thrust-wasm 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1073 @@
1
+ let wasm;
2
+
3
+ let cachedUint8ArrayMemory0 = null;
4
+
5
+ function getUint8ArrayMemory0() {
6
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
7
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
8
+ }
9
+ return cachedUint8ArrayMemory0;
10
+ }
11
+
12
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
13
+
14
+ cachedTextDecoder.decode();
15
+
16
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
17
+ let numBytesDecoded = 0;
18
+ function decodeText(ptr, len) {
19
+ numBytesDecoded += len;
20
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
21
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
22
+ cachedTextDecoder.decode();
23
+ numBytesDecoded = len;
24
+ }
25
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
26
+ }
27
+
28
+ function getStringFromWasm0(ptr, len) {
29
+ ptr = ptr >>> 0;
30
+ return decodeText(ptr, len);
31
+ }
32
+
33
+ let WASM_VECTOR_LEN = 0;
34
+
35
+ const cachedTextEncoder = new TextEncoder();
36
+
37
+ if (!('encodeInto' in cachedTextEncoder)) {
38
+ cachedTextEncoder.encodeInto = function (arg, view) {
39
+ const buf = cachedTextEncoder.encode(arg);
40
+ view.set(buf);
41
+ return {
42
+ read: arg.length,
43
+ written: buf.length
44
+ };
45
+ }
46
+ }
47
+
48
+ function passStringToWasm0(arg, malloc, realloc) {
49
+
50
+ if (realloc === undefined) {
51
+ const buf = cachedTextEncoder.encode(arg);
52
+ const ptr = malloc(buf.length, 1) >>> 0;
53
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
54
+ WASM_VECTOR_LEN = buf.length;
55
+ return ptr;
56
+ }
57
+
58
+ let len = arg.length;
59
+ let ptr = malloc(len, 1) >>> 0;
60
+
61
+ const mem = getUint8ArrayMemory0();
62
+
63
+ let offset = 0;
64
+
65
+ for (; offset < len; offset++) {
66
+ const code = arg.charCodeAt(offset);
67
+ if (code > 0x7F) break;
68
+ mem[ptr + offset] = code;
69
+ }
70
+
71
+ if (offset !== len) {
72
+ if (offset !== 0) {
73
+ arg = arg.slice(offset);
74
+ }
75
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
76
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
77
+ const ret = cachedTextEncoder.encodeInto(arg, view);
78
+
79
+ offset += ret.written;
80
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
81
+ }
82
+
83
+ WASM_VECTOR_LEN = offset;
84
+ return ptr;
85
+ }
86
+
87
+ let cachedDataViewMemory0 = null;
88
+
89
+ function getDataViewMemory0() {
90
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
91
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
92
+ }
93
+ return cachedDataViewMemory0;
94
+ }
95
+
96
+ function isLikeNone(x) {
97
+ return x === undefined || x === null;
98
+ }
99
+
100
+ function debugString(val) {
101
+ // primitive types
102
+ const type = typeof val;
103
+ if (type == 'number' || type == 'boolean' || val == null) {
104
+ return `${val}`;
105
+ }
106
+ if (type == 'string') {
107
+ return `"${val}"`;
108
+ }
109
+ if (type == 'symbol') {
110
+ const description = val.description;
111
+ if (description == null) {
112
+ return 'Symbol';
113
+ } else {
114
+ return `Symbol(${description})`;
115
+ }
116
+ }
117
+ if (type == 'function') {
118
+ const name = val.name;
119
+ if (typeof name == 'string' && name.length > 0) {
120
+ return `Function(${name})`;
121
+ } else {
122
+ return 'Function';
123
+ }
124
+ }
125
+ // objects
126
+ if (Array.isArray(val)) {
127
+ const length = val.length;
128
+ let debug = '[';
129
+ if (length > 0) {
130
+ debug += debugString(val[0]);
131
+ }
132
+ for(let i = 1; i < length; i++) {
133
+ debug += ', ' + debugString(val[i]);
134
+ }
135
+ debug += ']';
136
+ return debug;
137
+ }
138
+ // Test for built-in
139
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
140
+ let className;
141
+ if (builtInMatches && builtInMatches.length > 1) {
142
+ className = builtInMatches[1];
143
+ } else {
144
+ // Failed to match the standard '[object ClassName]'
145
+ return toString.call(val);
146
+ }
147
+ if (className == 'Object') {
148
+ // we're a user defined class or Object
149
+ // JSON.stringify avoids problems with cycles, and is generally much
150
+ // easier than looping through ownProperties of `val`.
151
+ try {
152
+ return 'Object(' + JSON.stringify(val) + ')';
153
+ } catch (_) {
154
+ return 'Object';
155
+ }
156
+ }
157
+ // errors
158
+ if (val instanceof Error) {
159
+ return `${val.name}: ${val.message}\n${val.stack}`;
160
+ }
161
+ // TODO we could test for more things here, like `Set`s and `Map`s.
162
+ return className;
163
+ }
164
+
165
+ function addToExternrefTable0(obj) {
166
+ const idx = wasm.__externref_table_alloc();
167
+ wasm.__wbindgen_externrefs.set(idx, obj);
168
+ return idx;
169
+ }
170
+
171
+ function handleError(f, args) {
172
+ try {
173
+ return f.apply(this, args);
174
+ } catch (e) {
175
+ const idx = addToExternrefTable0(e);
176
+ wasm.__wbindgen_exn_store(idx);
177
+ }
178
+ }
179
+
180
+ function getArrayU8FromWasm0(ptr, len) {
181
+ ptr = ptr >>> 0;
182
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
183
+ }
184
+
185
+ function takeFromExternrefTable0(idx) {
186
+ const value = wasm.__wbindgen_externrefs.get(idx);
187
+ wasm.__externref_table_dealloc(idx);
188
+ return value;
189
+ }
190
+
191
+ function passArray8ToWasm0(arg, malloc) {
192
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
193
+ getUint8ArrayMemory0().set(arg, ptr / 1);
194
+ WASM_VECTOR_LEN = arg.length;
195
+ return ptr;
196
+ }
197
+ /**
198
+ * @param {string} date
199
+ * @returns {string}
200
+ */
201
+ export function airac_code_from_date(date) {
202
+ let deferred3_0;
203
+ let deferred3_1;
204
+ try {
205
+ const ptr0 = passStringToWasm0(date, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
206
+ const len0 = WASM_VECTOR_LEN;
207
+ const ret = wasm.airac_code_from_date(ptr0, len0);
208
+ var ptr2 = ret[0];
209
+ var len2 = ret[1];
210
+ if (ret[3]) {
211
+ ptr2 = 0; len2 = 0;
212
+ throw takeFromExternrefTable0(ret[2]);
213
+ }
214
+ deferred3_0 = ptr2;
215
+ deferred3_1 = len2;
216
+ return getStringFromWasm0(ptr2, len2);
217
+ } finally {
218
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
219
+ }
220
+ }
221
+
222
+ /**
223
+ * @param {string} airac_code
224
+ * @returns {any}
225
+ */
226
+ export function airac_interval(airac_code) {
227
+ const ptr0 = passStringToWasm0(airac_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
228
+ const len0 = WASM_VECTOR_LEN;
229
+ const ret = wasm.airac_interval(ptr0, len0);
230
+ if (ret[2]) {
231
+ throw takeFromExternrefTable0(ret[1]);
232
+ }
233
+ return takeFromExternrefTable0(ret[0]);
234
+ }
235
+
236
+ /**
237
+ * @param {string} airac_code
238
+ * @returns {string}
239
+ */
240
+ export function effective_date_from_airac_code(airac_code) {
241
+ let deferred3_0;
242
+ let deferred3_1;
243
+ try {
244
+ const ptr0 = passStringToWasm0(airac_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
245
+ const len0 = WASM_VECTOR_LEN;
246
+ const ret = wasm.effective_date_from_airac_code(ptr0, len0);
247
+ var ptr2 = ret[0];
248
+ var len2 = ret[1];
249
+ if (ret[3]) {
250
+ ptr2 = 0; len2 = 0;
251
+ throw takeFromExternrefTable0(ret[2]);
252
+ }
253
+ deferred3_0 = ptr2;
254
+ deferred3_1 = len2;
255
+ return getStringFromWasm0(ptr2, len2);
256
+ } finally {
257
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
258
+ }
259
+ }
260
+
261
+ export function run() {
262
+ const ret = wasm.run();
263
+ if (ret[1]) {
264
+ throw takeFromExternrefTable0(ret[0]);
265
+ }
266
+ }
267
+
268
+ /**
269
+ * @returns {string}
270
+ */
271
+ export function wasm_build_profile() {
272
+ let deferred1_0;
273
+ let deferred1_1;
274
+ try {
275
+ const ret = wasm.wasm_build_profile();
276
+ deferred1_0 = ret[0];
277
+ deferred1_1 = ret[1];
278
+ return getStringFromWasm0(ret[0], ret[1]);
279
+ } finally {
280
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
281
+ }
282
+ }
283
+
284
+ const EurocontrolResolverFinalization = (typeof FinalizationRegistry === 'undefined')
285
+ ? { register: () => {}, unregister: () => {} }
286
+ : new FinalizationRegistry(ptr => wasm.__wbg_eurocontrolresolver_free(ptr >>> 0, 1));
287
+
288
+ export class EurocontrolResolver {
289
+
290
+ static __wrap(ptr) {
291
+ ptr = ptr >>> 0;
292
+ const obj = Object.create(EurocontrolResolver.prototype);
293
+ obj.__wbg_ptr = ptr;
294
+ EurocontrolResolverFinalization.register(obj, obj.__wbg_ptr, obj);
295
+ return obj;
296
+ }
297
+
298
+ __destroy_into_raw() {
299
+ const ptr = this.__wbg_ptr;
300
+ this.__wbg_ptr = 0;
301
+ EurocontrolResolverFinalization.unregister(this);
302
+ return ptr;
303
+ }
304
+
305
+ free() {
306
+ const ptr = this.__destroy_into_raw();
307
+ wasm.__wbg_eurocontrolresolver_free(ptr, 0);
308
+ }
309
+ /**
310
+ * @param {string} code
311
+ * @returns {any}
312
+ */
313
+ resolve_fix(code) {
314
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
315
+ const len0 = WASM_VECTOR_LEN;
316
+ const ret = wasm.eurocontrolresolver_resolve_fix(this.__wbg_ptr, ptr0, len0);
317
+ if (ret[2]) {
318
+ throw takeFromExternrefTable0(ret[1]);
319
+ }
320
+ return takeFromExternrefTable0(ret[0]);
321
+ }
322
+ /**
323
+ * @param {string} name
324
+ * @returns {any}
325
+ */
326
+ resolve_airway(name) {
327
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
328
+ const len0 = WASM_VECTOR_LEN;
329
+ const ret = wasm.eurocontrolresolver_resolve_airway(this.__wbg_ptr, ptr0, len0);
330
+ if (ret[2]) {
331
+ throw takeFromExternrefTable0(ret[1]);
332
+ }
333
+ return takeFromExternrefTable0(ret[0]);
334
+ }
335
+ /**
336
+ * @param {string} code
337
+ * @returns {any}
338
+ */
339
+ resolve_navaid(code) {
340
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
341
+ const len0 = WASM_VECTOR_LEN;
342
+ const ret = wasm.eurocontrolresolver_resolve_navaid(this.__wbg_ptr, ptr0, len0);
343
+ if (ret[2]) {
344
+ throw takeFromExternrefTable0(ret[1]);
345
+ }
346
+ return takeFromExternrefTable0(ret[0]);
347
+ }
348
+ /**
349
+ * @param {any} ddr_folder
350
+ * @returns {EurocontrolResolver}
351
+ */
352
+ static fromDdrFolder(ddr_folder) {
353
+ const ret = wasm.eurocontrolresolver_fromDdrFolder(ddr_folder);
354
+ if (ret[2]) {
355
+ throw takeFromExternrefTable0(ret[1]);
356
+ }
357
+ return EurocontrolResolver.__wrap(ret[0]);
358
+ }
359
+ /**
360
+ * @param {string} code
361
+ * @returns {any}
362
+ */
363
+ resolve_airport(code) {
364
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
365
+ const len0 = WASM_VECTOR_LEN;
366
+ const ret = wasm.eurocontrolresolver_resolve_airport(this.__wbg_ptr, ptr0, len0);
367
+ if (ret[2]) {
368
+ throw takeFromExternrefTable0(ret[1]);
369
+ }
370
+ return takeFromExternrefTable0(ret[0]);
371
+ }
372
+ /**
373
+ * @param {Uint8Array} ddr_archive
374
+ * @returns {EurocontrolResolver}
375
+ */
376
+ static fromDdrArchive(ddr_archive) {
377
+ const ptr0 = passArray8ToWasm0(ddr_archive, wasm.__wbindgen_malloc);
378
+ const len0 = WASM_VECTOR_LEN;
379
+ const ret = wasm.eurocontrolresolver_fromDdrArchive(ptr0, len0);
380
+ if (ret[2]) {
381
+ throw takeFromExternrefTable0(ret[1]);
382
+ }
383
+ return EurocontrolResolver.__wrap(ret[0]);
384
+ }
385
+ /**
386
+ * @param {any} aixm_folder
387
+ */
388
+ constructor(aixm_folder) {
389
+ const ret = wasm.eurocontrolresolver_new(aixm_folder);
390
+ if (ret[2]) {
391
+ throw takeFromExternrefTable0(ret[1]);
392
+ }
393
+ this.__wbg_ptr = ret[0] >>> 0;
394
+ EurocontrolResolverFinalization.register(this, this.__wbg_ptr, this);
395
+ return this;
396
+ }
397
+ /**
398
+ * @returns {any}
399
+ */
400
+ fixes() {
401
+ const ret = wasm.eurocontrolresolver_fixes(this.__wbg_ptr);
402
+ if (ret[2]) {
403
+ throw takeFromExternrefTable0(ret[1]);
404
+ }
405
+ return takeFromExternrefTable0(ret[0]);
406
+ }
407
+ /**
408
+ * @returns {any}
409
+ */
410
+ airways() {
411
+ const ret = wasm.eurocontrolresolver_airways(this.__wbg_ptr);
412
+ if (ret[2]) {
413
+ throw takeFromExternrefTable0(ret[1]);
414
+ }
415
+ return takeFromExternrefTable0(ret[0]);
416
+ }
417
+ /**
418
+ * @returns {any}
419
+ */
420
+ navaids() {
421
+ const ret = wasm.eurocontrolresolver_navaids(this.__wbg_ptr);
422
+ if (ret[2]) {
423
+ throw takeFromExternrefTable0(ret[1]);
424
+ }
425
+ return takeFromExternrefTable0(ret[0]);
426
+ }
427
+ /**
428
+ * @returns {any}
429
+ */
430
+ airports() {
431
+ const ret = wasm.eurocontrolresolver_airports(this.__wbg_ptr);
432
+ if (ret[2]) {
433
+ throw takeFromExternrefTable0(ret[1]);
434
+ }
435
+ return takeFromExternrefTable0(ret[0]);
436
+ }
437
+ }
438
+ if (Symbol.dispose) EurocontrolResolver.prototype[Symbol.dispose] = EurocontrolResolver.prototype.free;
439
+
440
+ const FaaArcgisResolverFinalization = (typeof FinalizationRegistry === 'undefined')
441
+ ? { register: () => {}, unregister: () => {} }
442
+ : new FinalizationRegistry(ptr => wasm.__wbg_faaarcgisresolver_free(ptr >>> 0, 1));
443
+
444
+ export class FaaArcgisResolver {
445
+
446
+ __destroy_into_raw() {
447
+ const ptr = this.__wbg_ptr;
448
+ this.__wbg_ptr = 0;
449
+ FaaArcgisResolverFinalization.unregister(this);
450
+ return ptr;
451
+ }
452
+
453
+ free() {
454
+ const ptr = this.__destroy_into_raw();
455
+ wasm.__wbg_faaarcgisresolver_free(ptr, 0);
456
+ }
457
+ /**
458
+ * @param {string} code
459
+ * @returns {any}
460
+ */
461
+ resolve_fix(code) {
462
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
463
+ const len0 = WASM_VECTOR_LEN;
464
+ const ret = wasm.faaarcgisresolver_resolve_fix(this.__wbg_ptr, ptr0, len0);
465
+ if (ret[2]) {
466
+ throw takeFromExternrefTable0(ret[1]);
467
+ }
468
+ return takeFromExternrefTable0(ret[0]);
469
+ }
470
+ /**
471
+ * @param {string} name
472
+ * @returns {any}
473
+ */
474
+ resolve_airway(name) {
475
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
476
+ const len0 = WASM_VECTOR_LEN;
477
+ const ret = wasm.faaarcgisresolver_resolve_airway(this.__wbg_ptr, ptr0, len0);
478
+ if (ret[2]) {
479
+ throw takeFromExternrefTable0(ret[1]);
480
+ }
481
+ return takeFromExternrefTable0(ret[0]);
482
+ }
483
+ /**
484
+ * @param {string} code
485
+ * @returns {any}
486
+ */
487
+ resolve_navaid(code) {
488
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
489
+ const len0 = WASM_VECTOR_LEN;
490
+ const ret = wasm.faaarcgisresolver_resolve_navaid(this.__wbg_ptr, ptr0, len0);
491
+ if (ret[2]) {
492
+ throw takeFromExternrefTable0(ret[1]);
493
+ }
494
+ return takeFromExternrefTable0(ret[0]);
495
+ }
496
+ /**
497
+ * @param {string} code
498
+ * @returns {any}
499
+ */
500
+ resolve_airport(code) {
501
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
502
+ const len0 = WASM_VECTOR_LEN;
503
+ const ret = wasm.faaarcgisresolver_resolve_airport(this.__wbg_ptr, ptr0, len0);
504
+ if (ret[2]) {
505
+ throw takeFromExternrefTable0(ret[1]);
506
+ }
507
+ return takeFromExternrefTable0(ret[0]);
508
+ }
509
+ /**
510
+ * @param {string} designator
511
+ * @returns {any}
512
+ */
513
+ resolve_airspace(designator) {
514
+ const ptr0 = passStringToWasm0(designator, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
515
+ const len0 = WASM_VECTOR_LEN;
516
+ const ret = wasm.faaarcgisresolver_resolve_airspace(this.__wbg_ptr, ptr0, len0);
517
+ if (ret[2]) {
518
+ throw takeFromExternrefTable0(ret[1]);
519
+ }
520
+ return takeFromExternrefTable0(ret[0]);
521
+ }
522
+ /**
523
+ * @param {any} feature_collections_json
524
+ */
525
+ constructor(feature_collections_json) {
526
+ const ret = wasm.faaarcgisresolver_new(feature_collections_json);
527
+ if (ret[2]) {
528
+ throw takeFromExternrefTable0(ret[1]);
529
+ }
530
+ this.__wbg_ptr = ret[0] >>> 0;
531
+ FaaArcgisResolverFinalization.register(this, this.__wbg_ptr, this);
532
+ return this;
533
+ }
534
+ /**
535
+ * @returns {any}
536
+ */
537
+ fixes() {
538
+ const ret = wasm.faaarcgisresolver_fixes(this.__wbg_ptr);
539
+ if (ret[2]) {
540
+ throw takeFromExternrefTable0(ret[1]);
541
+ }
542
+ return takeFromExternrefTable0(ret[0]);
543
+ }
544
+ /**
545
+ * @returns {any}
546
+ */
547
+ airways() {
548
+ const ret = wasm.faaarcgisresolver_airways(this.__wbg_ptr);
549
+ if (ret[2]) {
550
+ throw takeFromExternrefTable0(ret[1]);
551
+ }
552
+ return takeFromExternrefTable0(ret[0]);
553
+ }
554
+ /**
555
+ * @returns {any}
556
+ */
557
+ navaids() {
558
+ const ret = wasm.faaarcgisresolver_navaids(this.__wbg_ptr);
559
+ if (ret[2]) {
560
+ throw takeFromExternrefTable0(ret[1]);
561
+ }
562
+ return takeFromExternrefTable0(ret[0]);
563
+ }
564
+ /**
565
+ * @returns {any}
566
+ */
567
+ airports() {
568
+ const ret = wasm.faaarcgisresolver_airports(this.__wbg_ptr);
569
+ if (ret[2]) {
570
+ throw takeFromExternrefTable0(ret[1]);
571
+ }
572
+ return takeFromExternrefTable0(ret[0]);
573
+ }
574
+ /**
575
+ * @returns {any}
576
+ */
577
+ airspaces() {
578
+ const ret = wasm.faaarcgisresolver_airspaces(this.__wbg_ptr);
579
+ if (ret[2]) {
580
+ throw takeFromExternrefTable0(ret[1]);
581
+ }
582
+ return takeFromExternrefTable0(ret[0]);
583
+ }
584
+ }
585
+ if (Symbol.dispose) FaaArcgisResolver.prototype[Symbol.dispose] = FaaArcgisResolver.prototype.free;
586
+
587
+ const NasrResolverFinalization = (typeof FinalizationRegistry === 'undefined')
588
+ ? { register: () => {}, unregister: () => {} }
589
+ : new FinalizationRegistry(ptr => wasm.__wbg_nasrresolver_free(ptr >>> 0, 1));
590
+
591
+ export class NasrResolver {
592
+
593
+ __destroy_into_raw() {
594
+ const ptr = this.__wbg_ptr;
595
+ this.__wbg_ptr = 0;
596
+ NasrResolverFinalization.unregister(this);
597
+ return ptr;
598
+ }
599
+
600
+ free() {
601
+ const ptr = this.__destroy_into_raw();
602
+ wasm.__wbg_nasrresolver_free(ptr, 0);
603
+ }
604
+ /**
605
+ * @param {string} code
606
+ * @returns {any}
607
+ */
608
+ resolve_fix(code) {
609
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
610
+ const len0 = WASM_VECTOR_LEN;
611
+ const ret = wasm.nasrresolver_resolve_fix(this.__wbg_ptr, ptr0, len0);
612
+ if (ret[2]) {
613
+ throw takeFromExternrefTable0(ret[1]);
614
+ }
615
+ return takeFromExternrefTable0(ret[0]);
616
+ }
617
+ /**
618
+ * @param {string} name
619
+ * @returns {any}
620
+ */
621
+ resolve_airway(name) {
622
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
623
+ const len0 = WASM_VECTOR_LEN;
624
+ const ret = wasm.nasrresolver_resolve_airway(this.__wbg_ptr, ptr0, len0);
625
+ if (ret[2]) {
626
+ throw takeFromExternrefTable0(ret[1]);
627
+ }
628
+ return takeFromExternrefTable0(ret[0]);
629
+ }
630
+ /**
631
+ * @param {string} code
632
+ * @returns {any}
633
+ */
634
+ resolve_navaid(code) {
635
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
636
+ const len0 = WASM_VECTOR_LEN;
637
+ const ret = wasm.nasrresolver_resolve_navaid(this.__wbg_ptr, ptr0, len0);
638
+ if (ret[2]) {
639
+ throw takeFromExternrefTable0(ret[1]);
640
+ }
641
+ return takeFromExternrefTable0(ret[0]);
642
+ }
643
+ /**
644
+ * @param {string} code
645
+ * @returns {any}
646
+ */
647
+ resolve_airport(code) {
648
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
649
+ const len0 = WASM_VECTOR_LEN;
650
+ const ret = wasm.nasrresolver_resolve_airport(this.__wbg_ptr, ptr0, len0);
651
+ if (ret[2]) {
652
+ throw takeFromExternrefTable0(ret[1]);
653
+ }
654
+ return takeFromExternrefTable0(ret[0]);
655
+ }
656
+ /**
657
+ * @param {string} designator
658
+ * @returns {any}
659
+ */
660
+ resolve_airspace(designator) {
661
+ const ptr0 = passStringToWasm0(designator, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
662
+ const len0 = WASM_VECTOR_LEN;
663
+ const ret = wasm.nasrresolver_resolve_airspace(this.__wbg_ptr, ptr0, len0);
664
+ if (ret[2]) {
665
+ throw takeFromExternrefTable0(ret[1]);
666
+ }
667
+ return takeFromExternrefTable0(ret[0]);
668
+ }
669
+ /**
670
+ * @param {Uint8Array} zip_bytes
671
+ */
672
+ constructor(zip_bytes) {
673
+ const ptr0 = passArray8ToWasm0(zip_bytes, wasm.__wbindgen_malloc);
674
+ const len0 = WASM_VECTOR_LEN;
675
+ const ret = wasm.nasrresolver_new(ptr0, len0);
676
+ if (ret[2]) {
677
+ throw takeFromExternrefTable0(ret[1]);
678
+ }
679
+ this.__wbg_ptr = ret[0] >>> 0;
680
+ NasrResolverFinalization.register(this, this.__wbg_ptr, this);
681
+ return this;
682
+ }
683
+ /**
684
+ * @returns {any}
685
+ */
686
+ fixes() {
687
+ const ret = wasm.nasrresolver_fixes(this.__wbg_ptr);
688
+ if (ret[2]) {
689
+ throw takeFromExternrefTable0(ret[1]);
690
+ }
691
+ return takeFromExternrefTable0(ret[0]);
692
+ }
693
+ /**
694
+ * @returns {any}
695
+ */
696
+ airways() {
697
+ const ret = wasm.nasrresolver_airways(this.__wbg_ptr);
698
+ if (ret[2]) {
699
+ throw takeFromExternrefTable0(ret[1]);
700
+ }
701
+ return takeFromExternrefTable0(ret[0]);
702
+ }
703
+ /**
704
+ * @returns {any}
705
+ */
706
+ navaids() {
707
+ const ret = wasm.nasrresolver_navaids(this.__wbg_ptr);
708
+ if (ret[2]) {
709
+ throw takeFromExternrefTable0(ret[1]);
710
+ }
711
+ return takeFromExternrefTable0(ret[0]);
712
+ }
713
+ /**
714
+ * @returns {any}
715
+ */
716
+ airports() {
717
+ const ret = wasm.nasrresolver_airports(this.__wbg_ptr);
718
+ if (ret[2]) {
719
+ throw takeFromExternrefTable0(ret[1]);
720
+ }
721
+ return takeFromExternrefTable0(ret[0]);
722
+ }
723
+ /**
724
+ * @returns {any}
725
+ */
726
+ airspaces() {
727
+ const ret = wasm.nasrresolver_airspaces(this.__wbg_ptr);
728
+ if (ret[2]) {
729
+ throw takeFromExternrefTable0(ret[1]);
730
+ }
731
+ return takeFromExternrefTable0(ret[0]);
732
+ }
733
+ }
734
+ if (Symbol.dispose) NasrResolver.prototype[Symbol.dispose] = NasrResolver.prototype.free;
735
+
736
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
737
+
738
+ async function __wbg_load(module, imports) {
739
+ if (typeof Response === 'function' && module instanceof Response) {
740
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
741
+ try {
742
+ return await WebAssembly.instantiateStreaming(module, imports);
743
+
744
+ } catch (e) {
745
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
746
+
747
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
748
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
749
+
750
+ } else {
751
+ throw e;
752
+ }
753
+ }
754
+ }
755
+
756
+ const bytes = await module.arrayBuffer();
757
+ return await WebAssembly.instantiate(bytes, imports);
758
+
759
+ } else {
760
+ const instance = await WebAssembly.instantiate(module, imports);
761
+
762
+ if (instance instanceof WebAssembly.Instance) {
763
+ return { instance, module };
764
+
765
+ } else {
766
+ return instance;
767
+ }
768
+ }
769
+ }
770
+
771
+ function __wbg_get_imports() {
772
+ const imports = {};
773
+ imports.wbg = {};
774
+ imports.wbg.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
775
+ const ret = Error(getStringFromWasm0(arg0, arg1));
776
+ return ret;
777
+ };
778
+ imports.wbg.__wbg_Number_bb48ca12f395cd08 = function(arg0) {
779
+ const ret = Number(arg0);
780
+ return ret;
781
+ };
782
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
783
+ const ret = String(arg1);
784
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
785
+ const len1 = WASM_VECTOR_LEN;
786
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
787
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
788
+ };
789
+ imports.wbg.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
790
+ const v = arg1;
791
+ const ret = typeof(v) === 'bigint' ? v : undefined;
792
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
793
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
794
+ };
795
+ imports.wbg.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
796
+ const v = arg0;
797
+ const ret = typeof(v) === 'boolean' ? v : undefined;
798
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
799
+ };
800
+ imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
801
+ const ret = debugString(arg1);
802
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
803
+ const len1 = WASM_VECTOR_LEN;
804
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
805
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
806
+ };
807
+ imports.wbg.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
808
+ const ret = arg0 in arg1;
809
+ return ret;
810
+ };
811
+ imports.wbg.__wbg___wbindgen_is_bigint_cb320707dcd35f0b = function(arg0) {
812
+ const ret = typeof(arg0) === 'bigint';
813
+ return ret;
814
+ };
815
+ imports.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
816
+ const ret = typeof(arg0) === 'function';
817
+ return ret;
818
+ };
819
+ imports.wbg.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
820
+ const val = arg0;
821
+ const ret = typeof(val) === 'object' && val !== null;
822
+ return ret;
823
+ };
824
+ imports.wbg.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
825
+ const ret = arg0 === arg1;
826
+ return ret;
827
+ };
828
+ imports.wbg.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
829
+ const ret = arg0 == arg1;
830
+ return ret;
831
+ };
832
+ imports.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
833
+ const obj = arg1;
834
+ const ret = typeof(obj) === 'number' ? obj : undefined;
835
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
836
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
837
+ };
838
+ imports.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
839
+ const obj = arg1;
840
+ const ret = typeof(obj) === 'string' ? obj : undefined;
841
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
842
+ var len1 = WASM_VECTOR_LEN;
843
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
844
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
845
+ };
846
+ imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
847
+ throw new Error(getStringFromWasm0(arg0, arg1));
848
+ };
849
+ imports.wbg.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {
850
+ const ret = arg0.call(arg1);
851
+ return ret;
852
+ }, arguments) };
853
+ imports.wbg.__wbg_done_2042aa2670fb1db1 = function(arg0) {
854
+ const ret = arg0.done;
855
+ return ret;
856
+ };
857
+ imports.wbg.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
858
+ const ret = Object.entries(arg0);
859
+ return ret;
860
+ };
861
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
862
+ let deferred0_0;
863
+ let deferred0_1;
864
+ try {
865
+ deferred0_0 = arg0;
866
+ deferred0_1 = arg1;
867
+ console.error(getStringFromWasm0(arg0, arg1));
868
+ } finally {
869
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
870
+ }
871
+ };
872
+ imports.wbg.__wbg_from_a4ad7cbddd0d7135 = function(arg0) {
873
+ const ret = Array.from(arg0);
874
+ return ret;
875
+ };
876
+ imports.wbg.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
877
+ const ret = arg0[arg1 >>> 0];
878
+ return ret;
879
+ };
880
+ imports.wbg.__wbg_get_efcb449f58ec27c2 = function() { return handleError(function (arg0, arg1) {
881
+ const ret = Reflect.get(arg0, arg1);
882
+ return ret;
883
+ }, arguments) };
884
+ imports.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
885
+ let result;
886
+ try {
887
+ result = arg0 instanceof ArrayBuffer;
888
+ } catch (_) {
889
+ result = false;
890
+ }
891
+ const ret = result;
892
+ return ret;
893
+ };
894
+ imports.wbg.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
895
+ let result;
896
+ try {
897
+ result = arg0 instanceof Map;
898
+ } catch (_) {
899
+ result = false;
900
+ }
901
+ const ret = result;
902
+ return ret;
903
+ };
904
+ imports.wbg.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
905
+ let result;
906
+ try {
907
+ result = arg0 instanceof Uint8Array;
908
+ } catch (_) {
909
+ result = false;
910
+ }
911
+ const ret = result;
912
+ return ret;
913
+ };
914
+ imports.wbg.__wbg_isArray_96e0af9891d0945d = function(arg0) {
915
+ const ret = Array.isArray(arg0);
916
+ return ret;
917
+ };
918
+ imports.wbg.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
919
+ const ret = Number.isSafeInteger(arg0);
920
+ return ret;
921
+ };
922
+ imports.wbg.__wbg_iterator_e5822695327a3c39 = function() {
923
+ const ret = Symbol.iterator;
924
+ return ret;
925
+ };
926
+ imports.wbg.__wbg_length_69bca3cb64fc8748 = function(arg0) {
927
+ const ret = arg0.length;
928
+ return ret;
929
+ };
930
+ imports.wbg.__wbg_length_cdd215e10d9dd507 = function(arg0) {
931
+ const ret = arg0.length;
932
+ return ret;
933
+ };
934
+ imports.wbg.__wbg_new_1acc0b6eea89d040 = function() {
935
+ const ret = new Object();
936
+ return ret;
937
+ };
938
+ imports.wbg.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
939
+ const ret = new Uint8Array(arg0);
940
+ return ret;
941
+ };
942
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
943
+ const ret = new Error();
944
+ return ret;
945
+ };
946
+ imports.wbg.__wbg_new_e17d9f43105b08be = function() {
947
+ const ret = new Array();
948
+ return ret;
949
+ };
950
+ imports.wbg.__wbg_next_020810e0ae8ebcb0 = function() { return handleError(function (arg0) {
951
+ const ret = arg0.next();
952
+ return ret;
953
+ }, arguments) };
954
+ imports.wbg.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
955
+ const ret = arg0.next;
956
+ return ret;
957
+ };
958
+ imports.wbg.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
959
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
960
+ };
961
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
962
+ arg0[arg1] = arg2;
963
+ };
964
+ imports.wbg.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
965
+ arg0[arg1 >>> 0] = arg2;
966
+ };
967
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
968
+ const ret = arg1.stack;
969
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
970
+ const len1 = WASM_VECTOR_LEN;
971
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
972
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
973
+ };
974
+ imports.wbg.__wbg_value_692627309814bb8c = function(arg0) {
975
+ const ret = arg0.value;
976
+ return ret;
977
+ };
978
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
979
+ // Cast intrinsic for `Ref(String) -> Externref`.
980
+ const ret = getStringFromWasm0(arg0, arg1);
981
+ return ret;
982
+ };
983
+ imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
984
+ // Cast intrinsic for `U64 -> Externref`.
985
+ const ret = BigInt.asUintN(64, arg0);
986
+ return ret;
987
+ };
988
+ imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
989
+ // Cast intrinsic for `I64 -> Externref`.
990
+ const ret = arg0;
991
+ return ret;
992
+ };
993
+ imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
994
+ // Cast intrinsic for `F64 -> Externref`.
995
+ const ret = arg0;
996
+ return ret;
997
+ };
998
+ imports.wbg.__wbindgen_init_externref_table = function() {
999
+ const table = wasm.__wbindgen_externrefs;
1000
+ const offset = table.grow(4);
1001
+ table.set(0, undefined);
1002
+ table.set(offset + 0, undefined);
1003
+ table.set(offset + 1, null);
1004
+ table.set(offset + 2, true);
1005
+ table.set(offset + 3, false);
1006
+ ;
1007
+ };
1008
+
1009
+ return imports;
1010
+ }
1011
+
1012
+ function __wbg_finalize_init(instance, module) {
1013
+ wasm = instance.exports;
1014
+ __wbg_init.__wbindgen_wasm_module = module;
1015
+ cachedDataViewMemory0 = null;
1016
+ cachedUint8ArrayMemory0 = null;
1017
+
1018
+
1019
+ wasm.__wbindgen_start();
1020
+ return wasm;
1021
+ }
1022
+
1023
+ function initSync(module) {
1024
+ if (wasm !== undefined) return wasm;
1025
+
1026
+
1027
+ if (typeof module !== 'undefined') {
1028
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1029
+ ({module} = module)
1030
+ } else {
1031
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1032
+ }
1033
+ }
1034
+
1035
+ const imports = __wbg_get_imports();
1036
+
1037
+ if (!(module instanceof WebAssembly.Module)) {
1038
+ module = new WebAssembly.Module(module);
1039
+ }
1040
+
1041
+ const instance = new WebAssembly.Instance(module, imports);
1042
+
1043
+ return __wbg_finalize_init(instance, module);
1044
+ }
1045
+
1046
+ async function __wbg_init(module_or_path) {
1047
+ if (wasm !== undefined) return wasm;
1048
+
1049
+
1050
+ if (typeof module_or_path !== 'undefined') {
1051
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1052
+ ({module_or_path} = module_or_path)
1053
+ } else {
1054
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1055
+ }
1056
+ }
1057
+
1058
+ if (typeof module_or_path === 'undefined') {
1059
+ module_or_path = new URL('thrust_wasm_bg.wasm', import.meta.url);
1060
+ }
1061
+ const imports = __wbg_get_imports();
1062
+
1063
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1064
+ module_or_path = fetch(module_or_path);
1065
+ }
1066
+
1067
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1068
+
1069
+ return __wbg_finalize_init(instance, module);
1070
+ }
1071
+
1072
+ export { initSync };
1073
+ export default __wbg_init;