@a-company/paradigm 3.9.0 → 3.12.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/{accept-orchestration-DIGPJVUR.js → accept-orchestration-YKMKMWGA.js} +5 -5
- package/dist/{assessment-loader-T4GPBHLB.js → assessment-loader-C5EOUM47.js} +0 -1
- package/dist/{chunk-4N6AYEEA.js → chunk-4PEQHWD7.js} +1 -1
- package/dist/{chunk-5S5CF3ER.js → chunk-4ZO3ZOPM.js} +19 -2141
- package/dist/chunk-C3BK3E23.js +268 -0
- package/dist/{chunk-Y4XZWCHK.js → chunk-CQFNTBFJ.js} +8 -8
- package/dist/{chunk-KFHK6EBI.js → chunk-CYGHL7PQ.js} +63 -7
- package/dist/{chunk-M2XMTJHQ.js → chunk-DS5QY37M.js} +201 -287
- package/dist/chunk-F6EJKLF4.js +4971 -0
- package/dist/{chunk-6RNYVBSG.js → chunk-JQYGPVLQ.js} +4 -4
- package/dist/{chunk-BC6XKMUA.js → chunk-K34C7NAN.js} +4 -4
- package/dist/{chunk-2QNZ6PVD.js → chunk-KB4XJWE3.js} +63 -1
- package/dist/chunk-MW5DMGBB.js +255 -0
- package/dist/{chunk-GY5KO3YZ.js → chunk-RDPXBMHK.js} +1 -1
- package/dist/{chunk-QHJGB5TV.js → chunk-RP6TZYGE.js} +1 -1
- package/dist/{chunk-ADOBV4PH.js → chunk-UVI3OH3G.js} +6 -2127
- package/dist/{diff-J6C5IHPV.js → diff-4FV7T35U.js} +5 -5
- package/dist/{dist-OLFOTUHS.js → dist-6SX5ZKKF.js} +2 -2
- package/dist/{dist-OMY7U6NR.js → dist-YB7T54QE.js} +1 -2
- package/dist/{doctor-TQYRF7KK.js → doctor-2KM5HOK6.js} +3 -3
- package/dist/drift-FH2UY64B.js +251 -0
- package/dist/{flow-7JUH6D4H.js → flow-MCKPJGRJ.js} +1 -1
- package/dist/{habits-ZJBAL4HD.js → habits-NC2TRMRV.js} +2 -2
- package/dist/{hooks-DLZEYHI3.js → hooks-JXYHVGIN.js} +1 -1
- package/dist/index.js +87 -61
- package/dist/mcp.js +5502 -9984
- package/dist/{orchestrate-FAV64G2R.js → orchestrate-IV54FMHD.js} +5 -5
- package/dist/{plugin-update-checker-TWBWUSAG.js → plugin-update-checker-S3W4BUJO.js} +0 -1
- package/dist/portal-check-2HI4FFD6.js +42 -0
- package/dist/portal-compliance-KQCTAQTJ.js +18 -0
- package/dist/{providers-NQ67LO2Z.js → providers-IONB4YRJ.js} +1 -1
- package/dist/reindex-ZM6J53UP.js +11 -0
- package/dist/{sentinel-KDIGZWKT.js → sentinel-BGCISNIK.js} +1 -1
- package/dist/{server-NN7WDAZJ.js → server-3K3TTJH3.js} +1 -1
- package/dist/{shift-KJWSJLWN.js → shift-G2ZCIR5Q.js} +158 -19
- package/dist/{spawn-EO7B2UM3.js → spawn-7SDONTJN.js} +3 -3
- package/dist/{summary-E2PU4UN2.js → summary-F46FRO3Y.js} +1 -1
- package/dist/{sync-5VJPZQNX.js → sync-4CNRHUWX.js} +3 -3
- package/dist/{sync-llms-7QDA3ZWC.js → sync-llms-MCWB37HN.js} +2 -2
- package/dist/{task-loader-GUX4KS6N.js → task-loader-7M2FCBX6.js} +0 -1
- package/dist/{team-6CCNANKE.js → team-XUZBPIFZ.js} +6 -6
- package/dist/{triage-B5W6GZLT.js → triage-MKKIWBSW.js} +2 -2
- package/dist/{upgrade-RBSE4M6I.js → upgrade-HGF4MBGV.js} +1 -1
- package/dist/{watch-PAEH6MOG.js → watch-CL2PPS2K.js} +1 -1
- package/dist/workspace-7CWY4IWV.js +20 -0
- package/package.json +2 -1
- package/dist/chunk-HPC3JAUP.js +0 -42
- /package/dist/{chunk-CCG6KYBT.js → chunk-5N5LR2KS.js} +0 -0
|
@@ -1,2133 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
__commonJS,
|
|
4
|
-
__require,
|
|
5
|
-
__toESM
|
|
6
|
-
} from "./chunk-MO4EEYFW.js";
|
|
7
|
-
|
|
8
|
-
// ../paradigm-mcp/node_modules/.pnpm/sql.js@1.14.0/node_modules/sql.js/dist/sql-wasm.js
|
|
9
|
-
var require_sql_wasm = __commonJS({
|
|
10
|
-
"../paradigm-mcp/node_modules/.pnpm/sql.js@1.14.0/node_modules/sql.js/dist/sql-wasm.js"(exports, module) {
|
|
11
|
-
"use strict";
|
|
12
|
-
var initSqlJsPromise = void 0;
|
|
13
|
-
var initSqlJs2 = function(moduleConfig) {
|
|
14
|
-
if (initSqlJsPromise) {
|
|
15
|
-
return initSqlJsPromise;
|
|
16
|
-
}
|
|
17
|
-
initSqlJsPromise = new Promise(function(resolveModule, reject) {
|
|
18
|
-
var Module = typeof moduleConfig !== "undefined" ? moduleConfig : {};
|
|
19
|
-
var originalOnAbortFunction = Module["onAbort"];
|
|
20
|
-
Module["onAbort"] = function(errorThatCausedAbort) {
|
|
21
|
-
reject(new Error(errorThatCausedAbort));
|
|
22
|
-
if (originalOnAbortFunction) {
|
|
23
|
-
originalOnAbortFunction(errorThatCausedAbort);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
Module["postRun"] = Module["postRun"] || [];
|
|
27
|
-
Module["postRun"].push(function() {
|
|
28
|
-
resolveModule(Module);
|
|
29
|
-
});
|
|
30
|
-
module = void 0;
|
|
31
|
-
var k;
|
|
32
|
-
k ||= typeof Module != "undefined" ? Module : {};
|
|
33
|
-
var aa = !!globalThis.window, ba = !!globalThis.WorkerGlobalScope, ca = globalThis.process?.versions?.node && "renderer" != globalThis.process?.type;
|
|
34
|
-
k.onRuntimeInitialized = function() {
|
|
35
|
-
function a(f, l) {
|
|
36
|
-
switch (typeof l) {
|
|
37
|
-
case "boolean":
|
|
38
|
-
dc(f, l ? 1 : 0);
|
|
39
|
-
break;
|
|
40
|
-
case "number":
|
|
41
|
-
ec(f, l);
|
|
42
|
-
break;
|
|
43
|
-
case "string":
|
|
44
|
-
fc(f, l, -1, -1);
|
|
45
|
-
break;
|
|
46
|
-
case "object":
|
|
47
|
-
if (null === l) lb(f);
|
|
48
|
-
else if (null != l.length) {
|
|
49
|
-
var n = da(l.length);
|
|
50
|
-
m.set(l, n);
|
|
51
|
-
gc(f, n, l.length, -1);
|
|
52
|
-
ea(n);
|
|
53
|
-
} else sa(f, "Wrong API use : tried to return a value of an unknown type (" + l + ").", -1);
|
|
54
|
-
break;
|
|
55
|
-
default:
|
|
56
|
-
lb(f);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function b(f, l) {
|
|
60
|
-
for (var n = [], p = 0; p < f; p += 1) {
|
|
61
|
-
var u = r(l + 4 * p, "i32"), v = hc(u);
|
|
62
|
-
if (1 === v || 2 === v) u = ic(u);
|
|
63
|
-
else if (3 === v) u = jc(u);
|
|
64
|
-
else if (4 === v) {
|
|
65
|
-
v = u;
|
|
66
|
-
u = kc(v);
|
|
67
|
-
v = lc(v);
|
|
68
|
-
for (var K = new Uint8Array(u), I = 0; I < u; I += 1) K[I] = m[v + I];
|
|
69
|
-
u = K;
|
|
70
|
-
} else u = null;
|
|
71
|
-
n.push(u);
|
|
72
|
-
}
|
|
73
|
-
return n;
|
|
74
|
-
}
|
|
75
|
-
function c(f, l) {
|
|
76
|
-
this.Qa = f;
|
|
77
|
-
this.db = l;
|
|
78
|
-
this.Oa = 1;
|
|
79
|
-
this.lb = [];
|
|
80
|
-
}
|
|
81
|
-
function d(f, l) {
|
|
82
|
-
this.db = l;
|
|
83
|
-
this.eb = fa(f);
|
|
84
|
-
if (null === this.eb) throw Error("Unable to allocate memory for the SQL string");
|
|
85
|
-
this.kb = this.eb;
|
|
86
|
-
this.Za = this.qb = null;
|
|
87
|
-
}
|
|
88
|
-
function e(f) {
|
|
89
|
-
this.filename = "dbfile_" + (4294967295 * Math.random() >>> 0);
|
|
90
|
-
if (null != f) {
|
|
91
|
-
var l = this.filename, n = "/", p = l;
|
|
92
|
-
n && (n = "string" == typeof n ? n : ha(n), p = l ? ia(n + "/" + l) : n);
|
|
93
|
-
l = ja(true, true);
|
|
94
|
-
p = ka(
|
|
95
|
-
p,
|
|
96
|
-
l
|
|
97
|
-
);
|
|
98
|
-
if (f) {
|
|
99
|
-
if ("string" == typeof f) {
|
|
100
|
-
n = Array(f.length);
|
|
101
|
-
for (var u = 0, v = f.length; u < v; ++u) n[u] = f.charCodeAt(u);
|
|
102
|
-
f = n;
|
|
103
|
-
}
|
|
104
|
-
la(p, l | 146);
|
|
105
|
-
n = ma(p, 577);
|
|
106
|
-
na(n, f, 0, f.length, 0);
|
|
107
|
-
oa(n);
|
|
108
|
-
la(p, l);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
this.handleError(q(this.filename, g));
|
|
112
|
-
this.db = r(g, "i32");
|
|
113
|
-
ob(this.db);
|
|
114
|
-
this.fb = {};
|
|
115
|
-
this.Sa = {};
|
|
116
|
-
}
|
|
117
|
-
var g = y(4), h = k.cwrap, q = h("sqlite3_open", "number", ["string", "number"]), w = h("sqlite3_close_v2", "number", ["number"]), t = h("sqlite3_exec", "number", ["number", "string", "number", "number", "number"]), x = h("sqlite3_changes", "number", ["number"]), D = h(
|
|
118
|
-
"sqlite3_prepare_v2",
|
|
119
|
-
"number",
|
|
120
|
-
["number", "string", "number", "number", "number"]
|
|
121
|
-
), pb = h("sqlite3_sql", "string", ["number"]), nc = h("sqlite3_normalized_sql", "string", ["number"]), qb = h("sqlite3_prepare_v2", "number", ["number", "number", "number", "number", "number"]), oc = h("sqlite3_bind_text", "number", ["number", "number", "number", "number", "number"]), rb = h("sqlite3_bind_blob", "number", ["number", "number", "number", "number", "number"]), pc = h("sqlite3_bind_double", "number", ["number", "number", "number"]), qc = h("sqlite3_bind_int", "number", [
|
|
122
|
-
"number",
|
|
123
|
-
"number",
|
|
124
|
-
"number"
|
|
125
|
-
]), rc = h("sqlite3_bind_parameter_index", "number", ["number", "string"]), sc = h("sqlite3_step", "number", ["number"]), tc = h("sqlite3_errmsg", "string", ["number"]), uc = h("sqlite3_column_count", "number", ["number"]), vc = h("sqlite3_data_count", "number", ["number"]), wc = h("sqlite3_column_double", "number", ["number", "number"]), sb = h("sqlite3_column_text", "string", ["number", "number"]), xc = h("sqlite3_column_blob", "number", ["number", "number"]), yc = h("sqlite3_column_bytes", "number", ["number", "number"]), zc = h(
|
|
126
|
-
"sqlite3_column_type",
|
|
127
|
-
"number",
|
|
128
|
-
["number", "number"]
|
|
129
|
-
), Ac = h("sqlite3_column_name", "string", ["number", "number"]), Bc = h("sqlite3_reset", "number", ["number"]), Cc = h("sqlite3_clear_bindings", "number", ["number"]), Dc = h("sqlite3_finalize", "number", ["number"]), tb = h("sqlite3_create_function_v2", "number", "number string number number number number number number number".split(" ")), hc = h("sqlite3_value_type", "number", ["number"]), kc = h("sqlite3_value_bytes", "number", ["number"]), jc = h("sqlite3_value_text", "string", ["number"]), lc = h(
|
|
130
|
-
"sqlite3_value_blob",
|
|
131
|
-
"number",
|
|
132
|
-
["number"]
|
|
133
|
-
), ic = h("sqlite3_value_double", "number", ["number"]), ec = h("sqlite3_result_double", "", ["number", "number"]), lb = h("sqlite3_result_null", "", ["number"]), fc = h("sqlite3_result_text", "", ["number", "string", "number", "number"]), gc = h("sqlite3_result_blob", "", ["number", "number", "number", "number"]), dc = h("sqlite3_result_int", "", ["number", "number"]), sa = h("sqlite3_result_error", "", ["number", "string", "number"]), ub = h("sqlite3_aggregate_context", "number", ["number", "number"]), ob = h(
|
|
134
|
-
"RegisterExtensionFunctions",
|
|
135
|
-
"number",
|
|
136
|
-
["number"]
|
|
137
|
-
), vb = h("sqlite3_update_hook", "number", ["number", "number", "number"]);
|
|
138
|
-
c.prototype.bind = function(f) {
|
|
139
|
-
if (!this.Qa) throw "Statement closed";
|
|
140
|
-
this.reset();
|
|
141
|
-
return Array.isArray(f) ? this.Cb(f) : null != f && "object" === typeof f ? this.Db(f) : true;
|
|
142
|
-
};
|
|
143
|
-
c.prototype.step = function() {
|
|
144
|
-
if (!this.Qa) throw "Statement closed";
|
|
145
|
-
this.Oa = 1;
|
|
146
|
-
var f = sc(this.Qa);
|
|
147
|
-
switch (f) {
|
|
148
|
-
case 100:
|
|
149
|
-
return true;
|
|
150
|
-
case 101:
|
|
151
|
-
return false;
|
|
152
|
-
default:
|
|
153
|
-
throw this.db.handleError(f);
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
c.prototype.wb = function(f) {
|
|
157
|
-
null == f && (f = this.Oa, this.Oa += 1);
|
|
158
|
-
return wc(this.Qa, f);
|
|
159
|
-
};
|
|
160
|
-
c.prototype.Gb = function(f) {
|
|
161
|
-
null == f && (f = this.Oa, this.Oa += 1);
|
|
162
|
-
f = sb(this.Qa, f);
|
|
163
|
-
if ("function" !== typeof BigInt) throw Error("BigInt is not supported");
|
|
164
|
-
return BigInt(f);
|
|
165
|
-
};
|
|
166
|
-
c.prototype.Hb = function(f) {
|
|
167
|
-
null == f && (f = this.Oa, this.Oa += 1);
|
|
168
|
-
return sb(this.Qa, f);
|
|
169
|
-
};
|
|
170
|
-
c.prototype.getBlob = function(f) {
|
|
171
|
-
null == f && (f = this.Oa, this.Oa += 1);
|
|
172
|
-
var l = yc(this.Qa, f);
|
|
173
|
-
f = xc(this.Qa, f);
|
|
174
|
-
for (var n = new Uint8Array(l), p = 0; p < l; p += 1) n[p] = m[f + p];
|
|
175
|
-
return n;
|
|
176
|
-
};
|
|
177
|
-
c.prototype.get = function(f, l) {
|
|
178
|
-
l = l || {};
|
|
179
|
-
null != f && this.bind(f) && this.step();
|
|
180
|
-
f = [];
|
|
181
|
-
for (var n = vc(this.Qa), p = 0; p < n; p += 1) switch (zc(this.Qa, p)) {
|
|
182
|
-
case 1:
|
|
183
|
-
var u = l.useBigInt ? this.Gb(p) : this.wb(p);
|
|
184
|
-
f.push(u);
|
|
185
|
-
break;
|
|
186
|
-
case 2:
|
|
187
|
-
f.push(this.wb(p));
|
|
188
|
-
break;
|
|
189
|
-
case 3:
|
|
190
|
-
f.push(this.Hb(p));
|
|
191
|
-
break;
|
|
192
|
-
case 4:
|
|
193
|
-
f.push(this.getBlob(p));
|
|
194
|
-
break;
|
|
195
|
-
default:
|
|
196
|
-
f.push(null);
|
|
197
|
-
}
|
|
198
|
-
return f;
|
|
199
|
-
};
|
|
200
|
-
c.prototype.getColumnNames = function() {
|
|
201
|
-
for (var f = [], l = uc(this.Qa), n = 0; n < l; n += 1) f.push(Ac(this.Qa, n));
|
|
202
|
-
return f;
|
|
203
|
-
};
|
|
204
|
-
c.prototype.getAsObject = function(f, l) {
|
|
205
|
-
f = this.get(f, l);
|
|
206
|
-
l = this.getColumnNames();
|
|
207
|
-
for (var n = {}, p = 0; p < l.length; p += 1) n[l[p]] = f[p];
|
|
208
|
-
return n;
|
|
209
|
-
};
|
|
210
|
-
c.prototype.getSQL = function() {
|
|
211
|
-
return pb(this.Qa);
|
|
212
|
-
};
|
|
213
|
-
c.prototype.getNormalizedSQL = function() {
|
|
214
|
-
return nc(this.Qa);
|
|
215
|
-
};
|
|
216
|
-
c.prototype.run = function(f) {
|
|
217
|
-
null != f && this.bind(f);
|
|
218
|
-
this.step();
|
|
219
|
-
return this.reset();
|
|
220
|
-
};
|
|
221
|
-
c.prototype.tb = function(f, l) {
|
|
222
|
-
null == l && (l = this.Oa, this.Oa += 1);
|
|
223
|
-
f = fa(f);
|
|
224
|
-
this.lb.push(f);
|
|
225
|
-
this.db.handleError(oc(this.Qa, l, f, -1, 0));
|
|
226
|
-
};
|
|
227
|
-
c.prototype.Bb = function(f, l) {
|
|
228
|
-
null == l && (l = this.Oa, this.Oa += 1);
|
|
229
|
-
var n = da(f.length);
|
|
230
|
-
m.set(f, n);
|
|
231
|
-
this.lb.push(n);
|
|
232
|
-
this.db.handleError(rb(this.Qa, l, n, f.length, 0));
|
|
233
|
-
};
|
|
234
|
-
c.prototype.sb = function(f, l) {
|
|
235
|
-
null == l && (l = this.Oa, this.Oa += 1);
|
|
236
|
-
this.db.handleError((f === (f | 0) ? qc : pc)(this.Qa, l, f));
|
|
237
|
-
};
|
|
238
|
-
c.prototype.Eb = function(f) {
|
|
239
|
-
null == f && (f = this.Oa, this.Oa += 1);
|
|
240
|
-
rb(this.Qa, f, 0, 0, 0);
|
|
241
|
-
};
|
|
242
|
-
c.prototype.ub = function(f, l) {
|
|
243
|
-
null == l && (l = this.Oa, this.Oa += 1);
|
|
244
|
-
switch (typeof f) {
|
|
245
|
-
case "string":
|
|
246
|
-
this.tb(f, l);
|
|
247
|
-
return;
|
|
248
|
-
case "number":
|
|
249
|
-
this.sb(f, l);
|
|
250
|
-
return;
|
|
251
|
-
case "bigint":
|
|
252
|
-
this.tb(f.toString(), l);
|
|
253
|
-
return;
|
|
254
|
-
case "boolean":
|
|
255
|
-
this.sb(f + 0, l);
|
|
256
|
-
return;
|
|
257
|
-
case "object":
|
|
258
|
-
if (null === f) {
|
|
259
|
-
this.Eb(l);
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
if (null != f.length) {
|
|
263
|
-
this.Bb(f, l);
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
throw "Wrong API use : tried to bind a value of an unknown type (" + f + ").";
|
|
268
|
-
};
|
|
269
|
-
c.prototype.Db = function(f) {
|
|
270
|
-
var l = this;
|
|
271
|
-
Object.keys(f).forEach(function(n) {
|
|
272
|
-
var p = rc(l.Qa, n);
|
|
273
|
-
0 !== p && l.ub(f[n], p);
|
|
274
|
-
});
|
|
275
|
-
return true;
|
|
276
|
-
};
|
|
277
|
-
c.prototype.Cb = function(f) {
|
|
278
|
-
for (var l = 0; l < f.length; l += 1) this.ub(f[l], l + 1);
|
|
279
|
-
return true;
|
|
280
|
-
};
|
|
281
|
-
c.prototype.reset = function() {
|
|
282
|
-
this.freemem();
|
|
283
|
-
return 0 === Cc(this.Qa) && 0 === Bc(this.Qa);
|
|
284
|
-
};
|
|
285
|
-
c.prototype.freemem = function() {
|
|
286
|
-
for (var f; void 0 !== (f = this.lb.pop()); ) ea(f);
|
|
287
|
-
};
|
|
288
|
-
c.prototype.free = function() {
|
|
289
|
-
this.freemem();
|
|
290
|
-
var f = 0 === Dc(this.Qa);
|
|
291
|
-
delete this.db.fb[this.Qa];
|
|
292
|
-
this.Qa = 0;
|
|
293
|
-
return f;
|
|
294
|
-
};
|
|
295
|
-
d.prototype.next = function() {
|
|
296
|
-
if (null === this.eb) return { done: true };
|
|
297
|
-
null !== this.Za && (this.Za.free(), this.Za = null);
|
|
298
|
-
if (!this.db.db) throw this.nb(), Error("Database closed");
|
|
299
|
-
var f = pa(), l = y(4);
|
|
300
|
-
qa(g);
|
|
301
|
-
qa(l);
|
|
302
|
-
try {
|
|
303
|
-
this.db.handleError(qb(this.db.db, this.kb, -1, g, l));
|
|
304
|
-
this.kb = r(l, "i32");
|
|
305
|
-
var n = r(g, "i32");
|
|
306
|
-
if (0 === n) return this.nb(), { done: true };
|
|
307
|
-
this.Za = new c(n, this.db);
|
|
308
|
-
this.db.fb[n] = this.Za;
|
|
309
|
-
return { value: this.Za, done: false };
|
|
310
|
-
} catch (p) {
|
|
311
|
-
throw this.qb = z(this.kb), this.nb(), p;
|
|
312
|
-
} finally {
|
|
313
|
-
ra(f);
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
d.prototype.nb = function() {
|
|
317
|
-
ea(this.eb);
|
|
318
|
-
this.eb = null;
|
|
319
|
-
};
|
|
320
|
-
d.prototype.getRemainingSQL = function() {
|
|
321
|
-
return null !== this.qb ? this.qb : z(this.kb);
|
|
322
|
-
};
|
|
323
|
-
"function" === typeof Symbol && "symbol" === typeof Symbol.iterator && (d.prototype[Symbol.iterator] = function() {
|
|
324
|
-
return this;
|
|
325
|
-
});
|
|
326
|
-
e.prototype.run = function(f, l) {
|
|
327
|
-
if (!this.db) throw "Database closed";
|
|
328
|
-
if (l) {
|
|
329
|
-
f = this.prepare(f, l);
|
|
330
|
-
try {
|
|
331
|
-
f.step();
|
|
332
|
-
} finally {
|
|
333
|
-
f.free();
|
|
334
|
-
}
|
|
335
|
-
} else this.handleError(t(this.db, f, 0, 0, g));
|
|
336
|
-
return this;
|
|
337
|
-
};
|
|
338
|
-
e.prototype.exec = function(f, l, n) {
|
|
339
|
-
if (!this.db) throw "Database closed";
|
|
340
|
-
var p = null, u = null, v = null;
|
|
341
|
-
try {
|
|
342
|
-
v = u = fa(f);
|
|
343
|
-
var K = y(4);
|
|
344
|
-
for (f = []; 0 !== r(v, "i8"); ) {
|
|
345
|
-
qa(g);
|
|
346
|
-
qa(K);
|
|
347
|
-
this.handleError(qb(this.db, v, -1, g, K));
|
|
348
|
-
var I = r(g, "i32");
|
|
349
|
-
v = r(K, "i32");
|
|
350
|
-
if (0 !== I) {
|
|
351
|
-
var H = null;
|
|
352
|
-
p = new c(I, this);
|
|
353
|
-
for (null != l && p.bind(l); p.step(); ) null === H && (H = { columns: p.getColumnNames(), values: [] }, f.push(H)), H.values.push(p.get(null, n));
|
|
354
|
-
p.free();
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
return f;
|
|
358
|
-
} catch (L) {
|
|
359
|
-
throw p && p.free(), L;
|
|
360
|
-
} finally {
|
|
361
|
-
u && ea(u);
|
|
362
|
-
}
|
|
363
|
-
};
|
|
364
|
-
e.prototype.each = function(f, l, n, p, u) {
|
|
365
|
-
"function" === typeof l && (p = n, n = l, l = void 0);
|
|
366
|
-
f = this.prepare(f, l);
|
|
367
|
-
try {
|
|
368
|
-
for (; f.step(); ) n(f.getAsObject(null, u));
|
|
369
|
-
} finally {
|
|
370
|
-
f.free();
|
|
371
|
-
}
|
|
372
|
-
if ("function" === typeof p) return p();
|
|
373
|
-
};
|
|
374
|
-
e.prototype.prepare = function(f, l) {
|
|
375
|
-
qa(g);
|
|
376
|
-
this.handleError(D(this.db, f, -1, g, 0));
|
|
377
|
-
f = r(g, "i32");
|
|
378
|
-
if (0 === f) throw "Nothing to prepare";
|
|
379
|
-
var n = new c(f, this);
|
|
380
|
-
null != l && n.bind(l);
|
|
381
|
-
return this.fb[f] = n;
|
|
382
|
-
};
|
|
383
|
-
e.prototype.iterateStatements = function(f) {
|
|
384
|
-
return new d(f, this);
|
|
385
|
-
};
|
|
386
|
-
e.prototype["export"] = function() {
|
|
387
|
-
Object.values(this.fb).forEach(function(l) {
|
|
388
|
-
l.free();
|
|
389
|
-
});
|
|
390
|
-
Object.values(this.Sa).forEach(A);
|
|
391
|
-
this.Sa = {};
|
|
392
|
-
this.handleError(w(this.db));
|
|
393
|
-
var f = ta(this.filename);
|
|
394
|
-
this.handleError(q(this.filename, g));
|
|
395
|
-
this.db = r(g, "i32");
|
|
396
|
-
ob(this.db);
|
|
397
|
-
return f;
|
|
398
|
-
};
|
|
399
|
-
e.prototype.close = function() {
|
|
400
|
-
null !== this.db && (Object.values(this.fb).forEach(function(f) {
|
|
401
|
-
f.free();
|
|
402
|
-
}), Object.values(this.Sa).forEach(A), this.Sa = {}, this.Ya && (A(this.Ya), this.Ya = void 0), this.handleError(w(this.db)), ua("/" + this.filename), this.db = null);
|
|
403
|
-
};
|
|
404
|
-
e.prototype.handleError = function(f) {
|
|
405
|
-
if (0 === f) return null;
|
|
406
|
-
f = tc(this.db);
|
|
407
|
-
throw Error(f);
|
|
408
|
-
};
|
|
409
|
-
e.prototype.getRowsModified = function() {
|
|
410
|
-
return x(this.db);
|
|
411
|
-
};
|
|
412
|
-
e.prototype.create_function = function(f, l) {
|
|
413
|
-
Object.prototype.hasOwnProperty.call(this.Sa, f) && (A(this.Sa[f]), delete this.Sa[f]);
|
|
414
|
-
var n = va(function(p, u, v) {
|
|
415
|
-
u = b(u, v);
|
|
416
|
-
try {
|
|
417
|
-
var K = l.apply(null, u);
|
|
418
|
-
} catch (I) {
|
|
419
|
-
sa(p, I, -1);
|
|
420
|
-
return;
|
|
421
|
-
}
|
|
422
|
-
a(p, K);
|
|
423
|
-
}, "viii");
|
|
424
|
-
this.Sa[f] = n;
|
|
425
|
-
this.handleError(tb(this.db, f, l.length, 1, 0, n, 0, 0, 0));
|
|
426
|
-
return this;
|
|
427
|
-
};
|
|
428
|
-
e.prototype.create_aggregate = function(f, l) {
|
|
429
|
-
var n = l.init || function() {
|
|
430
|
-
return null;
|
|
431
|
-
}, p = l.finalize || function(H) {
|
|
432
|
-
return H;
|
|
433
|
-
}, u = l.step;
|
|
434
|
-
if (!u) throw "An aggregate function must have a step function in " + f;
|
|
435
|
-
var v = {};
|
|
436
|
-
Object.hasOwnProperty.call(this.Sa, f) && (A(this.Sa[f]), delete this.Sa[f]);
|
|
437
|
-
l = f + "__finalize";
|
|
438
|
-
Object.hasOwnProperty.call(
|
|
439
|
-
this.Sa,
|
|
440
|
-
l
|
|
441
|
-
) && (A(this.Sa[l]), delete this.Sa[l]);
|
|
442
|
-
var K = va(function(H, L, Pa) {
|
|
443
|
-
var V = ub(H, 1);
|
|
444
|
-
Object.hasOwnProperty.call(v, V) || (v[V] = n());
|
|
445
|
-
L = b(L, Pa);
|
|
446
|
-
L = [v[V]].concat(L);
|
|
447
|
-
try {
|
|
448
|
-
v[V] = u.apply(null, L);
|
|
449
|
-
} catch (Fc) {
|
|
450
|
-
delete v[V], sa(H, Fc, -1);
|
|
451
|
-
}
|
|
452
|
-
}, "viii"), I = va(function(H) {
|
|
453
|
-
var L = ub(H, 1);
|
|
454
|
-
try {
|
|
455
|
-
var Pa = p(v[L]);
|
|
456
|
-
} catch (V) {
|
|
457
|
-
delete v[L];
|
|
458
|
-
sa(H, V, -1);
|
|
459
|
-
return;
|
|
460
|
-
}
|
|
461
|
-
a(H, Pa);
|
|
462
|
-
delete v[L];
|
|
463
|
-
}, "vi");
|
|
464
|
-
this.Sa[f] = K;
|
|
465
|
-
this.Sa[l] = I;
|
|
466
|
-
this.handleError(tb(this.db, f, u.length - 1, 1, 0, 0, K, I, 0));
|
|
467
|
-
return this;
|
|
468
|
-
};
|
|
469
|
-
e.prototype.updateHook = function(f) {
|
|
470
|
-
this.Ya && (vb(this.db, 0, 0), A(this.Ya), this.Ya = void 0);
|
|
471
|
-
if (!f) return this;
|
|
472
|
-
this.Ya = va(function(l, n, p, u, v) {
|
|
473
|
-
switch (n) {
|
|
474
|
-
case 18:
|
|
475
|
-
l = "insert";
|
|
476
|
-
break;
|
|
477
|
-
case 23:
|
|
478
|
-
l = "update";
|
|
479
|
-
break;
|
|
480
|
-
case 9:
|
|
481
|
-
l = "delete";
|
|
482
|
-
break;
|
|
483
|
-
default:
|
|
484
|
-
throw "unknown operationCode in updateHook callback: " + n;
|
|
485
|
-
}
|
|
486
|
-
p = z(p);
|
|
487
|
-
u = z(u);
|
|
488
|
-
if (v > Number.MAX_SAFE_INTEGER) throw "rowId too big to fit inside a Number";
|
|
489
|
-
f(l, p, u, Number(v));
|
|
490
|
-
}, "viiiij");
|
|
491
|
-
vb(this.db, this.Ya, 0);
|
|
492
|
-
return this;
|
|
493
|
-
};
|
|
494
|
-
k.Database = e;
|
|
495
|
-
};
|
|
496
|
-
var wa = "./this.program", xa = (a, b) => {
|
|
497
|
-
throw b;
|
|
498
|
-
}, ya = globalThis.document?.currentScript?.src;
|
|
499
|
-
"undefined" != typeof __filename ? ya = __filename : ba && (ya = self.location.href);
|
|
500
|
-
var za = "", Aa, Ba;
|
|
501
|
-
if (ca) {
|
|
502
|
-
var fs5 = __require("fs");
|
|
503
|
-
za = __dirname + "/";
|
|
504
|
-
Ba = (a) => {
|
|
505
|
-
a = Ca(a) ? new URL(a) : a;
|
|
506
|
-
return fs5.readFileSync(a);
|
|
507
|
-
};
|
|
508
|
-
Aa = async (a) => {
|
|
509
|
-
a = Ca(a) ? new URL(a) : a;
|
|
510
|
-
return fs5.readFileSync(a, void 0);
|
|
511
|
-
};
|
|
512
|
-
1 < process.argv.length && (wa = process.argv[1].replace(/\\/g, "/"));
|
|
513
|
-
process.argv.slice(2);
|
|
514
|
-
"undefined" != typeof module && (module.exports = k);
|
|
515
|
-
xa = (a, b) => {
|
|
516
|
-
process.exitCode = a;
|
|
517
|
-
throw b;
|
|
518
|
-
};
|
|
519
|
-
} else if (aa || ba) {
|
|
520
|
-
try {
|
|
521
|
-
za = new URL(".", ya).href;
|
|
522
|
-
} catch {
|
|
523
|
-
}
|
|
524
|
-
ba && (Ba = (a) => {
|
|
525
|
-
var b = new XMLHttpRequest();
|
|
526
|
-
b.open("GET", a, false);
|
|
527
|
-
b.responseType = "arraybuffer";
|
|
528
|
-
b.send(null);
|
|
529
|
-
return new Uint8Array(b.response);
|
|
530
|
-
});
|
|
531
|
-
Aa = async (a) => {
|
|
532
|
-
if (Ca(a)) return new Promise((c, d) => {
|
|
533
|
-
var e = new XMLHttpRequest();
|
|
534
|
-
e.open("GET", a, true);
|
|
535
|
-
e.responseType = "arraybuffer";
|
|
536
|
-
e.onload = () => {
|
|
537
|
-
200 == e.status || 0 == e.status && e.response ? c(e.response) : d(e.status);
|
|
538
|
-
};
|
|
539
|
-
e.onerror = d;
|
|
540
|
-
e.send(null);
|
|
541
|
-
});
|
|
542
|
-
var b = await fetch(a, { credentials: "same-origin" });
|
|
543
|
-
if (b.ok) return b.arrayBuffer();
|
|
544
|
-
throw Error(b.status + " : " + b.url);
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
var Da = console.log.bind(console), B = console.error.bind(console), Ea, Fa = false, Ga, Ca = (a) => a.startsWith("file://"), m, C, Ha, E, F, Ia, Ja, G;
|
|
548
|
-
function Ka() {
|
|
549
|
-
var a = La.buffer;
|
|
550
|
-
m = new Int8Array(a);
|
|
551
|
-
Ha = new Int16Array(a);
|
|
552
|
-
C = new Uint8Array(a);
|
|
553
|
-
new Uint16Array(a);
|
|
554
|
-
E = new Int32Array(a);
|
|
555
|
-
F = new Uint32Array(a);
|
|
556
|
-
Ia = new Float32Array(a);
|
|
557
|
-
Ja = new Float64Array(a);
|
|
558
|
-
G = new BigInt64Array(a);
|
|
559
|
-
new BigUint64Array(a);
|
|
560
|
-
}
|
|
561
|
-
function Ma(a) {
|
|
562
|
-
k.onAbort?.(a);
|
|
563
|
-
a = "Aborted(" + a + ")";
|
|
564
|
-
B(a);
|
|
565
|
-
Fa = true;
|
|
566
|
-
throw new WebAssembly.RuntimeError(a + ". Build with -sASSERTIONS for more info.");
|
|
567
|
-
}
|
|
568
|
-
var Na;
|
|
569
|
-
async function Oa(a) {
|
|
570
|
-
if (!Ea) try {
|
|
571
|
-
var b = await Aa(a);
|
|
572
|
-
return new Uint8Array(b);
|
|
573
|
-
} catch {
|
|
574
|
-
}
|
|
575
|
-
if (a == Na && Ea) a = new Uint8Array(Ea);
|
|
576
|
-
else if (Ba) a = Ba(a);
|
|
577
|
-
else throw "both async and sync fetching of the wasm failed";
|
|
578
|
-
return a;
|
|
579
|
-
}
|
|
580
|
-
async function Qa(a, b) {
|
|
581
|
-
try {
|
|
582
|
-
var c = await Oa(a);
|
|
583
|
-
return await WebAssembly.instantiate(c, b);
|
|
584
|
-
} catch (d) {
|
|
585
|
-
B(`failed to asynchronously prepare wasm: ${d}`), Ma(d);
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
async function Ra(a) {
|
|
589
|
-
var b = Na;
|
|
590
|
-
if (!Ea && !Ca(b) && !ca) try {
|
|
591
|
-
var c = fetch(b, { credentials: "same-origin" });
|
|
592
|
-
return await WebAssembly.instantiateStreaming(c, a);
|
|
593
|
-
} catch (d) {
|
|
594
|
-
B(`wasm streaming compile failed: ${d}`), B("falling back to ArrayBuffer instantiation");
|
|
595
|
-
}
|
|
596
|
-
return Qa(b, a);
|
|
597
|
-
}
|
|
598
|
-
class Sa {
|
|
599
|
-
name = "ExitStatus";
|
|
600
|
-
constructor(a) {
|
|
601
|
-
this.message = `Program terminated with exit(${a})`;
|
|
602
|
-
this.status = a;
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
var Ta = (a) => {
|
|
606
|
-
for (; 0 < a.length; ) a.shift()(k);
|
|
607
|
-
}, Ua = [], Va = [], Wa = () => {
|
|
608
|
-
var a = k.preRun.shift();
|
|
609
|
-
Va.push(a);
|
|
610
|
-
}, J = 0, Xa = null;
|
|
611
|
-
function r(a, b = "i8") {
|
|
612
|
-
b.endsWith("*") && (b = "*");
|
|
613
|
-
switch (b) {
|
|
614
|
-
case "i1":
|
|
615
|
-
return m[a];
|
|
616
|
-
case "i8":
|
|
617
|
-
return m[a];
|
|
618
|
-
case "i16":
|
|
619
|
-
return Ha[a >> 1];
|
|
620
|
-
case "i32":
|
|
621
|
-
return E[a >> 2];
|
|
622
|
-
case "i64":
|
|
623
|
-
return G[a >> 3];
|
|
624
|
-
case "float":
|
|
625
|
-
return Ia[a >> 2];
|
|
626
|
-
case "double":
|
|
627
|
-
return Ja[a >> 3];
|
|
628
|
-
case "*":
|
|
629
|
-
return F[a >> 2];
|
|
630
|
-
default:
|
|
631
|
-
Ma(`invalid type for getValue: ${b}`);
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
var Ya = true;
|
|
635
|
-
function qa(a) {
|
|
636
|
-
var b = "i32";
|
|
637
|
-
b.endsWith("*") && (b = "*");
|
|
638
|
-
switch (b) {
|
|
639
|
-
case "i1":
|
|
640
|
-
m[a] = 0;
|
|
641
|
-
break;
|
|
642
|
-
case "i8":
|
|
643
|
-
m[a] = 0;
|
|
644
|
-
break;
|
|
645
|
-
case "i16":
|
|
646
|
-
Ha[a >> 1] = 0;
|
|
647
|
-
break;
|
|
648
|
-
case "i32":
|
|
649
|
-
E[a >> 2] = 0;
|
|
650
|
-
break;
|
|
651
|
-
case "i64":
|
|
652
|
-
G[a >> 3] = BigInt(0);
|
|
653
|
-
break;
|
|
654
|
-
case "float":
|
|
655
|
-
Ia[a >> 2] = 0;
|
|
656
|
-
break;
|
|
657
|
-
case "double":
|
|
658
|
-
Ja[a >> 3] = 0;
|
|
659
|
-
break;
|
|
660
|
-
case "*":
|
|
661
|
-
F[a >> 2] = 0;
|
|
662
|
-
break;
|
|
663
|
-
default:
|
|
664
|
-
Ma(`invalid type for setValue: ${b}`);
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
var Za = new TextDecoder(), $a = (a, b, c, d) => {
|
|
668
|
-
c = b + c;
|
|
669
|
-
if (d) return c;
|
|
670
|
-
for (; a[b] && !(b >= c); ) ++b;
|
|
671
|
-
return b;
|
|
672
|
-
}, z = (a, b, c) => a ? Za.decode(C.subarray(a, $a(C, a, b, c))) : "", ab = (a, b) => {
|
|
673
|
-
for (var c = 0, d = a.length - 1; 0 <= d; d--) {
|
|
674
|
-
var e = a[d];
|
|
675
|
-
"." === e ? a.splice(d, 1) : ".." === e ? (a.splice(d, 1), c++) : c && (a.splice(d, 1), c--);
|
|
676
|
-
}
|
|
677
|
-
if (b) for (; c; c--) a.unshift("..");
|
|
678
|
-
return a;
|
|
679
|
-
}, ia = (a) => {
|
|
680
|
-
var b = "/" === a.charAt(0), c = "/" === a.slice(-1);
|
|
681
|
-
(a = ab(a.split("/").filter((d) => !!d), !b).join("/")) || b || (a = ".");
|
|
682
|
-
a && c && (a += "/");
|
|
683
|
-
return (b ? "/" : "") + a;
|
|
684
|
-
}, bb = (a) => {
|
|
685
|
-
var b = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);
|
|
686
|
-
a = b[0];
|
|
687
|
-
b = b[1];
|
|
688
|
-
if (!a && !b) return ".";
|
|
689
|
-
b &&= b.slice(0, -1);
|
|
690
|
-
return a + b;
|
|
691
|
-
}, cb = (a) => a && a.match(/([^\/]+|\/)\/*$/)[1], db = () => {
|
|
692
|
-
if (ca) {
|
|
693
|
-
var a = __require("crypto");
|
|
694
|
-
return (b) => a.randomFillSync(b);
|
|
695
|
-
}
|
|
696
|
-
return (b) => crypto.getRandomValues(b);
|
|
697
|
-
}, eb = (a) => {
|
|
698
|
-
(eb = db())(a);
|
|
699
|
-
}, fb = (...a) => {
|
|
700
|
-
for (var b = "", c = false, d = a.length - 1; -1 <= d && !c; d--) {
|
|
701
|
-
c = 0 <= d ? a[d] : "/";
|
|
702
|
-
if ("string" != typeof c) throw new TypeError("Arguments to path.resolve must be strings");
|
|
703
|
-
if (!c) return "";
|
|
704
|
-
b = c + "/" + b;
|
|
705
|
-
c = "/" === c.charAt(0);
|
|
706
|
-
}
|
|
707
|
-
b = ab(b.split("/").filter((e) => !!e), !c).join("/");
|
|
708
|
-
return (c ? "/" : "") + b || ".";
|
|
709
|
-
}, gb = (a) => {
|
|
710
|
-
var b = $a(a, 0);
|
|
711
|
-
return Za.decode(a.buffer ? a.subarray(0, b) : new Uint8Array(a.slice(0, b)));
|
|
712
|
-
}, hb = [], ib = (a) => {
|
|
713
|
-
for (var b = 0, c = 0; c < a.length; ++c) {
|
|
714
|
-
var d = a.charCodeAt(c);
|
|
715
|
-
127 >= d ? b++ : 2047 >= d ? b += 2 : 55296 <= d && 57343 >= d ? (b += 4, ++c) : b += 3;
|
|
716
|
-
}
|
|
717
|
-
return b;
|
|
718
|
-
}, M = (a, b, c, d) => {
|
|
719
|
-
if (!(0 < d)) return 0;
|
|
720
|
-
var e = c;
|
|
721
|
-
d = c + d - 1;
|
|
722
|
-
for (var g = 0; g < a.length; ++g) {
|
|
723
|
-
var h = a.codePointAt(g);
|
|
724
|
-
if (127 >= h) {
|
|
725
|
-
if (c >= d) break;
|
|
726
|
-
b[c++] = h;
|
|
727
|
-
} else if (2047 >= h) {
|
|
728
|
-
if (c + 1 >= d) break;
|
|
729
|
-
b[c++] = 192 | h >> 6;
|
|
730
|
-
b[c++] = 128 | h & 63;
|
|
731
|
-
} else if (65535 >= h) {
|
|
732
|
-
if (c + 2 >= d) break;
|
|
733
|
-
b[c++] = 224 | h >> 12;
|
|
734
|
-
b[c++] = 128 | h >> 6 & 63;
|
|
735
|
-
b[c++] = 128 | h & 63;
|
|
736
|
-
} else {
|
|
737
|
-
if (c + 3 >= d) break;
|
|
738
|
-
b[c++] = 240 | h >> 18;
|
|
739
|
-
b[c++] = 128 | h >> 12 & 63;
|
|
740
|
-
b[c++] = 128 | h >> 6 & 63;
|
|
741
|
-
b[c++] = 128 | h & 63;
|
|
742
|
-
g++;
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
b[c] = 0;
|
|
746
|
-
return c - e;
|
|
747
|
-
}, jb = [];
|
|
748
|
-
function kb(a, b) {
|
|
749
|
-
jb[a] = { input: [], output: [], cb: b };
|
|
750
|
-
mb(a, nb);
|
|
751
|
-
}
|
|
752
|
-
var nb = { open(a) {
|
|
753
|
-
var b = jb[a.node.rdev];
|
|
754
|
-
if (!b) throw new N(43);
|
|
755
|
-
a.tty = b;
|
|
756
|
-
a.seekable = false;
|
|
757
|
-
}, close(a) {
|
|
758
|
-
a.tty.cb.fsync(a.tty);
|
|
759
|
-
}, fsync(a) {
|
|
760
|
-
a.tty.cb.fsync(a.tty);
|
|
761
|
-
}, read(a, b, c, d) {
|
|
762
|
-
if (!a.tty || !a.tty.cb.xb) throw new N(60);
|
|
763
|
-
for (var e = 0, g = 0; g < d; g++) {
|
|
764
|
-
try {
|
|
765
|
-
var h = a.tty.cb.xb(a.tty);
|
|
766
|
-
} catch (q) {
|
|
767
|
-
throw new N(29);
|
|
768
|
-
}
|
|
769
|
-
if (void 0 === h && 0 === e) throw new N(6);
|
|
770
|
-
if (null === h || void 0 === h) break;
|
|
771
|
-
e++;
|
|
772
|
-
b[c + g] = h;
|
|
773
|
-
}
|
|
774
|
-
e && (a.node.atime = Date.now());
|
|
775
|
-
return e;
|
|
776
|
-
}, write(a, b, c, d) {
|
|
777
|
-
if (!a.tty || !a.tty.cb.rb) throw new N(60);
|
|
778
|
-
try {
|
|
779
|
-
for (var e = 0; e < d; e++) a.tty.cb.rb(a.tty, b[c + e]);
|
|
780
|
-
} catch (g) {
|
|
781
|
-
throw new N(29);
|
|
782
|
-
}
|
|
783
|
-
d && (a.node.mtime = a.node.ctime = Date.now());
|
|
784
|
-
return e;
|
|
785
|
-
} }, wb = { xb() {
|
|
786
|
-
a: {
|
|
787
|
-
if (!hb.length) {
|
|
788
|
-
var a = null;
|
|
789
|
-
if (ca) {
|
|
790
|
-
var b = Buffer.alloc(256), c = 0, d = process.stdin.fd;
|
|
791
|
-
try {
|
|
792
|
-
c = fs5.readSync(d, b, 0, 256);
|
|
793
|
-
} catch (e) {
|
|
794
|
-
if (e.toString().includes("EOF")) c = 0;
|
|
795
|
-
else throw e;
|
|
796
|
-
}
|
|
797
|
-
0 < c && (a = b.slice(0, c).toString("utf-8"));
|
|
798
|
-
} else globalThis.window?.prompt && (a = window.prompt("Input: "), null !== a && (a += "\n"));
|
|
799
|
-
if (!a) {
|
|
800
|
-
a = null;
|
|
801
|
-
break a;
|
|
802
|
-
}
|
|
803
|
-
b = Array(ib(a) + 1);
|
|
804
|
-
a = M(a, b, 0, b.length);
|
|
805
|
-
b.length = a;
|
|
806
|
-
hb = b;
|
|
807
|
-
}
|
|
808
|
-
a = hb.shift();
|
|
809
|
-
}
|
|
810
|
-
return a;
|
|
811
|
-
}, rb(a, b) {
|
|
812
|
-
null === b || 10 === b ? (Da(gb(a.output)), a.output = []) : 0 != b && a.output.push(b);
|
|
813
|
-
}, fsync(a) {
|
|
814
|
-
0 < a.output?.length && (Da(gb(a.output)), a.output = []);
|
|
815
|
-
}, Tb() {
|
|
816
|
-
return { Ob: 25856, Qb: 5, Nb: 191, Pb: 35387, Mb: [3, 28, 127, 21, 4, 0, 1, 0, 17, 19, 26, 0, 18, 15, 23, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] };
|
|
817
|
-
}, Ub() {
|
|
818
|
-
return 0;
|
|
819
|
-
}, Vb() {
|
|
820
|
-
return [24, 80];
|
|
821
|
-
} }, xb = { rb(a, b) {
|
|
822
|
-
null === b || 10 === b ? (B(gb(a.output)), a.output = []) : 0 != b && a.output.push(b);
|
|
823
|
-
}, fsync(a) {
|
|
824
|
-
0 < a.output?.length && (B(gb(a.output)), a.output = []);
|
|
825
|
-
} }, O = { Wa: null, Xa() {
|
|
826
|
-
return O.createNode(null, "/", 16895, 0);
|
|
827
|
-
}, createNode(a, b, c, d) {
|
|
828
|
-
if (24576 === (c & 61440) || 4096 === (c & 61440)) throw new N(63);
|
|
829
|
-
O.Wa || (O.Wa = { dir: { node: { Ta: O.La.Ta, Ua: O.La.Ua, lookup: O.La.lookup, hb: O.La.hb, rename: O.La.rename, unlink: O.La.unlink, rmdir: O.La.rmdir, readdir: O.La.readdir, symlink: O.La.symlink }, stream: { Va: O.Ma.Va } }, file: { node: { Ta: O.La.Ta, Ua: O.La.Ua }, stream: { Va: O.Ma.Va, read: O.Ma.read, write: O.Ma.write, ib: O.Ma.ib, jb: O.Ma.jb } }, link: { node: { Ta: O.La.Ta, Ua: O.La.Ua, readlink: O.La.readlink }, stream: {} }, vb: { node: { Ta: O.La.Ta, Ua: O.La.Ua }, stream: yb } });
|
|
830
|
-
c = zb(a, b, c, d);
|
|
831
|
-
P(c.mode) ? (c.La = O.Wa.dir.node, c.Ma = O.Wa.dir.stream, c.Na = {}) : 32768 === (c.mode & 61440) ? (c.La = O.Wa.file.node, c.Ma = O.Wa.file.stream, c.Ra = 0, c.Na = null) : 40960 === (c.mode & 61440) ? (c.La = O.Wa.link.node, c.Ma = O.Wa.link.stream) : 8192 === (c.mode & 61440) && (c.La = O.Wa.vb.node, c.Ma = O.Wa.vb.stream);
|
|
832
|
-
c.atime = c.mtime = c.ctime = Date.now();
|
|
833
|
-
a && (a.Na[b] = c, a.atime = a.mtime = a.ctime = c.atime);
|
|
834
|
-
return c;
|
|
835
|
-
}, Sb(a) {
|
|
836
|
-
return a.Na ? a.Na.subarray ? a.Na.subarray(0, a.Ra) : new Uint8Array(a.Na) : new Uint8Array(0);
|
|
837
|
-
}, La: {
|
|
838
|
-
Ta(a) {
|
|
839
|
-
var b = {};
|
|
840
|
-
b.dev = 8192 === (a.mode & 61440) ? a.id : 1;
|
|
841
|
-
b.ino = a.id;
|
|
842
|
-
b.mode = a.mode;
|
|
843
|
-
b.nlink = 1;
|
|
844
|
-
b.uid = 0;
|
|
845
|
-
b.gid = 0;
|
|
846
|
-
b.rdev = a.rdev;
|
|
847
|
-
P(a.mode) ? b.size = 4096 : 32768 === (a.mode & 61440) ? b.size = a.Ra : 40960 === (a.mode & 61440) ? b.size = a.link.length : b.size = 0;
|
|
848
|
-
b.atime = new Date(a.atime);
|
|
849
|
-
b.mtime = new Date(a.mtime);
|
|
850
|
-
b.ctime = new Date(a.ctime);
|
|
851
|
-
b.blksize = 4096;
|
|
852
|
-
b.blocks = Math.ceil(b.size / b.blksize);
|
|
853
|
-
return b;
|
|
854
|
-
},
|
|
855
|
-
Ua(a, b) {
|
|
856
|
-
for (var c of ["mode", "atime", "mtime", "ctime"]) null != b[c] && (a[c] = b[c]);
|
|
857
|
-
void 0 !== b.size && (b = b.size, a.Ra != b && (0 == b ? (a.Na = null, a.Ra = 0) : (c = a.Na, a.Na = new Uint8Array(b), c && a.Na.set(c.subarray(0, Math.min(b, a.Ra))), a.Ra = b)));
|
|
858
|
-
},
|
|
859
|
-
lookup() {
|
|
860
|
-
O.mb || (O.mb = new N(44), O.mb.stack = "<generic error, no stack>");
|
|
861
|
-
throw O.mb;
|
|
862
|
-
},
|
|
863
|
-
hb(a, b, c, d) {
|
|
864
|
-
return O.createNode(a, b, c, d);
|
|
865
|
-
},
|
|
866
|
-
rename(a, b, c) {
|
|
867
|
-
try {
|
|
868
|
-
var d = Q(b, c);
|
|
869
|
-
} catch (g) {
|
|
870
|
-
}
|
|
871
|
-
if (d) {
|
|
872
|
-
if (P(a.mode)) for (var e in d.Na) throw new N(55);
|
|
873
|
-
Ab(d);
|
|
874
|
-
}
|
|
875
|
-
delete a.parent.Na[a.name];
|
|
876
|
-
b.Na[c] = a;
|
|
877
|
-
a.name = c;
|
|
878
|
-
b.ctime = b.mtime = a.parent.ctime = a.parent.mtime = Date.now();
|
|
879
|
-
},
|
|
880
|
-
unlink(a, b) {
|
|
881
|
-
delete a.Na[b];
|
|
882
|
-
a.ctime = a.mtime = Date.now();
|
|
883
|
-
},
|
|
884
|
-
rmdir(a, b) {
|
|
885
|
-
var c = Q(a, b), d;
|
|
886
|
-
for (d in c.Na) throw new N(55);
|
|
887
|
-
delete a.Na[b];
|
|
888
|
-
a.ctime = a.mtime = Date.now();
|
|
889
|
-
},
|
|
890
|
-
readdir(a) {
|
|
891
|
-
return [".", "..", ...Object.keys(a.Na)];
|
|
892
|
-
},
|
|
893
|
-
symlink(a, b, c) {
|
|
894
|
-
a = O.createNode(a, b, 41471, 0);
|
|
895
|
-
a.link = c;
|
|
896
|
-
return a;
|
|
897
|
-
},
|
|
898
|
-
readlink(a) {
|
|
899
|
-
if (40960 !== (a.mode & 61440)) throw new N(28);
|
|
900
|
-
return a.link;
|
|
901
|
-
}
|
|
902
|
-
}, Ma: { read(a, b, c, d, e) {
|
|
903
|
-
var g = a.node.Na;
|
|
904
|
-
if (e >= a.node.Ra) return 0;
|
|
905
|
-
a = Math.min(a.node.Ra - e, d);
|
|
906
|
-
if (8 < a && g.subarray) b.set(g.subarray(e, e + a), c);
|
|
907
|
-
else for (d = 0; d < a; d++) b[c + d] = g[e + d];
|
|
908
|
-
return a;
|
|
909
|
-
}, write(a, b, c, d, e, g) {
|
|
910
|
-
b.buffer === m.buffer && (g = false);
|
|
911
|
-
if (!d) return 0;
|
|
912
|
-
a = a.node;
|
|
913
|
-
a.mtime = a.ctime = Date.now();
|
|
914
|
-
if (b.subarray && (!a.Na || a.Na.subarray)) {
|
|
915
|
-
if (g) return a.Na = b.subarray(c, c + d), a.Ra = d;
|
|
916
|
-
if (0 === a.Ra && 0 === e) return a.Na = b.slice(c, c + d), a.Ra = d;
|
|
917
|
-
if (e + d <= a.Ra) return a.Na.set(b.subarray(c, c + d), e), d;
|
|
918
|
-
}
|
|
919
|
-
g = e + d;
|
|
920
|
-
var h = a.Na ? a.Na.length : 0;
|
|
921
|
-
h >= g || (g = Math.max(g, h * (1048576 > h ? 2 : 1.125) >>> 0), 0 != h && (g = Math.max(g, 256)), h = a.Na, a.Na = new Uint8Array(g), 0 < a.Ra && a.Na.set(h.subarray(0, a.Ra), 0));
|
|
922
|
-
if (a.Na.subarray && b.subarray) a.Na.set(b.subarray(c, c + d), e);
|
|
923
|
-
else for (g = 0; g < d; g++) a.Na[e + g] = b[c + g];
|
|
924
|
-
a.Ra = Math.max(a.Ra, e + d);
|
|
925
|
-
return d;
|
|
926
|
-
}, Va(a, b, c) {
|
|
927
|
-
1 === c ? b += a.position : 2 === c && 32768 === (a.node.mode & 61440) && (b += a.node.Ra);
|
|
928
|
-
if (0 > b) throw new N(28);
|
|
929
|
-
return b;
|
|
930
|
-
}, ib(a, b, c, d, e) {
|
|
931
|
-
if (32768 !== (a.node.mode & 61440)) throw new N(43);
|
|
932
|
-
a = a.node.Na;
|
|
933
|
-
if (e & 2 || !a || a.buffer !== m.buffer) {
|
|
934
|
-
e = true;
|
|
935
|
-
d = 65536 * Math.ceil(b / 65536);
|
|
936
|
-
var g = Bb(65536, d);
|
|
937
|
-
g && C.fill(0, g, g + d);
|
|
938
|
-
d = g;
|
|
939
|
-
if (!d) throw new N(48);
|
|
940
|
-
if (a) {
|
|
941
|
-
if (0 < c || c + b < a.length) a.subarray ? a = a.subarray(c, c + b) : a = Array.prototype.slice.call(a, c, c + b);
|
|
942
|
-
m.set(a, d);
|
|
943
|
-
}
|
|
944
|
-
} else e = false, d = a.byteOffset;
|
|
945
|
-
return { Kb: d, Ab: e };
|
|
946
|
-
}, jb(a, b, c, d) {
|
|
947
|
-
O.Ma.write(a, b, 0, d, c, false);
|
|
948
|
-
return 0;
|
|
949
|
-
} } }, ja = (a, b) => {
|
|
950
|
-
var c = 0;
|
|
951
|
-
a && (c |= 365);
|
|
952
|
-
b && (c |= 146);
|
|
953
|
-
return c;
|
|
954
|
-
}, Cb = null, Db = {}, Eb = [], Fb = 1, R = null, Gb = false, Hb = true, Ib = {}, N = class {
|
|
955
|
-
name = "ErrnoError";
|
|
956
|
-
constructor(a) {
|
|
957
|
-
this.Pa = a;
|
|
958
|
-
}
|
|
959
|
-
}, Jb = class {
|
|
960
|
-
gb = {};
|
|
961
|
-
node = null;
|
|
962
|
-
get flags() {
|
|
963
|
-
return this.gb.flags;
|
|
964
|
-
}
|
|
965
|
-
set flags(a) {
|
|
966
|
-
this.gb.flags = a;
|
|
967
|
-
}
|
|
968
|
-
get position() {
|
|
969
|
-
return this.gb.position;
|
|
970
|
-
}
|
|
971
|
-
set position(a) {
|
|
972
|
-
this.gb.position = a;
|
|
973
|
-
}
|
|
974
|
-
}, Kb = class {
|
|
975
|
-
La = {};
|
|
976
|
-
Ma = {};
|
|
977
|
-
ab = null;
|
|
978
|
-
constructor(a, b, c, d) {
|
|
979
|
-
a ||= this;
|
|
980
|
-
this.parent = a;
|
|
981
|
-
this.Xa = a.Xa;
|
|
982
|
-
this.id = Fb++;
|
|
983
|
-
this.name = b;
|
|
984
|
-
this.mode = c;
|
|
985
|
-
this.rdev = d;
|
|
986
|
-
this.atime = this.mtime = this.ctime = Date.now();
|
|
987
|
-
}
|
|
988
|
-
get read() {
|
|
989
|
-
return 365 === (this.mode & 365);
|
|
990
|
-
}
|
|
991
|
-
set read(a) {
|
|
992
|
-
a ? this.mode |= 365 : this.mode &= -366;
|
|
993
|
-
}
|
|
994
|
-
get write() {
|
|
995
|
-
return 146 === (this.mode & 146);
|
|
996
|
-
}
|
|
997
|
-
set write(a) {
|
|
998
|
-
a ? this.mode |= 146 : this.mode &= -147;
|
|
999
|
-
}
|
|
1000
|
-
};
|
|
1001
|
-
function S(a, b = {}) {
|
|
1002
|
-
if (!a) throw new N(44);
|
|
1003
|
-
b.ob ?? (b.ob = true);
|
|
1004
|
-
"/" === a.charAt(0) || (a = "//" + a);
|
|
1005
|
-
var c = 0;
|
|
1006
|
-
a: for (; 40 > c; c++) {
|
|
1007
|
-
a = a.split("/").filter((q) => !!q);
|
|
1008
|
-
for (var d = Cb, e = "/", g = 0; g < a.length; g++) {
|
|
1009
|
-
var h = g === a.length - 1;
|
|
1010
|
-
if (h && b.parent) break;
|
|
1011
|
-
if ("." !== a[g]) if (".." === a[g]) if (e = bb(e), d === d.parent) {
|
|
1012
|
-
a = e + "/" + a.slice(g + 1).join("/");
|
|
1013
|
-
c--;
|
|
1014
|
-
continue a;
|
|
1015
|
-
} else d = d.parent;
|
|
1016
|
-
else {
|
|
1017
|
-
e = ia(e + "/" + a[g]);
|
|
1018
|
-
try {
|
|
1019
|
-
d = Q(d, a[g]);
|
|
1020
|
-
} catch (q) {
|
|
1021
|
-
if (44 === q?.Pa && h && b.Jb) return { path: e };
|
|
1022
|
-
throw q;
|
|
1023
|
-
}
|
|
1024
|
-
!d.ab || h && !b.ob || (d = d.ab.root);
|
|
1025
|
-
if (40960 === (d.mode & 61440) && (!h || b.$a)) {
|
|
1026
|
-
if (!d.La.readlink) throw new N(52);
|
|
1027
|
-
d = d.La.readlink(d);
|
|
1028
|
-
"/" === d.charAt(0) || (d = bb(e) + "/" + d);
|
|
1029
|
-
a = d + "/" + a.slice(g + 1).join("/");
|
|
1030
|
-
continue a;
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
return { path: e, node: d };
|
|
1035
|
-
}
|
|
1036
|
-
throw new N(32);
|
|
1037
|
-
}
|
|
1038
|
-
function ha(a) {
|
|
1039
|
-
for (var b; ; ) {
|
|
1040
|
-
if (a === a.parent) return a = a.Xa.zb, b ? "/" !== a[a.length - 1] ? `${a}/${b}` : a + b : a;
|
|
1041
|
-
b = b ? `${a.name}/${b}` : a.name;
|
|
1042
|
-
a = a.parent;
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
function Lb(a, b) {
|
|
1046
|
-
for (var c = 0, d = 0; d < b.length; d++) c = (c << 5) - c + b.charCodeAt(d) | 0;
|
|
1047
|
-
return (a + c >>> 0) % R.length;
|
|
1048
|
-
}
|
|
1049
|
-
function Ab(a) {
|
|
1050
|
-
var b = Lb(a.parent.id, a.name);
|
|
1051
|
-
if (R[b] === a) R[b] = a.bb;
|
|
1052
|
-
else for (b = R[b]; b; ) {
|
|
1053
|
-
if (b.bb === a) {
|
|
1054
|
-
b.bb = a.bb;
|
|
1055
|
-
break;
|
|
1056
|
-
}
|
|
1057
|
-
b = b.bb;
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
function Q(a, b) {
|
|
1061
|
-
var c = P(a.mode) ? (c = Mb(a, "x")) ? c : a.La.lookup ? 0 : 2 : 54;
|
|
1062
|
-
if (c) throw new N(c);
|
|
1063
|
-
for (c = R[Lb(a.id, b)]; c; c = c.bb) {
|
|
1064
|
-
var d = c.name;
|
|
1065
|
-
if (c.parent.id === a.id && d === b) return c;
|
|
1066
|
-
}
|
|
1067
|
-
return a.La.lookup(a, b);
|
|
1068
|
-
}
|
|
1069
|
-
function zb(a, b, c, d) {
|
|
1070
|
-
a = new Kb(a, b, c, d);
|
|
1071
|
-
b = Lb(a.parent.id, a.name);
|
|
1072
|
-
a.bb = R[b];
|
|
1073
|
-
return R[b] = a;
|
|
1074
|
-
}
|
|
1075
|
-
function P(a) {
|
|
1076
|
-
return 16384 === (a & 61440);
|
|
1077
|
-
}
|
|
1078
|
-
function Nb(a) {
|
|
1079
|
-
var b = ["r", "w", "rw"][a & 3];
|
|
1080
|
-
a & 512 && (b += "w");
|
|
1081
|
-
return b;
|
|
1082
|
-
}
|
|
1083
|
-
function Mb(a, b) {
|
|
1084
|
-
if (Hb) return 0;
|
|
1085
|
-
if (!b.includes("r") || a.mode & 292) {
|
|
1086
|
-
if (b.includes("w") && !(a.mode & 146) || b.includes("x") && !(a.mode & 73)) return 2;
|
|
1087
|
-
} else return 2;
|
|
1088
|
-
return 0;
|
|
1089
|
-
}
|
|
1090
|
-
function Ob(a, b) {
|
|
1091
|
-
if (!P(a.mode)) return 54;
|
|
1092
|
-
try {
|
|
1093
|
-
return Q(a, b), 20;
|
|
1094
|
-
} catch (c) {
|
|
1095
|
-
}
|
|
1096
|
-
return Mb(a, "wx");
|
|
1097
|
-
}
|
|
1098
|
-
function Pb(a, b, c) {
|
|
1099
|
-
try {
|
|
1100
|
-
var d = Q(a, b);
|
|
1101
|
-
} catch (e) {
|
|
1102
|
-
return e.Pa;
|
|
1103
|
-
}
|
|
1104
|
-
if (a = Mb(a, "wx")) return a;
|
|
1105
|
-
if (c) {
|
|
1106
|
-
if (!P(d.mode)) return 54;
|
|
1107
|
-
if (d === d.parent || "/" === ha(d)) return 10;
|
|
1108
|
-
} else if (P(d.mode)) return 31;
|
|
1109
|
-
return 0;
|
|
1110
|
-
}
|
|
1111
|
-
function Qb(a) {
|
|
1112
|
-
if (!a) throw new N(63);
|
|
1113
|
-
return a;
|
|
1114
|
-
}
|
|
1115
|
-
function T(a) {
|
|
1116
|
-
a = Eb[a];
|
|
1117
|
-
if (!a) throw new N(8);
|
|
1118
|
-
return a;
|
|
1119
|
-
}
|
|
1120
|
-
function Rb(a, b = -1) {
|
|
1121
|
-
a = Object.assign(new Jb(), a);
|
|
1122
|
-
if (-1 == b) a: {
|
|
1123
|
-
for (b = 0; 4096 >= b; b++) if (!Eb[b]) break a;
|
|
1124
|
-
throw new N(33);
|
|
1125
|
-
}
|
|
1126
|
-
a.fd = b;
|
|
1127
|
-
return Eb[b] = a;
|
|
1128
|
-
}
|
|
1129
|
-
function Sb(a, b = -1) {
|
|
1130
|
-
a = Rb(a, b);
|
|
1131
|
-
a.Ma?.Rb?.(a);
|
|
1132
|
-
return a;
|
|
1133
|
-
}
|
|
1134
|
-
function Tb(a, b, c) {
|
|
1135
|
-
var d = a?.Ma.Ua;
|
|
1136
|
-
a = d ? a : b;
|
|
1137
|
-
d ??= b.La.Ua;
|
|
1138
|
-
Qb(d);
|
|
1139
|
-
d(a, c);
|
|
1140
|
-
}
|
|
1141
|
-
var yb = { open(a) {
|
|
1142
|
-
a.Ma = Db[a.node.rdev].Ma;
|
|
1143
|
-
a.Ma.open?.(a);
|
|
1144
|
-
}, Va() {
|
|
1145
|
-
throw new N(70);
|
|
1146
|
-
} };
|
|
1147
|
-
function mb(a, b) {
|
|
1148
|
-
Db[a] = { Ma: b };
|
|
1149
|
-
}
|
|
1150
|
-
function Ub(a, b) {
|
|
1151
|
-
var c = "/" === b;
|
|
1152
|
-
if (c && Cb) throw new N(10);
|
|
1153
|
-
if (!c && b) {
|
|
1154
|
-
var d = S(b, { ob: false });
|
|
1155
|
-
b = d.path;
|
|
1156
|
-
d = d.node;
|
|
1157
|
-
if (d.ab) throw new N(10);
|
|
1158
|
-
if (!P(d.mode)) throw new N(54);
|
|
1159
|
-
}
|
|
1160
|
-
b = { type: a, Wb: {}, zb: b, Ib: [] };
|
|
1161
|
-
a = a.Xa(b);
|
|
1162
|
-
a.Xa = b;
|
|
1163
|
-
b.root = a;
|
|
1164
|
-
c ? Cb = a : d && (d.ab = b, d.Xa && d.Xa.Ib.push(b));
|
|
1165
|
-
}
|
|
1166
|
-
function Vb(a, b, c) {
|
|
1167
|
-
var d = S(a, { parent: true }).node;
|
|
1168
|
-
a = cb(a);
|
|
1169
|
-
if (!a) throw new N(28);
|
|
1170
|
-
if ("." === a || ".." === a) throw new N(20);
|
|
1171
|
-
var e = Ob(d, a);
|
|
1172
|
-
if (e) throw new N(e);
|
|
1173
|
-
if (!d.La.hb) throw new N(63);
|
|
1174
|
-
return d.La.hb(d, a, b, c);
|
|
1175
|
-
}
|
|
1176
|
-
function ka(a, b = 438) {
|
|
1177
|
-
return Vb(a, b & 4095 | 32768, 0);
|
|
1178
|
-
}
|
|
1179
|
-
function U(a, b = 511) {
|
|
1180
|
-
return Vb(a, b & 1023 | 16384, 0);
|
|
1181
|
-
}
|
|
1182
|
-
function Wb(a, b, c) {
|
|
1183
|
-
"undefined" == typeof c && (c = b, b = 438);
|
|
1184
|
-
Vb(a, b | 8192, c);
|
|
1185
|
-
}
|
|
1186
|
-
function Xb(a, b) {
|
|
1187
|
-
if (!fb(a)) throw new N(44);
|
|
1188
|
-
var c = S(b, { parent: true }).node;
|
|
1189
|
-
if (!c) throw new N(44);
|
|
1190
|
-
b = cb(b);
|
|
1191
|
-
var d = Ob(c, b);
|
|
1192
|
-
if (d) throw new N(d);
|
|
1193
|
-
if (!c.La.symlink) throw new N(63);
|
|
1194
|
-
c.La.symlink(c, b, a);
|
|
1195
|
-
}
|
|
1196
|
-
function Yb(a) {
|
|
1197
|
-
var b = S(a, { parent: true }).node;
|
|
1198
|
-
a = cb(a);
|
|
1199
|
-
var c = Q(b, a), d = Pb(b, a, true);
|
|
1200
|
-
if (d) throw new N(d);
|
|
1201
|
-
if (!b.La.rmdir) throw new N(63);
|
|
1202
|
-
if (c.ab) throw new N(10);
|
|
1203
|
-
b.La.rmdir(b, a);
|
|
1204
|
-
Ab(c);
|
|
1205
|
-
}
|
|
1206
|
-
function ua(a) {
|
|
1207
|
-
var b = S(a, { parent: true }).node;
|
|
1208
|
-
if (!b) throw new N(44);
|
|
1209
|
-
a = cb(a);
|
|
1210
|
-
var c = Q(b, a), d = Pb(b, a, false);
|
|
1211
|
-
if (d) throw new N(d);
|
|
1212
|
-
if (!b.La.unlink) throw new N(63);
|
|
1213
|
-
if (c.ab) throw new N(10);
|
|
1214
|
-
b.La.unlink(b, a);
|
|
1215
|
-
Ab(c);
|
|
1216
|
-
}
|
|
1217
|
-
function Zb(a, b) {
|
|
1218
|
-
a = S(a, { $a: !b }).node;
|
|
1219
|
-
return Qb(a.La.Ta)(a);
|
|
1220
|
-
}
|
|
1221
|
-
function $b(a, b, c, d) {
|
|
1222
|
-
Tb(a, b, { mode: c & 4095 | b.mode & -4096, ctime: Date.now(), Fb: d });
|
|
1223
|
-
}
|
|
1224
|
-
function la(a, b) {
|
|
1225
|
-
a = "string" == typeof a ? S(a, { $a: true }).node : a;
|
|
1226
|
-
$b(null, a, b);
|
|
1227
|
-
}
|
|
1228
|
-
function ac(a, b, c) {
|
|
1229
|
-
if (P(b.mode)) throw new N(31);
|
|
1230
|
-
if (32768 !== (b.mode & 61440)) throw new N(28);
|
|
1231
|
-
var d = Mb(b, "w");
|
|
1232
|
-
if (d) throw new N(d);
|
|
1233
|
-
Tb(a, b, { size: c, timestamp: Date.now() });
|
|
1234
|
-
}
|
|
1235
|
-
function ma(a, b, c = 438) {
|
|
1236
|
-
if ("" === a) throw new N(44);
|
|
1237
|
-
if ("string" == typeof b) {
|
|
1238
|
-
var d = { r: 0, "r+": 2, w: 577, "w+": 578, a: 1089, "a+": 1090 }[b];
|
|
1239
|
-
if ("undefined" == typeof d) throw Error(`Unknown file open mode: ${b}`);
|
|
1240
|
-
b = d;
|
|
1241
|
-
}
|
|
1242
|
-
c = b & 64 ? c & 4095 | 32768 : 0;
|
|
1243
|
-
if ("object" == typeof a) d = a;
|
|
1244
|
-
else {
|
|
1245
|
-
var e = a.endsWith("/");
|
|
1246
|
-
a = S(a, { $a: !(b & 131072), Jb: true });
|
|
1247
|
-
d = a.node;
|
|
1248
|
-
a = a.path;
|
|
1249
|
-
}
|
|
1250
|
-
var g = false;
|
|
1251
|
-
if (b & 64) if (d) {
|
|
1252
|
-
if (b & 128) throw new N(20);
|
|
1253
|
-
} else {
|
|
1254
|
-
if (e) throw new N(31);
|
|
1255
|
-
d = Vb(a, c | 511, 0);
|
|
1256
|
-
g = true;
|
|
1257
|
-
}
|
|
1258
|
-
if (!d) throw new N(44);
|
|
1259
|
-
8192 === (d.mode & 61440) && (b &= -513);
|
|
1260
|
-
if (b & 65536 && !P(d.mode)) throw new N(54);
|
|
1261
|
-
if (!g && (e = d ? 40960 === (d.mode & 61440) ? 32 : P(d.mode) && ("r" !== Nb(b) || b & 576) ? 31 : Mb(d, Nb(b)) : 44)) throw new N(e);
|
|
1262
|
-
b & 512 && !g && (e = d, e = "string" == typeof e ? S(e, { $a: true }).node : e, ac(null, e, 0));
|
|
1263
|
-
b &= -131713;
|
|
1264
|
-
e = Rb({ node: d, path: ha(d), flags: b, seekable: true, position: 0, Ma: d.Ma, Lb: [], error: false });
|
|
1265
|
-
e.Ma.open && e.Ma.open(e);
|
|
1266
|
-
g && la(d, c & 511);
|
|
1267
|
-
!k.logReadFiles || b & 1 || a in Ib || (Ib[a] = 1);
|
|
1268
|
-
return e;
|
|
1269
|
-
}
|
|
1270
|
-
function oa(a) {
|
|
1271
|
-
if (null === a.fd) throw new N(8);
|
|
1272
|
-
a.pb && (a.pb = null);
|
|
1273
|
-
try {
|
|
1274
|
-
a.Ma.close && a.Ma.close(a);
|
|
1275
|
-
} catch (b) {
|
|
1276
|
-
throw b;
|
|
1277
|
-
} finally {
|
|
1278
|
-
Eb[a.fd] = null;
|
|
1279
|
-
}
|
|
1280
|
-
a.fd = null;
|
|
1281
|
-
}
|
|
1282
|
-
function bc(a, b, c) {
|
|
1283
|
-
if (null === a.fd) throw new N(8);
|
|
1284
|
-
if (!a.seekable || !a.Ma.Va) throw new N(70);
|
|
1285
|
-
if (0 != c && 1 != c && 2 != c) throw new N(28);
|
|
1286
|
-
a.position = a.Ma.Va(a, b, c);
|
|
1287
|
-
a.Lb = [];
|
|
1288
|
-
}
|
|
1289
|
-
function cc(a, b, c, d, e) {
|
|
1290
|
-
if (0 > d || 0 > e) throw new N(28);
|
|
1291
|
-
if (null === a.fd) throw new N(8);
|
|
1292
|
-
if (1 === (a.flags & 2097155)) throw new N(8);
|
|
1293
|
-
if (P(a.node.mode)) throw new N(31);
|
|
1294
|
-
if (!a.Ma.read) throw new N(28);
|
|
1295
|
-
var g = "undefined" != typeof e;
|
|
1296
|
-
if (!g) e = a.position;
|
|
1297
|
-
else if (!a.seekable) throw new N(70);
|
|
1298
|
-
b = a.Ma.read(a, b, c, d, e);
|
|
1299
|
-
g || (a.position += b);
|
|
1300
|
-
return b;
|
|
1301
|
-
}
|
|
1302
|
-
function na(a, b, c, d, e) {
|
|
1303
|
-
if (0 > d || 0 > e) throw new N(28);
|
|
1304
|
-
if (null === a.fd) throw new N(8);
|
|
1305
|
-
if (0 === (a.flags & 2097155)) throw new N(8);
|
|
1306
|
-
if (P(a.node.mode)) throw new N(31);
|
|
1307
|
-
if (!a.Ma.write) throw new N(28);
|
|
1308
|
-
a.seekable && a.flags & 1024 && bc(a, 0, 2);
|
|
1309
|
-
var g = "undefined" != typeof e;
|
|
1310
|
-
if (!g) e = a.position;
|
|
1311
|
-
else if (!a.seekable) throw new N(70);
|
|
1312
|
-
b = a.Ma.write(a, b, c, d, e, void 0);
|
|
1313
|
-
g || (a.position += b);
|
|
1314
|
-
return b;
|
|
1315
|
-
}
|
|
1316
|
-
function ta(a) {
|
|
1317
|
-
var b = b || 0;
|
|
1318
|
-
var c = "binary";
|
|
1319
|
-
"utf8" !== c && "binary" !== c && Ma(`Invalid encoding type "${c}"`);
|
|
1320
|
-
b = ma(a, b);
|
|
1321
|
-
a = Zb(a).size;
|
|
1322
|
-
var d = new Uint8Array(a);
|
|
1323
|
-
cc(b, d, 0, a, 0);
|
|
1324
|
-
"utf8" === c && (d = gb(d));
|
|
1325
|
-
oa(b);
|
|
1326
|
-
return d;
|
|
1327
|
-
}
|
|
1328
|
-
function W(a, b, c) {
|
|
1329
|
-
a = ia("/dev/" + a);
|
|
1330
|
-
var d = ja(!!b, !!c);
|
|
1331
|
-
W.yb ?? (W.yb = 64);
|
|
1332
|
-
var e = W.yb++ << 8 | 0;
|
|
1333
|
-
mb(e, { open(g) {
|
|
1334
|
-
g.seekable = false;
|
|
1335
|
-
}, close() {
|
|
1336
|
-
c?.buffer?.length && c(10);
|
|
1337
|
-
}, read(g, h, q, w) {
|
|
1338
|
-
for (var t = 0, x = 0; x < w; x++) {
|
|
1339
|
-
try {
|
|
1340
|
-
var D = b();
|
|
1341
|
-
} catch (pb) {
|
|
1342
|
-
throw new N(29);
|
|
1343
|
-
}
|
|
1344
|
-
if (void 0 === D && 0 === t) throw new N(6);
|
|
1345
|
-
if (null === D || void 0 === D) break;
|
|
1346
|
-
t++;
|
|
1347
|
-
h[q + x] = D;
|
|
1348
|
-
}
|
|
1349
|
-
t && (g.node.atime = Date.now());
|
|
1350
|
-
return t;
|
|
1351
|
-
}, write(g, h, q, w) {
|
|
1352
|
-
for (var t = 0; t < w; t++) try {
|
|
1353
|
-
c(h[q + t]);
|
|
1354
|
-
} catch (x) {
|
|
1355
|
-
throw new N(29);
|
|
1356
|
-
}
|
|
1357
|
-
w && (g.node.mtime = g.node.ctime = Date.now());
|
|
1358
|
-
return t;
|
|
1359
|
-
} });
|
|
1360
|
-
Wb(a, d, e);
|
|
1361
|
-
}
|
|
1362
|
-
var X = {};
|
|
1363
|
-
function Y(a, b, c) {
|
|
1364
|
-
if ("/" === b.charAt(0)) return b;
|
|
1365
|
-
a = -100 === a ? "/" : T(a).path;
|
|
1366
|
-
if (0 == b.length) {
|
|
1367
|
-
if (!c) throw new N(44);
|
|
1368
|
-
return a;
|
|
1369
|
-
}
|
|
1370
|
-
return a + "/" + b;
|
|
1371
|
-
}
|
|
1372
|
-
function mc(a, b) {
|
|
1373
|
-
F[a >> 2] = b.dev;
|
|
1374
|
-
F[a + 4 >> 2] = b.mode;
|
|
1375
|
-
F[a + 8 >> 2] = b.nlink;
|
|
1376
|
-
F[a + 12 >> 2] = b.uid;
|
|
1377
|
-
F[a + 16 >> 2] = b.gid;
|
|
1378
|
-
F[a + 20 >> 2] = b.rdev;
|
|
1379
|
-
G[a + 24 >> 3] = BigInt(b.size);
|
|
1380
|
-
E[a + 32 >> 2] = 4096;
|
|
1381
|
-
E[a + 36 >> 2] = b.blocks;
|
|
1382
|
-
var c = b.atime.getTime(), d = b.mtime.getTime(), e = b.ctime.getTime();
|
|
1383
|
-
G[a + 40 >> 3] = BigInt(Math.floor(c / 1e3));
|
|
1384
|
-
F[a + 48 >> 2] = c % 1e3 * 1e6;
|
|
1385
|
-
G[a + 56 >> 3] = BigInt(Math.floor(d / 1e3));
|
|
1386
|
-
F[a + 64 >> 2] = d % 1e3 * 1e6;
|
|
1387
|
-
G[a + 72 >> 3] = BigInt(Math.floor(e / 1e3));
|
|
1388
|
-
F[a + 80 >> 2] = e % 1e3 * 1e6;
|
|
1389
|
-
G[a + 88 >> 3] = BigInt(b.ino);
|
|
1390
|
-
return 0;
|
|
1391
|
-
}
|
|
1392
|
-
var Ec = void 0, Gc = () => {
|
|
1393
|
-
var a = E[+Ec >> 2];
|
|
1394
|
-
Ec += 4;
|
|
1395
|
-
return a;
|
|
1396
|
-
}, Hc = 0, Ic = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335], Jc = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Kc = {}, Lc = (a) => {
|
|
1397
|
-
Ga = a;
|
|
1398
|
-
Ya || 0 < Hc || (k.onExit?.(a), Fa = true);
|
|
1399
|
-
xa(a, new Sa(a));
|
|
1400
|
-
}, Mc = (a) => {
|
|
1401
|
-
if (!Fa) try {
|
|
1402
|
-
a();
|
|
1403
|
-
} catch (b) {
|
|
1404
|
-
b instanceof Sa || "unwind" == b || xa(1, b);
|
|
1405
|
-
} finally {
|
|
1406
|
-
if (!(Ya || 0 < Hc)) try {
|
|
1407
|
-
Ga = a = Ga, Lc(a);
|
|
1408
|
-
} catch (b) {
|
|
1409
|
-
b instanceof Sa || "unwind" == b || xa(1, b);
|
|
1410
|
-
}
|
|
1411
|
-
}
|
|
1412
|
-
}, Nc = {}, Pc = () => {
|
|
1413
|
-
if (!Oc) {
|
|
1414
|
-
var a = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: (globalThis.navigator?.language ?? "C").replace("-", "_") + ".UTF-8", _: wa || "./this.program" }, b;
|
|
1415
|
-
for (b in Nc) void 0 === Nc[b] ? delete a[b] : a[b] = Nc[b];
|
|
1416
|
-
var c = [];
|
|
1417
|
-
for (b in a) c.push(`${b}=${a[b]}`);
|
|
1418
|
-
Oc = c;
|
|
1419
|
-
}
|
|
1420
|
-
return Oc;
|
|
1421
|
-
}, Oc, Qc = (a, b, c, d) => {
|
|
1422
|
-
var e = { string: (t) => {
|
|
1423
|
-
var x = 0;
|
|
1424
|
-
if (null !== t && void 0 !== t && 0 !== t) {
|
|
1425
|
-
x = ib(t) + 1;
|
|
1426
|
-
var D = y(x);
|
|
1427
|
-
M(t, C, D, x);
|
|
1428
|
-
x = D;
|
|
1429
|
-
}
|
|
1430
|
-
return x;
|
|
1431
|
-
}, array: (t) => {
|
|
1432
|
-
var x = y(t.length);
|
|
1433
|
-
m.set(t, x);
|
|
1434
|
-
return x;
|
|
1435
|
-
} };
|
|
1436
|
-
a = k["_" + a];
|
|
1437
|
-
var g = [], h = 0;
|
|
1438
|
-
if (d) for (var q = 0; q < d.length; q++) {
|
|
1439
|
-
var w = e[c[q]];
|
|
1440
|
-
w ? (0 === h && (h = pa()), g[q] = w(d[q])) : g[q] = d[q];
|
|
1441
|
-
}
|
|
1442
|
-
c = a(...g);
|
|
1443
|
-
return c = (function(t) {
|
|
1444
|
-
0 !== h && ra(h);
|
|
1445
|
-
return "string" === b ? z(t) : "boolean" === b ? !!t : t;
|
|
1446
|
-
})(c);
|
|
1447
|
-
}, fa = (a) => {
|
|
1448
|
-
var b = ib(a) + 1, c = da(b);
|
|
1449
|
-
c && M(a, C, c, b);
|
|
1450
|
-
return c;
|
|
1451
|
-
}, Rc, Sc = [], A = (a) => {
|
|
1452
|
-
Rc.delete(Z.get(a));
|
|
1453
|
-
Z.set(a, null);
|
|
1454
|
-
Sc.push(a);
|
|
1455
|
-
}, Tc = (a) => {
|
|
1456
|
-
const b = a.length;
|
|
1457
|
-
return [b % 128 | 128, b >> 7, ...a];
|
|
1458
|
-
}, Uc = { i: 127, p: 127, j: 126, f: 125, d: 124, e: 111 }, Vc = (a) => Tc(Array.from(a, (b) => Uc[b])), va = (a, b) => {
|
|
1459
|
-
if (!Rc) {
|
|
1460
|
-
Rc = /* @__PURE__ */ new WeakMap();
|
|
1461
|
-
var c = Z.length;
|
|
1462
|
-
if (Rc) for (var d = 0; d < 0 + c; d++) {
|
|
1463
|
-
var e = Z.get(d);
|
|
1464
|
-
e && Rc.set(e, d);
|
|
1465
|
-
}
|
|
1466
|
-
}
|
|
1467
|
-
if (c = Rc.get(a) || 0) return c;
|
|
1468
|
-
c = Sc.length ? Sc.pop() : Z.grow(1);
|
|
1469
|
-
try {
|
|
1470
|
-
Z.set(c, a);
|
|
1471
|
-
} catch (g) {
|
|
1472
|
-
if (!(g instanceof TypeError)) throw g;
|
|
1473
|
-
b = Uint8Array.of(0, 97, 115, 109, 1, 0, 0, 0, 1, ...Tc([1, 96, ...Vc(b.slice(1)), ...Vc("v" === b[0] ? "" : b[0])]), 2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0);
|
|
1474
|
-
b = new WebAssembly.Module(b);
|
|
1475
|
-
b = new WebAssembly.Instance(b, { e: { f: a } }).exports.f;
|
|
1476
|
-
Z.set(c, b);
|
|
1477
|
-
}
|
|
1478
|
-
Rc.set(a, c);
|
|
1479
|
-
return c;
|
|
1480
|
-
};
|
|
1481
|
-
R = Array(4096);
|
|
1482
|
-
Ub(O, "/");
|
|
1483
|
-
U("/tmp");
|
|
1484
|
-
U("/home");
|
|
1485
|
-
U("/home/web_user");
|
|
1486
|
-
(function() {
|
|
1487
|
-
U("/dev");
|
|
1488
|
-
mb(259, { read: () => 0, write: (d, e, g, h) => h, Va: () => 0 });
|
|
1489
|
-
Wb("/dev/null", 259);
|
|
1490
|
-
kb(1280, wb);
|
|
1491
|
-
kb(1536, xb);
|
|
1492
|
-
Wb("/dev/tty", 1280);
|
|
1493
|
-
Wb("/dev/tty1", 1536);
|
|
1494
|
-
var a = new Uint8Array(1024), b = 0, c = () => {
|
|
1495
|
-
0 === b && (eb(a), b = a.byteLength);
|
|
1496
|
-
return a[--b];
|
|
1497
|
-
};
|
|
1498
|
-
W("random", c);
|
|
1499
|
-
W("urandom", c);
|
|
1500
|
-
U("/dev/shm");
|
|
1501
|
-
U("/dev/shm/tmp");
|
|
1502
|
-
})();
|
|
1503
|
-
(function() {
|
|
1504
|
-
U("/proc");
|
|
1505
|
-
var a = U("/proc/self");
|
|
1506
|
-
U("/proc/self/fd");
|
|
1507
|
-
Ub({ Xa() {
|
|
1508
|
-
var b = zb(a, "fd", 16895, 73);
|
|
1509
|
-
b.Ma = { Va: O.Ma.Va };
|
|
1510
|
-
b.La = { lookup(c, d) {
|
|
1511
|
-
c = +d;
|
|
1512
|
-
var e = T(c);
|
|
1513
|
-
c = { parent: null, Xa: { zb: "fake" }, La: { readlink: () => e.path }, id: c + 1 };
|
|
1514
|
-
return c.parent = c;
|
|
1515
|
-
}, readdir() {
|
|
1516
|
-
return Array.from(Eb.entries()).filter(([, c]) => c).map(([c]) => c.toString());
|
|
1517
|
-
} };
|
|
1518
|
-
return b;
|
|
1519
|
-
} }, "/proc/self/fd");
|
|
1520
|
-
})();
|
|
1521
|
-
k.noExitRuntime && (Ya = k.noExitRuntime);
|
|
1522
|
-
k.print && (Da = k.print);
|
|
1523
|
-
k.printErr && (B = k.printErr);
|
|
1524
|
-
k.wasmBinary && (Ea = k.wasmBinary);
|
|
1525
|
-
k.thisProgram && (wa = k.thisProgram);
|
|
1526
|
-
if (k.preInit) for ("function" == typeof k.preInit && (k.preInit = [k.preInit]); 0 < k.preInit.length; ) k.preInit.shift()();
|
|
1527
|
-
k.stackSave = () => pa();
|
|
1528
|
-
k.stackRestore = (a) => ra(a);
|
|
1529
|
-
k.stackAlloc = (a) => y(a);
|
|
1530
|
-
k.cwrap = (a, b, c, d) => {
|
|
1531
|
-
var e = !c || c.every((g) => "number" === g || "boolean" === g);
|
|
1532
|
-
return "string" !== b && e && !d ? k["_" + a] : (...g) => Qc(a, b, c, g);
|
|
1533
|
-
};
|
|
1534
|
-
k.addFunction = va;
|
|
1535
|
-
k.removeFunction = A;
|
|
1536
|
-
k.UTF8ToString = z;
|
|
1537
|
-
k.stringToNewUTF8 = fa;
|
|
1538
|
-
k.writeArrayToMemory = (a, b) => {
|
|
1539
|
-
m.set(a, b);
|
|
1540
|
-
};
|
|
1541
|
-
var da, ea, Bb, Wc, ra, y, pa, La, Z, Xc = {
|
|
1542
|
-
a: (a, b, c, d) => Ma(`Assertion failed: ${z(a)}, at: ` + [b ? z(b) : "unknown filename", c, d ? z(d) : "unknown function"]),
|
|
1543
|
-
i: function(a, b) {
|
|
1544
|
-
try {
|
|
1545
|
-
return a = z(a), la(a, b), 0;
|
|
1546
|
-
} catch (c) {
|
|
1547
|
-
if ("undefined" == typeof X || "ErrnoError" !== c.name) throw c;
|
|
1548
|
-
return -c.Pa;
|
|
1549
|
-
}
|
|
1550
|
-
},
|
|
1551
|
-
L: function(a, b, c) {
|
|
1552
|
-
try {
|
|
1553
|
-
b = z(b);
|
|
1554
|
-
b = Y(a, b);
|
|
1555
|
-
if (c & -8) return -28;
|
|
1556
|
-
var d = S(b, { $a: true }).node;
|
|
1557
|
-
if (!d) return -44;
|
|
1558
|
-
a = "";
|
|
1559
|
-
c & 4 && (a += "r");
|
|
1560
|
-
c & 2 && (a += "w");
|
|
1561
|
-
c & 1 && (a += "x");
|
|
1562
|
-
return a && Mb(d, a) ? -2 : 0;
|
|
1563
|
-
} catch (e) {
|
|
1564
|
-
if ("undefined" == typeof X || "ErrnoError" !== e.name) throw e;
|
|
1565
|
-
return -e.Pa;
|
|
1566
|
-
}
|
|
1567
|
-
},
|
|
1568
|
-
j: function(a, b) {
|
|
1569
|
-
try {
|
|
1570
|
-
var c = T(a);
|
|
1571
|
-
$b(c, c.node, b, false);
|
|
1572
|
-
return 0;
|
|
1573
|
-
} catch (d) {
|
|
1574
|
-
if ("undefined" == typeof X || "ErrnoError" !== d.name) throw d;
|
|
1575
|
-
return -d.Pa;
|
|
1576
|
-
}
|
|
1577
|
-
},
|
|
1578
|
-
h: function(a) {
|
|
1579
|
-
try {
|
|
1580
|
-
var b = T(a);
|
|
1581
|
-
Tb(b, b.node, { timestamp: Date.now(), Fb: false });
|
|
1582
|
-
return 0;
|
|
1583
|
-
} catch (c) {
|
|
1584
|
-
if ("undefined" == typeof X || "ErrnoError" !== c.name) throw c;
|
|
1585
|
-
return -c.Pa;
|
|
1586
|
-
}
|
|
1587
|
-
},
|
|
1588
|
-
b: function(a, b, c) {
|
|
1589
|
-
Ec = c;
|
|
1590
|
-
try {
|
|
1591
|
-
var d = T(a);
|
|
1592
|
-
switch (b) {
|
|
1593
|
-
case 0:
|
|
1594
|
-
var e = Gc();
|
|
1595
|
-
if (0 > e) break;
|
|
1596
|
-
for (; Eb[e]; ) e++;
|
|
1597
|
-
return Sb(d, e).fd;
|
|
1598
|
-
case 1:
|
|
1599
|
-
case 2:
|
|
1600
|
-
return 0;
|
|
1601
|
-
case 3:
|
|
1602
|
-
return d.flags;
|
|
1603
|
-
case 4:
|
|
1604
|
-
return e = Gc(), d.flags |= e, 0;
|
|
1605
|
-
case 12:
|
|
1606
|
-
return e = Gc(), Ha[e + 0 >> 1] = 2, 0;
|
|
1607
|
-
case 13:
|
|
1608
|
-
case 14:
|
|
1609
|
-
return 0;
|
|
1610
|
-
}
|
|
1611
|
-
return -28;
|
|
1612
|
-
} catch (g) {
|
|
1613
|
-
if ("undefined" == typeof X || "ErrnoError" !== g.name) throw g;
|
|
1614
|
-
return -g.Pa;
|
|
1615
|
-
}
|
|
1616
|
-
},
|
|
1617
|
-
g: function(a, b) {
|
|
1618
|
-
try {
|
|
1619
|
-
var c = T(a), d = c.node, e = c.Ma.Ta;
|
|
1620
|
-
a = e ? c : d;
|
|
1621
|
-
e ??= d.La.Ta;
|
|
1622
|
-
Qb(e);
|
|
1623
|
-
var g = e(a);
|
|
1624
|
-
return mc(b, g);
|
|
1625
|
-
} catch (h) {
|
|
1626
|
-
if ("undefined" == typeof X || "ErrnoError" !== h.name) throw h;
|
|
1627
|
-
return -h.Pa;
|
|
1628
|
-
}
|
|
1629
|
-
},
|
|
1630
|
-
H: function(a, b) {
|
|
1631
|
-
b = -9007199254740992 > b || 9007199254740992 < b ? NaN : Number(b);
|
|
1632
|
-
try {
|
|
1633
|
-
if (isNaN(b)) return -61;
|
|
1634
|
-
var c = T(a);
|
|
1635
|
-
if (0 > b || 0 === (c.flags & 2097155)) throw new N(28);
|
|
1636
|
-
ac(c, c.node, b);
|
|
1637
|
-
return 0;
|
|
1638
|
-
} catch (d) {
|
|
1639
|
-
if ("undefined" == typeof X || "ErrnoError" !== d.name) throw d;
|
|
1640
|
-
return -d.Pa;
|
|
1641
|
-
}
|
|
1642
|
-
},
|
|
1643
|
-
G: function(a, b) {
|
|
1644
|
-
try {
|
|
1645
|
-
if (0 === b) return -28;
|
|
1646
|
-
var c = ib("/") + 1;
|
|
1647
|
-
if (b < c) return -68;
|
|
1648
|
-
M("/", C, a, b);
|
|
1649
|
-
return c;
|
|
1650
|
-
} catch (d) {
|
|
1651
|
-
if ("undefined" == typeof X || "ErrnoError" !== d.name) throw d;
|
|
1652
|
-
return -d.Pa;
|
|
1653
|
-
}
|
|
1654
|
-
},
|
|
1655
|
-
K: function(a, b) {
|
|
1656
|
-
try {
|
|
1657
|
-
return a = z(a), mc(b, Zb(a, true));
|
|
1658
|
-
} catch (c) {
|
|
1659
|
-
if ("undefined" == typeof X || "ErrnoError" !== c.name) throw c;
|
|
1660
|
-
return -c.Pa;
|
|
1661
|
-
}
|
|
1662
|
-
},
|
|
1663
|
-
C: function(a, b, c) {
|
|
1664
|
-
try {
|
|
1665
|
-
return b = z(b), b = Y(a, b), U(b, c), 0;
|
|
1666
|
-
} catch (d) {
|
|
1667
|
-
if ("undefined" == typeof X || "ErrnoError" !== d.name) throw d;
|
|
1668
|
-
return -d.Pa;
|
|
1669
|
-
}
|
|
1670
|
-
},
|
|
1671
|
-
J: function(a, b, c, d) {
|
|
1672
|
-
try {
|
|
1673
|
-
b = z(b);
|
|
1674
|
-
var e = d & 256;
|
|
1675
|
-
b = Y(a, b, d & 4096);
|
|
1676
|
-
return mc(c, e ? Zb(b, true) : Zb(b));
|
|
1677
|
-
} catch (g) {
|
|
1678
|
-
if ("undefined" == typeof X || "ErrnoError" !== g.name) throw g;
|
|
1679
|
-
return -g.Pa;
|
|
1680
|
-
}
|
|
1681
|
-
},
|
|
1682
|
-
x: function(a, b, c, d) {
|
|
1683
|
-
Ec = d;
|
|
1684
|
-
try {
|
|
1685
|
-
b = z(b);
|
|
1686
|
-
b = Y(a, b);
|
|
1687
|
-
var e = d ? Gc() : 0;
|
|
1688
|
-
return ma(b, c, e).fd;
|
|
1689
|
-
} catch (g) {
|
|
1690
|
-
if ("undefined" == typeof X || "ErrnoError" !== g.name) throw g;
|
|
1691
|
-
return -g.Pa;
|
|
1692
|
-
}
|
|
1693
|
-
},
|
|
1694
|
-
v: function(a, b, c, d) {
|
|
1695
|
-
try {
|
|
1696
|
-
b = z(b);
|
|
1697
|
-
b = Y(a, b);
|
|
1698
|
-
if (0 >= d) return -28;
|
|
1699
|
-
var e = S(b).node;
|
|
1700
|
-
if (!e) throw new N(44);
|
|
1701
|
-
if (!e.La.readlink) throw new N(28);
|
|
1702
|
-
var g = e.La.readlink(e);
|
|
1703
|
-
var h = Math.min(d, ib(g)), q = m[c + h];
|
|
1704
|
-
M(
|
|
1705
|
-
g,
|
|
1706
|
-
C,
|
|
1707
|
-
c,
|
|
1708
|
-
d + 1
|
|
1709
|
-
);
|
|
1710
|
-
m[c + h] = q;
|
|
1711
|
-
return h;
|
|
1712
|
-
} catch (w) {
|
|
1713
|
-
if ("undefined" == typeof X || "ErrnoError" !== w.name) throw w;
|
|
1714
|
-
return -w.Pa;
|
|
1715
|
-
}
|
|
1716
|
-
},
|
|
1717
|
-
u: function(a) {
|
|
1718
|
-
try {
|
|
1719
|
-
return a = z(a), Yb(a), 0;
|
|
1720
|
-
} catch (b) {
|
|
1721
|
-
if ("undefined" == typeof X || "ErrnoError" !== b.name) throw b;
|
|
1722
|
-
return -b.Pa;
|
|
1723
|
-
}
|
|
1724
|
-
},
|
|
1725
|
-
f: function(a, b) {
|
|
1726
|
-
try {
|
|
1727
|
-
return a = z(a), mc(b, Zb(a));
|
|
1728
|
-
} catch (c) {
|
|
1729
|
-
if ("undefined" == typeof X || "ErrnoError" !== c.name) throw c;
|
|
1730
|
-
return -c.Pa;
|
|
1731
|
-
}
|
|
1732
|
-
},
|
|
1733
|
-
r: function(a, b, c) {
|
|
1734
|
-
try {
|
|
1735
|
-
b = z(b);
|
|
1736
|
-
b = Y(a, b);
|
|
1737
|
-
if (c) if (512 === c) Yb(b);
|
|
1738
|
-
else return -28;
|
|
1739
|
-
else ua(b);
|
|
1740
|
-
return 0;
|
|
1741
|
-
} catch (d) {
|
|
1742
|
-
if ("undefined" == typeof X || "ErrnoError" !== d.name) throw d;
|
|
1743
|
-
return -d.Pa;
|
|
1744
|
-
}
|
|
1745
|
-
},
|
|
1746
|
-
q: function(a, b, c) {
|
|
1747
|
-
try {
|
|
1748
|
-
b = z(b);
|
|
1749
|
-
b = Y(a, b, true);
|
|
1750
|
-
var d = Date.now(), e, g;
|
|
1751
|
-
if (c) {
|
|
1752
|
-
var h = F[c >> 2] + 4294967296 * E[c + 4 >> 2], q = E[c + 8 >> 2];
|
|
1753
|
-
1073741823 == q ? e = d : 1073741822 == q ? e = null : e = 1e3 * h + q / 1e6;
|
|
1754
|
-
c += 16;
|
|
1755
|
-
h = F[c >> 2] + 4294967296 * E[c + 4 >> 2];
|
|
1756
|
-
q = E[c + 8 >> 2];
|
|
1757
|
-
1073741823 == q ? g = d : 1073741822 == q ? g = null : g = 1e3 * h + q / 1e6;
|
|
1758
|
-
} else g = e = d;
|
|
1759
|
-
if (null !== (g ?? e)) {
|
|
1760
|
-
a = e;
|
|
1761
|
-
var w = S(b, { $a: true }).node;
|
|
1762
|
-
Qb(w.La.Ua)(w, { atime: a, mtime: g });
|
|
1763
|
-
}
|
|
1764
|
-
return 0;
|
|
1765
|
-
} catch (t) {
|
|
1766
|
-
if ("undefined" == typeof X || "ErrnoError" !== t.name) throw t;
|
|
1767
|
-
return -t.Pa;
|
|
1768
|
-
}
|
|
1769
|
-
},
|
|
1770
|
-
m: () => Ma(""),
|
|
1771
|
-
l: () => {
|
|
1772
|
-
Ya = false;
|
|
1773
|
-
Hc = 0;
|
|
1774
|
-
},
|
|
1775
|
-
A: function(a, b) {
|
|
1776
|
-
a = -9007199254740992 > a || 9007199254740992 < a ? NaN : Number(a);
|
|
1777
|
-
a = new Date(1e3 * a);
|
|
1778
|
-
E[b >> 2] = a.getSeconds();
|
|
1779
|
-
E[b + 4 >> 2] = a.getMinutes();
|
|
1780
|
-
E[b + 8 >> 2] = a.getHours();
|
|
1781
|
-
E[b + 12 >> 2] = a.getDate();
|
|
1782
|
-
E[b + 16 >> 2] = a.getMonth();
|
|
1783
|
-
E[b + 20 >> 2] = a.getFullYear() - 1900;
|
|
1784
|
-
E[b + 24 >> 2] = a.getDay();
|
|
1785
|
-
var c = a.getFullYear();
|
|
1786
|
-
E[b + 28 >> 2] = (0 !== c % 4 || 0 === c % 100 && 0 !== c % 400 ? Jc : Ic)[a.getMonth()] + a.getDate() - 1 | 0;
|
|
1787
|
-
E[b + 36 >> 2] = -(60 * a.getTimezoneOffset());
|
|
1788
|
-
c = new Date(a.getFullYear(), 6, 1).getTimezoneOffset();
|
|
1789
|
-
var d = new Date(a.getFullYear(), 0, 1).getTimezoneOffset();
|
|
1790
|
-
E[b + 32 >> 2] = (c != d && a.getTimezoneOffset() == Math.min(d, c)) | 0;
|
|
1791
|
-
},
|
|
1792
|
-
y: function(a, b, c, d, e, g, h) {
|
|
1793
|
-
e = -9007199254740992 > e || 9007199254740992 < e ? NaN : Number(e);
|
|
1794
|
-
try {
|
|
1795
|
-
var q = T(d);
|
|
1796
|
-
if (0 !== (b & 2) && 0 === (c & 2) && 2 !== (q.flags & 2097155)) throw new N(2);
|
|
1797
|
-
if (1 === (q.flags & 2097155)) throw new N(2);
|
|
1798
|
-
if (!q.Ma.ib) throw new N(43);
|
|
1799
|
-
if (!a) throw new N(28);
|
|
1800
|
-
var w = q.Ma.ib(q, a, e, b, c);
|
|
1801
|
-
var t = w.Kb;
|
|
1802
|
-
E[g >> 2] = w.Ab;
|
|
1803
|
-
F[h >> 2] = t;
|
|
1804
|
-
return 0;
|
|
1805
|
-
} catch (x) {
|
|
1806
|
-
if ("undefined" == typeof X || "ErrnoError" !== x.name) throw x;
|
|
1807
|
-
return -x.Pa;
|
|
1808
|
-
}
|
|
1809
|
-
},
|
|
1810
|
-
z: function(a, b, c, d, e, g) {
|
|
1811
|
-
g = -9007199254740992 > g || 9007199254740992 < g ? NaN : Number(g);
|
|
1812
|
-
try {
|
|
1813
|
-
var h = T(e);
|
|
1814
|
-
if (c & 2) {
|
|
1815
|
-
c = g;
|
|
1816
|
-
if (32768 !== (h.node.mode & 61440)) throw new N(43);
|
|
1817
|
-
if (!(d & 2)) {
|
|
1818
|
-
var q = C.slice(a, a + b);
|
|
1819
|
-
h.Ma.jb && h.Ma.jb(h, q, c, b, d);
|
|
1820
|
-
}
|
|
1821
|
-
}
|
|
1822
|
-
} catch (w) {
|
|
1823
|
-
if ("undefined" == typeof X || "ErrnoError" !== w.name) throw w;
|
|
1824
|
-
return -w.Pa;
|
|
1825
|
-
}
|
|
1826
|
-
},
|
|
1827
|
-
n: (a, b) => {
|
|
1828
|
-
Kc[a] && (clearTimeout(Kc[a].id), delete Kc[a]);
|
|
1829
|
-
if (!b) return 0;
|
|
1830
|
-
var c = setTimeout(() => {
|
|
1831
|
-
delete Kc[a];
|
|
1832
|
-
Mc(() => Wc(a, performance.now()));
|
|
1833
|
-
}, b);
|
|
1834
|
-
Kc[a] = { id: c, Xb: b };
|
|
1835
|
-
return 0;
|
|
1836
|
-
},
|
|
1837
|
-
B: (a, b, c, d) => {
|
|
1838
|
-
var e = (/* @__PURE__ */ new Date()).getFullYear(), g = new Date(e, 0, 1).getTimezoneOffset();
|
|
1839
|
-
e = new Date(e, 6, 1).getTimezoneOffset();
|
|
1840
|
-
F[a >> 2] = 60 * Math.max(g, e);
|
|
1841
|
-
E[b >> 2] = Number(g != e);
|
|
1842
|
-
b = (h) => {
|
|
1843
|
-
var q = Math.abs(h);
|
|
1844
|
-
return `UTC${0 <= h ? "-" : "+"}${String(Math.floor(q / 60)).padStart(2, "0")}${String(q % 60).padStart(2, "0")}`;
|
|
1845
|
-
};
|
|
1846
|
-
a = b(g);
|
|
1847
|
-
b = b(e);
|
|
1848
|
-
e < g ? (M(a, C, c, 17), M(b, C, d, 17)) : (M(a, C, d, 17), M(b, C, c, 17));
|
|
1849
|
-
},
|
|
1850
|
-
d: () => Date.now(),
|
|
1851
|
-
s: () => 2147483648,
|
|
1852
|
-
c: () => performance.now(),
|
|
1853
|
-
o: (a) => {
|
|
1854
|
-
var b = C.length;
|
|
1855
|
-
a >>>= 0;
|
|
1856
|
-
if (2147483648 < a) return false;
|
|
1857
|
-
for (var c = 1; 4 >= c; c *= 2) {
|
|
1858
|
-
var d = b * (1 + 0.2 / c);
|
|
1859
|
-
d = Math.min(d, a + 100663296);
|
|
1860
|
-
a: {
|
|
1861
|
-
d = (Math.min(2147483648, 65536 * Math.ceil(Math.max(
|
|
1862
|
-
a,
|
|
1863
|
-
d
|
|
1864
|
-
) / 65536)) - La.buffer.byteLength + 65535) / 65536 | 0;
|
|
1865
|
-
try {
|
|
1866
|
-
La.grow(d);
|
|
1867
|
-
Ka();
|
|
1868
|
-
var e = 1;
|
|
1869
|
-
break a;
|
|
1870
|
-
} catch (g) {
|
|
1871
|
-
}
|
|
1872
|
-
e = void 0;
|
|
1873
|
-
}
|
|
1874
|
-
if (e) return true;
|
|
1875
|
-
}
|
|
1876
|
-
return false;
|
|
1877
|
-
},
|
|
1878
|
-
E: (a, b) => {
|
|
1879
|
-
var c = 0, d = 0, e;
|
|
1880
|
-
for (e of Pc()) {
|
|
1881
|
-
var g = b + c;
|
|
1882
|
-
F[a + d >> 2] = g;
|
|
1883
|
-
c += M(e, C, g, Infinity) + 1;
|
|
1884
|
-
d += 4;
|
|
1885
|
-
}
|
|
1886
|
-
return 0;
|
|
1887
|
-
},
|
|
1888
|
-
F: (a, b) => {
|
|
1889
|
-
var c = Pc();
|
|
1890
|
-
F[a >> 2] = c.length;
|
|
1891
|
-
a = 0;
|
|
1892
|
-
for (var d of c) a += ib(d) + 1;
|
|
1893
|
-
F[b >> 2] = a;
|
|
1894
|
-
return 0;
|
|
1895
|
-
},
|
|
1896
|
-
e: function(a) {
|
|
1897
|
-
try {
|
|
1898
|
-
var b = T(a);
|
|
1899
|
-
oa(b);
|
|
1900
|
-
return 0;
|
|
1901
|
-
} catch (c) {
|
|
1902
|
-
if ("undefined" == typeof X || "ErrnoError" !== c.name) throw c;
|
|
1903
|
-
return c.Pa;
|
|
1904
|
-
}
|
|
1905
|
-
},
|
|
1906
|
-
p: function(a, b) {
|
|
1907
|
-
try {
|
|
1908
|
-
var c = T(a);
|
|
1909
|
-
m[b] = c.tty ? 2 : P(c.mode) ? 3 : 40960 === (c.mode & 61440) ? 7 : 4;
|
|
1910
|
-
Ha[b + 2 >> 1] = 0;
|
|
1911
|
-
G[b + 8 >> 3] = BigInt(0);
|
|
1912
|
-
G[b + 16 >> 3] = BigInt(0);
|
|
1913
|
-
return 0;
|
|
1914
|
-
} catch (d) {
|
|
1915
|
-
if ("undefined" == typeof X || "ErrnoError" !== d.name) throw d;
|
|
1916
|
-
return d.Pa;
|
|
1917
|
-
}
|
|
1918
|
-
},
|
|
1919
|
-
w: function(a, b, c, d) {
|
|
1920
|
-
try {
|
|
1921
|
-
a: {
|
|
1922
|
-
var e = T(a);
|
|
1923
|
-
a = b;
|
|
1924
|
-
for (var g, h = b = 0; h < c; h++) {
|
|
1925
|
-
var q = F[a >> 2], w = F[a + 4 >> 2];
|
|
1926
|
-
a += 8;
|
|
1927
|
-
var t = cc(e, m, q, w, g);
|
|
1928
|
-
if (0 > t) {
|
|
1929
|
-
var x = -1;
|
|
1930
|
-
break a;
|
|
1931
|
-
}
|
|
1932
|
-
b += t;
|
|
1933
|
-
if (t < w) break;
|
|
1934
|
-
"undefined" != typeof g && (g += t);
|
|
1935
|
-
}
|
|
1936
|
-
x = b;
|
|
1937
|
-
}
|
|
1938
|
-
F[d >> 2] = x;
|
|
1939
|
-
return 0;
|
|
1940
|
-
} catch (D) {
|
|
1941
|
-
if ("undefined" == typeof X || "ErrnoError" !== D.name) throw D;
|
|
1942
|
-
return D.Pa;
|
|
1943
|
-
}
|
|
1944
|
-
},
|
|
1945
|
-
D: function(a, b, c, d) {
|
|
1946
|
-
b = -9007199254740992 > b || 9007199254740992 < b ? NaN : Number(b);
|
|
1947
|
-
try {
|
|
1948
|
-
if (isNaN(b)) return 61;
|
|
1949
|
-
var e = T(a);
|
|
1950
|
-
bc(e, b, c);
|
|
1951
|
-
G[d >> 3] = BigInt(e.position);
|
|
1952
|
-
e.pb && 0 === b && 0 === c && (e.pb = null);
|
|
1953
|
-
return 0;
|
|
1954
|
-
} catch (g) {
|
|
1955
|
-
if ("undefined" == typeof X || "ErrnoError" !== g.name) throw g;
|
|
1956
|
-
return g.Pa;
|
|
1957
|
-
}
|
|
1958
|
-
},
|
|
1959
|
-
I: function(a) {
|
|
1960
|
-
try {
|
|
1961
|
-
var b = T(a);
|
|
1962
|
-
return b.Ma?.fsync?.(b);
|
|
1963
|
-
} catch (c) {
|
|
1964
|
-
if ("undefined" == typeof X || "ErrnoError" !== c.name) throw c;
|
|
1965
|
-
return c.Pa;
|
|
1966
|
-
}
|
|
1967
|
-
},
|
|
1968
|
-
t: function(a, b, c, d) {
|
|
1969
|
-
try {
|
|
1970
|
-
a: {
|
|
1971
|
-
var e = T(a);
|
|
1972
|
-
a = b;
|
|
1973
|
-
for (var g, h = b = 0; h < c; h++) {
|
|
1974
|
-
var q = F[a >> 2], w = F[a + 4 >> 2];
|
|
1975
|
-
a += 8;
|
|
1976
|
-
var t = na(e, m, q, w, g);
|
|
1977
|
-
if (0 > t) {
|
|
1978
|
-
var x = -1;
|
|
1979
|
-
break a;
|
|
1980
|
-
}
|
|
1981
|
-
b += t;
|
|
1982
|
-
if (t < w) break;
|
|
1983
|
-
"undefined" != typeof g && (g += t);
|
|
1984
|
-
}
|
|
1985
|
-
x = b;
|
|
1986
|
-
}
|
|
1987
|
-
F[d >> 2] = x;
|
|
1988
|
-
return 0;
|
|
1989
|
-
} catch (D) {
|
|
1990
|
-
if ("undefined" == typeof X || "ErrnoError" !== D.name) throw D;
|
|
1991
|
-
return D.Pa;
|
|
1992
|
-
}
|
|
1993
|
-
},
|
|
1994
|
-
k: Lc
|
|
1995
|
-
};
|
|
1996
|
-
function Yc() {
|
|
1997
|
-
function a() {
|
|
1998
|
-
k.calledRun = true;
|
|
1999
|
-
if (!Fa) {
|
|
2000
|
-
if (!k.noFSInit && !Gb) {
|
|
2001
|
-
var b, c;
|
|
2002
|
-
Gb = true;
|
|
2003
|
-
b ??= k.stdin;
|
|
2004
|
-
c ??= k.stdout;
|
|
2005
|
-
d ??= k.stderr;
|
|
2006
|
-
b ? W("stdin", b) : Xb("/dev/tty", "/dev/stdin");
|
|
2007
|
-
c ? W("stdout", null, c) : Xb("/dev/tty", "/dev/stdout");
|
|
2008
|
-
d ? W("stderr", null, d) : Xb("/dev/tty1", "/dev/stderr");
|
|
2009
|
-
ma("/dev/stdin", 0);
|
|
2010
|
-
ma("/dev/stdout", 1);
|
|
2011
|
-
ma("/dev/stderr", 1);
|
|
2012
|
-
}
|
|
2013
|
-
Zc.N();
|
|
2014
|
-
Hb = false;
|
|
2015
|
-
k.onRuntimeInitialized?.();
|
|
2016
|
-
if (k.postRun) for ("function" == typeof k.postRun && (k.postRun = [k.postRun]); k.postRun.length; ) {
|
|
2017
|
-
var d = k.postRun.shift();
|
|
2018
|
-
Ua.push(d);
|
|
2019
|
-
}
|
|
2020
|
-
Ta(Ua);
|
|
2021
|
-
}
|
|
2022
|
-
}
|
|
2023
|
-
if (0 < J) Xa = Yc;
|
|
2024
|
-
else {
|
|
2025
|
-
if (k.preRun) for ("function" == typeof k.preRun && (k.preRun = [k.preRun]); k.preRun.length; ) Wa();
|
|
2026
|
-
Ta(Va);
|
|
2027
|
-
0 < J ? Xa = Yc : k.setStatus ? (k.setStatus("Running..."), setTimeout(() => {
|
|
2028
|
-
setTimeout(() => k.setStatus(""), 1);
|
|
2029
|
-
a();
|
|
2030
|
-
}, 1)) : a();
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
var Zc;
|
|
2034
|
-
(async function() {
|
|
2035
|
-
function a(c) {
|
|
2036
|
-
c = Zc = c.exports;
|
|
2037
|
-
k._sqlite3_free = c.P;
|
|
2038
|
-
k._sqlite3_value_text = c.Q;
|
|
2039
|
-
k._sqlite3_prepare_v2 = c.R;
|
|
2040
|
-
k._sqlite3_step = c.S;
|
|
2041
|
-
k._sqlite3_reset = c.T;
|
|
2042
|
-
k._sqlite3_exec = c.U;
|
|
2043
|
-
k._sqlite3_finalize = c.V;
|
|
2044
|
-
k._sqlite3_column_name = c.W;
|
|
2045
|
-
k._sqlite3_column_text = c.X;
|
|
2046
|
-
k._sqlite3_column_type = c.Y;
|
|
2047
|
-
k._sqlite3_errmsg = c.Z;
|
|
2048
|
-
k._sqlite3_clear_bindings = c._;
|
|
2049
|
-
k._sqlite3_value_blob = c.$;
|
|
2050
|
-
k._sqlite3_value_bytes = c.aa;
|
|
2051
|
-
k._sqlite3_value_double = c.ba;
|
|
2052
|
-
k._sqlite3_value_int = c.ca;
|
|
2053
|
-
k._sqlite3_value_type = c.da;
|
|
2054
|
-
k._sqlite3_result_blob = c.ea;
|
|
2055
|
-
k._sqlite3_result_double = c.fa;
|
|
2056
|
-
k._sqlite3_result_error = c.ga;
|
|
2057
|
-
k._sqlite3_result_int = c.ha;
|
|
2058
|
-
k._sqlite3_result_int64 = c.ia;
|
|
2059
|
-
k._sqlite3_result_null = c.ja;
|
|
2060
|
-
k._sqlite3_result_text = c.ka;
|
|
2061
|
-
k._sqlite3_aggregate_context = c.la;
|
|
2062
|
-
k._sqlite3_column_count = c.ma;
|
|
2063
|
-
k._sqlite3_data_count = c.na;
|
|
2064
|
-
k._sqlite3_column_blob = c.oa;
|
|
2065
|
-
k._sqlite3_column_bytes = c.pa;
|
|
2066
|
-
k._sqlite3_column_double = c.qa;
|
|
2067
|
-
k._sqlite3_bind_blob = c.ra;
|
|
2068
|
-
k._sqlite3_bind_double = c.sa;
|
|
2069
|
-
k._sqlite3_bind_int = c.ta;
|
|
2070
|
-
k._sqlite3_bind_text = c.ua;
|
|
2071
|
-
k._sqlite3_bind_parameter_index = c.va;
|
|
2072
|
-
k._sqlite3_sql = c.wa;
|
|
2073
|
-
k._sqlite3_normalized_sql = c.xa;
|
|
2074
|
-
k._sqlite3_changes = c.ya;
|
|
2075
|
-
k._sqlite3_close_v2 = c.za;
|
|
2076
|
-
k._sqlite3_create_function_v2 = c.Aa;
|
|
2077
|
-
k._sqlite3_update_hook = c.Ba;
|
|
2078
|
-
k._sqlite3_open = c.Ca;
|
|
2079
|
-
da = k._malloc = c.Da;
|
|
2080
|
-
ea = k._free = c.Ea;
|
|
2081
|
-
k._RegisterExtensionFunctions = c.Fa;
|
|
2082
|
-
Bb = c.Ga;
|
|
2083
|
-
Wc = c.Ha;
|
|
2084
|
-
ra = c.Ia;
|
|
2085
|
-
y = c.Ja;
|
|
2086
|
-
pa = c.Ka;
|
|
2087
|
-
La = c.M;
|
|
2088
|
-
Z = c.O;
|
|
2089
|
-
Ka();
|
|
2090
|
-
J--;
|
|
2091
|
-
k.monitorRunDependencies?.(J);
|
|
2092
|
-
0 == J && Xa && (c = Xa, Xa = null, c());
|
|
2093
|
-
return Zc;
|
|
2094
|
-
}
|
|
2095
|
-
J++;
|
|
2096
|
-
k.monitorRunDependencies?.(J);
|
|
2097
|
-
var b = { a: Xc };
|
|
2098
|
-
if (k.instantiateWasm) return new Promise((c) => {
|
|
2099
|
-
k.instantiateWasm(b, (d, e) => {
|
|
2100
|
-
c(a(d, e));
|
|
2101
|
-
});
|
|
2102
|
-
});
|
|
2103
|
-
Na ??= k.locateFile ? k.locateFile("sql-wasm.wasm", za) : za + "sql-wasm.wasm";
|
|
2104
|
-
return a((await Ra(b)).instance);
|
|
2105
|
-
})();
|
|
2106
|
-
Yc();
|
|
2107
|
-
return Module;
|
|
2108
|
-
});
|
|
2109
|
-
return initSqlJsPromise;
|
|
2110
|
-
};
|
|
2111
|
-
if (typeof exports === "object" && typeof module === "object") {
|
|
2112
|
-
module.exports = initSqlJs2;
|
|
2113
|
-
module.exports.default = initSqlJs2;
|
|
2114
|
-
} else if (typeof define === "function" && define["amd"]) {
|
|
2115
|
-
define([], function() {
|
|
2116
|
-
return initSqlJs2;
|
|
2117
|
-
});
|
|
2118
|
-
} else if (typeof exports === "object") {
|
|
2119
|
-
exports["Module"] = initSqlJs2;
|
|
2120
|
-
}
|
|
2121
|
-
}
|
|
2122
|
-
});
|
|
2123
2
|
|
|
2124
3
|
// ../paradigm-mcp/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/rng.js
|
|
2125
|
-
import
|
|
4
|
+
import crypto from "crypto";
|
|
2126
5
|
var rnds8Pool = new Uint8Array(256);
|
|
2127
6
|
var poolPtr = rnds8Pool.length;
|
|
2128
7
|
function rng() {
|
|
2129
8
|
if (poolPtr > rnds8Pool.length - 16) {
|
|
2130
|
-
|
|
9
|
+
crypto.randomFillSync(rnds8Pool);
|
|
2131
10
|
poolPtr = 0;
|
|
2132
11
|
}
|
|
2133
12
|
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
@@ -2143,9 +22,9 @@ function unsafeStringify(arr, offset = 0) {
|
|
|
2143
22
|
}
|
|
2144
23
|
|
|
2145
24
|
// ../paradigm-mcp/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/native.js
|
|
2146
|
-
import
|
|
25
|
+
import crypto2 from "crypto";
|
|
2147
26
|
var native_default = {
|
|
2148
|
-
randomUUID:
|
|
27
|
+
randomUUID: crypto2.randomUUID
|
|
2149
28
|
};
|
|
2150
29
|
|
|
2151
30
|
// ../paradigm-mcp/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/v4.js
|
|
@@ -2298,7 +177,7 @@ var SentinelClient = class {
|
|
|
2298
177
|
const spanId = v4_default();
|
|
2299
178
|
const startTime = (/* @__PURE__ */ new Date()).toISOString();
|
|
2300
179
|
const startMs = Date.now();
|
|
2301
|
-
const
|
|
180
|
+
const self = this;
|
|
2302
181
|
return {
|
|
2303
182
|
traceId,
|
|
2304
183
|
spanId,
|
|
@@ -2309,7 +188,7 @@ var SentinelClient = class {
|
|
|
2309
188
|
traceId,
|
|
2310
189
|
spanId,
|
|
2311
190
|
parentSpanId,
|
|
2312
|
-
service:
|
|
191
|
+
service: self.service,
|
|
2313
192
|
symbol,
|
|
2314
193
|
operation,
|
|
2315
194
|
startTime,
|
|
@@ -2317,7 +196,7 @@ var SentinelClient = class {
|
|
|
2317
196
|
durationMs,
|
|
2318
197
|
status
|
|
2319
198
|
};
|
|
2320
|
-
await
|
|
199
|
+
await self.post("/api/traces", span);
|
|
2321
200
|
}
|
|
2322
201
|
};
|
|
2323
202
|
}
|
|
@@ -2581,7 +460,7 @@ function enableSentinel(logger, clientOrOptions) {
|
|
|
2581
460
|
}
|
|
2582
461
|
|
|
2583
462
|
// ../paradigm-mcp/node_modules/.pnpm/@a-company+sentinel@3.5.0/node_modules/@a-company/sentinel/dist/chunk-FOF7CPJ6.js
|
|
2584
|
-
|
|
463
|
+
import initSqlJs from "sql.js";
|
|
2585
464
|
import * as path from "path";
|
|
2586
465
|
import * as fs from "fs";
|
|
2587
466
|
import * as fs2 from "fs";
|
|
@@ -3024,7 +903,7 @@ var SentinelStorage = class {
|
|
|
3024
903
|
*/
|
|
3025
904
|
async ensureReady() {
|
|
3026
905
|
if (!SQL) {
|
|
3027
|
-
SQL = await (
|
|
906
|
+
SQL = await initSqlJs();
|
|
3028
907
|
}
|
|
3029
908
|
this.initializeSync();
|
|
3030
909
|
}
|
|
@@ -5035,15 +2914,15 @@ var PatternMatcher = class {
|
|
|
5035
2914
|
return pattern.pattern.environment.includes(incident.environment);
|
|
5036
2915
|
}
|
|
5037
2916
|
};
|
|
5038
|
-
var
|
|
5039
|
-
var
|
|
2917
|
+
var __filename = fileURLToPath(import.meta.url);
|
|
2918
|
+
var __dirname = path3.dirname(__filename);
|
|
5040
2919
|
function loadUniversalPatterns() {
|
|
5041
|
-
const filePath = path3.join(
|
|
2920
|
+
const filePath = path3.join(__dirname, "universal-patterns.json");
|
|
5042
2921
|
const content = fs3.readFileSync(filePath, "utf-8");
|
|
5043
2922
|
return JSON.parse(content);
|
|
5044
2923
|
}
|
|
5045
2924
|
function loadParadigmPatterns() {
|
|
5046
|
-
const filePath = path3.join(
|
|
2925
|
+
const filePath = path3.join(__dirname, "paradigm-patterns.json");
|
|
5047
2926
|
const content = fs3.readFileSync(filePath, "utf-8");
|
|
5048
2927
|
return JSON.parse(content);
|
|
5049
2928
|
}
|
|
@@ -5165,11 +3044,11 @@ var Sentinel = class {
|
|
|
5165
3044
|
*/
|
|
5166
3045
|
component(id) {
|
|
5167
3046
|
const componentId = ensurePrefix(id, "#");
|
|
5168
|
-
const
|
|
3047
|
+
const self = this;
|
|
5169
3048
|
return {
|
|
5170
3049
|
id: componentId,
|
|
5171
3050
|
capture(error, extra) {
|
|
5172
|
-
return
|
|
3051
|
+
return self.capture(error, { component: componentId, ...extra });
|
|
5173
3052
|
},
|
|
5174
3053
|
wrap(fn) {
|
|
5175
3054
|
const wrapped = ((...args) => {
|
|
@@ -5177,14 +3056,14 @@ var Sentinel = class {
|
|
|
5177
3056
|
const result = fn(...args);
|
|
5178
3057
|
if (result && typeof result.catch === "function") {
|
|
5179
3058
|
return result.catch((err) => {
|
|
5180
|
-
|
|
3059
|
+
self.capture(err, { component: componentId });
|
|
5181
3060
|
throw err;
|
|
5182
3061
|
});
|
|
5183
3062
|
}
|
|
5184
3063
|
return result;
|
|
5185
3064
|
} catch (err) {
|
|
5186
3065
|
if (err instanceof Error) {
|
|
5187
|
-
|
|
3066
|
+
self.capture(err, { component: componentId });
|
|
5188
3067
|
}
|
|
5189
3068
|
throw err;
|
|
5190
3069
|
}
|
|
@@ -5273,14 +3152,14 @@ var Sentinel = class {
|
|
|
5273
3152
|
* app.use(sentinel.express());
|
|
5274
3153
|
*/
|
|
5275
3154
|
express() {
|
|
5276
|
-
const
|
|
3155
|
+
const self = this;
|
|
5277
3156
|
return (err, req, res, next) => {
|
|
5278
3157
|
const context = {};
|
|
5279
3158
|
const routeParts = (req.path || req.url || "").split("/").filter(Boolean);
|
|
5280
3159
|
if (routeParts.length >= 2) {
|
|
5281
3160
|
context.component = `#${routeParts[1]}`;
|
|
5282
3161
|
}
|
|
5283
|
-
const incidentId =
|
|
3162
|
+
const incidentId = self.capture(err, context);
|
|
5284
3163
|
if (res.setHeader) {
|
|
5285
3164
|
res.setHeader("X-Sentinel-Incident", incidentId);
|
|
5286
3165
|
}
|
|
@@ -6976,7 +4855,6 @@ export {
|
|
|
6976
4855
|
SentinelTransport,
|
|
6977
4856
|
createSentinelTransport,
|
|
6978
4857
|
enableSentinel,
|
|
6979
|
-
require_sql_wasm,
|
|
6980
4858
|
SentinelStorage,
|
|
6981
4859
|
DEFAULT_AUTH_CONFIG,
|
|
6982
4860
|
DEFAULT_RATE_LIMIT_CONFIG,
|