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