barcode-detector 2.3.1 → 3.0.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.
@@ -0,0 +1,2176 @@
1
+ var Xe = (i) => {
2
+ throw TypeError(i);
3
+ };
4
+ var qe = (i, f, p) => f.has(i) || Xe("Cannot " + p);
5
+ var Ze = (i, f, p) => (qe(i, f, "read from private field"), p ? p.call(i) : f.get(i)), Ye = (i, f, p) => f.has(i) ? Xe("Cannot add the same private member more than once") : f instanceof WeakSet ? f.add(i) : f.set(i, p), Qe = (i, f, p, T) => (qe(i, f, "write to private field"), T ? T.call(i, p) : f.set(i, p), p);
6
+ const Bt = [
7
+ ["Aztec", "M"],
8
+ ["Codabar", "L"],
9
+ ["Code39", "L"],
10
+ ["Code93", "L"],
11
+ ["Code128", "L"],
12
+ ["DataBar", "L"],
13
+ ["DataBarExpanded", "L"],
14
+ ["DataMatrix", "M"],
15
+ ["EAN-8", "L"],
16
+ ["EAN-13", "L"],
17
+ ["ITF", "L"],
18
+ ["MaxiCode", "M"],
19
+ ["PDF417", "M"],
20
+ ["QRCode", "M"],
21
+ ["UPC-A", "L"],
22
+ ["UPC-E", "L"],
23
+ ["MicroQRCode", "M"],
24
+ ["rMQRCode", "M"],
25
+ ["DXFilmEdge", "L"],
26
+ ["DataBarLimited", "L"]
27
+ ], Ut = Bt.map(([i]) => i), Za = Ut.filter(
28
+ (i, f) => Bt[f][1] === "L"
29
+ ), Ya = Ut.filter(
30
+ (i, f) => Bt[f][1] === "M"
31
+ );
32
+ function re(i) {
33
+ switch (i) {
34
+ case "Linear-Codes":
35
+ return Za.reduce((f, p) => f | re(p), 0);
36
+ case "Matrix-Codes":
37
+ return Ya.reduce((f, p) => f | re(p), 0);
38
+ case "Any":
39
+ return (1 << Bt.length) - 1;
40
+ case "None":
41
+ return 0;
42
+ default:
43
+ return 1 << Ut.indexOf(i);
44
+ }
45
+ }
46
+ function Qa(i) {
47
+ if (i === 0)
48
+ return "None";
49
+ const f = 31 - Math.clz32(i);
50
+ return Ut[f];
51
+ }
52
+ function Ja(i) {
53
+ return i.reduce((f, p) => f | re(p), 0);
54
+ }
55
+ const Ka = [
56
+ "LocalAverage",
57
+ "GlobalHistogram",
58
+ "FixedThreshold",
59
+ "BoolCast"
60
+ ];
61
+ function ti(i) {
62
+ return Ka.indexOf(i);
63
+ }
64
+ const Je = [
65
+ "Unknown",
66
+ "ASCII",
67
+ "ISO8859_1",
68
+ "ISO8859_2",
69
+ "ISO8859_3",
70
+ "ISO8859_4",
71
+ "ISO8859_5",
72
+ "ISO8859_6",
73
+ "ISO8859_7",
74
+ "ISO8859_8",
75
+ "ISO8859_9",
76
+ "ISO8859_10",
77
+ "ISO8859_11",
78
+ "ISO8859_13",
79
+ "ISO8859_14",
80
+ "ISO8859_15",
81
+ "ISO8859_16",
82
+ "Cp437",
83
+ "Cp1250",
84
+ "Cp1251",
85
+ "Cp1252",
86
+ "Cp1256",
87
+ "Shift_JIS",
88
+ "Big5",
89
+ "GB2312",
90
+ "GB18030",
91
+ "EUC_JP",
92
+ "EUC_KR",
93
+ "UTF16BE",
94
+ /**
95
+ * UnicodeBig [[deprecated]]
96
+ */
97
+ "UTF16BE",
98
+ "UTF8",
99
+ "UTF16LE",
100
+ "UTF32BE",
101
+ "UTF32LE",
102
+ "BINARY"
103
+ ];
104
+ function ei(i) {
105
+ return i === "UnicodeBig" ? Je.indexOf("UTF16BE") : Je.indexOf(i);
106
+ }
107
+ const ri = [
108
+ "Text",
109
+ "Binary",
110
+ "Mixed",
111
+ "GS1",
112
+ "ISO15434",
113
+ "UnknownECI"
114
+ ];
115
+ function ni(i) {
116
+ return ri[i];
117
+ }
118
+ const ai = ["Ignore", "Read", "Require"];
119
+ function ii(i) {
120
+ return ai.indexOf(i);
121
+ }
122
+ const oi = ["Plain", "ECI", "HRI", "Hex", "Escaped"];
123
+ function si(i) {
124
+ return oi.indexOf(i);
125
+ }
126
+ const Lt = {
127
+ formats: [],
128
+ tryHarder: !0,
129
+ tryRotate: !0,
130
+ tryInvert: !0,
131
+ tryDownscale: !0,
132
+ tryDenoise: !1,
133
+ binarizer: "LocalAverage",
134
+ isPure: !1,
135
+ downscaleFactor: 3,
136
+ downscaleThreshold: 500,
137
+ minLineCount: 2,
138
+ maxNumberOfSymbols: 255,
139
+ tryCode39ExtendedMode: !0,
140
+ returnErrors: !1,
141
+ eanAddOnSymbol: "Ignore",
142
+ textMode: "HRI",
143
+ characterSet: "Unknown"
144
+ };
145
+ function Ke(i) {
146
+ return {
147
+ ...i,
148
+ formats: Ja(i.formats),
149
+ binarizer: ti(i.binarizer),
150
+ eanAddOnSymbol: ii(i.eanAddOnSymbol),
151
+ textMode: si(i.textMode),
152
+ characterSet: ei(i.characterSet)
153
+ };
154
+ }
155
+ function ui(i) {
156
+ return {
157
+ ...i,
158
+ format: Qa(i.format),
159
+ contentType: ni(i.contentType),
160
+ eccLevel: i.ecLevel
161
+ };
162
+ }
163
+ const Di = "2.1.0", Ii = "37b847798a1af55d3a289a9516a751fcafae3c23", ci = {
164
+ locateFile: (i, f) => {
165
+ const p = i.match(/_(.+?)\.wasm$/);
166
+ return p ? `https://fastly.jsdelivr.net/npm/zxing-wasm@2.1.0/dist/${p[1]}/${i}` : f + i;
167
+ }
168
+ }, Rt = /* @__PURE__ */ new WeakMap();
169
+ function li(i, f) {
170
+ return Object.is(i, f) || Object.keys(i).length === Object.keys(f).length && Object.keys(i).every(
171
+ (p) => Object.prototype.hasOwnProperty.call(f, p) && i[p] === f[p]
172
+ );
173
+ }
174
+ function er(i, {
175
+ overrides: f,
176
+ equalityFn: p = li,
177
+ fireImmediately: T = !1
178
+ } = {}) {
179
+ var c;
180
+ const [O, D] = (c = Rt.get(i)) != null ? c : [ci], R = f != null ? f : O;
181
+ let A;
182
+ if (T) {
183
+ if (D && (A = p(O, R)))
184
+ return D;
185
+ const M = i({
186
+ ...R
187
+ });
188
+ return Rt.set(i, [R, M]), M;
189
+ }
190
+ (A != null ? A : p(O, R)) || Rt.set(i, [R]);
191
+ }
192
+ function fi(i) {
193
+ Rt.delete(i);
194
+ }
195
+ async function di(i, f, p = Lt) {
196
+ const T = {
197
+ ...Lt,
198
+ ...p
199
+ }, c = await er(i, {
200
+ fireImmediately: !0
201
+ });
202
+ let O, D;
203
+ if ("width" in f && "height" in f && "data" in f) {
204
+ const {
205
+ data: A,
206
+ data: { byteLength: M },
207
+ width: k,
208
+ height: Z
209
+ } = f;
210
+ D = c._malloc(M), c.HEAPU8.set(A, D), O = c.readBarcodesFromPixmap(
211
+ D,
212
+ k,
213
+ Z,
214
+ Ke(T)
215
+ );
216
+ } else {
217
+ let A, M;
218
+ if ("buffer" in f)
219
+ [A, M] = [f.byteLength, f];
220
+ else if ("byteLength" in f)
221
+ [A, M] = [f.byteLength, new Uint8Array(f)];
222
+ else if ("size" in f)
223
+ [A, M] = [f.size, new Uint8Array(await f.arrayBuffer())];
224
+ else
225
+ throw new TypeError("Invalid input type");
226
+ D = c._malloc(A), c.HEAPU8.set(M, D), O = c.readBarcodesFromImage(
227
+ D,
228
+ A,
229
+ Ke(T)
230
+ );
231
+ }
232
+ c._free(D);
233
+ const R = [];
234
+ for (let A = 0; A < O.size(); ++A)
235
+ R.push(
236
+ ui(O.get(A))
237
+ );
238
+ return R;
239
+ }
240
+ ({
241
+ ...Lt,
242
+ formats: [...Lt.formats]
243
+ });
244
+ var ae = (() => {
245
+ var i, f = typeof document < "u" && ((i = document.currentScript) == null ? void 0 : i.tagName.toUpperCase()) === "SCRIPT" ? document.currentScript.src : void 0;
246
+ return function(p = {}) {
247
+ var T, c = p, O, D, R = new Promise((t, e) => {
248
+ O = t, D = e;
249
+ }), A = typeof window == "object", M = typeof Bun < "u", k = typeof WorkerGlobalScope < "u";
250
+ typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string" && process.type != "renderer";
251
+ var Z = Object.assign({}, c), tt = "./this.program", L = "";
252
+ function yt(t) {
253
+ return c.locateFile ? c.locateFile(t, L) : L + t;
254
+ }
255
+ var it, ot;
256
+ if (A || k || M) {
257
+ var st;
258
+ k ? L = self.location.href : typeof document < "u" && ((st = document.currentScript) === null || st === void 0 ? void 0 : st.tagName.toUpperCase()) === "SCRIPT" && (L = document.currentScript.src), f && (L = f), L.startsWith("blob:") ? L = "" : L = L.substr(0, L.replace(/[?#].*/, "").lastIndexOf("/") + 1), k && (ot = (t) => {
259
+ var e = new XMLHttpRequest();
260
+ return e.open("GET", t, !1), e.responseType = "arraybuffer", e.send(null), new Uint8Array(e.response);
261
+ }), it = async (t) => {
262
+ var e = await fetch(t, {
263
+ credentials: "same-origin"
264
+ });
265
+ if (e.ok)
266
+ return e.arrayBuffer();
267
+ throw new Error(e.status + " : " + e.url);
268
+ };
269
+ }
270
+ var dr = c.print || console.log.bind(console), et = c.printErr || console.error.bind(console);
271
+ Object.assign(c, Z), Z = null, c.arguments && c.arguments, c.thisProgram && (tt = c.thisProgram);
272
+ var vt = c.wasmBinary, mt, ie = !1, H, B, ut, gt, rt, P, oe, se;
273
+ function ue() {
274
+ var t = mt.buffer;
275
+ c.HEAP8 = H = new Int8Array(t), c.HEAP16 = ut = new Int16Array(t), c.HEAPU8 = B = new Uint8Array(t), c.HEAPU16 = gt = new Uint16Array(t), c.HEAP32 = rt = new Int32Array(t), c.HEAPU32 = P = new Uint32Array(t), c.HEAPF32 = oe = new Float32Array(t), c.HEAPF64 = se = new Float64Array(t);
276
+ }
277
+ var ce = [], le = [], fe = [];
278
+ function hr() {
279
+ if (c.preRun)
280
+ for (typeof c.preRun == "function" && (c.preRun = [c.preRun]); c.preRun.length; )
281
+ vr(c.preRun.shift());
282
+ kt(ce);
283
+ }
284
+ function pr() {
285
+ kt(le);
286
+ }
287
+ function yr() {
288
+ if (c.postRun)
289
+ for (typeof c.postRun == "function" && (c.postRun = [c.postRun]); c.postRun.length; )
290
+ gr(c.postRun.shift());
291
+ kt(fe);
292
+ }
293
+ function vr(t) {
294
+ ce.unshift(t);
295
+ }
296
+ function mr(t) {
297
+ le.unshift(t);
298
+ }
299
+ function gr(t) {
300
+ fe.unshift(t);
301
+ }
302
+ var Y = 0, ct = null;
303
+ function wr(t) {
304
+ var e;
305
+ Y++, (e = c.monitorRunDependencies) === null || e === void 0 || e.call(c, Y);
306
+ }
307
+ function $r(t) {
308
+ var e;
309
+ if (Y--, (e = c.monitorRunDependencies) === null || e === void 0 || e.call(c, Y), Y == 0 && ct) {
310
+ var r = ct;
311
+ ct = null, r();
312
+ }
313
+ }
314
+ function Wt(t) {
315
+ var e;
316
+ (e = c.onAbort) === null || e === void 0 || e.call(c, t), t = "Aborted(" + t + ")", et(t), ie = !0, t += ". Build with -sASSERTIONS for more info.";
317
+ var r = new WebAssembly.RuntimeError(t);
318
+ throw D(r), r;
319
+ }
320
+ var br = "data:application/octet-stream;base64,", de = (t) => t.startsWith(br);
321
+ function Cr() {
322
+ var t = "zxing_reader.wasm";
323
+ return de(t) ? t : yt(t);
324
+ }
325
+ var wt;
326
+ function Tr(t) {
327
+ if (t == wt && vt)
328
+ return new Uint8Array(vt);
329
+ if (ot)
330
+ return ot(t);
331
+ throw "both async and sync fetching of the wasm failed";
332
+ }
333
+ async function Pr(t) {
334
+ if (!vt)
335
+ try {
336
+ var e = await it(t);
337
+ return new Uint8Array(e);
338
+ } catch {
339
+ }
340
+ return Tr(t);
341
+ }
342
+ async function _r(t, e) {
343
+ try {
344
+ var r = await Pr(t), n = await WebAssembly.instantiate(r, e);
345
+ return n;
346
+ } catch (a) {
347
+ et(`failed to asynchronously prepare wasm: ${a}`), Wt(a);
348
+ }
349
+ }
350
+ async function Er(t, e, r) {
351
+ if (!t && typeof WebAssembly.instantiateStreaming == "function" && !de(e) && typeof fetch == "function")
352
+ try {
353
+ var n = fetch(e, {
354
+ credentials: "same-origin"
355
+ }), a = await WebAssembly.instantiateStreaming(n, r);
356
+ return a;
357
+ } catch (o) {
358
+ et(`wasm streaming compile failed: ${o}`), et("falling back to ArrayBuffer instantiation");
359
+ }
360
+ return _r(e, r);
361
+ }
362
+ function Or() {
363
+ return {
364
+ a: ha
365
+ };
366
+ }
367
+ async function Ar() {
368
+ var t;
369
+ function e(o, u) {
370
+ return E = o.exports, mt = E.xa, ue(), Ce = E.Ba, mr(E.ya), $r(), E;
371
+ }
372
+ wr();
373
+ function r(o) {
374
+ e(o.instance);
375
+ }
376
+ var n = Or();
377
+ if (c.instantiateWasm)
378
+ try {
379
+ return c.instantiateWasm(n, e);
380
+ } catch (o) {
381
+ et(`Module.instantiateWasm callback failed with error: ${o}`), D(o);
382
+ }
383
+ (t = wt) !== null && t !== void 0 || (wt = Cr());
384
+ try {
385
+ var a = await Er(vt, wt, n);
386
+ return r(a), a;
387
+ } catch (o) {
388
+ D(o);
389
+ return;
390
+ }
391
+ }
392
+ var kt = (t) => {
393
+ for (; t.length > 0; )
394
+ t.shift()(c);
395
+ };
396
+ c.noExitRuntime;
397
+ var m = (t) => je(t), g = () => Re(), $t = [], bt = 0, Sr = (t) => {
398
+ var e = new Ht(t);
399
+ return e.get_caught() || (e.set_caught(!0), bt--), e.set_rethrown(!1), $t.push(e), Be(t), Me(t);
400
+ }, V = 0, xr = () => {
401
+ v(0, 0);
402
+ var t = $t.pop();
403
+ Le(t.excPtr), V = 0;
404
+ };
405
+ class Ht {
406
+ constructor(e) {
407
+ this.excPtr = e, this.ptr = e - 24;
408
+ }
409
+ set_type(e) {
410
+ P[this.ptr + 4 >> 2] = e;
411
+ }
412
+ get_type() {
413
+ return P[this.ptr + 4 >> 2];
414
+ }
415
+ set_destructor(e) {
416
+ P[this.ptr + 8 >> 2] = e;
417
+ }
418
+ get_destructor() {
419
+ return P[this.ptr + 8 >> 2];
420
+ }
421
+ set_caught(e) {
422
+ e = e ? 1 : 0, H[this.ptr + 12] = e;
423
+ }
424
+ get_caught() {
425
+ return H[this.ptr + 12] != 0;
426
+ }
427
+ set_rethrown(e) {
428
+ e = e ? 1 : 0, H[this.ptr + 13] = e;
429
+ }
430
+ get_rethrown() {
431
+ return H[this.ptr + 13] != 0;
432
+ }
433
+ init(e, r) {
434
+ this.set_adjusted_ptr(0), this.set_type(e), this.set_destructor(r);
435
+ }
436
+ set_adjusted_ptr(e) {
437
+ P[this.ptr + 16 >> 2] = e;
438
+ }
439
+ get_adjusted_ptr() {
440
+ return P[this.ptr + 16 >> 2];
441
+ }
442
+ }
443
+ var Dr = (t) => {
444
+ throw V || (V = t), V;
445
+ }, Ct = (t) => Fe(t), Vt = (t) => {
446
+ var e = V;
447
+ if (!e)
448
+ return Ct(0), 0;
449
+ var r = new Ht(e);
450
+ r.set_adjusted_ptr(e);
451
+ var n = r.get_type();
452
+ if (!n)
453
+ return Ct(0), e;
454
+ for (var a of t) {
455
+ if (a === 0 || a === n)
456
+ break;
457
+ var o = r.ptr + 16;
458
+ if (Ue(a, n, o))
459
+ return Ct(a), e;
460
+ }
461
+ return Ct(n), e;
462
+ }, Ir = () => Vt([]), Mr = (t) => Vt([t]), Fr = (t, e) => Vt([t, e]), jr = () => {
463
+ var t = $t.pop();
464
+ t || Wt("no exception to throw");
465
+ var e = t.excPtr;
466
+ throw t.get_rethrown() || ($t.push(t), t.set_rethrown(!0), t.set_caught(!1), bt++), V = e, V;
467
+ }, Rr = (t, e, r) => {
468
+ var n = new Ht(t);
469
+ throw n.init(e, r), V = t, bt++, V;
470
+ }, Lr = () => bt, Br = () => Wt(""), Tt = {}, Nt = (t) => {
471
+ for (; t.length; ) {
472
+ var e = t.pop(), r = t.pop();
473
+ r(e);
474
+ }
475
+ };
476
+ function lt(t) {
477
+ return this.fromWireType(P[t >> 2]);
478
+ }
479
+ var nt = {}, Q = {}, Pt = {}, he, _t = (t) => {
480
+ throw new he(t);
481
+ }, J = (t, e, r) => {
482
+ t.forEach((s) => Pt[s] = e);
483
+ function n(s) {
484
+ var l = r(s);
485
+ l.length !== t.length && _t("Mismatched type converter count");
486
+ for (var d = 0; d < t.length; ++d)
487
+ W(t[d], l[d]);
488
+ }
489
+ var a = new Array(e.length), o = [], u = 0;
490
+ e.forEach((s, l) => {
491
+ Q.hasOwnProperty(s) ? a[l] = Q[s] : (o.push(s), nt.hasOwnProperty(s) || (nt[s] = []), nt[s].push(() => {
492
+ a[l] = Q[s], ++u, u === o.length && n(a);
493
+ }));
494
+ }), o.length === 0 && n(a);
495
+ }, Ur = (t) => {
496
+ var e = Tt[t];
497
+ delete Tt[t];
498
+ var r = e.rawConstructor, n = e.rawDestructor, a = e.fields, o = a.map((u) => u.getterReturnType).concat(a.map((u) => u.setterArgumentType));
499
+ J([t], o, (u) => {
500
+ var s = {};
501
+ return a.forEach((l, d) => {
502
+ var h = l.fieldName, y = u[d], $ = l.getter, C = l.getterContext, _ = u[d + a.length], I = l.setter, S = l.setterContext;
503
+ s[h] = {
504
+ read: (x) => y.fromWireType($(C, x)),
505
+ write: (x, K) => {
506
+ var j = [];
507
+ I(S, x, _.toWireType(j, K)), Nt(j);
508
+ }
509
+ };
510
+ }), [{
511
+ name: e.name,
512
+ fromWireType: (l) => {
513
+ var d = {};
514
+ for (var h in s)
515
+ d[h] = s[h].read(l);
516
+ return n(l), d;
517
+ },
518
+ toWireType: (l, d) => {
519
+ for (var h in s)
520
+ if (!(h in d))
521
+ throw new TypeError(`Missing field: "${h}"`);
522
+ var y = r();
523
+ for (h in s)
524
+ s[h].write(y, d[h]);
525
+ return l !== null && l.push(n, y), y;
526
+ },
527
+ argPackAdvance: N,
528
+ readValueFromPointer: lt,
529
+ destructorFunction: n
530
+ }];
531
+ });
532
+ }, Wr = (t, e, r, n, a) => {
533
+ }, kr = () => {
534
+ for (var t = new Array(256), e = 0; e < 256; ++e)
535
+ t[e] = String.fromCharCode(e);
536
+ pe = t;
537
+ }, pe, F = (t) => {
538
+ for (var e = "", r = t; B[r]; )
539
+ e += pe[B[r++]];
540
+ return e;
541
+ }, at, b = (t) => {
542
+ throw new at(t);
543
+ };
544
+ function Hr(t, e) {
545
+ let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
546
+ var n = e.name;
547
+ if (t || b(`type "${n}" must have a positive integer typeid pointer`), Q.hasOwnProperty(t)) {
548
+ if (r.ignoreDuplicateRegistrations)
549
+ return;
550
+ b(`Cannot register type '${n}' twice`);
551
+ }
552
+ if (Q[t] = e, delete Pt[t], nt.hasOwnProperty(t)) {
553
+ var a = nt[t];
554
+ delete nt[t], a.forEach((o) => o());
555
+ }
556
+ }
557
+ function W(t, e) {
558
+ let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
559
+ return Hr(t, e, r);
560
+ }
561
+ var N = 8, Vr = (t, e, r, n) => {
562
+ e = F(e), W(t, {
563
+ name: e,
564
+ fromWireType: function(a) {
565
+ return !!a;
566
+ },
567
+ toWireType: function(a, o) {
568
+ return o ? r : n;
569
+ },
570
+ argPackAdvance: N,
571
+ readValueFromPointer: function(a) {
572
+ return this.fromWireType(B[a]);
573
+ },
574
+ destructorFunction: null
575
+ });
576
+ }, Nr = (t) => ({
577
+ count: t.count,
578
+ deleteScheduled: t.deleteScheduled,
579
+ preservePointerOnDelete: t.preservePointerOnDelete,
580
+ ptr: t.ptr,
581
+ ptrType: t.ptrType,
582
+ smartPtr: t.smartPtr,
583
+ smartPtrType: t.smartPtrType
584
+ }), zt = (t) => {
585
+ function e(r) {
586
+ return r.$$.ptrType.registeredClass.name;
587
+ }
588
+ b(e(t) + " instance already deleted");
589
+ }, Gt = !1, ye = (t) => {
590
+ }, zr = (t) => {
591
+ t.smartPtr ? t.smartPtrType.rawDestructor(t.smartPtr) : t.ptrType.registeredClass.rawDestructor(t.ptr);
592
+ }, ve = (t) => {
593
+ t.count.value -= 1;
594
+ var e = t.count.value === 0;
595
+ e && zr(t);
596
+ }, me = (t, e, r) => {
597
+ if (e === r)
598
+ return t;
599
+ if (r.baseClass === void 0)
600
+ return null;
601
+ var n = me(t, e, r.baseClass);
602
+ return n === null ? null : r.downcast(n);
603
+ }, ge = {}, Gr = {}, Xr = (t, e) => {
604
+ for (e === void 0 && b("ptr should not be undefined"); t.baseClass; )
605
+ e = t.upcast(e), t = t.baseClass;
606
+ return e;
607
+ }, qr = (t, e) => (e = Xr(t, e), Gr[e]), Et = (t, e) => {
608
+ (!e.ptrType || !e.ptr) && _t("makeClassHandle requires ptr and ptrType");
609
+ var r = !!e.smartPtrType, n = !!e.smartPtr;
610
+ return r !== n && _t("Both smartPtrType and smartPtr must be specified"), e.count = {
611
+ value: 1
612
+ }, ft(Object.create(t, {
613
+ $$: {
614
+ value: e,
615
+ writable: !0
616
+ }
617
+ }));
618
+ };
619
+ function Zr(t) {
620
+ var e = this.getPointee(t);
621
+ if (!e)
622
+ return this.destructor(t), null;
623
+ var r = qr(this.registeredClass, e);
624
+ if (r !== void 0) {
625
+ if (r.$$.count.value === 0)
626
+ return r.$$.ptr = e, r.$$.smartPtr = t, r.clone();
627
+ var n = r.clone();
628
+ return this.destructor(t), n;
629
+ }
630
+ function a() {
631
+ return this.isSmartPointer ? Et(this.registeredClass.instancePrototype, {
632
+ ptrType: this.pointeeType,
633
+ ptr: e,
634
+ smartPtrType: this,
635
+ smartPtr: t
636
+ }) : Et(this.registeredClass.instancePrototype, {
637
+ ptrType: this,
638
+ ptr: t
639
+ });
640
+ }
641
+ var o = this.registeredClass.getActualType(e), u = ge[o];
642
+ if (!u)
643
+ return a.call(this);
644
+ var s;
645
+ this.isConst ? s = u.constPointerType : s = u.pointerType;
646
+ var l = me(e, this.registeredClass, s.registeredClass);
647
+ return l === null ? a.call(this) : this.isSmartPointer ? Et(s.registeredClass.instancePrototype, {
648
+ ptrType: s,
649
+ ptr: l,
650
+ smartPtrType: this,
651
+ smartPtr: t
652
+ }) : Et(s.registeredClass.instancePrototype, {
653
+ ptrType: s,
654
+ ptr: l
655
+ });
656
+ }
657
+ var ft = (t) => typeof FinalizationRegistry > "u" ? (ft = (e) => e, t) : (Gt = new FinalizationRegistry((e) => {
658
+ ve(e.$$);
659
+ }), ft = (e) => {
660
+ var r = e.$$, n = !!r.smartPtr;
661
+ if (n) {
662
+ var a = {
663
+ $$: r
664
+ };
665
+ Gt.register(e, a, e);
666
+ }
667
+ return e;
668
+ }, ye = (e) => Gt.unregister(e), ft(t)), Yr = () => {
669
+ Object.assign(Ot.prototype, {
670
+ isAliasOf(t) {
671
+ if (!(this instanceof Ot) || !(t instanceof Ot))
672
+ return !1;
673
+ var e = this.$$.ptrType.registeredClass, r = this.$$.ptr;
674
+ t.$$ = t.$$;
675
+ for (var n = t.$$.ptrType.registeredClass, a = t.$$.ptr; e.baseClass; )
676
+ r = e.upcast(r), e = e.baseClass;
677
+ for (; n.baseClass; )
678
+ a = n.upcast(a), n = n.baseClass;
679
+ return e === n && r === a;
680
+ },
681
+ clone() {
682
+ if (this.$$.ptr || zt(this), this.$$.preservePointerOnDelete)
683
+ return this.$$.count.value += 1, this;
684
+ var t = ft(Object.create(Object.getPrototypeOf(this), {
685
+ $$: {
686
+ value: Nr(this.$$)
687
+ }
688
+ }));
689
+ return t.$$.count.value += 1, t.$$.deleteScheduled = !1, t;
690
+ },
691
+ delete() {
692
+ this.$$.ptr || zt(this), this.$$.deleteScheduled && !this.$$.preservePointerOnDelete && b("Object already scheduled for deletion"), ye(this), ve(this.$$), this.$$.preservePointerOnDelete || (this.$$.smartPtr = void 0, this.$$.ptr = void 0);
693
+ },
694
+ isDeleted() {
695
+ return !this.$$.ptr;
696
+ },
697
+ deleteLater() {
698
+ return this.$$.ptr || zt(this), this.$$.deleteScheduled && !this.$$.preservePointerOnDelete && b("Object already scheduled for deletion"), this.$$.deleteScheduled = !0, this;
699
+ }
700
+ });
701
+ };
702
+ function Ot() {
703
+ }
704
+ var At = (t, e) => Object.defineProperty(e, "name", {
705
+ value: t
706
+ }), we = (t, e, r) => {
707
+ if (t[e].overloadTable === void 0) {
708
+ var n = t[e];
709
+ t[e] = function() {
710
+ for (var a = arguments.length, o = new Array(a), u = 0; u < a; u++)
711
+ o[u] = arguments[u];
712
+ return t[e].overloadTable.hasOwnProperty(o.length) || b(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${t[e].overloadTable})!`), t[e].overloadTable[o.length].apply(this, o);
713
+ }, t[e].overloadTable = [], t[e].overloadTable[n.argCount] = n;
714
+ }
715
+ }, $e = (t, e, r) => {
716
+ c.hasOwnProperty(t) ? ((r === void 0 || c[t].overloadTable !== void 0 && c[t].overloadTable[r] !== void 0) && b(`Cannot register public name '${t}' twice`), we(c, t, t), c[t].overloadTable.hasOwnProperty(r) && b(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`), c[t].overloadTable[r] = e) : (c[t] = e, c[t].argCount = r);
717
+ }, Qr = 48, Jr = 57, Kr = (t) => {
718
+ t = t.replace(/[^a-zA-Z0-9_]/g, "$");
719
+ var e = t.charCodeAt(0);
720
+ return e >= Qr && e <= Jr ? `_${t}` : t;
721
+ };
722
+ function tn(t, e, r, n, a, o, u, s) {
723
+ this.name = t, this.constructor = e, this.instancePrototype = r, this.rawDestructor = n, this.baseClass = a, this.getActualType = o, this.upcast = u, this.downcast = s, this.pureVirtualFunctions = [];
724
+ }
725
+ var Xt = (t, e, r) => {
726
+ for (; e !== r; )
727
+ e.upcast || b(`Expected null or instance of ${r.name}, got an instance of ${e.name}`), t = e.upcast(t), e = e.baseClass;
728
+ return t;
729
+ };
730
+ function en(t, e) {
731
+ if (e === null)
732
+ return this.isReference && b(`null is not a valid ${this.name}`), 0;
733
+ e.$$ || b(`Cannot pass "${Jt(e)}" as a ${this.name}`), e.$$.ptr || b(`Cannot pass deleted object as a pointer of type ${this.name}`);
734
+ var r = e.$$.ptrType.registeredClass, n = Xt(e.$$.ptr, r, this.registeredClass);
735
+ return n;
736
+ }
737
+ function rn(t, e) {
738
+ var r;
739
+ if (e === null)
740
+ return this.isReference && b(`null is not a valid ${this.name}`), this.isSmartPointer ? (r = this.rawConstructor(), t !== null && t.push(this.rawDestructor, r), r) : 0;
741
+ (!e || !e.$$) && b(`Cannot pass "${Jt(e)}" as a ${this.name}`), e.$$.ptr || b(`Cannot pass deleted object as a pointer of type ${this.name}`), !this.isConst && e.$$.ptrType.isConst && b(`Cannot convert argument of type ${e.$$.smartPtrType ? e.$$.smartPtrType.name : e.$$.ptrType.name} to parameter type ${this.name}`);
742
+ var n = e.$$.ptrType.registeredClass;
743
+ if (r = Xt(e.$$.ptr, n, this.registeredClass), this.isSmartPointer)
744
+ switch (e.$$.smartPtr === void 0 && b("Passing raw pointer to smart pointer is illegal"), this.sharingPolicy) {
745
+ case 0:
746
+ e.$$.smartPtrType === this ? r = e.$$.smartPtr : b(`Cannot convert argument of type ${e.$$.smartPtrType ? e.$$.smartPtrType.name : e.$$.ptrType.name} to parameter type ${this.name}`);
747
+ break;
748
+ case 1:
749
+ r = e.$$.smartPtr;
750
+ break;
751
+ case 2:
752
+ if (e.$$.smartPtrType === this)
753
+ r = e.$$.smartPtr;
754
+ else {
755
+ var a = e.clone();
756
+ r = this.rawShare(r, G.toHandle(() => a.delete())), t !== null && t.push(this.rawDestructor, r);
757
+ }
758
+ break;
759
+ default:
760
+ b("Unsupporting sharing policy");
761
+ }
762
+ return r;
763
+ }
764
+ function nn(t, e) {
765
+ if (e === null)
766
+ return this.isReference && b(`null is not a valid ${this.name}`), 0;
767
+ e.$$ || b(`Cannot pass "${Jt(e)}" as a ${this.name}`), e.$$.ptr || b(`Cannot pass deleted object as a pointer of type ${this.name}`), e.$$.ptrType.isConst && b(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);
768
+ var r = e.$$.ptrType.registeredClass, n = Xt(e.$$.ptr, r, this.registeredClass);
769
+ return n;
770
+ }
771
+ var an = () => {
772
+ Object.assign(St.prototype, {
773
+ getPointee(t) {
774
+ return this.rawGetPointee && (t = this.rawGetPointee(t)), t;
775
+ },
776
+ destructor(t) {
777
+ var e;
778
+ (e = this.rawDestructor) === null || e === void 0 || e.call(this, t);
779
+ },
780
+ argPackAdvance: N,
781
+ readValueFromPointer: lt,
782
+ fromWireType: Zr
783
+ });
784
+ };
785
+ function St(t, e, r, n, a, o, u, s, l, d, h) {
786
+ this.name = t, this.registeredClass = e, this.isReference = r, this.isConst = n, this.isSmartPointer = a, this.pointeeType = o, this.sharingPolicy = u, this.rawGetPointee = s, this.rawConstructor = l, this.rawShare = d, this.rawDestructor = h, !a && e.baseClass === void 0 ? n ? (this.toWireType = en, this.destructorFunction = null) : (this.toWireType = nn, this.destructorFunction = null) : this.toWireType = rn;
787
+ }
788
+ var be = (t, e, r) => {
789
+ c.hasOwnProperty(t) || _t("Replacing nonexistent public symbol"), c[t].overloadTable !== void 0 && r !== void 0 ? c[t].overloadTable[r] = e : (c[t] = e, c[t].argCount = r);
790
+ }, on = (t, e, r) => {
791
+ t = t.replace(/p/g, "i");
792
+ var n = c["dynCall_" + t];
793
+ return n(e, ...r);
794
+ }, xt = [], Ce, w = (t) => {
795
+ var e = xt[t];
796
+ return e || (t >= xt.length && (xt.length = t + 1), xt[t] = e = Ce.get(t)), e;
797
+ }, sn = function(t, e) {
798
+ let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
799
+ if (t.includes("j"))
800
+ return on(t, e, r);
801
+ var n = w(e)(...r);
802
+ return n;
803
+ }, un = (t, e) => function() {
804
+ for (var r = arguments.length, n = new Array(r), a = 0; a < r; a++)
805
+ n[a] = arguments[a];
806
+ return sn(t, e, n);
807
+ }, U = (t, e) => {
808
+ t = F(t);
809
+ function r() {
810
+ return t.includes("j") ? un(t, e) : w(e);
811
+ }
812
+ var n = r();
813
+ return typeof n != "function" && b(`unknown function pointer with signature ${t}: ${e}`), n;
814
+ }, cn = (t, e) => {
815
+ var r = At(e, function(n) {
816
+ this.name = e, this.message = n;
817
+ var a = new Error(n).stack;
818
+ a !== void 0 && (this.stack = this.toString() + `
819
+ ` + a.replace(/^Error(:[^\n]*)?\n/, ""));
820
+ });
821
+ return r.prototype = Object.create(t.prototype), r.prototype.constructor = r, r.prototype.toString = function() {
822
+ return this.message === void 0 ? this.name : `${this.name}: ${this.message}`;
823
+ }, r;
824
+ }, Te, Pe = (t) => {
825
+ var e = Ie(t), r = F(e);
826
+ return X(e), r;
827
+ }, Dt = (t, e) => {
828
+ var r = [], n = {};
829
+ function a(o) {
830
+ if (!n[o] && !Q[o]) {
831
+ if (Pt[o]) {
832
+ Pt[o].forEach(a);
833
+ return;
834
+ }
835
+ r.push(o), n[o] = !0;
836
+ }
837
+ }
838
+ throw e.forEach(a), new Te(`${t}: ` + r.map(Pe).join([", "]));
839
+ }, ln = (t, e, r, n, a, o, u, s, l, d, h, y, $) => {
840
+ h = F(h), o = U(a, o), s && (s = U(u, s)), d && (d = U(l, d)), $ = U(y, $);
841
+ var C = Kr(h);
842
+ $e(C, function() {
843
+ Dt(`Cannot construct ${h} due to unbound types`, [n]);
844
+ }), J([t, e, r], n ? [n] : [], (_) => {
845
+ _ = _[0];
846
+ var I, S;
847
+ n ? (I = _.registeredClass, S = I.instancePrototype) : S = Ot.prototype;
848
+ var x = At(h, function() {
849
+ if (Object.getPrototypeOf(this) !== K)
850
+ throw new at("Use 'new' to construct " + h);
851
+ if (j.constructor_body === void 0)
852
+ throw new at(h + " has no accessible constructor");
853
+ for (var ze = arguments.length, Ft = new Array(ze), jt = 0; jt < ze; jt++)
854
+ Ft[jt] = arguments[jt];
855
+ var Ge = j.constructor_body[Ft.length];
856
+ if (Ge === void 0)
857
+ throw new at(`Tried to invoke ctor of ${h} with invalid number of parameters (${Ft.length}) - expected (${Object.keys(j.constructor_body).toString()}) parameters instead!`);
858
+ return Ge.apply(this, Ft);
859
+ }), K = Object.create(S, {
860
+ constructor: {
861
+ value: x
862
+ }
863
+ });
864
+ x.prototype = K;
865
+ var j = new tn(h, x, K, $, I, o, s, d);
866
+ if (j.baseClass) {
867
+ var q, Mt;
868
+ (Mt = (q = j.baseClass).__derivedClasses) !== null && Mt !== void 0 || (q.__derivedClasses = []), j.baseClass.__derivedClasses.push(j);
869
+ }
870
+ var qa = new St(h, j, !0, !1, !1), Ve = new St(h + "*", j, !1, !1, !1), Ne = new St(h + " const*", j, !1, !0, !1);
871
+ return ge[t] = {
872
+ pointerType: Ve,
873
+ constPointerType: Ne
874
+ }, be(C, x), [qa, Ve, Ne];
875
+ });
876
+ }, qt = (t, e) => {
877
+ for (var r = [], n = 0; n < t; n++)
878
+ r.push(P[e + n * 4 >> 2]);
879
+ return r;
880
+ };
881
+ function fn(t) {
882
+ for (var e = 1; e < t.length; ++e)
883
+ if (t[e] !== null && t[e].destructorFunction === void 0)
884
+ return !0;
885
+ return !1;
886
+ }
887
+ function Zt(t, e, r, n, a, o) {
888
+ var u = e.length;
889
+ u < 2 && b("argTypes array size mismatch! Must at least get return value and 'this' types!");
890
+ var s = e[1] !== null && r !== null, l = fn(e), d = e[0].name !== "void", h = u - 2, y = new Array(h), $ = [], C = [], _ = function() {
891
+ C.length = 0;
892
+ var I;
893
+ $.length = s ? 2 : 1, $[0] = a, s && (I = e[1].toWireType(C, this), $[1] = I);
894
+ for (var S = 0; S < h; ++S)
895
+ y[S] = e[S + 2].toWireType(C, S < 0 || arguments.length <= S ? void 0 : arguments[S]), $.push(y[S]);
896
+ var x = n(...$);
897
+ function K(j) {
898
+ if (l)
899
+ Nt(C);
900
+ else
901
+ for (var q = s ? 1 : 2; q < e.length; q++) {
902
+ var Mt = q === 1 ? I : y[q - 2];
903
+ e[q].destructorFunction !== null && e[q].destructorFunction(Mt);
904
+ }
905
+ if (d)
906
+ return e[0].fromWireType(j);
907
+ }
908
+ return K(x);
909
+ };
910
+ return At(t, _);
911
+ }
912
+ var dn = (t, e, r, n, a, o) => {
913
+ var u = qt(e, r);
914
+ a = U(n, a), J([], [t], (s) => {
915
+ s = s[0];
916
+ var l = `constructor ${s.name}`;
917
+ if (s.registeredClass.constructor_body === void 0 && (s.registeredClass.constructor_body = []), s.registeredClass.constructor_body[e - 1] !== void 0)
918
+ throw new at(`Cannot register multiple constructors with identical number of parameters (${e - 1}) for class '${s.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
919
+ return s.registeredClass.constructor_body[e - 1] = () => {
920
+ Dt(`Cannot construct ${s.name} due to unbound types`, u);
921
+ }, J([], u, (d) => (d.splice(1, 0, null), s.registeredClass.constructor_body[e - 1] = Zt(l, d, null, a, o), [])), [];
922
+ });
923
+ }, _e = (t) => {
924
+ t = t.trim();
925
+ const e = t.indexOf("(");
926
+ return e !== -1 ? t.substr(0, e) : t;
927
+ }, hn = (t, e, r, n, a, o, u, s, l, d) => {
928
+ var h = qt(r, n);
929
+ e = F(e), e = _e(e), o = U(a, o), J([], [t], (y) => {
930
+ y = y[0];
931
+ var $ = `${y.name}.${e}`;
932
+ e.startsWith("@@") && (e = Symbol[e.substring(2)]), s && y.registeredClass.pureVirtualFunctions.push(e);
933
+ function C() {
934
+ Dt(`Cannot call ${$} due to unbound types`, h);
935
+ }
936
+ var _ = y.registeredClass.instancePrototype, I = _[e];
937
+ return I === void 0 || I.overloadTable === void 0 && I.className !== y.name && I.argCount === r - 2 ? (C.argCount = r - 2, C.className = y.name, _[e] = C) : (we(_, e, $), _[e].overloadTable[r - 2] = C), J([], h, (S) => {
938
+ var x = Zt($, S, y, o, u);
939
+ return _[e].overloadTable === void 0 ? (x.argCount = r - 2, _[e] = x) : _[e].overloadTable[r - 2] = x, [];
940
+ }), [];
941
+ });
942
+ }, Yt = [], z = [], Qt = (t) => {
943
+ t > 9 && --z[t + 1] === 0 && (z[t] = void 0, Yt.push(t));
944
+ }, pn = () => z.length / 2 - 5 - Yt.length, yn = () => {
945
+ z.push(0, 1, void 0, 1, null, 1, !0, 1, !1, 1), c.count_emval_handles = pn;
946
+ }, G = {
947
+ toValue: (t) => (t || b("Cannot use deleted val. handle = " + t), z[t]),
948
+ toHandle: (t) => {
949
+ switch (t) {
950
+ case void 0:
951
+ return 2;
952
+ case null:
953
+ return 4;
954
+ case !0:
955
+ return 6;
956
+ case !1:
957
+ return 8;
958
+ default: {
959
+ const e = Yt.pop() || z.length;
960
+ return z[e] = t, z[e + 1] = 1, e;
961
+ }
962
+ }
963
+ }
964
+ }, Ee = {
965
+ name: "emscripten::val",
966
+ fromWireType: (t) => {
967
+ var e = G.toValue(t);
968
+ return Qt(t), e;
969
+ },
970
+ toWireType: (t, e) => G.toHandle(e),
971
+ argPackAdvance: N,
972
+ readValueFromPointer: lt,
973
+ destructorFunction: null
974
+ }, vn = (t) => W(t, Ee), Jt = (t) => {
975
+ if (t === null)
976
+ return "null";
977
+ var e = typeof t;
978
+ return e === "object" || e === "array" || e === "function" ? t.toString() : "" + t;
979
+ }, mn = (t, e) => {
980
+ switch (e) {
981
+ case 4:
982
+ return function(r) {
983
+ return this.fromWireType(oe[r >> 2]);
984
+ };
985
+ case 8:
986
+ return function(r) {
987
+ return this.fromWireType(se[r >> 3]);
988
+ };
989
+ default:
990
+ throw new TypeError(`invalid float width (${e}): ${t}`);
991
+ }
992
+ }, gn = (t, e, r) => {
993
+ e = F(e), W(t, {
994
+ name: e,
995
+ fromWireType: (n) => n,
996
+ toWireType: (n, a) => a,
997
+ argPackAdvance: N,
998
+ readValueFromPointer: mn(e, r),
999
+ destructorFunction: null
1000
+ });
1001
+ }, wn = (t, e, r, n, a, o, u, s) => {
1002
+ var l = qt(e, r);
1003
+ t = F(t), t = _e(t), a = U(n, a), $e(t, function() {
1004
+ Dt(`Cannot call ${t} due to unbound types`, l);
1005
+ }, e - 1), J([], l, (d) => {
1006
+ var h = [d[0], null].concat(d.slice(1));
1007
+ return be(t, Zt(t, h, null, a, o), e - 1), [];
1008
+ });
1009
+ }, $n = (t, e, r) => {
1010
+ switch (e) {
1011
+ case 1:
1012
+ return r ? (n) => H[n] : (n) => B[n];
1013
+ case 2:
1014
+ return r ? (n) => ut[n >> 1] : (n) => gt[n >> 1];
1015
+ case 4:
1016
+ return r ? (n) => rt[n >> 2] : (n) => P[n >> 2];
1017
+ default:
1018
+ throw new TypeError(`invalid integer width (${e}): ${t}`);
1019
+ }
1020
+ }, bn = (t, e, r, n, a) => {
1021
+ e = F(e);
1022
+ var o = (h) => h;
1023
+ if (n === 0) {
1024
+ var u = 32 - 8 * r;
1025
+ o = (h) => h << u >>> u;
1026
+ }
1027
+ var s = e.includes("unsigned"), l = (h, y) => {
1028
+ }, d;
1029
+ s ? d = function(h, y) {
1030
+ return l(y, this.name), y >>> 0;
1031
+ } : d = function(h, y) {
1032
+ return l(y, this.name), y;
1033
+ }, W(t, {
1034
+ name: e,
1035
+ fromWireType: o,
1036
+ toWireType: d,
1037
+ argPackAdvance: N,
1038
+ readValueFromPointer: $n(e, r, n !== 0),
1039
+ destructorFunction: null
1040
+ });
1041
+ }, Cn = (t, e, r) => {
1042
+ var n = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array], a = n[e];
1043
+ function o(u) {
1044
+ var s = P[u >> 2], l = P[u + 4 >> 2];
1045
+ return new a(H.buffer, l, s);
1046
+ }
1047
+ r = F(r), W(t, {
1048
+ name: r,
1049
+ fromWireType: o,
1050
+ argPackAdvance: N,
1051
+ readValueFromPointer: o
1052
+ }, {
1053
+ ignoreDuplicateRegistrations: !0
1054
+ });
1055
+ }, Tn = Object.assign({
1056
+ optional: !0
1057
+ }, Ee), Pn = (t, e) => {
1058
+ W(t, Tn);
1059
+ }, _n = (t, e, r, n) => {
1060
+ if (!(n > 0)) return 0;
1061
+ for (var a = r, o = r + n - 1, u = 0; u < t.length; ++u) {
1062
+ var s = t.charCodeAt(u);
1063
+ if (s >= 55296 && s <= 57343) {
1064
+ var l = t.charCodeAt(++u);
1065
+ s = 65536 + ((s & 1023) << 10) | l & 1023;
1066
+ }
1067
+ if (s <= 127) {
1068
+ if (r >= o) break;
1069
+ e[r++] = s;
1070
+ } else if (s <= 2047) {
1071
+ if (r + 1 >= o) break;
1072
+ e[r++] = 192 | s >> 6, e[r++] = 128 | s & 63;
1073
+ } else if (s <= 65535) {
1074
+ if (r + 2 >= o) break;
1075
+ e[r++] = 224 | s >> 12, e[r++] = 128 | s >> 6 & 63, e[r++] = 128 | s & 63;
1076
+ } else {
1077
+ if (r + 3 >= o) break;
1078
+ e[r++] = 240 | s >> 18, e[r++] = 128 | s >> 12 & 63, e[r++] = 128 | s >> 6 & 63, e[r++] = 128 | s & 63;
1079
+ }
1080
+ }
1081
+ return e[r] = 0, r - a;
1082
+ }, dt = (t, e, r) => _n(t, B, e, r), En = (t) => {
1083
+ for (var e = 0, r = 0; r < t.length; ++r) {
1084
+ var n = t.charCodeAt(r);
1085
+ n <= 127 ? e++ : n <= 2047 ? e += 2 : n >= 55296 && n <= 57343 ? (e += 4, ++r) : e += 3;
1086
+ }
1087
+ return e;
1088
+ }, Oe = typeof TextDecoder < "u" ? new TextDecoder() : void 0, Ae = function(t) {
1089
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : NaN;
1090
+ for (var n = e + r, a = e; t[a] && !(a >= n); ) ++a;
1091
+ if (a - e > 16 && t.buffer && Oe)
1092
+ return Oe.decode(t.subarray(e, a));
1093
+ for (var o = ""; e < a; ) {
1094
+ var u = t[e++];
1095
+ if (!(u & 128)) {
1096
+ o += String.fromCharCode(u);
1097
+ continue;
1098
+ }
1099
+ var s = t[e++] & 63;
1100
+ if ((u & 224) == 192) {
1101
+ o += String.fromCharCode((u & 31) << 6 | s);
1102
+ continue;
1103
+ }
1104
+ var l = t[e++] & 63;
1105
+ if ((u & 240) == 224 ? u = (u & 15) << 12 | s << 6 | l : u = (u & 7) << 18 | s << 12 | l << 6 | t[e++] & 63, u < 65536)
1106
+ o += String.fromCharCode(u);
1107
+ else {
1108
+ var d = u - 65536;
1109
+ o += String.fromCharCode(55296 | d >> 10, 56320 | d & 1023);
1110
+ }
1111
+ }
1112
+ return o;
1113
+ }, On = (t, e) => t ? Ae(B, t, e) : "", An = (t, e) => {
1114
+ e = F(e), W(t, {
1115
+ name: e,
1116
+ fromWireType(r) {
1117
+ for (var n = P[r >> 2], a = r + 4, o, s, u = a, s = 0; s <= n; ++s) {
1118
+ var l = a + s;
1119
+ if (s == n || B[l] == 0) {
1120
+ var d = l - u, h = On(u, d);
1121
+ o === void 0 ? o = h : (o += "\0", o += h), u = l + 1;
1122
+ }
1123
+ }
1124
+ return X(r), o;
1125
+ },
1126
+ toWireType(r, n) {
1127
+ n instanceof ArrayBuffer && (n = new Uint8Array(n));
1128
+ var a, o = typeof n == "string";
1129
+ o || n instanceof Uint8Array || n instanceof Uint8ClampedArray || n instanceof Int8Array || b("Cannot pass non-string to std::string"), o ? a = En(n) : a = n.length;
1130
+ var u = ee(4 + a + 1), s = u + 4;
1131
+ if (P[u >> 2] = a, o)
1132
+ dt(n, s, a + 1);
1133
+ else if (o)
1134
+ for (var l = 0; l < a; ++l) {
1135
+ var d = n.charCodeAt(l);
1136
+ d > 255 && (X(s), b("String has UTF-16 code units that do not fit in 8 bits")), B[s + l] = d;
1137
+ }
1138
+ else
1139
+ for (var l = 0; l < a; ++l)
1140
+ B[s + l] = n[l];
1141
+ return r !== null && r.push(X, u), u;
1142
+ },
1143
+ argPackAdvance: N,
1144
+ readValueFromPointer: lt,
1145
+ destructorFunction(r) {
1146
+ X(r);
1147
+ }
1148
+ });
1149
+ }, Se = typeof TextDecoder < "u" ? new TextDecoder("utf-16le") : void 0, Sn = (t, e) => {
1150
+ for (var r = t, n = r >> 1, a = n + e / 2; !(n >= a) && gt[n]; ) ++n;
1151
+ if (r = n << 1, r - t > 32 && Se) return Se.decode(B.subarray(t, r));
1152
+ for (var o = "", u = 0; !(u >= e / 2); ++u) {
1153
+ var s = ut[t + u * 2 >> 1];
1154
+ if (s == 0) break;
1155
+ o += String.fromCharCode(s);
1156
+ }
1157
+ return o;
1158
+ }, xn = (t, e, r) => {
1159
+ var n;
1160
+ if ((n = r) !== null && n !== void 0 || (r = 2147483647), r < 2) return 0;
1161
+ r -= 2;
1162
+ for (var a = e, o = r < t.length * 2 ? r / 2 : t.length, u = 0; u < o; ++u) {
1163
+ var s = t.charCodeAt(u);
1164
+ ut[e >> 1] = s, e += 2;
1165
+ }
1166
+ return ut[e >> 1] = 0, e - a;
1167
+ }, Dn = (t) => t.length * 2, In = (t, e) => {
1168
+ for (var r = 0, n = ""; !(r >= e / 4); ) {
1169
+ var a = rt[t + r * 4 >> 2];
1170
+ if (a == 0) break;
1171
+ if (++r, a >= 65536) {
1172
+ var o = a - 65536;
1173
+ n += String.fromCharCode(55296 | o >> 10, 56320 | o & 1023);
1174
+ } else
1175
+ n += String.fromCharCode(a);
1176
+ }
1177
+ return n;
1178
+ }, Mn = (t, e, r) => {
1179
+ var n;
1180
+ if ((n = r) !== null && n !== void 0 || (r = 2147483647), r < 4) return 0;
1181
+ for (var a = e, o = a + r - 4, u = 0; u < t.length; ++u) {
1182
+ var s = t.charCodeAt(u);
1183
+ if (s >= 55296 && s <= 57343) {
1184
+ var l = t.charCodeAt(++u);
1185
+ s = 65536 + ((s & 1023) << 10) | l & 1023;
1186
+ }
1187
+ if (rt[e >> 2] = s, e += 4, e + 4 > o) break;
1188
+ }
1189
+ return rt[e >> 2] = 0, e - a;
1190
+ }, Fn = (t) => {
1191
+ for (var e = 0, r = 0; r < t.length; ++r) {
1192
+ var n = t.charCodeAt(r);
1193
+ n >= 55296 && n <= 57343 && ++r, e += 4;
1194
+ }
1195
+ return e;
1196
+ }, jn = (t, e, r) => {
1197
+ r = F(r);
1198
+ var n, a, o, u;
1199
+ e === 2 ? (n = Sn, a = xn, u = Dn, o = (s) => gt[s >> 1]) : e === 4 && (n = In, a = Mn, u = Fn, o = (s) => P[s >> 2]), W(t, {
1200
+ name: r,
1201
+ fromWireType: (s) => {
1202
+ for (var l = P[s >> 2], d, h = s + 4, y = 0; y <= l; ++y) {
1203
+ var $ = s + 4 + y * e;
1204
+ if (y == l || o($) == 0) {
1205
+ var C = $ - h, _ = n(h, C);
1206
+ d === void 0 ? d = _ : (d += "\0", d += _), h = $ + e;
1207
+ }
1208
+ }
1209
+ return X(s), d;
1210
+ },
1211
+ toWireType: (s, l) => {
1212
+ typeof l != "string" && b(`Cannot pass non-string to C++ string type ${r}`);
1213
+ var d = u(l), h = ee(4 + d + e);
1214
+ return P[h >> 2] = d / e, a(l, h + 4, d + e), s !== null && s.push(X, h), h;
1215
+ },
1216
+ argPackAdvance: N,
1217
+ readValueFromPointer: lt,
1218
+ destructorFunction(s) {
1219
+ X(s);
1220
+ }
1221
+ });
1222
+ }, Rn = (t, e, r, n, a, o) => {
1223
+ Tt[t] = {
1224
+ name: F(e),
1225
+ rawConstructor: U(r, n),
1226
+ rawDestructor: U(a, o),
1227
+ fields: []
1228
+ };
1229
+ }, Ln = (t, e, r, n, a, o, u, s, l, d) => {
1230
+ Tt[t].fields.push({
1231
+ fieldName: F(e),
1232
+ getterReturnType: r,
1233
+ getter: U(n, a),
1234
+ getterContext: o,
1235
+ setterArgumentType: u,
1236
+ setter: U(s, l),
1237
+ setterContext: d
1238
+ });
1239
+ }, Bn = (t, e) => {
1240
+ e = F(e), W(t, {
1241
+ isVoid: !0,
1242
+ name: e,
1243
+ argPackAdvance: 0,
1244
+ fromWireType: () => {
1245
+ },
1246
+ toWireType: (r, n) => {
1247
+ }
1248
+ });
1249
+ }, Un = (t, e, r) => B.copyWithin(t, e, e + r), Kt = [], Wn = (t, e, r, n) => (t = Kt[t], e = G.toValue(e), t(null, e, r, n)), kn = {}, Hn = (t) => {
1250
+ var e = kn[t];
1251
+ return e === void 0 ? F(t) : e;
1252
+ }, xe = () => {
1253
+ if (typeof globalThis == "object")
1254
+ return globalThis;
1255
+ function t(e) {
1256
+ e.$$$embind_global$$$ = e;
1257
+ var r = typeof $$$embind_global$$$ == "object" && e.$$$embind_global$$$ == e;
1258
+ return r || delete e.$$$embind_global$$$, r;
1259
+ }
1260
+ if (typeof $$$embind_global$$$ == "object" || (typeof global == "object" && t(global) ? $$$embind_global$$$ = global : typeof self == "object" && t(self) && ($$$embind_global$$$ = self), typeof $$$embind_global$$$ == "object"))
1261
+ return $$$embind_global$$$;
1262
+ throw Error("unable to get global object.");
1263
+ }, Vn = (t) => t === 0 ? G.toHandle(xe()) : (t = Hn(t), G.toHandle(xe()[t])), Nn = (t) => {
1264
+ var e = Kt.length;
1265
+ return Kt.push(t), e;
1266
+ }, De = (t, e) => {
1267
+ var r = Q[t];
1268
+ return r === void 0 && b(`${e} has unknown type ${Pe(t)}`), r;
1269
+ }, zn = (t, e) => {
1270
+ for (var r = new Array(t), n = 0; n < t; ++n)
1271
+ r[n] = De(P[e + n * 4 >> 2], "parameter " + n);
1272
+ return r;
1273
+ }, Gn = Reflect.construct, Xn = (t, e, r) => {
1274
+ var n = [], a = t.toWireType(n, r);
1275
+ return n.length && (P[e >> 2] = G.toHandle(n)), a;
1276
+ }, qn = (t, e, r) => {
1277
+ var n = zn(t, e), a = n.shift();
1278
+ t--;
1279
+ var o = new Array(t), u = (l, d, h, y) => {
1280
+ for (var $ = 0, C = 0; C < t; ++C)
1281
+ o[C] = n[C].readValueFromPointer(y + $), $ += n[C].argPackAdvance;
1282
+ var _ = r === 1 ? Gn(d, o) : d.apply(l, o);
1283
+ return Xn(a, h, _);
1284
+ }, s = `methodCaller<(${n.map((l) => l.name).join(", ")}) => ${a.name}>`;
1285
+ return Nn(At(s, u));
1286
+ }, Zn = (t) => {
1287
+ t > 9 && (z[t + 1] += 1);
1288
+ }, Yn = (t) => {
1289
+ var e = G.toValue(t);
1290
+ Nt(e), Qt(t);
1291
+ }, Qn = (t, e) => {
1292
+ t = De(t, "_emval_take_value");
1293
+ var r = t.readValueFromPointer(e);
1294
+ return G.toHandle(r);
1295
+ }, Jn = (t, e, r, n) => {
1296
+ var a = (/* @__PURE__ */ new Date()).getFullYear(), o = new Date(a, 0, 1), u = new Date(a, 6, 1), s = o.getTimezoneOffset(), l = u.getTimezoneOffset(), d = Math.max(s, l);
1297
+ P[t >> 2] = d * 60, rt[e >> 2] = +(s != l);
1298
+ var h = (C) => {
1299
+ var _ = C >= 0 ? "-" : "+", I = Math.abs(C), S = String(Math.floor(I / 60)).padStart(2, "0"), x = String(I % 60).padStart(2, "0");
1300
+ return `UTC${_}${S}${x}`;
1301
+ }, y = h(s), $ = h(l);
1302
+ l < s ? (dt(y, r, 17), dt($, n, 17)) : (dt(y, n, 17), dt($, r, 17));
1303
+ }, Kn = () => 2147483648, ta = (t, e) => Math.ceil(t / e) * e, ea = (t) => {
1304
+ var e = mt.buffer, r = (t - e.byteLength + 65535) / 65536 | 0;
1305
+ try {
1306
+ return mt.grow(r), ue(), 1;
1307
+ } catch {
1308
+ }
1309
+ }, ra = (t) => {
1310
+ var e = B.length;
1311
+ t >>>= 0;
1312
+ var r = Kn();
1313
+ if (t > r)
1314
+ return !1;
1315
+ for (var n = 1; n <= 4; n *= 2) {
1316
+ var a = e * (1 + 0.2 / n);
1317
+ a = Math.min(a, t + 100663296);
1318
+ var o = Math.min(r, ta(Math.max(t, a), 65536)), u = ea(o);
1319
+ if (u)
1320
+ return !0;
1321
+ }
1322
+ return !1;
1323
+ }, te = {}, na = () => tt || "./this.program", ht = () => {
1324
+ if (!ht.strings) {
1325
+ var t = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", e = {
1326
+ USER: "web_user",
1327
+ LOGNAME: "web_user",
1328
+ PATH: "/",
1329
+ PWD: "/",
1330
+ HOME: "/home/web_user",
1331
+ LANG: t,
1332
+ _: na()
1333
+ };
1334
+ for (var r in te)
1335
+ te[r] === void 0 ? delete e[r] : e[r] = te[r];
1336
+ var n = [];
1337
+ for (var r in e)
1338
+ n.push(`${r}=${e[r]}`);
1339
+ ht.strings = n;
1340
+ }
1341
+ return ht.strings;
1342
+ }, aa = (t, e) => {
1343
+ for (var r = 0; r < t.length; ++r)
1344
+ H[e++] = t.charCodeAt(r);
1345
+ H[e] = 0;
1346
+ }, ia = (t, e) => {
1347
+ var r = 0;
1348
+ return ht().forEach((n, a) => {
1349
+ var o = e + r;
1350
+ P[t + a * 4 >> 2] = o, aa(n, o), r += n.length + 1;
1351
+ }), 0;
1352
+ }, oa = (t, e) => {
1353
+ var r = ht();
1354
+ P[t >> 2] = r.length;
1355
+ var n = 0;
1356
+ return r.forEach((a) => n += a.length + 1), P[e >> 2] = n, 0;
1357
+ }, sa = (t) => 52;
1358
+ function ua(t, e, r, n, a) {
1359
+ return 70;
1360
+ }
1361
+ var ca = [null, [], []], la = (t, e) => {
1362
+ var r = ca[t];
1363
+ e === 0 || e === 10 ? ((t === 1 ? dr : et)(Ae(r)), r.length = 0) : r.push(e);
1364
+ }, fa = (t, e, r, n) => {
1365
+ for (var a = 0, o = 0; o < r; o++) {
1366
+ var u = P[e >> 2], s = P[e + 4 >> 2];
1367
+ e += 8;
1368
+ for (var l = 0; l < s; l++)
1369
+ la(t, B[u + l]);
1370
+ a += s;
1371
+ }
1372
+ return P[n >> 2] = a, 0;
1373
+ }, da = (t) => t;
1374
+ he = c.InternalError = class extends Error {
1375
+ constructor(t) {
1376
+ super(t), this.name = "InternalError";
1377
+ }
1378
+ }, kr(), at = c.BindingError = class extends Error {
1379
+ constructor(t) {
1380
+ super(t), this.name = "BindingError";
1381
+ }
1382
+ }, Yr(), an(), Te = c.UnboundTypeError = cn(Error, "UnboundTypeError"), yn();
1383
+ var ha = {
1384
+ s: Sr,
1385
+ w: xr,
1386
+ a: Ir,
1387
+ j: Mr,
1388
+ l: Fr,
1389
+ M: jr,
1390
+ p: Rr,
1391
+ ca: Lr,
1392
+ d: Dr,
1393
+ Z: Br,
1394
+ sa: Ur,
1395
+ Y: Wr,
1396
+ na: Vr,
1397
+ qa: ln,
1398
+ pa: dn,
1399
+ D: hn,
1400
+ la: vn,
1401
+ Q: gn,
1402
+ R: wn,
1403
+ x: bn,
1404
+ t: Cn,
1405
+ ra: Pn,
1406
+ ma: An,
1407
+ N: jn,
1408
+ J: Rn,
1409
+ ta: Ln,
1410
+ oa: Bn,
1411
+ fa: Un,
1412
+ U: Wn,
1413
+ ua: Qt,
1414
+ wa: Vn,
1415
+ _: qn,
1416
+ S: Zn,
1417
+ va: Yn,
1418
+ ka: Qn,
1419
+ $: Jn,
1420
+ da: ra,
1421
+ aa: ia,
1422
+ ba: oa,
1423
+ ea: sa,
1424
+ W: ua,
1425
+ P: fa,
1426
+ H: Fa,
1427
+ B: Ra,
1428
+ T: wa,
1429
+ O: Va,
1430
+ q: xa,
1431
+ b: ya,
1432
+ C: Ma,
1433
+ ha: Ba,
1434
+ c: ma,
1435
+ ga: Ua,
1436
+ h: ga,
1437
+ i: Pa,
1438
+ r: _a,
1439
+ L: Ia,
1440
+ v: Oa,
1441
+ G: ka,
1442
+ I: Da,
1443
+ z: La,
1444
+ F: Na,
1445
+ X: Ga,
1446
+ V: Xa,
1447
+ k: ba,
1448
+ f: $a,
1449
+ e: va,
1450
+ g: pa,
1451
+ K: Ha,
1452
+ m: Ta,
1453
+ ia: ja,
1454
+ o: Ea,
1455
+ u: Aa,
1456
+ ja: Sa,
1457
+ A: Wa,
1458
+ n: Ca,
1459
+ E: za,
1460
+ y: da
1461
+ }, E;
1462
+ Ar();
1463
+ var Ie = (t) => (Ie = E.za)(t), X = c._free = (t) => (X = c._free = E.Aa)(t), ee = c._malloc = (t) => (ee = c._malloc = E.Ca)(t), Me = (t) => (Me = E.Da)(t), v = (t, e) => (v = E.Ea)(t, e), Fe = (t) => (Fe = E.Fa)(t), je = (t) => (je = E.Ga)(t), Re = () => (Re = E.Ha)(), Le = (t) => (Le = E.Ia)(t), Be = (t) => (Be = E.Ja)(t), Ue = (t, e, r) => (Ue = E.Ka)(t, e, r);
1464
+ c.dynCall_viijii = (t, e, r, n, a, o, u) => (c.dynCall_viijii = E.La)(t, e, r, n, a, o, u);
1465
+ var We = c.dynCall_jiii = (t, e, r, n) => (We = c.dynCall_jiii = E.Ma)(t, e, r, n);
1466
+ c.dynCall_jiji = (t, e, r, n, a) => (c.dynCall_jiji = E.Na)(t, e, r, n, a);
1467
+ var ke = c.dynCall_jiiii = (t, e, r, n, a) => (ke = c.dynCall_jiiii = E.Oa)(t, e, r, n, a);
1468
+ c.dynCall_iiiiij = (t, e, r, n, a, o, u) => (c.dynCall_iiiiij = E.Pa)(t, e, r, n, a, o, u), c.dynCall_iiiiijj = (t, e, r, n, a, o, u, s, l) => (c.dynCall_iiiiijj = E.Qa)(t, e, r, n, a, o, u, s, l), c.dynCall_iiiiiijj = (t, e, r, n, a, o, u, s, l, d) => (c.dynCall_iiiiiijj = E.Ra)(t, e, r, n, a, o, u, s, l, d);
1469
+ function pa(t, e, r, n) {
1470
+ var a = g();
1471
+ try {
1472
+ w(t)(e, r, n);
1473
+ } catch (o) {
1474
+ if (m(a), o !== o + 0) throw o;
1475
+ v(1, 0);
1476
+ }
1477
+ }
1478
+ function ya(t, e) {
1479
+ var r = g();
1480
+ try {
1481
+ return w(t)(e);
1482
+ } catch (n) {
1483
+ if (m(r), n !== n + 0) throw n;
1484
+ v(1, 0);
1485
+ }
1486
+ }
1487
+ function va(t, e, r) {
1488
+ var n = g();
1489
+ try {
1490
+ w(t)(e, r);
1491
+ } catch (a) {
1492
+ if (m(n), a !== a + 0) throw a;
1493
+ v(1, 0);
1494
+ }
1495
+ }
1496
+ function ma(t, e, r) {
1497
+ var n = g();
1498
+ try {
1499
+ return w(t)(e, r);
1500
+ } catch (a) {
1501
+ if (m(n), a !== a + 0) throw a;
1502
+ v(1, 0);
1503
+ }
1504
+ }
1505
+ function ga(t, e, r, n) {
1506
+ var a = g();
1507
+ try {
1508
+ return w(t)(e, r, n);
1509
+ } catch (o) {
1510
+ if (m(a), o !== o + 0) throw o;
1511
+ v(1, 0);
1512
+ }
1513
+ }
1514
+ function wa(t, e, r, n, a) {
1515
+ var o = g();
1516
+ try {
1517
+ return w(t)(e, r, n, a);
1518
+ } catch (u) {
1519
+ if (m(o), u !== u + 0) throw u;
1520
+ v(1, 0);
1521
+ }
1522
+ }
1523
+ function $a(t, e) {
1524
+ var r = g();
1525
+ try {
1526
+ w(t)(e);
1527
+ } catch (n) {
1528
+ if (m(r), n !== n + 0) throw n;
1529
+ v(1, 0);
1530
+ }
1531
+ }
1532
+ function ba(t) {
1533
+ var e = g();
1534
+ try {
1535
+ w(t)();
1536
+ } catch (r) {
1537
+ if (m(e), r !== r + 0) throw r;
1538
+ v(1, 0);
1539
+ }
1540
+ }
1541
+ function Ca(t, e, r, n, a, o, u, s, l, d, h) {
1542
+ var y = g();
1543
+ try {
1544
+ w(t)(e, r, n, a, o, u, s, l, d, h);
1545
+ } catch ($) {
1546
+ if (m(y), $ !== $ + 0) throw $;
1547
+ v(1, 0);
1548
+ }
1549
+ }
1550
+ function Ta(t, e, r, n, a) {
1551
+ var o = g();
1552
+ try {
1553
+ w(t)(e, r, n, a);
1554
+ } catch (u) {
1555
+ if (m(o), u !== u + 0) throw u;
1556
+ v(1, 0);
1557
+ }
1558
+ }
1559
+ function Pa(t, e, r, n, a) {
1560
+ var o = g();
1561
+ try {
1562
+ return w(t)(e, r, n, a);
1563
+ } catch (u) {
1564
+ if (m(o), u !== u + 0) throw u;
1565
+ v(1, 0);
1566
+ }
1567
+ }
1568
+ function _a(t, e, r, n, a, o) {
1569
+ var u = g();
1570
+ try {
1571
+ return w(t)(e, r, n, a, o);
1572
+ } catch (s) {
1573
+ if (m(u), s !== s + 0) throw s;
1574
+ v(1, 0);
1575
+ }
1576
+ }
1577
+ function Ea(t, e, r, n, a, o) {
1578
+ var u = g();
1579
+ try {
1580
+ w(t)(e, r, n, a, o);
1581
+ } catch (s) {
1582
+ if (m(u), s !== s + 0) throw s;
1583
+ v(1, 0);
1584
+ }
1585
+ }
1586
+ function Oa(t, e, r, n, a, o, u) {
1587
+ var s = g();
1588
+ try {
1589
+ return w(t)(e, r, n, a, o, u);
1590
+ } catch (l) {
1591
+ if (m(s), l !== l + 0) throw l;
1592
+ v(1, 0);
1593
+ }
1594
+ }
1595
+ function Aa(t, e, r, n, a, o, u, s) {
1596
+ var l = g();
1597
+ try {
1598
+ w(t)(e, r, n, a, o, u, s);
1599
+ } catch (d) {
1600
+ if (m(l), d !== d + 0) throw d;
1601
+ v(1, 0);
1602
+ }
1603
+ }
1604
+ function Sa(t, e, r, n, a, o, u, s, l) {
1605
+ var d = g();
1606
+ try {
1607
+ w(t)(e, r, n, a, o, u, s, l);
1608
+ } catch (h) {
1609
+ if (m(d), h !== h + 0) throw h;
1610
+ v(1, 0);
1611
+ }
1612
+ }
1613
+ function xa(t) {
1614
+ var e = g();
1615
+ try {
1616
+ return w(t)();
1617
+ } catch (r) {
1618
+ if (m(e), r !== r + 0) throw r;
1619
+ v(1, 0);
1620
+ }
1621
+ }
1622
+ function Da(t, e, r, n, a, o, u, s, l) {
1623
+ var d = g();
1624
+ try {
1625
+ return w(t)(e, r, n, a, o, u, s, l);
1626
+ } catch (h) {
1627
+ if (m(d), h !== h + 0) throw h;
1628
+ v(1, 0);
1629
+ }
1630
+ }
1631
+ function Ia(t, e, r, n, a, o, u) {
1632
+ var s = g();
1633
+ try {
1634
+ return w(t)(e, r, n, a, o, u);
1635
+ } catch (l) {
1636
+ if (m(s), l !== l + 0) throw l;
1637
+ v(1, 0);
1638
+ }
1639
+ }
1640
+ function Ma(t, e, r, n) {
1641
+ var a = g();
1642
+ try {
1643
+ return w(t)(e, r, n);
1644
+ } catch (o) {
1645
+ if (m(a), o !== o + 0) throw o;
1646
+ v(1, 0);
1647
+ }
1648
+ }
1649
+ function Fa(t, e, r, n) {
1650
+ var a = g();
1651
+ try {
1652
+ return w(t)(e, r, n);
1653
+ } catch (o) {
1654
+ if (m(a), o !== o + 0) throw o;
1655
+ v(1, 0);
1656
+ }
1657
+ }
1658
+ function ja(t, e, r, n, a, o, u, s) {
1659
+ var l = g();
1660
+ try {
1661
+ w(t)(e, r, n, a, o, u, s);
1662
+ } catch (d) {
1663
+ if (m(l), d !== d + 0) throw d;
1664
+ v(1, 0);
1665
+ }
1666
+ }
1667
+ function Ra(t, e, r, n, a, o) {
1668
+ var u = g();
1669
+ try {
1670
+ return w(t)(e, r, n, a, o);
1671
+ } catch (s) {
1672
+ if (m(u), s !== s + 0) throw s;
1673
+ v(1, 0);
1674
+ }
1675
+ }
1676
+ function La(t, e, r, n, a, o, u, s, l, d) {
1677
+ var h = g();
1678
+ try {
1679
+ return w(t)(e, r, n, a, o, u, s, l, d);
1680
+ } catch (y) {
1681
+ if (m(h), y !== y + 0) throw y;
1682
+ v(1, 0);
1683
+ }
1684
+ }
1685
+ function Ba(t, e, r) {
1686
+ var n = g();
1687
+ try {
1688
+ return w(t)(e, r);
1689
+ } catch (a) {
1690
+ if (m(n), a !== a + 0) throw a;
1691
+ v(1, 0);
1692
+ }
1693
+ }
1694
+ function Ua(t, e, r, n, a) {
1695
+ var o = g();
1696
+ try {
1697
+ return w(t)(e, r, n, a);
1698
+ } catch (u) {
1699
+ if (m(o), u !== u + 0) throw u;
1700
+ v(1, 0);
1701
+ }
1702
+ }
1703
+ function Wa(t, e, r, n, a, o, u, s, l, d) {
1704
+ var h = g();
1705
+ try {
1706
+ w(t)(e, r, n, a, o, u, s, l, d);
1707
+ } catch (y) {
1708
+ if (m(h), y !== y + 0) throw y;
1709
+ v(1, 0);
1710
+ }
1711
+ }
1712
+ function ka(t, e, r, n, a, o, u, s) {
1713
+ var l = g();
1714
+ try {
1715
+ return w(t)(e, r, n, a, o, u, s);
1716
+ } catch (d) {
1717
+ if (m(l), d !== d + 0) throw d;
1718
+ v(1, 0);
1719
+ }
1720
+ }
1721
+ function Ha(t, e, r, n, a, o, u) {
1722
+ var s = g();
1723
+ try {
1724
+ w(t)(e, r, n, a, o, u);
1725
+ } catch (l) {
1726
+ if (m(s), l !== l + 0) throw l;
1727
+ v(1, 0);
1728
+ }
1729
+ }
1730
+ function Va(t, e, r, n) {
1731
+ var a = g();
1732
+ try {
1733
+ return w(t)(e, r, n);
1734
+ } catch (o) {
1735
+ if (m(a), o !== o + 0) throw o;
1736
+ v(1, 0);
1737
+ }
1738
+ }
1739
+ function Na(t, e, r, n, a, o, u, s, l, d, h, y) {
1740
+ var $ = g();
1741
+ try {
1742
+ return w(t)(e, r, n, a, o, u, s, l, d, h, y);
1743
+ } catch (C) {
1744
+ if (m($), C !== C + 0) throw C;
1745
+ v(1, 0);
1746
+ }
1747
+ }
1748
+ function za(t, e, r, n, a, o, u, s, l, d, h, y, $, C, _, I) {
1749
+ var S = g();
1750
+ try {
1751
+ w(t)(e, r, n, a, o, u, s, l, d, h, y, $, C, _, I);
1752
+ } catch (x) {
1753
+ if (m(S), x !== x + 0) throw x;
1754
+ v(1, 0);
1755
+ }
1756
+ }
1757
+ function Ga(t, e, r, n) {
1758
+ var a = g();
1759
+ try {
1760
+ return We(t, e, r, n);
1761
+ } catch (o) {
1762
+ if (m(a), o !== o + 0) throw o;
1763
+ v(1, 0);
1764
+ }
1765
+ }
1766
+ function Xa(t, e, r, n, a) {
1767
+ var o = g();
1768
+ try {
1769
+ return ke(t, e, r, n, a);
1770
+ } catch (u) {
1771
+ if (m(o), u !== u + 0) throw u;
1772
+ v(1, 0);
1773
+ }
1774
+ }
1775
+ var It;
1776
+ ct = function t() {
1777
+ It || He(), It || (ct = t);
1778
+ };
1779
+ function He() {
1780
+ if (Y > 0 || (hr(), Y > 0))
1781
+ return;
1782
+ function t() {
1783
+ var e;
1784
+ It || (It = !0, c.calledRun = !0, !ie && (pr(), O(c), (e = c.onRuntimeInitialized) === null || e === void 0 || e.call(c), yr()));
1785
+ }
1786
+ c.setStatus ? (c.setStatus("Running..."), setTimeout(() => {
1787
+ setTimeout(() => c.setStatus(""), 1), t();
1788
+ }, 1)) : t();
1789
+ }
1790
+ if (c.preInit)
1791
+ for (typeof c.preInit == "function" && (c.preInit = [c.preInit]); c.preInit.length > 0; )
1792
+ c.preInit.pop()();
1793
+ return He(), T = R, T;
1794
+ };
1795
+ })();
1796
+ function rr(i) {
1797
+ return er(ae, i);
1798
+ }
1799
+ function Mi() {
1800
+ return fi(ae);
1801
+ }
1802
+ function Fi(i) {
1803
+ rr({
1804
+ overrides: i,
1805
+ equalityFn: Object.is,
1806
+ fireImmediately: !1
1807
+ });
1808
+ }
1809
+ async function hi(i, f) {
1810
+ return di(ae, i, f);
1811
+ }
1812
+ const ji = "5bb3ce7aeedc314e24afb873bebcf366a01c27a00b21cdf2fa98b819c005c16b", nr = [
1813
+ ["aztec", "Aztec"],
1814
+ ["code_128", "Code128"],
1815
+ ["code_39", "Code39"],
1816
+ ["code_93", "Code93"],
1817
+ ["codabar", "Codabar"],
1818
+ ["databar", "DataBar"],
1819
+ ["databar_expanded", "DataBarExpanded"],
1820
+ ["databar_limited", "DataBarLimited"],
1821
+ ["data_matrix", "DataMatrix"],
1822
+ ["dx_film_edge", "DXFilmEdge"],
1823
+ ["ean_13", "EAN-13"],
1824
+ ["ean_8", "EAN-8"],
1825
+ ["itf", "ITF"],
1826
+ ["maxi_code", "MaxiCode"],
1827
+ ["micro_qr_code", "MicroQRCode"],
1828
+ ["pdf417", "PDF417"],
1829
+ ["qr_code", "QRCode"],
1830
+ ["rm_qr_code", "rMQRCode"],
1831
+ ["upc_a", "UPC-A"],
1832
+ ["upc_e", "UPC-E"],
1833
+ ["linear_codes", "Linear-Codes"],
1834
+ ["matrix_codes", "Matrix-Codes"],
1835
+ ["any", "Any"]
1836
+ ], pi = [...nr, ["unknown"]].map((i) => i[0]), ne = new Map(
1837
+ nr
1838
+ );
1839
+ function yi(i) {
1840
+ for (const [f, p] of ne)
1841
+ if (i === p)
1842
+ return f;
1843
+ return "unknown";
1844
+ }
1845
+ function vi(i) {
1846
+ if (ar(i))
1847
+ return {
1848
+ width: i.naturalWidth,
1849
+ height: i.naturalHeight
1850
+ };
1851
+ if (ir(i))
1852
+ return {
1853
+ width: i.width.baseVal.value,
1854
+ height: i.height.baseVal.value
1855
+ };
1856
+ if (or(i))
1857
+ return {
1858
+ width: i.videoWidth,
1859
+ height: i.videoHeight
1860
+ };
1861
+ if (ur(i))
1862
+ return {
1863
+ width: i.width,
1864
+ height: i.height
1865
+ };
1866
+ if (lr(i))
1867
+ return {
1868
+ width: i.displayWidth,
1869
+ height: i.displayHeight
1870
+ };
1871
+ if (sr(i))
1872
+ return {
1873
+ width: i.width,
1874
+ height: i.height
1875
+ };
1876
+ if (cr(i))
1877
+ return {
1878
+ width: i.width,
1879
+ height: i.height
1880
+ };
1881
+ throw new TypeError(
1882
+ "The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'."
1883
+ );
1884
+ }
1885
+ function ar(i) {
1886
+ var f, p;
1887
+ try {
1888
+ return i instanceof ((p = (f = i == null ? void 0 : i.ownerDocument) == null ? void 0 : f.defaultView) == null ? void 0 : p.HTMLImageElement);
1889
+ } catch {
1890
+ return !1;
1891
+ }
1892
+ }
1893
+ function ir(i) {
1894
+ var f, p;
1895
+ try {
1896
+ return i instanceof ((p = (f = i == null ? void 0 : i.ownerDocument) == null ? void 0 : f.defaultView) == null ? void 0 : p.SVGImageElement);
1897
+ } catch {
1898
+ return !1;
1899
+ }
1900
+ }
1901
+ function or(i) {
1902
+ var f, p;
1903
+ try {
1904
+ return i instanceof ((p = (f = i == null ? void 0 : i.ownerDocument) == null ? void 0 : f.defaultView) == null ? void 0 : p.HTMLVideoElement);
1905
+ } catch {
1906
+ return !1;
1907
+ }
1908
+ }
1909
+ function sr(i) {
1910
+ var f, p;
1911
+ try {
1912
+ return i instanceof ((p = (f = i == null ? void 0 : i.ownerDocument) == null ? void 0 : f.defaultView) == null ? void 0 : p.HTMLCanvasElement);
1913
+ } catch {
1914
+ return !1;
1915
+ }
1916
+ }
1917
+ function ur(i) {
1918
+ try {
1919
+ return i instanceof ImageBitmap || Object.prototype.toString.call(i) === "[object ImageBitmap]";
1920
+ } catch {
1921
+ return !1;
1922
+ }
1923
+ }
1924
+ function cr(i) {
1925
+ try {
1926
+ return i instanceof OffscreenCanvas || Object.prototype.toString.call(i) === "[object OffscreenCanvas]";
1927
+ } catch {
1928
+ return !1;
1929
+ }
1930
+ }
1931
+ function lr(i) {
1932
+ try {
1933
+ return i instanceof VideoFrame || Object.prototype.toString.call(i) === "[object VideoFrame]";
1934
+ } catch {
1935
+ return !1;
1936
+ }
1937
+ }
1938
+ function mi(i) {
1939
+ try {
1940
+ return i instanceof Blob || Object.prototype.toString.call(i) === "[object Blob]";
1941
+ } catch {
1942
+ return !1;
1943
+ }
1944
+ }
1945
+ function gi(i) {
1946
+ try {
1947
+ return i instanceof ImageData || Object.prototype.toString.call(i) === "[object ImageData]";
1948
+ } catch {
1949
+ return !1;
1950
+ }
1951
+ }
1952
+ function wi(i, f) {
1953
+ try {
1954
+ const p = new OffscreenCanvas(i, f);
1955
+ if (p.getContext("2d") instanceof OffscreenCanvasRenderingContext2D)
1956
+ return p;
1957
+ throw void 0;
1958
+ } catch {
1959
+ const p = document.createElement("canvas");
1960
+ return p.width = i, p.height = f, p;
1961
+ }
1962
+ }
1963
+ async function fr(i) {
1964
+ if (ar(i) && !await Ti(i))
1965
+ throw new DOMException(
1966
+ "Failed to load or decode HTMLImageElement.",
1967
+ "InvalidStateError"
1968
+ );
1969
+ if (ir(i) && !await Pi(i))
1970
+ throw new DOMException(
1971
+ "Failed to load or decode SVGImageElement.",
1972
+ "InvalidStateError"
1973
+ );
1974
+ if (lr(i) && _i(i))
1975
+ throw new DOMException("VideoFrame is closed.", "InvalidStateError");
1976
+ if (or(i) && (i.readyState === 0 || i.readyState === 1))
1977
+ throw new DOMException("Invalid element or state.", "InvalidStateError");
1978
+ if (ur(i) && Oi(i))
1979
+ throw new DOMException(
1980
+ "The image source is detached.",
1981
+ "InvalidStateError"
1982
+ );
1983
+ const { width: f, height: p } = vi(i);
1984
+ if (f === 0 || p === 0)
1985
+ return null;
1986
+ const c = wi(f, p).getContext("2d");
1987
+ c.drawImage(i, 0, 0);
1988
+ try {
1989
+ return c.getImageData(0, 0, f, p);
1990
+ } catch {
1991
+ throw new DOMException("Source would taint origin.", "SecurityError");
1992
+ }
1993
+ }
1994
+ async function $i(i) {
1995
+ let f;
1996
+ try {
1997
+ f = await createImageBitmap(i);
1998
+ } catch {
1999
+ try {
2000
+ if (globalThis.Image) {
2001
+ f = new Image();
2002
+ let c = "";
2003
+ try {
2004
+ c = URL.createObjectURL(i), f.src = c, await f.decode();
2005
+ } finally {
2006
+ URL.revokeObjectURL(c);
2007
+ }
2008
+ } else
2009
+ return i;
2010
+ } catch {
2011
+ throw new DOMException(
2012
+ "Failed to load or decode Blob.",
2013
+ "InvalidStateError"
2014
+ );
2015
+ }
2016
+ }
2017
+ return await fr(f);
2018
+ }
2019
+ function bi(i) {
2020
+ const { width: f, height: p } = i;
2021
+ if (f === 0 || p === 0)
2022
+ return null;
2023
+ const T = i.getContext("2d");
2024
+ try {
2025
+ return T.getImageData(0, 0, f, p);
2026
+ } catch {
2027
+ throw new DOMException("Source would taint origin.", "SecurityError");
2028
+ }
2029
+ }
2030
+ async function Ci(i) {
2031
+ if (mi(i))
2032
+ return await $i(i);
2033
+ if (gi(i)) {
2034
+ if (Ei(i))
2035
+ throw new DOMException(
2036
+ "The image data has been detached.",
2037
+ "InvalidStateError"
2038
+ );
2039
+ return i;
2040
+ }
2041
+ return sr(i) || cr(i) ? bi(i) : await fr(i);
2042
+ }
2043
+ async function Ti(i) {
2044
+ try {
2045
+ return await i.decode(), !0;
2046
+ } catch {
2047
+ return !1;
2048
+ }
2049
+ }
2050
+ async function Pi(i) {
2051
+ var f;
2052
+ try {
2053
+ return await ((f = i.decode) == null ? void 0 : f.call(i)), !0;
2054
+ } catch {
2055
+ return !1;
2056
+ }
2057
+ }
2058
+ function _i(i) {
2059
+ return i.format === null;
2060
+ }
2061
+ function Ei(i) {
2062
+ return i.data.buffer.byteLength === 0;
2063
+ }
2064
+ function Oi(i) {
2065
+ return i.width === 0 && i.height === 0;
2066
+ }
2067
+ function tr(i, f) {
2068
+ return Ai(i) ? new DOMException(`${f}: ${i.message}`, i.name) : Si(i) ? new i.constructor(`${f}: ${i.message}`) : new Error(`${f}: ${i}`);
2069
+ }
2070
+ function Ai(i) {
2071
+ return i instanceof DOMException || Object.prototype.toString.call(i) === "[object DOMException]";
2072
+ }
2073
+ function Si(i) {
2074
+ return i instanceof Error || Object.prototype.toString.call(i) === "[object Error]";
2075
+ }
2076
+ var pt;
2077
+ class Ri {
2078
+ constructor(f = {}) {
2079
+ Ye(this, pt);
2080
+ var p;
2081
+ try {
2082
+ const T = (p = f == null ? void 0 : f.formats) == null ? void 0 : p.filter(
2083
+ (c) => c !== "unknown"
2084
+ );
2085
+ if ((T == null ? void 0 : T.length) === 0)
2086
+ throw new TypeError("Hint option provided, but is empty.");
2087
+ for (const c of T != null ? T : [])
2088
+ if (!ne.has(c))
2089
+ throw new TypeError(
2090
+ `Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${c}' is not a valid enum value of type BarcodeFormat.`
2091
+ );
2092
+ Qe(this, pt, T != null ? T : []), rr({ fireImmediately: !0 }).catch(() => {
2093
+ });
2094
+ } catch (T) {
2095
+ throw tr(
2096
+ T,
2097
+ "Failed to construct 'BarcodeDetector'"
2098
+ );
2099
+ }
2100
+ }
2101
+ static async getSupportedFormats() {
2102
+ return pi.filter((f) => f !== "unknown");
2103
+ }
2104
+ async detect(f) {
2105
+ try {
2106
+ const p = await Ci(f);
2107
+ if (p === null)
2108
+ return [];
2109
+ let T;
2110
+ const c = {
2111
+ tryCode39ExtendedMode: !1,
2112
+ textMode: "Plain",
2113
+ formats: Ze(this, pt).map((O) => ne.get(O))
2114
+ };
2115
+ try {
2116
+ T = await hi(p, c);
2117
+ } catch (O) {
2118
+ throw console.error(O), new DOMException(
2119
+ "Barcode detection service unavailable.",
2120
+ "NotSupportedError"
2121
+ );
2122
+ }
2123
+ return T.map((O) => {
2124
+ const {
2125
+ topLeft: { x: D, y: R },
2126
+ topRight: { x: A, y: M },
2127
+ bottomLeft: { x: k, y: Z },
2128
+ bottomRight: { x: tt, y: L }
2129
+ } = O.position, yt = Math.min(D, A, k, tt), it = Math.min(R, M, Z, L), ot = Math.max(D, A, k, tt), st = Math.max(R, M, Z, L);
2130
+ return {
2131
+ boundingBox: new DOMRectReadOnly(
2132
+ yt,
2133
+ it,
2134
+ ot - yt,
2135
+ st - it
2136
+ ),
2137
+ rawValue: O.text,
2138
+ format: yi(O.format),
2139
+ cornerPoints: [
2140
+ {
2141
+ x: D,
2142
+ y: R
2143
+ },
2144
+ {
2145
+ x: A,
2146
+ y: M
2147
+ },
2148
+ {
2149
+ x: tt,
2150
+ y: L
2151
+ },
2152
+ {
2153
+ x: k,
2154
+ y: Z
2155
+ }
2156
+ ]
2157
+ };
2158
+ });
2159
+ } catch (p) {
2160
+ throw tr(
2161
+ p,
2162
+ "Failed to execute 'detect' on 'BarcodeDetector'"
2163
+ );
2164
+ }
2165
+ }
2166
+ }
2167
+ pt = new WeakMap();
2168
+ export {
2169
+ Ri as BarcodeDetector,
2170
+ Ii as ZXING_CPP_COMMIT,
2171
+ ji as ZXING_WASM_SHA256,
2172
+ Di as ZXING_WASM_VERSION,
2173
+ rr as prepareZXingModule,
2174
+ Mi as purgeZXingModule,
2175
+ Fi as setZXingModuleOverrides
2176
+ };