@popcorn245/cornfield-components 0.48.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2703 @@
1
+ import { n as e, r as t, t as n } from "./runtime-DFu6W5g-.js";
2
+ import { $ as r, B as i, C as a, D as o, E as s, F as c, G as l, H as u, I as d, J as f, K as p, L as m, M as h, N as g, O as _, P as v, Q as y, R as b, S as x, T as S, U as C, V as w, W as T, X as E, Z as D, _ as O, a as k, b as A, c as j, ct as M, d as N, et as P, f as F, g as I, h as ee, it as te, j as L, k as R, l as ne, lt as z, m as B, mt as V, nt as H, o as U, p as re, pt as W, q as G, rt as ie, s as ae, t as oe, tt as se, ut as ce, v as le, w as ue, x as de, y as fe, z as pe } from "./_corn-default-tokens-BpIL6q5N.js";
3
+ var K = 96, me = "letters:", he = (e) => `${me}${e}`, ge = (e) => typeof e == "string" && e.startsWith(me), _e = (e) => e.slice(8), ve = (e, t) => !!e.letters && !e.icon && e.r * 2 * t >= 14, ye = /* @__PURE__ */ new Map();
4
+ function be(e, t = null) {
5
+ if (typeof e != "string" || !e) return null;
6
+ let n = `${typeof t == "string" ? t : ""}|${e}`;
7
+ if (ye.has(n)) return ye.get(n);
8
+ if (ye.size >= 128) return null;
9
+ let r = null;
10
+ try {
11
+ let n = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(K, K) : typeof document < "u" ? Object.assign(document.createElement("canvas"), {
12
+ width: K,
13
+ height: K
14
+ }) : null, i = n && n.getContext && n.getContext("2d");
15
+ if (i && i.fillText) {
16
+ i.font = `700 ${e.length > 1 ? 56 : 72}px ${L}`, i.textAlign = "center", i.textBaseline = "middle", i.lineJoin = "round", i.lineWidth = 10;
17
+ let a = typeof t == "string" ? t : f;
18
+ i.strokeStyle = P(a) === "#ffffff" ? "rgba(11, 18, 32, 0.92)" : "rgba(255, 255, 255, 0.92)", i.strokeText(e, K / 2, 51), i.fillStyle = a, i.fillText(e, K / 2, 51), r = n;
19
+ }
20
+ } catch {
21
+ r = null;
22
+ }
23
+ return ye.set(n, r), r;
24
+ }
25
+ // ../explorer/renderer-canvas2d.js
26
+ var xe = Math.PI * 2, Se = 1.5, q = (e, t, n, r) => {
27
+ e.beginPath(), e.arc(t, n, r, 0, xe);
28
+ };
29
+ function Ce(e, t, n, r, i) {
30
+ if (t === "rounded-square" || t === "square") {
31
+ let a = i * (t === "square" ? v.squareHalf : v.roundedHalf), o = i * (t === "square" ? v.squareCorner : v.roundedCorner);
32
+ 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);
33
+ } else if (t === "hexagon") {
34
+ let t = i * v.hexInradius / Math.cos(Math.PI / 6);
35
+ e.beginPath();
36
+ for (let i = 0; i < 6; i++) {
37
+ let a = Math.PI / 6 + i * Math.PI / 3, o = n + t * Math.cos(a), s = r + t * Math.sin(a);
38
+ i ? e.lineTo(o, s) : e.moveTo(o, s);
39
+ }
40
+ e.closePath();
41
+ } else if (t === "diamond") {
42
+ let t = i * v.diamondHalf;
43
+ e.beginPath(), e.moveTo(n, r - t), e.lineTo(n + t, r), e.lineTo(n, r + t), e.lineTo(n - t, r), e.closePath();
44
+ } else q(e, n, r, i);
45
+ }
46
+ function we(e, t, n, r, i) {
47
+ 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;
48
+ e.beginPath(), e.strokeStyle = t.color, e.lineWidth = t.width;
49
+ for (let n = Math.floor(a / t.size) * t.size; n < o; n += t.size) e.moveTo(n, s), e.lineTo(n, c);
50
+ for (let n = Math.floor(s / t.size) * t.size; n < c; n += t.size) e.moveTo(a, n), e.lineTo(o, n);
51
+ e.stroke();
52
+ }
53
+ function Te(e, t) {
54
+ e.save(), t.forEach((t) => {
55
+ e.lineWidth = t.width, e.setLineDash(t.dash), e.strokeStyle = t.color, q(e, t.x, t.y, t.r), e.stroke();
56
+ }), e.restore();
57
+ }
58
+ function Ee(e, t) {
59
+ e.save(), t.forEach((t) => {
60
+ 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();
61
+ }), e.restore();
62
+ }
63
+ function De(e, t, n, r, i = !0) {
64
+ 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, g.edge / r) : t.width, e.setLineDash(t.dash || []), t.glow && t.glow * r >= Se) {
65
+ let n = e.lineWidth;
66
+ e.save(), e.globalAlpha = t.alpha * .3, e.strokeStyle = t.glowColor || t.color, e.lineWidth = n + t.glow * .6, e.stroke(), e.restore();
67
+ }
68
+ if (e.stroke(), e.setLineDash([]), t.mark === "removed") {
69
+ let n = m(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];
70
+ e.beginPath(), e.moveTo(n.x - o * _.halfLength, n.y + a * _.halfLength), e.lineTo(n.x + o * _.halfLength, n.y - a * _.halfLength), e.lineWidth = Math.max(_.width, 1.5 / r), e.stroke();
71
+ }
72
+ if (t.ticks && ke(e, t, r), t.arrow) {
73
+ let { cx: n, cy: i } = t.curve || {
74
+ cx: t.x1,
75
+ cy: t.y1
76
+ };
77
+ Oe(e, t, Math.atan2(t.y2 - i, t.x2 - n), r);
78
+ }
79
+ i && t.packet && Ae(e, t, n, r), e.restore();
80
+ }
81
+ function Oe(e, t, n, r) {
82
+ let i = t.end || "triangle", { x2: a, y2: o, color: c } = t, l = Math.cos(n), u = Math.sin(n), d = (e, t) => [a - l * e - u * t, o - u * e + l * t], f = Math.max(R.strokeWidth, 1.2 / r);
83
+ if (e.beginPath(), i === "triangle") e.moveTo(a, o), e.lineTo(a - Math.cos(n - s.spread) * s.length, o - Math.sin(n - s.spread) * s.length), e.lineTo(a - Math.cos(n + s.spread) * s.length, o - Math.sin(n + s.spread) * s.length), e.closePath(), e.fillStyle = c, e.fill();
84
+ else {
85
+ if (e.strokeStyle = c, e.lineWidth = f, e.lineJoin = "miter", i === "chevron") {
86
+ let t = s.length * Math.cos(s.spread), n = s.length * Math.sin(s.spread);
87
+ e.moveTo(...d(t, n)), e.lineTo(a, o), e.lineTo(...d(t, -n));
88
+ } else if (i === "bar") e.moveTo(...d(f / 2, R.barHalf)), e.lineTo(...d(f / 2, -R.barHalf));
89
+ else {
90
+ let t = R.diamondHalf;
91
+ e.moveTo(a, o), e.lineTo(...d(t, R.diamondAcross)), e.lineTo(...d(2 * t, 0)), e.lineTo(...d(t, -R.diamondAcross)), e.closePath();
92
+ }
93
+ e.stroke();
94
+ }
95
+ }
96
+ function ke(e, t, n) {
97
+ 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 = m(t, .5);
98
+ e.beginPath();
99
+ for (let n = 0; n < t.ticks; n++) {
100
+ let r = (n - (t.ticks - 1) / 2) * R.tickGap, s = o.x + i * r, c = o.y + a * r;
101
+ e.moveTo(s - a * R.tickHalf, c + i * R.tickHalf), e.lineTo(s + a * R.tickHalf, c - i * R.tickHalf);
102
+ }
103
+ e.strokeStyle = t.color, e.lineWidth = Math.max(R.tickWidth, 1.5 / n), e.setLineDash([]), e.stroke();
104
+ }
105
+ function Ae(e, t, n, r) {
106
+ let i = w(t, n), { packet: a } = t;
107
+ a.glow && a.glow * r >= Se && (e.beginPath(), e.arc(i.x, i.y, a.radius + a.glow * .5, 0, xe), 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, xe), e.fillStyle = a.color, e.fill();
108
+ }
109
+ function je(e, t, n, r) {
110
+ e.save(), e.globalAlpha = t.alpha, Ae(e, t, n, r), e.restore();
111
+ }
112
+ var Me = 16, Ne = /* @__PURE__ */ new WeakMap();
113
+ function Pe(e) {
114
+ let t = Ne.get(e);
115
+ return t || (t = new Float64Array(e.edges.length * 4), e.edges.forEach((e, n) => {
116
+ 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 + Me;
117
+ 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;
118
+ }), Ne.set(e, t)), t;
119
+ }
120
+ function Fe(e, t, n, r) {
121
+ let i = Pe(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 = [];
122
+ 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]);
123
+ return d;
124
+ }
125
+ function Ie(e, t, n, r, i) {
126
+ e.save(), e.globalAlpha = t.alpha;
127
+ let a = r.halo[t.halo];
128
+ a && (a.fill && (q(e, t.x, t.y, t.r + a.fillR), e.fillStyle = a.fill, e.fill()), q(e, t.x, t.y, t.r + a.ringR), e.strokeStyle = a.ring, e.lineWidth = a.ringWidth, e.stroke());
129
+ let s = r.mark[t.mark];
130
+ if (s) {
131
+ let r = t.r + Math.max(s.ringR, g.gap / n);
132
+ q(e, t.x, t.y, r), e.strokeStyle = s.color, e.lineWidth = Math.max(s.ringWidth, g.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());
133
+ }
134
+ Ce(e, t.shape, t.x, t.y, t.r), t.glow && t.glow * n >= Se && (e.save(), e.globalAlpha = t.alpha * .28, q(e, t.x, t.y, t.r + t.glow * .7), e.fillStyle = t.color, e.fill(), e.restore(), Ce(e, t.shape, t.x, t.y, t.r)), e.fillStyle = t.color, e.fill();
135
+ let c = t.icon && i.icons ? i.icons.get(t.icon) : null, l = !c && ve(t, n), u = !c && !l && H(t, n) ? E(t.glyph, D(t, i)) : null;
136
+ if (u || (q(e, t.x, t.y, t.r * o), e.fillStyle = r.core, e.fill()), t.stroke && (Ce(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) {
137
+ let n = t.r * de;
138
+ e.imageSmoothingEnabled = !i.pixelated, e.drawImage(c, t.x - n / 2, t.y - n / 2, n, n);
139
+ } else if (l) {
140
+ let n = be(t.letters, i.values && i.values["--corn-map-glyph"]);
141
+ if (n) {
142
+ let r = t.r * 1;
143
+ e.imageSmoothingEnabled = !0, e.drawImage(n, t.x - r / 2, t.y - r / 2, r, r);
144
+ }
145
+ } else if (u) {
146
+ let n = t.r * G;
147
+ e.imageSmoothingEnabled = !0, e.drawImage(u, t.x - n / 2, t.y - n / 2, n, n);
148
+ }
149
+ e.restore();
150
+ }
151
+ function Le(e, t = {}) {
152
+ let n = t.mapStyle || (() => x), r = e.getContext("2d"), o = 0, s = 0, c = 1, l = null, u = null, d = null, f = () => {
153
+ if (l) return l;
154
+ try {
155
+ l = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(e.width || 1, e.height || 1) : e.ownerDocument ? e.ownerDocument.createElement("canvas") : null, u = l && l.getContext ? l.getContext("2d") : null;
156
+ } catch {
157
+ u = null;
158
+ }
159
+ return u || (l = null), l;
160
+ }, p = t.layerMinEdges ?? 600, m = /* @__PURE__ */ new WeakMap(), h = (e) => (m.has(e) || m.set(e, e.edges.some((e) => e.packet)), m.get(e));
161
+ function g(e, t, n) {
162
+ e.save(), e.translate(n.x, n.y), e.scale(n.zoom, n.zoom);
163
+ let { decor: r } = t;
164
+ r.grid && we(e, r.grid, n, o, s), r.lanes.length && Ee(e, r.lanes), r.rings.length && Te(e, r.rings), Fe(t, n, o, s).forEach((t) => De(e, t, 0, n.zoom, !1)), e.restore();
165
+ }
166
+ return {
167
+ kind: "canvas2d",
168
+ resize(t, n, i) {
169
+ o = t, s = n, c = i, e.width = t * i, e.height = n * i, r.setTransform(i, 0, 0, i, 0, 0), d = null, l && (l.width = e.width, l.height = e.height, u.setTransform(i, 0, 0, i, 0, 0));
170
+ },
171
+ draw(t, m, _) {
172
+ let v = n(), y = S(t, v);
173
+ r.clearRect(0, 0, o, s);
174
+ let b = a(i(y.theme), v), x = Fe(y, m, o, s);
175
+ if (h(y) && x.length > p && f()) {
176
+ d && d.scene === y && d.x === m.x && d.y === m.y && d.zoom === m.zoom && d.w === e.width && d.h === e.height || ((l.width !== e.width || l.height !== e.height) && (l.width = e.width, l.height = e.height), u.setTransform(c, 0, 0, c, 0, 0), u.clearRect(0, 0, o, s), g(u, y, m), d = {
177
+ scene: y,
178
+ x: m.x,
179
+ y: m.y,
180
+ zoom: m.zoom,
181
+ w: e.width,
182
+ h: e.height
183
+ }), r.save(), r.setTransform(1, 0, 0, 1, 0, 0), r.drawImage(l, 0, 0), r.restore(), r.save(), r.translate(m.x, m.y), r.scale(m.zoom, m.zoom), x.forEach((e) => {
184
+ e.packet && je(r, e, _, m.zoom);
185
+ }), y.nodes.forEach((e) => Ie(r, e, m.zoom, b, v)), r.restore();
186
+ return;
187
+ }
188
+ r.save(), r.translate(m.x, m.y), r.scale(m.zoom, m.zoom);
189
+ let { decor: C } = y;
190
+ C.grid && we(r, C.grid, m, o, s), C.lanes.length && Ee(r, C.lanes), C.rings.length && Te(r, C.rings), x.forEach((e) => De(r, e, _, m.zoom)), y.nodes.forEach((e) => Ie(r, e, m.zoom, b, v)), r.restore();
191
+ },
192
+ destroy() {
193
+ l = null, u = null, d = null;
194
+ }
195
+ };
196
+ }
197
+ var Re = (e) => typeof e.hitR == "number" && e.hitR > e.r ? e.hitR : e.r;
198
+ function ze(e, { cellSize: t = 64 } = {}) {
199
+ let n = /* @__PURE__ */ new Map(), r = 0, i = (e, t) => e * 4194304 + t;
200
+ for (let a = 0; a < e.length; a++) {
201
+ let o = e[a];
202
+ Re(o) > r && (r = Re(o));
203
+ let s = i(Math.floor(o.x / t), Math.floor(o.y / t)), c = n.get(s);
204
+ c ? c.push(a) : n.set(s, [a]);
205
+ }
206
+ let a = (e) => typeof e == "number" ? e : e && e.pad || 0, o = (e) => typeof e == "number" ? 0 : e && e.min || 0;
207
+ return {
208
+ size: e.length,
209
+ cellSize: t,
210
+ nodeAt(s, c, l = 0) {
211
+ if (e.length === 0) return null;
212
+ let u = a(l), d = o(l), f = Math.max(r + u, d), p = Math.floor((s - f) / t), m = Math.floor((s + f) / t), h = Math.floor((c - f) / t), g = Math.floor((c + f) / t), _ = -1;
213
+ for (let t = p; t <= m; t++) for (let r = h; r <= g; r++) {
214
+ let a = n.get(i(t, r));
215
+ if (a) for (let t = 0; t < a.length; t++) {
216
+ let n = a[t];
217
+ if (n <= _) continue;
218
+ let r = e[n], i = Math.max(Re(r) + u, d);
219
+ Math.hypot(r.x - s, r.y - c) <= i && (_ = n);
220
+ }
221
+ }
222
+ return _ < 0 ? null : e[_];
223
+ },
224
+ nodesIn(a) {
225
+ if (e.length === 0) return [];
226
+ let { minX: o, minY: s, maxX: c, maxY: l } = a, u = Math.floor((o - r) / t), d = Math.floor((c + r) / t), f = Math.floor((s - r) / t), p = Math.floor((l + r) / t), m = [];
227
+ for (let t = u; t <= d; t++) for (let r = f; r <= p; r++) {
228
+ let a = n.get(i(t, r));
229
+ if (a) for (let t = 0; t < a.length; t++) {
230
+ 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);
231
+ i * i + u * u <= Re(r) ** 2 && m.push(n);
232
+ }
233
+ }
234
+ return m.sort((e, t) => e - t).map((t) => e[t]);
235
+ }
236
+ };
237
+ }
238
+ function Be(e, t, n, r, i = !1) {
239
+ let a = t.zoom;
240
+ return e.nodeAt((n - t.x) / a, (r - t.y) / a, {
241
+ pad: (i ? 16 : 6) / a,
242
+ min: (i ? 32 : 12) / a
243
+ });
244
+ }
245
+ function Ve(e) {
246
+ let t = null, n = null, r = {
247
+ builds: 0,
248
+ get(i) {
249
+ return n && t === i || (n = ze(i.nodes, e), t = i, r.builds++), n;
250
+ }
251
+ };
252
+ return r;
253
+ }
254
+ // ../explorer/frame.js
255
+ var He = 3e4;
256
+ function Ue({ dirty: e, packetsVisible: t, hidden: n, reduceMotion: r, idleMs: i, clientsWant: a = !1 }) {
257
+ if (n) return {
258
+ draw: !1,
259
+ again: !1
260
+ };
261
+ let o = t && !r && i < 3e4 || a;
262
+ return {
263
+ draw: e || o,
264
+ again: o
265
+ };
266
+ }
267
+ function We(e, t, n, r) {
268
+ let i = Ke(e);
269
+ if (i.length === 0) return !1;
270
+ if (!(n > 0) || !(r > 0)) return !0;
271
+ let a = -t.x / t.zoom, o = -t.y / t.zoom, s = (n - t.x) / t.zoom, c = (r - t.y) / t.zoom;
272
+ for (let e of i) {
273
+ let t = e.curve ? e.curve.cx : e.x1, n = e.curve ? e.curve.cy : e.y1, r = e.packet.radius + e.packet.glow;
274
+ if (!(Math.max(e.x1, e.x2, t) + r < a || Math.min(e.x1, e.x2, t) - r > s) && !(Math.max(e.y1, e.y2, n) + r < o || Math.min(e.y1, e.y2, n) - r > c)) return !0;
275
+ }
276
+ return !1;
277
+ }
278
+ var Ge = /* @__PURE__ */ new WeakMap();
279
+ function Ke(e) {
280
+ let t = Ge.get(e);
281
+ return t || (t = e.edges.filter((e) => e.packet), Ge.set(e, t)), t;
282
+ }
283
+ function qe(e) {
284
+ 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(), _ = () => {
285
+ if (g.size === 0) return;
286
+ let e = [...g];
287
+ g.clear(), e.forEach((e) => e());
288
+ }, v = () => {
289
+ !h && f === null && (f = l(y));
290
+ };
291
+ function y(e) {
292
+ f = null, _();
293
+ let n = o && !r() ? o(e) : !1, i = d || (a ? a() : !1), { draw: s, again: c } = b(i, n);
294
+ s && (i || e - p >= 31) && (d = !1, p = e, x.draws++, t()), x.frames++, c && v();
295
+ }
296
+ let b = (e, t) => Ue({
297
+ dirty: e,
298
+ packetsVisible: n(),
299
+ hidden: r(),
300
+ reduceMotion: i(),
301
+ idleMs: c() - m,
302
+ clientsWant: t
303
+ }), x = {
304
+ frames: 0,
305
+ draws: 0,
306
+ markDirty() {
307
+ d = !0, v();
308
+ },
309
+ queue(e, { draw: t = !0 } = {}) {
310
+ g.add(e), t ? x.markDirty() : v();
311
+ },
312
+ wake() {
313
+ v();
314
+ },
315
+ noteInput() {
316
+ let e = c(), t = e - m >= He;
317
+ m = e, t && v();
318
+ },
319
+ shown() {
320
+ m = c();
321
+ let e = d || (a ? a() : !1), { draw: t, again: n } = b(e, s ? s() : !1);
322
+ (t || n) && v();
323
+ },
324
+ drawNow() {
325
+ _(), d = !1, p = c(), x.draws++, t();
326
+ },
327
+ hold(e) {
328
+ h = !!e, h ? x.cancel() : x.markDirty();
329
+ },
330
+ get pending() {
331
+ return f !== null;
332
+ },
333
+ cancel() {
334
+ f !== null && u(f), f = null;
335
+ }
336
+ };
337
+ return x;
338
+ }
339
+ var Je = 1, Ye = .3, Xe = .58, Ze = 3, Qe = 100, J = 64, Y = {
340
+ selected: 0,
341
+ current: 1,
342
+ match: 2,
343
+ lit: 3,
344
+ marked: 4,
345
+ hub: 5,
346
+ rest: 6,
347
+ greyed: 7
348
+ }, $e = 1.5, et = (e) => Number.isFinite(e) && e >= 9 ? Math.max(11, e) : 11, tt = (e) => et(e.labelMin), nt = (e) => h.includes(e.type) && !e.greyed, rt = (e, t) => e.selected ? Y.selected : e.current ? Y.current : e.match ? Y.match : t && e.connected ? Y.lit : e.mark && e.mark !== "none" || e.labelKeep && !nt(e) ? Y.marked : e.greyed ? Y.greyed : nt(e) ? Y.hub : Y.rest;
349
+ function it(e, t, n = {}) {
350
+ let { measure: r = null } = n, i = tt(e), a = e.nodes.some((e) => e.selected || !e.connected), o = [];
351
+ e.nodes.forEach((e, t) => {
352
+ e.label && e.labelAlpha >= .15 && o.push({
353
+ node: e,
354
+ index: t,
355
+ tier: rt(e, a)
356
+ });
357
+ }), 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);
358
+ let s = /* @__PURE__ */ new Map(), c = (e, t) => (e + 8192) * 16384 + (t + 8192), l = [], u = Math.max(Ze, Ze * t);
359
+ for (let { node: e, index: n, tier: a } of o) {
360
+ let o = nt(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 * Xe, m = e.x * t, h = e.y * t + e.r * t + u + f, g = m - p / 2, _ = m + p / 2, v = h - f * Je, y = h + f * Ye, b = a === Y.greyed ? 2 + f * $e : 2, x = Math.floor((g - b) / J), S = Math.floor((_ + b) / J), C = Math.floor((v - b) / J), w = Math.floor((y + b) / J), T = !1;
361
+ for (let e = x; e <= S && !T; e++) for (let t = C; t <= w && !T; t++) {
362
+ let n = s.get(c(e, t));
363
+ if (n) for (let e = 0; e < n.length; e++) {
364
+ let t = n[e];
365
+ if (g - b < t.r && _ + b > t.l && v - b < t.b && y + b > t.t) {
366
+ T = !0;
367
+ break;
368
+ }
369
+ }
370
+ }
371
+ if (T) continue;
372
+ let E = {
373
+ index: n,
374
+ id: e.id,
375
+ rank: l.length,
376
+ tier: a,
377
+ px: f,
378
+ bold: d,
379
+ screen: e.labelSize * t <= (o ? i + 2 : i),
380
+ size: f / t,
381
+ x: e.x,
382
+ y: e.y + e.r + (u + f) / t,
383
+ node: e,
384
+ l: g,
385
+ t: v,
386
+ r: _,
387
+ b: y
388
+ };
389
+ l.push(E);
390
+ let D = Math.floor(g / J), O = Math.floor(_ / J), k = Math.floor(v / J), A = Math.floor(y / J);
391
+ for (let e = D; e <= O; e++) for (let t = k; t <= A; t++) {
392
+ let n = c(e, t), r = s.get(n);
393
+ r ? r.push(E) : s.set(n, [E]);
394
+ }
395
+ }
396
+ return l;
397
+ }
398
+ function at(e, t, n, r = {}) {
399
+ let { max: a = 400, margin: o = 32, measure: s = null, hover: c = null } = r, l = [], u = e.labelOutline || i(e.theme).labelOutline;
400
+ for (let t of e.decor.lanes) for (let n of [
401
+ t.title,
402
+ t.note,
403
+ t.arrow
404
+ ]) n && l.push({
405
+ kind: "lane",
406
+ text: n.text,
407
+ x: n.x,
408
+ y: n.y,
409
+ size: n.size,
410
+ bold: n.bold,
411
+ italic: !1,
412
+ color: n.color,
413
+ alpha: 1,
414
+ outline: null,
415
+ align: "center",
416
+ family: e.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif"
417
+ });
418
+ let { zoom: d } = t, f = r.placed || it(e, d, { measure: s }), p = -o - t.x, m = n.width + o - t.x, h = -o - t.y, g = n.height + o - t.y, _ = f.filter((e) => e.r >= p && e.l <= m && e.b >= h && e.t <= g);
419
+ _.length > a && (_ = _.slice(0, Math.max(0, a))), _.sort((e, t) => e.index - t.index);
420
+ let v = e.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif";
421
+ for (let e of _) {
422
+ let t = Math.max(1, 1 / d);
423
+ l.push({
424
+ kind: "node",
425
+ id: e.id,
426
+ text: e.node.label,
427
+ x: e.x,
428
+ y: e.y,
429
+ size: e.size,
430
+ bold: e.bold,
431
+ italic: !1,
432
+ color: e.node.labelColor,
433
+ alpha: e.node.labelAlpha,
434
+ outline: u.node ? {
435
+ color: u.node.color,
436
+ width: u.node.width * t
437
+ } : null,
438
+ align: "center",
439
+ family: v,
440
+ strike: !!e.node.labelStrike,
441
+ px: e.px,
442
+ screen: e.screen
443
+ });
444
+ }
445
+ let y = tt(e), b = _.map((e) => ({
446
+ l: t.x + e.l,
447
+ r: t.x + e.r,
448
+ t: t.y + e.t,
449
+ b: t.y + e.b
450
+ }));
451
+ for (let r of e.nodes) {
452
+ if (r.alpha < .5) continue;
453
+ let e = t.x + r.x * d, i = t.y + r.y * d, a = r.r * d;
454
+ e + a < 0 || e - a > n.width || i + a < 0 || i - a > n.height || b.push({
455
+ l: e - a,
456
+ r: e + a,
457
+ t: i - a,
458
+ b: i + a
459
+ });
460
+ }
461
+ let x = 0;
462
+ for (let r of e.edges) {
463
+ let i = r.label;
464
+ if (!i || x >= 120) continue;
465
+ let a = t.x + i.x * d, o = t.y + i.y * d;
466
+ if (a < 0 || a > n.width || o < 0 || o > n.height) continue;
467
+ let c = (s ? s(i.text, y, !1) : i.text.length * y * .55) / 2 + 2, f = {
468
+ l: a - c,
469
+ r: a + c,
470
+ t: o - y * .6 - 2,
471
+ b: o + y * .6 + 2
472
+ };
473
+ b.some((e) => f.l < e.r && f.r > e.l && f.t < e.b && f.b > e.t) || (b.push(f), x++, l.push({
474
+ kind: "edge",
475
+ text: i.text,
476
+ x: i.x,
477
+ y: i.y + y * .35 / d,
478
+ size: y / d,
479
+ px: y,
480
+ screen: !0,
481
+ bold: !1,
482
+ italic: !!i.italic,
483
+ color: i.color,
484
+ alpha: r.alpha,
485
+ outline: u.edge,
486
+ align: "center",
487
+ family: e.labelFont || "\"Segoe UI\", -apple-system, sans-serif"
488
+ }));
489
+ }
490
+ if (c) {
491
+ let n = e.nodes.find((e) => e.id === c);
492
+ if (n && n.label && !f.some((e) => e.id === c && _.includes(e))) {
493
+ let r = tt(e), i = t.y + n.y * d - n.r * d > 40 ? n.y - n.r - 5 / d : n.y + n.r + (5 + r) / d;
494
+ l.push({
495
+ kind: "chip",
496
+ id: n.id,
497
+ text: n.label,
498
+ x: n.x,
499
+ y: i,
500
+ size: r / d,
501
+ px: r,
502
+ screen: !0,
503
+ bold: !1,
504
+ italic: !1,
505
+ color: (e.nodes.find((e) => e.connected) || n).labelColor,
506
+ alpha: 1,
507
+ outline: u.node,
508
+ align: "center",
509
+ family: v,
510
+ strike: !1
511
+ });
512
+ }
513
+ }
514
+ return l;
515
+ }
516
+ var ot = (e) => `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${e.screen ? e.px : e.size}px ${e.family}`, st = {
517
+ ox: 0,
518
+ oy: 0,
519
+ k: 1
520
+ };
521
+ function ct(e, t, n) {
522
+ e.font = ot(t);
523
+ 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 * Je - 2;
524
+ 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);
525
+ }
526
+ function lt() {
527
+ return {
528
+ font: "",
529
+ alpha: -1,
530
+ fill: "",
531
+ stroke: "",
532
+ width: -1,
533
+ align: ""
534
+ };
535
+ }
536
+ function ut(e, t, n, r = st) {
537
+ if (t.kind === "chip") {
538
+ ct(e, t, r);
539
+ return;
540
+ }
541
+ n.alpha !== t.alpha && (e.globalAlpha = t.alpha, n.alpha = t.alpha);
542
+ let i = ot(t);
543
+ n.font !== i && (e.font = i, n.font = i), n.align !== t.align && (e.textAlign = t.align, n.align = t.align);
544
+ let a = r.ox + t.x * r.k, o = r.oy + t.y * r.k;
545
+ if (t.outline) {
546
+ e.lineJoin = "round";
547
+ let i = t.outline.width * r.k;
548
+ n.stroke !== t.outline.color && (e.strokeStyle = t.outline.color, n.stroke = t.outline.color), n.width !== i && (e.lineWidth = i, n.width = i), e.strokeText(t.text, a, o);
549
+ }
550
+ if (n.fill !== t.color && (e.fillStyle = t.color, n.fill = t.color), e.fillText(t.text, a, o), t.strike) {
551
+ let i = e.measureText(t.text).width / 2, s = t.screen ? t.px : t.size * r.k;
552
+ 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;
553
+ }
554
+ }
555
+ function dt(e, t, n, r) {
556
+ let i = null;
557
+ 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);
558
+ return i ? i.id : null;
559
+ }
560
+ function ft(e, t = {}) {
561
+ let n = t.mapStyle || (() => x), 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 = L, y = (e, t, n) => {
562
+ let i = `${n ? "b" : "n"}${t}|${v}|${e}`, a = _.get(i);
563
+ return a === void 0 && (_.size > 2e4 && _.clear(), r.font = ot({
564
+ italic: !1,
565
+ bold: n,
566
+ size: t,
567
+ family: v
568
+ }), a = r.measureText(e).width, _.set(i, a)), a;
569
+ };
570
+ return {
571
+ hit(e, t) {
572
+ return m && s ? dt(m, {
573
+ x: l,
574
+ y: u,
575
+ zoom: d
576
+ }, e, t) : null;
577
+ },
578
+ resize(t, n, s) {
579
+ i = t, a = n, o = s, e.width = t * s, e.height = n * s, r.setTransform(s, 0, 0, s, 0, 0), h = !0;
580
+ },
581
+ draw(e, t, _ = {}) {
582
+ if (g) return !1;
583
+ let b = n(), x = b.plain ? 0 : b.version, C = _.hover || null;
584
+ if (!h && e === s && e.version === c && t.x === l && t.y === u && t.zoom === d && x === f && C === p) return !1;
585
+ let w = m && e === s && e.version === c && t.zoom === d && x === f && !h;
586
+ s = e, c = e.version, l = t.x, u = t.y, d = t.zoom, f = x, p = C, h = !1;
587
+ let T = S(e, b);
588
+ v = 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 || (m = it(T, t.zoom, { measure: y }));
589
+ let E = at(T, t, {
590
+ width: i,
591
+ height: a
592
+ }, {
593
+ measure: y,
594
+ hover: C,
595
+ placed: m
596
+ }), D = lt();
597
+ for (let e of E) e.kind === "lane" && ut(r, e, D);
598
+ for (let e of E) e.kind === "node" && !e.screen && ut(r, e, D);
599
+ r.restore();
600
+ let O = {
601
+ ox: t.x,
602
+ oy: t.y,
603
+ k: t.zoom
604
+ };
605
+ D = lt();
606
+ for (let e of E) e.kind === "node" && e.screen && ut(r, e, D, O);
607
+ for (let e of E) e.kind === "edge" && ut(r, e, D, O);
608
+ for (let e of E) e.kind === "chip" && ut(r, e, D, O);
609
+ return !0;
610
+ },
611
+ destroy() {
612
+ g = !0, s = null, m = null, _.clear(), r.setTransform(1, 0, 0, 1, 0, 0), r.clearRect(0, 0, i, a);
613
+ }
614
+ };
615
+ }
616
+ // ../explorer/engine/render.js
617
+ var pt = [
618
+ "pointerdown",
619
+ "pointermove",
620
+ "mousedown",
621
+ "mousemove",
622
+ "wheel",
623
+ "touchstart",
624
+ "touchmove",
625
+ "keydown"
626
+ ];
627
+ function mt(e, t = {}) {
628
+ if (e.map) return e.map;
629
+ let { state: n } = e, r = t.measureCovered || (() => n.coveredBottom || 0), i = ue(e).get, a = !1, o = (e) => pe(n, e), s = (e) => pe(n, e, { viewer: !0 }), l = (t, r = e.viewEdges(), i = {
630
+ throughChildren: !!n.throughChildren,
631
+ kind: n.selectedKind || null
632
+ }) => b(t, r, i), f = d((t) => c(t, { reduceMotion: e.reducedMotion })), p = () => f.get(n), m = () => f.builds, h = Ve(), g = () => h.get(p()), _ = () => h.builds, v = null, y = null;
633
+ function x() {
634
+ return v && y === n.canvas || (v && v.destroy(), v = Le(n.canvas, { mapStyle: i }), y = n.canvas, n.width && v.resize(n.width, n.height, e.dpr())), v;
635
+ }
636
+ let S = null, w = null;
637
+ function T() {
638
+ return n.labelCanvas ? (S && w === n.labelCanvas || (S && S.destroy(), S = ft(n.labelCanvas, { mapStyle: i }), w = n.labelCanvas, n.width && S.resize(n.width, n.height, e.dpr())), S) : null;
639
+ }
640
+ function E(t) {
641
+ v && v !== t && v.destroy(), v = t, y = n.canvas, n.width && v.resize(n.width, n.height, e.dpr()), V();
642
+ }
643
+ function D() {
644
+ let { canvas: t } = n;
645
+ n.width = t.parentElement.clientWidth, n.height = t.parentElement.clientHeight, x().resize(n.width, n.height, e.dpr());
646
+ let r = T();
647
+ r && r.resize(n.width, n.height, e.dpr()), V();
648
+ }
649
+ function O() {
650
+ let t = n.canvas && n.canvas.parentElement, r = e.win && e.win.ResizeObserver;
651
+ if (!t || !r) return () => {};
652
+ let i = new r(() => {
653
+ n.canvas && (t.clientWidth !== n.width || t.clientHeight !== n.height) && D();
654
+ });
655
+ i.observe(t);
656
+ let a = () => i.disconnect();
657
+ return e.own(a), a;
658
+ }
659
+ function k(e, t = null) {
660
+ let { nodes: i, width: a, height: s } = n, c = i.filter(o);
661
+ if (t) {
662
+ let e = c.filter((e) => t.has(e.id));
663
+ e.length && (c = e);
664
+ }
665
+ if (c.length === 0) return null;
666
+ let l = Math.max(160, s - r()), u = Infinity, d = -Infinity, f = Infinity, p = -Infinity;
667
+ c.forEach((e) => {
668
+ let t = e.r || 18;
669
+ 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);
670
+ }), n.view === "dataflow" && n.flow && (f = Math.min(f, n.flow.top - 10)), n.view === "house" && n.house && n.house.fit && !t && ({minX: u, maxX: d, minY: f, maxY: p} = n.house.fit);
671
+ let m = Math.max(160, a - e * 2), h = Math.max(160, l - e * 2), g = Math.min(m / (d - u), h / (p - f));
672
+ return {
673
+ minX: u,
674
+ maxX: d,
675
+ minY: f,
676
+ maxY: p,
677
+ mapHeight: l,
678
+ raw: g
679
+ };
680
+ }
681
+ let A = "", j = C;
682
+ function M() {
683
+ let e = `${n.sceneVersion}|${n.width}|${n.height}|${n.view}|${r()}`;
684
+ if (e !== A) {
685
+ A = e;
686
+ let t = k(P());
687
+ j = t && t.raw > 0 && Number.isFinite(t.raw) ? Math.max(u, Math.min(C, t.raw)) : C;
688
+ }
689
+ return j;
690
+ }
691
+ function N(e = 40, t = null) {
692
+ let { width: r, camera: i } = n, a = k(e, t);
693
+ if (!a) return;
694
+ let { minX: o, maxX: s, minY: c, maxY: l, mapHeight: d } = a, f = Math.min(1, Math.max(u, a.raw));
695
+ i.zoom = f, i.x = r / 2 - (o + s) / 2 * f, i.y = d / 2 - (c + l) / 2 * f, V();
696
+ }
697
+ let P = () => n.width < 640 ? 24 : 48, F = (e, t) => ({
698
+ x: (e - n.camera.x) / n.camera.zoom,
699
+ y: (t - n.camera.y) / n.camera.zoom
700
+ }), I = -1;
701
+ function ee() {
702
+ if (!n.canvas) return;
703
+ let e = p();
704
+ I = e.version, x().draw(e, n.camera, performance.now());
705
+ let t = T();
706
+ t && t.draw(e, n.camera, { hover: n.hoverNodeId }), R.forEach((t) => t(e, n.camera));
707
+ }
708
+ function te(e, t) {
709
+ let n = T();
710
+ return n ? n.hit(e, t) : null;
711
+ }
712
+ function L(e) {
713
+ let t = e || null;
714
+ if (n.hoverNodeId === t) return;
715
+ n.hoverNodeId = t;
716
+ let r = T();
717
+ r && n.canvas && n.width && r.draw(p(), n.camera, { hover: t });
718
+ }
719
+ let R = /* @__PURE__ */ new Set(), ne = (e) => (R.add(e), () => R.delete(e)), z = /* @__PURE__ */ new Set(), B = qe({
720
+ draw: ee,
721
+ packetsVisible: () => !!n.canvas && We(p(), n.camera, n.width, n.height),
722
+ isHidden: () => e.hidden(),
723
+ tickClients: (e) => {
724
+ let t = !1;
725
+ return z.forEach((n) => {
726
+ n.tick(e), n.wants() && (t = !0);
727
+ }), t;
728
+ },
729
+ clientsWant: () => [...z].some((e) => e.wants()),
730
+ reduceMotion: () => e.reducedMotion,
731
+ extraDirty: () => n.sceneVersion !== I,
732
+ now: () => performance.now(),
733
+ raf: (e) => requestAnimationFrame(e),
734
+ caf: (e) => cancelAnimationFrame(e)
735
+ });
736
+ function V() {
737
+ !a && n.canvas && B.markDirty();
738
+ }
739
+ function H() {
740
+ !a && n.canvas && B.drawNow();
741
+ }
742
+ function U(e) {
743
+ return z.add(e), () => z.delete(e);
744
+ }
745
+ if (e.root) {
746
+ let t = () => B.noteInput();
747
+ for (let n of pt) e.listen(e.root, n, t, {
748
+ passive: !0,
749
+ capture: !0
750
+ });
751
+ }
752
+ e.onShown(() => B.shown());
753
+ function re() {
754
+ a = !0, e.map === W && (e.map = null), B.cancel(), v && (v.release ? v.release() : v.destroy(), v = null, y = null), S && (S.destroy(), S = null, w = null), R.clear(), z.clear();
755
+ }
756
+ let W = {
757
+ isNodeVisible: o,
758
+ isNodeVisibleToViewer: s,
759
+ getActiveSubgraph: l,
760
+ getScene: p,
761
+ sceneBuilds: m,
762
+ getSpatialIndex: g,
763
+ spatialBuilds: _,
764
+ getRenderer: x,
765
+ setRenderer: E,
766
+ resize: D,
767
+ watchSize: O,
768
+ getMinZoom: M,
769
+ fitGraphToViewport: N,
770
+ fitPadding: P,
771
+ screenToWorld: F,
772
+ labelNodeAt: te,
773
+ setHoverNode: L,
774
+ onPaint: ne,
775
+ render: V,
776
+ renderNow: H,
777
+ addFrameClient: U,
778
+ queueFrameWork: (e, t) => {
779
+ a || B.queue(e, t);
780
+ },
781
+ frameStats: () => ({
782
+ frames: B.frames,
783
+ draws: B.draws
784
+ }),
785
+ holdFrames: (e) => {
786
+ a || B.hold(e);
787
+ },
788
+ cancelFrame: () => B.cancel(),
789
+ ensureFlowLoop: () => {
790
+ a || B.wake();
791
+ },
792
+ destroy: re
793
+ };
794
+ return e.map = W, e.own(re), W;
795
+ }
796
+ // ../explorer/flow-build.js
797
+ function ht(e, t) {
798
+ let n = new Map(e.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map();
799
+ t.forEach((e) => {
800
+ !e.kind && !e.dashed && n.get(e.from)?.type === "app" && n.get(e.to)?.type === "page" && r.set(e.to, e.from);
801
+ });
802
+ let i = e.filter((e) => e.type === "container" && e.selfHosted), a = /* @__PURE__ */ new Map();
803
+ t.forEach((e) => {
804
+ let t = n.get(e.from);
805
+ if (e.kind !== "delivers" || t?.type !== "container" || t.selfHosted || n.get(e.to)?.type !== "page") return;
806
+ let r = i.filter((e) => e.stack === t.stack);
807
+ r.length === 1 && a.set(t.id, r[0].id);
808
+ });
809
+ let o = (e) => n.get(e)?.type === "page" ? r.get(e) || e : a.get(e) || e, s = new Set([...r].filter(([e]) => Array.isArray(n.get(e)?.methods) && n.get(e).methods.length).map(([, e]) => e)), c = (e) => e.type === "store" && (e.tier === "browser" || e.id === "store-idb"), l = /* @__PURE__ */ new Set();
810
+ t.forEach((e) => {
811
+ if (e.kind === "reads" || e.kind === "writes") {
812
+ let t = e.kind === "reads" ? e.to : e.from;
813
+ n.get(t)?.type === "page" && l.add(o(t));
814
+ }
815
+ }), t.forEach((e) => {
816
+ e.kind === "flow" && e.flow === "api" && n.get(e.from)?.type === "app" && l.add(e.from);
817
+ });
818
+ let u = new Set(t.filter((e) => e.kind === "flow" && e.flow === "api").map((e) => `${o(e.from)}|${o(e.to)}`)), d = (t) => e.filter(t).sort((e, t) => String(e.label).localeCompare(String(t.label))), f = [
819
+ {
820
+ key: "browser",
821
+ title: "Browser",
822
+ note: "saved on the device first",
823
+ nodes: d(c)
824
+ },
825
+ {
826
+ key: "servers",
827
+ title: "App servers",
828
+ note: "pages, no-JS forms",
829
+ nodes: d((e) => e.type === "app" && !s.has(e.id) && l.has(e.id))
830
+ },
831
+ {
832
+ key: "api",
833
+ title: "API",
834
+ note: "where the endpoints are",
835
+ nodes: d((e) => s.has(e.id))
836
+ },
837
+ {
838
+ key: "tables",
839
+ title: "Tables",
840
+ note: "stores and tables",
841
+ nodes: [...d((e) => e.type === "store" && !c(e)), ...d((e) => e.type === "table")]
842
+ },
843
+ {
844
+ key: "services",
845
+ title: "Services",
846
+ note: "jobs, hooks, webhooks",
847
+ nodes: d((e) => e.type === "service")
848
+ },
849
+ {
850
+ key: "outside",
851
+ title: "Outside",
852
+ note: "systems the API reaches",
853
+ nodes: [...d((e) => e.type === "external"), ...d((e) => e.type === "container" && e.selfHosted)]
854
+ }
855
+ ], p = new Set(f.flatMap((e) => e.nodes.map((e) => e.id))), m = [], h = /* @__PURE__ */ new Set(), g = (e, t, n) => {
856
+ if (t === n || !p.has(t) || !p.has(n)) return;
857
+ let r = `${t}|${n}|${e.kind}|${e.flow || ""}`;
858
+ h.has(r) || (h.add(r), m.push({
859
+ ...e,
860
+ from: t,
861
+ to: n,
862
+ status: e.status || "live",
863
+ phase: void 0
864
+ }));
865
+ };
866
+ return t.forEach((e) => {
867
+ if (!(e.kind === "calls" && u.has(`${o(e.from)}|${o(e.to)}`)) && (e.kind !== "calls" || n.get(e.from)?.type !== "container")) {
868
+ if (e.kind === "flow" || [
869
+ "calls",
870
+ "triggers",
871
+ "delivers"
872
+ ].includes(e.kind)) return g(e, o(e.from), o(e.to));
873
+ if (e.kind === "reads" || e.kind === "writes") {
874
+ let t = e.kind === "reads" ? e.to : e.from;
875
+ return n.get(t)?.type === "page" && !s.has(o(t)) ? void 0 : g(e, o(e.from), o(e.to));
876
+ }
877
+ }
878
+ }), {
879
+ tiers: f,
880
+ ids: p,
881
+ edges: m
882
+ };
883
+ }
884
+ // ../explorer/engine/topology.js
885
+ function gt(e) {
886
+ return {
887
+ nodes: e && Array.isArray(e.nodes) ? e.nodes.filter((e) => e && typeof e.id == "string") : [],
888
+ edges: e && Array.isArray(e.edges) ? e.edges.filter((e) => e && typeof e.from == "string" && typeof e.to == "string") : []
889
+ };
890
+ }
891
+ function _t(e, t) {
892
+ let { state: n } = e, { nodes: r, edges: i } = gt(t), a = n.selectedNode ? n.selectedNode.id : null;
893
+ 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 = ht(n.nodes, n.edges);
894
+ let o = a && n.nodes.find((e) => e.id === a) || null;
895
+ return o ? (n.selectedEdge = null, n.selectedNode = o) : (n.selectedNode || n.selectedEdge) && (n.selectedNode = null, n.selectedEdge = null), e.touchScene(), n.nodes.length > 0;
896
+ }
897
+ function vt(e, { placeLive: t } = {}) {
898
+ let { state: n } = e;
899
+ I(e), n.view === "dataflow" && n.flow ? (n.flow.tiers.forEach((e) => e.nodes.forEach((e) => {
900
+ e.r = Math.min(e.r, 13);
901
+ })), n.proposal && n.baseNodes && yt(e) || O(e, n.flow)) : n.baseNodes && (n.proposal || n.nodes.some((e) => e.live)) ? bt(e, t) : le(e);
902
+ }
903
+ function yt(e) {
904
+ let { state: t } = e, n = {
905
+ nodes: t.nodes,
906
+ edges: t.edges
907
+ }, r = t.baseNodes.map((e) => ({ ...e }));
908
+ t.nodes = r, t.edges = t.baseEdges, I(e);
909
+ let i = ht(r, t.baseEdges);
910
+ i.tiers.forEach((e) => e.nodes.forEach((e) => {
911
+ e.r = Math.min(e.r, 13);
912
+ })), O(e, i), t.nodes = n.nodes, t.edges = n.edges;
913
+ let a = z(t.flow, i);
914
+ return e.touchScene(), a;
915
+ }
916
+ function bt(e, t) {
917
+ let { state: n } = e, r = {
918
+ nodes: n.nodes,
919
+ edges: n.edges
920
+ }, i = n.baseNodes.map((e) => ({ ...e }));
921
+ n.nodes = i, n.edges = n.baseEdges, I(e), le(e);
922
+ let a = new Map(i.map((e) => [e.id, e]));
923
+ n.nodes = r.nodes, n.edges = r.edges, I(e), n.nodes.forEach((e) => {
924
+ let t = a.get(e.id);
925
+ t && (e.x = t.x, e.y = t.y, e.r = t.r);
926
+ }), ce(n.nodes, n.edges), t && t(n.nodes, n.edges), e.touchScene();
927
+ }
928
+ // ../explorer/shaders.js
929
+ var X = "#version 300 es\nprecision highp float;\nuniform vec2 u_viewport;\nuniform vec3 u_cam;\nuniform float u_dpr;\n", Z = "\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", xt = `${X}
930
+ layout(location = 0) in vec2 a_corner;
931
+ layout(location = 1) in vec4 a_grid; // size, width
932
+ layout(location = 2) in vec4 a_color;
933
+ out vec2 v_pos;
934
+ flat out vec4 v_grid;
935
+ flat out vec4 v_color;
936
+ void main() {
937
+ v_pos = vec2((a_corner.x * 0.5 + 0.5) * u_viewport.x, (0.5 - a_corner.y * 0.5) * u_viewport.y);
938
+ v_grid = a_grid;
939
+ v_color = a_color;
940
+ gl_Position = vec4(a_corner, 0.0, 1.0);
941
+ }
942
+ `, St = `${X}${Q}
943
+ in vec2 v_pos;
944
+ flat in vec4 v_grid;
945
+ flat in vec4 v_color;
946
+ void main() {
947
+ float zoom = u_cam.z;
948
+ float pix = 1.0 / u_dpr;
949
+ vec2 world = (v_pos - u_cam.xy) / zoom;
950
+ vec2 dist = abs(world - floor(world / v_grid.x + 0.5) * v_grid.x) * zoom;
951
+ float hw = v_grid.y * zoom * 0.5;
952
+ float cover = max(coverBand(dist.x, hw, pix), coverBand(dist.y, hw, pix));
953
+ outColor = vec4(v_color.rgb * v_color.a, v_color.a) * cover;
954
+ }
955
+ `, Ct = `${X}${Z}
956
+ layout(location = 0) in vec2 a_corner;
957
+ layout(location = 1) in vec4 a_rect; // x, y, w, h (world)
958
+ layout(location = 2) in vec4 a_fill;
959
+ layout(location = 3) in vec4 a_stroke;
960
+ layout(location = 4) in vec2 a_style; // corner radius, stroke width (world)
961
+ out vec2 v_local;
962
+ flat out vec2 v_half;
963
+ flat out vec2 v_style;
964
+ flat out vec4 v_fill;
965
+ flat out vec4 v_stroke;
966
+ void main() {
967
+ float zoom = u_cam.z;
968
+ vec2 half_ = a_rect.zw * 0.5 * zoom;
969
+ vec2 centre = u_cam.xy + (a_rect.xy + a_rect.zw * 0.5) * zoom;
970
+ vec2 ext = half_ + a_style.y * zoom * 0.5 + 2.0;
971
+ vec2 pos = clamp(centre + a_corner * ext, vec2(0.0), u_viewport);
972
+ v_local = pos - centre;
973
+ v_half = half_;
974
+ v_style = a_style;
975
+ v_fill = a_fill;
976
+ v_stroke = a_stroke;
977
+ gl_Position = toClip(pos);
978
+ }
979
+ `, wt = `${X}${Q}
980
+ in vec2 v_local;
981
+ flat in vec2 v_half;
982
+ flat in vec2 v_style;
983
+ flat in vec4 v_fill;
984
+ flat in vec4 v_stroke;
985
+ void main() {
986
+ float zoom = u_cam.z;
987
+ float pix = 1.0 / u_dpr;
988
+ float rad = min(v_style.x * zoom, min(v_half.x, v_half.y));
989
+ vec2 q = abs(v_local) - v_half + rad;
990
+ float sd = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - rad;
991
+ vec4 acc = vec4(0.0);
992
+ over(acc, v_fill.rgb, v_fill.a * coverEdge(sd, pix));
993
+ over(acc, v_stroke.rgb, v_stroke.a * coverBand(abs(sd), v_style.y * zoom * 0.5, pix));
994
+ outColor = acc;
995
+ }
996
+ `, Tt = `${X}${Z}
997
+ layout(location = 0) in vec2 a_corner;
998
+ layout(location = 1) in vec4 a_geom; // x, y, r, width (world)
999
+ layout(location = 2) in vec4 a_color;
1000
+ layout(location = 3) in vec2 a_dash; // on, off (world)
1001
+ out vec2 v_local;
1002
+ flat out vec4 v_geom;
1003
+ flat out vec4 v_color;
1004
+ flat out vec2 v_dash;
1005
+ void main() {
1006
+ float zoom = u_cam.z;
1007
+ vec2 centre = u_cam.xy + a_geom.xy * zoom;
1008
+ float ext = (a_geom.z + a_geom.w * 0.5) * zoom + 2.0;
1009
+ vec2 pos = clamp(centre + a_corner * ext, vec2(0.0), u_viewport);
1010
+ v_local = pos - centre;
1011
+ v_geom = a_geom;
1012
+ v_color = a_color;
1013
+ v_dash = a_dash;
1014
+ gl_Position = toClip(pos);
1015
+ }
1016
+ `, Et = `${X}${Q}
1017
+ in vec2 v_local;
1018
+ flat in vec4 v_geom;
1019
+ flat in vec4 v_color;
1020
+ flat in vec2 v_dash;
1021
+ void main() {
1022
+ float zoom = u_cam.z;
1023
+ float pix = 1.0 / u_dpr;
1024
+ float len = length(v_local);
1025
+ float cover = coverBand(abs(len - v_geom.z * zoom), v_geom.w * zoom * 0.5, pix);
1026
+ // Dashes run clockwise from angle 0, as Canvas 2D's arc() does
1027
+ float arc = mod(atan(v_local.y, v_local.x) + 6.2831853, 6.2831853) * v_geom.z;
1028
+ cover *= coverDash(arc, v_dash.x, v_dash.y, pix / zoom);
1029
+ outColor = vec4(v_color.rgb * v_color.a, v_color.a) * cover;
1030
+ }
1031
+ `, Dt = `${X}${Z}
1032
+ layout(location = 0) in vec2 a_corner;
1033
+ layout(location = 1) in vec4 a_geom; // x, y, r (world), alpha
1034
+ layout(location = 2) in vec4 a_color; // r, g, b (0..1), glow (px)
1035
+ layout(location = 3) in vec4 a_kind; // halo code, mark code, colour alpha, shape code (0 circle, 1 rounded square, 2 hexagon, 3 square, 4 diamond; plus 8 when a glyph takes the core dot's place)
1036
+ uniform vec4 u_haloGeom[4]; // fillR, ringR, ringWidth (world)
1037
+ uniform vec4 u_markGeom[5]; // per mark code: ringR, ringWidth (world), dash on, dash off
1038
+ uniform vec3 u_markMin; // MARK_MIN_PX, in screen px: ring thickness, edge thickness, gap from the node
1039
+ out vec2 v_local;
1040
+ flat out vec4 v_geom;
1041
+ flat out vec4 v_color;
1042
+ flat out vec4 v_kind;
1043
+ void main() {
1044
+ float zoom = u_cam.z;
1045
+ int halo = int(a_kind.x + 0.5);
1046
+ int mark = int(a_kind.y + 0.5);
1047
+ // The quad reaches as far as the farthest thing drawn: the glow (3 sigma), the halo ring, the mark ring
1048
+ float pad = a_color.w * 1.5 / u_dpr;
1049
+ if (halo > 0) pad = max(pad, (u_haloGeom[halo].y + u_haloGeom[halo].z * 0.5) * zoom);
1050
+ if (mark > 0) pad = max(pad, max(u_markGeom[mark].x * zoom, u_markMin.z) + max(u_markGeom[mark].y * zoom, u_markMin.x) + 1.5);
1051
+ float ext = a_geom.z * zoom * 1.2 + pad + 2.0; // a diamond reaches 1.15 radii
1052
+ vec2 centre = u_cam.xy + a_geom.xy * zoom;
1053
+ v_local = a_corner * ext;
1054
+ v_geom = a_geom;
1055
+ v_color = a_color;
1056
+ v_kind = a_kind;
1057
+ gl_Position = toClip(centre + v_local);
1058
+ }
1059
+ `, Ot = `${X}${Q}
1060
+ in vec2 v_local;
1061
+ flat in vec4 v_geom;
1062
+ flat in vec4 v_color;
1063
+ flat in vec4 v_kind;
1064
+ uniform vec4 u_shape; // rounded square half side, its corner, hexagon inradius, square half side (x radius)
1065
+ uniform vec2 u_shape2; // square corner, diamond half diagonal (x radius)
1066
+ uniform float u_glyphMin; // GLYPH_MIN_PX: a node this wide on screen shows its glyph (the icon pass) instead of the core dot
1067
+ uniform vec4 u_haloFill[4];
1068
+ uniform vec4 u_haloRing[4];
1069
+ uniform vec4 u_haloGeom[4];
1070
+ uniform vec4 u_markColor[5];
1071
+ uniform vec4 u_markGeom[5];
1072
+ uniform vec3 u_markMin;
1073
+ uniform vec4 u_core;
1074
+ uniform float u_coreRatio;
1075
+ // Signed distance (px) to a node's silhouette of radius R: the same shapes renderer-canvas2d.js draws (silhouette)
1076
+ float sdRoundBox(vec2 p, float h, float c) {
1077
+ vec2 q = abs(p) - vec2(h - c);
1078
+ return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - c;
1079
+ }
1080
+ float sdHex(vec2 p, float r) {
1081
+ const vec3 k = vec3(-0.866025404, 0.5, 0.577350269);
1082
+ p = abs(p);
1083
+ p -= 2.0 * min(dot(k.xy, p), 0.0) * k.xy;
1084
+ p -= vec2(clamp(p.x, -k.z * r, k.z * r), r);
1085
+ return length(p) * sign(p.y);
1086
+ }
1087
+ float sdShape(vec2 p, float R, int shape, float len) {
1088
+ if (shape == 1) return sdRoundBox(p, u_shape.x * R, u_shape.y * R);
1089
+ if (shape == 2) return sdHex(p.yx, u_shape.z * R);
1090
+ if (shape == 3) return sdRoundBox(p, u_shape.w * R, u_shape2.x * R);
1091
+ if (shape == 4) return (abs(p.x) + abs(p.y) - u_shape2.y * R) * 0.70710678;
1092
+ return len - R;
1093
+ }
1094
+ void main() {
1095
+ float zoom = u_cam.z;
1096
+ float pix = 1.0 / u_dpr;
1097
+ float rw = v_geom.z;
1098
+ float R = rw * zoom;
1099
+ float al = v_geom.w;
1100
+ float len = length(v_local);
1101
+ vec4 acc = vec4(0.0);
1102
+
1103
+ // Halo: a translucent disc, then a ring
1104
+ int halo = int(v_kind.x + 0.5);
1105
+ if (halo > 0) {
1106
+ vec4 fill = u_haloFill[halo];
1107
+ if (fill.a > 0.0) over(acc, fill.rgb, fill.a * al * coverEdge(len - (rw + u_haloGeom[halo].x) * zoom, pix));
1108
+ vec4 ring = u_haloRing[halo];
1109
+ over(acc, ring.rgb, ring.a * al * coverBand(abs(len - (rw + u_haloGeom[halo].y) * zoom), u_haloGeom[halo].z * zoom * 0.5, pix));
1110
+ }
1111
+
1112
+ // Glow: a blurred copy of the disc under it (see glowDisc)
1113
+ float glow = v_color.w;
1114
+ if (glow > 0.0) over(acc, v_color.rgb, v_kind.z * al * glowDisc(len, R, glow * 0.5 / u_dpr));
1115
+
1116
+ // 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)
1117
+ int shapeCode = int(v_kind.w + 0.5);
1118
+ bool glyph = shapeCode >= 8;
1119
+ if (glyph) shapeCode -= 8;
1120
+ over(acc, v_color.rgb, v_kind.z * al * coverEdge(sdShape(v_local, R, shapeCode, len), pix));
1121
+ if (!glyph || 2.0 * R < u_glyphMin) over(acc, u_core.rgb, u_core.a * al * coverEdge(len - R * u_coreRatio, pix));
1122
+
1123
+ // Mark: a ring with the look of its own mark (dashed when its dash is set: added), and for removed a
1124
+ // strike through the node. However far out the camera is, the ring stays u_markMin.z px from the node
1125
+ // and u_markMin.x px thick (scene.js MARK_MIN_PX; renderer-canvas2d.js drawNode does the same).
1126
+ int mark = int(v_kind.y + 0.5);
1127
+ if (mark > 0) {
1128
+ vec4 mc = u_markColor[mark];
1129
+ vec4 mg = u_markGeom[mark];
1130
+ float ringW = rw + max(mg.x, u_markMin.z / zoom);
1131
+ float rr = ringW * zoom;
1132
+ float wpx = max(mg.y * zoom, u_markMin.x);
1133
+ float cover = coverBand(abs(len - rr), wpx * 0.5, pix);
1134
+ if (mg.z > 0.0 && mg.w > 0.0 && len > 0.5) {
1135
+ // a whole number of dashes round the ring, so the pattern closes
1136
+ float circ = 6.2831853 * ringW;
1137
+ float n = max(floor(circ / (mg.z + mg.w) + 0.5), 1.0);
1138
+ float period = circ / n;
1139
+ float on = period * mg.z / (mg.z + mg.w);
1140
+ float arc = mod(atan(v_local.y, v_local.x) + 6.2831853, 6.2831853) * ringW;
1141
+ cover *= coverDash(arc, on, period - on, pix / zoom);
1142
+ }
1143
+ if (mark == 3) cover = max(cover, coverBand(abs(v_local.y), wpx * 0.5, pix) * coverEdge(abs(v_local.x) - rr, pix));
1144
+ over(acc, mc.rgb, mc.a * al * cover);
1145
+ }
1146
+
1147
+ outColor = acc;
1148
+ }
1149
+ `, kt = "\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", At = "\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", jt = (e) => `${X}${kt}
1150
+ #define SEGS ${e}
1151
+ layout(location = 1) in vec4 a_ends; // x1, y1, x2, y2 (world)
1152
+ layout(location = 2) in vec4 a_geom; // control x, y (world), width (world), glow blur (px)
1153
+ layout(location = 3) in vec4 a_color; // straight rgb, alpha (the edge's alpha folded in)
1154
+ layout(location = 4) in vec4 a_glow; // glow rgb, glow strength (colour alpha x edge alpha)
1155
+ layout(location = 5) in vec2 a_dash; // on, off (world); 0 = solid
1156
+ layout(location = 6) in float a_marked; // 1 = a proposal's mark: never thinner than u_markMin.y px
1157
+ uniform vec3 u_markMin; // MARK_MIN_PX in screen px: ring thickness, edge thickness, gap
1158
+ out float v_across; // CSS px from the centre line, signed
1159
+ out float v_arc; // world units along the edge from its start; below 0 and past the length on the end caps
1160
+ flat out float v_len;
1161
+ flat out float v_halfWidth; // the stroke's half width in CSS px, minimum included
1162
+ flat out vec4 v_geom;
1163
+ flat out vec4 v_color;
1164
+ flat out vec4 v_glow;
1165
+ flat out vec2 v_dash;
1166
+ void main() {
1167
+ float zoom = u_cam.z;
1168
+ vec2 a = a_ends.xy;
1169
+ vec2 b = a_ends.zw;
1170
+ vec2 c = a_geom.xy;
1171
+ int pair = gl_VertexID / 2;
1172
+ float side = (gl_VertexID - pair * 2 == 0) ? -1.0 : 1.0;
1173
+ float t = float(clamp(pair - 1, 0, SEGS)) / float(SEGS);
1174
+ vec2 dir = bezD(a, c, b, t);
1175
+ dir = dot(dir, dir) < 1e-9 ? vec2(1.0, 0.0) : normalize(dir);
1176
+ vec2 normal = vec2(-dir.y, dir.x);
1177
+ float halfWidth = max(a_geom.z * zoom, a_marked * u_markMin.y) * 0.5;
1178
+ float pad = a_geom.w * 1.5 / u_dpr + 1.5; // the glow's 3 sigma, and room to anti-alias
1179
+ float ext = pair == 0 ? -pad : (pair == SEGS + 2 ? pad : 0.0);
1180
+ vec2 pos = u_cam.xy + bez(a, c, b, t) * zoom + dir * ext + normal * side * (halfWidth + pad);
1181
+ v_across = side * (halfWidth + pad);
1182
+ v_arc = bezArc(a, c, b, t) + ext / zoom;
1183
+ v_len = bezArc(a, c, b, 1.0);
1184
+ v_halfWidth = halfWidth;
1185
+ v_geom = a_geom;
1186
+ v_color = a_color;
1187
+ v_glow = a_glow;
1188
+ v_dash = a_dash;
1189
+ 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);
1190
+ }
1191
+ `, Mt = `${X}${Q}
1192
+ in float v_across;
1193
+ in float v_arc;
1194
+ flat in float v_len;
1195
+ flat in float v_halfWidth;
1196
+ flat in vec4 v_geom;
1197
+ flat in vec4 v_color;
1198
+ flat in vec4 v_glow;
1199
+ flat in vec2 v_dash;
1200
+
1201
+ // How much of a blurred copy of the stroke's dashes (sigma sw, world units) is under arc
1202
+ float blurredDashes(float arc, float on, float off, float len, float sw) {
1203
+ float whole = phi((arc - 0.0) / sw) - phi((arc - len) / sw);
1204
+ if (on <= 0.0 || off <= 0.0) return whole;
1205
+ float period = on + off;
1206
+ float n = floor(arc / period);
1207
+ float near = 0.0;
1208
+ for (int j = -2; j <= 2; j++) {
1209
+ float lo = (n + float(j)) * period;
1210
+ float hi = min(lo + on, len);
1211
+ lo = max(lo, 0.0);
1212
+ if (hi > lo) near += phi((arc - lo) / sw) - phi((arc - hi) / sw);
1213
+ }
1214
+ // blurred wider than a few periods, the dashes are an even tint
1215
+ return mix(min(near, 1.0), whole * on / period, smoothstep(0.5, 1.5, sw / period));
1216
+ }
1217
+
1218
+ void main() {
1219
+ float zoom = u_cam.z;
1220
+ float pix = 1.0 / u_dpr;
1221
+ float dist = abs(v_across);
1222
+ float halfWidth = v_halfWidth;
1223
+ vec4 acc = vec4(0.0);
1224
+
1225
+ // Glow: Canvas 2D's shadowBlur of the stroke, dashes and all, under it (sigma = blur / 2 device px)
1226
+ if (v_geom.w > 0.0 && v_glow.a > 0.0) {
1227
+ float s = v_geom.w * 0.5 / u_dpr;
1228
+ float across = phi((halfWidth - dist) / s) + phi((halfWidth + dist) / s) - 1.0;
1229
+ float along = blurredDashes(v_arc, v_dash.x, v_dash.y, v_len, s / zoom);
1230
+ over(acc, v_glow.rgb, v_glow.a * clamp(across, 0.0, 1.0) * clamp(along, 0.0, 1.0));
1231
+ }
1232
+
1233
+ // The stroke: a band, with square ends and the dash pattern in world units
1234
+ float cover = coverBand(dist, halfWidth, pix)
1235
+ * coverEdge(-v_arc * zoom, pix)
1236
+ * coverEdge((v_arc - v_len) * zoom, pix)
1237
+ * coverDash(v_arc, v_dash.x, v_dash.y, pix / zoom);
1238
+ over(acc, v_color.rgb, v_color.a * cover);
1239
+ outColor = acc;
1240
+ }
1241
+ `, Nt = `${X}${Z}
1242
+ layout(location = 0) in vec2 a_corner;
1243
+ layout(location = 1) in vec4 a_tip; // x, y (world), direction x, y (unit)
1244
+ layout(location = 2) in vec4 a_color;
1245
+ layout(location = 3) in float a_kind; // 1 = arrowhead (tip at x, y), 2 = strike (centred on x, y), 3 = chevron, 4 = bar, 5 = diamond (all with their tip at x, y), 6 = tick (centred on x, y)
1246
+ uniform vec4 u_tip; // arrow length, arrow spread (radians), strike half length, strike width (world)
1247
+ uniform vec4 u_end; // stroke width of the open marks, bar half length, diamond half length, diamond half width (world)
1248
+ out vec2 v_local;
1249
+ flat out vec4 v_color;
1250
+ flat out float v_kind;
1251
+ void main() {
1252
+ float zoom = u_cam.z;
1253
+ float ext = max(max(u_tip.x, 2.0 * u_end.z), max(u_tip.z, u_end.y)) * zoom + 3.0;
1254
+ vec2 dir = a_tip.zw;
1255
+ vec2 off = a_corner * ext;
1256
+ v_local = vec2(dot(off, dir), dot(off, vec2(-dir.y, dir.x)));
1257
+ v_color = a_color;
1258
+ v_kind = a_kind;
1259
+ gl_Position = toClip(u_cam.xy + a_tip.xy * zoom + off);
1260
+ }
1261
+ `, Pt = `${X}${Q}
1262
+ in vec2 v_local;
1263
+ flat in vec4 v_color;
1264
+ flat in float v_kind;
1265
+ uniform vec4 u_tip;
1266
+ uniform vec4 u_end; // stroke width of the open marks, bar half length, diamond half length, diamond half width (world)
1267
+ uniform vec2 u_tick; // tick half length, tick width (world)
1268
+ // Distance to the segment a-b
1269
+ float sdSeg(vec2 p, vec2 a, vec2 b) {
1270
+ vec2 pa = p - a;
1271
+ vec2 ba = b - a;
1272
+ float h = clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0);
1273
+ return length(pa - ba * h);
1274
+ }
1275
+ // Distance to a rhombus with half diagonals b (iq's sdRhombus)
1276
+ float ndot(vec2 a, vec2 b) { return a.x * b.x - a.y * b.y; }
1277
+ float sdRhombus(vec2 p, vec2 b) {
1278
+ p = abs(p);
1279
+ float h = clamp(ndot(b - 2.0 * p, b) / dot(b, b), -1.0, 1.0);
1280
+ float d = length(p - 0.5 * b * vec2(1.0 - h, 1.0 + h));
1281
+ return d * sign(p.x * b.y + p.y * b.x - b.x * b.y);
1282
+ }
1283
+ void main() {
1284
+ float zoom = u_cam.z;
1285
+ float pix = 1.0 / u_dpr;
1286
+ float sd;
1287
+ float L = u_tip.x * zoom;
1288
+ float sn = sin(u_tip.y);
1289
+ float cs = cos(u_tip.y);
1290
+ float w = max(u_end.x * zoom, 1.2) * 0.5; // half the stroke of an open mark: at least 1.2 px thick so it stays visible zoomed out
1291
+ if (v_kind < 1.5) {
1292
+ // The triangle with its tip at the origin and two barbs L back, spread radians either side of the line
1293
+ sd = max(max(sn * v_local.x + cs * v_local.y, sn * v_local.x - cs * v_local.y), -v_local.x - L * cs);
1294
+ } else if (v_kind < 2.5) {
1295
+ // A box across the edge, at least 1.5 px thick so it stays visible zoomed out
1296
+ vec2 q = abs(v_local) - vec2(max(u_tip.w * zoom, 1.5) * 0.5, u_tip.z * zoom);
1297
+ sd = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0);
1298
+ } else if (v_kind < 3.5) {
1299
+ // The chevron: the arrowhead's two barbs, open (a line each, from the tip back)
1300
+ vec2 barb = vec2(-L * cs, L * sn);
1301
+ sd = min(sdSeg(v_local, vec2(0.0), barb), sdSeg(v_local, vec2(0.0), vec2(barb.x, -barb.y))) - w;
1302
+ } else if (v_kind < 4.5) {
1303
+ // The bar: across the line at the target
1304
+ vec2 q = abs(v_local - vec2(-w, 0.0)) - vec2(w, u_end.y * zoom);
1305
+ sd = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0);
1306
+ } else if (v_kind < 5.5) {
1307
+ // The diamond: an outline, its front vertex at the tip
1308
+ vec2 h = vec2(u_end.z, u_end.w) * zoom;
1309
+ sd = abs(sdRhombus(v_local - vec2(-h.x, 0.0), h)) - w;
1310
+ } else {
1311
+ // The tick: a short box across the edge, centred, at least 1.5 px thick
1312
+ vec2 q = abs(v_local) - vec2(max(u_tick.y * zoom, 1.5) * 0.5, u_tick.x * zoom);
1313
+ sd = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0);
1314
+ }
1315
+ outColor = vec4(v_color.rgb * v_color.a, v_color.a) * coverEdge(sd, pix);
1316
+ }
1317
+ `, Ft = `${X}${Z}${kt}${At}
1318
+ layout(location = 0) in vec2 a_corner;
1319
+ layout(location = 1) in vec4 a_ends; // x1, y1, x2, y2 (world)
1320
+ layout(location = 2) in vec4 a_mot; // control x, y (world), speed (trips per second), phase
1321
+ layout(location = 3) in vec4 a_color; // the dot: straight rgb, alpha (edge alpha folded in)
1322
+ layout(location = 4) in vec4 a_glow; // its glow: rgb, strength
1323
+ layout(location = 5) in vec2 a_size; // radius (world), glow blur (px)
1324
+ uniform float u_time; // seconds
1325
+ out vec2 v_local;
1326
+ flat out vec4 v_size;
1327
+ flat out vec4 v_color;
1328
+ flat out vec4 v_glow;
1329
+ void main() {
1330
+ float zoom = u_cam.z;
1331
+ vec2 centre = u_cam.xy + packetPos(a_ends, a_mot, u_time) * zoom;
1332
+ v_local = a_corner * (a_size.x * zoom + a_size.y * 1.5 / u_dpr + 2.0);
1333
+ v_size = a_size.xyxy;
1334
+ v_color = a_color;
1335
+ v_glow = a_glow;
1336
+ gl_Position = toClip(centre + v_local);
1337
+ }
1338
+ `, It = `${X}${Q}
1339
+ in vec2 v_local;
1340
+ flat in vec4 v_size;
1341
+ flat in vec4 v_color;
1342
+ flat in vec4 v_glow;
1343
+ void main() {
1344
+ float zoom = u_cam.z;
1345
+ float pix = 1.0 / u_dpr;
1346
+ float len = length(v_local);
1347
+ float R = v_size.x * zoom;
1348
+ vec4 acc = vec4(0.0);
1349
+ if (v_size.y > 0.0) over(acc, v_glow.rgb, v_glow.a * glowDisc(len, R, v_size.y * 0.5 / u_dpr));
1350
+ over(acc, v_color.rgb, v_color.a * coverEdge(len - R, pix));
1351
+ outColor = acc;
1352
+ }
1353
+ `, Lt = `${X}${Z}
1354
+ layout(location = 0) in vec2 a_corner;
1355
+ layout(location = 1) in vec4 a_geom; // x, y, side (world), alpha
1356
+ 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
1357
+ uniform float u_sideRatio; // the image's side as a multiple of the node's radius (LETTER_RATIO, GLYPH_RATIO), to read the radius back
1358
+ out vec2 v_uv;
1359
+ flat out float v_alpha;
1360
+ void main() {
1361
+ if (u_minR > 0.0 && a_geom.z / u_sideRatio * u_cam.z < u_minR) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); v_uv = vec2(0.0); v_alpha = 0.0; return; } // too small on screen: outside the clip space, nothing drawn
1362
+ vec2 centre = u_cam.xy + a_geom.xy * u_cam.z;
1363
+ vec2 pos = centre + a_corner * (a_geom.z * 0.5 * u_cam.z);
1364
+ v_uv = vec2(a_corner.x * 0.5 + 0.5, a_corner.y * 0.5 + 0.5); // screen y runs down and an image's first row is its top, so the corner below the centre reads the last row
1365
+ v_alpha = a_geom.w;
1366
+ gl_Position = toClip(pos);
1367
+ }
1368
+ `, Rt = `${X}
1369
+ uniform sampler2D u_tex;
1370
+ in vec2 v_uv;
1371
+ flat in float v_alpha;
1372
+ out vec4 outColor;
1373
+ void main() {
1374
+ outColor = texture(u_tex, v_uv) * v_alpha; // the texture is uploaded premultiplied
1375
+ }
1376
+ `, zt = {
1377
+ none: 0,
1378
+ selected: 1,
1379
+ match: 2,
1380
+ child: 3
1381
+ }, Bt = {
1382
+ arrow: 1,
1383
+ strike: 2,
1384
+ chevron: 3,
1385
+ bar: 4,
1386
+ diamond: 5,
1387
+ tick: 6
1388
+ }, Vt = Object.freeze(Object.fromEntries(M.map((e, t) => [e, t]))), Ht = {
1389
+ none: 0,
1390
+ added: 1,
1391
+ changed: 2,
1392
+ removed: 3,
1393
+ edit: 4
1394
+ }, $ = (e) => {
1395
+ let [t, n, r, i] = te(e);
1396
+ return [
1397
+ t / 255,
1398
+ n / 255,
1399
+ r / 255,
1400
+ i
1401
+ ];
1402
+ }, Ut = (e, t) => Object.hasOwn(e, t) ? e[t] : 0;
1403
+ function Wt(e) {
1404
+ let { nodes: t } = e, n = new Float32Array(t.length * 12);
1405
+ return t.forEach((e, t) => {
1406
+ let [r, i, a, o] = $(e.color);
1407
+ n.set([
1408
+ e.x,
1409
+ e.y,
1410
+ e.r,
1411
+ e.alpha,
1412
+ r,
1413
+ i,
1414
+ a,
1415
+ e.glow || 0,
1416
+ Ut(zt, e.halo),
1417
+ Ut(Ht, e.mark),
1418
+ o,
1419
+ Ut(Vt, e.shape) + (e.glyph && !e.icon && !e.letters ? 8 : 0)
1420
+ ], t * 12);
1421
+ }), {
1422
+ data: n,
1423
+ count: t.length,
1424
+ stride: 12
1425
+ };
1426
+ }
1427
+ function Gt(e) {
1428
+ let { grid: t, rings: n, lanes: r } = e.decor, i = new Float32Array(t ? 8 : 0);
1429
+ t && i.set([
1430
+ t.size,
1431
+ t.width,
1432
+ 0,
1433
+ 0,
1434
+ ...$(t.color)
1435
+ ]);
1436
+ let a = new Float32Array(n.length * 10);
1437
+ n.forEach((e, t) => {
1438
+ let [n, r] = e.dash && e.dash.length >= 2 ? e.dash : [0, 0];
1439
+ a.set([
1440
+ e.x,
1441
+ e.y,
1442
+ e.r,
1443
+ e.width,
1444
+ ...$(e.color),
1445
+ n,
1446
+ r
1447
+ ], t * 10);
1448
+ });
1449
+ let o = new Float32Array(r.length * 14);
1450
+ return r.forEach((e, t) => {
1451
+ o.set([
1452
+ e.x,
1453
+ e.y,
1454
+ e.w,
1455
+ e.h,
1456
+ ...$(e.fill),
1457
+ ...$(e.stroke),
1458
+ e.radius,
1459
+ e.strokeWidth
1460
+ ], t * 14);
1461
+ }), {
1462
+ grid: {
1463
+ data: i,
1464
+ count: +!!t,
1465
+ stride: 8
1466
+ },
1467
+ rings: {
1468
+ data: a,
1469
+ count: n.length,
1470
+ stride: 10
1471
+ },
1472
+ lanes: {
1473
+ data: o,
1474
+ count: r.length,
1475
+ stride: 14
1476
+ }
1477
+ };
1478
+ }
1479
+ function Kt(e) {
1480
+ let t = {
1481
+ straight: [],
1482
+ curved: [],
1483
+ tips: [],
1484
+ packets: []
1485
+ };
1486
+ e.edges.forEach((e) => {
1487
+ 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, h] = u ? $(e.glowColor) : [
1488
+ 0,
1489
+ 0,
1490
+ 0,
1491
+ 0
1492
+ ], g = e.curve ? e.curve.cx : (e.x1 + e.x2) / 2, _ = e.curve ? e.curve.cy : (e.y1 + e.y2) / 2, v = e.mark && e.mark !== "none" ? 1 : 0;
1493
+ if (t[e.curve ? "curved" : "straight"].push([
1494
+ e.x1,
1495
+ e.y1,
1496
+ e.x2,
1497
+ e.y2,
1498
+ g,
1499
+ _,
1500
+ e.width,
1501
+ u ? e.glow : 0,
1502
+ n,
1503
+ r,
1504
+ i,
1505
+ s,
1506
+ d,
1507
+ f,
1508
+ p,
1509
+ h * s,
1510
+ c,
1511
+ l,
1512
+ v
1513
+ ]), e.arrow) {
1514
+ 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" && Ut(Bt, e.end) || Bt.arrow;
1515
+ t.tips.push([
1516
+ e.x2,
1517
+ e.y2,
1518
+ Math.cos(a),
1519
+ Math.sin(a),
1520
+ n,
1521
+ r,
1522
+ i,
1523
+ s,
1524
+ o
1525
+ ]);
1526
+ }
1527
+ if (e.ticks) {
1528
+ let a = m(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];
1529
+ for (let o = 0; o < e.ticks; o++) {
1530
+ let u = (o - (e.ticks - 1) / 2) * R.tickGap;
1531
+ t.tips.push([
1532
+ a.x + c * u,
1533
+ a.y + l * u,
1534
+ c,
1535
+ l,
1536
+ n,
1537
+ r,
1538
+ i,
1539
+ s,
1540
+ Bt.tick
1541
+ ]);
1542
+ }
1543
+ }
1544
+ if (e.mark === "removed") {
1545
+ let a = m(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];
1546
+ t.tips.push([
1547
+ a.x,
1548
+ a.y,
1549
+ c,
1550
+ l,
1551
+ n,
1552
+ r,
1553
+ i,
1554
+ s,
1555
+ Bt.strike
1556
+ ]);
1557
+ }
1558
+ if (e.packet) {
1559
+ let n = e.packet, [r, i, a, s] = $(n.color), [c, l, u, d] = $(n.glowColor);
1560
+ t.packets.push([
1561
+ e.x1,
1562
+ e.y1,
1563
+ e.x2,
1564
+ e.y2,
1565
+ g,
1566
+ _,
1567
+ n.speed,
1568
+ n.phase,
1569
+ r,
1570
+ i,
1571
+ a,
1572
+ s * o,
1573
+ c,
1574
+ l,
1575
+ u,
1576
+ d * s * o,
1577
+ n.radius,
1578
+ n.glow
1579
+ ]);
1580
+ }
1581
+ });
1582
+ let n = (e, t) => {
1583
+ let n = new Float32Array(e.length * t);
1584
+ return e.forEach((e, r) => n.set(e, r * t)), {
1585
+ data: n,
1586
+ count: e.length,
1587
+ stride: t
1588
+ };
1589
+ };
1590
+ return {
1591
+ straight: n(t.straight, 19),
1592
+ curved: n(t.curved, 19),
1593
+ tips: n(t.tips, 9),
1594
+ packets: n(t.packets, 18)
1595
+ };
1596
+ }
1597
+ var qt = (e) => ({
1598
+ ...Gt(e),
1599
+ nodes: Wt(e),
1600
+ ...Kt(e)
1601
+ });
1602
+ function Jt(e) {
1603
+ let t = [];
1604
+ e.nodes.forEach((e) => {
1605
+ if (!e.stroke) return;
1606
+ let [n, r, i, a] = $(e.stroke.color);
1607
+ t.push([
1608
+ e.x,
1609
+ e.y,
1610
+ Math.max(0, e.r - e.stroke.width / 2),
1611
+ e.stroke.width,
1612
+ n,
1613
+ r,
1614
+ i,
1615
+ a * e.alpha,
1616
+ 0,
1617
+ 0
1618
+ ]);
1619
+ });
1620
+ let n = new Float32Array(t.length * 10);
1621
+ return t.forEach((e, t) => n.set(e, t * 10)), {
1622
+ data: n,
1623
+ count: t.length,
1624
+ stride: 10
1625
+ };
1626
+ }
1627
+ function Yt(e, t, n = null) {
1628
+ let r = /* @__PURE__ */ new Map();
1629
+ e.nodes.forEach((e) => {
1630
+ let i = e.icon && t(e.icon) ? e.icon : null, a = e.r * de;
1631
+ if (!i && !e.icon && e.letters && t(he(e.letters)) && (i = he(e.letters), a = e.r * 1), !i && !e.icon && !e.letters && e.glyph) {
1632
+ let r = y(e.glyph, D(e, n));
1633
+ t(r) && (i = r, a = e.r * G);
1634
+ }
1635
+ if (!i) return;
1636
+ r.has(i) || r.set(i, {
1637
+ rows: [],
1638
+ minR: Infinity,
1639
+ maxR: 0
1640
+ });
1641
+ let o = r.get(i);
1642
+ o.maxR = Math.max(o.maxR, e.r), o.rows.push([
1643
+ e.x,
1644
+ e.y,
1645
+ a,
1646
+ e.alpha
1647
+ ]), o.minR = Math.min(o.minR, e.r);
1648
+ });
1649
+ let i = [], a = [];
1650
+ for (let [e, { rows: t, minR: n, maxR: o }] of r) i.push({
1651
+ kind: e,
1652
+ first: a.length,
1653
+ count: t.length,
1654
+ minR: n,
1655
+ maxR: o
1656
+ }), a.push(...t);
1657
+ let o = new Float32Array(a.length * 4);
1658
+ return a.forEach((e, t) => o.set(e, t * 4)), {
1659
+ data: o,
1660
+ count: a.length,
1661
+ stride: 4,
1662
+ groups: i
1663
+ };
1664
+ }
1665
+ function Xt(e = "dark", t = null) {
1666
+ let { halo: n, mark: r, core: s } = t ? a(i(e), t) : i(e), c = /* @__PURE__ */ new Float32Array(16), l = /* @__PURE__ */ new Float32Array(16), u = /* @__PURE__ */ new Float32Array(16);
1667
+ Object.entries(zt).forEach(([e, t]) => {
1668
+ let r = n[e];
1669
+ t && r && (c.set($(r.fill), t * 4), l.set($(r.ring), t * 4), u.set([
1670
+ r.fillR,
1671
+ r.ringR,
1672
+ r.ringWidth,
1673
+ 0
1674
+ ], t * 4));
1675
+ });
1676
+ let d = /* @__PURE__ */ new Float32Array(20), f = /* @__PURE__ */ new Float32Array(20);
1677
+ return Object.entries(Ht).forEach(([e, t]) => {
1678
+ if (!t) return;
1679
+ let n = r[e];
1680
+ d.set($(n.color), t * 4);
1681
+ let [i, a] = n.ringDash || [0, 0];
1682
+ f.set([
1683
+ n.ringR,
1684
+ n.ringWidth,
1685
+ i,
1686
+ a
1687
+ ], t * 4);
1688
+ }), {
1689
+ haloFill: c,
1690
+ haloRing: l,
1691
+ haloGeom: u,
1692
+ markColor: d,
1693
+ markGeom: f,
1694
+ markMin: new Float32Array([
1695
+ g.ring,
1696
+ g.edge,
1697
+ g.gap
1698
+ ]),
1699
+ core: new Float32Array($(s)),
1700
+ coreRatio: o
1701
+ };
1702
+ }
1703
+ var Zt = [
1704
+ {
1705
+ name: "grid",
1706
+ vert: xt,
1707
+ frag: St,
1708
+ stride: 8,
1709
+ attribs: [[
1710
+ 1,
1711
+ 4,
1712
+ 0
1713
+ ], [
1714
+ 2,
1715
+ 4,
1716
+ 4
1717
+ ]]
1718
+ },
1719
+ {
1720
+ name: "lanes",
1721
+ vert: Ct,
1722
+ frag: wt,
1723
+ stride: 14,
1724
+ attribs: [
1725
+ [
1726
+ 1,
1727
+ 4,
1728
+ 0
1729
+ ],
1730
+ [
1731
+ 2,
1732
+ 4,
1733
+ 4
1734
+ ],
1735
+ [
1736
+ 3,
1737
+ 4,
1738
+ 8
1739
+ ],
1740
+ [
1741
+ 4,
1742
+ 2,
1743
+ 12
1744
+ ]
1745
+ ]
1746
+ },
1747
+ {
1748
+ name: "rings",
1749
+ vert: Tt,
1750
+ frag: Et,
1751
+ stride: 10,
1752
+ attribs: [
1753
+ [
1754
+ 1,
1755
+ 4,
1756
+ 0
1757
+ ],
1758
+ [
1759
+ 2,
1760
+ 4,
1761
+ 4
1762
+ ],
1763
+ [
1764
+ 3,
1765
+ 2,
1766
+ 8
1767
+ ]
1768
+ ]
1769
+ },
1770
+ {
1771
+ name: "straight",
1772
+ vert: jt(1),
1773
+ frag: Mt,
1774
+ stride: 19,
1775
+ verts: 8,
1776
+ attribs: [
1777
+ [
1778
+ 1,
1779
+ 4,
1780
+ 0
1781
+ ],
1782
+ [
1783
+ 2,
1784
+ 4,
1785
+ 4
1786
+ ],
1787
+ [
1788
+ 3,
1789
+ 4,
1790
+ 8
1791
+ ],
1792
+ [
1793
+ 4,
1794
+ 4,
1795
+ 12
1796
+ ],
1797
+ [
1798
+ 5,
1799
+ 2,
1800
+ 16
1801
+ ],
1802
+ [
1803
+ 6,
1804
+ 1,
1805
+ 18
1806
+ ]
1807
+ ],
1808
+ constants: "edges"
1809
+ },
1810
+ {
1811
+ name: "curved",
1812
+ vert: jt(24),
1813
+ frag: Mt,
1814
+ stride: 19,
1815
+ verts: 54,
1816
+ attribs: [
1817
+ [
1818
+ 1,
1819
+ 4,
1820
+ 0
1821
+ ],
1822
+ [
1823
+ 2,
1824
+ 4,
1825
+ 4
1826
+ ],
1827
+ [
1828
+ 3,
1829
+ 4,
1830
+ 8
1831
+ ],
1832
+ [
1833
+ 4,
1834
+ 4,
1835
+ 12
1836
+ ],
1837
+ [
1838
+ 5,
1839
+ 2,
1840
+ 16
1841
+ ],
1842
+ [
1843
+ 6,
1844
+ 1,
1845
+ 18
1846
+ ]
1847
+ ],
1848
+ constants: "edges"
1849
+ },
1850
+ {
1851
+ name: "tips",
1852
+ vert: Nt,
1853
+ frag: Pt,
1854
+ stride: 9,
1855
+ attribs: [
1856
+ [
1857
+ 1,
1858
+ 4,
1859
+ 0
1860
+ ],
1861
+ [
1862
+ 2,
1863
+ 4,
1864
+ 4
1865
+ ],
1866
+ [
1867
+ 3,
1868
+ 1,
1869
+ 8
1870
+ ]
1871
+ ],
1872
+ constants: "tips"
1873
+ },
1874
+ {
1875
+ name: "packets",
1876
+ vert: Ft,
1877
+ frag: It,
1878
+ stride: 18,
1879
+ attribs: [
1880
+ [
1881
+ 1,
1882
+ 4,
1883
+ 0
1884
+ ],
1885
+ [
1886
+ 2,
1887
+ 4,
1888
+ 4
1889
+ ],
1890
+ [
1891
+ 3,
1892
+ 4,
1893
+ 8
1894
+ ],
1895
+ [
1896
+ 4,
1897
+ 4,
1898
+ 12
1899
+ ],
1900
+ [
1901
+ 5,
1902
+ 2,
1903
+ 16
1904
+ ]
1905
+ ],
1906
+ time: !0
1907
+ },
1908
+ {
1909
+ name: "nodes",
1910
+ vert: Dt,
1911
+ frag: Ot,
1912
+ stride: 12,
1913
+ attribs: [
1914
+ [
1915
+ 1,
1916
+ 4,
1917
+ 0
1918
+ ],
1919
+ [
1920
+ 2,
1921
+ 4,
1922
+ 4
1923
+ ],
1924
+ [
1925
+ 3,
1926
+ 4,
1927
+ 8
1928
+ ]
1929
+ ],
1930
+ constants: "nodes"
1931
+ }
1932
+ ], Qt = {
1933
+ nodes(e, t, n) {
1934
+ 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"), v.roundedHalf, v.roundedCorner, v.hexInradius, v.squareHalf), e.uniform2f(t("u_shape2"), v.squareCorner, v.diamondHalf), e.uniform1f(t("u_glyphMin"), 14);
1935
+ },
1936
+ edges(e, t, n) {
1937
+ e.uniform3fv(t("u_markMin"), n.markMin);
1938
+ },
1939
+ tips(e, t) {
1940
+ e.uniform4f(t("u_tip"), s.length, s.spread, _.halfLength, _.width), e.uniform4f(t("u_end"), R.strokeWidth, R.barHalf, R.diamondHalf, R.diamondAcross), e.uniform2f(t("u_tick"), R.tickHalf, R.tickWidth);
1941
+ }
1942
+ }, $t = {
1943
+ alpha: !0,
1944
+ premultipliedAlpha: !0,
1945
+ antialias: !1,
1946
+ depth: !1,
1947
+ stencil: !1,
1948
+ preserveDrawingBuffer: !1,
1949
+ powerPreference: "high-performance"
1950
+ };
1951
+ function en(e, t, n, r) {
1952
+ let i = e.createShader(t);
1953
+ if (e.shaderSource(i, n), e.compileShader(i), !e.getShaderParameter(i, e.COMPILE_STATUS)) {
1954
+ let t = e.getShaderInfoLog(i);
1955
+ throw e.deleteShader(i), Error(`${r} shader did not compile: ${t}`);
1956
+ }
1957
+ return i;
1958
+ }
1959
+ function tn(e, t, n, r) {
1960
+ let i = en(e, e.VERTEX_SHADER, t, `${r} vertex`), a = en(e, e.FRAGMENT_SHADER, n, `${r} fragment`), o = e.createProgram();
1961
+ if (e.attachShader(o, i), e.attachShader(o, a), e.linkProgram(o), e.deleteShader(i), e.deleteShader(a), !e.getProgramParameter(o, e.LINK_STATUS)) {
1962
+ let t = e.getProgramInfoLog(o);
1963
+ throw e.deleteProgram(o), Error(`${r} program did not link: ${t}`);
1964
+ }
1965
+ return o;
1966
+ }
1967
+ var nn = (e) => !e || e.plain ? 0 : e.version;
1968
+ function rn(e, t, n, r = null) {
1969
+ let i = Xt(n, r);
1970
+ t.passes.forEach((t) => {
1971
+ t.spec.constants && (e.useProgram(t.program), Qt[t.spec.constants](e, t.at, i));
1972
+ }), t.theme = n, t.styleKey = nn(r);
1973
+ }
1974
+ function an(e, t, n) {
1975
+ let r = tn(e, t.vert, t.frag, t.name), i = e.createVertexArray(), a = e.createBuffer();
1976
+ 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]) => {
1977
+ e.enableVertexAttribArray(n), e.vertexAttribPointer(n, r, e.FLOAT, !1, t.stride * 4, i * 4), e.vertexAttribDivisor(n, 1);
1978
+ }), e.bindVertexArray(null);
1979
+ let o = (t) => e.getUniformLocation(r, t);
1980
+ return {
1981
+ spec: t,
1982
+ program: r,
1983
+ vao: i,
1984
+ buffer: a,
1985
+ at: o,
1986
+ count: 0,
1987
+ uniforms: {
1988
+ viewport: o("u_viewport"),
1989
+ cam: o("u_cam"),
1990
+ dpr: o("u_dpr"),
1991
+ time: t.time ? o("u_time") : null
1992
+ }
1993
+ };
1994
+ }
1995
+ var on = {
1996
+ strokes: {
1997
+ name: "strokes",
1998
+ vert: Tt,
1999
+ frag: Et,
2000
+ stride: 10,
2001
+ attribs: [
2002
+ [
2003
+ 1,
2004
+ 4,
2005
+ 0
2006
+ ],
2007
+ [
2008
+ 2,
2009
+ 4,
2010
+ 4
2011
+ ],
2012
+ [
2013
+ 3,
2014
+ 2,
2015
+ 8
2016
+ ]
2017
+ ]
2018
+ },
2019
+ icons: {
2020
+ name: "icons",
2021
+ vert: Lt,
2022
+ frag: Rt,
2023
+ stride: 4,
2024
+ attribs: [[
2025
+ 1,
2026
+ 4,
2027
+ 0
2028
+ ]]
2029
+ }
2030
+ };
2031
+ function sn(e, t = "dark", n = null) {
2032
+ let r = e.createBuffer();
2033
+ e.bindBuffer(e.ARRAY_BUFFER, r), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
2034
+ -1,
2035
+ -1,
2036
+ 1,
2037
+ -1,
2038
+ -1,
2039
+ 1,
2040
+ 1,
2041
+ 1
2042
+ ]), e.STATIC_DRAW);
2043
+ let i = {
2044
+ corners: r,
2045
+ passes: Zt.map((t) => an(e, t, r)),
2046
+ theme: t,
2047
+ styleKey: 0,
2048
+ extras: {
2049
+ strokes: null,
2050
+ icons: null
2051
+ },
2052
+ textures: /* @__PURE__ */ new Map(),
2053
+ iconStore: null
2054
+ };
2055
+ return rn(e, i, t, n), i;
2056
+ }
2057
+ function cn(e, t) {
2058
+ e.deleteBuffer(t.corners), t.textures.forEach(({ texture: t }) => e.deleteTexture(t)), [...t.passes, ...Object.values(t.extras).filter(Boolean)].forEach((t) => {
2059
+ e.deleteProgram(t.program), e.deleteVertexArray(t.vao), e.deleteBuffer(t.buffer);
2060
+ });
2061
+ }
2062
+ function ln(e, t = {}) {
2063
+ let n = t.gl || e.getContext("webgl2", $t);
2064
+ if (!n) throw Error("WebGL2 is not available");
2065
+ let i = t.mapStyle || (() => x), a = {
2066
+ uploads: 0,
2067
+ draws: 0
2068
+ }, o = sn(n), s = !1, c = 0, l = 0, u = null, d = null, f, p = null;
2069
+ function m(e) {
2070
+ return o.extras[e] || (o.extras[e] = an(n, on[e], o.corners)), o.extras[e];
2071
+ }
2072
+ function h() {
2073
+ o.passes.forEach((e) => {
2074
+ let t = u[e.spec.name];
2075
+ e.count = t.count, t.count && (n.bindBuffer(n.ARRAY_BUFFER, e.buffer), n.bufferData(n.ARRAY_BUFFER, t.data, n.DYNAMIC_DRAW));
2076
+ });
2077
+ for (let e of Object.keys(on)) {
2078
+ let t = u[e];
2079
+ if (!t.count && !o.extras[e]) continue;
2080
+ let r = m(e);
2081
+ r.count = t.count, t.count && (n.bindBuffer(n.ARRAY_BUFFER, r.buffer), n.bufferData(n.ARRAY_BUFFER, t.data, n.DYNAMIC_DRAW));
2082
+ }
2083
+ a.uploads++;
2084
+ }
2085
+ function g(e, t) {
2086
+ 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);
2087
+ }
2088
+ function _(e, t, r) {
2089
+ let i = o.textures.get(e);
2090
+ if (!i || i.image !== t) {
2091
+ i && n.deleteTexture(i.texture);
2092
+ let r = n.createTexture();
2093
+ n.bindTexture(n.TEXTURE_2D, r), n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0), n.texImage2D(n.TEXTURE_2D, 0, n.RGBA, n.RGBA, n.UNSIGNED_BYTE, t), n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE), n.generateMipmap(n.TEXTURE_2D), i = {
2094
+ image: t,
2095
+ texture: r,
2096
+ pixelated: null
2097
+ }, o.textures.set(e, i);
2098
+ }
2099
+ return i.pixelated !== r && (g(i.texture, r), i.pixelated = r), i.texture;
2100
+ }
2101
+ function v(t, m, g) {
2102
+ if (p = [
2103
+ t,
2104
+ m,
2105
+ g
2106
+ ], s || !o || !c || !l) return;
2107
+ let v = i(), y = S(t, v), b = v.values ? v.values[A] : void 0;
2108
+ (o.iconStore !== v.icons || o.glyphInk !== b) && (o.textures.forEach(({ texture: e }) => n.deleteTexture(e)), o.textures.clear(), o.iconStore = v.icons, o.glyphInk = b, d = null), (y !== d || y.version !== f) && (u = {
2109
+ ...qt(y),
2110
+ strokes: Jt(y),
2111
+ icons: Yt(y, (e) => ge(e) ? !!be(_e(e), b) : se(e) ? !!E(r(e).type, r(e).ink) : !!(v.icons && v.icons.get(e)), v)
2112
+ }, d = y, f = y.version, h());
2113
+ let x = y.theme || "dark";
2114
+ (o.theme !== x || o.styleKey !== nn(v)) && rn(n, o, x, 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), o.passes.forEach((t) => {
2115
+ t.count && (n.useProgram(t.program), n.uniform2f(t.uniforms.viewport, c, l), n.uniform3f(t.uniforms.cam, m.x, m.y, m.zoom), n.uniform1f(t.uniforms.dpr, e.width / c), 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), a.draws++);
2116
+ });
2117
+ let C = o.extras.strokes;
2118
+ C && C.count && (n.useProgram(C.program), n.uniform2f(C.uniforms.viewport, c, l), n.uniform3f(C.uniforms.cam, m.x, m.y, m.zoom), n.uniform1f(C.uniforms.dpr, e.width / c), n.bindVertexArray(C.vao), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, C.count), a.draws++);
2119
+ let w = o.extras.icons;
2120
+ if (w && w.count) {
2121
+ n.useProgram(w.program), n.uniform2f(w.uniforms.viewport, c, l), n.uniform3f(w.uniforms.cam, m.x, m.y, m.zoom), n.uniform1f(w.uniforms.dpr, e.width / c), n.uniform1i(w.at("u_tex"), 0), n.activeTexture(n.TEXTURE0), n.bindVertexArray(w.vao), n.bindBuffer(n.ARRAY_BUFFER, w.buffer);
2122
+ for (let e of u.icons.groups) {
2123
+ let t = ge(e.kind), i = se(e.kind), o = t || i ? 14 : 0;
2124
+ if (o && e.maxR * 2 * m.zoom < o) continue;
2125
+ n.uniform1f(w.at("u_minR"), o / 2), n.uniform1f(w.at("u_sideRatio"), t ? 1 : i ? G : 1);
2126
+ let s = t ? be(_e(e.kind), v.values && v.values["--corn-map-glyph"]) : i ? E(r(e.kind).type, r(e.kind).ink) : v.icons && v.icons.get(e.kind);
2127
+ s && (n.bindTexture(n.TEXTURE_2D, _(e.kind, s, !!v.pixelated && !t && !i)), n.vertexAttribPointer(1, 4, n.FLOAT, !1, 16, e.first * 4 * 4), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, e.count), a.draws++);
2128
+ }
2129
+ }
2130
+ n.bindVertexArray(null);
2131
+ }
2132
+ let y = (e) => {
2133
+ e.preventDefault(), s = !0, o = null;
2134
+ }, b = () => {
2135
+ try {
2136
+ o = sn(n, p && p[0].theme || "dark", i()), s = !1, u && h(), p && v(...p);
2137
+ } catch (e) {
2138
+ console.warn("WebGL2 context restored but the renderer could not be rebuilt:", e.message);
2139
+ }
2140
+ };
2141
+ return e.addEventListener("webglcontextlost", y), e.addEventListener("webglcontextrestored", b), {
2142
+ kind: "webgl2",
2143
+ stats: a,
2144
+ resize(t, n, r) {
2145
+ c = t, l = n, e.width = Math.round(t * r), e.height = Math.round(n * r), p && v(...p);
2146
+ },
2147
+ draw: v,
2148
+ destroy: C,
2149
+ release() {
2150
+ let e = s;
2151
+ C();
2152
+ try {
2153
+ let t = !e && n.getExtension ? n.getExtension("WEBGL_lose_context") : null;
2154
+ t && t.loseContext();
2155
+ } catch {}
2156
+ }
2157
+ };
2158
+ function C() {
2159
+ e.removeEventListener("webglcontextlost", y), e.removeEventListener("webglcontextrestored", b), o && !s && cn(n, o), o = null, s = !0;
2160
+ }
2161
+ }
2162
+ // ../explorer/renderer.js
2163
+ function un(e) {
2164
+ let t = e.ownerDocument.createElement("canvas");
2165
+ 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;
2166
+ }
2167
+ function dn(e, t = {}) {
2168
+ let n = t.prefer || null, r = t.mapStyle ? { mapStyle: t.mapStyle } : {};
2169
+ if (n === "canvas2d") return Le(e, r);
2170
+ let i = null;
2171
+ try {
2172
+ i = e.getContext("webgl2", $t);
2173
+ } catch {}
2174
+ if (!i) return Le(e, r);
2175
+ try {
2176
+ return ln(e, {
2177
+ gl: i,
2178
+ ...r
2179
+ });
2180
+ } catch (n) {
2181
+ console.warn(`WebGL2 renderer unavailable, drawing with Canvas 2D: ${n.message}`);
2182
+ let i = (t.makeStandIn || un)(e), a = Le(i, r);
2183
+ return {
2184
+ ...a,
2185
+ destroy() {
2186
+ a.destroy(), i.remove();
2187
+ }
2188
+ };
2189
+ }
2190
+ }
2191
+ // ../explorer/cluster.js
2192
+ function fn(e, t) {
2193
+ let n = /* @__PURE__ */ new Map();
2194
+ 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);
2195
+ let r = /* @__PURE__ */ new Set([e]), i = [e];
2196
+ for (; i.length;) for (let e of n.get(i.pop()) || []) r.has(e) || (r.add(e), i.push(e));
2197
+ return r;
2198
+ }
2199
+ // ../explorer/input.js
2200
+ function pn(e) {
2201
+ let { state: t } = e, { render: n, getSpatialIndex: r, queueFrameWork: i, screenToWorld: a, getMinZoom: o, setHoverNode: s, labelNodeAt: c, fitGraphToViewport: u, fitPadding: d } = e.map, f = (t) => e.emit("select", t), m = () => e.emit("background"), g = () => e.emit("grab"), _ = !1, v = null, y = {
2202
+ x: 0,
2203
+ y: 0
2204
+ }, b = {
2205
+ x: 0,
2206
+ y: 0
2207
+ }, x = !1, S = null, C = null, w = 0, E = null, D = !1, O = null, k = null, A = null, j = !1, M = "", N = () => t.isFreeform && t.view === "orbit";
2208
+ function P(e) {
2209
+ 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;
2210
+ return {
2211
+ x: (r.clientX - n.left) * i,
2212
+ y: (r.clientY - n.top) * a
2213
+ };
2214
+ }
2215
+ let F = {
2216
+ nodes: null,
2217
+ size: -1,
2218
+ map: null
2219
+ };
2220
+ function I(e) {
2221
+ return (F.nodes !== t.nodes || F.size !== t.nodes.length) && (F = {
2222
+ nodes: t.nodes,
2223
+ size: t.nodes.length,
2224
+ map: new Map(t.nodes.map((e) => [e.id, e]))
2225
+ }), F.map.get(e) || null;
2226
+ }
2227
+ function ee(e, n, i) {
2228
+ let a = Be(r(), t.camera, e, n, i);
2229
+ return a ? I(a.id) : null;
2230
+ }
2231
+ let te = (e) => Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY);
2232
+ function L(e) {
2233
+ let n = t.canvas.getBoundingClientRect();
2234
+ return {
2235
+ x: (e.touches[0].clientX + e.touches[1].clientX) / 2 - n.left,
2236
+ y: (e.touches[0].clientY + e.touches[1].clientY) / 2 - n.top
2237
+ };
2238
+ }
2239
+ function R(e) {
2240
+ if (D = !0, g(), s(null), e.touches && e.touches.length === 2) {
2241
+ E = l(t.camera, te(e), L(e)), O = null, _ = !1, v = null, S = null;
2242
+ return;
2243
+ }
2244
+ let n = !!(e.touches && e.touches.length > 0), r = P(e);
2245
+ b = {
2246
+ x: r.x,
2247
+ y: r.y
2248
+ }, x = !1, O = null, S = ee(r.x, r.y, n), N() && S ? (v = S, e.cancelable && e.preventDefault()) : (_ = !0, y = r);
2249
+ }
2250
+ function ne() {
2251
+ k && E && Object.assign(t.camera, T(E, k.dist, k.mid, o())), k = null;
2252
+ let n = O;
2253
+ if (O = null, n) {
2254
+ if (v && N()) {
2255
+ let r = a(n.x, n.y);
2256
+ v.x = r.x, v.y = r.y, t.freeformPositions[v.id] = {
2257
+ x: r.x,
2258
+ y: r.y
2259
+ }, e.touchScene(), fe(e);
2260
+ } else _ && (t.camera.x += n.x - y.x, t.camera.y += n.y - y.y, y = n);
2261
+ }
2262
+ }
2263
+ function z() {
2264
+ let e = A;
2265
+ if (A = null, !e || _ || v) return;
2266
+ let t = ee(e.x, e.y, !1);
2267
+ B(!!t), s(t ? t.id : null);
2268
+ }
2269
+ function B(e) {
2270
+ e !== j && t.canvas && (e && (M = t.canvas.style.cursor), j = e, t.canvas.style.cursor = e ? "pointer" : M);
2271
+ }
2272
+ function V(e) {
2273
+ if (e.touches && e.touches.length === 2 && E) {
2274
+ e.cancelable && e.preventDefault(), k = {
2275
+ dist: te(e),
2276
+ mid: L(e)
2277
+ }, i(ne);
2278
+ return;
2279
+ }
2280
+ let t = P(e);
2281
+ Math.hypot(t.x - b.x, t.y - b.y) > 8 && (x = !0), v && N() || _ ? (e.cancelable && e.preventDefault(), O = t, i(ne)) : e.touches || (A = t, i(z, { draw: !1 }));
2282
+ }
2283
+ function H(e) {
2284
+ ne();
2285
+ let n = !!(e.changedTouches && e.changedTouches.length > 0), r = t.canvas.getBoundingClientRect(), i = n ? {
2286
+ x: e.changedTouches[0].clientX - r.left,
2287
+ y: e.changedTouches[0].clientY - r.top
2288
+ } : P(e);
2289
+ if (!x && D) {
2290
+ if (S) {
2291
+ let e = ee(i.x, i.y, n);
2292
+ if (e && e.id === S.id) {
2293
+ if (!N()) f(S);
2294
+ else {
2295
+ let e = Date.now();
2296
+ C && C.id === S.id && e - w < 380 ? (f(S), C = null, w = 0) : (C = S, w = e);
2297
+ }
2298
+ }
2299
+ } else {
2300
+ let e = I(c(i.x, i.y));
2301
+ e && h.includes(e.type) && e.id !== "root" ? u(d(), fn(e.id, t.edges)) : t.selectedNode && m();
2302
+ }
2303
+ }
2304
+ _ = !1, v = null, S = null, E = null, k = null, D = !1;
2305
+ }
2306
+ let { canvas: U } = t, re = !(e.root && e.root.nodeType === 9), W = (r) => {
2307
+ if (re && !r.ctrlKey && !r.metaKey && e.active() !== t.canvas) return;
2308
+ r.preventDefault(), g();
2309
+ let i = P(r);
2310
+ Object.assign(t.camera, p(t.camera, r.deltaY < 0 ? 1.12 : .88, i.x, i.y, o())), n();
2311
+ }, G = e.root || U, ie = [
2312
+ e.listen(U, "mousedown", R),
2313
+ e.listen(U, "mousemove", V),
2314
+ e.listen(U, "mouseleave", () => {
2315
+ A = null, B(!1), s(null);
2316
+ }),
2317
+ e.listen(G, "mouseup", H),
2318
+ e.listen(U, "touchstart", R, { passive: !1 }),
2319
+ e.listen(U, "touchmove", V, { passive: !1 }),
2320
+ e.listen(G, "touchend", H, { passive: !1 }),
2321
+ e.listen(G, "touchcancel", H, { passive: !1 }),
2322
+ e.listen(U, "wheel", W, { passive: !1 })
2323
+ ];
2324
+ return () => ie.forEach((e) => e());
2325
+ }
2326
+ // ../explorer/pieces/map.js
2327
+ var mn = "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.", hn = "<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>", gn = ({ keysHelp: e = mn } = {}) => ({ stage: `${hn}
2328
+ <p id="map-keys-help" class="hx-sr-only">${W(e)}</p>
2329
+ <p id="map-announcer" class="hx-sr-only" role="status" aria-live="polite"></p>
2330
+ <canvas id="label-canvas" data-corn="label-canvas" aria-hidden="true"></canvas>` });
2331
+ function _n(e, t, n) {
2332
+ let r = j(t, e, "<div data-corn=\"map-stage\"></div>", null, "stage"), i = n.mountStatus(r[0], t, { follow: !1 });
2333
+ i.refuse("second-map"), t.emit("piece:refused", {
2334
+ piece: "map",
2335
+ reason: "second-map",
2336
+ message: "A scope holds one map.",
2337
+ host: e.nodeType === 11 ? e.host : e
2338
+ });
2339
+ let a = () => {};
2340
+ return {
2341
+ inst: t,
2342
+ refused: !0,
2343
+ update: a,
2344
+ fit: a,
2345
+ refresh: a,
2346
+ focusNode: () => !1,
2347
+ applyTheme: a,
2348
+ destroy() {
2349
+ i.destroy();
2350
+ for (let e of r) e.remove();
2351
+ }
2352
+ };
2353
+ }
2354
+ function vn(e) {
2355
+ let t = e.nodeType === 11 ? e.host : e;
2356
+ return t && typeof t.getRootNode == "function" ? t.getRootNode() : null;
2357
+ }
2358
+ function yn(e, t, n = {}) {
2359
+ return !t && n.src !== void 0 && n.src !== null && n.src !== "" ? bn(e, n) : xn(e, t, n, null);
2360
+ }
2361
+ function bn(e, t) {
2362
+ let n = e.nodeType === 11 ? e.host : e, r = {}, i = null, a = !1;
2363
+ return import("./scope-CmIkJ1qf.js").then((e) => e.n).then(({ mountScope: o }) => {
2364
+ if (a) return;
2365
+ let s = o(n, {
2366
+ src: t.src,
2367
+ theme: t.theme,
2368
+ useTheme: t.useTheme,
2369
+ tokens: t.tokens,
2370
+ version: t.version,
2371
+ pageUrl: t.pageUrl,
2372
+ onAuth: t.onAuth,
2373
+ onError: t.onError
2374
+ });
2375
+ i = xn(e, s.instance, {
2376
+ ...t,
2377
+ ...r
2378
+ }, s);
2379
+ }, (e) => {
2380
+ !a && t.onError && t.onError({
2381
+ kind: "offline",
2382
+ message: `the map's loader did not load: ${e && e.message ? e.message : e}`
2383
+ });
2384
+ }), {
2385
+ get inst() {
2386
+ return i ? i.inst : null;
2387
+ },
2388
+ get map() {
2389
+ return i ? i.map : null;
2390
+ },
2391
+ update(e = {}) {
2392
+ i ? i.update(e) : Object.assign(r, e);
2393
+ },
2394
+ fit() {
2395
+ i && i.fit();
2396
+ },
2397
+ focusNode(e) {
2398
+ return i ? i.focusNode(e) : !1;
2399
+ },
2400
+ refresh() {
2401
+ i && i.refresh();
2402
+ },
2403
+ applyTheme(e) {
2404
+ return i ? i.applyTheme(e) : null;
2405
+ },
2406
+ destroy() {
2407
+ a || (a = !0, i && i.destroy(), i = null);
2408
+ }
2409
+ };
2410
+ }
2411
+ function xn(e, t, n, r) {
2412
+ let i = !t;
2413
+ i && (t = V({
2414
+ root: e,
2415
+ base: n.base || "",
2416
+ fetch: n.fetch,
2417
+ strings: n.strings
2418
+ }));
2419
+ let a = U(t), o = () => {};
2420
+ if (a) try {
2421
+ o = t.attach(e);
2422
+ } catch {
2423
+ return r && r.destroy(), _n(e, t, a);
2424
+ }
2425
+ let { state: s } = t, c = a ? a.source : null;
2426
+ if (n.tokens) {
2427
+ let t = vn(e);
2428
+ t && ae(t.nodeType === 9 ? t : t.ownerDocument, n.tokens), t && t.nodeType === 11 && ae(t, n.tokens);
2429
+ }
2430
+ let l = ne(t);
2431
+ l.own(o), r && l.own(() => r.destroy());
2432
+ let u = (e) => e === "canvas2d" ? "canvas2d" : "auto", d = (e) => e === "light" || e === "dark" ? e : "auto", f = {
2433
+ renderer: u(n.renderer),
2434
+ theme: d(n.theme),
2435
+ topology: void 0
2436
+ }, p = n.topology !== void 0 && n.topology !== null, m = !1, h = !1, g = gn({ keysHelp: n.keysHelp }).stage, _ = n.slots && n.slots.stage ? n.slots : null, v = j(t, e, _ ? g : `<div data-corn="map-stage">${g}</div>`, _, "stage"), y = (e) => v.map((t) => t.matches(e) ? t : t.querySelector(e)).find(Boolean);
2437
+ l.own(() => {
2438
+ for (let e of [...v, s.canvas]) e && e.remove();
2439
+ });
2440
+ let b = v.find((e) => e.matches("[data-corn=\"map-stage\"]")) || null;
2441
+ if (c && b) {
2442
+ let e = a.mountStatus(b, t, {
2443
+ onRetry: () => c.load(),
2444
+ focusMap: () => {
2445
+ s.canvas && s.canvas.focus();
2446
+ }
2447
+ });
2448
+ l.own(e.destroy);
2449
+ }
2450
+ s.canvas = y("[data-corn=\"map-canvas\"]"), s.labelCanvas = y("[data-corn=\"label-canvas\"]"), s.ctx = t.doc.createElement("canvas").getContext("2d");
2451
+ let x = mt(t, n.measureCovered ? { measureCovered: n.measureCovered } : {}), S = ue(t);
2452
+ l.own(S.watch()), l.own(S.onChange(() => x.render()));
2453
+ let C = () => f.renderer === "canvas2d" ? "canvas2d" : null, w = () => x.setRenderer(dn(s.canvas, {
2454
+ prefer: C(),
2455
+ mapStyle: S.get
2456
+ })), T = t.win && t.win.matchMedia ? t.win.matchMedia("(prefers-color-scheme: light)") : null;
2457
+ function E() {
2458
+ if (f.theme === "light" || f.theme === "dark") return f.theme;
2459
+ if (a && (a.theme === "light" || a.theme === "dark")) return a.theme;
2460
+ let e = t.doc && t.doc.documentElement, n = e ? e.getAttribute("data-theme") : null;
2461
+ return n === "light" || n === "dark" ? n : ie("system", !!(T && T.matches));
2462
+ }
2463
+ function D() {
2464
+ if (m) return;
2465
+ let e = E();
2466
+ S.refresh(), s.theme !== e && (s.theme = e, t.touchScene()), x.render();
2467
+ }
2468
+ s.theme = E(), a && l.own(a.serverTheme.adopt(e)), a && (l.on("theme", () => D()), l.on("scope:theme", () => D())), T && T.addEventListener && (T.addEventListener("change", D), l.own(() => T.removeEventListener("change", D)));
2469
+ let O = t.win && t.win.MutationObserver;
2470
+ if (O && t.doc && t.doc.documentElement) {
2471
+ let e = new O(D);
2472
+ e.observe(t.doc.documentElement, {
2473
+ attributes: !0,
2474
+ attributeFilter: ["data-theme", "class"]
2475
+ }), l.own(() => e.disconnect());
2476
+ }
2477
+ w();
2478
+ let k = () => vt(t), A = !1, M = () => {
2479
+ s.nodes.length && (A = !s.width || !s.height, A || x.fitGraphToViewport(x.fitPadding()));
2480
+ }, P = (e) => s.nodes.find((t) => t.id === e) || null, I = null;
2481
+ l.on("select", (e) => B(t, e, { source: "tap" })), l.on("background", () => re(t, { source: "tap" })), l.on("grab", () => ee(t)), l.on("selection", ({ node: e, edge: t, source: r }) => {
2482
+ m || ((e || t) && (I = null), n.onSelect && (e ? n.onSelect({
2483
+ id: e.id,
2484
+ kind: "node",
2485
+ source: r
2486
+ }) : t ? n.onSelect({
2487
+ id: `${t.from}->${t.to}`,
2488
+ kind: "edge",
2489
+ from: t.from,
2490
+ to: t.to,
2491
+ source: r
2492
+ }) : n.onSelect({
2493
+ id: null,
2494
+ kind: null,
2495
+ source: r
2496
+ })));
2497
+ });
2498
+ function te(e) {
2499
+ let n = P(String(e));
2500
+ return !n || m ? !1 : (B(t, n, {
2501
+ frame: !0,
2502
+ source: "api"
2503
+ }), !0);
2504
+ }
2505
+ let L = () => {}, R = !!t.root && t.root.nodeType === 9;
2506
+ function z() {
2507
+ let e = s.canvas, n = [pn(t)];
2508
+ R || n.push(t.listen(e, "pointerdown", (t) => {
2509
+ if (t.pointerType === "mouse" && e.setPointerCapture) try {
2510
+ e.setPointerCapture(t.pointerId);
2511
+ } catch {}
2512
+ })), F(t), N(t), n.push(() => F(t)), L = () => n.forEach((e) => e());
2513
+ }
2514
+ l.own(x.onPaint(() => {
2515
+ A && s.width && s.height && M(), !h && s.nodes.length && (h = !0, n.onReady && n.onReady());
2516
+ })), z(), l.own(() => L());
2517
+ let H = () => {
2518
+ !p && c && c.topology && c.topology !== f.topology && (f.topology = c.topology, W(c.topology));
2519
+ };
2520
+ c && l.on("source", (e) => {
2521
+ e.state === "ready" && H();
2522
+ }), l.own(x.watchSize()), x.resize();
2523
+ function W(e) {
2524
+ let n = s.selectedNode ? s.selectedNode.id : null;
2525
+ _t(t, e);
2526
+ let r = n ? P(n) : null;
2527
+ s.nodes.length && (k(), M());
2528
+ let i = !r && I ? P(I) : null;
2529
+ i && B(t, i, { source: "api" }), x.render(), x.ensureFlowLoop();
2530
+ }
2531
+ function G(e) {
2532
+ let n = e === "dataflow" ? "dataflow" : "orbit";
2533
+ s.view !== n && (s.view = n, t.touchScene(), s.nodes.length && (k(), M(), x.ensureFlowLoop()));
2534
+ }
2535
+ function oe() {
2536
+ let e = x.getRenderer();
2537
+ e.release ? e.release() : e.destroy(), L();
2538
+ let n = t.doc.createElement("template");
2539
+ n.innerHTML = hn;
2540
+ let r = n.content.firstElementChild;
2541
+ r.setAttribute("part", "map-canvas");
2542
+ let i = t.active() === s.canvas;
2543
+ s.canvas.replaceWith(r), s.canvas = r, z(), w(), x.resize(), i && r.focus();
2544
+ }
2545
+ function se(e = {}) {
2546
+ if (!m) {
2547
+ if ("renderer" in e) {
2548
+ let t = u(e.renderer);
2549
+ t !== f.renderer && (f.renderer = t, oe());
2550
+ }
2551
+ if ("theme" in e) {
2552
+ let t = d(e.theme);
2553
+ t !== f.theme && (f.theme = t, D());
2554
+ }
2555
+ if ("topology" in e && (p = e.topology !== void 0 && e.topology !== null, p && e.topology !== f.topology ? (f.topology = e.topology, W(e.topology)) : !p && c && c.topology ? (f.topology = void 0, H()) : !p && e.topology !== f.topology && (f.topology = e.topology, W(e.topology))), "view" in e && G(e.view === "dataflow" ? "dataflow" : "orbit"), "node" in e) {
2556
+ let n = e.node == null || e.node === "" ? null : String(e.node);
2557
+ if (n === null) I = null, (s.selectedNode || s.selectedEdge) && re(t, { source: "api" });
2558
+ else {
2559
+ let e = P(n);
2560
+ e ? s.selectedNode && s.selectedNode.id === n || B(t, e, { source: "api" }) : I = n;
2561
+ }
2562
+ }
2563
+ }
2564
+ }
2565
+ function ce() {
2566
+ m || (m = !0, l.destroy(), x.destroy(), i && t.destroy());
2567
+ }
2568
+ let le = {};
2569
+ for (let e of [
2570
+ "topology",
2571
+ "view",
2572
+ "node"
2573
+ ]) n[e] !== void 0 && (le[e] = n[e]);
2574
+ return se(le), H(), D(), {
2575
+ inst: t,
2576
+ map: x,
2577
+ update: se,
2578
+ destroy: ce,
2579
+ fit: M,
2580
+ focusNode: te,
2581
+ refresh: D,
2582
+ applyTheme: (e) => S.applyTheme(e)
2583
+ };
2584
+ }
2585
+ // \0stencil-css:/home/runner/work/CornField/CornField/explorer/pieces/map-stage?tag=corn-map&encapsulation=shadow&__ext=css
2586
+ var Sn = () => "[data-corn=map-stage]{background:var(--corn-ground-image), var(--corn-ground);width:100%;height:100%;min-height:16rem;display:block;position:relative;overflow:hidden}[data-corn=map-canvas]{cursor:grab;touch-action:none;width:100%;height:100%;display:block;position:absolute;inset:0}[data-corn=map-canvas]:active{cursor:grabbing}[data-corn=map-canvas]:focus-visible{outline:var(--corn-focus-width) solid var(--corn-focus);outline-offset:calc(var(--corn-focus-width) * -1)}[data-corn=label-canvas]{pointer-events:none;width:100%;height:100%;position:absolute;inset:0}[data-corn=map-overlay]{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0}.hx-sr-only{clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;overflow:hidden;position:absolute!important}", Cn = () => "[data-corn=source-status]{z-index:2;box-sizing:border-box;align-items:center;gap:var(--corn-space-3);width:min(26rem, calc(100% - var(--corn-space-6) * 2));padding:var(--corn-space-6);border:var(--corn-border) solid var(--corn-line);border-radius:var(--corn-radius-lg);background:var(--corn-surface-1);color:var(--corn-text-2);box-shadow:var(--corn-shadow);text-align:center;font-family:var(--corn-font);font-size:var(--corn-text-md);flex-direction:column;line-height:1.5;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}[data-corn=source-status][hidden]{display:none}[data-corn=source-status]:focus-visible{outline:var(--corn-focus-width) solid var(--corn-focus);outline-offset:var(--corn-focus-offset)}[data-corn=source-status][data-corn-state=running]{box-shadow:none;color:var(--corn-text-3);background:0 0;border-color:#0000;padding:0}[data-corn=source-status][data-corn-state=running] [data-corn=source-title]{font-size:var(--corn-text-md);color:var(--corn-text-3);font-weight:400}[data-corn=source-status][data-corn-state=failure] [data-corn=source-title]{color:var(--corn-bad)}[data-corn=source-status][data-corn-state=waiting] [data-corn=source-title]{color:var(--corn-accent-text)}[data-corn=source-title],[data-corn=source-text]{margin:0}[data-corn=source-title]{font-size:var(--corn-text-lg);color:var(--corn-text);font-weight:600}[data-corn=source-text]{overflow-wrap:anywhere;user-select:text}[data-corn=source-origin]{font-family:var(--corn-mono);color:var(--corn-warn);overflow-wrap:anywhere;user-select:all}[data-corn=source-sign-in],[data-corn=source-retry]{box-sizing:border-box;min-height:max(var(--corn-control-height), 2.75rem);padding:0 var(--corn-space-6);border:var(--corn-border) solid var(--corn-line);border-radius:var(--corn-radius);background:var(--corn-surface-2);color:var(--corn-text);font-family:inherit;font-size:inherit;cursor:pointer;justify-content:center;align-items:center;text-decoration:none;display:inline-flex}[data-corn=source-sign-in]{border-color:var(--corn-accent);background:var(--corn-accent);color:var(--corn-text-on-accent);font-weight:600}[data-corn=source-sign-in]:hover{background:var(--corn-accent-hover)}[data-corn=source-retry]:hover{background:var(--corn-surface-3)}[data-corn=source-sign-in]:focus-visible,[data-corn=source-retry]:focus-visible{outline:var(--corn-focus-width) solid var(--corn-focus);outline-offset:var(--corn-focus-offset)}[data-corn=source-notice]{z-index:2;box-sizing:border-box;padding:var(--corn-space-3) var(--corn-space-6);background:var(--corn-surface-1);border-top:var(--corn-border) solid var(--corn-line-soft);color:var(--corn-text-2);font-family:var(--corn-font);font-size:var(--corn-text-sm);text-align:center;overflow-wrap:anywhere;margin:0;position:absolute;bottom:0;left:0;right:0}[data-corn=source-notice][hidden]{display:none}", wn = () => ":host{contain:layout;min-width:0;color:var(--corn-text);font-family:var(--corn-font);display:block;position:relative}:host([hidden]){display:none!important}", Tn = class extends n {
2587
+ constructor(t) {
2588
+ super(), t !== !1 && this.__registerHost(), this.__attachShadow(), this.cornSelect = e(this, "cornSelect", 7), this.cornReady = e(this, "cornReady", 7), this.cornAuth = e(this, "cornAuth", 7), this.cornError = e(this, "cornError", 7);
2589
+ }
2590
+ get el() {
2591
+ return this;
2592
+ }
2593
+ topology;
2594
+ node;
2595
+ view = "map";
2596
+ theme;
2597
+ renderer = "auto";
2598
+ src;
2599
+ useTheme = !1;
2600
+ cornSelect;
2601
+ cornReady;
2602
+ cornAuth;
2603
+ cornError;
2604
+ piece = null;
2605
+ scope = null;
2606
+ loaded = !1;
2607
+ changes = {};
2608
+ connectedCallback() {
2609
+ this.loaded && this.mountPiece();
2610
+ }
2611
+ componentDidLoad() {
2612
+ this.loaded = !0, this.mountPiece();
2613
+ }
2614
+ disconnectedCallback() {
2615
+ this.unmountPiece();
2616
+ }
2617
+ unmountPiece() {
2618
+ this.piece && this.piece.destroy(), this.piece = null, this.scope && this.scope.leave(), this.scope = null;
2619
+ }
2620
+ remount() {
2621
+ this.unmountPiece(), this.loaded && this.el.isConnected && this.mountPiece();
2622
+ }
2623
+ mountPiece() {
2624
+ !this.piece && this.el.shadowRoot && (this.changes = {}, this.scope = k(this.el, () => this.remount()), this.piece = yn(this.el.shadowRoot, this.scope.inst, {
2625
+ topology: this.topology,
2626
+ view: this.view,
2627
+ node: this.node,
2628
+ theme: this.theme,
2629
+ renderer: this.renderer,
2630
+ tokens: oe,
2631
+ src: this.src,
2632
+ useTheme: this.useTheme,
2633
+ version: "0.50.0",
2634
+ pageUrl: () => typeof location > "u" ? "" : location.href,
2635
+ onAuth: (e) => this.cornAuth.emit(e),
2636
+ onError: (e) => this.cornError.emit(e),
2637
+ onSelect: (e) => {
2638
+ this.node = e.kind === "node" ? e.id : null, delete this.changes.node, this.cornSelect.emit(e);
2639
+ },
2640
+ onReady: () => this.cornReady.emit()
2641
+ }));
2642
+ }
2643
+ componentDidRender() {
2644
+ let e = this.changes;
2645
+ this.changes = {}, this.piece && Object.keys(e).length && this.piece.update(e);
2646
+ }
2647
+ changed(e, t, n) {
2648
+ this.changes[n] = e;
2649
+ }
2650
+ addressChanged() {
2651
+ this.piece && this.scope && !this.scope.inst && this.remount();
2652
+ }
2653
+ async fit() {
2654
+ this.piece && this.piece.fit();
2655
+ }
2656
+ async focusNode(e) {
2657
+ this.piece && this.piece.focusNode(e);
2658
+ }
2659
+ async refresh() {
2660
+ this.piece && this.piece.refresh();
2661
+ }
2662
+ static get watchers() {
2663
+ return {
2664
+ topology: [{ changed: 0 }],
2665
+ view: [{ changed: 0 }],
2666
+ node: [{ changed: 0 }],
2667
+ theme: [{ changed: 0 }],
2668
+ renderer: [{ changed: 0 }],
2669
+ src: [{ addressChanged: 0 }],
2670
+ useTheme: [{ addressChanged: 0 }]
2671
+ };
2672
+ }
2673
+ static get style() {
2674
+ return Sn() + Cn() + wn();
2675
+ }
2676
+ };
2677
+ t(Tn, [
2678
+ 513,
2679
+ "corn-map",
2680
+ {
2681
+ topology: [16],
2682
+ node: [1537],
2683
+ view: [1],
2684
+ theme: [513],
2685
+ renderer: [1],
2686
+ src: [1],
2687
+ useTheme: [4, "use-theme"],
2688
+ fit: [64],
2689
+ focusNode: [64],
2690
+ refresh: [64]
2691
+ },
2692
+ void 0,
2693
+ {
2694
+ topology: [{ changed: 0 }],
2695
+ view: [{ changed: 0 }],
2696
+ node: [{ changed: 0 }],
2697
+ theme: [{ changed: 0 }],
2698
+ renderer: [{ changed: 0 }],
2699
+ src: [{ addressChanged: 0 }],
2700
+ useTheme: [{ addressChanged: 0 }]
2701
+ }
2702
+ ]);
2703
+ export { Tn as t };