@popcorn245/cornfield-components 0.51.8 → 0.52.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/around-BFqYTZ0K.js +78 -0
  3. package/dist/chunks/corn-layers-Cni5rISZ.js +275 -0
  4. package/dist/chunks/{corn-map-M7xt4MYk.js → corn-map-B2-YxiEL.js} +8 -5
  5. package/dist/chunks/corn-node-panel-BkvJThlp.js +42 -0
  6. package/dist/chunks/{corn-review-yQU3IpY5.js → corn-review-5wf7AT4o.js} +1047 -2564
  7. package/dist/chunks/corn-search-CXs5d06S.js +484 -0
  8. package/dist/chunks/{engine-ClfnAsgM.js → engine-BmXtSISH.js} +3691 -3577
  9. package/dist/chunks/layers-Bj4Tluxe.js +191 -0
  10. package/dist/chunks/{map-LS9aQk6z.js → map-BZRFOYkt.js} +803 -751
  11. package/dist/chunks/node-panel-BdvFvWCE.js +1291 -0
  12. package/dist/chunks/{review-source-CPiFTfyc.js → review-source-CK5tYIqk.js} +1 -1
  13. package/dist/chunks/{scope-Dg_uzefP.js → scope-CqPbHcKL.js} +24 -23
  14. package/dist/chunks/sheets-D-sMZzSs.js +204 -0
  15. package/dist/chunks/source-address-C70zNPIj.js +79 -0
  16. package/dist/chunks/{status-CYQD5PwL.js → status-DI5QLlAp.js} +78 -77
  17. package/dist/corn-layers.js +1 -0
  18. package/dist/corn-map.js +1 -1
  19. package/dist/corn-node-panel.js +1 -0
  20. package/dist/corn-review.js +1 -1
  21. package/dist/corn-scope.js +3 -3
  22. package/dist/corn-search.js +1 -0
  23. package/dist/index.js +8 -5
  24. package/dist/manifest.json +101 -36
  25. package/dist/tokens.css +8 -2
  26. package/dist/types/components.d.ts +90 -0
  27. package/dist/types/corn-layers.d.ts +2 -0
  28. package/dist/types/corn-node-panel.d.ts +2 -0
  29. package/dist/types/corn-search.d.ts +2 -0
  30. package/dist/types/index.d.ts +3 -0
  31. package/dist/version.json +1 -1
  32. package/package.json +14 -2
  33. package/dist/chunks/source-address-B7hYRgt8.js +0 -251
@@ -1,154 +1,174 @@
1
- import { $ as e, At as t, B as n, Ct as r, Dt as i, Et as a, F as o, G as s, H as c, I as l, J as u, L as d, M as f, N as p, Ot as m, P as h, Q as g, Qt as _, St as v, Tt as y, U as b, V as x, W as S, X as C, Y as w, Z as T, _ as E, an as D, at as O, b as ee, c as k, d as A, g as j, gt as M, h as N, ht as te, it as P, j as F, ln as ne, lt as I, mt as L, o as R, on as re, q as z, rt as ie, s as B, sn as V, tt as H, u as ae, ut as U, v as W, vt as G, wt as K, xt as oe, yt as se, z as ce } from "./engine-ClfnAsgM.js";
2
- var q = 96, le = "letters:", ue = (e) => `${le}${e}`, de = (e) => typeof e == "string" && e.startsWith(le), fe = (e) => e.slice(8), pe = (e, t) => !!e.letters && !e.icon && e.r * 2 * t >= 14, me = /* @__PURE__ */ new Map();
3
- function he(e, t = null) {
1
+ import { $t as e, C as t, Cn as n, D as r, Dn as i, En as a, G as o, Gt as s, H as c, J as l, K as u, Kt as d, M as f, Mn as p, Mt as m, Nt as h, Pt as g, Qt as _, Sn as v, T as y, Tt as b, U as x, Wt as S, X as C, Xt as w, Y as T, Yt as E, Z as D, Zt as O, _ as k, _n as A, b as j, c as M, d as N, en as P, et as ee, f as F, g as I, i as L, it as R, j as z, k as B, l as te, ln as ne, m as V, n as H, nn as U, p as W, q as re, r as G, rn as ie, tn as K, u as ae, v as q, vn as oe, w as se, wn as ce, x as J } from "./engine-BmXtSISH.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 (me.has(n)) return me.get(n);
7
- if (me.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(q, q) : typeof document < "u" ? Object.assign(document.createElement("canvas"), {
11
- width: q,
12
- height: q
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 ${z}`, i.textAlign = "center", i.textBaseline = "middle", i.lineJoin = "round", i.lineWidth = 10;
16
- let a = typeof t == "string" ? t : se;
17
- i.strokeStyle = y(a) === "#ffffff" ? "rgba(11, 18, 32, 0.92)" : "rgba(255, 255, 255, 0.92)", i.strokeText(e, q / 2, 51), i.fillStyle = a, i.fillText(e, q / 2, 51), r = n;
15
+ i.font = `700 ${e.length > 1 ? 56 : 72}px ${I}`, i.textAlign = "center", i.textBaseline = "middle", i.lineJoin = "round", i.lineWidth = 10;
16
+ let a = typeof t == "string" ? t : x;
17
+ i.strokeStyle = T(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 me.set(n, r), r;
22
+ return he.set(n, r), r;
23
23
  }
24
24
  // ../explorer/renderer-canvas2d.js
25
- var ge = Math.PI * 2, _e = 1.5, J = (e, t, n, r) => {
26
- e.beginPath(), e.arc(t, n, r, 0, ge);
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 = R(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" ? C.squareHalf : C.roundedHalf), o = i * (t === "square" ? C.squareCorner : C.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 * C.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 * C.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 J(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, J(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(t, n, r, i, a = !0) {
63
- if (t.save(), t.globalAlpha = n.alpha, t.beginPath(), t.moveTo(n.x1, n.y1), n.curve ? t.quadraticCurveTo(n.curve.cx, n.curve.cy, n.x2, n.y2) : t.lineTo(n.x2, n.y2), t.strokeStyle = n.color, t.lineWidth = n.mark && n.mark !== "none" ? Math.max(n.width, w.edge / i) : n.width, t.setLineDash(n.dash || []), n.glow && n.glow * i >= _e) {
64
- let e = t.lineWidth;
65
- t.save(), t.globalAlpha = n.alpha * .3, t.strokeStyle = n.glowColor || n.color, t.lineWidth = e + n.glow * .6, t.stroke(), t.restore();
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) {
72
+ let n = e.lineWidth;
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
- if (t.stroke(), t.setLineDash([]), n.mark === "removed") {
68
- let r = e(n, .5), a = Math.hypot(n.x2 - n.x1, n.y2 - n.y1), [o, s] = a > 0 ? [(n.x2 - n.x1) / a, (n.y2 - n.y1) / a] : [1, 0];
69
- t.beginPath(), t.moveTo(r.x - s * S.halfLength, r.y + o * S.halfLength), t.lineTo(r.x + s * S.halfLength, r.y - o * S.halfLength), t.lineWidth = Math.max(S.width, 1.5 / i), t.stroke();
75
+ if (e.stroke(), e.setLineDash([]), t.mark === "removed") {
76
+ let n = y(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 * W.halfLength, n.y + a * W.halfLength), e.lineTo(n.x + o * W.halfLength, n.y - a * W.halfLength), e.lineWidth = Math.max(W.width, 1.5 / r), e.stroke();
70
78
  }
71
- if (n.ticks && we(t, n, i), n.arrow) {
72
- let { cx: e, cy: r } = n.curve || {
73
- cx: n.x1,
74
- cy: n.y1
79
+ if (t.ticks && De(e, t, r), t.arrow) {
80
+ let { cx: n, cy: i } = t.curve || {
81
+ cx: t.x1,
82
+ cy: t.y1
75
83
  };
76
- Ce(t, n, Math.atan2(n.y2 - r, n.x2 - e), i);
84
+ Ee(e, t, Math.atan2(t.y2 - i, t.x2 - n), r);
77
85
  }
78
- a && n.packet && Te(t, n, r, i), t.restore();
86
+ i && t.packet && Oe(e, t, n, r), e.restore();
79
87
  }
80
- function Ce(e, t, n, r) {
81
- let i = t.end || "triangle", { x2: a, y2: o, color: l } = t, u = Math.cos(n), d = Math.sin(n), f = (e, t) => [a - u * e - d * t, o - d * e + u * t], p = Math.max(s.strokeWidth, 1.2 / r);
82
- if (e.beginPath(), i === "triangle") e.moveTo(a, o), e.lineTo(a - Math.cos(n - c.spread) * c.length, o - Math.sin(n - c.spread) * c.length), e.lineTo(a - Math.cos(n + c.spread) * c.length, o - Math.sin(n + c.spread) * c.length), e.closePath(), e.fillStyle = l, e.fill();
88
+ function Ee(e, t, n, r) {
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(V.strokeWidth, 1.2 / r);
90
+ if (e.beginPath(), i === "triangle") e.moveTo(a, o), e.lineTo(a - Math.cos(n - N.spread) * N.length, o - Math.sin(n - N.spread) * N.length), e.lineTo(a - Math.cos(n + N.spread) * N.length, o - Math.sin(n + N.spread) * N.length), e.closePath(), e.fillStyle = s, e.fill();
83
91
  else {
84
- if (e.strokeStyle = l, e.lineWidth = p, e.lineJoin = "miter", i === "chevron") {
85
- let t = c.length * Math.cos(c.spread), n = c.length * Math.sin(c.spread);
86
- e.moveTo(...f(t, n)), e.lineTo(a, o), e.lineTo(...f(t, -n));
87
- } else if (i === "bar") e.moveTo(...f(p / 2, s.barHalf)), e.lineTo(...f(p / 2, -s.barHalf));
92
+ if (e.strokeStyle = s, e.lineWidth = d, e.lineJoin = "miter", i === "chevron") {
93
+ let t = N.length * Math.cos(N.spread), n = N.length * Math.sin(N.spread);
94
+ e.moveTo(...u(t, n)), e.lineTo(a, o), e.lineTo(...u(t, -n));
95
+ } else if (i === "bar") e.moveTo(...u(d / 2, V.barHalf)), e.lineTo(...u(d / 2, -V.barHalf));
88
96
  else {
89
- let t = s.diamondHalf;
90
- e.moveTo(a, o), e.lineTo(...f(t, s.diamondAcross)), e.lineTo(...f(2 * t, 0)), e.lineTo(...f(t, -s.diamondAcross)), e.closePath();
97
+ let t = V.diamondHalf;
98
+ e.moveTo(a, o), e.lineTo(...u(t, V.diamondAcross)), e.lineTo(...u(2 * t, 0)), e.lineTo(...u(t, -V.diamondAcross)), e.closePath();
91
99
  }
92
100
  e.stroke();
93
101
  }
94
102
  }
95
- function we(t, n, r) {
96
- let i = Math.hypot(n.x2 - n.x1, n.y2 - n.y1), [a, o] = i > 0 ? [(n.x2 - n.x1) / i, (n.y2 - n.y1) / i] : [1, 0], c = e(n, .5);
97
- t.beginPath();
98
- for (let e = 0; e < n.ticks; e++) {
99
- let r = (e - (n.ticks - 1) / 2) * s.tickGap, i = c.x + a * r, l = c.y + o * r;
100
- t.moveTo(i - o * s.tickHalf, l + a * s.tickHalf), t.lineTo(i + o * s.tickHalf, l - a * s.tickHalf);
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 = y(t, .5);
105
+ e.beginPath();
106
+ for (let n = 0; n < t.ticks; n++) {
107
+ let r = (n - (t.ticks - 1) / 2) * V.tickGap, s = o.x + i * r, c = o.y + a * r;
108
+ e.moveTo(s - a * V.tickHalf, c + i * V.tickHalf), e.lineTo(s + a * V.tickHalf, c - i * V.tickHalf);
101
109
  }
102
- t.strokeStyle = n.color, t.lineWidth = Math.max(s.tickWidth, 1.5 / r), t.setLineDash([]), t.stroke();
110
+ e.strokeStyle = t.color, e.lineWidth = Math.max(V.tickWidth, 1.5 / n), e.setLineDash([]), e.stroke();
103
111
  }
104
- function Te(e, t, n, r) {
105
- let i = O(t, n), { packet: a } = t;
106
- a.glow && a.glow * r >= _e && (e.beginPath(), e.arc(i.x, i.y, a.radius + a.glow * .5, 0, ge), 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, ge), e.fillStyle = a.color, e.fill();
112
+ function Oe(e, t, n, r) {
113
+ let i = f(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, a) {
132
+ function Pe(e, t, n, r, i, a) {
125
133
  e.save(), e.globalAlpha = t.alpha;
126
- let o = r.halo[t.halo];
127
- o && (o.fill && (J(e, t.x, t.y, t.r + o.fillR), e.fillStyle = o.fill, e.fill()), J(e, t.x, t.y, t.r + o.ringR), e.strokeStyle = o.ring, e.lineWidth = o.ringWidth, e.stroke());
128
- let s = r.mark[t.mark];
129
- if (s) {
130
- let r = t.r + Math.max(s.ringR, w.gap / n);
131
- J(e, t.x, t.y, r), e.strokeStyle = s.color, e.lineWidth = Math.max(s.ringWidth, w.ring / n), e.setLineDash(s.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 >= _e && (e.save(), e.globalAlpha = t.alpha * .28, J(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 c = t.icon && a.icons ? a.icons.get(t.icon) : null, u = !c && pe(t, n), d = !c && !u && i(t, n) ? oe(t.glyph, v(t, a)) : null;
135
- if (d || (J(e, t.x, t.y, t.r * b), 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()), c) {
136
- let n = t.r * l;
137
- e.imageSmoothingEnabled = !a.pixelated, e.drawImage(c, t.x - n / 2, t.y - n / 2, n, n);
138
- } else if (u) {
139
- let n = he(t.letters, a.values && a.values["--corn-map-glyph"]);
134
+ let s = r.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 l = r.mark[t.mark];
137
+ if (l) {
138
+ let r = t.r + Math.max(l.ringR, q.gap / n);
139
+ Y(e, t.x, t.y, r), e.strokeStyle = l.color, e.lineWidth = Math.max(l.ringWidth, q.ring / n), e.setLineDash(l.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());
140
+ }
141
+ if (xe(e, t.shape, t.x, t.y, t.r), t.glow && t.glow * n >= 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 * (j[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 d = t.icon && i.icons ? i.icons.get(t.icon) : null, f = !d && me(t, n), p = !d && !f && D(t, n) ? o(t.glyph, u(t, i, a)) : null;
155
+ if (p || (Y(e, t.x, t.y, t.r * F), e.fillStyle = r.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()), d) {
156
+ let n = t.r * G;
157
+ e.imageSmoothingEnabled = !i.pixelated, e.drawImage(d, t.x - n / 2, t.y - n / 2, n, n);
158
+ } else if (f) {
159
+ let n = ge(t.letters, i.values && i.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 (d) {
145
- let n = t.r * G;
146
- e.imageSmoothingEnabled = !0, e.drawImage(d, t.x - n / 2, t.y - n / 2, n, n);
164
+ } else if (p) {
165
+ let n = t.r * c;
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 n = t.mapStyle || (() => d), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c = null, l = null, u = () => {
170
+ function Fe(e, t = {}) {
171
+ let n = t.mapStyle || (() => L), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c = null, l = null, u = () => {
152
172
  if (s) return s;
153
173
  try {
154
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;
@@ -156,49 +176,49 @@ function Me(e, t = {}) {
156
176
  c = null;
157
177
  }
158
178
  return c || (s = null), s;
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) {
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, i, a), r.lanes.length && xe(e, r.lanes), r.rings.length && be(e, r.rings), Ae(t, n, i, a).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
187
  resize(t, n, u) {
168
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, d, p) {
171
- let g = n(), _ = x(t, g);
190
+ draw(t, f, h) {
191
+ let g = n(), _ = ae(t, g);
172
192
  r.clearRect(0, 0, i, a);
173
- let v = ce(P(_.theme), g), y = Ae(_, d, i, a);
174
- if (m(_) && y.length > f && u()) {
175
- l && l.scene === _ && l.x === d.x && l.y === d.y && l.zoom === d.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), h(c, _, d), l = {
193
+ let v = M(z(_.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 = {
176
196
  scene: _,
177
- x: d.x,
178
- y: d.y,
179
- zoom: d.zoom,
197
+ x: f.x,
198
+ y: f.y,
199
+ zoom: f.zoom,
180
200
  w: e.width,
181
201
  h: e.height
182
- }), r.save(), r.setTransform(1, 0, 0, 1, 0, 0), r.drawImage(s, 0, 0), r.restore(), r.save(), r.translate(d.x, d.y), r.scale(d.zoom, d.zoom), y.forEach((e) => {
183
- e.packet && Ee(r, e, p, d.zoom);
184
- }), _.nodes.forEach((e) => je(r, e, d.zoom, v, g)), r.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
- r.save(), r.translate(d.x, d.y), r.scale(d.zoom, d.zoom);
207
+ r.save(), r.translate(f.x, f.y), r.scale(f.zoom, f.zoom);
188
208
  let { decor: b } = _;
189
- b.grid && ye(r, b.grid, d, i, a), b.lanes.length && xe(r, b.lanes), b.rings.length && be(r, b.rings), y.forEach((e) => Se(r, e, p, d.zoom)), _.nodes.forEach((e) => je(r, e, d.zoom, v, g)), r.restore();
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
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, Y = 64, X = {
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, Y = 64, X = {
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) => u.includes(e.type) && !e.greyed, Qe = (e, t) => e.selected ? X.selected : e.current ? X.current : e.match ? X.match : t && e.connected ? X.lit : e.mark && e.mark !== "none" || e.labelKeep && !Ze(e) ? X.marked : e.greyed ? X.greyed : Ze(e) ? X.hub : X.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) => k.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 === X.greyed ? 2 + f * Je : 2, x = Math.floor((g - b) / Y), S = Math.floor((_ + b) / Y), C = Math.floor((v - b) / Y), w = Math.floor((y + b) / Y), 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,16 +406,16 @@ function $e(e, t, n = {}) {
386
406
  b: y
387
407
  };
388
408
  l.push(E);
389
- let D = Math.floor(g / Y), O = Math.floor(_ / Y), ee = Math.floor(v / Y), k = Math.floor(y / Y);
390
- for (let e = D; e <= O; e++) for (let t = ee; t <= k; t++) {
409
+ let D = Math.floor(g / X), O = Math.floor(_ / X), k = Math.floor(v / X), A = Math.floor(y / X);
410
+ for (let e = D; e <= O; e++) for (let t = k; t <= A; 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, n, r = {}) {
398
- let { max: i = 400, margin: a = 32, measure: o = null, hover: s = null } = r, c = [], l = e.labelOutline || P(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 || z(e.theme).labelOutline;
399
419
  for (let t of e.decor.lanes) for (let n of [
400
420
  t.title,
401
421
  t.note,
@@ -414,7 +434,7 @@ function et(e, t, n, r = {}) {
414
434
  align: "center",
415
435
  family: e.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif"
416
436
  });
417
- let { zoom: u } = t, d = r.placed || $e(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);
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);
418
438
  g.length > i && (g = g.slice(0, Math.max(0, i))), g.sort((e, t) => e.index - t.index);
419
439
  let _ = e.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif";
420
440
  for (let e of g) {
@@ -441,7 +461,7 @@ function et(e, t, n, r = {}) {
441
461
  screen: e.screen
442
462
  });
443
463
  }
444
- let v = Xe(e), y = g.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,
@@ -489,7 +509,7 @@ function et(e, t, n, r = {}) {
489
509
  if (s) {
490
510
  let n = e.nodes.find((e) => e.id === s);
491
511
  if (n && n.label && !d.some((e) => e.id === s && g.includes(e))) {
492
- let r = Xe(e), i = t.y + n.y * u - n.r * u > 40 ? n.y - n.r - 5 / u : n.y + n.r + (5 + r) / u;
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;
493
513
  c.push({
494
514
  kind: "chip",
495
515
  id: n.id,
@@ -512,17 +532,17 @@ function et(e, t, n, r = {}) {
512
532
  }
513
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,69 +571,69 @@ 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 || (() => d), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c, l, u, f, p, m, h = null, g = !0, _ = !1, v = /* @__PURE__ */ new Map(), y = z, b = (e, t, n) => {
561
- let i = `${n ? "b" : "n"}${t}|${y}|${e}`, a = v.get(i);
562
- return a === void 0 && (v.size > 2e4 && v.clear(), r.font = tt({
579
+ function ut(e, t = {}) {
580
+ 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 = I, y = (e, t, n) => {
581
+ let i = `${n ? "b" : "n"}${t}|${v}|${e}`, a = _.get(i);
582
+ return a === void 0 && (_.size > 2e4 && _.clear(), r.font = it({
563
583
  italic: !1,
564
584
  bold: n,
565
585
  size: t,
566
- family: y
567
- }), a = r.measureText(e).width, v.set(i, a)), a;
586
+ family: v
587
+ }), a = r.measureText(e).width, _.set(i, a)), a;
568
588
  };
569
589
  return {
570
590
  hit(e, t) {
571
- return h && s ? ot(h, {
591
+ return m && s ? lt(m, {
572
592
  x: l,
573
593
  y: u,
574
- zoom: f
594
+ zoom: d
575
595
  }, e, t) : null;
576
596
  },
577
597
  resize(t, n, s) {
578
- i = t, a = n, o = s, e.width = t * s, e.height = n * s, r.setTransform(s, 0, 0, s, 0, 0), g = !0;
598
+ i = t, a = n, o = s, e.width = t * s, e.height = n * s, r.setTransform(s, 0, 0, s, 0, 0), h = !0;
579
599
  },
580
- draw(e, t, d = {}) {
581
- if (_) return !1;
582
- let v = n(), S = v.plain ? 0 : v.version, C = d.hover || null;
583
- if (!g && e === s && e.version === c && t.x === l && t.y === u && t.zoom === f && S === p && C === m) return !1;
584
- let w = h && e === s && e.version === c && t.zoom === f && S === p && !g;
585
- s = e, c = e.version, l = t.x, u = t.y, f = t.zoom, p = S, m = C, g = !1;
586
- let T = x(e, v);
587
- y = T.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), w || (h = $e(T, t.zoom, { measure: b }));
588
- let E = et(T, t, {
600
+ draw(e, t, _ = {}) {
601
+ if (g) return !1;
602
+ let b = n(), x = b.plain ? 0 : b.version, S = _.hover || null;
603
+ if (!h && e === s && e.version === c && t.x === l && t.y === u && t.zoom === d && x === f && S === p) return !1;
604
+ let C = m && e === s && e.version === c && t.zoom === d && x === f && !h;
605
+ s = e, c = e.version, l = t.x, u = t.y, d = t.zoom, f = x, p = S, h = !1;
606
+ let w = ae(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
- measure: b,
593
- hover: C,
594
- placed: h
595
- }), D = it();
596
- for (let e of E) e.kind === "lane" && at(r, e, D);
597
- for (let e of E) e.kind === "node" && !e.screen && at(r, e, D);
612
+ measure: y,
613
+ hover: S,
614
+ placed: m
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
- let O = {
619
+ let D = {
600
620
  ox: t.x,
601
621
  oy: t.y,
602
622
  k: t.zoom
603
623
  };
604
- D = it();
605
- for (let e of E) e.kind === "node" && e.screen && at(r, e, D, O);
606
- for (let e of E) e.kind === "edge" && at(r, e, D, O);
607
- for (let e of E) e.kind === "chip" && at(r, e, D, O);
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() {
611
- _ = !0, s = null, h = null, v.clear(), r.setTransform(1, 0, 0, 1, 0, 0), r.clearRect(0, 0, i, a);
631
+ g = !0, s = null, m = null, _.clear(), r.setTransform(1, 0, 0, 1, 0, 0), r.clearRect(0, 0, i, a);
612
632
  }
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,65 +643,65 @@ var ct = [
623
643
  "touchmove",
624
644
  "keydown"
625
645
  ];
626
- function lt(e, t = {}) {
646
+ function ft(e, n = {}) {
627
647
  if (e.map) return e.map;
628
- let { state: r } = e, i = t.measureCovered || (() => r.coveredBottom || 0), a = n(e).get, o = !1, s = (e) => ie(r, e), c = (e) => ie(r, e, { viewer: !0 }), l = (t, n = e.viewEdges(), i = {
629
- throughChildren: !!r.throughChildren,
630
- kind: r.selectedKind || null
631
- }) => H(t, n, i), u = g((t) => T(t, { reduceMotion: e.reducedMotion })), d = () => u.get(r), f = () => u.builds, p = Ie(), m = () => p.get(d()), h = () => p.builds, _ = null, v = null;
648
+ let { state: i } = e, a = n.measureCovered || (() => i.coveredBottom || 0), o = te(e).get, s = !1, c = (e) => B(i, e), l = (e) => B(i, e, { viewer: !0 }), u = (t, n = e.viewEdges(), a = {
649
+ throughChildren: !!i.throughChildren,
650
+ kind: i.selectedKind || null
651
+ }) => r(t, n, a), d = se((n) => t(n, { reduceMotion: e.reducedMotion })), f = () => d.get(i), p = () => d.builds, m = ze(), h = () => m.get(f()), g = () => m.builds, _ = null, v = null;
632
652
  function y() {
633
- return _ && v === r.canvas || (_ && _.destroy(), _ = Me(r.canvas, { mapStyle: a }), v = r.canvas, r.width && _.resize(r.width, r.height, e.dpr())), _;
653
+ return _ && v === i.canvas || (_ && _.destroy(), _ = Fe(i.canvas, { mapStyle: o }), v = i.canvas, i.width && _.resize(i.width, i.height, e.dpr())), _;
634
654
  }
635
655
  let b = null, x = null;
636
656
  function S() {
637
- return r.labelCanvas ? (b && x === r.labelCanvas || (b && b.destroy(), b = st(r.labelCanvas, { mapStyle: a }), x = r.labelCanvas, r.width && b.resize(r.width, r.height, e.dpr())), b) : null;
657
+ return i.labelCanvas ? (b && x === i.labelCanvas || (b && b.destroy(), b = ut(i.labelCanvas, { mapStyle: o }), x = i.labelCanvas, i.width && b.resize(i.width, i.height, e.dpr())), b) : null;
638
658
  }
639
659
  function C(t) {
640
- _ && _ !== t && _.destroy(), _ = t, v = r.canvas, r.width && _.resize(r.width, r.height, e.dpr()), V();
660
+ _ && _ !== t && _.destroy(), _ = t, v = i.canvas, i.width && _.resize(i.width, i.height, e.dpr()), U();
641
661
  }
642
662
  function w() {
643
- let { canvas: t } = r, n = `${r.width}x${r.height}`;
644
- r.width = t.parentElement.clientWidth, r.height = t.parentElement.clientHeight, y().resize(r.width, r.height, e.dpr());
645
- let i = S();
646
- i && i.resize(r.width, r.height, e.dpr()), n !== `${r.width}x${r.height}` && D(), V();
663
+ let { canvas: t } = i, n = `${i.width}x${i.height}`;
664
+ i.width = t.parentElement.clientWidth, i.height = t.parentElement.clientHeight, y().resize(i.width, i.height, e.dpr());
665
+ let r = S();
666
+ r && r.resize(i.width, i.height, e.dpr()), n !== `${i.width}x${i.height}` && E(), U();
647
667
  }
648
- let E = e.slot("fit", () => ({
668
+ let T = e.slot("fit", () => ({
649
669
  lastFit: null,
650
670
  waiting: null
651
671
  }));
652
- function D() {
653
- if (!r.width || !r.height) return;
654
- if (E.waiting) {
655
- let { padding: e, only: t } = E.waiting;
656
- M(e === null ? N() : e, t);
672
+ function E() {
673
+ if (!i.width || !i.height) return;
674
+ if (T.waiting) {
675
+ let { padding: e, only: t } = T.waiting;
676
+ N(e === null ? P() : e, t);
657
677
  return;
658
678
  }
659
- let { camera: e } = r, t = E.lastFit;
660
- t && e.x === t.x && e.y === t.y && e.zoom === t.zoom && M(t.auto ? N() : t.padding, t.only);
679
+ let { camera: e } = i, t = T.lastFit;
680
+ t && e.x === t.x && e.y === t.y && e.zoom === t.zoom && N(t.auto ? P() : t.padding, t.only);
661
681
  }
662
- function O() {
663
- let t = r.canvas && r.canvas.parentElement, n = e.win && e.win.ResizeObserver;
682
+ function D() {
683
+ let t = i.canvas && i.canvas.parentElement, n = e.win && e.win.ResizeObserver;
664
684
  if (!t || !n) return () => {};
665
- let i = new n(() => {
666
- r.canvas && (t.clientWidth !== r.width || t.clientHeight !== r.height) && w();
685
+ let r = new n(() => {
686
+ i.canvas && (t.clientWidth !== i.width || t.clientHeight !== i.height) && w();
667
687
  });
668
- i.observe(t);
669
- let a = () => i.disconnect();
688
+ r.observe(t);
689
+ let a = () => r.disconnect();
670
690
  return e.own(a), a;
671
691
  }
672
- function ee(e, t = null) {
673
- let { nodes: n, width: a, height: o } = r, c = n.filter(s);
692
+ function O(e, t = null) {
693
+ let { nodes: n, width: r, height: o } = i, s = n.filter(c);
674
694
  if (t) {
675
- let e = c.filter((e) => t.has(e.id));
676
- e.length && (c = e);
695
+ let e = s.filter((e) => t.has(e.id));
696
+ e.length && (s = e);
677
697
  }
678
- if (c.length === 0) return null;
679
- let l = Math.max(160, o - i()), u = Infinity, d = -Infinity, f = Infinity, p = -Infinity;
680
- c.forEach((e) => {
698
+ if (s.length === 0) return null;
699
+ let l = Math.max(160, o - a()), u = Infinity, d = -Infinity, f = Infinity, p = -Infinity;
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);
683
- }), r.view === "dataflow" && r.flow && (f = Math.min(f, r.flow.top - 10)), r.view === "house" && r.house && r.house.fit && !t && ({minX: u, maxX: d, minY: f, maxY: p} = r.house.fit);
684
- let m = Math.max(160, a - e * 2), h = Math.max(160, l - e * 2), g = Math.min(m / (d - u), h / (p - f));
703
+ }), i.view === "dataflow" && i.flow && (f = Math.min(f, i.flow.top - 10)), i.view === "house" && i.house && i.house.fit && !t && ({minX: u, maxX: d, minY: f, maxY: p} = i.house.fit);
704
+ let m = Math.max(160, r - e * 2), h = Math.max(160, l - e * 2), g = Math.min(m / (d - u), h / (p - f));
685
705
  return {
686
706
  minX: u,
687
707
  maxX: d,
@@ -691,142 +711,145 @@ function lt(e, t = {}) {
691
711
  raw: g
692
712
  };
693
713
  }
694
- let k = "", A = U;
695
- function j() {
696
- let e = `${r.sceneVersion}|${r.width}|${r.height}|${r.view}|${i()}`;
714
+ let k = "", j = oe;
715
+ function M() {
716
+ let e = `${i.sceneVersion}|${i.width}|${i.height}|${i.view}|${a()}`;
697
717
  if (e !== k) {
698
718
  k = e;
699
- let t = ee(N());
700
- A = t && t.raw > 0 && Number.isFinite(t.raw) ? Math.max(I, Math.min(U, t.raw)) : U;
719
+ let t = O(P());
720
+ j = t && t.raw > 0 && Number.isFinite(t.raw) ? Math.max(A, Math.min(oe, t.raw)) : oe;
701
721
  }
702
- return A;
722
+ return j;
703
723
  }
704
- function M(e = 40, t = null) {
705
- let { width: n, height: i, camera: a } = r;
706
- if (!n || !i) {
707
- r.nodes.length && (E.waiting = {
708
- padding: e === N() ? null : e,
724
+ function N(e = 40, t = null) {
725
+ let { width: n, height: r, camera: a } = i;
726
+ if (!n || !r) {
727
+ i.nodes.length && (T.waiting = {
728
+ padding: e === P() ? null : e,
709
729
  only: t
710
730
  });
711
731
  return;
712
732
  }
713
- E.waiting = null;
714
- let o = ee(e, t);
733
+ T.waiting = null;
734
+ let o = O(e, t);
715
735
  if (!o) return;
716
- let { minX: s, maxX: c, minY: l, maxY: u, mapHeight: d } = o, f = Math.min(1, Math.max(I, o.raw));
717
- a.zoom = f, a.x = n / 2 - (s + c) / 2 * f, a.y = d / 2 - (l + u) / 2 * f, E.lastFit = {
736
+ let { minX: s, maxX: c, minY: l, maxY: u, mapHeight: d } = o, f = Math.min(1, Math.max(A, o.raw));
737
+ a.zoom = f, a.x = n / 2 - (s + c) / 2 * f, a.y = d / 2 - (l + u) / 2 * f, T.lastFit = {
718
738
  padding: e,
719
- auto: e === N(),
739
+ auto: e === P(),
720
740
  only: t,
721
741
  x: a.x,
722
742
  y: a.y,
723
743
  zoom: a.zoom
724
- }, V();
725
- }
726
- let N = () => r.width < 640 ? 24 : 48, te = (e, t) => ({
727
- x: (e - r.camera.x) / r.camera.zoom,
728
- y: (t - r.camera.y) / r.camera.zoom
729
- }), P = -1;
730
- function F() {
731
- if (!r.canvas) return;
732
- let e = d();
733
- P = e.version, y().draw(e, r.camera, performance.now());
744
+ }, U();
745
+ }
746
+ let P = () => i.width < 640 ? 24 : 48, ee = (e, t) => ({
747
+ x: (e - i.camera.x) / i.camera.zoom,
748
+ y: (t - i.camera.y) / i.camera.zoom
749
+ }), F = -1;
750
+ function I() {
751
+ if (!i.canvas) return;
752
+ let e = f();
753
+ F = e.version, y().draw(e, i.camera, performance.now());
734
754
  let t = S();
735
- t && t.draw(e, r.camera, { hover: r.hoverNodeId }), R.forEach((t) => t(e, r.camera));
755
+ t && t.draw(e, i.camera, { hover: i.hoverNodeId }), z.forEach((t) => t(e, i.camera));
736
756
  }
737
- function ne(e, t) {
757
+ function L(e, t) {
738
758
  let n = S();
739
759
  return n ? n.hit(e, t) : null;
740
760
  }
741
- function L(e) {
761
+ function R(e) {
742
762
  let t = e || null;
743
- if (r.hoverNodeId === t) return;
744
- r.hoverNodeId = t;
763
+ if (i.hoverNodeId === t) return;
764
+ i.hoverNodeId = t;
745
765
  let n = S();
746
- n && r.canvas && r.width && n.draw(d(), r.camera, { hover: t });
766
+ n && i.canvas && i.width && n.draw(f(), i.camera, { hover: t });
747
767
  }
748
- let R = /* @__PURE__ */ new Set(), re = (e) => (R.add(e), () => R.delete(e)), z = /* @__PURE__ */ new Set(), B = He({
749
- draw: F,
750
- packetsVisible: () => !!r.canvas && ze(d(), r.camera, r.width, r.height),
768
+ let z = /* @__PURE__ */ new Set(), ne = (e) => (z.add(e), () => z.delete(e)), V = /* @__PURE__ */ new Set(), H = Ge({
769
+ draw: I,
770
+ packetsVisible: () => !!i.canvas && He(f(), i.camera, i.width, i.height),
751
771
  isHidden: () => e.hidden(),
752
772
  tickClients: (e) => {
753
773
  let t = !1;
754
- return z.forEach((n) => {
774
+ return V.forEach((n) => {
755
775
  n.tick(e), n.wants() && (t = !0);
756
776
  }), t;
757
777
  },
758
- clientsWant: () => [...z].some((e) => e.wants()),
778
+ clientsWant: () => [...V].some((e) => e.wants()),
759
779
  reduceMotion: () => e.reducedMotion,
760
- extraDirty: () => r.sceneVersion !== P,
780
+ extraDirty: () => i.sceneVersion !== F,
761
781
  now: () => performance.now(),
762
782
  raf: (e) => requestAnimationFrame(e),
763
783
  caf: (e) => cancelAnimationFrame(e)
764
784
  });
765
- function V() {
766
- !o && r.canvas && B.markDirty();
785
+ function U() {
786
+ !s && i.canvas && H.markDirty();
767
787
  }
768
- function ae() {
769
- !o && r.canvas && B.drawNow();
788
+ function W() {
789
+ !s && i.canvas && H.drawNow();
770
790
  }
771
- function W(e) {
772
- return z.add(e), () => z.delete(e);
791
+ function re(e) {
792
+ return V.add(e), () => V.delete(e);
773
793
  }
794
+ let G = [];
774
795
  if (e.root) {
775
- let t = () => B.noteInput();
776
- for (let n of ct) e.listen(e.root, n, t, {
796
+ let t = () => H.noteInput();
797
+ for (let n of dt) G.push(e.listen(e.root, n, t, {
777
798
  passive: !0,
778
799
  capture: !0
779
- });
800
+ }));
780
801
  }
781
- e.onShown(() => B.shown()), e.onShown(() => {
782
- let e = r.canvas && r.canvas.parentElement;
783
- !o && e && e.clientWidth && e.clientHeight && (e.clientWidth !== r.width || e.clientHeight !== r.height) && w();
784
- });
785
- function G() {
786
- o = !0, e.map === K && (e.map = null), B.cancel(), _ && (_.release ? _.release() : _.destroy(), _ = null, v = null), b && (b.destroy(), b = null, x = null), R.clear(), z.clear();
802
+ G.push(e.onShown(() => H.shown())), G.push(e.onShown(() => {
803
+ let e = i.canvas && i.canvas.parentElement;
804
+ !s && e && e.clientWidth && e.clientHeight && (e.clientWidth !== i.width || e.clientHeight !== i.height) && w();
805
+ }));
806
+ function ie() {
807
+ s = !0;
808
+ for (let e of G.splice(0)) e();
809
+ e.map === K && (e.map = null), H.cancel(), _ && (_.release ? _.release() : _.destroy(), _ = null, v = null), b && (b.destroy(), b = null, x = null), z.clear(), V.clear();
787
810
  }
788
811
  let K = {
789
- isNodeVisible: s,
790
- isNodeVisibleToViewer: c,
791
- getActiveSubgraph: l,
792
- getScene: d,
793
- sceneBuilds: f,
794
- getSpatialIndex: m,
795
- spatialBuilds: h,
812
+ isNodeVisible: c,
813
+ isNodeVisibleToViewer: l,
814
+ getActiveSubgraph: u,
815
+ getScene: f,
816
+ sceneBuilds: p,
817
+ getSpatialIndex: h,
818
+ spatialBuilds: g,
796
819
  getRenderer: y,
797
820
  setRenderer: C,
798
821
  resize: w,
799
- watchSize: O,
800
- getMinZoom: j,
801
- fitGraphToViewport: M,
802
- fitPadding: N,
803
- screenToWorld: te,
804
- labelNodeAt: ne,
805
- setHoverNode: L,
806
- onPaint: re,
807
- render: V,
808
- renderNow: ae,
809
- addFrameClient: W,
822
+ watchSize: D,
823
+ getMinZoom: M,
824
+ fitGraphToViewport: N,
825
+ fitPadding: P,
826
+ screenToWorld: ee,
827
+ labelNodeAt: L,
828
+ setHoverNode: R,
829
+ onPaint: ne,
830
+ render: U,
831
+ renderNow: W,
832
+ addFrameClient: re,
810
833
  queueFrameWork: (e, t) => {
811
- o || B.queue(e, t);
834
+ s || H.queue(e, t);
812
835
  },
813
836
  frameStats: () => ({
814
- frames: B.frames,
815
- draws: B.draws
837
+ frames: H.frames,
838
+ draws: H.draws
816
839
  }),
817
840
  holdFrames: (e) => {
818
- o || B.hold(e);
841
+ s || H.hold(e);
819
842
  },
820
- cancelFrame: () => B.cancel(),
843
+ cancelFrame: () => H.cancel(),
821
844
  ensureFlowLoop: () => {
822
- o || B.wake();
845
+ s || H.wake();
823
846
  },
824
- destroy: G
847
+ destroy: ie
825
848
  };
826
- return e.map = K, e.own(G), K;
849
+ return e.map = K, e.own(ie), K;
827
850
  }
828
851
  // ../explorer/flow-build.js
829
- function ut(e, t) {
852
+ function pt(e, t) {
830
853
  let n = new Map(e.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map();
831
854
  t.forEach((e) => {
832
855
  !e.kind && !e.dashed && n.get(e.from)?.type === "app" && n.get(e.to)?.type === "page" && r.set(e.to, e.from);
@@ -914,55 +937,55 @@ function ut(e, t) {
914
937
  };
915
938
  }
916
939
  // ../explorer/engine/topology.js
917
- function dt(e) {
940
+ function mt(e) {
918
941
  return {
919
942
  nodes: e && Array.isArray(e.nodes) ? e.nodes.filter((e) => e && typeof e.id == "string") : [],
920
943
  edges: e && Array.isArray(e.edges) ? e.edges.filter((e) => e && typeof e.from == "string" && typeof e.to == "string") : []
921
944
  };
922
945
  }
923
- function ft(e, t) {
924
- let { state: n } = e, { nodes: r, edges: i } = dt(t), a = n.selectedNode ? n.selectedNode.id : null;
925
- 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);
926
949
  let o = a && n.nodes.find((e) => e.id === a) || null;
927
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;
928
951
  }
929
- function pt(e, { placeLive: t } = {}) {
930
- let { state: n } = e;
931
- F(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
+ _(t), r.view === "dataflow" && r.flow ? (r.flow.tiers.forEach((e) => e.nodes.forEach((e) => {
932
955
  e.r = Math.min(e.r, 13);
933
- })), n.proposal && n.baseNodes && ht(e) || f(e, n.flow)) : n.baseNodes && (n.proposal || n.nodes.some((e) => e.live)) ? gt(e, t) : p(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) : P(t);
934
957
  }
935
- function mt(e, t, n) {
958
+ function _t(e, t, n) {
936
959
  let { state: r } = e;
937
- r.mapNodes = t, r.mapEdges = n, r.nodes = t, r.edges = n, r.flow = ut(t, n), D(r.flow), e.touchScene(), pt(e);
938
- }
939
- function ht(e) {
940
- let { state: t } = e, n = {
941
- nodes: t.nodes,
942
- edges: t.edges
943
- }, r = t.baseNodes.map((e) => ({ ...e }));
944
- t.nodes = r, t.edges = t.baseEdges, F(e);
945
- let i = ut(r, t.baseEdges);
946
- i.tiers.forEach((e) => e.nodes.forEach((e) => {
960
+ r.mapNodes = t, r.mapEdges = n, r.nodes = t, r.edges = n, r.flow = pt(t, n), m(r.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, _(t);
968
+ let a = pt(i, n.baseEdges);
969
+ a.tiers.forEach((e) => e.nodes.forEach((e) => {
947
970
  e.r = Math.min(e.r, 13);
948
- })), f(e, i), t.nodes = n.nodes, t.edges = n.edges;
949
- let a = re(t.flow, i);
950
- return e.touchScene(), a;
971
+ })), e(t, a), n.nodes = r.nodes, n.edges = r.edges;
972
+ let o = h(n.flow, a);
973
+ return t.touchScene(), o;
951
974
  }
952
- function gt(e, t) {
975
+ function yt(e, t) {
953
976
  let { state: n } = e, r = {
954
977
  nodes: n.nodes,
955
978
  edges: n.edges
956
979
  }, i = n.baseNodes.map((e) => ({ ...e }));
957
- n.nodes = i, n.edges = n.baseEdges, F(e), p(e);
980
+ n.nodes = i, n.edges = n.baseEdges, _(e), P(e);
958
981
  let a = new Map(i.map((e) => [e.id, e]));
959
- n.nodes = r.nodes, n.edges = r.edges, F(e), n.nodes.forEach((e) => {
982
+ n.nodes = r.nodes, n.edges = r.edges, _(e), n.nodes.forEach((e) => {
960
983
  let t = a.get(e.id);
961
984
  t && (e.x = t.x, e.y = t.y, e.r = t.r);
962
- }), V(n.nodes, n.edges), t && t(n.nodes, n.edges), e.touchScene();
985
+ }), g(n.nodes, n.edges), t && t(n.nodes, n.edges), e.touchScene();
963
986
  }
964
987
  // ../explorer/shaders.js
965
- var Z = "#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", Q = "\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", vt = `${Z}
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}
966
989
  layout(location = 0) in vec2 a_corner;
967
990
  layout(location = 1) in vec4 a_grid; // size, width
968
991
  layout(location = 2) in vec4 a_color;
@@ -975,7 +998,7 @@ void main() {
975
998
  v_color = a_color;
976
999
  gl_Position = vec4(a_corner, 0.0, 1.0);
977
1000
  }
978
- `, yt = `${Z}${Q}
1001
+ `, Ct = `${Q}${xt}
979
1002
  in vec2 v_pos;
980
1003
  flat in vec4 v_grid;
981
1004
  flat in vec4 v_color;
@@ -988,7 +1011,7 @@ void main() {
988
1011
  float cover = max(coverBand(dist.x, hw, pix), coverBand(dist.y, hw, pix));
989
1012
  outColor = vec4(v_color.rgb * v_color.a, v_color.a) * cover;
990
1013
  }
991
- `, bt = `${Z}${_t}
1014
+ `, wt = `${Q}${bt}
992
1015
  layout(location = 0) in vec2 a_corner;
993
1016
  layout(location = 1) in vec4 a_rect; // x, y, w, h (world)
994
1017
  layout(location = 2) in vec4 a_fill;
@@ -1012,7 +1035,7 @@ void main() {
1012
1035
  v_stroke = a_stroke;
1013
1036
  gl_Position = toClip(pos);
1014
1037
  }
1015
- `, xt = `${Z}${Q}
1038
+ `, Tt = `${Q}${xt}
1016
1039
  in vec2 v_local;
1017
1040
  flat in vec2 v_half;
1018
1041
  flat in vec2 v_style;
@@ -1029,7 +1052,7 @@ void main() {
1029
1052
  over(acc, v_stroke.rgb, v_stroke.a * coverBand(abs(sd), v_style.y * zoom * 0.5, pix));
1030
1053
  outColor = acc;
1031
1054
  }
1032
- `, St = `${Z}${_t}
1055
+ `, Et = `${Q}${bt}
1033
1056
  layout(location = 0) in vec2 a_corner;
1034
1057
  layout(location = 1) in vec4 a_geom; // x, y, r, width (world)
1035
1058
  layout(location = 2) in vec4 a_color;
@@ -1049,7 +1072,7 @@ void main() {
1049
1072
  v_dash = a_dash;
1050
1073
  gl_Position = toClip(pos);
1051
1074
  }
1052
- `, Ct = `${Z}${Q}
1075
+ `, Dt = `${Q}${xt}
1053
1076
  in vec2 v_local;
1054
1077
  flat in vec4 v_geom;
1055
1078
  flat in vec4 v_color;
@@ -1064,7 +1087,7 @@ void main() {
1064
1087
  cover *= coverDash(arc, v_dash.x, v_dash.y, pix / zoom);
1065
1088
  outColor = vec4(v_color.rgb * v_color.a, v_color.a) * cover;
1066
1089
  }
1067
- `, wt = `${Z}${_t}
1090
+ `, Ot = `${Q}${bt}
1068
1091
  layout(location = 0) in vec2 a_corner;
1069
1092
  layout(location = 1) in vec4 a_geom; // x, y, r (world), alpha
1070
1093
  layout(location = 2) in vec4 a_color; // r, g, b (0..1), glow (px)
@@ -1092,7 +1115,7 @@ void main() {
1092
1115
  v_kind = a_kind;
1093
1116
  gl_Position = toClip(centre + v_local);
1094
1117
  }
1095
- `, Tt = `${Z}${Q}
1118
+ `, kt = `${Q}${xt}
1096
1119
  in vec2 v_local;
1097
1120
  flat in vec4 v_geom;
1098
1121
  flat in vec4 v_color;
@@ -1145,15 +1168,26 @@ void main() {
1145
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));
1146
1169
  }
1147
1170
 
1148
- // Glow: a blurred copy of the disc under it (see glowDisc)
1149
- float glow = v_color.w;
1150
- if (glow > 0.0) over(acc, v_color.rgb, v_kind.z * al * glowDisc(len, R, glow * 0.5 / u_dpr));
1151
-
1152
- // 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)
1153
1171
  int shapeCode = int(v_kind.w + 0.5);
1154
1172
  bool glyph = shapeCode >= 8;
1155
1173
  if (glyph) shapeCode -= 8;
1156
- 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)
1157
1191
  if (!glyph || 2.0 * R < u_glyphMin) over(acc, u_core.rgb, u_core.a * al * coverEdge(len - R * u_coreRatio, pix));
1158
1192
 
1159
1193
  // Mark: a ring with the look of its own mark (dashed when its dash is set: added), and for removed a
@@ -1182,7 +1216,7 @@ void main() {
1182
1216
 
1183
1217
  outColor = acc;
1184
1218
  }
1185
- `, Et = "\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", Dt = "\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", Ot = (e) => `${Z}${Et}
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}
1186
1220
  #define SEGS ${e}
1187
1221
  layout(location = 1) in vec4 a_ends; // x1, y1, x2, y2 (world)
1188
1222
  layout(location = 2) in vec4 a_geom; // control x, y (world), width (world), glow blur (px)
@@ -1224,7 +1258,7 @@ void main() {
1224
1258
  v_dash = a_dash;
1225
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);
1226
1260
  }
1227
- `, kt = `${Z}${Q}
1261
+ `, Nt = `${Q}${xt}
1228
1262
  in float v_across;
1229
1263
  in float v_arc;
1230
1264
  flat in float v_len;
@@ -1274,7 +1308,7 @@ void main() {
1274
1308
  over(acc, v_color.rgb, v_color.a * cover);
1275
1309
  outColor = acc;
1276
1310
  }
1277
- `, At = `${Z}${_t}
1311
+ `, Pt = `${Q}${bt}
1278
1312
  layout(location = 0) in vec2 a_corner;
1279
1313
  layout(location = 1) in vec4 a_tip; // x, y (world), direction x, y (unit)
1280
1314
  layout(location = 2) in vec4 a_color;
@@ -1294,7 +1328,7 @@ void main() {
1294
1328
  v_kind = a_kind;
1295
1329
  gl_Position = toClip(u_cam.xy + a_tip.xy * zoom + off);
1296
1330
  }
1297
- `, jt = `${Z}${Q}
1331
+ `, Ft = `${Q}${xt}
1298
1332
  in vec2 v_local;
1299
1333
  flat in vec4 v_color;
1300
1334
  flat in float v_kind;
@@ -1350,7 +1384,7 @@ void main() {
1350
1384
  }
1351
1385
  outColor = vec4(v_color.rgb * v_color.a, v_color.a) * coverEdge(sd, pix);
1352
1386
  }
1353
- `, Mt = `${Z}${_t}${Et}${Dt}
1387
+ `, It = `${Q}${bt}${At}${jt}
1354
1388
  layout(location = 0) in vec2 a_corner;
1355
1389
  layout(location = 1) in vec4 a_ends; // x1, y1, x2, y2 (world)
1356
1390
  layout(location = 2) in vec4 a_mot; // control x, y (world), speed (trips per second), phase
@@ -1371,7 +1405,7 @@ void main() {
1371
1405
  v_glow = a_glow;
1372
1406
  gl_Position = toClip(centre + v_local);
1373
1407
  }
1374
- `, Nt = `${Z}${Q}
1408
+ `, Lt = `${Q}${xt}
1375
1409
  in vec2 v_local;
1376
1410
  flat in vec4 v_size;
1377
1411
  flat in vec4 v_color;
@@ -1386,7 +1420,7 @@ void main() {
1386
1420
  over(acc, v_color.rgb, v_color.a * coverEdge(len - R, pix));
1387
1421
  outColor = acc;
1388
1422
  }
1389
- `, Pt = `${Z}${_t}
1423
+ `, Rt = `${Q}${bt}
1390
1424
  layout(location = 0) in vec2 a_corner;
1391
1425
  layout(location = 1) in vec4 a_geom; // x, y, side (world), alpha
1392
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
@@ -1401,7 +1435,7 @@ void main() {
1401
1435
  v_alpha = a_geom.w;
1402
1436
  gl_Position = toClip(pos);
1403
1437
  }
1404
- `, Ft = `${Z}
1438
+ `, zt = `${Q}
1405
1439
  uniform sampler2D u_tex;
1406
1440
  in vec2 v_uv;
1407
1441
  flat in float v_alpha;
@@ -1409,34 +1443,34 @@ out vec4 outColor;
1409
1443
  void main() {
1410
1444
  outColor = texture(u_tex, v_uv) * v_alpha; // the texture is uploaded premultiplied
1411
1445
  }
1412
- `, It = {
1446
+ `, Bt = {
1413
1447
  none: 0,
1414
1448
  selected: 1,
1415
1449
  match: 2,
1416
1450
  child: 3
1417
- }, Lt = {
1451
+ }, Vt = {
1418
1452
  arrow: 1,
1419
1453
  strike: 2,
1420
1454
  chevron: 3,
1421
1455
  bar: 4,
1422
1456
  diamond: 5,
1423
1457
  tick: 6
1424
- }, Rt = Object.freeze(Object.fromEntries(_.map((e, t) => [e, t]))), zt = {
1458
+ }, Ht = Object.freeze(Object.fromEntries(b.map((e, t) => [e, t]))), Ut = {
1425
1459
  none: 0,
1426
1460
  added: 1,
1427
1461
  changed: 2,
1428
1462
  removed: 3,
1429
1463
  edit: 4
1430
1464
  }, $ = (e) => {
1431
- let [n, r, i, a] = t(e);
1465
+ let [t, n, r, i] = R(e);
1432
1466
  return [
1467
+ t / 255,
1433
1468
  n / 255,
1434
1469
  r / 255,
1435
- i / 255,
1436
- a
1470
+ i
1437
1471
  ];
1438
- }, Bt = (e, t) => Object.hasOwn(e, t) ? e[t] : 0;
1439
- function Vt(e) {
1472
+ }, Wt = (e, t) => Object.hasOwn(e, t) ? e[t] : 0;
1473
+ function Gt(e) {
1440
1474
  let { nodes: t } = e, n = new Float32Array(t.length * 12);
1441
1475
  return t.forEach((e, t) => {
1442
1476
  let [r, i, a, o] = $(e.color);
@@ -1449,10 +1483,10 @@ function Vt(e) {
1449
1483
  i,
1450
1484
  a,
1451
1485
  e.glow || 0,
1452
- Bt(It, e.halo),
1453
- Bt(zt, e.mark),
1486
+ Wt(Bt, e.halo),
1487
+ Wt(Ut, e.mark),
1454
1488
  o,
1455
- Bt(Rt, e.shape) + (e.glyph && !e.icon && !e.letters ? 8 : 0)
1489
+ Wt(Ht, e.shape) + (e.glyph && !e.icon && !e.letters ? 8 : 0)
1456
1490
  ], t * 12);
1457
1491
  }), {
1458
1492
  data: n,
@@ -1460,7 +1494,7 @@ function Vt(e) {
1460
1494
  stride: 12
1461
1495
  };
1462
1496
  }
1463
- function Ht(e) {
1497
+ function Kt(e) {
1464
1498
  let { grid: t, rings: n, lanes: r } = e.decor, i = new Float32Array(t ? 8 : 0);
1465
1499
  t && i.set([
1466
1500
  t.size,
@@ -1512,110 +1546,110 @@ function Ht(e) {
1512
1546
  }
1513
1547
  };
1514
1548
  }
1515
- function Ut(t) {
1516
- let n = {
1549
+ function qt(e) {
1550
+ let t = {
1517
1551
  straight: [],
1518
1552
  curved: [],
1519
1553
  tips: [],
1520
1554
  packets: []
1521
1555
  };
1522
- t.edges.forEach((t) => {
1523
- let [r, i, a, o] = $(t.color), c = t.alpha, l = o * c, [u, d] = t.dash && t.dash.length >= 2 ? t.dash : [0, 0], f = t.glow > 0 && !!t.glowColor, [p, m, h, g] = f ? $(t.glowColor) : [
1556
+ e.edges.forEach((e) => {
1557
+ let [n, r, i, a] = $(e.color), o = e.alpha, s = a * o, [c, l] = e.dash && e.dash.length >= 2 ? e.dash : [0, 0], u = e.glow > 0 && !!e.glowColor, [d, f, p, m] = u ? $(e.glowColor) : [
1524
1558
  0,
1525
1559
  0,
1526
1560
  0,
1527
1561
  0
1528
- ], _ = t.curve ? t.curve.cx : (t.x1 + t.x2) / 2, v = t.curve ? t.curve.cy : (t.y1 + t.y2) / 2, y = t.mark && t.mark !== "none" ? 1 : 0;
1529
- if (n[t.curve ? "curved" : "straight"].push([
1530
- t.x1,
1531
- t.y1,
1532
- t.x2,
1533
- t.y2,
1534
- _,
1535
- v,
1536
- t.width,
1537
- f ? t.glow : 0,
1562
+ ], h = e.curve ? e.curve.cx : (e.x1 + e.x2) / 2, g = e.curve ? e.curve.cy : (e.y1 + e.y2) / 2, _ = e.mark && e.mark !== "none" ? 1 : 0;
1563
+ if (t[e.curve ? "curved" : "straight"].push([
1564
+ e.x1,
1565
+ e.y1,
1566
+ e.x2,
1567
+ e.y2,
1568
+ h,
1569
+ g,
1570
+ e.width,
1571
+ u ? e.glow : 0,
1572
+ n,
1538
1573
  r,
1539
1574
  i,
1540
- a,
1541
- l,
1542
- p,
1543
- m,
1544
- h,
1545
- g * l,
1546
- u,
1575
+ s,
1547
1576
  d,
1548
- y
1549
- ]), t.arrow) {
1550
- let e = Math.atan2(t.y2 - (t.curve ? t.curve.cy : t.y1), t.x2 - (t.curve ? t.curve.cx : t.x1)), o = t.end && t.end !== "triangle" && Bt(Lt, t.end) || Lt.arrow;
1551
- n.tips.push([
1552
- t.x2,
1553
- t.y2,
1554
- Math.cos(e),
1555
- Math.sin(e),
1577
+ f,
1578
+ p,
1579
+ m * s,
1580
+ c,
1581
+ l,
1582
+ _
1583
+ ]), e.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;
1585
+ t.tips.push([
1586
+ e.x2,
1587
+ e.y2,
1588
+ Math.cos(a),
1589
+ Math.sin(a),
1590
+ n,
1556
1591
  r,
1557
1592
  i,
1558
- a,
1559
- l,
1593
+ s,
1560
1594
  o
1561
1595
  ]);
1562
1596
  }
1563
- if (t.ticks) {
1564
- let o = e(t, .5), c = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [u, d] = c > 0 ? [(t.x2 - t.x1) / c, (t.y2 - t.y1) / c] : [1, 0];
1565
- for (let e = 0; e < t.ticks; e++) {
1566
- let c = (e - (t.ticks - 1) / 2) * s.tickGap;
1567
- n.tips.push([
1568
- o.x + u * c,
1569
- o.y + d * c,
1570
- u,
1571
- d,
1597
+ if (e.ticks) {
1598
+ let a = y(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];
1599
+ for (let o = 0; o < e.ticks; o++) {
1600
+ let u = (o - (e.ticks - 1) / 2) * V.tickGap;
1601
+ t.tips.push([
1602
+ a.x + c * u,
1603
+ a.y + l * u,
1604
+ c,
1605
+ l,
1606
+ n,
1572
1607
  r,
1573
1608
  i,
1574
- a,
1575
- l,
1576
- Lt.tick
1609
+ s,
1610
+ Vt.tick
1577
1611
  ]);
1578
1612
  }
1579
1613
  }
1580
- if (t.mark === "removed") {
1581
- let o = e(t, .5), s = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [c, u] = s > 0 ? [(t.x2 - t.x1) / s, (t.y2 - t.y1) / s] : [1, 0];
1582
- n.tips.push([
1583
- o.x,
1584
- o.y,
1614
+ if (e.mark === "removed") {
1615
+ let a = y(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];
1616
+ t.tips.push([
1617
+ a.x,
1618
+ a.y,
1585
1619
  c,
1586
- u,
1620
+ l,
1621
+ n,
1587
1622
  r,
1588
1623
  i,
1589
- a,
1590
- l,
1591
- Lt.strike
1624
+ s,
1625
+ Vt.strike
1592
1626
  ]);
1593
1627
  }
1594
- if (t.packet) {
1595
- let e = t.packet, [r, i, a, o] = $(e.color), [s, l, u, d] = $(e.glowColor);
1596
- n.packets.push([
1597
- t.x1,
1598
- t.y1,
1599
- t.x2,
1600
- t.y2,
1601
- _,
1602
- v,
1603
- e.speed,
1604
- e.phase,
1628
+ if (e.packet) {
1629
+ let n = e.packet, [r, i, a, s] = $(n.color), [c, l, u, d] = $(n.glowColor);
1630
+ t.packets.push([
1631
+ e.x1,
1632
+ e.y1,
1633
+ e.x2,
1634
+ e.y2,
1635
+ h,
1636
+ g,
1637
+ n.speed,
1638
+ n.phase,
1605
1639
  r,
1606
1640
  i,
1607
1641
  a,
1608
- o * c,
1609
- s,
1642
+ s * o,
1643
+ c,
1610
1644
  l,
1611
1645
  u,
1612
- d * o * c,
1613
- e.radius,
1614
- e.glow
1646
+ d * s * o,
1647
+ n.radius,
1648
+ n.glow
1615
1649
  ]);
1616
1650
  }
1617
1651
  });
1618
- let r = (e, t) => {
1652
+ let n = (e, t) => {
1619
1653
  let n = new Float32Array(e.length * t);
1620
1654
  return e.forEach((e, r) => n.set(e, r * t)), {
1621
1655
  data: n,
@@ -1624,18 +1658,18 @@ function Ut(t) {
1624
1658
  };
1625
1659
  };
1626
1660
  return {
1627
- straight: r(n.straight, 19),
1628
- curved: r(n.curved, 19),
1629
- tips: r(n.tips, 9),
1630
- packets: r(n.packets, 18)
1661
+ straight: n(t.straight, 19),
1662
+ curved: n(t.curved, 19),
1663
+ tips: n(t.tips, 9),
1664
+ packets: n(t.packets, 18)
1631
1665
  };
1632
1666
  }
1633
- var Wt = (e) => ({
1634
- ...Ht(e),
1635
- nodes: Vt(e),
1636
- ...Ut(e)
1667
+ var Jt = (e) => ({
1668
+ ...Kt(e),
1669
+ nodes: Gt(e),
1670
+ ...qt(e)
1637
1671
  });
1638
- function Gt(e) {
1672
+ function Yt(e) {
1639
1673
  let t = [];
1640
1674
  e.nodes.forEach((e) => {
1641
1675
  if (!e.stroke) return;
@@ -1660,47 +1694,47 @@ function Gt(e) {
1660
1694
  stride: 10
1661
1695
  };
1662
1696
  }
1663
- function Kt(e, t, n = null) {
1664
- let i = /* @__PURE__ */ new Map();
1665
- e.nodes.forEach((e) => {
1666
- let a = e.icon && t(e.icon) ? e.icon : null, o = e.r * l;
1667
- if (!a && !e.icon && e.letters && t(ue(e.letters)) && (a = ue(e.letters), o = e.r * 1), !a && !e.icon && !e.letters && e.glyph) {
1668
- let i = r(e.glyph, v(e, n));
1669
- t(i) && (a = i, o = e.r * G);
1697
+ function Xt(e, t, n = null) {
1698
+ let r = /* @__PURE__ */ new Map();
1699
+ e.nodes.forEach((i) => {
1700
+ let a = i.icon && t(i.icon) ? i.icon : null, o = i.r * G;
1701
+ if (!a && !i.icon && i.letters && t(de(i.letters)) && (a = de(i.letters), o = i.r * 1), !a && !i.icon && !i.letters && i.glyph) {
1702
+ let r = re(i.glyph, u(i, n, e.theme));
1703
+ t(r) && (a = r, o = i.r * c);
1670
1704
  }
1671
1705
  if (!a) return;
1672
- i.has(a) || i.set(a, {
1706
+ r.has(a) || r.set(a, {
1673
1707
  rows: [],
1674
1708
  minR: Infinity,
1675
1709
  maxR: 0
1676
1710
  });
1677
- let s = i.get(a);
1678
- s.maxR = Math.max(s.maxR, e.r), s.rows.push([
1679
- e.x,
1680
- e.y,
1711
+ let s = r.get(a);
1712
+ s.maxR = Math.max(s.maxR, i.r), s.rows.push([
1713
+ i.x,
1714
+ i.y,
1681
1715
  o,
1682
- e.alpha
1683
- ]), s.minR = Math.min(s.minR, e.r);
1716
+ i.alpha
1717
+ ]), s.minR = Math.min(s.minR, i.r);
1684
1718
  });
1685
- let a = [], o = [];
1686
- for (let [e, { rows: t, minR: n, maxR: r }] of i) a.push({
1719
+ let i = [], a = [];
1720
+ for (let [e, { rows: t, minR: n, maxR: o }] of r) i.push({
1687
1721
  kind: e,
1688
- first: o.length,
1722
+ first: a.length,
1689
1723
  count: t.length,
1690
1724
  minR: n,
1691
- maxR: r
1692
- }), o.push(...t);
1693
- let s = new Float32Array(o.length * 4);
1694
- return o.forEach((e, t) => s.set(e, t * 4)), {
1695
- data: s,
1696
- count: o.length,
1725
+ maxR: o
1726
+ }), a.push(...t);
1727
+ let o = new Float32Array(a.length * 4);
1728
+ return a.forEach((e, t) => o.set(e, t * 4)), {
1729
+ data: o,
1730
+ count: a.length,
1697
1731
  stride: 4,
1698
- groups: a
1732
+ groups: i
1699
1733
  };
1700
1734
  }
1701
- function qt(e = "dark", t = null) {
1702
- let { halo: n, mark: r, core: i } = t ? ce(P(e), t) : P(e), a = /* @__PURE__ */ new Float32Array(16), o = /* @__PURE__ */ new Float32Array(16), s = /* @__PURE__ */ new Float32Array(16);
1703
- Object.entries(It).forEach(([e, t]) => {
1735
+ function Zt(e = "dark", t = null) {
1736
+ let { halo: n, mark: r, core: i } = t ? M(z(e), t) : z(e), a = /* @__PURE__ */ new Float32Array(16), o = /* @__PURE__ */ new Float32Array(16), s = /* @__PURE__ */ new Float32Array(16);
1737
+ Object.entries(Bt).forEach(([e, t]) => {
1704
1738
  let r = n[e];
1705
1739
  t && r && (a.set($(r.fill), t * 4), o.set($(r.ring), t * 4), s.set([
1706
1740
  r.fillR,
@@ -1710,7 +1744,7 @@ function qt(e = "dark", t = null) {
1710
1744
  ], t * 4));
1711
1745
  });
1712
1746
  let c = /* @__PURE__ */ new Float32Array(20), l = /* @__PURE__ */ new Float32Array(20);
1713
- return Object.entries(zt).forEach(([e, t]) => {
1747
+ return Object.entries(Ut).forEach(([e, t]) => {
1714
1748
  if (!t) return;
1715
1749
  let n = r[e];
1716
1750
  c.set($(n.color), t * 4);
@@ -1728,19 +1762,19 @@ function qt(e = "dark", t = null) {
1728
1762
  markColor: c,
1729
1763
  markGeom: l,
1730
1764
  markMin: new Float32Array([
1731
- w.ring,
1732
- w.edge,
1733
- w.gap
1765
+ q.ring,
1766
+ q.edge,
1767
+ q.gap
1734
1768
  ]),
1735
1769
  core: new Float32Array($(i)),
1736
- coreRatio: b
1770
+ coreRatio: F
1737
1771
  };
1738
1772
  }
1739
- var Jt = [
1773
+ var Qt = [
1740
1774
  {
1741
1775
  name: "grid",
1742
- vert: vt,
1743
- frag: yt,
1776
+ vert: St,
1777
+ frag: Ct,
1744
1778
  stride: 8,
1745
1779
  attribs: [[
1746
1780
  1,
@@ -1754,8 +1788,8 @@ var Jt = [
1754
1788
  },
1755
1789
  {
1756
1790
  name: "lanes",
1757
- vert: bt,
1758
- frag: xt,
1791
+ vert: wt,
1792
+ frag: Tt,
1759
1793
  stride: 14,
1760
1794
  attribs: [
1761
1795
  [
@@ -1782,8 +1816,8 @@ var Jt = [
1782
1816
  },
1783
1817
  {
1784
1818
  name: "rings",
1785
- vert: St,
1786
- frag: Ct,
1819
+ vert: Et,
1820
+ frag: Dt,
1787
1821
  stride: 10,
1788
1822
  attribs: [
1789
1823
  [
@@ -1805,8 +1839,8 @@ var Jt = [
1805
1839
  },
1806
1840
  {
1807
1841
  name: "straight",
1808
- vert: Ot(1),
1809
- frag: kt,
1842
+ vert: Mt(1),
1843
+ frag: Nt,
1810
1844
  stride: 19,
1811
1845
  verts: 8,
1812
1846
  attribs: [
@@ -1845,8 +1879,8 @@ var Jt = [
1845
1879
  },
1846
1880
  {
1847
1881
  name: "curved",
1848
- vert: Ot(24),
1849
- frag: kt,
1882
+ vert: Mt(24),
1883
+ frag: Nt,
1850
1884
  stride: 19,
1851
1885
  verts: 54,
1852
1886
  attribs: [
@@ -1885,8 +1919,8 @@ var Jt = [
1885
1919
  },
1886
1920
  {
1887
1921
  name: "tips",
1888
- vert: At,
1889
- frag: jt,
1922
+ vert: Pt,
1923
+ frag: Ft,
1890
1924
  stride: 9,
1891
1925
  attribs: [
1892
1926
  [
@@ -1909,8 +1943,8 @@ var Jt = [
1909
1943
  },
1910
1944
  {
1911
1945
  name: "packets",
1912
- vert: Mt,
1913
- frag: Nt,
1946
+ vert: It,
1947
+ frag: Lt,
1914
1948
  stride: 18,
1915
1949
  attribs: [
1916
1950
  [
@@ -1943,8 +1977,8 @@ var Jt = [
1943
1977
  },
1944
1978
  {
1945
1979
  name: "nodes",
1946
- vert: wt,
1947
- frag: Tt,
1980
+ vert: Ot,
1981
+ frag: kt,
1948
1982
  stride: 12,
1949
1983
  attribs: [
1950
1984
  [
@@ -1965,17 +1999,17 @@ var Jt = [
1965
1999
  ],
1966
2000
  constants: "nodes"
1967
2001
  }
1968
- ], Yt = {
2002
+ ], $t = {
1969
2003
  nodes(e, t, n) {
1970
- 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"), C.roundedHalf, C.roundedCorner, C.hexInradius, C.squareHalf), e.uniform2f(t("u_shape2"), C.squareCorner, C.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);
1971
2005
  },
1972
2006
  edges(e, t, n) {
1973
2007
  e.uniform3fv(t("u_markMin"), n.markMin);
1974
2008
  },
1975
2009
  tips(e, t) {
1976
- e.uniform4f(t("u_tip"), c.length, c.spread, S.halfLength, S.width), e.uniform4f(t("u_end"), s.strokeWidth, s.barHalf, s.diamondHalf, s.diamondAcross), e.uniform2f(t("u_tick"), s.tickHalf, s.tickWidth);
2010
+ e.uniform4f(t("u_tip"), N.length, N.spread, W.halfLength, W.width), e.uniform4f(t("u_end"), V.strokeWidth, V.barHalf, V.diamondHalf, V.diamondAcross), e.uniform2f(t("u_tick"), V.tickHalf, V.tickWidth);
1977
2011
  }
1978
- }, Xt = {
2012
+ }, en = {
1979
2013
  alpha: !0,
1980
2014
  premultipliedAlpha: !0,
1981
2015
  antialias: !1,
@@ -1984,7 +2018,7 @@ var Jt = [
1984
2018
  preserveDrawingBuffer: !1,
1985
2019
  powerPreference: "high-performance"
1986
2020
  };
1987
- function Zt(e, t, n, r) {
2021
+ function tn(e, t, n, r) {
1988
2022
  let i = e.createShader(t);
1989
2023
  if (e.shaderSource(i, n), e.compileShader(i), !e.getShaderParameter(i, e.COMPILE_STATUS)) {
1990
2024
  let t = e.getShaderInfoLog(i);
@@ -1992,23 +2026,23 @@ function Zt(e, t, n, r) {
1992
2026
  }
1993
2027
  return i;
1994
2028
  }
1995
- function Qt(e, t, n, r) {
1996
- let i = Zt(e, e.VERTEX_SHADER, t, `${r} vertex`), a = Zt(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();
1997
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)) {
1998
2032
  let t = e.getProgramInfoLog(o);
1999
2033
  throw e.deleteProgram(o), Error(`${r} program did not link: ${t}`);
2000
2034
  }
2001
2035
  return o;
2002
2036
  }
2003
- var $t = (e) => !e || e.plain ? 0 : e.version;
2004
- function en(e, t, n, r = null) {
2005
- let i = qt(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);
2006
2040
  t.passes.forEach((t) => {
2007
- t.spec.constants && (e.useProgram(t.program), Yt[t.spec.constants](e, t.at, i));
2008
- }), t.theme = n, t.styleKey = $t(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);
2009
2043
  }
2010
- function tn(e, t, n) {
2011
- let r = Qt(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();
2012
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]) => {
2013
2047
  e.enableVertexAttribArray(n), e.vertexAttribPointer(n, r, e.FLOAT, !1, t.stride * 4, i * 4), e.vertexAttribDivisor(n, 1);
2014
2048
  }), e.bindVertexArray(null);
@@ -2028,11 +2062,11 @@ function tn(e, t, n) {
2028
2062
  }
2029
2063
  };
2030
2064
  }
2031
- var nn = {
2065
+ var sn = {
2032
2066
  strokes: {
2033
2067
  name: "strokes",
2034
- vert: St,
2035
- frag: Ct,
2068
+ vert: Et,
2069
+ frag: Dt,
2036
2070
  stride: 10,
2037
2071
  attribs: [
2038
2072
  [
@@ -2054,8 +2088,8 @@ var nn = {
2054
2088
  },
2055
2089
  icons: {
2056
2090
  name: "icons",
2057
- vert: Pt,
2058
- frag: Ft,
2091
+ vert: Rt,
2092
+ frag: zt,
2059
2093
  stride: 4,
2060
2094
  attribs: [[
2061
2095
  1,
@@ -2064,7 +2098,7 @@ var nn = {
2064
2098
  ]]
2065
2099
  }
2066
2100
  };
2067
- function rn(e, t = "dark", n = null) {
2101
+ function cn(e, t = "dark", n = null) {
2068
2102
  let r = e.createBuffer();
2069
2103
  e.bindBuffer(e.ARRAY_BUFFER, r), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
2070
2104
  -1,
@@ -2078,7 +2112,7 @@ function rn(e, t = "dark", n = null) {
2078
2112
  ]), e.STATIC_DRAW);
2079
2113
  let i = {
2080
2114
  corners: r,
2081
- passes: Jt.map((t) => tn(e, t, r)),
2115
+ passes: Qt.map((t) => on(e, t, r)),
2082
2116
  theme: t,
2083
2117
  styleKey: 0,
2084
2118
  extras: {
@@ -2088,41 +2122,41 @@ function rn(e, t = "dark", n = null) {
2088
2122
  textures: /* @__PURE__ */ new Map(),
2089
2123
  iconStore: null
2090
2124
  };
2091
- return en(e, i, t, n), i;
2125
+ return an(e, i, t, n), i;
2092
2126
  }
2093
- function an(e, t) {
2127
+ function ln(e, t) {
2094
2128
  e.deleteBuffer(t.corners), t.textures.forEach(({ texture: t }) => e.deleteTexture(t)), [...t.passes, ...Object.values(t.extras).filter(Boolean)].forEach((t) => {
2095
2129
  e.deleteProgram(t.program), e.deleteVertexArray(t.vao), e.deleteBuffer(t.buffer);
2096
2130
  });
2097
2131
  }
2098
- function on(e, t = {}) {
2099
- let n = t.gl || e.getContext("webgl2", Xt);
2132
+ function un(e, t = {}) {
2133
+ let n = t.gl || e.getContext("webgl2", en);
2100
2134
  if (!n) throw Error("WebGL2 is not available");
2101
- let r = t.mapStyle || (() => d), i = {
2135
+ let r = t.mapStyle || (() => L), i = {
2102
2136
  uploads: 0,
2103
2137
  draws: 0
2104
- }, s = rn(n), c = !1, l = 0, u = 0, f = null, p = null, m, h = null;
2105
- function g(e) {
2106
- return s.extras[e] || (s.extras[e] = tn(n, nn[e], s.corners)), s.extras[e];
2138
+ }, a = cn(n), s = !1, u = 0, d = 0, f = null, p = null, m, h = null, g = null;
2139
+ function _(e) {
2140
+ return a.extras[e] || (a.extras[e] = on(n, sn[e], a.corners)), a.extras[e];
2107
2141
  }
2108
- function _() {
2109
- s.passes.forEach((e) => {
2142
+ function v() {
2143
+ a.passes.forEach((e) => {
2110
2144
  let t = f[e.spec.name];
2111
2145
  e.count = t.count, t.count && (n.bindBuffer(n.ARRAY_BUFFER, e.buffer), n.bufferData(n.ARRAY_BUFFER, t.data, n.DYNAMIC_DRAW));
2112
2146
  });
2113
- for (let e of Object.keys(nn)) {
2147
+ for (let e of Object.keys(sn)) {
2114
2148
  let t = f[e];
2115
- if (!t.count && !s.extras[e]) continue;
2116
- let r = g(e);
2149
+ if (!t.count && !a.extras[e]) continue;
2150
+ let r = _(e);
2117
2151
  r.count = t.count, t.count && (n.bindBuffer(n.ARRAY_BUFFER, r.buffer), n.bufferData(n.ARRAY_BUFFER, t.data, n.DYNAMIC_DRAW));
2118
2152
  }
2119
2153
  i.uploads++;
2120
2154
  }
2121
- function v(e, t) {
2155
+ function y(e, t) {
2122
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);
2123
2157
  }
2124
- function y(e, t, r) {
2125
- let i = s.textures.get(e);
2158
+ function b(e, t, r) {
2159
+ let i = a.textures.get(e);
2126
2160
  if (!i || i.image !== t) {
2127
2161
  i && n.deleteTexture(i.texture);
2128
2162
  let r = n.createTexture();
@@ -2130,92 +2164,92 @@ function on(e, t = {}) {
2130
2164
  image: t,
2131
2165
  texture: r,
2132
2166
  pixelated: null
2133
- }, s.textures.set(e, i);
2167
+ }, a.textures.set(e, i);
2134
2168
  }
2135
- return i.pixelated !== r && (v(i.texture, r), i.pixelated = r), i.texture;
2169
+ return i.pixelated !== r && (y(i.texture, r), i.pixelated = r), i.texture;
2136
2170
  }
2137
- function b(t, d, g) {
2138
- if (h = [
2171
+ function x(t, _, y) {
2172
+ if (g = [
2139
2173
  t,
2140
- d,
2141
- g
2142
- ], c || !s || !l || !u) return;
2143
- let v = r(), b = x(t, v), S = v.values ? v.values[o] : void 0;
2144
- (s.iconStore !== v.icons || s.glyphInk !== S) && (s.textures.forEach(({ texture: e }) => n.deleteTexture(e)), s.textures.clear(), s.iconStore = v.icons, s.glyphInk = S, p = null), (b !== p || b.version !== m) && (f = {
2145
- ...Wt(b),
2146
- strokes: Gt(b),
2147
- icons: Kt(b, (e) => de(e) ? !!he(fe(e), S) : a(e) ? !!oe(K(e).type, K(e).ink) : !!(v.icons && v.icons.get(e)), v)
2148
- }, p = b, m = b.version, _());
2149
- let C = b.theme || "dark";
2150
- (s.theme !== C || s.styleKey !== $t(v)) && en(n, s, C, v), 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), s.passes.forEach((t) => {
2151
- t.count && (n.useProgram(t.program), n.uniform2f(t.uniforms.viewport, l, u), n.uniform3f(t.uniforms.cam, d.x, d.y, d.zoom), n.uniform1f(t.uniforms.dpr, e.width / l), n.bindVertexArray(t.vao), t.uniforms.time && n.uniform1f(t.uniforms.time, (g || 0) / 1e3), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, t.spec.verts || 4, t.count), i.draws++);
2174
+ _,
2175
+ y
2176
+ ], s || !a || !u || !d) return;
2177
+ let x = r(), S = ae(t, x), w = x.values ? x.values[H] : void 0;
2178
+ (a.iconStore !== x.icons || a.glyphInk !== w) && (a.textures.forEach(({ texture: e }) => n.deleteTexture(e)), a.textures.clear(), a.iconStore = x.icons, a.glyphInk = w, p = null), h !== x.ground && (h = x.ground, p = null), (S !== p || S.version !== m) && (f = {
2179
+ ...Jt(S),
2180
+ strokes: Yt(S),
2181
+ icons: Xt(S, (e) => fe(e) ? !!ge(pe(e), w) : C(e) ? !!o(l(e).type, l(e).ink) : !!(x.icons && x.icons.get(e)), x)
2182
+ }, p = S, m = S.version, v());
2183
+ let T = S.theme || "dark";
2184
+ (a.theme !== T || a.styleKey !== rn(x)) && an(n, a, T, x), 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, u, d), n.uniform3f(t.uniforms.cam, _.x, _.y, _.zoom), n.uniform1f(t.uniforms.dpr, e.width / u), n.bindVertexArray(t.vao), t.uniforms.time && n.uniform1f(t.uniforms.time, (y || 0) / 1e3), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, t.spec.verts || 4, t.count), i.draws++);
2152
2186
  });
2153
- let w = s.extras.strokes;
2154
- w && w.count && (n.useProgram(w.program), n.uniform2f(w.uniforms.viewport, l, u), n.uniform3f(w.uniforms.cam, d.x, d.y, d.zoom), n.uniform1f(w.uniforms.dpr, e.width / l), n.bindVertexArray(w.vao), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, w.count), i.draws++);
2155
- let T = s.extras.icons;
2156
- if (T && T.count) {
2157
- n.useProgram(T.program), n.uniform2f(T.uniforms.viewport, l, u), n.uniform3f(T.uniforms.cam, d.x, d.y, d.zoom), n.uniform1f(T.uniforms.dpr, e.width / l), n.uniform1i(T.at("u_tex"), 0), n.activeTexture(n.TEXTURE0), n.bindVertexArray(T.vao), n.bindBuffer(n.ARRAY_BUFFER, T.buffer);
2187
+ let E = a.extras.strokes;
2188
+ E && E.count && (n.useProgram(E.program), n.uniform2f(E.uniforms.viewport, u, d), n.uniform3f(E.uniforms.cam, _.x, _.y, _.zoom), n.uniform1f(E.uniforms.dpr, e.width / u), n.bindVertexArray(E.vao), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, E.count), i.draws++);
2189
+ let D = a.extras.icons;
2190
+ if (D && D.count) {
2191
+ n.useProgram(D.program), n.uniform2f(D.uniforms.viewport, u, d), n.uniform3f(D.uniforms.cam, _.x, _.y, _.zoom), n.uniform1f(D.uniforms.dpr, e.width / u), n.uniform1i(D.at("u_tex"), 0), n.activeTexture(n.TEXTURE0), n.bindVertexArray(D.vao), n.bindBuffer(n.ARRAY_BUFFER, D.buffer);
2158
2192
  for (let e of f.icons.groups) {
2159
- let t = de(e.kind), r = a(e.kind), o = t || r ? 14 : 0;
2160
- if (o && e.maxR * 2 * d.zoom < o) continue;
2161
- n.uniform1f(T.at("u_minR"), o / 2), n.uniform1f(T.at("u_sideRatio"), t ? 1 : r ? G : 1);
2162
- let s = t ? he(fe(e.kind), v.values && v.values["--corn-map-glyph"]) : r ? oe(K(e.kind).type, K(e.kind).ink) : v.icons && v.icons.get(e.kind);
2163
- s && (n.bindTexture(n.TEXTURE_2D, y(e.kind, s, !!v.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 = C(e.kind), a = t || r ? 14 : 0;
2194
+ if (a && e.maxR * 2 * _.zoom < a) continue;
2195
+ n.uniform1f(D.at("u_minR"), a / 2), n.uniform1f(D.at("u_sideRatio"), t ? 1 : r ? c : 1);
2196
+ let s = t ? ge(pe(e.kind), x.values && x.values["--corn-map-glyph"]) : r ? o(l(e.kind).type, l(e.kind).ink) : x.icons && x.icons.get(e.kind);
2197
+ s && (n.bindTexture(n.TEXTURE_2D, b(e.kind, s, !!x.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++);
2164
2198
  }
2165
2199
  }
2166
2200
  n.bindVertexArray(null);
2167
2201
  }
2168
2202
  let S = (e) => {
2169
- e.preventDefault(), c = !0, s = null;
2170
- }, C = () => {
2203
+ e.preventDefault(), s = !0, a = null;
2204
+ }, w = () => {
2171
2205
  try {
2172
- s = rn(n, h && h[0].theme || "dark", r()), c = !1, f && _(), h && b(...h);
2206
+ a = cn(n, g && g[0].theme || "dark", r()), s = !1, f && v(), g && x(...g);
2173
2207
  } catch (e) {
2174
2208
  console.warn("WebGL2 context restored but the renderer could not be rebuilt:", e.message);
2175
2209
  }
2176
2210
  };
2177
- return e.addEventListener("webglcontextlost", S), e.addEventListener("webglcontextrestored", C), {
2211
+ return e.addEventListener("webglcontextlost", S), e.addEventListener("webglcontextrestored", w), {
2178
2212
  kind: "webgl2",
2179
2213
  stats: i,
2180
2214
  resize(t, n, r) {
2181
- l = t, u = n, e.width = Math.round(t * r), e.height = Math.round(n * r), h && b(...h);
2215
+ u = t, d = n, e.width = Math.round(t * r), e.height = Math.round(n * r), g && x(...g);
2182
2216
  },
2183
- draw: b,
2184
- destroy: w,
2217
+ draw: x,
2218
+ destroy: T,
2185
2219
  release() {
2186
- let e = c;
2187
- w();
2220
+ let e = s;
2221
+ T();
2188
2222
  try {
2189
2223
  let t = !e && n.getExtension ? n.getExtension("WEBGL_lose_context") : null;
2190
2224
  t && t.loseContext();
2191
2225
  } catch {}
2192
2226
  }
2193
2227
  };
2194
- function w() {
2195
- e.removeEventListener("webglcontextlost", S), e.removeEventListener("webglcontextrestored", C), s && !c && an(n, s), s = null, c = !0;
2228
+ function T() {
2229
+ e.removeEventListener("webglcontextlost", S), e.removeEventListener("webglcontextrestored", w), a && !s && ln(n, a), a = null, s = !0;
2196
2230
  }
2197
2231
  }
2198
2232
  // ../explorer/renderer.js
2199
- function sn(e) {
2233
+ function dn(e) {
2200
2234
  let t = e.ownerDocument.createElement("canvas");
2201
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;
2202
2236
  }
2203
- function cn(e, t = {}) {
2237
+ function fn(e, t = {}) {
2204
2238
  let n = t.prefer || null, r = t.mapStyle ? { mapStyle: t.mapStyle } : {};
2205
- if (n === "canvas2d") return Me(e, r);
2239
+ if (n === "canvas2d") return Fe(e, r);
2206
2240
  let i = null;
2207
2241
  try {
2208
- i = e.getContext("webgl2", Xt);
2242
+ i = e.getContext("webgl2", en);
2209
2243
  } catch {}
2210
- if (!i) return Me(e, r);
2244
+ if (!i) return Fe(e, r);
2211
2245
  try {
2212
- return on(e, {
2246
+ return un(e, {
2213
2247
  gl: i,
2214
2248
  ...r
2215
2249
  });
2216
2250
  } catch (n) {
2217
2251
  console.warn(`WebGL2 renderer unavailable, drawing with Canvas 2D: ${n.message}`);
2218
- let i = (t.makeStandIn || sn)(e), a = Me(i, r);
2252
+ let i = (t.makeStandIn || dn)(e), a = Fe(i, r);
2219
2253
  return {
2220
2254
  ...a,
2221
2255
  destroy() {
@@ -2225,7 +2259,7 @@ function cn(e, t = {}) {
2225
2259
  }
2226
2260
  }
2227
2261
  // ../explorer/cluster.js
2228
- function ln(e, t) {
2262
+ function pn(e, t) {
2229
2263
  let n = /* @__PURE__ */ new Map();
2230
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);
2231
2265
  let r = /* @__PURE__ */ new Set([e]), i = [e];
@@ -2233,39 +2267,39 @@ function ln(e, t) {
2233
2267
  return r;
2234
2268
  }
2235
2269
  // ../explorer/input.js
2236
- function un(e) {
2237
- let { state: t } = e, { render: n, getSpatialIndex: r, queueFrameWork: i, screenToWorld: a, getMinZoom: o, setHoverNode: s, labelNodeAt: c, fitGraphToViewport: l, fitPadding: d } = e.map, f = (t) => e.emit("select", t), p = () => e.emit("background"), m = () => e.emit("grab"), g = !1, _ = null, v = {
2270
+ function mn(e) {
2271
+ let { state: t } = 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, _ = {
2238
2272
  x: 0,
2239
2273
  y: 0
2240
2274
  }, y = {
2241
2275
  x: 0,
2242
2276
  y: 0
2243
- }, b = !1, x = null, S = null, C = 0, w = null, T = !1, E = null, D = null, O = null, ee = !1, k = "", A = () => t.isFreeform && t.view === "orbit";
2244
- function j(e) {
2277
+ }, b = !1, x = null, S = null, C = 0, w = null, T = !1, E = null, D = null, O = null, A = !1, j = "", M = () => t.isFreeform && t.view === "orbit";
2278
+ function N(e) {
2245
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;
2246
2280
  return {
2247
2281
  x: (r.clientX - n.left) * i,
2248
2282
  y: (r.clientY - n.top) * a
2249
2283
  };
2250
2284
  }
2251
- let N = {
2285
+ let P = {
2252
2286
  nodes: null,
2253
2287
  size: -1,
2254
2288
  map: null
2255
2289
  };
2256
- function P(e) {
2257
- return (N.nodes !== t.nodes || N.size !== t.nodes.length) && (N = {
2290
+ function ee(e) {
2291
+ return (P.nodes !== t.nodes || P.size !== t.nodes.length) && (P = {
2258
2292
  nodes: t.nodes,
2259
2293
  size: t.nodes.length,
2260
2294
  map: new Map(t.nodes.map((e) => [e.id, e]))
2261
- }), N.map.get(e) || null;
2295
+ }), P.map.get(e) || null;
2262
2296
  }
2263
- function F(e, n, i) {
2264
- let a = Fe(r(), t.camera, e, n, i);
2265
- return a ? P(a.id) : null;
2297
+ function F(e, n, r) {
2298
+ let a = Re(i(), t.camera, e, n, r);
2299
+ return a ? ee(a.id) : null;
2266
2300
  }
2267
- let ne = (e) => Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY);
2268
- function I(e) {
2301
+ let I = (e) => Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY);
2302
+ function L(e) {
2269
2303
  let n = t.canvas.getBoundingClientRect();
2270
2304
  return {
2271
2305
  x: (e.touches[0].clientX + e.touches[1].clientX) / 2 - n.left,
@@ -2273,130 +2307,131 @@ function un(e) {
2273
2307
  };
2274
2308
  }
2275
2309
  function R(e) {
2276
- if (T = !0, m(), s(null), e.touches && e.touches.length === 2) {
2277
- w = te(t.camera, ne(e), I(e)), E = null, g = !1, _ = null, x = null;
2310
+ if (T = !0, m(), c(null), e.touches && e.touches.length === 2) {
2311
+ w = n(t.camera, I(e), L(e)), E = null, h = !1, g = null, x = null;
2278
2312
  return;
2279
2313
  }
2280
- let n = !!(e.touches && e.touches.length > 0), r = j(e);
2314
+ let r = !!(e.touches && e.touches.length > 0), i = N(e);
2281
2315
  y = {
2282
- x: r.x,
2283
- y: r.y
2284
- }, b = !1, E = null, x = F(r.x, r.y, n), A() && x ? (_ = x, e.cancelable && e.preventDefault()) : (g = !0, v = r);
2316
+ x: i.x,
2317
+ y: i.y
2318
+ }, b = !1, E = null, x = F(i.x, i.y, r), M() && x ? (g = x, e.cancelable && e.preventDefault()) : (h = !0, _ = i);
2285
2319
  }
2286
- function re() {
2287
- D && w && Object.assign(t.camera, L(w, D.dist, D.mid, o())), D = null;
2320
+ function z() {
2321
+ D && w && Object.assign(t.camera, v(w, D.dist, D.mid, s())), D = null;
2288
2322
  let n = E;
2289
2323
  if (E = null, n) {
2290
- if (_ && A()) {
2291
- let r = a(n.x, n.y);
2292
- _.x = r.x, _.y = r.y, t.freeformPositions[_.id] = {
2324
+ if (g && M()) {
2325
+ let r = o(n.x, n.y);
2326
+ g.x = r.x, g.y = r.y, t.freeformPositions[g.id] = {
2293
2327
  x: r.x,
2294
2328
  y: r.y
2295
- }, e.touchScene(), h(e);
2296
- } else g && (t.camera.x += n.x - v.x, t.camera.y += n.y - v.y, v = n);
2329
+ }, e.touchScene(), K(e);
2330
+ } else h && (t.camera.x += n.x - _.x, t.camera.y += n.y - _.y, _ = n);
2297
2331
  }
2298
2332
  }
2299
- function z() {
2333
+ function B() {
2300
2334
  let e = O;
2301
- if (O = null, !e || g || _) return;
2335
+ if (O = null, !e || h || g) return;
2302
2336
  let t = F(e.x, e.y, !1);
2303
- ie(!!t), s(t ? t.id : null);
2337
+ te(!!t), c(t ? t.id : null);
2304
2338
  }
2305
- function ie(e) {
2306
- e !== ee && t.canvas && (e && (k = t.canvas.style.cursor), ee = e, t.canvas.style.cursor = e ? "pointer" : k);
2339
+ function te(e) {
2340
+ e !== A && t.canvas && (e && (j = t.canvas.style.cursor), A = e, t.canvas.style.cursor = e ? "pointer" : j);
2307
2341
  }
2308
- function B(e) {
2342
+ function ne(e) {
2309
2343
  if (e.touches && e.touches.length === 2 && w) {
2310
2344
  e.cancelable && e.preventDefault(), D = {
2311
- dist: ne(e),
2312
- mid: I(e)
2313
- }, i(re);
2345
+ dist: I(e),
2346
+ mid: L(e)
2347
+ }, a(z);
2314
2348
  return;
2315
2349
  }
2316
- let t = j(e);
2317
- Math.hypot(t.x - y.x, t.y - y.y) > 8 && (b = !0), _ && A() || g ? (e.cancelable && e.preventDefault(), E = t, i(re)) : e.touches || (O = t, i(z, { draw: !1 }));
2350
+ let t = N(e);
2351
+ 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(B, { draw: !1 }));
2318
2352
  }
2319
2353
  function V(e) {
2320
- re();
2354
+ z();
2321
2355
  let n = !!(e.changedTouches && e.changedTouches.length > 0), r = t.canvas.getBoundingClientRect(), i = n ? {
2322
2356
  x: e.changedTouches[0].clientX - r.left,
2323
2357
  y: e.changedTouches[0].clientY - r.top
2324
- } : j(e);
2358
+ } : N(e);
2325
2359
  if (!b && T) {
2326
2360
  if (x) {
2327
2361
  let e = F(i.x, i.y, n);
2328
2362
  if (e && e.id === x.id) {
2329
- if (!A()) f(x);
2363
+ if (!M()) f(x);
2330
2364
  else {
2331
2365
  let e = Date.now();
2332
2366
  S && S.id === x.id && e - C < 380 ? (f(x), S = null, C = 0) : (S = x, C = e);
2333
2367
  }
2334
2368
  }
2335
2369
  } else {
2336
- let e = P(c(i.x, i.y));
2337
- e && u.includes(e.type) && e.id !== "root" ? l(d(), ln(e.id, t.edges)) : t.selectedNode && p();
2370
+ let e = ee(l(i.x, i.y));
2371
+ e && k.includes(e.type) && e.id !== "root" ? u(d(), pn(e.id, t.edges)) : t.selectedNode && p();
2338
2372
  }
2339
2373
  }
2340
- g = !1, _ = null, x = null, w = null, D = null, T = !1;
2341
- }
2342
- let { canvas: H } = t, ae = !(e.root && e.root.nodeType === 9), U = (r) => {
2343
- if (ae && !r.ctrlKey && !r.metaKey && e.active() !== t.canvas) return;
2344
- r.preventDefault(), m();
2345
- let i = j(r);
2346
- Object.assign(t.camera, M(t.camera, r.deltaY < 0 ? 1.12 : .88, i.x, i.y, o())), n();
2347
- }, W = e.root || H, G = [
2374
+ h = !1, g = null, x = null, w = null, D = null, T = !1;
2375
+ }
2376
+ let { canvas: H } = t, U = !(e.root && e.root.nodeType === 9), W = (n) => {
2377
+ if (U && !n.ctrlKey && !n.metaKey && e.active() !== t.canvas) return;
2378
+ n.preventDefault(), m();
2379
+ let i = N(n);
2380
+ Object.assign(t.camera, ce(t.camera, n.deltaY < 0 ? 1.12 : .88, i.x, i.y, s())), r();
2381
+ }, re = e.root || H, G = [
2348
2382
  e.listen(H, "mousedown", R),
2349
- e.listen(H, "mousemove", B),
2383
+ e.listen(H, "mousemove", ne),
2350
2384
  e.listen(H, "mouseleave", () => {
2351
- O = null, ie(!1), s(null);
2385
+ O = null, te(!1), c(null);
2352
2386
  }),
2353
- e.listen(W, "mouseup", V),
2387
+ e.listen(re, "mouseup", V),
2354
2388
  e.listen(H, "touchstart", R, { passive: !1 }),
2355
- e.listen(H, "touchmove", B, { passive: !1 }),
2356
- e.listen(W, "touchend", V, { passive: !1 }),
2357
- e.listen(W, "touchcancel", V, { passive: !1 }),
2358
- e.listen(H, "wheel", U, { passive: !1 })
2389
+ e.listen(H, "touchmove", ne, { passive: !1 }),
2390
+ e.listen(re, "touchend", V, { passive: !1 }),
2391
+ e.listen(re, "touchcancel", V, { passive: !1 }),
2392
+ e.listen(H, "wheel", W, { passive: !1 })
2359
2393
  ];
2360
2394
  return () => G.forEach((e) => e());
2361
2395
  }
2362
2396
  // ../explorer/pieces/map.js
2363
- var dn = "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.", fn = "<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>", pn = ({ keysHelp: e = dn } = {}) => ({ stage: `${fn}
2364
- <p id="map-keys-help" class="hx-sr-only">${k(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">${d(e)}</p>
2365
2399
  <p id="map-announcer" class="hx-sr-only" role="status" aria-live="polite"></p>
2366
2400
  <canvas id="label-canvas" data-corn="label-canvas" aria-hidden="true"></canvas>` });
2367
- function mn(e, t, n) {
2368
- let r = ae(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 = a(t, e, "<div data-corn=\"map-stage\"></div>", null, "stage"), i = n.mountStatus(r[0], t, { follow: !1 });
2369
2403
  i.refuse("second-map"), t.emit("piece:refused", {
2370
2404
  piece: "map",
2371
2405
  reason: "second-map",
2372
2406
  message: "A scope holds one map.",
2373
2407
  host: e.nodeType === 11 ? e.host : e
2374
2408
  });
2375
- let a = () => {};
2409
+ let o = () => {};
2376
2410
  return {
2377
2411
  inst: t,
2378
2412
  refused: !0,
2379
- update: a,
2380
- fit: a,
2381
- refresh: a,
2413
+ selection: () => null,
2414
+ update: o,
2415
+ fit: o,
2416
+ refresh: o,
2382
2417
  focusNode: () => !1,
2383
- applyTheme: a,
2418
+ applyTheme: o,
2384
2419
  destroy() {
2385
2420
  i.destroy();
2386
2421
  for (let e of r) e.remove();
2387
2422
  }
2388
2423
  };
2389
2424
  }
2390
- function hn(e) {
2425
+ function yn(e) {
2391
2426
  let t = e.nodeType === 11 ? e.host : e;
2392
2427
  return t && typeof t.getRootNode == "function" ? t.getRootNode() : null;
2393
2428
  }
2394
- function gn(e, t, n = {}) {
2395
- return !t && n.src !== void 0 && n.src !== null && n.src !== "" ? _n(e, n) : vn(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);
2396
2431
  }
2397
- function _n(e, t) {
2432
+ function xn(e, t) {
2398
2433
  let n = e.nodeType === 11 ? e.host : e, r = {}, i = null, a = !1;
2399
- return import("./scope-Dg_uzefP.js").then((e) => e.n).then(({ mountScope: o }) => {
2434
+ return import("./scope-CqPbHcKL.js").then((e) => e.n).then(({ mountScope: o }) => {
2400
2435
  if (a) return;
2401
2436
  let s = o(n, {
2402
2437
  src: t.src,
@@ -2408,7 +2443,7 @@ function _n(e, t) {
2408
2443
  onAuth: t.onAuth,
2409
2444
  onError: t.onError
2410
2445
  });
2411
- i = vn(e, s.instance, {
2446
+ i = Sn(e, s.instance, {
2412
2447
  ...t,
2413
2448
  ...r
2414
2449
  }, s);
@@ -2424,6 +2459,9 @@ function _n(e, t) {
2424
2459
  get map() {
2425
2460
  return i ? i.map : null;
2426
2461
  },
2462
+ selection() {
2463
+ return i ? i.selection() : null;
2464
+ },
2427
2465
  update(e = {}) {
2428
2466
  i ? i.update(e) : Object.assign(r, e);
2429
2467
  },
@@ -2444,178 +2482,192 @@ function _n(e, t) {
2444
2482
  }
2445
2483
  };
2446
2484
  }
2447
- function vn(e, t, r, i) {
2448
- let a = !t;
2449
- a && (t = ne({
2485
+ function Sn(e, t, n, r) {
2486
+ let o = !t;
2487
+ o && (t = p({
2450
2488
  root: e,
2451
- base: r.base || "",
2452
- fetch: r.fetch,
2453
- strings: r.strings
2489
+ base: n.base || "",
2490
+ fetch: n.fetch,
2491
+ strings: n.strings
2454
2492
  }));
2455
- let o = R(t), s = () => {};
2456
- if (o) try {
2457
- s = t.attach(e);
2493
+ let c = S(t), l = () => {};
2494
+ if (c) try {
2495
+ l = t.attach(e);
2458
2496
  } catch {
2459
- return i && i.destroy(), mn(e, t, o);
2460
- }
2461
- let { state: c } = t, l = o ? o.source : null;
2462
- if (r.tokens) {
2463
- let t = hn(e);
2464
- t && B(t.nodeType === 9 ? t : t.ownerDocument, r.tokens), t && t.nodeType === 11 && B(t, r.tokens);
2465
- }
2466
- let u = A(t);
2467
- u.own(s), i && u.own(() => i.destroy());
2468
- let d = (e) => e === "canvas2d" ? "canvas2d" : "auto", f = (e) => e === "light" || e === "dark" ? e : "auto", p = {
2469
- renderer: d(r.renderer),
2470
- theme: f(r.theme),
2497
+ return r && r.destroy(), vn(e, t, c);
2498
+ }
2499
+ let { state: u } = t, d = c ? c.source : null;
2500
+ if (n.tokens) {
2501
+ let t = yn(e);
2502
+ t && s(t.nodeType === 9 ? t : t.ownerDocument, n.tokens), t && t.nodeType === 11 && s(t, n.tokens);
2503
+ }
2504
+ let f = i(t);
2505
+ f.own(l), r && f.own(() => r.destroy());
2506
+ let m = (e) => e === "canvas2d" ? "canvas2d" : "auto", h = (e) => e === "light" || e === "dark" ? e : "auto", g = {
2507
+ renderer: m(n.renderer),
2508
+ theme: h(n.theme),
2471
2509
  topology: void 0
2472
- }, h = r.topology !== void 0 && r.topology !== null, g = !1, _ = !1, v = pn({ keysHelp: r.keysHelp }).stage, y = r.slots && r.slots.stage ? r.slots : null, b = ae(t, e, y ? v : `<div data-corn="map-stage">${v}</div>`, y, "stage"), x = (e) => b.map((t) => t.matches(e) ? t : t.querySelector(e)).find(Boolean);
2473
- u.own(() => {
2474
- for (let e of [...b, c.canvas]) e && e.remove();
2510
+ }, _ = n.topology !== void 0 && n.topology !== null, v = !1, y = !1, b = _n({ keysHelp: n.keysHelp }).stage, x = n.slots && n.slots.stage ? n.slots : null, C = a(t, e, x ? b : `<div data-corn="map-stage">${b}</div>`, x, "stage"), T = (e) => C.map((t) => t.matches(e) ? t : t.querySelector(e)).find(Boolean);
2511
+ f.own(() => {
2512
+ for (let e of [...C, u.canvas]) e && e.remove();
2475
2513
  });
2476
- let S = b.find((e) => e.matches("[data-corn=\"map-stage\"]")) || null;
2477
- if (l && S) {
2478
- let e = o.mountStatus(S, t, {
2479
- onRetry: () => l.load(),
2514
+ let D = T("#map-announcer");
2515
+ if (D) {
2516
+ let e = O(t, D);
2517
+ f.on("announce:write", (t) => (e(t), !0));
2518
+ }
2519
+ let k = C.find((e) => e.matches("[data-corn=\"map-stage\"]")) || null;
2520
+ if (d && k) {
2521
+ let e = c.mountStatus(k, t, {
2522
+ onRetry: () => d.load(),
2480
2523
  focusMap: () => {
2481
- c.canvas && c.canvas.focus();
2524
+ u.canvas && u.canvas.focus();
2482
2525
  }
2483
2526
  });
2484
- u.own(e.destroy);
2485
- }
2486
- c.canvas = x("[data-corn=\"map-canvas\"]"), c.labelCanvas = x("[data-corn=\"label-canvas\"]"), c.ctx = t.doc.createElement("canvas").getContext("2d");
2487
- let C = lt(t, r.measureCovered ? { measureCovered: r.measureCovered } : {}), w = n(t);
2488
- u.own(w.watch()), u.own(w.onChange(() => C.render()));
2489
- let T = () => p.renderer === "canvas2d" ? "canvas2d" : null, D = () => C.setRenderer(cn(c.canvas, {
2490
- prefer: T(),
2491
- mapStyle: w.get
2492
- })), O = t.win && t.win.matchMedia ? t.win.matchMedia("(prefers-color-scheme: light)") : null;
2493
- function k() {
2494
- if (p.theme === "light" || p.theme === "dark") return p.theme;
2495
- if (o && (o.theme === "light" || o.theme === "dark")) return o.theme;
2527
+ f.own(e.destroy);
2528
+ }
2529
+ u.canvas = T("[data-corn=\"map-canvas\"]"), u.labelCanvas = T("[data-corn=\"label-canvas\"]"), u.ctx = t.doc.createElement("canvas").getContext("2d");
2530
+ let A = ft(t, n.measureCovered ? { measureCovered: n.measureCovered } : {}), j = te(t);
2531
+ f.own(j.watch()), f.own(j.onChange(() => A.render()));
2532
+ let M = () => g.renderer === "canvas2d" ? "canvas2d" : null, N = () => A.setRenderer(fn(u.canvas, {
2533
+ prefer: M(),
2534
+ mapStyle: j.get
2535
+ })), P = t.win && t.win.matchMedia ? t.win.matchMedia("(prefers-color-scheme: light)") : null;
2536
+ function F() {
2537
+ if (g.theme === "light" || g.theme === "dark") return g.theme;
2538
+ if (c && (c.theme === "light" || c.theme === "dark")) return c.theme;
2496
2539
  let e = t.doc && t.doc.documentElement, n = e ? e.getAttribute("data-theme") : null;
2497
- return n === "light" || n === "dark" ? n : m("system", !!(O && O.matches));
2540
+ return n === "light" || n === "dark" ? n : ee("system", !!(P && P.matches));
2498
2541
  }
2499
- function M() {
2500
- if (g) return;
2501
- let e = k();
2502
- w.refresh(), c.theme !== e && (c.theme = e, t.touchScene()), C.render();
2503
- }
2504
- c.theme = k(), o && u.own(o.serverTheme.adopt(e)), o && (u.on("theme", () => M()), u.on("scope:theme", () => M())), O && O.addEventListener && (O.addEventListener("change", M), u.own(() => O.removeEventListener("change", M)));
2505
- let te = t.win && t.win.MutationObserver;
2506
- if (te && t.doc && t.doc.documentElement) {
2507
- let e = new te(M);
2542
+ function I() {
2543
+ if (v) return;
2544
+ let e = F();
2545
+ j.refresh(), u.theme !== e && (u.theme = e, t.touchScene()), A.render();
2546
+ }
2547
+ u.theme = F(), c && f.own(c.serverTheme.adopt(e)), c && (f.on("theme", () => I()), f.on("scope:theme", () => I())), P && P.addEventListener && (P.addEventListener("change", I), f.own(() => P.removeEventListener("change", I)));
2548
+ let L = t.win && t.win.MutationObserver;
2549
+ if (L && t.doc && t.doc.documentElement) {
2550
+ let e = new L(I);
2508
2551
  e.observe(t.doc.documentElement, {
2509
2552
  attributes: !0,
2510
2553
  attributeFilter: ["data-theme", "class"]
2511
- }), u.own(() => e.disconnect());
2512
- }
2513
- D();
2514
- let P = () => pt(t), F = () => {
2515
- c.nodes.length && C.fitGraphToViewport(C.fitPadding());
2516
- }, I = (e) => c.nodes.find((t) => t.id === e) || null, L = null;
2517
- u.on("select", (e) => W(t, e, { source: "tap" })), u.on("background", () => E(t, { source: "tap" })), u.on("grab", () => ee(t)), u.on("selection", ({ node: e, edge: t, source: n }) => {
2518
- g || ((e || t) && (L = null), r.onSelect && (e ? r.onSelect({
2554
+ }), f.own(() => e.disconnect());
2555
+ }
2556
+ N();
2557
+ let R = () => gt(t), z = () => {
2558
+ u.nodes.length && A.fitGraphToViewport(A.fitPadding());
2559
+ }, B = (e) => u.nodes.find((t) => t.id === e) || null, V = null;
2560
+ f.on("select", (e) => ie(t, e, { source: "tap" })), f.on("background", () => U(t, { source: "tap" })), f.on("grab", () => ne(t)), f.on("selection", ({ node: e, edge: t, source: r }) => {
2561
+ v || ((e || t) && (V = null), n.onSelect && (e ? n.onSelect({
2519
2562
  id: e.id,
2520
2563
  kind: "node",
2521
- source: n
2522
- }) : t ? r.onSelect({
2564
+ source: r
2565
+ }) : t ? n.onSelect({
2523
2566
  id: `${t.from}->${t.to}`,
2524
2567
  kind: "edge",
2525
2568
  from: t.from,
2526
2569
  to: t.to,
2527
- source: n
2528
- }) : r.onSelect({
2570
+ source: r
2571
+ }) : n.onSelect({
2529
2572
  id: null,
2530
2573
  kind: null,
2531
- source: n
2574
+ source: r
2532
2575
  })));
2533
2576
  });
2534
- function re(e) {
2535
- let n = I(String(e));
2536
- return !n || g ? !1 : (W(t, n, {
2577
+ function H(e) {
2578
+ let n = B(String(e));
2579
+ return !n || v ? !1 : (ie(t, n, {
2537
2580
  frame: !0,
2538
2581
  source: "api"
2539
2582
  }), !0);
2540
2583
  }
2541
- let z = () => {}, ie = !!t.root && t.root.nodeType === 9;
2542
- function V() {
2543
- let e = c.canvas, n = [un(t)];
2544
- ie || n.push(t.listen(e, "pointerdown", (t) => {
2584
+ let W = () => {}, re = !!t.root && t.root.nodeType === 9;
2585
+ function G() {
2586
+ let e = u.canvas, n = [mn(t)];
2587
+ re || n.push(t.listen(e, "pointerdown", (t) => {
2545
2588
  if (t.pointerType === "mouse" && e.setPointerCapture) try {
2546
2589
  e.setPointerCapture(t.pointerId);
2547
2590
  } catch {}
2548
- })), j(t), N(t), n.push(() => j(t)), z = () => n.forEach((e) => e());
2591
+ })), w(t), E(t), n.push(() => w(t)), W = () => n.forEach((e) => e());
2549
2592
  }
2550
- u.own(C.onPaint(() => {
2551
- !_ && c.nodes.length && (_ = !0, r.onReady && r.onReady());
2552
- })), V(), u.own(() => z());
2553
- let H = () => {
2554
- !h && l && l.topology && l.topology !== p.topology && (p.topology = l.topology, U(l.topology));
2593
+ f.own(A.onPaint(() => {
2594
+ !y && u.nodes.length && (y = !0, n.onReady && n.onReady());
2595
+ })), G(), f.own(() => W());
2596
+ let K = () => {
2597
+ !_ && d && d.topology && d.topology !== g.topology && (g.topology = d.topology, ae(d.topology));
2555
2598
  };
2556
- l && u.on("source", (e) => {
2557
- e.state === "ready" && H();
2558
- }), u.own(C.watchSize()), C.resize();
2559
- function U(e) {
2560
- let n = c.selectedNode ? c.selectedNode.id : null;
2561
- ft(t, e);
2562
- let r = n ? I(n) : null;
2563
- c.nodes.length && (P(), F());
2564
- let i = !r && L ? I(L) : null;
2565
- i && W(t, i, { source: "api" }), C.render(), C.ensureFlowLoop();
2566
- }
2567
- function G(e) {
2599
+ d && f.on("source", (e) => {
2600
+ e.state === "ready" && K();
2601
+ }), f.own(A.watchSize()), A.resize();
2602
+ function ae(e) {
2603
+ let n = u.selectedNode ? u.selectedNode.id : null;
2604
+ ht(t, e);
2605
+ let r = n ? B(n) : null;
2606
+ u.nodes.length && (R(), z());
2607
+ let i = !r && V ? B(V) : null;
2608
+ i && ie(t, i, { source: "api" }), A.render(), A.ensureFlowLoop();
2609
+ }
2610
+ function q(e) {
2568
2611
  let n = e === "dataflow" ? "dataflow" : "orbit";
2569
- c.view !== n && (c.view = n, t.touchScene(), c.nodes.length && (P(), F(), C.ensureFlowLoop()));
2612
+ u.view !== n && (u.view = n, t.touchScene(), u.nodes.length && (R(), z(), A.ensureFlowLoop()));
2570
2613
  }
2571
- function K() {
2572
- let e = C.getRenderer();
2573
- e.release ? e.release() : e.destroy(), z();
2614
+ function oe() {
2615
+ let e = A.getRenderer();
2616
+ e.release ? e.release() : e.destroy(), W();
2574
2617
  let n = t.doc.createElement("template");
2575
- n.innerHTML = fn;
2618
+ n.innerHTML = gn;
2576
2619
  let r = n.content.firstElementChild;
2577
2620
  r.setAttribute("part", "map-canvas");
2578
- let i = t.active() === c.canvas;
2579
- c.canvas.replaceWith(r), c.canvas = r, V(), D(), C.resize(), i && r.focus();
2621
+ let i = t.active() === u.canvas;
2622
+ u.canvas.replaceWith(r), u.canvas = r, G(), N(), A.resize(), i && r.focus();
2580
2623
  }
2581
- function oe(e = {}) {
2582
- if (!g) {
2624
+ function se(e = {}) {
2625
+ if (!v) {
2583
2626
  if ("renderer" in e) {
2584
- let t = d(e.renderer);
2585
- t !== p.renderer && (p.renderer = t, K());
2627
+ let t = m(e.renderer);
2628
+ t !== g.renderer && (g.renderer = t, oe());
2586
2629
  }
2587
2630
  if ("theme" in e) {
2588
- let t = f(e.theme);
2589
- t !== p.theme && (p.theme = t, M());
2631
+ let t = h(e.theme);
2632
+ t !== g.theme && (g.theme = t, I());
2590
2633
  }
2591
- if ("topology" in e && (h = e.topology !== void 0 && e.topology !== null, h && e.topology !== p.topology ? (p.topology = e.topology, U(e.topology)) : !h && l && l.topology ? (p.topology = void 0, H()) : !h && e.topology !== p.topology && (p.topology = e.topology, U(e.topology))), "view" in e && G(e.view === "dataflow" ? "dataflow" : "orbit"), "node" in e) {
2634
+ if ("topology" in e && (_ = e.topology !== void 0 && e.topology !== null, _ && e.topology !== g.topology ? (g.topology = e.topology, ae(e.topology)) : !_ && d && d.topology ? (g.topology = void 0, K()) : !_ && e.topology !== g.topology && (g.topology = e.topology, ae(e.topology))), "view" in e && q(e.view === "dataflow" ? "dataflow" : "orbit"), "node" in e) {
2592
2635
  let n = e.node == null || e.node === "" ? null : String(e.node);
2593
- if (n === null) L = null, (c.selectedNode || c.selectedEdge) && E(t, { source: "api" });
2636
+ if (n === null) V = null, (u.selectedNode || u.selectedEdge) && U(t, { source: "api" });
2594
2637
  else {
2595
- let e = I(n);
2596
- e ? c.selectedNode && c.selectedNode.id === n || W(t, e, { source: "api" }) : L = n;
2638
+ let e = B(n);
2639
+ e ? u.selectedNode && u.selectedNode.id === n || ie(t, e, { source: "api" }) : V = n;
2597
2640
  }
2598
2641
  }
2599
2642
  }
2600
2643
  }
2601
- function se() {
2602
- g || (g = !0, u.destroy(), C.destroy(), a && t.destroy());
2644
+ function ce() {
2645
+ v || (v = !0, f.destroy(), A.destroy(), o && t.destroy());
2603
2646
  }
2604
- let ce = {};
2647
+ let J = {};
2605
2648
  for (let e of [
2606
2649
  "topology",
2607
2650
  "view",
2608
2651
  "node"
2609
- ]) r[e] !== void 0 && (ce[e] = r[e]);
2610
- return oe(ce), H(), M(), {
2652
+ ]) n[e] !== void 0 && (J[e] = n[e]);
2653
+ return se(J), K(), I(), f.own(() => t.emit("map:gone")), t.emit("map:ready"), {
2611
2654
  inst: t,
2612
- map: C,
2613
- update: oe,
2614
- destroy: se,
2615
- fit: F,
2616
- focusNode: re,
2617
- refresh: M,
2618
- applyTheme: (e) => w.applyTheme(e)
2655
+ map: A,
2656
+ selection() {
2657
+ return u.selectedNode ? {
2658
+ id: u.selectedNode.id,
2659
+ kind: "node"
2660
+ } : u.selectedEdge ? {
2661
+ id: `${u.selectedEdge.from}->${u.selectedEdge.to}`,
2662
+ kind: "edge"
2663
+ } : null;
2664
+ },
2665
+ update: se,
2666
+ destroy: ce,
2667
+ fit: z,
2668
+ focusNode: H,
2669
+ refresh: I,
2670
+ applyTheme: (e) => j.applyTheme(e)
2619
2671
  };
2620
2672
  }
2621
- export { ft as i, pt as n, mt as r, gn as t };
2673
+ export { ht as i, gt as n, _t as r, bn as t };