glassjar 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/glassjar.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
function JA(Q) {
|
|
2
2
|
return Q && Q.__esModule && Object.prototype.hasOwnProperty.call(Q, "default") ? Q.default : Q;
|
|
3
3
|
}
|
|
4
|
-
var l = { exports: {} },
|
|
4
|
+
var l = { exports: {} }, BA;
|
|
5
5
|
function UA() {
|
|
6
|
-
if (
|
|
7
|
-
|
|
6
|
+
if (BA) return l.exports;
|
|
7
|
+
BA = 1;
|
|
8
8
|
var Q = typeof Reflect == "object" ? Reflect : null, A = Q && typeof Q.apply == "function" ? Q.apply : function(E, o, F) {
|
|
9
9
|
return Function.prototype.apply.call(E, o, F);
|
|
10
10
|
}, g;
|
|
@@ -22,7 +22,7 @@ function UA() {
|
|
|
22
22
|
function B() {
|
|
23
23
|
B.init.call(this);
|
|
24
24
|
}
|
|
25
|
-
l.exports = B, l.exports.once =
|
|
25
|
+
l.exports = B, l.exports.once = d, 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")
|
|
@@ -61,8 +61,8 @@ function UA() {
|
|
|
61
61
|
var G;
|
|
62
62
|
if (o.length > 0 && (G = o[0]), G instanceof Error)
|
|
63
63
|
throw G;
|
|
64
|
-
var
|
|
65
|
-
throw
|
|
64
|
+
var a = new Error("Unhandled error." + (G ? " (" + G.message + ")" : ""));
|
|
65
|
+
throw a.context = G, a;
|
|
66
66
|
}
|
|
67
67
|
var V = R[E];
|
|
68
68
|
if (V === void 0)
|
|
@@ -70,7 +70,7 @@ function UA() {
|
|
|
70
70
|
if (typeof V == "function")
|
|
71
71
|
A(V, this, o);
|
|
72
72
|
else
|
|
73
|
-
for (var
|
|
73
|
+
for (var QA = V.length, YA = H(V, QA), F = 0; F < QA; ++F)
|
|
74
74
|
A(YA[F], this, o);
|
|
75
75
|
return !0;
|
|
76
76
|
};
|
|
@@ -84,8 +84,8 @@ function UA() {
|
|
|
84
84
|
G = R[E] = o, ++w._eventsCount;
|
|
85
85
|
else if (typeof G == "function" ? G = R[E] = F ? [o, G] : [G, o] : F ? G.unshift(o) : G.push(o), M = N(w), M > 0 && G.length > M && !G.warned) {
|
|
86
86
|
G.warned = !0;
|
|
87
|
-
var
|
|
88
|
-
|
|
87
|
+
var a = new Error("Possible EventEmitter memory leak detected. " + G.length + " " + String(E) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
88
|
+
a.name = "MaxListenersExceededWarning", a.emitter = w, a.type = E, a.count = G.length, I(a);
|
|
89
89
|
}
|
|
90
90
|
return w;
|
|
91
91
|
}
|
|
@@ -94,20 +94,20 @@ function UA() {
|
|
|
94
94
|
}, B.prototype.on = B.prototype.addListener, B.prototype.prependListener = function(E, o) {
|
|
95
95
|
return K(this, E, o, !0);
|
|
96
96
|
};
|
|
97
|
-
function
|
|
97
|
+
function J() {
|
|
98
98
|
if (!this.fired)
|
|
99
99
|
return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
var F = { fired: !1, wrapFn: void 0, target: w, type: E, listener: o }, M =
|
|
101
|
+
function L(w, E, o) {
|
|
102
|
+
var F = { fired: !1, wrapFn: void 0, target: w, type: E, listener: o }, M = J.bind(F);
|
|
103
103
|
return M.listener = o, F.wrapFn = M, M;
|
|
104
104
|
}
|
|
105
105
|
B.prototype.once = function(E, o) {
|
|
106
|
-
return D(o), this.on(E,
|
|
106
|
+
return D(o), this.on(E, L(this, E, o)), this;
|
|
107
107
|
}, B.prototype.prependOnceListener = function(E, o) {
|
|
108
|
-
return D(o), this.prependListener(E,
|
|
108
|
+
return D(o), this.prependListener(E, L(this, E, o)), this;
|
|
109
109
|
}, B.prototype.removeListener = function(E, o) {
|
|
110
|
-
var F, M, R, G,
|
|
110
|
+
var F, M, R, G, a;
|
|
111
111
|
if (D(o), M = this._events, M === void 0)
|
|
112
112
|
return this;
|
|
113
113
|
if (F = M[E], F === void 0)
|
|
@@ -117,12 +117,12 @@ function UA() {
|
|
|
117
117
|
else if (typeof F != "function") {
|
|
118
118
|
for (R = -1, G = F.length - 1; G >= 0; G--)
|
|
119
119
|
if (F[G] === o || F[G].listener === o) {
|
|
120
|
-
|
|
120
|
+
a = F[G].listener, R = G;
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
123
|
if (R < 0)
|
|
124
124
|
return this;
|
|
125
|
-
R === 0 ? F.shift() :
|
|
125
|
+
R === 0 ? F.shift() : u(F, R), F.length === 1 && (M[E] = F[0]), M.removeListener !== void 0 && this.emit("removeListener", E, a || o);
|
|
126
126
|
}
|
|
127
127
|
return this;
|
|
128
128
|
}, B.prototype.off = B.prototype.removeListener, B.prototype.removeAllListeners = function(E) {
|
|
@@ -149,16 +149,16 @@ function UA() {
|
|
|
149
149
|
if (F === void 0)
|
|
150
150
|
return [];
|
|
151
151
|
var M = F[E];
|
|
152
|
-
return M === void 0 ? [] : typeof M == "function" ? o ? [M.listener || M] : [M] : o ?
|
|
152
|
+
return M === void 0 ? [] : typeof M == "function" ? o ? [M.listener || M] : [M] : o ? v(M) : H(M, M.length);
|
|
153
153
|
}
|
|
154
154
|
B.prototype.listeners = function(E) {
|
|
155
155
|
return Y(this, E, !0);
|
|
156
156
|
}, B.prototype.rawListeners = function(E) {
|
|
157
157
|
return Y(this, E, !1);
|
|
158
158
|
}, B.listenerCount = function(w, E) {
|
|
159
|
-
return typeof w.listenerCount == "function" ? w.listenerCount(E) :
|
|
160
|
-
}, B.prototype.listenerCount =
|
|
161
|
-
function
|
|
159
|
+
return typeof w.listenerCount == "function" ? w.listenerCount(E) : s.call(w, E);
|
|
160
|
+
}, B.prototype.listenerCount = s;
|
|
161
|
+
function s(w) {
|
|
162
162
|
var E = this._events;
|
|
163
163
|
if (E !== void 0) {
|
|
164
164
|
var o = E[w];
|
|
@@ -172,22 +172,22 @@ function UA() {
|
|
|
172
172
|
B.prototype.eventNames = function() {
|
|
173
173
|
return this._eventsCount > 0 ? g(this._events) : [];
|
|
174
174
|
};
|
|
175
|
-
function
|
|
175
|
+
function H(w, E) {
|
|
176
176
|
for (var o = new Array(E), F = 0; F < E; ++F)
|
|
177
177
|
o[F] = w[F];
|
|
178
178
|
return o;
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function u(w, E) {
|
|
181
181
|
for (; E + 1 < w.length; E++)
|
|
182
182
|
w[E] = w[E + 1];
|
|
183
183
|
w.pop();
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function v(w) {
|
|
186
186
|
for (var E = new Array(w.length), o = 0; o < E.length; ++o)
|
|
187
187
|
E[o] = w[o].listener || w[o];
|
|
188
188
|
return E;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function d(w, E) {
|
|
191
191
|
return new Promise(function(o, F) {
|
|
192
192
|
function M(G) {
|
|
193
193
|
w.removeListener(E, R), F(G);
|
|
@@ -195,13 +195,13 @@ function UA() {
|
|
|
195
195
|
function R() {
|
|
196
196
|
typeof w.removeListener == "function" && w.removeListener("error", M), o([].slice.call(arguments));
|
|
197
197
|
}
|
|
198
|
-
|
|
198
|
+
CA(w, E, R, { once: !0 }), E !== "error" && RA(w, M, { once: !0 });
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
201
|
function RA(w, E, o) {
|
|
202
|
-
typeof w.on == "function" &&
|
|
202
|
+
typeof w.on == "function" && CA(w, "error", E, o);
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function CA(w, E, o, F) {
|
|
205
205
|
if (typeof w.on == "function")
|
|
206
206
|
F.once ? w.once(E, o) : w.on(E, o);
|
|
207
207
|
else if (typeof w.addEventListener == "function")
|
|
@@ -214,11 +214,11 @@ function UA() {
|
|
|
214
214
|
return l.exports;
|
|
215
215
|
}
|
|
216
216
|
var SA = UA();
|
|
217
|
-
const
|
|
218
|
-
class
|
|
217
|
+
const MA = /* @__PURE__ */ JA(SA);
|
|
218
|
+
class $ {
|
|
219
219
|
__destroy_into_raw() {
|
|
220
220
|
const A = this.__wbg_ptr;
|
|
221
|
-
return this.__wbg_ptr = 0,
|
|
221
|
+
return this.__wbg_ptr = 0, wA.unregister(this), A;
|
|
222
222
|
}
|
|
223
223
|
free() {
|
|
224
224
|
const A = this.__destroy_into_raw();
|
|
@@ -243,7 +243,7 @@ class e {
|
|
|
243
243
|
}
|
|
244
244
|
constructor() {
|
|
245
245
|
const A = k.dapadapter_new();
|
|
246
|
-
return this.__wbg_ptr = A >>> 0,
|
|
246
|
+
return this.__wbg_ptr = A >>> 0, wA.register(this, this.__wbg_ptr, this), this;
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
249
|
* @param {Function} callback
|
|
@@ -268,16 +268,16 @@ class e {
|
|
|
268
268
|
k.dapadapter_setFilterInternals(this.__wbg_ptr, A);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
Symbol.dispose && (
|
|
271
|
+
Symbol.dispose && ($.prototype[Symbol.dispose] = $.prototype.free);
|
|
272
272
|
class X {
|
|
273
273
|
static __wrap(A) {
|
|
274
274
|
A = A >>> 0;
|
|
275
275
|
const g = Object.create(X.prototype);
|
|
276
|
-
return g.__wbg_ptr = A,
|
|
276
|
+
return g.__wbg_ptr = A, iA.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,
|
|
280
|
+
return this.__wbg_ptr = 0, iA.unregister(this), A;
|
|
281
281
|
}
|
|
282
282
|
free() {
|
|
283
283
|
const A = this.__destroy_into_raw();
|
|
@@ -301,9 +301,9 @@ function hA() {
|
|
|
301
301
|
k.__wbindgen_free(Q, A, 1);
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
const A = O(Q, k.__wbindgen_malloc, k.__wbindgen_realloc), g =
|
|
306
|
-
var C =
|
|
304
|
+
function EA(Q) {
|
|
305
|
+
const A = O(Q, k.__wbindgen_malloc, k.__wbindgen_realloc), g = x, I = k.prefetch_urls(A, g);
|
|
306
|
+
var C = GA(I[0], I[1]).slice();
|
|
307
307
|
return k.__wbindgen_free(I[0], I[1] * 4, 4), C;
|
|
308
308
|
}
|
|
309
309
|
function LA() {
|
|
@@ -321,20 +321,20 @@ function LA() {
|
|
|
321
321
|
return Number(A);
|
|
322
322
|
},
|
|
323
323
|
__wbg_String_8f0eb39a4a4c2f66: function(A, g) {
|
|
324
|
-
const I = String(g), C = O(I, k.__wbindgen_malloc, k.__wbindgen_realloc), B =
|
|
325
|
-
|
|
324
|
+
const I = String(g), C = O(I, k.__wbindgen_malloc, k.__wbindgen_realloc), B = x;
|
|
325
|
+
h().setInt32(A + 4, B, !0), h().setInt32(A + 0, C, !0);
|
|
326
326
|
},
|
|
327
327
|
__wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2: function(A, g) {
|
|
328
328
|
const I = g, C = typeof I == "bigint" ? I : void 0;
|
|
329
|
-
|
|
329
|
+
h().setBigInt64(A + 8, p(C) ? BigInt(0) : C, !0), h().setInt32(A + 0, !p(C), !0);
|
|
330
330
|
},
|
|
331
331
|
__wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(A) {
|
|
332
332
|
const g = A, I = typeof g == "boolean" ? g : void 0;
|
|
333
|
-
return
|
|
333
|
+
return p(I) ? 16777215 : I ? 1 : 0;
|
|
334
334
|
},
|
|
335
335
|
__wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(A, g) {
|
|
336
|
-
const I =
|
|
337
|
-
|
|
336
|
+
const I = AA(g), C = O(I, k.__wbindgen_malloc, k.__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
340
|
return k.__wbindgen_export;
|
|
@@ -372,7 +372,7 @@ function LA() {
|
|
|
372
372
|
},
|
|
373
373
|
__wbg___wbindgen_number_get_8ff4255516ccad3e: function(A, g) {
|
|
374
374
|
const I = g, C = typeof I == "number" ? I : void 0;
|
|
375
|
-
|
|
375
|
+
h().setFloat64(A + 8, p(C) ? 0 : C, !0), h().setInt32(A + 0, !p(C), !0);
|
|
376
376
|
},
|
|
377
377
|
__wbg___wbindgen_rethrow_05525c567f154472: function(A) {
|
|
378
378
|
throw A;
|
|
@@ -382,8 +382,8 @@ 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 =
|
|
386
|
-
|
|
385
|
+
var B = p(C) ? 0 : O(C, k.__wbindgen_malloc, k.__wbindgen_realloc), i = x;
|
|
386
|
+
h().setInt32(A + 4, i, !0), h().setInt32(A + 0, B, !0);
|
|
387
387
|
},
|
|
388
388
|
__wbg___wbindgen_throw_be289d5034ed271b: function(A, g) {
|
|
389
389
|
throw new Error(c(A, g));
|
|
@@ -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 = O(I, k.__wbindgen_malloc, k.__wbindgen_realloc), B =
|
|
904
|
-
|
|
903
|
+
const I = g.stack, C = O(I, k.__wbindgen_malloc, k.__wbindgen_realloc), B = x;
|
|
904
|
+
h().setInt32(A + 4, B, !0), h().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
|
|
908
|
+
return p(A) ? 0 : j(A);
|
|
909
909
|
},
|
|
910
910
|
__wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function() {
|
|
911
911
|
const A = typeof globalThis > "u" ? null : globalThis;
|
|
912
|
-
return
|
|
912
|
+
return p(A) ? 0 : j(A);
|
|
913
913
|
},
|
|
914
914
|
__wbg_static_accessor_SELF_a621d3dfbb60d0ce: function() {
|
|
915
915
|
const A = typeof self > "u" ? null : self;
|
|
916
|
-
return
|
|
916
|
+
return p(A) ? 0 : j(A);
|
|
917
917
|
},
|
|
918
918
|
__wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function() {
|
|
919
919
|
const A = typeof window > "u" ? null : window;
|
|
920
|
-
return
|
|
920
|
+
return p(A) ? 0 : j(A);
|
|
921
921
|
},
|
|
922
922
|
__wbg_store_d1d951c98d9bed41: function() {
|
|
923
923
|
return y(function(A, g, I) {
|
|
@@ -934,8 +934,8 @@ 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 = O(C, k.__wbindgen_malloc, k.__wbindgen_realloc), i =
|
|
938
|
-
|
|
937
|
+
const C = g.toString(I), B = O(C, k.__wbindgen_malloc, k.__wbindgen_realloc), i = x;
|
|
938
|
+
h().setInt32(A + 4, i, !0), h().setInt32(A + 0, B, !0);
|
|
939
939
|
},
|
|
940
940
|
__wbg_toString_964ff7fe6eca8362: function(A) {
|
|
941
941
|
return A.toString();
|
|
@@ -966,10 +966,10 @@ function LA() {
|
|
|
966
966
|
console.warn(A, g, I);
|
|
967
967
|
},
|
|
968
968
|
__wbindgen_cast_0000000000000001: function(A, g) {
|
|
969
|
-
return W(A, g, k.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___,
|
|
969
|
+
return W(A, g, k.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___, DA);
|
|
970
970
|
},
|
|
971
971
|
__wbindgen_cast_0000000000000002: function(A, g) {
|
|
972
|
-
return W(A, g, k.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___,
|
|
972
|
+
return W(A, g, k.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___, DA);
|
|
973
973
|
},
|
|
974
974
|
__wbindgen_cast_0000000000000003: function(A, g) {
|
|
975
975
|
return W(A, g, k.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);
|
|
@@ -1002,7 +1002,7 @@ function LA() {
|
|
|
1002
1002
|
return BigInt.asUintN(64, A);
|
|
1003
1003
|
},
|
|
1004
1004
|
__wbindgen_cast_000000000000000d: function(A, g) {
|
|
1005
|
-
var I =
|
|
1005
|
+
var I = GA(A, g).slice();
|
|
1006
1006
|
return k.__wbindgen_free(A, g * 4, 4), I;
|
|
1007
1007
|
},
|
|
1008
1008
|
__wbindgen_init_externref_table: function() {
|
|
@@ -1024,20 +1024,20 @@ function HA(Q, A, g) {
|
|
|
1024
1024
|
function aA(Q, A, g) {
|
|
1025
1025
|
const I = k.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
|
-
throw
|
|
1027
|
+
throw gA(I[0]);
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1029
|
+
function DA(Q, A, g) {
|
|
1030
1030
|
const I = k.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
|
-
throw
|
|
1033
|
-
return
|
|
1032
|
+
throw gA(I[1]);
|
|
1033
|
+
return gA(I[0]);
|
|
1034
1034
|
}
|
|
1035
1035
|
function qA(Q, A, g, I) {
|
|
1036
1036
|
k.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___wasm_bindgen_36932265c58943ab___JsValue__wasm_bindgen_36932265c58943ab___JsValue_____(Q, A, g, I);
|
|
1037
1037
|
}
|
|
1038
|
-
const
|
|
1038
|
+
const wA = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1039
1039
|
}, unregister: () => {
|
|
1040
|
-
} } : new FinalizationRegistry((Q) => k.__wbg_dapadapter_free(Q >>> 0, 1)),
|
|
1040
|
+
} } : new FinalizationRegistry((Q) => k.__wbg_dapadapter_free(Q >>> 0, 1)), iA = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1041
1041
|
}, unregister: () => {
|
|
1042
1042
|
} } : new FinalizationRegistry((Q) => k.__wbg_trap_free(Q >>> 0, 1));
|
|
1043
1043
|
function j(Q) {
|
|
@@ -1047,7 +1047,7 @@ function j(Q) {
|
|
|
1047
1047
|
const n = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1048
1048
|
}, unregister: () => {
|
|
1049
1049
|
} } : new FinalizationRegistry((Q) => Q.dtor(Q.a, Q.b));
|
|
1050
|
-
function
|
|
1050
|
+
function AA(Q) {
|
|
1051
1051
|
const A = typeof Q;
|
|
1052
1052
|
if (A == "number" || A == "boolean" || Q == null)
|
|
1053
1053
|
return `${Q}`;
|
|
@@ -1064,9 +1064,9 @@ function _(Q) {
|
|
|
1064
1064
|
if (Array.isArray(Q)) {
|
|
1065
1065
|
const C = Q.length;
|
|
1066
1066
|
let B = "[";
|
|
1067
|
-
C > 0 && (B +=
|
|
1067
|
+
C > 0 && (B += AA(Q[0]));
|
|
1068
1068
|
for (let i = 1; i < C; i++)
|
|
1069
|
-
B += ", " +
|
|
1069
|
+
B += ", " + AA(Q[i]);
|
|
1070
1070
|
return B += "]", B;
|
|
1071
1071
|
}
|
|
1072
1072
|
const g = /\[object ([^\]]+)\]/.exec(toString.call(Q));
|
|
@@ -1084,9 +1084,9 @@ function _(Q) {
|
|
|
1084
1084
|
return Q instanceof Error ? `${Q.name}: ${Q.message}
|
|
1085
1085
|
${Q.stack}` : I;
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1087
|
+
function GA(Q, A) {
|
|
1088
1088
|
Q = Q >>> 0;
|
|
1089
|
-
const g =
|
|
1089
|
+
const g = h(), I = [];
|
|
1090
1090
|
for (let C = Q; C < Q + 4 * A; C += 4)
|
|
1091
1091
|
I.push(k.__wbindgen_externrefs.get(g.getUint32(C, !0)));
|
|
1092
1092
|
return k.__externref_drop_slice(Q, A), I;
|
|
@@ -1094,9 +1094,9 @@ function FA(Q, A) {
|
|
|
1094
1094
|
function b(Q, A) {
|
|
1095
1095
|
return Q = Q >>> 0, T().subarray(Q / 1, Q / 1 + A);
|
|
1096
1096
|
}
|
|
1097
|
-
let
|
|
1098
|
-
function
|
|
1099
|
-
return (
|
|
1097
|
+
let Z = null;
|
|
1098
|
+
function h() {
|
|
1099
|
+
return (Z === null || Z.buffer.detached === !0 || Z.buffer.detached === void 0 && Z.buffer !== k.memory.buffer) && (Z = new DataView(k.memory.buffer)), Z;
|
|
1100
1100
|
}
|
|
1101
1101
|
function c(Q, A) {
|
|
1102
1102
|
return Q = Q >>> 0, xA(Q, A);
|
|
@@ -1113,7 +1113,7 @@ function y(Q, A) {
|
|
|
1113
1113
|
k.__wbindgen_exn_store(I);
|
|
1114
1114
|
}
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1116
|
+
function p(Q) {
|
|
1117
1117
|
return Q == null;
|
|
1118
1118
|
}
|
|
1119
1119
|
function pA(Q, A, g, I) {
|
|
@@ -1147,7 +1147,7 @@ function W(Q, A, g, I) {
|
|
|
1147
1147
|
function O(Q, A, g) {
|
|
1148
1148
|
if (g === void 0) {
|
|
1149
1149
|
const D = z.encode(Q), N = A(D.length, 1) >>> 0;
|
|
1150
|
-
return T().subarray(N, N + D.length).set(D),
|
|
1150
|
+
return T().subarray(N, N + D.length).set(D), x = D.length, N;
|
|
1151
1151
|
}
|
|
1152
1152
|
let I = Q.length, C = A(I, 1) >>> 0;
|
|
1153
1153
|
const B = T();
|
|
@@ -1162,18 +1162,18 @@ function O(Q, A, g) {
|
|
|
1162
1162
|
const D = T().subarray(C + i, C + I), N = z.encodeInto(Q, D);
|
|
1163
1163
|
i += N.written, C = g(C, I, i, 1) >>> 0;
|
|
1164
1164
|
}
|
|
1165
|
-
return
|
|
1165
|
+
return x = i, C;
|
|
1166
1166
|
}
|
|
1167
|
-
function
|
|
1167
|
+
function gA(Q) {
|
|
1168
1168
|
const A = k.__wbindgen_externrefs.get(Q);
|
|
1169
1169
|
return k.__externref_table_dealloc(Q), A;
|
|
1170
1170
|
}
|
|
1171
1171
|
let P = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
|
|
1172
1172
|
P.decode();
|
|
1173
1173
|
const dA = 2146435072;
|
|
1174
|
-
let
|
|
1174
|
+
let e = 0;
|
|
1175
1175
|
function xA(Q, A) {
|
|
1176
|
-
return
|
|
1176
|
+
return e += A, e >= dA && (P = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }), P.decode(), e = A), P.decode(T().subarray(Q, Q + A));
|
|
1177
1177
|
}
|
|
1178
1178
|
const z = new TextEncoder();
|
|
1179
1179
|
"encodeInto" in z || (z.encodeInto = function(Q, A) {
|
|
@@ -1183,9 +1183,9 @@ const z = new TextEncoder();
|
|
|
1183
1183
|
written: g.length
|
|
1184
1184
|
};
|
|
1185
1185
|
});
|
|
1186
|
-
let
|
|
1186
|
+
let x = 0, k;
|
|
1187
1187
|
function ZA(Q, A) {
|
|
1188
|
-
return k = Q.exports,
|
|
1188
|
+
return k = Q.exports, Z = null, t = null, k.__wbindgen_start(), k;
|
|
1189
1189
|
}
|
|
1190
1190
|
async function OA(Q, A) {
|
|
1191
1191
|
if (typeof Response == "function" && Q instanceof Response) {
|
|
@@ -1222,7 +1222,7 @@ async function VA(Q) {
|
|
|
1222
1222
|
const { instance: g, module: I } = await OA(await Q, A);
|
|
1223
1223
|
return ZA(g);
|
|
1224
1224
|
}
|
|
1225
|
-
const WA = new URL("https://cdn.jsdelivr.net/npm/glassjar@0.4.
|
|
1225
|
+
const WA = new URL("https://cdn.jsdelivr.net/npm/glassjar@0.4.1/dist/engine_bg.wasm"), jA = Object.freeze({
|
|
1226
1226
|
maxObjectBytes: 128 * 1024 * 1024,
|
|
1227
1227
|
maxEntries: 256,
|
|
1228
1228
|
maxMetadataBytes: 8 * 1024 * 1024,
|
|
@@ -1396,8 +1396,8 @@ function TA(Q) {
|
|
|
1396
1396
|
return !1;
|
|
1397
1397
|
}
|
|
1398
1398
|
}
|
|
1399
|
-
const
|
|
1400
|
-
function
|
|
1399
|
+
const U = /* @__PURE__ */ Symbol();
|
|
1400
|
+
function S(Q) {
|
|
1401
1401
|
return Q instanceof Error ? {
|
|
1402
1402
|
type: "error",
|
|
1403
1403
|
error: { type: Q.constructor.name, message: Q.message }
|
|
@@ -1417,13 +1417,13 @@ class zA {
|
|
|
1417
1417
|
C.href = I, C.download = this.name, document.body.appendChild(C), C.click(), document.body.removeChild(C), URL.revokeObjectURL(I);
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
|
-
class fA extends
|
|
1420
|
+
class fA extends MA {
|
|
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
|
|
1424
1424
|
* clients of the library.
|
|
1425
1425
|
*/
|
|
1426
|
-
[
|
|
1426
|
+
[U];
|
|
1427
1427
|
dap;
|
|
1428
1428
|
/**
|
|
1429
1429
|
* Whether or not debugging is enabled.
|
|
@@ -1440,11 +1440,11 @@ class fA extends kA {
|
|
|
1440
1440
|
this.dap.setFilterInternals(A);
|
|
1441
1441
|
}
|
|
1442
1442
|
constructor() {
|
|
1443
|
-
super(), this[
|
|
1443
|
+
super(), this[U] = {
|
|
1444
1444
|
attach: this.attach.bind(this),
|
|
1445
1445
|
detach: this.detach.bind(this),
|
|
1446
1446
|
beginRun: () => this.dap.resetRun()
|
|
1447
|
-
}, this.onMessage = this.onMessage.bind(this), this.dap = new
|
|
1447
|
+
}, this.onMessage = this.onMessage.bind(this), this.dap = new $(), this.dap.on(this.onMessage);
|
|
1448
1448
|
}
|
|
1449
1449
|
send(A) {
|
|
1450
1450
|
return this.dap.sendMessage(A);
|
|
@@ -1473,7 +1473,7 @@ function lA(Q, A) {
|
|
|
1473
1473
|
}
|
|
1474
1474
|
function bA(Q) {
|
|
1475
1475
|
return new Worker(
|
|
1476
|
-
"" + new URL("assets/worker-
|
|
1476
|
+
"" + new URL("assets/worker-CgVDPM2f.js", import.meta.url).href,
|
|
1477
1477
|
{
|
|
1478
1478
|
type: "module",
|
|
1479
1479
|
name: Q?.name
|
|
@@ -1484,7 +1484,7 @@ function mA(Q) {
|
|
|
1484
1484
|
return new bA(Q ? { name: XA + Q } : void 0);
|
|
1485
1485
|
}
|
|
1486
1486
|
const rA = "/dev/debugger-sh-host";
|
|
1487
|
-
class
|
|
1487
|
+
class oA {
|
|
1488
1488
|
buffer = new SharedArrayBuffer(4 + 64 * 1024);
|
|
1489
1489
|
length = new Int32Array(this.buffer, 0, 1);
|
|
1490
1490
|
bytes = new Uint8Array(this.buffer, 4);
|
|
@@ -1492,7 +1492,7 @@ class wA {
|
|
|
1492
1492
|
Atomics.store(this.length, 0, A), Atomics.notify(this.length, 0);
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
|
-
function
|
|
1495
|
+
function IA(Q) {
|
|
1496
1496
|
try {
|
|
1497
1497
|
return new Error(
|
|
1498
1498
|
`Host device callback failed: ${Q instanceof Error ? Q.message : String(Q)}`
|
|
@@ -1501,22 +1501,22 @@ function AA(Q) {
|
|
|
1501
1501
|
return new Error("Host device callback failed");
|
|
1502
1502
|
}
|
|
1503
1503
|
}
|
|
1504
|
-
function
|
|
1504
|
+
function NA(Q) {
|
|
1505
1505
|
try {
|
|
1506
1506
|
const A = Q?.();
|
|
1507
1507
|
if (A && typeof A.then == "function")
|
|
1508
1508
|
return Promise.resolve(A).catch(() => {
|
|
1509
1509
|
}), new TypeError("Host device cleanup must be synchronous");
|
|
1510
1510
|
} catch (A) {
|
|
1511
|
-
return
|
|
1511
|
+
return IA(A);
|
|
1512
1512
|
}
|
|
1513
1513
|
}
|
|
1514
1514
|
class PA {
|
|
1515
1515
|
constructor(A) {
|
|
1516
1516
|
this.onFailure = A;
|
|
1517
1517
|
}
|
|
1518
|
-
incoming = new
|
|
1519
|
-
outgoing = new
|
|
1518
|
+
incoming = new oA();
|
|
1519
|
+
outgoing = new oA();
|
|
1520
1520
|
workerStart = {
|
|
1521
1521
|
guest_to_host: this.incoming.buffer,
|
|
1522
1522
|
host_to_guest: this.outgoing.buffer
|
|
@@ -1541,14 +1541,14 @@ class PA {
|
|
|
1541
1541
|
write: (I) => this.write(I)
|
|
1542
1542
|
});
|
|
1543
1543
|
} catch (I) {
|
|
1544
|
-
throw
|
|
1544
|
+
throw IA(I);
|
|
1545
1545
|
}
|
|
1546
1546
|
if (g !== void 0 && typeof g != "function")
|
|
1547
1547
|
throw Promise.resolve(g).catch(() => {
|
|
1548
1548
|
}), new TypeError("Host device opener must return a cleanup function or undefined");
|
|
1549
1549
|
if (typeof g == "function")
|
|
1550
1550
|
if (this.abort.signal.aborted) {
|
|
1551
|
-
const I =
|
|
1551
|
+
const I = NA(g);
|
|
1552
1552
|
if (I) throw I;
|
|
1553
1553
|
} else this.cleanup = g;
|
|
1554
1554
|
}
|
|
@@ -1596,13 +1596,13 @@ class PA {
|
|
|
1596
1596
|
}
|
|
1597
1597
|
};
|
|
1598
1598
|
fail(A) {
|
|
1599
|
-
this.abort.signal.aborted || (this.close(), this.onFailure(
|
|
1599
|
+
this.abort.signal.aborted || (this.close(), this.onFailure(IA(A)));
|
|
1600
1600
|
}
|
|
1601
1601
|
close() {
|
|
1602
1602
|
if (this.abort.signal.aborted) return;
|
|
1603
1603
|
this.worker?.removeEventListener("message", this.onMessage), this.worker = void 0, this.incoming.publish(-1), this.outgoing.publish(-1), this.abort.abort(), this.listeners.clear();
|
|
1604
1604
|
const A = this.cleanup;
|
|
1605
|
-
return this.cleanup = void 0,
|
|
1605
|
+
return this.cleanup = void 0, NA(A);
|
|
1606
1606
|
}
|
|
1607
1607
|
}
|
|
1608
1608
|
const nA = [
|
|
@@ -1612,7 +1612,7 @@ const nA = [
|
|
|
1612
1612
|
sysroot: "8745c6af23fd841fa507d0c73f6b6b8e8da1b4ec216a6339739a28b38ff7227b",
|
|
1613
1613
|
exceptions: "20986166552953de0e3ca5c1e9f341e7aec8b9ba54dcb244d0d2b2f9ca843ab4"
|
|
1614
1614
|
});
|
|
1615
|
-
function
|
|
1615
|
+
function yA(Q = "legacy") {
|
|
1616
1616
|
if (Q === "legacy") return { profile: Q, digests: r };
|
|
1617
1617
|
if (Q === "stock-certified-v1" && nA.length > 0)
|
|
1618
1618
|
return { profile: Q, digests: r };
|
|
@@ -1626,33 +1626,34 @@ class f {
|
|
|
1626
1626
|
this.#A = A, this.hashMs = g;
|
|
1627
1627
|
}
|
|
1628
1628
|
static async load(A, g, I, C = r.exceptions, B = "legacy") {
|
|
1629
|
-
const i =
|
|
1629
|
+
const i = yA(B);
|
|
1630
1630
|
if (A.length !== 2) throw new Error("Missing C++ toolchain assets");
|
|
1631
|
-
let D;
|
|
1632
|
-
const
|
|
1633
|
-
A.map(async (
|
|
1631
|
+
let D, N;
|
|
1632
|
+
const K = await Promise.allSettled(
|
|
1633
|
+
A.map(async (u, v) => {
|
|
1634
1634
|
try {
|
|
1635
|
-
const
|
|
1636
|
-
if (!
|
|
1637
|
-
return
|
|
1638
|
-
|
|
1639
|
-
|
|
1635
|
+
const d = await fetch(u, { cache: "force-cache", signal: I });
|
|
1636
|
+
if (!d.ok) throw new Error(`Cannot load C++ toolchain (${d.status})`);
|
|
1637
|
+
return v === 0 && g && (N = WebAssembly.compileStreaming(d.clone()), N.catch(() => {
|
|
1638
|
+
})), new Uint8Array(await d.arrayBuffer());
|
|
1639
|
+
} catch (d) {
|
|
1640
|
+
throw D ??= { error: d }, d;
|
|
1640
1641
|
}
|
|
1641
1642
|
})
|
|
1642
1643
|
);
|
|
1643
|
-
if (
|
|
1644
|
+
if (K[0].status === "rejected" || K[1].status === "rejected")
|
|
1644
1645
|
throw D?.error;
|
|
1645
|
-
const [
|
|
1646
|
-
f.ingestOwned(
|
|
1647
|
-
g ? Promise.resolve().then(() => WebAssembly.compile(
|
|
1646
|
+
const [J, L] = [K[0].value, K[1].value], [Y, s] = await Promise.allSettled([
|
|
1647
|
+
f.ingestOwned(J, L, !1, C),
|
|
1648
|
+
g ? N ?? Promise.resolve().then(() => WebAssembly.compile(J)) : Promise.resolve(void 0)
|
|
1648
1649
|
]);
|
|
1649
|
-
if (
|
|
1650
|
-
const
|
|
1651
|
-
if (
|
|
1650
|
+
if (Y.status === "rejected") throw Y.reason;
|
|
1651
|
+
const H = Y.value;
|
|
1652
|
+
if (H.#A.compilerHash !== i.digests.compiler || H.#A.sysrootHash !== i.digests.sysroot || H.#A.exceptionsHash !== i.digests.exceptions)
|
|
1652
1653
|
throw new Error("C++ toolchain integrity mismatch");
|
|
1653
1654
|
if (I?.aborted) throw new DOMException("Toolchain loading aborted", "AbortError");
|
|
1654
|
-
if (
|
|
1655
|
-
return
|
|
1655
|
+
if (s.status === "rejected") throw s.reason;
|
|
1656
|
+
return H.#A.stockProfile = i.profile === "stock-certified-v1", H.#A.module = s.value, H;
|
|
1656
1657
|
}
|
|
1657
1658
|
/** Captures even Buffer/subclass inputs before the first asynchronous boundary. */
|
|
1658
1659
|
static async fromBytes(A, g, I) {
|
|
@@ -1665,7 +1666,7 @@ class f {
|
|
|
1665
1666
|
);
|
|
1666
1667
|
}
|
|
1667
1668
|
static async ingestOwned(A, g, I, C) {
|
|
1668
|
-
const B = performance.now(), i = await Promise.allSettled([
|
|
1669
|
+
const B = performance.now(), i = await Promise.allSettled([kA(A), kA(g)]);
|
|
1669
1670
|
if (i[0].status === "rejected") throw i[0].reason;
|
|
1670
1671
|
if (i[1].status === "rejected") throw i[1].reason;
|
|
1671
1672
|
const [D, N] = [i[0].value, i[1].value], K = I ? await WebAssembly.compile(A) : void 0;
|
|
@@ -1697,15 +1698,15 @@ class f {
|
|
|
1697
1698
|
}
|
|
1698
1699
|
}
|
|
1699
1700
|
}
|
|
1700
|
-
async function
|
|
1701
|
+
async function kA(Q) {
|
|
1701
1702
|
const A = await crypto.subtle.digest("SHA-256", Q);
|
|
1702
1703
|
return Array.from(new Uint8Array(A), (g) => g.toString(16).padStart(2, "0")).join("");
|
|
1703
1704
|
}
|
|
1704
|
-
let
|
|
1705
|
-
class
|
|
1706
|
-
stdout = new
|
|
1707
|
-
stderr = new
|
|
1708
|
-
stdin = new
|
|
1705
|
+
let _, m;
|
|
1706
|
+
class KA {
|
|
1707
|
+
stdout = new FA(1);
|
|
1708
|
+
stderr = new FA(2);
|
|
1709
|
+
stdin = new q();
|
|
1709
1710
|
debugger;
|
|
1710
1711
|
lang;
|
|
1711
1712
|
scope;
|
|
@@ -1747,13 +1748,13 @@ class GA {
|
|
|
1747
1748
|
const { wasmUrl: I, ...C } = g, B = I === void 0 ? void 0 : lA(I, globalThis.location?.href), i = structuredClone(C), D = B ?? null;
|
|
1748
1749
|
if (m !== void 0 && m !== D)
|
|
1749
1750
|
throw new Error("The engine Wasm is already loaded from a different wasmUrl");
|
|
1750
|
-
m = D,
|
|
1751
|
-
throw
|
|
1752
|
-
}), await
|
|
1753
|
-
const N = new
|
|
1751
|
+
m = D, _ ??= VA({ module_or_path: B ?? WA }).catch((K) => {
|
|
1752
|
+
throw _ = void 0, m = void 0, K;
|
|
1753
|
+
}), await _;
|
|
1754
|
+
const N = new KA(A, i);
|
|
1754
1755
|
if (N.wasmUrl = B, A !== "c" && typeof window < "u" && typeof fetch < "u")
|
|
1755
|
-
for (const K of
|
|
1756
|
-
fetch(K, { cache: "force-cache" }).then((
|
|
1756
|
+
for (const K of EA(A))
|
|
1757
|
+
fetch(K, { cache: "force-cache" }).then((J) => J.arrayBuffer()).catch(() => {
|
|
1757
1758
|
});
|
|
1758
1759
|
return N;
|
|
1759
1760
|
}
|
|
@@ -1769,7 +1770,7 @@ class GA {
|
|
|
1769
1770
|
throw new TypeError("C++ performance options require project and account identity");
|
|
1770
1771
|
if (I.compilerLifetime !== void 0 && !["idle", "project"].includes(I.compilerLifetime))
|
|
1771
1772
|
throw new TypeError("Invalid compiler lifetime");
|
|
1772
|
-
|
|
1773
|
+
yA(I.toolchainProfile), this.scope = Object.freeze({ ...I.scope }), this.options = Object.freeze({ ...I, scope: this.scope, idleTimeoutMs: C });
|
|
1773
1774
|
}
|
|
1774
1775
|
this.objects = new tA(typeof I?.objectCache == "object" ? I.objectCache : {}), this.debugger = new fA(), this.lang = A;
|
|
1775
1776
|
}
|
|
@@ -1857,7 +1858,7 @@ class GA {
|
|
|
1857
1858
|
/** Load compiler resources. Optional input validation never invokes Clang, links, or runs a guest. */
|
|
1858
1859
|
prepareCompiler(A) {
|
|
1859
1860
|
if (A?.validateCacheInputs !== void 0 && typeof A.validateCacheInputs != "boolean")
|
|
1860
|
-
return Promise.resolve(
|
|
1861
|
+
return Promise.resolve(S(new TypeError("Invalid compiler preparation options")));
|
|
1861
1862
|
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;
|
|
1862
1863
|
return this.submit(!0, !0, g);
|
|
1863
1864
|
}
|
|
@@ -1870,44 +1871,44 @@ class GA {
|
|
|
1870
1871
|
return this.submit(!0);
|
|
1871
1872
|
}
|
|
1872
1873
|
submit(A, g = !1, I = !1) {
|
|
1873
|
-
if (this.disposed) return Promise.resolve(
|
|
1874
|
+
if (this.disposed) return Promise.resolve(S(new Error("Engine is disposed")));
|
|
1874
1875
|
if (this.active || this.cancellationDraining)
|
|
1875
|
-
return Promise.resolve(
|
|
1876
|
+
return Promise.resolve(S(new Error("An engine job is already active")));
|
|
1876
1877
|
if (A && this.lang !== "c")
|
|
1877
|
-
return Promise.resolve(
|
|
1878
|
+
return Promise.resolve(S(new Error("Compile-only is supported for C/C++")));
|
|
1878
1879
|
this.cacheValidation = void 0;
|
|
1879
1880
|
const C = g && !I;
|
|
1880
1881
|
let B;
|
|
1881
1882
|
try {
|
|
1882
1883
|
const Y = C || !this.cppArtifacts ? null : { ...this.cppArtifacts };
|
|
1883
1884
|
if (Y?.cacheCertificate !== void 0) {
|
|
1884
|
-
const
|
|
1885
|
-
(typeof
|
|
1885
|
+
const s = Y.cacheCertificate;
|
|
1886
|
+
(typeof s != "string" || s.length > 1024 * 1024 || new TextEncoder().encode(s).byteLength > 1024 * 1024) && delete Y.cacheCertificate;
|
|
1886
1887
|
}
|
|
1887
1888
|
B = {
|
|
1888
1889
|
fs: C ? {} : structuredClone(this.fs),
|
|
1889
1890
|
binary_files: Object.fromEntries(
|
|
1890
|
-
Object.entries(C ? {} : this.binaryFiles).map(([
|
|
1891
|
-
|
|
1892
|
-
new Uint8Array(
|
|
1891
|
+
Object.entries(C ? {} : this.binaryFiles).map(([s, H]) => [
|
|
1892
|
+
s,
|
|
1893
|
+
new Uint8Array(H)
|
|
1893
1894
|
])
|
|
1894
1895
|
),
|
|
1895
1896
|
cpp_artifacts: structuredClone(Y)
|
|
1896
1897
|
};
|
|
1897
1898
|
} catch (Y) {
|
|
1898
|
-
return Promise.resolve(
|
|
1899
|
+
return Promise.resolve(S(Y));
|
|
1899
1900
|
}
|
|
1900
1901
|
const i = !A && this.debugger.enabled, D = A ? void 0 : this.hostDevice;
|
|
1901
1902
|
if (D !== void 0 && (typeof D != "function" || !["c", "python"].includes(this.lang)))
|
|
1902
|
-
return Promise.resolve(
|
|
1903
|
-
clearTimeout(this.idleTimer), this.stdin[
|
|
1903
|
+
return Promise.resolve(S(new TypeError("Invalid host device configuration")));
|
|
1904
|
+
clearTimeout(this.idleTimer), this.stdin[U].clear();
|
|
1904
1905
|
const N = !!this.slot;
|
|
1905
1906
|
let K;
|
|
1906
|
-
const
|
|
1907
|
+
const J = new Promise((Y) => {
|
|
1907
1908
|
K = Y;
|
|
1908
1909
|
});
|
|
1909
|
-
this.promise =
|
|
1910
|
-
const
|
|
1910
|
+
this.promise = J;
|
|
1911
|
+
const L = {
|
|
1911
1912
|
generation: this.generation,
|
|
1912
1913
|
scopeEpoch: this.scopeEpoch,
|
|
1913
1914
|
operationId: ++this.operationId,
|
|
@@ -1935,7 +1936,7 @@ class GA {
|
|
|
1935
1936
|
cache_epoch: this.generation,
|
|
1936
1937
|
is_debug: i,
|
|
1937
1938
|
build_only: A,
|
|
1938
|
-
stdin_buffer: this.stdin[
|
|
1939
|
+
stdin_buffer: this.stdin[U].buffer,
|
|
1939
1940
|
cpp_cache: this.options?.objectCache && !i && !g ? {
|
|
1940
1941
|
generation: this.generation,
|
|
1941
1942
|
entries: this.objects.snapshot(),
|
|
@@ -1947,17 +1948,17 @@ class GA {
|
|
|
1947
1948
|
} : null
|
|
1948
1949
|
}
|
|
1949
1950
|
};
|
|
1950
|
-
this.objects.beginBatch(), this.active =
|
|
1951
|
+
this.objects.beginBatch(), this.active = L;
|
|
1951
1952
|
try {
|
|
1952
|
-
if (this.slot || this.makeWorker(), !this.current(
|
|
1953
|
+
if (this.slot || this.makeWorker(), !this.current(L)) return J;
|
|
1953
1954
|
const Y = this.slot;
|
|
1954
|
-
this.lang === "c" && !this.toolchain && this.ensureToolchain().catch((
|
|
1955
|
-
this.current(
|
|
1956
|
-
}), this.slot.ready && this.dispatch(
|
|
1955
|
+
this.lang === "c" && !this.toolchain && this.ensureToolchain().catch((s) => {
|
|
1956
|
+
this.current(L) && this.slot === Y && this.finish(L, S(s));
|
|
1957
|
+
}), this.slot.ready && this.dispatch(L);
|
|
1957
1958
|
} catch (Y) {
|
|
1958
|
-
this.finish(
|
|
1959
|
+
this.finish(L, S(Y));
|
|
1959
1960
|
}
|
|
1960
|
-
return
|
|
1961
|
+
return J;
|
|
1961
1962
|
}
|
|
1962
1963
|
current(A) {
|
|
1963
1964
|
return this.active === A && !A.settled;
|
|
@@ -1976,7 +1977,7 @@ class GA {
|
|
|
1976
1977
|
}
|
|
1977
1978
|
if (!(!N || !this.current(N))) {
|
|
1978
1979
|
if (!g.ready && D.type === "error") {
|
|
1979
|
-
this.finish(N,
|
|
1980
|
+
this.finish(N, S(new Error(D.message)));
|
|
1980
1981
|
return;
|
|
1981
1982
|
}
|
|
1982
1983
|
if (!(D.operationId !== N.operationId || D.scopeEpoch !== N.scopeEpoch))
|
|
@@ -1984,13 +1985,13 @@ class GA {
|
|
|
1984
1985
|
if (D.type === "cpp_cache_eligibility") {
|
|
1985
1986
|
if (this.options?.toolchainProfile !== "stock-certified-v1" || N.prepareOnly && !N.validateCacheInputs)
|
|
1986
1987
|
return;
|
|
1987
|
-
const K = (
|
|
1988
|
+
const K = (L) => typeof L == "string" && /^[0-9a-f]{64}$/.test(L), J = D.eligible === !0 && K(D.certificate_sha256) && K(D.snapshot);
|
|
1988
1989
|
this.cacheValidation = {
|
|
1989
|
-
eligible:
|
|
1990
|
+
eligible: J,
|
|
1990
1991
|
certificate: K(D.certificate_sha256) ? D.certificate_sha256 : void 0,
|
|
1991
|
-
snapshot:
|
|
1992
|
+
snapshot: J ? D.snapshot : void 0,
|
|
1992
1993
|
operationId: N.operationId,
|
|
1993
|
-
reason:
|
|
1994
|
+
reason: J ? void 0 : typeof D.reason == "string" ? D.reason.slice(0, 128) : "stock-input-validation"
|
|
1994
1995
|
};
|
|
1995
1996
|
} else if (D.type === "stop")
|
|
1996
1997
|
this.finish(N, {
|
|
@@ -2003,7 +2004,7 @@ class GA {
|
|
|
2003
2004
|
}
|
|
2004
2005
|
});
|
|
2005
2006
|
else if (D.type === "error")
|
|
2006
|
-
this.finish(N,
|
|
2007
|
+
this.finish(N, S(new Error(D.message)));
|
|
2007
2008
|
else if (D.type === "cpp_cache_object" && D.generation === this.generation && N.generation === this.generation)
|
|
2008
2009
|
try {
|
|
2009
2010
|
this.objects.stage(D);
|
|
@@ -2012,14 +2013,14 @@ class GA {
|
|
|
2012
2013
|
}
|
|
2013
2014
|
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);
|
|
2014
2015
|
} catch (K) {
|
|
2015
|
-
this.finish(N,
|
|
2016
|
+
this.finish(N, S(K));
|
|
2016
2017
|
}
|
|
2017
2018
|
}
|
|
2018
2019
|
}, C = (i) => {
|
|
2019
|
-
this.slot === g && (this.clearCaches(), this.active ? this.finish(this.active,
|
|
2020
|
+
this.slot === g && (this.clearCaches(), this.active ? this.finish(this.active, S(i.error ?? new Error(i.message))) : this.retireWorker());
|
|
2020
2021
|
}, B = () => C({ message: "Unreadable execution worker message" });
|
|
2021
|
-
this.debugger[
|
|
2022
|
-
A.removeEventListener("message", I), A.removeEventListener("error", C), A.removeEventListener("messageerror", B), this.debugger[
|
|
2022
|
+
this.debugger[U].attach(A), A.addEventListener("message", I), A.addEventListener("error", C), A.addEventListener("messageerror", B), g.remove = () => {
|
|
2023
|
+
A.removeEventListener("message", I), A.removeEventListener("error", C), A.removeEventListener("messageerror", B), this.debugger[U].detach(A);
|
|
2023
2024
|
};
|
|
2024
2025
|
}
|
|
2025
2026
|
async publishObjects(A, g) {
|
|
@@ -2057,7 +2058,7 @@ class GA {
|
|
|
2057
2058
|
if (this.toolchainLoading) return this.toolchainLoading;
|
|
2058
2059
|
this.toolchainController = new AbortController();
|
|
2059
2060
|
const A = f.load(
|
|
2060
|
-
|
|
2061
|
+
EA("c"),
|
|
2061
2062
|
this.cacheCompilerModule,
|
|
2062
2063
|
this.toolchainController.signal,
|
|
2063
2064
|
hA(),
|
|
@@ -2097,52 +2098,52 @@ class GA {
|
|
|
2097
2098
|
const I = g.worker;
|
|
2098
2099
|
A.stats.workerReadyMs = performance.now() - A.startedAt;
|
|
2099
2100
|
const C = (B) => this.current(A) && B.scopeEpoch === A.scopeEpoch && B.operationId === A.operationId;
|
|
2100
|
-
if (this.stdout[
|
|
2101
|
-
if (A.device = new PA((B) => this.finish(A,
|
|
2101
|
+
if (this.stdout[U].attach(I, C), this.stderr[U].attach(I, C), A.prepareOnly || this.debugger[U].beginRun(), A.opener) {
|
|
2102
|
+
if (A.device = new PA((B) => this.finish(A, S(B))), A.device.attach(I), A.device.open(A.opener), !this.current(A)) return;
|
|
2102
2103
|
A.start.host_device = A.device.workerStart;
|
|
2103
2104
|
}
|
|
2104
2105
|
this.current(A) && (I.postMessage(A.start), A.start.fs = {}, A.start.binary_files = {}, A.start.cpp_artifacts = null, A.start.cpp_cache = null);
|
|
2105
2106
|
} catch (I) {
|
|
2106
|
-
this.current(A) && (this.toolchainLoading = void 0, this.finish(A,
|
|
2107
|
+
this.current(A) && (this.toolchainLoading = void 0, this.finish(A, S(I)));
|
|
2107
2108
|
}
|
|
2108
2109
|
}
|
|
2109
2110
|
finish(A, g) {
|
|
2110
2111
|
if (!this.current(A)) return;
|
|
2111
2112
|
(g.type !== "completed" || g.exitCode !== 0) && (this.cacheValidation = void 0), A.settled = !0;
|
|
2112
2113
|
const I = this.slot?.worker;
|
|
2113
|
-
I && (this.stdout[
|
|
2114
|
+
I && (this.stdout[U].detach(I), this.stderr[U].detach(I));
|
|
2114
2115
|
const C = A.device?.close();
|
|
2115
|
-
C && (g =
|
|
2116
|
+
C && (g = S(C));
|
|
2116
2117
|
const B = g.type === "completed" && A.generation === this.generation && !this.disposed, i = B && g.type === "completed" && g.exitCode === 0;
|
|
2117
2118
|
if (A.generation === this.generation)
|
|
2118
2119
|
for (const D of A.stats.cache?.invalid_sources ?? []) this.objects.delete(D);
|
|
2119
2120
|
if (i)
|
|
2120
2121
|
for (const D of A.stats.cache?.hit_sources ?? []) this.objects.touch(D);
|
|
2121
|
-
this.objects.discardBatch(), this.latest = A.stats, this.stdin[
|
|
2122
|
+
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(() => {
|
|
2122
2123
|
this.retireWorker(), this.toolchain = void 0, this.toolchainLoading = void 0;
|
|
2123
2124
|
}, 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);
|
|
2124
2125
|
}
|
|
2125
2126
|
retireWorker() {
|
|
2126
2127
|
clearTimeout(this.idleTimer);
|
|
2127
2128
|
const A = this.slot;
|
|
2128
|
-
A && (this.slot = void 0, A.remove(), this.stdout[
|
|
2129
|
+
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++);
|
|
2129
2130
|
}
|
|
2130
2131
|
}
|
|
2131
|
-
class
|
|
2132
|
+
class FA extends MA {
|
|
2132
2133
|
constructor(A) {
|
|
2133
2134
|
super(), this.mode = A, this.callback = ((g) => {
|
|
2134
2135
|
const I = g.data;
|
|
2135
2136
|
if (this.accepts && !this.accepts(I) || I.type !== "stdout" || I.mode !== this.mode) return;
|
|
2136
2137
|
const C = I.data;
|
|
2137
2138
|
this.emit("data", C);
|
|
2138
|
-
}).bind(this), this[
|
|
2139
|
+
}).bind(this), this[U] = {
|
|
2139
2140
|
attach: this.attach.bind(this),
|
|
2140
2141
|
detach: this.detach.bind(this)
|
|
2141
2142
|
};
|
|
2142
2143
|
}
|
|
2143
2144
|
callback;
|
|
2144
2145
|
accepts;
|
|
2145
|
-
[
|
|
2146
|
+
[U];
|
|
2146
2147
|
attach(A, g) {
|
|
2147
2148
|
this.accepts = g, A.addEventListener("message", this.callback);
|
|
2148
2149
|
}
|
|
@@ -2150,7 +2151,7 @@ class NA extends kA {
|
|
|
2150
2151
|
A.removeEventListener("message", this.callback);
|
|
2151
2152
|
}
|
|
2152
2153
|
}
|
|
2153
|
-
class
|
|
2154
|
+
class q {
|
|
2154
2155
|
/**
|
|
2155
2156
|
* Ring buffer to store stdin data.
|
|
2156
2157
|
*
|
|
@@ -2160,19 +2161,19 @@ class a {
|
|
|
2160
2161
|
static BUFFER_SIZE = 2048;
|
|
2161
2162
|
static HEADER_SIZE = 8;
|
|
2162
2163
|
// 2 x i32
|
|
2163
|
-
static DATA_SIZE =
|
|
2164
|
+
static DATA_SIZE = q.BUFFER_SIZE - q.HEADER_SIZE;
|
|
2164
2165
|
static READ_IDX = 0;
|
|
2165
2166
|
static WRITE_IDX = 1;
|
|
2166
2167
|
static encoder = new TextEncoder();
|
|
2167
|
-
buffer = new SharedArrayBuffer(
|
|
2168
|
+
buffer = new SharedArrayBuffer(q.BUFFER_SIZE);
|
|
2168
2169
|
generation = 0;
|
|
2169
2170
|
indices;
|
|
2170
2171
|
data;
|
|
2171
|
-
[
|
|
2172
|
+
[U];
|
|
2172
2173
|
constructor() {
|
|
2173
|
-
this.indices = new Int32Array(this.buffer, 0, 2), this.data = new Int8Array(this.buffer,
|
|
2174
|
+
this.indices = new Int32Array(this.buffer, 0, 2), this.data = new Int8Array(this.buffer, q.HEADER_SIZE);
|
|
2174
2175
|
const A = () => this.buffer;
|
|
2175
|
-
this[
|
|
2176
|
+
this[U] = {
|
|
2176
2177
|
clear: this.clear.bind(this),
|
|
2177
2178
|
get buffer() {
|
|
2178
2179
|
return A();
|
|
@@ -2180,14 +2181,14 @@ class a {
|
|
|
2180
2181
|
};
|
|
2181
2182
|
}
|
|
2182
2183
|
clear() {
|
|
2183
|
-
this.generation++, Atomics.notify(this.indices,
|
|
2184
|
+
this.generation++, Atomics.notify(this.indices, q.READ_IDX), this.buffer = new SharedArrayBuffer(q.BUFFER_SIZE), this.indices = new Int32Array(this.buffer, 0, 2), this.data = new Int8Array(this.buffer, q.HEADER_SIZE);
|
|
2184
2185
|
}
|
|
2185
2186
|
async write(A) {
|
|
2186
|
-
const g = typeof A == "string" ?
|
|
2187
|
+
const g = typeof A == "string" ? q.encoder.encode(A) : A;
|
|
2187
2188
|
return this.writeBytes(g);
|
|
2188
2189
|
}
|
|
2189
2190
|
async writeBytes(A) {
|
|
2190
|
-
const { DATA_SIZE: g, READ_IDX: I, WRITE_IDX: C } =
|
|
2191
|
+
const { DATA_SIZE: g, READ_IDX: I, WRITE_IDX: C } = q;
|
|
2191
2192
|
let B = 0;
|
|
2192
2193
|
const i = this.generation;
|
|
2193
2194
|
for (; B < A.length && i === this.generation; ) {
|
|
@@ -2199,16 +2200,16 @@ class a {
|
|
|
2199
2200
|
await Atomics.waitAsync(this.indices, I, D).value;
|
|
2200
2201
|
continue;
|
|
2201
2202
|
}
|
|
2202
|
-
const
|
|
2203
|
-
this.data.set(A.subarray(B, B +
|
|
2203
|
+
const J = Math.min(A.length - B, K);
|
|
2204
|
+
this.data.set(A.subarray(B, B + J), N), Atomics.store(this.indices, C, (N + J) % g), Atomics.notify(this.indices, C), B += J;
|
|
2204
2205
|
}
|
|
2205
2206
|
}
|
|
2206
2207
|
}
|
|
2207
2208
|
export {
|
|
2208
2209
|
zA as Artifact,
|
|
2209
2210
|
fA as Debugger,
|
|
2210
|
-
|
|
2211
|
+
KA as Engine,
|
|
2211
2212
|
rA as HOST_DEVICE_PATH,
|
|
2212
|
-
|
|
2213
|
-
|
|
2213
|
+
q as Stdin,
|
|
2214
|
+
FA as Stdout
|
|
2214
2215
|
};
|