glassjar 0.2.1 → 0.3.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.
- package/README.md +5 -1
- package/dist/assets/{worker-BPJOu1S6.js → worker-BgBM-gEP.js} +85 -85
- package/dist/engine_bg.wasm +0 -0
- package/dist/glassjar.js +242 -235
- package/dist/glassjar.umd.cjs +2 -2
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/glassjar.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
function UA(Q) {
|
|
2
2
|
return Q && Q.__esModule && Object.prototype.hasOwnProperty.call(Q, "default") ? Q.default : Q;
|
|
3
3
|
}
|
|
4
|
-
var
|
|
4
|
+
var m = { exports: {} }, CA;
|
|
5
5
|
function JA() {
|
|
6
|
-
if (CA) return
|
|
6
|
+
if (CA) return m.exports;
|
|
7
7
|
CA = 1;
|
|
8
|
-
var Q = typeof Reflect == "object" ? Reflect : null, A = Q && typeof Q.apply == "function" ? Q.apply : function(E, o,
|
|
9
|
-
return Function.prototype.apply.call(E, o,
|
|
8
|
+
var Q = typeof Reflect == "object" ? Reflect : null, A = Q && typeof Q.apply == "function" ? Q.apply : function(E, o, k) {
|
|
9
|
+
return Function.prototype.apply.call(E, o, k);
|
|
10
10
|
}, g;
|
|
11
11
|
Q && typeof Q.ownKeys == "function" ? g = Q.ownKeys : Object.getOwnPropertySymbols ? g = function(E) {
|
|
12
12
|
return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E));
|
|
@@ -22,7 +22,7 @@ function JA() {
|
|
|
22
22
|
function B() {
|
|
23
23
|
B.init.call(this);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
m.exports = B, m.exports.once = yA, B.EventEmitter = B, B.prototype._events = void 0, B.prototype._eventsCount = 0, B.prototype._maxListeners = void 0;
|
|
26
26
|
var i = 10;
|
|
27
27
|
function D(w) {
|
|
28
28
|
if (typeof w != "function")
|
|
@@ -51,41 +51,41 @@ function JA() {
|
|
|
51
51
|
B.prototype.getMaxListeners = function() {
|
|
52
52
|
return N(this);
|
|
53
53
|
}, B.prototype.emit = function(E) {
|
|
54
|
-
for (var o = [],
|
|
55
|
-
var
|
|
54
|
+
for (var o = [], k = 1; k < arguments.length; k++) o.push(arguments[k]);
|
|
55
|
+
var M = E === "error", R = this._events;
|
|
56
56
|
if (R !== void 0)
|
|
57
|
-
|
|
58
|
-
else if (!
|
|
57
|
+
M = M && R.error === void 0;
|
|
58
|
+
else if (!M)
|
|
59
59
|
return !1;
|
|
60
|
-
if (
|
|
60
|
+
if (M) {
|
|
61
61
|
var F;
|
|
62
62
|
if (o.length > 0 && (F = o[0]), F instanceof Error)
|
|
63
63
|
throw F;
|
|
64
|
-
var
|
|
65
|
-
throw
|
|
64
|
+
var a = new Error("Unhandled error." + (F ? " (" + F.message + ")" : ""));
|
|
65
|
+
throw a.context = F, a;
|
|
66
66
|
}
|
|
67
|
-
var
|
|
68
|
-
if (
|
|
67
|
+
var j = R[E];
|
|
68
|
+
if (j === void 0)
|
|
69
69
|
return !1;
|
|
70
|
-
if (typeof
|
|
71
|
-
A(
|
|
70
|
+
if (typeof j == "function")
|
|
71
|
+
A(j, this, o);
|
|
72
72
|
else
|
|
73
|
-
for (var IA =
|
|
74
|
-
A(YA[
|
|
73
|
+
for (var IA = j.length, YA = x(j, IA), k = 0; k < IA; ++k)
|
|
74
|
+
A(YA[k], this, o);
|
|
75
75
|
return !0;
|
|
76
76
|
};
|
|
77
|
-
function y(w, E, o,
|
|
78
|
-
var
|
|
77
|
+
function y(w, E, o, k) {
|
|
78
|
+
var M, R, F;
|
|
79
79
|
if (D(o), R = w._events, R === void 0 ? (R = w._events = /* @__PURE__ */ Object.create(null), w._eventsCount = 0) : (R.newListener !== void 0 && (w.emit(
|
|
80
80
|
"newListener",
|
|
81
81
|
E,
|
|
82
82
|
o.listener ? o.listener : o
|
|
83
83
|
), R = w._events), F = R[E]), F === void 0)
|
|
84
84
|
F = R[E] = o, ++w._eventsCount;
|
|
85
|
-
else if (typeof F == "function" ? F = R[E] =
|
|
85
|
+
else if (typeof F == "function" ? F = R[E] = k ? [o, F] : [F, o] : k ? F.unshift(o) : F.push(o), M = N(w), M > 0 && F.length > M && !F.warned) {
|
|
86
86
|
F.warned = !0;
|
|
87
|
-
var
|
|
88
|
-
|
|
87
|
+
var a = new Error("Possible EventEmitter memory leak detected. " + F.length + " " + String(E) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
88
|
+
a.name = "MaxListenersExceededWarning", a.emitter = w, a.type = E, a.count = F.length, I(a);
|
|
89
89
|
}
|
|
90
90
|
return w;
|
|
91
91
|
}
|
|
@@ -98,67 +98,67 @@ function JA() {
|
|
|
98
98
|
if (!this.fired)
|
|
99
99
|
return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
var
|
|
103
|
-
return
|
|
101
|
+
function S(w, E, o) {
|
|
102
|
+
var k = { fired: !1, wrapFn: void 0, target: w, type: E, listener: o }, M = J.bind(k);
|
|
103
|
+
return M.listener = o, k.wrapFn = M, M;
|
|
104
104
|
}
|
|
105
105
|
B.prototype.once = function(E, o) {
|
|
106
|
-
return D(o), this.on(E,
|
|
106
|
+
return D(o), this.on(E, S(this, E, o)), this;
|
|
107
107
|
}, B.prototype.prependOnceListener = function(E, o) {
|
|
108
|
-
return D(o), this.prependListener(E,
|
|
108
|
+
return D(o), this.prependListener(E, S(this, E, o)), this;
|
|
109
109
|
}, B.prototype.removeListener = function(E, o) {
|
|
110
|
-
var
|
|
111
|
-
if (D(o),
|
|
110
|
+
var k, M, R, F, a;
|
|
111
|
+
if (D(o), M = this._events, M === void 0)
|
|
112
112
|
return this;
|
|
113
|
-
if (
|
|
113
|
+
if (k = M[E], k === void 0)
|
|
114
114
|
return this;
|
|
115
|
-
if (
|
|
116
|
-
--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete
|
|
117
|
-
else if (typeof
|
|
118
|
-
for (R = -1, F =
|
|
119
|
-
if (
|
|
120
|
-
|
|
115
|
+
if (k === o || k.listener === o)
|
|
116
|
+
--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete M[E], M.removeListener && this.emit("removeListener", E, k.listener || o));
|
|
117
|
+
else if (typeof k != "function") {
|
|
118
|
+
for (R = -1, F = k.length - 1; F >= 0; F--)
|
|
119
|
+
if (k[F] === o || k[F].listener === o) {
|
|
120
|
+
a = k[F].listener, R = F;
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
123
|
if (R < 0)
|
|
124
124
|
return this;
|
|
125
|
-
R === 0 ?
|
|
125
|
+
R === 0 ? k.shift() : p(k, R), k.length === 1 && (M[E] = k[0]), M.removeListener !== void 0 && this.emit("removeListener", E, a || o);
|
|
126
126
|
}
|
|
127
127
|
return this;
|
|
128
128
|
}, B.prototype.off = B.prototype.removeListener, B.prototype.removeAllListeners = function(E) {
|
|
129
|
-
var o,
|
|
130
|
-
if (
|
|
129
|
+
var o, k, M;
|
|
130
|
+
if (k = this._events, k === void 0)
|
|
131
131
|
return this;
|
|
132
|
-
if (
|
|
133
|
-
return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) :
|
|
132
|
+
if (k.removeListener === void 0)
|
|
133
|
+
return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : k[E] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete k[E]), this;
|
|
134
134
|
if (arguments.length === 0) {
|
|
135
|
-
var R = Object.keys(
|
|
136
|
-
for (
|
|
137
|
-
F = R[
|
|
135
|
+
var R = Object.keys(k), F;
|
|
136
|
+
for (M = 0; M < R.length; ++M)
|
|
137
|
+
F = R[M], F !== "removeListener" && this.removeAllListeners(F);
|
|
138
138
|
return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
|
|
139
139
|
}
|
|
140
|
-
if (o =
|
|
140
|
+
if (o = k[E], typeof o == "function")
|
|
141
141
|
this.removeListener(E, o);
|
|
142
142
|
else if (o !== void 0)
|
|
143
|
-
for (
|
|
144
|
-
this.removeListener(E, o[
|
|
143
|
+
for (M = o.length - 1; M >= 0; M--)
|
|
144
|
+
this.removeListener(E, o[M]);
|
|
145
145
|
return this;
|
|
146
146
|
};
|
|
147
147
|
function Y(w, E, o) {
|
|
148
|
-
var
|
|
149
|
-
if (
|
|
148
|
+
var k = w._events;
|
|
149
|
+
if (k === void 0)
|
|
150
150
|
return [];
|
|
151
|
-
var
|
|
152
|
-
return
|
|
151
|
+
var M = k[E];
|
|
152
|
+
return M === void 0 ? [] : typeof M == "function" ? o ? [M.listener || M] : [M] : o ? KA(M) : x(M, M.length);
|
|
153
153
|
}
|
|
154
154
|
B.prototype.listeners = function(E) {
|
|
155
155
|
return Y(this, E, !0);
|
|
156
156
|
}, B.prototype.rawListeners = function(E) {
|
|
157
157
|
return Y(this, E, !1);
|
|
158
158
|
}, B.listenerCount = function(w, E) {
|
|
159
|
-
return typeof w.listenerCount == "function" ? w.listenerCount(E) :
|
|
160
|
-
}, B.prototype.listenerCount =
|
|
161
|
-
function
|
|
159
|
+
return typeof w.listenerCount == "function" ? w.listenerCount(E) : L.call(w, E);
|
|
160
|
+
}, B.prototype.listenerCount = L;
|
|
161
|
+
function L(w) {
|
|
162
162
|
var E = this._events;
|
|
163
163
|
if (E !== void 0) {
|
|
164
164
|
var o = E[w];
|
|
@@ -172,9 +172,9 @@ function JA() {
|
|
|
172
172
|
B.prototype.eventNames = function() {
|
|
173
173
|
return this._eventsCount > 0 ? g(this._events) : [];
|
|
174
174
|
};
|
|
175
|
-
function
|
|
176
|
-
for (var o = new Array(E),
|
|
177
|
-
o[
|
|
175
|
+
function x(w, E) {
|
|
176
|
+
for (var o = new Array(E), k = 0; k < E; ++k)
|
|
177
|
+
o[k] = w[k];
|
|
178
178
|
return o;
|
|
179
179
|
}
|
|
180
180
|
function p(w, E) {
|
|
@@ -188,33 +188,33 @@ function JA() {
|
|
|
188
188
|
return E;
|
|
189
189
|
}
|
|
190
190
|
function yA(w, E) {
|
|
191
|
-
return new Promise(function(o,
|
|
192
|
-
function
|
|
193
|
-
w.removeListener(E, R),
|
|
191
|
+
return new Promise(function(o, k) {
|
|
192
|
+
function M(F) {
|
|
193
|
+
w.removeListener(E, R), k(F);
|
|
194
194
|
}
|
|
195
195
|
function R() {
|
|
196
|
-
typeof w.removeListener == "function" && w.removeListener("error",
|
|
196
|
+
typeof w.removeListener == "function" && w.removeListener("error", M), o([].slice.call(arguments));
|
|
197
197
|
}
|
|
198
|
-
gA(w, E, R, { once: !0 }), E !== "error" && RA(w,
|
|
198
|
+
gA(w, E, R, { once: !0 }), E !== "error" && RA(w, M, { once: !0 });
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
201
|
function RA(w, E, o) {
|
|
202
202
|
typeof w.on == "function" && gA(w, "error", E, o);
|
|
203
203
|
}
|
|
204
|
-
function gA(w, E, o,
|
|
204
|
+
function gA(w, E, o, k) {
|
|
205
205
|
if (typeof w.on == "function")
|
|
206
|
-
|
|
206
|
+
k.once ? w.once(E, o) : w.on(E, o);
|
|
207
207
|
else if (typeof w.addEventListener == "function")
|
|
208
|
-
w.addEventListener(E, function
|
|
209
|
-
|
|
208
|
+
w.addEventListener(E, function M(R) {
|
|
209
|
+
k.once && w.removeEventListener(E, M), o(R);
|
|
210
210
|
});
|
|
211
211
|
else
|
|
212
212
|
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof w);
|
|
213
213
|
}
|
|
214
|
-
return
|
|
214
|
+
return m.exports;
|
|
215
215
|
}
|
|
216
|
-
var
|
|
217
|
-
const
|
|
216
|
+
var LA = JA();
|
|
217
|
+
const GA = /* @__PURE__ */ UA(LA);
|
|
218
218
|
class e {
|
|
219
219
|
__destroy_into_raw() {
|
|
220
220
|
const A = this.__wbg_ptr;
|
|
@@ -222,7 +222,7 @@ class e {
|
|
|
222
222
|
}
|
|
223
223
|
free() {
|
|
224
224
|
const A = this.__destroy_into_raw();
|
|
225
|
-
|
|
225
|
+
G.__wbg_dapadapter_free(A, 0);
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
228
228
|
* Attaches a worker to the adapter.
|
|
@@ -233,39 +233,39 @@ class e {
|
|
|
233
233
|
* @param {Worker} worker
|
|
234
234
|
*/
|
|
235
235
|
attach(A) {
|
|
236
|
-
|
|
236
|
+
G.dapadapter_attach(this.__wbg_ptr, A);
|
|
237
237
|
}
|
|
238
238
|
/**
|
|
239
239
|
* Retire the listener without borrowing session state (callbacks can synchronously Stop).
|
|
240
240
|
*/
|
|
241
241
|
detach() {
|
|
242
|
-
|
|
242
|
+
G.dapadapter_detach(this.__wbg_ptr);
|
|
243
243
|
}
|
|
244
244
|
constructor() {
|
|
245
|
-
const A =
|
|
245
|
+
const A = G.dapadapter_new();
|
|
246
246
|
return this.__wbg_ptr = A >>> 0, EA.register(this, this.__wbg_ptr, this), this;
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
249
|
* @param {Function} callback
|
|
250
250
|
*/
|
|
251
251
|
on(A) {
|
|
252
|
-
|
|
252
|
+
G.dapadapter_on(this.__wbg_ptr, A);
|
|
253
253
|
}
|
|
254
254
|
resetRun() {
|
|
255
|
-
|
|
255
|
+
G.dapadapter_resetRun(this.__wbg_ptr);
|
|
256
256
|
}
|
|
257
257
|
/**
|
|
258
258
|
* @param {any} msg
|
|
259
259
|
* @returns {any}
|
|
260
260
|
*/
|
|
261
261
|
sendMessage(A) {
|
|
262
|
-
return
|
|
262
|
+
return G.dapadapter_sendMessage(this.__wbg_ptr, A);
|
|
263
263
|
}
|
|
264
264
|
/**
|
|
265
265
|
* @param {boolean} value
|
|
266
266
|
*/
|
|
267
267
|
setFilterInternals(A) {
|
|
268
|
-
|
|
268
|
+
G.dapadapter_setFilterInternals(this.__wbg_ptr, A);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
Symbol.dispose && (e.prototype[Symbol.dispose] = e.prototype.free);
|
|
@@ -281,32 +281,32 @@ class l {
|
|
|
281
281
|
}
|
|
282
282
|
free() {
|
|
283
283
|
const A = this.__destroy_into_raw();
|
|
284
|
-
|
|
284
|
+
G.__wbg_trap_free(A, 0);
|
|
285
285
|
}
|
|
286
286
|
/**
|
|
287
287
|
* A marker method to indicate that an object is an instance of the `Trap`
|
|
288
288
|
* class.
|
|
289
289
|
*/
|
|
290
290
|
static __wbg_wasmer_trap() {
|
|
291
|
-
|
|
291
|
+
G.trap___wbg_wasmer_trap();
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
Symbol.dispose && (l.prototype[Symbol.dispose] = l.prototype.free);
|
|
295
|
-
function
|
|
295
|
+
function SA() {
|
|
296
296
|
let Q, A;
|
|
297
297
|
try {
|
|
298
|
-
const g =
|
|
298
|
+
const g = G.cpp_exception_hash();
|
|
299
299
|
return Q = g[0], A = g[1], c(g[0], g[1]);
|
|
300
300
|
} finally {
|
|
301
|
-
|
|
301
|
+
G.__wbindgen_free(Q, A, 1);
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
function QA(Q) {
|
|
305
|
-
const A =
|
|
306
|
-
var C =
|
|
307
|
-
return
|
|
305
|
+
const A = V(Q, G.__wbindgen_malloc, G.__wbindgen_realloc), g = d, I = G.prefetch_urls(A, g);
|
|
306
|
+
var C = kA(I[0], I[1]).slice();
|
|
307
|
+
return G.__wbindgen_free(I[0], I[1] * 4, 4), C;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function hA() {
|
|
310
310
|
return {
|
|
311
311
|
__proto__: null,
|
|
312
312
|
"./engine_bg.js": {
|
|
@@ -321,7 +321,7 @@ function LA() {
|
|
|
321
321
|
return Number(A);
|
|
322
322
|
},
|
|
323
323
|
__wbg_String_8f0eb39a4a4c2f66: function(A, g) {
|
|
324
|
-
const I = String(g), C =
|
|
324
|
+
const I = String(g), C = V(I, G.__wbindgen_malloc, G.__wbindgen_realloc), B = d;
|
|
325
325
|
s().setInt32(A + 4, B, !0), s().setInt32(A + 0, C, !0);
|
|
326
326
|
},
|
|
327
327
|
__wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2: function(A, g) {
|
|
@@ -333,11 +333,11 @@ function LA() {
|
|
|
333
333
|
return q(I) ? 16777215 : I ? 1 : 0;
|
|
334
334
|
},
|
|
335
335
|
__wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(A, g) {
|
|
336
|
-
const I = _(g), C =
|
|
336
|
+
const I = _(g), C = V(I, G.__wbindgen_malloc, G.__wbindgen_realloc), B = d;
|
|
337
337
|
s().setInt32(A + 4, B, !0), s().setInt32(A + 0, C, !0);
|
|
338
338
|
},
|
|
339
339
|
__wbg___wbindgen_function_table_5ae7216dfcbcc506: function() {
|
|
340
|
-
return
|
|
340
|
+
return G.__wbindgen_export;
|
|
341
341
|
},
|
|
342
342
|
__wbg___wbindgen_in_47fa6863be6f2f25: function(A, g) {
|
|
343
343
|
return A in g;
|
|
@@ -382,7 +382,7 @@ function LA() {
|
|
|
382
382
|
},
|
|
383
383
|
__wbg___wbindgen_string_get_72fb696202c56729: function(A, g) {
|
|
384
384
|
const I = g, C = typeof I == "string" ? I : void 0;
|
|
385
|
-
var B = q(C) ? 0 :
|
|
385
|
+
var B = q(C) ? 0 : V(C, G.__wbindgen_malloc, G.__wbindgen_realloc), i = d;
|
|
386
386
|
s().setInt32(A + 4, i, !0), s().setInt32(A + 0, B, !0);
|
|
387
387
|
},
|
|
388
388
|
__wbg___wbindgen_throw_be289d5034ed271b: function(A, g) {
|
|
@@ -464,7 +464,7 @@ function LA() {
|
|
|
464
464
|
try {
|
|
465
465
|
I = A, C = g, console.error(c(A, g));
|
|
466
466
|
} finally {
|
|
467
|
-
|
|
467
|
+
G.__wbindgen_free(I, C, 1);
|
|
468
468
|
}
|
|
469
469
|
},
|
|
470
470
|
__wbg_exports_794a42000dacd046: function(A) {
|
|
@@ -765,7 +765,7 @@ function LA() {
|
|
|
765
765
|
return new Uint8Array(A);
|
|
766
766
|
},
|
|
767
767
|
__wbg_new_from_slice_a3d2629dc1826784: function(A, g) {
|
|
768
|
-
return new Uint8Array(
|
|
768
|
+
return new Uint8Array(b(A, g));
|
|
769
769
|
},
|
|
770
770
|
__wbg_new_no_args_1c7c842f08d00ebb: function(A, g) {
|
|
771
771
|
return new Function(c(A, g));
|
|
@@ -822,7 +822,7 @@ function LA() {
|
|
|
822
822
|
return A.process;
|
|
823
823
|
},
|
|
824
824
|
__wbg_prototypesetcall_bdcdcc5842e4d77d: function(A, g, I) {
|
|
825
|
-
Uint8Array.prototype.set.call(
|
|
825
|
+
Uint8Array.prototype.set.call(b(A, g), I);
|
|
826
826
|
},
|
|
827
827
|
__wbg_push_8ffdcb2063340ba5: function(A, g) {
|
|
828
828
|
return A.push(g);
|
|
@@ -879,7 +879,7 @@ function LA() {
|
|
|
879
879
|
}, arguments);
|
|
880
880
|
},
|
|
881
881
|
__wbg_set_cc56eefd2dd91957: function(A, g, I) {
|
|
882
|
-
A.set(
|
|
882
|
+
A.set(b(g, I));
|
|
883
883
|
},
|
|
884
884
|
__wbg_set_f43e577aea94465b: function(A, g, I) {
|
|
885
885
|
A[g >>> 0] = I;
|
|
@@ -900,24 +900,24 @@ function LA() {
|
|
|
900
900
|
return A.slice(g >>> 0, I >>> 0);
|
|
901
901
|
},
|
|
902
902
|
__wbg_stack_0ed75d68575b0f3c: function(A, g) {
|
|
903
|
-
const I = g.stack, C =
|
|
903
|
+
const I = g.stack, C = V(I, G.__wbindgen_malloc, G.__wbindgen_realloc), B = d;
|
|
904
904
|
s().setInt32(A + 4, B, !0), s().setInt32(A + 0, C, !0);
|
|
905
905
|
},
|
|
906
906
|
__wbg_static_accessor_GLOBAL_12837167ad935116: function() {
|
|
907
907
|
const A = typeof global > "u" ? null : global;
|
|
908
|
-
return q(A) ? 0 :
|
|
908
|
+
return q(A) ? 0 : W(A);
|
|
909
909
|
},
|
|
910
910
|
__wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function() {
|
|
911
911
|
const A = typeof globalThis > "u" ? null : globalThis;
|
|
912
|
-
return q(A) ? 0 :
|
|
912
|
+
return q(A) ? 0 : W(A);
|
|
913
913
|
},
|
|
914
914
|
__wbg_static_accessor_SELF_a621d3dfbb60d0ce: function() {
|
|
915
915
|
const A = typeof self > "u" ? null : self;
|
|
916
|
-
return q(A) ? 0 :
|
|
916
|
+
return q(A) ? 0 : W(A);
|
|
917
917
|
},
|
|
918
918
|
__wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function() {
|
|
919
919
|
const A = typeof window > "u" ? null : window;
|
|
920
|
-
return q(A) ? 0 :
|
|
920
|
+
return q(A) ? 0 : W(A);
|
|
921
921
|
},
|
|
922
922
|
__wbg_store_d1d951c98d9bed41: function() {
|
|
923
923
|
return K(function(A, g, I) {
|
|
@@ -934,7 +934,7 @@ function LA() {
|
|
|
934
934
|
return A.then(g);
|
|
935
935
|
},
|
|
936
936
|
__wbg_toString_56d946daff83867b: function(A, g, I) {
|
|
937
|
-
const C = g.toString(I), B =
|
|
937
|
+
const C = g.toString(I), B = V(C, G.__wbindgen_malloc, G.__wbindgen_realloc), i = d;
|
|
938
938
|
s().setInt32(A + 4, i, !0), s().setInt32(A + 0, B, !0);
|
|
939
939
|
},
|
|
940
940
|
__wbg_toString_964ff7fe6eca8362: function(A) {
|
|
@@ -966,22 +966,22 @@ function LA() {
|
|
|
966
966
|
console.warn(A, g, I);
|
|
967
967
|
},
|
|
968
968
|
__wbindgen_cast_0000000000000001: function(A, g) {
|
|
969
|
-
return
|
|
969
|
+
return Z(A, g, G.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___, BA);
|
|
970
970
|
},
|
|
971
971
|
__wbindgen_cast_0000000000000002: function(A, g) {
|
|
972
|
-
return
|
|
972
|
+
return Z(A, g, G.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___, BA);
|
|
973
973
|
},
|
|
974
974
|
__wbindgen_cast_0000000000000003: function(A, g) {
|
|
975
|
-
return
|
|
975
|
+
return Z(A, g, G.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___, HA);
|
|
976
976
|
},
|
|
977
977
|
__wbindgen_cast_0000000000000004: function(A, g) {
|
|
978
|
-
return
|
|
978
|
+
return Z(A, g, G.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__FnMut__wasm_bindgen_36932265c58943ab___JsValue____Output_______, sA);
|
|
979
979
|
},
|
|
980
980
|
__wbindgen_cast_0000000000000005: function(A, g) {
|
|
981
|
-
return pA(A, g,
|
|
981
|
+
return pA(A, g, G.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__Fn__web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent____Output_______, cA);
|
|
982
982
|
},
|
|
983
983
|
__wbindgen_cast_0000000000000006: function(A, g) {
|
|
984
|
-
return
|
|
984
|
+
return Z(A, g, G.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__Fn__web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent____Output_______, aA);
|
|
985
985
|
},
|
|
986
986
|
__wbindgen_cast_0000000000000007: function(A) {
|
|
987
987
|
return A;
|
|
@@ -990,7 +990,7 @@ function LA() {
|
|
|
990
990
|
return A;
|
|
991
991
|
},
|
|
992
992
|
__wbindgen_cast_0000000000000009: function(A, g) {
|
|
993
|
-
return
|
|
993
|
+
return b(A, g);
|
|
994
994
|
},
|
|
995
995
|
__wbindgen_cast_000000000000000a: function(A, g) {
|
|
996
996
|
return c(A, g);
|
|
@@ -1002,47 +1002,47 @@ function LA() {
|
|
|
1002
1002
|
return BigInt.asUintN(64, A);
|
|
1003
1003
|
},
|
|
1004
1004
|
__wbindgen_cast_000000000000000d: function(A, g) {
|
|
1005
|
-
var I =
|
|
1006
|
-
return
|
|
1005
|
+
var I = kA(A, g).slice();
|
|
1006
|
+
return G.__wbindgen_free(A, g * 4, 4), I;
|
|
1007
1007
|
},
|
|
1008
1008
|
__wbindgen_init_externref_table: function() {
|
|
1009
|
-
const A =
|
|
1009
|
+
const A = G.__wbindgen_externrefs, g = A.grow(4);
|
|
1010
1010
|
A.set(0, void 0), A.set(g + 0, void 0), A.set(g + 1, null), A.set(g + 2, !0), A.set(g + 3, !1);
|
|
1011
1011
|
}
|
|
1012
1012
|
}
|
|
1013
1013
|
};
|
|
1014
1014
|
}
|
|
1015
1015
|
function sA(Q, A, g) {
|
|
1016
|
-
|
|
1016
|
+
G.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___wasm_bindgen_36932265c58943ab___JsValue_____(Q, A, g);
|
|
1017
1017
|
}
|
|
1018
1018
|
function cA(Q, A, g) {
|
|
1019
|
-
|
|
1020
|
-
}
|
|
1021
|
-
function HA(Q, A, g) {
|
|
1022
|
-
M.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent______1_(Q, A, g);
|
|
1019
|
+
G.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent_____(Q, A, g);
|
|
1023
1020
|
}
|
|
1024
1021
|
function aA(Q, A, g) {
|
|
1025
|
-
|
|
1022
|
+
G.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent______1_(Q, A, g);
|
|
1023
|
+
}
|
|
1024
|
+
function HA(Q, A, g) {
|
|
1025
|
+
const I = G.wasm_bindgen_36932265c58943ab___convert__closures________invoke___js_sys_9eaf8169b8189500___Array__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_36932265c58943ab___JsValue__(Q, A, g);
|
|
1026
1026
|
if (I[1])
|
|
1027
1027
|
throw $(I[0]);
|
|
1028
1028
|
}
|
|
1029
1029
|
function BA(Q, A, g) {
|
|
1030
|
-
const I =
|
|
1030
|
+
const I = G.wasm_bindgen_36932265c58943ab___convert__closures________invoke___js_sys_9eaf8169b8189500___Array__core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue__(Q, A, g);
|
|
1031
1031
|
if (I[2])
|
|
1032
1032
|
throw $(I[1]);
|
|
1033
1033
|
return $(I[0]);
|
|
1034
1034
|
}
|
|
1035
1035
|
function qA(Q, A, g, I) {
|
|
1036
|
-
|
|
1036
|
+
G.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___wasm_bindgen_36932265c58943ab___JsValue__wasm_bindgen_36932265c58943ab___JsValue_____(Q, A, g, I);
|
|
1037
1037
|
}
|
|
1038
1038
|
const EA = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1039
1039
|
}, unregister: () => {
|
|
1040
|
-
} } : new FinalizationRegistry((Q) =>
|
|
1040
|
+
} } : new FinalizationRegistry((Q) => G.__wbg_dapadapter_free(Q >>> 0, 1)), DA = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1041
1041
|
}, unregister: () => {
|
|
1042
|
-
} } : new FinalizationRegistry((Q) =>
|
|
1043
|
-
function
|
|
1044
|
-
const A =
|
|
1045
|
-
return
|
|
1042
|
+
} } : new FinalizationRegistry((Q) => G.__wbg_trap_free(Q >>> 0, 1));
|
|
1043
|
+
function W(Q) {
|
|
1044
|
+
const A = G.__externref_table_alloc();
|
|
1045
|
+
return G.__wbindgen_externrefs.set(A, Q), A;
|
|
1046
1046
|
}
|
|
1047
1047
|
const r = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1048
1048
|
}, unregister: () => {
|
|
@@ -1084,33 +1084,33 @@ function _(Q) {
|
|
|
1084
1084
|
return Q instanceof Error ? `${Q.name}: ${Q.message}
|
|
1085
1085
|
${Q.stack}` : I;
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1087
|
+
function kA(Q, A) {
|
|
1088
1088
|
Q = Q >>> 0;
|
|
1089
1089
|
const g = s(), I = [];
|
|
1090
1090
|
for (let C = Q; C < Q + 4 * A; C += 4)
|
|
1091
|
-
I.push(
|
|
1092
|
-
return
|
|
1091
|
+
I.push(G.__wbindgen_externrefs.get(g.getUint32(C, !0)));
|
|
1092
|
+
return G.__externref_drop_slice(Q, A), I;
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1095
|
-
return Q = Q >>> 0,
|
|
1094
|
+
function b(Q, A) {
|
|
1095
|
+
return Q = Q >>> 0, T().subarray(Q / 1, Q / 1 + A);
|
|
1096
1096
|
}
|
|
1097
|
-
let
|
|
1097
|
+
let t = null;
|
|
1098
1098
|
function s() {
|
|
1099
|
-
return (
|
|
1099
|
+
return (t === null || t.buffer.detached === !0 || t.buffer.detached === void 0 && t.buffer !== G.memory.buffer) && (t = new DataView(G.memory.buffer)), t;
|
|
1100
1100
|
}
|
|
1101
1101
|
function c(Q, A) {
|
|
1102
|
-
return Q = Q >>> 0,
|
|
1102
|
+
return Q = Q >>> 0, tA(Q, A);
|
|
1103
1103
|
}
|
|
1104
|
-
let
|
|
1105
|
-
function
|
|
1106
|
-
return (
|
|
1104
|
+
let O = null;
|
|
1105
|
+
function T() {
|
|
1106
|
+
return (O === null || O.byteLength === 0) && (O = new Uint8Array(G.memory.buffer)), O;
|
|
1107
1107
|
}
|
|
1108
1108
|
function K(Q, A) {
|
|
1109
1109
|
try {
|
|
1110
1110
|
return Q.apply(this, A);
|
|
1111
1111
|
} catch (g) {
|
|
1112
|
-
const I =
|
|
1113
|
-
|
|
1112
|
+
const I = W(g);
|
|
1113
|
+
G.__wbindgen_exn_store(I);
|
|
1114
1114
|
}
|
|
1115
1115
|
}
|
|
1116
1116
|
function q(Q) {
|
|
@@ -1129,7 +1129,7 @@ function pA(Q, A, g, I) {
|
|
|
1129
1129
|
--C.cnt === 0 && (C.dtor(C.a, C.b), C.a = 0, r.unregister(C));
|
|
1130
1130
|
}, r.register(B, C, C), B;
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1132
|
+
function Z(Q, A, g, I) {
|
|
1133
1133
|
const C = { a: Q, b: A, cnt: 1, dtor: g }, B = (...i) => {
|
|
1134
1134
|
C.cnt++;
|
|
1135
1135
|
const D = C.a;
|
|
@@ -1144,13 +1144,13 @@ function O(Q, A, g, I) {
|
|
|
1144
1144
|
--C.cnt === 0 && (C.dtor(C.a, C.b), C.a = 0, r.unregister(C));
|
|
1145
1145
|
}, r.register(B, C, C), B;
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1147
|
+
function V(Q, A, g) {
|
|
1148
1148
|
if (g === void 0) {
|
|
1149
1149
|
const D = z.encode(Q), N = A(D.length, 1) >>> 0;
|
|
1150
|
-
return
|
|
1150
|
+
return T().subarray(N, N + D.length).set(D), d = D.length, N;
|
|
1151
1151
|
}
|
|
1152
1152
|
let I = Q.length, C = A(I, 1) >>> 0;
|
|
1153
|
-
const B =
|
|
1153
|
+
const B = T();
|
|
1154
1154
|
let i = 0;
|
|
1155
1155
|
for (; i < I; i++) {
|
|
1156
1156
|
const D = Q.charCodeAt(i);
|
|
@@ -1159,21 +1159,21 @@ function j(Q, A, g) {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
if (i !== I) {
|
|
1161
1161
|
i !== 0 && (Q = Q.slice(i)), C = g(C, I, I = i + Q.length * 3, 1) >>> 0;
|
|
1162
|
-
const D =
|
|
1162
|
+
const D = T().subarray(C + i, C + I), N = z.encodeInto(Q, D);
|
|
1163
1163
|
i += N.written, C = g(C, I, i, 1) >>> 0;
|
|
1164
1164
|
}
|
|
1165
1165
|
return d = i, C;
|
|
1166
1166
|
}
|
|
1167
1167
|
function $(Q) {
|
|
1168
|
-
const A =
|
|
1169
|
-
return
|
|
1168
|
+
const A = G.__wbindgen_externrefs.get(Q);
|
|
1169
|
+
return G.__externref_table_dealloc(Q), A;
|
|
1170
1170
|
}
|
|
1171
|
-
let
|
|
1172
|
-
|
|
1171
|
+
let P = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
|
|
1172
|
+
P.decode();
|
|
1173
1173
|
const dA = 2146435072;
|
|
1174
|
-
let
|
|
1175
|
-
function
|
|
1176
|
-
return
|
|
1174
|
+
let u = 0;
|
|
1175
|
+
function tA(Q, A) {
|
|
1176
|
+
return u += A, u >= dA && (P = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }), P.decode(), u = A), P.decode(T().subarray(Q, Q + A));
|
|
1177
1177
|
}
|
|
1178
1178
|
const z = new TextEncoder();
|
|
1179
1179
|
"encodeInto" in z || (z.encodeInto = function(Q, A) {
|
|
@@ -1183,11 +1183,11 @@ const z = new TextEncoder();
|
|
|
1183
1183
|
written: g.length
|
|
1184
1184
|
};
|
|
1185
1185
|
});
|
|
1186
|
-
let d = 0,
|
|
1187
|
-
function
|
|
1188
|
-
return
|
|
1186
|
+
let d = 0, G;
|
|
1187
|
+
function xA(Q, A) {
|
|
1188
|
+
return G = Q.exports, t = null, O = null, G.__wbindgen_start(), G;
|
|
1189
1189
|
}
|
|
1190
|
-
async function
|
|
1190
|
+
async function VA(Q, A) {
|
|
1191
1191
|
if (typeof Response == "function" && Q instanceof Response) {
|
|
1192
1192
|
if (typeof WebAssembly.instantiateStreaming == "function")
|
|
1193
1193
|
try {
|
|
@@ -1214,21 +1214,21 @@ async function jA(Q, A) {
|
|
|
1214
1214
|
return !1;
|
|
1215
1215
|
}
|
|
1216
1216
|
}
|
|
1217
|
-
async function
|
|
1218
|
-
if (
|
|
1217
|
+
async function jA(Q) {
|
|
1218
|
+
if (G !== void 0) return G;
|
|
1219
1219
|
Q !== void 0 && (Object.getPrototypeOf(Q) === Object.prototype ? { module_or_path: Q } = Q : console.warn("using deprecated parameters for the initialization function; pass a single object instead")), Q === void 0 && (Q = new URL("", import.meta.url));
|
|
1220
|
-
const A =
|
|
1220
|
+
const A = hA();
|
|
1221
1221
|
(typeof Q == "string" || typeof Request == "function" && Q instanceof Request || typeof URL == "function" && Q instanceof URL) && (Q = fetch(Q));
|
|
1222
|
-
const { instance: g, module: I } = await
|
|
1223
|
-
return
|
|
1222
|
+
const { instance: g, module: I } = await VA(await Q, A);
|
|
1223
|
+
return xA(g);
|
|
1224
1224
|
}
|
|
1225
|
-
const
|
|
1225
|
+
const ZA = new URL("https://cdn.jsdelivr.net/npm/glassjar@0.3.1/dist/engine_bg.wasm"), WA = Object.freeze({
|
|
1226
1226
|
maxObjectBytes: 128 * 1024 * 1024,
|
|
1227
1227
|
maxEntries: 256,
|
|
1228
1228
|
maxMetadataBytes: 8 * 1024 * 1024,
|
|
1229
1229
|
maxEntryMetadataBytes: 1024 * 1024
|
|
1230
1230
|
});
|
|
1231
|
-
class
|
|
1231
|
+
class OA {
|
|
1232
1232
|
records = /* @__PURE__ */ new Map();
|
|
1233
1233
|
staged = /* @__PURE__ */ new Map();
|
|
1234
1234
|
stagingFailed = !1;
|
|
@@ -1238,7 +1238,7 @@ class TA {
|
|
|
1238
1238
|
oversized = 0;
|
|
1239
1239
|
limits;
|
|
1240
1240
|
constructor(A = {}) {
|
|
1241
|
-
this.limits = Object.freeze({ ...
|
|
1241
|
+
this.limits = Object.freeze({ ...WA, ...A });
|
|
1242
1242
|
for (const g of Object.values(this.limits))
|
|
1243
1243
|
if (!Number.isSafeInteger(g) || g < 0)
|
|
1244
1244
|
throw new RangeError("C++ cache limits must be nonnegative safe integers");
|
|
@@ -1288,7 +1288,7 @@ class TA {
|
|
|
1288
1288
|
if (this.stagingFailed) return !1;
|
|
1289
1289
|
const A = [...this.staged.values()];
|
|
1290
1290
|
for (const g of A) {
|
|
1291
|
-
if (!
|
|
1291
|
+
if (!TA(g.object)) return !1;
|
|
1292
1292
|
const I = await crypto.subtle.digest("SHA-256", g.object);
|
|
1293
1293
|
if (Array.from(
|
|
1294
1294
|
new Uint8Array(I),
|
|
@@ -1365,7 +1365,7 @@ class TA {
|
|
|
1365
1365
|
};
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
|
-
function
|
|
1368
|
+
function TA(Q) {
|
|
1369
1369
|
if (!WebAssembly.validate(Q) || Q.length < 8) return !1;
|
|
1370
1370
|
let A = 8, g = !1;
|
|
1371
1371
|
const I = () => {
|
|
@@ -1397,7 +1397,7 @@ function VA(Q) {
|
|
|
1397
1397
|
}
|
|
1398
1398
|
}
|
|
1399
1399
|
const U = /* @__PURE__ */ Symbol();
|
|
1400
|
-
function
|
|
1400
|
+
function h(Q) {
|
|
1401
1401
|
return Q instanceof Error ? {
|
|
1402
1402
|
type: "error",
|
|
1403
1403
|
error: { type: Q.constructor.name, message: Q.message }
|
|
@@ -1417,7 +1417,7 @@ class zA {
|
|
|
1417
1417
|
C.href = I, C.download = this.name, document.body.appendChild(C), C.click(), document.body.removeChild(C), URL.revokeObjectURL(I);
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
|
-
class fA extends
|
|
1420
|
+
class fA extends GA {
|
|
1421
1421
|
/**
|
|
1422
1422
|
* Access to internal properties of the debugger.
|
|
1423
1423
|
* These are put under a special symbol so that they cannot be accessed by
|
|
@@ -1465,23 +1465,23 @@ class fA extends MA {
|
|
|
1465
1465
|
}
|
|
1466
1466
|
}
|
|
1467
1467
|
const lA = "glassjar-wasm:";
|
|
1468
|
-
function
|
|
1468
|
+
function mA(Q, A) {
|
|
1469
1469
|
const g = new URL(String(Q), A);
|
|
1470
1470
|
if (g.protocol !== "https:" && g.protocol !== "http:")
|
|
1471
1471
|
throw new TypeError(`Engine Wasm must be served over http(s), not ${g.protocol}`);
|
|
1472
1472
|
return g.href;
|
|
1473
1473
|
}
|
|
1474
|
-
function
|
|
1474
|
+
function bA(Q) {
|
|
1475
1475
|
return new Worker(
|
|
1476
|
-
"" + new URL("assets/worker-
|
|
1476
|
+
"" + new URL("assets/worker-BgBM-gEP.js", import.meta.url).href,
|
|
1477
1477
|
{
|
|
1478
1478
|
type: "module",
|
|
1479
1479
|
name: Q?.name
|
|
1480
1480
|
}
|
|
1481
1481
|
);
|
|
1482
1482
|
}
|
|
1483
|
-
function
|
|
1484
|
-
return new
|
|
1483
|
+
function XA(Q) {
|
|
1484
|
+
return new bA(Q ? { name: lA + Q } : void 0);
|
|
1485
1485
|
}
|
|
1486
1486
|
const nA = "/dev/debugger-sh-host";
|
|
1487
1487
|
class wA {
|
|
@@ -1511,7 +1511,7 @@ function iA(Q) {
|
|
|
1511
1511
|
return AA(A);
|
|
1512
1512
|
}
|
|
1513
1513
|
}
|
|
1514
|
-
class
|
|
1514
|
+
class PA {
|
|
1515
1515
|
constructor(A) {
|
|
1516
1516
|
this.onFailure = A;
|
|
1517
1517
|
}
|
|
@@ -1612,7 +1612,7 @@ const rA = [
|
|
|
1612
1612
|
sysroot: "8745c6af23fd841fa507d0c73f6b6b8e8da1b4ec216a6339739a28b38ff7227b",
|
|
1613
1613
|
exceptions: "20986166552953de0e3ca5c1e9f341e7aec8b9ba54dcb244d0d2b2f9ca843ab4"
|
|
1614
1614
|
});
|
|
1615
|
-
function
|
|
1615
|
+
function MA(Q = "legacy") {
|
|
1616
1616
|
if (Q === "legacy") return { profile: Q, digests: n };
|
|
1617
1617
|
if (Q === "stock-certified-v1" && rA.length > 0)
|
|
1618
1618
|
return { profile: Q, digests: n };
|
|
@@ -1626,13 +1626,13 @@ class f {
|
|
|
1626
1626
|
this.#A = A, this.hashMs = g;
|
|
1627
1627
|
}
|
|
1628
1628
|
static async load(A, g, I, C = n.exceptions, B = "legacy") {
|
|
1629
|
-
const i =
|
|
1629
|
+
const i = MA(B);
|
|
1630
1630
|
if (A.length !== 2) throw new Error("Missing C++ toolchain assets");
|
|
1631
1631
|
let D;
|
|
1632
1632
|
const N = await Promise.allSettled(
|
|
1633
|
-
A.map(async (
|
|
1633
|
+
A.map(async (x) => {
|
|
1634
1634
|
try {
|
|
1635
|
-
const p = await fetch(
|
|
1635
|
+
const p = await fetch(x, { cache: "force-cache", signal: I });
|
|
1636
1636
|
if (!p.ok) throw new Error(`Cannot load C++ toolchain (${p.status})`);
|
|
1637
1637
|
return new Uint8Array(await p.arrayBuffer());
|
|
1638
1638
|
} catch (p) {
|
|
@@ -1642,17 +1642,17 @@ class f {
|
|
|
1642
1642
|
);
|
|
1643
1643
|
if (N[0].status === "rejected" || N[1].status === "rejected")
|
|
1644
1644
|
throw D?.error;
|
|
1645
|
-
const [y, J] = [N[0].value, N[1].value], [
|
|
1645
|
+
const [y, J] = [N[0].value, N[1].value], [S, Y] = await Promise.allSettled([
|
|
1646
1646
|
f.ingestOwned(y, J, !1, C),
|
|
1647
1647
|
g ? Promise.resolve().then(() => WebAssembly.compile(y)) : Promise.resolve(void 0)
|
|
1648
1648
|
]);
|
|
1649
|
-
if (
|
|
1650
|
-
const
|
|
1651
|
-
if (
|
|
1649
|
+
if (S.status === "rejected") throw S.reason;
|
|
1650
|
+
const L = S.value;
|
|
1651
|
+
if (L.#A.compilerHash !== i.digests.compiler || L.#A.sysrootHash !== i.digests.sysroot || L.#A.exceptionsHash !== i.digests.exceptions)
|
|
1652
1652
|
throw new Error("C++ toolchain integrity mismatch");
|
|
1653
1653
|
if (I?.aborted) throw new DOMException("Toolchain loading aborted", "AbortError");
|
|
1654
1654
|
if (Y.status === "rejected") throw Y.reason;
|
|
1655
|
-
return
|
|
1655
|
+
return L.#A.stockProfile = i.profile === "stock-certified-v1", L.#A.module = Y.value, L;
|
|
1656
1656
|
}
|
|
1657
1657
|
/** Captures even Buffer/subclass inputs before the first asynchronous boundary. */
|
|
1658
1658
|
static async fromBytes(A, g, I) {
|
|
@@ -1701,11 +1701,11 @@ async function oA(Q) {
|
|
|
1701
1701
|
const A = await crypto.subtle.digest("SHA-256", Q);
|
|
1702
1702
|
return Array.from(new Uint8Array(A), (g) => g.toString(16).padStart(2, "0")).join("");
|
|
1703
1703
|
}
|
|
1704
|
-
let
|
|
1704
|
+
let v, X;
|
|
1705
1705
|
class FA {
|
|
1706
1706
|
stdout = new NA(1);
|
|
1707
1707
|
stderr = new NA(2);
|
|
1708
|
-
stdin = new
|
|
1708
|
+
stdin = new H();
|
|
1709
1709
|
debugger;
|
|
1710
1710
|
lang;
|
|
1711
1711
|
scope;
|
|
@@ -1714,6 +1714,8 @@ class FA {
|
|
|
1714
1714
|
cppArtifacts;
|
|
1715
1715
|
hostDevice;
|
|
1716
1716
|
options;
|
|
1717
|
+
retain;
|
|
1718
|
+
idleTimeoutMs;
|
|
1717
1719
|
/** Absolute `EngineOptions.wasmUrl`, handed to each worker; unset uses the default. */
|
|
1718
1720
|
wasmUrl;
|
|
1719
1721
|
objects;
|
|
@@ -1742,12 +1744,12 @@ class FA {
|
|
|
1742
1744
|
latest;
|
|
1743
1745
|
cacheValidation;
|
|
1744
1746
|
static async create(A, g = {}) {
|
|
1745
|
-
const { wasmUrl: I, ...C } = g, B = I === void 0 ? void 0 :
|
|
1746
|
-
if (
|
|
1747
|
+
const { wasmUrl: I, ...C } = g, B = I === void 0 ? void 0 : mA(I, globalThis.location?.href), i = structuredClone(C), D = B ?? null;
|
|
1748
|
+
if (X !== void 0 && X !== D)
|
|
1747
1749
|
throw new Error("The engine Wasm is already loaded from a different wasmUrl");
|
|
1748
|
-
|
|
1749
|
-
throw
|
|
1750
|
-
}), await
|
|
1750
|
+
X = D, v ??= jA({ module_or_path: B ?? ZA }).catch((y) => {
|
|
1751
|
+
throw v = void 0, X = void 0, y;
|
|
1752
|
+
}), await v;
|
|
1751
1753
|
const N = new FA(A, i);
|
|
1752
1754
|
if (N.wasmUrl = B, A !== "c" && typeof window < "u" && typeof fetch < "u")
|
|
1753
1755
|
for (const y of QA(A))
|
|
@@ -1757,18 +1759,23 @@ class FA {
|
|
|
1757
1759
|
}
|
|
1758
1760
|
constructor(A, g) {
|
|
1759
1761
|
const I = g.cpp;
|
|
1760
|
-
|
|
1762
|
+
this.retain = g.retainWorker ?? I?.retainWorker ?? !0;
|
|
1763
|
+
const C = g.idleTimeoutMs ?? I?.idleTimeoutMs ?? 3e4;
|
|
1764
|
+
if (!Number.isSafeInteger(C) || C < 1 || C > 3e5)
|
|
1765
|
+
throw new RangeError("Worker idle timeout must be between 1 and 300000 milliseconds");
|
|
1766
|
+
if (this.idleTimeoutMs = C, I) {
|
|
1761
1767
|
if (A !== "c") throw new TypeError("C++ performance options require C/C++");
|
|
1762
1768
|
if (!I.scope?.projectId || !I.scope.accountId)
|
|
1763
1769
|
throw new TypeError("C++ performance options require project and account identity");
|
|
1764
|
-
const C = I.idleTimeoutMs ?? 3e4;
|
|
1765
|
-
if (!Number.isSafeInteger(C) || C < 1 || C > 3e5)
|
|
1766
|
-
throw new RangeError("Compiler idle timeout must be between 1 and 300000 milliseconds");
|
|
1767
1770
|
if (I.compilerLifetime !== void 0 && !["idle", "project"].includes(I.compilerLifetime))
|
|
1768
1771
|
throw new TypeError("Invalid compiler lifetime");
|
|
1769
|
-
|
|
1772
|
+
MA(I.toolchainProfile), this.scope = Object.freeze({ ...I.scope }), this.options = Object.freeze({ ...I, scope: this.scope, idleTimeoutMs: C });
|
|
1770
1773
|
}
|
|
1771
|
-
this.objects = new
|
|
1774
|
+
this.objects = new OA(typeof I?.objectCache == "object" ? I.objectCache : {}), this.debugger = new fA(), this.lang = A;
|
|
1775
|
+
}
|
|
1776
|
+
/** A retained worker reuses clang, compiled once on this thread and cloned to it. */
|
|
1777
|
+
get cacheCompilerModule() {
|
|
1778
|
+
return this.options?.cacheCompilerModule ?? this.retain;
|
|
1772
1779
|
}
|
|
1773
1780
|
get cacheStats() {
|
|
1774
1781
|
return structuredClone({
|
|
@@ -1790,7 +1797,7 @@ class FA {
|
|
|
1790
1797
|
compilerModuleCloned: this.compilerModuleCloned,
|
|
1791
1798
|
workerRetained: !!this.slot && !this.active,
|
|
1792
1799
|
workerRetirements: this.retirements,
|
|
1793
|
-
compilerModuleIdentityBytes: this.
|
|
1800
|
+
compilerModuleIdentityBytes: this.cacheCompilerModule ? this.toolchain?.compilerBytes ?? 0 : 0,
|
|
1794
1801
|
latest: this.active?.stats ?? this.latest
|
|
1795
1802
|
});
|
|
1796
1803
|
}
|
|
@@ -1850,7 +1857,7 @@ class FA {
|
|
|
1850
1857
|
/** Load compiler resources. Optional input validation never invokes Clang, links, or runs a guest. */
|
|
1851
1858
|
prepareCompiler(A) {
|
|
1852
1859
|
if (A?.validateCacheInputs !== void 0 && typeof A.validateCacheInputs != "boolean")
|
|
1853
|
-
return Promise.resolve(
|
|
1860
|
+
return Promise.resolve(h(new TypeError("Invalid compiler preparation options")));
|
|
1854
1861
|
const g = A?.validateCacheInputs === !0 && this.options?.toolchainProfile === "stock-certified-v1" && !!this.options?.objectCache && this.objects.limits.maxEntries > 0 && this.objects.limits.maxObjectBytes > 0 && this.objects.limits.maxMetadataBytes > 0 && this.objects.limits.maxEntryMetadataBytes > 0;
|
|
1855
1862
|
return this.submit(!0, !0, g);
|
|
1856
1863
|
}
|
|
@@ -1863,36 +1870,36 @@ class FA {
|
|
|
1863
1870
|
return this.submit(!0);
|
|
1864
1871
|
}
|
|
1865
1872
|
submit(A, g = !1, I = !1) {
|
|
1866
|
-
if (this.disposed) return Promise.resolve(
|
|
1873
|
+
if (this.disposed) return Promise.resolve(h(new Error("Engine is disposed")));
|
|
1867
1874
|
if (this.active || this.cancellationDraining)
|
|
1868
|
-
return Promise.resolve(
|
|
1875
|
+
return Promise.resolve(h(new Error("An engine job is already active")));
|
|
1869
1876
|
if (A && this.lang !== "c")
|
|
1870
|
-
return Promise.resolve(
|
|
1877
|
+
return Promise.resolve(h(new Error("Compile-only is supported for C/C++")));
|
|
1871
1878
|
this.cacheValidation = void 0;
|
|
1872
1879
|
const C = g && !I;
|
|
1873
1880
|
let B;
|
|
1874
1881
|
try {
|
|
1875
1882
|
const Y = C || !this.cppArtifacts ? null : { ...this.cppArtifacts };
|
|
1876
1883
|
if (Y?.cacheCertificate !== void 0) {
|
|
1877
|
-
const
|
|
1878
|
-
(typeof
|
|
1884
|
+
const L = Y.cacheCertificate;
|
|
1885
|
+
(typeof L != "string" || L.length > 1024 * 1024 || new TextEncoder().encode(L).byteLength > 1024 * 1024) && delete Y.cacheCertificate;
|
|
1879
1886
|
}
|
|
1880
1887
|
B = {
|
|
1881
1888
|
fs: C ? {} : structuredClone(this.fs),
|
|
1882
1889
|
binary_files: Object.fromEntries(
|
|
1883
|
-
Object.entries(C ? {} : this.binaryFiles).map(([
|
|
1884
|
-
|
|
1885
|
-
new Uint8Array(
|
|
1890
|
+
Object.entries(C ? {} : this.binaryFiles).map(([L, x]) => [
|
|
1891
|
+
L,
|
|
1892
|
+
new Uint8Array(x)
|
|
1886
1893
|
])
|
|
1887
1894
|
),
|
|
1888
1895
|
cpp_artifacts: structuredClone(Y)
|
|
1889
1896
|
};
|
|
1890
1897
|
} catch (Y) {
|
|
1891
|
-
return Promise.resolve(
|
|
1898
|
+
return Promise.resolve(h(Y));
|
|
1892
1899
|
}
|
|
1893
1900
|
const i = !A && this.debugger.enabled, D = A ? void 0 : this.hostDevice;
|
|
1894
1901
|
if (D !== void 0 && (typeof D != "function" || !["c", "python"].includes(this.lang)))
|
|
1895
|
-
return Promise.resolve(
|
|
1902
|
+
return Promise.resolve(h(new TypeError("Invalid host device configuration")));
|
|
1896
1903
|
clearTimeout(this.idleTimer), i && this.retireWorker(), this.stdin[U].clear();
|
|
1897
1904
|
const N = !!this.slot;
|
|
1898
1905
|
let y;
|
|
@@ -1900,7 +1907,7 @@ class FA {
|
|
|
1900
1907
|
y = Y;
|
|
1901
1908
|
});
|
|
1902
1909
|
this.promise = J;
|
|
1903
|
-
const
|
|
1910
|
+
const S = {
|
|
1904
1911
|
generation: this.generation,
|
|
1905
1912
|
scopeEpoch: this.scopeEpoch,
|
|
1906
1913
|
operationId: ++this.operationId,
|
|
@@ -1940,15 +1947,15 @@ class FA {
|
|
|
1940
1947
|
} : null
|
|
1941
1948
|
}
|
|
1942
1949
|
};
|
|
1943
|
-
this.objects.beginBatch(), this.active =
|
|
1950
|
+
this.objects.beginBatch(), this.active = S;
|
|
1944
1951
|
try {
|
|
1945
|
-
if (this.slot || this.makeWorker(), !this.current(
|
|
1952
|
+
if (this.slot || this.makeWorker(), !this.current(S)) return J;
|
|
1946
1953
|
const Y = this.slot;
|
|
1947
|
-
this.lang === "c" && !this.toolchain && this.ensureToolchain().catch((
|
|
1948
|
-
this.current(
|
|
1949
|
-
}), this.slot.ready && this.dispatch(
|
|
1954
|
+
this.lang === "c" && !this.toolchain && this.ensureToolchain().catch((L) => {
|
|
1955
|
+
this.current(S) && this.slot === Y && this.finish(S, h(L));
|
|
1956
|
+
}), this.slot.ready && this.dispatch(S);
|
|
1950
1957
|
} catch (Y) {
|
|
1951
|
-
this.finish(
|
|
1958
|
+
this.finish(S, h(Y));
|
|
1952
1959
|
}
|
|
1953
1960
|
return J;
|
|
1954
1961
|
}
|
|
@@ -1956,7 +1963,7 @@ class FA {
|
|
|
1956
1963
|
return this.active === A && !A.settled;
|
|
1957
1964
|
}
|
|
1958
1965
|
makeWorker() {
|
|
1959
|
-
const A =
|
|
1966
|
+
const A = XA(this.wasmUrl), g = { worker: A, ready: !1, remove: () => {
|
|
1960
1967
|
} };
|
|
1961
1968
|
this.slot = g;
|
|
1962
1969
|
const I = (i) => {
|
|
@@ -1969,7 +1976,7 @@ class FA {
|
|
|
1969
1976
|
}
|
|
1970
1977
|
if (!(!N || !this.current(N))) {
|
|
1971
1978
|
if (!g.ready && D.type === "error") {
|
|
1972
|
-
this.finish(N,
|
|
1979
|
+
this.finish(N, h(new Error(D.message)));
|
|
1973
1980
|
return;
|
|
1974
1981
|
}
|
|
1975
1982
|
if (!(D.operationId !== N.operationId || D.scopeEpoch !== N.scopeEpoch))
|
|
@@ -1977,7 +1984,7 @@ class FA {
|
|
|
1977
1984
|
if (D.type === "cpp_cache_eligibility") {
|
|
1978
1985
|
if (this.options?.toolchainProfile !== "stock-certified-v1" || N.prepareOnly && !N.validateCacheInputs)
|
|
1979
1986
|
return;
|
|
1980
|
-
const y = (
|
|
1987
|
+
const y = (S) => typeof S == "string" && /^[0-9a-f]{64}$/.test(S), J = D.eligible === !0 && y(D.certificate_sha256) && y(D.snapshot);
|
|
1981
1988
|
this.cacheValidation = {
|
|
1982
1989
|
eligible: J,
|
|
1983
1990
|
certificate: y(D.certificate_sha256) ? D.certificate_sha256 : void 0,
|
|
@@ -1996,7 +2003,7 @@ class FA {
|
|
|
1996
2003
|
}
|
|
1997
2004
|
});
|
|
1998
2005
|
else if (D.type === "error")
|
|
1999
|
-
this.finish(N,
|
|
2006
|
+
this.finish(N, h(new Error(D.message)));
|
|
2000
2007
|
else if (D.type === "cpp_cache_object" && D.generation === this.generation && N.generation === this.generation)
|
|
2001
2008
|
try {
|
|
2002
2009
|
this.objects.stage(D);
|
|
@@ -2005,11 +2012,11 @@ class FA {
|
|
|
2005
2012
|
}
|
|
2006
2013
|
else D.type === "cpp_cache_stats" && D.generation === N.generation ? N.stats.cache = D.stats : D.type === "cpp_cache_abandon" ? this.objects.abandonBatch() : D.type === "object_build_complete" ? N.publication ??= this.publishObjects(N, g) : D.type === "compiler_module_stats" && (N.stats.compilerModule = D);
|
|
2007
2014
|
} catch (y) {
|
|
2008
|
-
this.finish(N,
|
|
2015
|
+
this.finish(N, h(y));
|
|
2009
2016
|
}
|
|
2010
2017
|
}
|
|
2011
2018
|
}, C = (i) => {
|
|
2012
|
-
this.slot === g && (this.clearCaches(), this.active ? this.finish(this.active,
|
|
2019
|
+
this.slot === g && (this.clearCaches(), this.active ? this.finish(this.active, h(i.error ?? new Error(i.message))) : this.retireWorker());
|
|
2013
2020
|
}, B = () => C({ message: "Unreadable execution worker message" });
|
|
2014
2021
|
this.debugger[U].attach(A), A.addEventListener("message", I), A.addEventListener("error", C), A.addEventListener("messageerror", B), g.remove = () => {
|
|
2015
2022
|
A.removeEventListener("message", I), A.removeEventListener("error", C), A.removeEventListener("messageerror", B), this.debugger[U].detach(A);
|
|
@@ -2051,9 +2058,9 @@ class FA {
|
|
|
2051
2058
|
this.toolchainController = new AbortController();
|
|
2052
2059
|
const A = f.load(
|
|
2053
2060
|
QA("c"),
|
|
2054
|
-
|
|
2061
|
+
this.cacheCompilerModule,
|
|
2055
2062
|
this.toolchainController.signal,
|
|
2056
|
-
|
|
2063
|
+
SA(),
|
|
2057
2064
|
this.options?.toolchainProfile
|
|
2058
2065
|
);
|
|
2059
2066
|
return this.toolchainLoading = A, this.initializing.add(A), A.then(
|
|
@@ -2083,7 +2090,7 @@ class FA {
|
|
|
2083
2090
|
}
|
|
2084
2091
|
i === this.generation && (this.toolchainIdentity && this.toolchainIdentity !== N.identity && (this.objects.clear(), A.start.cpp_cache = null), this.toolchain !== N && (this.toolchainIngestions++, this.toolchainHashCount += N.hashCount, this.toolchainHashMs += N.hashMs), this.toolchainIdentity = N.identity, this.toolchain = N, this.toolchainLoading === D && (this.toolchainLoading = void 0)), g.toolchain !== N && (this.compilerModuleCloned = N.configure(g.worker, {
|
|
2085
2092
|
type: "configure_cpp",
|
|
2086
|
-
cacheCompilerModule:
|
|
2093
|
+
cacheCompilerModule: this.cacheCompilerModule
|
|
2087
2094
|
}), g.toolchain = N);
|
|
2088
2095
|
}
|
|
2089
2096
|
if (!this.current(A) || this.slot !== g) return;
|
|
@@ -2091,12 +2098,12 @@ class FA {
|
|
|
2091
2098
|
A.stats.workerReadyMs = performance.now() - A.startedAt;
|
|
2092
2099
|
const C = (B) => this.current(A) && B.scopeEpoch === A.scopeEpoch && B.operationId === A.operationId;
|
|
2093
2100
|
if (this.stdout[U].attach(I, C), this.stderr[U].attach(I, C), A.prepareOnly || this.debugger[U].beginRun(), A.opener) {
|
|
2094
|
-
if (A.device = new
|
|
2101
|
+
if (A.device = new PA((B) => this.finish(A, h(B))), A.device.attach(I), A.device.open(A.opener), !this.current(A)) return;
|
|
2095
2102
|
A.start.host_device = A.device.workerStart;
|
|
2096
2103
|
}
|
|
2097
2104
|
this.current(A) && (I.postMessage(A.start), A.start.fs = {}, A.start.binary_files = {}, A.start.cpp_artifacts = null, A.start.cpp_cache = null);
|
|
2098
2105
|
} catch (I) {
|
|
2099
|
-
this.current(A) && (this.toolchainLoading = void 0, this.finish(A,
|
|
2106
|
+
this.current(A) && (this.toolchainLoading = void 0, this.finish(A, h(I)));
|
|
2100
2107
|
}
|
|
2101
2108
|
}
|
|
2102
2109
|
finish(A, g) {
|
|
@@ -2105,15 +2112,15 @@ class FA {
|
|
|
2105
2112
|
const I = this.slot?.worker;
|
|
2106
2113
|
I && (this.stdout[U].detach(I), this.stderr[U].detach(I));
|
|
2107
2114
|
const C = A.device?.close();
|
|
2108
|
-
C && (g =
|
|
2115
|
+
C && (g = h(C));
|
|
2109
2116
|
const B = g.type === "completed" && g.exitCode === 0 && !A.debug && A.generation === this.generation && !this.disposed;
|
|
2110
2117
|
if (A.generation === this.generation)
|
|
2111
2118
|
for (const i of A.stats.cache?.invalid_sources ?? []) this.objects.delete(i);
|
|
2112
2119
|
if (B)
|
|
2113
2120
|
for (const i of A.stats.cache?.hit_sources ?? []) this.objects.touch(i);
|
|
2114
|
-
this.objects.discardBatch(), this.latest = A.stats, this.stdin[U].clear(), (!B || !this.
|
|
2121
|
+
this.objects.discardBatch(), this.latest = A.stats, this.stdin[U].clear(), (!B || !this.retain) && this.retireWorker(), !this.disposed && A.cacheEpoch === this.generation && (this.slot || this.toolchain && this.cacheCompilerModule) && this.options?.compilerLifetime !== "project" && (this.idleTimer = setTimeout(() => {
|
|
2115
2122
|
this.retireWorker(), this.toolchain = void 0, this.toolchainLoading = void 0;
|
|
2116
|
-
}, this.
|
|
2123
|
+
}, this.idleTimeoutMs)), !this.retain && !this.cacheCompilerModule && (this.toolchain = void 0), A.cacheEpoch !== this.generation && (this.toolchainController?.abort(), this.toolchainLoading = void 0), this.active = void 0, this.promise = void 0, this.flushReleases(), A.resolve(g);
|
|
2117
2124
|
}
|
|
2118
2125
|
retireWorker() {
|
|
2119
2126
|
clearTimeout(this.idleTimer);
|
|
@@ -2121,7 +2128,7 @@ class FA {
|
|
|
2121
2128
|
A && (this.slot = void 0, A.remove(), this.stdout[U].detach(A.worker), this.stderr[U].detach(A.worker), A.worker.onerror = (g) => g.preventDefault(), A.worker.terminate(), this.retirements++);
|
|
2122
2129
|
}
|
|
2123
2130
|
}
|
|
2124
|
-
class NA extends
|
|
2131
|
+
class NA extends GA {
|
|
2125
2132
|
constructor(A) {
|
|
2126
2133
|
super(), this.mode = A, this.callback = ((g) => {
|
|
2127
2134
|
const I = g.data;
|
|
@@ -2143,7 +2150,7 @@ class NA extends MA {
|
|
|
2143
2150
|
A.removeEventListener("message", this.callback);
|
|
2144
2151
|
}
|
|
2145
2152
|
}
|
|
2146
|
-
class
|
|
2153
|
+
class H {
|
|
2147
2154
|
/**
|
|
2148
2155
|
* Ring buffer to store stdin data.
|
|
2149
2156
|
*
|
|
@@ -2153,17 +2160,17 @@ class a {
|
|
|
2153
2160
|
static BUFFER_SIZE = 2048;
|
|
2154
2161
|
static HEADER_SIZE = 8;
|
|
2155
2162
|
// 2 x i32
|
|
2156
|
-
static DATA_SIZE =
|
|
2163
|
+
static DATA_SIZE = H.BUFFER_SIZE - H.HEADER_SIZE;
|
|
2157
2164
|
static READ_IDX = 0;
|
|
2158
2165
|
static WRITE_IDX = 1;
|
|
2159
2166
|
static encoder = new TextEncoder();
|
|
2160
|
-
buffer = new SharedArrayBuffer(
|
|
2167
|
+
buffer = new SharedArrayBuffer(H.BUFFER_SIZE);
|
|
2161
2168
|
generation = 0;
|
|
2162
2169
|
indices;
|
|
2163
2170
|
data;
|
|
2164
2171
|
[U];
|
|
2165
2172
|
constructor() {
|
|
2166
|
-
this.indices = new Int32Array(this.buffer, 0, 2), this.data = new Int8Array(this.buffer,
|
|
2173
|
+
this.indices = new Int32Array(this.buffer, 0, 2), this.data = new Int8Array(this.buffer, H.HEADER_SIZE);
|
|
2167
2174
|
const A = () => this.buffer;
|
|
2168
2175
|
this[U] = {
|
|
2169
2176
|
clear: this.clear.bind(this),
|
|
@@ -2173,14 +2180,14 @@ class a {
|
|
|
2173
2180
|
};
|
|
2174
2181
|
}
|
|
2175
2182
|
clear() {
|
|
2176
|
-
this.generation++, Atomics.notify(this.indices,
|
|
2183
|
+
this.generation++, Atomics.notify(this.indices, H.READ_IDX), this.buffer = new SharedArrayBuffer(H.BUFFER_SIZE), this.indices = new Int32Array(this.buffer, 0, 2), this.data = new Int8Array(this.buffer, H.HEADER_SIZE);
|
|
2177
2184
|
}
|
|
2178
2185
|
async write(A) {
|
|
2179
|
-
const g = typeof A == "string" ?
|
|
2186
|
+
const g = typeof A == "string" ? H.encoder.encode(A) : A;
|
|
2180
2187
|
return this.writeBytes(g);
|
|
2181
2188
|
}
|
|
2182
2189
|
async writeBytes(A) {
|
|
2183
|
-
const { DATA_SIZE: g, READ_IDX: I, WRITE_IDX: C } =
|
|
2190
|
+
const { DATA_SIZE: g, READ_IDX: I, WRITE_IDX: C } = H;
|
|
2184
2191
|
let B = 0;
|
|
2185
2192
|
const i = this.generation;
|
|
2186
2193
|
for (; B < A.length && i === this.generation; ) {
|
|
@@ -2202,6 +2209,6 @@ export {
|
|
|
2202
2209
|
fA as Debugger,
|
|
2203
2210
|
FA as Engine,
|
|
2204
2211
|
nA as HOST_DEVICE_PATH,
|
|
2205
|
-
|
|
2212
|
+
H as Stdin,
|
|
2206
2213
|
NA as Stdout
|
|
2207
2214
|
};
|