@ylink-sdk/mobile-web 0.1.6 → 0.1.9-beta.1

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.
Files changed (55) hide show
  1. package/dist/e30037b8/VERSION +6 -0
  2. package/dist/e30037b8/libipvp-simd.d.ts +474 -0
  3. package/dist/e30037b8/libipvp-simd.js +3267 -0
  4. package/dist/e30037b8/libipvp-simd.prod.d.ts +474 -0
  5. package/dist/e30037b8/libipvp-simd.prod.js +184 -0
  6. package/dist/e30037b8/libipvp-simd.prod.wasm +0 -0
  7. package/dist/e30037b8/libipvp-simd.wasm +0 -0
  8. package/dist/e30037b8/libipvp.d.ts +474 -0
  9. package/dist/e30037b8/libipvp.js +3267 -0
  10. package/dist/e30037b8/libipvp.prod.d.ts +474 -0
  11. package/dist/e30037b8/libipvp.prod.js +184 -0
  12. package/dist/e30037b8/libipvp.prod.wasm +0 -0
  13. package/dist/e30037b8/libipvp.wasm +0 -0
  14. package/dist/e30037b8/librtc.d.ts +438 -0
  15. package/dist/e30037b8/librtc.global.js +5863 -0
  16. package/dist/e30037b8/librtc.global.prod.js +15 -0
  17. package/dist/e30037b8/libsfu-simd.d.ts +767 -0
  18. package/dist/e30037b8/libsfu-simd.js +4822 -0
  19. package/dist/e30037b8/libsfu-simd.prod.d.ts +767 -0
  20. package/dist/e30037b8/libsfu-simd.prod.js +209 -0
  21. package/dist/e30037b8/libsfu-simd.prod.wasm +0 -0
  22. package/dist/e30037b8/libsfu-simd.wasm +0 -0
  23. package/dist/e30037b8/libsfu.d.ts +767 -0
  24. package/dist/e30037b8/libsfu.js +4822 -0
  25. package/dist/e30037b8/libsfu.prod.d.ts +767 -0
  26. package/dist/e30037b8/libsfu.prod.js +209 -0
  27. package/dist/e30037b8/libsfu.prod.wasm +0 -0
  28. package/dist/e30037b8/libsfu.wasm +0 -0
  29. package/dist/e30037b8/libsvc-simd-m1.d.ts +767 -0
  30. package/dist/e30037b8/libsvc-simd-m1.js +4921 -0
  31. package/dist/e30037b8/libsvc-simd-m1.prod.d.ts +767 -0
  32. package/dist/e30037b8/libsvc-simd-m1.prod.js +209 -0
  33. package/dist/e30037b8/libsvc-simd-m1.prod.wasm +0 -0
  34. package/dist/e30037b8/libsvc-simd-m1.wasm +0 -0
  35. package/dist/e30037b8/libsvc-simd.d.ts +767 -0
  36. package/dist/e30037b8/libsvc-simd.js +4857 -0
  37. package/dist/e30037b8/libsvc-simd.prod.d.ts +767 -0
  38. package/dist/e30037b8/libsvc-simd.prod.js +209 -0
  39. package/dist/e30037b8/libsvc-simd.prod.wasm +0 -0
  40. package/dist/e30037b8/libsvc-simd.wasm +0 -0
  41. package/dist/e30037b8/libsvc.d.ts +767 -0
  42. package/dist/e30037b8/libsvc.js +4857 -0
  43. package/dist/e30037b8/libsvc.prod.d.ts +767 -0
  44. package/dist/e30037b8/libsvc.prod.js +209 -0
  45. package/dist/e30037b8/libsvc.prod.wasm +0 -0
  46. package/dist/e30037b8/libsvc.wasm +0 -0
  47. package/dist/e30037b8/native-audio-worker.global.js +1583 -0
  48. package/dist/e30037b8/native-audio-worker.global.prod.js +15 -0
  49. package/dist/e30037b8/native-video-worker.global.js +1960 -0
  50. package/dist/e30037b8/native-video-worker.global.prod.js +15 -0
  51. package/dist/e30037b8/worklet-audio-worker.global.js +900 -0
  52. package/dist/e30037b8/worklet-audio-worker.global.prod.js +15 -0
  53. package/dist/style.css +1 -1
  54. package/dist/ylink-sdk-mobile.umd.js +70 -70
  55. package/package.json +1 -1
@@ -0,0 +1,3267 @@
1
+ /* eslint-disable */
2
+ if (typeof WXWebAssembly !== 'undefined') {
3
+ var WebAssembly = WXWebAssembly;
4
+ WebAssembly.RuntimeError = Error;
5
+ WebAssembly.validate = () => false;
6
+ }
7
+
8
+
9
+ var LIBIPVP = (function() {
10
+ var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
11
+ if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
12
+ return (
13
+ function(LIBIPVP) {
14
+ LIBIPVP = LIBIPVP || {};
15
+
16
+
17
+
18
+ // The Module object: Our interface to the outside world. We import
19
+ // and export values on it. There are various ways Module can be used:
20
+ // 1. Not defined. We create it here
21
+ // 2. A function parameter, function(Module) { ..generated code.. }
22
+ // 3. pre-run appended it, var Module = {}; ..generated code..
23
+ // 4. External script tag defines var Module.
24
+ // We need to check if Module already exists (e.g. case 3 above).
25
+ // Substitution will be replaced with actual code on later stage of the build,
26
+ // this way Closure Compiler will not mangle it (e.g. case 4. above).
27
+ // Note that if you want to run closure, and also to use Module
28
+ // after the generated code, you will need to define var Module = {};
29
+ // before the code. Then that object will be used in the code, and you
30
+ // can continue to use Module afterwards as well.
31
+ var Module = typeof LIBIPVP !== 'undefined' ? LIBIPVP : {};
32
+
33
+ // Set up the promise that indicates the Module is initialized
34
+ var readyPromiseResolve, readyPromiseReject;
35
+ Module['ready'] = new Promise(function(resolve, reject) {
36
+ readyPromiseResolve = resolve;
37
+ readyPromiseReject = reject;
38
+ });
39
+
40
+ // --pre-jses are emitted after the Module integration code, so that they can
41
+ // refer to Module (if they choose; they can also define Module)
42
+ // {{PRE_JSES}}
43
+
44
+ // Sometimes an existing Module object exists with properties
45
+ // meant to overwrite the default module functionality. Here
46
+ // we collect those properties and reapply _after_ we configure
47
+ // the current environment's defaults to avoid having to be so
48
+ // defensive during initialization.
49
+ var moduleOverrides = {};
50
+ var key;
51
+ for (key in Module) {
52
+ if (Module.hasOwnProperty(key)) {
53
+ moduleOverrides[key] = Module[key];
54
+ }
55
+ }
56
+
57
+ var arguments_ = [];
58
+ var thisProgram = './this.program';
59
+ var quit_ = function(status, toThrow) {
60
+ throw toThrow;
61
+ };
62
+
63
+ // Determine the runtime environment we are in. You can customize this by
64
+ // setting the ENVIRONMENT setting at compile time (see settings.js).
65
+
66
+ var ENVIRONMENT_IS_WEB = false;
67
+ var ENVIRONMENT_IS_WORKER = false;
68
+ var ENVIRONMENT_IS_NODE = false;
69
+ var ENVIRONMENT_IS_SHELL = false;
70
+ ENVIRONMENT_IS_WEB = typeof window === 'object';
71
+ ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';
72
+ // N.b. Electron.js environment is simultaneously a NODE-environment, but
73
+ // also a web environment.
74
+ ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string';
75
+ ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
76
+
77
+ // `/` should be present at the end if `scriptDirectory` is not empty
78
+ var scriptDirectory = '';
79
+ function locateFile(path) {
80
+ if (Module['locateFile']) {
81
+ return Module['locateFile'](path, scriptDirectory);
82
+ }
83
+ return scriptDirectory + path;
84
+ }
85
+
86
+ // Hooks that are implemented differently in different runtime environments.
87
+ var read_,
88
+ readAsync,
89
+ readBinary,
90
+ setWindowTitle;
91
+
92
+ var nodeFS;
93
+ var nodePath;
94
+
95
+ if (ENVIRONMENT_IS_NODE) {
96
+ if (ENVIRONMENT_IS_WORKER) {
97
+ scriptDirectory = require('path').dirname(scriptDirectory) + '/';
98
+ } else {
99
+ scriptDirectory = __dirname + '/';
100
+ }
101
+
102
+ // include: node_shell_read.js
103
+
104
+
105
+ read_ = function shell_read(filename, binary) {
106
+ if (!nodeFS) nodeFS = require('fs');
107
+ if (!nodePath) nodePath = require('path');
108
+ filename = nodePath['normalize'](filename);
109
+ return nodeFS['readFileSync'](filename, binary ? null : 'utf8');
110
+ };
111
+
112
+ readBinary = function readBinary(filename) {
113
+ var ret = read_(filename, true);
114
+ if (!ret.buffer) {
115
+ ret = new Uint8Array(ret);
116
+ }
117
+ assert(ret.buffer);
118
+ return ret;
119
+ };
120
+
121
+ // end include: node_shell_read.js
122
+ if (process['argv'].length > 1) {
123
+ thisProgram = process['argv'][1].replace(/\\/g, '/');
124
+ }
125
+
126
+ arguments_ = process['argv'].slice(2);
127
+
128
+ // MODULARIZE will export the module in the proper place outside, we don't need to export here
129
+
130
+ process['on']('uncaughtException', function(ex) {
131
+ // suppress ExitStatus exceptions from showing an error
132
+ if (!(ex instanceof ExitStatus)) {
133
+ throw ex;
134
+ }
135
+ });
136
+
137
+ process['on']('unhandledRejection', abort);
138
+
139
+ quit_ = function(status) {
140
+ process['exit'](status);
141
+ };
142
+
143
+ Module['inspect'] = function () { return '[Emscripten Module object]'; };
144
+
145
+ } else
146
+ if (ENVIRONMENT_IS_SHELL) {
147
+
148
+ if (typeof read != 'undefined') {
149
+ read_ = function shell_read(f) {
150
+ return read(f);
151
+ };
152
+ }
153
+
154
+ readBinary = function readBinary(f) {
155
+ var data;
156
+ if (typeof readbuffer === 'function') {
157
+ return new Uint8Array(readbuffer(f));
158
+ }
159
+ data = read(f, 'binary');
160
+ assert(typeof data === 'object');
161
+ return data;
162
+ };
163
+
164
+ if (typeof scriptArgs != 'undefined') {
165
+ arguments_ = scriptArgs;
166
+ } else if (typeof arguments != 'undefined') {
167
+ arguments_ = arguments;
168
+ }
169
+
170
+ if (typeof quit === 'function') {
171
+ quit_ = function(status) {
172
+ quit(status);
173
+ };
174
+ }
175
+
176
+ if (typeof print !== 'undefined') {
177
+ // Prefer to use print/printErr where they exist, as they usually work better.
178
+ if (typeof console === 'undefined') console = /** @type{!Console} */({});
179
+ console.log = /** @type{!function(this:Console, ...*): undefined} */ (print);
180
+ console.warn = console.error = /** @type{!function(this:Console, ...*): undefined} */ (typeof printErr !== 'undefined' ? printErr : print);
181
+ }
182
+
183
+ } else
184
+
185
+ // Note that this includes Node.js workers when relevant (pthreads is enabled).
186
+ // Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and
187
+ // ENVIRONMENT_IS_NODE.
188
+ if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
189
+ if (ENVIRONMENT_IS_WORKER) { // Check worker, not web, since window could be polyfilled
190
+ scriptDirectory = typeof self !== 'undefined' ? self.location.href : '';
191
+ } else if (typeof document !== 'undefined' && document.currentScript) { // web
192
+ scriptDirectory = document.currentScript.src;
193
+ }
194
+ // When MODULARIZE, this JS may be executed later, after document.currentScript
195
+ // is gone, so we saved it, and we use it here instead of any other info.
196
+ if (_scriptDir) {
197
+ scriptDirectory = _scriptDir;
198
+ }
199
+ // blob urls look like blob:http://site.com/etc/etc and we cannot infer anything from them.
200
+ // otherwise, slice off the final part of the url to find the script directory.
201
+ // if scriptDirectory does not contain a slash, lastIndexOf will return -1,
202
+ // and scriptDirectory will correctly be replaced with an empty string.
203
+ if (scriptDirectory.indexOf('blob:') !== 0) {
204
+ scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf('/')+1);
205
+ } else {
206
+ scriptDirectory = '';
207
+ }
208
+
209
+ // Differentiate the Web Worker from the Node Worker case, as reading must
210
+ // be done differently.
211
+ {
212
+
213
+ // include: web_or_worker_shell_read.js
214
+
215
+
216
+ read_ = function(url) {
217
+ var xhr = new XMLHttpRequest();
218
+ xhr.open('GET', url, false);
219
+ xhr.send(null);
220
+ return xhr.responseText;
221
+ };
222
+
223
+ if (ENVIRONMENT_IS_WORKER) {
224
+ readBinary = function(url) {
225
+ var xhr = new XMLHttpRequest();
226
+ xhr.open('GET', url, false);
227
+ xhr.responseType = 'arraybuffer';
228
+ xhr.send(null);
229
+ return new Uint8Array(/** @type{!ArrayBuffer} */(xhr.response));
230
+ };
231
+ }
232
+
233
+ readAsync = function(url, onload, onerror) {
234
+ var xhr = new XMLHttpRequest();
235
+ xhr.open('GET', url, true);
236
+ xhr.responseType = 'arraybuffer';
237
+ xhr.onload = function() {
238
+ if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
239
+ onload(xhr.response);
240
+ return;
241
+ }
242
+ onerror();
243
+ };
244
+ xhr.onerror = onerror;
245
+ xhr.send(null);
246
+ };
247
+
248
+ // end include: web_or_worker_shell_read.js
249
+ }
250
+
251
+ setWindowTitle = function(title) { document.title = title };
252
+ } else
253
+ {
254
+ }
255
+
256
+ // Set up the out() and err() hooks, which are how we can print to stdout or
257
+ // stderr, respectively.
258
+ var out = Module['print'] || console.log.bind(console);
259
+ var err = Module['printErr'] || console.warn.bind(console);
260
+
261
+ // Merge back in the overrides
262
+ for (key in moduleOverrides) {
263
+ if (moduleOverrides.hasOwnProperty(key)) {
264
+ Module[key] = moduleOverrides[key];
265
+ }
266
+ }
267
+ // Free the object hierarchy contained in the overrides, this lets the GC
268
+ // reclaim data used e.g. in memoryInitializerRequest, which is a large typed array.
269
+ moduleOverrides = null;
270
+
271
+ // Emit code to handle expected values on the Module object. This applies Module.x
272
+ // to the proper local x. This has two benefits: first, we only emit it if it is
273
+ // expected to arrive, and second, by using a local everywhere else that can be
274
+ // minified.
275
+ if (Module['arguments']) arguments_ = Module['arguments'];
276
+ if (Module['thisProgram']) thisProgram = Module['thisProgram'];
277
+ if (Module['quit']) quit_ = Module['quit'];
278
+
279
+ // perform assertions in shell.js after we set up out() and err(), as otherwise if an assertion fails it cannot print the message
280
+
281
+
282
+
283
+
284
+ var STACK_ALIGN = 16;
285
+
286
+ function alignMemory(size, factor) {
287
+ if (!factor) factor = STACK_ALIGN; // stack alignment (16-byte) by default
288
+ return Math.ceil(size / factor) * factor;
289
+ }
290
+
291
+ function getNativeTypeSize(type) {
292
+ switch (type) {
293
+ case 'i1': case 'i8': return 1;
294
+ case 'i16': return 2;
295
+ case 'i32': return 4;
296
+ case 'i64': return 8;
297
+ case 'float': return 4;
298
+ case 'double': return 8;
299
+ default: {
300
+ if (type[type.length-1] === '*') {
301
+ return 4; // A pointer
302
+ } else if (type[0] === 'i') {
303
+ var bits = Number(type.substr(1));
304
+ assert(bits % 8 === 0, 'getNativeTypeSize invalid bits ' + bits + ', type ' + type);
305
+ return bits / 8;
306
+ } else {
307
+ return 0;
308
+ }
309
+ }
310
+ }
311
+ }
312
+
313
+ function warnOnce(text) {
314
+ if (!warnOnce.shown) warnOnce.shown = {};
315
+ if (!warnOnce.shown[text]) {
316
+ warnOnce.shown[text] = 1;
317
+ err(text);
318
+ }
319
+ }
320
+
321
+ // include: runtime_functions.js
322
+
323
+
324
+ // Wraps a JS function as a wasm function with a given signature.
325
+ function convertJsFunctionToWasm(func, sig) {
326
+
327
+ // If the type reflection proposal is available, use the new
328
+ // "WebAssembly.Function" constructor.
329
+ // Otherwise, construct a minimal wasm module importing the JS function and
330
+ // re-exporting it.
331
+ if (typeof WebAssembly.Function === "function") {
332
+ var typeNames = {
333
+ 'i': 'i32',
334
+ 'j': 'i64',
335
+ 'f': 'f32',
336
+ 'd': 'f64'
337
+ };
338
+ var type = {
339
+ parameters: [],
340
+ results: sig[0] == 'v' ? [] : [typeNames[sig[0]]]
341
+ };
342
+ for (var i = 1; i < sig.length; ++i) {
343
+ type.parameters.push(typeNames[sig[i]]);
344
+ }
345
+ return new WebAssembly.Function(type, func);
346
+ }
347
+
348
+ // The module is static, with the exception of the type section, which is
349
+ // generated based on the signature passed in.
350
+ var typeSection = [
351
+ 0x01, // id: section,
352
+ 0x00, // length: 0 (placeholder)
353
+ 0x01, // count: 1
354
+ 0x60, // form: func
355
+ ];
356
+ var sigRet = sig.slice(0, 1);
357
+ var sigParam = sig.slice(1);
358
+ var typeCodes = {
359
+ 'i': 0x7f, // i32
360
+ 'j': 0x7e, // i64
361
+ 'f': 0x7d, // f32
362
+ 'd': 0x7c, // f64
363
+ };
364
+
365
+ // Parameters, length + signatures
366
+ typeSection.push(sigParam.length);
367
+ for (var i = 0; i < sigParam.length; ++i) {
368
+ typeSection.push(typeCodes[sigParam[i]]);
369
+ }
370
+
371
+ // Return values, length + signatures
372
+ // With no multi-return in MVP, either 0 (void) or 1 (anything else)
373
+ if (sigRet == 'v') {
374
+ typeSection.push(0x00);
375
+ } else {
376
+ typeSection = typeSection.concat([0x01, typeCodes[sigRet]]);
377
+ }
378
+
379
+ // Write the overall length of the type section back into the section header
380
+ // (excepting the 2 bytes for the section id and length)
381
+ typeSection[1] = typeSection.length - 2;
382
+
383
+ // Rest of the module is static
384
+ var bytes = new Uint8Array([
385
+ 0x00, 0x61, 0x73, 0x6d, // magic ("\0asm")
386
+ 0x01, 0x00, 0x00, 0x00, // version: 1
387
+ ].concat(typeSection, [
388
+ 0x02, 0x07, // import section
389
+ // (import "e" "f" (func 0 (type 0)))
390
+ 0x01, 0x01, 0x65, 0x01, 0x66, 0x00, 0x00,
391
+ 0x07, 0x05, // export section
392
+ // (export "f" (func 0 (type 0)))
393
+ 0x01, 0x01, 0x66, 0x00, 0x00,
394
+ ]));
395
+
396
+ // We can compile this wasm module synchronously because it is very small.
397
+ // This accepts an import (at "e.f"), that it reroutes to an export (at "f")
398
+ var module = new WebAssembly.Module(bytes);
399
+ var instance = new WebAssembly.Instance(module, {
400
+ 'e': {
401
+ 'f': func
402
+ }
403
+ });
404
+ var wrappedFunc = instance.exports['f'];
405
+ return wrappedFunc;
406
+ }
407
+
408
+ var freeTableIndexes = [];
409
+
410
+ // Weak map of functions in the table to their indexes, created on first use.
411
+ var functionsInTableMap;
412
+
413
+ function getEmptyTableSlot() {
414
+ // Reuse a free index if there is one, otherwise grow.
415
+ if (freeTableIndexes.length) {
416
+ return freeTableIndexes.pop();
417
+ }
418
+ // Grow the table
419
+ try {
420
+ wasmTable.grow(1);
421
+ } catch (err) {
422
+ if (!(err instanceof RangeError)) {
423
+ throw err;
424
+ }
425
+ throw 'Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.';
426
+ }
427
+ return wasmTable.length - 1;
428
+ }
429
+
430
+ // Add a wasm function to the table.
431
+ function addFunctionWasm(func, sig) {
432
+ // Check if the function is already in the table, to ensure each function
433
+ // gets a unique index. First, create the map if this is the first use.
434
+ if (!functionsInTableMap) {
435
+ functionsInTableMap = new WeakMap();
436
+ for (var i = 0; i < wasmTable.length; i++) {
437
+ var item = wasmTable.get(i);
438
+ // Ignore null values.
439
+ if (item) {
440
+ functionsInTableMap.set(item, i);
441
+ }
442
+ }
443
+ }
444
+ if (functionsInTableMap.has(func)) {
445
+ return functionsInTableMap.get(func);
446
+ }
447
+
448
+ // It's not in the table, add it now.
449
+
450
+ var ret = getEmptyTableSlot();
451
+
452
+ // Set the new value.
453
+ try {
454
+ // Attempting to call this with JS function will cause of table.set() to fail
455
+ wasmTable.set(ret, func);
456
+ } catch (err) {
457
+ if (!(err instanceof TypeError)) {
458
+ throw err;
459
+ }
460
+ var wrapped = convertJsFunctionToWasm(func, sig);
461
+ wasmTable.set(ret, wrapped);
462
+ }
463
+
464
+ functionsInTableMap.set(func, ret);
465
+
466
+ return ret;
467
+ }
468
+
469
+ function removeFunction(index) {
470
+ functionsInTableMap.delete(wasmTable.get(index));
471
+ freeTableIndexes.push(index);
472
+ }
473
+
474
+ // 'sig' parameter is required for the llvm backend but only when func is not
475
+ // already a WebAssembly function.
476
+ function addFunction(func, sig) {
477
+
478
+ return addFunctionWasm(func, sig);
479
+ }
480
+
481
+ // end include: runtime_functions.js
482
+ // include: runtime_debug.js
483
+
484
+
485
+ // end include: runtime_debug.js
486
+ function makeBigInt(low, high, unsigned) {
487
+ return unsigned ? ((+((low>>>0)))+((+((high>>>0)))*4294967296.0)) : ((+((low>>>0)))+((+((high|0)))*4294967296.0));
488
+ }
489
+
490
+ var tempRet0 = 0;
491
+
492
+ var setTempRet0 = function(value) {
493
+ tempRet0 = value;
494
+ };
495
+
496
+ var getTempRet0 = function() {
497
+ return tempRet0;
498
+ };
499
+
500
+
501
+
502
+ // === Preamble library stuff ===
503
+
504
+ // Documentation for the public APIs defined in this file must be updated in:
505
+ // site/source/docs/api_reference/preamble.js.rst
506
+ // A prebuilt local version of the documentation is available at:
507
+ // site/build/text/docs/api_reference/preamble.js.txt
508
+ // You can also build docs locally as HTML or other formats in site/
509
+ // An online HTML version (which may be of a different version of Emscripten)
510
+ // is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html
511
+
512
+ var wasmBinary;if (Module['wasmBinary']) wasmBinary = Module['wasmBinary'];
513
+ var noExitRuntime;if (Module['noExitRuntime']) noExitRuntime = Module['noExitRuntime'];
514
+
515
+ if (typeof WebAssembly !== 'object') {
516
+ abort('no native wasm support detected');
517
+ }
518
+
519
+ // include: runtime_safe_heap.js
520
+
521
+
522
+ // In MINIMAL_RUNTIME, setValue() and getValue() are only available when building with safe heap enabled, for heap safety checking.
523
+ // In traditional runtime, setValue() and getValue() are always available (although their use is highly discouraged due to perf penalties)
524
+
525
+ /** @param {number} ptr
526
+ @param {number} value
527
+ @param {string} type
528
+ @param {number|boolean=} noSafe */
529
+ function setValue(ptr, value, type, noSafe) {
530
+ type = type || 'i8';
531
+ if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
532
+ switch(type) {
533
+ case 'i1': HEAP8[((ptr)>>0)]=value; break;
534
+ case 'i8': HEAP8[((ptr)>>0)]=value; break;
535
+ case 'i16': HEAP16[((ptr)>>1)]=value; break;
536
+ case 'i32': HEAP32[((ptr)>>2)]=value; break;
537
+ case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math.min((+(Math.floor((tempDouble)/4294967296.0))), 4294967295.0))|0)>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;
538
+ case 'float': HEAPF32[((ptr)>>2)]=value; break;
539
+ case 'double': HEAPF64[((ptr)>>3)]=value; break;
540
+ default: abort('invalid type for setValue: ' + type);
541
+ }
542
+ }
543
+
544
+ /** @param {number} ptr
545
+ @param {string} type
546
+ @param {number|boolean=} noSafe */
547
+ function getValue(ptr, type, noSafe) {
548
+ type = type || 'i8';
549
+ if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
550
+ switch(type) {
551
+ case 'i1': return HEAP8[((ptr)>>0)];
552
+ case 'i8': return HEAP8[((ptr)>>0)];
553
+ case 'i16': return HEAP16[((ptr)>>1)];
554
+ case 'i32': return HEAP32[((ptr)>>2)];
555
+ case 'i64': return HEAP32[((ptr)>>2)];
556
+ case 'float': return HEAPF32[((ptr)>>2)];
557
+ case 'double': return HEAPF64[((ptr)>>3)];
558
+ default: abort('invalid type for getValue: ' + type);
559
+ }
560
+ return null;
561
+ }
562
+
563
+ // end include: runtime_safe_heap.js
564
+ // Wasm globals
565
+
566
+ var wasmMemory;
567
+
568
+ //========================================
569
+ // Runtime essentials
570
+ //========================================
571
+
572
+ // whether we are quitting the application. no code should run after this.
573
+ // set in exit() and abort()
574
+ var ABORT = false;
575
+
576
+ // set by exit() and abort(). Passed to 'onExit' handler.
577
+ // NOTE: This is also used as the process return code code in shell environments
578
+ // but only when noExitRuntime is false.
579
+ var EXITSTATUS;
580
+
581
+ /** @type {function(*, string=)} */
582
+ function assert(condition, text) {
583
+ if (!condition) {
584
+ abort('Assertion failed: ' + text);
585
+ }
586
+ }
587
+
588
+ // Returns the C function with a specified identifier (for C++, you need to do manual name mangling)
589
+ function getCFunc(ident) {
590
+ var func = Module['_' + ident]; // closure exported function
591
+ assert(func, 'Cannot call unknown function ' + ident + ', make sure it is exported');
592
+ return func;
593
+ }
594
+
595
+ // C calling interface.
596
+ /** @param {string|null=} returnType
597
+ @param {Array=} argTypes
598
+ @param {Arguments|Array=} args
599
+ @param {Object=} opts */
600
+ function ccall(ident, returnType, argTypes, args, opts) {
601
+ // For fast lookup of conversion functions
602
+ var toC = {
603
+ 'string': function(str) {
604
+ var ret = 0;
605
+ if (str !== null && str !== undefined && str !== 0) { // null string
606
+ // at most 4 bytes per UTF-8 code point, +1 for the trailing '\0'
607
+ var len = (str.length << 2) + 1;
608
+ ret = stackAlloc(len);
609
+ stringToUTF8(str, ret, len);
610
+ }
611
+ return ret;
612
+ },
613
+ 'array': function(arr) {
614
+ var ret = stackAlloc(arr.length);
615
+ writeArrayToMemory(arr, ret);
616
+ return ret;
617
+ }
618
+ };
619
+
620
+ function convertReturnValue(ret) {
621
+ if (returnType === 'string') return UTF8ToString(ret);
622
+ if (returnType === 'boolean') return Boolean(ret);
623
+ return ret;
624
+ }
625
+
626
+ var func = getCFunc(ident);
627
+ var cArgs = [];
628
+ var stack = 0;
629
+ if (args) {
630
+ for (var i = 0; i < args.length; i++) {
631
+ var converter = toC[argTypes[i]];
632
+ if (converter) {
633
+ if (stack === 0) stack = stackSave();
634
+ cArgs[i] = converter(args[i]);
635
+ } else {
636
+ cArgs[i] = args[i];
637
+ }
638
+ }
639
+ }
640
+ var ret = func.apply(null, cArgs);
641
+
642
+ ret = convertReturnValue(ret);
643
+ if (stack !== 0) stackRestore(stack);
644
+ return ret;
645
+ }
646
+
647
+ /** @param {string=} returnType
648
+ @param {Array=} argTypes
649
+ @param {Object=} opts */
650
+ function cwrap(ident, returnType, argTypes, opts) {
651
+ argTypes = argTypes || [];
652
+ // When the function takes numbers and returns a number, we can just return
653
+ // the original function
654
+ var numericArgs = argTypes.every(function(type){ return type === 'number'});
655
+ var numericRet = returnType !== 'string';
656
+ if (numericRet && numericArgs && !opts) {
657
+ return getCFunc(ident);
658
+ }
659
+ return function() {
660
+ return ccall(ident, returnType, argTypes, arguments, opts);
661
+ }
662
+ }
663
+
664
+ var ALLOC_NORMAL = 0; // Tries to use _malloc()
665
+ var ALLOC_STACK = 1; // Lives for the duration of the current function call
666
+
667
+ // allocate(): This is for internal use. You can use it yourself as well, but the interface
668
+ // is a little tricky (see docs right below). The reason is that it is optimized
669
+ // for multiple syntaxes to save space in generated code. So you should
670
+ // normally not use allocate(), and instead allocate memory using _malloc(),
671
+ // initialize it with setValue(), and so forth.
672
+ // @slab: An array of data.
673
+ // @allocator: How to allocate memory, see ALLOC_*
674
+ /** @type {function((Uint8Array|Array<number>), number)} */
675
+ function allocate(slab, allocator) {
676
+ var ret;
677
+
678
+ if (allocator == ALLOC_STACK) {
679
+ ret = stackAlloc(slab.length);
680
+ } else {
681
+ ret = _malloc(slab.length);
682
+ }
683
+
684
+ if (slab.subarray || slab.slice) {
685
+ HEAPU8.set(/** @type {!Uint8Array} */(slab), ret);
686
+ } else {
687
+ HEAPU8.set(new Uint8Array(slab), ret);
688
+ }
689
+ return ret;
690
+ }
691
+
692
+ // include: runtime_strings.js
693
+
694
+
695
+ // runtime_strings.js: Strings related runtime functions that are part of both MINIMAL_RUNTIME and regular runtime.
696
+
697
+ // Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the given array that contains uint8 values, returns
698
+ // a copy of that string as a Javascript String object.
699
+
700
+ var UTF8Decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf8') : undefined;
701
+
702
+ /**
703
+ * @param {number} idx
704
+ * @param {number=} maxBytesToRead
705
+ * @return {string}
706
+ */
707
+ function UTF8ArrayToString(heap, idx, maxBytesToRead) {
708
+ var endIdx = idx + maxBytesToRead;
709
+ var endPtr = idx;
710
+ // TextDecoder needs to know the byte length in advance, it doesn't stop on null terminator by itself.
711
+ // Also, use the length info to avoid running tiny strings through TextDecoder, since .subarray() allocates garbage.
712
+ // (As a tiny code save trick, compare endPtr against endIdx using a negation, so that undefined means Infinity)
713
+ while (heap[endPtr] && !(endPtr >= endIdx)) ++endPtr;
714
+
715
+ if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) {
716
+ return UTF8Decoder.decode(heap.subarray(idx, endPtr));
717
+ } else {
718
+ var str = '';
719
+ // If building with TextDecoder, we have already computed the string length above, so test loop end condition against that
720
+ while (idx < endPtr) {
721
+ // For UTF8 byte structure, see:
722
+ // http://en.wikipedia.org/wiki/UTF-8#Description
723
+ // https://www.ietf.org/rfc/rfc2279.txt
724
+ // https://tools.ietf.org/html/rfc3629
725
+ var u0 = heap[idx++];
726
+ if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }
727
+ var u1 = heap[idx++] & 63;
728
+ if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }
729
+ var u2 = heap[idx++] & 63;
730
+ if ((u0 & 0xF0) == 0xE0) {
731
+ u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;
732
+ } else {
733
+ u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heap[idx++] & 63);
734
+ }
735
+
736
+ if (u0 < 0x10000) {
737
+ str += String.fromCharCode(u0);
738
+ } else {
739
+ var ch = u0 - 0x10000;
740
+ str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));
741
+ }
742
+ }
743
+ }
744
+ return str;
745
+ }
746
+
747
+ // Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the emscripten HEAP, returns a
748
+ // copy of that string as a Javascript String object.
749
+ // maxBytesToRead: an optional length that specifies the maximum number of bytes to read. You can omit
750
+ // this parameter to scan the string until the first \0 byte. If maxBytesToRead is
751
+ // passed, and the string at [ptr, ptr+maxBytesToReadr[ contains a null byte in the
752
+ // middle, then the string will cut short at that byte index (i.e. maxBytesToRead will
753
+ // not produce a string of exact length [ptr, ptr+maxBytesToRead[)
754
+ // N.B. mixing frequent uses of UTF8ToString() with and without maxBytesToRead may
755
+ // throw JS JIT optimizations off, so it is worth to consider consistently using one
756
+ // style or the other.
757
+ /**
758
+ * @param {number} ptr
759
+ * @param {number=} maxBytesToRead
760
+ * @return {string}
761
+ */
762
+ function UTF8ToString(ptr, maxBytesToRead) {
763
+ return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : '';
764
+ }
765
+
766
+ // Copies the given Javascript String object 'str' to the given byte array at address 'outIdx',
767
+ // encoded in UTF8 form and null-terminated. The copy will require at most str.length*4+1 bytes of space in the HEAP.
768
+ // Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this function will write.
769
+ // Parameters:
770
+ // str: the Javascript string to copy.
771
+ // heap: the array to copy to. Each index in this array is assumed to be one 8-byte element.
772
+ // outIdx: The starting offset in the array to begin the copying.
773
+ // maxBytesToWrite: The maximum number of bytes this function can write to the array.
774
+ // This count should include the null terminator,
775
+ // i.e. if maxBytesToWrite=1, only the null terminator will be written and nothing else.
776
+ // maxBytesToWrite=0 does not write any bytes to the output, not even the null terminator.
777
+ // Returns the number of bytes written, EXCLUDING the null terminator.
778
+
779
+ function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) {
780
+ if (!(maxBytesToWrite > 0)) // Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes.
781
+ return 0;
782
+
783
+ var startIdx = outIdx;
784
+ var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator.
785
+ for (var i = 0; i < str.length; ++i) {
786
+ // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8.
787
+ // See http://unicode.org/faq/utf_bom.html#utf16-3
788
+ // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629
789
+ var u = str.charCodeAt(i); // possibly a lead surrogate
790
+ if (u >= 0xD800 && u <= 0xDFFF) {
791
+ var u1 = str.charCodeAt(++i);
792
+ u = 0x10000 + ((u & 0x3FF) << 10) | (u1 & 0x3FF);
793
+ }
794
+ if (u <= 0x7F) {
795
+ if (outIdx >= endIdx) break;
796
+ heap[outIdx++] = u;
797
+ } else if (u <= 0x7FF) {
798
+ if (outIdx + 1 >= endIdx) break;
799
+ heap[outIdx++] = 0xC0 | (u >> 6);
800
+ heap[outIdx++] = 0x80 | (u & 63);
801
+ } else if (u <= 0xFFFF) {
802
+ if (outIdx + 2 >= endIdx) break;
803
+ heap[outIdx++] = 0xE0 | (u >> 12);
804
+ heap[outIdx++] = 0x80 | ((u >> 6) & 63);
805
+ heap[outIdx++] = 0x80 | (u & 63);
806
+ } else {
807
+ if (outIdx + 3 >= endIdx) break;
808
+ heap[outIdx++] = 0xF0 | (u >> 18);
809
+ heap[outIdx++] = 0x80 | ((u >> 12) & 63);
810
+ heap[outIdx++] = 0x80 | ((u >> 6) & 63);
811
+ heap[outIdx++] = 0x80 | (u & 63);
812
+ }
813
+ }
814
+ // Null-terminate the pointer to the buffer.
815
+ heap[outIdx] = 0;
816
+ return outIdx - startIdx;
817
+ }
818
+
819
+ // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
820
+ // null-terminated and encoded in UTF8 form. The copy will require at most str.length*4+1 bytes of space in the HEAP.
821
+ // Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this function will write.
822
+ // Returns the number of bytes written, EXCLUDING the null terminator.
823
+
824
+ function stringToUTF8(str, outPtr, maxBytesToWrite) {
825
+ return stringToUTF8Array(str, HEAPU8,outPtr, maxBytesToWrite);
826
+ }
827
+
828
+ // Returns the number of bytes the given Javascript string takes if encoded as a UTF8 byte array, EXCLUDING the null terminator byte.
829
+ function lengthBytesUTF8(str) {
830
+ var len = 0;
831
+ for (var i = 0; i < str.length; ++i) {
832
+ // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8.
833
+ // See http://unicode.org/faq/utf_bom.html#utf16-3
834
+ var u = str.charCodeAt(i); // possibly a lead surrogate
835
+ if (u >= 0xD800 && u <= 0xDFFF) u = 0x10000 + ((u & 0x3FF) << 10) | (str.charCodeAt(++i) & 0x3FF);
836
+ if (u <= 0x7F) ++len;
837
+ else if (u <= 0x7FF) len += 2;
838
+ else if (u <= 0xFFFF) len += 3;
839
+ else len += 4;
840
+ }
841
+ return len;
842
+ }
843
+
844
+ // end include: runtime_strings.js
845
+ // include: runtime_strings_extra.js
846
+
847
+
848
+ // runtime_strings_extra.js: Strings related runtime functions that are available only in regular runtime.
849
+
850
+ // Given a pointer 'ptr' to a null-terminated ASCII-encoded string in the emscripten HEAP, returns
851
+ // a copy of that string as a Javascript String object.
852
+
853
+ function AsciiToString(ptr) {
854
+ var str = '';
855
+ while (1) {
856
+ var ch = HEAPU8[((ptr++)>>0)];
857
+ if (!ch) return str;
858
+ str += String.fromCharCode(ch);
859
+ }
860
+ }
861
+
862
+ // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
863
+ // null-terminated and encoded in ASCII form. The copy will require at most str.length+1 bytes of space in the HEAP.
864
+
865
+ function stringToAscii(str, outPtr) {
866
+ return writeAsciiToMemory(str, outPtr, false);
867
+ }
868
+
869
+ // Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns
870
+ // a copy of that string as a Javascript String object.
871
+
872
+ var UTF16Decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-16le') : undefined;
873
+
874
+ function UTF16ToString(ptr, maxBytesToRead) {
875
+ var endPtr = ptr;
876
+ // TextDecoder needs to know the byte length in advance, it doesn't stop on null terminator by itself.
877
+ // Also, use the length info to avoid running tiny strings through TextDecoder, since .subarray() allocates garbage.
878
+ var idx = endPtr >> 1;
879
+ var maxIdx = idx + maxBytesToRead / 2;
880
+ // If maxBytesToRead is not passed explicitly, it will be undefined, and this
881
+ // will always evaluate to true. This saves on code size.
882
+ while (!(idx >= maxIdx) && HEAPU16[idx]) ++idx;
883
+ endPtr = idx << 1;
884
+
885
+ if (endPtr - ptr > 32 && UTF16Decoder) {
886
+ return UTF16Decoder.decode(HEAPU8.subarray(ptr, endPtr));
887
+ } else {
888
+ var str = '';
889
+
890
+ // If maxBytesToRead is not passed explicitly, it will be undefined, and the for-loop's condition
891
+ // will always evaluate to true. The loop is then terminated on the first null char.
892
+ for (var i = 0; !(i >= maxBytesToRead / 2); ++i) {
893
+ var codeUnit = HEAP16[(((ptr)+(i*2))>>1)];
894
+ if (codeUnit == 0) break;
895
+ // fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.
896
+ str += String.fromCharCode(codeUnit);
897
+ }
898
+
899
+ return str;
900
+ }
901
+ }
902
+
903
+ // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
904
+ // null-terminated and encoded in UTF16 form. The copy will require at most str.length*4+2 bytes of space in the HEAP.
905
+ // Use the function lengthBytesUTF16() to compute the exact number of bytes (excluding null terminator) that this function will write.
906
+ // Parameters:
907
+ // str: the Javascript string to copy.
908
+ // outPtr: Byte address in Emscripten HEAP where to write the string to.
909
+ // maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null
910
+ // terminator, i.e. if maxBytesToWrite=2, only the null terminator will be written and nothing else.
911
+ // maxBytesToWrite<2 does not write any bytes to the output, not even the null terminator.
912
+ // Returns the number of bytes written, EXCLUDING the null terminator.
913
+
914
+ function stringToUTF16(str, outPtr, maxBytesToWrite) {
915
+ // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
916
+ if (maxBytesToWrite === undefined) {
917
+ maxBytesToWrite = 0x7FFFFFFF;
918
+ }
919
+ if (maxBytesToWrite < 2) return 0;
920
+ maxBytesToWrite -= 2; // Null terminator.
921
+ var startPtr = outPtr;
922
+ var numCharsToWrite = (maxBytesToWrite < str.length*2) ? (maxBytesToWrite / 2) : str.length;
923
+ for (var i = 0; i < numCharsToWrite; ++i) {
924
+ // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.
925
+ var codeUnit = str.charCodeAt(i); // possibly a lead surrogate
926
+ HEAP16[((outPtr)>>1)]=codeUnit;
927
+ outPtr += 2;
928
+ }
929
+ // Null-terminate the pointer to the HEAP.
930
+ HEAP16[((outPtr)>>1)]=0;
931
+ return outPtr - startPtr;
932
+ }
933
+
934
+ // Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte.
935
+
936
+ function lengthBytesUTF16(str) {
937
+ return str.length*2;
938
+ }
939
+
940
+ function UTF32ToString(ptr, maxBytesToRead) {
941
+ var i = 0;
942
+
943
+ var str = '';
944
+ // If maxBytesToRead is not passed explicitly, it will be undefined, and this
945
+ // will always evaluate to true. This saves on code size.
946
+ while (!(i >= maxBytesToRead / 4)) {
947
+ var utf32 = HEAP32[(((ptr)+(i*4))>>2)];
948
+ if (utf32 == 0) break;
949
+ ++i;
950
+ // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.
951
+ // See http://unicode.org/faq/utf_bom.html#utf16-3
952
+ if (utf32 >= 0x10000) {
953
+ var ch = utf32 - 0x10000;
954
+ str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));
955
+ } else {
956
+ str += String.fromCharCode(utf32);
957
+ }
958
+ }
959
+ return str;
960
+ }
961
+
962
+ // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
963
+ // null-terminated and encoded in UTF32 form. The copy will require at most str.length*4+4 bytes of space in the HEAP.
964
+ // Use the function lengthBytesUTF32() to compute the exact number of bytes (excluding null terminator) that this function will write.
965
+ // Parameters:
966
+ // str: the Javascript string to copy.
967
+ // outPtr: Byte address in Emscripten HEAP where to write the string to.
968
+ // maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null
969
+ // terminator, i.e. if maxBytesToWrite=4, only the null terminator will be written and nothing else.
970
+ // maxBytesToWrite<4 does not write any bytes to the output, not even the null terminator.
971
+ // Returns the number of bytes written, EXCLUDING the null terminator.
972
+
973
+ function stringToUTF32(str, outPtr, maxBytesToWrite) {
974
+ // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
975
+ if (maxBytesToWrite === undefined) {
976
+ maxBytesToWrite = 0x7FFFFFFF;
977
+ }
978
+ if (maxBytesToWrite < 4) return 0;
979
+ var startPtr = outPtr;
980
+ var endPtr = startPtr + maxBytesToWrite - 4;
981
+ for (var i = 0; i < str.length; ++i) {
982
+ // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.
983
+ // See http://unicode.org/faq/utf_bom.html#utf16-3
984
+ var codeUnit = str.charCodeAt(i); // possibly a lead surrogate
985
+ if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) {
986
+ var trailSurrogate = str.charCodeAt(++i);
987
+ codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF);
988
+ }
989
+ HEAP32[((outPtr)>>2)]=codeUnit;
990
+ outPtr += 4;
991
+ if (outPtr + 4 > endPtr) break;
992
+ }
993
+ // Null-terminate the pointer to the HEAP.
994
+ HEAP32[((outPtr)>>2)]=0;
995
+ return outPtr - startPtr;
996
+ }
997
+
998
+ // Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte.
999
+
1000
+ function lengthBytesUTF32(str) {
1001
+ var len = 0;
1002
+ for (var i = 0; i < str.length; ++i) {
1003
+ // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.
1004
+ // See http://unicode.org/faq/utf_bom.html#utf16-3
1005
+ var codeUnit = str.charCodeAt(i);
1006
+ if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) ++i; // possibly a lead surrogate, so skip over the tail surrogate.
1007
+ len += 4;
1008
+ }
1009
+
1010
+ return len;
1011
+ }
1012
+
1013
+ // Allocate heap space for a JS string, and write it there.
1014
+ // It is the responsibility of the caller to free() that memory.
1015
+ function allocateUTF8(str) {
1016
+ var size = lengthBytesUTF8(str) + 1;
1017
+ var ret = _malloc(size);
1018
+ if (ret) stringToUTF8Array(str, HEAP8, ret, size);
1019
+ return ret;
1020
+ }
1021
+
1022
+ // Allocate stack space for a JS string, and write it there.
1023
+ function allocateUTF8OnStack(str) {
1024
+ var size = lengthBytesUTF8(str) + 1;
1025
+ var ret = stackAlloc(size);
1026
+ stringToUTF8Array(str, HEAP8, ret, size);
1027
+ return ret;
1028
+ }
1029
+
1030
+ // Deprecated: This function should not be called because it is unsafe and does not provide
1031
+ // a maximum length limit of how many bytes it is allowed to write. Prefer calling the
1032
+ // function stringToUTF8Array() instead, which takes in a maximum length that can be used
1033
+ // to be secure from out of bounds writes.
1034
+ /** @deprecated
1035
+ @param {boolean=} dontAddNull */
1036
+ function writeStringToMemory(string, buffer, dontAddNull) {
1037
+ warnOnce('writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!');
1038
+
1039
+ var /** @type {number} */ lastChar, /** @type {number} */ end;
1040
+ if (dontAddNull) {
1041
+ // stringToUTF8Array always appends null. If we don't want to do that, remember the
1042
+ // character that existed at the location where the null will be placed, and restore
1043
+ // that after the write (below).
1044
+ end = buffer + lengthBytesUTF8(string);
1045
+ lastChar = HEAP8[end];
1046
+ }
1047
+ stringToUTF8(string, buffer, Infinity);
1048
+ if (dontAddNull) HEAP8[end] = lastChar; // Restore the value under the null character.
1049
+ }
1050
+
1051
+ function writeArrayToMemory(array, buffer) {
1052
+ HEAP8.set(array, buffer);
1053
+ }
1054
+
1055
+ /** @param {boolean=} dontAddNull */
1056
+ function writeAsciiToMemory(str, buffer, dontAddNull) {
1057
+ for (var i = 0; i < str.length; ++i) {
1058
+ HEAP8[((buffer++)>>0)]=str.charCodeAt(i);
1059
+ }
1060
+ // Null-terminate the pointer to the HEAP.
1061
+ if (!dontAddNull) HEAP8[((buffer)>>0)]=0;
1062
+ }
1063
+
1064
+ // end include: runtime_strings_extra.js
1065
+ // Memory management
1066
+
1067
+ function alignUp(x, multiple) {
1068
+ if (x % multiple > 0) {
1069
+ x += multiple - (x % multiple);
1070
+ }
1071
+ return x;
1072
+ }
1073
+
1074
+ var HEAP,
1075
+ /** @type {ArrayBuffer} */
1076
+ buffer,
1077
+ /** @type {Int8Array} */
1078
+ HEAP8,
1079
+ /** @type {Uint8Array} */
1080
+ HEAPU8,
1081
+ /** @type {Int16Array} */
1082
+ HEAP16,
1083
+ /** @type {Uint16Array} */
1084
+ HEAPU16,
1085
+ /** @type {Int32Array} */
1086
+ HEAP32,
1087
+ /** @type {Uint32Array} */
1088
+ HEAPU32,
1089
+ /** @type {Float32Array} */
1090
+ HEAPF32,
1091
+ /** @type {Float64Array} */
1092
+ HEAPF64;
1093
+
1094
+ function updateGlobalBufferAndViews(buf) {
1095
+ buffer = buf;
1096
+ Module['HEAP8'] = HEAP8 = new Int8Array(buf);
1097
+ Module['HEAP16'] = HEAP16 = new Int16Array(buf);
1098
+ Module['HEAP32'] = HEAP32 = new Int32Array(buf);
1099
+ Module['HEAPU8'] = HEAPU8 = new Uint8Array(buf);
1100
+ Module['HEAPU16'] = HEAPU16 = new Uint16Array(buf);
1101
+ Module['HEAPU32'] = HEAPU32 = new Uint32Array(buf);
1102
+ Module['HEAPF32'] = HEAPF32 = new Float32Array(buf);
1103
+ Module['HEAPF64'] = HEAPF64 = new Float64Array(buf);
1104
+ }
1105
+
1106
+ var TOTAL_STACK = 5242880;
1107
+
1108
+ var INITIAL_MEMORY = Module['INITIAL_MEMORY'] || 16777216;
1109
+
1110
+ // include: runtime_init_table.js
1111
+ // In regular non-RELOCATABLE mode the table is exported
1112
+ // from the wasm module and this will be assigned once
1113
+ // the exports are available.
1114
+ var wasmTable;
1115
+
1116
+ // end include: runtime_init_table.js
1117
+ // include: runtime_stack_check.js
1118
+
1119
+
1120
+ // end include: runtime_stack_check.js
1121
+ // include: runtime_assertions.js
1122
+
1123
+
1124
+ // end include: runtime_assertions.js
1125
+ var __ATPRERUN__ = []; // functions called before the runtime is initialized
1126
+ var __ATINIT__ = []; // functions called during startup
1127
+ var __ATMAIN__ = []; // functions called when main() is to be run
1128
+ var __ATEXIT__ = []; // functions called during shutdown
1129
+ var __ATPOSTRUN__ = []; // functions called after the main() is called
1130
+
1131
+ var runtimeInitialized = false;
1132
+ var runtimeExited = false;
1133
+
1134
+ __ATINIT__.push({ func: function() { ___wasm_call_ctors() } });
1135
+
1136
+ function preRun() {
1137
+
1138
+ if (Module['preRun']) {
1139
+ if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];
1140
+ while (Module['preRun'].length) {
1141
+ addOnPreRun(Module['preRun'].shift());
1142
+ }
1143
+ }
1144
+
1145
+ callRuntimeCallbacks(__ATPRERUN__);
1146
+ }
1147
+
1148
+ function initRuntime() {
1149
+ runtimeInitialized = true;
1150
+
1151
+ callRuntimeCallbacks(__ATINIT__);
1152
+ }
1153
+
1154
+ function preMain() {
1155
+
1156
+ callRuntimeCallbacks(__ATMAIN__);
1157
+ }
1158
+
1159
+ function exitRuntime() {
1160
+ runtimeExited = true;
1161
+ }
1162
+
1163
+ function postRun() {
1164
+
1165
+ if (Module['postRun']) {
1166
+ if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];
1167
+ while (Module['postRun'].length) {
1168
+ addOnPostRun(Module['postRun'].shift());
1169
+ }
1170
+ }
1171
+
1172
+ callRuntimeCallbacks(__ATPOSTRUN__);
1173
+ }
1174
+
1175
+ function addOnPreRun(cb) {
1176
+ __ATPRERUN__.unshift(cb);
1177
+ }
1178
+
1179
+ function addOnInit(cb) {
1180
+ __ATINIT__.unshift(cb);
1181
+ }
1182
+
1183
+ function addOnPreMain(cb) {
1184
+ __ATMAIN__.unshift(cb);
1185
+ }
1186
+
1187
+ function addOnExit(cb) {
1188
+ }
1189
+
1190
+ function addOnPostRun(cb) {
1191
+ __ATPOSTRUN__.unshift(cb);
1192
+ }
1193
+
1194
+ // include: runtime_math.js
1195
+
1196
+
1197
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul
1198
+
1199
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround
1200
+
1201
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32
1202
+
1203
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc
1204
+
1205
+ // end include: runtime_math.js
1206
+ // A counter of dependencies for calling run(). If we need to
1207
+ // do asynchronous work before running, increment this and
1208
+ // decrement it. Incrementing must happen in a place like
1209
+ // Module.preRun (used by emcc to add file preloading).
1210
+ // Note that you can add dependencies in preRun, even though
1211
+ // it happens right before run - run will be postponed until
1212
+ // the dependencies are met.
1213
+ var runDependencies = 0;
1214
+ var runDependencyWatcher = null;
1215
+ var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled
1216
+
1217
+ function getUniqueRunDependency(id) {
1218
+ return id;
1219
+ }
1220
+
1221
+ function addRunDependency(id) {
1222
+ runDependencies++;
1223
+
1224
+ if (Module['monitorRunDependencies']) {
1225
+ Module['monitorRunDependencies'](runDependencies);
1226
+ }
1227
+
1228
+ }
1229
+
1230
+ function removeRunDependency(id) {
1231
+ runDependencies--;
1232
+
1233
+ if (Module['monitorRunDependencies']) {
1234
+ Module['monitorRunDependencies'](runDependencies);
1235
+ }
1236
+
1237
+ if (runDependencies == 0) {
1238
+ if (runDependencyWatcher !== null) {
1239
+ clearInterval(runDependencyWatcher);
1240
+ runDependencyWatcher = null;
1241
+ }
1242
+ if (dependenciesFulfilled) {
1243
+ var callback = dependenciesFulfilled;
1244
+ dependenciesFulfilled = null;
1245
+ callback(); // can add another dependenciesFulfilled
1246
+ }
1247
+ }
1248
+ }
1249
+
1250
+ Module["preloadedImages"] = {}; // maps url to image data
1251
+ Module["preloadedAudios"] = {}; // maps url to audio data
1252
+
1253
+ /** @param {string|number=} what */
1254
+ function abort(what) {
1255
+ if (Module['onAbort']) {
1256
+ Module['onAbort'](what);
1257
+ }
1258
+
1259
+ what += '';
1260
+ err(what);
1261
+
1262
+ ABORT = true;
1263
+ EXITSTATUS = 1;
1264
+
1265
+ what = 'abort(' + what + '). Build with -s ASSERTIONS=1 for more info.';
1266
+
1267
+ // Use a wasm runtime error, because a JS error might be seen as a foreign
1268
+ // exception, which means we'd run destructors on it. We need the error to
1269
+ // simply make the program stop.
1270
+ var e = new WebAssembly.RuntimeError(what);
1271
+
1272
+ readyPromiseReject(e);
1273
+ // Throw the error whether or not MODULARIZE is set because abort is used
1274
+ // in code paths apart from instantiation where an exception is expected
1275
+ // to be thrown when abort is called.
1276
+ throw e;
1277
+ }
1278
+
1279
+ // {{MEM_INITIALIZER}}
1280
+
1281
+ // include: memoryprofiler.js
1282
+
1283
+
1284
+ // end include: memoryprofiler.js
1285
+ // include: URIUtils.js
1286
+
1287
+
1288
+ function hasPrefix(str, prefix) {
1289
+ return String.prototype.startsWith ?
1290
+ str.startsWith(prefix) :
1291
+ str.indexOf(prefix) === 0;
1292
+ }
1293
+
1294
+ // Prefix of data URIs emitted by SINGLE_FILE and related options.
1295
+ var dataURIPrefix = 'data:application/octet-stream;base64,';
1296
+
1297
+ // Indicates whether filename is a base64 data URI.
1298
+ function isDataURI(filename) {
1299
+ return hasPrefix(filename, dataURIPrefix);
1300
+ }
1301
+
1302
+ var fileURIPrefix = "file://";
1303
+
1304
+ // Indicates whether filename is delivered via file protocol (as opposed to http/https)
1305
+ function isFileURI(filename) {
1306
+ return hasPrefix(filename, fileURIPrefix);
1307
+ }
1308
+
1309
+ // end include: URIUtils.js
1310
+ var wasmBinaryFile = 'libipvp-simd.wasm';
1311
+ if (!isDataURI(wasmBinaryFile)) {
1312
+ wasmBinaryFile = locateFile(wasmBinaryFile);
1313
+ }
1314
+
1315
+ function getBinary(file) {
1316
+ try {
1317
+ if (file == wasmBinaryFile && wasmBinary) {
1318
+ return new Uint8Array(wasmBinary);
1319
+ }
1320
+ if (readBinary) {
1321
+ return readBinary(file);
1322
+ } else {
1323
+ throw "both async and sync fetching of the wasm failed";
1324
+ }
1325
+ }
1326
+ catch (err) {
1327
+ abort(err);
1328
+ }
1329
+ }
1330
+
1331
+ function getBinaryPromise() {
1332
+ if ((typeof __wxjs_environment !== 'undefined' && __wxjs_environment === 'miniprogram') || typeof worker !== 'undefined') {
1333
+ return Promise.resolve(wasmBinary || wasmBinaryFile);
1334
+ }
1335
+
1336
+ // If we don't have the binary yet, try to to load it asynchronously.
1337
+ // Fetch has some additional restrictions over XHR, like it can't be used on a file:// url.
1338
+ // See https://github.com/github/fetch/pull/92#issuecomment-140665932
1339
+ // Cordova or Electron apps are typically loaded from a file:// url.
1340
+ // So use fetch if it is available and the url is not a file, otherwise fall back to XHR.
1341
+ if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {
1342
+ if (typeof fetch === 'function'
1343
+ && !isFileURI(wasmBinaryFile)
1344
+ ) {
1345
+ return fetch(wasmBinaryFile, { credentials: 'same-origin' }).then(function(response) {
1346
+ if (!response['ok']) {
1347
+ throw "failed to load wasm binary file at '" + wasmBinaryFile + "'";
1348
+ }
1349
+ return response['arrayBuffer']();
1350
+ }).catch(function () {
1351
+ return getBinary(wasmBinaryFile);
1352
+ });
1353
+ }
1354
+ else {
1355
+ if (readAsync) {
1356
+ // fetch is not available or url is file => try XHR (readAsync uses XHR internally)
1357
+ return new Promise(function(resolve, reject) {
1358
+ readAsync(wasmBinaryFile, function(response) { resolve(new Uint8Array(/** @type{!ArrayBuffer} */(response))) }, reject)
1359
+ });
1360
+ }
1361
+ }
1362
+ }
1363
+
1364
+ // Otherwise, getBinary should be able to get it synchronously
1365
+ return Promise.resolve().then(function() { return getBinary(wasmBinaryFile); });
1366
+ }
1367
+
1368
+ // Create the wasm instance.
1369
+ // Receives the wasm imports, returns the exports.
1370
+ function createWasm() {
1371
+ // prepare imports
1372
+ var info = {
1373
+ 'env': asmLibraryArg,
1374
+ 'wasi_snapshot_preview1': asmLibraryArg,
1375
+ };
1376
+ // Load the wasm module and create an instance of using native support in the JS engine.
1377
+ // handle a generated wasm instance, receiving its exports and
1378
+ // performing other necessary setup
1379
+ /** @param {WebAssembly.Module=} module*/
1380
+ function receiveInstance(instance, module) {
1381
+ var exports = instance.exports;
1382
+
1383
+ Module['asm'] = exports;
1384
+
1385
+ wasmMemory = Module['asm']['memory'];
1386
+ updateGlobalBufferAndViews(wasmMemory.buffer);
1387
+
1388
+ wasmTable = Module['asm']['__indirect_function_table'];
1389
+
1390
+ removeRunDependency('wasm-instantiate');
1391
+ }
1392
+ // we can't run yet (except in a pthread, where we have a custom sync instantiator)
1393
+ addRunDependency('wasm-instantiate');
1394
+
1395
+ function receiveInstantiatedSource(output) {
1396
+ // 'output' is a WebAssemblyInstantiatedSource object which has both the module and instance.
1397
+ // receiveInstance() will swap in the exports (to Module.asm) so they can be called
1398
+ // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.
1399
+ // When the regression is fixed, can restore the above USE_PTHREADS-enabled path.
1400
+ receiveInstance(output['instance']);
1401
+ }
1402
+
1403
+ function instantiateArrayBuffer(receiver) {
1404
+ return getBinaryPromise().then(function(binary) {
1405
+ return WebAssembly.instantiate(binary, info);
1406
+ }).then(receiver, function(reason) {
1407
+ err('failed to asynchronously prepare wasm: ' + reason);
1408
+
1409
+ abort(reason);
1410
+ });
1411
+ }
1412
+
1413
+ // Prefer streaming instantiation if available.
1414
+ function instantiateAsync() {
1415
+ if (!wasmBinary &&
1416
+ typeof WebAssembly.instantiateStreaming === 'function' &&
1417
+ !isDataURI(wasmBinaryFile) &&
1418
+ // Don't use streaming for file:// delivered objects in a webview, fetch them synchronously.
1419
+ !isFileURI(wasmBinaryFile) &&
1420
+ typeof fetch === 'function') {
1421
+ return fetch(wasmBinaryFile, { credentials: 'same-origin' }).then(function (response) {
1422
+ var result = WebAssembly.instantiateStreaming(response, info);
1423
+ return result.then(receiveInstantiatedSource, function(reason) {
1424
+ // We expect the most common failure cause to be a bad MIME type for the binary,
1425
+ // in which case falling back to ArrayBuffer instantiation should work.
1426
+ err('wasm streaming compile failed: ' + reason);
1427
+ err('falling back to ArrayBuffer instantiation');
1428
+ return instantiateArrayBuffer(receiveInstantiatedSource);
1429
+ });
1430
+ });
1431
+ } else {
1432
+ return instantiateArrayBuffer(receiveInstantiatedSource);
1433
+ }
1434
+ }
1435
+
1436
+ // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback
1437
+ // to manually instantiate the Wasm module themselves. This allows pages to run the instantiation parallel
1438
+ // to any other async startup actions they are performing.
1439
+ if (Module['instantiateWasm']) {
1440
+ try {
1441
+ var exports = Module['instantiateWasm'](info, receiveInstance);
1442
+ return exports;
1443
+ } catch(e) {
1444
+ err('Module.instantiateWasm callback failed with error: ' + e);
1445
+ return false;
1446
+ }
1447
+ }
1448
+
1449
+ // If instantiation fails, reject the module ready promise.
1450
+ instantiateAsync().catch(readyPromiseReject);
1451
+ return {}; // no exports yet; we'll fill them in later
1452
+ }
1453
+
1454
+ // Globals used by JS i64 conversions (see makeSetValue)
1455
+ var tempDouble;
1456
+ var tempI64;
1457
+
1458
+ // === Body ===
1459
+
1460
+ var ASM_CONSTS = {
1461
+
1462
+ };
1463
+
1464
+
1465
+
1466
+
1467
+
1468
+
1469
+ function callRuntimeCallbacks(callbacks) {
1470
+ while(callbacks.length > 0) {
1471
+ var callback = callbacks.shift();
1472
+ if (typeof callback == 'function') {
1473
+ callback(Module); // Pass the module as the first argument.
1474
+ continue;
1475
+ }
1476
+ var func = callback.func;
1477
+ if (typeof func === 'number') {
1478
+ if (callback.arg === undefined) {
1479
+ wasmTable.get(func)();
1480
+ } else {
1481
+ wasmTable.get(func)(callback.arg);
1482
+ }
1483
+ } else {
1484
+ func(callback.arg === undefined ? null : callback.arg);
1485
+ }
1486
+ }
1487
+ }
1488
+
1489
+ function demangle(func) {
1490
+ return func;
1491
+ }
1492
+
1493
+ function demangleAll(text) {
1494
+ var regex =
1495
+ /\b_Z[\w\d_]+/g;
1496
+ return text.replace(regex,
1497
+ function(x) {
1498
+ var y = demangle(x);
1499
+ return x === y ? x : (y + ' [' + x + ']');
1500
+ });
1501
+ }
1502
+
1503
+ function jsStackTrace() {
1504
+ var error = new Error();
1505
+ if (!error.stack) {
1506
+ // IE10+ special cases: It does have callstack info, but it is only populated if an Error object is thrown,
1507
+ // so try that as a special-case.
1508
+ try {
1509
+ throw new Error();
1510
+ } catch(e) {
1511
+ error = e;
1512
+ }
1513
+ if (!error.stack) {
1514
+ return '(no stack trace available)';
1515
+ }
1516
+ }
1517
+ return error.stack.toString();
1518
+ }
1519
+
1520
+ function stackTrace() {
1521
+ var js = jsStackTrace();
1522
+ if (Module['extraStackTrace']) js += '\n' + Module['extraStackTrace']();
1523
+ return demangleAll(js);
1524
+ }
1525
+
1526
+ function ___assert_fail(condition, filename, line, func) {
1527
+ abort('Assertion failed: ' + UTF8ToString(condition) + ', at: ' + [filename ? UTF8ToString(filename) : 'unknown filename', line, func ? UTF8ToString(func) : 'unknown function']);
1528
+ }
1529
+
1530
+ function _atexit(func, arg) {
1531
+ }
1532
+ function ___cxa_atexit(a0,a1
1533
+ ) {
1534
+ return _atexit(a0,a1);
1535
+ }
1536
+
1537
+ var tupleRegistrations={};
1538
+
1539
+ function runDestructors(destructors) {
1540
+ while (destructors.length) {
1541
+ var ptr = destructors.pop();
1542
+ var del = destructors.pop();
1543
+ del(ptr);
1544
+ }
1545
+ }
1546
+
1547
+ function simpleReadValueFromPointer(pointer) {
1548
+ return this['fromWireType'](HEAPU32[pointer >> 2]);
1549
+ }
1550
+
1551
+ var awaitingDependencies={};
1552
+
1553
+ var registeredTypes={};
1554
+
1555
+ var typeDependencies={};
1556
+
1557
+ var char_0=48;
1558
+
1559
+ var char_9=57;
1560
+ function makeLegalFunctionName(name) {
1561
+ if (undefined === name) {
1562
+ return '_unknown';
1563
+ }
1564
+ name = name.replace(/[^a-zA-Z0-9_]/g, '$');
1565
+ var f = name.charCodeAt(0);
1566
+ if (f >= char_0 && f <= char_9) {
1567
+ return '_' + name;
1568
+ } else {
1569
+ return name;
1570
+ }
1571
+ }
1572
+ function createNamedFunction(name, body) {
1573
+ return body;
1574
+ }
1575
+ function extendError(baseErrorType, errorName) {
1576
+ var errorClass = createNamedFunction(errorName, function(message) {
1577
+ this.name = errorName;
1578
+ this.message = message;
1579
+
1580
+ var stack = (new Error(message)).stack;
1581
+ if (stack !== undefined) {
1582
+ this.stack = this.toString() + '\n' +
1583
+ stack.replace(/^Error(:[^\n]*)?\n/, '');
1584
+ }
1585
+ });
1586
+ errorClass.prototype = Object.create(baseErrorType.prototype);
1587
+ errorClass.prototype.constructor = errorClass;
1588
+ errorClass.prototype.toString = function() {
1589
+ if (this.message === undefined) {
1590
+ return this.name;
1591
+ } else {
1592
+ return this.name + ': ' + this.message;
1593
+ }
1594
+ };
1595
+
1596
+ return errorClass;
1597
+ }
1598
+ var InternalError=undefined;
1599
+ function throwInternalError(message) {
1600
+ throw new InternalError(message);
1601
+ }
1602
+ function whenDependentTypesAreResolved(myTypes, dependentTypes, getTypeConverters) {
1603
+ myTypes.forEach(function(type) {
1604
+ typeDependencies[type] = dependentTypes;
1605
+ });
1606
+
1607
+ function onComplete(typeConverters) {
1608
+ var myTypeConverters = getTypeConverters(typeConverters);
1609
+ if (myTypeConverters.length !== myTypes.length) {
1610
+ throwInternalError('Mismatched type converter count');
1611
+ }
1612
+ for (var i = 0; i < myTypes.length; ++i) {
1613
+ registerType(myTypes[i], myTypeConverters[i]);
1614
+ }
1615
+ }
1616
+
1617
+ var typeConverters = new Array(dependentTypes.length);
1618
+ var unregisteredTypes = [];
1619
+ var registered = 0;
1620
+ dependentTypes.forEach(function(dt, i) {
1621
+ if (registeredTypes.hasOwnProperty(dt)) {
1622
+ typeConverters[i] = registeredTypes[dt];
1623
+ } else {
1624
+ unregisteredTypes.push(dt);
1625
+ if (!awaitingDependencies.hasOwnProperty(dt)) {
1626
+ awaitingDependencies[dt] = [];
1627
+ }
1628
+ awaitingDependencies[dt].push(function() {
1629
+ typeConverters[i] = registeredTypes[dt];
1630
+ ++registered;
1631
+ if (registered === unregisteredTypes.length) {
1632
+ onComplete(typeConverters);
1633
+ }
1634
+ });
1635
+ }
1636
+ });
1637
+ if (0 === unregisteredTypes.length) {
1638
+ onComplete(typeConverters);
1639
+ }
1640
+ }
1641
+ function __embind_finalize_value_array(rawTupleType) {
1642
+ var reg = tupleRegistrations[rawTupleType];
1643
+ delete tupleRegistrations[rawTupleType];
1644
+ var elements = reg.elements;
1645
+ var elementsLength = elements.length;
1646
+ var elementTypes = elements.map(function(elt) { return elt.getterReturnType; }).
1647
+ concat(elements.map(function(elt) { return elt.setterArgumentType; }));
1648
+
1649
+ var rawConstructor = reg.rawConstructor;
1650
+ var rawDestructor = reg.rawDestructor;
1651
+
1652
+ whenDependentTypesAreResolved([rawTupleType], elementTypes, function(elementTypes) {
1653
+ elements.forEach(function(elt, i) {
1654
+ var getterReturnType = elementTypes[i];
1655
+ var getter = elt.getter;
1656
+ var getterContext = elt.getterContext;
1657
+ var setterArgumentType = elementTypes[i + elementsLength];
1658
+ var setter = elt.setter;
1659
+ var setterContext = elt.setterContext;
1660
+ elt.read = function(ptr) {
1661
+ return getterReturnType['fromWireType'](getter(getterContext, ptr));
1662
+ };
1663
+ elt.write = function(ptr, o) {
1664
+ var destructors = [];
1665
+ setter(setterContext, ptr, setterArgumentType['toWireType'](destructors, o));
1666
+ runDestructors(destructors);
1667
+ };
1668
+ });
1669
+
1670
+ return [{
1671
+ name: reg.name,
1672
+ 'fromWireType': function(ptr) {
1673
+ var rv = new Array(elementsLength);
1674
+ for (var i = 0; i < elementsLength; ++i) {
1675
+ rv[i] = elements[i].read(ptr);
1676
+ }
1677
+ rawDestructor(ptr);
1678
+ return rv;
1679
+ },
1680
+ 'toWireType': function(destructors, o) {
1681
+ if (elementsLength !== o.length) {
1682
+ throw new TypeError("Incorrect number of tuple elements for " + reg.name + ": expected=" + elementsLength + ", actual=" + o.length);
1683
+ }
1684
+ var ptr = rawConstructor();
1685
+ for (var i = 0; i < elementsLength; ++i) {
1686
+ elements[i].write(ptr, o[i]);
1687
+ }
1688
+ if (destructors !== null) {
1689
+ destructors.push(rawDestructor, ptr);
1690
+ }
1691
+ return ptr;
1692
+ },
1693
+ 'argPackAdvance': 8,
1694
+ 'readValueFromPointer': simpleReadValueFromPointer,
1695
+ destructorFunction: rawDestructor,
1696
+ }];
1697
+ });
1698
+ }
1699
+
1700
+ var structRegistrations={};
1701
+ function __embind_finalize_value_object(structType) {
1702
+ var reg = structRegistrations[structType];
1703
+ delete structRegistrations[structType];
1704
+
1705
+ var rawConstructor = reg.rawConstructor;
1706
+ var rawDestructor = reg.rawDestructor;
1707
+ var fieldRecords = reg.fields;
1708
+ var fieldTypes = fieldRecords.map(function(field) { return field.getterReturnType; }).
1709
+ concat(fieldRecords.map(function(field) { return field.setterArgumentType; }));
1710
+ whenDependentTypesAreResolved([structType], fieldTypes, function(fieldTypes) {
1711
+ var fields = {};
1712
+ fieldRecords.forEach(function(field, i) {
1713
+ var fieldName = field.fieldName;
1714
+ var getterReturnType = fieldTypes[i];
1715
+ var getter = field.getter;
1716
+ var getterContext = field.getterContext;
1717
+ var setterArgumentType = fieldTypes[i + fieldRecords.length];
1718
+ var setter = field.setter;
1719
+ var setterContext = field.setterContext;
1720
+ fields[fieldName] = {
1721
+ read: function(ptr) {
1722
+ return getterReturnType['fromWireType'](
1723
+ getter(getterContext, ptr));
1724
+ },
1725
+ write: function(ptr, o) {
1726
+ var destructors = [];
1727
+ setter(setterContext, ptr, setterArgumentType['toWireType'](destructors, o));
1728
+ runDestructors(destructors);
1729
+ }
1730
+ };
1731
+ });
1732
+
1733
+ return [{
1734
+ name: reg.name,
1735
+ 'fromWireType': function(ptr) {
1736
+ var rv = {};
1737
+ for (var i in fields) {
1738
+ rv[i] = fields[i].read(ptr);
1739
+ }
1740
+ rawDestructor(ptr);
1741
+ return rv;
1742
+ },
1743
+ 'toWireType': function(destructors, o) {
1744
+ // todo: Here we have an opportunity for -O3 level "unsafe" optimizations:
1745
+ // assume all fields are present without checking.
1746
+ for (var fieldName in fields) {
1747
+ if (!(fieldName in o)) {
1748
+ throw new TypeError('Missing field: "' + fieldName + '"');
1749
+ }
1750
+ }
1751
+ var ptr = rawConstructor();
1752
+ for (fieldName in fields) {
1753
+ fields[fieldName].write(ptr, o[fieldName]);
1754
+ }
1755
+ if (destructors !== null) {
1756
+ destructors.push(rawDestructor, ptr);
1757
+ }
1758
+ return ptr;
1759
+ },
1760
+ 'argPackAdvance': 8,
1761
+ 'readValueFromPointer': simpleReadValueFromPointer,
1762
+ destructorFunction: rawDestructor,
1763
+ }];
1764
+ });
1765
+ }
1766
+
1767
+ function getShiftFromSize(size) {
1768
+ switch (size) {
1769
+ case 1: return 0;
1770
+ case 2: return 1;
1771
+ case 4: return 2;
1772
+ case 8: return 3;
1773
+ default:
1774
+ throw new TypeError('Unknown type size: ' + size);
1775
+ }
1776
+ }
1777
+
1778
+ function embind_init_charCodes() {
1779
+ var codes = new Array(256);
1780
+ for (var i = 0; i < 256; ++i) {
1781
+ codes[i] = String.fromCharCode(i);
1782
+ }
1783
+ embind_charCodes = codes;
1784
+ }
1785
+ var embind_charCodes=undefined;
1786
+ function readLatin1String(ptr) {
1787
+ var ret = "";
1788
+ var c = ptr;
1789
+ while (HEAPU8[c]) {
1790
+ ret += embind_charCodes[HEAPU8[c++]];
1791
+ }
1792
+ return ret;
1793
+ }
1794
+
1795
+ var BindingError=undefined;
1796
+ function throwBindingError(message) {
1797
+ throw new BindingError(message);
1798
+ }
1799
+ /** @param {Object=} options */
1800
+ function registerType(rawType, registeredInstance, options) {
1801
+ options = options || {};
1802
+
1803
+ if (!('argPackAdvance' in registeredInstance)) {
1804
+ throw new TypeError('registerType registeredInstance requires argPackAdvance');
1805
+ }
1806
+
1807
+ var name = registeredInstance.name;
1808
+ if (!rawType) {
1809
+ throwBindingError('type "' + name + '" must have a positive integer typeid pointer');
1810
+ }
1811
+ if (registeredTypes.hasOwnProperty(rawType)) {
1812
+ if (options.ignoreDuplicateRegistrations) {
1813
+ return;
1814
+ } else {
1815
+ throwBindingError("Cannot register type '" + name + "' twice");
1816
+ }
1817
+ }
1818
+
1819
+ registeredTypes[rawType] = registeredInstance;
1820
+ delete typeDependencies[rawType];
1821
+
1822
+ if (awaitingDependencies.hasOwnProperty(rawType)) {
1823
+ var callbacks = awaitingDependencies[rawType];
1824
+ delete awaitingDependencies[rawType];
1825
+ callbacks.forEach(function(cb) {
1826
+ cb();
1827
+ });
1828
+ }
1829
+ }
1830
+ function __embind_register_bool(rawType, name, size, trueValue, falseValue) {
1831
+ var shift = getShiftFromSize(size);
1832
+
1833
+ name = readLatin1String(name);
1834
+ registerType(rawType, {
1835
+ name: name,
1836
+ 'fromWireType': function(wt) {
1837
+ // ambiguous emscripten ABI: sometimes return values are
1838
+ // true or false, and sometimes integers (0 or 1)
1839
+ return !!wt;
1840
+ },
1841
+ 'toWireType': function(destructors, o) {
1842
+ return o ? trueValue : falseValue;
1843
+ },
1844
+ 'argPackAdvance': 8,
1845
+ 'readValueFromPointer': function(pointer) {
1846
+ // TODO: if heap is fixed (like in asm.js) this could be executed outside
1847
+ var heap;
1848
+ if (size === 1) {
1849
+ heap = HEAP8;
1850
+ } else if (size === 2) {
1851
+ heap = HEAP16;
1852
+ } else if (size === 4) {
1853
+ heap = HEAP32;
1854
+ } else {
1855
+ throw new TypeError("Unknown boolean type size: " + name);
1856
+ }
1857
+ return this['fromWireType'](heap[pointer >> shift]);
1858
+ },
1859
+ destructorFunction: null, // This type does not need a destructor
1860
+ });
1861
+ }
1862
+
1863
+ var emval_free_list=[];
1864
+
1865
+ var emval_handle_array=[{},{value:undefined},{value:null},{value:true},{value:false}];
1866
+ function __emval_decref(handle) {
1867
+ if (handle > 4 && 0 === --emval_handle_array[handle].refcount) {
1868
+ emval_handle_array[handle] = undefined;
1869
+ emval_free_list.push(handle);
1870
+ }
1871
+ }
1872
+
1873
+ function count_emval_handles() {
1874
+ var count = 0;
1875
+ for (var i = 5; i < emval_handle_array.length; ++i) {
1876
+ if (emval_handle_array[i] !== undefined) {
1877
+ ++count;
1878
+ }
1879
+ }
1880
+ return count;
1881
+ }
1882
+
1883
+ function get_first_emval() {
1884
+ for (var i = 5; i < emval_handle_array.length; ++i) {
1885
+ if (emval_handle_array[i] !== undefined) {
1886
+ return emval_handle_array[i];
1887
+ }
1888
+ }
1889
+ return null;
1890
+ }
1891
+ function init_emval() {
1892
+ Module['count_emval_handles'] = count_emval_handles;
1893
+ Module['get_first_emval'] = get_first_emval;
1894
+ }
1895
+ function __emval_register(value) {
1896
+
1897
+ switch(value){
1898
+ case undefined :{ return 1; }
1899
+ case null :{ return 2; }
1900
+ case true :{ return 3; }
1901
+ case false :{ return 4; }
1902
+ default:{
1903
+ var handle = emval_free_list.length ?
1904
+ emval_free_list.pop() :
1905
+ emval_handle_array.length;
1906
+
1907
+ emval_handle_array[handle] = {refcount: 1, value: value};
1908
+ return handle;
1909
+ }
1910
+ }
1911
+ }
1912
+ function __embind_register_emval(rawType, name) {
1913
+ name = readLatin1String(name);
1914
+ registerType(rawType, {
1915
+ name: name,
1916
+ 'fromWireType': function(handle) {
1917
+ var rv = emval_handle_array[handle].value;
1918
+ __emval_decref(handle);
1919
+ return rv;
1920
+ },
1921
+ 'toWireType': function(destructors, value) {
1922
+ return __emval_register(value);
1923
+ },
1924
+ 'argPackAdvance': 8,
1925
+ 'readValueFromPointer': simpleReadValueFromPointer,
1926
+ destructorFunction: null, // This type does not need a destructor
1927
+
1928
+ // TODO: do we need a deleteObject here? write a test where
1929
+ // emval is passed into JS via an interface
1930
+ });
1931
+ }
1932
+
1933
+ function _embind_repr(v) {
1934
+ if (v === null) {
1935
+ return 'null';
1936
+ }
1937
+ var t = typeof v;
1938
+ if (t === 'object' || t === 'array' || t === 'function') {
1939
+ return v.toString();
1940
+ } else {
1941
+ return '' + v;
1942
+ }
1943
+ }
1944
+
1945
+ function floatReadValueFromPointer(name, shift) {
1946
+ switch (shift) {
1947
+ case 2: return function(pointer) {
1948
+ return this['fromWireType'](HEAPF32[pointer >> 2]);
1949
+ };
1950
+ case 3: return function(pointer) {
1951
+ return this['fromWireType'](HEAPF64[pointer >> 3]);
1952
+ };
1953
+ default:
1954
+ throw new TypeError("Unknown float type: " + name);
1955
+ }
1956
+ }
1957
+ function __embind_register_float(rawType, name, size) {
1958
+ var shift = getShiftFromSize(size);
1959
+ name = readLatin1String(name);
1960
+ registerType(rawType, {
1961
+ name: name,
1962
+ 'fromWireType': function(value) {
1963
+ return value;
1964
+ },
1965
+ 'toWireType': function(destructors, value) {
1966
+ // todo: Here we have an opportunity for -O3 level "unsafe" optimizations: we could
1967
+ // avoid the following if() and assume value is of proper type.
1968
+ if (typeof value !== "number" && typeof value !== "boolean") {
1969
+ throw new TypeError('Cannot convert "' + _embind_repr(value) + '" to ' + this.name);
1970
+ }
1971
+ return value;
1972
+ },
1973
+ 'argPackAdvance': 8,
1974
+ 'readValueFromPointer': floatReadValueFromPointer(name, shift),
1975
+ destructorFunction: null, // This type does not need a destructor
1976
+ });
1977
+ }
1978
+
1979
+ function new_(constructor, argumentList) {
1980
+ if (!(constructor instanceof Function)) {
1981
+ throw new TypeError('new_ called with constructor type ' + typeof(constructor) + " which is not a function");
1982
+ }
1983
+
1984
+ /*
1985
+ * Previously, the following line was just:
1986
+
1987
+ function dummy() {};
1988
+
1989
+ * Unfortunately, Chrome was preserving 'dummy' as the object's name, even though at creation, the 'dummy' has the
1990
+ * correct constructor name. Thus, objects created with IMVU.new would show up in the debugger as 'dummy', which
1991
+ * isn't very helpful. Using IMVU.createNamedFunction addresses the issue. Doublely-unfortunately, there's no way
1992
+ * to write a test for this behavior. -NRD 2013.02.22
1993
+ */
1994
+ var dummy = createNamedFunction(constructor.name || 'unknownFunctionName', function(){});
1995
+ dummy.prototype = constructor.prototype;
1996
+ var obj = new dummy;
1997
+
1998
+ var r = constructor.apply(obj, argumentList);
1999
+ return (r instanceof Object) ? r : obj;
2000
+ }
2001
+ function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc) {
2002
+ // humanName: a human-readable string name for the function to be generated.
2003
+ // argTypes: An array that contains the embind type objects for all types in the function signature.
2004
+ // argTypes[0] is the type object for the function return value.
2005
+ // argTypes[1] is the type object for function this object/class type, or null if not crafting an invoker for a class method.
2006
+ // argTypes[2...] are the actual function parameters.
2007
+ // classType: The embind type object for the class to be bound, or null if this is not a method of a class.
2008
+ // cppInvokerFunc: JS Function object to the C++-side function that interops into C++ code.
2009
+ // cppTargetFunc: Function pointer (an integer to FUNCTION_TABLE) to the target C++ function the cppInvokerFunc will end up calling.
2010
+ var argCount = argTypes.length;
2011
+
2012
+ if (argCount < 2) {
2013
+ throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!");
2014
+ }
2015
+
2016
+ var isClassMethodFunc = (argTypes[1] !== null && classType !== null);
2017
+
2018
+ var needsDestructorStack = false;
2019
+
2020
+ for(var i = 1; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here.
2021
+ if (argTypes[i] !== null && argTypes[i]['destructorFunction'] === undefined) { // The type does not define a destructor function - must use dynamic stack
2022
+ needsDestructorStack = true;
2023
+ break;
2024
+ }
2025
+ }
2026
+
2027
+ var returns = (argTypes[0].name !== "void");
2028
+
2029
+ var invoker = cppInvokerFunc;
2030
+ var fn = cppTargetFunc;
2031
+ var retType = argTypes[0];
2032
+ var classParam = argTypes[1];
2033
+
2034
+ return function craftInvoker() {
2035
+ if (arguments.length !== argCount - 2) {
2036
+ throwBindingError(`function ${humanName} called with ${arguments.length} arguments, expected "${argCount - 2}" args!`);
2037
+ }
2038
+
2039
+ var destructors = [];
2040
+ var dtorStack = needsDestructorStack ? destructors : null;
2041
+
2042
+ var thisWired;
2043
+ var argsWired = [];
2044
+
2045
+ if (isClassMethodFunc) {
2046
+ thisWired = classParam['toWireType'](dtorStack, this);
2047
+ argsWired.push(thisWired);
2048
+ }
2049
+
2050
+ for(var i = 0; i < argCount - 2; ++i) {
2051
+ argsWired.push(argTypes[i + 2]['toWireType'](dtorStack, arguments[i]));
2052
+ }
2053
+
2054
+ var rv = invoker(fn, ...argsWired);
2055
+
2056
+ if (needsDestructorStack) {
2057
+ runDestructors(destructors);
2058
+ } else {
2059
+ var from = isClassMethodFunc ? 1 : 2;
2060
+ for(var i = from; i < argCount; ++i) { // Skip return value at index 0 - it's not deleted here. Also skip class type if not a method.
2061
+ var dtor = argTypes[i]['destructorFunction'];
2062
+ if (dtor) {
2063
+ dtor(argsWired[i - from]);
2064
+ }
2065
+ }
2066
+ }
2067
+
2068
+ if (returns) {
2069
+ return retType['fromWireType'](rv);
2070
+ }
2071
+ }
2072
+ }
2073
+
2074
+ function ensureOverloadTable(proto, methodName, humanName) {
2075
+ if (undefined === proto[methodName].overloadTable) {
2076
+ var prevFunc = proto[methodName];
2077
+ // Inject an overload resolver function that routes to the appropriate overload based on the number of arguments.
2078
+ proto[methodName] = function() {
2079
+ // TODO This check can be removed in -O3 level "unsafe" optimizations.
2080
+ if (!proto[methodName].overloadTable.hasOwnProperty(arguments.length)) {
2081
+ throwBindingError("Function '" + humanName + "' called with an invalid number of arguments (" + arguments.length + ") - expects one of (" + proto[methodName].overloadTable + ")!");
2082
+ }
2083
+ return proto[methodName].overloadTable[arguments.length].apply(this, arguments);
2084
+ };
2085
+ // Move the previous function into the overload table.
2086
+ proto[methodName].overloadTable = [];
2087
+ proto[methodName].overloadTable[prevFunc.argCount] = prevFunc;
2088
+ }
2089
+ }
2090
+ /** @param {number=} numArguments */
2091
+ function exposePublicSymbol(name, value, numArguments) {
2092
+ if (Module.hasOwnProperty(name)) {
2093
+ if (undefined === numArguments || (undefined !== Module[name].overloadTable && undefined !== Module[name].overloadTable[numArguments])) {
2094
+ throwBindingError("Cannot register public name '" + name + "' twice");
2095
+ }
2096
+
2097
+ // We are exposing a function with the same name as an existing function. Create an overload table and a function selector
2098
+ // that routes between the two.
2099
+ ensureOverloadTable(Module, name, name);
2100
+ if (Module.hasOwnProperty(numArguments)) {
2101
+ throwBindingError("Cannot register multiple overloads of a function with the same number of arguments (" + numArguments + ")!");
2102
+ }
2103
+ // Add the new function into the overload table.
2104
+ Module[name].overloadTable[numArguments] = value;
2105
+ }
2106
+ else {
2107
+ Module[name] = value;
2108
+ if (undefined !== numArguments) {
2109
+ Module[name].numArguments = numArguments;
2110
+ }
2111
+ }
2112
+ }
2113
+
2114
+ function heap32VectorToArray(count, firstElement) {
2115
+ var array = [];
2116
+ for (var i = 0; i < count; i++) {
2117
+ array.push(HEAP32[(firstElement >> 2) + i]);
2118
+ }
2119
+ return array;
2120
+ }
2121
+
2122
+ /** @param {number=} numArguments */
2123
+ function replacePublicSymbol(name, value, numArguments) {
2124
+ if (!Module.hasOwnProperty(name)) {
2125
+ throwInternalError('Replacing nonexistant public symbol');
2126
+ }
2127
+ // If there's an overload table for this symbol, replace the symbol in the overload table instead.
2128
+ if (undefined !== Module[name].overloadTable && undefined !== numArguments) {
2129
+ Module[name].overloadTable[numArguments] = value;
2130
+ }
2131
+ else {
2132
+ Module[name] = value;
2133
+ Module[name].argCount = numArguments;
2134
+ }
2135
+ }
2136
+
2137
+ function dynCallLegacy(sig, ptr, args) {
2138
+ if (args && args.length) {
2139
+ return Module['dynCall_' + sig].apply(null, [ptr].concat(args));
2140
+ }
2141
+ return Module['dynCall_' + sig].call(null, ptr);
2142
+ }
2143
+ function dynCall(sig, ptr, args) {
2144
+ // Without WASM_BIGINT support we cannot directly call function with i64 as
2145
+ // part of thier signature, so we rely the dynCall functions generated by
2146
+ // wasm-emscripten-finalize
2147
+ if (sig.indexOf('j') != -1) {
2148
+ return dynCallLegacy(sig, ptr, args);
2149
+ }
2150
+ return wasmTable.get(ptr).apply(null, args)
2151
+ }
2152
+ function getDynCaller(sig, ptr) {
2153
+ assert(sig.indexOf('j') >= 0, 'getDynCaller should only be called with i64 sigs')
2154
+ var argCache = [];
2155
+ return function() {
2156
+ argCache.length = arguments.length;
2157
+ for (var i = 0; i < arguments.length; i++) {
2158
+ argCache[i] = arguments[i];
2159
+ }
2160
+ return dynCall(sig, ptr, argCache);
2161
+ };
2162
+ }
2163
+ function embind__requireFunction(signature, rawFunction) {
2164
+ signature = readLatin1String(signature);
2165
+
2166
+ function makeDynCaller() {
2167
+ if (signature.indexOf('j') != -1) {
2168
+ return getDynCaller(signature, rawFunction);
2169
+ }
2170
+ return wasmTable.get(rawFunction);
2171
+ }
2172
+
2173
+ var fp = makeDynCaller();
2174
+ if (typeof fp !== "function") {
2175
+ throwBindingError("unknown function pointer with signature " + signature + ": " + rawFunction);
2176
+ }
2177
+ return fp;
2178
+ }
2179
+
2180
+ var UnboundTypeError=undefined;
2181
+
2182
+ function getTypeName(type) {
2183
+ var ptr = ___getTypeName(type);
2184
+ var rv = readLatin1String(ptr);
2185
+ _free(ptr);
2186
+ return rv;
2187
+ }
2188
+ function throwUnboundTypeError(message, types) {
2189
+ var unboundTypes = [];
2190
+ var seen = {};
2191
+ function visit(type) {
2192
+ if (seen[type]) {
2193
+ return;
2194
+ }
2195
+ if (registeredTypes[type]) {
2196
+ return;
2197
+ }
2198
+ if (typeDependencies[type]) {
2199
+ typeDependencies[type].forEach(visit);
2200
+ return;
2201
+ }
2202
+ unboundTypes.push(type);
2203
+ seen[type] = true;
2204
+ }
2205
+ types.forEach(visit);
2206
+
2207
+ throw new UnboundTypeError(message + ': ' + unboundTypes.map(getTypeName).join([', ']));
2208
+ }
2209
+ function __embind_register_function(name, argCount, rawArgTypesAddr, signature, rawInvoker, fn) {
2210
+ var argTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
2211
+ name = readLatin1String(name);
2212
+
2213
+ rawInvoker = embind__requireFunction(signature, rawInvoker);
2214
+
2215
+ exposePublicSymbol(name, function() {
2216
+ throwUnboundTypeError('Cannot call ' + name + ' due to unbound types', argTypes);
2217
+ }, argCount - 1);
2218
+
2219
+ whenDependentTypesAreResolved([], argTypes, function(argTypes) {
2220
+ var invokerArgsArray = [argTypes[0] /* return value */, null /* no class 'this'*/].concat(argTypes.slice(1) /* actual params */);
2221
+ replacePublicSymbol(name, craftInvokerFunction(name, invokerArgsArray, null /* no class 'this'*/, rawInvoker, fn), argCount - 1);
2222
+ return [];
2223
+ });
2224
+ }
2225
+
2226
+ function integerReadValueFromPointer(name, shift, signed) {
2227
+ // integers are quite common, so generate very specialized functions
2228
+ switch (shift) {
2229
+ case 0: return signed ?
2230
+ function readS8FromPointer(pointer) { return HEAP8[pointer]; } :
2231
+ function readU8FromPointer(pointer) { return HEAPU8[pointer]; };
2232
+ case 1: return signed ?
2233
+ function readS16FromPointer(pointer) { return HEAP16[pointer >> 1]; } :
2234
+ function readU16FromPointer(pointer) { return HEAPU16[pointer >> 1]; };
2235
+ case 2: return signed ?
2236
+ function readS32FromPointer(pointer) { return HEAP32[pointer >> 2]; } :
2237
+ function readU32FromPointer(pointer) { return HEAPU32[pointer >> 2]; };
2238
+ default:
2239
+ throw new TypeError("Unknown integer type: " + name);
2240
+ }
2241
+ }
2242
+ function __embind_register_integer(primitiveType, name, size, minRange, maxRange) {
2243
+ name = readLatin1String(name);
2244
+ if (maxRange === -1) { // LLVM doesn't have signed and unsigned 32-bit types, so u32 literals come out as 'i32 -1'. Always treat those as max u32.
2245
+ maxRange = 4294967295;
2246
+ }
2247
+
2248
+ var shift = getShiftFromSize(size);
2249
+
2250
+ var fromWireType = function(value) {
2251
+ return value;
2252
+ };
2253
+
2254
+ if (minRange === 0) {
2255
+ var bitshift = 32 - 8*size;
2256
+ fromWireType = function(value) {
2257
+ return (value << bitshift) >>> bitshift;
2258
+ };
2259
+ }
2260
+
2261
+ var isUnsignedType = (name.indexOf('unsigned') != -1);
2262
+
2263
+ registerType(primitiveType, {
2264
+ name: name,
2265
+ 'fromWireType': fromWireType,
2266
+ 'toWireType': function(destructors, value) {
2267
+ // todo: Here we have an opportunity for -O3 level "unsafe" optimizations: we could
2268
+ // avoid the following two if()s and assume value is of proper type.
2269
+ if (typeof value !== "number" && typeof value !== "boolean") {
2270
+ throw new TypeError('Cannot convert "' + _embind_repr(value) + '" to ' + this.name);
2271
+ }
2272
+ if (value < minRange || value > maxRange) {
2273
+ throw new TypeError('Passing a number "' + _embind_repr(value) + '" from JS side to C/C++ side to an argument of type "' + name + '", which is outside the valid range [' + minRange + ', ' + maxRange + ']!');
2274
+ }
2275
+ return isUnsignedType ? (value >>> 0) : (value | 0);
2276
+ },
2277
+ 'argPackAdvance': 8,
2278
+ 'readValueFromPointer': integerReadValueFromPointer(name, shift, minRange !== 0),
2279
+ destructorFunction: null, // This type does not need a destructor
2280
+ });
2281
+ }
2282
+
2283
+ function __embind_register_memory_view(rawType, dataTypeIndex, name) {
2284
+ var typeMapping = [
2285
+ Int8Array,
2286
+ Uint8Array,
2287
+ Int16Array,
2288
+ Uint16Array,
2289
+ Int32Array,
2290
+ Uint32Array,
2291
+ Float32Array,
2292
+ Float64Array,
2293
+ ];
2294
+
2295
+ var TA = typeMapping[dataTypeIndex];
2296
+
2297
+ function decodeMemoryView(handle) {
2298
+ handle = handle >> 2;
2299
+ var heap = HEAPU32;
2300
+ var size = heap[handle]; // in elements
2301
+ var data = heap[handle + 1]; // byte offset into emscripten heap
2302
+ return new TA(buffer, data, size);
2303
+ }
2304
+
2305
+ name = readLatin1String(name);
2306
+ registerType(rawType, {
2307
+ name: name,
2308
+ 'fromWireType': decodeMemoryView,
2309
+ 'argPackAdvance': 8,
2310
+ 'readValueFromPointer': decodeMemoryView,
2311
+ }, {
2312
+ ignoreDuplicateRegistrations: true,
2313
+ });
2314
+ }
2315
+
2316
+ function __embind_register_std_string(rawType, name) {
2317
+ name = readLatin1String(name);
2318
+ var stdStringIsUTF8
2319
+ //process only std::string bindings with UTF8 support, in contrast to e.g. std::basic_string<unsigned char>
2320
+ = (name === "std::string");
2321
+
2322
+ registerType(rawType, {
2323
+ name: name,
2324
+ 'fromWireType': function(value) {
2325
+ var length = HEAPU32[value >> 2];
2326
+
2327
+ var str;
2328
+ if (stdStringIsUTF8) {
2329
+ var decodeStartPtr = value + 4;
2330
+ // Looping here to support possible embedded '0' bytes
2331
+ for (var i = 0; i <= length; ++i) {
2332
+ var currentBytePtr = value + 4 + i;
2333
+ if (i == length || HEAPU8[currentBytePtr] == 0) {
2334
+ var maxRead = currentBytePtr - decodeStartPtr;
2335
+ var stringSegment = UTF8ToString(decodeStartPtr, maxRead);
2336
+ if (str === undefined) {
2337
+ str = stringSegment;
2338
+ } else {
2339
+ str += String.fromCharCode(0);
2340
+ str += stringSegment;
2341
+ }
2342
+ decodeStartPtr = currentBytePtr + 1;
2343
+ }
2344
+ }
2345
+ } else {
2346
+ var a = new Array(length);
2347
+ for (var i = 0; i < length; ++i) {
2348
+ a[i] = String.fromCharCode(HEAPU8[value + 4 + i]);
2349
+ }
2350
+ str = a.join('');
2351
+ }
2352
+
2353
+ _free(value);
2354
+
2355
+ return str;
2356
+ },
2357
+ 'toWireType': function(destructors, value) {
2358
+ if (value instanceof ArrayBuffer) {
2359
+ value = new Uint8Array(value);
2360
+ }
2361
+
2362
+ var getLength;
2363
+ var valueIsOfTypeString = (typeof value === 'string');
2364
+
2365
+ if (!(valueIsOfTypeString || value instanceof Uint8Array || value instanceof Uint8ClampedArray || value instanceof Int8Array)) {
2366
+ throwBindingError('Cannot pass non-string to std::string');
2367
+ }
2368
+ if (stdStringIsUTF8 && valueIsOfTypeString) {
2369
+ getLength = function() {return lengthBytesUTF8(value);};
2370
+ } else {
2371
+ getLength = function() {return value.length;};
2372
+ }
2373
+
2374
+ // assumes 4-byte alignment
2375
+ var length = getLength();
2376
+ var ptr = _malloc(4 + length + 1);
2377
+ HEAPU32[ptr >> 2] = length;
2378
+ if (stdStringIsUTF8 && valueIsOfTypeString) {
2379
+ stringToUTF8(value, ptr + 4, length + 1);
2380
+ } else {
2381
+ if (valueIsOfTypeString) {
2382
+ for (var i = 0; i < length; ++i) {
2383
+ var charCode = value.charCodeAt(i);
2384
+ if (charCode > 255) {
2385
+ _free(ptr);
2386
+ throwBindingError('String has UTF-16 code units that do not fit in 8 bits');
2387
+ }
2388
+ HEAPU8[ptr + 4 + i] = charCode;
2389
+ }
2390
+ } else {
2391
+ for (var i = 0; i < length; ++i) {
2392
+ HEAPU8[ptr + 4 + i] = value[i];
2393
+ }
2394
+ }
2395
+ }
2396
+
2397
+ if (destructors !== null) {
2398
+ destructors.push(_free, ptr);
2399
+ }
2400
+ return ptr;
2401
+ },
2402
+ 'argPackAdvance': 8,
2403
+ 'readValueFromPointer': simpleReadValueFromPointer,
2404
+ destructorFunction: function(ptr) { _free(ptr); },
2405
+ });
2406
+ }
2407
+
2408
+ function __embind_register_std_wstring(rawType, charSize, name) {
2409
+ name = readLatin1String(name);
2410
+ var decodeString, encodeString, getHeap, lengthBytesUTF, shift;
2411
+ if (charSize === 2) {
2412
+ decodeString = UTF16ToString;
2413
+ encodeString = stringToUTF16;
2414
+ lengthBytesUTF = lengthBytesUTF16;
2415
+ getHeap = function() { return HEAPU16; };
2416
+ shift = 1;
2417
+ } else if (charSize === 4) {
2418
+ decodeString = UTF32ToString;
2419
+ encodeString = stringToUTF32;
2420
+ lengthBytesUTF = lengthBytesUTF32;
2421
+ getHeap = function() { return HEAPU32; };
2422
+ shift = 2;
2423
+ }
2424
+ registerType(rawType, {
2425
+ name: name,
2426
+ 'fromWireType': function(value) {
2427
+ // Code mostly taken from _embind_register_std_string fromWireType
2428
+ var length = HEAPU32[value >> 2];
2429
+ var HEAP = getHeap();
2430
+ var str;
2431
+
2432
+ var decodeStartPtr = value + 4;
2433
+ // Looping here to support possible embedded '0' bytes
2434
+ for (var i = 0; i <= length; ++i) {
2435
+ var currentBytePtr = value + 4 + i * charSize;
2436
+ if (i == length || HEAP[currentBytePtr >> shift] == 0) {
2437
+ var maxReadBytes = currentBytePtr - decodeStartPtr;
2438
+ var stringSegment = decodeString(decodeStartPtr, maxReadBytes);
2439
+ if (str === undefined) {
2440
+ str = stringSegment;
2441
+ } else {
2442
+ str += String.fromCharCode(0);
2443
+ str += stringSegment;
2444
+ }
2445
+ decodeStartPtr = currentBytePtr + charSize;
2446
+ }
2447
+ }
2448
+
2449
+ _free(value);
2450
+
2451
+ return str;
2452
+ },
2453
+ 'toWireType': function(destructors, value) {
2454
+ if (!(typeof value === 'string')) {
2455
+ throwBindingError('Cannot pass non-string to C++ string type ' + name);
2456
+ }
2457
+
2458
+ // assumes 4-byte alignment
2459
+ var length = lengthBytesUTF(value);
2460
+ var ptr = _malloc(4 + length + charSize);
2461
+ HEAPU32[ptr >> 2] = length >> shift;
2462
+
2463
+ encodeString(value, ptr + 4, length + charSize);
2464
+
2465
+ if (destructors !== null) {
2466
+ destructors.push(_free, ptr);
2467
+ }
2468
+ return ptr;
2469
+ },
2470
+ 'argPackAdvance': 8,
2471
+ 'readValueFromPointer': simpleReadValueFromPointer,
2472
+ destructorFunction: function(ptr) { _free(ptr); },
2473
+ });
2474
+ }
2475
+
2476
+ function __embind_register_value_array(
2477
+ rawType,
2478
+ name,
2479
+ constructorSignature,
2480
+ rawConstructor,
2481
+ destructorSignature,
2482
+ rawDestructor
2483
+ ) {
2484
+ tupleRegistrations[rawType] = {
2485
+ name: readLatin1String(name),
2486
+ rawConstructor: embind__requireFunction(constructorSignature, rawConstructor),
2487
+ rawDestructor: embind__requireFunction(destructorSignature, rawDestructor),
2488
+ elements: [],
2489
+ };
2490
+ }
2491
+
2492
+ function __embind_register_value_array_element(
2493
+ rawTupleType,
2494
+ getterReturnType,
2495
+ getterSignature,
2496
+ getter,
2497
+ getterContext,
2498
+ setterArgumentType,
2499
+ setterSignature,
2500
+ setter,
2501
+ setterContext
2502
+ ) {
2503
+ tupleRegistrations[rawTupleType].elements.push({
2504
+ getterReturnType: getterReturnType,
2505
+ getter: embind__requireFunction(getterSignature, getter),
2506
+ getterContext: getterContext,
2507
+ setterArgumentType: setterArgumentType,
2508
+ setter: embind__requireFunction(setterSignature, setter),
2509
+ setterContext: setterContext,
2510
+ });
2511
+ }
2512
+
2513
+ function __embind_register_value_object(
2514
+ rawType,
2515
+ name,
2516
+ constructorSignature,
2517
+ rawConstructor,
2518
+ destructorSignature,
2519
+ rawDestructor
2520
+ ) {
2521
+ structRegistrations[rawType] = {
2522
+ name: readLatin1String(name),
2523
+ rawConstructor: embind__requireFunction(constructorSignature, rawConstructor),
2524
+ rawDestructor: embind__requireFunction(destructorSignature, rawDestructor),
2525
+ fields: [],
2526
+ };
2527
+ }
2528
+
2529
+ function __embind_register_value_object_field(
2530
+ structType,
2531
+ fieldName,
2532
+ getterReturnType,
2533
+ getterSignature,
2534
+ getter,
2535
+ getterContext,
2536
+ setterArgumentType,
2537
+ setterSignature,
2538
+ setter,
2539
+ setterContext
2540
+ ) {
2541
+ structRegistrations[structType].fields.push({
2542
+ fieldName: readLatin1String(fieldName),
2543
+ getterReturnType: getterReturnType,
2544
+ getter: embind__requireFunction(getterSignature, getter),
2545
+ getterContext: getterContext,
2546
+ setterArgumentType: setterArgumentType,
2547
+ setter: embind__requireFunction(setterSignature, setter),
2548
+ setterContext: setterContext,
2549
+ });
2550
+ }
2551
+
2552
+ function __embind_register_void(rawType, name) {
2553
+ name = readLatin1String(name);
2554
+ registerType(rawType, {
2555
+ isVoid: true, // void return values can be optimized out sometimes
2556
+ name: name,
2557
+ 'argPackAdvance': 0,
2558
+ 'fromWireType': function() {
2559
+ return undefined;
2560
+ },
2561
+ 'toWireType': function(destructors, o) {
2562
+ // TODO: assert if anything else is given?
2563
+ return undefined;
2564
+ },
2565
+ });
2566
+ }
2567
+
2568
+ function requireHandle(handle) {
2569
+ if (!handle) {
2570
+ throwBindingError('Cannot use deleted val. handle = ' + handle);
2571
+ }
2572
+ return emval_handle_array[handle].value;
2573
+ }
2574
+
2575
+ function requireRegisteredType(rawType, humanName) {
2576
+ var impl = registeredTypes[rawType];
2577
+ if (undefined === impl) {
2578
+ throwBindingError(humanName + " has unknown type " + getTypeName(rawType));
2579
+ }
2580
+ return impl;
2581
+ }
2582
+ function __emval_as(handle, returnType, destructorsRef) {
2583
+ handle = requireHandle(handle);
2584
+ returnType = requireRegisteredType(returnType, 'emval::as');
2585
+ var destructors = [];
2586
+ var rd = __emval_register(destructors);
2587
+ HEAP32[destructorsRef >> 2] = rd;
2588
+ return returnType['toWireType'](destructors, handle);
2589
+ }
2590
+
2591
+ function __emval_lookupTypes(argCount, argTypes) {
2592
+ var a = new Array(argCount);
2593
+ for (var i = 0; i < argCount; ++i) {
2594
+ a[i] = requireRegisteredType(
2595
+ HEAP32[(argTypes >> 2) + i],
2596
+ "parameter " + i);
2597
+ }
2598
+ return a;
2599
+ }
2600
+ function __emval_call(handle, argCount, argTypes, argv) {
2601
+ handle = requireHandle(handle);
2602
+ var types = __emval_lookupTypes(argCount, argTypes);
2603
+
2604
+ var args = new Array(argCount);
2605
+ for (var i = 0; i < argCount; ++i) {
2606
+ var type = types[i];
2607
+ args[i] = type['readValueFromPointer'](argv);
2608
+ argv += type['argPackAdvance'];
2609
+ }
2610
+
2611
+ var rv = handle.apply(undefined, args);
2612
+ return __emval_register(rv);
2613
+ }
2614
+
2615
+ function __emval_allocateDestructors(destructorsRef) {
2616
+ var destructors = [];
2617
+ HEAP32[destructorsRef >> 2] = __emval_register(destructors);
2618
+ return destructors;
2619
+ }
2620
+
2621
+ var emval_symbols={};
2622
+ function getStringOrSymbol(address) {
2623
+ var symbol = emval_symbols[address];
2624
+ if (symbol === undefined) {
2625
+ return readLatin1String(address);
2626
+ } else {
2627
+ return symbol;
2628
+ }
2629
+ }
2630
+
2631
+ var emval_methodCallers=[];
2632
+ function __emval_call_void_method(caller, handle, methodName, args) {
2633
+ caller = emval_methodCallers[caller];
2634
+ handle = requireHandle(handle);
2635
+ methodName = getStringOrSymbol(methodName);
2636
+ caller(handle, methodName, null, args);
2637
+ }
2638
+
2639
+
2640
+ function emval_get_global() {
2641
+ if (typeof globalThis === 'object') {
2642
+ return globalThis;
2643
+ }
2644
+ return (function(){
2645
+ return Function;
2646
+ })()('return this')();
2647
+ }
2648
+ function __emval_get_global(name) {
2649
+ if(name===0){
2650
+ return __emval_register(emval_get_global());
2651
+ } else {
2652
+ name = getStringOrSymbol(name);
2653
+ return __emval_register(emval_get_global()[name]);
2654
+ }
2655
+ }
2656
+
2657
+ function __emval_addMethodCaller(caller) {
2658
+ var id = emval_methodCallers.length;
2659
+ emval_methodCallers.push(caller);
2660
+ return id;
2661
+ }
2662
+ function __emval_get_method_caller(argCount, argTypes) {
2663
+ var types = __emval_lookupTypes(argCount, argTypes);
2664
+
2665
+ var retType = types[0];
2666
+
2667
+ var invokerFunction = function methodCaller(handle, name, destructors, args) {
2668
+ var offset = 0;
2669
+ var argsValue = [];
2670
+
2671
+ for (var i = 1; i < argCount; ++i) {
2672
+ argsValue.push(types[i]['readValueFromPointer'](args + offset));
2673
+ offset += types[i]['argPackAdvance'];
2674
+ }
2675
+
2676
+ var rv = handle[name](...argsValue);
2677
+
2678
+ for (var i = 1; i < argCount; ++i) {
2679
+ var dtor = types[i]['deleteObject'];
2680
+ if (dtor) {
2681
+ dtor(argsValue[i - 1]);
2682
+ }
2683
+ }
2684
+
2685
+ if (!retType.isVoid) {
2686
+ return retType['toWireType'](destructors, rv);
2687
+ }
2688
+ }
2689
+
2690
+ return __emval_addMethodCaller(invokerFunction);
2691
+ }
2692
+
2693
+ function __emval_get_property(handle, key) {
2694
+ handle = requireHandle(handle);
2695
+ key = requireHandle(key);
2696
+ return __emval_register(handle[key]);
2697
+ }
2698
+
2699
+ function __emval_incref(handle) {
2700
+ if (handle > 4) {
2701
+ emval_handle_array[handle].refcount += 1;
2702
+ }
2703
+ }
2704
+
2705
+ function __emval_instanceof(object, constructor) {
2706
+ object = requireHandle(object);
2707
+ constructor = requireHandle(constructor);
2708
+ return object instanceof constructor;
2709
+ }
2710
+
2711
+ function __emval_new_array() {
2712
+ return __emval_register([]);
2713
+ }
2714
+
2715
+ function __emval_new_cstring(v) {
2716
+ return __emval_register(getStringOrSymbol(v));
2717
+ }
2718
+
2719
+ function __emval_run_destructors(handle) {
2720
+ var destructors = emval_handle_array[handle].value;
2721
+ runDestructors(destructors);
2722
+ __emval_decref(handle);
2723
+ }
2724
+
2725
+ function __emval_take_value(type, argv) {
2726
+ type = requireRegisteredType(type, '_emval_take_value');
2727
+ var v = type['readValueFromPointer'](argv);
2728
+ return __emval_register(v);
2729
+ }
2730
+
2731
+ function _abort() {
2732
+ abort();
2733
+ }
2734
+
2735
+ var _emscripten_get_now;if (ENVIRONMENT_IS_NODE) {
2736
+ _emscripten_get_now = function() {
2737
+ var t = process['hrtime']();
2738
+ return t[0] * 1e3 + t[1] / 1e6;
2739
+ };
2740
+ } else if (typeof dateNow !== 'undefined') {
2741
+ _emscripten_get_now = dateNow;
2742
+ } else _emscripten_get_now = function() { return performance.now(); }
2743
+ ;
2744
+
2745
+ var _emscripten_get_now_is_monotonic=true;;
2746
+
2747
+ function setErrNo(value) {
2748
+ HEAP32[((___errno_location())>>2)]=value;
2749
+ return value;
2750
+ }
2751
+ function _clock_gettime(clk_id, tp) {
2752
+ // int clock_gettime(clockid_t clk_id, struct timespec *tp);
2753
+ var now;
2754
+ if (clk_id === 0) {
2755
+ now = Date.now();
2756
+ } else if ((clk_id === 1 || clk_id === 4) && _emscripten_get_now_is_monotonic) {
2757
+ now = _emscripten_get_now();
2758
+ } else {
2759
+ setErrNo(28);
2760
+ return -1;
2761
+ }
2762
+ HEAP32[((tp)>>2)]=(now/1000)|0; // seconds
2763
+ HEAP32[(((tp)+(4))>>2)]=((now % 1000)*1000*1000)|0; // nanoseconds
2764
+ return 0;
2765
+ }
2766
+
2767
+ function _emscripten_memcpy_big(dest, src, num) {
2768
+ HEAPU8.copyWithin(dest, src, src + num);
2769
+ }
2770
+
2771
+ function _emscripten_get_heap_size() {
2772
+ return HEAPU8.length;
2773
+ }
2774
+
2775
+ function emscripten_realloc_buffer(size) {
2776
+ try {
2777
+ // round size grow request up to wasm page size (fixed 64KB per spec)
2778
+ wasmMemory.grow((size - buffer.byteLength + 65535) >>> 16); // .grow() takes a delta compared to the previous size
2779
+ updateGlobalBufferAndViews(wasmMemory.buffer);
2780
+ return 1 /*success*/;
2781
+ } catch(e) {
2782
+ }
2783
+ // implicit 0 return to save code size (caller will cast "undefined" into 0
2784
+ // anyhow)
2785
+ }
2786
+ function _emscripten_resize_heap(requestedSize) {
2787
+ requestedSize = requestedSize >>> 0;
2788
+ var oldSize = _emscripten_get_heap_size();
2789
+ // With pthreads, races can happen (another thread might increase the size in between), so return a failure, and let the caller retry.
2790
+
2791
+ // Memory resize rules:
2792
+ // 1. When resizing, always produce a resized heap that is at least 16MB (to avoid tiny heap sizes receiving lots of repeated resizes at startup)
2793
+ // 2. Always increase heap size to at least the requested size, rounded up to next page multiple.
2794
+ // 3a. If MEMORY_GROWTH_LINEAR_STEP == -1, excessively resize the heap geometrically: increase the heap size according to
2795
+ // MEMORY_GROWTH_GEOMETRIC_STEP factor (default +20%),
2796
+ // At most overreserve by MEMORY_GROWTH_GEOMETRIC_CAP bytes (default 96MB).
2797
+ // 3b. If MEMORY_GROWTH_LINEAR_STEP != -1, excessively resize the heap linearly: increase the heap size by at least MEMORY_GROWTH_LINEAR_STEP bytes.
2798
+ // 4. Max size for the heap is capped at 2048MB-WASM_PAGE_SIZE, or by MAXIMUM_MEMORY, or by ASAN limit, depending on which is smallest
2799
+ // 5. If we were unable to allocate as much memory, it may be due to over-eager decision to excessively reserve due to (3) above.
2800
+ // Hence if an allocation fails, cut down on the amount of excess growth, in an attempt to succeed to perform a smaller allocation.
2801
+
2802
+ // A limit was set for how much we can grow. We should not exceed that
2803
+ // (the wasm binary specifies it, so if we tried, we'd fail anyhow).
2804
+ var maxHeapSize = 2147483648;
2805
+ if (requestedSize > maxHeapSize) {
2806
+ return false;
2807
+ }
2808
+
2809
+ var minHeapSize = 16777216;
2810
+
2811
+ // Loop through potential heap size increases. If we attempt a too eager reservation that fails, cut down on the
2812
+ // attempted size and reserve a smaller bump instead. (max 3 times, chosen somewhat arbitrarily)
2813
+ for(var cutDown = 1; cutDown <= 4; cutDown *= 2) {
2814
+ var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); // ensure geometric growth
2815
+ // but limit overreserving (default to capping at +96MB overgrowth at most)
2816
+ overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296 );
2817
+
2818
+ var newSize = Math.min(maxHeapSize, alignUp(Math.max(minHeapSize, requestedSize, overGrownHeapSize), 65536));
2819
+
2820
+ var replacement = emscripten_realloc_buffer(newSize);
2821
+ if (replacement) {
2822
+
2823
+ return true;
2824
+ }
2825
+ }
2826
+ return false;
2827
+ }
2828
+
2829
+ function _emscripten_thread_sleep(msecs) {
2830
+ var start = _emscripten_get_now();
2831
+ while (_emscripten_get_now() - start < msecs) {
2832
+ // Do nothing.
2833
+ }
2834
+ }
2835
+
2836
+ function flush_NO_FILESYSTEM() {
2837
+ // flush anything remaining in the buffers during shutdown
2838
+ if (typeof _fflush !== 'undefined') _fflush(0);
2839
+ var buffers = SYSCALLS.buffers;
2840
+ if (buffers[1].length) SYSCALLS.printChar(1, 10);
2841
+ if (buffers[2].length) SYSCALLS.printChar(2, 10);
2842
+ }
2843
+
2844
+ var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream, curr) {
2845
+ var buffer = SYSCALLS.buffers[stream];
2846
+ if (curr === 0 || curr === 10) {
2847
+ (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0));
2848
+ buffer.length = 0;
2849
+ } else {
2850
+ buffer.push(curr);
2851
+ }
2852
+ },varargs:undefined,get:function() {
2853
+ SYSCALLS.varargs += 4;
2854
+ var ret = HEAP32[(((SYSCALLS.varargs)-(4))>>2)];
2855
+ return ret;
2856
+ },getStr:function(ptr) {
2857
+ var ret = UTF8ToString(ptr);
2858
+ return ret;
2859
+ },get64:function(low, high) {
2860
+ return low;
2861
+ }};
2862
+ function _fd_write(fd, iov, iovcnt, pnum) {
2863
+ // hack to support printf in SYSCALLS_REQUIRE_FILESYSTEM=0
2864
+ var num = 0;
2865
+ for (var i = 0; i < iovcnt; i++) {
2866
+ var ptr = HEAP32[(((iov)+(i*8))>>2)];
2867
+ var len = HEAP32[(((iov)+(i*8 + 4))>>2)];
2868
+ for (var j = 0; j < len; j++) {
2869
+ SYSCALLS.printChar(fd, HEAPU8[ptr+j]);
2870
+ }
2871
+ num += len;
2872
+ }
2873
+ HEAP32[((pnum)>>2)]=num
2874
+ return 0;
2875
+ }
2876
+
2877
+ function _setTempRet0($i) {
2878
+ setTempRet0(($i) | 0);
2879
+ }
2880
+
2881
+ function _time(ptr) {
2882
+ var ret = (Date.now()/1000)|0;
2883
+ if (ptr) {
2884
+ HEAP32[((ptr)>>2)]=ret;
2885
+ }
2886
+ return ret;
2887
+ }
2888
+ InternalError = Module['InternalError'] = extendError(Error, 'InternalError');;
2889
+ embind_init_charCodes();
2890
+ BindingError = Module['BindingError'] = extendError(Error, 'BindingError');;
2891
+ init_emval();;
2892
+ UnboundTypeError = Module['UnboundTypeError'] = extendError(Error, 'UnboundTypeError');;
2893
+ var ASSERTIONS = false;
2894
+
2895
+
2896
+
2897
+ /** @type {function(string, boolean=, number=)} */
2898
+ function intArrayFromString(stringy, dontAddNull, length) {
2899
+ var len = length > 0 ? length : lengthBytesUTF8(stringy)+1;
2900
+ var u8array = new Array(len);
2901
+ var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
2902
+ if (dontAddNull) u8array.length = numBytesWritten;
2903
+ return u8array;
2904
+ }
2905
+
2906
+ function intArrayToString(array) {
2907
+ var ret = [];
2908
+ for (var i = 0; i < array.length; i++) {
2909
+ var chr = array[i];
2910
+ if (chr > 0xFF) {
2911
+ if (ASSERTIONS) {
2912
+ assert(false, 'Character code ' + chr + ' (' + String.fromCharCode(chr) + ') at offset ' + i + ' not in 0x00-0xFF.');
2913
+ }
2914
+ chr &= 0xFF;
2915
+ }
2916
+ ret.push(String.fromCharCode(chr));
2917
+ }
2918
+ return ret.join('');
2919
+ }
2920
+
2921
+
2922
+ var asmLibraryArg = {
2923
+ "__assert_fail": ___assert_fail,
2924
+ "__cxa_atexit": ___cxa_atexit,
2925
+ "_embind_finalize_value_array": __embind_finalize_value_array,
2926
+ "_embind_finalize_value_object": __embind_finalize_value_object,
2927
+ "_embind_register_bool": __embind_register_bool,
2928
+ "_embind_register_emval": __embind_register_emval,
2929
+ "_embind_register_float": __embind_register_float,
2930
+ "_embind_register_function": __embind_register_function,
2931
+ "_embind_register_integer": __embind_register_integer,
2932
+ "_embind_register_memory_view": __embind_register_memory_view,
2933
+ "_embind_register_std_string": __embind_register_std_string,
2934
+ "_embind_register_std_wstring": __embind_register_std_wstring,
2935
+ "_embind_register_value_array": __embind_register_value_array,
2936
+ "_embind_register_value_array_element": __embind_register_value_array_element,
2937
+ "_embind_register_value_object": __embind_register_value_object,
2938
+ "_embind_register_value_object_field": __embind_register_value_object_field,
2939
+ "_embind_register_void": __embind_register_void,
2940
+ "_emval_as": __emval_as,
2941
+ "_emval_call": __emval_call,
2942
+ "_emval_call_void_method": __emval_call_void_method,
2943
+ "_emval_decref": __emval_decref,
2944
+ "_emval_get_global": __emval_get_global,
2945
+ "_emval_get_method_caller": __emval_get_method_caller,
2946
+ "_emval_get_property": __emval_get_property,
2947
+ "_emval_incref": __emval_incref,
2948
+ "_emval_instanceof": __emval_instanceof,
2949
+ "_emval_new_array": __emval_new_array,
2950
+ "_emval_new_cstring": __emval_new_cstring,
2951
+ "_emval_run_destructors": __emval_run_destructors,
2952
+ "_emval_take_value": __emval_take_value,
2953
+ "abort": _abort,
2954
+ "clock_gettime": _clock_gettime,
2955
+ "emscripten_memcpy_big": _emscripten_memcpy_big,
2956
+ "emscripten_resize_heap": _emscripten_resize_heap,
2957
+ "emscripten_thread_sleep": _emscripten_thread_sleep,
2958
+ "fd_write": _fd_write,
2959
+ "setTempRet0": _setTempRet0,
2960
+ "time": _time
2961
+ };
2962
+ var asm = createWasm();
2963
+ /** @type {function(...*):?} */
2964
+ var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function() {
2965
+ return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["__wasm_call_ctors"]).apply(null, arguments);
2966
+ };
2967
+
2968
+ /** @type {function(...*):?} */
2969
+ var _malloc = Module["_malloc"] = function() {
2970
+ return (_malloc = Module["_malloc"] = Module["asm"]["malloc"]).apply(null, arguments);
2971
+ };
2972
+
2973
+ /** @type {function(...*):?} */
2974
+ var _free = Module["_free"] = function() {
2975
+ return (_free = Module["_free"] = Module["asm"]["free"]).apply(null, arguments);
2976
+ };
2977
+
2978
+ /** @type {function(...*):?} */
2979
+ var ___errno_location = Module["___errno_location"] = function() {
2980
+ return (___errno_location = Module["___errno_location"] = Module["asm"]["__errno_location"]).apply(null, arguments);
2981
+ };
2982
+
2983
+ /** @type {function(...*):?} */
2984
+ var ___getTypeName = Module["___getTypeName"] = function() {
2985
+ return (___getTypeName = Module["___getTypeName"] = Module["asm"]["__getTypeName"]).apply(null, arguments);
2986
+ };
2987
+
2988
+ /** @type {function(...*):?} */
2989
+ var ___embind_register_native_and_builtin_types = Module["___embind_register_native_and_builtin_types"] = function() {
2990
+ return (___embind_register_native_and_builtin_types = Module["___embind_register_native_and_builtin_types"] = Module["asm"]["__embind_register_native_and_builtin_types"]).apply(null, arguments);
2991
+ };
2992
+
2993
+ /** @type {function(...*):?} */
2994
+ var __get_tzname = Module["__get_tzname"] = function() {
2995
+ return (__get_tzname = Module["__get_tzname"] = Module["asm"]["_get_tzname"]).apply(null, arguments);
2996
+ };
2997
+
2998
+ /** @type {function(...*):?} */
2999
+ var __get_daylight = Module["__get_daylight"] = function() {
3000
+ return (__get_daylight = Module["__get_daylight"] = Module["asm"]["_get_daylight"]).apply(null, arguments);
3001
+ };
3002
+
3003
+ /** @type {function(...*):?} */
3004
+ var __get_timezone = Module["__get_timezone"] = function() {
3005
+ return (__get_timezone = Module["__get_timezone"] = Module["asm"]["_get_timezone"]).apply(null, arguments);
3006
+ };
3007
+
3008
+ /** @type {function(...*):?} */
3009
+ var stackSave = Module["stackSave"] = function() {
3010
+ return (stackSave = Module["stackSave"] = Module["asm"]["stackSave"]).apply(null, arguments);
3011
+ };
3012
+
3013
+ /** @type {function(...*):?} */
3014
+ var stackRestore = Module["stackRestore"] = function() {
3015
+ return (stackRestore = Module["stackRestore"] = Module["asm"]["stackRestore"]).apply(null, arguments);
3016
+ };
3017
+
3018
+ /** @type {function(...*):?} */
3019
+ var stackAlloc = Module["stackAlloc"] = function() {
3020
+ return (stackAlloc = Module["stackAlloc"] = Module["asm"]["stackAlloc"]).apply(null, arguments);
3021
+ };
3022
+
3023
+ /** @type {function(...*):?} */
3024
+ var dynCall_vijiii = Module["dynCall_vijiii"] = function() {
3025
+ return (dynCall_vijiii = Module["dynCall_vijiii"] = Module["asm"]["dynCall_vijiii"]).apply(null, arguments);
3026
+ };
3027
+
3028
+ /** @type {function(...*):?} */
3029
+ var dynCall_jiji = Module["dynCall_jiji"] = function() {
3030
+ return (dynCall_jiji = Module["dynCall_jiji"] = Module["asm"]["dynCall_jiji"]).apply(null, arguments);
3031
+ };
3032
+
3033
+
3034
+
3035
+
3036
+
3037
+ // === Auto-generated postamble setup entry stuff ===
3038
+
3039
+ Module["setValue"] = setValue;
3040
+ Module["getValue"] = getValue;
3041
+ Module["UTF8ToString"] = UTF8ToString;
3042
+ Module["stringToUTF8"] = stringToUTF8;
3043
+
3044
+ var calledRun;
3045
+
3046
+ /**
3047
+ * @constructor
3048
+ * @this {ExitStatus}
3049
+ */
3050
+ function ExitStatus(status) {
3051
+ this.name = "ExitStatus";
3052
+ this.message = "Program terminated with exit(" + status + ")";
3053
+ this.status = status;
3054
+ }
3055
+
3056
+ var calledMain = false;
3057
+
3058
+ dependenciesFulfilled = function runCaller() {
3059
+ // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
3060
+ if (!calledRun) run();
3061
+ if (!calledRun) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled
3062
+ };
3063
+
3064
+ /** @type {function(Array=)} */
3065
+ function run(args) {
3066
+ args = args || arguments_;
3067
+
3068
+ if (runDependencies > 0) {
3069
+ return;
3070
+ }
3071
+
3072
+ preRun();
3073
+
3074
+ if (runDependencies > 0) return; // a preRun added a dependency, run will be called later
3075
+
3076
+ function doRun() {
3077
+ // run may have just been called through dependencies being fulfilled just in this very frame,
3078
+ // or while the async setStatus time below was happening
3079
+ if (calledRun) return;
3080
+ calledRun = true;
3081
+ Module['calledRun'] = true;
3082
+
3083
+ if (ABORT) return;
3084
+
3085
+ initRuntime();
3086
+
3087
+ preMain();
3088
+
3089
+ readyPromiseResolve(Module);
3090
+ if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();
3091
+
3092
+ postRun();
3093
+ }
3094
+
3095
+ if (Module['setStatus']) {
3096
+ Module['setStatus']('Running...');
3097
+ setTimeout(function() {
3098
+ setTimeout(function() {
3099
+ Module['setStatus']('');
3100
+ }, 1);
3101
+ doRun();
3102
+ }, 1);
3103
+ } else
3104
+ {
3105
+ doRun();
3106
+ }
3107
+ }
3108
+ Module['run'] = run;
3109
+
3110
+ /** @param {boolean|number=} implicit */
3111
+ function exit(status, implicit) {
3112
+
3113
+ // if this is just main exit-ing implicitly, and the status is 0, then we
3114
+ // don't need to do anything here and can just leave. if the status is
3115
+ // non-zero, though, then we need to report it.
3116
+ // (we may have warned about this earlier, if a situation justifies doing so)
3117
+ if (implicit && noExitRuntime && status === 0) {
3118
+ return;
3119
+ }
3120
+
3121
+ if (noExitRuntime) {
3122
+ } else {
3123
+
3124
+ EXITSTATUS = status;
3125
+
3126
+ exitRuntime();
3127
+
3128
+ if (Module['onExit']) Module['onExit'](status);
3129
+
3130
+ ABORT = true;
3131
+ }
3132
+
3133
+ quit_(status, new ExitStatus(status));
3134
+ }
3135
+
3136
+ if (Module['preInit']) {
3137
+ if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];
3138
+ while (Module['preInit'].length > 0) {
3139
+ Module['preInit'].pop()();
3140
+ }
3141
+ }
3142
+
3143
+ noExitRuntime = true;
3144
+
3145
+ run();
3146
+
3147
+
3148
+
3149
+
3150
+
3151
+
3152
+
3153
+ return LIBIPVP.ready
3154
+ }
3155
+ );
3156
+ })();
3157
+ if (typeof exports === 'object' && typeof module === 'object')
3158
+ module.exports = LIBIPVP;
3159
+ else if (typeof define === 'function' && define['amd'])
3160
+ define([], function() { return LIBIPVP; });
3161
+ else if (typeof exports === 'object')
3162
+ exports["LIBIPVP"] = LIBIPVP;
3163
+ /* eslint-disable */
3164
+ (function (LIBIPVP) {
3165
+ var IPVPEvents = {};
3166
+ IPVPEvents[(IPVPEvents['kRTPDead'] = 1)] = 'kRTPDead';
3167
+ IPVPEvents[(IPVPEvents['kGainCtrl'] = 2)] = 'kGainCtrl';
3168
+ IPVPEvents[(IPVPEvents['kCSRCChange'] = 3)] = 'kCSRCChange';
3169
+ IPVPEvents[(IPVPEvents['kCCIDChange'] = 4)] = 'kCCIDChange';
3170
+ IPVPEvents[(IPVPEvents['kMicFramingDelay'] = 5)] = 'kMicFramingDelay';
3171
+ IPVPEvents[(IPVPEvents['kSpkFramengDelay'] = 6)] = 'kSpkFramengDelay';
3172
+ IPVPEvents[(IPVPEvents['kRTPViolate'] = 7)] = 'kRTPViolate';
3173
+ IPVPEvents[(IPVPEvents['kSignalBreak'] = 8)] = 'kSignalBreak';
3174
+
3175
+ var IPVPConfigAEC = {};
3176
+ IPVPConfigAEC[(IPVPConfigAEC['kOff'] = 0)] = 'kOff';
3177
+ IPVPConfigAEC[(IPVPConfigAEC['kNormal'] = 1)] = 'kNormal';
3178
+ IPVPConfigAEC[(IPVPConfigAEC['kEnhance'] = 2)] = 'kEnhance';
3179
+
3180
+ var IPVPConfigANS = {};
3181
+ IPVPConfigANS[(IPVPConfigANS['kOff'] = 0)] = 'kOff';
3182
+ IPVPConfigANS[(IPVPConfigANS['kLow'] = 1)] = 'kLow';
3183
+ IPVPConfigANS[(IPVPConfigANS['kMiddle'] = 2)] = 'kMiddle';
3184
+ IPVPConfigANS[(IPVPConfigANS['kHigh'] = 3)] = 'kHigh';
3185
+
3186
+ var IPVPConfigAGCMode = {};
3187
+ IPVPConfigAGCMode[(IPVPConfigAGCMode['kAdaptiveDigital'] = 1)] =
3188
+ 'kAdaptiveDigital';
3189
+ IPVPConfigAGCMode[(IPVPConfigAGCMode['kAdaptiveAnalog'] = 2)] =
3190
+ 'kAdaptiveAnalog';
3191
+ IPVPConfigAGCMode[(IPVPConfigAGCMode['kFixedDigital'] = 4)] = 'kFixedDigital';
3192
+ IPVPConfigAGCMode[(IPVPConfigAGCMode['kUnchanged'] = 8)] = 'kUnchanged';
3193
+ IPVPConfigAGCMode[(IPVPConfigAGCMode['kCustomTable'] = 16)] = 'kCustomTable';
3194
+ IPVPConfigAGCMode[(IPVPConfigAGCMode['kDigitalAgcAdj'] = 32)] =
3195
+ 'kDigitalAgcAdj';
3196
+ IPVPConfigAGCMode[(IPVPConfigAGCMode['kVadThresholdAdj'] = 64)] =
3197
+ 'kVadThresholdAdj';
3198
+
3199
+ var IPVPDataType = {};
3200
+ IPVPDataType[(IPVPDataType['kInvalid'] = -1)] = 'kInvalid';
3201
+ IPVPDataType[(IPVPDataType['kSpeech'] = 0)] = 'kSpeech';
3202
+ IPVPDataType[(IPVPDataType['kPCM'] = 1)] = 'kPCM';
3203
+ IPVPDataType[(IPVPDataType['kRTP'] = 2)] = 'kRTP';
3204
+ IPVPDataType[(IPVPDataType['kRTCP'] = 3)] = 'kRTCP';
3205
+ IPVPDataType[(IPVPDataType['kRFC2833'] = 4)] = 'kRFC2833';
3206
+ IPVPDataType[(IPVPDataType['kCNG'] = 5)] = 'kCNG';
3207
+ IPVPDataType[(IPVPDataType['kAVS'] = 6)] = 'kAVS';
3208
+ IPVPDataType[(IPVPDataType['kRED'] = 7)] = 'kRED';
3209
+ IPVPDataType[(IPVPDataType['kVQM'] = 8)] = 'kVQM';
3210
+ IPVPDataType[(IPVPDataType['kSDES'] = 9)] = 'kSDES';
3211
+ IPVPDataType[(IPVPDataType['kFEC'] = 10)] = 'kFEC';
3212
+
3213
+ var IPVPTalkFlag = {};
3214
+ IPVPTalkFlag[(IPVPTalkFlag['kInactive'] = 0)] = 'kInactive';
3215
+ IPVPTalkFlag[(IPVPTalkFlag['kRecvOnly'] = 1)] = 'kRecvOnly';
3216
+ IPVPTalkFlag[(IPVPTalkFlag['kSendOnly'] = 2)] = 'kSendOnly';
3217
+ IPVPTalkFlag[(IPVPTalkFlag['kSendRecv'] = 3)] = 'kSendRecv';
3218
+ IPVPTalkFlag[(IPVPTalkFlag['kSendEvnt'] = 4)] = 'kSendEvnt';
3219
+ IPVPTalkFlag[(IPVPTalkFlag['kPaging'] = 8)] = 'kPaging';
3220
+ IPVPTalkFlag[(IPVPTalkFlag['kMax'] = 15)] = 'kMax';
3221
+
3222
+ var IPVPSRTPCryptoExtern = {};
3223
+ IPVPSRTPCryptoExtern[(IPVPSRTPCryptoExtern['kUnencryRTP'] = 1)] =
3224
+ 'kUnencryRTP';
3225
+ IPVPSRTPCryptoExtern[(IPVPSRTPCryptoExtern['kUnencryRTCP'] = 2)] =
3226
+ 'kUnencryRTCP';
3227
+ IPVPSRTPCryptoExtern[(IPVPSRTPCryptoExtern['kUnautoRTP'] = 4)] = 'kUnautoRTP';
3228
+
3229
+ var IPVPCodecOpts = {};
3230
+ IPVPCodecOpts[(IPVPCodecOpts['kAmrWbIO'] = 1)] = 'kAmrWbIO';
3231
+ IPVPCodecOpts[(IPVPCodecOpts['kHFOnly'] = 2)] = 'kHFOnly';
3232
+ IPVPCodecOpts[(IPVPCodecOpts['kDTXSend'] = 4)] = 'kDTXSend';
3233
+ IPVPCodecOpts[(IPVPCodecOpts['kDTXRecv'] = 8)] = 'kDTXRecv';
3234
+ IPVPCodecOpts[(IPVPCodecOpts['kStero'] = 16)] = 'kStero';
3235
+ IPVPCodecOpts[(IPVPCodecOpts['kInbandFEC'] = 32)] = 'kInbandFEC';
3236
+ IPVPCodecOpts[(IPVPCodecOpts['kUseYLRTX'] = 64)] = 'kUseYLRTX';
3237
+
3238
+ var IPVPFECFormat = {};
3239
+ IPVPFECFormat[(IPVPFECFormat['kURL'] = 0)] = 'kURL';
3240
+ IPVPFECFormat[(IPVPFECFormat['kFLEX'] = 1)] = 'kFLEX';
3241
+
3242
+ var IPVPGainDir = {};
3243
+ IPVPGainDir[(IPVPGainDir['kNone'] = 0)] = 'kNone';
3244
+ IPVPGainDir[(IPVPGainDir['kRecv'] = 1)] = 'kRecv';
3245
+ IPVPGainDir[(IPVPGainDir['kSend'] = 2)] = 'kSend';
3246
+
3247
+ var IPVPFlowDir = {};
3248
+ IPVPFlowDir[(IPVPFlowDir['kNone'] = 0)] = 'kNone';
3249
+ IPVPFlowDir[(IPVPFlowDir['kLocal'] = 1)] = 'kLocal';
3250
+ IPVPFlowDir[(IPVPFlowDir['kNet'] = 2)] = 'kNet';
3251
+ IPVPFlowDir[(IPVPFlowDir['kMix'] = 4)] = 'kMix';
3252
+ IPVPFlowDir[(IPVPFlowDir['kAll'] = 3)] = 'kAll';
3253
+
3254
+ LIBIPVP['IPVPEvents'] = IPVPEvents;
3255
+ LIBIPVP['IPVPConfigAEC'] = IPVPConfigAEC;
3256
+ LIBIPVP['IPVPConfigANS'] = IPVPConfigANS;
3257
+ LIBIPVP['IPVPConfigAGCMode'] = IPVPConfigAGCMode;
3258
+ LIBIPVP['IPVPDataType'] = IPVPDataType;
3259
+ LIBIPVP['IPVPTalkFlag'] = IPVPTalkFlag;
3260
+ LIBIPVP['IPVPSRTPCryptoExtern'] = IPVPSRTPCryptoExtern;
3261
+ LIBIPVP['IPVPCodecOpts'] = IPVPCodecOpts;
3262
+ LIBIPVP['IPVPFECFormat'] = IPVPFECFormat;
3263
+ LIBIPVP['IPVPGainDir'] = IPVPGainDir;
3264
+ LIBIPVP['IPVPFlowDir'] = IPVPFlowDir;
3265
+ })(LIBIPVP || (LIBIPVP = {}));
3266
+ /* eslint-enable */
3267
+