@popcorn245/cornfield-components 0.52.0 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/around-BcnegEdS.js +99 -0
  3. package/dist/chunks/connection-KDiWvV19.js +23 -0
  4. package/dist/chunks/{engine-HIgX35hE.js → engine-xmHJvQY9.js} +1360 -1343
  5. package/dist/chunks/{layers-n1mJVJs8.js → layers-ho10a2y7.js} +68 -68
  6. package/dist/chunks/{map-CeP9M2_w.js → map-DbfPgQRe.js} +736 -705
  7. package/dist/chunks/node-panel-CC8UrSzJ.js +410 -0
  8. package/dist/chunks/panel-review-ih7RlfkH.js +884 -0
  9. package/dist/chunks/review-pieces-DtRxCDMr.js +2523 -0
  10. package/dist/chunks/{review-source-DWisOXyR.js → review-source-CmbwaPCM.js} +1 -1
  11. package/dist/chunks/scope-2m2VmJXn.js +185 -0
  12. package/dist/chunks/scope-proposal-T06ndbin.js +116 -0
  13. package/dist/chunks/sheets-BWANwtZP.js +209 -0
  14. package/dist/chunks/source-address-DXanAREm.js +57 -0
  15. package/dist/chunks/{status-CsFpnQxw.js → status-DM-iIEsg.js} +57 -56
  16. package/dist/corn-changes.js +43 -0
  17. package/dist/corn-decision.js +52 -0
  18. package/dist/corn-layers.js +275 -1
  19. package/dist/corn-map.js +125 -1
  20. package/dist/corn-node-panel.js +42 -1
  21. package/dist/corn-proposal.js +50 -0
  22. package/dist/corn-review.js +425 -1
  23. package/dist/corn-scope.js +33 -9
  24. package/dist/corn-search.js +484 -1
  25. package/dist/index.js +11 -8
  26. package/dist/manifest.json +95 -70
  27. package/dist/tokens.css +6 -0
  28. package/dist/types/components.d.ts +111 -5
  29. package/dist/types/corn-changes.d.ts +2 -0
  30. package/dist/types/corn-decision.d.ts +2 -0
  31. package/dist/types/corn-proposal.d.ts +2 -0
  32. package/dist/types/index.d.ts +3 -0
  33. package/dist/version.json +1 -1
  34. package/package.json +17 -5
  35. package/dist/chunks/around-D7aqHejs.js +0 -78
  36. package/dist/chunks/corn-layers-g9AprK6G.js +0 -275
  37. package/dist/chunks/corn-map-DE-pg-A0.js +0 -125
  38. package/dist/chunks/corn-node-panel-CdtFb9IZ.js +0 -42
  39. package/dist/chunks/corn-review-9krtLSPK.js +0 -2900
  40. package/dist/chunks/corn-search-BY1Po63S.js +0 -484
  41. package/dist/chunks/node-panel-CY5xnuKC.js +0 -1291
  42. package/dist/chunks/scope-CUhp8mkf.js +0 -137
  43. package/dist/chunks/sheets-TFCL_dIn.js +0 -204
  44. package/dist/chunks/source-address-C70zNPIj.js +0 -79
@@ -1,88 +1,96 @@
1
- import { $ as e, $t as t, A as n, An as r, At as i, C as a, Ct as o, E as s, G as c, H as l, Ht as u, J as d, Jt as f, K as p, Mt as m, O as h, Qt as g, S as _, Sn as v, Tn as y, Ut as b, V as x, W as S, Wt as C, X as w, Xt as T, Y as E, Yt as D, Zt as O, _ as k, b as A, bn as ee, c as j, d as M, en as N, f as P, g as F, gn as I, hn as te, i as L, j as R, jt as z, l as ne, m as B, n as V, p as H, q as U, qt as W, r as G, rt as K, sn as re, tn as q, u as ie, v as J, w as ae, wn as oe, xn as se } from "./engine-HIgX35hE.js";
2
- var Y = 96, ce = "letters:", le = (e) => `${ce}${e}`, ue = (e) => typeof e == "string" && e.startsWith(ce), de = (e) => e.slice(8), fe = (e, t) => !!e.letters && !e.icon && e.r * 2 * t >= 14, pe = /* @__PURE__ */ new Map();
3
- function me(e, t = null) {
1
+ import { $t as e, At as t, B as n, C as r, Cn as i, D as a, Dn as o, En as s, Et as c, G as l, Gt as u, H as d, I as f, Kt as p, L as m, M as h, Mn as g, Mt as _, Qt as v, Sn as y, St as b, T as x, U as S, V as C, W as w, Wt as T, Xt as E, Yt as D, Zt as O, _ as ee, _n as te, b as k, c as A, d as j, en as M, f as N, g as P, ht as F, i as I, j as L, jt as R, k as z, l as ne, ln as re, m as B, n as V, nn as H, p as U, r as W, rn as G, tn as ie, u as K, v as q, vn as ae, w as oe, wn as se, x as J, z as ce } from "./engine-xmHJvQY9.js";
2
+ var le = 96, ue = "letters:", de = (e) => `${ue}${e}`, fe = (e) => typeof e == "string" && e.startsWith(ue), pe = (e) => e.slice(8), me = (e, t) => !!e.letters && !e.icon && e.r * 2 * t >= 14, he = /* @__PURE__ */ new Map();
3
+ function ge(e, t = null) {
4
4
  if (typeof e != "string" || !e) return null;
5
5
  let n = `${typeof t == "string" ? t : ""}|${e}`;
6
- if (pe.has(n)) return pe.get(n);
7
- if (pe.size >= 128) return null;
6
+ if (he.has(n)) return he.get(n);
7
+ if (he.size >= 128) return null;
8
8
  let r = null;
9
9
  try {
10
- let n = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(Y, Y) : typeof document < "u" ? Object.assign(document.createElement("canvas"), {
11
- width: Y,
12
- height: Y
10
+ let n = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(le, le) : typeof document < "u" ? Object.assign(document.createElement("canvas"), {
11
+ width: le,
12
+ height: le
13
13
  }) : null, i = n && n.getContext && n.getContext("2d");
14
14
  if (i && i.fillText) {
15
- i.font = `700 ${e.length > 1 ? 56 : 72}px ${F}`, i.textAlign = "center", i.textBaseline = "middle", i.lineJoin = "round", i.lineWidth = 10;
16
- let a = typeof t == "string" ? t : l;
17
- i.strokeStyle = d(a) === "#ffffff" ? "rgba(11, 18, 32, 0.92)" : "rgba(255, 255, 255, 0.92)", i.strokeText(e, Y / 2, 51), i.fillStyle = a, i.fillText(e, Y / 2, 51), r = n;
15
+ i.font = `700 ${e.length > 1 ? 56 : 72}px ${P}`, i.textAlign = "center", i.textBaseline = "middle", i.lineJoin = "round", i.lineWidth = 10;
16
+ let a = typeof t == "string" ? t : m;
17
+ i.strokeStyle = S(a) === "#ffffff" ? "rgba(11, 18, 32, 0.92)" : "rgba(255, 255, 255, 0.92)", i.strokeText(e, le / 2, 51), i.fillStyle = a, i.fillText(e, le / 2, 51), r = n;
18
18
  }
19
19
  } catch {
20
20
  r = null;
21
21
  }
22
- return pe.set(n, r), r;
22
+ return he.set(n, r), r;
23
23
  }
24
24
  // ../explorer/renderer-canvas2d.js
25
- var he = Math.PI * 2, ge = 1.5, _e = (e, t, n, r) => {
26
- e.beginPath(), e.arc(t, n, r, 0, he);
25
+ var _e = Math.PI * 2, ve = 1.5, ye = /* @__PURE__ */ new Map();
26
+ function be(e) {
27
+ let t = ye.get(e);
28
+ return t === void 0 && (ye.size > 512 && ye.clear(), t = c(e)[3], ye.set(e, t)), t;
29
+ }
30
+ var Y = (e, t, n, r) => {
31
+ e.beginPath(), e.arc(t, n, r, 0, _e);
27
32
  };
28
- function ve(e, t, n, r, i) {
33
+ function xe(e, t, n, r, i, a = !1) {
34
+ let o = () => {
35
+ a || e.beginPath();
36
+ };
29
37
  if (t === "rounded-square" || t === "square") {
30
- let a = i * (t === "square" ? A.squareHalf : A.roundedHalf), o = i * (t === "square" ? A.squareCorner : A.roundedCorner);
31
- e.beginPath(), e.roundRect ? e.roundRect(n - a, r - a, a * 2, a * 2, o) : e.rect(n - a, r - a, a * 2, a * 2);
38
+ let a = i * (t === "square" ? J.squareHalf : J.roundedHalf), s = i * (t === "square" ? J.squareCorner : J.roundedCorner);
39
+ o(), e.roundRect ? e.roundRect(n - a, r - a, a * 2, a * 2, s) : e.rect(n - a, r - a, a * 2, a * 2);
32
40
  } else if (t === "hexagon") {
33
- let t = i * A.hexInradius / Math.cos(Math.PI / 6);
34
- e.beginPath();
41
+ let t = i * J.hexInradius / Math.cos(Math.PI / 6);
42
+ o();
35
43
  for (let i = 0; i < 6; i++) {
36
44
  let a = Math.PI / 6 + i * Math.PI / 3, o = n + t * Math.cos(a), s = r + t * Math.sin(a);
37
45
  i ? e.lineTo(o, s) : e.moveTo(o, s);
38
46
  }
39
47
  e.closePath();
40
48
  } else if (t === "diamond") {
41
- let t = i * A.diamondHalf;
42
- e.beginPath(), e.moveTo(n, r - t), e.lineTo(n + t, r), e.lineTo(n, r + t), e.lineTo(n - t, r), e.closePath();
43
- } else _e(e, n, r, i);
49
+ let t = i * J.diamondHalf;
50
+ o(), e.moveTo(n, r - t), e.lineTo(n + t, r), e.lineTo(n, r + t), e.lineTo(n - t, r), e.closePath();
51
+ } else a ? (e.moveTo(n + i, r), e.arc(n, r, i, 0, _e)) : Y(e, n, r, i);
44
52
  }
45
- function ye(e, t, n, r, i) {
53
+ function Se(e, t, n, r, i) {
46
54
  let a = -n.x / n.zoom - t.margin, o = (r - n.x) / n.zoom + t.margin, s = -n.y / n.zoom - t.margin, c = (i - n.y) / n.zoom + t.margin;
47
55
  e.beginPath(), e.strokeStyle = t.color, e.lineWidth = t.width;
48
56
  for (let n = Math.floor(a / t.size) * t.size; n < o; n += t.size) e.moveTo(n, s), e.lineTo(n, c);
49
57
  for (let n = Math.floor(s / t.size) * t.size; n < c; n += t.size) e.moveTo(a, n), e.lineTo(o, n);
50
58
  e.stroke();
51
59
  }
52
- function be(e, t) {
60
+ function Ce(e, t) {
53
61
  e.save(), t.forEach((t) => {
54
- e.lineWidth = t.width, e.setLineDash(t.dash), e.strokeStyle = t.color, _e(e, t.x, t.y, t.r), e.stroke();
62
+ e.lineWidth = t.width, e.setLineDash(t.dash), e.strokeStyle = t.color, Y(e, t.x, t.y, t.r), e.stroke();
55
63
  }), e.restore();
56
64
  }
57
- function xe(e, t) {
65
+ function we(e, t) {
58
66
  e.save(), t.forEach((t) => {
59
67
  e.fillStyle = t.fill, e.strokeStyle = t.stroke, e.lineWidth = t.strokeWidth, e.beginPath(), e.roundRect(t.x, t.y, t.w, t.h, t.radius), e.fill(), e.stroke();
60
68
  }), e.restore();
61
69
  }
62
- function Se(e, t, n, r, i = !0) {
63
- if (e.save(), e.globalAlpha = t.alpha, e.beginPath(), e.moveTo(t.x1, t.y1), t.curve ? e.quadraticCurveTo(t.curve.cx, t.curve.cy, t.x2, t.y2) : e.lineTo(t.x2, t.y2), e.strokeStyle = t.color, e.lineWidth = t.mark && t.mark !== "none" ? Math.max(t.width, J.edge / r) : t.width, e.setLineDash(t.dash || []), t.glow && t.glow * r >= ge) {
70
+ function Te(e, t, n, r, i = !0) {
71
+ if (e.save(), e.globalAlpha = t.alpha, e.beginPath(), e.moveTo(t.x1, t.y1), t.curve ? e.quadraticCurveTo(t.curve.cx, t.curve.cy, t.x2, t.y2) : e.lineTo(t.x2, t.y2), e.strokeStyle = t.color, e.lineWidth = t.mark && t.mark !== "none" ? Math.max(t.width, q.edge / r) : t.width, e.setLineDash(t.dash || []), t.glow && t.glow * r >= ve) {
64
72
  let n = e.lineWidth;
65
73
  e.save(), e.globalAlpha = t.alpha * .3, e.strokeStyle = t.glowColor || t.color, e.lineWidth = n + t.glow * .6, e.stroke(), e.restore();
66
74
  }
67
75
  if (e.stroke(), e.setLineDash([]), t.mark === "removed") {
68
- let n = ae(t, .5), i = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [a, o] = i > 0 ? [(t.x2 - t.x1) / i, (t.y2 - t.y1) / i] : [1, 0];
69
- e.beginPath(), e.moveTo(n.x - o * H.halfLength, n.y + a * H.halfLength), e.lineTo(n.x + o * H.halfLength, n.y - a * H.halfLength), e.lineWidth = Math.max(H.width, 1.5 / r), e.stroke();
76
+ let n = x(t, .5), i = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [a, o] = i > 0 ? [(t.x2 - t.x1) / i, (t.y2 - t.y1) / i] : [1, 0];
77
+ e.beginPath(), e.moveTo(n.x - o * U.halfLength, n.y + a * U.halfLength), e.lineTo(n.x + o * U.halfLength, n.y - a * U.halfLength), e.lineWidth = Math.max(U.width, 1.5 / r), e.stroke();
70
78
  }
71
- if (t.ticks && we(e, t, r), t.arrow) {
79
+ if (t.ticks && De(e, t, r), t.arrow) {
72
80
  let { cx: n, cy: i } = t.curve || {
73
81
  cx: t.x1,
74
82
  cy: t.y1
75
83
  };
76
- Ce(e, t, Math.atan2(t.y2 - i, t.x2 - n), r);
84
+ Ee(e, t, Math.atan2(t.y2 - i, t.x2 - n), r);
77
85
  }
78
- i && t.packet && Te(e, t, n, r), e.restore();
86
+ i && t.packet && Oe(e, t, n, r), e.restore();
79
87
  }
80
- function Ce(e, t, n, r) {
88
+ function Ee(e, t, n, r) {
81
89
  let i = t.end || "triangle", { x2: a, y2: o, color: s } = t, c = Math.cos(n), l = Math.sin(n), u = (e, t) => [a - c * e - l * t, o - l * e + c * t], d = Math.max(B.strokeWidth, 1.2 / r);
82
- if (e.beginPath(), i === "triangle") e.moveTo(a, o), e.lineTo(a - Math.cos(n - M.spread) * M.length, o - Math.sin(n - M.spread) * M.length), e.lineTo(a - Math.cos(n + M.spread) * M.length, o - Math.sin(n + M.spread) * M.length), e.closePath(), e.fillStyle = s, e.fill();
90
+ if (e.beginPath(), i === "triangle") e.moveTo(a, o), e.lineTo(a - Math.cos(n - j.spread) * j.length, o - Math.sin(n - j.spread) * j.length), e.lineTo(a - Math.cos(n + j.spread) * j.length, o - Math.sin(n + j.spread) * j.length), e.closePath(), e.fillStyle = s, e.fill();
83
91
  else {
84
92
  if (e.strokeStyle = s, e.lineWidth = d, e.lineJoin = "miter", i === "chevron") {
85
- let t = M.length * Math.cos(M.spread), n = M.length * Math.sin(M.spread);
93
+ let t = j.length * Math.cos(j.spread), n = j.length * Math.sin(j.spread);
86
94
  e.moveTo(...u(t, n)), e.lineTo(a, o), e.lineTo(...u(t, -n));
87
95
  } else if (i === "bar") e.moveTo(...u(d / 2, B.barHalf)), e.lineTo(...u(d / 2, -B.barHalf));
88
96
  else {
@@ -92,8 +100,8 @@ function Ce(e, t, n, r) {
92
100
  e.stroke();
93
101
  }
94
102
  }
95
- function we(e, t, n) {
96
- let r = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [i, a] = r > 0 ? [(t.x2 - t.x1) / r, (t.y2 - t.y1) / r] : [1, 0], o = ae(t, .5);
103
+ function De(e, t, n) {
104
+ let r = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [i, a] = r > 0 ? [(t.x2 - t.x1) / r, (t.y2 - t.y1) / r] : [1, 0], o = x(t, .5);
97
105
  e.beginPath();
98
106
  for (let n = 0; n < t.ticks; n++) {
99
107
  let r = (n - (t.ticks - 1) / 2) * B.tickGap, s = o.x + i * r, c = o.y + a * r;
@@ -101,104 +109,116 @@ function we(e, t, n) {
101
109
  }
102
110
  e.strokeStyle = t.color, e.lineWidth = Math.max(B.tickWidth, 1.5 / n), e.setLineDash([]), e.stroke();
103
111
  }
104
- function Te(e, t, n, r) {
105
- let i = R(t, n), { packet: a } = t;
106
- a.glow && a.glow * r >= ge && (e.beginPath(), e.arc(i.x, i.y, a.radius + a.glow * .5, 0, he), e.globalAlpha = t.alpha * .3, e.fillStyle = a.glowColor || a.color, e.fill(), e.globalAlpha = t.alpha), e.beginPath(), e.arc(i.x, i.y, a.radius, 0, he), e.fillStyle = a.color, e.fill();
112
+ function Oe(e, t, n, r) {
113
+ let i = h(t, n), { packet: a } = t;
114
+ a.glow && a.glow * r >= ve && (e.beginPath(), e.arc(i.x, i.y, a.radius + a.glow * .5, 0, _e), e.globalAlpha = t.alpha * .3, e.fillStyle = a.glowColor || a.color, e.fill(), e.globalAlpha = t.alpha), e.beginPath(), e.arc(i.x, i.y, a.radius, 0, _e), e.fillStyle = a.color, e.fill();
107
115
  }
108
- function Ee(e, t, n, r) {
109
- e.save(), e.globalAlpha = t.alpha, Te(e, t, n, r), e.restore();
116
+ function ke(e, t, n, r) {
117
+ e.save(), e.globalAlpha = t.alpha, Oe(e, t, n, r), e.restore();
110
118
  }
111
- var De = 16, Oe = /* @__PURE__ */ new WeakMap();
112
- function ke(e) {
113
- let t = Oe.get(e);
119
+ var Ae = 16, je = /* @__PURE__ */ new WeakMap();
120
+ function Me(e) {
121
+ let t = je.get(e);
114
122
  return t || (t = new Float64Array(e.edges.length * 4), e.edges.forEach((e, n) => {
115
- let r = e.curve ? e.curve.cx : e.x1, i = e.curve ? e.curve.cy : e.y1, a = (e.glow || 0) * .6 + (e.packet ? e.packet.radius + (e.packet.glow || 0) * .5 : 0), o = (e.width || 0) / 2 + a + De;
123
+ let r = e.curve ? e.curve.cx : e.x1, i = e.curve ? e.curve.cy : e.y1, a = (e.glow || 0) * .6 + (e.packet ? e.packet.radius + (e.packet.glow || 0) * .5 : 0), o = (e.width || 0) / 2 + a + Ae;
116
124
  t[n * 4] = Math.min(e.x1, e.x2, r) - o, t[n * 4 + 1] = Math.min(e.y1, e.y2, i) - o, t[n * 4 + 2] = Math.max(e.x1, e.x2, r) + o, t[n * 4 + 3] = Math.max(e.y1, e.y2, i) + o;
117
- }), Oe.set(e, t)), t;
125
+ }), je.set(e, t)), t;
118
126
  }
119
- function Ae(e, t, n, r) {
120
- let i = ke(e), a = t.zoom || 1, o = 4 / a, s = -t.x / a - o, c = -t.y / a - o, l = (n - t.x) / a + o, u = (r - t.y) / a + o, d = [];
127
+ function Ne(e, t, n, r) {
128
+ let i = Me(e), a = t.zoom || 1, o = 4 / a, s = -t.x / a - o, c = -t.y / a - o, l = (n - t.x) / a + o, u = (r - t.y) / a + o, d = [];
121
129
  for (let t = 0; t < e.edges.length; t++) i[t * 4 + 2] < s || i[t * 4] > l || i[t * 4 + 3] < c || i[t * 4 + 1] > u || d.push(e.edges[t]);
122
130
  return d;
123
131
  }
124
- function je(e, t, n, r, i) {
132
+ function Pe(e, t, r, i, a, o) {
125
133
  e.save(), e.globalAlpha = t.alpha;
126
- let a = r.halo[t.halo];
127
- a && (a.fill && (_e(e, t.x, t.y, t.r + a.fillR), e.fillStyle = a.fill, e.fill()), _e(e, t.x, t.y, t.r + a.ringR), e.strokeStyle = a.ring, e.lineWidth = a.ringWidth, e.stroke());
128
- let o = r.mark[t.mark];
129
- if (o) {
130
- let r = t.r + Math.max(o.ringR, J.gap / n);
131
- _e(e, t.x, t.y, r), e.strokeStyle = o.color, e.lineWidth = Math.max(o.ringWidth, J.ring / n), e.setLineDash(o.ringDash || []), e.stroke(), e.setLineDash([]), t.mark === "removed" && (e.beginPath(), e.moveTo(t.x - r, t.y), e.lineTo(t.x + r, t.y), e.stroke());
132
- }
133
- ve(e, t.shape, t.x, t.y, t.r), t.glow && t.glow * n >= ge && (e.save(), e.globalAlpha = t.alpha * .28, _e(e, t.x, t.y, t.r + t.glow * .7), e.fillStyle = t.color, e.fill(), e.restore(), ve(e, t.shape, t.x, t.y, t.r)), e.fillStyle = t.color, e.fill();
134
- let s = t.icon && i.icons ? i.icons.get(t.icon) : null, l = !s && fe(t, n), u = !s && !l && w(t, n) ? S(t.glyph, c(t, i)) : null;
135
- if (u || (_e(e, t.x, t.y, t.r * P), e.fillStyle = r.core, e.fill()), t.stroke && (ve(e, t.shape, t.x, t.y, Math.max(0, t.r - t.stroke.width / 2)), e.strokeStyle = t.stroke.color, e.lineWidth = t.stroke.width, e.stroke()), s) {
136
- let n = t.r * G;
137
- e.imageSmoothingEnabled = !i.pixelated, e.drawImage(s, t.x - n / 2, t.y - n / 2, n, n);
138
- } else if (l) {
139
- let n = me(t.letters, i.values && i.values["--corn-map-glyph"]);
134
+ let s = i.halo[t.halo];
135
+ s && (s.fill && (Y(e, t.x, t.y, t.r + s.fillR), e.fillStyle = s.fill, e.fill()), Y(e, t.x, t.y, t.r + s.ringR), e.strokeStyle = s.ring, e.lineWidth = s.ringWidth, e.stroke());
136
+ let c = i.mark[t.mark];
137
+ if (c) {
138
+ let n = t.r + Math.max(c.ringR, q.gap / r);
139
+ Y(e, t.x, t.y, n), e.strokeStyle = c.color, e.lineWidth = Math.max(c.ringWidth, q.ring / r), e.setLineDash(c.ringDash || []), e.stroke(), e.setLineDash([]), t.mark === "removed" && (e.beginPath(), e.moveTo(t.x - n, t.y), e.lineTo(t.x + n, t.y), e.stroke());
140
+ }
141
+ if (xe(e, t.shape, t.x, t.y, t.r), t.glow && t.glow * r >= ve) {
142
+ e.save(), e.globalAlpha = t.alpha * .28;
143
+ let n = t.r + t.glow * .7;
144
+ if (e.fillStyle = t.color, be(t.color) < 1) {
145
+ if (t.r * (k[t.shape] || 1) < n) Y(e, t.x, t.y, n), xe(e, t.shape, t.x, t.y, t.r, !0), e.fill("evenodd");
146
+ else {
147
+ let r = n + t.r;
148
+ e.beginPath(), e.rect(t.x - r, t.y - r, r * 2, r * 2), xe(e, t.shape, t.x, t.y, t.r, !0), e.clip("evenodd"), Y(e, t.x, t.y, n), e.fill();
149
+ }
150
+ } else Y(e, t.x, t.y, n), e.fill();
151
+ e.restore(), xe(e, t.shape, t.x, t.y, t.r);
152
+ }
153
+ e.fillStyle = t.color, e.fill();
154
+ let u = t.icon && a.icons ? a.icons.get(t.icon) : null, d = !u && me(t, r), p = !u && !d && l(t, r) ? ce(t.glyph, n(t, a, o)) : null;
155
+ if (p || (Y(e, t.x, t.y, t.r * N), e.fillStyle = i.core, e.fill()), t.stroke && (xe(e, t.shape, t.x, t.y, Math.max(0, t.r - t.stroke.width / 2)), e.strokeStyle = t.stroke.color, e.lineWidth = t.stroke.width, e.stroke()), u) {
156
+ let n = t.r * W;
157
+ e.imageSmoothingEnabled = !a.pixelated, e.drawImage(u, t.x - n / 2, t.y - n / 2, n, n);
158
+ } else if (d) {
159
+ let n = ge(t.letters, a.values && a.values["--corn-map-glyph"]);
140
160
  if (n) {
141
161
  let r = t.r * 1;
142
162
  e.imageSmoothingEnabled = !0, e.drawImage(n, t.x - r / 2, t.y - r / 2, r, r);
143
163
  }
144
- } else if (u) {
145
- let n = t.r * x;
146
- e.imageSmoothingEnabled = !0, e.drawImage(u, t.x - n / 2, t.y - n / 2, n, n);
164
+ } else if (p) {
165
+ let n = t.r * f;
166
+ e.imageSmoothingEnabled = !0, e.drawImage(p, t.x - n / 2, t.y - n / 2, n, n);
147
167
  }
148
168
  e.restore();
149
169
  }
150
- function Me(e, t = {}) {
151
- let r = t.mapStyle || (() => L), i = e.getContext("2d"), a = 0, o = 0, s = 1, c = null, l = null, u = null, d = () => {
152
- if (c) return c;
170
+ function Fe(e, t = {}) {
171
+ let n = t.mapStyle || (() => I), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c = null, l = null, u = () => {
172
+ if (s) return s;
153
173
  try {
154
- c = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(e.width || 1, e.height || 1) : e.ownerDocument ? e.ownerDocument.createElement("canvas") : null, l = c && c.getContext ? c.getContext("2d") : null;
174
+ s = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(e.width || 1, e.height || 1) : e.ownerDocument ? e.ownerDocument.createElement("canvas") : null, c = s && s.getContext ? s.getContext("2d") : null;
155
175
  } catch {
156
- l = null;
176
+ c = null;
157
177
  }
158
- return l || (c = null), c;
159
- }, f = t.layerMinEdges ?? 600, p = /* @__PURE__ */ new WeakMap(), m = (e) => (p.has(e) || p.set(e, e.edges.some((e) => e.packet)), p.get(e));
160
- function h(e, t, n) {
178
+ return c || (s = null), s;
179
+ }, d = t.layerMinEdges ?? 600, f = /* @__PURE__ */ new WeakMap(), p = (e) => (f.has(e) || f.set(e, e.edges.some((e) => e.packet)), f.get(e));
180
+ function m(e, t, n) {
161
181
  e.save(), e.translate(n.x, n.y), e.scale(n.zoom, n.zoom);
162
182
  let { decor: r } = t;
163
- r.grid && ye(e, r.grid, n, a, o), r.lanes.length && xe(e, r.lanes), r.rings.length && be(e, r.rings), Ae(t, n, a, o).forEach((t) => Se(e, t, 0, n.zoom, !1)), e.restore();
183
+ r.grid && Se(e, r.grid, n, i, a), r.lanes.length && we(e, r.lanes), r.rings.length && Ce(e, r.rings), Ne(t, n, i, a).forEach((t) => Te(e, t, 0, n.zoom, !1)), e.restore();
164
184
  }
165
185
  return {
166
186
  kind: "canvas2d",
167
- resize(t, n, r) {
168
- a = t, o = n, s = r, e.width = t * r, e.height = n * r, i.setTransform(r, 0, 0, r, 0, 0), u = null, c && (c.width = e.width, c.height = e.height, l.setTransform(r, 0, 0, r, 0, 0));
187
+ resize(t, n, u) {
188
+ i = t, a = n, o = u, e.width = t * u, e.height = n * u, r.setTransform(u, 0, 0, u, 0, 0), l = null, s && (s.width = e.width, s.height = e.height, c.setTransform(u, 0, 0, u, 0, 0));
169
189
  },
170
- draw(t, p, g) {
171
- let _ = r(), v = ie(t, _);
172
- i.clearRect(0, 0, a, o);
173
- let y = j(n(v.theme), _), b = Ae(v, p, a, o);
174
- if (m(v) && b.length > f && d()) {
175
- u && u.scene === v && u.x === p.x && u.y === p.y && u.zoom === p.zoom && u.w === e.width && u.h === e.height || ((c.width !== e.width || c.height !== e.height) && (c.width = e.width, c.height = e.height), l.setTransform(s, 0, 0, s, 0, 0), l.clearRect(0, 0, a, o), h(l, v, p), u = {
176
- scene: v,
177
- x: p.x,
178
- y: p.y,
179
- zoom: p.zoom,
190
+ draw(t, f, h) {
191
+ let g = n(), _ = K(t, g);
192
+ r.clearRect(0, 0, i, a);
193
+ let v = A(L(_.theme), g), y = Ne(_, f, i, a);
194
+ if (p(_) && y.length > d && u()) {
195
+ l && l.scene === _ && l.x === f.x && l.y === f.y && l.zoom === f.zoom && l.w === e.width && l.h === e.height || ((s.width !== e.width || s.height !== e.height) && (s.width = e.width, s.height = e.height), c.setTransform(o, 0, 0, o, 0, 0), c.clearRect(0, 0, i, a), m(c, _, f), l = {
196
+ scene: _,
197
+ x: f.x,
198
+ y: f.y,
199
+ zoom: f.zoom,
180
200
  w: e.width,
181
201
  h: e.height
182
- }), i.save(), i.setTransform(1, 0, 0, 1, 0, 0), i.drawImage(c, 0, 0), i.restore(), i.save(), i.translate(p.x, p.y), i.scale(p.zoom, p.zoom), b.forEach((e) => {
183
- e.packet && Ee(i, e, g, p.zoom);
184
- }), v.nodes.forEach((e) => je(i, e, p.zoom, y, _)), i.restore();
202
+ }), r.save(), r.setTransform(1, 0, 0, 1, 0, 0), r.drawImage(s, 0, 0), r.restore(), r.save(), r.translate(f.x, f.y), r.scale(f.zoom, f.zoom), y.forEach((e) => {
203
+ e.packet && ke(r, e, h, f.zoom);
204
+ }), _.nodes.forEach((e) => Pe(r, e, f.zoom, v, g, _.theme)), r.restore();
185
205
  return;
186
206
  }
187
- i.save(), i.translate(p.x, p.y), i.scale(p.zoom, p.zoom);
188
- let { decor: x } = v;
189
- x.grid && ye(i, x.grid, p, a, o), x.lanes.length && xe(i, x.lanes), x.rings.length && be(i, x.rings), b.forEach((e) => Se(i, e, g, p.zoom)), v.nodes.forEach((e) => je(i, e, p.zoom, y, _)), i.restore();
207
+ r.save(), r.translate(f.x, f.y), r.scale(f.zoom, f.zoom);
208
+ let { decor: b } = _;
209
+ b.grid && Se(r, b.grid, f, i, a), b.lanes.length && we(r, b.lanes), b.rings.length && Ce(r, b.rings), y.forEach((e) => Te(r, e, h, f.zoom)), _.nodes.forEach((e) => Pe(r, e, f.zoom, v, g, _.theme)), r.restore();
190
210
  },
191
211
  destroy() {
192
- c = null, l = null, u = null;
212
+ s = null, c = null, l = null;
193
213
  }
194
214
  };
195
215
  }
196
- var Ne = (e) => typeof e.hitR == "number" && e.hitR > e.r ? e.hitR : e.r;
197
- function Pe(e, { cellSize: t = 64 } = {}) {
216
+ var Ie = (e) => typeof e.hitR == "number" && e.hitR > e.r ? e.hitR : e.r;
217
+ function Le(e, { cellSize: t = 64 } = {}) {
198
218
  let n = /* @__PURE__ */ new Map(), r = 0, i = (e, t) => e * 4194304 + t;
199
219
  for (let a = 0; a < e.length; a++) {
200
220
  let o = e[a];
201
- Ne(o) > r && (r = Ne(o));
221
+ Ie(o) > r && (r = Ie(o));
202
222
  let s = i(Math.floor(o.x / t), Math.floor(o.y / t)), c = n.get(s);
203
223
  c ? c.push(a) : n.set(s, [a]);
204
224
  }
@@ -214,7 +234,7 @@ function Pe(e, { cellSize: t = 64 } = {}) {
214
234
  if (a) for (let t = 0; t < a.length; t++) {
215
235
  let n = a[t];
216
236
  if (n <= _) continue;
217
- let r = e[n], i = Math.max(Ne(r) + u, d);
237
+ let r = e[n], i = Math.max(Ie(r) + u, d);
218
238
  Math.hypot(r.x - s, r.y - c) <= i && (_ = n);
219
239
  }
220
240
  }
@@ -227,32 +247,32 @@ function Pe(e, { cellSize: t = 64 } = {}) {
227
247
  let a = n.get(i(t, r));
228
248
  if (a) for (let t = 0; t < a.length; t++) {
229
249
  let n = a[t], r = e[n], i = r.x - Math.min(Math.max(r.x, o), c), u = r.y - Math.min(Math.max(r.y, s), l);
230
- i * i + u * u <= Ne(r) ** 2 && m.push(n);
250
+ i * i + u * u <= Ie(r) ** 2 && m.push(n);
231
251
  }
232
252
  }
233
253
  return m.sort((e, t) => e - t).map((t) => e[t]);
234
254
  }
235
255
  };
236
256
  }
237
- function Fe(e, t, n, r, i = !1) {
257
+ function Re(e, t, n, r, i = !1) {
238
258
  let a = t.zoom;
239
259
  return e.nodeAt((n - t.x) / a, (r - t.y) / a, {
240
260
  pad: (i ? 16 : 6) / a,
241
261
  min: (i ? 32 : 12) / a
242
262
  });
243
263
  }
244
- function Ie(e) {
264
+ function ze(e) {
245
265
  let t = null, n = null, r = {
246
266
  builds: 0,
247
267
  get(i) {
248
- return n && t === i || (n = Pe(i.nodes, e), t = i, r.builds++), n;
268
+ return n && t === i || (n = Le(i.nodes, e), t = i, r.builds++), n;
249
269
  }
250
270
  };
251
271
  return r;
252
272
  }
253
273
  // ../explorer/frame.js
254
- var Le = 3e4;
255
- function Re({ dirty: e, packetsVisible: t, hidden: n, reduceMotion: r, idleMs: i, clientsWant: a = !1 }) {
274
+ var Be = 3e4;
275
+ function Ve({ dirty: e, packetsVisible: t, hidden: n, reduceMotion: r, idleMs: i, clientsWant: a = !1 }) {
256
276
  if (n) return {
257
277
  draw: !1,
258
278
  again: !1
@@ -263,8 +283,8 @@ function Re({ dirty: e, packetsVisible: t, hidden: n, reduceMotion: r, idleMs: i
263
283
  again: o
264
284
  };
265
285
  }
266
- function ze(e, t, n, r) {
267
- let i = Ve(e);
286
+ function He(e, t, n, r) {
287
+ let i = We(e);
268
288
  if (i.length === 0) return !1;
269
289
  if (!(n > 0) || !(r > 0)) return !0;
270
290
  let a = -t.x / t.zoom, o = -t.y / t.zoom, s = (n - t.x) / t.zoom, c = (r - t.y) / t.zoom;
@@ -274,12 +294,12 @@ function ze(e, t, n, r) {
274
294
  }
275
295
  return !1;
276
296
  }
277
- var Be = /* @__PURE__ */ new WeakMap();
278
- function Ve(e) {
279
- let t = Be.get(e);
280
- return t || (t = e.edges.filter((e) => e.packet), Be.set(e, t)), t;
297
+ var Ue = /* @__PURE__ */ new WeakMap();
298
+ function We(e) {
299
+ let t = Ue.get(e);
300
+ return t || (t = e.edges.filter((e) => e.packet), Ue.set(e, t)), t;
281
301
  }
282
- function He(e) {
302
+ function Ge(e) {
283
303
  let { draw: t, packetsVisible: n, isHidden: r, reduceMotion: i, extraDirty: a, tickClients: o, clientsWant: s, now: c, raf: l, caf: u } = e, d = !0, f = null, p = -Infinity, m = c(), h = !1, g = /* @__PURE__ */ new Set(), _ = () => {
284
304
  if (g.size === 0) return;
285
305
  let e = [...g];
@@ -292,7 +312,7 @@ function He(e) {
292
312
  let n = o && !r() ? o(e) : !1, i = d || (a ? a() : !1), { draw: s, again: c } = b(i, n);
293
313
  s && (i || e - p >= 31) && (d = !1, p = e, x.draws++, t()), x.frames++, c && v();
294
314
  }
295
- let b = (e, t) => Re({
315
+ let b = (e, t) => Ve({
296
316
  dirty: e,
297
317
  packetsVisible: n(),
298
318
  hidden: r(),
@@ -312,7 +332,7 @@ function He(e) {
312
332
  v();
313
333
  },
314
334
  noteInput() {
315
- let e = c(), t = e - m >= Le;
335
+ let e = c(), t = e - m >= Be;
316
336
  m = e, t && v();
317
337
  },
318
338
  shown() {
@@ -335,7 +355,7 @@ function He(e) {
335
355
  };
336
356
  return x;
337
357
  }
338
- var Ue = 1, We = .3, Ge = .58, Ke = 3, qe = 100, X = 64, Z = {
358
+ var Ke = 1, qe = .3, Je = .58, Ye = 3, Xe = 100, X = 64, Z = {
339
359
  selected: 0,
340
360
  current: 1,
341
361
  match: 2,
@@ -344,19 +364,19 @@ var Ue = 1, We = .3, Ge = .58, Ke = 3, qe = 100, X = 64, Z = {
344
364
  hub: 5,
345
365
  rest: 6,
346
366
  greyed: 7
347
- }, Je = 1.5, Ye = (e) => Number.isFinite(e) && e >= 9 ? Math.max(11, e) : 11, Xe = (e) => Ye(e.labelMin), Ze = (e) => k.includes(e.type) && !e.greyed, Qe = (e, t) => e.selected ? Z.selected : e.current ? Z.current : e.match ? Z.match : t && e.connected ? Z.lit : e.mark && e.mark !== "none" || e.labelKeep && !Ze(e) ? Z.marked : e.greyed ? Z.greyed : Ze(e) ? Z.hub : Z.rest;
348
- function $e(e, t, n = {}) {
349
- let { measure: r = null } = n, i = Xe(e), a = e.nodes.some((e) => e.selected || !e.connected), o = [];
367
+ }, Ze = 1.5, Qe = (e) => Number.isFinite(e) && e >= 9 ? Math.max(11, e) : 11, $e = (e) => Qe(e.labelMin), et = (e) => ee.includes(e.type) && !e.greyed, tt = (e, t) => e.selected ? Z.selected : e.current ? Z.current : e.match ? Z.match : t && e.connected ? Z.lit : e.mark && e.mark !== "none" || e.labelKeep && !et(e) ? Z.marked : e.greyed ? Z.greyed : et(e) ? Z.hub : Z.rest;
368
+ function nt(e, t, n = {}) {
369
+ let { measure: r = null } = n, i = $e(e), a = e.nodes.some((e) => e.selected || !e.connected), o = [];
350
370
  e.nodes.forEach((e, t) => {
351
371
  e.label && e.labelAlpha >= .15 && o.push({
352
372
  node: e,
353
373
  index: t,
354
- tier: Qe(e, a)
374
+ tier: tt(e, a)
355
375
  });
356
376
  }), o.sort((e, t) => e.tier - t.tier || t.node.r - e.node.r || (t.node.degree || 0) - (e.node.degree || 0) || e.index - t.index);
357
- let s = /* @__PURE__ */ new Map(), c = (e, t) => (e + 8192) * 16384 + (t + 8192), l = [], u = Math.max(Ke, Ke * t);
377
+ let s = /* @__PURE__ */ new Map(), c = (e, t) => (e + 8192) * 16384 + (t + 8192), l = [], u = Math.max(Ye, Ye * t);
358
378
  for (let { node: e, index: n, tier: a } of o) {
359
- let o = Ze(e), d = !e.greyed && (!!e.labelBold || o), f = Math.max(o ? i + 2 : i, e.labelSize * t), p = r ? r(e.label, qe, d) * f / qe : e.label.length * f * Ge, m = e.x * t, h = e.y * t + e.r * t + u + f, g = m - p / 2, _ = m + p / 2, v = h - f * Ue, y = h + f * We, b = a === Z.greyed ? 2 + f * Je : 2, x = Math.floor((g - b) / X), S = Math.floor((_ + b) / X), C = Math.floor((v - b) / X), w = Math.floor((y + b) / X), T = !1;
379
+ let o = et(e), d = !e.greyed && (!!e.labelBold || o), f = Math.max(o ? i + 2 : i, e.labelSize * t), p = r ? r(e.label, Xe, d) * f / Xe : e.label.length * f * Je, m = e.x * t, h = e.y * t + e.r * t + u + f, g = m - p / 2, _ = m + p / 2, v = h - f * Ke, y = h + f * qe, b = a === Z.greyed ? 2 + f * Ze : 2, x = Math.floor((g - b) / X), S = Math.floor((_ + b) / X), C = Math.floor((v - b) / X), w = Math.floor((y + b) / X), T = !1;
360
380
  for (let e = x; e <= S && !T; e++) for (let t = C; t <= w && !T; t++) {
361
381
  let n = s.get(c(e, t));
362
382
  if (n) for (let e = 0; e < n.length; e++) {
@@ -386,21 +406,21 @@ function $e(e, t, n = {}) {
386
406
  b: y
387
407
  };
388
408
  l.push(E);
389
- let D = Math.floor(g / X), O = Math.floor(_ / X), k = Math.floor(v / X), A = Math.floor(y / X);
390
- for (let e = D; e <= O; e++) for (let t = k; t <= A; t++) {
409
+ let D = Math.floor(g / X), O = Math.floor(_ / X), ee = Math.floor(v / X), te = Math.floor(y / X);
410
+ for (let e = D; e <= O; e++) for (let t = ee; t <= te; t++) {
391
411
  let n = c(e, t), r = s.get(n);
392
412
  r ? r.push(E) : s.set(n, [E]);
393
413
  }
394
414
  }
395
415
  return l;
396
416
  }
397
- function et(e, t, r, i = {}) {
398
- let { max: a = 400, margin: o = 32, measure: s = null, hover: c = null } = i, l = [], u = e.labelOutline || n(e.theme).labelOutline;
417
+ function rt(e, t, n, r = {}) {
418
+ let { max: i = 400, margin: a = 32, measure: o = null, hover: s = null } = r, c = [], l = e.labelOutline || L(e.theme).labelOutline;
399
419
  for (let t of e.decor.lanes) for (let n of [
400
420
  t.title,
401
421
  t.note,
402
422
  t.arrow
403
- ]) n && l.push({
423
+ ]) n && c.push({
404
424
  kind: "lane",
405
425
  text: n.text,
406
426
  x: n.x,
@@ -414,12 +434,12 @@ function et(e, t, r, i = {}) {
414
434
  align: "center",
415
435
  family: e.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif"
416
436
  });
417
- let { zoom: d } = t, f = i.placed || $e(e, d, { measure: s }), p = -o - t.x, m = r.width + o - t.x, h = -o - t.y, g = r.height + o - t.y, _ = f.filter((e) => e.r >= p && e.l <= m && e.b >= h && e.t <= g);
418
- _.length > a && (_ = _.slice(0, Math.max(0, a))), _.sort((e, t) => e.index - t.index);
419
- let v = e.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif";
420
- for (let e of _) {
421
- let t = Math.max(1, 1 / d);
422
- l.push({
437
+ let { zoom: u } = t, d = r.placed || nt(e, u, { measure: o }), f = -a - t.x, p = n.width + a - t.x, m = -a - t.y, h = n.height + a - t.y, g = d.filter((e) => e.r >= f && e.l <= p && e.b >= m && e.t <= h);
438
+ g.length > i && (g = g.slice(0, Math.max(0, i))), g.sort((e, t) => e.index - t.index);
439
+ let _ = e.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif";
440
+ for (let e of g) {
441
+ let t = Math.max(1, 1 / u);
442
+ c.push({
423
443
  kind: "node",
424
444
  id: e.id,
425
445
  text: e.node.label,
@@ -430,99 +450,99 @@ function et(e, t, r, i = {}) {
430
450
  italic: !1,
431
451
  color: e.node.labelColor,
432
452
  alpha: e.node.labelAlpha,
433
- outline: u.node ? {
434
- color: u.node.color,
435
- width: u.node.width * t
453
+ outline: l.node ? {
454
+ color: l.node.color,
455
+ width: l.node.width * t
436
456
  } : null,
437
457
  align: "center",
438
- family: v,
458
+ family: _,
439
459
  strike: !!e.node.labelStrike,
440
460
  px: e.px,
441
461
  screen: e.screen
442
462
  });
443
463
  }
444
- let y = Xe(e), b = _.map((e) => ({
464
+ let v = $e(e), y = g.map((e) => ({
445
465
  l: t.x + e.l,
446
466
  r: t.x + e.r,
447
467
  t: t.y + e.t,
448
468
  b: t.y + e.b
449
469
  }));
450
- for (let n of e.nodes) {
451
- if (n.alpha < .5) continue;
452
- let e = t.x + n.x * d, i = t.y + n.y * d, a = n.r * d;
453
- e + a < 0 || e - a > r.width || i + a < 0 || i - a > r.height || b.push({
470
+ for (let r of e.nodes) {
471
+ if (r.alpha < .5) continue;
472
+ let e = t.x + r.x * u, i = t.y + r.y * u, a = r.r * u;
473
+ e + a < 0 || e - a > n.width || i + a < 0 || i - a > n.height || y.push({
454
474
  l: e - a,
455
475
  r: e + a,
456
476
  t: i - a,
457
477
  b: i + a
458
478
  });
459
479
  }
460
- let x = 0;
461
- for (let n of e.edges) {
462
- let i = n.label;
463
- if (!i || x >= 120) continue;
464
- let a = t.x + i.x * d, o = t.y + i.y * d;
465
- if (a < 0 || a > r.width || o < 0 || o > r.height) continue;
466
- let c = (s ? s(i.text, y, !1) : i.text.length * y * .55) / 2 + 2, f = {
467
- l: a - c,
468
- r: a + c,
469
- t: o - y * .6 - 2,
470
- b: o + y * .6 + 2
480
+ let b = 0;
481
+ for (let r of e.edges) {
482
+ let i = r.label;
483
+ if (!i || b >= 120) continue;
484
+ let a = t.x + i.x * u, s = t.y + i.y * u;
485
+ if (a < 0 || a > n.width || s < 0 || s > n.height) continue;
486
+ let d = (o ? o(i.text, v, !1) : i.text.length * v * .55) / 2 + 2, f = {
487
+ l: a - d,
488
+ r: a + d,
489
+ t: s - v * .6 - 2,
490
+ b: s + v * .6 + 2
471
491
  };
472
- b.some((e) => f.l < e.r && f.r > e.l && f.t < e.b && f.b > e.t) || (b.push(f), x++, l.push({
492
+ y.some((e) => f.l < e.r && f.r > e.l && f.t < e.b && f.b > e.t) || (y.push(f), b++, c.push({
473
493
  kind: "edge",
474
494
  text: i.text,
475
495
  x: i.x,
476
- y: i.y + y * .35 / d,
477
- size: y / d,
478
- px: y,
496
+ y: i.y + v * .35 / u,
497
+ size: v / u,
498
+ px: v,
479
499
  screen: !0,
480
500
  bold: !1,
481
501
  italic: !!i.italic,
482
502
  color: i.color,
483
- alpha: n.alpha,
484
- outline: u.edge,
503
+ alpha: r.alpha,
504
+ outline: l.edge,
485
505
  align: "center",
486
506
  family: e.labelFont || "\"Segoe UI\", -apple-system, sans-serif"
487
507
  }));
488
508
  }
489
- if (c) {
490
- let n = e.nodes.find((e) => e.id === c);
491
- if (n && n.label && !f.some((e) => e.id === c && _.includes(e))) {
492
- let r = Xe(e), i = t.y + n.y * d - n.r * d > 40 ? n.y - n.r - 5 / d : n.y + n.r + (5 + r) / d;
493
- l.push({
509
+ if (s) {
510
+ let n = e.nodes.find((e) => e.id === s);
511
+ if (n && n.label && !d.some((e) => e.id === s && g.includes(e))) {
512
+ let r = $e(e), i = t.y + n.y * u - n.r * u > 40 ? n.y - n.r - 5 / u : n.y + n.r + (5 + r) / u;
513
+ c.push({
494
514
  kind: "chip",
495
515
  id: n.id,
496
516
  text: n.label,
497
517
  x: n.x,
498
518
  y: i,
499
- size: r / d,
519
+ size: r / u,
500
520
  px: r,
501
521
  screen: !0,
502
522
  bold: !1,
503
523
  italic: !1,
504
524
  color: (e.nodes.find((e) => e.connected) || n).labelColor,
505
525
  alpha: 1,
506
- outline: u.node,
526
+ outline: l.node,
507
527
  align: "center",
508
- family: v,
528
+ family: _,
509
529
  strike: !1
510
530
  });
511
531
  }
512
532
  }
513
- return l;
533
+ return c;
514
534
  }
515
- var tt = (e) => `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${e.screen ? e.px : e.size}px ${e.family}`, nt = {
535
+ var it = (e) => `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${e.screen ? e.px : e.size}px ${e.family}`, at = {
516
536
  ox: 0,
517
537
  oy: 0,
518
538
  k: 1
519
539
  };
520
- function rt(e, t, n) {
521
- e.font = tt(t);
522
- let r = e.measureText(t.text).width + 8, i = t.px * 1.3 + 4, a = n.ox + t.x * n.k, o = n.oy + t.y * n.k, s = a - r / 2, c = o - t.px * Ue - 2;
540
+ function ot(e, t, n) {
541
+ e.font = it(t);
542
+ let r = e.measureText(t.text).width + 8, i = t.px * 1.3 + 4, a = n.ox + t.x * n.k, o = n.oy + t.y * n.k, s = a - r / 2, c = o - t.px * Ke - 2;
523
543
  e.globalAlpha = 1, e.beginPath(), e.roundRect ? e.roundRect(s, c, r, i, 4) : e.rect(s, c, r, i), e.fillStyle = t.outline ? t.outline.color : "rgba(9, 13, 22, 0.95)", e.fill(), e.lineWidth = 1, e.strokeStyle = t.color, e.stroke(), e.textAlign = t.align, e.fillStyle = t.color, e.fillText(t.text, a, o);
524
544
  }
525
- function it() {
545
+ function st() {
526
546
  return {
527
547
  font: "",
528
548
  alpha: -1,
@@ -532,13 +552,13 @@ function it() {
532
552
  align: ""
533
553
  };
534
554
  }
535
- function at(e, t, n, r = nt) {
555
+ function ct(e, t, n, r = at) {
536
556
  if (t.kind === "chip") {
537
- rt(e, t, r);
557
+ ot(e, t, r);
538
558
  return;
539
559
  }
540
560
  n.alpha !== t.alpha && (e.globalAlpha = t.alpha, n.alpha = t.alpha);
541
- let i = tt(t);
561
+ let i = it(t);
542
562
  n.font !== i && (e.font = i, n.font = i), n.align !== t.align && (e.textAlign = t.align, n.align = t.align);
543
563
  let a = r.ox + t.x * r.k, o = r.oy + t.y * r.k;
544
564
  if (t.outline) {
@@ -551,15 +571,15 @@ function at(e, t, n, r = nt) {
551
571
  e.beginPath(), e.moveTo(a - i, o - s * .32), e.lineTo(a + i, o - s * .32), e.strokeStyle = t.color, e.lineWidth = 1.4, e.stroke(), n.stroke = t.color, n.width = 1.4;
552
572
  }
553
573
  }
554
- function ot(e, t, n, r) {
574
+ function lt(e, t, n, r) {
555
575
  let i = null;
556
576
  for (let a of e) n >= t.x + a.l && n <= t.x + a.r && r >= t.y + a.t && r <= t.y + a.b && (!i || a.index > i.index) && (i = a);
557
577
  return i ? i.id : null;
558
578
  }
559
- function st(e, t = {}) {
560
- let n = t.mapStyle || (() => L), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c, l, u, d, f, p, m = null, h = !0, g = !1, _ = /* @__PURE__ */ new Map(), v = F, y = (e, t, n) => {
579
+ function ut(e, t = {}) {
580
+ let n = t.mapStyle || (() => I), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c, l, u, d, f, p, m = null, h = !0, g = !1, _ = /* @__PURE__ */ new Map(), v = P, y = (e, t, n) => {
561
581
  let i = `${n ? "b" : "n"}${t}|${v}|${e}`, a = _.get(i);
562
- return a === void 0 && (_.size > 2e4 && _.clear(), r.font = tt({
582
+ return a === void 0 && (_.size > 2e4 && _.clear(), r.font = it({
563
583
  italic: !1,
564
584
  bold: n,
565
585
  size: t,
@@ -568,7 +588,7 @@ function st(e, t = {}) {
568
588
  };
569
589
  return {
570
590
  hit(e, t) {
571
- return m && s ? ot(m, {
591
+ return m && s ? lt(m, {
572
592
  x: l,
573
593
  y: u,
574
594
  zoom: d
@@ -583,28 +603,28 @@ function st(e, t = {}) {
583
603
  if (!h && e === s && e.version === c && t.x === l && t.y === u && t.zoom === d && x === f && S === p) return !1;
584
604
  let C = m && e === s && e.version === c && t.zoom === d && x === f && !h;
585
605
  s = e, c = e.version, l = t.x, u = t.y, d = t.zoom, f = x, p = S, h = !1;
586
- let w = ie(e, b);
587
- v = w.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif", r.setTransform(o, 0, 0, o, 0, 0), r.clearRect(0, 0, i, a), r.save(), r.translate(t.x, t.y), r.scale(t.zoom, t.zoom), C || (m = $e(w, t.zoom, { measure: y }));
588
- let T = et(w, t, {
606
+ let w = K(e, b);
607
+ v = w.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif", r.setTransform(o, 0, 0, o, 0, 0), r.clearRect(0, 0, i, a), r.save(), r.translate(t.x, t.y), r.scale(t.zoom, t.zoom), C || (m = nt(w, t.zoom, { measure: y }));
608
+ let T = rt(w, t, {
589
609
  width: i,
590
610
  height: a
591
611
  }, {
592
612
  measure: y,
593
613
  hover: S,
594
614
  placed: m
595
- }), E = it();
596
- for (let e of T) e.kind === "lane" && at(r, e, E);
597
- for (let e of T) e.kind === "node" && !e.screen && at(r, e, E);
615
+ }), E = st();
616
+ for (let e of T) e.kind === "lane" && ct(r, e, E);
617
+ for (let e of T) e.kind === "node" && !e.screen && ct(r, e, E);
598
618
  r.restore();
599
619
  let D = {
600
620
  ox: t.x,
601
621
  oy: t.y,
602
622
  k: t.zoom
603
623
  };
604
- E = it();
605
- for (let e of T) e.kind === "node" && e.screen && at(r, e, E, D);
606
- for (let e of T) e.kind === "edge" && at(r, e, E, D);
607
- for (let e of T) e.kind === "chip" && at(r, e, E, D);
624
+ E = st();
625
+ for (let e of T) e.kind === "node" && e.screen && ct(r, e, E, D);
626
+ for (let e of T) e.kind === "edge" && ct(r, e, E, D);
627
+ for (let e of T) e.kind === "chip" && ct(r, e, E, D);
608
628
  return !0;
609
629
  },
610
630
  destroy() {
@@ -613,7 +633,7 @@ function st(e, t = {}) {
613
633
  };
614
634
  }
615
635
  // ../explorer/engine/render.js
616
- var ct = [
636
+ var dt = [
617
637
  "pointerdown",
618
638
  "pointermove",
619
639
  "mousedown",
@@ -623,60 +643,60 @@ var ct = [
623
643
  "touchmove",
624
644
  "keydown"
625
645
  ];
626
- function lt(e, t = {}) {
646
+ function ft(e, t = {}) {
627
647
  if (e.map) return e.map;
628
- let { state: n } = e, r = t.measureCovered || (() => n.coveredBottom || 0), i = ne(e).get, o = !1, c = (e) => h(n, e), l = (e) => h(n, e, { viewer: !0 }), u = (t, r = e.viewEdges(), i = {
648
+ let { state: n } = e, i = t.measureCovered || (() => n.coveredBottom || 0), o = ne(e).get, s = !1, c = (e) => z(n, e), l = (e) => z(n, e, { viewer: !0 }), u = (t, r = e.viewEdges(), i = {
629
649
  throughChildren: !!n.throughChildren,
630
650
  kind: n.selectedKind || null
631
- }) => s(t, r, i), d = a((t) => _(t, { reduceMotion: e.reducedMotion })), f = () => d.get(n), p = () => d.builds, m = Ie(), g = () => m.get(f()), v = () => m.builds, y = null, b = null;
632
- function x() {
633
- return y && b === n.canvas || (y && y.destroy(), y = Me(n.canvas, { mapStyle: i }), b = n.canvas, n.width && y.resize(n.width, n.height, e.dpr())), y;
651
+ }) => a(t, r, i), d = oe((t) => r(t, { reduceMotion: e.reducedMotion })), f = () => d.get(n), p = () => d.builds, m = ze(), h = () => m.get(f()), g = () => m.builds, _ = null, v = null;
652
+ function y() {
653
+ return _ && v === n.canvas || (_ && _.destroy(), _ = Fe(n.canvas, { mapStyle: o }), v = n.canvas, n.width && _.resize(n.width, n.height, e.dpr())), _;
634
654
  }
635
- let S = null, C = null;
636
- function w() {
637
- return n.labelCanvas ? (S && C === n.labelCanvas || (S && S.destroy(), S = st(n.labelCanvas, { mapStyle: i }), C = n.labelCanvas, n.width && S.resize(n.width, n.height, e.dpr())), S) : null;
655
+ let b = null, x = null;
656
+ function S() {
657
+ return n.labelCanvas ? (b && x === n.labelCanvas || (b && b.destroy(), b = ut(n.labelCanvas, { mapStyle: o }), x = n.labelCanvas, n.width && b.resize(n.width, n.height, e.dpr())), b) : null;
638
658
  }
639
- function T(t) {
640
- y && y !== t && y.destroy(), y = t, b = n.canvas, n.width && y.resize(n.width, n.height, e.dpr()), G();
659
+ function C(t) {
660
+ _ && _ !== t && _.destroy(), _ = t, v = n.canvas, n.width && _.resize(n.width, n.height, e.dpr()), H();
641
661
  }
642
- function E() {
662
+ function w() {
643
663
  let { canvas: t } = n, r = `${n.width}x${n.height}`;
644
- n.width = t.parentElement.clientWidth, n.height = t.parentElement.clientHeight, x().resize(n.width, n.height, e.dpr());
645
- let i = w();
646
- i && i.resize(n.width, n.height, e.dpr()), r !== `${n.width}x${n.height}` && O(), G();
664
+ n.width = t.parentElement.clientWidth, n.height = t.parentElement.clientHeight, y().resize(n.width, n.height, e.dpr());
665
+ let i = S();
666
+ i && i.resize(n.width, n.height, e.dpr()), r !== `${n.width}x${n.height}` && E(), H();
647
667
  }
648
- let D = e.slot("fit", () => ({
668
+ let T = e.slot("fit", () => ({
649
669
  lastFit: null,
650
670
  waiting: null
651
671
  }));
652
- function O() {
672
+ function E() {
653
673
  if (!n.width || !n.height) return;
654
- if (D.waiting) {
655
- let { padding: e, only: t } = D.waiting;
656
- N(e === null ? P() : e, t);
674
+ if (T.waiting) {
675
+ let { padding: e, only: t } = T.waiting;
676
+ j(e === null ? M() : e, t);
657
677
  return;
658
678
  }
659
- let { camera: e } = n, t = D.lastFit;
660
- t && e.x === t.x && e.y === t.y && e.zoom === t.zoom && N(t.auto ? P() : t.padding, t.only);
679
+ let { camera: e } = n, t = T.lastFit;
680
+ t && e.x === t.x && e.y === t.y && e.zoom === t.zoom && j(t.auto ? M() : t.padding, t.only);
661
681
  }
662
- function k() {
682
+ function D() {
663
683
  let t = n.canvas && n.canvas.parentElement, r = e.win && e.win.ResizeObserver;
664
684
  if (!t || !r) return () => {};
665
685
  let i = new r(() => {
666
- n.canvas && (t.clientWidth !== n.width || t.clientHeight !== n.height) && E();
686
+ n.canvas && (t.clientWidth !== n.width || t.clientHeight !== n.height) && w();
667
687
  });
668
688
  i.observe(t);
669
689
  let a = () => i.disconnect();
670
690
  return e.own(a), a;
671
691
  }
672
- function A(e, t = null) {
673
- let { nodes: i, width: a, height: o } = n, s = i.filter(c);
692
+ function O(e, t = null) {
693
+ let { nodes: r, width: a, height: o } = n, s = r.filter(c);
674
694
  if (t) {
675
695
  let e = s.filter((e) => t.has(e.id));
676
696
  e.length && (s = e);
677
697
  }
678
698
  if (s.length === 0) return null;
679
- let l = Math.max(160, o - r()), u = Infinity, d = -Infinity, f = Infinity, p = -Infinity;
699
+ let l = Math.max(160, o - i()), u = Infinity, d = -Infinity, f = Infinity, p = -Infinity;
680
700
  s.forEach((e) => {
681
701
  let t = e.r || 18;
682
702
  u = Math.min(u, e.x - t - 25), d = Math.max(d, e.x + t + 25), f = Math.min(f, e.y - t - 25), p = Math.max(p, e.y + t + 35);
@@ -691,145 +711,145 @@ function lt(e, t = {}) {
691
711
  raw: g
692
712
  };
693
713
  }
694
- let ee = "", j = I;
695
- function M() {
696
- let e = `${n.sceneVersion}|${n.width}|${n.height}|${n.view}|${r()}`;
714
+ let ee = "", k = ae;
715
+ function A() {
716
+ let e = `${n.sceneVersion}|${n.width}|${n.height}|${n.view}|${i()}`;
697
717
  if (e !== ee) {
698
718
  ee = e;
699
- let t = A(P());
700
- j = t && t.raw > 0 && Number.isFinite(t.raw) ? Math.max(te, Math.min(I, t.raw)) : I;
719
+ let t = O(M());
720
+ k = t && t.raw > 0 && Number.isFinite(t.raw) ? Math.max(te, Math.min(ae, t.raw)) : ae;
701
721
  }
702
- return j;
722
+ return k;
703
723
  }
704
- function N(e = 40, t = null) {
724
+ function j(e = 40, t = null) {
705
725
  let { width: r, height: i, camera: a } = n;
706
726
  if (!r || !i) {
707
- n.nodes.length && (D.waiting = {
708
- padding: e === P() ? null : e,
727
+ n.nodes.length && (T.waiting = {
728
+ padding: e === M() ? null : e,
709
729
  only: t
710
730
  });
711
731
  return;
712
732
  }
713
- D.waiting = null;
714
- let o = A(e, t);
733
+ T.waiting = null;
734
+ let o = O(e, t);
715
735
  if (!o) return;
716
736
  let { minX: s, maxX: c, minY: l, maxY: u, mapHeight: d } = o, f = Math.min(1, Math.max(te, o.raw));
717
- a.zoom = f, a.x = r / 2 - (s + c) / 2 * f, a.y = d / 2 - (l + u) / 2 * f, D.lastFit = {
737
+ a.zoom = f, a.x = r / 2 - (s + c) / 2 * f, a.y = d / 2 - (l + u) / 2 * f, T.lastFit = {
718
738
  padding: e,
719
- auto: e === P(),
739
+ auto: e === M(),
720
740
  only: t,
721
741
  x: a.x,
722
742
  y: a.y,
723
743
  zoom: a.zoom
724
- }, G();
744
+ }, H();
725
745
  }
726
- let P = () => n.width < 640 ? 24 : 48, F = (e, t) => ({
746
+ let M = () => n.width < 640 ? 24 : 48, N = (e, t) => ({
727
747
  x: (e - n.camera.x) / n.camera.zoom,
728
748
  y: (t - n.camera.y) / n.camera.zoom
729
- }), L = -1;
730
- function R() {
749
+ }), P = -1;
750
+ function F() {
731
751
  if (!n.canvas) return;
732
752
  let e = f();
733
- L = e.version, x().draw(e, n.camera, performance.now());
734
- let t = w();
735
- t && t.draw(e, n.camera, { hover: n.hoverNodeId }), V.forEach((t) => t(e, n.camera));
753
+ P = e.version, y().draw(e, n.camera, performance.now());
754
+ let t = S();
755
+ t && t.draw(e, n.camera, { hover: n.hoverNodeId }), R.forEach((t) => t(e, n.camera));
736
756
  }
737
- function z(e, t) {
738
- let n = w();
757
+ function I(e, t) {
758
+ let n = S();
739
759
  return n ? n.hit(e, t) : null;
740
760
  }
741
- function B(e) {
761
+ function L(e) {
742
762
  let t = e || null;
743
763
  if (n.hoverNodeId === t) return;
744
764
  n.hoverNodeId = t;
745
- let r = w();
765
+ let r = S();
746
766
  r && n.canvas && n.width && r.draw(f(), n.camera, { hover: t });
747
767
  }
748
- let V = /* @__PURE__ */ new Set(), H = (e) => (V.add(e), () => V.delete(e)), U = /* @__PURE__ */ new Set(), W = He({
749
- draw: R,
750
- packetsVisible: () => !!n.canvas && ze(f(), n.camera, n.width, n.height),
768
+ let R = /* @__PURE__ */ new Set(), re = (e) => (R.add(e), () => R.delete(e)), B = /* @__PURE__ */ new Set(), V = Ge({
769
+ draw: F,
770
+ packetsVisible: () => !!n.canvas && He(f(), n.camera, n.width, n.height),
751
771
  isHidden: () => e.hidden(),
752
772
  tickClients: (e) => {
753
773
  let t = !1;
754
- return U.forEach((n) => {
774
+ return B.forEach((n) => {
755
775
  n.tick(e), n.wants() && (t = !0);
756
776
  }), t;
757
777
  },
758
- clientsWant: () => [...U].some((e) => e.wants()),
778
+ clientsWant: () => [...B].some((e) => e.wants()),
759
779
  reduceMotion: () => e.reducedMotion,
760
- extraDirty: () => n.sceneVersion !== L,
780
+ extraDirty: () => n.sceneVersion !== P,
761
781
  now: () => performance.now(),
762
782
  raf: (e) => requestAnimationFrame(e),
763
783
  caf: (e) => cancelAnimationFrame(e)
764
784
  });
765
- function G() {
766
- !o && n.canvas && W.markDirty();
785
+ function H() {
786
+ !s && n.canvas && V.markDirty();
767
787
  }
768
- function K() {
769
- !o && n.canvas && W.drawNow();
788
+ function U() {
789
+ !s && n.canvas && V.drawNow();
770
790
  }
771
- function re(e) {
772
- return U.add(e), () => U.delete(e);
791
+ function W(e) {
792
+ return B.add(e), () => B.delete(e);
773
793
  }
774
- let q = [];
794
+ let G = [];
775
795
  if (e.root) {
776
- let t = () => W.noteInput();
777
- for (let n of ct) q.push(e.listen(e.root, n, t, {
796
+ let t = () => V.noteInput();
797
+ for (let n of dt) G.push(e.listen(e.root, n, t, {
778
798
  passive: !0,
779
799
  capture: !0
780
800
  }));
781
801
  }
782
- q.push(e.onShown(() => W.shown())), q.push(e.onShown(() => {
802
+ G.push(e.onShown(() => V.shown())), G.push(e.onShown(() => {
783
803
  let e = n.canvas && n.canvas.parentElement;
784
- !o && e && e.clientWidth && e.clientHeight && (e.clientWidth !== n.width || e.clientHeight !== n.height) && E();
804
+ !s && e && e.clientWidth && e.clientHeight && (e.clientWidth !== n.width || e.clientHeight !== n.height) && w();
785
805
  }));
786
806
  function ie() {
787
- o = !0;
788
- for (let e of q.splice(0)) e();
789
- e.map === J && (e.map = null), W.cancel(), y && (y.release ? y.release() : y.destroy(), y = null, b = null), S && (S.destroy(), S = null, C = null), V.clear(), U.clear();
807
+ s = !0;
808
+ for (let e of G.splice(0)) e();
809
+ e.map === K && (e.map = null), V.cancel(), _ && (_.release ? _.release() : _.destroy(), _ = null, v = null), b && (b.destroy(), b = null, x = null), R.clear(), B.clear();
790
810
  }
791
- let J = {
811
+ let K = {
792
812
  isNodeVisible: c,
793
813
  isNodeVisibleToViewer: l,
794
814
  getActiveSubgraph: u,
795
815
  getScene: f,
796
816
  sceneBuilds: p,
797
- getSpatialIndex: g,
798
- spatialBuilds: v,
799
- getRenderer: x,
800
- setRenderer: T,
801
- resize: E,
802
- watchSize: k,
803
- getMinZoom: M,
804
- fitGraphToViewport: N,
805
- fitPadding: P,
806
- screenToWorld: F,
807
- labelNodeAt: z,
808
- setHoverNode: B,
809
- onPaint: H,
810
- render: G,
811
- renderNow: K,
812
- addFrameClient: re,
817
+ getSpatialIndex: h,
818
+ spatialBuilds: g,
819
+ getRenderer: y,
820
+ setRenderer: C,
821
+ resize: w,
822
+ watchSize: D,
823
+ getMinZoom: A,
824
+ fitGraphToViewport: j,
825
+ fitPadding: M,
826
+ screenToWorld: N,
827
+ labelNodeAt: I,
828
+ setHoverNode: L,
829
+ onPaint: re,
830
+ render: H,
831
+ renderNow: U,
832
+ addFrameClient: W,
813
833
  queueFrameWork: (e, t) => {
814
- o || W.queue(e, t);
834
+ s || V.queue(e, t);
815
835
  },
816
836
  frameStats: () => ({
817
- frames: W.frames,
818
- draws: W.draws
837
+ frames: V.frames,
838
+ draws: V.draws
819
839
  }),
820
840
  holdFrames: (e) => {
821
- o || W.hold(e);
841
+ s || V.hold(e);
822
842
  },
823
- cancelFrame: () => W.cancel(),
843
+ cancelFrame: () => V.cancel(),
824
844
  ensureFlowLoop: () => {
825
- o || W.wake();
845
+ s || V.wake();
826
846
  },
827
847
  destroy: ie
828
848
  };
829
- return e.map = J, e.own(ie), J;
849
+ return e.map = K, e.own(ie), K;
830
850
  }
831
851
  // ../explorer/flow-build.js
832
- function ut(e, t) {
852
+ function pt(e, t) {
833
853
  let n = new Map(e.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map();
834
854
  t.forEach((e) => {
835
855
  !e.kind && !e.dashed && n.get(e.from)?.type === "app" && n.get(e.to)?.type === "page" && r.set(e.to, e.from);
@@ -917,55 +937,55 @@ function ut(e, t) {
917
937
  };
918
938
  }
919
939
  // ../explorer/engine/topology.js
920
- function dt(e) {
940
+ function mt(e) {
921
941
  return {
922
942
  nodes: e && Array.isArray(e.nodes) ? e.nodes.filter((e) => e && typeof e.id == "string") : [],
923
943
  edges: e && Array.isArray(e.edges) ? e.edges.filter((e) => e && typeof e.from == "string" && typeof e.to == "string") : []
924
944
  };
925
945
  }
926
- function ft(e, t) {
927
- let { state: n } = e, { nodes: r, edges: i } = dt(t), a = n.selectedNode ? n.selectedNode.id : null;
928
- n.baseNodes = r, n.baseEdges = i, n.nodes = r.map((e) => ({ ...e })), n.edges = i.map((e) => ({ ...e })), n.mapNodes = n.nodes, n.mapEdges = n.edges, n.flow = ut(n.nodes, n.edges);
946
+ function ht(e, t) {
947
+ let { state: n } = e, { nodes: r, edges: i } = mt(t), a = n.selectedNode ? n.selectedNode.id : null;
948
+ n.baseNodes = r, n.baseEdges = i, n.nodes = r.map((e) => ({ ...e })), n.edges = i.map((e) => ({ ...e })), n.mapNodes = n.nodes, n.mapEdges = n.edges, n.flow = pt(n.nodes, n.edges);
929
949
  let o = a && n.nodes.find((e) => e.id === a) || null;
930
950
  return o ? (n.selectedEdge = null, n.selectedNode = o) : (n.selectedNode || n.selectedEdge) && (n.selectedNode = null, n.selectedEdge = null), e.touchScene(), n.nodes.length > 0;
931
951
  }
932
- function pt(e, { placeLive: t } = {}) {
933
- let { state: n } = e;
934
- T(e), n.view === "dataflow" && n.flow ? (n.flow.tiers.forEach((e) => e.nodes.forEach((e) => {
952
+ function gt(t, { placeLive: n } = {}) {
953
+ let { state: r } = t;
954
+ v(t), r.view === "dataflow" && r.flow ? (r.flow.tiers.forEach((e) => e.nodes.forEach((e) => {
935
955
  e.r = Math.min(e.r, 13);
936
- })), n.proposal && n.baseNodes && ht(e) || O(e, n.flow)) : n.baseNodes && (n.proposal || n.nodes.some((e) => e.live)) ? gt(e, t) : g(e);
937
- }
938
- function mt(e, t, n) {
939
- let { state: r } = e;
940
- r.mapNodes = t, r.mapEdges = n, r.nodes = t, r.edges = n, r.flow = ut(t, n), i(r.flow), e.touchScene(), pt(e);
941
- }
942
- function ht(e) {
943
- let { state: t } = e, n = {
944
- nodes: t.nodes,
945
- edges: t.edges
946
- }, r = t.baseNodes.map((e) => ({ ...e }));
947
- t.nodes = r, t.edges = t.baseEdges, T(e);
948
- let i = ut(r, t.baseEdges);
949
- i.tiers.forEach((e) => e.nodes.forEach((e) => {
956
+ })), r.proposal && r.baseNodes && vt(t) || e(t, r.flow)) : r.baseNodes && (r.proposal || r.nodes.some((e) => e.live)) ? yt(t, n) : M(t);
957
+ }
958
+ function _t(e, n, r) {
959
+ let { state: i } = e;
960
+ i.mapNodes = n, i.mapEdges = r, i.nodes = n, i.edges = r, i.flow = pt(n, r), t(i.flow), e.touchScene(), gt(e);
961
+ }
962
+ function vt(t) {
963
+ let { state: n } = t, r = {
964
+ nodes: n.nodes,
965
+ edges: n.edges
966
+ }, i = n.baseNodes.map((e) => ({ ...e }));
967
+ n.nodes = i, n.edges = n.baseEdges, v(t);
968
+ let a = pt(i, n.baseEdges);
969
+ a.tiers.forEach((e) => e.nodes.forEach((e) => {
950
970
  e.r = Math.min(e.r, 13);
951
- })), O(e, i), t.nodes = n.nodes, t.edges = n.edges;
952
- let a = z(t.flow, i);
953
- return e.touchScene(), a;
971
+ })), e(t, a), n.nodes = r.nodes, n.edges = r.edges;
972
+ let o = R(n.flow, a);
973
+ return t.touchScene(), o;
954
974
  }
955
- function gt(e, t) {
975
+ function yt(e, t) {
956
976
  let { state: n } = e, r = {
957
977
  nodes: n.nodes,
958
978
  edges: n.edges
959
979
  }, i = n.baseNodes.map((e) => ({ ...e }));
960
- n.nodes = i, n.edges = n.baseEdges, T(e), g(e);
980
+ n.nodes = i, n.edges = n.baseEdges, v(e), M(e);
961
981
  let a = new Map(i.map((e) => [e.id, e]));
962
- n.nodes = r.nodes, n.edges = r.edges, T(e), n.nodes.forEach((e) => {
982
+ n.nodes = r.nodes, n.edges = r.edges, v(e), n.nodes.forEach((e) => {
963
983
  let t = a.get(e.id);
964
984
  t && (e.x = t.x, e.y = t.y, e.r = t.r);
965
- }), m(n.nodes, n.edges), t && t(n.nodes, n.edges), e.touchScene();
985
+ }), _(n.nodes, n.edges), t && t(n.nodes, n.edges), e.touchScene();
966
986
  }
967
987
  // ../explorer/shaders.js
968
- var Q = "#version 300 es\nprecision highp float;\nuniform vec2 u_viewport;\nuniform vec3 u_cam;\nuniform float u_dpr;\n", _t = "\nvec4 toClip(vec2 pos) {\n return vec4(pos.x / u_viewport.x * 2.0 - 1.0, 1.0 - pos.y / u_viewport.y * 2.0, 0.0, 1.0);\n}\n", vt = "\nout vec4 outColor;\n\n// Coverage of one device pixel by the half plane d < 0 (d: signed distance in CSS px, pix: the pixel's size)\nfloat coverEdge(float d, float pix) {\n return clamp(0.5 - d / pix, 0.0, 1.0);\n}\n\n// Coverage of one pixel by a band of half width hw around dist = 0 (dist >= 0: distance from the centre line)\nfloat coverBand(float dist, float hw, float pix) {\n float hi = min(hw, dist + 0.5 * pix);\n float lo = max(-hw, dist - 0.5 * pix);\n return clamp((hi - lo) / pix, 0.0, 1.0);\n}\n\n// Coverage by a dash pattern along an arc (on / off in world units; on <= 0 or off <= 0 is solid)\nfloat coverDash(float arc, float on, float off, float pixWorld) {\n if (on <= 0.0 || off <= 0.0) return 1.0;\n float period = on + off;\n float u = mod(arc - on * 0.5 + period * 0.5, period) - period * 0.5;\n return clamp((on * 0.5 - abs(u)) / pixWorld + 0.5, 0.0, 1.0);\n}\n\n// Straight colour at alpha a, composited over acc (premultiplied)\nvoid over(inout vec4 acc, vec3 rgb, float a) {\n acc = vec4(rgb * a, a) + acc * (1.0 - a);\n}\n\n// What Canvas 2D's shadowBlur gives a disc of radius R at distance len from its centre: a blurred copy\n// of the disc. s is the blur's sigma in CSS px (shadowBlur is in DEVICE px and sigma = blur / 2). A big\n// disc has a straight-edge profile (a logistic stands in for the Gaussian's CDF); a small one is a\n// Gaussian bump whose height is what the blur leaves of it.\nfloat glowDisc(float len, float R, float s) {\n float wide = 1.0 / (1.0 + exp(clamp(1.702 * (len - R) / s, -30.0, 30.0)));\n float narrow = (1.0 - exp(-R * R / (2.0 * s * s))) * exp(-len * len / (2.0 * s * s));\n return mix(narrow, wide, smoothstep(0.5 * s, 2.5 * s, R));\n}\n\n// The normal distribution's CDF, as the same logistic (error under 0.01)\nfloat phi(float x) {\n return 1.0 / (1.0 + exp(clamp(-1.702 * x, -30.0, 30.0)));\n}\n", yt = `${Q}
988
+ var Q = "#version 300 es\nprecision highp float;\nuniform vec2 u_viewport;\nuniform vec3 u_cam;\nuniform float u_dpr;\n", bt = "\nvec4 toClip(vec2 pos) {\n return vec4(pos.x / u_viewport.x * 2.0 - 1.0, 1.0 - pos.y / u_viewport.y * 2.0, 0.0, 1.0);\n}\n", xt = "\nout vec4 outColor;\n\n// Coverage of one device pixel by the half plane d < 0 (d: signed distance in CSS px, pix: the pixel's size)\nfloat coverEdge(float d, float pix) {\n return clamp(0.5 - d / pix, 0.0, 1.0);\n}\n\n// Coverage of one pixel by a band of half width hw around dist = 0 (dist >= 0: distance from the centre line)\nfloat coverBand(float dist, float hw, float pix) {\n float hi = min(hw, dist + 0.5 * pix);\n float lo = max(-hw, dist - 0.5 * pix);\n return clamp((hi - lo) / pix, 0.0, 1.0);\n}\n\n// Coverage by a dash pattern along an arc (on / off in world units; on <= 0 or off <= 0 is solid)\nfloat coverDash(float arc, float on, float off, float pixWorld) {\n if (on <= 0.0 || off <= 0.0) return 1.0;\n float period = on + off;\n float u = mod(arc - on * 0.5 + period * 0.5, period) - period * 0.5;\n return clamp((on * 0.5 - abs(u)) / pixWorld + 0.5, 0.0, 1.0);\n}\n\n// Straight colour at alpha a, composited over acc (premultiplied)\nvoid over(inout vec4 acc, vec3 rgb, float a) {\n acc = vec4(rgb * a, a) + acc * (1.0 - a);\n}\n\n// What Canvas 2D's shadowBlur gives a disc of radius R at distance len from its centre: a blurred copy\n// of the disc. s is the blur's sigma in CSS px (shadowBlur is in DEVICE px and sigma = blur / 2). A big\n// disc has a straight-edge profile (a logistic stands in for the Gaussian's CDF); a small one is a\n// Gaussian bump whose height is what the blur leaves of it.\nfloat glowDisc(float len, float R, float s) {\n float wide = 1.0 / (1.0 + exp(clamp(1.702 * (len - R) / s, -30.0, 30.0)));\n float narrow = (1.0 - exp(-R * R / (2.0 * s * s))) * exp(-len * len / (2.0 * s * s));\n return mix(narrow, wide, smoothstep(0.5 * s, 2.5 * s, R));\n}\n\n// The normal distribution's CDF, as the same logistic (error under 0.01)\nfloat phi(float x) {\n return 1.0 / (1.0 + exp(clamp(-1.702 * x, -30.0, 30.0)));\n}\n", St = `${Q}
969
989
  layout(location = 0) in vec2 a_corner;
970
990
  layout(location = 1) in vec4 a_grid; // size, width
971
991
  layout(location = 2) in vec4 a_color;
@@ -978,7 +998,7 @@ void main() {
978
998
  v_color = a_color;
979
999
  gl_Position = vec4(a_corner, 0.0, 1.0);
980
1000
  }
981
- `, bt = `${Q}${vt}
1001
+ `, Ct = `${Q}${xt}
982
1002
  in vec2 v_pos;
983
1003
  flat in vec4 v_grid;
984
1004
  flat in vec4 v_color;
@@ -991,7 +1011,7 @@ void main() {
991
1011
  float cover = max(coverBand(dist.x, hw, pix), coverBand(dist.y, hw, pix));
992
1012
  outColor = vec4(v_color.rgb * v_color.a, v_color.a) * cover;
993
1013
  }
994
- `, xt = `${Q}${_t}
1014
+ `, wt = `${Q}${bt}
995
1015
  layout(location = 0) in vec2 a_corner;
996
1016
  layout(location = 1) in vec4 a_rect; // x, y, w, h (world)
997
1017
  layout(location = 2) in vec4 a_fill;
@@ -1015,7 +1035,7 @@ void main() {
1015
1035
  v_stroke = a_stroke;
1016
1036
  gl_Position = toClip(pos);
1017
1037
  }
1018
- `, St = `${Q}${vt}
1038
+ `, Tt = `${Q}${xt}
1019
1039
  in vec2 v_local;
1020
1040
  flat in vec2 v_half;
1021
1041
  flat in vec2 v_style;
@@ -1032,7 +1052,7 @@ void main() {
1032
1052
  over(acc, v_stroke.rgb, v_stroke.a * coverBand(abs(sd), v_style.y * zoom * 0.5, pix));
1033
1053
  outColor = acc;
1034
1054
  }
1035
- `, Ct = `${Q}${_t}
1055
+ `, Et = `${Q}${bt}
1036
1056
  layout(location = 0) in vec2 a_corner;
1037
1057
  layout(location = 1) in vec4 a_geom; // x, y, r, width (world)
1038
1058
  layout(location = 2) in vec4 a_color;
@@ -1052,7 +1072,7 @@ void main() {
1052
1072
  v_dash = a_dash;
1053
1073
  gl_Position = toClip(pos);
1054
1074
  }
1055
- `, wt = `${Q}${vt}
1075
+ `, Dt = `${Q}${xt}
1056
1076
  in vec2 v_local;
1057
1077
  flat in vec4 v_geom;
1058
1078
  flat in vec4 v_color;
@@ -1067,7 +1087,7 @@ void main() {
1067
1087
  cover *= coverDash(arc, v_dash.x, v_dash.y, pix / zoom);
1068
1088
  outColor = vec4(v_color.rgb * v_color.a, v_color.a) * cover;
1069
1089
  }
1070
- `, Tt = `${Q}${_t}
1090
+ `, Ot = `${Q}${bt}
1071
1091
  layout(location = 0) in vec2 a_corner;
1072
1092
  layout(location = 1) in vec4 a_geom; // x, y, r (world), alpha
1073
1093
  layout(location = 2) in vec4 a_color; // r, g, b (0..1), glow (px)
@@ -1095,7 +1115,7 @@ void main() {
1095
1115
  v_kind = a_kind;
1096
1116
  gl_Position = toClip(centre + v_local);
1097
1117
  }
1098
- `, Et = `${Q}${vt}
1118
+ `, kt = `${Q}${xt}
1099
1119
  in vec2 v_local;
1100
1120
  flat in vec4 v_geom;
1101
1121
  flat in vec4 v_color;
@@ -1148,15 +1168,26 @@ void main() {
1148
1168
  over(acc, ring.rgb, ring.a * al * coverBand(abs(len - (rw + u_haloGeom[halo].y) * zoom), u_haloGeom[halo].z * zoom * 0.5, pix));
1149
1169
  }
1150
1170
 
1151
- // Glow: a blurred copy of the disc under it (see glowDisc)
1152
- float glow = v_color.w;
1153
- if (glow > 0.0) over(acc, v_color.rgb, v_kind.z * al * glowDisc(len, R, glow * 0.5 / u_dpr));
1154
-
1155
- // The silhouette, and its white core unless the type's glyph is drawn there (glyphs.js: the icon pass draws it once the node is wide enough)
1156
1171
  int shapeCode = int(v_kind.w + 0.5);
1157
1172
  bool glyph = shapeCode >= 8;
1158
1173
  if (glyph) shapeCode -= 8;
1159
- over(acc, v_color.rgb, v_kind.z * al * coverEdge(sdShape(v_local, R, shapeCode, len), pix));
1174
+ float shapeCover = coverEdge(sdShape(v_local, R, shapeCode, len), pix); // how much of this pixel the silhouette covers
1175
+
1176
+ // Glow: a blurred copy of the disc under it (see glowDisc), then the silhouette. An opaque fill hides the glow under it: drawn as it always was.
1177
+ // Under a translucent fill the glow is left out, so the fill alone sets what is seen through it, as renderer-canvas2d.js drawNode does (a clip).
1178
+ // Glow and fill are the same colour, so that is ONE layer: the fill in the part of the pixel the silhouette covers, the glow in the rest. Two
1179
+ // layers (the glow times 1 - cover, then the fill times cover) would let the ground through both at the edge: a dark line round a square or a
1180
+ // diamond, whose sides lie inside the glow's disc
1181
+ float glow = v_color.w;
1182
+ if (v_kind.z < 1.0) {
1183
+ float soft = glow > 0.0 ? glowDisc(len, R, glow * 0.5 / u_dpr) : 0.0;
1184
+ over(acc, v_color.rgb, v_kind.z * al * mix(soft, 1.0, shapeCover));
1185
+ } else {
1186
+ if (glow > 0.0) over(acc, v_color.rgb, v_kind.z * al * glowDisc(len, R, glow * 0.5 / u_dpr));
1187
+ over(acc, v_color.rgb, v_kind.z * al * shapeCover);
1188
+ }
1189
+
1190
+ // The white core unless the type's glyph is drawn there (glyphs.js: the icon pass draws it once the node is wide enough)
1160
1191
  if (!glyph || 2.0 * R < u_glyphMin) over(acc, u_core.rgb, u_core.a * al * coverEdge(len - R * u_coreRatio, pix));
1161
1192
 
1162
1193
  // Mark: a ring with the look of its own mark (dashed when its dash is set: added), and for removed a
@@ -1185,7 +1216,7 @@ void main() {
1185
1216
 
1186
1217
  outColor = acc;
1187
1218
  }
1188
- `, Dt = "\nvec2 bez(vec2 a, vec2 c, vec2 b, float t) {\n float u = 1.0 - t;\n return u * u * a + 2.0 * u * t * c + t * t * b;\n}\nvec2 bezD(vec2 a, vec2 c, vec2 b, float t) {\n return 2.0 * (1.0 - t) * (c - a) + 2.0 * t * (b - c);\n}\n// Arc length from 0 to t, in world units (midpoint rule, 8 steps: the speed is smooth)\nfloat bezArc(vec2 a, vec2 c, vec2 b, float t) {\n float sum = 0.0;\n for (int j = 0; j < 8; j++) sum += length(bezD(a, c, b, (float(j) + 0.5) * t / 8.0));\n return sum * t / 8.0;\n}\n", Ot = "\nvec2 packetPos(vec4 ends, vec4 mot, float timeSec) {\n float k = fract(timeSec * mot.z + mot.w);\n return bez(ends.xy, mot.xy, ends.zw, k);\n}\n", kt = (e) => `${Q}${Dt}
1219
+ `, At = "\nvec2 bez(vec2 a, vec2 c, vec2 b, float t) {\n float u = 1.0 - t;\n return u * u * a + 2.0 * u * t * c + t * t * b;\n}\nvec2 bezD(vec2 a, vec2 c, vec2 b, float t) {\n return 2.0 * (1.0 - t) * (c - a) + 2.0 * t * (b - c);\n}\n// Arc length from 0 to t, in world units (midpoint rule, 8 steps: the speed is smooth)\nfloat bezArc(vec2 a, vec2 c, vec2 b, float t) {\n float sum = 0.0;\n for (int j = 0; j < 8; j++) sum += length(bezD(a, c, b, (float(j) + 0.5) * t / 8.0));\n return sum * t / 8.0;\n}\n", jt = "\nvec2 packetPos(vec4 ends, vec4 mot, float timeSec) {\n float k = fract(timeSec * mot.z + mot.w);\n return bez(ends.xy, mot.xy, ends.zw, k);\n}\n", Mt = (e) => `${Q}${At}
1189
1220
  #define SEGS ${e}
1190
1221
  layout(location = 1) in vec4 a_ends; // x1, y1, x2, y2 (world)
1191
1222
  layout(location = 2) in vec4 a_geom; // control x, y (world), width (world), glow blur (px)
@@ -1227,7 +1258,7 @@ void main() {
1227
1258
  v_dash = a_dash;
1228
1259
  gl_Position = vec4(pos.x / u_viewport.x * 2.0 - 1.0, 1.0 - pos.y / u_viewport.y * 2.0, 0.0, 1.0);
1229
1260
  }
1230
- `, At = `${Q}${vt}
1261
+ `, Nt = `${Q}${xt}
1231
1262
  in float v_across;
1232
1263
  in float v_arc;
1233
1264
  flat in float v_len;
@@ -1277,7 +1308,7 @@ void main() {
1277
1308
  over(acc, v_color.rgb, v_color.a * cover);
1278
1309
  outColor = acc;
1279
1310
  }
1280
- `, jt = `${Q}${_t}
1311
+ `, Pt = `${Q}${bt}
1281
1312
  layout(location = 0) in vec2 a_corner;
1282
1313
  layout(location = 1) in vec4 a_tip; // x, y (world), direction x, y (unit)
1283
1314
  layout(location = 2) in vec4 a_color;
@@ -1297,7 +1328,7 @@ void main() {
1297
1328
  v_kind = a_kind;
1298
1329
  gl_Position = toClip(u_cam.xy + a_tip.xy * zoom + off);
1299
1330
  }
1300
- `, Mt = `${Q}${vt}
1331
+ `, Ft = `${Q}${xt}
1301
1332
  in vec2 v_local;
1302
1333
  flat in vec4 v_color;
1303
1334
  flat in float v_kind;
@@ -1353,7 +1384,7 @@ void main() {
1353
1384
  }
1354
1385
  outColor = vec4(v_color.rgb * v_color.a, v_color.a) * coverEdge(sd, pix);
1355
1386
  }
1356
- `, Nt = `${Q}${_t}${Dt}${Ot}
1387
+ `, It = `${Q}${bt}${At}${jt}
1357
1388
  layout(location = 0) in vec2 a_corner;
1358
1389
  layout(location = 1) in vec4 a_ends; // x1, y1, x2, y2 (world)
1359
1390
  layout(location = 2) in vec4 a_mot; // control x, y (world), speed (trips per second), phase
@@ -1374,7 +1405,7 @@ void main() {
1374
1405
  v_glow = a_glow;
1375
1406
  gl_Position = toClip(centre + v_local);
1376
1407
  }
1377
- `, Pt = `${Q}${vt}
1408
+ `, Lt = `${Q}${xt}
1378
1409
  in vec2 v_local;
1379
1410
  flat in vec4 v_size;
1380
1411
  flat in vec4 v_color;
@@ -1389,7 +1420,7 @@ void main() {
1389
1420
  over(acc, v_color.rgb, v_color.a * coverEdge(len - R, pix));
1390
1421
  outColor = acc;
1391
1422
  }
1392
- `, Ft = `${Q}${_t}
1423
+ `, Rt = `${Q}${bt}
1393
1424
  layout(location = 0) in vec2 a_corner;
1394
1425
  layout(location = 1) in vec4 a_geom; // x, y, side (world), alpha
1395
1426
  uniform float u_minR; // letters and glyphs: the least on-screen radius (px) of a node that shows them; 0 for a theme's icon
@@ -1404,7 +1435,7 @@ void main() {
1404
1435
  v_alpha = a_geom.w;
1405
1436
  gl_Position = toClip(pos);
1406
1437
  }
1407
- `, It = `${Q}
1438
+ `, zt = `${Q}
1408
1439
  uniform sampler2D u_tex;
1409
1440
  in vec2 v_uv;
1410
1441
  flat in float v_alpha;
@@ -1412,34 +1443,34 @@ out vec4 outColor;
1412
1443
  void main() {
1413
1444
  outColor = texture(u_tex, v_uv) * v_alpha; // the texture is uploaded premultiplied
1414
1445
  }
1415
- `, Lt = {
1446
+ `, Bt = {
1416
1447
  none: 0,
1417
1448
  selected: 1,
1418
1449
  match: 2,
1419
1450
  child: 3
1420
- }, Rt = {
1451
+ }, Vt = {
1421
1452
  arrow: 1,
1422
1453
  strike: 2,
1423
1454
  chevron: 3,
1424
1455
  bar: 4,
1425
1456
  diamond: 5,
1426
1457
  tick: 6
1427
- }, zt = Object.freeze(Object.fromEntries(o.map((e, t) => [e, t]))), Bt = {
1458
+ }, Ht = Object.freeze(Object.fromEntries(F.map((e, t) => [e, t]))), Ut = {
1428
1459
  none: 0,
1429
1460
  added: 1,
1430
1461
  changed: 2,
1431
1462
  removed: 3,
1432
1463
  edit: 4
1433
1464
  }, $ = (e) => {
1434
- let [t, n, r, i] = K(e);
1465
+ let [t, n, r, i] = c(e);
1435
1466
  return [
1436
1467
  t / 255,
1437
1468
  n / 255,
1438
1469
  r / 255,
1439
1470
  i
1440
1471
  ];
1441
- }, Vt = (e, t) => Object.hasOwn(e, t) ? e[t] : 0;
1442
- function Ht(e) {
1472
+ }, Wt = (e, t) => Object.hasOwn(e, t) ? e[t] : 0;
1473
+ function Gt(e) {
1443
1474
  let { nodes: t } = e, n = new Float32Array(t.length * 12);
1444
1475
  return t.forEach((e, t) => {
1445
1476
  let [r, i, a, o] = $(e.color);
@@ -1452,10 +1483,10 @@ function Ht(e) {
1452
1483
  i,
1453
1484
  a,
1454
1485
  e.glow || 0,
1455
- Vt(Lt, e.halo),
1456
- Vt(Bt, e.mark),
1486
+ Wt(Bt, e.halo),
1487
+ Wt(Ut, e.mark),
1457
1488
  o,
1458
- Vt(zt, e.shape) + (e.glyph && !e.icon && !e.letters ? 8 : 0)
1489
+ Wt(Ht, e.shape) + (e.glyph && !e.icon && !e.letters ? 8 : 0)
1459
1490
  ], t * 12);
1460
1491
  }), {
1461
1492
  data: n,
@@ -1463,7 +1494,7 @@ function Ht(e) {
1463
1494
  stride: 12
1464
1495
  };
1465
1496
  }
1466
- function Ut(e) {
1497
+ function Kt(e) {
1467
1498
  let { grid: t, rings: n, lanes: r } = e.decor, i = new Float32Array(t ? 8 : 0);
1468
1499
  t && i.set([
1469
1500
  t.size,
@@ -1515,7 +1546,7 @@ function Ut(e) {
1515
1546
  }
1516
1547
  };
1517
1548
  }
1518
- function Wt(e) {
1549
+ function qt(e) {
1519
1550
  let t = {
1520
1551
  straight: [],
1521
1552
  curved: [],
@@ -1550,7 +1581,7 @@ function Wt(e) {
1550
1581
  l,
1551
1582
  _
1552
1583
  ]), e.arrow) {
1553
- let a = Math.atan2(e.y2 - (e.curve ? e.curve.cy : e.y1), e.x2 - (e.curve ? e.curve.cx : e.x1)), o = e.end && e.end !== "triangle" && Vt(Rt, e.end) || Rt.arrow;
1584
+ let a = Math.atan2(e.y2 - (e.curve ? e.curve.cy : e.y1), e.x2 - (e.curve ? e.curve.cx : e.x1)), o = e.end && e.end !== "triangle" && Wt(Vt, e.end) || Vt.arrow;
1554
1585
  t.tips.push([
1555
1586
  e.x2,
1556
1587
  e.y2,
@@ -1564,7 +1595,7 @@ function Wt(e) {
1564
1595
  ]);
1565
1596
  }
1566
1597
  if (e.ticks) {
1567
- let a = ae(e, .5), o = Math.hypot(e.x2 - e.x1, e.y2 - e.y1), [c, l] = o > 0 ? [(e.x2 - e.x1) / o, (e.y2 - e.y1) / o] : [1, 0];
1598
+ let a = x(e, .5), o = Math.hypot(e.x2 - e.x1, e.y2 - e.y1), [c, l] = o > 0 ? [(e.x2 - e.x1) / o, (e.y2 - e.y1) / o] : [1, 0];
1568
1599
  for (let o = 0; o < e.ticks; o++) {
1569
1600
  let u = (o - (e.ticks - 1) / 2) * B.tickGap;
1570
1601
  t.tips.push([
@@ -1576,12 +1607,12 @@ function Wt(e) {
1576
1607
  r,
1577
1608
  i,
1578
1609
  s,
1579
- Rt.tick
1610
+ Vt.tick
1580
1611
  ]);
1581
1612
  }
1582
1613
  }
1583
1614
  if (e.mark === "removed") {
1584
- let a = ae(e, .5), o = Math.hypot(e.x2 - e.x1, e.y2 - e.y1), [c, l] = o > 0 ? [(e.x2 - e.x1) / o, (e.y2 - e.y1) / o] : [1, 0];
1615
+ let a = x(e, .5), o = Math.hypot(e.x2 - e.x1, e.y2 - e.y1), [c, l] = o > 0 ? [(e.x2 - e.x1) / o, (e.y2 - e.y1) / o] : [1, 0];
1585
1616
  t.tips.push([
1586
1617
  a.x,
1587
1618
  a.y,
@@ -1591,7 +1622,7 @@ function Wt(e) {
1591
1622
  r,
1592
1623
  i,
1593
1624
  s,
1594
- Rt.strike
1625
+ Vt.strike
1595
1626
  ]);
1596
1627
  }
1597
1628
  if (e.packet) {
@@ -1633,12 +1664,12 @@ function Wt(e) {
1633
1664
  packets: n(t.packets, 18)
1634
1665
  };
1635
1666
  }
1636
- var Gt = (e) => ({
1637
- ...Ut(e),
1638
- nodes: Ht(e),
1639
- ...Wt(e)
1667
+ var Jt = (e) => ({
1668
+ ...Kt(e),
1669
+ nodes: Gt(e),
1670
+ ...qt(e)
1640
1671
  });
1641
- function Kt(e) {
1672
+ function Yt(e) {
1642
1673
  let t = [];
1643
1674
  e.nodes.forEach((e) => {
1644
1675
  if (!e.stroke) return;
@@ -1663,87 +1694,87 @@ function Kt(e) {
1663
1694
  stride: 10
1664
1695
  };
1665
1696
  }
1666
- function qt(e, t, n = null) {
1667
- let r = /* @__PURE__ */ new Map();
1668
- e.nodes.forEach((e) => {
1669
- let i = e.icon && t(e.icon) ? e.icon : null, a = e.r * G;
1670
- if (!i && !e.icon && e.letters && t(le(e.letters)) && (i = le(e.letters), a = e.r * 1), !i && !e.icon && !e.letters && e.glyph) {
1671
- let r = p(e.glyph, c(e, n));
1672
- t(r) && (i = r, a = e.r * x);
1697
+ function Xt(e, t, r = null) {
1698
+ let i = /* @__PURE__ */ new Map();
1699
+ e.nodes.forEach((a) => {
1700
+ let o = a.icon && t(a.icon) ? a.icon : null, s = a.r * W;
1701
+ if (!o && !a.icon && a.letters && t(de(a.letters)) && (o = de(a.letters), s = a.r * 1), !o && !a.icon && !a.letters && a.glyph) {
1702
+ let i = C(a.glyph, n(a, r, e.theme));
1703
+ t(i) && (o = i, s = a.r * f);
1673
1704
  }
1674
- if (!i) return;
1675
- r.has(i) || r.set(i, {
1705
+ if (!o) return;
1706
+ i.has(o) || i.set(o, {
1676
1707
  rows: [],
1677
1708
  minR: Infinity,
1678
1709
  maxR: 0
1679
1710
  });
1680
- let o = r.get(i);
1681
- o.maxR = Math.max(o.maxR, e.r), o.rows.push([
1682
- e.x,
1683
- e.y,
1684
- a,
1685
- e.alpha
1686
- ]), o.minR = Math.min(o.minR, e.r);
1711
+ let c = i.get(o);
1712
+ c.maxR = Math.max(c.maxR, a.r), c.rows.push([
1713
+ a.x,
1714
+ a.y,
1715
+ s,
1716
+ a.alpha
1717
+ ]), c.minR = Math.min(c.minR, a.r);
1687
1718
  });
1688
- let i = [], a = [];
1689
- for (let [e, { rows: t, minR: n, maxR: o }] of r) i.push({
1719
+ let a = [], o = [];
1720
+ for (let [e, { rows: t, minR: n, maxR: r }] of i) a.push({
1690
1721
  kind: e,
1691
- first: a.length,
1722
+ first: o.length,
1692
1723
  count: t.length,
1693
1724
  minR: n,
1694
- maxR: o
1695
- }), a.push(...t);
1696
- let o = new Float32Array(a.length * 4);
1697
- return a.forEach((e, t) => o.set(e, t * 4)), {
1698
- data: o,
1699
- count: a.length,
1725
+ maxR: r
1726
+ }), o.push(...t);
1727
+ let s = new Float32Array(o.length * 4);
1728
+ return o.forEach((e, t) => s.set(e, t * 4)), {
1729
+ data: s,
1730
+ count: o.length,
1700
1731
  stride: 4,
1701
- groups: i
1732
+ groups: a
1702
1733
  };
1703
1734
  }
1704
- function Jt(e = "dark", t = null) {
1705
- let { halo: r, mark: i, core: a } = t ? j(n(e), t) : n(e), o = /* @__PURE__ */ new Float32Array(16), s = /* @__PURE__ */ new Float32Array(16), c = /* @__PURE__ */ new Float32Array(16);
1706
- Object.entries(Lt).forEach(([e, t]) => {
1707
- let n = r[e];
1708
- t && n && (o.set($(n.fill), t * 4), s.set($(n.ring), t * 4), c.set([
1709
- n.fillR,
1710
- n.ringR,
1711
- n.ringWidth,
1735
+ function Zt(e = "dark", t = null) {
1736
+ let { halo: n, mark: r, core: i } = t ? A(L(e), t) : L(e), a = /* @__PURE__ */ new Float32Array(16), o = /* @__PURE__ */ new Float32Array(16), s = /* @__PURE__ */ new Float32Array(16);
1737
+ Object.entries(Bt).forEach(([e, t]) => {
1738
+ let r = n[e];
1739
+ t && r && (a.set($(r.fill), t * 4), o.set($(r.ring), t * 4), s.set([
1740
+ r.fillR,
1741
+ r.ringR,
1742
+ r.ringWidth,
1712
1743
  0
1713
1744
  ], t * 4));
1714
1745
  });
1715
- let l = /* @__PURE__ */ new Float32Array(20), u = /* @__PURE__ */ new Float32Array(20);
1716
- return Object.entries(Bt).forEach(([e, t]) => {
1746
+ let c = /* @__PURE__ */ new Float32Array(20), l = /* @__PURE__ */ new Float32Array(20);
1747
+ return Object.entries(Ut).forEach(([e, t]) => {
1717
1748
  if (!t) return;
1718
- let n = i[e];
1719
- l.set($(n.color), t * 4);
1720
- let [r, a] = n.ringDash || [0, 0];
1721
- u.set([
1749
+ let n = r[e];
1750
+ c.set($(n.color), t * 4);
1751
+ let [i, a] = n.ringDash || [0, 0];
1752
+ l.set([
1722
1753
  n.ringR,
1723
1754
  n.ringWidth,
1724
- r,
1755
+ i,
1725
1756
  a
1726
1757
  ], t * 4);
1727
1758
  }), {
1728
- haloFill: o,
1729
- haloRing: s,
1730
- haloGeom: c,
1731
- markColor: l,
1732
- markGeom: u,
1759
+ haloFill: a,
1760
+ haloRing: o,
1761
+ haloGeom: s,
1762
+ markColor: c,
1763
+ markGeom: l,
1733
1764
  markMin: new Float32Array([
1734
- J.ring,
1735
- J.edge,
1736
- J.gap
1765
+ q.ring,
1766
+ q.edge,
1767
+ q.gap
1737
1768
  ]),
1738
- core: new Float32Array($(a)),
1739
- coreRatio: P
1769
+ core: new Float32Array($(i)),
1770
+ coreRatio: N
1740
1771
  };
1741
1772
  }
1742
- var Yt = [
1773
+ var Qt = [
1743
1774
  {
1744
1775
  name: "grid",
1745
- vert: yt,
1746
- frag: bt,
1776
+ vert: St,
1777
+ frag: Ct,
1747
1778
  stride: 8,
1748
1779
  attribs: [[
1749
1780
  1,
@@ -1757,8 +1788,8 @@ var Yt = [
1757
1788
  },
1758
1789
  {
1759
1790
  name: "lanes",
1760
- vert: xt,
1761
- frag: St,
1791
+ vert: wt,
1792
+ frag: Tt,
1762
1793
  stride: 14,
1763
1794
  attribs: [
1764
1795
  [
@@ -1785,8 +1816,8 @@ var Yt = [
1785
1816
  },
1786
1817
  {
1787
1818
  name: "rings",
1788
- vert: Ct,
1789
- frag: wt,
1819
+ vert: Et,
1820
+ frag: Dt,
1790
1821
  stride: 10,
1791
1822
  attribs: [
1792
1823
  [
@@ -1808,8 +1839,8 @@ var Yt = [
1808
1839
  },
1809
1840
  {
1810
1841
  name: "straight",
1811
- vert: kt(1),
1812
- frag: At,
1842
+ vert: Mt(1),
1843
+ frag: Nt,
1813
1844
  stride: 19,
1814
1845
  verts: 8,
1815
1846
  attribs: [
@@ -1848,8 +1879,8 @@ var Yt = [
1848
1879
  },
1849
1880
  {
1850
1881
  name: "curved",
1851
- vert: kt(24),
1852
- frag: At,
1882
+ vert: Mt(24),
1883
+ frag: Nt,
1853
1884
  stride: 19,
1854
1885
  verts: 54,
1855
1886
  attribs: [
@@ -1888,8 +1919,8 @@ var Yt = [
1888
1919
  },
1889
1920
  {
1890
1921
  name: "tips",
1891
- vert: jt,
1892
- frag: Mt,
1922
+ vert: Pt,
1923
+ frag: Ft,
1893
1924
  stride: 9,
1894
1925
  attribs: [
1895
1926
  [
@@ -1912,8 +1943,8 @@ var Yt = [
1912
1943
  },
1913
1944
  {
1914
1945
  name: "packets",
1915
- vert: Nt,
1916
- frag: Pt,
1946
+ vert: It,
1947
+ frag: Lt,
1917
1948
  stride: 18,
1918
1949
  attribs: [
1919
1950
  [
@@ -1946,8 +1977,8 @@ var Yt = [
1946
1977
  },
1947
1978
  {
1948
1979
  name: "nodes",
1949
- vert: Tt,
1950
- frag: Et,
1980
+ vert: Ot,
1981
+ frag: kt,
1951
1982
  stride: 12,
1952
1983
  attribs: [
1953
1984
  [
@@ -1968,17 +1999,17 @@ var Yt = [
1968
1999
  ],
1969
2000
  constants: "nodes"
1970
2001
  }
1971
- ], Xt = {
2002
+ ], $t = {
1972
2003
  nodes(e, t, n) {
1973
- e.uniform4fv(t("u_haloFill"), n.haloFill), e.uniform4fv(t("u_haloRing"), n.haloRing), e.uniform4fv(t("u_haloGeom"), n.haloGeom), e.uniform4fv(t("u_markColor"), n.markColor), e.uniform4fv(t("u_markGeom"), n.markGeom), e.uniform3fv(t("u_markMin"), n.markMin), e.uniform4fv(t("u_core"), n.core), e.uniform1f(t("u_coreRatio"), n.coreRatio), e.uniform4f(t("u_shape"), A.roundedHalf, A.roundedCorner, A.hexInradius, A.squareHalf), e.uniform2f(t("u_shape2"), A.squareCorner, A.diamondHalf), e.uniform1f(t("u_glyphMin"), 14);
2004
+ e.uniform4fv(t("u_haloFill"), n.haloFill), e.uniform4fv(t("u_haloRing"), n.haloRing), e.uniform4fv(t("u_haloGeom"), n.haloGeom), e.uniform4fv(t("u_markColor"), n.markColor), e.uniform4fv(t("u_markGeom"), n.markGeom), e.uniform3fv(t("u_markMin"), n.markMin), e.uniform4fv(t("u_core"), n.core), e.uniform1f(t("u_coreRatio"), n.coreRatio), e.uniform4f(t("u_shape"), J.roundedHalf, J.roundedCorner, J.hexInradius, J.squareHalf), e.uniform2f(t("u_shape2"), J.squareCorner, J.diamondHalf), e.uniform1f(t("u_glyphMin"), 14);
1974
2005
  },
1975
2006
  edges(e, t, n) {
1976
2007
  e.uniform3fv(t("u_markMin"), n.markMin);
1977
2008
  },
1978
2009
  tips(e, t) {
1979
- e.uniform4f(t("u_tip"), M.length, M.spread, H.halfLength, H.width), e.uniform4f(t("u_end"), B.strokeWidth, B.barHalf, B.diamondHalf, B.diamondAcross), e.uniform2f(t("u_tick"), B.tickHalf, B.tickWidth);
2010
+ e.uniform4f(t("u_tip"), j.length, j.spread, U.halfLength, U.width), e.uniform4f(t("u_end"), B.strokeWidth, B.barHalf, B.diamondHalf, B.diamondAcross), e.uniform2f(t("u_tick"), B.tickHalf, B.tickWidth);
1980
2011
  }
1981
- }, Zt = {
2012
+ }, en = {
1982
2013
  alpha: !0,
1983
2014
  premultipliedAlpha: !0,
1984
2015
  antialias: !1,
@@ -1987,7 +2018,7 @@ var Yt = [
1987
2018
  preserveDrawingBuffer: !1,
1988
2019
  powerPreference: "high-performance"
1989
2020
  };
1990
- function Qt(e, t, n, r) {
2021
+ function tn(e, t, n, r) {
1991
2022
  let i = e.createShader(t);
1992
2023
  if (e.shaderSource(i, n), e.compileShader(i), !e.getShaderParameter(i, e.COMPILE_STATUS)) {
1993
2024
  let t = e.getShaderInfoLog(i);
@@ -1995,23 +2026,23 @@ function Qt(e, t, n, r) {
1995
2026
  }
1996
2027
  return i;
1997
2028
  }
1998
- function $t(e, t, n, r) {
1999
- let i = Qt(e, e.VERTEX_SHADER, t, `${r} vertex`), a = Qt(e, e.FRAGMENT_SHADER, n, `${r} fragment`), o = e.createProgram();
2029
+ function nn(e, t, n, r) {
2030
+ let i = tn(e, e.VERTEX_SHADER, t, `${r} vertex`), a = tn(e, e.FRAGMENT_SHADER, n, `${r} fragment`), o = e.createProgram();
2000
2031
  if (e.attachShader(o, i), e.attachShader(o, a), e.linkProgram(o), e.deleteShader(i), e.deleteShader(a), !e.getProgramParameter(o, e.LINK_STATUS)) {
2001
2032
  let t = e.getProgramInfoLog(o);
2002
2033
  throw e.deleteProgram(o), Error(`${r} program did not link: ${t}`);
2003
2034
  }
2004
2035
  return o;
2005
2036
  }
2006
- var en = (e) => !e || e.plain ? 0 : e.version;
2007
- function tn(e, t, n, r = null) {
2008
- let i = Jt(n, r);
2037
+ var rn = (e) => !e || e.plain ? 0 : e.version;
2038
+ function an(e, t, n, r = null) {
2039
+ let i = Zt(n, r);
2009
2040
  t.passes.forEach((t) => {
2010
- t.spec.constants && (e.useProgram(t.program), Xt[t.spec.constants](e, t.at, i));
2011
- }), t.theme = n, t.styleKey = en(r);
2041
+ t.spec.constants && (e.useProgram(t.program), $t[t.spec.constants](e, t.at, i));
2042
+ }), t.theme = n, t.styleKey = rn(r);
2012
2043
  }
2013
- function nn(e, t, n) {
2014
- let r = $t(e, t.vert, t.frag, t.name), i = e.createVertexArray(), a = e.createBuffer();
2044
+ function on(e, t, n) {
2045
+ let r = nn(e, t.vert, t.frag, t.name), i = e.createVertexArray(), a = e.createBuffer();
2015
2046
  e.bindVertexArray(i), t.verts || (e.bindBuffer(e.ARRAY_BUFFER, n), e.enableVertexAttribArray(0), e.vertexAttribPointer(0, 2, e.FLOAT, !1, 0, 0), e.vertexAttribDivisor(0, 0)), e.bindBuffer(e.ARRAY_BUFFER, a), t.attribs.forEach(([n, r, i]) => {
2016
2047
  e.enableVertexAttribArray(n), e.vertexAttribPointer(n, r, e.FLOAT, !1, t.stride * 4, i * 4), e.vertexAttribDivisor(n, 1);
2017
2048
  }), e.bindVertexArray(null);
@@ -2031,11 +2062,11 @@ function nn(e, t, n) {
2031
2062
  }
2032
2063
  };
2033
2064
  }
2034
- var rn = {
2065
+ var sn = {
2035
2066
  strokes: {
2036
2067
  name: "strokes",
2037
- vert: Ct,
2038
- frag: wt,
2068
+ vert: Et,
2069
+ frag: Dt,
2039
2070
  stride: 10,
2040
2071
  attribs: [
2041
2072
  [
@@ -2057,8 +2088,8 @@ var rn = {
2057
2088
  },
2058
2089
  icons: {
2059
2090
  name: "icons",
2060
- vert: Ft,
2061
- frag: It,
2091
+ vert: Rt,
2092
+ frag: zt,
2062
2093
  stride: 4,
2063
2094
  attribs: [[
2064
2095
  1,
@@ -2067,7 +2098,7 @@ var rn = {
2067
2098
  ]]
2068
2099
  }
2069
2100
  };
2070
- function an(e, t = "dark", n = null) {
2101
+ function cn(e, t = "dark", n = null) {
2071
2102
  let r = e.createBuffer();
2072
2103
  e.bindBuffer(e.ARRAY_BUFFER, r), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
2073
2104
  -1,
@@ -2081,7 +2112,7 @@ function an(e, t = "dark", n = null) {
2081
2112
  ]), e.STATIC_DRAW);
2082
2113
  let i = {
2083
2114
  corners: r,
2084
- passes: Yt.map((t) => nn(e, t, r)),
2115
+ passes: Qt.map((t) => on(e, t, r)),
2085
2116
  theme: t,
2086
2117
  styleKey: 0,
2087
2118
  extras: {
@@ -2091,40 +2122,40 @@ function an(e, t = "dark", n = null) {
2091
2122
  textures: /* @__PURE__ */ new Map(),
2092
2123
  iconStore: null
2093
2124
  };
2094
- return tn(e, i, t, n), i;
2125
+ return an(e, i, t, n), i;
2095
2126
  }
2096
- function on(e, t) {
2127
+ function ln(e, t) {
2097
2128
  e.deleteBuffer(t.corners), t.textures.forEach(({ texture: t }) => e.deleteTexture(t)), [...t.passes, ...Object.values(t.extras).filter(Boolean)].forEach((t) => {
2098
2129
  e.deleteProgram(t.program), e.deleteVertexArray(t.vao), e.deleteBuffer(t.buffer);
2099
2130
  });
2100
2131
  }
2101
- function sn(e, t = {}) {
2102
- let n = t.gl || e.getContext("webgl2", Zt);
2132
+ function un(e, t = {}) {
2133
+ let n = t.gl || e.getContext("webgl2", en);
2103
2134
  if (!n) throw Error("WebGL2 is not available");
2104
- let r = t.mapStyle || (() => L), i = {
2135
+ let r = t.mapStyle || (() => I), i = {
2105
2136
  uploads: 0,
2106
2137
  draws: 0
2107
- }, a = an(n), o = !1, s = 0, c = 0, l = null, u = null, d, f = null;
2108
- function p(e) {
2109
- return a.extras[e] || (a.extras[e] = nn(n, rn[e], a.corners)), a.extras[e];
2138
+ }, a = cn(n), o = !1, s = 0, c = 0, l = null, u = null, p, m = null, h = null;
2139
+ function g(e) {
2140
+ return a.extras[e] || (a.extras[e] = on(n, sn[e], a.corners)), a.extras[e];
2110
2141
  }
2111
- function m() {
2142
+ function _() {
2112
2143
  a.passes.forEach((e) => {
2113
2144
  let t = l[e.spec.name];
2114
2145
  e.count = t.count, t.count && (n.bindBuffer(n.ARRAY_BUFFER, e.buffer), n.bufferData(n.ARRAY_BUFFER, t.data, n.DYNAMIC_DRAW));
2115
2146
  });
2116
- for (let e of Object.keys(rn)) {
2147
+ for (let e of Object.keys(sn)) {
2117
2148
  let t = l[e];
2118
2149
  if (!t.count && !a.extras[e]) continue;
2119
- let r = p(e);
2150
+ let r = g(e);
2120
2151
  r.count = t.count, t.count && (n.bindBuffer(n.ARRAY_BUFFER, r.buffer), n.bufferData(n.ARRAY_BUFFER, t.data, n.DYNAMIC_DRAW));
2121
2152
  }
2122
2153
  i.uploads++;
2123
2154
  }
2124
- function h(e, t) {
2155
+ function v(e, t) {
2125
2156
  n.bindTexture(n.TEXTURE_2D, e), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, t ? n.NEAREST : n.LINEAR_MIPMAP_LINEAR), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, t ? n.NEAREST : n.LINEAR);
2126
2157
  }
2127
- function g(e, t, r) {
2158
+ function y(e, t, r) {
2128
2159
  let i = a.textures.get(e);
2129
2160
  if (!i || i.image !== t) {
2130
2161
  i && n.deleteTexture(i.texture);
@@ -2135,90 +2166,90 @@ function sn(e, t = {}) {
2135
2166
  pixelated: null
2136
2167
  }, a.textures.set(e, i);
2137
2168
  }
2138
- return i.pixelated !== r && (h(i.texture, r), i.pixelated = r), i.texture;
2169
+ return i.pixelated !== r && (v(i.texture, r), i.pixelated = r), i.texture;
2139
2170
  }
2140
- function _(t, p, h) {
2141
- if (f = [
2171
+ function b(t, g, v) {
2172
+ if (h = [
2142
2173
  t,
2143
- p,
2144
- h
2174
+ g,
2175
+ v
2145
2176
  ], o || !a || !s || !c) return;
2146
- let _ = r(), v = ie(t, _), y = _.values ? _.values[V] : void 0;
2147
- (a.iconStore !== _.icons || a.glyphInk !== y) && (a.textures.forEach(({ texture: e }) => n.deleteTexture(e)), a.textures.clear(), a.iconStore = _.icons, a.glyphInk = y, u = null), (v !== u || v.version !== d) && (l = {
2148
- ...Gt(v),
2149
- strokes: Kt(v),
2150
- icons: qt(v, (e) => ue(e) ? !!me(de(e), y) : E(e) ? !!S(U(e).type, U(e).ink) : !!(_.icons && _.icons.get(e)), _)
2151
- }, u = v, d = v.version, m());
2152
- let b = v.theme || "dark";
2153
- (a.theme !== b || a.styleKey !== en(_)) && tn(n, a, b, _), n.viewport(0, 0, e.width, e.height), n.clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT), n.enable(n.BLEND), n.blendFunc(n.ONE, n.ONE_MINUS_SRC_ALPHA), a.passes.forEach((t) => {
2154
- t.count && (n.useProgram(t.program), n.uniform2f(t.uniforms.viewport, s, c), n.uniform3f(t.uniforms.cam, p.x, p.y, p.zoom), n.uniform1f(t.uniforms.dpr, e.width / s), n.bindVertexArray(t.vao), t.uniforms.time && n.uniform1f(t.uniforms.time, (h || 0) / 1e3), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, t.spec.verts || 4, t.count), i.draws++);
2177
+ let b = r(), x = K(t, b), S = b.values ? b.values[V] : void 0;
2178
+ (a.iconStore !== b.icons || a.glyphInk !== S) && (a.textures.forEach(({ texture: e }) => n.deleteTexture(e)), a.textures.clear(), a.iconStore = b.icons, a.glyphInk = S, u = null), m !== b.ground && (m = b.ground, u = null), (x !== u || x.version !== p) && (l = {
2179
+ ...Jt(x),
2180
+ strokes: Yt(x),
2181
+ icons: Xt(x, (e) => fe(e) ? !!ge(pe(e), S) : w(e) ? !!ce(d(e).type, d(e).ink) : !!(b.icons && b.icons.get(e)), b)
2182
+ }, u = x, p = x.version, _());
2183
+ let C = x.theme || "dark";
2184
+ (a.theme !== C || a.styleKey !== rn(b)) && an(n, a, C, b), n.viewport(0, 0, e.width, e.height), n.clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT), n.enable(n.BLEND), n.blendFunc(n.ONE, n.ONE_MINUS_SRC_ALPHA), a.passes.forEach((t) => {
2185
+ t.count && (n.useProgram(t.program), n.uniform2f(t.uniforms.viewport, s, c), n.uniform3f(t.uniforms.cam, g.x, g.y, g.zoom), n.uniform1f(t.uniforms.dpr, e.width / s), n.bindVertexArray(t.vao), t.uniforms.time && n.uniform1f(t.uniforms.time, (v || 0) / 1e3), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, t.spec.verts || 4, t.count), i.draws++);
2155
2186
  });
2156
- let C = a.extras.strokes;
2157
- C && C.count && (n.useProgram(C.program), n.uniform2f(C.uniforms.viewport, s, c), n.uniform3f(C.uniforms.cam, p.x, p.y, p.zoom), n.uniform1f(C.uniforms.dpr, e.width / s), n.bindVertexArray(C.vao), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, C.count), i.draws++);
2158
- let w = a.extras.icons;
2159
- if (w && w.count) {
2160
- n.useProgram(w.program), n.uniform2f(w.uniforms.viewport, s, c), n.uniform3f(w.uniforms.cam, p.x, p.y, p.zoom), n.uniform1f(w.uniforms.dpr, e.width / s), n.uniform1i(w.at("u_tex"), 0), n.activeTexture(n.TEXTURE0), n.bindVertexArray(w.vao), n.bindBuffer(n.ARRAY_BUFFER, w.buffer);
2187
+ let T = a.extras.strokes;
2188
+ T && T.count && (n.useProgram(T.program), n.uniform2f(T.uniforms.viewport, s, c), n.uniform3f(T.uniforms.cam, g.x, g.y, g.zoom), n.uniform1f(T.uniforms.dpr, e.width / s), n.bindVertexArray(T.vao), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, T.count), i.draws++);
2189
+ let E = a.extras.icons;
2190
+ if (E && E.count) {
2191
+ n.useProgram(E.program), n.uniform2f(E.uniforms.viewport, s, c), n.uniform3f(E.uniforms.cam, g.x, g.y, g.zoom), n.uniform1f(E.uniforms.dpr, e.width / s), n.uniform1i(E.at("u_tex"), 0), n.activeTexture(n.TEXTURE0), n.bindVertexArray(E.vao), n.bindBuffer(n.ARRAY_BUFFER, E.buffer);
2161
2192
  for (let e of l.icons.groups) {
2162
- let t = ue(e.kind), r = E(e.kind), a = t || r ? 14 : 0;
2163
- if (a && e.maxR * 2 * p.zoom < a) continue;
2164
- n.uniform1f(w.at("u_minR"), a / 2), n.uniform1f(w.at("u_sideRatio"), t ? 1 : r ? x : 1);
2165
- let o = t ? me(de(e.kind), _.values && _.values["--corn-map-glyph"]) : r ? S(U(e.kind).type, U(e.kind).ink) : _.icons && _.icons.get(e.kind);
2166
- o && (n.bindTexture(n.TEXTURE_2D, g(e.kind, o, !!_.pixelated && !t && !r)), n.vertexAttribPointer(1, 4, n.FLOAT, !1, 16, e.first * 4 * 4), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, e.count), i.draws++);
2193
+ let t = fe(e.kind), r = w(e.kind), a = t || r ? 14 : 0;
2194
+ if (a && e.maxR * 2 * g.zoom < a) continue;
2195
+ n.uniform1f(E.at("u_minR"), a / 2), n.uniform1f(E.at("u_sideRatio"), t ? 1 : r ? f : 1);
2196
+ let o = t ? ge(pe(e.kind), b.values && b.values["--corn-map-glyph"]) : r ? ce(d(e.kind).type, d(e.kind).ink) : b.icons && b.icons.get(e.kind);
2197
+ o && (n.bindTexture(n.TEXTURE_2D, y(e.kind, o, !!b.pixelated && !t && !r)), n.vertexAttribPointer(1, 4, n.FLOAT, !1, 16, e.first * 4 * 4), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, e.count), i.draws++);
2167
2198
  }
2168
2199
  }
2169
2200
  n.bindVertexArray(null);
2170
2201
  }
2171
- let v = (e) => {
2202
+ let x = (e) => {
2172
2203
  e.preventDefault(), o = !0, a = null;
2173
- }, y = () => {
2204
+ }, S = () => {
2174
2205
  try {
2175
- a = an(n, f && f[0].theme || "dark", r()), o = !1, l && m(), f && _(...f);
2206
+ a = cn(n, h && h[0].theme || "dark", r()), o = !1, l && _(), h && b(...h);
2176
2207
  } catch (e) {
2177
2208
  console.warn("WebGL2 context restored but the renderer could not be rebuilt:", e.message);
2178
2209
  }
2179
2210
  };
2180
- return e.addEventListener("webglcontextlost", v), e.addEventListener("webglcontextrestored", y), {
2211
+ return e.addEventListener("webglcontextlost", x), e.addEventListener("webglcontextrestored", S), {
2181
2212
  kind: "webgl2",
2182
2213
  stats: i,
2183
2214
  resize(t, n, r) {
2184
- s = t, c = n, e.width = Math.round(t * r), e.height = Math.round(n * r), f && _(...f);
2215
+ s = t, c = n, e.width = Math.round(t * r), e.height = Math.round(n * r), h && b(...h);
2185
2216
  },
2186
- draw: _,
2187
- destroy: b,
2217
+ draw: b,
2218
+ destroy: C,
2188
2219
  release() {
2189
2220
  let e = o;
2190
- b();
2221
+ C();
2191
2222
  try {
2192
2223
  let t = !e && n.getExtension ? n.getExtension("WEBGL_lose_context") : null;
2193
2224
  t && t.loseContext();
2194
2225
  } catch {}
2195
2226
  }
2196
2227
  };
2197
- function b() {
2198
- e.removeEventListener("webglcontextlost", v), e.removeEventListener("webglcontextrestored", y), a && !o && on(n, a), a = null, o = !0;
2228
+ function C() {
2229
+ e.removeEventListener("webglcontextlost", x), e.removeEventListener("webglcontextrestored", S), a && !o && ln(n, a), a = null, o = !0;
2199
2230
  }
2200
2231
  }
2201
2232
  // ../explorer/renderer.js
2202
- function cn(e) {
2233
+ function dn(e) {
2203
2234
  let t = e.ownerDocument.createElement("canvas");
2204
2235
  return t.className = "hx-overlay", t.setAttribute("data-corn", "map-overlay"), t.setAttribute("part", "map-overlay"), t.setAttribute("aria-hidden", "true"), e.after(t), t;
2205
2236
  }
2206
- function ln(e, t = {}) {
2237
+ function fn(e, t = {}) {
2207
2238
  let n = t.prefer || null, r = t.mapStyle ? { mapStyle: t.mapStyle } : {};
2208
- if (n === "canvas2d") return Me(e, r);
2239
+ if (n === "canvas2d") return Fe(e, r);
2209
2240
  let i = null;
2210
2241
  try {
2211
- i = e.getContext("webgl2", Zt);
2242
+ i = e.getContext("webgl2", en);
2212
2243
  } catch {}
2213
- if (!i) return Me(e, r);
2244
+ if (!i) return Fe(e, r);
2214
2245
  try {
2215
- return sn(e, {
2246
+ return un(e, {
2216
2247
  gl: i,
2217
2248
  ...r
2218
2249
  });
2219
2250
  } catch (n) {
2220
2251
  console.warn(`WebGL2 renderer unavailable, drawing with Canvas 2D: ${n.message}`);
2221
- let i = (t.makeStandIn || cn)(e), a = Me(i, r);
2252
+ let i = (t.makeStandIn || dn)(e), a = Fe(i, r);
2222
2253
  return {
2223
2254
  ...a,
2224
2255
  destroy() {
@@ -2228,7 +2259,7 @@ function ln(e, t = {}) {
2228
2259
  }
2229
2260
  }
2230
2261
  // ../explorer/cluster.js
2231
- function un(e, t) {
2262
+ function pn(e, t) {
2232
2263
  let n = /* @__PURE__ */ new Map();
2233
2264
  for (let e of t) !e.kind && !e.dashed && e.from && e.to && (n.get(e.from) || n.set(e.from, []).get(e.from)).push(e.to);
2234
2265
  let r = /* @__PURE__ */ new Set([e]), i = [e];
@@ -2236,139 +2267,139 @@ function un(e, t) {
2236
2267
  return r;
2237
2268
  }
2238
2269
  // ../explorer/input.js
2239
- function dn(e) {
2240
- let { state: n } = e, { render: r, getSpatialIndex: i, queueFrameWork: a, screenToWorld: o, getMinZoom: s, setHoverNode: c, labelNodeAt: l, fitGraphToViewport: u, fitPadding: d } = e.map, f = (t) => e.emit("select", t), p = () => e.emit("background"), m = () => e.emit("grab"), h = !1, g = null, _ = {
2270
+ function mn(e) {
2271
+ let { state: t } = e, { render: n, getSpatialIndex: r, queueFrameWork: a, screenToWorld: o, getMinZoom: s, setHoverNode: c, labelNodeAt: l, fitGraphToViewport: u, fitPadding: d } = e.map, f = (t) => e.emit("select", t), p = () => e.emit("background"), m = () => e.emit("grab"), h = !1, g = null, _ = {
2241
2272
  x: 0,
2242
2273
  y: 0
2243
- }, y = {
2274
+ }, v = {
2244
2275
  x: 0,
2245
2276
  y: 0
2246
- }, b = !1, x = null, S = null, C = 0, w = null, T = !1, E = null, D = null, O = null, A = !1, j = "", M = () => n.isFreeform && n.view === "orbit";
2247
- function N(e) {
2248
- let t = n.canvas.getBoundingClientRect(), r = e.touches ? e.touches[0] : e, i = t.width && n.width ? n.width / t.width : 1, a = t.height && n.height ? n.height / t.height : 1;
2277
+ }, b = !1, x = null, S = null, C = 0, w = null, T = !1, E = null, D = null, O = null, te = !1, k = "", A = () => t.isFreeform && t.view === "orbit";
2278
+ function j(e) {
2279
+ let n = t.canvas.getBoundingClientRect(), r = e.touches ? e.touches[0] : e, i = n.width && t.width ? t.width / n.width : 1, a = n.height && t.height ? t.height / n.height : 1;
2249
2280
  return {
2250
- x: (r.clientX - t.left) * i,
2251
- y: (r.clientY - t.top) * a
2281
+ x: (r.clientX - n.left) * i,
2282
+ y: (r.clientY - n.top) * a
2252
2283
  };
2253
2284
  }
2254
- let P = {
2285
+ let M = {
2255
2286
  nodes: null,
2256
2287
  size: -1,
2257
2288
  map: null
2258
2289
  };
2259
- function F(e) {
2260
- return (P.nodes !== n.nodes || P.size !== n.nodes.length) && (P = {
2261
- nodes: n.nodes,
2262
- size: n.nodes.length,
2263
- map: new Map(n.nodes.map((e) => [e.id, e]))
2264
- }), P.map.get(e) || null;
2265
- }
2266
- function I(e, t, r) {
2267
- let a = Fe(i(), n.camera, e, t, r);
2268
- return a ? F(a.id) : null;
2269
- }
2270
- let te = (e) => Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY);
2271
- function L(e) {
2272
- let t = n.canvas.getBoundingClientRect();
2290
+ function N(e) {
2291
+ return (M.nodes !== t.nodes || M.size !== t.nodes.length) && (M = {
2292
+ nodes: t.nodes,
2293
+ size: t.nodes.length,
2294
+ map: new Map(t.nodes.map((e) => [e.id, e]))
2295
+ }), M.map.get(e) || null;
2296
+ }
2297
+ function P(e, n, i) {
2298
+ let a = Re(r(), t.camera, e, n, i);
2299
+ return a ? N(a.id) : null;
2300
+ }
2301
+ let F = (e) => Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY);
2302
+ function I(e) {
2303
+ let n = t.canvas.getBoundingClientRect();
2273
2304
  return {
2274
- x: (e.touches[0].clientX + e.touches[1].clientX) / 2 - t.left,
2275
- y: (e.touches[0].clientY + e.touches[1].clientY) / 2 - t.top
2305
+ x: (e.touches[0].clientX + e.touches[1].clientX) / 2 - n.left,
2306
+ y: (e.touches[0].clientY + e.touches[1].clientY) / 2 - n.top
2276
2307
  };
2277
2308
  }
2278
- function R(e) {
2309
+ function L(e) {
2279
2310
  if (T = !0, m(), c(null), e.touches && e.touches.length === 2) {
2280
- w = se(n.camera, te(e), L(e)), E = null, h = !1, g = null, x = null;
2311
+ w = i(t.camera, F(e), I(e)), E = null, h = !1, g = null, x = null;
2281
2312
  return;
2282
2313
  }
2283
- let t = !!(e.touches && e.touches.length > 0), r = N(e);
2284
- y = {
2314
+ let n = !!(e.touches && e.touches.length > 0), r = j(e);
2315
+ v = {
2285
2316
  x: r.x,
2286
2317
  y: r.y
2287
- }, b = !1, E = null, x = I(r.x, r.y, t), M() && x ? (g = x, e.cancelable && e.preventDefault()) : (h = !0, _ = r);
2318
+ }, b = !1, E = null, x = P(r.x, r.y, n), A() && x ? (g = x, e.cancelable && e.preventDefault()) : (h = !0, _ = r);
2288
2319
  }
2289
- function z() {
2290
- D && w && Object.assign(n.camera, ee(w, D.dist, D.mid, s())), D = null;
2291
- let r = E;
2292
- if (E = null, r) {
2293
- if (g && M()) {
2294
- let i = o(r.x, r.y);
2295
- g.x = i.x, g.y = i.y, n.freeformPositions[g.id] = {
2296
- x: i.x,
2297
- y: i.y
2298
- }, e.touchScene(), t(e);
2299
- } else h && (n.camera.x += r.x - _.x, n.camera.y += r.y - _.y, _ = r);
2320
+ function R() {
2321
+ D && w && Object.assign(t.camera, y(w, D.dist, D.mid, s())), D = null;
2322
+ let n = E;
2323
+ if (E = null, n) {
2324
+ if (g && A()) {
2325
+ let r = o(n.x, n.y);
2326
+ g.x = r.x, g.y = r.y, t.freeformPositions[g.id] = {
2327
+ x: r.x,
2328
+ y: r.y
2329
+ }, e.touchScene(), ie(e);
2330
+ } else h && (t.camera.x += n.x - _.x, t.camera.y += n.y - _.y, _ = n);
2300
2331
  }
2301
2332
  }
2302
- function ne() {
2333
+ function z() {
2303
2334
  let e = O;
2304
2335
  if (O = null, !e || h || g) return;
2305
- let t = I(e.x, e.y, !1);
2306
- B(!!t), c(t ? t.id : null);
2336
+ let t = P(e.x, e.y, !1);
2337
+ ne(!!t), c(t ? t.id : null);
2307
2338
  }
2308
- function B(e) {
2309
- e !== A && n.canvas && (e && (j = n.canvas.style.cursor), A = e, n.canvas.style.cursor = e ? "pointer" : j);
2339
+ function ne(e) {
2340
+ e !== te && t.canvas && (e && (k = t.canvas.style.cursor), te = e, t.canvas.style.cursor = e ? "pointer" : k);
2310
2341
  }
2311
- function V(e) {
2342
+ function re(e) {
2312
2343
  if (e.touches && e.touches.length === 2 && w) {
2313
2344
  e.cancelable && e.preventDefault(), D = {
2314
- dist: te(e),
2315
- mid: L(e)
2316
- }, a(z);
2345
+ dist: F(e),
2346
+ mid: I(e)
2347
+ }, a(R);
2317
2348
  return;
2318
2349
  }
2319
- let t = N(e);
2320
- Math.hypot(t.x - y.x, t.y - y.y) > 8 && (b = !0), g && M() || h ? (e.cancelable && e.preventDefault(), E = t, a(z)) : e.touches || (O = t, a(ne, { draw: !1 }));
2350
+ let t = j(e);
2351
+ Math.hypot(t.x - v.x, t.y - v.y) > 8 && (b = !0), g && A() || h ? (e.cancelable && e.preventDefault(), E = t, a(R)) : e.touches || (O = t, a(z, { draw: !1 }));
2321
2352
  }
2322
- function H(e) {
2323
- z();
2324
- let t = !!(e.changedTouches && e.changedTouches.length > 0), r = n.canvas.getBoundingClientRect(), i = t ? {
2353
+ function B(e) {
2354
+ R();
2355
+ let n = !!(e.changedTouches && e.changedTouches.length > 0), r = t.canvas.getBoundingClientRect(), i = n ? {
2325
2356
  x: e.changedTouches[0].clientX - r.left,
2326
2357
  y: e.changedTouches[0].clientY - r.top
2327
- } : N(e);
2358
+ } : j(e);
2328
2359
  if (!b && T) {
2329
2360
  if (x) {
2330
- let e = I(i.x, i.y, t);
2361
+ let e = P(i.x, i.y, n);
2331
2362
  if (e && e.id === x.id) {
2332
- if (!M()) f(x);
2363
+ if (!A()) f(x);
2333
2364
  else {
2334
2365
  let e = Date.now();
2335
2366
  S && S.id === x.id && e - C < 380 ? (f(x), S = null, C = 0) : (S = x, C = e);
2336
2367
  }
2337
2368
  }
2338
2369
  } else {
2339
- let e = F(l(i.x, i.y));
2340
- e && k.includes(e.type) && e.id !== "root" ? u(d(), un(e.id, n.edges)) : n.selectedNode && p();
2370
+ let e = N(l(i.x, i.y));
2371
+ e && ee.includes(e.type) && e.id !== "root" ? u(d(), pn(e.id, t.edges)) : t.selectedNode && p();
2341
2372
  }
2342
2373
  }
2343
2374
  h = !1, g = null, x = null, w = null, D = null, T = !1;
2344
2375
  }
2345
- let { canvas: U } = n, W = !(e.root && e.root.nodeType === 9), G = (t) => {
2346
- if (W && !t.ctrlKey && !t.metaKey && e.active() !== n.canvas) return;
2347
- t.preventDefault(), m();
2348
- let i = N(t);
2349
- Object.assign(n.camera, v(n.camera, t.deltaY < 0 ? 1.12 : .88, i.x, i.y, s())), r();
2350
- }, K = e.root || U, re = [
2351
- e.listen(U, "mousedown", R),
2352
- e.listen(U, "mousemove", V),
2353
- e.listen(U, "mouseleave", () => {
2354
- O = null, B(!1), c(null);
2376
+ let { canvas: V } = t, H = !(e.root && e.root.nodeType === 9), U = (r) => {
2377
+ if (H && !r.ctrlKey && !r.metaKey && e.active() !== t.canvas) return;
2378
+ r.preventDefault(), m();
2379
+ let i = j(r);
2380
+ Object.assign(t.camera, se(t.camera, r.deltaY < 0 ? 1.12 : .88, i.x, i.y, s())), n();
2381
+ }, W = e.root || V, G = [
2382
+ e.listen(V, "mousedown", L),
2383
+ e.listen(V, "mousemove", re),
2384
+ e.listen(V, "mouseleave", () => {
2385
+ O = null, ne(!1), c(null);
2355
2386
  }),
2356
- e.listen(K, "mouseup", H),
2357
- e.listen(U, "touchstart", R, { passive: !1 }),
2358
- e.listen(U, "touchmove", V, { passive: !1 }),
2359
- e.listen(K, "touchend", H, { passive: !1 }),
2360
- e.listen(K, "touchcancel", H, { passive: !1 }),
2361
- e.listen(U, "wheel", G, { passive: !1 })
2387
+ e.listen(W, "mouseup", B),
2388
+ e.listen(V, "touchstart", L, { passive: !1 }),
2389
+ e.listen(V, "touchmove", re, { passive: !1 }),
2390
+ e.listen(W, "touchend", B, { passive: !1 }),
2391
+ e.listen(W, "touchcancel", B, { passive: !1 }),
2392
+ e.listen(V, "wheel", U, { passive: !1 })
2362
2393
  ];
2363
- return () => re.forEach((e) => e());
2394
+ return () => G.forEach((e) => e());
2364
2395
  }
2365
2396
  // ../explorer/pieces/map.js
2366
- var fn = "Arrow keys pan, plus and minus zoom, 0 fits the map. N and P select the next and the previous node, Home and End the first and the last. F frames the selected node and what it lights. Escape clears the selection.", pn = "<canvas id=\"graph-canvas\" data-corn=\"map-canvas\" tabindex=\"0\" role=\"application\" aria-roledescription=\"map\" aria-label=\"Topology map\" aria-describedby=\"map-keys-help\"></canvas>", mn = ({ keysHelp: e = fn } = {}) => ({ stage: `${pn}
2367
- <p id="map-keys-help" class="hx-sr-only">${C(e)}</p>
2397
+ var hn = "Arrow keys pan, plus and minus zoom, 0 fits the map. N and P select the next and the previous node, Home and End the first and the last. F frames the selected node and what it lights. Escape clears the selection.", gn = "<canvas id=\"graph-canvas\" data-corn=\"map-canvas\" tabindex=\"0\" role=\"application\" aria-roledescription=\"map\" aria-label=\"Topology map\" aria-describedby=\"map-keys-help\"></canvas>", _n = ({ keysHelp: e = hn } = {}) => ({ stage: `${gn}
2398
+ <p id="map-keys-help" class="hx-sr-only">${p(e)}</p>
2368
2399
  <p id="map-announcer" class="hx-sr-only" role="status" aria-live="polite"></p>
2369
2400
  <canvas id="label-canvas" data-corn="label-canvas" aria-hidden="true"></canvas>` });
2370
- function hn(e, t, n) {
2371
- let r = oe(t, e, "<div data-corn=\"map-stage\"></div>", null, "stage"), i = n.mountStatus(r[0], t, { follow: !1 });
2401
+ function vn(e, t, n) {
2402
+ let r = s(t, e, "<div data-corn=\"map-stage\"></div>", null, "stage"), i = n.mountStatus(r[0], t, { follow: !1 });
2372
2403
  i.refuse("second-map"), t.emit("piece:refused", {
2373
2404
  piece: "map",
2374
2405
  reason: "second-map",
@@ -2391,16 +2422,16 @@ function hn(e, t, n) {
2391
2422
  }
2392
2423
  };
2393
2424
  }
2394
- function gn(e) {
2425
+ function yn(e) {
2395
2426
  let t = e.nodeType === 11 ? e.host : e;
2396
2427
  return t && typeof t.getRootNode == "function" ? t.getRootNode() : null;
2397
2428
  }
2398
- function _n(e, t, n = {}) {
2399
- return !t && n.src !== void 0 && n.src !== null && n.src !== "" ? vn(e, n) : yn(e, t, n, null);
2429
+ function bn(e, t, n = {}) {
2430
+ return !t && n.src !== void 0 && n.src !== null && n.src !== "" ? xn(e, n) : Sn(e, t, n, null);
2400
2431
  }
2401
- function vn(e, t) {
2432
+ function xn(e, t) {
2402
2433
  let n = e.nodeType === 11 ? e.host : e, r = {}, i = null, a = !1;
2403
- return import("./scope-CUhp8mkf.js").then((e) => e.n).then(({ mountScope: o }) => {
2434
+ return import("./scope-2m2VmJXn.js").then((e) => e.n).then(({ mountScope: o }) => {
2404
2435
  if (a) return;
2405
2436
  let s = o(n, {
2406
2437
  src: t.src,
@@ -2412,7 +2443,7 @@ function vn(e, t) {
2412
2443
  onAuth: t.onAuth,
2413
2444
  onError: t.onError
2414
2445
  });
2415
- i = yn(e, s.instance, {
2446
+ i = Sn(e, s.instance, {
2416
2447
  ...t,
2417
2448
  ...r
2418
2449
  }, s);
@@ -2451,176 +2482,176 @@ function vn(e, t) {
2451
2482
  }
2452
2483
  };
2453
2484
  }
2454
- function yn(t, n, i, a) {
2455
- let o = !n;
2456
- o && (n = r({
2457
- root: t,
2458
- base: i.base || "",
2459
- fetch: i.fetch,
2460
- strings: i.strings
2485
+ function Sn(e, t, n, r) {
2486
+ let i = !t;
2487
+ i && (t = g({
2488
+ root: e,
2489
+ base: n.base || "",
2490
+ fetch: n.fetch,
2491
+ strings: n.strings
2461
2492
  }));
2462
- let s = u(n), c = () => {};
2463
- if (s) try {
2464
- c = n.attach(t);
2493
+ let a = T(t), c = () => {};
2494
+ if (a) try {
2495
+ c = t.attach(e);
2465
2496
  } catch {
2466
- return a && a.destroy(), hn(t, n, s);
2467
- }
2468
- let { state: l } = n, d = s ? s.source : null;
2469
- if (i.tokens) {
2470
- let e = gn(t);
2471
- e && b(e.nodeType === 9 ? e : e.ownerDocument, i.tokens), e && e.nodeType === 11 && b(e, i.tokens);
2472
- }
2473
- let p = y(n);
2474
- p.own(c), a && p.own(() => a.destroy());
2475
- let m = (e) => e === "canvas2d" ? "canvas2d" : "auto", h = (e) => e === "light" || e === "dark" ? e : "auto", g = {
2476
- renderer: m(i.renderer),
2477
- theme: h(i.theme),
2497
+ return r && r.destroy(), vn(e, t, a);
2498
+ }
2499
+ let { state: l } = t, d = a ? a.source : null;
2500
+ if (n.tokens) {
2501
+ let t = yn(e);
2502
+ t && u(t.nodeType === 9 ? t : t.ownerDocument, n.tokens), t && t.nodeType === 11 && u(t, n.tokens);
2503
+ }
2504
+ let f = o(t);
2505
+ f.own(c), r && f.own(() => r.destroy()), a && f.on("map:set", ({ nodes: e, edges: n }) => (_t(t, e, n), !0));
2506
+ let p = (e) => e === "canvas2d" ? "canvas2d" : "auto", m = (e) => e === "light" || e === "dark" ? e : "auto", h = {
2507
+ renderer: p(n.renderer),
2508
+ theme: m(n.theme),
2478
2509
  topology: void 0
2479
- }, _ = i.topology !== void 0 && i.topology !== null, v = !1, x = !1, S = mn({ keysHelp: i.keysHelp }).stage, C = i.slots && i.slots.stage ? i.slots : null, w = oe(n, t, C ? S : `<div data-corn="map-stage">${S}</div>`, C, "stage"), T = (e) => w.map((t) => t.matches(e) ? t : t.querySelector(e)).find(Boolean);
2480
- p.own(() => {
2481
- for (let e of [...w, l.canvas]) e && e.remove();
2510
+ }, _ = n.topology !== void 0 && n.topology !== null, v = !1, y = !1, x = _n({ keysHelp: n.keysHelp }).stage, S = n.slots && n.slots.stage ? n.slots : null, C = s(t, e, S ? x : `<div data-corn="map-stage">${x}</div>`, S, "stage"), w = (e) => C.map((t) => t.matches(e) ? t : t.querySelector(e)).find(Boolean);
2511
+ f.own(() => {
2512
+ for (let e of [...C, l.canvas]) e && e.remove();
2482
2513
  });
2483
- let E = T("#map-announcer");
2484
- if (E) {
2485
- let e = D(n, E);
2486
- p.on("announce:write", (t) => (e(t), !0));
2487
- }
2488
- let O = w.find((e) => e.matches("[data-corn=\"map-stage\"]")) || null;
2489
- if (d && O) {
2490
- let e = s.mountStatus(O, n, {
2514
+ let ee = w("#map-announcer");
2515
+ if (ee) {
2516
+ let e = O(t, ee);
2517
+ f.on("announce:write", (t) => (e(t), !0));
2518
+ }
2519
+ let te = C.find((e) => e.matches("[data-corn=\"map-stage\"]")) || null;
2520
+ if (d && te) {
2521
+ let e = a.mountStatus(te, t, {
2491
2522
  onRetry: () => d.load(),
2492
2523
  focusMap: () => {
2493
2524
  l.canvas && l.canvas.focus();
2494
2525
  }
2495
2526
  });
2496
- p.own(e.destroy);
2527
+ f.own(e.destroy);
2497
2528
  }
2498
- l.canvas = T("[data-corn=\"map-canvas\"]"), l.labelCanvas = T("[data-corn=\"label-canvas\"]"), l.ctx = n.doc.createElement("canvas").getContext("2d");
2499
- let k = lt(n, i.measureCovered ? { measureCovered: i.measureCovered } : {}), A = ne(n);
2500
- p.own(A.watch()), p.own(A.onChange(() => k.render()));
2501
- let ee = () => g.renderer === "canvas2d" ? "canvas2d" : null, j = () => k.setRenderer(ln(l.canvas, {
2502
- prefer: ee(),
2529
+ l.canvas = w("[data-corn=\"map-canvas\"]"), l.labelCanvas = w("[data-corn=\"label-canvas\"]"), l.ctx = t.doc.createElement("canvas").getContext("2d");
2530
+ let k = ft(t, n.measureCovered ? { measureCovered: n.measureCovered } : {}), A = ne(t);
2531
+ f.own(A.watch()), f.own(A.onChange(() => k.render()));
2532
+ let j = () => h.renderer === "canvas2d" ? "canvas2d" : null, M = () => k.setRenderer(fn(l.canvas, {
2533
+ prefer: j(),
2503
2534
  mapStyle: A.get
2504
- })), M = n.win && n.win.matchMedia ? n.win.matchMedia("(prefers-color-scheme: light)") : null;
2535
+ })), N = t.win && t.win.matchMedia ? t.win.matchMedia("(prefers-color-scheme: light)") : null;
2505
2536
  function P() {
2506
- if (g.theme === "light" || g.theme === "dark") return g.theme;
2507
- if (s && (s.theme === "light" || s.theme === "dark")) return s.theme;
2508
- let t = n.doc && n.doc.documentElement, r = t ? t.getAttribute("data-theme") : null;
2509
- return r === "light" || r === "dark" ? r : e("system", !!(M && M.matches));
2537
+ if (h.theme === "light" || h.theme === "dark") return h.theme;
2538
+ if (a && (a.theme === "light" || a.theme === "dark")) return a.theme;
2539
+ let e = t.doc && t.doc.documentElement, n = e ? e.getAttribute("data-theme") : null;
2540
+ return n === "light" || n === "dark" ? n : b("system", !!(N && N.matches));
2510
2541
  }
2511
2542
  function F() {
2512
2543
  if (v) return;
2513
2544
  let e = P();
2514
- A.refresh(), l.theme !== e && (l.theme = e, n.touchScene()), k.render();
2545
+ A.refresh(), l.theme !== e && (l.theme = e, t.touchScene()), k.render();
2515
2546
  }
2516
- l.theme = P(), s && p.own(s.serverTheme.adopt(t)), s && (p.on("theme", () => F()), p.on("scope:theme", () => F())), M && M.addEventListener && (M.addEventListener("change", F), p.own(() => M.removeEventListener("change", F)));
2517
- let I = n.win && n.win.MutationObserver;
2518
- if (I && n.doc && n.doc.documentElement) {
2547
+ l.theme = P(), a && f.own(a.serverTheme.adopt(e)), a && (f.on("theme", () => F()), f.on("scope:theme", () => F())), N && N.addEventListener && (N.addEventListener("change", F), f.own(() => N.removeEventListener("change", F)));
2548
+ let I = t.win && t.win.MutationObserver;
2549
+ if (I && t.doc && t.doc.documentElement) {
2519
2550
  let e = new I(F);
2520
- e.observe(n.doc.documentElement, {
2551
+ e.observe(t.doc.documentElement, {
2521
2552
  attributes: !0,
2522
2553
  attributeFilter: ["data-theme", "class"]
2523
- }), p.own(() => e.disconnect());
2554
+ }), f.own(() => e.disconnect());
2524
2555
  }
2525
- j();
2526
- let te = () => pt(n), L = () => {
2556
+ M();
2557
+ let L = () => gt(t), R = () => {
2527
2558
  l.nodes.length && k.fitGraphToViewport(k.fitPadding());
2528
- }, R = (e) => l.nodes.find((t) => t.id === e) || null, z = null;
2529
- p.on("select", (e) => q(n, e, { source: "tap" })), p.on("background", () => N(n, { source: "tap" })), p.on("grab", () => re(n)), p.on("selection", ({ node: e, edge: t, source: n }) => {
2530
- v || ((e || t) && (z = null), i.onSelect && (e ? i.onSelect({
2559
+ }, z = (e) => l.nodes.find((t) => t.id === e) || null, B = null;
2560
+ f.on("select", (e) => G(t, e, { source: "tap" })), f.on("background", () => H(t, { source: "tap" })), f.on("grab", () => re(t)), f.on("selection", ({ node: e, edge: t, source: r }) => {
2561
+ v || ((e || t) && (B = null), n.onSelect && (e ? n.onSelect({
2531
2562
  id: e.id,
2532
2563
  kind: "node",
2533
- source: n
2534
- }) : t ? i.onSelect({
2564
+ source: r
2565
+ }) : t ? n.onSelect({
2535
2566
  id: `${t.from}->${t.to}`,
2536
2567
  kind: "edge",
2537
2568
  from: t.from,
2538
2569
  to: t.to,
2539
- source: n
2540
- }) : i.onSelect({
2570
+ source: r
2571
+ }) : n.onSelect({
2541
2572
  id: null,
2542
2573
  kind: null,
2543
- source: n
2574
+ source: r
2544
2575
  })));
2545
2576
  });
2546
- function B(e) {
2547
- let t = R(String(e));
2548
- return !t || v ? !1 : (q(n, t, {
2577
+ function V(e) {
2578
+ let n = z(String(e));
2579
+ return !n || v ? !1 : (G(t, n, {
2549
2580
  frame: !0,
2550
2581
  source: "api"
2551
2582
  }), !0);
2552
2583
  }
2553
- let V = () => {}, H = !!n.root && n.root.nodeType === 9;
2554
- function U() {
2555
- let e = l.canvas, t = [dn(n)];
2556
- H || t.push(n.listen(e, "pointerdown", (t) => {
2584
+ let U = () => {}, W = !!t.root && t.root.nodeType === 9;
2585
+ function ie() {
2586
+ let e = l.canvas, n = [mn(t)];
2587
+ W || n.push(t.listen(e, "pointerdown", (t) => {
2557
2588
  if (t.pointerType === "mouse" && e.setPointerCapture) try {
2558
2589
  e.setPointerCapture(t.pointerId);
2559
2590
  } catch {}
2560
- })), f(n), W(n), t.push(() => f(n)), V = () => t.forEach((e) => e());
2591
+ })), E(t), D(t), n.push(() => E(t)), U = () => n.forEach((e) => e());
2561
2592
  }
2562
- p.own(k.onPaint(() => {
2563
- !x && l.nodes.length && (x = !0, i.onReady && i.onReady());
2564
- })), U(), p.own(() => V());
2565
- let G = () => {
2566
- !_ && d && d.topology && d.topology !== g.topology && (g.topology = d.topology, K(d.topology));
2593
+ f.own(k.onPaint(() => {
2594
+ !y && l.nodes.length && (y = !0, n.onReady && n.onReady());
2595
+ })), ie(), f.own(() => U());
2596
+ let K = () => {
2597
+ !_ && d && d.topology && d.topology !== h.topology && (h.topology = d.topology, q(d.topology));
2567
2598
  };
2568
- d && p.on("source", (e) => {
2569
- e.state === "ready" && G();
2570
- }), p.own(k.watchSize()), k.resize();
2571
- function K(e) {
2572
- let t = l.selectedNode ? l.selectedNode.id : null;
2573
- ft(n, e);
2574
- let r = t ? R(t) : null;
2575
- l.nodes.length && (te(), L());
2576
- let i = !r && z ? R(z) : null;
2577
- i && q(n, i, { source: "api" }), k.render(), k.ensureFlowLoop();
2578
- }
2579
- function ie(e) {
2580
- let t = e === "dataflow" ? "dataflow" : "orbit";
2581
- l.view !== t && (l.view = t, n.touchScene(), l.nodes.length && (te(), L(), k.ensureFlowLoop()));
2582
- }
2583
- function J() {
2599
+ d && f.on("source", (e) => {
2600
+ e.state === "ready" && K();
2601
+ }), f.own(k.watchSize()), k.resize();
2602
+ function q(e) {
2603
+ let n = l.selectedNode ? l.selectedNode.id : null;
2604
+ ht(t, e);
2605
+ let r = n ? z(n) : null;
2606
+ l.nodes.length && (L(), R());
2607
+ let i = !r && B ? z(B) : null;
2608
+ i && G(t, i, { source: "api" }), k.render(), k.ensureFlowLoop(), t.emit("map:topology");
2609
+ }
2610
+ function ae(e) {
2611
+ let n = e === "dataflow" ? "dataflow" : "orbit";
2612
+ l.view !== n && (l.view = n, t.touchScene(), l.nodes.length && (L(), R(), k.ensureFlowLoop()));
2613
+ }
2614
+ function oe() {
2584
2615
  let e = k.getRenderer();
2585
- e.release ? e.release() : e.destroy(), V();
2586
- let t = n.doc.createElement("template");
2587
- t.innerHTML = pn;
2588
- let r = t.content.firstElementChild;
2616
+ e.release ? e.release() : e.destroy(), U();
2617
+ let n = t.doc.createElement("template");
2618
+ n.innerHTML = gn;
2619
+ let r = n.content.firstElementChild;
2589
2620
  r.setAttribute("part", "map-canvas");
2590
- let i = n.active() === l.canvas;
2591
- l.canvas.replaceWith(r), l.canvas = r, U(), j(), k.resize(), i && r.focus();
2621
+ let i = t.active() === l.canvas;
2622
+ l.canvas.replaceWith(r), l.canvas = r, ie(), M(), k.resize(), i && r.focus(), t.emit("map:canvas");
2592
2623
  }
2593
- function ae(e = {}) {
2624
+ function se(e = {}) {
2594
2625
  if (!v) {
2595
2626
  if ("renderer" in e) {
2596
- let t = m(e.renderer);
2597
- t !== g.renderer && (g.renderer = t, J());
2627
+ let t = p(e.renderer);
2628
+ t !== h.renderer && (h.renderer = t, oe());
2598
2629
  }
2599
2630
  if ("theme" in e) {
2600
- let t = h(e.theme);
2601
- t !== g.theme && (g.theme = t, F());
2631
+ let t = m(e.theme);
2632
+ t !== h.theme && (h.theme = t, F());
2602
2633
  }
2603
- if ("topology" in e && (_ = e.topology !== void 0 && e.topology !== null, _ && e.topology !== g.topology ? (g.topology = e.topology, K(e.topology)) : !_ && d && d.topology ? (g.topology = void 0, G()) : !_ && e.topology !== g.topology && (g.topology = e.topology, K(e.topology))), "view" in e && ie(e.view === "dataflow" ? "dataflow" : "orbit"), "node" in e) {
2604
- let t = e.node == null || e.node === "" ? null : String(e.node);
2605
- if (t === null) z = null, (l.selectedNode || l.selectedEdge) && N(n, { source: "api" });
2634
+ if ("topology" in e && (_ = e.topology !== void 0 && e.topology !== null, _ && e.topology !== h.topology ? (h.topology = e.topology, q(e.topology)) : !_ && d && d.topology ? (h.topology = void 0, K()) : !_ && e.topology !== h.topology && (h.topology = e.topology, q(e.topology))), "view" in e && ae(e.view === "dataflow" ? "dataflow" : "orbit"), "node" in e) {
2635
+ let n = e.node == null || e.node === "" ? null : String(e.node);
2636
+ if (n === null) B = null, (l.selectedNode || l.selectedEdge) && H(t, { source: "api" });
2606
2637
  else {
2607
- let e = R(t);
2608
- e ? l.selectedNode && l.selectedNode.id === t || q(n, e, { source: "api" }) : z = t;
2638
+ let e = z(n);
2639
+ e ? l.selectedNode && l.selectedNode.id === n || G(t, e, { source: "api" }) : B = n;
2609
2640
  }
2610
2641
  }
2611
2642
  }
2612
2643
  }
2613
- function se() {
2614
- v || (v = !0, p.destroy(), k.destroy(), o && n.destroy());
2644
+ function J() {
2645
+ v || (v = !0, f.destroy(), k.destroy(), i && t.destroy());
2615
2646
  }
2616
- let Y = {};
2647
+ let ce = {};
2617
2648
  for (let e of [
2618
2649
  "topology",
2619
2650
  "view",
2620
2651
  "node"
2621
- ]) i[e] !== void 0 && (Y[e] = i[e]);
2622
- return ae(Y), G(), F(), p.own(() => n.emit("map:gone")), n.emit("map:ready"), {
2623
- inst: n,
2652
+ ]) n[e] !== void 0 && (ce[e] = n[e]);
2653
+ return se(ce), K(), F(), f.own(() => t.emit("map:gone")), t.emit("map:ready"), {
2654
+ inst: t,
2624
2655
  map: k,
2625
2656
  selection() {
2626
2657
  return l.selectedNode ? {
@@ -2631,12 +2662,12 @@ function yn(t, n, i, a) {
2631
2662
  kind: "edge"
2632
2663
  } : null;
2633
2664
  },
2634
- update: ae,
2635
- destroy: se,
2636
- fit: L,
2637
- focusNode: B,
2665
+ update: se,
2666
+ destroy: J,
2667
+ fit: R,
2668
+ focusNode: V,
2638
2669
  refresh: F,
2639
2670
  applyTheme: (e) => A.applyTheme(e)
2640
2671
  };
2641
2672
  }
2642
- export { ft as i, pt as n, mt as r, _n as t };
2673
+ export { ht as i, gt as n, _t as r, bn as t };