@peasant-labs/fairtrade 0.0.41 → 0.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib/graph.js CHANGED
@@ -1,20 +1,20 @@
1
- import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as A, c as j, ct as M, et as N, f as P, g as F, gt as I, i as ee, it as te, j as ne, k as re, l as ie, lt as ae, m as oe, n as se, o as ce, ot as le, pt as ue, q as de, r as fe, rt as pe, s as me, st as he, t as ge, tt as _e, v as ve, vt as ye, w as be, wt as xe, x as Se, y as Ce, z as we } from "./GraphLegend-CBKZsRta.js";
2
- import { p as Te } from "./time-CpVBzcqQ.js";
3
- import { a as Ee, n as De, r as Oe } from "./format-B3uT2wzU.js";
4
- import { memo as ke, useCallback as L, useEffect as R, useMemo as z, useRef as B, useState as V } from "react";
5
- import { Fragment as Ae, jsx as H, jsxs as U } from "react/jsx-runtime";
6
- import { Box as je, Check as Me, ChevronDown as Ne, ChevronRight as W, Coins as Pe, CornerDownRight as Fe, FileCode as Ie, FileDiff as Le, FileText as Re, Folder as ze, GitMerge as Be, Hash as Ve, Map as He, Maximize2 as Ue, MessageSquare as We, Minus as Ge, Plus as Ke, RotateCcw as qe, RotateCw as Je, Search as Ye, Share2 as Xe, Star as Ze, Tag as Qe, TriangleAlert as $e, X as et } from "lucide-react";
7
- import { AllChangeBindings as tt, AllDiffLineKinds as nt, AllEdgeViolationKinds as rt, AllFileChangeStatuses as it, AllInsightKinds as at, AllInsightProvenances as ot, AllMapNodeKinds as st, AllReadAttributionStates as ct, AllReadStateGrades as lt, ChangeBinding as ut, DiffLineKind as dt, EdgeViolationKind as ft, FileChangeStatus as pt, InsightKind as mt, InsightProvenance as ht, MapNodeKind as gt, ReadAttributionState as _t, ReadStateGrade as vt, isChangeBinding as yt, isDiffLineKind as bt, isEdgeViolationKind as xt, isFileChangeStatus as St, isInsightKind as Ct, isInsightProvenance as wt, isMapNodeKind as Tt, isReadAttributionState as Et, isReadStateGrade as Dt } from "@peasant-labs/schema";
8
- import { Background as Ot, BackgroundVariant as kt, Handle as G, MiniMap as At, Position as K, ReactFlow as jt, ReactFlowProvider as Mt, useEdgesState as Nt, useNodesState as Pt, useReactFlow as Ft } from "@xyflow/react";
1
+ import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as A, c as j, ct as M, et as N, f as P, g as F, gt as I, i as L, it as ee, j as te, k as ne, l as re, lt as ie, m as ae, n as oe, o as se, ot as ce, pt as le, q as ue, r as de, rt as fe, s as pe, st as me, t as he, tt as ge, v as _e, vt as ve, w as ye, wt as be, x as xe, y as Se, z as Ce } from "./GraphLegend-e9x79JtU.js";
2
+ import { p as we } from "./time-CpVBzcqQ.js";
3
+ import { a as Te, n as Ee, r as De } from "./format-B3uT2wzU.js";
4
+ import { memo as Oe, useCallback as R, useEffect as z, useMemo as B, useRef as V, useState as H } from "react";
5
+ import { Fragment as ke, jsx as U, jsxs as W } from "react/jsx-runtime";
6
+ import { Box as Ae, Check as je, ChevronDown as Me, ChevronRight as G, Coins as Ne, CornerDownRight as Pe, FileCode as Fe, FileDiff as Ie, FileText as Le, Folder as Re, GitMerge as ze, Hash as Be, Map as Ve, Maximize2 as He, MessageSquare as Ue, Minus as We, Plus as Ge, RotateCcw as Ke, RotateCw as qe, Search as Je, Share2 as Ye, Star as Xe, Tag as Ze, TriangleAlert as Qe, X as $e } from "lucide-react";
7
+ import { AllChangeBindings as et, AllDiffLineKinds as tt, AllEdgeViolationKinds as nt, AllFileChangeStatuses as rt, AllInsightKinds as it, AllInsightProvenances as at, AllMapNodeKinds as ot, AllReadAttributionStates as st, AllReadStateGrades as ct, ChangeBinding as lt, DiffLineKind as ut, EdgeViolationKind as dt, FileChangeStatus as ft, InsightKind as pt, InsightProvenance as mt, MapNodeKind as ht, ReadAttributionState as gt, ReadStateGrade as _t, isChangeBinding as vt, isDiffLineKind as yt, isEdgeViolationKind as bt, isFileChangeStatus as xt, isInsightKind as St, isInsightProvenance as Ct, isMapNodeKind as wt, isReadAttributionState as Tt, isReadStateGrade as Et } from "@peasant-labs/schema";
8
+ import { Background as Dt, BackgroundVariant as Ot, Handle as K, MiniMap as kt, Position as q, ReactFlow as At, ReactFlowProvider as jt, useEdgesState as Mt, useNodesState as Nt, useReactFlow as Pt } from "@xyflow/react";
9
9
  //#region src/ui/graph/changeGraph.js
10
- var It = 6e4, Lt = 60 * It, Rt = 24 * Lt, zt = 7 * Rt;
11
- function q(e, t) {
10
+ var Ft = 6e4, It = 60 * Ft, Lt = 24 * It, Rt = 7 * Lt;
11
+ function J(e, t) {
12
12
  if (e == null) return "";
13
13
  let n = Math.max(0, t - e);
14
- return n < Lt ? `${Math.max(1, Math.floor(n / It))}m ago` : n < Rt ? `${Math.floor(n / Lt)}h ago` : n < zt ? `${Math.floor(n / Rt)}d ago` : `${Math.floor(n / zt)}wk ago`;
14
+ return n < It ? `${Math.max(1, Math.floor(n / Ft))}m ago` : n < Lt ? `${Math.floor(n / It)}h ago` : n < Rt ? `${Math.floor(n / Lt)}d ago` : `${Math.floor(n / Rt)}wk ago`;
15
15
  }
16
- function Bt(e, { nowMs: t }) {
17
- let n = e.recentCommits ?? [], r = e.changes ?? [], i = e.defaultBranch, a = e.sessions ?? [], o = new Map(a.map((e) => [e.sessionId, e])), s = new Set(n.flatMap((e) => e.sessionIds ?? [])), c = r.filter((e) => !e.merged).slice().sort((e, t) => Vt(t) - Vt(e) || e.branch.localeCompare(t.branch)), l = r.filter((e) => e.merged && !e.reverted), u = r.filter((e) => e.merged && e.reverted), d = new Map(l.filter((e) => e.mergeCommitHash).map((e) => [e.mergeCommitHash, e])), f = c.map((e, t) => ({
16
+ function zt(e, { nowMs: t }) {
17
+ let n = e.recentCommits ?? [], r = e.changes ?? [], i = e.defaultBranch, a = e.sessions ?? [], o = new Map(a.map((e) => [e.sessionId, e])), s = new Set(n.flatMap((e) => e.sessionIds ?? [])), c = r.filter((e) => !e.merged).slice().sort((e, t) => Bt(t) - Bt(e) || e.branch.localeCompare(t.branch)), l = r.filter((e) => e.merged && !e.reverted), u = r.filter((e) => e.merged && e.reverted), d = new Map(l.filter((e) => e.mergeCommitHash).map((e) => [e.mergeCommitHash, e])), f = c.map((e, t) => ({
18
18
  change: e,
19
19
  lane: t + 1,
20
20
  baseHash: e.baseHash,
@@ -34,7 +34,7 @@ function Bt(e, { nowMs: t }) {
34
34
  branch: i.branch,
35
35
  session: (i.sessionCount ?? 0) > 0,
36
36
  tip: !0,
37
- time: q(n.tipMs, t)
37
+ time: J(n.tipMs, t)
38
38
  });
39
39
  }
40
40
  };
@@ -53,13 +53,13 @@ function Bt(e, { nowMs: t }) {
53
53
  return t ? [t] : [];
54
54
  }),
55
55
  merged: c ? !0 : void 0,
56
- time: q(e.timeMs, t)
56
+ time: J(e.timeMs, t)
57
57
  });
58
58
  }), h(-Infinity);
59
59
  let g = u.map((e) => ({
60
60
  branch: e.branch,
61
61
  mergedAtMs: e.mergedAtMs ?? null,
62
- when: q(e.mergedAtMs, t)
62
+ when: J(e.mergedAtMs, t)
63
63
  })), _ = a.filter((e) => e.hasCommitBinding === !0 && !s.has(e.sessionId));
64
64
  return {
65
65
  commits: p,
@@ -70,33 +70,33 @@ function Bt(e, { nowMs: t }) {
70
70
  outsideWindowSessions: _
71
71
  };
72
72
  }
73
- function Vt(e) {
73
+ function Bt(e) {
74
74
  return e.tipCommitMs ?? Infinity;
75
75
  }
76
76
  //#endregion
77
77
  //#region src/ui/graph/Changes.jsx
78
- function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelectChange: i, onOpenMap: a, hasMore: o = !1, onShowOlder: s, onOpenSession: c, nowMs: l, headerActions: u }) {
79
- let d = l ?? Date.now(), { commits: f, reverted: p, unlinkedSessions: m, outsideWindowSessions: h, openCount: g, mergedCount: _ } = z(() => Bt(e, { nowMs: d }), [e, d]), v = e.defaultBranch, y = z(() => new Set(f.filter((e) => (e.sessionRefs?.length ?? 0) > 2).map((e) => e.id)), [f]), [b, x] = V([]);
80
- R(() => {
78
+ function Vt({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelectChange: i, onOpenMap: a, hasMore: o = !1, onShowOlder: s, onOpenSession: c, nowMs: l, headerActions: u }) {
79
+ let d = l ?? Date.now(), { commits: f, reverted: p, unlinkedSessions: m, outsideWindowSessions: h, openCount: g, mergedCount: _ } = B(() => zt(e, { nowMs: d }), [e, d]), v = e.defaultBranch, y = B(() => new Set(f.filter((e) => (e.sessionRefs?.length ?? 0) > 2).map((e) => e.id)), [f]), [b, x] = H([]);
80
+ z(() => {
81
81
  x((e) => {
82
82
  let t = e.filter((e) => y.has(e));
83
83
  return t.length === e.length ? e : t;
84
84
  });
85
85
  }, [y]);
86
- let S = L((e) => {
86
+ let S = R((e) => {
87
87
  y.has(e) && x((t) => {
88
88
  let n = new Set(t);
89
89
  return n.has(e) ? n.delete(e) : n.add(e), [...n];
90
90
  });
91
91
  }, [y]);
92
- return /* @__PURE__ */ U("div", {
92
+ return /* @__PURE__ */ W("div", {
93
93
  className: "gmp-root gmp-changes-root",
94
- children: [/* @__PURE__ */ U("div", {
94
+ children: [/* @__PURE__ */ W("div", {
95
95
  className: "gmp-changes-head",
96
- children: [/* @__PURE__ */ U("div", { children: [t && /* @__PURE__ */ U("span", {
96
+ children: [/* @__PURE__ */ W("div", { children: [t && /* @__PURE__ */ W("span", {
97
97
  className: "label",
98
98
  children: ["lines of work, ", t]
99
- }), /* @__PURE__ */ U("div", {
99
+ }), /* @__PURE__ */ W("div", {
100
100
  className: "gmp-changes-sub mono",
101
101
  children: [
102
102
  v ? `default branch ${v}, ` : "",
@@ -105,24 +105,24 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
105
105
  _,
106
106
  " merged"
107
107
  ]
108
- })] }), /* @__PURE__ */ U("div", {
108
+ })] }), /* @__PURE__ */ W("div", {
109
109
  className: "gmp-head-actions",
110
- children: [u, /* @__PURE__ */ U("button", {
110
+ children: [u, /* @__PURE__ */ W("button", {
111
111
  type: "button",
112
112
  className: "btn btn-secondary btn-sm",
113
113
  onClick: () => {
114
114
  r ? r({ type: "open-map" }) : a?.();
115
115
  },
116
- children: [/* @__PURE__ */ H(je, {
116
+ children: [/* @__PURE__ */ U(Ae, {
117
117
  size: 14,
118
118
  "aria-hidden": "true"
119
119
  }), " open the map"]
120
120
  })]
121
121
  })]
122
- }), /* @__PURE__ */ U("div", {
122
+ }), /* @__PURE__ */ W("div", {
123
123
  className: "gmp-changes-body",
124
124
  children: [
125
- /* @__PURE__ */ H(pe, {
125
+ /* @__PURE__ */ U(fe, {
126
126
  className: "gmp-cg",
127
127
  commits: f,
128
128
  selectedId: n,
@@ -135,16 +135,16 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
135
135
  expandedCommitSessions: b,
136
136
  onToggleCommitSessions: S
137
137
  }),
138
- m.length > 0 && /* @__PURE__ */ U("section", {
138
+ m.length > 0 && /* @__PURE__ */ W("section", {
139
139
  className: "gmp-unlinked-sessions",
140
140
  "aria-labelledby": "gmp-unlinked-sessions-heading",
141
- children: [/* @__PURE__ */ H("h2", {
141
+ children: [/* @__PURE__ */ U("h2", {
142
142
  id: "gmp-unlinked-sessions-heading",
143
143
  className: "sb-head gmp-unlinked-sessions-head",
144
144
  children: "sessions not linked to a commit"
145
- }), /* @__PURE__ */ H("div", {
145
+ }), /* @__PURE__ */ U("div", {
146
146
  className: "gmp-unlinked-sessions-list",
147
- children: m.map((e) => /* @__PURE__ */ U("button", {
147
+ children: m.map((e) => /* @__PURE__ */ W("button", {
148
148
  type: "button",
149
149
  className: "gmp-unlinked-session",
150
150
  onClick: () => {
@@ -154,20 +154,20 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
154
154
  source: { kind: "unlinked" }
155
155
  }) : c?.(e.sessionId);
156
156
  },
157
- children: [/* @__PURE__ */ H(ue, { harness: e.harness }), /* @__PURE__ */ H("span", { children: e.title || e.sessionId })]
157
+ children: [/* @__PURE__ */ U(le, { harness: e.harness }), /* @__PURE__ */ U("span", { children: e.title || e.sessionId })]
158
158
  }, e.sessionId))
159
159
  })]
160
160
  }),
161
- h.length > 0 && /* @__PURE__ */ U("section", {
161
+ h.length > 0 && /* @__PURE__ */ W("section", {
162
162
  className: "gmp-unlinked-sessions",
163
163
  "aria-labelledby": "gmp-outside-window-sessions-heading",
164
- children: [/* @__PURE__ */ H("h2", {
164
+ children: [/* @__PURE__ */ U("h2", {
165
165
  id: "gmp-outside-window-sessions-heading",
166
166
  className: "sb-head gmp-unlinked-sessions-head",
167
167
  children: "sessions linked outside this visible commit window"
168
- }), /* @__PURE__ */ H("div", {
168
+ }), /* @__PURE__ */ U("div", {
169
169
  className: "gmp-unlinked-sessions-list",
170
- children: h.map((e) => /* @__PURE__ */ U("button", {
170
+ children: h.map((e) => /* @__PURE__ */ W("button", {
171
171
  type: "button",
172
172
  className: "gmp-unlinked-session",
173
173
  onClick: () => {
@@ -177,18 +177,18 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
177
177
  source: { kind: "outside-window" }
178
178
  }) : c?.(e.sessionId);
179
179
  },
180
- children: [/* @__PURE__ */ H(ue, { harness: e.harness }), /* @__PURE__ */ H("span", { children: e.title || e.sessionId })]
180
+ children: [/* @__PURE__ */ U(le, { harness: e.harness }), /* @__PURE__ */ U("span", { children: e.title || e.sessionId })]
181
181
  }, e.sessionId))
182
182
  })]
183
183
  }),
184
- p.length > 0 && /* @__PURE__ */ U("div", {
184
+ p.length > 0 && /* @__PURE__ */ W("div", {
185
185
  className: "gmp-merged-sec",
186
- children: [/* @__PURE__ */ H("div", {
186
+ children: [/* @__PURE__ */ U("div", {
187
187
  className: "sb-head gmp-merged-head",
188
188
  children: "already merged in"
189
- }), /* @__PURE__ */ H("div", {
189
+ }), /* @__PURE__ */ U("div", {
190
190
  className: "gmp-merged-list",
191
- children: p.map((e) => /* @__PURE__ */ U("button", {
191
+ children: p.map((e) => /* @__PURE__ */ W("button", {
192
192
  type: "button",
193
193
  className: "gmp-merged-chip gmp-merged-revert",
194
194
  onClick: () => {
@@ -205,7 +205,7 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
205
205
  }) : i?.(t);
206
206
  },
207
207
  children: [
208
- /* @__PURE__ */ H(Be, {
208
+ /* @__PURE__ */ U(ze, {
209
209
  size: 14,
210
210
  "aria-hidden": "true"
211
211
  }),
@@ -217,23 +217,23 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
217
217
  }, e.branch))
218
218
  })]
219
219
  }),
220
- /* @__PURE__ */ U("div", {
220
+ /* @__PURE__ */ W("div", {
221
221
  className: "gmp-changes-legend",
222
222
  children: [
223
- /* @__PURE__ */ U("span", {
223
+ /* @__PURE__ */ W("span", {
224
224
  className: "gmp-legend-item",
225
- children: [/* @__PURE__ */ H("span", {
225
+ children: [/* @__PURE__ */ U("span", {
226
226
  className: "cg-dot cg-dot-filled",
227
227
  "aria-hidden": "true",
228
- children: /* @__PURE__ */ H(Ze, {
228
+ children: /* @__PURE__ */ U(Xe, {
229
229
  className: "cg-spark",
230
230
  "aria-hidden": "true"
231
231
  })
232
232
  }), " commit with a recorded session"]
233
233
  }),
234
- /* @__PURE__ */ U("span", {
234
+ /* @__PURE__ */ W("span", {
235
235
  className: "gmp-legend-item",
236
- children: [/* @__PURE__ */ H("span", {
236
+ children: [/* @__PURE__ */ U("span", {
237
237
  className: "cg-dot cg-dot-hollow",
238
238
  style: {
239
239
  width: 9,
@@ -242,7 +242,7 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
242
242
  "aria-hidden": "true"
243
243
  }), " no session captured"]
244
244
  }),
245
- /* @__PURE__ */ H("span", {
245
+ /* @__PURE__ */ U("span", {
246
246
  className: "gmp-legend-item gmp-legend-dim",
247
247
  children: "a star marks a recorded session, select a commit to open it"
248
248
  })
@@ -254,29 +254,29 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
254
254
  }
255
255
  //#endregion
256
256
  //#region src/ui/graph/ChangeDetail.jsx
257
- var Ut = {
257
+ var Ht = {
258
258
  M: "changed",
259
259
  A: "added",
260
260
  D: "deleted",
261
261
  R: "renamed"
262
- }, Wt = {
262
+ }, Ut = {
263
263
  A: "chip-ok",
264
264
  M: "",
265
265
  D: "chip-err",
266
266
  R: "chip-warn"
267
- }, Gt = {
267
+ }, Wt = {
268
268
  context: "ctx",
269
269
  add: "add",
270
270
  del: "del"
271
271
  };
272
- function Kt(e) {
272
+ function Gt(e) {
273
273
  let t = (e.split("/").pop() ?? e).replace(/[-_]+/g, " ").trim();
274
274
  return t.charAt(0).toUpperCase() + t.slice(1);
275
275
  }
276
- var qt = (e) => e >= 1e3 ? `≈${Oe(e)}` : Oe(e);
277
- function Jt(e) {
276
+ var Kt = (e) => e >= 1e3 ? `≈${De(e)}` : De(e);
277
+ function qt(e) {
278
278
  let t = e.oldStart, n = e.newStart, r = e.lines.map((e) => {
279
- let r = Gt[e.kind] ?? "ctx";
279
+ let r = Wt[e.kind] ?? "ctx";
280
280
  return r === "add" ? {
281
281
  type: r,
282
282
  newNo: n++,
@@ -297,99 +297,99 @@ function Jt(e) {
297
297
  lines: r
298
298
  };
299
299
  }
300
- function Yt({ file: t, diff: n, open: r, onToggle: i }) {
300
+ function Jt({ file: t, diff: n, open: r, onToggle: i }) {
301
301
  n && e(n);
302
302
  let a = t.status, o = n ? new Set(n.hunks.map((e) => e.sessionId).filter(Boolean)).size : null;
303
- return /* @__PURE__ */ U("div", {
303
+ return /* @__PURE__ */ W("div", {
304
304
  className: "gmp-file",
305
- children: [/* @__PURE__ */ U("button", {
305
+ children: [/* @__PURE__ */ W("button", {
306
306
  type: "button",
307
307
  className: "gmp-file-head",
308
308
  "aria-expanded": r,
309
309
  onClick: i,
310
310
  children: [
311
- H(r ? Ne : W, {
311
+ U(r ? Me : G, {
312
312
  size: 14,
313
313
  "aria-hidden": "true"
314
314
  }),
315
- /* @__PURE__ */ H("span", {
315
+ /* @__PURE__ */ U("span", {
316
316
  className: "mono gmp-file-path",
317
317
  children: t.path
318
318
  }),
319
- /* @__PURE__ */ H("span", {
320
- className: "chip gmp-file-status " + (Wt[a] ?? ""),
321
- children: Ut[a] ?? a
319
+ /* @__PURE__ */ U("span", {
320
+ className: "chip gmp-file-status " + (Ut[a] ?? ""),
321
+ children: Ht[a] ?? a
322
322
  }),
323
- o != null && o > 0 && /* @__PURE__ */ U("span", {
323
+ o != null && o > 0 && /* @__PURE__ */ W("span", {
324
324
  className: "gmp-file-convos metaitem",
325
325
  children: [
326
- /* @__PURE__ */ H(We, {
326
+ /* @__PURE__ */ U(Ue, {
327
327
  size: 14,
328
328
  "aria-hidden": "true"
329
329
  }),
330
330
  " ",
331
- /* @__PURE__ */ H("span", {
331
+ /* @__PURE__ */ U("span", {
332
332
  className: "tnum",
333
333
  children: o
334
334
  })
335
335
  ]
336
336
  })
337
337
  ]
338
- }), r && /* @__PURE__ */ H("div", {
338
+ }), r && /* @__PURE__ */ U("div", {
339
339
  className: "gmp-file-body",
340
- children: n ? n.error ? /* @__PURE__ */ H("p", {
340
+ children: n ? n.error ? /* @__PURE__ */ U("p", {
341
341
  className: "gmp-diff-state gmp-diff-error mono",
342
342
  children: n.error
343
- }) : n.binary ? /* @__PURE__ */ H("p", {
343
+ }) : n.binary ? /* @__PURE__ */ U("p", {
344
344
  className: "gmp-diff-state mono",
345
345
  children: "binary file — no textual diff."
346
- }) : n.hunks.length === 0 ? /* @__PURE__ */ H("p", {
346
+ }) : n.hunks.length === 0 ? /* @__PURE__ */ U("p", {
347
347
  className: "gmp-diff-state mono",
348
348
  children: "no line changes."
349
- }) : n.hunks.map((e, t) => /* @__PURE__ */ U("div", {
349
+ }) : n.hunks.map((e, t) => /* @__PURE__ */ W("div", {
350
350
  className: "gmp-hunk",
351
351
  children: [
352
- e.sessionTitle && /* @__PURE__ */ U("div", {
352
+ e.sessionTitle && /* @__PURE__ */ W("div", {
353
353
  className: "gmp-hunk-attrib",
354
354
  children: [
355
- /* @__PURE__ */ H(Fe, {
355
+ /* @__PURE__ */ U(Pe, {
356
356
  size: 14,
357
357
  "aria-hidden": "true"
358
358
  }),
359
- /* @__PURE__ */ H("span", {
359
+ /* @__PURE__ */ U("span", {
360
360
  className: "gmp-hunk-from",
361
361
  children: "from"
362
362
  }),
363
- /* @__PURE__ */ H("span", {
363
+ /* @__PURE__ */ U("span", {
364
364
  className: "gmp-hunk-link",
365
365
  children: e.sessionTitle
366
366
  }),
367
- e.sessionId && /* @__PURE__ */ H("span", {
367
+ e.sessionId && /* @__PURE__ */ U("span", {
368
368
  className: "mono gmp-hunk-hash",
369
369
  children: e.sessionId.slice(0, 7)
370
370
  })
371
371
  ]
372
372
  }),
373
- /* @__PURE__ */ H(_e, {
373
+ /* @__PURE__ */ U(ge, {
374
374
  file: "",
375
- hunks: [Jt(e)],
375
+ hunks: [qt(e)],
376
376
  className: "gmp-hunk-diff"
377
377
  }),
378
- n.truncated && t === n.hunks.length - 1 && /* @__PURE__ */ H("p", {
378
+ n.truncated && t === n.hunks.length - 1 && /* @__PURE__ */ U("p", {
379
379
  className: "gmp-diff-state mono",
380
380
  children: "diff truncated (file exceeds the size cap)."
381
381
  })
382
382
  ]
383
- }, t)) : /* @__PURE__ */ H("p", {
383
+ }, t)) : /* @__PURE__ */ U("p", {
384
384
  className: "gmp-diff-state mono",
385
385
  children: "loading diff…"
386
386
  })
387
387
  })]
388
388
  });
389
389
  }
390
- function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnotation: i, onRemoveAnnotation: a, onOpenMap: o, onShare: s, onCopyRecap: c, initialOpenFiles: l = {}, headerActions: u }) {
390
+ function Yt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnotation: i, onRemoveAnnotation: a, onOpenMap: o, onShare: s, onCopyRecap: c, initialOpenFiles: l = {}, headerActions: u }) {
391
391
  _(e);
392
- let [d, f] = V(l), [p, m] = V(null), [h, g] = V(!1), [v, y] = V(""), b = B({}), x = B(null), S = n ?? Kt(e.branch), C = e.work.length, w = e.newEdges.length, T = e.removedEdges.length, E = (e) => f((t) => ({
392
+ let [d, f] = H(l), [p, m] = H(null), [h, g] = H(!1), [v, y] = H(""), b = V({}), x = V(null), S = n ?? Gt(e.branch), C = e.work.length, w = e.newEdges.length, T = e.removedEdges.length, E = (e) => f((t) => ({
393
393
  ...t,
394
394
  [e]: !t[e]
395
395
  }));
@@ -415,51 +415,51 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
415
415
  t && i?.(t), g(!1), y("");
416
416
  }
417
417
  let k = e.files[0]?.path;
418
- return /* @__PURE__ */ U("div", {
418
+ return /* @__PURE__ */ W("div", {
419
419
  className: "gmp-root gmp-detail-root",
420
420
  ref: x,
421
421
  children: [
422
- /* @__PURE__ */ U("div", {
422
+ /* @__PURE__ */ W("div", {
423
423
  className: "gmp-detail-head",
424
424
  children: [
425
- /* @__PURE__ */ U("div", {
425
+ /* @__PURE__ */ W("div", {
426
426
  className: "gmp-head-row",
427
- children: [/* @__PURE__ */ U("div", {
427
+ children: [/* @__PURE__ */ W("div", {
428
428
  className: "crumb",
429
429
  children: [
430
430
  "review ",
431
- /* @__PURE__ */ H(W, {
431
+ /* @__PURE__ */ U(G, {
432
432
  size: 14,
433
433
  "aria-hidden": "true"
434
434
  }),
435
435
  " ",
436
436
  e.defaultBranch,
437
437
  " ",
438
- /* @__PURE__ */ H(W, {
438
+ /* @__PURE__ */ U(G, {
439
439
  size: 14,
440
440
  "aria-hidden": "true"
441
441
  }),
442
442
  " ",
443
- /* @__PURE__ */ H("span", {
443
+ /* @__PURE__ */ U("span", {
444
444
  className: "cur",
445
445
  children: e.branch
446
446
  })
447
447
  ]
448
- }), u ? /* @__PURE__ */ H("div", {
448
+ }), u ? /* @__PURE__ */ U("div", {
449
449
  className: "gmp-head-actions",
450
450
  children: u
451
451
  }) : null]
452
452
  }),
453
- /* @__PURE__ */ H("div", {
453
+ /* @__PURE__ */ U("div", {
454
454
  className: "gmp-detail-title",
455
455
  children: S
456
456
  }),
457
- /* @__PURE__ */ U("p", {
457
+ /* @__PURE__ */ W("p", {
458
458
  className: "gmp-caption",
459
459
  children: [
460
460
  "this line of work touched",
461
461
  " ",
462
- /* @__PURE__ */ U("button", {
462
+ /* @__PURE__ */ W("button", {
463
463
  type: "button",
464
464
  className: "gmp-frag" + (p === "files" ? " gmp-frag-on" : ""),
465
465
  onClick: () => D("files", k),
@@ -468,7 +468,7 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
468
468
  " ",
469
469
  "across",
470
470
  " ",
471
- /* @__PURE__ */ U("button", {
471
+ /* @__PURE__ */ W("button", {
472
472
  type: "button",
473
473
  className: "gmp-frag" + (p === "conversations" ? " gmp-frag-on" : ""),
474
474
  onClick: () => D("conversations"),
@@ -476,7 +476,7 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
476
476
  }),
477
477
  ", reshaping",
478
478
  " ",
479
- /* @__PURE__ */ U("button", {
479
+ /* @__PURE__ */ W("button", {
480
480
  type: "button",
481
481
  className: "gmp-frag" + (p === "conn" ? " gmp-frag-on" : ""),
482
482
  onClick: () => D("conn"),
@@ -491,30 +491,30 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
491
491
  "."
492
492
  ]
493
493
  }),
494
- /* @__PURE__ */ H("span", {
494
+ /* @__PURE__ */ U("span", {
495
495
  className: "gmp-caption-hint mono",
496
496
  children: "click any number to jump to its proof"
497
497
  })
498
498
  ]
499
499
  }),
500
- (e.frictions.length > 0 || e.violations.length > 0) && /* @__PURE__ */ U("div", {
500
+ (e.frictions.length > 0 || e.violations.length > 0) && /* @__PURE__ */ W("div", {
501
501
  className: "gmp-signals",
502
- children: [e.frictions.map((e, t) => /* @__PURE__ */ U("span", {
502
+ children: [e.frictions.map((e, t) => /* @__PURE__ */ W("span", {
503
503
  className: "gmp-signal",
504
504
  children: [
505
- /* @__PURE__ */ H(Je, {
505
+ /* @__PURE__ */ U(qe, {
506
506
  size: 14,
507
507
  "aria-hidden": "true"
508
508
  }),
509
509
  " ",
510
510
  e.label,
511
511
  ", ",
512
- /* @__PURE__ */ H("span", {
512
+ /* @__PURE__ */ U("span", {
513
513
  className: "mono",
514
514
  children: e.file
515
515
  }),
516
516
  " ",
517
- /* @__PURE__ */ U("b", {
517
+ /* @__PURE__ */ W("b", {
518
518
  className: "tnum",
519
519
  children: [e.count, "×"]
520
520
  }),
@@ -522,15 +522,15 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
522
522
  e.sessions,
523
523
  " conversations"
524
524
  ]
525
- }, t)), e.violations.length > 0 && /* @__PURE__ */ U("span", {
525
+ }, t)), e.violations.length > 0 && /* @__PURE__ */ W("span", {
526
526
  className: "gmp-signal gmp-signal-warn",
527
527
  children: [
528
- /* @__PURE__ */ H($e, {
528
+ /* @__PURE__ */ U(Qe, {
529
529
  size: 14,
530
530
  "aria-hidden": "true"
531
531
  }),
532
532
  " ",
533
- /* @__PURE__ */ H("b", {
533
+ /* @__PURE__ */ U("b", {
534
534
  className: "tnum",
535
535
  children: e.violations.length
536
536
  }),
@@ -538,13 +538,13 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
538
538
  ]
539
539
  })]
540
540
  }),
541
- /* @__PURE__ */ U("div", {
541
+ /* @__PURE__ */ W("div", {
542
542
  className: "gmp-totals",
543
543
  children: [
544
- /* @__PURE__ */ U("span", {
544
+ /* @__PURE__ */ W("span", {
545
545
  className: "metaitem tnum",
546
546
  children: [
547
- /* @__PURE__ */ H(Le, {
547
+ /* @__PURE__ */ U(Ie, {
548
548
  size: 14,
549
549
  "aria-hidden": "true"
550
550
  }),
@@ -553,58 +553,58 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
553
553
  " files touched"
554
554
  ]
555
555
  }),
556
- /* @__PURE__ */ U("span", {
556
+ /* @__PURE__ */ W("span", {
557
557
  className: "metaitem tnum",
558
558
  children: [
559
- /* @__PURE__ */ U("span", {
559
+ /* @__PURE__ */ W("span", {
560
560
  className: "gmp-add",
561
561
  children: ["+", w]
562
562
  }),
563
563
  "/",
564
- /* @__PURE__ */ U("span", {
564
+ /* @__PURE__ */ W("span", {
565
565
  className: "gmp-del",
566
566
  children: ["−", T]
567
567
  }),
568
568
  " connections"
569
569
  ]
570
570
  }),
571
- /* @__PURE__ */ U("span", {
571
+ /* @__PURE__ */ W("span", {
572
572
  className: "metaitem tnum",
573
573
  children: [
574
- /* @__PURE__ */ H(Ve, {
574
+ /* @__PURE__ */ U(Be, {
575
575
  size: 14,
576
576
  "aria-hidden": "true"
577
577
  }),
578
578
  " ai wrote ",
579
- qt(Number(e.outputTokens)),
579
+ Kt(Number(e.outputTokens)),
580
580
  " tokens"
581
581
  ]
582
582
  }),
583
- e.costUsd != null && /* @__PURE__ */ U("span", {
583
+ e.costUsd != null && /* @__PURE__ */ W("span", {
584
584
  className: "metaitem tnum",
585
585
  children: [
586
- /* @__PURE__ */ H(Pe, {
586
+ /* @__PURE__ */ U(Ne, {
587
587
  size: 14,
588
588
  "aria-hidden": "true"
589
589
  }),
590
590
  " est. spend ",
591
- De(e.costUsd)
591
+ Ee(e.costUsd)
592
592
  ]
593
593
  })
594
594
  ]
595
595
  }),
596
- /* @__PURE__ */ U("div", {
596
+ /* @__PURE__ */ W("div", {
597
597
  className: "gmp-detail-sec",
598
- children: [/* @__PURE__ */ H("div", {
598
+ children: [/* @__PURE__ */ U("div", {
599
599
  className: "sb-head gmp-detail-sechead",
600
600
  children: "files changed, click a path to open its diff"
601
- }), /* @__PURE__ */ H("div", {
601
+ }), /* @__PURE__ */ U("div", {
602
602
  className: "gmp-files",
603
- children: e.files.map((e) => /* @__PURE__ */ H("div", {
603
+ children: e.files.map((e) => /* @__PURE__ */ U("div", {
604
604
  ref: (t) => {
605
605
  b.current[e.path] = t;
606
606
  },
607
- children: /* @__PURE__ */ H(Yt, {
607
+ children: /* @__PURE__ */ U(Jt, {
608
608
  file: e,
609
609
  diff: d[e.path] ? t?.(e) : void 0,
610
610
  open: !!d[e.path],
@@ -613,42 +613,42 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
613
613
  }, e.path))
614
614
  })]
615
615
  }),
616
- /* @__PURE__ */ U("div", {
616
+ /* @__PURE__ */ W("div", {
617
617
  className: "gmp-detail-sec",
618
- children: [/* @__PURE__ */ H("div", {
618
+ children: [/* @__PURE__ */ U("div", {
619
619
  className: "sb-head gmp-detail-sechead",
620
620
  children: "your annotation"
621
- }), /* @__PURE__ */ U("div", {
621
+ }), /* @__PURE__ */ W("div", {
622
622
  className: "gmp-annot",
623
623
  children: [
624
- r && /* @__PURE__ */ U("span", {
624
+ r && /* @__PURE__ */ W("span", {
625
625
  className: "gmp-label-chip gmp-annot-chip",
626
626
  children: [
627
- /* @__PURE__ */ H(Qe, {
627
+ /* @__PURE__ */ U(Ze, {
628
628
  size: 14,
629
629
  "aria-hidden": "true"
630
630
  }),
631
631
  " ",
632
632
  r,
633
- /* @__PURE__ */ H("button", {
633
+ /* @__PURE__ */ U("button", {
634
634
  type: "button",
635
635
  className: "gmp-annot-x",
636
636
  "aria-label": "remove annotation",
637
637
  onClick: () => a?.(),
638
- children: /* @__PURE__ */ H(et, {
638
+ children: /* @__PURE__ */ U($e, {
639
639
  size: 14,
640
640
  "aria-hidden": "true"
641
641
  })
642
642
  })
643
643
  ]
644
644
  }),
645
- /* @__PURE__ */ U("button", {
645
+ /* @__PURE__ */ W("button", {
646
646
  type: "button",
647
647
  className: "gmp-annot-add",
648
648
  "aria-expanded": h,
649
649
  onClick: () => g((e) => !e),
650
650
  children: [
651
- /* @__PURE__ */ H(Qe, {
651
+ /* @__PURE__ */ U(Ze, {
652
652
  size: 14,
653
653
  "aria-hidden": "true"
654
654
  }),
@@ -656,15 +656,15 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
656
656
  r ? "change label" : "add a label"
657
657
  ]
658
658
  }),
659
- h && /* @__PURE__ */ U("form", {
659
+ h && /* @__PURE__ */ W("form", {
660
660
  className: "gmp-annot-pop",
661
661
  onSubmit: O,
662
662
  children: [
663
- /* @__PURE__ */ H("span", {
663
+ /* @__PURE__ */ U("span", {
664
664
  className: "label",
665
665
  children: "user.custom_label"
666
666
  }),
667
- /* @__PURE__ */ H("input", {
667
+ /* @__PURE__ */ U("input", {
668
668
  className: "input",
669
669
  type: "text",
670
670
  autoFocus: !0,
@@ -673,17 +673,17 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
673
673
  placeholder: "e.g. good handoff",
674
674
  "aria-label": "annotation value"
675
675
  }),
676
- /* @__PURE__ */ U("div", {
676
+ /* @__PURE__ */ W("div", {
677
677
  className: "gmp-annot-pop-foot",
678
- children: [/* @__PURE__ */ H("button", {
678
+ children: [/* @__PURE__ */ U("button", {
679
679
  type: "button",
680
680
  className: "btn btn-ghost btn-sm",
681
681
  onClick: () => g(!1),
682
682
  children: "cancel"
683
- }), /* @__PURE__ */ U("button", {
683
+ }), /* @__PURE__ */ W("button", {
684
684
  type: "submit",
685
685
  className: "btn btn-primary btn-sm",
686
- children: [/* @__PURE__ */ H(Me, {
686
+ children: [/* @__PURE__ */ U(je, {
687
687
  size: 14,
688
688
  "aria-hidden": "true"
689
689
  }), " save"]
@@ -694,24 +694,24 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
694
694
  ]
695
695
  })]
696
696
  }),
697
- /* @__PURE__ */ U("div", {
697
+ /* @__PURE__ */ W("div", {
698
698
  className: "gmp-exits",
699
699
  children: [
700
- /* @__PURE__ */ U("button", {
700
+ /* @__PURE__ */ W("button", {
701
701
  type: "button",
702
702
  className: "btn btn-secondary btn-sm",
703
703
  onClick: () => o?.(),
704
- children: [/* @__PURE__ */ H(je, {
704
+ children: [/* @__PURE__ */ U(Ae, {
705
705
  size: 14,
706
706
  "aria-hidden": "true"
707
707
  }), " see this work on the code map"]
708
708
  }),
709
- /* @__PURE__ */ U("button", {
709
+ /* @__PURE__ */ W("button", {
710
710
  type: "button",
711
711
  className: "btn btn-secondary btn-sm",
712
712
  onClick: () => s?.(),
713
713
  children: [
714
- /* @__PURE__ */ H(Xe, {
714
+ /* @__PURE__ */ U(Ye, {
715
715
  size: 14,
716
716
  "aria-hidden": "true"
717
717
  }),
@@ -720,16 +720,16 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
720
720
  " conversations…"
721
721
  ]
722
722
  }),
723
- /* @__PURE__ */ U("button", {
723
+ /* @__PURE__ */ W("button", {
724
724
  type: "button",
725
725
  className: "btn btn-secondary btn-sm",
726
726
  onClick: () => c?.(),
727
- children: [/* @__PURE__ */ H(Re, {
727
+ children: [/* @__PURE__ */ U(Le, {
728
728
  size: 14,
729
729
  "aria-hidden": "true"
730
730
  }), " copy recap"]
731
731
  }),
732
- /* @__PURE__ */ U("code", {
732
+ /* @__PURE__ */ W("code", {
733
733
  className: "gmp-gitdiff mono",
734
734
  children: [
735
735
  "git diff ",
@@ -740,7 +740,7 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
740
740
  })
741
741
  ]
742
742
  }),
743
- /* @__PURE__ */ H("p", {
743
+ /* @__PURE__ */ U("p", {
744
744
  className: "gmp-boundary mono",
745
745
  children: "shows what changed and the recorded work behind it, not whether the change is correct or secure."
746
746
  })
@@ -749,31 +749,31 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
749
749
  }
750
750
  //#endregion
751
751
  //#region src/ui/graph/CodeMap.jsx
752
- var Zt = Object.freeze({
752
+ var Xt = Object.freeze({
753
753
  project: "overview",
754
754
  package: "folders",
755
755
  file: "files"
756
- }), Qt = Object.freeze({
756
+ }), Zt = Object.freeze({
757
757
  overview: "project",
758
758
  folders: "package",
759
759
  files: "file"
760
760
  });
761
- function $t({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i, onExpand: a, highlightedIds: o, nodeDeltas: s, structureEdgeDeltas: c, height: l = 520, ariaLabel: u = "code map", className: d = "", viewport: f, onViewportChange: p, state: m, onStateChange: h }) {
762
- let g = z(() => {
761
+ function Qt({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i, onExpand: a, highlightedIds: o, nodeDeltas: s, structureEdgeDeltas: c, height: l = 520, ariaLabel: u = "code map", className: d = "", viewport: f, onViewportChange: p, state: m, onStateChange: h }) {
762
+ let g = B(() => {
763
763
  let t = /* @__PURE__ */ new Map();
764
764
  for (let n of e?.nodes ?? []) t.set(n.id, n);
765
765
  return t;
766
- }, [e?.nodes]), _ = z(() => m === void 0 ? null : A(m), [m]), v = z(() => _ ? Se(e, _) : null, [e, _]), y = z(() => en(e && {
766
+ }, [e?.nodes]), _ = B(() => m === void 0 ? null : A(m), [m]), v = B(() => _ ? xe(e, _) : null, [e, _]), y = B(() => $t(e && {
767
767
  ...e,
768
768
  nodes: v?.canvas.allNodes ?? e.nodes
769
- }), [e, v?.canvas.allNodes]), b = v ? Zt[v.canvas.grain] ?? "folders" : Zt[t?.level ?? "package"], x = v?.canvas.expandedIds ?? t?.expanded, S = B(b);
769
+ }), [e, v?.canvas.allNodes]), b = v ? Xt[v.canvas.grain] ?? "folders" : Xt[t?.level ?? "package"], x = v?.canvas.expandedIds ?? t?.expanded, S = V(b);
770
770
  S.current = b;
771
771
  function C(e) {
772
772
  if (!_) return;
773
- let t = be(_, e);
774
- Ce(_, t) || h?.(t);
773
+ let t = ye(_, e);
774
+ Se(_, t) || h?.(t);
775
775
  }
776
- return /* @__PURE__ */ H(F, {
776
+ return /* @__PURE__ */ U(F, {
777
777
  data: y,
778
778
  grain: b,
779
779
  expandedIds: x,
@@ -789,13 +789,13 @@ function $t({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i,
789
789
  onExpand: a,
790
790
  onGrainChange: (e) => {
791
791
  S.current = e, n?.({
792
- level: Qt[e] ?? "package",
792
+ level: Zt[e] ?? "package",
793
793
  expanded: []
794
794
  });
795
795
  },
796
796
  onExpandedIdsChange: (e) => {
797
797
  n?.({
798
- level: Qt[S.current] ?? "package",
798
+ level: Zt[S.current] ?? "package",
799
799
  expanded: e
800
800
  });
801
801
  },
@@ -810,16 +810,16 @@ function $t({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i,
810
810
  canonicalControlled: _ !== null
811
811
  });
812
812
  }
813
- function en(e) {
813
+ function $t(e) {
814
814
  e && N(e);
815
- let t = e?.nodes ?? [], n = nn(e?.violations ?? []);
815
+ let t = e?.nodes ?? [], n = tn(e?.violations ?? []);
816
816
  return {
817
817
  nodes: t.map((e) => ({
818
818
  id: e.id,
819
819
  label: e.name || e.id,
820
820
  kind: e.kind === "file" ? "file" : "folder",
821
821
  loc: e.loc ?? 0,
822
- coverage: tn(e.recordedFiles, e.totalFiles),
822
+ coverage: en(e.recordedFiles, e.totalFiles),
823
823
  parent: e.parent || void 0,
824
824
  violations: n.get(e.id) ?? 0,
825
825
  layer: e.layer,
@@ -833,90 +833,113 @@ function en(e) {
833
833
  }))
834
834
  };
835
835
  }
836
- function tn(e, t) {
836
+ function en(e, t) {
837
837
  let n = Number(t) || 0;
838
838
  if (n <= 0) return 0;
839
839
  let r = Math.max(0, Math.min(1, (Number(e) || 0) / n));
840
840
  return Math.max(0, Math.min(4, Math.round(r * 4)));
841
841
  }
842
- function nn(e) {
842
+ function tn(e) {
843
843
  let t = /* @__PURE__ */ new Map();
844
- for (let n of e) rn(t, n.from), rn(t, n.to);
844
+ for (let n of e) nn(t, n.from), nn(t, n.to);
845
845
  return t;
846
846
  }
847
- function rn(e, t) {
847
+ function nn(e, t) {
848
848
  t && e.set(t, (e.get(t) ?? 0) + 1);
849
849
  }
850
850
  //#endregion
851
851
  //#region src/ui/graph/CodeMapNavigator.jsx
852
- function an({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsChange: r, selectedId: i = null, onSelect: a, focusedId: o, onFocusChange: s, filter: c = "", onFilterChange: l, onOpenMap: u, onStateAction: d, ariaLabel: f = "code map navigator" }) {
853
- let [p, m] = V(() => /* @__PURE__ */ new Set()), [h, g] = V(null), _ = n === void 0 ? p : new Set(n), v = o === void 0 ? h : o, y = B(/* @__PURE__ */ new Map()), b = z(() => Se(e, A({
852
+ function rn({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsChange: r, selectedId: i = null, onSelect: a, focusedId: o, onFocusChange: s, filter: c = "", onFilterChange: l, onOpenMap: u, onStateAction: d, ariaLabel: f = "code map navigator", lineCounts: p = "measured" }) {
853
+ let [m, h] = H(() => /* @__PURE__ */ new Set()), [g, _] = H(null), [v, y] = H(() => /* @__PURE__ */ new Set()), b = n === void 0 ? m : new Set(n), x = o === void 0 ? g : o, S = V(/* @__PURE__ */ new Map()), C = B(() => xe(e, A({
854
854
  grain: t,
855
- expandedIds: Array.from(_),
855
+ expandedIds: Array.from(b),
856
856
  selectedId: i,
857
- navigatorFocusedId: v,
857
+ navigatorFocusedId: x,
858
858
  navigatorFilter: c
859
859
  })), [
860
860
  e,
861
861
  t,
862
- sn(_),
862
+ on(b),
863
863
  i,
864
- v,
864
+ x,
865
865
  c
866
- ]), x = b.rows, S = b.focusedId, C = b.selected, w = C ? x.find((e) => e.node.id === C.id) : null, T = !!w?.canExpand && !w.forcedOpen;
867
- function E(e) {
868
- n === void 0 && m(e), d?.({
866
+ ]), w = c.trim() !== "", T = B(() => {
867
+ if (w || v.size === 0) return C.rows;
868
+ let e = [], t = null;
869
+ for (let n of C.rows) {
870
+ if (t !== null && n.depth > t) continue;
871
+ t = null;
872
+ let r = n.openByGrain && v.has(n.node.id);
873
+ e.push(r ? {
874
+ ...n,
875
+ expanded: !1
876
+ } : n), r && (t = n.depth);
877
+ }
878
+ return e;
879
+ }, [
880
+ C.rows,
881
+ v,
882
+ w
883
+ ]), E = T.some((e) => e.node.id === C.focusedId) ? C.focusedId : T[0]?.node.id ?? null, D = C.selected, O = D ? T.find((e) => e.node.id === D.id) : null, k = (e) => !w && e.hasChildren, j = !!O && k(O);
884
+ function M(e) {
885
+ n === void 0 && h(e), d?.({
869
886
  type: "set-expanded",
870
887
  ids: Array.from(e)
871
888
  }), r?.(Array.from(e));
872
889
  }
873
- function D(e) {
874
- let t = new Set(_);
875
- t.has(e) ? t.delete(e) : t.add(e), E(t);
890
+ function N(e) {
891
+ let t = new Set(b);
892
+ t.has(e) ? t.delete(e) : t.add(e), M(t);
876
893
  }
877
- function O(e) {
878
- o === void 0 && g(e), d?.({
894
+ function P(e) {
895
+ e.openByGrain && !w ? y((t) => {
896
+ let n = new Set(t);
897
+ return n.has(e.node.id) ? n.delete(e.node.id) : n.add(e.node.id), n;
898
+ }) : N(e.node.id);
899
+ }
900
+ function F(e) {
901
+ o === void 0 && _(e), d?.({
879
902
  type: "focus",
880
903
  id: e
881
- }), s?.(e), y.current.get(e)?.focus();
904
+ }), s?.(e), S.current.get(e)?.focus();
882
905
  }
883
- function k(e) {
884
- o === void 0 && g(e.id), y.current.get(e.id)?.focus(), d?.({
906
+ function I(e) {
907
+ o === void 0 && _(e.id), S.current.get(e.id)?.focus(), d?.({
885
908
  type: "select",
886
909
  id: e.id
887
910
  }), s?.(e.id), a?.(e.id, e);
888
911
  }
889
- function j(e, t) {
890
- let n = x[t];
912
+ function L(e, t) {
913
+ let n = T[t];
891
914
  if (!n) return;
892
915
  let { node: r } = n, i = null;
893
- if (e.key === "ArrowDown") i = x[Math.min(t + 1, x.length - 1)]?.node.id;
894
- else if (e.key === "ArrowUp") i = x[Math.max(t - 1, 0)]?.node.id;
895
- else if (e.key === "Home") i = x[0]?.node.id;
896
- else if (e.key === "End") i = x[x.length - 1]?.node.id;
897
- else if (e.key === "ArrowRight" && (n.canExpand || n.forcedOpen)) n.forcedOpen || n.expanded ? i = n.childIds[0] ?? null : _.has(r.id) || D(r.id);
898
- else if (e.key === "ArrowLeft") !n.forcedOpen && n.canExpand && n.expanded ? D(r.id) : i = n.parentId;
916
+ if (e.key === "ArrowDown") i = T[Math.min(t + 1, T.length - 1)]?.node.id;
917
+ else if (e.key === "ArrowUp") i = T[Math.max(t - 1, 0)]?.node.id;
918
+ else if (e.key === "Home") i = T[0]?.node.id;
919
+ else if (e.key === "End") i = T[T.length - 1]?.node.id;
920
+ else if (e.key === "ArrowRight" && (n.forcedOpen || k(n))) n.expanded ? i = n.childIds[0] ?? null : P(n);
921
+ else if (e.key === "ArrowLeft") k(n) && n.expanded ? P(n) : i = n.parentId;
899
922
  else if (e.key === "Enter" || e.key === " ") {
900
- k(r), e.preventDefault();
923
+ I(r), e.preventDefault();
901
924
  return;
902
925
  } else return;
903
- e.preventDefault(), i && O(i);
926
+ e.preventDefault(), i && F(i);
904
927
  }
905
- return /* @__PURE__ */ U("section", {
928
+ return /* @__PURE__ */ W("section", {
906
929
  className: "gmp-navigator",
907
930
  "aria-label": f,
908
931
  children: [
909
- /* @__PURE__ */ H("header", {
932
+ /* @__PURE__ */ U("header", {
910
933
  className: "gmp-navigator-head",
911
- children: /* @__PURE__ */ U("label", {
934
+ children: /* @__PURE__ */ W("label", {
912
935
  className: "gmp-navigator-search",
913
936
  children: [
914
- /* @__PURE__ */ H(Ye, { "aria-hidden": "true" }),
915
- /* @__PURE__ */ H("span", {
937
+ /* @__PURE__ */ U(Je, { "aria-hidden": "true" }),
938
+ /* @__PURE__ */ U("span", {
916
939
  className: "gmp-sr",
917
940
  children: "filter code areas"
918
941
  }),
919
- /* @__PURE__ */ H("input", {
942
+ /* @__PURE__ */ U("input", {
920
943
  value: c,
921
944
  onChange: (e) => {
922
945
  d?.({
@@ -929,13 +952,13 @@ function an({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsCha
929
952
  ]
930
953
  })
931
954
  }),
932
- b.staleSelectedId ? /* @__PURE__ */ U("p", {
955
+ C.staleSelectedId ? /* @__PURE__ */ W("p", {
933
956
  className: "gmp-navigator-missing",
934
957
  role: "status",
935
958
  children: [
936
959
  "the selected code area is not present in this map.",
937
960
  " ",
938
- /* @__PURE__ */ H("button", {
961
+ /* @__PURE__ */ U("button", {
939
962
  type: "button",
940
963
  onClick: () => {
941
964
  d?.({ type: "clear-selection" }), a?.(null, null);
@@ -944,68 +967,67 @@ function an({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsCha
944
967
  })
945
968
  ]
946
969
  }) : null,
947
- /* @__PURE__ */ U("div", {
970
+ /* @__PURE__ */ W("div", {
948
971
  className: "gmp-navigator-body",
949
- children: [/* @__PURE__ */ H("div", {
950
- role: x.length ? "tree" : void 0,
972
+ children: [/* @__PURE__ */ U("div", {
973
+ role: T.length ? "tree" : void 0,
951
974
  "aria-label": "code areas",
952
975
  className: "gmp-navigator-tree",
953
976
  "data-grain": t,
954
- children: x.length === 0 ? /* @__PURE__ */ H("p", {
977
+ children: T.length === 0 ? /* @__PURE__ */ U("p", {
955
978
  className: "gmp-navigator-empty",
956
979
  role: "status",
957
980
  children: "no code areas match this filter"
958
- }) : x.map((e, t) => {
959
- let n = e.canExpand || e.forcedOpen, r = e.expanded, a = S === e.node.id;
960
- return /* @__PURE__ */ H(on, {
981
+ }) : T.map((e, t) => {
982
+ let n = k(e), r = e.expanded, a = E === e.node.id;
983
+ return /* @__PURE__ */ U(an, {
961
984
  row: e,
962
- hasChildren: n,
985
+ hasDisclosure: n,
963
986
  isExpanded: r,
964
987
  selected: i === e.node.id,
965
988
  tabbable: a,
966
989
  setRef: (t) => {
967
- t ? y.current.set(e.node.id, t) : y.current.delete(e.node.id);
990
+ t ? S.current.set(e.node.id, t) : S.current.delete(e.node.id);
968
991
  },
969
992
  onFocus: () => {
970
- o === void 0 && g(e.node.id);
993
+ o === void 0 && _(e.node.id);
971
994
  },
972
- onSelect: () => k(e.node),
973
- onToggle: () => {
974
- e.forcedOpen || D(e.node.id);
975
- },
976
- onKeyDown: (e) => j(e, t)
995
+ onSelect: () => I(e.node),
996
+ onToggle: () => P(e),
997
+ onKeyDown: (e) => L(e, t),
998
+ lineCounts: p
977
999
  }, e.node.id);
978
1000
  })
979
- }), /* @__PURE__ */ H("aside", {
1001
+ }), /* @__PURE__ */ U("aside", {
980
1002
  className: "gmp-navigator-actions",
981
1003
  "aria-label": "selected code area",
982
- children: C ? /* @__PURE__ */ U(Ae, { children: [
983
- /* @__PURE__ */ H("p", {
1004
+ children: D ? /* @__PURE__ */ W(ke, { children: [
1005
+ /* @__PURE__ */ U("p", {
984
1006
  className: "gmp-navigator-selected",
985
- children: C.name || C.id
1007
+ children: D.name || D.id
986
1008
  }),
987
- /* @__PURE__ */ H("p", {
1009
+ /* @__PURE__ */ U("p", {
988
1010
  className: "gmp-navigator-selected-path",
989
- children: C.id
1011
+ children: D.id
990
1012
  }),
991
- T ? /* @__PURE__ */ U("button", {
1013
+ j ? /* @__PURE__ */ W("button", {
992
1014
  type: "button",
993
1015
  className: "gmp-navigator-action",
994
- onClick: () => D(C.id),
995
- children: [/* @__PURE__ */ H(W, { "aria-hidden": "true" }), _.has(C.id) ? "hide children" : "show children"]
1016
+ onClick: () => P(O),
1017
+ children: [/* @__PURE__ */ U(G, { "aria-hidden": "true" }), O.expanded ? "hide children" : "show children"]
996
1018
  }) : null,
997
- /* @__PURE__ */ U("button", {
1019
+ /* @__PURE__ */ W("button", {
998
1020
  type: "button",
999
1021
  className: "gmp-navigator-action gmp-navigator-action--primary",
1000
1022
  onClick: () => {
1001
1023
  d?.({
1002
1024
  type: "open-in-map",
1003
- id: C.id
1004
- }), u?.(C.id);
1025
+ id: D.id
1026
+ }), u?.(D.id);
1005
1027
  },
1006
- children: [/* @__PURE__ */ H(He, { "aria-hidden": "true" }), " open in map"]
1028
+ children: [/* @__PURE__ */ U(Ve, { "aria-hidden": "true" }), " open in map"]
1007
1029
  })
1008
- ] }) : /* @__PURE__ */ H("p", {
1030
+ ] }) : /* @__PURE__ */ U("p", {
1009
1031
  className: "gmp-navigator-empty",
1010
1032
  children: "select an area to see its recorded work and map context"
1011
1033
  })
@@ -1014,114 +1036,113 @@ function an({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsCha
1014
1036
  ]
1015
1037
  });
1016
1038
  }
1017
- function on({ row: e, hasChildren: t, isExpanded: n, selected: r, tabbable: i, setRef: a, onFocus: o, onSelect: s, onToggle: c, onKeyDown: l }) {
1018
- return /* @__PURE__ */ U("div", {
1039
+ function an({ row: e, hasDisclosure: t, isExpanded: n, selected: r, tabbable: i, setRef: a, onFocus: o, onSelect: s, onToggle: c, onKeyDown: l, lineCounts: u }) {
1040
+ return /* @__PURE__ */ W("div", {
1019
1041
  role: "none",
1020
1042
  className: "gmp-navigator-row-wrap",
1021
1043
  "data-selected": r,
1022
1044
  style: { "--gmp-tree-depth": e.depth },
1023
- children: [t ? /* @__PURE__ */ H("button", {
1045
+ children: [t ? /* @__PURE__ */ U("button", {
1024
1046
  type: "button",
1025
1047
  className: "gmp-navigator-disclosure",
1026
1048
  tabIndex: -1,
1027
1049
  "aria-hidden": "true",
1028
1050
  "aria-label": `${n ? "hide" : "show"} children for ${e.node.name || e.node.id}`,
1029
1051
  "aria-expanded": n,
1030
- "aria-disabled": e.forcedOpen ? "true" : void 0,
1031
1052
  onKeyDown: (e) => e.stopPropagation(),
1032
- onClick: (t) => {
1033
- t.stopPropagation(), e.forcedOpen || c();
1053
+ onClick: (e) => {
1054
+ e.stopPropagation(), c();
1034
1055
  },
1035
- children: /* @__PURE__ */ H(W, {
1056
+ children: /* @__PURE__ */ U(G, {
1036
1057
  className: "gmp-navigator-chevron",
1037
1058
  "aria-hidden": "true"
1038
1059
  })
1039
- }) : /* @__PURE__ */ H("span", {
1060
+ }) : /* @__PURE__ */ U("span", {
1040
1061
  className: "gmp-navigator-disclosure-placeholder",
1041
1062
  "aria-hidden": "true"
1042
- }), /* @__PURE__ */ U("div", {
1063
+ }), /* @__PURE__ */ W("div", {
1043
1064
  ref: a,
1044
1065
  role: "treeitem",
1045
1066
  "aria-level": e.depth + 1,
1046
1067
  "aria-selected": r,
1047
- "aria-expanded": t ? n : void 0,
1068
+ "aria-expanded": t || e.forcedOpen ? n : void 0,
1048
1069
  tabIndex: i ? 0 : -1,
1049
1070
  className: "gmp-navigator-row",
1050
1071
  onFocus: o,
1051
1072
  onClick: s,
1052
1073
  onDoubleClick: () => {
1053
- t && !e.forcedOpen && c();
1074
+ t && c();
1054
1075
  },
1055
1076
  onKeyDown: l,
1056
1077
  children: [
1057
- e.node.kind === "file" ? /* @__PURE__ */ H(Ie, { "aria-hidden": "true" }) : /* @__PURE__ */ H(ze, { "aria-hidden": "true" }),
1058
- /* @__PURE__ */ H("span", {
1078
+ e.node.kind === "file" ? /* @__PURE__ */ U(Fe, { "aria-hidden": "true" }) : /* @__PURE__ */ U(Re, { "aria-hidden": "true" }),
1079
+ /* @__PURE__ */ U("span", {
1059
1080
  className: "gmp-navigator-path",
1060
1081
  children: e.node.name || e.node.id
1061
1082
  }),
1062
- /* @__PURE__ */ U("span", {
1083
+ /* @__PURE__ */ W("span", {
1063
1084
  className: "gmp-navigator-meta",
1064
- children: [/* @__PURE__ */ U("span", { children: [cn(e.node.loc ?? 0), " lines"] }), /* @__PURE__ */ H("span", { children: ln(e.node.recordedFiles, e.node.totalFiles) })]
1085
+ children: [u === "unknown" ? null : /* @__PURE__ */ W("span", { children: [sn(e.node.loc ?? 0), " lines"] }), /* @__PURE__ */ U("span", { children: cn(e.node.recordedFiles, e.node.totalFiles) })]
1065
1086
  })
1066
1087
  ]
1067
1088
  })]
1068
1089
  });
1069
1090
  }
1070
- function sn(e) {
1091
+ function on(e) {
1071
1092
  return Array.from(e).sort().join("\0");
1072
1093
  }
1073
- function cn(e) {
1074
- return Oe(Number(e) || 0);
1094
+ function sn(e) {
1095
+ return De(Number(e) || 0);
1075
1096
  }
1076
- function ln(e, t) {
1097
+ function cn(e, t) {
1077
1098
  let n = Number(t) || 0;
1078
1099
  return n <= 0 ? "no coverage data" : `${Math.round((Number(e) || 0) / n * 100)}% recorded`;
1079
1100
  }
1080
1101
  //#endregion
1081
1102
  //#region src/ui/graph/CodeMapComposition.jsx
1082
- function un({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i, onExpand: a, highlightedIds: o, nodeDeltas: s, structureEdgeDeltas: c, height: l = 480, ariaLabel: u = "code map", canvasSlot: d, rail: f, toolbar: p, sheetTitle: m = "code area", sheetMeta: h, railSide: g = "right", legend: _, canvasWrapperClassName: v = "", canvasWrapperStyle: y, className: b = "", presentation: x = "canvas", navigatorSlot: S, onPresentationChange: C, viewport: w, onViewportChange: T, state: E, defaultState: D, onStateChange: O }) {
1083
- let k = E !== void 0 || D !== void 0, [j, M] = V(() => A(D)), N = z(() => k ? A(E ?? j) : null, [
1084
- k,
1103
+ function ln({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i, onExpand: a, highlightedIds: o, nodeDeltas: s, structureEdgeDeltas: c, height: l = 480, ariaLabel: u = "code map", canvasSlot: d, rail: f, toolbar: p, sheetTitle: m = "code area", sheetMeta: h, railSide: g = "right", legend: _, canvasWrapperClassName: v = "", canvasWrapperStyle: y, className: b = "", presentation: x = "canvas", navigatorSlot: S, onPresentationChange: C, viewport: w, onViewportChange: T, state: E, defaultState: D, onStateChange: O, lineCounts: k = "measured" }) {
1104
+ let j = E !== void 0 || D !== void 0, [M, N] = H(() => A(D)), P = B(() => j ? A(E ?? M) : null, [
1105
+ j,
1085
1106
  E,
1086
- j
1087
- ]), P = N?.presentation ?? x;
1088
- function F(e, t) {
1089
- E === void 0 && M(e), O?.(e), t?.(e);
1090
- }
1107
+ M
1108
+ ]), F = P?.presentation ?? x;
1091
1109
  function I(e, t) {
1092
- if (!N) return;
1093
- let n = be(N, e);
1094
- Ce(N, n) || F(n, t);
1110
+ E === void 0 && N(e), O?.(e), t?.(e);
1111
+ }
1112
+ function L(e, t) {
1113
+ if (!P) return;
1114
+ let n = ye(P, e);
1115
+ Se(P, n) || I(n, t);
1095
1116
  }
1096
- let ee = k || C ? /* @__PURE__ */ U(Ae, { children: [/* @__PURE__ */ U("div", {
1117
+ let ee = j || C ? /* @__PURE__ */ W(ke, { children: [/* @__PURE__ */ W("div", {
1097
1118
  className: "gmp-presentation-switch",
1098
1119
  role: "group",
1099
1120
  "aria-label": "code map view",
1100
- children: [/* @__PURE__ */ H("button", {
1121
+ children: [/* @__PURE__ */ U("button", {
1101
1122
  type: "button",
1102
- "aria-pressed": P === "navigator",
1103
- onClick: () => k ? I({
1123
+ "aria-pressed": F === "navigator",
1124
+ onClick: () => j ? L({
1104
1125
  type: "set-presentation",
1105
1126
  presentation: "navigator"
1106
1127
  }, () => C?.("navigator")) : C?.("navigator"),
1107
- children: P === "canvas" ? "back to browse" : "browse"
1108
- }), /* @__PURE__ */ H("button", {
1128
+ children: F === "canvas" ? "back to browse" : "browse"
1129
+ }), /* @__PURE__ */ U("button", {
1109
1130
  type: "button",
1110
- "aria-pressed": P === "canvas",
1111
- onClick: () => k ? I({
1131
+ "aria-pressed": F === "canvas",
1132
+ onClick: () => j ? L({
1112
1133
  type: "set-presentation",
1113
1134
  presentation: "canvas"
1114
1135
  }, () => C?.("canvas")) : C?.("canvas"),
1115
1136
  children: "spatial map"
1116
1137
  })]
1117
- }), p] }) : p, te = d ?? /* @__PURE__ */ H($t, {
1138
+ }), p] }) : p, te = d ?? /* @__PURE__ */ U(Qt, {
1118
1139
  payload: e,
1119
- zoom: N ? {
1120
- level: N.grain,
1121
- expanded: N.expandedIds
1140
+ zoom: P ? {
1141
+ level: P.grain,
1142
+ expanded: P.expandedIds
1122
1143
  } : t,
1123
1144
  onZoomChange: n,
1124
- selectedId: N ? N.selectedId : r,
1145
+ selectedId: P ? P.selectedId : r,
1125
1146
  onSelect: i,
1126
1147
  onExpand: a,
1127
1148
  highlightedIds: o,
@@ -1129,76 +1150,77 @@ function un({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i,
1129
1150
  structureEdgeDeltas: c,
1130
1151
  height: l,
1131
1152
  ariaLabel: u,
1132
- viewport: N ? N.viewport ?? void 0 : w,
1153
+ viewport: P ? P.viewport ?? void 0 : w,
1133
1154
  onViewportChange: T,
1134
- state: N ?? void 0,
1135
- onStateChange: N ? (e) => F(e) : void 0
1136
- }), ne = S ?? (N && e ? /* @__PURE__ */ H(an, {
1155
+ state: P ?? void 0,
1156
+ onStateChange: P ? (e) => I(e) : void 0
1157
+ }), ne = S ?? (P && e ? /* @__PURE__ */ U(rn, {
1137
1158
  payload: e,
1138
- grain: N.grain,
1139
- expandedIds: N.expandedIds,
1140
- selectedId: N.selectedId,
1141
- focusedId: N.navigatorFocusedId,
1142
- filter: N.navigatorFilter,
1143
- onStateAction: (t) => I(t, () => {
1159
+ lineCounts: k,
1160
+ grain: P.grain,
1161
+ expandedIds: P.expandedIds,
1162
+ selectedId: P.selectedId,
1163
+ focusedId: P.navigatorFocusedId,
1164
+ filter: P.navigatorFilter,
1165
+ onStateAction: (t) => L(t, () => {
1144
1166
  t.type === "select" ? i?.(t.id, e.nodes.find((e) => e.id === t.id) ?? null) : t.type === "clear-selection" ? i?.(null, null) : t.type === "set-expanded" ? n?.({
1145
- level: N.grain,
1167
+ level: P.grain,
1146
1168
  expanded: Array.from(t.ids)
1147
1169
  }) : t.type === "open-in-map" && (i?.(t.id, e.nodes.find((e) => e.id === t.id) ?? null), C?.("canvas"));
1148
1170
  }),
1149
1171
  ariaLabel: `browse ${u}`
1150
- }) : null), re = P === "navigator" && ne !== null;
1151
- return /* @__PURE__ */ H("div", {
1172
+ }) : null), re = F === "navigator" && ne !== null;
1173
+ return /* @__PURE__ */ U("div", {
1152
1174
  className: ["gmp-root", b].filter(Boolean).join(" "),
1153
- children: /* @__PURE__ */ U(oe, {
1175
+ children: /* @__PURE__ */ W(ae, {
1154
1176
  toolbar: ee,
1155
1177
  rail: f,
1156
1178
  sheetTitle: m,
1157
1179
  sheetMeta: h,
1158
1180
  railSide: g,
1159
- children: [/* @__PURE__ */ H("div", {
1181
+ children: [/* @__PURE__ */ U("div", {
1160
1182
  className: ["gmp-map-canvas-region", v].filter(Boolean).join(" "),
1161
1183
  style: y,
1162
1184
  "data-testid": "gmp-map-canvas-region",
1163
1185
  children: re ? ne : te
1164
- }), !re && _ !== !1 && (_ ?? /* @__PURE__ */ H(dn, {}))]
1186
+ }), !re && _ !== !1 && (_ ?? /* @__PURE__ */ U(un, {}))]
1165
1187
  })
1166
1188
  });
1167
1189
  }
1168
- function dn() {
1169
- return /* @__PURE__ */ U("p", {
1190
+ function un() {
1191
+ return /* @__PURE__ */ W("p", {
1170
1192
  className: "gmp-map-legend",
1171
1193
  children: [
1172
- /* @__PURE__ */ U("span", {
1194
+ /* @__PURE__ */ W("span", {
1173
1195
  className: "gmp-legend-item",
1174
- children: [/* @__PURE__ */ H("span", {
1196
+ children: [/* @__PURE__ */ U("span", {
1175
1197
  className: "gmp-map-swatch",
1176
1198
  "aria-hidden": "true"
1177
1199
  }), " code area (folder or file)"]
1178
1200
  }),
1179
- /* @__PURE__ */ U("span", {
1201
+ /* @__PURE__ */ W("span", {
1180
1202
  className: "gmp-legend-item gmp-legend-dim",
1181
- children: [/* @__PURE__ */ H("span", {
1203
+ children: [/* @__PURE__ */ U("span", {
1182
1204
  className: "gmp-map-swatch gmp-map-swatch--empty",
1183
1205
  "aria-hidden": "true"
1184
1206
  }), " no saved conversation behind it"]
1185
1207
  }),
1186
- /* @__PURE__ */ H("span", {
1208
+ /* @__PURE__ */ U("span", {
1187
1209
  className: "gmp-legend-item gmp-legend-dim",
1188
1210
  children: "brighter = more of it built with AI on record"
1189
1211
  }),
1190
- /* @__PURE__ */ U("span", {
1212
+ /* @__PURE__ */ W("span", {
1191
1213
  className: "gmp-legend-item gmp-legend-dim",
1192
- children: [/* @__PURE__ */ H("span", {
1214
+ children: [/* @__PURE__ */ U("span", {
1193
1215
  className: "gmp-map-swatch gmp-map-swatch--edge",
1194
1216
  "aria-hidden": "true"
1195
1217
  }), " one area uses another"]
1196
1218
  }),
1197
- /* @__PURE__ */ H("span", {
1219
+ /* @__PURE__ */ U("span", {
1198
1220
  className: "gmp-legend-item gmp-map-legend-danger",
1199
1221
  children: "⚠ tangle — two areas that depend on each other"
1200
1222
  }),
1201
- /* @__PURE__ */ H("span", {
1223
+ /* @__PURE__ */ U("span", {
1202
1224
  className: "gmp-legend-item gmp-legend-dim",
1203
1225
  children: "double-click a folder to open its files"
1204
1226
  })
@@ -1207,26 +1229,26 @@ function dn() {
1207
1229
  }
1208
1230
  //#endregion
1209
1231
  //#region src/ui/graph/timelineNavigation.js
1210
- function J(e) {
1232
+ function Y(e) {
1211
1233
  return typeof e == "object" && !!e && !Array.isArray(e);
1212
1234
  }
1213
- function Y(e, t) {
1235
+ function X(e, t) {
1214
1236
  let n = Object.keys(e).sort();
1215
1237
  return n.length === t.length && t.slice().sort().every((e, t) => e === n[t]);
1216
1238
  }
1217
- function X(e) {
1239
+ function dn(e) {
1218
1240
  return typeof e == "string" && e.length > 0;
1219
1241
  }
1220
1242
  function fn(e) {
1221
- return e === null || X(e);
1243
+ return e === null || dn(e);
1222
1244
  }
1223
1245
  function pn(e) {
1224
1246
  let t = !1;
1225
- if (J(e) && typeof e.type == "string" && (e.type === "open-change" && Y(e, ["type", "change"]) && J(e.change) ? t = Y(e.change, ["id", "branch"]) && X(e.change.id) && fn(e.change.branch) : e.type === "open-session" && Y(e, [
1247
+ if (Y(e) && typeof e.type == "string" && (e.type === "open-change" && X(e, ["type", "change"]) && Y(e.change) ? t = X(e.change, ["id", "branch"]) && dn(e.change.id) && fn(e.change.branch) : e.type === "open-session" && X(e, [
1226
1248
  "type",
1227
1249
  "sessionId",
1228
1250
  "source"
1229
- ]) && X(e.sessionId) && J(e.source) ? e.source.kind === "commit" && Y(e.source, ["kind", "commit"]) && J(e.source.commit) ? t = Y(e.source.commit, ["id", "branch"]) && X(e.source.commit.id) && fn(e.source.commit.branch) : (e.source.kind === "unlinked" || e.source.kind === "outside-window") && Y(e.source, ["kind"]) && (t = !0) : (e.type === "open-map" || e.type === "show-older") && Y(e, ["type"]) && (t = !0)), !t) throw TypeError([
1251
+ ]) && dn(e.sessionId) && Y(e.source) ? e.source.kind === "commit" && X(e.source, ["kind", "commit"]) && Y(e.source.commit) ? t = X(e.source.commit, ["id", "branch"]) && dn(e.source.commit.id) && fn(e.source.commit.branch) : (e.source.kind === "unlinked" || e.source.kind === "outside-window") && X(e.source, ["kind"]) && (t = !0) : (e.type === "open-map" || e.type === "show-older") && X(e, ["type"]) && (t = !0)), !t) throw TypeError([
1230
1252
  "Timeline navigation action rejected.",
1231
1253
  "What went wrong: the value is not an exact supported TimelineNavigationAction.",
1232
1254
  "Why it happened: an untyped caller supplied an unknown action, missing context, or extra fields.",
@@ -1241,18 +1263,18 @@ function pn(e) {
1241
1263
  function mn({ tag: e, hoverText: t, active: n = !1, onToggle: r, className: i = "", ...a }) {
1242
1264
  if (!p.includes(e)) throw Error(`ScentTag render failed: what went wrong: unknown scent tag ${JSON.stringify(e)}; why: the value is not a member of the closed SCENT_TAGS set; where: src/ui/graph/ScentTag.jsx; when: rendering a ranked-list row; what it means: an upstream ranking derivation produced a value outside the frozen vocabulary; how to fix: only pass one of ${p.join(", ")}.`);
1243
1265
  if (!r) {
1244
- let n = /* @__PURE__ */ H("span", {
1266
+ let n = /* @__PURE__ */ U("span", {
1245
1267
  className: `tlp-scent${i ? ` ${i}` : ""}`,
1246
1268
  tabIndex: t ? 0 : void 0,
1247
1269
  ...a,
1248
1270
  children: e
1249
1271
  });
1250
- return t ? /* @__PURE__ */ H(xe, {
1272
+ return t ? /* @__PURE__ */ U(be, {
1251
1273
  content: t,
1252
1274
  children: n
1253
1275
  }) : n;
1254
1276
  }
1255
- let o = /* @__PURE__ */ H("button", {
1277
+ let o = /* @__PURE__ */ U("button", {
1256
1278
  type: "button",
1257
1279
  className: `tlp-scent tlp-scent-filter${n ? " tlp-scent-filter-active" : ""}${i ? ` ${i}` : ""}`,
1258
1280
  "aria-pressed": n,
@@ -1260,7 +1282,7 @@ function mn({ tag: e, hoverText: t, active: n = !1, onToggle: r, className: i =
1260
1282
  ...a,
1261
1283
  children: e
1262
1284
  });
1263
- return t ? /* @__PURE__ */ H(xe, {
1285
+ return t ? /* @__PURE__ */ U(be, {
1264
1286
  content: t,
1265
1287
  children: o
1266
1288
  }) : o;
@@ -1268,7 +1290,7 @@ function mn({ tag: e, hoverText: t, active: n = !1, onToggle: r, className: i =
1268
1290
  //#endregion
1269
1291
  //#region src/ui/graph/RankedRow.jsx
1270
1292
  function hn({ row: e, loc: t = 0, selected: n = !1, onSelect: r, className: i = "", ...a }) {
1271
- return /* @__PURE__ */ U("button", {
1293
+ return /* @__PURE__ */ W("button", {
1272
1294
  type: "button",
1273
1295
  className: [
1274
1296
  "tlp-ranked-row",
@@ -1279,9 +1301,9 @@ function hn({ row: e, loc: t = 0, selected: n = !1, onSelect: r, className: i =
1279
1301
  onClick: () => r?.(e.id),
1280
1302
  ...a,
1281
1303
  children: [
1282
- /* @__PURE__ */ H(I, {
1304
+ /* @__PURE__ */ U(I, {
1283
1305
  className: "tlp-ranked-doi-scope",
1284
- children: /* @__PURE__ */ H(ye, {
1306
+ children: /* @__PURE__ */ U(ve, {
1285
1307
  label: e.name,
1286
1308
  loc: t,
1287
1309
  recorded: Math.round(e.doi * 100) / 100,
@@ -1291,23 +1313,23 @@ function hn({ row: e, loc: t = 0, selected: n = !1, onSelect: r, className: i =
1291
1313
  className: "tlp-ranked-doi"
1292
1314
  })
1293
1315
  }),
1294
- /* @__PURE__ */ H("span", {
1316
+ /* @__PURE__ */ U("span", {
1295
1317
  className: "tlp-ranked-name",
1296
1318
  title: e.name,
1297
1319
  children: e.name
1298
1320
  }),
1299
- /* @__PURE__ */ H("span", {
1321
+ /* @__PURE__ */ U("span", {
1300
1322
  className: "tlp-ranked-tags",
1301
1323
  "aria-label": "comprehension signals",
1302
- children: e.scentTags.map((t) => /* @__PURE__ */ H(mn, {
1324
+ children: e.scentTags.map((t) => /* @__PURE__ */ U(mn, {
1303
1325
  tag: t,
1304
1326
  hoverText: t.startsWith("agent wrote:") ? e.hoverText ?? void 0 : void 0
1305
1327
  }, t))
1306
1328
  }),
1307
- /* @__PURE__ */ H("span", {
1329
+ /* @__PURE__ */ U("span", {
1308
1330
  className: "tlp-ranked-doi-val tnum",
1309
1331
  "aria-hidden": "true",
1310
- children: Ee(e.doi, 2)
1332
+ children: Te(e.doi, 2)
1311
1333
  })
1312
1334
  ]
1313
1335
  });
@@ -1320,7 +1342,7 @@ var Z = [
1320
1342
  "churn"
1321
1343
  ];
1322
1344
  function gn({ rankMode: e, onChange: t, className: n = "", ...r }) {
1323
- let i = B([]), a = (e) => {
1345
+ let i = V([]), a = (e) => {
1324
1346
  let n = Z[e];
1325
1347
  n && (t(n), i.current[e]?.focus());
1326
1348
  }, o = (e, t) => {
@@ -1344,12 +1366,12 @@ function gn({ rankMode: e, onChange: t, className: n = "", ...r }) {
1344
1366
  }
1345
1367
  e.preventDefault(), a(n);
1346
1368
  };
1347
- return /* @__PURE__ */ H("span", {
1369
+ return /* @__PURE__ */ U("span", {
1348
1370
  className: `tlp-rank-mode${n ? ` ${n}` : ""}`,
1349
1371
  role: "radiogroup",
1350
1372
  "aria-label": "rank mode",
1351
1373
  ...r,
1352
- children: Z.map((n, r) => /* @__PURE__ */ H("button", {
1374
+ children: Z.map((n, r) => /* @__PURE__ */ U("button", {
1353
1375
  type: "button",
1354
1376
  role: "radio",
1355
1377
  "aria-checked": e === n,
@@ -1367,7 +1389,7 @@ function gn({ rankMode: e, onChange: t, className: n = "", ...r }) {
1367
1389
  //#endregion
1368
1390
  //#region src/ui/graph/InsightPanel.jsx
1369
1391
  function _n({ insights: e, onOpenEvidence: t, className: n = "", ...r }) {
1370
- if (d(e), e.length === 0) return /* @__PURE__ */ H("p", {
1392
+ if (d(e), e.length === 0) return /* @__PURE__ */ U("p", {
1371
1393
  className: `tlp-insight-empty${n ? ` ${n}` : ""}`,
1372
1394
  ...r,
1373
1395
  children: "no insights recorded for this node yet."
@@ -1377,35 +1399,35 @@ function _n({ insights: e, onOpenEvidence: t, className: n = "", ...r }) {
1377
1399
  let e = i.get(t.kind) ?? [];
1378
1400
  e.push(t), i.set(t.kind, e);
1379
1401
  }
1380
- return /* @__PURE__ */ H("div", {
1402
+ return /* @__PURE__ */ U("div", {
1381
1403
  className: `tlp-insight-panel${n ? ` ${n}` : ""}`,
1382
1404
  ...r,
1383
- children: [...i.entries()].map(([e, n]) => /* @__PURE__ */ U("section", {
1405
+ children: [...i.entries()].map(([e, n]) => /* @__PURE__ */ W("section", {
1384
1406
  className: "tlp-insight-group",
1385
1407
  "aria-label": C[e],
1386
- children: [/* @__PURE__ */ H("p", {
1408
+ children: [/* @__PURE__ */ U("p", {
1387
1409
  className: "tlp-insight-group-title",
1388
1410
  children: C[e]
1389
- }), /* @__PURE__ */ H("ul", {
1411
+ }), /* @__PURE__ */ U("ul", {
1390
1412
  className: "tlp-insight-list",
1391
- children: n.map((e, n) => /* @__PURE__ */ U("li", {
1413
+ children: n.map((e, n) => /* @__PURE__ */ W("li", {
1392
1414
  className: "tlp-insight-item",
1393
1415
  children: [
1394
- /* @__PURE__ */ H("span", {
1416
+ /* @__PURE__ */ U("span", {
1395
1417
  className: `tlp-insight-provenance ${s[e.provenance].markerClass}`,
1396
1418
  "aria-hidden": "true"
1397
1419
  }),
1398
- /* @__PURE__ */ H("span", {
1420
+ /* @__PURE__ */ U("span", {
1399
1421
  className: "tlp-insight-title",
1400
1422
  children: e.title
1401
1423
  }),
1402
- e.summary && /* @__PURE__ */ H("span", {
1424
+ e.summary && /* @__PURE__ */ U("span", {
1403
1425
  className: "tlp-insight-summary",
1404
1426
  children: e.summary
1405
1427
  }),
1406
- /* @__PURE__ */ H("span", {
1428
+ /* @__PURE__ */ U("span", {
1407
1429
  className: "tlp-insight-evidence",
1408
- children: e.evidence.map((e, n) => /* @__PURE__ */ H("button", {
1430
+ children: e.evidence.map((e, n) => /* @__PURE__ */ U("button", {
1409
1431
  type: "button",
1410
1432
  className: "tlp-insight-evidence-link",
1411
1433
  onClick: () => t?.(e.sessionId),
@@ -1591,9 +1613,9 @@ function Sn(e) {
1591
1613
  //#endregion
1592
1614
  //#region src/ui/transcript/graph/engine/useCanvasSync.js
1593
1615
  function Cn(e, t, n) {
1594
- let r = Ft();
1616
+ let r = Pt();
1595
1617
  return {
1596
- focusPhase: L((i) => {
1618
+ focusPhase: R((i) => {
1597
1619
  let a = e[i];
1598
1620
  if (!a) return;
1599
1621
  let o = /* @__PURE__ */ new Set();
@@ -1621,7 +1643,7 @@ function Cn(e, t, n) {
1621
1643
  r,
1622
1644
  n
1623
1645
  ]),
1624
- focusTurn: L((e) => {
1646
+ focusTurn: R((e) => {
1625
1647
  let n = t[e]?.index ?? e, i = r.getNodes().find((e) => e.type === "turn" && e.data.turn.index === n);
1626
1648
  i && r.setCenter(i.position.x + Q.turnWidth / 2, i.position.y + Q.turnBaseHeight / 2, {
1627
1649
  zoom: 1,
@@ -1639,17 +1661,17 @@ function wn(e, t) {
1639
1661
  }
1640
1662
  function Tn({ data: e, selected: t }) {
1641
1663
  let { turn: n, annotations: r, isSearchMatch: i, isFilteredOut: a, isSelected: o, turnNumber: s, provider: c } = e, l = n.depth ?? 0, u = n.role === "assistant" && l > 0, d = r.some((e) => e.type === "error"), f = r.some((e) => e.type === "retry"), p = r.some((e) => e.type === "revert");
1642
- return /* @__PURE__ */ U("div", {
1664
+ return /* @__PURE__ */ W("div", {
1643
1665
  "data-turn-index": n.index,
1644
1666
  "data-harness": u ? void 0 : n.role === "assistant" ? c : void 0,
1645
1667
  style: { width: Q.turnWidth },
1646
1668
  children: [
1647
- /* @__PURE__ */ H(G, {
1669
+ /* @__PURE__ */ U(K, {
1648
1670
  type: "target",
1649
- position: K.Top,
1671
+ position: q.Top,
1650
1672
  className: "tb-gnode-handle tb-gnode-handle-top"
1651
1673
  }),
1652
- /* @__PURE__ */ H(O, {
1674
+ /* @__PURE__ */ U(O, {
1653
1675
  role: n.role,
1654
1676
  agentName: u ? n.agentName : void 0,
1655
1677
  turnNumber: s,
@@ -1666,21 +1688,21 @@ function Tn({ data: e, selected: t }) {
1666
1688
  isSelected: t || o,
1667
1689
  provider: c
1668
1690
  }),
1669
- /* @__PURE__ */ H(G, {
1691
+ /* @__PURE__ */ U(K, {
1670
1692
  type: "source",
1671
- position: K.Bottom,
1693
+ position: q.Bottom,
1672
1694
  className: "tb-gnode-handle tb-gnode-handle-bottom"
1673
1695
  }),
1674
- /* @__PURE__ */ H(G, {
1696
+ /* @__PURE__ */ U(K, {
1675
1697
  type: "source",
1676
1698
  id: "tool-source",
1677
- position: K.Right,
1699
+ position: q.Right,
1678
1700
  className: "tb-gnode-handle tb-gnode-handle-right"
1679
1701
  })
1680
1702
  ]
1681
1703
  });
1682
1704
  }
1683
- var En = ke(Tn);
1705
+ var En = Oe(Tn);
1684
1706
  //#endregion
1685
1707
  //#region src/ui/transcript/graph/engine/nodes/ToolPillNode.jsx
1686
1708
  function Dn({ data: e }) {
@@ -1693,14 +1715,14 @@ function Dn({ data: e }) {
1693
1715
  exitCode: e.exitCode ?? void 0,
1694
1716
  preview: n[e.id] ?? ""
1695
1717
  }));
1696
- return /* @__PURE__ */ U("div", {
1718
+ return /* @__PURE__ */ W("div", {
1697
1719
  style: { width: Q.toolCallWidth },
1698
- children: [/* @__PURE__ */ H(G, {
1720
+ children: [/* @__PURE__ */ U(K, {
1699
1721
  type: "target",
1700
1722
  id: "tool-target",
1701
- position: K.Left,
1723
+ position: q.Left,
1702
1724
  className: "tb-gnode-handle tb-gnode-handle-left"
1703
- }), /* @__PURE__ */ H(ee, {
1725
+ }), /* @__PURE__ */ U(L, {
1704
1726
  tools: o,
1705
1727
  totalDurationMs: r,
1706
1728
  hasError: i,
@@ -1708,59 +1730,59 @@ function Dn({ data: e }) {
1708
1730
  })]
1709
1731
  });
1710
1732
  }
1711
- var On = ke(Dn);
1733
+ var On = Oe(Dn);
1712
1734
  //#endregion
1713
1735
  //#region src/ui/transcript/graph/engine/nodes/SubagentBranchNode.jsx
1714
1736
  function kn({ data: e }) {
1715
1737
  let { agentName: t, depth: n } = e;
1716
- return /* @__PURE__ */ H(fe, {
1738
+ return /* @__PURE__ */ U(de, {
1717
1739
  agentName: t,
1718
1740
  depth: n
1719
1741
  });
1720
1742
  }
1721
- var An = ke(kn);
1743
+ var An = Oe(kn);
1722
1744
  //#endregion
1723
1745
  //#region src/ui/transcript/graph/engine/GraphControls.jsx
1724
1746
  function jn({ className: e = "" }) {
1725
- let t = Ft();
1726
- return /* @__PURE__ */ U("div", {
1747
+ let t = Pt();
1748
+ return /* @__PURE__ */ W("div", {
1727
1749
  className: ["tb-graph-controls", e].filter(Boolean).join(" "),
1728
1750
  children: [
1729
- /* @__PURE__ */ H(Mn, {
1751
+ /* @__PURE__ */ U(Mn, {
1730
1752
  label: "zoom in",
1731
1753
  onClick: () => t.zoomIn({ duration: 150 }),
1732
- children: /* @__PURE__ */ H(Ke, {
1754
+ children: /* @__PURE__ */ U(Ge, {
1733
1755
  size: 14,
1734
1756
  strokeWidth: 2
1735
1757
  })
1736
1758
  }),
1737
- /* @__PURE__ */ H(Mn, {
1759
+ /* @__PURE__ */ U(Mn, {
1738
1760
  label: "zoom out",
1739
1761
  onClick: () => t.zoomOut({ duration: 150 }),
1740
- children: /* @__PURE__ */ H(Ge, {
1762
+ children: /* @__PURE__ */ U(We, {
1741
1763
  size: 14,
1742
1764
  strokeWidth: 2
1743
1765
  })
1744
1766
  }),
1745
- /* @__PURE__ */ H(Mn, {
1767
+ /* @__PURE__ */ U(Mn, {
1746
1768
  label: "fit view",
1747
1769
  onClick: () => t.fitView({
1748
1770
  padding: .1,
1749
1771
  duration: 250
1750
1772
  }),
1751
- children: /* @__PURE__ */ H(Ue, {
1773
+ children: /* @__PURE__ */ U(He, {
1752
1774
  size: 14,
1753
1775
  strokeWidth: 1.75
1754
1776
  })
1755
1777
  }),
1756
- /* @__PURE__ */ H(Mn, {
1778
+ /* @__PURE__ */ U(Mn, {
1757
1779
  label: "reset",
1758
1780
  onClick: () => t.setViewport({
1759
1781
  x: 0,
1760
1782
  y: 0,
1761
1783
  zoom: 1
1762
1784
  }, { duration: 200 }),
1763
- children: /* @__PURE__ */ H(qe, {
1785
+ children: /* @__PURE__ */ U(Ke, {
1764
1786
  size: 14,
1765
1787
  strokeWidth: 1.75
1766
1788
  })
@@ -1769,7 +1791,7 @@ function jn({ className: e = "" }) {
1769
1791
  });
1770
1792
  }
1771
1793
  function Mn({ label: e, onClick: t, children: n }) {
1772
- return /* @__PURE__ */ H("button", {
1794
+ return /* @__PURE__ */ U("button", {
1773
1795
  type: "button",
1774
1796
  onClick: t,
1775
1797
  "aria-label": e,
@@ -1781,8 +1803,8 @@ function Mn({ label: e, onClick: t, children: n }) {
1781
1803
  //#endregion
1782
1804
  //#region src/ui/transcript/graph/engine/TrajectoryGraphLegend.jsx
1783
1805
  function Nn({ provider: e, className: t = "" }) {
1784
- let n = e && Te(e).toLocaleLowerCase("en-US") || "agent";
1785
- return /* @__PURE__ */ H(se, {
1806
+ let n = e && we(e).toLocaleLowerCase("en-US") || "agent";
1807
+ return /* @__PURE__ */ U(oe, {
1786
1808
  className: ["tb-graph-legend", t].filter(Boolean).join(" "),
1787
1809
  items: [
1788
1810
  {
@@ -1817,15 +1839,15 @@ var Pn = {
1817
1839
  subagentLane: An
1818
1840
  };
1819
1841
  function Fn(e) {
1820
- return /* @__PURE__ */ H(Mt, { children: /* @__PURE__ */ H(In, { ...e }) });
1842
+ return /* @__PURE__ */ U(jt, { children: /* @__PURE__ */ U(In, { ...e }) });
1821
1843
  }
1822
1844
  function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotations: i, searchMatches: a, searchQuery: o, activeMatchIndex: s, focusTurn: c, focusPhase: l, onPhaseActivate: u, onViewportChange: d, selectedTurns: f, provider: p, className: m = "" }) {
1823
- let h = Ft(), { focusTurn: g, focusPhase: _ } = Cn(r, e, u), v = z(() => {
1845
+ let h = Pt(), { focusTurn: g, focusPhase: _ } = Cn(r, e, u), v = B(() => {
1824
1846
  if (n.length === e.length) return /* @__PURE__ */ new Set();
1825
1847
  let t = new Set(n), r = /* @__PURE__ */ new Set();
1826
1848
  for (let n = 0; n < e.length; n++) t.has(e[n]) && r.add(n);
1827
1849
  return r;
1828
- }, [e, n]), y = z(() => xn({
1850
+ }, [e, n]), y = B(() => xn({
1829
1851
  turns: e,
1830
1852
  toolVMsByTurn: t,
1831
1853
  phases: r,
@@ -1843,13 +1865,13 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1843
1865
  v,
1844
1866
  o,
1845
1867
  f
1846
- ]), b = z(() => y.nodes.map((e) => e.type === "turn" ? {
1868
+ ]), b = B(() => y.nodes.map((e) => e.type === "turn" ? {
1847
1869
  ...e,
1848
1870
  data: {
1849
1871
  ...e.data,
1850
1872
  provider: p
1851
1873
  }
1852
- } : e), [y.nodes, p]), x = z(() => Sn(b), [b]), S = z(() => y.edges.map((e) => {
1874
+ } : e), [y.nodes, p]), x = B(() => Sn(b), [b]), S = B(() => y.edges.map((e) => {
1853
1875
  let t = e.sourceHandle === "tool-source";
1854
1876
  return {
1855
1877
  ...e,
@@ -1862,8 +1884,8 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1862
1884
  },
1863
1885
  animated: t ? !1 : e.animated
1864
1886
  };
1865
- }), [y.edges]), C = z(() => [...x, ...b], [x, b]), [w, T, E] = Pt(C), [D, O, k] = Nt(S), A = B(e.length), j = B(o), M = B(n.length);
1866
- R(() => {
1887
+ }), [y.edges]), C = B(() => [...x, ...b], [x, b]), [w, T, E] = Nt(C), [D, O, k] = Mt(S), A = V(e.length), j = V(o), M = V(n.length);
1888
+ z(() => {
1867
1889
  (e.length !== A.current || o !== j.current || n.length !== M.current) && (T(C), O(S), A.current = e.length, j.current = o, M.current = n.length);
1868
1890
  }, [
1869
1891
  C,
@@ -1873,7 +1895,7 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1873
1895
  n.length,
1874
1896
  T,
1875
1897
  O
1876
- ]), R(() => {
1898
+ ]), z(() => {
1877
1899
  if (s === void 0) return;
1878
1900
  let t = e[s]?.index;
1879
1901
  if (t === void 0) return;
@@ -1888,16 +1910,16 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1888
1910
  h,
1889
1911
  e
1890
1912
  ]);
1891
- let N = B(-1);
1892
- R(() => {
1913
+ let N = V(-1);
1914
+ z(() => {
1893
1915
  !c || c.seq === N.current || (N.current = c.seq, g(c.target));
1894
1916
  }, [c, g]);
1895
- let P = B(-1);
1896
- R(() => {
1917
+ let P = V(-1);
1918
+ z(() => {
1897
1919
  !l || l.seq === P.current || (P.current = l.seq, _(l.target));
1898
1920
  }, [l, _]);
1899
- let F = B(!1);
1900
- R(() => {
1921
+ let F = V(!1);
1922
+ z(() => {
1901
1923
  w.length > 0 && !F.current && (F.current = !0, setTimeout(() => {
1902
1924
  let e = w.find((e) => e.type === "turn");
1903
1925
  e ? h.setCenter(e.position.x + Q.turnWidth / 2, e.position.y + Q.turnBaseHeight, {
@@ -1913,13 +1935,13 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1913
1935
  h,
1914
1936
  w
1915
1937
  ]);
1916
- let I = L((e) => {
1938
+ let I = R((e) => {
1917
1939
  if (e.type === "turn") {
1918
1940
  let t = e.data;
1919
1941
  return t.annotations?.some?.((e) => e.type === "error") ? "var(--danger)" : t.isFilteredOut ? "var(--rule)" : t.turn.role === "user" ? "var(--teal)" : t.turn.role === "assistant" ? "var(--amber)" : "var(--ink-2)";
1920
1942
  }
1921
1943
  return e.type === "toolCall" ? "var(--ink-3)" : "var(--rule)";
1922
- }, []), ee = L((e, t) => {
1944
+ }, []), L = R((e, t) => {
1923
1945
  if (t.type !== "turn") return;
1924
1946
  let n = t.data;
1925
1947
  d?.({
@@ -1927,21 +1949,21 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1927
1949
  end: n.turn.index
1928
1950
  });
1929
1951
  }, [d]);
1930
- return /* @__PURE__ */ H("div", {
1952
+ return /* @__PURE__ */ U("div", {
1931
1953
  className: [
1932
1954
  "tb-root",
1933
1955
  "tb-graph",
1934
1956
  m
1935
1957
  ].filter(Boolean).join(" "),
1936
- children: /* @__PURE__ */ U("div", {
1958
+ children: /* @__PURE__ */ W("div", {
1937
1959
  className: "tb-graph-flow",
1938
1960
  children: [
1939
- /* @__PURE__ */ U(jt, {
1961
+ /* @__PURE__ */ W(At, {
1940
1962
  nodes: w,
1941
1963
  edges: D,
1942
1964
  onNodesChange: E,
1943
1965
  onEdgesChange: k,
1944
- onNodeClick: ee,
1966
+ onNodeClick: L,
1945
1967
  nodeTypes: Pn,
1946
1968
  fitView: !1,
1947
1969
  minZoom: .2,
@@ -1958,12 +1980,12 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1958
1980
  panOnDrag: !0,
1959
1981
  panOnScroll: !0,
1960
1982
  zoomOnScroll: !0,
1961
- children: [/* @__PURE__ */ H(Ot, {
1962
- variant: kt.Dots,
1983
+ children: [/* @__PURE__ */ U(Dt, {
1984
+ variant: Ot.Dots,
1963
1985
  gap: 20,
1964
1986
  size: 1,
1965
1987
  color: "var(--rule)"
1966
- }), /* @__PURE__ */ H(At, {
1988
+ }), /* @__PURE__ */ U(kt, {
1967
1989
  zoomable: !0,
1968
1990
  pannable: !0,
1969
1991
  nodeColor: I,
@@ -1973,11 +1995,11 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1973
1995
  className: "tb-graph-minimap"
1974
1996
  })]
1975
1997
  }),
1976
- /* @__PURE__ */ H(jn, {}),
1977
- /* @__PURE__ */ H(Nn, { provider: p })
1998
+ /* @__PURE__ */ U(jn, {}),
1999
+ /* @__PURE__ */ U(Nn, { provider: p })
1978
2000
  ]
1979
2001
  })
1980
2002
  });
1981
2003
  }
1982
2004
  //#endregion
1983
- export { tt as AllChangeBindings, nt as AllDiffLineKinds, rt as AllEdgeViolationKinds, it as AllFileChangeStatuses, at as AllInsightKinds, ot as AllInsightProvenances, st as AllMapNodeKinds, ct as AllReadAttributionStates, lt as AllReadStateGrades, de as CHANGE_BINDINGS, D as CODE_MAP_STATE_VERSION, ve as CODE_MAP_VIEWPORT_SCALE, a as COVERAGE_CAP, ut as ChangeBinding, Xt as ChangeDetail, Ht as Changes, $t as CodeMap, un as CodeMapComposition, an as CodeMapNavigator, i as DEBT_VIEWED, u as DIFF_LINE_KINDS, h as DOI_WEIGHTS, dn as DefaultMapLegend, dt as DiffLineKind, $ as EDGE_DEFAULTS, T as EDGE_VIOLATION_KINDS, ft as EdgeViolationKind, w as FILE_CHANGE_STATUSES, pt as FileChangeStatus, me as GRAPH_APP_SECTIONS, ge as GRAPH_LEGEND_ITEMS, ae as GhostCommitNode, he as GhostGroup, j as GraphAppShell, jn as GraphControls, se as GraphLegend, ie as GraphSectionNav, fe as GraphSubagentBranch, ee as GraphToolNode, O as GraphTurnNode, k as HighlightEdge, mt as InsightKind, _n as InsightPanel, ht as InsightProvenance, P as LOCAL_APP_SECTIONS, E as MAP_NODE_KINDS, gt as MapNodeKind, Q as NODE_DIMENSIONS, re as RANK_CAP, t as RANK_FLOOR, ne as RECENCY_HALF_LIFE_DAYS, gn as RankModeControl, hn as RankedRow, _t as ReadAttributionState, vt as ReadStateGrade, p as SCENT_TAGS, mn as ScentTag, M as SessionLane, le as SessionOverflowDisclosure, An as SubagentBranchNode, On as ToolPillNode, te as TouchedFileCluster, Fn as TrajectoryGraph, Nn as TrajectoryGraphLegend, En as TurnCardNode, ce as VillageObservations, _ as assertChangeDetailPayloadEnums, e as assertChangeDiffPayloadEnums, N as assertCodeMapPayloadEnums, pn as assertTimelineNavigationAction, Bt as buildChangesGraph, en as codeMapPayloadToMapData, Ce as codeMapStatesEqual, Sn as computeLaneHeaders, m as coverage, A as createCodeMapState, g as debt, o as debtHoverText, l as debtState, Se as deriveCodeMapView, f as deriveRankedRows, y as deriveTimelineHighlight, v as gateRankedRows, q as humanizeAge, we as hunkClears, yt as isChangeBinding, r as isCodeMapViewportScale, bt as isDiffLineKind, xt as isEdgeViolationKind, St as isFileChangeStatus, Ct as isInsightKind, wt as isInsightProvenance, Tt as isMapNodeKind, Et as isReadAttributionState, Dt as isReadStateGrade, n as partialReadHoverText, S as rankMapNodes, c as rankMapNodesIntrinsic, be as reduceCodeMapState, b as resolveEscapeAction, x as scentTagsFor, xn as turnsToFlow, Cn as useCanvasSync };
2005
+ export { et as AllChangeBindings, tt as AllDiffLineKinds, nt as AllEdgeViolationKinds, rt as AllFileChangeStatuses, it as AllInsightKinds, at as AllInsightProvenances, ot as AllMapNodeKinds, st as AllReadAttributionStates, ct as AllReadStateGrades, ue as CHANGE_BINDINGS, D as CODE_MAP_STATE_VERSION, _e as CODE_MAP_VIEWPORT_SCALE, a as COVERAGE_CAP, lt as ChangeBinding, Yt as ChangeDetail, Vt as Changes, Qt as CodeMap, ln as CodeMapComposition, rn as CodeMapNavigator, i as DEBT_VIEWED, u as DIFF_LINE_KINDS, h as DOI_WEIGHTS, un as DefaultMapLegend, ut as DiffLineKind, $ as EDGE_DEFAULTS, T as EDGE_VIOLATION_KINDS, dt as EdgeViolationKind, w as FILE_CHANGE_STATUSES, ft as FileChangeStatus, pe as GRAPH_APP_SECTIONS, he as GRAPH_LEGEND_ITEMS, ie as GhostCommitNode, me as GhostGroup, j as GraphAppShell, jn as GraphControls, oe as GraphLegend, re as GraphSectionNav, de as GraphSubagentBranch, L as GraphToolNode, O as GraphTurnNode, k as HighlightEdge, pt as InsightKind, _n as InsightPanel, mt as InsightProvenance, P as LOCAL_APP_SECTIONS, E as MAP_NODE_KINDS, ht as MapNodeKind, Q as NODE_DIMENSIONS, ne as RANK_CAP, t as RANK_FLOOR, te as RECENCY_HALF_LIFE_DAYS, gn as RankModeControl, hn as RankedRow, gt as ReadAttributionState, _t as ReadStateGrade, p as SCENT_TAGS, mn as ScentTag, M as SessionLane, ce as SessionOverflowDisclosure, An as SubagentBranchNode, On as ToolPillNode, ee as TouchedFileCluster, Fn as TrajectoryGraph, Nn as TrajectoryGraphLegend, En as TurnCardNode, se as VillageObservations, _ as assertChangeDetailPayloadEnums, e as assertChangeDiffPayloadEnums, N as assertCodeMapPayloadEnums, pn as assertTimelineNavigationAction, zt as buildChangesGraph, $t as codeMapPayloadToMapData, Se as codeMapStatesEqual, Sn as computeLaneHeaders, m as coverage, A as createCodeMapState, g as debt, o as debtHoverText, l as debtState, xe as deriveCodeMapView, f as deriveRankedRows, y as deriveTimelineHighlight, v as gateRankedRows, J as humanizeAge, Ce as hunkClears, vt as isChangeBinding, r as isCodeMapViewportScale, yt as isDiffLineKind, bt as isEdgeViolationKind, xt as isFileChangeStatus, St as isInsightKind, Ct as isInsightProvenance, wt as isMapNodeKind, Tt as isReadAttributionState, Et as isReadStateGrade, n as partialReadHoverText, S as rankMapNodes, c as rankMapNodesIntrinsic, ye as reduceCodeMapState, b as resolveEscapeAction, x as scentTagsFor, xn as turnsToFlow, Cn as useCanvasSync };