@reactor-team/js-sdk 2.12.3 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1428 @@
1
+ /* @ts-self-types="./reactor_wasm.d.ts" */
2
+
3
+ /**
4
+ * The Reactor client, as JavaScript sees it.
5
+ *
6
+ * ```js
7
+ * import init, { ReactorClient } from "@reactor-team/reactor-wasm";
8
+ *
9
+ * await init();
10
+ * const client = new ReactorClient({ modelName: "my-model" }, () => getToken());
11
+ * client.onStatusChanged((status) => console.log(status));
12
+ * client.onTrackReceived((name, mid) => {
13
+ * video.srcObject = client.getStreamByMid(mid);
14
+ * });
15
+ * await client.connect();
16
+ * await client.sendCommand("set_prompt", { prompt: "a cat" });
17
+ * ```
18
+ */
19
+ export class ReactorClient {
20
+ __destroy_into_raw() {
21
+ const ptr = this.__wbg_ptr;
22
+ this.__wbg_ptr = 0;
23
+ ReactorClientFinalization.unregister(this);
24
+ return ptr;
25
+ }
26
+ free() {
27
+ const ptr = this.__destroy_into_raw();
28
+ wasm.__wbg_reactorclient_free(ptr, 0);
29
+ }
30
+ /**
31
+ * The runtime's capabilities, or `undefined` before they arrive.
32
+ * @returns {Capabilities | undefined}
33
+ */
34
+ capabilities() {
35
+ const ret = wasm.reactorclient_capabilities(this.__wbg_ptr);
36
+ if (ret[2]) {
37
+ throw takeFromExternrefTable0(ret[1]);
38
+ }
39
+ return takeFromExternrefTable0(ret[0]);
40
+ }
41
+ /**
42
+ * Create (or adopt) a session and bring up the transport.
43
+ * @param {ConnectOptions | null} [options]
44
+ * @returns {Promise<void>}
45
+ */
46
+ connect(options) {
47
+ const ret = wasm.reactorclient_connect(this.__wbg_ptr, isLikeNone(options) ? 0 : addToExternrefTable0(options));
48
+ return ret;
49
+ }
50
+ /**
51
+ * Tear down the transport and end the session server-side — unless this
52
+ * client only adopted the session, in which case it stays alive for
53
+ * whoever created it.
54
+ * @returns {Promise<void>}
55
+ */
56
+ disconnect() {
57
+ const ret = wasm.reactorclient_disconnect(this.__wbg_ptr);
58
+ return ret;
59
+ }
60
+ /**
61
+ * The live `RTCPeerConnection` — for `getStats()`, or anything else the
62
+ * binding does not wrap. `undefined` before the first connect.
63
+ * @returns {RTCPeerConnection | undefined}
64
+ */
65
+ getPeerConnection() {
66
+ const ret = wasm.reactorclient_getPeerConnection(this.__wbg_ptr);
67
+ return ret;
68
+ }
69
+ /**
70
+ * The `MediaStream` a received track arrived on — what a `<video>` or
71
+ * `<audio>` element's `srcObject` wants.
72
+ * @param {string} mid
73
+ * @returns {MediaStream | undefined}
74
+ */
75
+ getStreamByMid(mid) {
76
+ const ptr0 = passStringToWasm0(mid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
77
+ const len0 = WASM_VECTOR_LEN;
78
+ const ret = wasm.reactorclient_getStreamByMid(this.__wbg_ptr, ptr0, len0);
79
+ return ret;
80
+ }
81
+ /**
82
+ * The stream of a received track, by declared name.
83
+ * @param {string} name
84
+ * @returns {MediaStream | undefined}
85
+ */
86
+ getStreamByName(name) {
87
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
88
+ const len0 = WASM_VECTOR_LEN;
89
+ const ret = wasm.reactorclient_getStreamByName(this.__wbg_ptr, ptr0, len0);
90
+ return ret;
91
+ }
92
+ /**
93
+ * A received track by its SDP mid, as reported by `onTrackReceived`.
94
+ * @param {string} mid
95
+ * @returns {MediaStreamTrack | undefined}
96
+ */
97
+ getTrackByMid(mid) {
98
+ const ptr0 = passStringToWasm0(mid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
99
+ const len0 = WASM_VECTOR_LEN;
100
+ const ret = wasm.reactorclient_getTrackByMid(this.__wbg_ptr, ptr0, len0);
101
+ return ret;
102
+ }
103
+ /**
104
+ * A received track by its declared name.
105
+ *
106
+ * Useful when the track arrived before the listener was registered — a
107
+ * component that mounts mid-connect misses the event but not the track.
108
+ * @param {string} name
109
+ * @returns {MediaStreamTrack | undefined}
110
+ */
111
+ getTrackByName(name) {
112
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
113
+ const len0 = WASM_VECTOR_LEN;
114
+ const ret = wasm.reactorclient_getTrackByName(this.__wbg_ptr, ptr0, len0);
115
+ return ret;
116
+ }
117
+ /**
118
+ * The last error, in the shape the `onError` listener receives.
119
+ * @returns {ReactorError | undefined}
120
+ */
121
+ lastError() {
122
+ const ret = wasm.reactorclient_lastError(this.__wbg_ptr);
123
+ if (ret[2]) {
124
+ throw takeFromExternrefTable0(ret[1]);
125
+ }
126
+ return takeFromExternrefTable0(ret[0]);
127
+ }
128
+ /**
129
+ * Create a client.
130
+ *
131
+ * * `options` — see the `ClientOptions` fields; `modelName` is required.
132
+ * * `jwt` — a token string, a `() => string | Promise<string>` resolver
133
+ * called before every authenticated request, or `null` for an
134
+ * unauthenticated local runtime. Replaceable later with `setJwt`.
135
+ * @param {ClientOptions} options
136
+ * @param {JwtSource | null} [jwt]
137
+ */
138
+ constructor(options, jwt) {
139
+ const ret = wasm.reactorclient_new(options, isLikeNone(jwt) ? 0 : addToExternrefTable0(jwt));
140
+ if (ret[2]) {
141
+ throw takeFromExternrefTable0(ret[1]);
142
+ }
143
+ this.__wbg_ptr = ret[0];
144
+ ReactorClientFinalization.register(this, this.__wbg_ptr, this);
145
+ return this;
146
+ }
147
+ /**
148
+ * `(capabilities: { protocolVersion, tracks, commands? }) => void`
149
+ * @param {CapabilitiesListener} listener
150
+ */
151
+ onCapabilitiesReceived(listener) {
152
+ wasm.reactorclient_onCapabilitiesReceived(this.__wbg_ptr, listener);
153
+ }
154
+ /**
155
+ * `(error: { code, message, recoverable, timestampMs, status?, operation?,
156
+ * retryAfterMs? }) => void`
157
+ * @param {ErrorListener} listener
158
+ */
159
+ onError(listener) {
160
+ wasm.reactorclient_onError(this.__wbg_ptr, listener);
161
+ }
162
+ /**
163
+ * `(message: { type, data }) => void` — application messages from the model.
164
+ * @param {MessageListener} listener
165
+ */
166
+ onMessage(listener) {
167
+ wasm.reactorclient_onMessage(this.__wbg_ptr, listener);
168
+ }
169
+ /**
170
+ * `(message: { type, data }) => void` — platform messages: moderation,
171
+ * recording lifecycle, and the rest of the runtime's own traffic.
172
+ * @param {MessageListener} listener
173
+ */
174
+ onRuntimeMessage(listener) {
175
+ wasm.reactorclient_onRuntimeMessage(this.__wbg_ptr, listener);
176
+ }
177
+ /**
178
+ * `(sessionId: string | undefined) => void`
179
+ * @param {SessionIdListener} listener
180
+ */
181
+ onSessionIdChanged(listener) {
182
+ wasm.reactorclient_onSessionIdChanged(this.__wbg_ptr, listener);
183
+ }
184
+ /**
185
+ * `(status: string) => void`
186
+ * @param {StatusListener} listener
187
+ */
188
+ onStatusChanged(listener) {
189
+ wasm.reactorclient_onStatusChanged(this.__wbg_ptr, listener);
190
+ }
191
+ /**
192
+ * `(name: string, mid: string | undefined) => void` — a remote track
193
+ * arrived. Fetch the media with `getTrackByMid` / `getStreamByMid`.
194
+ * @param {TrackListener} listener
195
+ */
196
+ onTrackReceived(listener) {
197
+ wasm.reactorclient_onTrackReceived(this.__wbg_ptr, listener);
198
+ }
199
+ /**
200
+ * Stop receiving a track: the receiver goes inactive and the runtime stops
201
+ * producing it.
202
+ * @param {string} name
203
+ * @returns {Promise<void>}
204
+ */
205
+ pauseTrack(name) {
206
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
207
+ const len0 = WASM_VECTOR_LEN;
208
+ const ret = wasm.reactorclient_pauseTrack(this.__wbg_ptr, ptr0, len0);
209
+ return ret;
210
+ }
211
+ /**
212
+ * Names of the tracks currently paused.
213
+ * @returns {string[]}
214
+ */
215
+ pausedTracks() {
216
+ const ret = wasm.reactorclient_pausedTracks(this.__wbg_ptr);
217
+ if (ret[2]) {
218
+ throw takeFromExternrefTable0(ret[1]);
219
+ }
220
+ return takeFromExternrefTable0(ret[0]);
221
+ }
222
+ /**
223
+ * Claim a sendonly track and start sending `track` on it.
224
+ * @param {string} name
225
+ * @param {MediaStreamTrack} track
226
+ * @returns {Promise<void>}
227
+ */
228
+ publishTrack(name, track) {
229
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
230
+ const len0 = WASM_VECTOR_LEN;
231
+ const ret = wasm.reactorclient_publishTrack(this.__wbg_ptr, ptr0, len0, track);
232
+ return ret;
233
+ }
234
+ /**
235
+ * Rebuild the transport on the same session, without ending it.
236
+ *
237
+ * Only `maxAttempts` applies here — the rest of `ConnectOptions` (session
238
+ * adoption, connection id, auto-resume) only makes sense at initial
239
+ * connect time, same as the JS SDK's own `reconnect()` always ignored
240
+ * them.
241
+ * @param {ConnectOptions | null} [options]
242
+ * @returns {Promise<void>}
243
+ */
244
+ reconnect(options) {
245
+ const ret = wasm.reactorclient_reconnect(this.__wbg_ptr, isLikeNone(options) ? 0 : addToExternrefTable0(options));
246
+ return ret;
247
+ }
248
+ /**
249
+ * Capture the last `durationSeconds` of the session.
250
+ * @param {number} duration_seconds
251
+ * @returns {Promise<Clip>}
252
+ */
253
+ requestClip(duration_seconds) {
254
+ const ret = wasm.reactorclient_requestClip(this.__wbg_ptr, duration_seconds);
255
+ return ret;
256
+ }
257
+ /**
258
+ * Capture the session in full.
259
+ * @returns {Promise<Clip>}
260
+ */
261
+ requestRecording() {
262
+ const ret = wasm.reactorclient_requestRecording(this.__wbg_ptr);
263
+ return ret;
264
+ }
265
+ /**
266
+ * Request the model's command schema (an OpenAPI document).
267
+ * @returns {Promise<unknown>}
268
+ */
269
+ requestSchema() {
270
+ const ret = wasm.reactorclient_requestSchema(this.__wbg_ptr);
271
+ return ret;
272
+ }
273
+ /**
274
+ * Resume a paused track.
275
+ * @param {string} name
276
+ * @returns {Promise<void>}
277
+ */
278
+ resumeTrack(name) {
279
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
280
+ const len0 = WASM_VECTOR_LEN;
281
+ const ret = wasm.reactorclient_resumeTrack(this.__wbg_ptr, ptr0, len0);
282
+ return ret;
283
+ }
284
+ /**
285
+ * Send a command to the model and resolve with its reply.
286
+ *
287
+ * * `data` — a JSON-serializable object.
288
+ * * `uploads` — optional `{ param: FileRef }` map, from `uploadFile`.
289
+ *
290
+ * Resolves with `{ type, data }`, or `undefined` when the model's handler
291
+ * acknowledged the command without answering.
292
+ * @param {string} command
293
+ * @param {Record<string, unknown> | null} [data]
294
+ * @param {Record<string, FileRef> | null} [uploads]
295
+ * @returns {Promise<ReactorMessage | undefined>}
296
+ */
297
+ sendCommand(command, data, uploads) {
298
+ const ptr0 = passStringToWasm0(command, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
299
+ const len0 = WASM_VECTOR_LEN;
300
+ const ret = wasm.reactorclient_sendCommand(this.__wbg_ptr, ptr0, len0, isLikeNone(data) ? 0 : addToExternrefTable0(data), isLikeNone(uploads) ? 0 : addToExternrefTable0(uploads));
301
+ return ret;
302
+ }
303
+ /**
304
+ * The current session id, or `undefined`.
305
+ * @returns {string | undefined}
306
+ */
307
+ sessionId() {
308
+ const ret = wasm.reactorclient_sessionId(this.__wbg_ptr);
309
+ let v1;
310
+ if (ret[0] !== 0) {
311
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
312
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
313
+ }
314
+ return v1;
315
+ }
316
+ /**
317
+ * The session resource from the coordinator, or `undefined` when
318
+ * disconnected: model, cluster, server info, selected transport.
319
+ * @returns {SessionInfo | undefined}
320
+ */
321
+ sessionInfo() {
322
+ const ret = wasm.reactorclient_sessionInfo(this.__wbg_ptr);
323
+ if (ret[2]) {
324
+ throw takeFromExternrefTable0(ret[1]);
325
+ }
326
+ return takeFromExternrefTable0(ret[0]);
327
+ }
328
+ /**
329
+ * Replace the token source. Takes effect on the next request, so this is
330
+ * how a client built before sign-in gets its token.
331
+ * @param {JwtSource | null} [jwt]
332
+ */
333
+ setJwt(jwt) {
334
+ const ret = wasm.reactorclient_setJwt(this.__wbg_ptr, isLikeNone(jwt) ? 0 : addToExternrefTable0(jwt));
335
+ if (ret[1]) {
336
+ throw takeFromExternrefTable0(ret[0]);
337
+ }
338
+ }
339
+ /**
340
+ * `"disconnected"` | `"connecting"` | `"waiting"` | `"ready"`.
341
+ * @returns {ReactorStatus}
342
+ */
343
+ status() {
344
+ const ret = wasm.reactorclient_status(this.__wbg_ptr);
345
+ return ret;
346
+ }
347
+ /**
348
+ * The negotiated `name` → `mid` mapping: `[{ name, kind, direction, mid }]`.
349
+ * @returns {TrackMappingEntry[]}
350
+ */
351
+ trackMapping() {
352
+ const ret = wasm.reactorclient_trackMapping(this.__wbg_ptr);
353
+ if (ret[2]) {
354
+ throw takeFromExternrefTable0(ret[1]);
355
+ }
356
+ return takeFromExternrefTable0(ret[0]);
357
+ }
358
+ /**
359
+ * The tracks the runtime declared for this session:
360
+ * `[{ name, kind, direction }]`. Empty until capabilities arrive.
361
+ * @returns {TrackCapability[]}
362
+ */
363
+ tracks() {
364
+ const ret = wasm.reactorclient_tracks(this.__wbg_ptr);
365
+ if (ret[2]) {
366
+ throw takeFromExternrefTable0(ret[1]);
367
+ }
368
+ return takeFromExternrefTable0(ret[0]);
369
+ }
370
+ /**
371
+ * Stop sending on a published track and release it.
372
+ * @param {string} name
373
+ * @returns {Promise<void>}
374
+ */
375
+ unpublishTrack(name) {
376
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
377
+ const len0 = WASM_VECTOR_LEN;
378
+ const ret = wasm.reactorclient_unpublishTrack(this.__wbg_ptr, ptr0, len0);
379
+ return ret;
380
+ }
381
+ /**
382
+ * Upload a `File` or `Blob` to the session's object store and resolve with
383
+ * a `FileRef` to pass in a command's `uploads`.
384
+ *
385
+ * `name` overrides the file name; a `Blob` has none, so it needs one.
386
+ * @param {Blob} file
387
+ * @param {string | null} [name]
388
+ * @returns {Promise<FileRef>}
389
+ */
390
+ uploadFile(file, name) {
391
+ var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
392
+ var len0 = WASM_VECTOR_LEN;
393
+ const ret = wasm.reactorclient_uploadFile(this.__wbg_ptr, file, ptr0, len0);
394
+ return ret;
395
+ }
396
+ }
397
+ if (Symbol.dispose) ReactorClient.prototype[Symbol.dispose] = ReactorClient.prototype.free;
398
+ function __wbg_get_imports() {
399
+ const import0 = {
400
+ __proto__: null,
401
+ __wbg_Error_92b29b0548f8b746: function(arg0, arg1) {
402
+ const ret = Error(getStringFromWasm0(arg0, arg1));
403
+ return ret;
404
+ },
405
+ __wbg_Number_9a4e0ecb0fa16705: function(arg0) {
406
+ const ret = Number(arg0);
407
+ return ret;
408
+ },
409
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
410
+ const ret = String(arg1);
411
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
412
+ const len1 = WASM_VECTOR_LEN;
413
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
414
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
415
+ },
416
+ __wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f: function(arg0, arg1) {
417
+ const v = arg1;
418
+ const ret = typeof(v) === 'bigint' ? v : undefined;
419
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
420
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
421
+ },
422
+ __wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
423
+ const v = arg0;
424
+ const ret = typeof(v) === 'boolean' ? v : undefined;
425
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
426
+ },
427
+ __wbg___wbindgen_debug_string_c25d447a39f5578f: function(arg0, arg1) {
428
+ const ret = debugString(arg1);
429
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
430
+ const len1 = WASM_VECTOR_LEN;
431
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
432
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
433
+ },
434
+ __wbg___wbindgen_in_aca499c5de7ff5e5: function(arg0, arg1) {
435
+ const ret = arg0 in arg1;
436
+ return ret;
437
+ },
438
+ __wbg___wbindgen_is_bigint_2f76dc55065b4273: function(arg0) {
439
+ const ret = typeof(arg0) === 'bigint';
440
+ return ret;
441
+ },
442
+ __wbg___wbindgen_is_function_1ff95bcc5517c252: function(arg0) {
443
+ const ret = typeof(arg0) === 'function';
444
+ return ret;
445
+ },
446
+ __wbg___wbindgen_is_null_ea9085d691f535d3: function(arg0) {
447
+ const ret = arg0 === null;
448
+ return ret;
449
+ },
450
+ __wbg___wbindgen_is_object_a27215656b807791: function(arg0) {
451
+ const val = arg0;
452
+ const ret = typeof(val) === 'object' && val !== null;
453
+ return ret;
454
+ },
455
+ __wbg___wbindgen_is_string_ea5e6cc2e4141dfe: function(arg0) {
456
+ const ret = typeof(arg0) === 'string';
457
+ return ret;
458
+ },
459
+ __wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
460
+ const ret = arg0 === undefined;
461
+ return ret;
462
+ },
463
+ __wbg___wbindgen_jsval_eq_e659fcf7b0e32763: function(arg0, arg1) {
464
+ const ret = arg0 === arg1;
465
+ return ret;
466
+ },
467
+ __wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170: function(arg0, arg1) {
468
+ const ret = arg0 == arg1;
469
+ return ret;
470
+ },
471
+ __wbg___wbindgen_number_get_394265ed1e1b84ee: function(arg0, arg1) {
472
+ const obj = arg1;
473
+ const ret = typeof(obj) === 'number' ? obj : undefined;
474
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
475
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
476
+ },
477
+ __wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
478
+ const obj = arg1;
479
+ const ret = typeof(obj) === 'string' ? obj : undefined;
480
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
481
+ var len1 = WASM_VECTOR_LEN;
482
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
483
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
484
+ },
485
+ __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
486
+ throw new Error(getStringFromWasm0(arg0, arg1));
487
+ },
488
+ __wbg__wbg_cb_unref_fffb441def202758: function(arg0) {
489
+ arg0._wbg_cb_unref();
490
+ },
491
+ __wbg_addTransceiver_ace2a0d9fb04ce1b: function(arg0, arg1, arg2, arg3) {
492
+ const ret = arg0.addTransceiver(getStringFromWasm0(arg1, arg2), arg3);
493
+ return ret;
494
+ },
495
+ __wbg_apply_23dd4d2439189415: function() { return handleError(function (arg0, arg1, arg2) {
496
+ const ret = Reflect.apply(arg0, arg1, arg2);
497
+ return ret;
498
+ }, arguments); },
499
+ __wbg_arrayBuffer_3b637f0fa65c5351: function() { return handleError(function (arg0) {
500
+ const ret = arg0.arrayBuffer();
501
+ return ret;
502
+ }, arguments); },
503
+ __wbg_arrayBuffer_a158e423a87ee756: function(arg0) {
504
+ const ret = arg0.arrayBuffer();
505
+ return ret;
506
+ },
507
+ __wbg_assign_fd82cd5b89efb160: function(arg0, arg1) {
508
+ const ret = Object.assign(arg0, arg1);
509
+ return ret;
510
+ },
511
+ __wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
512
+ const ret = arg0.call(arg1);
513
+ return ret;
514
+ }, arguments); },
515
+ __wbg_call_a6e5c5dce5018821: function() { return handleError(function (arg0, arg1, arg2) {
516
+ const ret = arg0.call(arg1, arg2);
517
+ return ret;
518
+ }, arguments); },
519
+ __wbg_candidate_c03bb5d81bec0300: function(arg0) {
520
+ const ret = arg0.candidate;
521
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
522
+ },
523
+ __wbg_candidate_f7f684cdcc2dfa01: function(arg0, arg1) {
524
+ const ret = arg1.candidate;
525
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
526
+ const len1 = WASM_VECTOR_LEN;
527
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
528
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
529
+ },
530
+ __wbg_clone_6e4daf4fc3007688: function(arg0) {
531
+ const ret = arg0.clone();
532
+ return ret;
533
+ },
534
+ __wbg_close_b52db0582c2d1ef9: function(arg0) {
535
+ arg0.close();
536
+ },
537
+ __wbg_close_c1dc24d72ecf36bf: function(arg0) {
538
+ arg0.close();
539
+ },
540
+ __wbg_connectionState_8f907dbcbcdb52e9: function(arg0) {
541
+ const ret = arg0.connectionState;
542
+ return (__wbindgen_enum_RtcPeerConnectionState.indexOf(ret) + 1 || 7) - 1;
543
+ },
544
+ __wbg_createDataChannel_c6d560e9b1225d62: function(arg0, arg1, arg2) {
545
+ const ret = arg0.createDataChannel(getStringFromWasm0(arg1, arg2));
546
+ return ret;
547
+ },
548
+ __wbg_createOffer_bf4e8d6b4b5cea92: function(arg0) {
549
+ const ret = arg0.createOffer();
550
+ return ret;
551
+ },
552
+ __wbg_data_328de4280640da92: function(arg0) {
553
+ const ret = arg0.data;
554
+ return ret;
555
+ },
556
+ __wbg_debug_87fd9b1a625b7efb: function(arg0) {
557
+ console.debug(arg0);
558
+ },
559
+ __wbg_done_89b2b13e91a60321: function(arg0) {
560
+ const ret = arg0.done;
561
+ return ret;
562
+ },
563
+ __wbg_entries_015dc610cd81ede0: function(arg0) {
564
+ const ret = Object.entries(arg0);
565
+ return ret;
566
+ },
567
+ __wbg_error_744744ff0c9861e6: function(arg0) {
568
+ console.error(arg0);
569
+ },
570
+ __wbg_fetch_6ecc661950e58d49: function(arg0, arg1) {
571
+ const ret = arg0.fetch(arg1);
572
+ return ret;
573
+ },
574
+ __wbg_fetch_b5951fc96f52f786: function(arg0, arg1) {
575
+ const ret = arg0.fetch(arg1);
576
+ return ret;
577
+ },
578
+ __wbg_get_507a50627bffa49b: function(arg0, arg1) {
579
+ const ret = arg0[arg1 >>> 0];
580
+ return ret;
581
+ },
582
+ __wbg_get_78f252d074a84d0b: function() { return handleError(function (arg0, arg1) {
583
+ const ret = Reflect.get(arg0, arg1);
584
+ return ret;
585
+ }, arguments); },
586
+ __wbg_get_c7eb1f358a7654df: function() { return handleError(function (arg0, arg1) {
587
+ const ret = Reflect.get(arg0, arg1);
588
+ return ret;
589
+ }, arguments); },
590
+ __wbg_get_unchecked_6e0ad6d2a41b06f6: function(arg0, arg1) {
591
+ const ret = arg0[arg1 >>> 0];
592
+ return ret;
593
+ },
594
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
595
+ const ret = arg0[arg1];
596
+ return ret;
597
+ },
598
+ __wbg_headers_cf9c80f30e2a4eff: function(arg0) {
599
+ const ret = arg0.headers;
600
+ return ret;
601
+ },
602
+ __wbg_info_eadbe775a8e2e9eb: function(arg0) {
603
+ console.info(arg0);
604
+ },
605
+ __wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
606
+ let result;
607
+ try {
608
+ result = arg0 instanceof ArrayBuffer;
609
+ } catch (_) {
610
+ result = false;
611
+ }
612
+ const ret = result;
613
+ return ret;
614
+ },
615
+ __wbg_instanceof_Error_1fdac9f13a8181ba: function(arg0) {
616
+ let result;
617
+ try {
618
+ result = arg0 instanceof Error;
619
+ } catch (_) {
620
+ result = false;
621
+ }
622
+ const ret = result;
623
+ return ret;
624
+ },
625
+ __wbg_instanceof_File_ee62de53bca2e697: function(arg0) {
626
+ let result;
627
+ try {
628
+ result = arg0 instanceof File;
629
+ } catch (_) {
630
+ result = false;
631
+ }
632
+ const ret = result;
633
+ return ret;
634
+ },
635
+ __wbg_instanceof_Map_e5b5e3db98422fcc: function(arg0) {
636
+ let result;
637
+ try {
638
+ result = arg0 instanceof Map;
639
+ } catch (_) {
640
+ result = false;
641
+ }
642
+ const ret = result;
643
+ return ret;
644
+ },
645
+ __wbg_instanceof_MediaStream_acbfd121c4db2b74: function(arg0) {
646
+ let result;
647
+ try {
648
+ result = arg0 instanceof MediaStream;
649
+ } catch (_) {
650
+ result = false;
651
+ }
652
+ const ret = result;
653
+ return ret;
654
+ },
655
+ __wbg_instanceof_Object_33f20e6f12439f3e: function(arg0) {
656
+ let result;
657
+ try {
658
+ result = arg0 instanceof Object;
659
+ } catch (_) {
660
+ result = false;
661
+ }
662
+ const ret = result;
663
+ return ret;
664
+ },
665
+ __wbg_instanceof_Promise_4cb210c0b8f8c959: function(arg0) {
666
+ let result;
667
+ try {
668
+ result = arg0 instanceof Promise;
669
+ } catch (_) {
670
+ result = false;
671
+ }
672
+ const ret = result;
673
+ return ret;
674
+ },
675
+ __wbg_instanceof_Response_c8b64b2256f01bec: function(arg0) {
676
+ let result;
677
+ try {
678
+ result = arg0 instanceof Response;
679
+ } catch (_) {
680
+ result = false;
681
+ }
682
+ const ret = result;
683
+ return ret;
684
+ },
685
+ __wbg_instanceof_Uint8Array_309b927aaf7a3fc7: function(arg0) {
686
+ let result;
687
+ try {
688
+ result = arg0 instanceof Uint8Array;
689
+ } catch (_) {
690
+ result = false;
691
+ }
692
+ const ret = result;
693
+ return ret;
694
+ },
695
+ __wbg_instanceof_Window_05ba1ee4f6781663: function(arg0) {
696
+ let result;
697
+ try {
698
+ result = arg0 instanceof Window;
699
+ } catch (_) {
700
+ result = false;
701
+ }
702
+ const ret = result;
703
+ return ret;
704
+ },
705
+ __wbg_instanceof_WorkerGlobalScope_8ec07b5e040a41c3: function(arg0) {
706
+ let result;
707
+ try {
708
+ result = arg0 instanceof WorkerGlobalScope;
709
+ } catch (_) {
710
+ result = false;
711
+ }
712
+ const ret = result;
713
+ return ret;
714
+ },
715
+ __wbg_isArray_0677c962b281d01a: function(arg0) {
716
+ const ret = Array.isArray(arg0);
717
+ return ret;
718
+ },
719
+ __wbg_isSafeInteger_04f36e4056f1b851: function(arg0) {
720
+ const ret = Number.isSafeInteger(arg0);
721
+ return ret;
722
+ },
723
+ __wbg_iterator_6f722e4a93058b71: function() {
724
+ const ret = Symbol.iterator;
725
+ return ret;
726
+ },
727
+ __wbg_length_1f0964f4a5e2c6d8: function(arg0) {
728
+ const ret = arg0.length;
729
+ return ret;
730
+ },
731
+ __wbg_length_370319915dc99107: function(arg0) {
732
+ const ret = arg0.length;
733
+ return ret;
734
+ },
735
+ __wbg_log_d267660666346fb3: function(arg0) {
736
+ console.log(arg0);
737
+ },
738
+ __wbg_message_8326fb1d549bebc5: function(arg0) {
739
+ const ret = arg0.message;
740
+ return ret;
741
+ },
742
+ __wbg_mid_6671271dd2f9460f: function(arg0, arg1) {
743
+ const ret = arg1.mid;
744
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
745
+ var len1 = WASM_VECTOR_LEN;
746
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
747
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
748
+ },
749
+ __wbg_name_d7d79f5466e37447: function(arg0, arg1) {
750
+ const ret = arg1.name;
751
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
752
+ const len1 = WASM_VECTOR_LEN;
753
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
754
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
755
+ },
756
+ __wbg_new_0d809930cd1354c6: function() { return handleError(function () {
757
+ const ret = new Headers();
758
+ return ret;
759
+ }, arguments); },
760
+ __wbg_new_32b398fb48b6d94a: function() {
761
+ const ret = new Array();
762
+ return ret;
763
+ },
764
+ __wbg_new_7796ffc7ed656783: function() {
765
+ const ret = new Map();
766
+ return ret;
767
+ },
768
+ __wbg_new_aec3e25493d729fe: function(arg0, arg1) {
769
+ try {
770
+ var state0 = {a: arg0, b: arg1};
771
+ var cb0 = (arg0, arg1) => {
772
+ const a = state0.a;
773
+ state0.a = 0;
774
+ try {
775
+ return wasm_bindgen_85f920685b213f97___convert__closures_____invoke___js_sys_17f5e83adf9a2bda___Function_fn_wasm_bindgen_85f920685b213f97___JsValue_____wasm_bindgen_85f920685b213f97___sys__Undefined___js_sys_17f5e83adf9a2bda___Function_fn_wasm_bindgen_85f920685b213f97___JsValue_____wasm_bindgen_85f920685b213f97___sys__Undefined_______true_(a, state0.b, arg0, arg1);
776
+ } finally {
777
+ state0.a = a;
778
+ }
779
+ };
780
+ const ret = new Promise(cb0);
781
+ return ret;
782
+ } finally {
783
+ state0.a = 0;
784
+ }
785
+ },
786
+ __wbg_new_b667d279fd5aa943: function(arg0, arg1) {
787
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
788
+ return ret;
789
+ },
790
+ __wbg_new_cd45aabdf6073e84: function(arg0) {
791
+ const ret = new Uint8Array(arg0);
792
+ return ret;
793
+ },
794
+ __wbg_new_da52cf8fe3429cb2: function() {
795
+ const ret = new Object();
796
+ return ret;
797
+ },
798
+ __wbg_new_from_slice_77cdfb7977362f3c: function(arg0, arg1) {
799
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
800
+ return ret;
801
+ },
802
+ __wbg_new_typed_1824d93f294193e5: function(arg0, arg1) {
803
+ try {
804
+ var state0 = {a: arg0, b: arg1};
805
+ var cb0 = (arg0, arg1) => {
806
+ const a = state0.a;
807
+ state0.a = 0;
808
+ try {
809
+ return wasm_bindgen_85f920685b213f97___convert__closures_____invoke___js_sys_17f5e83adf9a2bda___Function_fn_wasm_bindgen_85f920685b213f97___JsValue_____wasm_bindgen_85f920685b213f97___sys__Undefined___js_sys_17f5e83adf9a2bda___Function_fn_wasm_bindgen_85f920685b213f97___JsValue_____wasm_bindgen_85f920685b213f97___sys__Undefined_______true_(a, state0.b, arg0, arg1);
810
+ } finally {
811
+ state0.a = a;
812
+ }
813
+ };
814
+ const ret = new Promise(cb0);
815
+ return ret;
816
+ } finally {
817
+ state0.a = 0;
818
+ }
819
+ },
820
+ __wbg_new_with_configuration_40ac01bf87e5584e: function() { return handleError(function (arg0) {
821
+ const ret = new RTCPeerConnection(arg0);
822
+ return ret;
823
+ }, arguments); },
824
+ __wbg_new_with_str_and_init_d95cbe11ce28e65e: function() { return handleError(function (arg0, arg1, arg2) {
825
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
826
+ return ret;
827
+ }, arguments); },
828
+ __wbg_new_with_tracks_6fa81eb205e387c7: function() { return handleError(function (arg0) {
829
+ const ret = new MediaStream(arg0);
830
+ return ret;
831
+ }, arguments); },
832
+ __wbg_next_6dbf2c0ac8cde20f: function(arg0) {
833
+ const ret = arg0.next;
834
+ return ret;
835
+ },
836
+ __wbg_next_71f2aa1cb3d1e37e: function() { return handleError(function (arg0) {
837
+ const ret = arg0.next();
838
+ return ret;
839
+ }, arguments); },
840
+ __wbg_now_86c0d4ba3fa605b8: function() {
841
+ const ret = Date.now();
842
+ return ret;
843
+ },
844
+ __wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
845
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
846
+ },
847
+ __wbg_push_d2ae3af0c1217ae6: function(arg0, arg1) {
848
+ const ret = arg0.push(arg1);
849
+ return ret;
850
+ },
851
+ __wbg_queueMicrotask_0ab5b2d2393e99b9: function(arg0) {
852
+ const ret = arg0.queueMicrotask;
853
+ return ret;
854
+ },
855
+ __wbg_queueMicrotask_6a09b7bc46549209: function(arg0) {
856
+ queueMicrotask(arg0);
857
+ },
858
+ __wbg_replaceTrack_19163bddac4709c8: function(arg0, arg1) {
859
+ const ret = arg0.replaceTrack(arg1);
860
+ return ret;
861
+ },
862
+ __wbg_resolve_2191a4dfe481c25b: function(arg0) {
863
+ const ret = Promise.resolve(arg0);
864
+ return ret;
865
+ },
866
+ __wbg_sdpMLineIndex_25f34f297ced702a: function(arg0) {
867
+ const ret = arg0.sdpMLineIndex;
868
+ return isLikeNone(ret) ? 0xFFFFFF : ret;
869
+ },
870
+ __wbg_sdpMid_d3e98f8b4c29e5d9: function(arg0, arg1) {
871
+ const ret = arg1.sdpMid;
872
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
873
+ var len1 = WASM_VECTOR_LEN;
874
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
875
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
876
+ },
877
+ __wbg_send_5ebf3f8153c59081: function() { return handleError(function (arg0, arg1, arg2) {
878
+ arg0.send(getArrayU8FromWasm0(arg1, arg2));
879
+ }, arguments); },
880
+ __wbg_send_632c4452a512b363: function() { return handleError(function (arg0, arg1, arg2) {
881
+ arg0.send(getStringFromWasm0(arg1, arg2));
882
+ }, arguments); },
883
+ __wbg_sender_5d92a74ad2840ee0: function(arg0) {
884
+ const ret = arg0.sender;
885
+ return ret;
886
+ },
887
+ __wbg_setLocalDescription_423abfc919239ddf: function(arg0, arg1) {
888
+ const ret = arg0.setLocalDescription(arg1);
889
+ return ret;
890
+ },
891
+ __wbg_setRemoteDescription_921ff9a4233c90c7: function(arg0, arg1) {
892
+ const ret = arg0.setRemoteDescription(arg1);
893
+ return ret;
894
+ },
895
+ __wbg_setTimeout_6928223bf8fbd91a: function() { return handleError(function (arg0, arg1, arg2) {
896
+ const ret = arg0.setTimeout(arg1, arg2);
897
+ return ret;
898
+ }, arguments); },
899
+ __wbg_setTimeout_cfa2cf195c3738db: function() { return handleError(function (arg0, arg1, arg2) {
900
+ const ret = arg0.setTimeout(arg1, arg2);
901
+ return ret;
902
+ }, arguments); },
903
+ __wbg_set_0de9c62c23d04ad5: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
904
+ arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
905
+ }, arguments); },
906
+ __wbg_set_575dd786d51585f8: function(arg0, arg1, arg2) {
907
+ const ret = arg0.set(arg1, arg2);
908
+ return ret;
909
+ },
910
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
911
+ arg0[arg1] = arg2;
912
+ },
913
+ __wbg_set_8535240470bf2500: function() { return handleError(function (arg0, arg1, arg2) {
914
+ const ret = Reflect.set(arg0, arg1, arg2);
915
+ return ret;
916
+ }, arguments); },
917
+ __wbg_set_8a16b38e4805b298: function(arg0, arg1, arg2) {
918
+ arg0[arg1 >>> 0] = arg2;
919
+ },
920
+ __wbg_set_binaryType_3d0ba17e56989d16: function(arg0, arg1) {
921
+ arg0.binaryType = __wbindgen_enum_RtcDataChannelType[arg1];
922
+ },
923
+ __wbg_set_body_029f2d171e0a005f: function(arg0, arg1) {
924
+ arg0.body = arg1;
925
+ },
926
+ __wbg_set_direction_1d775b49d9a3508b: function(arg0, arg1) {
927
+ arg0.direction = __wbindgen_enum_RtcRtpTransceiverDirection[arg1];
928
+ },
929
+ __wbg_set_direction_baa4f2e93edf734f: function(arg0, arg1) {
930
+ arg0.direction = __wbindgen_enum_RtcRtpTransceiverDirection[arg1];
931
+ },
932
+ __wbg_set_headers_9c61d123c3ee1f10: function(arg0, arg1) {
933
+ arg0.headers = arg1;
934
+ },
935
+ __wbg_set_method_5532d59b92d76467: function(arg0, arg1, arg2) {
936
+ arg0.method = getStringFromWasm0(arg1, arg2);
937
+ },
938
+ __wbg_set_name_3bbc583faefa4193: function(arg0, arg1, arg2) {
939
+ arg0.name = getStringFromWasm0(arg1, arg2);
940
+ },
941
+ __wbg_set_onconnectionstatechange_993320a2febaef9b: function(arg0, arg1) {
942
+ arg0.onconnectionstatechange = arg1;
943
+ },
944
+ __wbg_set_onicecandidate_0fd31ace2f760bf0: function(arg0, arg1) {
945
+ arg0.onicecandidate = arg1;
946
+ },
947
+ __wbg_set_onmessage_5b4754d6f18ffa95: function(arg0, arg1) {
948
+ arg0.onmessage = arg1;
949
+ },
950
+ __wbg_set_onopen_8994b7ffb0ef2792: function(arg0, arg1) {
951
+ arg0.onopen = arg1;
952
+ },
953
+ __wbg_set_ontrack_32cae4df6350f244: function(arg0, arg1) {
954
+ arg0.ontrack = arg1;
955
+ },
956
+ __wbg_set_sdp_de28f5c5c5b94fcb: function(arg0, arg1, arg2) {
957
+ arg0.sdp = getStringFromWasm0(arg1, arg2);
958
+ },
959
+ __wbg_set_type_0a410d31ee19e04c: function(arg0, arg1) {
960
+ arg0.type = __wbindgen_enum_RtcSdpType[arg1];
961
+ },
962
+ __wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
963
+ const ret = typeof global === 'undefined' ? null : global;
964
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
965
+ },
966
+ __wbg_static_accessor_GLOBAL_THIS_8d1badc68b5a74f4: function() {
967
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
968
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
969
+ },
970
+ __wbg_static_accessor_SELF_146583524fe1469b: function() {
971
+ const ret = typeof self === 'undefined' ? null : self;
972
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
973
+ },
974
+ __wbg_static_accessor_WINDOW_f2829a2234d7819e: function() {
975
+ const ret = typeof window === 'undefined' ? null : window;
976
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
977
+ },
978
+ __wbg_status_c45b3b9b3033184a: function(arg0) {
979
+ const ret = arg0.status;
980
+ return ret;
981
+ },
982
+ __wbg_streams_6e4af1bfd97a39c8: function(arg0) {
983
+ const ret = arg0.streams;
984
+ return ret;
985
+ },
986
+ __wbg_stringify_b54333f60f1e4dad: function() { return handleError(function (arg0) {
987
+ const ret = JSON.stringify(arg0);
988
+ return ret;
989
+ }, arguments); },
990
+ __wbg_then_16d107c451e9905d: function(arg0, arg1, arg2) {
991
+ const ret = arg0.then(arg1, arg2);
992
+ return ret;
993
+ },
994
+ __wbg_then_6ec10ae38b3e92f7: function(arg0, arg1) {
995
+ const ret = arg0.then(arg1);
996
+ return ret;
997
+ },
998
+ __wbg_track_2ee1f18714999962: function(arg0) {
999
+ const ret = arg0.track;
1000
+ return ret;
1001
+ },
1002
+ __wbg_transceiver_04de1db3c684bea5: function(arg0) {
1003
+ const ret = arg0.transceiver;
1004
+ return ret;
1005
+ },
1006
+ __wbg_type_06f2150affb3c059: function(arg0, arg1) {
1007
+ const ret = arg1.type;
1008
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1009
+ const len1 = WASM_VECTOR_LEN;
1010
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1011
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1012
+ },
1013
+ __wbg_value_a5d5488a9589444a: function(arg0) {
1014
+ const ret = arg0.value;
1015
+ return ret;
1016
+ },
1017
+ __wbg_warn_b1370d804fa3e259: function(arg0) {
1018
+ console.warn(arg0);
1019
+ },
1020
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1021
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 278, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1022
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_85f920685b213f97___convert__closures_____invoke___wasm_bindgen_85f920685b213f97___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_85f920685b213f97___JsError___true_);
1023
+ return ret;
1024
+ },
1025
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
1026
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 125, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1027
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_43688100395f4fe3___features__gen_MessageEvent__MessageEvent______true_);
1028
+ return ret;
1029
+ },
1030
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
1031
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("RTCPeerConnectionIceEvent")], shim_idx: 125, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1032
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_43688100395f4fe3___features__gen_MessageEvent__MessageEvent______true__2);
1033
+ return ret;
1034
+ },
1035
+ __wbindgen_cast_0000000000000004: function(arg0, arg1) {
1036
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("RTCTrackEvent")], shim_idx: 125, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1037
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_43688100395f4fe3___features__gen_MessageEvent__MessageEvent______true__3);
1038
+ return ret;
1039
+ },
1040
+ __wbindgen_cast_0000000000000005: function(arg0, arg1) {
1041
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 129, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1042
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_85f920685b213f97___convert__closures_____invoke_______true_);
1043
+ return ret;
1044
+ },
1045
+ __wbindgen_cast_0000000000000006: function(arg0) {
1046
+ // Cast intrinsic for `F64 -> Externref`.
1047
+ const ret = arg0;
1048
+ return ret;
1049
+ },
1050
+ __wbindgen_cast_0000000000000007: function(arg0) {
1051
+ // Cast intrinsic for `I64 -> Externref`.
1052
+ const ret = arg0;
1053
+ return ret;
1054
+ },
1055
+ __wbindgen_cast_0000000000000008: function(arg0, arg1) {
1056
+ // Cast intrinsic for `Ref(String) -> Externref`.
1057
+ const ret = getStringFromWasm0(arg0, arg1);
1058
+ return ret;
1059
+ },
1060
+ __wbindgen_cast_0000000000000009: function(arg0) {
1061
+ // Cast intrinsic for `U64 -> Externref`.
1062
+ const ret = BigInt.asUintN(64, arg0);
1063
+ return ret;
1064
+ },
1065
+ __wbindgen_init_externref_table: function() {
1066
+ const table = wasm.__wbindgen_externrefs;
1067
+ const offset = table.grow(4);
1068
+ table.set(0, undefined);
1069
+ table.set(offset + 0, undefined);
1070
+ table.set(offset + 1, null);
1071
+ table.set(offset + 2, true);
1072
+ table.set(offset + 3, false);
1073
+ },
1074
+ };
1075
+ return {
1076
+ __proto__: null,
1077
+ "./reactor_wasm_bg.js": import0,
1078
+ };
1079
+ }
1080
+
1081
+ function wasm_bindgen_85f920685b213f97___convert__closures_____invoke_______true_(arg0, arg1) {
1082
+ wasm.wasm_bindgen_85f920685b213f97___convert__closures_____invoke_______true_(arg0, arg1);
1083
+ }
1084
+
1085
+ function wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_43688100395f4fe3___features__gen_MessageEvent__MessageEvent______true_(arg0, arg1, arg2) {
1086
+ wasm.wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_43688100395f4fe3___features__gen_MessageEvent__MessageEvent______true_(arg0, arg1, arg2);
1087
+ }
1088
+
1089
+ function wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_43688100395f4fe3___features__gen_MessageEvent__MessageEvent______true__2(arg0, arg1, arg2) {
1090
+ wasm.wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_43688100395f4fe3___features__gen_MessageEvent__MessageEvent______true__2(arg0, arg1, arg2);
1091
+ }
1092
+
1093
+ function wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_43688100395f4fe3___features__gen_MessageEvent__MessageEvent______true__3(arg0, arg1, arg2) {
1094
+ wasm.wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_43688100395f4fe3___features__gen_MessageEvent__MessageEvent______true__3(arg0, arg1, arg2);
1095
+ }
1096
+
1097
+ function wasm_bindgen_85f920685b213f97___convert__closures_____invoke___wasm_bindgen_85f920685b213f97___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_85f920685b213f97___JsError___true_(arg0, arg1, arg2) {
1098
+ const ret = wasm.wasm_bindgen_85f920685b213f97___convert__closures_____invoke___wasm_bindgen_85f920685b213f97___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_85f920685b213f97___JsError___true_(arg0, arg1, arg2);
1099
+ if (ret[1]) {
1100
+ throw takeFromExternrefTable0(ret[0]);
1101
+ }
1102
+ }
1103
+
1104
+ function wasm_bindgen_85f920685b213f97___convert__closures_____invoke___js_sys_17f5e83adf9a2bda___Function_fn_wasm_bindgen_85f920685b213f97___JsValue_____wasm_bindgen_85f920685b213f97___sys__Undefined___js_sys_17f5e83adf9a2bda___Function_fn_wasm_bindgen_85f920685b213f97___JsValue_____wasm_bindgen_85f920685b213f97___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
1105
+ wasm.wasm_bindgen_85f920685b213f97___convert__closures_____invoke___js_sys_17f5e83adf9a2bda___Function_fn_wasm_bindgen_85f920685b213f97___JsValue_____wasm_bindgen_85f920685b213f97___sys__Undefined___js_sys_17f5e83adf9a2bda___Function_fn_wasm_bindgen_85f920685b213f97___JsValue_____wasm_bindgen_85f920685b213f97___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
1106
+ }
1107
+
1108
+
1109
+ const __wbindgen_enum_RtcDataChannelType = ["arraybuffer", "blob"];
1110
+
1111
+
1112
+ const __wbindgen_enum_RtcPeerConnectionState = ["closed", "failed", "disconnected", "new", "connecting", "connected"];
1113
+
1114
+
1115
+ const __wbindgen_enum_RtcRtpTransceiverDirection = ["sendrecv", "sendonly", "recvonly", "inactive", "stopped"];
1116
+
1117
+
1118
+ const __wbindgen_enum_RtcSdpType = ["offer", "pranswer", "answer", "rollback"];
1119
+ const ReactorClientFinalization = (typeof FinalizationRegistry === 'undefined')
1120
+ ? { register: () => {}, unregister: () => {} }
1121
+ : new FinalizationRegistry(ptr => wasm.__wbg_reactorclient_free(ptr, 1));
1122
+
1123
+ function addToExternrefTable0(obj) {
1124
+ const idx = wasm.__externref_table_alloc();
1125
+ wasm.__wbindgen_externrefs.set(idx, obj);
1126
+ return idx;
1127
+ }
1128
+
1129
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
1130
+ ? { register: () => {}, unregister: () => {} }
1131
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
1132
+
1133
+ function debugString(val) {
1134
+ // primitive types
1135
+ const type = typeof val;
1136
+ if (type == 'number' || type == 'boolean' || val == null) {
1137
+ return `${val}`;
1138
+ }
1139
+ if (type == 'string') {
1140
+ return `"${val}"`;
1141
+ }
1142
+ if (type == 'symbol') {
1143
+ const description = val.description;
1144
+ if (description == null) {
1145
+ return 'Symbol';
1146
+ } else {
1147
+ return `Symbol(${description})`;
1148
+ }
1149
+ }
1150
+ if (type == 'function') {
1151
+ const name = val.name;
1152
+ if (typeof name == 'string' && name.length > 0) {
1153
+ return `Function(${name})`;
1154
+ } else {
1155
+ return 'Function';
1156
+ }
1157
+ }
1158
+ // objects
1159
+ if (Array.isArray(val)) {
1160
+ const length = val.length;
1161
+ let debug = '[';
1162
+ if (length > 0) {
1163
+ debug += debugString(val[0]);
1164
+ }
1165
+ for(let i = 1; i < length; i++) {
1166
+ debug += ', ' + debugString(val[i]);
1167
+ }
1168
+ debug += ']';
1169
+ return debug;
1170
+ }
1171
+ // Test for built-in
1172
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1173
+ let className;
1174
+ if (builtInMatches && builtInMatches.length > 1) {
1175
+ className = builtInMatches[1];
1176
+ } else {
1177
+ // Failed to match the standard '[object ClassName]'
1178
+ return toString.call(val);
1179
+ }
1180
+ if (className == 'Object') {
1181
+ // we're a user defined class or Object
1182
+ // JSON.stringify avoids problems with cycles, and is generally much
1183
+ // easier than looping through ownProperties of `val`.
1184
+ try {
1185
+ return 'Object(' + JSON.stringify(val) + ')';
1186
+ } catch (_) {
1187
+ return 'Object';
1188
+ }
1189
+ }
1190
+ // errors
1191
+ if (val instanceof Error) {
1192
+ return `${val.name}: ${val.message}\n${val.stack}`;
1193
+ }
1194
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1195
+ return className;
1196
+ }
1197
+
1198
+ function getArrayU8FromWasm0(ptr, len) {
1199
+ ptr = ptr >>> 0;
1200
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1201
+ }
1202
+
1203
+ let cachedDataViewMemory0 = null;
1204
+ function getDataViewMemory0() {
1205
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1206
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1207
+ }
1208
+ return cachedDataViewMemory0;
1209
+ }
1210
+
1211
+ function getStringFromWasm0(ptr, len) {
1212
+ return decodeText(ptr >>> 0, len);
1213
+ }
1214
+
1215
+ let cachedUint8ArrayMemory0 = null;
1216
+ function getUint8ArrayMemory0() {
1217
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1218
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1219
+ }
1220
+ return cachedUint8ArrayMemory0;
1221
+ }
1222
+
1223
+ function handleError(f, args) {
1224
+ try {
1225
+ return f.apply(this, args);
1226
+ } catch (e) {
1227
+ const idx = addToExternrefTable0(e);
1228
+ wasm.__wbindgen_exn_store(idx);
1229
+ }
1230
+ }
1231
+
1232
+ function isLikeNone(x) {
1233
+ return x === undefined || x === null;
1234
+ }
1235
+
1236
+ function makeMutClosure(arg0, arg1, f) {
1237
+ const state = { a: arg0, b: arg1, cnt: 1 };
1238
+ const real = (...args) => {
1239
+
1240
+ // First up with a closure we increment the internal reference
1241
+ // count. This ensures that the Rust closure environment won't
1242
+ // be deallocated while we're invoking it.
1243
+ state.cnt++;
1244
+ const a = state.a;
1245
+ state.a = 0;
1246
+ try {
1247
+ return f(a, state.b, ...args);
1248
+ } finally {
1249
+ state.a = a;
1250
+ real._wbg_cb_unref();
1251
+ }
1252
+ };
1253
+ real._wbg_cb_unref = () => {
1254
+ if (--state.cnt === 0) {
1255
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
1256
+ state.a = 0;
1257
+ CLOSURE_DTORS.unregister(state);
1258
+ }
1259
+ };
1260
+ CLOSURE_DTORS.register(real, state, state);
1261
+ return real;
1262
+ }
1263
+
1264
+ function passStringToWasm0(arg, malloc, realloc) {
1265
+ if (realloc === undefined) {
1266
+ const buf = cachedTextEncoder.encode(arg);
1267
+ const ptr = malloc(buf.length, 1) >>> 0;
1268
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1269
+ WASM_VECTOR_LEN = buf.length;
1270
+ return ptr;
1271
+ }
1272
+
1273
+ let len = arg.length;
1274
+ let ptr = malloc(len, 1) >>> 0;
1275
+
1276
+ const mem = getUint8ArrayMemory0();
1277
+
1278
+ let offset = 0;
1279
+
1280
+ for (; offset < len; offset++) {
1281
+ const code = arg.charCodeAt(offset);
1282
+ if (code > 0x7F) break;
1283
+ mem[ptr + offset] = code;
1284
+ }
1285
+ if (offset !== len) {
1286
+ if (offset !== 0) {
1287
+ arg = arg.slice(offset);
1288
+ }
1289
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1290
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1291
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1292
+
1293
+ offset += ret.written;
1294
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1295
+ }
1296
+
1297
+ WASM_VECTOR_LEN = offset;
1298
+ return ptr;
1299
+ }
1300
+
1301
+ function takeFromExternrefTable0(idx) {
1302
+ const value = wasm.__wbindgen_externrefs.get(idx);
1303
+ wasm.__externref_table_dealloc(idx);
1304
+ return value;
1305
+ }
1306
+
1307
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1308
+ cachedTextDecoder.decode();
1309
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1310
+ let numBytesDecoded = 0;
1311
+ function decodeText(ptr, len) {
1312
+ numBytesDecoded += len;
1313
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1314
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1315
+ cachedTextDecoder.decode();
1316
+ numBytesDecoded = len;
1317
+ }
1318
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1319
+ }
1320
+
1321
+ const cachedTextEncoder = new TextEncoder();
1322
+
1323
+ if (!('encodeInto' in cachedTextEncoder)) {
1324
+ cachedTextEncoder.encodeInto = function (arg, view) {
1325
+ const buf = cachedTextEncoder.encode(arg);
1326
+ view.set(buf);
1327
+ return {
1328
+ read: arg.length,
1329
+ written: buf.length
1330
+ };
1331
+ };
1332
+ }
1333
+
1334
+ let WASM_VECTOR_LEN = 0;
1335
+
1336
+ let wasmModule, wasmInstance, wasm;
1337
+ function __wbg_finalize_init(instance, module) {
1338
+ wasmInstance = instance;
1339
+ wasm = instance.exports;
1340
+ wasmModule = module;
1341
+ cachedDataViewMemory0 = null;
1342
+ cachedUint8ArrayMemory0 = null;
1343
+ wasm.__wbindgen_start();
1344
+ return wasm;
1345
+ }
1346
+
1347
+ async function __wbg_load(module, imports) {
1348
+ if (typeof Response === 'function' && module instanceof Response) {
1349
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1350
+ try {
1351
+ return await WebAssembly.instantiateStreaming(module, imports);
1352
+ } catch (e) {
1353
+ const validResponse = module.ok && expectedResponseType(module.type);
1354
+
1355
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1356
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
1357
+
1358
+ } else { throw e; }
1359
+ }
1360
+ }
1361
+
1362
+ const bytes = await module.arrayBuffer();
1363
+ return await WebAssembly.instantiate(bytes, imports);
1364
+ } else {
1365
+ const instance = await WebAssembly.instantiate(module, imports);
1366
+
1367
+ if (instance instanceof WebAssembly.Instance) {
1368
+ return { instance, module };
1369
+ } else {
1370
+ return instance;
1371
+ }
1372
+ }
1373
+
1374
+ function expectedResponseType(type) {
1375
+ switch (type) {
1376
+ case 'basic': case 'cors': case 'default': return true;
1377
+ }
1378
+ return false;
1379
+ }
1380
+ }
1381
+
1382
+ function initSync(module) {
1383
+ if (wasm !== undefined) return wasm;
1384
+
1385
+
1386
+ if (module !== undefined) {
1387
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1388
+ ({module} = module)
1389
+ } else {
1390
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1391
+ }
1392
+ }
1393
+
1394
+ const imports = __wbg_get_imports();
1395
+ if (!(module instanceof WebAssembly.Module)) {
1396
+ module = new WebAssembly.Module(module);
1397
+ }
1398
+ const instance = new WebAssembly.Instance(module, imports);
1399
+ return __wbg_finalize_init(instance, module);
1400
+ }
1401
+
1402
+ async function __wbg_init(module_or_path) {
1403
+ if (wasm !== undefined) return wasm;
1404
+
1405
+
1406
+ if (module_or_path !== undefined) {
1407
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1408
+ ({module_or_path} = module_or_path)
1409
+ } else {
1410
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1411
+ }
1412
+ }
1413
+
1414
+ if (module_or_path === undefined) {
1415
+ module_or_path = new URL('reactor_wasm_bg.wasm', import.meta.url);
1416
+ }
1417
+ const imports = __wbg_get_imports();
1418
+
1419
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1420
+ module_or_path = fetch(module_or_path);
1421
+ }
1422
+
1423
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1424
+
1425
+ return __wbg_finalize_init(instance, module);
1426
+ }
1427
+
1428
+ export { initSync, __wbg_init as default };