glassjar 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/glassjar.js CHANGED
@@ -1,19 +1,19 @@
1
- function OA(Q) {
1
+ function dA(Q) {
2
2
  return Q && Q.__esModule && Object.prototype.hasOwnProperty.call(Q, "default") ? Q.default : Q;
3
3
  }
4
- var e = { exports: {} }, FA;
5
- function xA() {
6
- if (FA) return e.exports;
4
+ var v = { exports: {} }, FA;
5
+ function jA() {
6
+ if (FA) return v.exports;
7
7
  FA = 1;
8
- var Q = typeof Reflect == "object" ? Reflect : null, A = Q && typeof Q.apply == "function" ? Q.apply : function(i, F, M) {
9
- return Function.prototype.apply.call(i, F, M);
10
- }, I;
11
- Q && typeof Q.ownKeys == "function" ? I = Q.ownKeys : Object.getOwnPropertySymbols ? I = function(i) {
8
+ var Q = typeof Reflect == "object" ? Reflect : null, A = Q && typeof Q.apply == "function" ? Q.apply : function(i, F, k) {
9
+ return Function.prototype.apply.call(i, F, k);
10
+ }, g;
11
+ Q && typeof Q.ownKeys == "function" ? g = Q.ownKeys : Object.getOwnPropertySymbols ? g = function(i) {
12
12
  return Object.getOwnPropertyNames(i).concat(Object.getOwnPropertySymbols(i));
13
- } : I = function(i) {
13
+ } : g = function(i) {
14
14
  return Object.getOwnPropertyNames(i);
15
15
  };
16
- function g(o) {
16
+ function I(o) {
17
17
  console && console.warn && console.warn(o);
18
18
  }
19
19
  var C = Number.isNaN || function(i) {
@@ -22,7 +22,7 @@ function xA() {
22
22
  function B() {
23
23
  B.init.call(this);
24
24
  }
25
- e.exports = B, e.exports.once = s, B.EventEmitter = B, B.prototype._events = void 0, B.prototype._eventsCount = 0, B.prototype._maxListeners = void 0;
25
+ v.exports = B, v.exports.once = s, B.EventEmitter = B, B.prototype._events = void 0, B.prototype._eventsCount = 0, B.prototype._maxListeners = void 0;
26
26
  var E = 10;
27
27
  function D(o) {
28
28
  if (typeof o != "function")
@@ -51,18 +51,18 @@ function xA() {
51
51
  B.prototype.getMaxListeners = function() {
52
52
  return w(this);
53
53
  }, B.prototype.emit = function(i) {
54
- for (var F = [], M = 1; M < arguments.length; M++) F.push(arguments[M]);
55
- var y = i === "error", S = this._events;
54
+ for (var F = [], k = 1; k < arguments.length; k++) F.push(arguments[k]);
55
+ var K = i === "error", S = this._events;
56
56
  if (S !== void 0)
57
- y = y && S.error === void 0;
58
- else if (!y)
57
+ K = K && S.error === void 0;
58
+ else if (!K)
59
59
  return !1;
60
- if (y) {
60
+ if (K) {
61
61
  var Y;
62
62
  if (F.length > 0 && (Y = F[0]), Y instanceof Error)
63
63
  throw Y;
64
- var p = new Error("Unhandled error." + (Y ? " (" + Y.message + ")" : ""));
65
- throw p.context = Y, p;
64
+ var d = new Error("Unhandled error." + (Y ? " (" + Y.message + ")" : ""));
65
+ throw d.context = Y, d;
66
66
  }
67
67
  var t = S[i];
68
68
  if (t === void 0)
@@ -70,22 +70,22 @@ function xA() {
70
70
  if (typeof t == "function")
71
71
  A(t, this, F);
72
72
  else
73
- for (var NA = t.length, pA = R(t, NA), M = 0; M < NA; ++M)
74
- A(pA[M], this, F);
73
+ for (var NA = t.length, pA = U(t, NA), k = 0; k < NA; ++k)
74
+ A(pA[k], this, F);
75
75
  return !0;
76
76
  };
77
- function N(o, i, F, M) {
78
- var y, S, Y;
77
+ function N(o, i, F, k) {
78
+ var K, S, Y;
79
79
  if (D(F), S = o._events, S === void 0 ? (S = o._events = /* @__PURE__ */ Object.create(null), o._eventsCount = 0) : (S.newListener !== void 0 && (o.emit(
80
80
  "newListener",
81
81
  i,
82
82
  F.listener ? F.listener : F
83
83
  ), S = o._events), Y = S[i]), Y === void 0)
84
84
  Y = S[i] = F, ++o._eventsCount;
85
- else if (typeof Y == "function" ? Y = S[i] = M ? [F, Y] : [Y, F] : M ? Y.unshift(F) : Y.push(F), y = w(o), y > 0 && Y.length > y && !Y.warned) {
85
+ else if (typeof Y == "function" ? Y = S[i] = k ? [F, Y] : [Y, F] : k ? Y.unshift(F) : Y.push(F), K = w(o), K > 0 && Y.length > K && !Y.warned) {
86
86
  Y.warned = !0;
87
- var p = new Error("Possible EventEmitter memory leak detected. " + Y.length + " " + String(i) + " listeners added. Use emitter.setMaxListeners() to increase limit");
88
- p.name = "MaxListenersExceededWarning", p.emitter = o, p.type = i, p.count = Y.length, g(p);
87
+ var d = new Error("Possible EventEmitter memory leak detected. " + Y.length + " " + String(i) + " listeners added. Use emitter.setMaxListeners() to increase limit");
88
+ d.name = "MaxListenersExceededWarning", d.emitter = o, d.type = i, d.count = Y.length, I(d);
89
89
  }
90
90
  return o;
91
91
  }
@@ -94,71 +94,71 @@ function xA() {
94
94
  }, B.prototype.on = B.prototype.addListener, B.prototype.prependListener = function(i, F) {
95
95
  return N(this, i, F, !0);
96
96
  };
97
- function k() {
97
+ function G() {
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 U(o, i, F) {
102
- var M = { fired: !1, wrapFn: void 0, target: o, type: i, listener: F }, y = k.bind(M);
103
- return y.listener = F, M.wrapFn = y, y;
101
+ function R(o, i, F) {
102
+ var k = { fired: !1, wrapFn: void 0, target: o, type: i, listener: F }, K = G.bind(k);
103
+ return K.listener = F, k.wrapFn = K, K;
104
104
  }
105
105
  B.prototype.once = function(i, F) {
106
- return D(F), this.on(i, U(this, i, F)), this;
106
+ return D(F), this.on(i, R(this, i, F)), this;
107
107
  }, B.prototype.prependOnceListener = function(i, F) {
108
- return D(F), this.prependListener(i, U(this, i, F)), this;
108
+ return D(F), this.prependListener(i, R(this, i, F)), this;
109
109
  }, B.prototype.removeListener = function(i, F) {
110
- var M, y, S, Y, p;
111
- if (D(F), y = this._events, y === void 0)
110
+ var k, K, S, Y, d;
111
+ if (D(F), K = this._events, K === void 0)
112
112
  return this;
113
- if (M = y[i], M === void 0)
113
+ if (k = K[i], k === void 0)
114
114
  return this;
115
- if (M === F || M.listener === F)
116
- --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete y[i], y.removeListener && this.emit("removeListener", i, M.listener || F));
117
- else if (typeof M != "function") {
118
- for (S = -1, Y = M.length - 1; Y >= 0; Y--)
119
- if (M[Y] === F || M[Y].listener === F) {
120
- p = M[Y].listener, S = Y;
115
+ if (k === F || k.listener === F)
116
+ --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete K[i], K.removeListener && this.emit("removeListener", i, k.listener || F));
117
+ else if (typeof k != "function") {
118
+ for (S = -1, Y = k.length - 1; Y >= 0; Y--)
119
+ if (k[Y] === F || k[Y].listener === F) {
120
+ d = k[Y].listener, S = Y;
121
121
  break;
122
122
  }
123
123
  if (S < 0)
124
124
  return this;
125
- S === 0 ? M.shift() : H(M, S), M.length === 1 && (y[i] = M[0]), y.removeListener !== void 0 && this.emit("removeListener", i, p || F);
125
+ S === 0 ? k.shift() : a(k, S), k.length === 1 && (K[i] = k[0]), K.removeListener !== void 0 && this.emit("removeListener", i, d || F);
126
126
  }
127
127
  return this;
128
128
  }, B.prototype.off = B.prototype.removeListener, B.prototype.removeAllListeners = function(i) {
129
- var F, M, y;
130
- if (M = this._events, M === void 0)
129
+ var F, k, K;
130
+ if (k = this._events, k === void 0)
131
131
  return this;
132
- if (M.removeListener === void 0)
133
- return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : M[i] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete M[i]), this;
132
+ if (k.removeListener === void 0)
133
+ return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : k[i] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete k[i]), this;
134
134
  if (arguments.length === 0) {
135
- var S = Object.keys(M), Y;
136
- for (y = 0; y < S.length; ++y)
137
- Y = S[y], Y !== "removeListener" && this.removeAllListeners(Y);
135
+ var S = Object.keys(k), Y;
136
+ for (K = 0; K < S.length; ++K)
137
+ Y = S[K], Y !== "removeListener" && this.removeAllListeners(Y);
138
138
  return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
139
139
  }
140
- if (F = M[i], typeof F == "function")
140
+ if (F = k[i], typeof F == "function")
141
141
  this.removeListener(i, F);
142
142
  else if (F !== void 0)
143
- for (y = F.length - 1; y >= 0; y--)
144
- this.removeListener(i, F[y]);
143
+ for (K = F.length - 1; K >= 0; K--)
144
+ this.removeListener(i, F[K]);
145
145
  return this;
146
146
  };
147
147
  function h(o, i, F) {
148
- var M = o._events;
149
- if (M === void 0)
148
+ var k = o._events;
149
+ if (k === void 0)
150
150
  return [];
151
- var y = M[i];
152
- return y === void 0 ? [] : typeof y == "function" ? F ? [y.listener || y] : [y] : F ? j(y) : R(y, y.length);
151
+ var K = k[i];
152
+ return K === void 0 ? [] : typeof K == "function" ? F ? [K.listener || K] : [K] : F ? O(K) : U(K, K.length);
153
153
  }
154
154
  B.prototype.listeners = function(i) {
155
155
  return h(this, i, !0);
156
156
  }, B.prototype.rawListeners = function(i) {
157
157
  return h(this, i, !1);
158
158
  }, B.listenerCount = function(o, i) {
159
- return typeof o.listenerCount == "function" ? o.listenerCount(i) : K.call(o, i);
160
- }, B.prototype.listenerCount = K;
161
- function K(o) {
159
+ return typeof o.listenerCount == "function" ? o.listenerCount(i) : y.call(o, i);
160
+ }, B.prototype.listenerCount = y;
161
+ function y(o) {
162
162
  var i = this._events;
163
163
  if (i !== void 0) {
164
164
  var F = i[o];
@@ -170,59 +170,59 @@ function xA() {
170
170
  return 0;
171
171
  }
172
172
  B.prototype.eventNames = function() {
173
- return this._eventsCount > 0 ? I(this._events) : [];
173
+ return this._eventsCount > 0 ? g(this._events) : [];
174
174
  };
175
- function R(o, i) {
176
- for (var F = new Array(i), M = 0; M < i; ++M)
177
- F[M] = o[M];
175
+ function U(o, i) {
176
+ for (var F = new Array(i), k = 0; k < i; ++k)
177
+ F[k] = o[k];
178
178
  return F;
179
179
  }
180
- function H(o, i) {
180
+ function a(o, i) {
181
181
  for (; i + 1 < o.length; i++)
182
182
  o[i] = o[i + 1];
183
183
  o.pop();
184
184
  }
185
- function j(o) {
185
+ function O(o) {
186
186
  for (var i = new Array(o.length), F = 0; F < i.length; ++F)
187
187
  i[F] = o[F].listener || o[F];
188
188
  return i;
189
189
  }
190
190
  function s(o, i) {
191
- return new Promise(function(F, M) {
192
- function y(Y) {
193
- o.removeListener(i, S), M(Y);
191
+ return new Promise(function(F, k) {
192
+ function K(Y) {
193
+ o.removeListener(i, S), k(Y);
194
194
  }
195
195
  function S() {
196
- typeof o.removeListener == "function" && o.removeListener("error", y), F([].slice.call(arguments));
196
+ typeof o.removeListener == "function" && o.removeListener("error", K), F([].slice.call(arguments));
197
197
  }
198
- V(o, i, S, { once: !0 }), i !== "error" && u(o, y, { once: !0 });
198
+ T(o, i, S, { once: !0 }), i !== "error" && u(o, K, { once: !0 });
199
199
  });
200
200
  }
201
201
  function u(o, i, F) {
202
- typeof o.on == "function" && V(o, "error", i, F);
202
+ typeof o.on == "function" && T(o, "error", i, F);
203
203
  }
204
- function V(o, i, F, M) {
204
+ function T(o, i, F, k) {
205
205
  if (typeof o.on == "function")
206
- M.once ? o.once(i, F) : o.on(i, F);
206
+ k.once ? o.once(i, F) : o.on(i, F);
207
207
  else if (typeof o.addEventListener == "function")
208
- o.addEventListener(i, function y(S) {
209
- M.once && o.removeEventListener(i, y), F(S);
208
+ o.addEventListener(i, function K(S) {
209
+ k.once && o.removeEventListener(i, K), F(S);
210
210
  });
211
211
  else
212
212
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof o);
213
213
  }
214
- return e.exports;
214
+ return v.exports;
215
215
  }
216
- var jA = xA();
217
- const cA = /* @__PURE__ */ OA(jA);
216
+ var OA = jA();
217
+ const cA = /* @__PURE__ */ dA(OA);
218
218
  class EA {
219
219
  __destroy_into_raw() {
220
220
  const A = this.__wbg_ptr;
221
- return this.__wbg_ptr = 0, kA.unregister(this), A;
221
+ return this.__wbg_ptr = 0, GA.unregister(this), A;
222
222
  }
223
223
  free() {
224
224
  const A = this.__destroy_into_raw();
225
- G.__wbg_dapadapter_free(A, 0);
225
+ M.__wbg_dapadapter_free(A, 0);
226
226
  }
227
227
  /**
228
228
  * Attaches a worker to the adapter.
@@ -233,80 +233,80 @@ class EA {
233
233
  * @param {Worker} worker
234
234
  */
235
235
  attach(A) {
236
- G.dapadapter_attach(this.__wbg_ptr, A);
236
+ M.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
- G.dapadapter_detach(this.__wbg_ptr);
242
+ M.dapadapter_detach(this.__wbg_ptr);
243
243
  }
244
244
  constructor() {
245
- const A = G.dapadapter_new();
246
- return this.__wbg_ptr = A >>> 0, kA.register(this, this.__wbg_ptr, this), this;
245
+ const A = M.dapadapter_new();
246
+ return this.__wbg_ptr = A >>> 0, GA.register(this, this.__wbg_ptr, this), this;
247
247
  }
248
248
  /**
249
249
  * @param {Function} callback
250
250
  */
251
251
  on(A) {
252
- G.dapadapter_on(this.__wbg_ptr, A);
252
+ M.dapadapter_on(this.__wbg_ptr, A);
253
253
  }
254
254
  resetRun() {
255
- G.dapadapter_resetRun(this.__wbg_ptr);
255
+ M.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 G.dapadapter_sendMessage(this.__wbg_ptr, A);
262
+ return M.dapadapter_sendMessage(this.__wbg_ptr, A);
263
263
  }
264
264
  /**
265
265
  * @param {boolean} value
266
266
  */
267
267
  setFilterInternals(A) {
268
- G.dapadapter_setFilterInternals(this.__wbg_ptr, A);
268
+ M.dapadapter_setFilterInternals(this.__wbg_ptr, A);
269
269
  }
270
270
  }
271
271
  Symbol.dispose && (EA.prototype[Symbol.dispose] = EA.prototype.free);
272
272
  class n {
273
273
  static __wrap(A) {
274
274
  A = A >>> 0;
275
- const I = Object.create(n.prototype);
276
- return I.__wbg_ptr = A, KA.register(I, I.__wbg_ptr, I), I;
275
+ const g = Object.create(n.prototype);
276
+ return g.__wbg_ptr = A, yA.register(g, g.__wbg_ptr, g), g;
277
277
  }
278
278
  __destroy_into_raw() {
279
279
  const A = this.__wbg_ptr;
280
- return this.__wbg_ptr = 0, KA.unregister(this), A;
280
+ return this.__wbg_ptr = 0, yA.unregister(this), A;
281
281
  }
282
282
  free() {
283
283
  const A = this.__destroy_into_raw();
284
- G.__wbg_trap_free(A, 0);
284
+ M.__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
- G.trap___wbg_wasmer_trap();
291
+ M.trap___wbg_wasmer_trap();
292
292
  }
293
293
  }
294
294
  Symbol.dispose && (n.prototype[Symbol.dispose] = n.prototype.free);
295
- function dA() {
295
+ function xA() {
296
296
  let Q, A;
297
297
  try {
298
- const I = G.cpp_exception_hash();
299
- return Q = I[0], A = I[1], q(I[0], I[1]);
298
+ const g = M.cpp_exception_hash();
299
+ return Q = g[0], A = g[1], p(g[0], g[1]);
300
300
  } finally {
301
- G.__wbindgen_free(Q, A, 1);
301
+ M.__wbindgen_free(Q, A, 1);
302
302
  }
303
303
  }
304
- function GA(Q) {
305
- const A = T(Q, G.__wbindgen_malloc, G.__wbindgen_realloc), I = d, g = G.prefetch_urls(A, I);
306
- var C = lA(g[0], g[1]).slice();
307
- return G.__wbindgen_free(g[0], g[1] * 4, 4), C;
304
+ function MA(Q) {
305
+ const A = Z(Q, M.__wbindgen_malloc, M.__wbindgen_realloc), g = x, I = M.prefetch_urls(A, g);
306
+ var C = lA(I[0], I[1]).slice();
307
+ return M.__wbindgen_free(I[0], I[1] * 4, 4), C;
308
308
  }
309
- function WA() {
309
+ function VA() {
310
310
  return {
311
311
  __proto__: null,
312
312
  "./engine_bg.js": {
@@ -314,33 +314,33 @@ function WA() {
314
314
  __wbg_BigInt_b7bbccdff258c9f2: function(A) {
315
315
  return BigInt(A);
316
316
  },
317
- __wbg_Error_8c4e43fe74559d73: function(A, I) {
318
- return Error(q(A, I));
317
+ __wbg_Error_8c4e43fe74559d73: function(A, g) {
318
+ return Error(p(A, g));
319
319
  },
320
320
  __wbg_Number_04624de7d0e8332d: function(A) {
321
321
  return Number(A);
322
322
  },
323
- __wbg_String_8f0eb39a4a4c2f66: function(A, I) {
324
- const g = String(I), C = T(g, G.__wbindgen_malloc, G.__wbindgen_realloc), B = d;
325
- a().setInt32(A + 4, B, !0), a().setInt32(A + 0, C, !0);
323
+ __wbg_String_8f0eb39a4a4c2f66: function(A, g) {
324
+ const I = String(g), C = Z(I, M.__wbindgen_malloc, M.__wbindgen_realloc), B = x;
325
+ H().setInt32(A + 4, B, !0), H().setInt32(A + 0, C, !0);
326
326
  },
327
- __wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2: function(A, I) {
328
- const g = I, C = typeof g == "bigint" ? g : void 0;
329
- a().setBigInt64(A + 8, x(C) ? BigInt(0) : C, !0), a().setInt32(A + 0, !x(C), !0);
327
+ __wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2: function(A, g) {
328
+ const I = g, C = typeof I == "bigint" ? I : void 0;
329
+ H().setBigInt64(A + 8, j(C) ? BigInt(0) : C, !0), H().setInt32(A + 0, !j(C), !0);
330
330
  },
331
331
  __wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(A) {
332
- const I = A, g = typeof I == "boolean" ? I : void 0;
333
- return x(g) ? 16777215 : g ? 1 : 0;
332
+ const g = A, I = typeof g == "boolean" ? g : void 0;
333
+ return j(I) ? 16777215 : I ? 1 : 0;
334
334
  },
335
- __wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(A, I) {
336
- const g = DA(I), C = T(g, G.__wbindgen_malloc, G.__wbindgen_realloc), B = d;
337
- a().setInt32(A + 4, B, !0), a().setInt32(A + 0, C, !0);
335
+ __wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(A, g) {
336
+ const I = DA(g), C = Z(I, M.__wbindgen_malloc, M.__wbindgen_realloc), B = x;
337
+ H().setInt32(A + 4, B, !0), H().setInt32(A + 0, C, !0);
338
338
  },
339
339
  __wbg___wbindgen_function_table_5ae7216dfcbcc506: function() {
340
- return G.__wbindgen_export;
340
+ return M.__wbindgen_export;
341
341
  },
342
- __wbg___wbindgen_in_47fa6863be6f2f25: function(A, I) {
343
- return A in I;
342
+ __wbg___wbindgen_in_47fa6863be6f2f25: function(A, g) {
343
+ return A in g;
344
344
  },
345
345
  __wbg___wbindgen_is_bigint_31b12575b56f32fc: function(A) {
346
346
  return typeof A == "bigint";
@@ -349,8 +349,8 @@ function WA() {
349
349
  return typeof A == "function";
350
350
  },
351
351
  __wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(A) {
352
- const I = A;
353
- return typeof I == "object" && I !== null;
352
+ const g = A;
353
+ return typeof g == "object" && g !== null;
354
354
  },
355
355
  __wbg___wbindgen_is_string_cd444516edc5b180: function(A) {
356
356
  return typeof A == "string";
@@ -358,52 +358,52 @@ function WA() {
358
358
  __wbg___wbindgen_is_undefined_9e4d92534c42d778: function(A) {
359
359
  return A === void 0;
360
360
  },
361
- __wbg___wbindgen_jsval_eq_11888390b0186270: function(A, I) {
362
- return A === I;
361
+ __wbg___wbindgen_jsval_eq_11888390b0186270: function(A, g) {
362
+ return A === g;
363
363
  },
364
- __wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811: function(A, I) {
365
- return A == I;
364
+ __wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811: function(A, g) {
365
+ return A == g;
366
366
  },
367
- __wbg___wbindgen_lt_bb59cc3d23526e0d: function(A, I) {
368
- return A < I;
367
+ __wbg___wbindgen_lt_bb59cc3d23526e0d: function(A, g) {
368
+ return A < g;
369
369
  },
370
370
  __wbg___wbindgen_neg_6b4d356dff49dcc6: function(A) {
371
371
  return -A;
372
372
  },
373
- __wbg___wbindgen_number_get_8ff4255516ccad3e: function(A, I) {
374
- const g = I, C = typeof g == "number" ? g : void 0;
375
- a().setFloat64(A + 8, x(C) ? 0 : C, !0), a().setInt32(A + 0, !x(C), !0);
373
+ __wbg___wbindgen_number_get_8ff4255516ccad3e: function(A, g) {
374
+ const I = g, C = typeof I == "number" ? I : void 0;
375
+ H().setFloat64(A + 8, j(C) ? 0 : C, !0), H().setInt32(A + 0, !j(C), !0);
376
376
  },
377
377
  __wbg___wbindgen_rethrow_05525c567f154472: function(A) {
378
378
  throw A;
379
379
  },
380
- __wbg___wbindgen_shr_ef8e07cce709eb54: function(A, I) {
381
- return A >> I;
380
+ __wbg___wbindgen_shr_ef8e07cce709eb54: function(A, g) {
381
+ return A >> g;
382
382
  },
383
- __wbg___wbindgen_string_get_72fb696202c56729: function(A, I) {
384
- const g = I, C = typeof g == "string" ? g : void 0;
385
- var B = x(C) ? 0 : T(C, G.__wbindgen_malloc, G.__wbindgen_realloc), E = d;
386
- a().setInt32(A + 4, E, !0), a().setInt32(A + 0, B, !0);
383
+ __wbg___wbindgen_string_get_72fb696202c56729: function(A, g) {
384
+ const I = g, C = typeof I == "string" ? I : void 0;
385
+ var B = j(C) ? 0 : Z(C, M.__wbindgen_malloc, M.__wbindgen_realloc), E = x;
386
+ H().setInt32(A + 4, E, !0), H().setInt32(A + 0, B, !0);
387
387
  },
388
- __wbg___wbindgen_throw_be289d5034ed271b: function(A, I) {
389
- throw new Error(q(A, I));
388
+ __wbg___wbindgen_throw_be289d5034ed271b: function(A, g) {
389
+ throw new Error(p(A, g));
390
390
  },
391
391
  __wbg__wbg_cb_unref_d9b87ff7982e3b21: function(A) {
392
392
  A._wbg_cb_unref();
393
393
  },
394
394
  __wbg_addEventListener_3acb0aad4483804c: function() {
395
- return J(function(A, I, g, C) {
396
- A.addEventListener(q(I, g), C);
395
+ return J(function(A, g, I, C) {
396
+ A.addEventListener(p(g, I), C);
397
397
  }, arguments);
398
398
  },
399
399
  __wbg_apply_2e22c45cb4f12415: function() {
400
- return J(function(A, I, g) {
401
- return Reflect.apply(A, I, g);
400
+ return J(function(A, g, I) {
401
+ return Reflect.apply(A, g, I);
402
402
  }, arguments);
403
403
  },
404
404
  __wbg_apply_ada2ee1a60ac7b3c: function() {
405
- return J(function(A, I, g) {
406
- return A.apply(I, g);
405
+ return J(function(A, g, I) {
406
+ return A.apply(g, I);
407
407
  }, arguments);
408
408
  },
409
409
  __wbg_arrayBuffer_bb54076166006c39: function() {
@@ -411,11 +411,11 @@ function WA() {
411
411
  return A.arrayBuffer();
412
412
  }, arguments);
413
413
  },
414
- __wbg_bind_1dc37de2b9939128: function(A, I, g, C) {
415
- return A.bind(I, g, C);
414
+ __wbg_bind_1dc37de2b9939128: function(A, g, I, C) {
415
+ return A.bind(g, I, C);
416
416
  },
417
- __wbg_bind_29ba380591735d8c: function(A, I, g) {
418
- return A.bind(I, g);
417
+ __wbg_bind_29ba380591735d8c: function(A, g, I) {
418
+ return A.bind(g, I);
419
419
  },
420
420
  __wbg_buffer_7b5f53e46557d8f1: function(A) {
421
421
  return A.buffer;
@@ -427,18 +427,18 @@ function WA() {
427
427
  return A.byteLength;
428
428
  },
429
429
  __wbg_call_389efe28435a9388: function() {
430
- return J(function(A, I) {
431
- return A.call(I);
430
+ return J(function(A, g) {
431
+ return A.call(g);
432
432
  }, arguments);
433
433
  },
434
434
  __wbg_call_4708e0c13bdc8e95: function() {
435
- return J(function(A, I, g) {
436
- return A.call(I, g);
435
+ return J(function(A, g, I) {
436
+ return A.call(g, I);
437
437
  }, arguments);
438
438
  },
439
439
  __wbg_compareExchange_b578410c358e695e: function() {
440
- return J(function(A, I, g, C) {
441
- return Atomics.compareExchange(A, I >>> 0, g, C);
440
+ return J(function(A, g, I, C) {
441
+ return Atomics.compareExchange(A, g >>> 0, I, C);
442
442
  }, arguments);
443
443
  },
444
444
  __wbg_constructor_ad6c0ed428f55d34: function(A) {
@@ -447,8 +447,8 @@ function WA() {
447
447
  __wbg_crypto_86f2631e91b51511: function(A) {
448
448
  return A.crypto;
449
449
  },
450
- __wbg_customSections_193491b069139fb1: function(A, I, g) {
451
- return WebAssembly.Module.customSections(A, q(I, g));
450
+ __wbg_customSections_193491b069139fb1: function(A, g, I) {
451
+ return WebAssembly.Module.customSections(A, p(g, I));
452
452
  },
453
453
  __wbg_data_5330da50312d0bc1: function(A) {
454
454
  return A.data;
@@ -459,12 +459,12 @@ function WA() {
459
459
  __wbg_entries_58c7934c745daac7: function(A) {
460
460
  return Object.entries(A);
461
461
  },
462
- __wbg_error_7534b8e9a36f1ab4: function(A, I) {
463
- let g, C;
462
+ __wbg_error_7534b8e9a36f1ab4: function(A, g) {
463
+ let I, C;
464
464
  try {
465
- g = A, C = I, console.error(q(A, I));
465
+ I = A, C = g, console.error(p(A, g));
466
466
  } finally {
467
- G.__wbindgen_free(g, C, 1);
467
+ M.__wbindgen_free(I, C, 1);
468
468
  }
469
469
  },
470
470
  __wbg_exports_794a42000dacd046: function(A) {
@@ -473,8 +473,8 @@ function WA() {
473
473
  __wbg_exports_86b4926134c40288: function(A) {
474
474
  return A.exports;
475
475
  },
476
- __wbg_fetch_d1488f40cef1e210: function(A, I, g) {
477
- return A.fetch(q(I, g));
476
+ __wbg_fetch_d1488f40cef1e210: function(A, g, I) {
477
+ return A.fetch(p(g, I));
478
478
  },
479
479
  __wbg_from_bddd64e7d5ff6941: function(A) {
480
480
  return Array.from(A);
@@ -485,8 +485,8 @@ function WA() {
485
485
  }, arguments);
486
486
  },
487
487
  __wbg_getRandomValues_b3f15fcbfabb0f8b: function() {
488
- return J(function(A, I) {
489
- A.getRandomValues(I);
488
+ return J(function(A, g) {
489
+ A.getRandomValues(g);
490
490
  }, arguments);
491
491
  },
492
492
  __wbg_getTime_1e3cd1391c5c3995: function(A) {
@@ -495,169 +495,169 @@ function WA() {
495
495
  __wbg_getTimezoneOffset_81776d10a4ec18a8: function(A) {
496
496
  return A.getTimezoneOffset();
497
497
  },
498
- __wbg_getUint32_bb6f5a401408e7fa: function(A, I, g) {
499
- return A.getUint32(I >>> 0, g !== 0);
498
+ __wbg_getUint32_bb6f5a401408e7fa: function(A, g, I) {
499
+ return A.getUint32(g >>> 0, I !== 0);
500
500
  },
501
501
  __wbg_get_7efbcc3819719b0f: function() {
502
- return J(function(A, I) {
503
- return A.get(I >>> 0);
502
+ return J(function(A, g) {
503
+ return A.get(g >>> 0);
504
504
  }, arguments);
505
505
  },
506
- __wbg_get_9b94d73e6221f75c: function(A, I) {
507
- return A[I >>> 0];
506
+ __wbg_get_9b94d73e6221f75c: function(A, g) {
507
+ return A[g >>> 0];
508
508
  },
509
509
  __wbg_get_b3ed3ad4be2bc8ac: function() {
510
- return J(function(A, I) {
511
- return Reflect.get(A, I);
510
+ return J(function(A, g) {
511
+ return Reflect.get(A, g);
512
512
  }, arguments);
513
513
  },
514
- __wbg_get_index_253dd2a9e007656d: function(A, I) {
515
- return A[I >>> 0];
514
+ __wbg_get_index_253dd2a9e007656d: function(A, g) {
515
+ return A[g >>> 0];
516
516
  },
517
- __wbg_get_index_9a5bfdd2ca49c65f: function(A, I) {
518
- return A[I >>> 0];
517
+ __wbg_get_index_9a5bfdd2ca49c65f: function(A, g) {
518
+ return A[g >>> 0];
519
519
  },
520
- __wbg_get_with_ref_key_1dc361bd10053bfe: function(A, I) {
521
- return A[I];
520
+ __wbg_get_with_ref_key_1dc361bd10053bfe: function(A, g) {
521
+ return A[g];
522
522
  },
523
523
  __wbg_grow_5d42bf28c2da22cb: function() {
524
- return J(function(A, I) {
525
- return A.grow(I >>> 0);
524
+ return J(function(A, g) {
525
+ return A.grow(g >>> 0);
526
526
  }, arguments);
527
527
  },
528
528
  __wbg_grow_d034989fce14cc8e: function() {
529
- return J(function(A, I) {
530
- return A.grow(I >>> 0);
529
+ return J(function(A, g) {
530
+ return A.grow(g >>> 0);
531
531
  }, arguments);
532
532
  },
533
533
  __wbg_imports_8333d40ab24779ad: function(A) {
534
534
  return WebAssembly.Module.imports(A);
535
535
  },
536
536
  __wbg_instanceof_ArrayBuffer_c367199e2fa2aa04: function(A) {
537
- let I;
537
+ let g;
538
538
  try {
539
- I = A instanceof ArrayBuffer;
539
+ g = A instanceof ArrayBuffer;
540
540
  } catch {
541
- I = !1;
541
+ g = !1;
542
542
  }
543
- return I;
543
+ return g;
544
544
  },
545
545
  __wbg_instanceof_Error_8573fe0b0b480f46: function(A) {
546
- let I;
546
+ let g;
547
547
  try {
548
- I = A instanceof Error;
548
+ g = A instanceof Error;
549
549
  } catch {
550
- I = !1;
550
+ g = !1;
551
551
  }
552
- return I;
552
+ return g;
553
553
  },
554
554
  __wbg_instanceof_Function_2a29eec978bb3b11: function(A) {
555
- let I;
555
+ let g;
556
556
  try {
557
- I = A instanceof Function;
557
+ g = A instanceof Function;
558
558
  } catch {
559
- I = !1;
559
+ g = !1;
560
560
  }
561
- return I;
561
+ return g;
562
562
  },
563
563
  __wbg_instanceof_Global_2db767b6b2347f01: function(A) {
564
- let I;
564
+ let g;
565
565
  try {
566
- I = A instanceof WebAssembly.Global;
566
+ g = A instanceof WebAssembly.Global;
567
567
  } catch {
568
- I = !1;
568
+ g = !1;
569
569
  }
570
- return I;
570
+ return g;
571
571
  },
572
572
  __wbg_instanceof_Map_53af74335dec57f4: function(A) {
573
- let I;
573
+ let g;
574
574
  try {
575
- I = A instanceof Map;
575
+ g = A instanceof Map;
576
576
  } catch {
577
- I = !1;
577
+ g = !1;
578
578
  }
579
- return I;
579
+ return g;
580
580
  },
581
581
  __wbg_instanceof_Memory_dc8c61e3f831ee37: function(A) {
582
- let I;
582
+ let g;
583
583
  try {
584
- I = A instanceof WebAssembly.Memory;
584
+ g = A instanceof WebAssembly.Memory;
585
585
  } catch {
586
- I = !1;
586
+ g = !1;
587
587
  }
588
- return I;
588
+ return g;
589
589
  },
590
590
  __wbg_instanceof_Module_d0d412b14363ba9a: function(A) {
591
- let I;
591
+ let g;
592
592
  try {
593
- I = A instanceof WebAssembly.Module;
593
+ g = A instanceof WebAssembly.Module;
594
594
  } catch {
595
- I = !1;
595
+ g = !1;
596
596
  }
597
- return I;
597
+ return g;
598
598
  },
599
599
  __wbg_instanceof_Object_1c6af87502b733ed: function(A) {
600
- let I;
600
+ let g;
601
601
  try {
602
- I = A instanceof Object;
602
+ g = A instanceof Object;
603
603
  } catch {
604
- I = !1;
604
+ g = !1;
605
605
  }
606
- return I;
606
+ return g;
607
607
  },
608
608
  __wbg_instanceof_RangeError_0b0dd056bc557b89: function(A) {
609
- let I;
609
+ let g;
610
610
  try {
611
- I = A instanceof RangeError;
611
+ g = A instanceof RangeError;
612
612
  } catch {
613
- I = !1;
613
+ g = !1;
614
614
  }
615
- return I;
615
+ return g;
616
616
  },
617
617
  __wbg_instanceof_Response_ee1d54d79ae41977: function(A) {
618
- let I;
618
+ let g;
619
619
  try {
620
- I = A instanceof Response;
620
+ g = A instanceof Response;
621
621
  } catch {
622
- I = !1;
622
+ g = !1;
623
623
  }
624
- return I;
624
+ return g;
625
625
  },
626
626
  __wbg_instanceof_SharedArrayBuffer_91d8a2fa16a2cc26: function(A) {
627
- let I;
627
+ let g;
628
628
  try {
629
- I = A instanceof SharedArrayBuffer;
629
+ g = A instanceof SharedArrayBuffer;
630
630
  } catch {
631
- I = !1;
631
+ g = !1;
632
632
  }
633
- return I;
633
+ return g;
634
634
  },
635
635
  __wbg_instanceof_Table_127f216e592f4159: function(A) {
636
- let I;
636
+ let g;
637
637
  try {
638
- I = A instanceof WebAssembly.Table;
638
+ g = A instanceof WebAssembly.Table;
639
639
  } catch {
640
- I = !1;
640
+ g = !1;
641
641
  }
642
- return I;
642
+ return g;
643
643
  },
644
644
  __wbg_instanceof_Tag_f1d6b24a98b95210: function(A) {
645
- let I;
645
+ let g;
646
646
  try {
647
- I = A instanceof WebAssembly.Tag;
647
+ g = A instanceof WebAssembly.Tag;
648
648
  } catch {
649
- I = !1;
649
+ g = !1;
650
650
  }
651
- return I;
651
+ return g;
652
652
  },
653
653
  __wbg_instanceof_Uint8Array_9b9075935c74707c: function(A) {
654
- let I;
654
+ let g;
655
655
  try {
656
- I = A instanceof Uint8Array;
656
+ g = A instanceof Uint8Array;
657
657
  } catch {
658
- I = !1;
658
+ g = !1;
659
659
  }
660
- return I;
660
+ return g;
661
661
  },
662
662
  __wbg_isArray_d314bb98fcf08331: function(A) {
663
663
  return Array.isArray(A);
@@ -665,8 +665,8 @@ function WA() {
665
665
  __wbg_isSafeInteger_bfbc7332a9768d2a: function(A) {
666
666
  return Number.isSafeInteger(A);
667
667
  },
668
- __wbg_is_f29129f676e5410c: function(A, I) {
669
- return Object.is(A, I);
668
+ __wbg_is_f29129f676e5410c: function(A, g) {
669
+ return Object.is(A, g);
670
670
  },
671
671
  __wbg_iterator_6ff6560ca1568e55: function() {
672
672
  return Symbol.iterator;
@@ -681,8 +681,8 @@ function WA() {
681
681
  return A.length;
682
682
  },
683
683
  __wbg_load_eff64ff5e429a422: function() {
684
- return J(function(A, I) {
685
- return Atomics.load(A, I >>> 0);
684
+ return J(function(A, g) {
685
+ return Atomics.load(A, g >>> 0);
686
686
  }, arguments);
687
687
  },
688
688
  __wbg_message_9ddc4b9a62a7c379: function(A) {
@@ -697,8 +697,8 @@ function WA() {
697
697
  __wbg_new_245cd5c49157e602: function(A) {
698
698
  return new Date(A);
699
699
  },
700
- __wbg_new_2ac7fa8be584d280: function(A, I, g) {
701
- return new DataView(A, I >>> 0, g >>> 0);
700
+ __wbg_new_2ac7fa8be584d280: function(A, g, I) {
701
+ return new DataView(A, g >>> 0, I >>> 0);
702
702
  },
703
703
  __wbg_new_361308b2356cecd0: function() {
704
704
  return new Object();
@@ -707,8 +707,8 @@ function WA() {
707
707
  return new Array();
708
708
  },
709
709
  __wbg_new_4a996a46a82782b6: function() {
710
- return J(function(A, I) {
711
- return new WebAssembly.Global(A, I);
710
+ return J(function(A, g) {
711
+ return new WebAssembly.Global(A, g);
712
712
  }, arguments);
713
713
  },
714
714
  __wbg_new_57c27ff3ddf5b62c: function() {
@@ -720,8 +720,8 @@ function WA() {
720
720
  return new Error();
721
721
  },
722
722
  __wbg_new_a4e3cab1cdd635ba: function() {
723
- return J(function(A, I) {
724
- return new WebAssembly.Instance(A, I);
723
+ return J(function(A, g) {
724
+ return new WebAssembly.Instance(A, g);
725
725
  }, arguments);
726
726
  },
727
727
  __wbg_new_b061c0550d9f3281: function() {
@@ -729,20 +729,20 @@ function WA() {
729
729
  return new WebAssembly.Memory(A);
730
730
  }, arguments);
731
731
  },
732
- __wbg_new_b5d9e2fb389fef91: function(A, I) {
732
+ __wbg_new_b5d9e2fb389fef91: function(A, g) {
733
733
  try {
734
- var g = { a: A, b: I }, C = (E, D) => {
735
- const w = g.a;
736
- g.a = 0;
734
+ var I = { a: A, b: g }, C = (E, D) => {
735
+ const w = I.a;
736
+ I.a = 0;
737
737
  try {
738
- return zA(w, g.b, E, D);
738
+ return zA(w, I.b, E, D);
739
739
  } finally {
740
- g.a = w;
740
+ I.a = w;
741
741
  }
742
742
  };
743
743
  return new Promise(C);
744
744
  } finally {
745
- g.a = g.b = 0;
745
+ I.a = I.b = 0;
746
746
  }
747
747
  },
748
748
  __wbg_new_ca409f861989e0c5: function(A) {
@@ -754,23 +754,23 @@ function WA() {
754
754
  __wbg_new_dd2b680c8bf6ae29: function(A) {
755
755
  return new Uint8Array(A);
756
756
  },
757
- __wbg_new_from_slice_a3d2629dc1826784: function(A, I) {
758
- return new Uint8Array(_(A, I));
757
+ __wbg_new_from_slice_a3d2629dc1826784: function(A, g) {
758
+ return new Uint8Array(_(A, g));
759
759
  },
760
- __wbg_new_no_args_1c7c842f08d00ebb: function(A, I) {
761
- return new Function(q(A, I));
760
+ __wbg_new_no_args_1c7c842f08d00ebb: function(A, g) {
761
+ return new Function(p(A, g));
762
762
  },
763
- __wbg_new_with_args_7bba34e94b1cfa40: function(A, I, g, C) {
764
- return new Function(q(A, I), q(g, C));
763
+ __wbg_new_with_args_7bba34e94b1cfa40: function(A, g, I, C) {
764
+ return new Function(p(A, g), p(I, C));
765
765
  },
766
- __wbg_new_with_byte_offset_9120ba79e057895b: function(A, I) {
767
- return new Uint8Array(A, I >>> 0);
766
+ __wbg_new_with_byte_offset_9120ba79e057895b: function(A, g) {
767
+ return new Uint8Array(A, g >>> 0);
768
768
  },
769
- __wbg_new_with_byte_offset_and_length_aa261d9c9da49eb1: function(A, I, g) {
770
- return new Uint8Array(A, I >>> 0, g >>> 0);
769
+ __wbg_new_with_byte_offset_and_length_aa261d9c9da49eb1: function(A, g, I) {
770
+ return new Uint8Array(A, g >>> 0, I >>> 0);
771
771
  },
772
- __wbg_new_with_byte_offset_and_length_bc2e7b72cc96d1c1: function(A, I, g) {
773
- return new Int32Array(A, I >>> 0, g >>> 0);
772
+ __wbg_new_with_byte_offset_and_length_bc2e7b72cc96d1c1: function(A, g, I) {
773
+ return new Int32Array(A, g >>> 0, I >>> 0);
774
774
  },
775
775
  __wbg_new_with_length_1763c527b2923202: function(A) {
776
776
  return new Array(A >>> 0);
@@ -790,8 +790,8 @@ function WA() {
790
790
  return A.node;
791
791
  },
792
792
  __wbg_notify_78a90977fab74963: function() {
793
- return J(function(A, I) {
794
- return Atomics.notify(A, I >>> 0);
793
+ return J(function(A, g) {
794
+ return Atomics.notify(A, g >>> 0);
795
795
  }, arguments);
796
796
  },
797
797
  __wbg_now_a3af9a2f4bbaa4d1: function() {
@@ -804,18 +804,18 @@ function WA() {
804
804
  return A.ok;
805
805
  },
806
806
  __wbg_postMessage_2041f4e90af61318: function() {
807
- return J(function(A, I) {
808
- A.postMessage(I);
807
+ return J(function(A, g) {
808
+ A.postMessage(g);
809
809
  }, arguments);
810
810
  },
811
811
  __wbg_process_3975fd6c72f520aa: function(A) {
812
812
  return A.process;
813
813
  },
814
- __wbg_prototypesetcall_bdcdcc5842e4d77d: function(A, I, g) {
815
- Uint8Array.prototype.set.call(_(A, I), g);
814
+ __wbg_prototypesetcall_bdcdcc5842e4d77d: function(A, g, I) {
815
+ Uint8Array.prototype.set.call(_(A, g), I);
816
816
  },
817
- __wbg_push_8ffdcb2063340ba5: function(A, I) {
818
- return A.push(I);
817
+ __wbg_push_8ffdcb2063340ba5: function(A, g) {
818
+ return A.push(g);
819
819
  },
820
820
  __wbg_queueMicrotask_0aa0a927f78f5d98: function(A) {
821
821
  return A.queueMicrotask;
@@ -824,13 +824,13 @@ function WA() {
824
824
  queueMicrotask(A);
825
825
  },
826
826
  __wbg_randomFillSync_f8c153b79f285817: function() {
827
- return J(function(A, I) {
828
- A.randomFillSync(I);
827
+ return J(function(A, g) {
828
+ A.randomFillSync(g);
829
829
  }, arguments);
830
830
  },
831
831
  __wbg_removeEventListener_e63328781a5b9af9: function() {
832
- return J(function(A, I, g, C) {
833
- A.removeEventListener(q(I, g), C);
832
+ return J(function(A, g, I, C) {
833
+ A.removeEventListener(p(g, I), C);
834
834
  }, arguments);
835
835
  },
836
836
  __wbg_require_b74f47fc2d022fd6: function() {
@@ -842,90 +842,90 @@ function WA() {
842
842
  return Promise.resolve(A);
843
843
  },
844
844
  __wbg_setTimeout_e0aacd5a637418a6: function() {
845
- return J(function(A, I, g) {
846
- return A.setTimeout(I, g);
845
+ return J(function(A, g, I) {
846
+ return A.setTimeout(g, I);
847
847
  }, arguments);
848
848
  },
849
- __wbg_setUint32_d168af7751a8557e: function(A, I, g, C) {
850
- A.setUint32(I >>> 0, g >>> 0, C !== 0);
849
+ __wbg_setUint32_d168af7751a8557e: function(A, g, I, C) {
850
+ A.setUint32(g >>> 0, I >>> 0, C !== 0);
851
851
  },
852
852
  __wbg_set_0af2522656c2a71b: function() {
853
- return J(function(A, I, g) {
854
- A.set(I >>> 0, g);
853
+ return J(function(A, g, I) {
854
+ A.set(g >>> 0, I);
855
855
  }, arguments);
856
856
  },
857
- __wbg_set_1eb0999cf5d27fc8: function(A, I, g) {
858
- return A.set(I, g);
857
+ __wbg_set_1eb0999cf5d27fc8: function(A, g, I) {
858
+ return A.set(g, I);
859
859
  },
860
- __wbg_set_25cf9deff6bf0ea8: function(A, I, g) {
861
- A.set(I, g >>> 0);
860
+ __wbg_set_25cf9deff6bf0ea8: function(A, g, I) {
861
+ A.set(g, I >>> 0);
862
862
  },
863
- __wbg_set_3f1d0b984ed272ed: function(A, I, g) {
864
- A[I] = g;
863
+ __wbg_set_3f1d0b984ed272ed: function(A, g, I) {
864
+ A[g] = I;
865
865
  },
866
866
  __wbg_set_6cb8631f80447a67: function() {
867
- return J(function(A, I, g) {
868
- return Reflect.set(A, I, g);
867
+ return J(function(A, g, I) {
868
+ return Reflect.set(A, g, I);
869
869
  }, arguments);
870
870
  },
871
- __wbg_set_cc56eefd2dd91957: function(A, I, g) {
872
- A.set(_(I, g));
871
+ __wbg_set_cc56eefd2dd91957: function(A, g, I) {
872
+ A.set(_(g, I));
873
873
  },
874
- __wbg_set_f43e577aea94465b: function(A, I, g) {
875
- A[I >>> 0] = g;
874
+ __wbg_set_f43e577aea94465b: function(A, g, I) {
875
+ A[g >>> 0] = I;
876
876
  },
877
- __wbg_set_index_b3244a6c458021e4: function(A, I, g) {
878
- A[I >>> 0] = g;
877
+ __wbg_set_index_b3244a6c458021e4: function(A, g, I) {
878
+ A[g >>> 0] = I;
879
879
  },
880
- __wbg_set_index_f259b54e97f7b177: function(A, I, g) {
881
- A[I >>> 0] = g;
880
+ __wbg_set_index_f259b54e97f7b177: function(A, g, I) {
881
+ A[g >>> 0] = I;
882
882
  },
883
- __wbg_set_onmessage_ea7cc2ba099021cd: function(A, I) {
884
- A.onmessage = I;
883
+ __wbg_set_onmessage_ea7cc2ba099021cd: function(A, g) {
884
+ A.onmessage = g;
885
885
  },
886
- __wbg_set_value_fc06e541de098215: function(A, I) {
887
- A.value = I;
886
+ __wbg_set_value_fc06e541de098215: function(A, g) {
887
+ A.value = g;
888
888
  },
889
- __wbg_slice_8bbd46adb2100583: function(A, I, g) {
890
- return A.slice(I >>> 0, g >>> 0);
889
+ __wbg_slice_8bbd46adb2100583: function(A, g, I) {
890
+ return A.slice(g >>> 0, I >>> 0);
891
891
  },
892
- __wbg_stack_0ed75d68575b0f3c: function(A, I) {
893
- const g = I.stack, C = T(g, G.__wbindgen_malloc, G.__wbindgen_realloc), B = d;
894
- a().setInt32(A + 4, B, !0), a().setInt32(A + 0, C, !0);
892
+ __wbg_stack_0ed75d68575b0f3c: function(A, g) {
893
+ const I = g.stack, C = Z(I, M.__wbindgen_malloc, M.__wbindgen_realloc), B = x;
894
+ H().setInt32(A + 4, B, !0), H().setInt32(A + 0, C, !0);
895
895
  },
896
896
  __wbg_static_accessor_GLOBAL_12837167ad935116: function() {
897
897
  const A = typeof global > "u" ? null : global;
898
- return x(A) ? 0 : f(A);
898
+ return j(A) ? 0 : X(A);
899
899
  },
900
900
  __wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function() {
901
901
  const A = typeof globalThis > "u" ? null : globalThis;
902
- return x(A) ? 0 : f(A);
902
+ return j(A) ? 0 : X(A);
903
903
  },
904
904
  __wbg_static_accessor_SELF_a621d3dfbb60d0ce: function() {
905
905
  const A = typeof self > "u" ? null : self;
906
- return x(A) ? 0 : f(A);
906
+ return j(A) ? 0 : X(A);
907
907
  },
908
908
  __wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function() {
909
909
  const A = typeof window > "u" ? null : window;
910
- return x(A) ? 0 : f(A);
910
+ return j(A) ? 0 : X(A);
911
911
  },
912
912
  __wbg_store_d1d951c98d9bed41: function() {
913
- return J(function(A, I, g) {
914
- return Atomics.store(A, I >>> 0, g);
913
+ return J(function(A, g, I) {
914
+ return Atomics.store(A, g >>> 0, I);
915
915
  }, arguments);
916
916
  },
917
- __wbg_subarray_a96e1fef17ed23cb: function(A, I, g) {
918
- return A.subarray(I >>> 0, g >>> 0);
917
+ __wbg_subarray_a96e1fef17ed23cb: function(A, g, I) {
918
+ return A.subarray(g >>> 0, I >>> 0);
919
919
  },
920
- __wbg_then_0d9fe2c7b1857d32: function(A, I, g) {
921
- return A.then(I, g);
920
+ __wbg_then_0d9fe2c7b1857d32: function(A, g, I) {
921
+ return A.then(g, I);
922
922
  },
923
- __wbg_then_b9e7b3b5f1a9e1b5: function(A, I) {
924
- return A.then(I);
923
+ __wbg_then_b9e7b3b5f1a9e1b5: function(A, g) {
924
+ return A.then(g);
925
925
  },
926
- __wbg_toString_56d946daff83867b: function(A, I, g) {
927
- const C = I.toString(g), B = T(C, G.__wbindgen_malloc, G.__wbindgen_realloc), E = d;
928
- a().setInt32(A + 4, E, !0), a().setInt32(A + 0, B, !0);
926
+ __wbg_toString_56d946daff83867b: function(A, g, I) {
927
+ const C = g.toString(I), B = Z(C, M.__wbindgen_malloc, M.__wbindgen_realloc), E = x;
928
+ H().setInt32(A + 4, E, !0), H().setInt32(A + 0, B, !0);
929
929
  },
930
930
  __wbg_toString_964ff7fe6eca8362: function(A) {
931
931
  return A.toString();
@@ -947,31 +947,36 @@ function WA() {
947
947
  __wbg_versions_4e31226f5e8dc909: function(A) {
948
948
  return A.versions;
949
949
  },
950
+ __wbg_wait_5404654a64e22842: function() {
951
+ return J(function(A, g, I, C) {
952
+ return Atomics.wait(A, g >>> 0, I, C);
953
+ }, arguments);
954
+ },
950
955
  __wbg_wait_be5dae1e53f590f1: function() {
951
- return J(function(A, I, g) {
952
- return Atomics.wait(A, I >>> 0, g);
956
+ return J(function(A, g, I) {
957
+ return Atomics.wait(A, g >>> 0, I);
953
958
  }, arguments);
954
959
  },
955
- __wbg_warn_81ab00e6e16e886d: function(A, I, g) {
956
- console.warn(A, I, g);
960
+ __wbg_warn_81ab00e6e16e886d: function(A, g, I) {
961
+ console.warn(A, g, I);
957
962
  },
958
- __wbindgen_cast_0000000000000001: function(A, I) {
959
- return PA(A, I, G.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__Fn__web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent____Output_______, ZA);
963
+ __wbindgen_cast_0000000000000001: function(A, g) {
964
+ return fA(A, g, M.wasm_bindgen_8243b1be48d1cf33___closure__destroy___dyn_core_d941ad8722425d2e___ops__function__Fn__web_sys_9db025406f626889___features__gen_MessageEvent__MessageEvent____Output_______, WA);
960
965
  },
961
- __wbindgen_cast_0000000000000002: function(A, I) {
962
- return z(A, I, G.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__Fn__web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent____Output_______, TA);
966
+ __wbindgen_cast_0000000000000002: function(A, g) {
967
+ return z(A, g, M.wasm_bindgen_8243b1be48d1cf33___closure__destroy___dyn_core_d941ad8722425d2e___ops__function__Fn__web_sys_9db025406f626889___features__gen_MessageEvent__MessageEvent____Output_______, ZA);
963
968
  },
964
- __wbindgen_cast_0000000000000003: function(A, I) {
965
- return z(A, I, 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___, MA);
969
+ __wbindgen_cast_0000000000000003: function(A, g) {
970
+ return z(A, g, M.wasm_bindgen_8243b1be48d1cf33___closure__destroy___dyn_for__a__core_d941ad8722425d2e___ops__function__FnMut____a_js_sys_662c4dd2f34eb95c___Array____Output___core_d941ad8722425d2e___result__Result_js_sys_662c4dd2f34eb95c___Array__wasm_bindgen_8243b1be48d1cf33___JsValue___, kA);
966
971
  },
967
- __wbindgen_cast_0000000000000004: function(A, I) {
968
- return z(A, I, 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___, MA);
972
+ __wbindgen_cast_0000000000000004: function(A, g) {
973
+ return z(A, g, M.wasm_bindgen_8243b1be48d1cf33___closure__destroy___dyn_for__a__core_d941ad8722425d2e___ops__function__FnMut____a_js_sys_662c4dd2f34eb95c___Array____Output___core_d941ad8722425d2e___result__Result_js_sys_662c4dd2f34eb95c___Array__wasm_bindgen_8243b1be48d1cf33___JsValue___, kA);
969
974
  },
970
- __wbindgen_cast_0000000000000005: function(A, I) {
971
- return z(A, I, 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___, tA);
975
+ __wbindgen_cast_0000000000000005: function(A, g) {
976
+ return z(A, g, M.wasm_bindgen_8243b1be48d1cf33___closure__destroy___dyn_for__a__core_d941ad8722425d2e___ops__function__FnMut____a_js_sys_662c4dd2f34eb95c___Array____Output___core_d941ad8722425d2e___result__Result_js_sys_662c4dd2f34eb95c___Array__wasm_bindgen_8243b1be48d1cf33___JsValue___, tA);
972
977
  },
973
- __wbindgen_cast_0000000000000006: function(A, I) {
974
- return z(A, I, G.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__FnMut__wasm_bindgen_36932265c58943ab___JsValue____Output_______, VA);
978
+ __wbindgen_cast_0000000000000006: function(A, g) {
979
+ return z(A, g, M.wasm_bindgen_8243b1be48d1cf33___closure__destroy___dyn_core_d941ad8722425d2e___ops__function__FnMut__wasm_bindgen_8243b1be48d1cf33___JsValue____Output_______, TA);
975
980
  },
976
981
  __wbindgen_cast_0000000000000007: function(A) {
977
982
  return A;
@@ -979,58 +984,58 @@ function WA() {
979
984
  __wbindgen_cast_0000000000000008: function(A) {
980
985
  return A;
981
986
  },
982
- __wbindgen_cast_0000000000000009: function(A, I) {
983
- return _(A, I);
987
+ __wbindgen_cast_0000000000000009: function(A, g) {
988
+ return _(A, g);
984
989
  },
985
- __wbindgen_cast_000000000000000a: function(A, I) {
986
- return q(A, I);
990
+ __wbindgen_cast_000000000000000a: function(A, g) {
991
+ return p(A, g);
987
992
  },
988
- __wbindgen_cast_000000000000000b: function(A, I) {
989
- return BigInt.asUintN(64, A) | BigInt.asUintN(64, I) << BigInt(64);
993
+ __wbindgen_cast_000000000000000b: function(A, g) {
994
+ return BigInt.asUintN(64, A) | BigInt.asUintN(64, g) << BigInt(64);
990
995
  },
991
996
  __wbindgen_cast_000000000000000c: function(A) {
992
997
  return BigInt.asUintN(64, A);
993
998
  },
994
999
  __wbindgen_init_externref_table: function() {
995
- const A = G.__wbindgen_externrefs, I = A.grow(4);
996
- A.set(0, void 0), A.set(I + 0, void 0), A.set(I + 1, null), A.set(I + 2, !0), A.set(I + 3, !1);
1000
+ const A = M.__wbindgen_externrefs, g = A.grow(4);
1001
+ 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);
997
1002
  }
998
1003
  }
999
1004
  };
1000
1005
  }
1001
- function ZA(Q, A, I) {
1002
- G.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent_____(Q, A, I);
1006
+ function WA(Q, A, g) {
1007
+ M.wasm_bindgen_8243b1be48d1cf33___convert__closures_____invoke___web_sys_9db025406f626889___features__gen_MessageEvent__MessageEvent_____(Q, A, g);
1003
1008
  }
1004
- function TA(Q, A, I) {
1005
- G.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent______1_(Q, A, I);
1009
+ function ZA(Q, A, g) {
1010
+ M.wasm_bindgen_8243b1be48d1cf33___convert__closures_____invoke___web_sys_9db025406f626889___features__gen_MessageEvent__MessageEvent______1_(Q, A, g);
1006
1011
  }
1007
- function VA(Q, A, I) {
1008
- G.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___wasm_bindgen_36932265c58943ab___JsValue_____(Q, A, I);
1012
+ function TA(Q, A, g) {
1013
+ M.wasm_bindgen_8243b1be48d1cf33___convert__closures_____invoke___wasm_bindgen_8243b1be48d1cf33___JsValue_____(Q, A, g);
1009
1014
  }
1010
- function tA(Q, A, I) {
1011
- const g = G.wasm_bindgen_36932265c58943ab___convert__closures________invoke___js_sys_9eaf8169b8189500___Array__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_36932265c58943ab___JsValue__(Q, A, I);
1012
- if (g[1])
1013
- throw wA(g[0]);
1015
+ function tA(Q, A, g) {
1016
+ const I = M.wasm_bindgen_8243b1be48d1cf33___convert__closures________invoke___js_sys_662c4dd2f34eb95c___Array__core_d941ad8722425d2e___result__Result_____wasm_bindgen_8243b1be48d1cf33___JsValue__(Q, A, g);
1017
+ if (I[1])
1018
+ throw wA(I[0]);
1014
1019
  }
1015
- function MA(Q, A, I) {
1016
- const g = 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, I);
1017
- if (g[2])
1018
- throw wA(g[1]);
1019
- return wA(g[0]);
1020
+ function kA(Q, A, g) {
1021
+ const I = M.wasm_bindgen_8243b1be48d1cf33___convert__closures________invoke___js_sys_662c4dd2f34eb95c___Array__core_d941ad8722425d2e___result__Result_js_sys_662c4dd2f34eb95c___Array__wasm_bindgen_8243b1be48d1cf33___JsValue__(Q, A, g);
1022
+ if (I[2])
1023
+ throw wA(I[1]);
1024
+ return wA(I[0]);
1020
1025
  }
1021
- function zA(Q, A, I, g) {
1022
- G.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___wasm_bindgen_36932265c58943ab___JsValue__wasm_bindgen_36932265c58943ab___JsValue_____(Q, A, I, g);
1026
+ function zA(Q, A, g, I) {
1027
+ M.wasm_bindgen_8243b1be48d1cf33___convert__closures_____invoke___wasm_bindgen_8243b1be48d1cf33___JsValue__wasm_bindgen_8243b1be48d1cf33___JsValue_____(Q, A, g, I);
1023
1028
  }
1024
- const kA = typeof FinalizationRegistry > "u" ? { register: () => {
1029
+ const GA = typeof FinalizationRegistry > "u" ? { register: () => {
1025
1030
  }, unregister: () => {
1026
- } } : new FinalizationRegistry((Q) => G.__wbg_dapadapter_free(Q >>> 0, 1)), KA = typeof FinalizationRegistry > "u" ? { register: () => {
1031
+ } } : new FinalizationRegistry((Q) => M.__wbg_dapadapter_free(Q >>> 0, 1)), yA = typeof FinalizationRegistry > "u" ? { register: () => {
1027
1032
  }, unregister: () => {
1028
- } } : new FinalizationRegistry((Q) => G.__wbg_trap_free(Q >>> 0, 1));
1029
- function f(Q) {
1030
- const A = G.__externref_table_alloc();
1031
- return G.__wbindgen_externrefs.set(A, Q), A;
1033
+ } } : new FinalizationRegistry((Q) => M.__wbg_trap_free(Q >>> 0, 1));
1034
+ function X(Q) {
1035
+ const A = M.__externref_table_alloc();
1036
+ return M.__wbindgen_externrefs.set(A, Q), A;
1032
1037
  }
1033
- const gA = typeof FinalizationRegistry > "u" ? { register: () => {
1038
+ const IA = typeof FinalizationRegistry > "u" ? { register: () => {
1034
1039
  }, unregister: () => {
1035
1040
  } } : new FinalizationRegistry((Q) => Q.dtor(Q.a, Q.b));
1036
1041
  function DA(Q) {
@@ -1055,143 +1060,143 @@ function DA(Q) {
1055
1060
  B += ", " + DA(Q[E]);
1056
1061
  return B += "]", B;
1057
1062
  }
1058
- const I = /\[object ([^\]]+)\]/.exec(toString.call(Q));
1059
- let g;
1060
- if (I && I.length > 1)
1061
- g = I[1];
1063
+ const g = /\[object ([^\]]+)\]/.exec(toString.call(Q));
1064
+ let I;
1065
+ if (g && g.length > 1)
1066
+ I = g[1];
1062
1067
  else
1063
1068
  return toString.call(Q);
1064
- if (g == "Object")
1069
+ if (I == "Object")
1065
1070
  try {
1066
1071
  return "Object(" + JSON.stringify(Q) + ")";
1067
1072
  } catch {
1068
1073
  return "Object";
1069
1074
  }
1070
1075
  return Q instanceof Error ? `${Q.name}: ${Q.message}
1071
- ${Q.stack}` : g;
1076
+ ${Q.stack}` : I;
1072
1077
  }
1073
1078
  function lA(Q, A) {
1074
1079
  Q = Q >>> 0;
1075
- const I = a(), g = [];
1080
+ const g = H(), I = [];
1076
1081
  for (let C = Q; C < Q + 4 * A; C += 4)
1077
- g.push(G.__wbindgen_externrefs.get(I.getUint32(C, !0)));
1078
- return G.__externref_drop_slice(Q, A), g;
1082
+ I.push(M.__wbindgen_externrefs.get(g.getUint32(C, !0)));
1083
+ return M.__externref_drop_slice(Q, A), I;
1079
1084
  }
1080
1085
  function _(Q, A) {
1081
1086
  return Q = Q >>> 0, m().subarray(Q / 1, Q / 1 + A);
1082
1087
  }
1083
- let Z = null;
1084
- function a() {
1085
- return (Z === null || Z.buffer.detached === !0 || Z.buffer.detached === void 0 && Z.buffer !== G.memory.buffer) && (Z = new DataView(G.memory.buffer)), Z;
1088
+ let W = null;
1089
+ function H() {
1090
+ return (W === null || W.buffer.detached === !0 || W.buffer.detached === void 0 && W.buffer !== M.memory.buffer) && (W = new DataView(M.memory.buffer)), W;
1086
1091
  }
1087
- function q(Q, A) {
1092
+ function p(Q, A) {
1088
1093
  return Q = Q >>> 0, bA(Q, A);
1089
1094
  }
1090
1095
  let b = null;
1091
1096
  function m() {
1092
- return (b === null || b.byteLength === 0) && (b = new Uint8Array(G.memory.buffer)), b;
1097
+ return (b === null || b.byteLength === 0) && (b = new Uint8Array(M.memory.buffer)), b;
1093
1098
  }
1094
1099
  function J(Q, A) {
1095
1100
  try {
1096
1101
  return Q.apply(this, A);
1097
- } catch (I) {
1098
- const g = f(I);
1099
- G.__wbindgen_exn_store(g);
1102
+ } catch (g) {
1103
+ const I = X(g);
1104
+ M.__wbindgen_exn_store(I);
1100
1105
  }
1101
1106
  }
1102
- function x(Q) {
1107
+ function j(Q) {
1103
1108
  return Q == null;
1104
1109
  }
1105
- function PA(Q, A, I, g) {
1106
- const C = { a: Q, b: A, cnt: 1, dtor: I }, B = (...E) => {
1110
+ function fA(Q, A, g, I) {
1111
+ const C = { a: Q, b: A, cnt: 1, dtor: g }, B = (...E) => {
1107
1112
  C.cnt++;
1108
1113
  try {
1109
- return g(C.a, C.b, ...E);
1114
+ return I(C.a, C.b, ...E);
1110
1115
  } finally {
1111
1116
  B._wbg_cb_unref();
1112
1117
  }
1113
1118
  };
1114
1119
  return B._wbg_cb_unref = () => {
1115
- --C.cnt === 0 && (C.dtor(C.a, C.b), C.a = 0, gA.unregister(C));
1116
- }, gA.register(B, C, C), B;
1120
+ --C.cnt === 0 && (C.dtor(C.a, C.b), C.a = 0, IA.unregister(C));
1121
+ }, IA.register(B, C, C), B;
1117
1122
  }
1118
- function z(Q, A, I, g) {
1119
- const C = { a: Q, b: A, cnt: 1, dtor: I }, B = (...E) => {
1123
+ function z(Q, A, g, I) {
1124
+ const C = { a: Q, b: A, cnt: 1, dtor: g }, B = (...E) => {
1120
1125
  C.cnt++;
1121
1126
  const D = C.a;
1122
1127
  C.a = 0;
1123
1128
  try {
1124
- return g(D, C.b, ...E);
1129
+ return I(D, C.b, ...E);
1125
1130
  } finally {
1126
1131
  C.a = D, B._wbg_cb_unref();
1127
1132
  }
1128
1133
  };
1129
1134
  return B._wbg_cb_unref = () => {
1130
- --C.cnt === 0 && (C.dtor(C.a, C.b), C.a = 0, gA.unregister(C));
1131
- }, gA.register(B, C, C), B;
1135
+ --C.cnt === 0 && (C.dtor(C.a, C.b), C.a = 0, IA.unregister(C));
1136
+ }, IA.register(B, C, C), B;
1132
1137
  }
1133
- function T(Q, A, I) {
1134
- if (I === void 0) {
1135
- const D = X.encode(Q), w = A(D.length, 1) >>> 0;
1136
- return m().subarray(w, w + D.length).set(D), d = D.length, w;
1138
+ function Z(Q, A, g) {
1139
+ if (g === void 0) {
1140
+ const D = P.encode(Q), w = A(D.length, 1) >>> 0;
1141
+ return m().subarray(w, w + D.length).set(D), x = D.length, w;
1137
1142
  }
1138
- let g = Q.length, C = A(g, 1) >>> 0;
1143
+ let I = Q.length, C = A(I, 1) >>> 0;
1139
1144
  const B = m();
1140
1145
  let E = 0;
1141
- for (; E < g; E++) {
1146
+ for (; E < I; E++) {
1142
1147
  const D = Q.charCodeAt(E);
1143
1148
  if (D > 127) break;
1144
1149
  B[C + E] = D;
1145
1150
  }
1146
- if (E !== g) {
1147
- E !== 0 && (Q = Q.slice(E)), C = I(C, g, g = E + Q.length * 3, 1) >>> 0;
1148
- const D = m().subarray(C + E, C + g), w = X.encodeInto(Q, D);
1149
- E += w.written, C = I(C, g, E, 1) >>> 0;
1151
+ if (E !== I) {
1152
+ E !== 0 && (Q = Q.slice(E)), C = g(C, I, I = E + Q.length * 3, 1) >>> 0;
1153
+ const D = m().subarray(C + E, C + I), w = P.encodeInto(Q, D);
1154
+ E += w.written, C = g(C, I, E, 1) >>> 0;
1150
1155
  }
1151
- return d = E, C;
1156
+ return x = E, C;
1152
1157
  }
1153
1158
  function wA(Q) {
1154
- const A = G.__wbindgen_externrefs.get(Q);
1155
- return G.__externref_table_dealloc(Q), A;
1159
+ const A = M.__wbindgen_externrefs.get(Q);
1160
+ return M.__externref_table_dealloc(Q), A;
1156
1161
  }
1157
1162
  let AA = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
1158
1163
  AA.decode();
1159
- const fA = 2146435072;
1164
+ const XA = 2146435072;
1160
1165
  let QA = 0;
1161
1166
  function bA(Q, A) {
1162
- return QA += A, QA >= fA && (AA = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }), AA.decode(), QA = A), AA.decode(m().subarray(Q, Q + A));
1167
+ return QA += A, QA >= XA && (AA = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }), AA.decode(), QA = A), AA.decode(m().subarray(Q, Q + A));
1163
1168
  }
1164
- const X = new TextEncoder();
1165
- "encodeInto" in X || (X.encodeInto = function(Q, A) {
1166
- const I = X.encode(Q);
1167
- return A.set(I), {
1169
+ const P = new TextEncoder();
1170
+ "encodeInto" in P || (P.encodeInto = function(Q, A) {
1171
+ const g = P.encode(Q);
1172
+ return A.set(g), {
1168
1173
  read: Q.length,
1169
- written: I.length
1174
+ written: g.length
1170
1175
  };
1171
1176
  });
1172
- let d = 0, G;
1177
+ let x = 0, M;
1173
1178
  function mA(Q, A) {
1174
- return G = Q.exports, Z = null, b = null, G.__wbindgen_start(), G;
1179
+ return M = Q.exports, W = null, b = null, M.__wbindgen_start(), M;
1175
1180
  }
1176
- async function XA(Q, A) {
1181
+ async function PA(Q, A) {
1177
1182
  if (typeof Response == "function" && Q instanceof Response) {
1178
1183
  if (typeof WebAssembly.instantiateStreaming == "function")
1179
1184
  try {
1180
1185
  return await WebAssembly.instantiateStreaming(Q, A);
1181
1186
  } catch (C) {
1182
- if (Q.ok && I(Q.type) && Q.headers.get("Content-Type") !== "application/wasm")
1187
+ if (Q.ok && g(Q.type) && Q.headers.get("Content-Type") !== "application/wasm")
1183
1188
  console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", C);
1184
1189
  else
1185
1190
  throw C;
1186
1191
  }
1187
- const g = await Q.arrayBuffer();
1188
- return await WebAssembly.instantiate(g, A);
1192
+ const I = await Q.arrayBuffer();
1193
+ return await WebAssembly.instantiate(I, A);
1189
1194
  } else {
1190
- const g = await WebAssembly.instantiate(Q, A);
1191
- return g instanceof WebAssembly.Instance ? { instance: g, module: Q } : g;
1195
+ const I = await WebAssembly.instantiate(Q, A);
1196
+ return I instanceof WebAssembly.Instance ? { instance: I, module: Q } : I;
1192
1197
  }
1193
- function I(g) {
1194
- switch (g) {
1198
+ function g(I) {
1199
+ switch (I) {
1195
1200
  case "basic":
1196
1201
  case "cors":
1197
1202
  case "default":
@@ -1201,14 +1206,14 @@ async function XA(Q, A) {
1201
1206
  }
1202
1207
  }
1203
1208
  async function rA(Q) {
1204
- if (G !== void 0) return G;
1209
+ if (M !== void 0) return M;
1205
1210
  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));
1206
- const A = WA();
1211
+ const A = VA();
1207
1212
  (typeof Q == "string" || typeof Request == "function" && Q instanceof Request || typeof URL == "function" && Q instanceof URL) && (Q = fetch(Q));
1208
- const { instance: I, module: g } = await XA(await Q, A);
1209
- return mA(I);
1213
+ const { instance: g, module: I } = await PA(await Q, A);
1214
+ return mA(g);
1210
1215
  }
1211
- const nA = new URL("https://cdn.jsdelivr.net/npm/glassjar@0.9.0/dist/engine_bg.wasm"), vA = Object.freeze({
1216
+ const nA = new URL("https://cdn.jsdelivr.net/npm/glassjar@0.10.0/dist/engine_bg.wasm"), eA = Object.freeze({
1212
1217
  maxObjectBytes: 128 * 1024 * 1024,
1213
1218
  maxEntries: 256,
1214
1219
  maxMetadataBytes: 8 * 1024 * 1024,
@@ -1224,9 +1229,9 @@ class uA {
1224
1229
  oversized = 0;
1225
1230
  limits;
1226
1231
  constructor(A = {}) {
1227
- this.limits = Object.freeze({ ...vA, ...A });
1228
- for (const I of Object.values(this.limits))
1229
- if (!Number.isSafeInteger(I) || I < 0)
1232
+ this.limits = Object.freeze({ ...eA, ...A });
1233
+ for (const g of Object.values(this.limits))
1234
+ if (!Number.isSafeInteger(g) || g < 0)
1230
1235
  throw new RangeError("C++ cache limits must be nonnegative safe integers");
1231
1236
  }
1232
1237
  beginBatch() {
@@ -1235,23 +1240,23 @@ class uA {
1235
1240
  /** Stage against the same storage budget, before copying any optional object. */
1236
1241
  stage(A) {
1237
1242
  if (this.stagingFailed) return;
1238
- const I = this.recordSize(A);
1239
- if (I === void 0 || this.staged.has(A.source)) {
1243
+ const g = this.recordSize(A);
1244
+ if (g === void 0 || this.staged.has(A.source)) {
1240
1245
  this.failBatch();
1241
1246
  return;
1242
1247
  }
1243
- const g = this.limits;
1244
- for (; this.records.size && (this.records.size + this.staged.size >= g.maxEntries || this.objectBytes + A.object.byteLength > g.maxObjectBytes || this.metadataBytes + I > g.maxMetadataBytes); )
1248
+ const I = this.limits;
1249
+ for (; this.records.size && (this.records.size + this.staged.size >= I.maxEntries || this.objectBytes + A.object.byteLength > I.maxObjectBytes || this.metadataBytes + g > I.maxMetadataBytes); )
1245
1250
  this.remove(this.records.keys().next().value), this.evictions++;
1246
- if (this.records.size + this.staged.size >= g.maxEntries || this.objectBytes + A.object.byteLength > g.maxObjectBytes || this.metadataBytes + I > g.maxMetadataBytes || I > g.maxEntryMetadataBytes) {
1251
+ if (this.records.size + this.staged.size >= I.maxEntries || this.objectBytes + A.object.byteLength > I.maxObjectBytes || this.metadataBytes + g > I.maxMetadataBytes || g > I.maxEntryMetadataBytes) {
1247
1252
  this.oversized++, this.failBatch();
1248
1253
  return;
1249
1254
  }
1250
1255
  this.staged.set(A.source, {
1251
1256
  ...A,
1252
1257
  object: new Uint8Array(A.object),
1253
- metadataBytes: I
1254
- }), this.objectBytes += A.object.byteLength, this.metadataBytes += I;
1258
+ metadataBytes: g
1259
+ }), this.objectBytes += A.object.byteLength, this.metadataBytes += g;
1255
1260
  }
1256
1261
  abandonBatch() {
1257
1262
  this.failBatch();
@@ -1260,7 +1265,7 @@ class uA {
1260
1265
  this.discardBatch(), this.stagingFailed = !0;
1261
1266
  }
1262
1267
  recordSize(A) {
1263
- if (!(typeof A.source != "string" || !A.source.startsWith("/") || A.source.split("/").slice(1).some((I) => !I || I === "." || I === "..") || typeof A.key != "string" || typeof A.object_hash != "string" || !/^[a-f0-9]{64}$/.test(A.key) || !/^[a-f0-9]{64}$/.test(A.object_hash) || A.receipt != null && typeof A.receipt != "string" || !(A.object instanceof Uint8Array)))
1268
+ if (!(typeof A.source != "string" || !A.source.startsWith("/") || A.source.split("/").slice(1).some((g) => !g || g === "." || g === "..") || typeof A.key != "string" || typeof A.object_hash != "string" || !/^[a-f0-9]{64}$/.test(A.key) || !/^[a-f0-9]{64}$/.test(A.object_hash) || A.receipt != null && typeof A.receipt != "string" || !(A.object instanceof Uint8Array)))
1264
1269
  return new TextEncoder().encode(
1265
1270
  JSON.stringify({
1266
1271
  source: A.source,
@@ -1273,19 +1278,19 @@ class uA {
1273
1278
  async validateBatch() {
1274
1279
  if (this.stagingFailed) return !1;
1275
1280
  const A = [...this.staged.values()];
1276
- for (const I of A) {
1277
- if (!eA(I.object)) return !1;
1278
- const g = await crypto.subtle.digest("SHA-256", I.object);
1281
+ for (const g of A) {
1282
+ if (!vA(g.object)) return !1;
1283
+ const I = await crypto.subtle.digest("SHA-256", g.object);
1279
1284
  if (Array.from(
1280
- new Uint8Array(g),
1285
+ new Uint8Array(I),
1281
1286
  (B) => B.toString(16).padStart(2, "0")
1282
- ).join("") !== I.object_hash) return !1;
1287
+ ).join("") !== g.object_hash) return !1;
1283
1288
  }
1284
1289
  return !0;
1285
1290
  }
1286
1291
  commitBatch() {
1287
- for (const [A, I] of this.staged)
1288
- this.remove(A), this.records.set(A, I);
1292
+ for (const [A, g] of this.staged)
1293
+ this.remove(A), this.records.set(A, g);
1289
1294
  this.staged.clear(), this.stagingFailed = !1;
1290
1295
  }
1291
1296
  discardBatch() {
@@ -1294,40 +1299,40 @@ class uA {
1294
1299
  this.staged.clear();
1295
1300
  }
1296
1301
  snapshot() {
1297
- return [...this.records.values()].map(({ source: A, key: I, object_hash: g, object: C, receipt: B }) => ({
1302
+ return [...this.records.values()].map(({ source: A, key: g, object_hash: I, object: C, receipt: B }) => ({
1298
1303
  source: A,
1299
- key: I,
1300
- object_hash: g,
1304
+ key: g,
1305
+ object_hash: I,
1301
1306
  ...B == null ? {} : { receipt: B },
1302
1307
  object: C.slice()
1303
1308
  }));
1304
1309
  }
1305
1310
  /** Worker hits are the only accesses that move an entry to the LRU tail. */
1306
1311
  touch(A) {
1307
- const I = this.records.get(A);
1308
- I && (this.records.delete(A), this.records.set(A, I));
1312
+ const g = this.records.get(A);
1313
+ g && (this.records.delete(A), this.records.set(A, g));
1309
1314
  }
1310
1315
  put(A) {
1311
1316
  if (typeof A.source != "string" || !A.source.startsWith("/") || A.source.split("/").slice(1).some((B) => !B || B === "." || B === "..") || typeof A.key != "string" || typeof A.object_hash != "string" || !/^[a-f0-9]{64}$/.test(A.object_hash) || !/^[a-f0-9]{64}$/.test(A.key) || !(A.object instanceof Uint8Array))
1312
1317
  return;
1313
- const I = this.recordSize(A);
1314
- if (I === void 0) return;
1315
- const g = this.limits;
1316
- if (this.remove(A.source), g.maxEntries === 0 || A.object.byteLength > g.maxObjectBytes || I > g.maxMetadataBytes || I > g.maxEntryMetadataBytes) {
1318
+ const g = this.recordSize(A);
1319
+ if (g === void 0) return;
1320
+ const I = this.limits;
1321
+ if (this.remove(A.source), I.maxEntries === 0 || A.object.byteLength > I.maxObjectBytes || g > I.maxMetadataBytes || g > I.maxEntryMetadataBytes) {
1317
1322
  this.oversized++;
1318
1323
  return;
1319
1324
  }
1320
- for (; this.records.size >= g.maxEntries || this.objectBytes + A.object.byteLength > g.maxObjectBytes || this.metadataBytes + I > g.maxMetadataBytes; )
1325
+ for (; this.records.size >= I.maxEntries || this.objectBytes + A.object.byteLength > I.maxObjectBytes || this.metadataBytes + g > I.maxMetadataBytes; )
1321
1326
  this.remove(this.records.keys().next().value), this.evictions++;
1322
- const C = { ...A, object: new Uint8Array(A.object), metadataBytes: I };
1323
- this.records.set(A.source, C), this.objectBytes += C.object.byteLength, this.metadataBytes += I;
1327
+ const C = { ...A, object: new Uint8Array(A.object), metadataBytes: g };
1328
+ this.records.set(A.source, C), this.objectBytes += C.object.byteLength, this.metadataBytes += g;
1324
1329
  }
1325
1330
  delete(A) {
1326
1331
  this.remove(A);
1327
1332
  }
1328
1333
  remove(A) {
1329
- const I = this.records.get(A);
1330
- I && (this.objectBytes -= I.object.byteLength, this.metadataBytes -= I.metadataBytes, this.records.delete(A));
1334
+ const g = this.records.get(A);
1335
+ g && (this.objectBytes -= g.object.byteLength, this.metadataBytes -= g.metadataBytes, this.records.delete(A));
1331
1336
  }
1332
1337
  clear() {
1333
1338
  this.records.clear(), this.staged.clear(), this.stagingFailed = !1, this.objectBytes = this.metadataBytes = 0;
@@ -1339,11 +1344,11 @@ class uA {
1339
1344
  entries: this.records.size,
1340
1345
  stagingEntries: this.staged.size,
1341
1346
  stagingObjectBytes: [...this.staged.values()].reduce(
1342
- (A, I) => A + I.object.byteLength,
1347
+ (A, g) => A + g.object.byteLength,
1343
1348
  0
1344
1349
  ),
1345
1350
  stagingMetadataBytes: [...this.staged.values()].reduce(
1346
- (A, I) => A + I.metadataBytes,
1351
+ (A, g) => A + g.metadataBytes,
1347
1352
  0
1348
1353
  ),
1349
1354
  evictions: this.evictions,
@@ -1351,10 +1356,10 @@ class uA {
1351
1356
  };
1352
1357
  }
1353
1358
  }
1354
- function eA(Q) {
1359
+ function vA(Q) {
1355
1360
  if (!WebAssembly.validate(Q) || Q.length < 8) return !1;
1356
- let A = 8, I = !1;
1357
- const g = () => {
1361
+ let A = 8, g = !1;
1362
+ const I = () => {
1358
1363
  let C = 0, B = 0;
1359
1364
  for (let E = 0; E < 5 && A < Q.length; E++, B += 7) {
1360
1365
  const D = Q[A++];
@@ -1364,20 +1369,20 @@ function eA(Q) {
1364
1369
  };
1365
1370
  try {
1366
1371
  for (; A < Q.length; ) {
1367
- const C = Q[A++], B = g(), E = A + B;
1372
+ const C = Q[A++], B = I(), E = A + B;
1368
1373
  if (E > Q.length || C === 8) return !1;
1369
1374
  if (C === 0) {
1370
- const D = g();
1375
+ const D = I();
1371
1376
  if (A + D > E) return !1;
1372
1377
  const w = new TextDecoder().decode(Q.subarray(A, A + D));
1373
1378
  if (A += D, w === "linking") {
1374
- if (I || g() !== 2) return !1;
1375
- I = !0;
1379
+ if (g || I() !== 2) return !1;
1380
+ g = !0;
1376
1381
  }
1377
1382
  }
1378
1383
  A = E;
1379
1384
  }
1380
- return I;
1385
+ return g;
1381
1386
  } catch {
1382
1387
  return !1;
1383
1388
  }
@@ -1395,12 +1400,12 @@ function c(Q) {
1395
1400
  class _A {
1396
1401
  name;
1397
1402
  data;
1398
- constructor(A, I) {
1399
- this.name = A, this.data = I;
1403
+ constructor(A, g) {
1404
+ this.name = A, this.data = g;
1400
1405
  }
1401
1406
  download() {
1402
- const A = new Uint8Array(this.data), I = new Blob([A]), g = URL.createObjectURL(I), C = document.createElement("a");
1403
- C.href = g, C.download = this.name, document.body.appendChild(C), C.click(), document.body.removeChild(C), URL.revokeObjectURL(g);
1407
+ const A = new Uint8Array(this.data), g = new Blob([A]), I = URL.createObjectURL(g), C = document.createElement("a");
1408
+ C.href = I, C.download = this.name, document.body.appendChild(C), C.click(), document.body.removeChild(C), URL.revokeObjectURL(I);
1404
1409
  }
1405
1410
  }
1406
1411
  class $A extends cA {
@@ -1437,8 +1442,8 @@ class $A extends cA {
1437
1442
  }
1438
1443
  artifactListener = (A) => {
1439
1444
  if (A.data.type !== "artifact") return;
1440
- const I = new _A(A.data.name, new Uint8Array(A.data.data));
1441
- this.emit("artifact", I);
1445
+ const g = new _A(A.data.name, new Uint8Array(A.data.data));
1446
+ this.emit("artifact", g);
1442
1447
  };
1443
1448
  attach(A) {
1444
1449
  A.addEventListener("message", this.artifactListener), this.dap.attach(A);
@@ -1450,27 +1455,27 @@ class $A extends cA {
1450
1455
  this.emit("event", A);
1451
1456
  }
1452
1457
  }
1453
- const AI = "glassjar-wasm:";
1454
- function II(Q, A) {
1455
- const I = new URL(String(Q), A);
1456
- if (I.protocol !== "https:" && I.protocol !== "http:")
1457
- throw new TypeError(`Engine Wasm must be served over http(s), not ${I.protocol}`);
1458
- return I.href;
1458
+ const Ag = "glassjar-wasm:";
1459
+ function gg(Q, A) {
1460
+ const g = new URL(String(Q), A);
1461
+ if (g.protocol !== "https:" && g.protocol !== "http:")
1462
+ throw new TypeError(`Engine Wasm must be served over http(s), not ${g.protocol}`);
1463
+ return g.href;
1459
1464
  }
1460
- function gI(Q) {
1465
+ function Ig(Q) {
1461
1466
  return new Worker(
1462
- "" + new URL("assets/worker-bkz0CBX9.js", import.meta.url).href,
1467
+ "" + new URL("assets/worker-D45G03b3.js", import.meta.url).href,
1463
1468
  {
1464
1469
  type: "module",
1465
1470
  name: Q?.name
1466
1471
  }
1467
1472
  );
1468
1473
  }
1469
- function CI(Q) {
1470
- return new gI(Q ? { name: AI + Q } : void 0);
1474
+ function Cg(Q) {
1475
+ return new Ig(Q ? { name: Ag + Q } : void 0);
1471
1476
  }
1472
- const JI = "/dev/debugger-sh-host";
1473
- class yA {
1477
+ const Jg = "/dev/debugger-sh-host";
1478
+ class KA {
1474
1479
  buffer = new SharedArrayBuffer(4 + 64 * 1024);
1475
1480
  length = new Int32Array(this.buffer, 0, 1);
1476
1481
  bytes = new Uint8Array(this.buffer, 4);
@@ -1487,7 +1492,7 @@ function iA(Q) {
1487
1492
  return new Error("Host device callback failed");
1488
1493
  }
1489
1494
  }
1490
- function UA(Q) {
1495
+ function RA(Q) {
1491
1496
  try {
1492
1497
  const A = Q?.();
1493
1498
  if (A && typeof A.then == "function")
@@ -1497,12 +1502,12 @@ function UA(Q) {
1497
1502
  return iA(A);
1498
1503
  }
1499
1504
  }
1500
- class QI {
1505
+ class Qg {
1501
1506
  constructor(A) {
1502
1507
  this.onFailure = A;
1503
1508
  }
1504
- incoming = new yA();
1505
- outgoing = new yA();
1509
+ incoming = new KA();
1510
+ outgoing = new KA();
1506
1511
  workerStart = {
1507
1512
  guest_to_host: this.incoming.buffer,
1508
1513
  host_to_guest: this.outgoing.buffer
@@ -1513,30 +1518,30 @@ class QI {
1513
1518
  worker;
1514
1519
  writing = !1;
1515
1520
  open(A) {
1516
- let I;
1521
+ let g;
1517
1522
  try {
1518
- I = A({
1523
+ g = A({
1519
1524
  signal: this.abort.signal,
1520
- onData: (g) => {
1521
- if (this.assertOpen(), typeof g != "function")
1525
+ onData: (I) => {
1526
+ if (this.assertOpen(), typeof I != "function")
1522
1527
  throw new TypeError("Host device listener must be a function");
1523
- return this.listeners.add(g), () => {
1524
- this.listeners.delete(g);
1528
+ return this.listeners.add(I), () => {
1529
+ this.listeners.delete(I);
1525
1530
  };
1526
1531
  },
1527
- write: (g) => this.write(g)
1532
+ write: (I) => this.write(I)
1528
1533
  });
1529
- } catch (g) {
1530
- throw iA(g);
1534
+ } catch (I) {
1535
+ throw iA(I);
1531
1536
  }
1532
- if (I !== void 0 && typeof I != "function")
1533
- throw Promise.resolve(I).catch(() => {
1537
+ if (g !== void 0 && typeof g != "function")
1538
+ throw Promise.resolve(g).catch(() => {
1534
1539
  }), new TypeError("Host device opener must return a cleanup function or undefined");
1535
- if (typeof I == "function")
1540
+ if (typeof g == "function")
1536
1541
  if (this.abort.signal.aborted) {
1537
- const g = UA(I);
1538
- if (g) throw g;
1539
- } else this.cleanup = I;
1542
+ const I = RA(g);
1543
+ if (I) throw I;
1544
+ } else this.cleanup = g;
1540
1545
  }
1541
1546
  attach(A) {
1542
1547
  this.assertOpen(), this.worker = A, A.addEventListener("message", this.onMessage);
@@ -1550,17 +1555,17 @@ class QI {
1550
1555
  if (this.writing) throw new Error("Await the previous host device write before writing again");
1551
1556
  this.writing = !0;
1552
1557
  try {
1553
- const I = new Uint8Array(A), g = this.outgoing;
1558
+ const g = new Uint8Array(A), I = this.outgoing;
1554
1559
  let C = 0;
1555
- for (; C < I.length; ) {
1560
+ for (; C < g.length; ) {
1556
1561
  this.assertOpen();
1557
- const B = Atomics.load(g.length, 0);
1562
+ const B = Atomics.load(I.length, 0);
1558
1563
  if (B !== 0) {
1559
- await Atomics.waitAsync(g.length, 0, B).value;
1564
+ await Atomics.waitAsync(I.length, 0, B).value;
1560
1565
  continue;
1561
1566
  }
1562
- const E = I.subarray(C, C + g.bytes.length);
1563
- g.bytes.set(E), g.publish(E.length), C += E.length;
1567
+ const E = g.subarray(C, C + I.bytes.length);
1568
+ I.bytes.set(E), I.publish(E.length), C += E.length;
1564
1569
  }
1565
1570
  } finally {
1566
1571
  this.writing = !1;
@@ -1569,16 +1574,16 @@ class QI {
1569
1574
  onMessage = (A) => {
1570
1575
  if (!(this.abort.signal.aborted || A.data?.type !== "host_wake"))
1571
1576
  try {
1572
- const I = Atomics.load(this.incoming.length, 0);
1573
- if (I <= 0) return;
1574
- const g = this.incoming.bytes.slice(0, I);
1577
+ const g = Atomics.load(this.incoming.length, 0);
1578
+ if (g <= 0) return;
1579
+ const I = this.incoming.bytes.slice(0, g);
1575
1580
  this.incoming.publish(0);
1576
1581
  for (const C of this.listeners) {
1577
1582
  if (this.abort.signal.aborted) break;
1578
- Promise.resolve(C(g)).catch((B) => this.fail(B));
1583
+ Promise.resolve(C(I)).catch((B) => this.fail(B));
1579
1584
  }
1580
- } catch (I) {
1581
- this.fail(I);
1585
+ } catch (g) {
1586
+ this.fail(g);
1582
1587
  }
1583
1588
  };
1584
1589
  fail(A) {
@@ -1588,10 +1593,10 @@ class QI {
1588
1593
  if (this.abort.signal.aborted) return;
1589
1594
  this.worker?.removeEventListener("message", this.onMessage), this.worker = void 0, this.incoming.publish(-1), this.outgoing.publish(-1), this.abort.abort(), this.listeners.clear();
1590
1595
  const A = this.cleanup;
1591
- return this.cleanup = void 0, UA(A);
1596
+ return this.cleanup = void 0, RA(A);
1592
1597
  }
1593
1598
  }
1594
- const BI = [
1599
+ const Bg = [
1595
1600
  "__future__",
1596
1601
  "_abc",
1597
1602
  "_aix_support",
@@ -1896,16 +1901,16 @@ const BI = [
1896
1901
  "zipimport",
1897
1902
  "zlib",
1898
1903
  "zoneinfo"
1899
- ], IA = "3.15.2", EI = "/usr/local/lib/python3.15/site-packages", RA = "https://pypi.org/pypi", DI = "files.pythonhosted.org", l = {
1904
+ ], gA = "3.15.2", Eg = "/usr/local/lib/python3.15/site-packages", UA = "https://pypi.org/pypi", Dg = "files.pythonhosted.org", l = {
1900
1905
  packages: 50,
1901
1906
  downloadBytes: 60 * 1024 * 1024,
1902
1907
  files: 5e3,
1903
1908
  unpackedBytes: 200 * 1024 * 1024
1904
- }, wI = {
1905
- python_version: IA.split(".").slice(0, 2).join("."),
1906
- python_full_version: IA,
1909
+ }, wg = {
1910
+ python_version: gA.split(".").slice(0, 2).join("."),
1911
+ python_full_version: gA,
1907
1912
  implementation_name: "cpython",
1908
- implementation_version: IA,
1913
+ implementation_version: gA,
1909
1914
  platform_python_implementation: "CPython",
1910
1915
  os_name: "posix",
1911
1916
  sys_platform: "wasi",
@@ -1931,16 +1936,16 @@ const BI = [
1931
1936
  skimage: "scikit-image",
1932
1937
  google: "protobuf",
1933
1938
  _pytest: "pytest"
1934
- }, iI = new Set(BI), JA = /^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$/;
1935
- function W(Q) {
1939
+ }, ig = new Set(Bg), JA = /^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$/;
1940
+ function V(Q) {
1936
1941
  return Q.toLowerCase().replace(/[-_.]+/g, "-");
1937
1942
  }
1938
- function oI(Q) {
1943
+ function og(Q) {
1939
1944
  const A = /* @__PURE__ */ new Set();
1940
- for (const I of Q.split(`
1945
+ for (const g of Q.split(`
1941
1946
  `)) {
1942
- const g = I.replace(/#.*/, "").trim();
1943
- let C = /^import\s+(.+)$/.exec(g);
1947
+ const I = g.replace(/#.*/, "").trim();
1948
+ let C = /^import\s+(.+)$/.exec(I);
1944
1949
  if (C) {
1945
1950
  for (const B of C[1].split(",")) {
1946
1951
  const E = B.trim().split(/\s+/)[0]?.split(".")[0];
@@ -1948,132 +1953,132 @@ function oI(Q) {
1948
1953
  }
1949
1954
  continue;
1950
1955
  }
1951
- C = /^from\s+([A-Za-z_][\w.]*)\s+import\b/.exec(g), C && A.add(C[1].split(".")[0]);
1956
+ C = /^from\s+([A-Za-z_][\w.]*)\s+import\b/.exec(I), C && A.add(C[1].split(".")[0]);
1952
1957
  }
1953
1958
  return A;
1954
1959
  }
1955
- function NI(Q) {
1956
- const A = /* @__PURE__ */ new Set(), I = [];
1957
- let g = "";
1960
+ function Ng(Q) {
1961
+ const A = /* @__PURE__ */ new Set(), g = [];
1962
+ let I = "";
1958
1963
  const C = (E, D) => {
1959
1964
  for (const [w, N] of Object.entries(E))
1960
- typeof N == "string" ? (w.endsWith(".py") && (I.push(N), D || A.add(w.slice(0, -3))), !D && w === "requirements.txt" && (g = N)) : (D || A.add(w), C(N, `${D}/${w}`));
1965
+ typeof N == "string" ? (w.endsWith(".py") && (g.push(N), D || A.add(w.slice(0, -3))), !D && w === "requirements.txt" && (I = N)) : (D || A.add(w), C(N, `${D}/${w}`));
1961
1966
  };
1962
1967
  C(Q, "");
1963
1968
  const B = /* @__PURE__ */ new Map();
1964
- for (const E of I)
1965
- for (const D of oI(E)) {
1966
- if (iI.has(D) || A.has(D) || D.startsWith("_") && !(D in YA))
1969
+ for (const E of g)
1970
+ for (const D of og(E)) {
1971
+ if (ig.has(D) || A.has(D) || D.startsWith("_") && !(D in YA))
1967
1972
  continue;
1968
1973
  const w = YA[D] ?? D;
1969
- B.set(W(w), w);
1974
+ B.set(V(w), w);
1970
1975
  }
1971
- for (const E of g.split(`
1976
+ for (const E of I.split(`
1972
1977
  `)) {
1973
1978
  const D = E.replace(/#.*/, "").trim();
1974
1979
  if (!D || D.startsWith("-")) continue;
1975
1980
  const w = /^[A-Za-z0-9][A-Za-z0-9._-]*/.exec(D)?.[0];
1976
- w && B.set(W(w), D);
1981
+ w && B.set(V(w), D);
1977
1982
  }
1978
1983
  return [...B.values()].sort();
1979
1984
  }
1980
- function v(Q) {
1985
+ function e(Q) {
1981
1986
  const A = /^v?(?:\d+!)?(\d+(?:\.\d+)*)(?:[-_.]?(a|b|c|rc|alpha|beta|pre|preview)[-_.]?(\d*))?(?:-(\d+)|[-_.]?(?:post|rev|r)[-_.]?(\d*))?(?:[-_.]?dev[-_.]?(\d*))?(?:\+[a-z0-9.]+)?$/i.exec(
1982
1987
  Q.trim()
1983
1988
  );
1984
1989
  if (!A) return null;
1985
- const I = A[2]?.toLowerCase(), g = I ? { a: 0, alpha: 0, b: 1, beta: 1, c: 2, rc: 2, pre: 2, preview: 2 }[I] : void 0;
1990
+ const g = A[2]?.toLowerCase(), I = g ? { a: 0, alpha: 0, b: 1, beta: 1, c: 2, rc: 2, pre: 2, preview: 2 }[g] : void 0;
1986
1991
  return {
1987
1992
  release: A[1].split(".").map(Number),
1988
- pre: g === void 0 ? void 0 : [g, Number(A[3] || 0)],
1993
+ pre: I === void 0 ? void 0 : [I, Number(A[3] || 0)],
1989
1994
  post: A[4] !== void 0 ? Number(A[4]) : A[5] !== void 0 ? Number(A[5] || 0) : void 0,
1990
1995
  dev: A[6] !== void 0 ? Number(A[6] || 0) : void 0,
1991
1996
  text: Q
1992
1997
  };
1993
1998
  }
1994
- function aA(Q, A) {
1995
- const I = Math.max(Q.release.length, A.release.length);
1996
- for (let E = 0; E < I; E++) {
1999
+ function HA(Q, A) {
2000
+ const g = Math.max(Q.release.length, A.release.length);
2001
+ for (let E = 0; E < g; E++) {
1997
2002
  const D = (Q.release[E] ?? 0) - (A.release[E] ?? 0);
1998
2003
  if (D) return Math.sign(D);
1999
2004
  }
2000
- const g = (E) => [
2005
+ const I = (E) => [
2001
2006
  E.pre ? 0 : E.dev !== void 0 && E.post === void 0 ? -1 : 1,
2002
2007
  E.pre?.[0] ?? 0,
2003
2008
  E.pre?.[1] ?? 0,
2004
2009
  E.post ?? -1,
2005
2010
  E.dev ?? Number.POSITIVE_INFINITY
2006
- ], C = g(Q), B = g(A);
2011
+ ], C = I(Q), B = I(A);
2007
2012
  for (let E = 0; E < C.length; E++) if (C[E] !== B[E]) return Math.sign(C[E] - B[E]);
2008
2013
  return 0;
2009
2014
  }
2010
2015
  const hA = (Q) => Q.pre !== void 0 || Q.dev !== void 0;
2011
2016
  function oA(Q, A) {
2012
- for (const I of A.split(",")) {
2013
- const g = I.trim();
2014
- if (!g) continue;
2015
- const C = /^(~=|===|==|!=|<=|>=|<|>)\s*(.+)$/.exec(g);
2017
+ for (const g of A.split(",")) {
2018
+ const I = g.trim();
2019
+ if (!I) continue;
2020
+ const C = /^(~=|===|==|!=|<=|>=|<|>)\s*(.+)$/.exec(I);
2016
2021
  if (!C) return !1;
2017
2022
  const [, B, E] = C;
2018
2023
  if ((B === "==" || B === "!=") && E.endsWith(".*")) {
2019
- if (E.slice(0, -2).split(".").map(Number).every((U, h) => (Q.release[h] ?? 0) === U) !== (B === "==")) return !1;
2024
+ if (E.slice(0, -2).split(".").map(Number).every((R, h) => (Q.release[h] ?? 0) === R) !== (B === "==")) return !1;
2020
2025
  continue;
2021
2026
  }
2022
- const D = v(E);
2027
+ const D = e(E);
2023
2028
  if (!D) return !1;
2024
- const w = aA(Q, D);
2029
+ const w = HA(Q, D);
2025
2030
  if (B === "~=") {
2026
2031
  const N = D.release.slice(0, Math.max(1, D.release.length - 1));
2027
- if (w < 0 || !N.every((k, U) => (Q.release[U] ?? 0) === k)) return !1;
2032
+ if (w < 0 || !N.every((G, R) => (Q.release[R] ?? 0) === G)) return !1;
2028
2033
  } else if (!(B === "==" || B === "===" ? w === 0 : B === "!=" ? w !== 0 : B === "<=" ? w <= 0 : B === ">=" ? w >= 0 : B === "<" ? w < 0 : w > 0))
2029
2034
  return !1;
2030
2035
  }
2031
2036
  return !0;
2032
2037
  }
2033
2038
  function SA(Q) {
2034
- const [A, I] = Q.split(";", 2).map((C) => C.trim()), g = /^([A-Za-z0-9][A-Za-z0-9._-]*)\s*(?:\[([^\]]*)\])?\s*\(?\s*([^)]*?)\s*\)?$/.exec(
2039
+ const [A, g] = Q.split(";", 2).map((C) => C.trim()), I = /^([A-Za-z0-9][A-Za-z0-9._-]*)\s*(?:\[([^\]]*)\])?\s*\(?\s*([^)]*?)\s*\)?$/.exec(
2035
2040
  A
2036
2041
  );
2037
- return !g || g[3].includes("@") ? null : {
2038
- name: g[1],
2039
- extras: (g[2] ?? "").split(",").map((C) => C.trim()).filter(Boolean),
2040
- specifiers: g[3].replace(/\s+/g, ""),
2041
- marker: I || void 0
2042
+ return !I || I[3].includes("@") ? null : {
2043
+ name: I[1],
2044
+ extras: (I[2] ?? "").split(",").map((C) => C.trim()).filter(Boolean),
2045
+ specifiers: I[3].replace(/\s+/g, ""),
2046
+ marker: g || void 0
2042
2047
  };
2043
2048
  }
2044
- function FI(Q, A = []) {
2045
- const I = Q.match(
2049
+ function Fg(Q, A = []) {
2050
+ const g = Q.match(
2046
2051
  /\(|\)|'[^']*'|"[^"]*"|===|==|!=|<=|>=|~=|<|>|\bnot\s+in\b|\bin\b|\band\b|\bor\b|[A-Za-z_][A-Za-z0-9_.]*/g
2047
2052
  ) ?? [];
2048
- let g = 0;
2049
- const C = (N) => /^['"]/.test(N) ? { text: N.slice(1, -1) } : N === "extra" ? { text: "", variable: "extra" } : { text: wI[N] ?? "", variable: N }, B = (N, k, U) => {
2050
- if (N.variable === "extra" || U.variable === "extra") {
2051
- const R = W((N.variable === "extra" ? U : N).text), H = A.some((j) => W(j) === R);
2052
- return k === "!=" ? !H : H;
2053
+ let I = 0;
2054
+ const C = (N) => /^['"]/.test(N) ? { text: N.slice(1, -1) } : N === "extra" ? { text: "", variable: "extra" } : { text: wg[N] ?? "", variable: N }, B = (N, G, R) => {
2055
+ if (N.variable === "extra" || R.variable === "extra") {
2056
+ const U = V((N.variable === "extra" ? R : N).text), a = A.some((O) => V(O) === U);
2057
+ return G === "!=" ? !a : a;
2053
2058
  }
2054
- if (k === "in") return U.text.includes(N.text);
2055
- if (/^not\s+in$/.test(k)) return !U.text.includes(N.text);
2056
- if (!N.variable && U.variable)
2057
- return B(U, { "<": ">", ">": "<", "<=": ">=", ">=": "<=" }[k] ?? k, N);
2058
- const h = v(N.text), K = v(U.text);
2059
- return h && K && /version/.test(N.variable ?? "") ? oA(h, `${k}${U.text}`) : k === "==" || k === "===" ? N.text === U.text : k === "!=" ? N.text !== U.text : !1;
2059
+ if (G === "in") return R.text.includes(N.text);
2060
+ if (/^not\s+in$/.test(G)) return !R.text.includes(N.text);
2061
+ if (!N.variable && R.variable)
2062
+ return B(R, { "<": ">", ">": "<", "<=": ">=", ">=": "<=" }[G] ?? G, N);
2063
+ const h = e(N.text), y = e(R.text);
2064
+ return h && y && /version/.test(N.variable ?? "") ? oA(h, `${G}${R.text}`) : G === "==" || G === "===" ? N.text === R.text : G === "!=" ? N.text !== R.text : !1;
2060
2065
  }, E = () => {
2061
- if (I[g] === "(") {
2062
- g++;
2066
+ if (g[I] === "(") {
2067
+ I++;
2063
2068
  const h = w();
2064
- return g++, h;
2069
+ return I++, h;
2065
2070
  }
2066
- const N = C(I[g++]), k = I[g++], U = C(I[g++]);
2067
- return B(N, k, U);
2071
+ const N = C(g[I++]), G = g[I++], R = C(g[I++]);
2072
+ return B(N, G, R);
2068
2073
  }, D = () => {
2069
2074
  let N = E();
2070
- for (; I[g] === "and"; )
2071
- g++, N = E() && N;
2075
+ for (; g[I] === "and"; )
2076
+ I++, N = E() && N;
2072
2077
  return N;
2073
2078
  }, w = () => {
2074
2079
  let N = D();
2075
- for (; I[g] === "or"; )
2076
- g++, N = D() || N;
2080
+ for (; g[I] === "or"; )
2081
+ I++, N = D() || N;
2077
2082
  return N;
2078
2083
  };
2079
2084
  try {
@@ -2082,36 +2087,36 @@ function FI(Q, A = []) {
2082
2087
  return !1;
2083
2088
  }
2084
2089
  }
2085
- function GI(Q) {
2090
+ function Mg(Q) {
2086
2091
  if (Q.packagetype !== "bdist_wheel" || Q.yanked) return !1;
2087
2092
  const A = Q.filename.replace(/\.whl$/, "").split("-").slice(-3);
2088
- return A.length === 3 && A[1] === "none" && A[2] === "any" && A[0].split(".").some((I) => I === "py3" || I.startsWith("py3"));
2093
+ return A.length === 3 && A[1] === "none" && A[2] === "any" && A[0].split(".").some((g) => g === "py3" || g.startsWith("py3"));
2089
2094
  }
2090
- function MI(Q) {
2091
- return Q ? oA(v(IA), Q.replace(/\s+/g, "")) : !0;
2095
+ function kg(Q) {
2096
+ return Q ? oA(e(gA), Q.replace(/\s+/g, "")) : !0;
2092
2097
  }
2093
- class kI {
2094
- constructor(A = (I, g) => fetch(I, g)) {
2098
+ class Gg {
2099
+ constructor(A = (g, I) => fetch(g, I)) {
2095
2100
  this.fetchImpl = A;
2096
2101
  }
2097
2102
  projects = /* @__PURE__ */ new Map();
2098
2103
  metadata = /* @__PURE__ */ new Map();
2099
2104
  wheels = /* @__PURE__ */ new Map();
2100
2105
  project(A) {
2101
- const I = W(A);
2102
- let g = this.projects.get(I);
2103
- return g || (g = this.fetchImpl(`${RA}/${encodeURIComponent(I)}/json`).then(
2106
+ const g = V(A);
2107
+ let I = this.projects.get(g);
2108
+ return I || (I = this.fetchImpl(`${UA}/${encodeURIComponent(g)}/json`).then(
2104
2109
  async (C) => C.ok ? await C.json() : null,
2105
2110
  () => null
2106
- ), this.projects.set(I, g)), g;
2111
+ ), this.projects.set(g, I)), I;
2107
2112
  }
2108
2113
  /** requires_dist of one release (the project JSON only carries the latest's). */
2109
- requiresDist(A, I, g) {
2110
- if (g.info.version === I) return Promise.resolve(g.info.requires_dist ?? []);
2111
- const C = `${W(A)}@${I}`;
2114
+ requiresDist(A, g, I) {
2115
+ if (I.info.version === g) return Promise.resolve(I.info.requires_dist ?? []);
2116
+ const C = `${V(A)}@${g}`;
2112
2117
  let B = this.metadata.get(C);
2113
2118
  return B || (B = this.fetchImpl(
2114
- `${RA}/${encodeURIComponent(W(A))}/${encodeURIComponent(I)}/json`
2119
+ `${UA}/${encodeURIComponent(V(A))}/${encodeURIComponent(g)}/json`
2115
2120
  ).then(
2116
2121
  async (E) => E.ok ? (await E.json()).info.requires_dist ?? [] : [],
2117
2122
  () => []
@@ -2121,67 +2126,67 @@ class kI {
2121
2126
  * Resolves requirements and their dependencies to pure-Python wheels. Greedy: the newest
2122
2127
  * release that fits every constraint seen so far for that project.
2123
2128
  */
2124
- async resolve(A, I = () => {
2129
+ async resolve(A, g = () => {
2125
2130
  }) {
2126
- const g = /* @__PURE__ */ new Map(), C = [];
2131
+ const I = /* @__PURE__ */ new Map(), C = [];
2127
2132
  for (const B of A) {
2128
2133
  const E = SA(B);
2129
2134
  E && JA.test(E.name) && C.push({ requirement: E, top: !0 });
2130
2135
  }
2131
2136
  for (; C.length; ) {
2132
- const { requirement: B, top: E } = C.shift(), D = W(B.name);
2133
- if (g.has(D)) continue;
2134
- if (g.size >= l.packages) break;
2137
+ const { requirement: B, top: E } = C.shift(), D = V(B.name);
2138
+ if (I.has(D)) continue;
2139
+ if (I.size >= l.packages) break;
2135
2140
  const w = await this.project(B.name);
2136
2141
  if (!w) {
2137
- E && I({ kind: "skipped", message: `${B.name}: not found on PyPI` });
2142
+ E && g({ kind: "skipped", message: `${B.name}: not found on PyPI` });
2138
2143
  continue;
2139
2144
  }
2140
- const N = Object.entries(w.releases).map(([K, R]) => ({ version: v(K), files: R })).filter(
2141
- (K) => K.version !== null && oA(K.version, B.specifiers)
2142
- ).sort((K, R) => aA(R.version, K.version)), U = [...N.filter((K) => !hA(K.version)), ...N.filter((K) => hA(K.version))].map((K) => ({
2143
- version: K.version,
2144
- wheel: K.files.find((R) => GI(R) && MI(R.requires_python))
2145
- })).find((K) => K.wheel);
2146
- if (!U?.wheel) {
2147
- const K = N.some(
2148
- (R) => R.files.some((H) => H.packagetype === "bdist_wheel")
2145
+ const N = Object.entries(w.releases).map(([y, U]) => ({ version: e(y), files: U })).filter(
2146
+ (y) => y.version !== null && oA(y.version, B.specifiers)
2147
+ ).sort((y, U) => HA(U.version, y.version)), R = [...N.filter((y) => !hA(y.version)), ...N.filter((y) => hA(y.version))].map((y) => ({
2148
+ version: y.version,
2149
+ wheel: y.files.find((U) => Mg(U) && kg(U.requires_python))
2150
+ })).find((y) => y.wheel);
2151
+ if (!R?.wheel) {
2152
+ const y = N.some(
2153
+ (U) => U.files.some((a) => a.packagetype === "bdist_wheel")
2149
2154
  );
2150
- I({
2155
+ g({
2151
2156
  kind: "skipped",
2152
- message: K ? `${w.info.name} has compiled code, which can't run in the browser` : `${w.info.name}: no Python 3.15 wheel on PyPI`
2157
+ message: y ? `${w.info.name} has compiled code, which can't run in the browser` : `${w.info.name}: no Python 3.15 wheel on PyPI`
2153
2158
  });
2154
2159
  continue;
2155
2160
  }
2156
- const h = new URL(U.wheel.url);
2157
- if (!(h.protocol !== "https:" || h.hostname !== DI)) {
2158
- g.set(D, {
2161
+ const h = new URL(R.wheel.url);
2162
+ if (!(h.protocol !== "https:" || h.hostname !== Dg)) {
2163
+ I.set(D, {
2159
2164
  name: w.info.name,
2160
- version: U.version.text,
2161
- url: U.wheel.url,
2162
- sha256: U.wheel.digests.sha256,
2163
- size: U.wheel.size
2165
+ version: R.version.text,
2166
+ url: R.wheel.url,
2167
+ sha256: R.wheel.digests.sha256,
2168
+ size: R.wheel.size
2164
2169
  });
2165
- for (const K of await this.requiresDist(
2170
+ for (const y of await this.requiresDist(
2166
2171
  B.name,
2167
- U.version.text,
2172
+ R.version.text,
2168
2173
  w
2169
2174
  )) {
2170
- const R = SA(K);
2171
- !R || !JA.test(R.name) || R.marker && !FI(R.marker, B.extras) || C.push({ requirement: R, top: !1 });
2175
+ const U = SA(y);
2176
+ !U || !JA.test(U.name) || U.marker && !Fg(U.marker, B.extras) || C.push({ requirement: U, top: !1 });
2172
2177
  }
2173
2178
  }
2174
2179
  }
2175
- return [...g.values()];
2180
+ return [...I.values()];
2176
2181
  }
2177
2182
  /** Files to mount, by absolute path in the run, for these resolved packages. */
2178
- async install(A, I = () => {
2183
+ async install(A, g = () => {
2179
2184
  }) {
2180
- const g = {};
2185
+ const I = {};
2181
2186
  let C = 0, B = 0;
2182
2187
  for (const E of A) {
2183
2188
  if (C += E.size, C > l.downloadBytes) {
2184
- I({
2189
+ g({
2185
2190
  kind: "skipped",
2186
2191
  message: `${E.name}: over the ${l.downloadBytes >> 20}MB package limit`
2187
2192
  });
@@ -2189,70 +2194,70 @@ class kI {
2189
2194
  }
2190
2195
  const D = `${E.url}#${E.sha256}`;
2191
2196
  let w = this.wheels.get(D);
2192
- w || (I({ kind: "installing", message: `Installing ${E.name} ${E.version}` }), w = this.download(E), this.wheels.set(D, w), w.catch(() => this.wheels.delete(D)));
2197
+ w || (g({ kind: "installing", message: `Installing ${E.name} ${E.version}` }), w = this.download(E), this.wheels.set(D, w), w.catch(() => this.wheels.delete(D)));
2193
2198
  let N;
2194
2199
  try {
2195
2200
  N = await w;
2196
- } catch (k) {
2197
- I({
2201
+ } catch (G) {
2202
+ g({
2198
2203
  kind: "skipped",
2199
- message: `${E.name}: ${k instanceof Error ? k.message : String(k)}`
2204
+ message: `${E.name}: ${G instanceof Error ? G.message : String(G)}`
2200
2205
  });
2201
2206
  continue;
2202
2207
  }
2203
- for (const [k, U] of N) {
2208
+ for (const [G, R] of N) {
2204
2209
  if (++B > l.files) break;
2205
- g[`${EI}/${k}`] = U;
2210
+ I[`${Eg}/${G}`] = R;
2206
2211
  }
2207
2212
  }
2208
- return g;
2213
+ return I;
2209
2214
  }
2210
2215
  async download(A) {
2211
- const I = await this.fetchImpl(A.url, { cache: "force-cache" });
2212
- if (!I.ok) throw new Error(`download failed (${I.status})`);
2213
- const g = new Uint8Array(await I.arrayBuffer());
2214
- if ([...new Uint8Array(await crypto.subtle.digest("SHA-256", g))].map((B) => B.toString(16).padStart(2, "0")).join("") !== A.sha256) throw new Error("download did not match PyPI's checksum");
2215
- return KI(await UI(g, l.unpackedBytes));
2216
+ const g = await this.fetchImpl(A.url, { cache: "force-cache" });
2217
+ if (!g.ok) throw new Error(`download failed (${g.status})`);
2218
+ const I = new Uint8Array(await g.arrayBuffer());
2219
+ if ([...new Uint8Array(await crypto.subtle.digest("SHA-256", I))].map((B) => B.toString(16).padStart(2, "0")).join("") !== A.sha256) throw new Error("download did not match PyPI's checksum");
2220
+ return yg(await Rg(I, l.unpackedBytes));
2216
2221
  }
2217
2222
  }
2218
- function KI(Q) {
2223
+ function yg(Q) {
2219
2224
  const A = /* @__PURE__ */ new Map();
2220
- for (const [I, g] of Q) {
2221
- const C = /^[^/]+\.data\/(purelib|platlib)\/(.+)$/.exec(I);
2222
- C ? A.set(C[2], g) : /^[^/]+\.data\//.test(I) || A.set(I, g);
2225
+ for (const [g, I] of Q) {
2226
+ const C = /^[^/]+\.data\/(purelib|platlib)\/(.+)$/.exec(g);
2227
+ C ? A.set(C[2], I) : /^[^/]+\.data\//.test(g) || A.set(g, I);
2223
2228
  }
2224
2229
  return A;
2225
2230
  }
2226
- function yI(Q) {
2231
+ function Kg(Q) {
2227
2232
  return Q.length > 0 && !Q.startsWith("/") && !Q.includes("\\") && !Q.includes("\0") && !Q.split("/").some((A) => A === ".." || A === ".");
2228
2233
  }
2229
- async function UI(Q, A) {
2230
- const I = new DataView(Q.buffer, Q.byteOffset, Q.byteLength);
2231
- let g = -1;
2234
+ async function Rg(Q, A) {
2235
+ const g = new DataView(Q.buffer, Q.byteOffset, Q.byteLength);
2236
+ let I = -1;
2232
2237
  for (let N = Q.length - 22; N >= Math.max(0, Q.length - 22 - 65535); N--)
2233
- if (I.getUint32(N, !0) === 101010256) {
2234
- g = N;
2238
+ if (g.getUint32(N, !0) === 101010256) {
2239
+ I = N;
2235
2240
  break;
2236
2241
  }
2237
- if (g < 0) throw new Error("not a zip archive");
2238
- const C = I.getUint16(g + 10, !0);
2239
- let B = I.getUint32(g + 16, !0);
2242
+ if (I < 0) throw new Error("not a zip archive");
2243
+ const C = g.getUint16(I + 10, !0);
2244
+ let B = g.getUint32(I + 16, !0);
2240
2245
  const E = /* @__PURE__ */ new Map();
2241
2246
  let D = 0;
2242
2247
  const w = new TextDecoder();
2243
2248
  for (let N = 0; N < C; N++) {
2244
- if (I.getUint32(B, !0) !== 33639248) throw new Error("corrupt zip directory");
2245
- const k = I.getUint16(B + 10, !0), U = I.getUint32(B + 20, !0), h = I.getUint32(B + 24, !0), K = I.getUint16(B + 28, !0), R = I.getUint16(B + 30, !0), H = I.getUint16(B + 32, !0), j = I.getUint32(B + 42, !0), s = w.decode(Q.subarray(B + 46, B + 46 + K));
2246
- if (B += 46 + K + R + H, s.endsWith("/")) continue;
2247
- if (!yI(s)) throw new Error(`unsafe path in package: ${s}`);
2249
+ if (g.getUint32(B, !0) !== 33639248) throw new Error("corrupt zip directory");
2250
+ const G = g.getUint16(B + 10, !0), R = g.getUint32(B + 20, !0), h = g.getUint32(B + 24, !0), y = g.getUint16(B + 28, !0), U = g.getUint16(B + 30, !0), a = g.getUint16(B + 32, !0), O = g.getUint32(B + 42, !0), s = w.decode(Q.subarray(B + 46, B + 46 + y));
2251
+ if (B += 46 + y + U + a, s.endsWith("/")) continue;
2252
+ if (!Kg(s)) throw new Error(`unsafe path in package: ${s}`);
2248
2253
  if (D += h, D > A) throw new Error("package too large");
2249
- const u = j + 30 + I.getUint16(j + 26, !0) + I.getUint16(j + 28, !0), V = Q.subarray(u, u + U);
2254
+ const u = O + 30 + g.getUint16(O + 26, !0) + g.getUint16(O + 28, !0), T = Q.subarray(u, u + R);
2250
2255
  let o;
2251
- if (k === 0) o = V.slice();
2252
- else if (k === 8)
2256
+ if (G === 0) o = T.slice();
2257
+ else if (G === 8)
2253
2258
  o = new Uint8Array(
2254
2259
  await new Response(
2255
- new Blob([V.slice()]).stream().pipeThrough(new DecompressionStream("deflate-raw"))
2260
+ new Blob([T.slice()]).stream().pipeThrough(new DecompressionStream("deflate-raw"))
2256
2261
  ).arrayBuffer()
2257
2262
  );
2258
2263
  else throw new Error(`unsupported compression in package: ${s}`);
@@ -2261,38 +2266,38 @@ async function UI(Q, A) {
2261
2266
  }
2262
2267
  return E;
2263
2268
  }
2264
- const P = {
2269
+ const f = {
2265
2270
  installer: void 0,
2266
2271
  sets: /* @__PURE__ */ new Map()
2267
2272
  };
2268
- async function RI(Q, A = () => {
2273
+ async function Ug(Q, A = () => {
2269
2274
  }) {
2270
- const I = NI(Q);
2271
- if (!I.length) return {};
2272
- const g = I.join(`
2275
+ const g = Ng(Q);
2276
+ if (!g.length) return {};
2277
+ const I = g.join(`
2273
2278
  `);
2274
- let C = P.sets.get(g);
2279
+ let C = f.sets.get(I);
2275
2280
  if (!C) {
2276
- P.installer ??= new kI();
2277
- const D = P.installer, w = [], N = (k) => {
2278
- k.kind === "skipped" ? w.push(k) : A(k);
2281
+ f.installer ??= new Gg();
2282
+ const D = f.installer, w = [], N = (G) => {
2283
+ G.kind === "skipped" ? w.push(G) : A(G);
2279
2284
  };
2280
- C = D.resolve(I, N).then(async (k) => ({ files: await D.install(k, N), notes: w })), P.sets.set(g, C), C.catch(() => P.sets.delete(g));
2285
+ C = D.resolve(g, N).then(async (G) => ({ files: await D.install(G, N), notes: w })), f.sets.set(I, C), C.catch(() => f.sets.delete(I));
2281
2286
  }
2282
2287
  const { files: B, notes: E } = await C;
2283
2288
  for (const D of E) A(D);
2284
2289
  return B;
2285
2290
  }
2286
- const YI = [
2291
+ const Yg = [
2287
2292
  "4847c7cda81eb51b1cec18fe40b396605579fe84e17eca2760702b8a9666e4e1"
2288
2293
  ], CA = Object.freeze({
2289
2294
  compiler: "d6b8d6e4596136fc6ae451fe3b81b1be5a1829505cbc993179247c75a764ce87",
2290
2295
  sysroot: "8745c6af23fd841fa507d0c73f6b6b8e8da1b4ec216a6339739a28b38ff7227b",
2291
2296
  exceptions: "20986166552953de0e3ca5c1e9f341e7aec8b9ba54dcb244d0d2b2f9ca843ab4"
2292
2297
  });
2293
- function HA(Q = "legacy") {
2298
+ function aA(Q = "legacy") {
2294
2299
  if (Q === "legacy") return { profile: Q, digests: CA };
2295
- if (Q === "stock-certified-v1" && YI.length > 0)
2300
+ if (Q === "stock-certified-v1" && Yg.length > 0)
2296
2301
  return { profile: Q, digests: CA };
2297
2302
  throw new Error(`The ${Q} toolchain is not available in this build`);
2298
2303
  }
@@ -2300,19 +2305,19 @@ class r {
2300
2305
  #A;
2301
2306
  hashCount = 3;
2302
2307
  hashMs;
2303
- constructor(A, I) {
2304
- this.#A = A, this.hashMs = I;
2308
+ constructor(A, g) {
2309
+ this.#A = A, this.hashMs = g;
2305
2310
  }
2306
- static async load(A, I, g, C = CA.exceptions, B = "legacy") {
2307
- const E = HA(B);
2311
+ static async load(A, g, I, C = CA.exceptions, B = "legacy") {
2312
+ const E = aA(B);
2308
2313
  if (A.length !== 2) throw new Error("Missing C++ toolchain assets");
2309
2314
  let D, w;
2310
2315
  const N = await Promise.allSettled(
2311
- A.map(async (H, j) => {
2316
+ A.map(async (a, O) => {
2312
2317
  try {
2313
- const s = await fetch(H, { cache: "force-cache", signal: g });
2318
+ const s = await fetch(a, { cache: "force-cache", signal: I });
2314
2319
  if (!s.ok) throw new Error(`Cannot load C++ toolchain (${s.status})`);
2315
- return j === 0 && I && typeof WebAssembly.compileStreaming == "function" && typeof s.clone == "function" && (w = WebAssembly.compileStreaming(s.clone()).catch(() => {
2320
+ return O === 0 && g && typeof WebAssembly.compileStreaming == "function" && typeof s.clone == "function" && (w = WebAssembly.compileStreaming(s.clone()).catch(() => {
2316
2321
  })), new Uint8Array(await s.arrayBuffer());
2317
2322
  } catch (s) {
2318
2323
  throw D ??= { error: s }, s;
@@ -2321,37 +2326,37 @@ class r {
2321
2326
  );
2322
2327
  if (N[0].status === "rejected" || N[1].status === "rejected")
2323
2328
  throw D?.error;
2324
- const [k, U] = [N[0].value, N[1].value], [h, K] = await Promise.allSettled([
2325
- r.ingestOwned(k, U, !1, C),
2326
- I ? (w ?? Promise.resolve(void 0)).then(
2327
- (H) => H ?? WebAssembly.compile(k)
2329
+ const [G, R] = [N[0].value, N[1].value], [h, y] = await Promise.allSettled([
2330
+ r.ingestOwned(G, R, !1, C),
2331
+ g ? (w ?? Promise.resolve(void 0)).then(
2332
+ (a) => a ?? WebAssembly.compile(G)
2328
2333
  ) : Promise.resolve(void 0)
2329
2334
  ]);
2330
2335
  if (h.status === "rejected") throw h.reason;
2331
- const R = h.value;
2332
- if (R.#A.compilerHash !== E.digests.compiler || R.#A.sysrootHash !== E.digests.sysroot || R.#A.exceptionsHash !== E.digests.exceptions)
2336
+ const U = h.value;
2337
+ if (U.#A.compilerHash !== E.digests.compiler || U.#A.sysrootHash !== E.digests.sysroot || U.#A.exceptionsHash !== E.digests.exceptions)
2333
2338
  throw new Error("C++ toolchain integrity mismatch");
2334
- if (g?.aborted) throw new DOMException("Toolchain loading aborted", "AbortError");
2335
- if (K.status === "rejected") throw K.reason;
2336
- return R.#A.stockProfile = E.profile === "stock-certified-v1", R.#A.module = K.value, R;
2339
+ if (I?.aborted) throw new DOMException("Toolchain loading aborted", "AbortError");
2340
+ if (y.status === "rejected") throw y.reason;
2341
+ return U.#A.stockProfile = E.profile === "stock-certified-v1", U.#A.module = y.value, U;
2337
2342
  }
2338
2343
  /** Captures even Buffer/subclass inputs before the first asynchronous boundary. */
2339
- static async fromBytes(A, I, g) {
2340
- const C = new Uint8Array(A), B = new Uint8Array(I);
2344
+ static async fromBytes(A, g, I) {
2345
+ const C = new Uint8Array(A), B = new Uint8Array(g);
2341
2346
  return r.ingestOwned(
2342
2347
  C,
2343
2348
  B,
2344
- g,
2349
+ I,
2345
2350
  CA.exceptions
2346
2351
  );
2347
2352
  }
2348
- static async ingestOwned(A, I, g, C) {
2349
- const B = performance.now(), E = await Promise.allSettled([LA(A), LA(I)]);
2353
+ static async ingestOwned(A, g, I, C) {
2354
+ const B = performance.now(), E = await Promise.allSettled([LA(A), LA(g)]);
2350
2355
  if (E[0].status === "rejected") throw E[0].reason;
2351
2356
  if (E[1].status === "rejected") throw E[1].reason;
2352
- const [D, w] = [E[0].value, E[1].value], N = g ? await WebAssembly.compile(A) : void 0;
2357
+ const [D, w] = [E[0].value, E[1].value], N = I ? await WebAssembly.compile(A) : void 0;
2353
2358
  return new r(
2354
- { compiler: A, sysroot: I, compilerHash: D, sysrootHash: w, exceptionsHash: C, module: N },
2359
+ { compiler: A, sysroot: g, compilerHash: D, sysrootHash: w, exceptionsHash: C, module: N },
2355
2360
  performance.now() - B
2356
2361
  );
2357
2362
  }
@@ -2368,25 +2373,25 @@ class r {
2368
2373
  return this.#A.compiler.byteLength;
2369
2374
  }
2370
2375
  /** postMessage clones the private seed; never transfer/detach the restart owner. */
2371
- configure(A, I) {
2376
+ configure(A, g) {
2372
2377
  try {
2373
- return A.postMessage({ ...I, toolchain: this.#A }), !!this.#A.module;
2374
- } catch (g) {
2375
- if (!(g instanceof DOMException) || g.name !== "DataCloneError" || !this.#A.module)
2376
- throw g;
2377
- return A.postMessage({ ...I, toolchain: { ...this.#A, module: void 0 } }), !1;
2378
+ return A.postMessage({ ...g, toolchain: this.#A }), !!this.#A.module;
2379
+ } catch (I) {
2380
+ if (!(I instanceof DOMException) || I.name !== "DataCloneError" || !this.#A.module)
2381
+ throw I;
2382
+ return A.postMessage({ ...g, toolchain: { ...this.#A, module: void 0 } }), !1;
2378
2383
  }
2379
2384
  }
2380
2385
  }
2381
2386
  async function LA(Q) {
2382
2387
  const A = await crypto.subtle.digest("SHA-256", Q);
2383
- return Array.from(new Uint8Array(A), (I) => I.toString(16).padStart(2, "0")).join("");
2388
+ return Array.from(new Uint8Array(A), (g) => g.toString(16).padStart(2, "0")).join("");
2384
2389
  }
2385
2390
  let BA, $;
2386
2391
  class qA {
2387
2392
  stdout = new sA(1);
2388
2393
  stderr = new sA(2);
2389
- stdin = new O();
2394
+ stdin = new q();
2390
2395
  debugger;
2391
2396
  lang;
2392
2397
  scope;
@@ -2394,6 +2399,8 @@ class qA {
2394
2399
  binaryFiles = {};
2395
2400
  cppArtifacts;
2396
2401
  hostDevice;
2402
+ /** How the next run starts the program: arguments, directory, entry file, environment. */
2403
+ program = {};
2397
2404
  options;
2398
2405
  python;
2399
2406
  retain;
@@ -2425,8 +2432,8 @@ class qA {
2425
2432
  retirements = 0;
2426
2433
  latest;
2427
2434
  cacheValidation;
2428
- static async create(A, I = {}) {
2429
- const { wasmUrl: g, python: C, ...B } = I, E = g === void 0 ? void 0 : II(g, globalThis.location?.href), D = structuredClone(B);
2435
+ static async create(A, g = {}) {
2436
+ const { wasmUrl: I, python: C, ...B } = g, E = I === void 0 ? void 0 : gg(I, globalThis.location?.href), D = structuredClone(B);
2430
2437
  C && (D.python = {
2431
2438
  packages: !!C.packages,
2432
2439
  onPackageStatus: typeof C.onPackageStatus == "function" ? C.onPackageStatus : void 0
@@ -2434,35 +2441,35 @@ class qA {
2434
2441
  const w = E ?? null;
2435
2442
  if ($ !== void 0 && $ !== w)
2436
2443
  throw new Error("The engine Wasm is already loaded from a different wasmUrl");
2437
- $ = w, BA ??= rA({ module_or_path: E ?? nA }).catch((k) => {
2438
- throw BA = void 0, $ = void 0, k;
2444
+ $ = w, BA ??= rA({ module_or_path: E ?? nA }).catch((G) => {
2445
+ throw BA = void 0, $ = void 0, G;
2439
2446
  }), await BA;
2440
2447
  const N = new qA(A, D);
2441
2448
  if (N.wasmUrl = E, A !== "c" && typeof window < "u" && typeof fetch < "u")
2442
- for (const k of GA(A))
2443
- fetch(k, { cache: "force-cache" }).then((U) => U.arrayBuffer()).catch(() => {
2449
+ for (const G of MA(A))
2450
+ fetch(G, { cache: "force-cache" }).then((R) => R.arrayBuffer()).catch(() => {
2444
2451
  });
2445
2452
  return N;
2446
2453
  }
2447
- constructor(A, I) {
2448
- const g = I.cpp;
2449
- this.retain = I.retainWorker ?? g?.retainWorker ?? !0;
2450
- const C = I.idleTimeoutMs ?? g?.idleTimeoutMs ?? 3e4;
2454
+ constructor(A, g) {
2455
+ const I = g.cpp;
2456
+ this.retain = g.retainWorker ?? I?.retainWorker ?? !0;
2457
+ const C = g.idleTimeoutMs ?? I?.idleTimeoutMs ?? 3e4;
2451
2458
  if (!Number.isSafeInteger(C) || C < 1 || C > 3e5)
2452
2459
  throw new RangeError("Worker idle timeout must be between 1 and 300000 milliseconds");
2453
- if (this.idleTimeoutMs = C, g) {
2460
+ if (this.idleTimeoutMs = C, I) {
2454
2461
  if (A !== "c") throw new TypeError("C++ performance options require C/C++");
2455
- if (!g.scope?.projectId || !g.scope.accountId)
2462
+ if (!I.scope?.projectId || !I.scope.accountId)
2456
2463
  throw new TypeError("C++ performance options require project and account identity");
2457
- if (g.compilerLifetime !== void 0 && !["idle", "project"].includes(g.compilerLifetime))
2464
+ if (I.compilerLifetime !== void 0 && !["idle", "project"].includes(I.compilerLifetime))
2458
2465
  throw new TypeError("Invalid compiler lifetime");
2459
- HA(g.toolchainProfile), this.scope = Object.freeze({ ...g.scope }), this.options = Object.freeze({ ...g, scope: this.scope, idleTimeoutMs: C });
2466
+ aA(I.toolchainProfile), this.scope = Object.freeze({ ...I.scope }), this.options = Object.freeze({ ...I, scope: this.scope, idleTimeoutMs: C });
2460
2467
  }
2461
- if (I.python) {
2468
+ if (g.python) {
2462
2469
  if (A !== "python") throw new TypeError("Python options require Python");
2463
- this.python = Object.freeze({ ...I.python });
2470
+ this.python = Object.freeze({ ...g.python });
2464
2471
  }
2465
- this.objects = new uA(typeof g?.objectCache == "object" ? g.objectCache : {}), this.debugger = new $A(), this.lang = A;
2472
+ this.objects = new uA(typeof I?.objectCache == "object" ? I.objectCache : {}), this.debugger = new $A(), this.lang = A;
2466
2473
  }
2467
2474
  /** A retained worker reuses clang, compiled once on this thread and cloned to it. */
2468
2475
  get cacheCompilerModule() {
@@ -2504,23 +2511,23 @@ class qA {
2504
2511
  cancelCurrentOperation() {
2505
2512
  if (this.cancellationDraining) return this.cancellationDraining;
2506
2513
  this.operationId++;
2507
- const A = this.promise, I = this.active?.publication;
2514
+ const A = this.promise, g = this.active?.publication;
2508
2515
  this.retireWorker(), this.objects.discardBatch(), this.active && this.finish(this.active, { type: "stopped" });
2509
- const g = Promise.allSettled([A, I]).then(() => {
2510
- this.cancellationDraining === g && (this.cancellationDraining = void 0);
2516
+ const I = Promise.allSettled([A, g]).then(() => {
2517
+ this.cancellationDraining === I && (this.cancellationDraining = void 0);
2511
2518
  });
2512
- return this.cancellationDraining = g, g;
2519
+ return this.cancellationDraining = I, I;
2513
2520
  }
2514
2521
  /** Release idle compiler resources, or defer behind an active guest without stopping it. */
2515
2522
  releaseCompilerResources(A = {}) {
2516
- const I = A.signal;
2517
- return I?.aborted ? Promise.resolve("cancelled") : this.disposed ? Promise.resolve("released") : new Promise((g) => {
2518
- const C = { resolve: g, signal: I, abort: () => this.settleRelease(C, "cancelled") };
2519
- this.releases.add(C), I?.addEventListener("abort", C.abort, { once: !0 }), this.flushReleases();
2523
+ const g = A.signal;
2524
+ return g?.aborted ? Promise.resolve("cancelled") : this.disposed ? Promise.resolve("released") : new Promise((I) => {
2525
+ const C = { resolve: I, signal: g, abort: () => this.settleRelease(C, "cancelled") };
2526
+ this.releases.add(C), g?.addEventListener("abort", C.abort, { once: !0 }), this.flushReleases();
2520
2527
  });
2521
2528
  }
2522
- settleRelease(A, I) {
2523
- this.releases.delete(A) && (A.signal?.removeEventListener("abort", A.abort), A.resolve(I));
2529
+ settleRelease(A, g) {
2530
+ this.releases.delete(A) && (A.signal?.removeEventListener("abort", A.abort), A.resolve(g));
2524
2531
  }
2525
2532
  flushReleases() {
2526
2533
  if (!(this.active || !this.releases.size || this.releaseDrain)) {
@@ -2549,8 +2556,8 @@ class qA {
2549
2556
  prepareCompiler(A) {
2550
2557
  if (A?.validateCacheInputs !== void 0 && typeof A.validateCacheInputs != "boolean")
2551
2558
  return Promise.resolve(c(new TypeError("Invalid compiler preparation options")));
2552
- const I = 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;
2553
- return this.submit(!0, !0, I);
2559
+ 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;
2560
+ return this.submit(!0, !0, g);
2554
2561
  }
2555
2562
  /** Every Run links current objects and starts a fresh student runtime. */
2556
2563
  run() {
@@ -2558,94 +2565,106 @@ class qA {
2558
2565
  }
2559
2566
  /** Installs what the program imports from PyPI, then runs it with those files mounted. */
2560
2567
  async runWithPackages() {
2561
- const A = (g) => {
2568
+ const A = (I) => {
2562
2569
  try {
2563
- this.python?.onPackageStatus?.(g);
2570
+ this.python?.onPackageStatus?.(I);
2564
2571
  } catch {
2565
2572
  }
2566
2573
  };
2567
- let I = {};
2574
+ let g = {};
2568
2575
  try {
2569
- I = await RI(this.fs, A);
2570
- } catch (g) {
2576
+ g = await Ug(this.fs, A);
2577
+ } catch (I) {
2571
2578
  A({
2572
2579
  kind: "skipped",
2573
- message: `Packages: ${g instanceof Error ? g.message : String(g)}`
2580
+ message: `Packages: ${I instanceof Error ? I.message : String(I)}`
2574
2581
  });
2575
2582
  }
2576
- return this.submit(!1, !1, !1, I);
2583
+ return this.submit(!1, !1, !1, g);
2577
2584
  }
2578
- /** Compiles Run-profile C++ translation units only; never links, runs, or opens devices. */
2585
+ /**
2586
+ * Builds without running: C++ compiles its Run-profile translation units (no link, no
2587
+ * devices); Rust compiles and links its crate. Errors arrive as a nonzero exit code.
2588
+ */
2579
2589
  compile() {
2580
2590
  return this.submit(!0);
2581
2591
  }
2582
- submit(A, I = !1, g = !1, C = {}) {
2592
+ submit(A, g = !1, I = !1, C = {}) {
2583
2593
  if (this.disposed) return Promise.resolve(c(new Error("Engine is disposed")));
2584
2594
  if (this.active || this.cancellationDraining)
2585
2595
  return Promise.resolve(c(new Error("An engine job is already active")));
2586
- if (A && this.lang !== "c")
2587
- return Promise.resolve(c(new Error("Compile-only is supported for C/C++")));
2596
+ if (A && this.lang === "python")
2597
+ return Promise.resolve(
2598
+ c(new Error("Compile-only is supported for C/C++ and Rust"))
2599
+ );
2588
2600
  this.cacheValidation = void 0;
2589
- const B = I && !g;
2601
+ const B = g && !I;
2590
2602
  let E;
2591
2603
  try {
2592
- const K = B || !this.cppArtifacts ? null : { ...this.cppArtifacts };
2593
- if (K?.cacheCertificate !== void 0) {
2594
- const R = K.cacheCertificate;
2595
- (typeof R != "string" || R.length > 1024 * 1024 || new TextEncoder().encode(R).byteLength > 1024 * 1024) && delete K.cacheCertificate;
2604
+ const y = B || !this.cppArtifacts ? null : { ...this.cppArtifacts };
2605
+ if (y?.cacheCertificate !== void 0) {
2606
+ const U = y.cacheCertificate;
2607
+ (typeof U != "string" || U.length > 1024 * 1024 || new TextEncoder().encode(U).byteLength > 1024 * 1024) && delete y.cacheCertificate;
2596
2608
  }
2597
2609
  E = {
2598
2610
  fs: B ? {} : structuredClone(this.fs),
2599
2611
  binary_files: Object.fromEntries(
2600
2612
  Object.entries(B ? {} : { ...C, ...this.binaryFiles }).map(
2601
- ([R, H]) => [R, new Uint8Array(H)]
2613
+ ([U, a]) => [U, new Uint8Array(a)]
2602
2614
  )
2603
2615
  ),
2604
- cpp_artifacts: structuredClone(K)
2616
+ cpp_artifacts: structuredClone(y)
2605
2617
  };
2606
- } catch (K) {
2607
- return Promise.resolve(c(K));
2618
+ } catch (y) {
2619
+ return Promise.resolve(c(y));
2608
2620
  }
2609
2621
  const D = !A && this.debugger.enabled, w = A ? void 0 : this.hostDevice;
2610
2622
  if (w !== void 0 && (typeof w != "function" || !["c", "python"].includes(this.lang)))
2611
2623
  return Promise.resolve(c(new TypeError("Invalid host device configuration")));
2612
2624
  clearTimeout(this.idleTimer), this.stdin[L].clear();
2613
2625
  const N = !!this.slot;
2614
- let k;
2615
- const U = new Promise((K) => {
2616
- k = K;
2626
+ let G;
2627
+ const R = new Promise((y) => {
2628
+ G = y;
2617
2629
  });
2618
- this.promise = U;
2630
+ this.promise = R;
2619
2631
  const h = {
2620
2632
  generation: this.generation,
2621
2633
  scopeEpoch: this.scopeEpoch,
2622
2634
  operationId: ++this.operationId,
2623
2635
  cacheEpoch: this.generation,
2624
- prepareOnly: I,
2625
- validateCacheInputs: g,
2636
+ prepareOnly: g,
2637
+ validateCacheInputs: I,
2626
2638
  settled: !1,
2627
2639
  buildOnly: A,
2628
2640
  debug: D,
2629
2641
  opener: w,
2630
2642
  startedAt: performance.now(),
2631
- resolve: k,
2643
+ resolve: G,
2632
2644
  stats: {
2633
- operation: I ? "prepare_compiler" : A ? "compile" : "run",
2645
+ operation: g ? "prepare_compiler" : A ? "compile" : "run",
2634
2646
  workerReadyMs: 0,
2635
2647
  workerReused: N
2636
2648
  },
2637
2649
  start: {
2638
2650
  ...E,
2639
2651
  lang: this.lang,
2640
- prepare_compiler: I,
2641
- validate_cache_inputs: g,
2652
+ prepare_compiler: g,
2653
+ validate_cache_inputs: I,
2642
2654
  scope_epoch: this.scopeEpoch,
2643
2655
  operation_id: this.operationId,
2644
2656
  cache_epoch: this.generation,
2645
2657
  is_debug: D,
2646
2658
  build_only: A,
2647
2659
  stdin_buffer: this.stdin[L].buffer,
2648
- cpp_cache: this.options?.objectCache && !D && !I ? {
2660
+ program: {
2661
+ args: [...this.program.args ?? []].map(String),
2662
+ cwd: this.program.cwd,
2663
+ entry: this.program.entry,
2664
+ env: { ...this.program.env },
2665
+ collectFiles: !!this.program.collectFiles
2666
+ },
2667
+ cpp_cache: this.options?.objectCache && !D && !g ? {
2649
2668
  generation: this.generation,
2650
2669
  entries: this.objects.snapshot(),
2651
2670
  max_entry_metadata_bytes: Math.min(
@@ -2658,33 +2677,33 @@ class qA {
2658
2677
  };
2659
2678
  this.objects.beginBatch(), this.active = h;
2660
2679
  try {
2661
- if (this.slot || this.makeWorker(), !this.current(h)) return U;
2662
- const K = this.slot;
2663
- this.lang === "c" && !this.toolchain && this.ensureToolchain().catch((R) => {
2664
- this.current(h) && this.slot === K && this.finish(h, c(R));
2680
+ if (this.slot || this.makeWorker(), !this.current(h)) return R;
2681
+ const y = this.slot;
2682
+ this.lang === "c" && !this.toolchain && this.ensureToolchain().catch((U) => {
2683
+ this.current(h) && this.slot === y && this.finish(h, c(U));
2665
2684
  }), this.slot.ready && this.dispatch(h);
2666
- } catch (K) {
2667
- this.finish(h, c(K));
2685
+ } catch (y) {
2686
+ this.finish(h, c(y));
2668
2687
  }
2669
- return U;
2688
+ return R;
2670
2689
  }
2671
2690
  current(A) {
2672
2691
  return this.active === A && !A.settled;
2673
2692
  }
2674
2693
  makeWorker() {
2675
- const A = CI(this.wasmUrl), I = { worker: A, ready: !1, remove: () => {
2694
+ const A = Cg(this.wasmUrl), g = { worker: A, ready: !1, remove: () => {
2676
2695
  } };
2677
- this.slot = I;
2678
- const g = (E) => {
2679
- if (this.slot !== I) return;
2696
+ this.slot = g;
2697
+ const I = (E) => {
2698
+ if (this.slot !== g) return;
2680
2699
  const D = E.data, w = this.active;
2681
2700
  if (D.type === "ready") {
2682
- if (I.ready) return;
2683
- I.ready = !0, w && this.current(w) && this.dispatch(w);
2701
+ if (g.ready) return;
2702
+ g.ready = !0, w && this.current(w) && this.dispatch(w);
2684
2703
  return;
2685
2704
  }
2686
2705
  if (!(!w || !this.current(w))) {
2687
- if (!I.ready && D.type === "error") {
2706
+ if (!g.ready && D.type === "error") {
2688
2707
  this.finish(w, c(new Error(D.message)));
2689
2708
  return;
2690
2709
  }
@@ -2693,15 +2712,21 @@ class qA {
2693
2712
  if (D.type === "cpp_cache_eligibility") {
2694
2713
  if (this.options?.toolchainProfile !== "stock-certified-v1" || w.prepareOnly && !w.validateCacheInputs)
2695
2714
  return;
2696
- const N = (U) => typeof U == "string" && /^[0-9a-f]{64}$/.test(U), k = D.eligible === !0 && N(D.certificate_sha256) && N(D.snapshot);
2715
+ const N = (R) => typeof R == "string" && /^[0-9a-f]{64}$/.test(R), G = D.eligible === !0 && N(D.certificate_sha256) && N(D.snapshot);
2697
2716
  this.cacheValidation = {
2698
- eligible: k,
2717
+ eligible: G,
2699
2718
  certificate: N(D.certificate_sha256) ? D.certificate_sha256 : void 0,
2700
- snapshot: k ? D.snapshot : void 0,
2719
+ snapshot: G ? D.snapshot : void 0,
2701
2720
  operationId: w.operationId,
2702
- reason: k ? void 0 : typeof D.reason == "string" ? D.reason.slice(0, 128) : "stock-input-validation"
2721
+ reason: G ? void 0 : typeof D.reason == "string" ? D.reason.slice(0, 128) : "stock-input-validation"
2722
+ };
2723
+ } else if (D.type === "files")
2724
+ w.files = {
2725
+ written: Object.fromEntries(D.written),
2726
+ removed: D.removed,
2727
+ truncated: D.truncated
2703
2728
  };
2704
- } else if (D.type === "stop")
2729
+ else if (D.type === "stop")
2705
2730
  this.finish(w, {
2706
2731
  type: "completed",
2707
2732
  exitCode: D.exit_code,
@@ -2709,7 +2734,8 @@ class qA {
2709
2734
  totalMs: performance.now() - w.startedAt,
2710
2735
  buildMs: D.build_ms,
2711
2736
  runMs: D.run_ms
2712
- }
2737
+ },
2738
+ ...w.files ? { files: w.files } : {}
2713
2739
  });
2714
2740
  else if (D.type === "error")
2715
2741
  this.finish(w, c(new Error(D.message)));
@@ -2719,27 +2745,27 @@ class qA {
2719
2745
  } catch {
2720
2746
  this.objects.abandonBatch();
2721
2747
  }
2722
- else D.type === "cpp_cache_stats" && D.generation === w.generation ? w.stats.cache = D.stats : D.type === "cpp_cache_abandon" ? this.objects.abandonBatch() : D.type === "object_build_complete" ? w.publication ??= this.publishObjects(w, I) : D.type === "compiler_module_stats" && (w.stats.compilerModule = D);
2748
+ else D.type === "cpp_cache_stats" && D.generation === w.generation ? w.stats.cache = D.stats : D.type === "cpp_cache_abandon" ? this.objects.abandonBatch() : D.type === "object_build_complete" ? w.publication ??= this.publishObjects(w, g) : D.type === "compiler_module_stats" && (w.stats.compilerModule = D);
2723
2749
  } catch (N) {
2724
2750
  this.finish(w, c(N));
2725
2751
  }
2726
2752
  }
2727
2753
  }, C = (E) => {
2728
- this.slot === I && (this.clearCaches(), this.active ? this.finish(this.active, c(E.error ?? new Error(E.message))) : this.retireWorker());
2754
+ this.slot === g && (this.clearCaches(), this.active ? this.finish(this.active, c(E.error ?? new Error(E.message))) : this.retireWorker());
2729
2755
  }, B = () => C({ message: "Unreadable execution worker message" });
2730
- this.debugger[L].attach(A), A.addEventListener("message", g), A.addEventListener("error", C), A.addEventListener("messageerror", B), I.remove = () => {
2731
- A.removeEventListener("message", g), A.removeEventListener("error", C), A.removeEventListener("messageerror", B), this.debugger[L].detach(A);
2756
+ this.debugger[L].attach(A), A.addEventListener("message", I), A.addEventListener("error", C), A.addEventListener("messageerror", B), g.remove = () => {
2757
+ A.removeEventListener("message", I), A.removeEventListener("error", C), A.removeEventListener("messageerror", B), this.debugger[L].detach(A);
2732
2758
  };
2733
2759
  }
2734
- async publishObjects(A, I) {
2735
- let g = !1;
2760
+ async publishObjects(A, g) {
2761
+ let I = !1;
2736
2762
  try {
2737
- g = await this.objects.validateBatch();
2763
+ I = await this.objects.validateBatch();
2738
2764
  } catch {
2739
2765
  }
2740
- if (!(!this.current(A) || this.slot !== I)) {
2766
+ if (!(!this.current(A) || this.slot !== g)) {
2741
2767
  try {
2742
- g && A.cacheEpoch === this.generation ? this.objects.commitBatch() : (this.objects.abandonBatch(), this.cacheValidation?.operationId === A.operationId && (this.cacheValidation = {
2768
+ I && A.cacheEpoch === this.generation ? this.objects.commitBatch() : (this.objects.abandonBatch(), this.cacheValidation?.operationId === A.operationId && (this.cacheValidation = {
2743
2769
  ...this.cacheValidation,
2744
2770
  eligible: !1,
2745
2771
  snapshot: void 0,
@@ -2753,7 +2779,7 @@ class qA {
2753
2779
  reason: "stock-publication-failure"
2754
2780
  });
2755
2781
  }
2756
- this.current(A) && I.worker.postMessage({
2782
+ this.current(A) && g.worker.postMessage({
2757
2783
  type: "object_build_ack",
2758
2784
  scopeEpoch: A.scopeEpoch,
2759
2785
  operationId: A.operationId,
@@ -2766,10 +2792,10 @@ class qA {
2766
2792
  if (this.toolchainLoading) return this.toolchainLoading;
2767
2793
  this.toolchainController = new AbortController();
2768
2794
  const A = r.load(
2769
- GA("c"),
2795
+ MA("c"),
2770
2796
  this.cacheCompilerModule,
2771
2797
  this.toolchainController.signal,
2772
- dA(),
2798
+ xA(),
2773
2799
  this.options?.toolchainProfile
2774
2800
  );
2775
2801
  return this.toolchainLoading = A, this.initializing.add(A), A.then(
@@ -2780,12 +2806,12 @@ class qA {
2780
2806
  ), A;
2781
2807
  }
2782
2808
  async dispatch(A) {
2783
- const I = this.slot;
2784
- if (!(!this.current(A) || !I))
2809
+ const g = this.slot;
2810
+ if (!(!this.current(A) || !g))
2785
2811
  try {
2786
2812
  if (this.lang === "c") {
2787
2813
  const B = this.scopeEpoch, E = this.generation, D = this.ensureToolchain(), w = this.toolchain ?? await D;
2788
- if (!this.current(A) || this.slot !== I || B !== this.scopeEpoch) return;
2814
+ if (!this.current(A) || this.slot !== g || B !== this.scopeEpoch) return;
2789
2815
  const N = A.start.cpp_artifacts?.requiredToolchain;
2790
2816
  if (N && !w.matchesExpectation(N)) {
2791
2817
  this.finish(A, {
@@ -2797,52 +2823,52 @@ class qA {
2797
2823
  });
2798
2824
  return;
2799
2825
  }
2800
- E === this.generation && (this.toolchainIdentity && this.toolchainIdentity !== w.identity && (this.objects.clear(), A.start.cpp_cache = null), this.toolchain !== w && (this.toolchainIngestions++, this.toolchainHashCount += w.hashCount, this.toolchainHashMs += w.hashMs), this.toolchainIdentity = w.identity, this.toolchain = w, this.toolchainLoading === D && (this.toolchainLoading = void 0)), I.toolchain !== w && (this.compilerModuleCloned = w.configure(I.worker, {
2826
+ E === this.generation && (this.toolchainIdentity && this.toolchainIdentity !== w.identity && (this.objects.clear(), A.start.cpp_cache = null), this.toolchain !== w && (this.toolchainIngestions++, this.toolchainHashCount += w.hashCount, this.toolchainHashMs += w.hashMs), this.toolchainIdentity = w.identity, this.toolchain = w, this.toolchainLoading === D && (this.toolchainLoading = void 0)), g.toolchain !== w && (this.compilerModuleCloned = w.configure(g.worker, {
2801
2827
  type: "configure_cpp",
2802
2828
  cacheCompilerModule: this.cacheCompilerModule
2803
- }), I.toolchain = w);
2829
+ }), g.toolchain = w);
2804
2830
  }
2805
- if (!this.current(A) || this.slot !== I) return;
2806
- const g = I.worker;
2831
+ if (!this.current(A) || this.slot !== g) return;
2832
+ const I = g.worker;
2807
2833
  A.stats.workerReadyMs = performance.now() - A.startedAt;
2808
2834
  const C = (B) => this.current(A) && B.scopeEpoch === A.scopeEpoch && B.operationId === A.operationId;
2809
- if (this.stdout[L].attach(g, C), this.stderr[L].attach(g, C), A.prepareOnly || this.debugger[L].beginRun(), A.opener) {
2810
- if (A.device = new QI((B) => this.finish(A, c(B))), A.device.attach(g), A.device.open(A.opener), !this.current(A)) return;
2835
+ if (this.stdout[L].attach(I, C), this.stderr[L].attach(I, C), A.prepareOnly || this.debugger[L].beginRun(), A.opener) {
2836
+ if (A.device = new Qg((B) => this.finish(A, c(B))), A.device.attach(I), A.device.open(A.opener), !this.current(A)) return;
2811
2837
  A.start.host_device = A.device.workerStart;
2812
2838
  }
2813
- this.current(A) && (g.postMessage(A.start), A.start.fs = {}, A.start.binary_files = {}, A.start.cpp_artifacts = null, A.start.cpp_cache = null);
2814
- } catch (g) {
2815
- this.current(A) && (this.toolchainLoading = void 0, this.finish(A, c(g)));
2839
+ this.current(A) && (I.postMessage(A.start), A.start.fs = {}, A.start.binary_files = {}, A.start.cpp_artifacts = null, A.start.cpp_cache = null);
2840
+ } catch (I) {
2841
+ this.current(A) && (this.toolchainLoading = void 0, this.finish(A, c(I)));
2816
2842
  }
2817
2843
  }
2818
- finish(A, I) {
2844
+ finish(A, g) {
2819
2845
  if (!this.current(A)) return;
2820
- (I.type !== "completed" || I.exitCode !== 0) && (this.cacheValidation = void 0), A.settled = !0;
2821
- const g = this.slot?.worker;
2822
- g && (this.stdout[L].detach(g), this.stderr[L].detach(g));
2846
+ (g.type !== "completed" || g.exitCode !== 0) && (this.cacheValidation = void 0), A.settled = !0;
2847
+ const I = this.slot?.worker;
2848
+ I && (this.stdout[L].detach(I), this.stderr[L].detach(I));
2823
2849
  const C = A.device?.close();
2824
- C && (I = c(C));
2825
- const B = I.type === "completed" && A.generation === this.generation && !this.disposed, E = B && I.type === "completed" && I.exitCode === 0;
2850
+ C && (g = c(C));
2851
+ const B = g.type === "completed" && A.generation === this.generation && !this.disposed, E = B && g.type === "completed" && g.exitCode === 0;
2826
2852
  if (A.generation === this.generation)
2827
2853
  for (const D of A.stats.cache?.invalid_sources ?? []) this.objects.delete(D);
2828
2854
  if (E)
2829
2855
  for (const D of A.stats.cache?.hit_sources ?? []) this.objects.touch(D);
2830
2856
  this.objects.discardBatch(), this.latest = A.stats, this.stdin[L].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(() => {
2831
2857
  this.retireWorker(), this.toolchain = void 0, this.toolchainLoading = void 0;
2832
- }, 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(I);
2858
+ }, 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);
2833
2859
  }
2834
2860
  retireWorker() {
2835
2861
  clearTimeout(this.idleTimer);
2836
2862
  const A = this.slot;
2837
- A && (this.slot = void 0, A.remove(), this.stdout[L].detach(A.worker), this.stderr[L].detach(A.worker), A.worker.onerror = (I) => I.preventDefault(), A.worker.terminate(), this.retirements++);
2863
+ A && (this.slot = void 0, A.remove(), this.stdout[L].detach(A.worker), this.stderr[L].detach(A.worker), A.worker.onerror = (g) => g.preventDefault(), A.worker.terminate(), this.retirements++);
2838
2864
  }
2839
2865
  }
2840
2866
  class sA extends cA {
2841
2867
  constructor(A) {
2842
- super(), this.mode = A, this.callback = ((I) => {
2843
- const g = I.data;
2844
- if (this.accepts && !this.accepts(g) || g.type !== "stdout" || g.mode !== this.mode) return;
2845
- const C = g.data;
2868
+ super(), this.mode = A, this.callback = ((g) => {
2869
+ const I = g.data;
2870
+ if (this.accepts && !this.accepts(I) || I.type !== "stdout" || I.mode !== this.mode) return;
2871
+ const C = I.data;
2846
2872
  this.emit("data", C);
2847
2873
  }).bind(this), this[L] = {
2848
2874
  attach: this.attach.bind(this),
@@ -2852,14 +2878,14 @@ class sA extends cA {
2852
2878
  callback;
2853
2879
  accepts;
2854
2880
  [L];
2855
- attach(A, I) {
2856
- this.accepts = I, A.addEventListener("message", this.callback);
2881
+ attach(A, g) {
2882
+ this.accepts = g, A.addEventListener("message", this.callback);
2857
2883
  }
2858
2884
  detach(A) {
2859
2885
  A.removeEventListener("message", this.callback);
2860
2886
  }
2861
2887
  }
2862
- class O {
2888
+ class q {
2863
2889
  /**
2864
2890
  * Ring buffer to store stdin data.
2865
2891
  *
@@ -2867,19 +2893,23 @@ class O {
2867
2893
  * - One slot is always kept empty to distinguish full from empty
2868
2894
  */
2869
2895
  static BUFFER_SIZE = 2048;
2870
- static HEADER_SIZE = 8;
2871
- // 2 x i32
2872
- static DATA_SIZE = O.BUFFER_SIZE - O.HEADER_SIZE;
2896
+ static HEADER_SIZE = 12;
2897
+ // 3 x i32
2898
+ static DATA_SIZE = q.BUFFER_SIZE - q.HEADER_SIZE;
2873
2899
  static READ_IDX = 0;
2874
2900
  static WRITE_IDX = 1;
2901
+ /** Nonzero after `end()`: reads return end-of-file once the buffer drains. */
2902
+ static CLOSED_IDX = 2;
2875
2903
  static encoder = new TextEncoder();
2876
- buffer = new SharedArrayBuffer(O.BUFFER_SIZE);
2904
+ buffer = new SharedArrayBuffer(q.BUFFER_SIZE);
2877
2905
  generation = 0;
2906
+ /** Writes and `end()` happen in call order. */
2907
+ queue = Promise.resolve();
2878
2908
  indices;
2879
2909
  data;
2880
2910
  [L];
2881
2911
  constructor() {
2882
- this.indices = new Int32Array(this.buffer, 0, 2), this.data = new Int8Array(this.buffer, O.HEADER_SIZE);
2912
+ this.indices = new Int32Array(this.buffer, 0, 3), this.data = new Int8Array(this.buffer, q.HEADER_SIZE);
2883
2913
  const A = () => this.buffer;
2884
2914
  this[L] = {
2885
2915
  clear: this.clear.bind(this),
@@ -2889,27 +2919,42 @@ class O {
2889
2919
  };
2890
2920
  }
2891
2921
  clear() {
2892
- this.generation++, Atomics.notify(this.indices, O.READ_IDX), this.buffer = new SharedArrayBuffer(O.BUFFER_SIZE), this.indices = new Int32Array(this.buffer, 0, 2), this.data = new Int8Array(this.buffer, O.HEADER_SIZE);
2922
+ this.generation++, Atomics.notify(this.indices, q.READ_IDX), this.buffer = new SharedArrayBuffer(q.BUFFER_SIZE), this.indices = new Int32Array(this.buffer, 0, 3), this.data = new Int8Array(this.buffer, q.HEADER_SIZE), this.queue = Promise.resolve();
2893
2923
  }
2894
- async write(A) {
2895
- const I = typeof A == "string" ? O.encoder.encode(A) : A;
2896
- return this.writeBytes(I);
2924
+ write(A) {
2925
+ const g = typeof A == "string" ? q.encoder.encode(A) : A;
2926
+ return this.enqueue(() => this.writeBytes(g));
2927
+ }
2928
+ /**
2929
+ * Close the program's input, like Ctrl+D in a terminal or the end of a `< file`:
2930
+ * once it has read everything written so far, its reads return end-of-file.
2931
+ */
2932
+ end() {
2933
+ const A = this.generation;
2934
+ return this.enqueue(async () => {
2935
+ A === this.generation && (Atomics.store(this.indices, q.CLOSED_IDX, 1), Atomics.notify(this.indices, q.WRITE_IDX));
2936
+ });
2937
+ }
2938
+ enqueue(A) {
2939
+ const g = this.queue.then(A, A);
2940
+ return this.queue = g.catch(() => {
2941
+ }), g;
2897
2942
  }
2898
2943
  async writeBytes(A) {
2899
- const { DATA_SIZE: I, READ_IDX: g, WRITE_IDX: C } = O;
2944
+ const { DATA_SIZE: g, READ_IDX: I, WRITE_IDX: C } = q;
2900
2945
  let B = 0;
2901
2946
  const E = this.generation;
2902
2947
  for (; B < A.length && E === this.generation; ) {
2903
- const D = Atomics.load(this.indices, g);
2948
+ const D = Atomics.load(this.indices, I);
2904
2949
  let w = Atomics.load(this.indices, C);
2905
- w === I - 1 && D > 0 && (w = 0);
2906
- const N = D <= w ? I - w - 1 : D - w - 1;
2950
+ w === g - 1 && D > 0 && (w = 0);
2951
+ const N = D <= w ? g - w - 1 : D - w - 1;
2907
2952
  if (N === 0) {
2908
- await Atomics.waitAsync(this.indices, g, D).value;
2953
+ await Atomics.waitAsync(this.indices, I, D).value;
2909
2954
  continue;
2910
2955
  }
2911
- const k = Math.min(A.length - B, N);
2912
- this.data.set(A.subarray(B, B + k), w), Atomics.store(this.indices, C, (w + k) % I), Atomics.notify(this.indices, C), B += k;
2956
+ const G = Math.min(A.length - B, N);
2957
+ this.data.set(A.subarray(B, B + G), w), Atomics.store(this.indices, C, (w + G) % g), Atomics.notify(this.indices, C), B += G;
2913
2958
  }
2914
2959
  }
2915
2960
  }
@@ -2917,9 +2962,9 @@ export {
2917
2962
  _A as Artifact,
2918
2963
  $A as Debugger,
2919
2964
  qA as Engine,
2920
- JI as HOST_DEVICE_PATH,
2921
- EI as SITE_PACKAGES,
2922
- O as Stdin,
2965
+ Jg as HOST_DEVICE_PATH,
2966
+ Eg as SITE_PACKAGES,
2967
+ q as Stdin,
2923
2968
  sA as Stdout,
2924
- RI as pythonPackageFiles
2969
+ Ug as pythonPackageFiles
2925
2970
  };