@floegence/floe-webapp-core 0.86.22 → 0.86.23
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/assets/{layout-worker-CLVTDA3E.js → layout-worker-CFMp3t5w.js} +790 -760
- package/dist/components/graph/GraphCanvas.d.ts +1 -1
- package/dist/components/graph/GraphCanvas.js +107 -104
- package/dist/components/graph/GraphMinimap.d.ts +2 -0
- package/dist/components/graph/GraphMinimap.js +30 -30
- package/dist/components/graph/engine.d.ts +5 -1
- package/dist/components/graph/engine.js +42 -26
- package/dist/components/graph/layout.d.ts +3 -1
- package/dist/components/graph/routing.d.ts +1 -1
- package/dist/components/graph/types.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
function
|
|
1
|
+
function qr(s) {
|
|
2
2
|
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
3
3
|
}
|
|
4
4
|
function qe(s) {
|
|
5
5
|
throw new Error('Could not dynamically require "' + s + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
6
6
|
}
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
return
|
|
10
|
-
(function(
|
|
11
|
-
s.exports =
|
|
7
|
+
var pt = { exports: {} }, Zt;
|
|
8
|
+
function Kr() {
|
|
9
|
+
return Zt || (Zt = 1, (function(s, c) {
|
|
10
|
+
(function(b) {
|
|
11
|
+
s.exports = b();
|
|
12
12
|
})(function() {
|
|
13
13
|
return (/* @__PURE__ */ (function() {
|
|
14
|
-
function
|
|
15
|
-
function
|
|
16
|
-
if (!
|
|
17
|
-
if (!i[
|
|
18
|
-
var
|
|
19
|
-
if (!l &&
|
|
20
|
-
if (R) return R(
|
|
21
|
-
var k = new Error("Cannot find module '" +
|
|
14
|
+
function b(i, d, I) {
|
|
15
|
+
function _(C, l) {
|
|
16
|
+
if (!d[C]) {
|
|
17
|
+
if (!i[C]) {
|
|
18
|
+
var x = typeof qe == "function" && qe;
|
|
19
|
+
if (!l && x) return x(C, !0);
|
|
20
|
+
if (R) return R(C, !0);
|
|
21
|
+
var k = new Error("Cannot find module '" + C + "'");
|
|
22
22
|
throw k.code = "MODULE_NOT_FOUND", k;
|
|
23
23
|
}
|
|
24
|
-
var
|
|
25
|
-
i[
|
|
26
|
-
var v = i[
|
|
27
|
-
return
|
|
28
|
-
},
|
|
24
|
+
var S = d[C] = { exports: {} };
|
|
25
|
+
i[C][0].call(S.exports, function(w) {
|
|
26
|
+
var v = i[C][1][w];
|
|
27
|
+
return _(v || w);
|
|
28
|
+
}, S, S.exports, b, i, d, I);
|
|
29
29
|
}
|
|
30
|
-
return
|
|
30
|
+
return d[C].exports;
|
|
31
31
|
}
|
|
32
|
-
for (var R = typeof qe == "function" && qe, $ = 0; $ <
|
|
33
|
-
return
|
|
32
|
+
for (var R = typeof qe == "function" && qe, $ = 0; $ < I.length; $++) _(I[$]);
|
|
33
|
+
return _;
|
|
34
34
|
}
|
|
35
|
-
return
|
|
36
|
-
})())({ 1: [function(
|
|
37
|
-
Object.defineProperty(
|
|
35
|
+
return b;
|
|
36
|
+
})())({ 1: [function(b, i, d) {
|
|
37
|
+
Object.defineProperty(d, "__esModule", {
|
|
38
38
|
value: !0
|
|
39
|
-
}),
|
|
40
|
-
function
|
|
39
|
+
}), d.default = void 0;
|
|
40
|
+
function I(k) {
|
|
41
41
|
"@babel/helpers - typeof";
|
|
42
|
-
return
|
|
43
|
-
return typeof
|
|
44
|
-
} : function(
|
|
45
|
-
return
|
|
46
|
-
},
|
|
42
|
+
return I = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(S) {
|
|
43
|
+
return typeof S;
|
|
44
|
+
} : function(S) {
|
|
45
|
+
return S && typeof Symbol == "function" && S.constructor === Symbol && S !== Symbol.prototype ? "symbol" : typeof S;
|
|
46
|
+
}, I(k);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
if (!(k instanceof
|
|
48
|
+
function _(k, S) {
|
|
49
|
+
if (!(k instanceof S)) throw new TypeError("Cannot call a class as a function");
|
|
50
50
|
}
|
|
51
|
-
function R(k,
|
|
52
|
-
for (var w = 0; w <
|
|
53
|
-
var v =
|
|
54
|
-
v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(k,
|
|
51
|
+
function R(k, S) {
|
|
52
|
+
for (var w = 0; w < S.length; w++) {
|
|
53
|
+
var v = S[w];
|
|
54
|
+
v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(k, C(v.key), v);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
function $(k,
|
|
58
|
-
return
|
|
57
|
+
function $(k, S, w) {
|
|
58
|
+
return S && R(k.prototype, S), Object.defineProperty(k, "prototype", { writable: !1 }), k;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
var
|
|
62
|
-
return
|
|
60
|
+
function C(k) {
|
|
61
|
+
var S = l(k, "string");
|
|
62
|
+
return I(S) == "symbol" ? S : S + "";
|
|
63
63
|
}
|
|
64
|
-
function l(k,
|
|
65
|
-
if (
|
|
64
|
+
function l(k, S) {
|
|
65
|
+
if (I(k) != "object" || !k) return k;
|
|
66
66
|
var w = k[Symbol.toPrimitive];
|
|
67
67
|
if (w !== void 0) {
|
|
68
|
-
var v = w.call(k,
|
|
69
|
-
if (
|
|
68
|
+
var v = w.call(k, S);
|
|
69
|
+
if (I(v) != "object") return v;
|
|
70
70
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
71
71
|
}
|
|
72
72
|
return String(k);
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
d.default = /* @__PURE__ */ (function() {
|
|
75
75
|
function k() {
|
|
76
|
-
var
|
|
77
|
-
if (
|
|
76
|
+
var S = this, w = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, v = w.defaultLayoutOptions, f = v === void 0 ? {} : v, m = w.algorithms, g = m === void 0 ? ["layered", "stress", "mrtree", "radial", "force", "disco", "sporeOverlap", "sporeCompaction", "rectpacking"] : m, E = w.workerFactory, F = w.workerUrl;
|
|
77
|
+
if (_(this, k), this.defaultLayoutOptions = f, this.initialized = !1, typeof F > "u" && typeof E > "u")
|
|
78
78
|
throw new Error("Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.");
|
|
79
|
-
var L =
|
|
80
|
-
typeof F < "u" && typeof
|
|
79
|
+
var L = E;
|
|
80
|
+
typeof F < "u" && typeof E > "u" && (L = function(U) {
|
|
81
81
|
return new Worker(U);
|
|
82
82
|
});
|
|
83
83
|
var o = L(F);
|
|
84
84
|
if (typeof o.postMessage != "function")
|
|
85
85
|
throw new TypeError("Created worker does not provide the required 'postMessage' function.");
|
|
86
|
-
this.worker = new
|
|
86
|
+
this.worker = new x(o), this.worker.postMessage({
|
|
87
87
|
cmd: "register",
|
|
88
88
|
algorithms: g
|
|
89
89
|
}).then(function(y) {
|
|
90
|
-
return
|
|
90
|
+
return S.initialized = !0;
|
|
91
91
|
}).catch(console.err);
|
|
92
92
|
}
|
|
93
93
|
return $(k, [{
|
|
94
94
|
key: "layout",
|
|
95
95
|
value: function(w) {
|
|
96
|
-
var v = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {},
|
|
96
|
+
var v = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, f = v.layoutOptions, m = f === void 0 ? this.defaultLayoutOptions : f, g = v.logging, E = g === void 0 ? !1 : g, F = v.measureExecutionTime, L = F === void 0 ? !1 : F;
|
|
97
97
|
return w ? this.worker.postMessage({
|
|
98
98
|
cmd: "layout",
|
|
99
99
|
graph: w,
|
|
100
100
|
layoutOptions: m,
|
|
101
101
|
options: {
|
|
102
|
-
logging:
|
|
102
|
+
logging: E,
|
|
103
103
|
measureExecutionTime: L
|
|
104
104
|
}
|
|
105
105
|
}) : Promise.reject(new Error("Missing mandatory parameter 'graph'."));
|
|
@@ -132,12 +132,12 @@ function Yr() {
|
|
|
132
132
|
}
|
|
133
133
|
}]);
|
|
134
134
|
})();
|
|
135
|
-
var
|
|
136
|
-
function k(
|
|
135
|
+
var x = /* @__PURE__ */ (function() {
|
|
136
|
+
function k(S) {
|
|
137
137
|
var w = this;
|
|
138
|
-
if (
|
|
138
|
+
if (_(this, k), S === void 0)
|
|
139
139
|
throw new Error("Missing mandatory parameter 'worker'.");
|
|
140
|
-
this.resolvers = {}, this.worker =
|
|
140
|
+
this.resolvers = {}, this.worker = S, this.worker.onmessage = function(v) {
|
|
141
141
|
setTimeout(function() {
|
|
142
142
|
w.receive(w, v);
|
|
143
143
|
}, 0);
|
|
@@ -148,18 +148,18 @@ function Yr() {
|
|
|
148
148
|
value: function(w) {
|
|
149
149
|
var v = this.id || 0;
|
|
150
150
|
this.id = v + 1, w.id = v;
|
|
151
|
-
var
|
|
151
|
+
var f = this;
|
|
152
152
|
return new Promise(function(m, g) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
},
|
|
153
|
+
f.resolvers[v] = function(E, F) {
|
|
154
|
+
E ? (f.convertGwtStyleError(E), g(E)) : m(F);
|
|
155
|
+
}, f.worker.postMessage(w);
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
}, {
|
|
159
159
|
key: "receive",
|
|
160
160
|
value: function(w, v) {
|
|
161
|
-
var
|
|
162
|
-
m && (delete w.resolvers[
|
|
161
|
+
var f = v.data, m = w.resolvers[f.id];
|
|
162
|
+
m && (delete w.resolvers[f.id], f.error ? m(f.error) : m(null, f.data));
|
|
163
163
|
}
|
|
164
164
|
}, {
|
|
165
165
|
key: "terminate",
|
|
@@ -176,53 +176,53 @@ function Yr() {
|
|
|
176
176
|
}
|
|
177
177
|
}]);
|
|
178
178
|
})();
|
|
179
|
-
}, {}], 2: [function(
|
|
180
|
-
var
|
|
179
|
+
}, {}], 2: [function(b, i, d) {
|
|
180
|
+
var I = b("./elk-api.js").default;
|
|
181
181
|
Object.defineProperty(i.exports, "__esModule", {
|
|
182
182
|
value: !0
|
|
183
|
-
}), i.exports =
|
|
183
|
+
}), i.exports = I, I.default = I;
|
|
184
184
|
}, { "./elk-api.js": 1 }] }, {}, [2])(2);
|
|
185
185
|
});
|
|
186
|
-
})(
|
|
186
|
+
})(pt)), pt.exports;
|
|
187
187
|
}
|
|
188
|
-
var
|
|
188
|
+
var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (s) => ({ avoidLib: void 0, async load(c = void 0) {
|
|
189
189
|
if (this.avoidLib) console.log("Avoid library is already initialized");
|
|
190
190
|
else {
|
|
191
|
-
let
|
|
192
|
-
return c !== void 0 && i.endsWith(".wasm") ? c :
|
|
191
|
+
let b = function(i, d) {
|
|
192
|
+
return c !== void 0 && i.endsWith(".wasm") ? c : d + i;
|
|
193
193
|
};
|
|
194
|
-
this.avoidLib = await s({ locateFile:
|
|
194
|
+
this.avoidLib = await s({ locateFile: b });
|
|
195
195
|
}
|
|
196
196
|
}, getInstance() {
|
|
197
197
|
if (!this.avoidLib) throw new Error("Avoid library should be initialized before using");
|
|
198
198
|
return this.avoidLib;
|
|
199
|
-
} }),
|
|
199
|
+
} }), en = (() => {
|
|
200
200
|
var s = import.meta.url;
|
|
201
201
|
return async function(c = {}) {
|
|
202
|
-
var
|
|
203
|
-
|
|
204
|
-
}), R = "./this.program", $ = "",
|
|
202
|
+
var b, i = c, d, I, _ = new Promise((e, t) => {
|
|
203
|
+
d = e, I = t;
|
|
204
|
+
}), R = "./this.program", $ = "", C;
|
|
205
205
|
if (typeof document < "u" && document.currentScript && ($ = document.currentScript.src), s && ($ = s), $.startsWith("blob:") ? $ = "" : $ = $.slice(0, $.replace(/[?#].*/, "").lastIndexOf("/") + 1), typeof window != "object" && typeof WorkerGlobalScope > "u") throw Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
|
|
206
|
-
|
|
207
|
-
if (
|
|
206
|
+
C = async (e) => {
|
|
207
|
+
if (f(!j(e), "readAsync does not work with file:// URLs"), e = await fetch(e, { credentials: "same-origin" }), e.ok) return e.arrayBuffer();
|
|
208
208
|
throw Error(e.status + " : " + e.url);
|
|
209
209
|
};
|
|
210
|
-
var l = console.log.bind(console),
|
|
211
|
-
|
|
210
|
+
var l = console.log.bind(console), x = console.error.bind(console);
|
|
211
|
+
f(!0, "worker environment detected but not enabled at build time. Add `worker` to `-sENVIRONMENT` to enable."), f(!0, "node environment detected but not enabled at build time. Add `node` to `-sENVIRONMENT` to enable."), f(!0, "shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");
|
|
212
212
|
var k;
|
|
213
|
-
typeof WebAssembly != "object" &&
|
|
214
|
-
var
|
|
215
|
-
function
|
|
213
|
+
typeof WebAssembly != "object" && x("no native wasm support detected");
|
|
214
|
+
var S, w = !1, v;
|
|
215
|
+
function f(e, t) {
|
|
216
216
|
e || J("Assertion failed" + (t ? ": " + t : ""));
|
|
217
217
|
}
|
|
218
|
-
var m, g,
|
|
218
|
+
var m, g, E, F, L, o, y, U, G, T, A = !1, N = !1, j = (e) => e.startsWith("file://");
|
|
219
219
|
function H() {
|
|
220
|
-
var e =
|
|
221
|
-
|
|
220
|
+
var e = Jt();
|
|
221
|
+
f((e & 3) == 0), e == 0 && (e += 4), o[e >> 2] = 34821223, o[e + 4 >> 2] = 2310721022, o[0] = 1668509029;
|
|
222
222
|
}
|
|
223
223
|
function D() {
|
|
224
224
|
if (!w) {
|
|
225
|
-
var e =
|
|
225
|
+
var e = Jt();
|
|
226
226
|
e == 0 && (e += 4);
|
|
227
227
|
var t = o[e >> 2], r = o[e + 4 >> 2];
|
|
228
228
|
t == 34821223 && r == 2310721022 || J(`Stack overflow! Stack cookie has been overwritten at ${ke(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ke(r)} ${ke(t)}`), o[0] != 1668509029 && J("Runtime error: The application has corrupted its heap memory area (address zero)!");
|
|
@@ -256,60 +256,60 @@ var qr = Yr(), Kr = /* @__PURE__ */ Jr(qr), Xr = (s) => ({ avoidLib: void 0, asy
|
|
|
256
256
|
} });
|
|
257
257
|
}
|
|
258
258
|
function re() {
|
|
259
|
-
var e =
|
|
260
|
-
m = new Int8Array(e),
|
|
259
|
+
var e = S.buffer;
|
|
260
|
+
m = new Int8Array(e), E = new Int16Array(e), g = new Uint8Array(e), F = new Uint16Array(e), L = new Int32Array(e), o = new Uint32Array(e), y = new Float32Array(e), T = new Float64Array(e), U = new BigInt64Array(e), G = new BigUint64Array(e);
|
|
261
261
|
}
|
|
262
|
-
|
|
262
|
+
f(typeof Int32Array < "u" && typeof Float64Array < "u" && Int32Array.prototype.subarray != null && Int32Array.prototype.set != null, "JS engine does not provide full typed array support");
|
|
263
263
|
var te = 0, X = null, Q = {}, ne = null;
|
|
264
264
|
function Me() {
|
|
265
|
-
te++, i.monitorRunDependencies?.(te),
|
|
265
|
+
te++, i.monitorRunDependencies?.(te), f(!Q["wasm-instantiate"]), Q["wasm-instantiate"] = 1, ne === null && typeof setInterval < "u" && (ne = setInterval(() => {
|
|
266
266
|
if (w) clearInterval(ne), ne = null;
|
|
267
267
|
else {
|
|
268
268
|
var e = !1, t;
|
|
269
|
-
for (t in Q) e || (e = !0,
|
|
270
|
-
e &&
|
|
269
|
+
for (t in Q) e || (e = !0, x("still waiting on run dependencies:")), x(`dependency: ${t}`);
|
|
270
|
+
e && x("(end of list)");
|
|
271
271
|
}
|
|
272
272
|
}, 1e4));
|
|
273
273
|
}
|
|
274
274
|
function J(e) {
|
|
275
|
-
throw i.onAbort?.(e), e = "Aborted(" + e + ")",
|
|
275
|
+
throw i.onAbort?.(e), e = "Aborted(" + e + ")", x(e), w = !0, A && Gr(), e = new WebAssembly.RuntimeError(e), I(e), e;
|
|
276
276
|
}
|
|
277
277
|
function fe() {
|
|
278
278
|
J("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM");
|
|
279
279
|
}
|
|
280
280
|
function ie(e, t) {
|
|
281
281
|
return (...r) => {
|
|
282
|
-
|
|
282
|
+
f(A, `native function \`${e}\` called before runtime initialization`), f(!N, `native function \`${e}\` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)`);
|
|
283
283
|
var n = ee[e];
|
|
284
|
-
return
|
|
284
|
+
return f(n, `exported native function \`${e}\` not found`), f(r.length <= t, `native function \`${e}\` called with ${r.length} args but expects ${t}`), n(...r);
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
var
|
|
288
|
-
function
|
|
287
|
+
var Xe = 0;
|
|
288
|
+
function wt(e) {
|
|
289
289
|
return (...t) => {
|
|
290
290
|
if (w) throw "program has already aborted!";
|
|
291
|
-
|
|
291
|
+
Xe++;
|
|
292
292
|
try {
|
|
293
293
|
return e(...t);
|
|
294
294
|
} catch (r) {
|
|
295
|
-
if (w || 1 <
|
|
295
|
+
if (w || 1 < Xe || r === "unwind") throw r;
|
|
296
296
|
J("unhandled exception: " + [r, r.stack]);
|
|
297
297
|
} finally {
|
|
298
|
-
|
|
298
|
+
Xe--;
|
|
299
299
|
}
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function cr() {
|
|
303
303
|
var e = be.get, t = {};
|
|
304
304
|
be.get = (r) => {
|
|
305
305
|
var n = e.call(be, r), a = t[r];
|
|
306
|
-
return a && a.S === n || (a = t[r] = { S: n, ca:
|
|
306
|
+
return a && a.S === n || (a = t[r] = { S: n, ca: wt(n) }), a.ca;
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
309
|
var Fe;
|
|
310
|
-
async function
|
|
310
|
+
async function ur(e) {
|
|
311
311
|
if (!k) try {
|
|
312
|
-
var t = await
|
|
312
|
+
var t = await C(e);
|
|
313
313
|
return new Uint8Array(t);
|
|
314
314
|
} catch {
|
|
315
315
|
}
|
|
@@ -317,95 +317,95 @@ var qr = Yr(), Kr = /* @__PURE__ */ Jr(qr), Xr = (s) => ({ avoidLib: void 0, asy
|
|
|
317
317
|
else throw "both async and sync fetching of the wasm failed";
|
|
318
318
|
return e;
|
|
319
319
|
}
|
|
320
|
-
async function
|
|
320
|
+
async function lr(e, t) {
|
|
321
321
|
try {
|
|
322
|
-
var r = await
|
|
322
|
+
var r = await ur(e);
|
|
323
323
|
return await WebAssembly.instantiate(r, t);
|
|
324
324
|
} catch (n) {
|
|
325
|
-
|
|
325
|
+
x(`failed to asynchronously prepare wasm: ${n}`), j(Fe) && x(`warning: Loading from a file URI (${Fe}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`), J(n);
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
async function
|
|
328
|
+
async function dr(e) {
|
|
329
329
|
var t = Fe;
|
|
330
330
|
if (!k && typeof WebAssembly.instantiateStreaming == "function") try {
|
|
331
331
|
var r = fetch(t, { credentials: "same-origin" });
|
|
332
332
|
return await WebAssembly.instantiateStreaming(r, e);
|
|
333
333
|
} catch (n) {
|
|
334
|
-
|
|
334
|
+
x(`wasm streaming compile failed: ${n}`), x("falling back to ArrayBuffer instantiation");
|
|
335
335
|
}
|
|
336
|
-
return
|
|
336
|
+
return lr(t, e);
|
|
337
337
|
}
|
|
338
|
-
class
|
|
338
|
+
class vt {
|
|
339
339
|
name = "ExitStatus";
|
|
340
340
|
constructor(t) {
|
|
341
341
|
this.message = `Program terminated with exit(${t})`, this.status = t;
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
var
|
|
344
|
+
var bt = (e) => {
|
|
345
345
|
for (; 0 < e.length; ) e.shift()(i);
|
|
346
|
-
},
|
|
346
|
+
}, _t = [], xt = [], hr = () => {
|
|
347
347
|
var e = i.preRun.shift();
|
|
348
|
-
|
|
349
|
-
}, Se = !1, ke = (e) => (
|
|
350
|
-
ye.M || (ye.M = {}), ye.M[e] || (ye.M[e] = 1,
|
|
351
|
-
}, be,
|
|
348
|
+
xt.push(e);
|
|
349
|
+
}, Se = !1, ke = (e) => (f(typeof e == "number"), "0x" + (e >>> 0).toString(16).padStart(8, "0")), ye = (e) => {
|
|
350
|
+
ye.M || (ye.M = {}), ye.M[e] || (ye.M[e] = 1, x(e));
|
|
351
|
+
}, be, Tt = typeof TextDecoder < "u" ? new TextDecoder() : void 0, Et = (e, t = 0, r = NaN) => {
|
|
352
352
|
var n = t + r;
|
|
353
353
|
for (r = t; e[r] && !(r >= n); ) ++r;
|
|
354
|
-
if (16 < r - t && e.buffer &&
|
|
354
|
+
if (16 < r - t && e.buffer && Tt) return Tt.decode(e.subarray(t, r));
|
|
355
355
|
for (n = ""; t < r; ) {
|
|
356
356
|
var a = e[t++];
|
|
357
357
|
if (a & 128) {
|
|
358
358
|
var u = e[t++] & 63;
|
|
359
359
|
if ((a & 224) == 192) n += String.fromCharCode((a & 31) << 6 | u);
|
|
360
360
|
else {
|
|
361
|
-
var
|
|
362
|
-
(a & 240) == 224 ? a = (a & 15) << 12 | u << 6 |
|
|
361
|
+
var h = e[t++] & 63;
|
|
362
|
+
(a & 240) == 224 ? a = (a & 15) << 12 | u << 6 | h : ((a & 248) != 240 && ye("Invalid UTF-8 leading byte " + ke(a) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!"), a = (a & 7) << 18 | u << 12 | h << 6 | e[t++] & 63), 65536 > a ? n += String.fromCharCode(a) : (a -= 65536, n += String.fromCharCode(55296 | a >> 10, 56320 | a & 1023));
|
|
363
363
|
}
|
|
364
364
|
} else n += String.fromCharCode(a);
|
|
365
365
|
}
|
|
366
366
|
return n;
|
|
367
|
-
}, Ce = (e, t) => (
|
|
368
|
-
var t =
|
|
369
|
-
e =
|
|
370
|
-
var r =
|
|
371
|
-
if (
|
|
367
|
+
}, Ce = (e, t) => (f(typeof e == "number", `UTF8ToString expects a number (got ${typeof e})`), e ? Et(g, e, t) : ""), Ze = (e) => (e = e.getArg(ee.__cpp_exception, 0), Jr(e)), Mt = (e) => {
|
|
368
|
+
var t = Ze(e);
|
|
369
|
+
e = qt();
|
|
370
|
+
var r = Yt(4), n = Yt(4);
|
|
371
|
+
if (Yr(t, r, n), t = o[r >> 2], n = o[n >> 2], r = Ce(t), me(t), n) {
|
|
372
372
|
var a = Ce(n);
|
|
373
373
|
me(n);
|
|
374
374
|
}
|
|
375
|
-
return
|
|
375
|
+
return Br(e), [r, a];
|
|
376
376
|
}, we = (e) => {
|
|
377
377
|
if (e === null) return "null";
|
|
378
378
|
var t = typeof e;
|
|
379
379
|
return t === "object" || t === "array" || t === "function" ? e.toString() : "" + e;
|
|
380
|
-
},
|
|
381
|
-
for (var t = ""; g[e]; ) t +=
|
|
380
|
+
}, St, Z = (e) => {
|
|
381
|
+
for (var t = ""; g[e]; ) t += St[g[e++]];
|
|
382
382
|
return t;
|
|
383
|
-
}, Ie = {}, _e = {}, Ue = {},
|
|
383
|
+
}, Ie = {}, _e = {}, Ue = {}, W = i.BindingError = class extends Error {
|
|
384
384
|
constructor(e) {
|
|
385
385
|
super(e), this.name = "BindingError";
|
|
386
386
|
}
|
|
387
|
-
},
|
|
388
|
-
throw new
|
|
387
|
+
}, fr = (e) => {
|
|
388
|
+
throw new W(e);
|
|
389
389
|
};
|
|
390
|
-
function
|
|
390
|
+
function gr(e, t, r = {}) {
|
|
391
391
|
var n = t.name;
|
|
392
|
-
if (!e) throw new
|
|
392
|
+
if (!e) throw new W(`type "${n}" must have a positive integer typeid pointer`);
|
|
393
393
|
if (_e.hasOwnProperty(e)) {
|
|
394
394
|
if (r.V) return;
|
|
395
|
-
throw new
|
|
395
|
+
throw new W(`Cannot register type '${n}' twice`);
|
|
396
396
|
}
|
|
397
397
|
_e[e] = t, delete Ue[e], Ie.hasOwnProperty(e) && (t = Ie[e], delete Ie[e], t.forEach((a) => a()));
|
|
398
398
|
}
|
|
399
399
|
function ce(e, t, r = {}) {
|
|
400
400
|
if (t.o === void 0) throw new TypeError("registerType registeredInstance requires argPackAdvance");
|
|
401
|
-
return
|
|
401
|
+
return gr(e, t, r);
|
|
402
402
|
}
|
|
403
|
-
var
|
|
403
|
+
var kt = (e, t, r) => {
|
|
404
404
|
switch (t) {
|
|
405
405
|
case 1:
|
|
406
406
|
return r ? (n) => m[n] : (n) => g[n];
|
|
407
407
|
case 2:
|
|
408
|
-
return r ? (n) =>
|
|
408
|
+
return r ? (n) => E[n >> 1] : (n) => F[n >> 1];
|
|
409
409
|
case 4:
|
|
410
410
|
return r ? (n) => L[n >> 2] : (n) => o[n >> 2];
|
|
411
411
|
case 8:
|
|
@@ -413,36 +413,36 @@ var qr = Yr(), Kr = /* @__PURE__ */ Jr(qr), Xr = (s) => ({ avoidLib: void 0, asy
|
|
|
413
413
|
default:
|
|
414
414
|
throw new TypeError(`invalid integer width (${t}): ${e}`);
|
|
415
415
|
}
|
|
416
|
-
},
|
|
417
|
-
throw new
|
|
418
|
-
},
|
|
419
|
-
},
|
|
420
|
-
if (t === void 0) throw new
|
|
416
|
+
}, Qe = (e) => {
|
|
417
|
+
throw new W(e.g.j.h.name + " instance already deleted");
|
|
418
|
+
}, et = !1, Ct = () => {
|
|
419
|
+
}, It = (e, t, r) => t === r ? e : r.m === void 0 ? null : (e = It(e, t, r.m), e === null ? null : r.R(e)), Pt = {}, pr = {}, mr = (e, t) => {
|
|
420
|
+
if (t === void 0) throw new W("ptr should not be undefined");
|
|
421
421
|
for (; e.m; ) t = e.H(t), e = e.m;
|
|
422
|
-
return
|
|
423
|
-
},
|
|
422
|
+
return pr[t];
|
|
423
|
+
}, je = i.InternalError = class extends Error {
|
|
424
424
|
constructor(e) {
|
|
425
425
|
super(e), this.name = "InternalError";
|
|
426
426
|
}
|
|
427
|
-
},
|
|
428
|
-
if (!t.j || !t.i) throw new
|
|
429
|
-
if (!!t.v != !!t.l) throw new
|
|
427
|
+
}, We = (e, t) => {
|
|
428
|
+
if (!t.j || !t.i) throw new je("makeClassHandle requires ptr and ptrType");
|
|
429
|
+
if (!!t.v != !!t.l) throw new je("Both smartPtrType and smartPtr must be specified");
|
|
430
430
|
return t.count = { value: 1 }, Le(Object.create(e, { g: { value: t, writable: !0 } }));
|
|
431
431
|
};
|
|
432
|
-
function
|
|
432
|
+
function At(e) {
|
|
433
433
|
function t() {
|
|
434
|
-
return this.K ?
|
|
434
|
+
return this.K ? We(this.h.A, { j: this.Y, i: r, v: this, l: e }) : We(this.h.A, { j: this, i: e });
|
|
435
435
|
}
|
|
436
436
|
var r = this.U(e);
|
|
437
437
|
if (!r) return this.N(e), null;
|
|
438
|
-
var n =
|
|
438
|
+
var n = mr(this.h, r);
|
|
439
439
|
if (n !== void 0) return n.g.count.value === 0 ? (n.g.i = r, n.g.l = e, n.clone()) : (n = n.clone(), this.N(e), n);
|
|
440
|
-
if (n = this.h.T(r), n =
|
|
440
|
+
if (n = this.h.T(r), n = Pt[n], !n) return t.call(this);
|
|
441
441
|
n = this.J ? n.P : n.pointerType;
|
|
442
|
-
var a =
|
|
443
|
-
return a === null ? t.call(this) : this.K ?
|
|
442
|
+
var a = It(r, this.h, n.h);
|
|
443
|
+
return a === null ? t.call(this) : this.K ? We(n.h.A, { j: n, i: a, v: this, l: e }) : We(n.h.A, { j: n, i: a });
|
|
444
444
|
}
|
|
445
|
-
var Le = (e) => typeof FinalizationRegistry > "u" ? (Le = (t) => t, e) : (
|
|
445
|
+
var Le = (e) => typeof FinalizationRegistry > "u" ? (Le = (t) => t, e) : (et = new FinalizationRegistry((t) => {
|
|
446
446
|
console.warn(t.X), t = t.g, --t.count.value, t.count.value === 0 && (t.l ? t.v.B(t.l) : t.j.h.B(t.i));
|
|
447
447
|
}), Le = (t) => {
|
|
448
448
|
var r = t.g;
|
|
@@ -451,67 +451,67 @@ var qr = Yr(), Kr = /* @__PURE__ */ Jr(qr), Xr = (s) => ({ avoidLib: void 0, asy
|
|
|
451
451
|
r = Error(`Embind found a leaked C++ instance ${r.j.h.name} <${ke(r.i)}>.
|
|
452
452
|
We'll free it automatically in this case, but this functionality is not reliable across various environments.
|
|
453
453
|
Make sure to invoke .delete() manually once you're done with the instance instead.
|
|
454
|
-
Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(r,
|
|
454
|
+
Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(r, At), n.X = r.stack.replace(/^Error: /, ""), et.register(t, n, t);
|
|
455
455
|
}
|
|
456
456
|
return t;
|
|
457
|
-
},
|
|
458
|
-
|
|
457
|
+
}, Ct = (t) => {
|
|
458
|
+
et.unregister(t);
|
|
459
459
|
}, Le(e));
|
|
460
460
|
function De() {
|
|
461
461
|
}
|
|
462
|
-
var Ge = (e, t) => Object.defineProperty(t, "name", { value: e }),
|
|
462
|
+
var Ge = (e, t) => Object.defineProperty(t, "name", { value: e }), Ot = (e, t, r) => {
|
|
463
463
|
if (e[t].u === void 0) {
|
|
464
464
|
var n = e[t];
|
|
465
465
|
e[t] = function(...a) {
|
|
466
|
-
if (!e[t].u.hasOwnProperty(a.length)) throw new
|
|
466
|
+
if (!e[t].u.hasOwnProperty(a.length)) throw new W(`Function '${r}' called with an invalid number of arguments (${a.length}) - expects one of (${e[t].u})!`);
|
|
467
467
|
return e[t].u[a.length].apply(this, a);
|
|
468
468
|
}, e[t].u = [], e[t].u[n.C] = n;
|
|
469
469
|
}
|
|
470
|
-
},
|
|
471
|
-
if (i.hasOwnProperty(e)) throw new
|
|
470
|
+
}, Rt = (e, t) => {
|
|
471
|
+
if (i.hasOwnProperty(e)) throw new W(`Cannot register public name '${e}' twice`);
|
|
472
472
|
i[e] = t, i[e].C = void 0;
|
|
473
|
-
},
|
|
474
|
-
|
|
473
|
+
}, yr = (e) => {
|
|
474
|
+
f(typeof e == "string"), e = e.replace(/[^a-zA-Z0-9_]/g, "$");
|
|
475
475
|
var t = e.charCodeAt(0);
|
|
476
476
|
return 48 <= t && 57 >= t ? `_${e}` : e;
|
|
477
477
|
};
|
|
478
|
-
function
|
|
479
|
-
this.name = e, this.constructor = t, this.A = r, this.B = n, this.m = a, this.T = u, this.H =
|
|
478
|
+
function wr(e, t, r, n, a, u, h, p) {
|
|
479
|
+
this.name = e, this.constructor = t, this.A = r, this.B = n, this.m = a, this.T = u, this.H = h, this.R = p, this.Z = [];
|
|
480
480
|
}
|
|
481
481
|
var He = (e, t, r) => {
|
|
482
482
|
for (; t !== r; ) {
|
|
483
|
-
if (!t.H) throw new
|
|
483
|
+
if (!t.H) throw new W(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);
|
|
484
484
|
e = t.H(e), t = t.m;
|
|
485
485
|
}
|
|
486
486
|
return e;
|
|
487
487
|
};
|
|
488
|
-
function
|
|
488
|
+
function vr(e, t) {
|
|
489
489
|
if (t === null) {
|
|
490
|
-
if (this.L) throw new
|
|
490
|
+
if (this.L) throw new W(`null is not a valid ${this.name}`);
|
|
491
491
|
return 0;
|
|
492
492
|
}
|
|
493
|
-
if (!t.g) throw new
|
|
494
|
-
if (!t.g.i) throw new
|
|
493
|
+
if (!t.g) throw new W(`Cannot pass "${we(t)}" as a ${this.name}`);
|
|
494
|
+
if (!t.g.i) throw new W(`Cannot pass deleted object as a pointer of type ${this.name}`);
|
|
495
495
|
return He(t.g.i, t.g.j.h, this.h);
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function br(e, t) {
|
|
498
498
|
if (t === null) {
|
|
499
|
-
if (this.L) throw new
|
|
499
|
+
if (this.L) throw new W(`null is not a valid ${this.name}`);
|
|
500
500
|
if (this.K) {
|
|
501
501
|
var r = this.$();
|
|
502
502
|
return e !== null && e.push(this.B, r), r;
|
|
503
503
|
}
|
|
504
504
|
return 0;
|
|
505
505
|
}
|
|
506
|
-
if (!t || !t.g) throw new
|
|
507
|
-
if (!t.g.i) throw new
|
|
508
|
-
if (!this.J && t.g.j.J) throw new
|
|
506
|
+
if (!t || !t.g) throw new W(`Cannot pass "${we(t)}" as a ${this.name}`);
|
|
507
|
+
if (!t.g.i) throw new W(`Cannot pass deleted object as a pointer of type ${this.name}`);
|
|
508
|
+
if (!this.J && t.g.j.J) throw new W(`Cannot convert argument of type ${t.g.v ? t.g.v.name : t.g.j.name} to parameter type ${this.name}`);
|
|
509
509
|
if (r = He(t.g.i, t.g.j.h, this.h), this.K) {
|
|
510
|
-
if (t.g.l === void 0) throw new
|
|
510
|
+
if (t.g.l === void 0) throw new W("Passing raw pointer to smart pointer is illegal");
|
|
511
511
|
switch (this.ba) {
|
|
512
512
|
case 0:
|
|
513
513
|
if (t.g.v === this) r = t.g.l;
|
|
514
|
-
else throw new
|
|
514
|
+
else throw new W(`Cannot convert argument of type ${t.g.v ? t.g.v.name : t.g.j.name} to parameter type ${this.name}`);
|
|
515
515
|
break;
|
|
516
516
|
case 1:
|
|
517
517
|
r = t.g.l;
|
|
@@ -524,38 +524,38 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
524
524
|
}
|
|
525
525
|
break;
|
|
526
526
|
default:
|
|
527
|
-
throw new
|
|
527
|
+
throw new W("Unsupporting sharing policy");
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
530
|
return r;
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function _r(e, t) {
|
|
533
533
|
if (t === null) {
|
|
534
|
-
if (this.L) throw new
|
|
534
|
+
if (this.L) throw new W(`null is not a valid ${this.name}`);
|
|
535
535
|
return 0;
|
|
536
536
|
}
|
|
537
|
-
if (!t.g) throw new
|
|
538
|
-
if (!t.g.i) throw new
|
|
539
|
-
if (t.g.j.J) throw new
|
|
537
|
+
if (!t.g) throw new W(`Cannot pass "${we(t)}" as a ${this.name}`);
|
|
538
|
+
if (!t.g.i) throw new W(`Cannot pass deleted object as a pointer of type ${this.name}`);
|
|
539
|
+
if (t.g.j.J) throw new W(`Cannot convert argument of type ${t.g.j.name} to parameter type ${this.name}`);
|
|
540
540
|
return He(t.g.i, t.g.j.h, this.h);
|
|
541
541
|
}
|
|
542
542
|
function Be(e) {
|
|
543
543
|
return this.fromWireType(o[e >> 2]);
|
|
544
544
|
}
|
|
545
|
-
function ze(e, t, r, n, a, u,
|
|
546
|
-
this.name = e, this.h = t, this.L = r, this.J = n, this.K = a, this.Y = u, this.ba =
|
|
545
|
+
function ze(e, t, r, n, a, u, h, p, P, O, M) {
|
|
546
|
+
this.name = e, this.h = t, this.L = r, this.J = n, this.K = a, this.Y = u, this.ba = h, this.O = p, this.$ = P, this.aa = O, this.B = M, a || t.m !== void 0 ? this.toWireType = br : (this.toWireType = n ? vr : _r, this.s = null);
|
|
547
547
|
}
|
|
548
|
-
var
|
|
549
|
-
if (!i.hasOwnProperty(e)) throw new
|
|
548
|
+
var xr = (e, t) => {
|
|
549
|
+
if (!i.hasOwnProperty(e)) throw new je("Replacing nonexistent public symbol");
|
|
550
550
|
i[e] = t, i[e].C = void 0;
|
|
551
|
-
},
|
|
552
|
-
if (
|
|
551
|
+
}, $t = [], ge = (e, t, r = !1) => {
|
|
552
|
+
if (f(!r, "Async bindings are only supported with JSPI."), e = Z(e), (r = $t[t]) || ($t[t] = r = be.get(t)), f(be.get(t) == r, "JavaScript-side Wasm function table mirror is out of date!"), typeof r != "function") throw new W(`unknown function pointer with signature ${e}: ${t}`);
|
|
553
553
|
return r;
|
|
554
554
|
};
|
|
555
|
-
class
|
|
555
|
+
class Tr extends Error {
|
|
556
556
|
}
|
|
557
|
-
var
|
|
558
|
-
e =
|
|
557
|
+
var Ft = (e) => {
|
|
558
|
+
e = Ur(e);
|
|
559
559
|
var t = Z(e);
|
|
560
560
|
return me(e), t;
|
|
561
561
|
}, Pe = (e, t) => {
|
|
@@ -563,80 +563,80 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
563
563
|
a[u] || _e[u] || (Ue[u] ? Ue[u].forEach(r) : (n.push(u), a[u] = !0));
|
|
564
564
|
}
|
|
565
565
|
var n = [], a = {};
|
|
566
|
-
throw t.forEach(r), new
|
|
566
|
+
throw t.forEach(r), new Tr(`${e}: ` + n.map(Ft).join([", "]));
|
|
567
567
|
}, pe = (e, t, r) => {
|
|
568
568
|
function n(p) {
|
|
569
|
-
if (p = r(p), p.length !== e.length) throw new
|
|
569
|
+
if (p = r(p), p.length !== e.length) throw new je("Mismatched type converter count");
|
|
570
570
|
for (var P = 0; P < e.length; ++P) ce(e[P], p[P]);
|
|
571
571
|
}
|
|
572
572
|
e.forEach((p) => Ue[p] = t);
|
|
573
|
-
var a = Array(t.length), u = [],
|
|
573
|
+
var a = Array(t.length), u = [], h = 0;
|
|
574
574
|
t.forEach((p, P) => {
|
|
575
575
|
_e.hasOwnProperty(p) ? a[P] = _e[p] : (u.push(p), Ie.hasOwnProperty(p) || (Ie[p] = []), Ie[p].push(() => {
|
|
576
|
-
a[P] = _e[p], ++
|
|
576
|
+
a[P] = _e[p], ++h, h === u.length && n(a);
|
|
577
577
|
}));
|
|
578
578
|
}), u.length === 0 && n(a);
|
|
579
|
-
},
|
|
579
|
+
}, tt = (e) => {
|
|
580
580
|
for (; e.length; ) {
|
|
581
581
|
var t = e.pop();
|
|
582
582
|
e.pop()(t);
|
|
583
583
|
}
|
|
584
584
|
};
|
|
585
|
-
function
|
|
585
|
+
function Lt(e) {
|
|
586
586
|
for (var t = 1; t < e.length; ++t) if (e[t] !== null && e[t].s === void 0) return !0;
|
|
587
587
|
return !1;
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function Er(e, t, r, n, a) {
|
|
590
590
|
(e < t || e > r) && a(`function ${n} called with ${e} arguments, expected ${t == r ? t : `${t} to ${r}`}`);
|
|
591
591
|
}
|
|
592
|
-
function
|
|
593
|
-
var
|
|
594
|
-
if (2 >
|
|
595
|
-
|
|
596
|
-
var p = t[1] !== null && r !== null, P =
|
|
592
|
+
function rt(e, t, r, n, a, u) {
|
|
593
|
+
var h = t.length;
|
|
594
|
+
if (2 > h) throw new W("argTypes array size mismatch! Must at least get return value and 'this' types!");
|
|
595
|
+
f(!u, "Async bindings are only supported with JSPI.");
|
|
596
|
+
var p = t[1] !== null && r !== null, P = Lt(t);
|
|
597
597
|
r = t[0].name !== "void";
|
|
598
|
-
for (var O =
|
|
599
|
-
for (n = [e,
|
|
598
|
+
for (var O = h - 2, M = t.length - 2, B = t.length - 1; 2 <= B && t[B].optional; --B) M--;
|
|
599
|
+
for (n = [e, fr, n, a, tt, t[0], t[1]], a = 0; a < h - 2; ++a) n.push(t[a + 2]);
|
|
600
600
|
if (!P) for (a = p ? 1 : 2; a < t.length; ++a) t[a].s !== null && n.push(t[a].s);
|
|
601
|
-
for (n.push(
|
|
602
|
-
|
|
601
|
+
for (n.push(Er, M, O), P = Lt(t), O = t.length - 2, M = [], a = ["fn"], p && a.push("thisWired"), h = 0; h < O; ++h) M.push(`arg${h}`), a.push(`arg${h}Wired`);
|
|
602
|
+
M = M.join(","), a = a.join(","), M = `return function (${M}) {
|
|
603
603
|
checkArgCount(arguments.length, minArgs, maxArgs, humanName, throwBindingError);
|
|
604
|
-
`, P && (
|
|
604
|
+
`, P && (M += `var destructors = [];
|
|
605
605
|
`);
|
|
606
606
|
var Y = P ? "destructors" : "null";
|
|
607
|
-
for (B = "humanName throwBindingError invoker fn runDestructors retType classParam".split(" "), p && (
|
|
608
|
-
`),
|
|
609
|
-
`, B.push(`argType${
|
|
610
|
-
if (
|
|
611
|
-
`, P)
|
|
607
|
+
for (B = "humanName throwBindingError invoker fn runDestructors retType classParam".split(" "), p && (M += `var thisWired = classParam['toWireType'](${Y}, this);
|
|
608
|
+
`), h = 0; h < O; ++h) M += `var arg${h}Wired = argType${h}['toWireType'](${Y}, arg${h});
|
|
609
|
+
`, B.push(`argType${h}`);
|
|
610
|
+
if (M += (r || u ? "var rv = " : "") + `invoker(${a});
|
|
611
|
+
`, P) M += `runDestructors(destructors);
|
|
612
612
|
`;
|
|
613
|
-
else for (
|
|
613
|
+
else for (h = p ? 1 : 2; h < t.length; ++h) u = h === 1 ? "thisWired" : "arg" + (h - 2) + "Wired", t[h].s !== null && (M += `${u}_dtor(${u});
|
|
614
614
|
`, B.push(`${u}_dtor`));
|
|
615
|
-
r && (
|
|
615
|
+
r && (M += `var ret = retType['fromWireType'](rv);
|
|
616
616
|
return ret;
|
|
617
|
-
`),
|
|
618
|
-
`, B.push("checkArgCount", "minArgs", "maxArgs"),
|
|
619
|
-
${
|
|
620
|
-
let [q, K] = [B,
|
|
617
|
+
`), M += `}
|
|
618
|
+
`, B.push("checkArgCount", "minArgs", "maxArgs"), M = `if (arguments.length !== ${B.length}){ throw new Error(humanName + "Expected ${B.length} closure arguments " + arguments.length + " given."); }
|
|
619
|
+
${M}`;
|
|
620
|
+
let [q, K] = [B, M];
|
|
621
621
|
return t = new Function(...q, K)(...n), Ge(e, t);
|
|
622
622
|
}
|
|
623
|
-
for (var
|
|
623
|
+
for (var nt = (e, t) => {
|
|
624
624
|
for (var r = [], n = 0; n < e; n++) r.push(o[t + 4 * n >> 2]);
|
|
625
625
|
return r;
|
|
626
|
-
},
|
|
626
|
+
}, Nt = (e) => {
|
|
627
627
|
e = e.trim();
|
|
628
628
|
let t = e.indexOf("(");
|
|
629
|
-
return t === -1 ? e : (
|
|
630
|
-
},
|
|
631
|
-
if (!(e instanceof Object)) throw new
|
|
632
|
-
if (!(e instanceof t.h.constructor)) throw new
|
|
633
|
-
if (!e.g.i) throw new
|
|
629
|
+
return t === -1 ? e : (f(e.endsWith(")"), "Parentheses for argument names should match."), e.slice(0, t));
|
|
630
|
+
}, Ut = (e, t, r) => {
|
|
631
|
+
if (!(e instanceof Object)) throw new W(`${r} with invalid "this": ${e}`);
|
|
632
|
+
if (!(e instanceof t.h.constructor)) throw new W(`${r} incompatible with "this" of type ${e.constructor.name}`);
|
|
633
|
+
if (!e.g.i) throw new W(`cannot call emscripten binding method ${r} on deleted object`);
|
|
634
634
|
return He(e.g.i, e.g.j.h, t.h);
|
|
635
|
-
},
|
|
636
|
-
9 < e && --ue[e + 1] === 0 && (
|
|
637
|
-
},
|
|
638
|
-
if (!e) throw new
|
|
639
|
-
return
|
|
635
|
+
}, it = [], ue = [], ot = (e) => {
|
|
636
|
+
9 < e && --ue[e + 1] === 0 && (f(ue[e] !== void 0, "Decref for unallocated handle."), ue[e] = void 0, it.push(e));
|
|
637
|
+
}, at = (e) => {
|
|
638
|
+
if (!e) throw new W(`Cannot use deleted val. handle = ${e}`);
|
|
639
|
+
return f(e === 2 || ue[e] !== void 0 && e % 2 === 0, `invalid handle: ${e}`), ue[e];
|
|
640
640
|
}, Ve = (e) => {
|
|
641
641
|
switch (e) {
|
|
642
642
|
case void 0:
|
|
@@ -648,13 +648,13 @@ ${E}`;
|
|
|
648
648
|
case !1:
|
|
649
649
|
return 8;
|
|
650
650
|
default:
|
|
651
|
-
let t =
|
|
651
|
+
let t = it.pop() || ue.length;
|
|
652
652
|
return ue[t] = e, ue[t + 1] = 1, t;
|
|
653
653
|
}
|
|
654
|
-
},
|
|
655
|
-
var t =
|
|
656
|
-
return
|
|
657
|
-
}, toWireType: (e, t) => Ve(t), o: 8, readValueFromPointer: Be, s: null },
|
|
654
|
+
}, jt = { name: "emscripten::val", fromWireType: (e) => {
|
|
655
|
+
var t = at(e);
|
|
656
|
+
return ot(e), t;
|
|
657
|
+
}, toWireType: (e, t) => Ve(t), o: 8, readValueFromPointer: Be, s: null }, Mr = (e, t, r) => {
|
|
658
658
|
switch (t) {
|
|
659
659
|
case 1:
|
|
660
660
|
return r ? function(n) {
|
|
@@ -664,7 +664,7 @@ ${E}`;
|
|
|
664
664
|
};
|
|
665
665
|
case 2:
|
|
666
666
|
return r ? function(n) {
|
|
667
|
-
return this.fromWireType(
|
|
667
|
+
return this.fromWireType(E[n >> 1]);
|
|
668
668
|
} : function(n) {
|
|
669
669
|
return this.fromWireType(F[n >> 1]);
|
|
670
670
|
};
|
|
@@ -677,11 +677,11 @@ ${E}`;
|
|
|
677
677
|
default:
|
|
678
678
|
throw new TypeError(`invalid integer width (${t}): ${e}`);
|
|
679
679
|
}
|
|
680
|
-
},
|
|
680
|
+
}, st = (e, t) => {
|
|
681
681
|
var r = _e[e];
|
|
682
|
-
if (r === void 0) throw e = `${t} has unknown type ${
|
|
682
|
+
if (r === void 0) throw e = `${t} has unknown type ${Ft(e)}`, new W(e);
|
|
683
683
|
return r;
|
|
684
|
-
},
|
|
684
|
+
}, Sr = (e, t) => {
|
|
685
685
|
switch (t) {
|
|
686
686
|
case 4:
|
|
687
687
|
return function(r) {
|
|
@@ -689,41 +689,41 @@ ${E}`;
|
|
|
689
689
|
};
|
|
690
690
|
case 8:
|
|
691
691
|
return function(r) {
|
|
692
|
-
return this.fromWireType(
|
|
692
|
+
return this.fromWireType(T[r >> 3]);
|
|
693
693
|
};
|
|
694
694
|
default:
|
|
695
695
|
throw new TypeError(`invalid float width (${t}): ${e}`);
|
|
696
696
|
}
|
|
697
|
-
},
|
|
698
|
-
|
|
697
|
+
}, kr = Object.assign({ optional: !0 }, jt), Ae = (e, t, r) => {
|
|
698
|
+
f(typeof r == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");
|
|
699
699
|
var n = g;
|
|
700
|
-
if (
|
|
700
|
+
if (f(typeof e == "string", `stringToUTF8Array expects a string (got ${typeof e})`), 0 < r) {
|
|
701
701
|
var a = t;
|
|
702
702
|
r = t + r - 1;
|
|
703
703
|
for (var u = 0; u < e.length; ++u) {
|
|
704
|
-
var
|
|
705
|
-
if (55296 <=
|
|
704
|
+
var h = e.charCodeAt(u);
|
|
705
|
+
if (55296 <= h && 57343 >= h) {
|
|
706
706
|
var p = e.charCodeAt(++u);
|
|
707
|
-
|
|
707
|
+
h = 65536 + ((h & 1023) << 10) | p & 1023;
|
|
708
708
|
}
|
|
709
|
-
if (127 >=
|
|
709
|
+
if (127 >= h) {
|
|
710
710
|
if (t >= r) break;
|
|
711
|
-
n[t++] =
|
|
711
|
+
n[t++] = h;
|
|
712
712
|
} else {
|
|
713
|
-
if (2047 >=
|
|
713
|
+
if (2047 >= h) {
|
|
714
714
|
if (t + 1 >= r) break;
|
|
715
|
-
n[t++] = 192 |
|
|
715
|
+
n[t++] = 192 | h >> 6;
|
|
716
716
|
} else {
|
|
717
|
-
if (65535 >=
|
|
717
|
+
if (65535 >= h) {
|
|
718
718
|
if (t + 2 >= r) break;
|
|
719
|
-
n[t++] = 224 |
|
|
719
|
+
n[t++] = 224 | h >> 12;
|
|
720
720
|
} else {
|
|
721
721
|
if (t + 3 >= r) break;
|
|
722
|
-
1114111 <
|
|
722
|
+
1114111 < h && ye("Invalid Unicode code point " + ke(h) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."), n[t++] = 240 | h >> 18, n[t++] = 128 | h >> 12 & 63;
|
|
723
723
|
}
|
|
724
|
-
n[t++] = 128 |
|
|
724
|
+
n[t++] = 128 | h >> 6 & 63;
|
|
725
725
|
}
|
|
726
|
-
n[t++] = 128 |
|
|
726
|
+
n[t++] = 128 | h & 63;
|
|
727
727
|
}
|
|
728
728
|
}
|
|
729
729
|
n[t] = 0, e = t - a;
|
|
@@ -735,92 +735,92 @@ ${E}`;
|
|
|
735
735
|
127 >= n ? t++ : 2047 >= n ? t += 2 : 55296 <= n && 57343 >= n ? (t += 4, ++r) : t += 3;
|
|
736
736
|
}
|
|
737
737
|
return t;
|
|
738
|
-
},
|
|
739
|
-
|
|
738
|
+
}, Wt = typeof TextDecoder < "u" ? new TextDecoder("utf-16le") : void 0, Cr = (e, t) => {
|
|
739
|
+
f(e % 2 == 0, "Pointer passed to UTF16ToString must be aligned to two bytes!");
|
|
740
740
|
for (var r = e >> 1, n = r + t / 2; !(r >= n) && F[r]; ) ++r;
|
|
741
|
-
if (r <<= 1, 32 < r - e &&
|
|
741
|
+
if (r <<= 1, 32 < r - e && Wt) return Wt.decode(g.subarray(e, r));
|
|
742
742
|
for (r = "", n = 0; !(n >= t / 2); ++n) {
|
|
743
|
-
var a =
|
|
743
|
+
var a = E[e + 2 * n >> 1];
|
|
744
744
|
if (a == 0) break;
|
|
745
745
|
r += String.fromCharCode(a);
|
|
746
746
|
}
|
|
747
747
|
return r;
|
|
748
|
-
},
|
|
749
|
-
if (
|
|
748
|
+
}, Ir = (e, t, r) => {
|
|
749
|
+
if (f(t % 2 == 0, "Pointer passed to stringToUTF16 must be aligned to two bytes!"), f(typeof r == "number", "stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), r ??= 2147483647, 2 > r) return 0;
|
|
750
750
|
r -= 2;
|
|
751
751
|
var n = t;
|
|
752
752
|
r = r < 2 * e.length ? r / 2 : e.length;
|
|
753
|
-
for (var a = 0; a < r; ++a)
|
|
754
|
-
return
|
|
755
|
-
},
|
|
756
|
-
|
|
753
|
+
for (var a = 0; a < r; ++a) E[t >> 1] = e.charCodeAt(a), t += 2;
|
|
754
|
+
return E[t >> 1] = 0, t - n;
|
|
755
|
+
}, Pr = (e) => 2 * e.length, Ar = (e, t) => {
|
|
756
|
+
f(e % 4 == 0, "Pointer passed to UTF32ToString must be aligned to four bytes!");
|
|
757
757
|
for (var r = 0, n = ""; !(r >= t / 4); ) {
|
|
758
758
|
var a = L[e + 4 * r >> 2];
|
|
759
759
|
if (a == 0) break;
|
|
760
760
|
++r, 65536 <= a ? (a -= 65536, n += String.fromCharCode(55296 | a >> 10, 56320 | a & 1023)) : n += String.fromCharCode(a);
|
|
761
761
|
}
|
|
762
762
|
return n;
|
|
763
|
-
},
|
|
764
|
-
if (
|
|
763
|
+
}, Or = (e, t, r) => {
|
|
764
|
+
if (f(t % 4 == 0, "Pointer passed to stringToUTF32 must be aligned to four bytes!"), f(typeof r == "number", "stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), r ??= 2147483647, 4 > r) return 0;
|
|
765
765
|
var n = t;
|
|
766
766
|
r = n + r - 4;
|
|
767
767
|
for (var a = 0; a < e.length; ++a) {
|
|
768
768
|
var u = e.charCodeAt(a);
|
|
769
769
|
if (55296 <= u && 57343 >= u) {
|
|
770
|
-
var
|
|
771
|
-
u = 65536 + ((u & 1023) << 10) |
|
|
770
|
+
var h = e.charCodeAt(++a);
|
|
771
|
+
u = 65536 + ((u & 1023) << 10) | h & 1023;
|
|
772
772
|
}
|
|
773
773
|
if (L[t >> 2] = u, t += 4, t + 4 > r) break;
|
|
774
774
|
}
|
|
775
775
|
return L[t >> 2] = 0, t - n;
|
|
776
|
-
},
|
|
776
|
+
}, Rr = (e) => {
|
|
777
777
|
for (var t = 0, r = 0; r < e.length; ++r) {
|
|
778
778
|
var n = e.charCodeAt(r);
|
|
779
779
|
55296 <= n && 57343 >= n && ++r, t += 4;
|
|
780
780
|
}
|
|
781
781
|
return t;
|
|
782
|
-
}, Oe = 0,
|
|
783
|
-
var t =
|
|
784
|
-
return
|
|
785
|
-
},
|
|
786
|
-
for (var r = Array(e), n = 0; n < e; ++n) r[n] =
|
|
782
|
+
}, Oe = 0, ct = [], $r = (e) => {
|
|
783
|
+
var t = ct.length;
|
|
784
|
+
return ct.push(e), t;
|
|
785
|
+
}, Fr = (e, t) => {
|
|
786
|
+
for (var r = Array(e), n = 0; n < e; ++n) r[n] = st(o[t + 4 * n >> 2], `parameter ${n}`);
|
|
787
787
|
return r;
|
|
788
|
-
},
|
|
788
|
+
}, Lr = (e, t, r) => {
|
|
789
789
|
var n = [];
|
|
790
790
|
return e = e.toWireType(n, r), n.length && (o[t >> 2] = Ve(n)), e;
|
|
791
|
-
}, Re = {},
|
|
792
|
-
if (!(e instanceof
|
|
793
|
-
},
|
|
794
|
-
throw v = e, Se || 0 < Oe || (i.onExit?.(e), w = !0), new
|
|
795
|
-
},
|
|
796
|
-
if (N || w)
|
|
791
|
+
}, Re = {}, Dt = (e) => {
|
|
792
|
+
if (!(e instanceof vt || e == "unwind")) throw D(), e instanceof WebAssembly.RuntimeError && 0 >= qt() && x("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 65536)"), e;
|
|
793
|
+
}, Gt = (e) => {
|
|
794
|
+
throw v = e, Se || 0 < Oe || (i.onExit?.(e), w = !0), new vt(e);
|
|
795
|
+
}, Nr = (e) => {
|
|
796
|
+
if (N || w) x("user callback triggered after runtime exited or application aborted. Ignoring.");
|
|
797
797
|
else try {
|
|
798
798
|
if (e(), !(N || Se || 0 < Oe)) try {
|
|
799
|
-
if (v = e = v, Se || 0 < Oe || (
|
|
799
|
+
if (v = e = v, Se || 0 < Oe || (f(!N), D(), Wr(), jr(0), dt[1].length && ht(1, 10), dt[2].length && ht(2, 10), N = !0), Se || 0 < Oe) {
|
|
800
800
|
var t = `program exited (with status: ${e}), but keepRuntimeAlive() is set (counter=${Oe}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`;
|
|
801
|
-
|
|
801
|
+
I(t), x(t);
|
|
802
802
|
}
|
|
803
|
-
|
|
803
|
+
Gt(e);
|
|
804
804
|
} catch (r) {
|
|
805
|
-
|
|
805
|
+
Dt(r);
|
|
806
806
|
}
|
|
807
807
|
} catch (r) {
|
|
808
|
-
|
|
808
|
+
Dt(r);
|
|
809
809
|
}
|
|
810
|
-
},
|
|
811
|
-
if (!
|
|
810
|
+
}, ut = {}, Ht = () => {
|
|
811
|
+
if (!lt) {
|
|
812
812
|
var e = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: R || "./this.program" }, t;
|
|
813
|
-
for (t in
|
|
813
|
+
for (t in ut) ut[t] === void 0 ? delete e[t] : e[t] = ut[t];
|
|
814
814
|
var r = [];
|
|
815
815
|
for (t in e) r.push(`${t}=${e[t]}`);
|
|
816
|
-
|
|
816
|
+
lt = r;
|
|
817
817
|
}
|
|
818
|
-
return
|
|
819
|
-
},
|
|
820
|
-
var r =
|
|
821
|
-
|
|
822
|
-
},
|
|
823
|
-
|
|
818
|
+
return lt;
|
|
819
|
+
}, lt, dt = [null, [], []], ht = (e, t) => {
|
|
820
|
+
var r = dt[e];
|
|
821
|
+
f(r), t === 0 || t === 10 ? ((e === 1 ? l : x)(Et(r)), r.length = 0) : r.push(t);
|
|
822
|
+
}, Bt = Array(256), Ye = 0; 256 > Ye; ++Ye) Bt[Ye] = String.fromCharCode(Ye);
|
|
823
|
+
St = Bt, (() => {
|
|
824
824
|
let e = De.prototype;
|
|
825
825
|
Object.assign(e, { isAliasOf: function(r) {
|
|
826
826
|
if (!(this instanceof De && r instanceof De)) return !1;
|
|
@@ -831,18 +831,18 @@ ${E}`;
|
|
|
831
831
|
for (; u.m; ) r = u.H(r), u = u.m;
|
|
832
832
|
return n === u && a === r;
|
|
833
833
|
}, clone: function() {
|
|
834
|
-
if (this.g.i ||
|
|
835
|
-
var r = Le, n = Object, a = n.create, u = Object.getPrototypeOf(this),
|
|
836
|
-
return r = r(a.call(n, u, { g: { value: { count:
|
|
834
|
+
if (this.g.i || Qe(this), this.g.G) return this.g.count.value += 1, this;
|
|
835
|
+
var r = Le, n = Object, a = n.create, u = Object.getPrototypeOf(this), h = this.g;
|
|
836
|
+
return r = r(a.call(n, u, { g: { value: { count: h.count, F: h.F, G: h.G, i: h.i, j: h.j, l: h.l, v: h.v } } })), r.g.count.value += 1, r.g.F = !1, r;
|
|
837
837
|
}, delete() {
|
|
838
|
-
if (this.g.i ||
|
|
839
|
-
|
|
838
|
+
if (this.g.i || Qe(this), this.g.F && !this.g.G) throw new W("Object already scheduled for deletion");
|
|
839
|
+
Ct(this);
|
|
840
840
|
var r = this.g;
|
|
841
841
|
--r.count.value, r.count.value === 0 && (r.l ? r.v.B(r.l) : r.j.h.B(r.i)), this.g.G || (this.g.l = void 0, this.g.i = void 0);
|
|
842
842
|
}, isDeleted: function() {
|
|
843
843
|
return !this.g.i;
|
|
844
844
|
}, deleteLater: function() {
|
|
845
|
-
if (this.g.i ||
|
|
845
|
+
if (this.g.i || Qe(this), this.g.F && !this.g.G) throw new W("Object already scheduled for deletion");
|
|
846
846
|
return this.g.F = !0, this;
|
|
847
847
|
} });
|
|
848
848
|
let t = Symbol.dispose;
|
|
@@ -851,30 +851,30 @@ ${E}`;
|
|
|
851
851
|
return this.O && (e = this.O(e)), e;
|
|
852
852
|
}, N(e) {
|
|
853
853
|
this.B?.(e);
|
|
854
|
-
}, o: 8, readValueFromPointer: Be, fromWireType:
|
|
854
|
+
}, o: 8, readValueFromPointer: Be, fromWireType: At }), ue.push(0, 1, void 0, 1, null, 1, !0, 1, !1, 1), f(ue.length === 10), i.count_emval_handles = () => ue.length / 2 - 5 - it.length, i.noExitRuntime && (Se = i.noExitRuntime), i.print && (l = i.print), i.printErr && (x = i.printErr), i.wasmBinary && (k = i.wasmBinary), i.FS_createDataFile = function() {
|
|
855
855
|
fe();
|
|
856
856
|
}, i.FS_createPreloadedFile = function() {
|
|
857
857
|
fe();
|
|
858
|
-
}, Object.getOwnPropertyDescriptor(i, "fetchSettings") && J("`Module.fetchSettings` was supplied but `fetchSettings` not included in INCOMING_MODULE_JS_API"), i.thisProgram && (R = i.thisProgram),
|
|
858
|
+
}, Object.getOwnPropertyDescriptor(i, "fetchSettings") && J("`Module.fetchSettings` was supplied but `fetchSettings` not included in INCOMING_MODULE_JS_API"), i.thisProgram && (R = i.thisProgram), f(typeof i.memoryInitializerPrefixURL > "u", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"), f(typeof i.pthreadMainPrefixURL > "u", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"), f(typeof i.cdInitializerPrefixURL > "u", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"), f(typeof i.filePackagePrefixURL > "u", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"), f(typeof i.read > "u", "Module.read option was removed"), f(typeof i.readAsync > "u", "Module.readAsync option was removed (modify readAsync in JS)"), f(typeof i.readBinary > "u", "Module.readBinary option was removed (modify readBinary in JS)"), f(typeof i.setWindowTitle > "u", "Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"), f(typeof i.TOTAL_MEMORY > "u", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"), f(typeof i.ENVIRONMENT > "u", "Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)"), f(typeof i.STACK_SIZE > "u", "STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"), f(typeof i.wasmMemory > "u", "Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"), f(typeof i.INITIAL_MEMORY > "u", "Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"), "writeI53ToI64 writeI53ToI64Clamped writeI53ToI64Signaling writeI53ToU64Clamped writeI53ToU64Signaling readI53FromI64 readI53FromU64 convertI32PairToI53 convertI32PairToI53Checked convertU32PairToI53 getTempRet0 setTempRet0 zeroMemory strError inetPton4 inetNtop4 inetPton6 inetNtop6 readSockaddr writeSockaddr emscriptenLog readEmAsmArgs jstoi_q listenOnce autoResumeAudioContext getDynCaller dynCall runtimeKeepalivePush runtimeKeepalivePop asmjsMangle asyncLoad mmapAlloc HandleAllocator getNativeTypeSize addOnInit addOnPostCtor addOnPreMain addOnExit STACK_SIZE STACK_ALIGN POINTER_SIZE ASSERTIONS getCFunc ccall cwrap uleb128Encode sigToWasmTypes generateFuncType convertJsFunctionToWasm getEmptyTableSlot updateTableMap getFunctionAddress addFunction removeFunction reallyNegative unSign strLen reSign formatString intArrayFromString intArrayToString AsciiToString stringToAscii stringToNewUTF8 stringToUTF8OnStack writeArrayToMemory registerKeyEventCallback maybeCStringToJsString findEventTarget getBoundingClientRect fillMouseEventData registerMouseEventCallback registerWheelEventCallback registerUiEventCallback registerFocusEventCallback fillDeviceOrientationEventData registerDeviceOrientationEventCallback fillDeviceMotionEventData registerDeviceMotionEventCallback screenOrientation fillOrientationChangeEventData registerOrientationChangeEventCallback fillFullscreenChangeEventData registerFullscreenChangeEventCallback JSEvents_requestFullscreen JSEvents_resizeCanvasForFullscreen registerRestoreOldStyle hideEverythingExceptGivenElement restoreHiddenElements setLetterbox softFullscreenResizeWebGLRenderTarget doRequestFullscreen fillPointerlockChangeEventData registerPointerlockChangeEventCallback registerPointerlockErrorEventCallback requestPointerLock fillVisibilityChangeEventData registerVisibilityChangeEventCallback registerTouchEventCallback fillGamepadEventData registerGamepadEventCallback registerBeforeUnloadEventCallback fillBatteryEventData battery registerBatteryEventCallback setCanvasElementSize getCanvasElementSize jsStackTrace getCallstack convertPCtoSourceLocation wasiRightsToMuslOFlags wasiOFlagsToMuslOFlags initRandomFill randomFill safeSetTimeout setImmediateWrapped safeRequestAnimationFrame clearImmediateWrapped registerPostMainLoop registerPreMainLoop getPromise makePromise idsToPromises makePromiseCallback Browser_asyncPrepareDataCounter isLeapYear ydayFromDate arraySum addDays getSocketFromFD getSocketAddress heapObjectForWebGLType toTypedArrayIndex webgl_enable_ANGLE_instanced_arrays webgl_enable_OES_vertex_array_object webgl_enable_WEBGL_draw_buffers webgl_enable_WEBGL_multi_draw webgl_enable_EXT_polygon_offset_clamp webgl_enable_EXT_clip_control webgl_enable_WEBGL_polygon_mode emscriptenWebGLGet computeUnpackAlignedImageSize colorChannelsInGlTextureFormat emscriptenWebGLGetTexPixelData emscriptenWebGLGetUniform webglGetUniformLocation webglPrepareUniformLocationsBeforeFirstUse webglGetLeftBracePos emscriptenWebGLGetVertexAttrib __glGetActiveAttribOrUniform writeGLArray registerWebGlEventCallback runAndAbortIfError ALLOC_NORMAL ALLOC_STACK allocate writeStringToMemory writeAsciiToMemory demangle stackTrace getFunctionArgsName createJsInvokerSignature PureVirtualError registerInheritedInstance unregisterInheritedInstance getInheritedInstanceCount getLiveInheritedInstances setDelayFunction getStringOrSymbol emval_get_global".split(" ").forEach(function(e) {
|
|
859
859
|
Ne(e, () => {
|
|
860
860
|
var t = `\`${e}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`, r = e;
|
|
861
861
|
r.startsWith("_") || (r = "$" + e), t += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${r}')`, $e(e) && (t += ". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"), ye(t);
|
|
862
862
|
}), he(e);
|
|
863
|
-
}), "run addRunDependency removeRunDependency out err callMain abort wasmMemory wasmExports HEAPF32 HEAPF64 HEAP8 HEAPU8 HEAP16 HEAPU16 HEAP32 HEAPU32 HEAP64 HEAPU64 writeStackCookie checkStackCookie INT53_MAX INT53_MIN bigintToI53Checked stackSave stackRestore stackAlloc ptrToString exitJS getHeapMax growMemory ENV ERRNO_CODES DNS Protocols Sockets timers warnOnce readEmAsmArgsArray jstoi_s getExecutableName handleException keepRuntimeAlive callUserCallback maybeExit alignMemory wasmTable noExitRuntime addOnPreRun addOnPostRun freeTableIndexes functionsInTableMap setValue getValue PATH PATH_FS UTF8Decoder UTF8ArrayToString UTF8ToString stringToUTF8Array stringToUTF8 lengthBytesUTF8 UTF16Decoder UTF16ToString stringToUTF16 lengthBytesUTF16 UTF32ToString stringToUTF32 lengthBytesUTF32 JSEvents specialHTMLTargets findCanvasEventTarget currentFullscreenStrategy restoreOldWindowedStyle UNWIND_CACHE ExitStatus getEnvStrings checkWasiClock flush_NO_FILESYSTEM emSetImmediate emClearImmediate_deps emClearImmediate promiseMap getExceptionMessageCommon getCppExceptionTag getCppExceptionThrownObjectFromWebAssemblyException Browser getPreloadedImageData__data wget MONTH_DAYS_REGULAR MONTH_DAYS_LEAP MONTH_DAYS_REGULAR_CUMULATIVE MONTH_DAYS_LEAP_CUMULATIVE SYSCALLS tempFixedLengthArray miniTempWebGLFloatBuffers miniTempWebGLIntBuffers GL AL GLUT EGL GLEW IDBStore SDL SDL_gfx allocateUTF8 allocateUTF8OnStack print printErr InternalError BindingError throwInternalError throwBindingError registeredTypes awaitingDependencies typeDependencies tupleRegistrations structRegistrations sharedRegisterType whenDependentTypesAreResolved embind_charCodes embind_init_charCodes readLatin1String getTypeName getFunctionName heap32VectorToArray requireRegisteredType usesDestructorStack checkArgCount getRequiredArgCount createJsInvoker UnboundTypeError GenericWireTypeSize EmValType EmValOptionalType throwUnboundTypeError ensureOverloadTable exposePublicSymbol replacePublicSymbol createNamedFunction embindRepr registeredInstances getBasestPointer getInheritedInstance registeredPointers registerType integerReadValueFromPointer enumReadValueFromPointer floatReadValueFromPointer readPointer runDestructors craftInvokerFunction embind__requireFunction genericPointerToWireType constNoSmartPtrRawPointerToWireType nonConstNoSmartPtrRawPointerToWireType init_RegisteredPointer RegisteredPointer RegisteredPointer_fromWireType runDestructor releaseClassHandle finalizationRegistry detachFinalizer_deps detachFinalizer attachFinalizer makeClassHandle init_ClassHandle ClassHandle throwInstanceAlreadyDeleted deletionQueue flushPendingDeletes delayFunction RegisteredClass shallowCopyInternalPointer downcastPointer upcastPointer validateThis char_0 char_9 makeLegalFunctionName emval_freelist emval_handles emval_symbols init_emval count_emval_handles Emval emval_returnValue emval_lookupTypes emval_methodCallers emval_addMethodCaller reflectConstruct".split(" ").forEach(he), i.getExceptionMessage =
|
|
864
|
-
e =
|
|
863
|
+
}), "run addRunDependency removeRunDependency out err callMain abort wasmMemory wasmExports HEAPF32 HEAPF64 HEAP8 HEAPU8 HEAP16 HEAPU16 HEAP32 HEAPU32 HEAP64 HEAPU64 writeStackCookie checkStackCookie INT53_MAX INT53_MIN bigintToI53Checked stackSave stackRestore stackAlloc ptrToString exitJS getHeapMax growMemory ENV ERRNO_CODES DNS Protocols Sockets timers warnOnce readEmAsmArgsArray jstoi_s getExecutableName handleException keepRuntimeAlive callUserCallback maybeExit alignMemory wasmTable noExitRuntime addOnPreRun addOnPostRun freeTableIndexes functionsInTableMap setValue getValue PATH PATH_FS UTF8Decoder UTF8ArrayToString UTF8ToString stringToUTF8Array stringToUTF8 lengthBytesUTF8 UTF16Decoder UTF16ToString stringToUTF16 lengthBytesUTF16 UTF32ToString stringToUTF32 lengthBytesUTF32 JSEvents specialHTMLTargets findCanvasEventTarget currentFullscreenStrategy restoreOldWindowedStyle UNWIND_CACHE ExitStatus getEnvStrings checkWasiClock flush_NO_FILESYSTEM emSetImmediate emClearImmediate_deps emClearImmediate promiseMap getExceptionMessageCommon getCppExceptionTag getCppExceptionThrownObjectFromWebAssemblyException Browser getPreloadedImageData__data wget MONTH_DAYS_REGULAR MONTH_DAYS_LEAP MONTH_DAYS_REGULAR_CUMULATIVE MONTH_DAYS_LEAP_CUMULATIVE SYSCALLS tempFixedLengthArray miniTempWebGLFloatBuffers miniTempWebGLIntBuffers GL AL GLUT EGL GLEW IDBStore SDL SDL_gfx allocateUTF8 allocateUTF8OnStack print printErr InternalError BindingError throwInternalError throwBindingError registeredTypes awaitingDependencies typeDependencies tupleRegistrations structRegistrations sharedRegisterType whenDependentTypesAreResolved embind_charCodes embind_init_charCodes readLatin1String getTypeName getFunctionName heap32VectorToArray requireRegisteredType usesDestructorStack checkArgCount getRequiredArgCount createJsInvoker UnboundTypeError GenericWireTypeSize EmValType EmValOptionalType throwUnboundTypeError ensureOverloadTable exposePublicSymbol replacePublicSymbol createNamedFunction embindRepr registeredInstances getBasestPointer getInheritedInstance registeredPointers registerType integerReadValueFromPointer enumReadValueFromPointer floatReadValueFromPointer readPointer runDestructors craftInvokerFunction embind__requireFunction genericPointerToWireType constNoSmartPtrRawPointerToWireType nonConstNoSmartPtrRawPointerToWireType init_RegisteredPointer RegisteredPointer RegisteredPointer_fromWireType runDestructor releaseClassHandle finalizationRegistry detachFinalizer_deps detachFinalizer attachFinalizer makeClassHandle init_ClassHandle ClassHandle throwInstanceAlreadyDeleted deletionQueue flushPendingDeletes delayFunction RegisteredClass shallowCopyInternalPointer downcastPointer upcastPointer validateThis char_0 char_9 makeLegalFunctionName emval_freelist emval_handles emval_symbols init_emval count_emval_handles Emval emval_returnValue emval_lookupTypes emval_methodCallers emval_addMethodCaller reflectConstruct".split(" ").forEach(he), i.getExceptionMessage = Mt, i.incrementExceptionRefcount = (e) => {
|
|
864
|
+
e = Ze(e), Vr(e);
|
|
865
865
|
}, i.decrementExceptionRefcount = (e) => {
|
|
866
|
-
e =
|
|
866
|
+
e = Ze(e), zr(e);
|
|
867
867
|
};
|
|
868
|
-
var
|
|
869
|
-
throw e = new WebAssembly.Exception(ee.__cpp_exception, [e], { traceStack: !0 }), e.message =
|
|
868
|
+
var zt = { __assert_fail: (e, t, r, n) => J(`Assertion failed: ${Ce(e)}, at: ` + [t ? Ce(t) : "unknown filename", r, n ? Ce(n) : "unknown function"]), __throw_exception_with_stack_trace: (e) => {
|
|
869
|
+
throw e = new WebAssembly.Exception(ee.__cpp_exception, [e], { traceStack: !0 }), e.message = Mt(e), e;
|
|
870
870
|
}, _abort_js: () => J("native code called abort()"), _embind_register_bigint: (e, t, r, n, a) => {
|
|
871
871
|
t = Z(t);
|
|
872
872
|
var u = t.indexOf("u") != -1;
|
|
873
|
-
u && (a = (1n << 64n) - 1n), ce(e, { name: t, fromWireType: (
|
|
873
|
+
u && (a = (1n << 64n) - 1n), ce(e, { name: t, fromWireType: (h) => h, toWireType: function(h, p) {
|
|
874
874
|
if (typeof p != "bigint" && typeof p != "number") throw new TypeError(`Cannot convert "${we(p)}" to ${this.name}`);
|
|
875
875
|
if (typeof p == "number" && (p = BigInt(p)), p < n || p > a) throw new TypeError(`Passing a number "${we(p)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${n}, ${a}]!`);
|
|
876
876
|
return p;
|
|
877
|
-
}, o: 8, readValueFromPointer:
|
|
877
|
+
}, o: 8, readValueFromPointer: kt(t, r, !u), s: null });
|
|
878
878
|
}, _embind_register_bool: (e, t, r, n) => {
|
|
879
879
|
t = Z(t), ce(e, { name: t, fromWireType: function(a) {
|
|
880
880
|
return !!a;
|
|
@@ -883,123 +883,123 @@ ${E}`;
|
|
|
883
883
|
}, o: 8, readValueFromPointer: function(a) {
|
|
884
884
|
return this.fromWireType(g[a]);
|
|
885
885
|
}, s: null });
|
|
886
|
-
}, _embind_register_class: (e, t, r, n, a, u,
|
|
887
|
-
|
|
888
|
-
var q =
|
|
889
|
-
|
|
890
|
-
Pe(`Cannot construct ${
|
|
886
|
+
}, _embind_register_class: (e, t, r, n, a, u, h, p, P, O, M, B, Y) => {
|
|
887
|
+
M = Z(M), u = ge(a, u), p &&= ge(h, p), O &&= ge(P, O), Y = ge(B, Y);
|
|
888
|
+
var q = yr(M);
|
|
889
|
+
Rt(q, function() {
|
|
890
|
+
Pe(`Cannot construct ${M} due to unbound types`, [n]);
|
|
891
891
|
}), pe([e, t, r], n ? [n] : [], (K) => {
|
|
892
892
|
if (K = K[0], n) var oe = K.h, xe = oe.A;
|
|
893
893
|
else xe = De.prototype;
|
|
894
|
-
K = Ge(
|
|
895
|
-
if (Object.getPrototypeOf(this) !== Te) throw new
|
|
896
|
-
if (le.D === void 0) throw new
|
|
897
|
-
var
|
|
898
|
-
if (
|
|
899
|
-
return
|
|
894
|
+
K = Ge(M, function(...gt) {
|
|
895
|
+
if (Object.getPrototypeOf(this) !== Te) throw new W(`Use 'new' to construct ${M}`);
|
|
896
|
+
if (le.D === void 0) throw new W(`${M} has no accessible constructor`);
|
|
897
|
+
var Xt = le.D[gt.length];
|
|
898
|
+
if (Xt === void 0) throw new W(`Tried to invoke ctor of ${M} with invalid number of parameters (${gt.length}) - expected (${Object.keys(le.D).toString()}) parameters instead!`);
|
|
899
|
+
return Xt.apply(this, gt);
|
|
900
900
|
});
|
|
901
901
|
var Te = Object.create(xe, { constructor: { value: K } });
|
|
902
902
|
K.prototype = Te;
|
|
903
|
-
var le = new
|
|
903
|
+
var le = new wr(M, K, Te, Y, oe, u, p, O);
|
|
904
904
|
if (le.m) {
|
|
905
905
|
var ve;
|
|
906
906
|
(ve = le.m).I ?? (ve.I = []), le.m.I.push(le);
|
|
907
907
|
}
|
|
908
|
-
return oe = new ze(
|
|
908
|
+
return oe = new ze(M, le, !0, !1, !1), ve = new ze(M + "*", le, !1, !1, !1), xe = new ze(M + " const*", le, !1, !0, !1), Pt[e] = { pointerType: ve, P: xe }, xr(q, K), [oe, ve, xe];
|
|
909
909
|
});
|
|
910
|
-
}, _embind_register_class_class_function: (e, t, r, n, a, u,
|
|
911
|
-
var P =
|
|
912
|
-
t = Z(t), t =
|
|
913
|
-
function
|
|
910
|
+
}, _embind_register_class_class_function: (e, t, r, n, a, u, h, p) => {
|
|
911
|
+
var P = nt(r, n);
|
|
912
|
+
t = Z(t), t = Nt(t), u = ge(a, u, p), pe([], [e], (O) => {
|
|
913
|
+
function M() {
|
|
914
914
|
Pe(`Cannot call ${B} due to unbound types`, P);
|
|
915
915
|
}
|
|
916
916
|
O = O[0];
|
|
917
917
|
var B = `${O.name}.${t}`;
|
|
918
918
|
t.startsWith("@@") && (t = Symbol[t.substring(2)]);
|
|
919
919
|
var Y = O.h.constructor;
|
|
920
|
-
return Y[t] === void 0 ? (
|
|
921
|
-
if (q =
|
|
920
|
+
return Y[t] === void 0 ? (M.C = r - 1, Y[t] = M) : (Ot(Y, t, B), Y[t].u[r - 1] = M), pe([], P, (q) => {
|
|
921
|
+
if (q = rt(B, [q[0], null].concat(q.slice(1)), null, u, h, p), Y[t].u === void 0 ? (q.C = r - 1, Y[t] = q) : Y[t].u[r - 1] = q, O.h.I) for (let K of O.h.I) K.constructor.hasOwnProperty(t) || (K.constructor[t] = q);
|
|
922
922
|
return [];
|
|
923
923
|
}), [];
|
|
924
924
|
});
|
|
925
925
|
}, _embind_register_class_constructor: (e, t, r, n, a, u) => {
|
|
926
|
-
|
|
927
|
-
var
|
|
926
|
+
f(0 < t);
|
|
927
|
+
var h = nt(t, r);
|
|
928
928
|
a = ge(n, a), pe([], [e], (p) => {
|
|
929
929
|
p = p[0];
|
|
930
930
|
var P = `constructor ${p.name}`;
|
|
931
|
-
if (p.h.D === void 0 && (p.h.D = []), p.h.D[t - 1] !== void 0) throw new
|
|
931
|
+
if (p.h.D === void 0 && (p.h.D = []), p.h.D[t - 1] !== void 0) throw new W(`Cannot register multiple constructors with identical number of parameters (${t - 1}) for class '${p.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
|
|
932
932
|
return p.h.D[t - 1] = () => {
|
|
933
|
-
Pe(`Cannot construct ${p.name} due to unbound types`,
|
|
934
|
-
}, pe([],
|
|
933
|
+
Pe(`Cannot construct ${p.name} due to unbound types`, h);
|
|
934
|
+
}, pe([], h, (O) => (O.splice(1, 0, null), p.h.D[t - 1] = rt(P, O, null, a, u), [])), [];
|
|
935
935
|
});
|
|
936
|
-
}, _embind_register_class_function: (e, t, r, n, a, u,
|
|
937
|
-
var O =
|
|
938
|
-
t = Z(t), t =
|
|
936
|
+
}, _embind_register_class_function: (e, t, r, n, a, u, h, p, P) => {
|
|
937
|
+
var O = nt(r, n);
|
|
938
|
+
t = Z(t), t = Nt(t), u = ge(a, u, P), pe([], [e], (M) => {
|
|
939
939
|
function B() {
|
|
940
940
|
Pe(`Cannot call ${Y} due to unbound types`, O);
|
|
941
941
|
}
|
|
942
|
-
|
|
943
|
-
var Y = `${
|
|
944
|
-
t.startsWith("@@") && (t = Symbol[t.substring(2)]), p &&
|
|
945
|
-
var q =
|
|
946
|
-
return K === void 0 || K.u === void 0 && K.className !==
|
|
942
|
+
M = M[0];
|
|
943
|
+
var Y = `${M.name}.${t}`;
|
|
944
|
+
t.startsWith("@@") && (t = Symbol[t.substring(2)]), p && M.h.Z.push(t);
|
|
945
|
+
var q = M.h.A, K = q[t];
|
|
946
|
+
return K === void 0 || K.u === void 0 && K.className !== M.name && K.C === r - 2 ? (B.C = r - 2, B.className = M.name, q[t] = B) : (Ot(q, t, Y), q[t].u[r - 2] = B), pe([], O, (oe) => (oe = rt(Y, oe, M, u, h, P), q[t].u === void 0 ? (oe.C = r - 2, q[t] = oe) : q[t].u[r - 2] = oe, [])), [];
|
|
947
947
|
});
|
|
948
|
-
}, _embind_register_class_property: (e, t, r, n, a, u,
|
|
949
|
-
t = Z(t), a = ge(n, a), pe([], [e], (
|
|
950
|
-
|
|
951
|
-
var B = `${
|
|
952
|
-
Pe(`Cannot access ${B} due to unbound types`, [r,
|
|
948
|
+
}, _embind_register_class_property: (e, t, r, n, a, u, h, p, P, O) => {
|
|
949
|
+
t = Z(t), a = ge(n, a), pe([], [e], (M) => {
|
|
950
|
+
M = M[0];
|
|
951
|
+
var B = `${M.name}.${t}`, Y = { get() {
|
|
952
|
+
Pe(`Cannot access ${B} due to unbound types`, [r, h]);
|
|
953
953
|
}, enumerable: !0, configurable: !0 };
|
|
954
|
-
return Y.set = P ? () => Pe(`Cannot access ${B} due to unbound types`, [r,
|
|
955
|
-
throw new
|
|
956
|
-
}, Object.defineProperty(
|
|
954
|
+
return Y.set = P ? () => Pe(`Cannot access ${B} due to unbound types`, [r, h]) : () => {
|
|
955
|
+
throw new W(B + " is a read-only property");
|
|
956
|
+
}, Object.defineProperty(M.h.A, t, Y), pe([], P ? [r, h] : [r], (q) => {
|
|
957
957
|
var K = q[0], oe = { get() {
|
|
958
|
-
var Te =
|
|
958
|
+
var Te = Ut(this, M, B + " getter");
|
|
959
959
|
return K.fromWireType(a(u, Te));
|
|
960
960
|
}, enumerable: !0 };
|
|
961
961
|
if (P) {
|
|
962
962
|
P = ge(p, P);
|
|
963
963
|
var xe = q[1];
|
|
964
964
|
oe.set = function(Te) {
|
|
965
|
-
var le =
|
|
966
|
-
P(O, le, xe.toWireType(ve, Te)),
|
|
965
|
+
var le = Ut(this, M, B + " setter"), ve = [];
|
|
966
|
+
P(O, le, xe.toWireType(ve, Te)), tt(ve);
|
|
967
967
|
};
|
|
968
968
|
}
|
|
969
|
-
return Object.defineProperty(
|
|
969
|
+
return Object.defineProperty(M.h.A, t, oe), [];
|
|
970
970
|
}), [];
|
|
971
971
|
});
|
|
972
|
-
}, _embind_register_emval: (e) => ce(e,
|
|
972
|
+
}, _embind_register_emval: (e) => ce(e, jt), _embind_register_enum: (e, t, r, n) => {
|
|
973
973
|
function a() {
|
|
974
974
|
}
|
|
975
975
|
t = Z(t), a.values = {}, ce(e, { name: t, constructor: a, fromWireType: function(u) {
|
|
976
976
|
return this.constructor.values[u];
|
|
977
|
-
}, toWireType: (u,
|
|
977
|
+
}, toWireType: (u, h) => h.value, o: 8, readValueFromPointer: Mr(t, r, n), s: null }), Rt(t, a);
|
|
978
978
|
}, _embind_register_enum_value: (e, t, r) => {
|
|
979
|
-
var n =
|
|
979
|
+
var n = st(e, "enum");
|
|
980
980
|
t = Z(t), e = n.constructor, n = Object.create(n.constructor.prototype, { value: { value: r }, constructor: { value: Ge(`${n.name}_${t}`, function() {
|
|
981
981
|
}) } }), e.values[r] = n, e[t] = n;
|
|
982
982
|
}, _embind_register_float: (e, t, r) => {
|
|
983
983
|
t = Z(t), ce(e, { name: t, fromWireType: (n) => n, toWireType: (n, a) => {
|
|
984
984
|
if (typeof a != "number" && typeof a != "boolean") throw new TypeError(`Cannot convert ${we(a)} to ${this.name}`);
|
|
985
985
|
return a;
|
|
986
|
-
}, o: 8, readValueFromPointer:
|
|
986
|
+
}, o: 8, readValueFromPointer: Sr(t, r), s: null });
|
|
987
987
|
}, _embind_register_integer: (e, t, r, n, a) => {
|
|
988
988
|
t = Z(t), a === -1 && (a = 4294967295);
|
|
989
989
|
var u = (O) => O;
|
|
990
990
|
if (n === 0) {
|
|
991
|
-
var
|
|
992
|
-
u = (O) => O <<
|
|
991
|
+
var h = 32 - 8 * r;
|
|
992
|
+
u = (O) => O << h >>> h;
|
|
993
993
|
}
|
|
994
|
-
var p = (O,
|
|
995
|
-
if (typeof O != "number" && typeof O != "boolean") throw new TypeError(`Cannot convert "${we(O)}" to ${
|
|
994
|
+
var p = (O, M) => {
|
|
995
|
+
if (typeof O != "number" && typeof O != "boolean") throw new TypeError(`Cannot convert "${we(O)}" to ${M}`);
|
|
996
996
|
if (O < n || O > a) throw new TypeError(`Passing a number "${we(O)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${n}, ${a}]!`);
|
|
997
|
-
}, P = t.includes("unsigned") ? function(O,
|
|
998
|
-
return p(
|
|
999
|
-
} : function(O,
|
|
1000
|
-
return p(
|
|
997
|
+
}, P = t.includes("unsigned") ? function(O, M) {
|
|
998
|
+
return p(M, this.name), M >>> 0;
|
|
999
|
+
} : function(O, M) {
|
|
1000
|
+
return p(M, this.name), M;
|
|
1001
1001
|
};
|
|
1002
|
-
ce(e, { name: t, fromWireType: u, toWireType: P, o: 8, readValueFromPointer:
|
|
1002
|
+
ce(e, { name: t, fromWireType: u, toWireType: P, o: 8, readValueFromPointer: kt(t, r, n !== 0), s: null });
|
|
1003
1003
|
}, _embind_register_memory_view: (e, t, r) => {
|
|
1004
1004
|
function n(u) {
|
|
1005
1005
|
return new a(m.buffer, o[u + 4 >> 2], o[u >> 2]);
|
|
@@ -1007,36 +1007,36 @@ ${E}`;
|
|
|
1007
1007
|
var a = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, BigInt64Array, BigUint64Array][t];
|
|
1008
1008
|
r = Z(r), ce(e, { name: r, fromWireType: n, o: 8, readValueFromPointer: n }, { V: !0 });
|
|
1009
1009
|
}, _embind_register_optional: (e) => {
|
|
1010
|
-
ce(e,
|
|
1010
|
+
ce(e, kr);
|
|
1011
1011
|
}, _embind_register_std_string: (e, t) => {
|
|
1012
1012
|
t = Z(t), ce(e, { name: t, fromWireType: function(r) {
|
|
1013
|
-
for (var n = o[r >> 2], a = r + 4, u,
|
|
1013
|
+
for (var n = o[r >> 2], a = r + 4, u, h = a, p = 0; p <= n; ++p) {
|
|
1014
1014
|
var P = a + p;
|
|
1015
|
-
(p == n || g[P] == 0) && (
|
|
1015
|
+
(p == n || g[P] == 0) && (h = Ce(h, P - h), u === void 0 ? u = h : (u += "\0", u += h), h = P + 1);
|
|
1016
1016
|
}
|
|
1017
1017
|
return me(r), u;
|
|
1018
1018
|
}, toWireType: function(r, n) {
|
|
1019
1019
|
n instanceof ArrayBuffer && (n = new Uint8Array(n));
|
|
1020
1020
|
var a = typeof n == "string";
|
|
1021
|
-
if (!(a || ArrayBuffer.isView(n) && n.BYTES_PER_ELEMENT == 1)) throw new
|
|
1022
|
-
var u = a ? Je(n) : n.length,
|
|
1023
|
-
return o[
|
|
1021
|
+
if (!(a || ArrayBuffer.isView(n) && n.BYTES_PER_ELEMENT == 1)) throw new W("Cannot pass non-string to std::string");
|
|
1022
|
+
var u = a ? Je(n) : n.length, h = Vt(4 + u + 1), p = h + 4;
|
|
1023
|
+
return o[h >> 2] = u, a ? Ae(n, p, u + 1) : g.set(n, p), r !== null && r.push(me, h), h;
|
|
1024
1024
|
}, o: 8, readValueFromPointer: Be, s(r) {
|
|
1025
1025
|
me(r);
|
|
1026
1026
|
} });
|
|
1027
1027
|
}, _embind_register_std_wstring: (e, t, r) => {
|
|
1028
|
-
if (r = Z(r), t === 2) var n =
|
|
1029
|
-
else t === 4 && (n =
|
|
1028
|
+
if (r = Z(r), t === 2) var n = Cr, a = Ir, u = Pr, h = (p) => F[p >> 1];
|
|
1029
|
+
else t === 4 && (n = Ar, a = Or, u = Rr, h = (p) => o[p >> 2]);
|
|
1030
1030
|
ce(e, { name: r, fromWireType: (p) => {
|
|
1031
|
-
for (var P = o[p >> 2], O,
|
|
1031
|
+
for (var P = o[p >> 2], O, M = p + 4, B = 0; B <= P; ++B) {
|
|
1032
1032
|
var Y = p + 4 + B * t;
|
|
1033
|
-
(B == P ||
|
|
1033
|
+
(B == P || h(Y) == 0) && (M = n(M, Y - M), O === void 0 ? O = M : (O += "\0", O += M), M = Y + t);
|
|
1034
1034
|
}
|
|
1035
1035
|
return me(p), O;
|
|
1036
1036
|
}, toWireType: (p, P) => {
|
|
1037
|
-
if (typeof P != "string") throw new
|
|
1038
|
-
var O = u(P),
|
|
1039
|
-
return o[
|
|
1037
|
+
if (typeof P != "string") throw new W(`Cannot pass non-string to C++ string type ${r}`);
|
|
1038
|
+
var O = u(P), M = Vt(4 + O + t);
|
|
1039
|
+
return o[M >> 2] = O / t, a(P, M + 4, O + t), p !== null && p.push(me, M), M;
|
|
1040
1040
|
}, o: 8, readValueFromPointer: Be, s(p) {
|
|
1041
1041
|
me(p);
|
|
1042
1042
|
} });
|
|
@@ -1046,70 +1046,70 @@ ${E}`;
|
|
|
1046
1046
|
} });
|
|
1047
1047
|
}, _emscripten_runtime_keepalive_clear: () => {
|
|
1048
1048
|
Se = !1, Oe = 0;
|
|
1049
|
-
}, _emval_call: (e, t, r, n) => (e =
|
|
1050
|
-
t =
|
|
1049
|
+
}, _emval_call: (e, t, r, n) => (e = ct[e], t = at(t), e(null, t, r, n)), _emval_decref: ot, _emval_get_method_caller: (e, t, r) => {
|
|
1050
|
+
t = Fr(e, t);
|
|
1051
1051
|
var n = t.shift();
|
|
1052
1052
|
e--;
|
|
1053
1053
|
var a = `return function (obj, func, destructorsRef, args) {
|
|
1054
|
-
`, u = 0,
|
|
1055
|
-
r === 0 &&
|
|
1056
|
-
for (var p = ["retType"], P = [n], O = 0; O < e; ++O)
|
|
1054
|
+
`, u = 0, h = [];
|
|
1055
|
+
r === 0 && h.push("obj");
|
|
1056
|
+
for (var p = ["retType"], P = [n], O = 0; O < e; ++O) h.push(`arg${O}`), p.push(`argType${O}`), P.push(t[O]), a += ` var arg${O} = argType${O}.readValueFromPointer(args${u ? "+" + u : ""});
|
|
1057
1057
|
`, u += t[O].o;
|
|
1058
|
-
return a += ` var rv = ${r === 1 ? "new func" : "func.call"}(${
|
|
1059
|
-
`, n.W || (p.push("emval_returnValue"), P.push(
|
|
1058
|
+
return a += ` var rv = ${r === 1 ? "new func" : "func.call"}(${h.join(", ")});
|
|
1059
|
+
`, n.W || (p.push("emval_returnValue"), P.push(Lr), a += ` return emval_returnValue(retType, destructorsRef, rv);
|
|
1060
1060
|
`), e = new Function(...p, a + `};
|
|
1061
|
-
`)(...P), r = `methodCaller<(${t.map((
|
|
1061
|
+
`)(...P), r = `methodCaller<(${t.map((M) => M.name).join(", ")}) => ${n.name}>`, $r(Ge(r, e));
|
|
1062
1062
|
}, _emval_incref: (e) => {
|
|
1063
1063
|
9 < e && (ue[e + 1] += 1);
|
|
1064
1064
|
}, _emval_run_destructors: (e) => {
|
|
1065
|
-
var t =
|
|
1066
|
-
|
|
1067
|
-
}, _emval_take_value: (e, t) => (e =
|
|
1065
|
+
var t = at(e);
|
|
1066
|
+
tt(t), ot(e);
|
|
1067
|
+
}, _emval_take_value: (e, t) => (e = st(e, "_emval_take_value"), e = e.readValueFromPointer(t), Ve(e)), _setitimer_js: (e, t) => {
|
|
1068
1068
|
if (Re[e] && (clearTimeout(Re[e].id), delete Re[e]), !t) return 0;
|
|
1069
1069
|
var r = setTimeout(() => {
|
|
1070
|
-
|
|
1070
|
+
f(e in Re), delete Re[e], Nr(() => Dr(e, performance.now()));
|
|
1071
1071
|
}, t);
|
|
1072
1072
|
return Re[e] = { id: r, da: t }, 0;
|
|
1073
1073
|
}, _tzset_js: (e, t, r, n) => {
|
|
1074
1074
|
var a = (/* @__PURE__ */ new Date()).getFullYear(), u = new Date(a, 0, 1).getTimezoneOffset();
|
|
1075
|
-
a = new Date(a, 6, 1).getTimezoneOffset(), o[e >> 2] = 60 * Math.max(u, a), L[t >> 2] = +(u != a), t = (
|
|
1076
|
-
var p = Math.abs(
|
|
1077
|
-
return `UTC${0 <=
|
|
1078
|
-
}, e = t(u), t = t(a),
|
|
1075
|
+
a = new Date(a, 6, 1).getTimezoneOffset(), o[e >> 2] = 60 * Math.max(u, a), L[t >> 2] = +(u != a), t = (h) => {
|
|
1076
|
+
var p = Math.abs(h);
|
|
1077
|
+
return `UTC${0 <= h ? "-" : "+"}${String(Math.floor(p / 60)).padStart(2, "0")}${String(p % 60).padStart(2, "0")}`;
|
|
1078
|
+
}, e = t(u), t = t(a), f(e), f(t), f(16 >= Je(e), `timezone name truncated to fit in TZNAME_MAX (${e})`), f(16 >= Je(t), `timezone name truncated to fit in TZNAME_MAX (${t})`), a < u ? (Ae(e, r, 17), Ae(t, n, 17)) : (Ae(e, n, 17), Ae(t, r, 17));
|
|
1079
1079
|
}, clock_time_get: function(e, t, r) {
|
|
1080
1080
|
return 0 <= e && 3 >= e ? (U[r >> 3] = BigInt(Math.round(1e6 * (e === 0 ? Date.now() : performance.now()))), 0) : 28;
|
|
1081
1081
|
}, emscripten_resize_heap: (e) => {
|
|
1082
1082
|
var t = g.length;
|
|
1083
|
-
if (e >>>= 0,
|
|
1083
|
+
if (e >>>= 0, f(e > t), 2147483648 < e) return x(`Cannot enlarge memory, requested ${e} bytes, but the limit is ${2147483648} bytes!`), !1;
|
|
1084
1084
|
for (var r = 1; 4 >= r; r *= 2) {
|
|
1085
1085
|
var n = t * (1 + 0.2 / r);
|
|
1086
1086
|
n = Math.min(n, e + 100663296);
|
|
1087
1087
|
var a = Math, u = a.min;
|
|
1088
|
-
n = Math.max(e, n),
|
|
1088
|
+
n = Math.max(e, n), f(65536, "alignment argument is required"), a = u.call(a, 2147483648, 65536 * Math.ceil(n / 65536));
|
|
1089
1089
|
e: {
|
|
1090
|
-
u = a, n =
|
|
1091
|
-
var
|
|
1090
|
+
u = a, n = S.buffer;
|
|
1091
|
+
var h = (u - n.byteLength + 65535) / 65536 | 0;
|
|
1092
1092
|
try {
|
|
1093
|
-
|
|
1093
|
+
S.grow(h), re();
|
|
1094
1094
|
var p = 1;
|
|
1095
1095
|
break e;
|
|
1096
1096
|
} catch (P) {
|
|
1097
|
-
|
|
1097
|
+
x(`growMemory: Attempted to grow heap from ${n.byteLength} bytes to ${u} bytes, but got error: ${P}`);
|
|
1098
1098
|
}
|
|
1099
1099
|
p = void 0;
|
|
1100
1100
|
}
|
|
1101
1101
|
if (p) return !0;
|
|
1102
1102
|
}
|
|
1103
|
-
return
|
|
1103
|
+
return x(`Failed to grow the heap from ${t} bytes to ${a} bytes, not enough memory!`), !1;
|
|
1104
1104
|
}, environ_get: (e, t) => {
|
|
1105
1105
|
var r = 0, n = 0, a;
|
|
1106
|
-
for (a of
|
|
1106
|
+
for (a of Ht()) {
|
|
1107
1107
|
var u = t + r;
|
|
1108
1108
|
o[e + n >> 2] = u, r += Ae(a, u, 1 / 0) + 1, n += 4;
|
|
1109
1109
|
}
|
|
1110
1110
|
return 0;
|
|
1111
1111
|
}, environ_sizes_get: (e, t) => {
|
|
1112
|
-
var r =
|
|
1112
|
+
var r = Ht();
|
|
1113
1113
|
o[e >> 2] = r.length, e = 0;
|
|
1114
1114
|
for (var n of r) e += Je(n) + 1;
|
|
1115
1115
|
return o[t >> 2] = e, 0;
|
|
@@ -1119,138 +1119,143 @@ ${E}`;
|
|
|
1119
1119
|
return 70;
|
|
1120
1120
|
}, fd_write: (e, t, r, n) => {
|
|
1121
1121
|
for (var a = 0, u = 0; u < r; u++) {
|
|
1122
|
-
var
|
|
1122
|
+
var h = o[t >> 2], p = o[t + 4 >> 2];
|
|
1123
1123
|
t += 8;
|
|
1124
|
-
for (var P = 0; P < p; P++)
|
|
1124
|
+
for (var P = 0; P < p; P++) ht(e, g[h + P]);
|
|
1125
1125
|
a += p;
|
|
1126
1126
|
}
|
|
1127
1127
|
return o[n >> 2] = a, 0;
|
|
1128
|
-
}, proc_exit:
|
|
1128
|
+
}, proc_exit: Gt }, ee = await (async function() {
|
|
1129
1129
|
function e(u) {
|
|
1130
1130
|
u = ee = u.exports;
|
|
1131
|
-
var
|
|
1131
|
+
var h = {};
|
|
1132
1132
|
for (P in u) {
|
|
1133
1133
|
var p = u[P];
|
|
1134
|
-
|
|
1134
|
+
h[P] = typeof p == "function" ? wt(p) : p;
|
|
1135
1135
|
}
|
|
1136
|
-
if (ee =
|
|
1136
|
+
if (ee = h, S = ee.memory, f(S, "memory not found in wasm exports"), re(), be = ee.__indirect_function_table, f(be, "table not found in wasm exports"), cr(), te--, i.monitorRunDependencies?.(te), f(Q["wasm-instantiate"]), delete Q["wasm-instantiate"], te == 0 && (ne !== null && (clearInterval(ne), ne = null), X)) {
|
|
1137
1137
|
var P = X;
|
|
1138
1138
|
X = null, P();
|
|
1139
1139
|
}
|
|
1140
1140
|
return ee;
|
|
1141
1141
|
}
|
|
1142
1142
|
function t(u) {
|
|
1143
|
-
return
|
|
1143
|
+
return f(i === r, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"), r = null, e(u.instance);
|
|
1144
1144
|
}
|
|
1145
1145
|
Me();
|
|
1146
|
-
var r = i, n = { env:
|
|
1147
|
-
if (i.instantiateWasm) return new Promise((u,
|
|
1146
|
+
var r = i, n = { env: zt, wasi_snapshot_preview1: zt };
|
|
1147
|
+
if (i.instantiateWasm) return new Promise((u, h) => {
|
|
1148
1148
|
try {
|
|
1149
1149
|
i.instantiateWasm(n, (p, P) => {
|
|
1150
1150
|
u(e(p, P));
|
|
1151
1151
|
});
|
|
1152
1152
|
} catch (p) {
|
|
1153
|
-
|
|
1153
|
+
x(`Module.instantiateWasm callback failed with error: ${p}`), h(p);
|
|
1154
1154
|
}
|
|
1155
1155
|
});
|
|
1156
1156
|
Fe ??= i.locateFile ? i.locateFile ? i.locateFile("libavoid.wasm", $) : $ + "libavoid.wasm" : new URL("" + new URL("../libavoid.wasm?no-inline", import.meta.url).href, import.meta.url).href;
|
|
1157
1157
|
try {
|
|
1158
|
-
var a = await
|
|
1158
|
+
var a = await dr(n);
|
|
1159
1159
|
return t(a);
|
|
1160
1160
|
} catch (u) {
|
|
1161
|
-
return
|
|
1161
|
+
return I(u), Promise.reject(u);
|
|
1162
1162
|
}
|
|
1163
|
-
})(),
|
|
1164
|
-
function
|
|
1163
|
+
})(), Ur = ie("__getTypeName", 1), Vt = ie("malloc", 1), me = ie("free", 1), jr = ie("fflush", 1), Wr = ie("__funcs_on_exit", 0), Jt = ee.emscripten_stack_get_end, Dr = ie("_emscripten_timeout", 2), Gr = ee.__trap, Hr = ee.emscripten_stack_init, Br = ee._emscripten_stack_restore, Yt = ee._emscripten_stack_alloc, qt = ee.emscripten_stack_get_current, zr = ie("__cxa_decrement_exception_refcount", 1), Vr = ie("__cxa_increment_exception_refcount", 1), Jr = ie("__thrown_object_from_unwind_exception", 1), Yr = ie("__get_exception_message", 3), Kt;
|
|
1164
|
+
function ft() {
|
|
1165
1165
|
function e() {
|
|
1166
|
-
if (
|
|
1167
|
-
if (
|
|
1166
|
+
if (f(!Kt), Kt = !0, i.calledRun = !0, !w) {
|
|
1167
|
+
if (f(!A), A = !0, D(), ee.__wasm_call_ctors(), d(i), i.onRuntimeInitialized?.(), se("onRuntimeInitialized"), f(!i._main, 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'), D(), i.postRun) for (typeof i.postRun == "function" && (i.postRun = [i.postRun]); i.postRun.length; ) {
|
|
1168
1168
|
var t = i.postRun.shift();
|
|
1169
|
-
|
|
1169
|
+
_t.push(t);
|
|
1170
1170
|
}
|
|
1171
|
-
se("postRun"),
|
|
1171
|
+
se("postRun"), bt(_t);
|
|
1172
1172
|
}
|
|
1173
1173
|
}
|
|
1174
|
-
if (0 < te) X =
|
|
1174
|
+
if (0 < te) X = ft;
|
|
1175
1175
|
else {
|
|
1176
|
-
if (
|
|
1177
|
-
se("preRun"),
|
|
1176
|
+
if (Hr(), H(), i.preRun) for (typeof i.preRun == "function" && (i.preRun = [i.preRun]); i.preRun.length; ) hr();
|
|
1177
|
+
se("preRun"), bt(xt), 0 < te ? X = ft : (i.setStatus ? (i.setStatus("Running..."), setTimeout(() => {
|
|
1178
1178
|
setTimeout(() => i.setStatus(""), 1), e();
|
|
1179
1179
|
}, 1)) : e(), D());
|
|
1180
1180
|
}
|
|
1181
1181
|
}
|
|
1182
1182
|
if (i.preInit) for (typeof i.preInit == "function" && (i.preInit = [i.preInit]); 0 < i.preInit.length; ) i.preInit.shift()();
|
|
1183
|
-
se("preInit"),
|
|
1183
|
+
se("preInit"), ft(), b = _;
|
|
1184
1184
|
for (let e of Object.keys(i)) e in c || Object.defineProperty(c, e, { configurable: !0, get() {
|
|
1185
1185
|
J(`Access to module property ('${e}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`);
|
|
1186
1186
|
} });
|
|
1187
|
-
return
|
|
1187
|
+
return b;
|
|
1188
1188
|
};
|
|
1189
|
-
})(),
|
|
1190
|
-
let
|
|
1191
|
-
const
|
|
1192
|
-
async function
|
|
1193
|
-
const
|
|
1194
|
-
if (!Number.isFinite(
|
|
1189
|
+
})(), tn = en, Qt = Qr(tn), rn = "" + new URL("../libavoid.wasm?no-inline", import.meta.url).href;
|
|
1190
|
+
let er;
|
|
1191
|
+
const tr = { NORTH: 1, SOUTH: 2, WEST: 4, EAST: 8 }, Ee = ["NORTH", "EAST", "SOUTH", "WEST"], de = (s) => s.delete();
|
|
1192
|
+
async function Ke(s, c = {}) {
|
|
1193
|
+
const b = c.edgeClearance ?? 4;
|
|
1194
|
+
if (!Number.isFinite(b) || b < 0)
|
|
1195
1195
|
throw new Error("Graph edge clearance must be finite and nonnegative");
|
|
1196
|
+
if (c.routing === "none")
|
|
1197
|
+
return mt({
|
|
1198
|
+
...s,
|
|
1199
|
+
edges: s.edges.map((C) => ({ ...C, sections: [] }))
|
|
1200
|
+
});
|
|
1196
1201
|
if (!s.nodes.length) return s;
|
|
1197
|
-
if (!s.edges.length) return
|
|
1198
|
-
await (
|
|
1199
|
-
throw
|
|
1202
|
+
if (!s.edges.length) return mt(s);
|
|
1203
|
+
await (er ??= Qt.load(rn).catch((C) => {
|
|
1204
|
+
throw er = void 0, C;
|
|
1200
1205
|
}));
|
|
1201
|
-
const i =
|
|
1206
|
+
const i = Qt.getInstance(), d = new Map(s.nodes.map((C) => [C.id, C])), I = (C) => {
|
|
1202
1207
|
const l = [];
|
|
1203
|
-
for (let
|
|
1204
|
-
l.push(
|
|
1208
|
+
for (let x = d.get(C).parentId; x; x = d.get(x).parentId)
|
|
1209
|
+
l.push(x);
|
|
1205
1210
|
return l;
|
|
1206
|
-
},
|
|
1207
|
-
for (const
|
|
1208
|
-
const l = /* @__PURE__ */ new Set([...C
|
|
1209
|
-
k.edges.push(
|
|
1211
|
+
}, _ = /* @__PURE__ */ new Map();
|
|
1212
|
+
for (const C of s.edges) {
|
|
1213
|
+
const l = /* @__PURE__ */ new Set([...I(C.source), ...I(C.target)]), x = JSON.stringify([...l].sort()), k = _.get(x) ?? { open: l, edges: [] };
|
|
1214
|
+
k.edges.push(C), _.set(x, k);
|
|
1210
1215
|
}
|
|
1211
1216
|
const R = /* @__PURE__ */ new Map();
|
|
1212
|
-
for (const { open:
|
|
1213
|
-
const
|
|
1217
|
+
for (const { open: C, edges: l } of _.values()) {
|
|
1218
|
+
const x = new i.Router(2);
|
|
1214
1219
|
try {
|
|
1215
|
-
|
|
1220
|
+
x.setRoutingParameter(i.RoutingParameter.shapeBufferDistance, b), x.setRoutingParameter(i.RoutingParameter.idealNudgingDistance, 8), x.setRoutingParameter(i.RoutingParameter.crossingPenalty, 80), x.setRoutingParameter(i.RoutingParameter.fixedSharedPathPenalty, 120), x.setRoutingParameter(i.RoutingParameter.portDirectionPenalty, 0), x.setRoutingOption(
|
|
1216
1221
|
i.RoutingOption.nudgeOrthogonalSegmentsConnectedToShapes,
|
|
1217
1222
|
!l.some((o) => o.sourcePort || o.targetPort || o.source === o.target)
|
|
1218
|
-
),
|
|
1223
|
+
), x.setRoutingOption(i.RoutingOption.nudgeSharedPathsWithCommonEndPoint, !0);
|
|
1219
1224
|
const k = new Map(
|
|
1220
|
-
s.nodes.filter((o) => !
|
|
1221
|
-
const y = new i.Point(o.x, o.y), U = new i.Point(o.x + o.width, o.y + o.height), G = new i.Rectangle(y, U),
|
|
1222
|
-
return de(y), de(U), de(G), [o.id,
|
|
1225
|
+
s.nodes.filter((o) => !C.has(o.id) && I(o.id).every((y) => C.has(y))).map((o) => {
|
|
1226
|
+
const y = new i.Point(o.x, o.y), U = new i.Point(o.x + o.width, o.y + o.height), G = new i.Rectangle(y, U), T = new i.ShapeRef(x, G);
|
|
1227
|
+
return de(y), de(U), de(G), [o.id, T];
|
|
1223
1228
|
})
|
|
1224
|
-
),
|
|
1229
|
+
), S = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map();
|
|
1225
1230
|
for (const o of l) {
|
|
1226
|
-
const y = [o.source, o.target].sort().join("\0"), U =
|
|
1227
|
-
|
|
1231
|
+
const y = [o.source, o.target].sort().join("\0"), U = S.get(y) ?? 0;
|
|
1232
|
+
S.set(y, U + 1), w.set(o.id, U % 2 === 0 ? -6 : 6);
|
|
1228
1233
|
}
|
|
1229
1234
|
let v = Ee.length + 2;
|
|
1230
|
-
const
|
|
1235
|
+
const f = /* @__PURE__ */ new Map(), m = (o, y) => Math.max(0, Math.min(1, o / y));
|
|
1231
1236
|
for (const o of s.nodes) {
|
|
1232
1237
|
const y = k.get(o.id);
|
|
1233
1238
|
if (!y) continue;
|
|
1234
|
-
const U = (G,
|
|
1239
|
+
const U = (G, T, A, N, j) => {
|
|
1235
1240
|
const H = new i.ShapeConnectionPin(
|
|
1236
1241
|
y,
|
|
1237
1242
|
G,
|
|
1238
|
-
m(
|
|
1243
|
+
m(T, o.width),
|
|
1239
1244
|
m(A, o.height),
|
|
1240
1245
|
!0,
|
|
1241
1246
|
0,
|
|
1242
1247
|
N
|
|
1243
1248
|
);
|
|
1244
|
-
H.setExclusive(
|
|
1245
|
-
o.width / 2 + o.height / 2 - Math.abs(
|
|
1249
|
+
H.setExclusive(j), H.setConnectionCost(
|
|
1250
|
+
o.width / 2 + o.height / 2 - Math.abs(T - o.width / 2) - Math.abs(A - o.height / 2)
|
|
1246
1251
|
);
|
|
1247
1252
|
};
|
|
1248
|
-
for (const G of new Set(o.ports?.map((
|
|
1249
|
-
const { x, y: A } =
|
|
1250
|
-
U(N,
|
|
1253
|
+
for (const G of new Set(o.ports?.map((T) => T.side))) {
|
|
1254
|
+
const { x: T, y: A } = rr(o, G), N = Ee.indexOf(G) + 2;
|
|
1255
|
+
U(N, T - o.x, A - o.y, tr[G], !1), f.set(
|
|
1251
1256
|
JSON.stringify([
|
|
1252
1257
|
o.id,
|
|
1253
|
-
m(
|
|
1258
|
+
m(T - o.x, o.width),
|
|
1254
1259
|
m(A - o.y, o.height),
|
|
1255
1260
|
G
|
|
1256
1261
|
]),
|
|
@@ -1258,14 +1263,14 @@ async function pt(s, c = {}) {
|
|
|
1258
1263
|
);
|
|
1259
1264
|
}
|
|
1260
1265
|
}
|
|
1261
|
-
const g = s.nodes.filter((o) => k.has(o.id)),
|
|
1262
|
-
const N =
|
|
1266
|
+
const g = s.nodes.filter((o) => k.has(o.id)), E = (o, y, U, G, T, A = !1) => {
|
|
1267
|
+
const N = b + 8, j = {
|
|
1263
1268
|
left: Math.min(o.x, y.x) - N,
|
|
1264
1269
|
right: Math.max(o.x + o.width, y.x + y.width) + N,
|
|
1265
1270
|
top: Math.min(o.y, y.y) - N,
|
|
1266
1271
|
bottom: Math.max(o.y + o.height, y.y + y.height) + N
|
|
1267
1272
|
}, H = g.filter(
|
|
1268
|
-
(V) => V.x <=
|
|
1273
|
+
(V) => V.x <= j.right && V.x + V.width >= j.left && V.y <= j.bottom && V.y + V.height >= j.top
|
|
1269
1274
|
), D = k.get(o.id);
|
|
1270
1275
|
if (D && U)
|
|
1271
1276
|
return new i.ConnEnd(
|
|
@@ -1275,10 +1280,10 @@ async function pt(s, c = {}) {
|
|
|
1275
1280
|
const z = U ? [
|
|
1276
1281
|
{
|
|
1277
1282
|
side: o.ports.find((V) => V.id === U).side,
|
|
1278
|
-
position:
|
|
1283
|
+
position: rr(o, o.ports.find((V) => V.id === U).side)
|
|
1279
1284
|
}
|
|
1280
|
-
] :
|
|
1281
|
-
const he =
|
|
1285
|
+
] : T ? [{ side: "EAST", position: T }] : (A ? [nr(o, y).source] : Ee).flatMap((V) => {
|
|
1286
|
+
const he = nn(o, V, y, G);
|
|
1282
1287
|
if (A) return [{ side: V, position: he }];
|
|
1283
1288
|
const re = V === "NORTH" || V === "SOUTH", te = re ? o.x : o.y, X = re ? o.width : o.height, Q = te + Math.min(8, X / 4), ne = te + X - Math.min(8, X / 4), Me = [
|
|
1284
1289
|
re ? he.x : he.y,
|
|
@@ -1286,7 +1291,7 @@ async function pt(s, c = {}) {
|
|
|
1286
1291
|
ne,
|
|
1287
1292
|
...H.flatMap((J) => {
|
|
1288
1293
|
const fe = re ? J.x : J.y, ie = fe + (re ? J.width : J.height);
|
|
1289
|
-
return [fe -
|
|
1294
|
+
return [fe - b, ie + b, fe - b - 8, ie + b + 8];
|
|
1290
1295
|
}).filter((J) => J >= Q && J <= ne)
|
|
1291
1296
|
];
|
|
1292
1297
|
return [...new Set(Me)].map((J) => ({
|
|
@@ -1300,15 +1305,15 @@ async function pt(s, c = {}) {
|
|
|
1300
1305
|
m(Q.x - o.x, o.width),
|
|
1301
1306
|
m(Q.y - o.y, o.height),
|
|
1302
1307
|
X
|
|
1303
|
-
]), re = !!(U ||
|
|
1304
|
-
(X) =>
|
|
1305
|
-
) ?
|
|
1308
|
+
]), re = !!(U || T || A) || z.every(
|
|
1309
|
+
(X) => f.has(V(X.side, X.position))
|
|
1310
|
+
) ? f.get(V(z[0].side, z[0].position)) : void 0;
|
|
1306
1311
|
if (re !== void 0) return new i.ConnEnd(D, re);
|
|
1307
1312
|
const te = re ?? v++;
|
|
1308
1313
|
for (const { side: X, position: Q } of z) {
|
|
1309
1314
|
const ne = V(X, Q);
|
|
1310
|
-
if (
|
|
1311
|
-
|
|
1315
|
+
if (f.has(ne)) continue;
|
|
1316
|
+
f.set(ne, te);
|
|
1312
1317
|
const Me = Q.x - o.x, J = Q.y - o.y, fe = new i.ShapeConnectionPin(
|
|
1313
1318
|
D,
|
|
1314
1319
|
te,
|
|
@@ -1316,7 +1321,7 @@ async function pt(s, c = {}) {
|
|
|
1316
1321
|
m(J, o.height),
|
|
1317
1322
|
!0,
|
|
1318
1323
|
0,
|
|
1319
|
-
|
|
1324
|
+
tr[X]
|
|
1320
1325
|
);
|
|
1321
1326
|
fe.setExclusive(!1), fe.setConnectionCost(
|
|
1322
1327
|
o.width / 2 + o.height / 2 - Math.abs(Me - o.width / 2) - Math.abs(J - o.height / 2)
|
|
@@ -1324,17 +1329,17 @@ async function pt(s, c = {}) {
|
|
|
1324
1329
|
}
|
|
1325
1330
|
return new i.ConnEnd(D, te);
|
|
1326
1331
|
}
|
|
1327
|
-
const ae =
|
|
1332
|
+
const ae = nr(o, y).source, se = z.find((V) => V.side === ae)?.position ?? z[0].position, $e = new i.Point(se.x, se.y), Ne = new i.ConnEnd($e);
|
|
1328
1333
|
return de($e), Ne;
|
|
1329
|
-
}, F = (o) => +!!(o.sourcePort || o.targetPort || o.source === o.target ||
|
|
1330
|
-
const y =
|
|
1334
|
+
}, F = (o) => +!!(o.sourcePort || o.targetPort || o.source === o.target || S.get([o.source, o.target].sort().join("\0")) > 1), L = [...l].sort((o, y) => F(y) - F(o)).map((o) => {
|
|
1335
|
+
const y = d.get(o.source), U = d.get(o.target), G = o.source === o.target, T = S.get([o.source, o.target].sort().join("\0")) > 1, A = E(
|
|
1331
1336
|
y,
|
|
1332
1337
|
U,
|
|
1333
1338
|
o.sourcePort,
|
|
1334
1339
|
w.get(o.id),
|
|
1335
1340
|
G ? { x: y.x + y.width, y: y.y + y.height / 3 } : void 0,
|
|
1336
|
-
|
|
1337
|
-
), N =
|
|
1341
|
+
T
|
|
1342
|
+
), N = E(
|
|
1338
1343
|
U,
|
|
1339
1344
|
y,
|
|
1340
1345
|
o.targetPort,
|
|
@@ -1343,8 +1348,8 @@ async function pt(s, c = {}) {
|
|
|
1343
1348
|
x: U.x + U.width,
|
|
1344
1349
|
y: U.y + U.height * 2 / 3
|
|
1345
1350
|
} : void 0,
|
|
1346
|
-
|
|
1347
|
-
),
|
|
1351
|
+
T
|
|
1352
|
+
), j = new i.ConnRef(x, A, N);
|
|
1348
1353
|
if (de(A), de(N), G) {
|
|
1349
1354
|
const H = new i.CheckpointVector();
|
|
1350
1355
|
for (const D of [
|
|
@@ -1352,89 +1357,91 @@ async function pt(s, c = {}) {
|
|
|
1352
1357
|
y.y + y.height * 2 / 3
|
|
1353
1358
|
]) {
|
|
1354
1359
|
const z = new i.Point(
|
|
1355
|
-
y.x + y.width + Math.max(24,
|
|
1360
|
+
y.x + y.width + Math.max(24, b + 4),
|
|
1356
1361
|
D
|
|
1357
1362
|
), ae = new i.Checkpoint(z);
|
|
1358
1363
|
H.push_back(ae), de(z), de(ae);
|
|
1359
1364
|
}
|
|
1360
|
-
|
|
1365
|
+
j.setRoutingCheckpoints(H), de(H);
|
|
1361
1366
|
}
|
|
1362
|
-
return { edge: o, connection:
|
|
1367
|
+
return { edge: o, connection: j };
|
|
1363
1368
|
});
|
|
1364
|
-
|
|
1369
|
+
x.processTransaction();
|
|
1365
1370
|
for (const { edge: o, connection: y } of L) {
|
|
1366
|
-
const U = y.displayRoute(), G = Array.from({ length: U.size() }, (
|
|
1367
|
-
const N = U.at(A),
|
|
1368
|
-
return de(N),
|
|
1371
|
+
const U = y.displayRoute(), G = Array.from({ length: U.size() }, (T, A) => {
|
|
1372
|
+
const N = U.at(A), j = { x: N.x, y: N.y };
|
|
1373
|
+
return de(N), j;
|
|
1369
1374
|
});
|
|
1370
|
-
if (de(U), !y.hasValidRoute() || G.length < 2 || G.some((
|
|
1375
|
+
if (de(U), !y.hasValidRoute() || G.length < 2 || G.some((T) => !Number.isFinite(T.x) || !Number.isFinite(T.y)) || G.some((T, A) => A > 0 && T.x !== G[A - 1].x && T.y !== G[A - 1].y))
|
|
1371
1376
|
throw new Error(`Graph edge cannot be routed: ${o.id}`);
|
|
1372
1377
|
R.set(o.id, G);
|
|
1373
1378
|
}
|
|
1374
1379
|
} finally {
|
|
1375
|
-
|
|
1380
|
+
x.delete();
|
|
1376
1381
|
}
|
|
1377
1382
|
}
|
|
1378
|
-
const $ = s.edges.map((
|
|
1379
|
-
return
|
|
1383
|
+
const $ = s.edges.map((C) => ({ ...C, sections: [R.get(C.id)] }));
|
|
1384
|
+
return mt({
|
|
1380
1385
|
nodes: s.nodes,
|
|
1381
1386
|
edges: $,
|
|
1382
1387
|
bounds: s.bounds
|
|
1383
1388
|
});
|
|
1384
1389
|
}
|
|
1385
|
-
function
|
|
1390
|
+
function mt(s) {
|
|
1386
1391
|
const c = [
|
|
1387
|
-
...s.nodes.flatMap((
|
|
1388
|
-
{ x:
|
|
1389
|
-
{ x:
|
|
1392
|
+
...s.nodes.flatMap((d) => [
|
|
1393
|
+
{ x: d.x, y: d.y },
|
|
1394
|
+
{ x: d.x + d.width, y: d.y + d.height }
|
|
1390
1395
|
]),
|
|
1391
|
-
...s.edges.flatMap((
|
|
1392
|
-
]
|
|
1396
|
+
...s.edges.flatMap((d) => d.sections.flat())
|
|
1397
|
+
];
|
|
1398
|
+
if (!c.length) return { ...s, bounds: { x: 0, y: 0, width: 0, height: 0 } };
|
|
1399
|
+
const b = Math.min(...c.map((d) => d.x)), i = Math.min(...c.map((d) => d.y));
|
|
1393
1400
|
return {
|
|
1394
1401
|
nodes: s.nodes,
|
|
1395
1402
|
edges: s.edges,
|
|
1396
1403
|
bounds: {
|
|
1397
|
-
x:
|
|
1404
|
+
x: b,
|
|
1398
1405
|
y: i,
|
|
1399
|
-
width: Math.max(...c.map((
|
|
1400
|
-
height: Math.max(...c.map((
|
|
1406
|
+
width: Math.max(...c.map((d) => d.x)) - b,
|
|
1407
|
+
height: Math.max(...c.map((d) => d.y)) - i
|
|
1401
1408
|
}
|
|
1402
1409
|
};
|
|
1403
1410
|
}
|
|
1404
|
-
function
|
|
1411
|
+
function rr(s, c) {
|
|
1405
1412
|
return {
|
|
1406
1413
|
x: c === "WEST" ? s.x : c === "EAST" ? s.x + s.width : s.x + s.width / 2,
|
|
1407
1414
|
y: c === "NORTH" ? s.y : c === "SOUTH" ? s.y + s.height : s.y + s.height / 2
|
|
1408
1415
|
};
|
|
1409
1416
|
}
|
|
1410
|
-
function
|
|
1411
|
-
const
|
|
1417
|
+
function nr(s, c) {
|
|
1418
|
+
const b = (l, x) => x.x >= l.x && x.y >= l.y && x.x + x.width <= l.x + l.width && x.y + x.height <= l.y + l.height, i = b(s, c) ? s : b(c, s) ? c : void 0;
|
|
1412
1419
|
if (i) {
|
|
1413
|
-
const l = i === s ? c : s,
|
|
1420
|
+
const l = i === s ? c : s, x = {
|
|
1414
1421
|
NORTH: l.y - i.y,
|
|
1415
1422
|
EAST: i.x + i.width - l.x - l.width,
|
|
1416
1423
|
SOUTH: i.y + i.height - l.y - l.height,
|
|
1417
1424
|
WEST: l.x - i.x
|
|
1418
|
-
}, k = [...Ee].sort((
|
|
1425
|
+
}, k = [...Ee].sort((S, w) => x[S] - x[w])[0];
|
|
1419
1426
|
return { source: k, target: k };
|
|
1420
1427
|
}
|
|
1421
|
-
const
|
|
1428
|
+
const d = c.x + c.width / 2 - (s.x + s.width / 2), I = c.y + c.height / 2 - (s.y + s.height / 2), _ = Math.max(s.x - (c.x + c.width), c.x - (s.x + s.width), 0), R = Math.max(
|
|
1422
1429
|
s.y - (c.y + c.height),
|
|
1423
1430
|
c.y - (s.y + s.height),
|
|
1424
1431
|
0
|
|
1425
|
-
),
|
|
1426
|
-
return { source:
|
|
1432
|
+
), C = (R === 0 && _ > 0 ? !0 : _ === 0 && R > 0 ? !1 : _ === 0 && R === 0 ? Math.abs(d) >= Math.abs(I) : _ <= R) ? d >= 0 ? "EAST" : "WEST" : I >= 0 ? "SOUTH" : "NORTH";
|
|
1433
|
+
return { source: C, target: Ee[(Ee.indexOf(C) + 2) % 4] };
|
|
1427
1434
|
}
|
|
1428
|
-
function
|
|
1429
|
-
const
|
|
1430
|
-
const
|
|
1431
|
-
return
|
|
1432
|
-
}, R =
|
|
1435
|
+
function nn(s, c, b, i = 0) {
|
|
1436
|
+
const d = (C) => Math.min(8, C / 4), I = (C, l, x) => Math.max(l + d(x), Math.min(l + x - d(x), C)), _ = (C, l, x, k) => {
|
|
1437
|
+
const S = Math.max(C, x), w = Math.min(C + l, x + k);
|
|
1438
|
+
return S < w ? (S + w) / 2 + i : void 0;
|
|
1439
|
+
}, R = b.x + b.width / 2, $ = b.y + b.height / 2;
|
|
1433
1440
|
switch (c) {
|
|
1434
1441
|
case "NORTH":
|
|
1435
1442
|
return {
|
|
1436
|
-
x:
|
|
1437
|
-
|
|
1443
|
+
x: I(
|
|
1444
|
+
_(s.x, s.width, b.x, b.width) ?? R + i,
|
|
1438
1445
|
s.x,
|
|
1439
1446
|
s.width
|
|
1440
1447
|
),
|
|
@@ -1443,16 +1450,16 @@ function tn(s, c, S, i = 0) {
|
|
|
1443
1450
|
case "EAST":
|
|
1444
1451
|
return {
|
|
1445
1452
|
x: s.x + s.width,
|
|
1446
|
-
y:
|
|
1447
|
-
|
|
1453
|
+
y: I(
|
|
1454
|
+
_(s.y, s.height, b.y, b.height) ?? $ + i,
|
|
1448
1455
|
s.y,
|
|
1449
1456
|
s.height
|
|
1450
1457
|
)
|
|
1451
1458
|
};
|
|
1452
1459
|
case "SOUTH":
|
|
1453
1460
|
return {
|
|
1454
|
-
x:
|
|
1455
|
-
|
|
1461
|
+
x: I(
|
|
1462
|
+
_(s.x, s.width, b.x, b.width) ?? R + i,
|
|
1456
1463
|
s.x,
|
|
1457
1464
|
s.width
|
|
1458
1465
|
),
|
|
@@ -1461,156 +1468,156 @@ function tn(s, c, S, i = 0) {
|
|
|
1461
1468
|
case "WEST":
|
|
1462
1469
|
return {
|
|
1463
1470
|
x: s.x,
|
|
1464
|
-
y:
|
|
1465
|
-
|
|
1471
|
+
y: I(
|
|
1472
|
+
_(s.y, s.height, b.y, b.height) ?? $ + i,
|
|
1466
1473
|
s.y,
|
|
1467
1474
|
s.height
|
|
1468
1475
|
)
|
|
1469
1476
|
};
|
|
1470
1477
|
}
|
|
1471
1478
|
}
|
|
1472
|
-
function
|
|
1473
|
-
const
|
|
1474
|
-
let $ = 0,
|
|
1479
|
+
function or(s, c, b, i, d, I = { x: 0, y: 0 }) {
|
|
1480
|
+
const _ = c.flow === "row", R = c.maxPerLine ?? Math.max(1, s.length);
|
|
1481
|
+
let $ = 0, C = 0;
|
|
1475
1482
|
for (let l = 0; l < s.length; l += R) {
|
|
1476
|
-
const
|
|
1477
|
-
let k = 0,
|
|
1478
|
-
for (const w of
|
|
1479
|
-
|
|
1483
|
+
const x = s.slice(l, l + R);
|
|
1484
|
+
let k = 0, S = 0;
|
|
1485
|
+
for (const w of x)
|
|
1486
|
+
d(
|
|
1480
1487
|
w,
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
), k += (
|
|
1484
|
-
|
|
1488
|
+
I.x + b.left + (_ ? k : $) - w.x,
|
|
1489
|
+
I.y + b.top + (_ ? $ : k) - w.y
|
|
1490
|
+
), k += (_ ? w.width : w.height) + i, S = Math.max(S, _ ? w.height : w.width);
|
|
1491
|
+
C = Math.max(C, k - i), $ += S + i;
|
|
1485
1492
|
}
|
|
1486
1493
|
return $ = Math.max(0, $ - i), {
|
|
1487
|
-
width:
|
|
1488
|
-
height:
|
|
1494
|
+
width: b.left + (_ ? C : $) + b.right,
|
|
1495
|
+
height: b.top + (_ ? $ : C) + b.bottom
|
|
1489
1496
|
};
|
|
1490
1497
|
}
|
|
1491
|
-
function
|
|
1498
|
+
function ar(s, c, b) {
|
|
1492
1499
|
if (!c.positions?.length || c.positionMode === "compact")
|
|
1493
|
-
return c.edgeClearance === void 0 ? s :
|
|
1494
|
-
const i = new Map(s.nodes.map((l) => [l.id, { ...l }])),
|
|
1500
|
+
return c.routing !== "none" && c.edgeClearance === void 0 ? s : Ke(s, c);
|
|
1501
|
+
const i = new Map(s.nodes.map((l) => [l.id, { ...l }])), d = /* @__PURE__ */ new Map();
|
|
1495
1502
|
for (const l of c.positions) {
|
|
1496
|
-
if (!i.has(l.nodeId) ||
|
|
1503
|
+
if (!i.has(l.nodeId) || d.has(l.nodeId) || !Number.isFinite(l.x) || !Number.isFinite(l.y))
|
|
1497
1504
|
throw new Error(`Invalid graph position: ${l.nodeId}`);
|
|
1498
|
-
|
|
1505
|
+
d.set(l.nodeId, l);
|
|
1499
1506
|
}
|
|
1500
|
-
const
|
|
1507
|
+
const I = /* @__PURE__ */ new Map();
|
|
1501
1508
|
for (const l of i.values())
|
|
1502
1509
|
if (l.parentId) {
|
|
1503
|
-
const
|
|
1504
|
-
|
|
1510
|
+
const x = I.get(l.parentId) ?? [];
|
|
1511
|
+
x.push(l), I.set(l.parentId, x);
|
|
1505
1512
|
}
|
|
1506
|
-
const
|
|
1507
|
-
const
|
|
1508
|
-
l.x = w?.x ?? l.x +
|
|
1509
|
-
const v =
|
|
1510
|
-
for (const F of v)
|
|
1513
|
+
const _ = c.groupPadding ?? { top: 64, left: 28, right: 28, bottom: 28 }, R = c.positionMode === "preferred", $ = new Map(b.map((l) => [l.id, l])), C = (l, x, k) => {
|
|
1514
|
+
const S = { x: l.x, y: l.y }, w = d.get(l.id);
|
|
1515
|
+
l.x = w?.x ?? l.x + x, l.y = w?.y ?? l.y + k;
|
|
1516
|
+
const v = I.get(l.id) ?? [];
|
|
1517
|
+
for (const F of v) C(F, l.x - S.x, l.y - S.y);
|
|
1511
1518
|
if (!v.length || R) return;
|
|
1512
|
-
const
|
|
1513
|
-
if (w && (
|
|
1519
|
+
const f = Math.min(...v.map((F) => F.x)) - _.left, m = Math.min(...v.map((F) => F.y)) - _.top;
|
|
1520
|
+
if (w && (f < l.x || m < l.y))
|
|
1514
1521
|
throw new Error(`Pinned child lies outside group content: ${l.id}`);
|
|
1515
1522
|
const g = Math.max(
|
|
1516
1523
|
l.x + l.width,
|
|
1517
|
-
...v.map((F) => F.x + F.width +
|
|
1518
|
-
),
|
|
1524
|
+
...v.map((F) => F.x + F.width + _.right)
|
|
1525
|
+
), E = Math.max(
|
|
1519
1526
|
l.y + l.height,
|
|
1520
|
-
...v.map((F) => F.y + F.height +
|
|
1527
|
+
...v.map((F) => F.y + F.height + _.bottom)
|
|
1521
1528
|
);
|
|
1522
|
-
w || (l.x = Math.min(l.x,
|
|
1529
|
+
w || (l.x = Math.min(l.x, f), l.y = Math.min(l.y, m)), l.width = g - l.x, l.height = E - l.y;
|
|
1523
1530
|
};
|
|
1524
|
-
for (const l of i.values()) l.parentId ||
|
|
1531
|
+
for (const l of i.values()) l.parentId || C(l, 0, 0);
|
|
1525
1532
|
if (R) {
|
|
1526
|
-
const l = Math.max(16, c.spacing ?? 64),
|
|
1527
|
-
v.x +=
|
|
1528
|
-
for (const g of
|
|
1533
|
+
const l = Math.max(16, c.spacing ?? 64), x = (v, f, m) => {
|
|
1534
|
+
v.x += f, v.y += m;
|
|
1535
|
+
for (const g of I.get(v.id) ?? []) x(g, f, m);
|
|
1529
1536
|
}, k = (v) => {
|
|
1530
|
-
const
|
|
1537
|
+
const f = [];
|
|
1531
1538
|
for (const m of [...v].sort(
|
|
1532
|
-
(g,
|
|
1539
|
+
(g, E) => g.y - E.y || g.x - E.x || g.id.localeCompare(E.id)
|
|
1533
1540
|
)) {
|
|
1534
1541
|
const g = { x: m.x, y: m.y };
|
|
1535
|
-
for (const L of [...
|
|
1542
|
+
for (const L of [...f].sort((o, y) => o.x - y.x))
|
|
1536
1543
|
m.y < L.y + L.height + l && m.y + m.height + l > L.y && g.x < L.x + L.width + l && g.x + m.width + l > L.x && (g.x = L.x + L.width + l);
|
|
1537
|
-
const
|
|
1538
|
-
for (const L of [...
|
|
1539
|
-
m.x < L.x + L.width + l && m.x + m.width + l > L.x &&
|
|
1540
|
-
const F = g.x - m.x <
|
|
1541
|
-
|
|
1544
|
+
const E = { x: m.x, y: m.y };
|
|
1545
|
+
for (const L of [...f].sort((o, y) => o.y - y.y))
|
|
1546
|
+
m.x < L.x + L.width + l && m.x + m.width + l > L.x && E.y < L.y + L.height + l && E.y + m.height + l > L.y && (E.y = L.y + L.height + l);
|
|
1547
|
+
const F = g.x - m.x < E.y - m.y ? g : E;
|
|
1548
|
+
x(m, F.x - m.x, F.y - m.y), f.push(m);
|
|
1542
1549
|
}
|
|
1543
|
-
},
|
|
1544
|
-
const
|
|
1545
|
-
if (!
|
|
1546
|
-
for (const y of
|
|
1550
|
+
}, S = (v) => {
|
|
1551
|
+
const f = I.get(v.id) ?? [];
|
|
1552
|
+
if (!f.length) return;
|
|
1553
|
+
for (const y of f) S(y);
|
|
1547
1554
|
const m = c.groupLayouts?.[v.id];
|
|
1548
1555
|
if (m) {
|
|
1549
|
-
const y =
|
|
1550
|
-
|
|
1556
|
+
const y = or(
|
|
1557
|
+
f,
|
|
1551
1558
|
m,
|
|
1552
|
-
b,
|
|
1553
|
-
c.spacing ?? 64,
|
|
1554
1559
|
_,
|
|
1560
|
+
c.spacing ?? 64,
|
|
1561
|
+
x,
|
|
1555
1562
|
v
|
|
1556
1563
|
);
|
|
1557
1564
|
v.width = Math.max($.get(v.id).width, y.width), v.height = Math.max($.get(v.id).height, y.height);
|
|
1558
1565
|
return;
|
|
1559
1566
|
}
|
|
1560
|
-
k(
|
|
1561
|
-
const g = Math.max(12,
|
|
1562
|
-
v.x = Math.min(o?.x ?? 1 / 0, Math.min(...
|
|
1567
|
+
k(f);
|
|
1568
|
+
const g = Math.max(12, _.left), E = Math.max(12, _.top), F = Math.max(12, _.right), L = Math.max(12, _.bottom), o = d.get(v.id);
|
|
1569
|
+
v.x = Math.min(o?.x ?? 1 / 0, Math.min(...f.map((y) => y.x)) - g), v.y = Math.min(o?.y ?? 1 / 0, Math.min(...f.map((y) => y.y)) - E), v.width = Math.max(
|
|
1563
1570
|
$.get(v.id).width,
|
|
1564
|
-
Math.max(...
|
|
1571
|
+
Math.max(...f.map((y) => y.x + y.width)) + F - v.x
|
|
1565
1572
|
), v.height = Math.max(
|
|
1566
1573
|
$.get(v.id).height,
|
|
1567
|
-
Math.max(...
|
|
1574
|
+
Math.max(...f.map((y) => y.y + y.height)) + L - v.y
|
|
1568
1575
|
);
|
|
1569
1576
|
}, w = [...i.values()].filter((v) => !v.parentId);
|
|
1570
|
-
for (const v of w)
|
|
1577
|
+
for (const v of w) S(v);
|
|
1571
1578
|
k(w);
|
|
1572
1579
|
}
|
|
1573
|
-
return
|
|
1580
|
+
return Ke({ ...s, nodes: [...i.values()] }, c);
|
|
1574
1581
|
}
|
|
1575
|
-
async function
|
|
1576
|
-
const i = new Map(s.nodes.map((m) => [m.id, { ...m, x: 0, y: 0 }])),
|
|
1582
|
+
async function on(s, c, b) {
|
|
1583
|
+
const i = new Map(s.nodes.map((m) => [m.id, { ...m, x: 0, y: 0 }])), d = new Map(s.nodes.map((m, g) => [m.id, g])), I = /* @__PURE__ */ new Map();
|
|
1577
1584
|
for (const m of i.values()) {
|
|
1578
|
-
const g =
|
|
1579
|
-
g.push(m),
|
|
1585
|
+
const g = I.get(m.parentId) ?? [];
|
|
1586
|
+
g.push(m), I.set(m.parentId, g);
|
|
1580
1587
|
}
|
|
1581
|
-
const
|
|
1588
|
+
const _ = /* @__PURE__ */ new Set([
|
|
1582
1589
|
...s.nodes.flatMap((m) => [m.id, ...(m.ports ?? []).map((g) => g.id)]),
|
|
1583
1590
|
...s.edges.map((m) => m.id)
|
|
1584
1591
|
]);
|
|
1585
1592
|
let R = "$packed";
|
|
1586
|
-
for (;
|
|
1587
|
-
const $ = c.groupPadding ?? { top: 64, right: 28, bottom: 28, left: 28 },
|
|
1593
|
+
for (; _.has(R); ) R += "$";
|
|
1594
|
+
const $ = c.groupPadding ?? { top: 64, right: 28, bottom: 28, left: 28 }, C = c.direction ?? "RIGHT", l = new Map(
|
|
1588
1595
|
(c.positions ?? []).map((m) => [
|
|
1589
1596
|
m.nodeId,
|
|
1590
|
-
|
|
1597
|
+
C === "RIGHT" || C === "LEFT" ? m.y : m.x
|
|
1591
1598
|
])
|
|
1592
|
-
),
|
|
1593
|
-
m.x += g, m.y +=
|
|
1594
|
-
for (const F of
|
|
1599
|
+
), x = (m, g, E) => {
|
|
1600
|
+
m.x += g, m.y += E;
|
|
1601
|
+
for (const F of I.get(m.id) ?? []) x(F, g, E);
|
|
1595
1602
|
}, k = (m, g) => {
|
|
1596
|
-
let
|
|
1597
|
-
for (;
|
|
1598
|
-
|
|
1599
|
-
return
|
|
1600
|
-
},
|
|
1601
|
-
const g = [...
|
|
1602
|
-
!
|
|
1603
|
-
(o, y) => (l.get(o.id) ?? 1 / 0) - (l.get(y.id) ?? 1 / 0) ||
|
|
1603
|
+
let E = i.get(m);
|
|
1604
|
+
for (; E && E.parentId !== g; )
|
|
1605
|
+
E = E.parentId ? i.get(E.parentId) : void 0;
|
|
1606
|
+
return E;
|
|
1607
|
+
}, S = async (m) => {
|
|
1608
|
+
const g = [...I.get(m) ?? []], E = m === void 0 ? void 0 : c.groupLayouts?.[m];
|
|
1609
|
+
!E && (m !== void 0 || !c.layers) && g.sort(
|
|
1610
|
+
(o, y) => (l.get(o.id) ?? 1 / 0) - (l.get(y.id) ?? 1 / 0) || d.get(o.id) - d.get(y.id)
|
|
1604
1611
|
);
|
|
1605
1612
|
for (const o of g) {
|
|
1606
|
-
if (!
|
|
1607
|
-
const y = await
|
|
1613
|
+
if (!I.has(o.id)) continue;
|
|
1614
|
+
const y = await S(o.id);
|
|
1608
1615
|
o.width = Math.max(o.width, y.width), o.height = Math.max(o.height, y.height);
|
|
1609
1616
|
}
|
|
1610
1617
|
if (!g.length) return { width: 0, height: 0 };
|
|
1611
|
-
if (
|
|
1618
|
+
if (E) return or(g, E, $, c.spacing ?? 64, x);
|
|
1612
1619
|
if (m === void 0 && c.layers)
|
|
1613
|
-
return
|
|
1620
|
+
return an(g, s, c, k, x);
|
|
1614
1621
|
const F = /* @__PURE__ */ new Map();
|
|
1615
1622
|
for (const o of s.edges) {
|
|
1616
1623
|
const y = k(o.source, m), U = k(o.target, m);
|
|
@@ -1618,13 +1625,13 @@ async function rn(s, c, S) {
|
|
|
1618
1625
|
const G = JSON.stringify([y.id, U.id]);
|
|
1619
1626
|
F.has(G) || F.set(G, { id: o.id, sources: [y.id], targets: [U.id] });
|
|
1620
1627
|
}
|
|
1621
|
-
const L = await
|
|
1628
|
+
const L = await b.layout({
|
|
1622
1629
|
id: m ?? R,
|
|
1623
1630
|
children: g.map((o) => ({ id: o.id, width: o.width, height: o.height })),
|
|
1624
1631
|
edges: [...F.values()],
|
|
1625
1632
|
layoutOptions: {
|
|
1626
1633
|
"elk.algorithm": F.size ? "layered" : "rectpacking",
|
|
1627
|
-
"elk.direction":
|
|
1634
|
+
"elk.direction": C,
|
|
1628
1635
|
"elk.edgeRouting": "ORTHOGONAL",
|
|
1629
1636
|
"elk.separateConnectedComponents": "true",
|
|
1630
1637
|
...c.aspectRatio !== void 0 ? { "elk.aspectRatio": String(c.aspectRatio) } : {},
|
|
@@ -1638,168 +1645,170 @@ async function rn(s, c, S) {
|
|
|
1638
1645
|
});
|
|
1639
1646
|
for (const o of L.children ?? []) {
|
|
1640
1647
|
const y = i.get(o.id);
|
|
1641
|
-
|
|
1648
|
+
x(y, (o.x ?? 0) - y.x, (o.y ?? 0) - y.y);
|
|
1642
1649
|
}
|
|
1643
1650
|
return { width: L.width ?? 0, height: L.height ?? 0 };
|
|
1644
|
-
}, w = await
|
|
1651
|
+
}, w = await S(), v = (!c.positions?.length || c.positionMode === "compact" || c.layers) && c.anchor && i.get(c.anchor.nodeId);
|
|
1645
1652
|
if (v) {
|
|
1646
1653
|
const m = c.anchor.position.x - v.x, g = c.anchor.position.y - v.y;
|
|
1647
|
-
for (const
|
|
1654
|
+
for (const E of I.get(void 0) ?? []) x(E, m, g);
|
|
1648
1655
|
}
|
|
1649
|
-
const
|
|
1656
|
+
const f = {
|
|
1650
1657
|
nodes: [...i.values()],
|
|
1651
1658
|
edges: s.edges.map((m) => ({ ...m, sections: [] })),
|
|
1652
1659
|
bounds: { x: 0, y: 0, ...w }
|
|
1653
1660
|
};
|
|
1654
|
-
return c.positions?.length && c.positionMode !== "compact" && !c.layers ?
|
|
1661
|
+
return c.positions?.length && c.positionMode !== "compact" && !c.layers ? ar(f, c, s.nodes) : Ke(f, c);
|
|
1655
1662
|
}
|
|
1656
|
-
function
|
|
1657
|
-
const
|
|
1658
|
-
(
|
|
1659
|
-
), l = (
|
|
1660
|
-
for (const
|
|
1661
|
-
const A = i(
|
|
1663
|
+
function an(s, c, b, i, d) {
|
|
1664
|
+
const I = b.direction ?? "RIGHT", _ = I === "RIGHT" || I === "LEFT", R = I === "RIGHT" || I === "DOWN", $ = new Map(s.map((T, A) => [T.id, A])), C = new Map(
|
|
1665
|
+
(b.positions ?? []).filter((T) => $.has(T.nodeId)).map((T) => [T.nodeId, _ ? T.y : T.x])
|
|
1666
|
+
), l = (T, A) => $.get(T) - $.get(A) || T.localeCompare(A), x = (T, A) => (C.get(T) ?? 1 / 0) - (C.get(A) ?? 1 / 0) || l(T, A), k = new Map(s.map((T) => [T.id, /* @__PURE__ */ new Set()]));
|
|
1667
|
+
for (const T of c.edges) {
|
|
1668
|
+
const A = i(T.source, void 0)?.id, N = i(T.target, void 0)?.id;
|
|
1662
1669
|
A && N && A !== N && (k.get(A)?.add(N), k.get(N)?.add(A));
|
|
1663
1670
|
}
|
|
1664
|
-
const
|
|
1665
|
-
|
|
1666
|
-
const v = new Set(s.map((
|
|
1667
|
-
for (const
|
|
1668
|
-
if (!v.has(
|
|
1669
|
-
const A = [], N = [
|
|
1670
|
-
v.delete(
|
|
1671
|
-
for (let
|
|
1672
|
-
const H = N[
|
|
1671
|
+
const S = b.layers ?? [], w = /* @__PURE__ */ new Map();
|
|
1672
|
+
S.forEach((T, A) => T.forEach((N) => w.set(N, A)));
|
|
1673
|
+
const v = new Set(s.map((T) => T.id)), f = [];
|
|
1674
|
+
for (const T of [...v].sort(l)) {
|
|
1675
|
+
if (!v.has(T)) continue;
|
|
1676
|
+
const A = [], N = [T];
|
|
1677
|
+
v.delete(T);
|
|
1678
|
+
for (let j = 0; j < N.length; j++) {
|
|
1679
|
+
const H = N[j];
|
|
1673
1680
|
A.push(H);
|
|
1674
1681
|
for (const D of [...k.get(H)].sort(l))
|
|
1675
1682
|
v.delete(D) && N.push(D);
|
|
1676
1683
|
}
|
|
1677
|
-
|
|
1684
|
+
f.push(A);
|
|
1678
1685
|
}
|
|
1679
|
-
let m =
|
|
1680
|
-
for (const
|
|
1681
|
-
const A =
|
|
1686
|
+
let m = S.length;
|
|
1687
|
+
for (const T of f) {
|
|
1688
|
+
const A = T.filter((H) => w.has(H));
|
|
1682
1689
|
if (!A.length) {
|
|
1683
|
-
|
|
1690
|
+
T.sort(l).forEach((H) => w.set(H, m)), m++;
|
|
1684
1691
|
continue;
|
|
1685
1692
|
}
|
|
1686
|
-
const N = /* @__PURE__ */ new Map(),
|
|
1687
|
-
for (const H of
|
|
1688
|
-
for (let H = 0; H <
|
|
1689
|
-
const D =
|
|
1693
|
+
const N = /* @__PURE__ */ new Map(), j = [...A].sort((H, D) => w.get(H) - w.get(D) || l(H, D));
|
|
1694
|
+
for (const H of j) N.set(H, 0);
|
|
1695
|
+
for (let H = 0; H < j.length; H++) {
|
|
1696
|
+
const D = j[H];
|
|
1690
1697
|
for (const z of [...k.get(D)].sort(l))
|
|
1691
|
-
N.has(z) || (N.set(z, N.get(D) + 1), w.set(z, w.get(D)),
|
|
1698
|
+
N.has(z) || (N.set(z, N.get(D) + 1), w.set(z, w.get(D)), j.push(z));
|
|
1692
1699
|
}
|
|
1693
1700
|
}
|
|
1694
|
-
const g = Math.max(
|
|
1695
|
-
for (const
|
|
1696
|
-
for (const
|
|
1697
|
-
const F = (
|
|
1698
|
-
const N = new Map(
|
|
1701
|
+
const g = Math.max(S.length, m), E = Array.from({ length: g }, () => []);
|
|
1702
|
+
for (const T of s) E[w.get(T.id)].push(T);
|
|
1703
|
+
for (const T of E) T.sort((A, N) => x(A.id, N.id));
|
|
1704
|
+
const F = (T, A) => {
|
|
1705
|
+
const N = new Map(E[A].map((D, z) => [D.id, z])), j = new Map(E[T].map((D, z) => [D.id, z])), H = (D) => {
|
|
1699
1706
|
const z = [...k.get(D) ?? []].flatMap((ae) => {
|
|
1700
1707
|
const se = N.get(ae);
|
|
1701
1708
|
return w.get(ae) === A && se !== void 0 ? [se] : [];
|
|
1702
1709
|
});
|
|
1703
|
-
return z.length ? z.reduce((ae, se) => ae + se, 0) / z.length :
|
|
1710
|
+
return z.length ? z.reduce((ae, se) => ae + se, 0) / z.length : j.get(D);
|
|
1704
1711
|
};
|
|
1705
|
-
T
|
|
1712
|
+
E[T].sort((D, z) => H(D.id) - H(z.id) || x(D.id, z.id));
|
|
1706
1713
|
};
|
|
1707
|
-
for (let
|
|
1708
|
-
for (let
|
|
1709
|
-
const L =
|
|
1714
|
+
for (let T = 1; T < E.length; T++) F(T, T - 1);
|
|
1715
|
+
for (let T = E.length - 2; T >= 0; T--) F(T, T + 1);
|
|
1716
|
+
const L = b.spacing ?? 64;
|
|
1710
1717
|
let o = 0, y = 0;
|
|
1711
1718
|
const U = [], G = [];
|
|
1712
|
-
for (const
|
|
1719
|
+
for (const T of E) {
|
|
1713
1720
|
let A = 0;
|
|
1714
|
-
const N = Math.max(0, ...
|
|
1721
|
+
const N = Math.max(0, ...T.map((j) => _ ? j.width : j.height));
|
|
1715
1722
|
U.push(o), G.push(N);
|
|
1716
|
-
for (const
|
|
1717
|
-
const H = o + (N - (
|
|
1718
|
-
|
|
1723
|
+
for (const j of T) {
|
|
1724
|
+
const H = o + (N - (_ ? j.width : j.height)) / 2, D = _ ? H : A, z = _ ? A : H;
|
|
1725
|
+
d(j, D - j.x, z - j.y), A += (_ ? j.height : j.width) + L;
|
|
1719
1726
|
}
|
|
1720
1727
|
y = Math.max(y, Math.max(0, A - L)), o += N + L;
|
|
1721
1728
|
}
|
|
1722
1729
|
if (o = Math.max(0, o - L), !R)
|
|
1723
|
-
for (const
|
|
1724
|
-
const A = w.get(
|
|
1725
|
-
|
|
1730
|
+
for (const T of s) {
|
|
1731
|
+
const A = w.get(T.id), j = o - U[A] - G[A] + (G[A] - (_ ? T.width : T.height)) / 2;
|
|
1732
|
+
d(T, _ ? j - T.x : 0, _ ? 0 : j - T.y);
|
|
1726
1733
|
}
|
|
1727
|
-
return
|
|
1734
|
+
return _ ? { width: o, height: y } : { width: y, height: o };
|
|
1728
1735
|
}
|
|
1729
|
-
function
|
|
1730
|
-
const c = /* @__PURE__ */ new Set(),
|
|
1731
|
-
if (!
|
|
1732
|
-
c.add(
|
|
1733
|
-
}, i = new Map(s.nodes.map((
|
|
1734
|
-
for (const
|
|
1735
|
-
if (
|
|
1736
|
-
throw new Error(`Invalid dimensions for graph node: ${
|
|
1737
|
-
for (const R of
|
|
1738
|
-
const
|
|
1739
|
-
let
|
|
1740
|
-
for (;
|
|
1741
|
-
const R = i.get(
|
|
1736
|
+
function sr(s) {
|
|
1737
|
+
const c = /* @__PURE__ */ new Set(), b = (d) => {
|
|
1738
|
+
if (!d || c.has(d)) throw new Error(`Duplicate or empty graph ID: ${d}`);
|
|
1739
|
+
c.add(d);
|
|
1740
|
+
}, i = new Map(s.nodes.map((d) => [d.id, d]));
|
|
1741
|
+
for (const d of s.nodes) {
|
|
1742
|
+
if (b(d.id), ![d.width, d.height].every((R) => Number.isFinite(R) && R > 0))
|
|
1743
|
+
throw new Error(`Invalid dimensions for graph node: ${d.id}`);
|
|
1744
|
+
for (const R of d.ports ?? []) b(R.id);
|
|
1745
|
+
const I = /* @__PURE__ */ new Set([d.id]);
|
|
1746
|
+
let _ = d.parentId;
|
|
1747
|
+
for (; _ !== void 0; ) {
|
|
1748
|
+
const R = i.get(_);
|
|
1742
1749
|
if (!R || R.kind !== "group")
|
|
1743
|
-
throw new Error(`Invalid parent for graph node: ${
|
|
1744
|
-
if (
|
|
1745
|
-
|
|
1750
|
+
throw new Error(`Invalid parent for graph node: ${d.id}`);
|
|
1751
|
+
if (I.has(_)) throw new Error(`Cyclic graph containment: ${d.id}`);
|
|
1752
|
+
I.add(_), _ = R.parentId;
|
|
1746
1753
|
}
|
|
1747
1754
|
}
|
|
1748
|
-
for (const
|
|
1749
|
-
|
|
1750
|
-
for (const [
|
|
1751
|
-
[
|
|
1752
|
-
[
|
|
1755
|
+
for (const d of s.edges) {
|
|
1756
|
+
b(d.id);
|
|
1757
|
+
for (const [I, _] of [
|
|
1758
|
+
[d.source, d.sourcePort],
|
|
1759
|
+
[d.target, d.targetPort]
|
|
1753
1760
|
]) {
|
|
1754
|
-
const R = i.get(
|
|
1755
|
-
if (!R ||
|
|
1756
|
-
throw new Error(`Invalid endpoint for graph edge: ${
|
|
1761
|
+
const R = i.get(I);
|
|
1762
|
+
if (!R || _ !== void 0 && !R.ports?.some(($) => $.id === _))
|
|
1763
|
+
throw new Error(`Invalid endpoint for graph edge: ${d.id}`);
|
|
1757
1764
|
}
|
|
1758
1765
|
}
|
|
1759
1766
|
}
|
|
1760
|
-
async function
|
|
1761
|
-
if (
|
|
1767
|
+
async function sn(s, c, b) {
|
|
1768
|
+
if (sr(s), c.routing !== void 0 && !["all", "none"].includes(c.routing))
|
|
1769
|
+
throw new Error("Invalid graph routing mode");
|
|
1770
|
+
if (ln(s, c), c.edgeClearance !== void 0 && (!Number.isFinite(c.edgeClearance) || c.edgeClearance < 0))
|
|
1762
1771
|
throw new Error("Graph edge clearance must be finite and nonnegative");
|
|
1763
|
-
const i =
|
|
1772
|
+
const i = un(s, c);
|
|
1764
1773
|
if (c.aspectRatio !== void 0 && (!Number.isFinite(c.aspectRatio) || c.aspectRatio <= 0))
|
|
1765
1774
|
throw new Error("Graph layout aspect ratio must be finite and positive");
|
|
1766
|
-
const
|
|
1767
|
-
if (![...Object.values(
|
|
1775
|
+
const d = c.groupPadding ?? { top: 64, right: 28, bottom: 28, left: 28 };
|
|
1776
|
+
if (![...Object.values(d), c.spacing ?? 64].every((g) => Number.isFinite(g) && g >= 0))
|
|
1768
1777
|
throw new Error("Graph layout spacing must be finite and nonnegative");
|
|
1769
|
-
if (c.layers && (
|
|
1778
|
+
if (c.layers && (dn(s, c.layers), c.positionMode === "fixed" && c.positions?.length))
|
|
1770
1779
|
throw new Error("Fixed positions cannot be combined with graph layers");
|
|
1771
1780
|
if (c.aspectRatio !== void 0 || c.layers || Object.keys(c.groupLayouts ?? {}).length)
|
|
1772
|
-
return
|
|
1773
|
-
const
|
|
1781
|
+
return on(i, c, b);
|
|
1782
|
+
const I = /* @__PURE__ */ new Map();
|
|
1774
1783
|
for (const g of i.nodes)
|
|
1775
|
-
|
|
1784
|
+
I.set(g.id, {
|
|
1776
1785
|
id: g.id,
|
|
1777
1786
|
width: g.width,
|
|
1778
1787
|
height: g.height,
|
|
1779
1788
|
...g.kind === "group" ? { children: [] } : {},
|
|
1780
|
-
ports: g.ports?.map((
|
|
1781
|
-
id:
|
|
1789
|
+
ports: g.ports?.map((E) => ({
|
|
1790
|
+
id: E.id,
|
|
1782
1791
|
width: 1,
|
|
1783
1792
|
height: 1,
|
|
1784
|
-
layoutOptions: { "elk.port.side":
|
|
1793
|
+
layoutOptions: { "elk.port.side": E.side }
|
|
1785
1794
|
})),
|
|
1786
1795
|
layoutOptions: {
|
|
1787
1796
|
"elk.portConstraints": "FIXED_ORDER",
|
|
1788
|
-
"elk.padding": `[top=${
|
|
1797
|
+
"elk.padding": `[top=${d.top},left=${d.left},bottom=${d.bottom},right=${d.right}]`
|
|
1789
1798
|
}
|
|
1790
1799
|
});
|
|
1791
|
-
const
|
|
1800
|
+
const _ = [];
|
|
1792
1801
|
for (const g of i.nodes)
|
|
1793
|
-
(g.parentId ?
|
|
1802
|
+
(g.parentId ? I.get(g.parentId).children : _).push(I.get(g.id));
|
|
1794
1803
|
const R = /* @__PURE__ */ new Set([
|
|
1795
|
-
...i.nodes.flatMap((g) => [g.id, ...(g.ports ?? []).map((
|
|
1804
|
+
...i.nodes.flatMap((g) => [g.id, ...(g.ports ?? []).map((E) => E.id)]),
|
|
1796
1805
|
...i.edges.map((g) => g.id)
|
|
1797
1806
|
]);
|
|
1798
1807
|
let $ = "$graph";
|
|
1799
1808
|
for (; R.has($); ) $ += "$";
|
|
1800
|
-
const
|
|
1809
|
+
const C = await b.layout({
|
|
1801
1810
|
id: $,
|
|
1802
|
-
children:
|
|
1811
|
+
children: _,
|
|
1803
1812
|
edges: i.edges.map((g) => ({
|
|
1804
1813
|
id: g.id,
|
|
1805
1814
|
sources: [g.sourcePort ?? g.source],
|
|
@@ -1815,12 +1824,12 @@ async function an(s, c, S) {
|
|
|
1815
1824
|
"elk.layered.considerModelOrder.strategy": "NODES",
|
|
1816
1825
|
"elk.randomSeed": "1"
|
|
1817
1826
|
}
|
|
1818
|
-
}), l = /* @__PURE__ */ new Map(),
|
|
1819
|
-
for (const
|
|
1820
|
-
const F =
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
(
|
|
1827
|
+
}), l = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), k = (g) => {
|
|
1828
|
+
for (const E of g.edges ?? []) {
|
|
1829
|
+
const F = E.container ?? g.id, L = l.get(F) ?? { x: 0, y: 0 };
|
|
1830
|
+
x.set(
|
|
1831
|
+
E.id,
|
|
1832
|
+
(E.sections ?? []).map(
|
|
1824
1833
|
(o) => [o.startPoint, ...o.bendPoints ?? [], o.endPoint].map((y) => ({
|
|
1825
1834
|
x: y.x + L.x,
|
|
1826
1835
|
y: y.y + L.y
|
|
@@ -1828,73 +1837,86 @@ async function an(s, c, S) {
|
|
|
1828
1837
|
)
|
|
1829
1838
|
);
|
|
1830
1839
|
}
|
|
1831
|
-
for (const
|
|
1832
|
-
},
|
|
1833
|
-
const L =
|
|
1840
|
+
for (const E of g.children ?? []) k(E);
|
|
1841
|
+
}, S = (g, E, F) => {
|
|
1842
|
+
const L = E + (g.x ?? 0), o = F + (g.y ?? 0);
|
|
1834
1843
|
l.set(g.id, { x: L, y: o, width: g.width ?? 0, height: g.height ?? 0 });
|
|
1835
|
-
for (const y of g.children ?? [])
|
|
1844
|
+
for (const y of g.children ?? []) S(y, L, o);
|
|
1836
1845
|
};
|
|
1837
|
-
for (const g of
|
|
1838
|
-
k(
|
|
1839
|
-
const w = (!c.positions?.length || c.positionMode === "compact") && c.anchor && l.get(c.anchor.nodeId), v = w ? c.anchor.position.x - w.x : 0,
|
|
1840
|
-
const
|
|
1841
|
-
return { ...g, ...
|
|
1846
|
+
for (const g of C.children ?? []) S(g, 0, 0);
|
|
1847
|
+
k(C);
|
|
1848
|
+
const w = (!c.positions?.length || c.positionMode === "compact") && c.anchor && l.get(c.anchor.nodeId), v = w ? c.anchor.position.x - w.x : 0, f = w ? c.anchor.position.y - w.y : 0, m = i.nodes.map((g) => {
|
|
1849
|
+
const E = l.get(g.id);
|
|
1850
|
+
return { ...g, ...E, x: E.x + v, y: E.y + f };
|
|
1842
1851
|
});
|
|
1843
|
-
return
|
|
1852
|
+
return ar(
|
|
1844
1853
|
{
|
|
1845
1854
|
nodes: m,
|
|
1846
1855
|
edges: i.edges.map((g) => ({
|
|
1847
1856
|
...g,
|
|
1848
|
-
sections: (
|
|
1849
|
-
(
|
|
1857
|
+
sections: (x.get(g.id) ?? []).map(
|
|
1858
|
+
(E) => E.map((F) => ({ x: F.x + v, y: F.y + f }))
|
|
1850
1859
|
)
|
|
1851
1860
|
})),
|
|
1852
|
-
bounds: { x: v, y:
|
|
1861
|
+
bounds: { x: v, y: f, width: C.width ?? 0, height: C.height ?? 0 }
|
|
1853
1862
|
},
|
|
1854
1863
|
c,
|
|
1855
1864
|
i.nodes
|
|
1856
1865
|
);
|
|
1857
1866
|
}
|
|
1858
|
-
function
|
|
1867
|
+
async function cn(s, c, b = {}) {
|
|
1868
|
+
sr({ nodes: s.nodes, edges: c });
|
|
1869
|
+
for (const d of s.nodes)
|
|
1870
|
+
if (![d.x, d.y].every(Number.isFinite))
|
|
1871
|
+
throw new Error(`Invalid geometry for graph node: ${d.id}`);
|
|
1872
|
+
return (await Ke(
|
|
1873
|
+
{
|
|
1874
|
+
...s,
|
|
1875
|
+
edges: c.map((d) => ({ ...d, sections: [] }))
|
|
1876
|
+
},
|
|
1877
|
+
b
|
|
1878
|
+
)).edges;
|
|
1879
|
+
}
|
|
1880
|
+
function un(s, c) {
|
|
1859
1881
|
if (c.positionMode !== "compact" || !c.positions?.length) return s;
|
|
1860
|
-
const
|
|
1861
|
-
c.positions.map((
|
|
1862
|
-
|
|
1863
|
-
|
|
1882
|
+
const b = c.direction ?? "RIGHT", i = new Map(
|
|
1883
|
+
c.positions.map((_) => [
|
|
1884
|
+
_.nodeId,
|
|
1885
|
+
b === "RIGHT" || b === "LEFT" ? _.y : _.x
|
|
1864
1886
|
])
|
|
1865
|
-
),
|
|
1866
|
-
return { nodes: [...s.nodes].sort((
|
|
1867
|
-
const $ = (
|
|
1868
|
-
return $ ||
|
|
1887
|
+
), d = new Map(s.nodes.map((_, R) => [_.id, R]));
|
|
1888
|
+
return { nodes: [...s.nodes].sort((_, R) => {
|
|
1889
|
+
const $ = (_.parentId ?? "").localeCompare(R.parentId ?? ""), C = c.layers && !_.parentId && !R.parentId || _.parentId === R.parentId && _.parentId && c.groupLayouts?.[_.parentId] ? 0 : (i.get(_.id) ?? 1 / 0) - (i.get(R.id) ?? 1 / 0);
|
|
1890
|
+
return $ || C || d.get(_.id) - d.get(R.id);
|
|
1869
1891
|
}), edges: s.edges };
|
|
1870
1892
|
}
|
|
1871
|
-
function
|
|
1872
|
-
const
|
|
1873
|
-
for (const [i,
|
|
1874
|
-
if (
|
|
1893
|
+
function ln(s, c) {
|
|
1894
|
+
const b = new Map(s.nodes.map((i) => [i.id, i]));
|
|
1895
|
+
for (const [i, d] of Object.entries(c.groupLayouts ?? {}))
|
|
1896
|
+
if (b.get(i)?.kind !== "group" || !d || !["row", "column"].includes(d.flow) || d.maxPerLine !== void 0 && (!Number.isSafeInteger(d.maxPerLine) || d.maxPerLine <= 0))
|
|
1875
1897
|
throw new Error(`Invalid graph group layout: ${i}`);
|
|
1876
1898
|
if ((c.positionMode ?? "fixed") === "fixed") {
|
|
1877
1899
|
for (const i of c.positions ?? [])
|
|
1878
|
-
for (let
|
|
1879
|
-
if (c.groupLayouts?.[
|
|
1900
|
+
for (let d = b.get(i.nodeId)?.parentId; d; d = b.get(d)?.parentId)
|
|
1901
|
+
if (c.groupLayouts?.[d])
|
|
1880
1902
|
throw new Error(
|
|
1881
1903
|
`Fixed positions cannot constrain members of a graph group layout: ${i.nodeId}`
|
|
1882
1904
|
);
|
|
1883
1905
|
}
|
|
1884
1906
|
}
|
|
1885
|
-
function
|
|
1886
|
-
const
|
|
1887
|
-
for (const [
|
|
1888
|
-
if (!
|
|
1889
|
-
for (const
|
|
1890
|
-
const R =
|
|
1891
|
-
if (!R || R.parentId) throw new Error(`Graph layer object must be a root node: ${
|
|
1892
|
-
if (i.has(
|
|
1893
|
-
i.add(
|
|
1907
|
+
function dn(s, c) {
|
|
1908
|
+
const b = new Map(s.nodes.map((d) => [d.id, d])), i = /* @__PURE__ */ new Set();
|
|
1909
|
+
for (const [d, I] of c.entries()) {
|
|
1910
|
+
if (!I.length) throw new Error(`Graph layer must not be empty: ${d}`);
|
|
1911
|
+
for (const _ of I) {
|
|
1912
|
+
const R = b.get(_);
|
|
1913
|
+
if (!R || R.parentId) throw new Error(`Graph layer object must be a root node: ${_}`);
|
|
1914
|
+
if (i.has(_)) throw new Error(`Graph object appears in multiple layers: ${_}`);
|
|
1915
|
+
i.add(_);
|
|
1894
1916
|
}
|
|
1895
1917
|
}
|
|
1896
1918
|
}
|
|
1897
|
-
const
|
|
1919
|
+
const hn = new Zr({
|
|
1898
1920
|
workerFactory: () => {
|
|
1899
1921
|
const s = new Worker(new URL("elk-worker-CrDP6jPz.js", import.meta.url), { type: "module" });
|
|
1900
1922
|
return s.addEventListener("error", (c) => {
|
|
@@ -1904,19 +1926,27 @@ const ln = new Kr({
|
|
|
1904
1926
|
}), s;
|
|
1905
1927
|
}
|
|
1906
1928
|
});
|
|
1907
|
-
let
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1929
|
+
let ir = Promise.resolve();
|
|
1930
|
+
const yt = /* @__PURE__ */ new Map();
|
|
1931
|
+
self.onmessage = ({ data: s }) => {
|
|
1932
|
+
if ("cancel" in s) {
|
|
1933
|
+
const b = yt.get(s.id);
|
|
1934
|
+
b && (b.canceled = !0);
|
|
1935
|
+
return;
|
|
1936
|
+
}
|
|
1937
|
+
const c = { canceled: !1 };
|
|
1938
|
+
yt.set(s.id, c), ir = ir.then(async () => {
|
|
1912
1939
|
try {
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1940
|
+
if (c.canceled || (await new Promise((i) => setTimeout(i, 0)), c.canceled)) return;
|
|
1941
|
+
const b = s.kind === "route" ? { edges: await cn(s.geometry, s.edges, s.options) } : { layout: await sn(s.input, s.options, hn) };
|
|
1942
|
+
c.canceled || self.postMessage({ id: s.id, ...b });
|
|
1943
|
+
} catch (b) {
|
|
1944
|
+
c.canceled || self.postMessage({
|
|
1917
1945
|
id: s.id,
|
|
1918
|
-
error:
|
|
1946
|
+
error: b instanceof Error ? b.message : String(b)
|
|
1919
1947
|
});
|
|
1948
|
+
} finally {
|
|
1949
|
+
yt.delete(s.id);
|
|
1920
1950
|
}
|
|
1921
1951
|
});
|
|
1922
1952
|
};
|