@pihanga2/shadcn 0.2.23 → 0.2.25

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.
@@ -1,14 +1,14 @@
1
1
  import "./swimlane.types.js";
2
- import { describeSwimlaneTarget as e, formatTs as t, projectPending as n, relatedCallIds as r, rowTouches as i } from "./swimlane.model.js";
2
+ import { describeSwimlaneTarget as e, formatTs as t, projectPending as n, relatedCallIds as r, rowTouches as i, stepKeyOf as a, stepRows as o } from "./swimlane.model.js";
3
3
  import './swimlane.css';/* empty css */
4
- import { memo as a, useEffect as o, useId as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
5
- import f from "clsx";
6
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
4
+ import { memo as s, useEffect as c, useId as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
5
+ import m from "clsx";
6
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
7
7
  //#region src/cards/swimlane/swimlane.component.tsx
8
- var g = (e, t) => e.gutter + t * e.laneW + e.laneW / 2;
9
- function _(e, t, n, r, i, a, o, s = null) {
10
- n.forEach((n, c) => {
11
- let l = g(t, c);
8
+ var v = (e, t) => e.gutter + t * e.laneW + e.laneW / 2;
9
+ function y(e, t, n, r, i, a, o, s = null, c = {}, l = {}) {
10
+ n.forEach((n, u) => {
11
+ let d = v(t, u);
12
12
  [[
13
13
  r,
14
14
  0,
@@ -17,45 +17,49 @@ function _(e, t, n, r, i, a, o, s = null) {
17
17
  i,
18
18
  t.mid,
19
19
  t.rowH
20
- ]].forEach(([t, o, c], u) => {
21
- let d = t[n];
22
- d && (e.visuals.push(/* @__PURE__ */ m("line", {
23
- className: `swl-ll swl-ll-${d.state}`,
24
- x1: l,
25
- x2: l,
20
+ ]].forEach(([t, o, u], f) => {
21
+ let p = t[n];
22
+ p && (e.visuals.push(/* @__PURE__ */ g("line", {
23
+ className: `swl-ll swl-ll-${p.state}`,
24
+ x1: d,
25
+ x2: d,
26
26
  y1: o,
27
- y2: c
28
- }, `ll-${n}-${u}`)), d.acts.forEach((t, d) => {
29
- let p = l - 5 + d * 5, g = u === 1 && !r[n]?.acts.includes(t), _ = u === 0 && !i[n]?.acts.includes(t), v = `M${p},${o} V${c} M${p + 10},${o} V${c}` + (g ? ` M${p},${o} H${p + 10}` : "") + (_ ? ` M${p},${c} H${p + 10}` : "");
30
- e.visuals.push(/* @__PURE__ */ h("g", {
31
- className: f("swl-act", a === t ? "swl-hl" : s === t && "swl-hl-proc"),
32
- children: [/* @__PURE__ */ m("rect", {
33
- x: p,
27
+ y2: u
28
+ }, `ll-${n}-${f}`)), p.acts.forEach((t, p) => {
29
+ let h = d - 5 + p * 5, v = f === 1 && !r[n]?.acts.includes(t), y = f === 0 && !i[n]?.acts.includes(t), b = `M${h},${o} V${u} M${h + 10},${o} V${u}` + (v ? ` M${h},${o} H${h + 10}` : "") + (y ? ` M${h},${u} H${h + 10}` : ""), x = l[n];
30
+ e.visuals.push(/* @__PURE__ */ _("g", {
31
+ className: m("swl-act", c[n], a === t ? "swl-hl" : s === t && "swl-hl-proc"),
32
+ children: [/* @__PURE__ */ g("rect", {
33
+ x: h,
34
34
  y: o,
35
35
  width: 10,
36
- height: c - o
37
- }), /* @__PURE__ */ m("path", { d: v })]
38
- }, `a-${t}-${u}`)), e.hits.push(/* @__PURE__ */ m("rect", {
36
+ height: u - o,
37
+ style: x
38
+ }), /* @__PURE__ */ g("path", {
39
+ d: b,
40
+ style: x
41
+ })]
42
+ }, `a-${t}-${f}`)), e.hits.push(/* @__PURE__ */ g("rect", {
39
43
  className: "swl-hit",
40
- x: p - 8,
44
+ x: h - 8,
41
45
  y: o,
42
46
  width: 26,
43
- height: c - o,
47
+ height: u - o,
44
48
  "data-kind": "activity",
45
49
  "data-id": t,
46
50
  "data-lane": n
47
- }, `ha-${t}-${u}`));
51
+ }, `ha-${t}-${f}`));
48
52
  }));
49
- }), !r[n] && i[n] && e.visuals.push(/* @__PURE__ */ m("rect", {
53
+ }), !r[n] && i[n] && e.visuals.push(/* @__PURE__ */ g("rect", {
50
54
  className: "swl-lane-head",
51
- x: l - 16,
55
+ x: d - 16,
52
56
  y: t.mid - 5,
53
57
  width: 32,
54
58
  height: 10,
55
59
  rx: 2
56
- }, `h-${n}`), /* @__PURE__ */ h("text", {
60
+ }, `h-${n}`), /* @__PURE__ */ _("text", {
57
61
  className: "swl-lbl-muted",
58
- x: l + 20,
62
+ x: d + 20,
59
63
  y: t.mid + 3,
60
64
  children: [
61
65
  "+ ",
@@ -65,26 +69,26 @@ function _(e, t, n, r, i, a, o, s = null) {
65
69
  }, `ht-${n}`));
66
70
  });
67
71
  }
68
- function v(e, t, n, r) {
72
+ function b(e, t, n, r) {
69
73
  let i = n(r.from), a = n(r.to);
70
74
  if (i < 0 || a < 0) return;
71
- let o = g(t, i), s = g(t, a), c = f("swl-ar", r.cls, r.hl ? "swl-hl" : r.rel && "swl-hl-rel"), l = `url(#${t.mk}-${r.marker})`, u = {
75
+ let o = v(t, i), s = v(t, a), c = m("swl-ar", r.cls, r.hl ? "swl-hl" : r.rel && "swl-hl-rel"), l = `url(#${t.mk}-${r.marker})`, u = {
72
76
  "data-kind": r.kind,
73
77
  "data-id": r.hitId,
74
78
  "data-row": r.rowId
75
79
  };
76
80
  if (r.from === r.to) {
77
81
  let n = `M${o + 6},${t.mid - 9} h26 v16 h-20`;
78
- e.visuals.push(/* @__PURE__ */ m("path", {
82
+ e.visuals.push(/* @__PURE__ */ g("path", {
79
83
  className: c,
80
84
  d: n,
81
85
  markerEnd: l
82
- }, "ar"), /* @__PURE__ */ m("text", {
86
+ }, "ar"), /* @__PURE__ */ g("text", {
83
87
  className: "swl-lbl",
84
88
  x: o + 38,
85
89
  y: t.mid + 3,
86
90
  children: r.label
87
- }, "lb")), e.hits.push(/* @__PURE__ */ m("path", {
91
+ }, "lb")), e.hits.push(/* @__PURE__ */ g("path", {
88
92
  className: "swl-hit",
89
93
  d: n,
90
94
  strokeWidth: 14,
@@ -93,23 +97,23 @@ function v(e, t, n, r) {
93
97
  }, "hit"));
94
98
  return;
95
99
  }
96
- let d = Math.sign(s - o), p = o + d * 6, h = s - d * 6;
97
- e.visuals.push(/* @__PURE__ */ m("line", {
100
+ let d = Math.sign(s - o), f = o + d * 6, p = s - d * 6;
101
+ e.visuals.push(/* @__PURE__ */ g("line", {
98
102
  className: c,
99
- x1: p,
100
- x2: h,
103
+ x1: f,
104
+ x2: p,
101
105
  y1: t.mid,
102
106
  y2: t.mid,
103
107
  markerEnd: l
104
- }, "ar"), /* @__PURE__ */ m("text", {
108
+ }, "ar"), /* @__PURE__ */ g("text", {
105
109
  className: "swl-lbl",
106
- x: Math.min(p, h) + 8,
110
+ x: Math.min(f, p) + 8,
107
111
  y: t.mid - 5,
108
112
  children: r.label
109
- }, "lb")), e.hits.push(/* @__PURE__ */ m("line", {
113
+ }, "lb")), e.hits.push(/* @__PURE__ */ g("line", {
110
114
  className: "swl-hit",
111
- x1: p,
112
- x2: h,
115
+ x1: f,
116
+ x2: p,
113
117
  y1: t.mid,
114
118
  y2: t.mid,
115
119
  strokeWidth: 16,
@@ -117,164 +121,179 @@ function v(e, t, n, r) {
117
121
  ...u
118
122
  }, "hit"));
119
123
  }
120
- var y = {
124
+ var x = {
121
125
  sync: ["swl-ar-sync", "sync"],
122
126
  async: ["swl-ar-async", "async"],
123
127
  event: ["swl-ar-event", "event"]
124
- }, b = a(function({ row: e, g: n, laneOrder: r, laneLabels: i, width: a, hl: o, rel: s, proc: c }) {
125
- let l = {
128
+ }, S = s(function({ row: e, g: t, laneOrder: n, laneLabels: r, laneActivityClassName: i, laneActivityStyle: o, width: s, hl: c, rel: l, proc: u, fmtTs: d, grouped: f, stepHl: p }) {
129
+ let h = {
126
130
  visuals: [],
127
131
  hits: []
128
- }, u = (e) => r.indexOf(e);
129
- _(l, n, r, e.pre, e.post, o, i, c);
130
- let d = e.event;
131
- switch (d.type) {
132
+ }, S = (e) => n.indexOf(e);
133
+ y(h, t, n, e.pre, e.post, c, r, u, i, o);
134
+ let C = e.event;
135
+ switch (C.type) {
132
136
  case "call": {
133
- let [t, r] = y[d.kind];
134
- v(l, n, u, {
135
- from: d.from,
136
- to: d.to,
137
- cls: t,
137
+ let [n, r] = x[C.kind];
138
+ b(h, t, S, {
139
+ from: C.from,
140
+ to: C.to,
141
+ cls: n,
138
142
  marker: r,
139
- label: d.label,
140
- hitId: d.id,
143
+ label: C.label,
144
+ hitId: C.id,
141
145
  kind: "transition",
142
146
  rowId: e.id,
143
- hl: o === d.id,
144
- rel: s
147
+ hl: c === C.id,
148
+ rel: l
145
149
  });
146
150
  break;
147
151
  }
148
152
  case "reply":
149
- e.route && v(l, n, u, {
153
+ e.route && b(h, t, S, {
150
154
  from: e.route.to,
151
155
  to: e.route.from,
152
- cls: d.ok ? "swl-ar-reply" : "swl-ar-error",
153
- marker: d.ok ? "reply" : "error",
154
- label: d.label,
155
- hitId: d.id,
156
+ cls: C.ok ? "swl-ar-reply" : "swl-ar-error",
157
+ marker: C.ok ? "reply" : "error",
158
+ label: C.label,
159
+ hitId: C.id,
156
160
  kind: "transition",
157
161
  rowId: e.id,
158
- hl: o === d.id,
159
- rel: s
162
+ hl: c === C.id,
163
+ rel: l
160
164
  });
161
165
  break;
162
166
  case "done":
163
- e.route && l.visuals.push(/* @__PURE__ */ h("text", {
167
+ e.route && h.visuals.push(/* @__PURE__ */ _("text", {
164
168
  className: "swl-lbl-muted",
165
- x: g(n, u(e.route.to)) + 14,
166
- y: n.mid + 3,
169
+ x: v(t, S(e.route.to)) + 14,
170
+ y: t.mid + 3,
167
171
  children: ["✓ processed ", e.route.label]
168
172
  }, "dn"));
169
173
  break;
170
174
  case "state": {
171
- let t = g(n, u(d.lane));
172
- l.visuals.push(/* @__PURE__ */ m("circle", {
173
- cx: t,
174
- cy: n.mid,
175
+ let n = v(t, S(C.lane));
176
+ h.visuals.push(/* @__PURE__ */ g("circle", {
177
+ cx: n,
178
+ cy: t.mid,
175
179
  r: 5,
176
- className: `swl-dot-${d.state}`
177
- }, "st"), /* @__PURE__ */ h("text", {
180
+ className: `swl-dot-${C.state}`
181
+ }, "st")), (C.showLabel ?? !0) && h.visuals.push(/* @__PURE__ */ _("text", {
178
182
  className: "swl-lbl-muted",
179
- x: t + 10,
180
- y: n.mid + 3,
181
- children: ["→ ", d.state]
182
- }, "stl")), l.hits.push(/* @__PURE__ */ m("circle", {
183
+ x: n + 10,
184
+ y: t.mid + 3,
185
+ children: ["→ ", C.state]
186
+ }, "stl")), h.hits.push(/* @__PURE__ */ g("circle", {
183
187
  className: "swl-hit",
184
- cx: t,
185
- cy: n.mid,
188
+ cx: n,
189
+ cy: t.mid,
186
190
  r: 12,
187
191
  "data-kind": "state",
188
192
  "data-id": `state-${e.id}`,
189
- "data-lane": d.lane,
193
+ "data-lane": C.lane,
190
194
  "data-row": e.id
191
195
  }, "sth"));
192
196
  break;
193
197
  }
194
198
  }
195
- return /* @__PURE__ */ h("svg", {
196
- className: f("swl-row", e.fulfilled && "swl-arrived"),
197
- width: a,
198
- height: n.rowH,
199
+ return /* @__PURE__ */ _("svg", {
200
+ className: m("swl-row", e.fulfilled && "swl-arrived", f && "swl-grouped", p && "swl-hl-step"),
201
+ width: s,
202
+ height: t.rowH,
199
203
  "data-row": e.id,
200
204
  children: [
201
- /* @__PURE__ */ m("text", {
205
+ f ? /* @__PURE__ */ g("line", {
206
+ className: "swl-ts-tie",
207
+ x1: 6,
208
+ x2: 6,
209
+ y1: 0,
210
+ y2: t.rowH
211
+ }) : /* @__PURE__ */ g("text", {
202
212
  className: "swl-ts",
203
213
  x: 0,
204
- y: n.mid + 3,
205
- children: t(d.ts)
214
+ y: t.mid + 3,
215
+ children: d(C.ts)
206
216
  }),
207
- e.fulfilled && /* @__PURE__ */ h("text", {
208
- className: "swl-ok",
209
- x: n.gutter - 16,
210
- y: n.mid + 4,
211
- children: [/* @__PURE__ */ m("title", { children: "replaced an outstanding message" }), "✓"]
217
+ e.fulfilled && (() => {
218
+ let e = C.type === "reply" && C.ok === !1;
219
+ return /* @__PURE__ */ _("text", {
220
+ className: m("swl-ok", e && "swl-ok-error"),
221
+ x: t.gutter - 16,
222
+ y: t.mid + 4,
223
+ children: [/* @__PURE__ */ g("title", { children: e ? "replaced an outstanding message (error)" : "replaced an outstanding message" }), e ? "✗" : "✓"]
224
+ });
225
+ })(),
226
+ h.visuals,
227
+ /* @__PURE__ */ g("rect", {
228
+ className: "swl-hit",
229
+ x: 0,
230
+ y: 0,
231
+ width: t.gutter - 2,
232
+ height: t.rowH,
233
+ "data-kind": "step",
234
+ "data-id": a(e),
235
+ "data-row": e.id
212
236
  }),
213
- l.visuals,
214
- l.hits
237
+ h.hits
215
238
  ]
216
239
  });
217
- }), x = a(function({ row: e, g: t, laneOrder: n, laneLabels: r, width: i, hl: a, rel: o, proc: s, now: c }) {
218
- let l = {
240
+ }), C = (e) => `${(e / 1e3).toFixed(1)}s`, w = s(function({ row: e, g: t, laneOrder: n, laneLabels: r, laneActivityClassName: i, laneActivityStyle: a, width: o, hl: s, rel: c, proc: l, now: u, formatWait: d = C }) {
241
+ let f = {
219
242
  visuals: [],
220
243
  hits: []
221
- }, u = e.pending, d = c - u.since, p = u.timeoutMs != null && d > u.timeoutMs;
222
- return _(l, t, n, e.pre, e.post, a, r, s), v(l, t, (e) => n.indexOf(e), {
223
- from: u.from,
224
- to: u.to,
225
- cls: f("swl-ar-ghost", p && "swl-overdue"),
244
+ }, p = e.pending, h = u - p.since, g = p.timeoutMs != null && h > p.timeoutMs;
245
+ return y(f, t, n, e.pre, e.post, s, r, l, i, a), b(f, t, (e) => n.indexOf(e), {
246
+ from: p.from,
247
+ to: p.to,
248
+ cls: m("swl-ar-ghost", g && "swl-overdue"),
226
249
  marker: "ghost",
227
- label: `⌛ ${u.label}`,
228
- hitId: u.id,
250
+ label: `⌛ ${p.label}`,
251
+ hitId: p.id,
229
252
  kind: "pending",
230
- hl: a === u.id,
231
- rel: o
232
- }), /* @__PURE__ */ h("svg", {
253
+ hl: s === p.id,
254
+ rel: c
255
+ }), /* @__PURE__ */ _("svg", {
233
256
  className: "swl-row swl-ghost",
234
- width: i,
257
+ width: o,
235
258
  height: t.rowH,
236
259
  children: [
237
- /* @__PURE__ */ h("text", {
238
- className: f("swl-ts", p && "swl-overdue"),
260
+ /* @__PURE__ */ _("text", {
261
+ className: m("swl-ts", g && "swl-overdue"),
239
262
  x: 0,
240
263
  y: t.mid + 3,
241
- children: [
242
- "waiting ",
243
- (d / 1e3).toFixed(1),
244
- "s"
245
- ]
264
+ children: ["waiting ", d(h)]
246
265
  }),
247
- l.visuals,
248
- l.hits
266
+ f.visuals,
267
+ f.hits
249
268
  ]
250
269
  });
251
- }), S = a(function({ snap: e, count: t, g: n, laneOrder: r, laneLabels: i, width: a, proc: o }) {
252
- let s = {
270
+ }), T = s(function({ snap: e, count: t, g: n, laneOrder: r, laneLabels: i, laneActivityClassName: a, laneActivityStyle: o, width: s, proc: c }) {
271
+ let l = {
253
272
  visuals: [],
254
273
  hits: []
255
274
  };
256
- return _(s, n, r, e, e, null, i, o), /* @__PURE__ */ h("svg", {
275
+ return y(l, n, r, e, e, null, i, c, a, o), /* @__PURE__ */ _("svg", {
257
276
  className: "swl-row swl-now",
258
- width: a,
277
+ width: s,
259
278
  height: n.rowH,
260
279
  children: [
261
- /* @__PURE__ */ m("text", {
280
+ /* @__PURE__ */ g("text", {
262
281
  className: "swl-now-lbl",
263
282
  x: 0,
264
283
  y: n.mid + 3,
265
284
  children: "now"
266
285
  }),
267
- s.visuals,
268
- /* @__PURE__ */ m("line", {
286
+ l.visuals,
287
+ /* @__PURE__ */ g("line", {
269
288
  className: "swl-now-line",
270
289
  x1: n.gutter - 6,
271
- x2: a - 10,
290
+ x2: s - 10,
272
291
  y1: n.mid,
273
292
  y2: n.mid
274
293
  }),
275
- /* @__PURE__ */ h("text", {
294
+ /* @__PURE__ */ _("text", {
276
295
  className: "swl-now-lbl",
277
- x: a - 136,
296
+ x: s - 136,
278
297
  y: n.mid - 4,
279
298
  children: [
280
299
  "▼ ",
@@ -285,64 +304,75 @@ var y = {
285
304
  ]
286
305
  });
287
306
  });
288
- function C(e) {
289
- let { model: t, hid: r, related: a, procId: s, clock: c, ...u } = e, [f, g] = d(() => Date.now()), _ = c ?? f, v = t.pending.length > 0;
290
- o(() => {
291
- if (!v || c != null) return;
292
- let e = setInterval(() => g(Date.now()), 250);
307
+ function ee(e) {
308
+ let { model: t, hid: r, related: a, procId: o, clock: s, formatWait: l, ...u } = e, [f, m] = p(() => Date.now()), v = s ?? f, y = t.pending.length > 0;
309
+ c(() => {
310
+ if (!y || s != null) return;
311
+ let e = setInterval(() => m(Date.now()), 250);
293
312
  return () => clearInterval(e);
294
- }, [v, c]);
295
- let { current: y, pending: b } = t, C = l(() => n(y, b), [y, b]);
296
- return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(S, {
313
+ }, [y, s]);
314
+ let { current: b, pending: x } = t, S = d(() => n(b, x), [b, x]);
315
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(T, {
297
316
  snap: t.current,
298
317
  count: t.pending.length,
299
- proc: s && i({
318
+ proc: o && i({
300
319
  pre: t.current,
301
320
  post: t.current
302
- }, void 0, s) ? s : null,
321
+ }, void 0, o) ? o : null,
303
322
  ...u
304
- }), C.map((e) => /* @__PURE__ */ m(x, {
323
+ }), S.map((e) => /* @__PURE__ */ g(w, {
305
324
  row: e,
306
- now: _,
325
+ now: v,
307
326
  hl: r && i(e, e.pending.id, r) ? r : null,
308
327
  rel: a.has(e.pending.id),
309
- proc: s && i(e, void 0, s) ? s : null,
328
+ proc: o && i(e, void 0, o) ? o : null,
329
+ formatWait: l,
310
330
  ...u
311
331
  }, e.id))] });
312
332
  }
313
- function w({ model: e, g: t, headH: n, width: r }) {
314
- return /* @__PURE__ */ m("svg", {
333
+ function te({ model: e, g: t, headH: n, width: r }) {
334
+ return /* @__PURE__ */ g("svg", {
315
335
  width: r,
316
336
  height: n,
317
337
  children: e.laneOrder.map((r, i) => {
318
- let a = g(t, i), o = e.current[r], s = n - 24;
319
- return /* @__PURE__ */ h("g", { children: [
320
- /* @__PURE__ */ m("text", {
338
+ let a = v(t, i), o = e.current[r], s = n - 24;
339
+ return /* @__PURE__ */ _("g", { children: [
340
+ /* @__PURE__ */ g("text", {
321
341
  className: "swl-lane-name",
322
342
  x: a + 4,
323
343
  y: s,
324
344
  transform: `rotate(-90 ${a + 4} ${s})`,
325
345
  children: e.laneLabels[r] ?? r
326
346
  }),
327
- /* @__PURE__ */ m("circle", {
347
+ /* @__PURE__ */ g("circle", {
328
348
  cx: a,
329
349
  cy: n - 12,
330
350
  r: 5,
331
351
  className: `swl-dot-${o?.state}`,
332
- children: /* @__PURE__ */ m("title", { children: o?.state })
352
+ children: /* @__PURE__ */ g("title", { children: o?.state })
333
353
  }),
334
- o && o.acts.length > 0 && /* @__PURE__ */ m("text", {
354
+ o && o.acts.length > 0 && /* @__PURE__ */ g("text", {
335
355
  className: "swl-lbl-muted",
336
356
  x: a + 9,
337
357
  y: n - 8,
338
358
  children: o.acts.length
359
+ }),
360
+ /* @__PURE__ */ g("rect", {
361
+ className: "swl-hit",
362
+ x: a - t.laneW / 2,
363
+ y: 0,
364
+ width: t.laneW,
365
+ height: n,
366
+ "data-kind": "lane",
367
+ "data-id": r,
368
+ "data-lane": r
339
369
  })
340
370
  ] }, r);
341
371
  })
342
372
  });
343
373
  }
344
- function T({ mk: e }) {
345
- let t = (t, n, r) => /* @__PURE__ */ m("marker", {
374
+ function ne({ mk: e }) {
375
+ let t = (t, n, r) => /* @__PURE__ */ g("marker", {
346
376
  id: `${e}-${t}`,
347
377
  viewBox: "0 0 10 10",
348
378
  refX: 9,
@@ -351,20 +381,20 @@ function T({ mk: e }) {
351
381
  markerHeight: 9,
352
382
  markerUnits: "userSpaceOnUse",
353
383
  orient: "auto-start-reverse",
354
- children: r ? /* @__PURE__ */ m("path", {
384
+ children: r ? /* @__PURE__ */ g("path", {
355
385
  d: "M1,1 L9,5 L1,9",
356
386
  className: n
357
- }) : /* @__PURE__ */ m("path", {
387
+ }) : /* @__PURE__ */ g("path", {
358
388
  d: "M0,0 L10,5 L0,10 z",
359
389
  className: n
360
390
  })
361
391
  });
362
- return /* @__PURE__ */ m("svg", {
392
+ return /* @__PURE__ */ g("svg", {
363
393
  width: 0,
364
394
  height: 0,
365
395
  style: { position: "absolute" },
366
396
  "aria-hidden": "true",
367
- children: /* @__PURE__ */ h("defs", { children: [
397
+ children: /* @__PURE__ */ _("defs", { children: [
368
398
  t("sync", "swl-mk-sync", !1),
369
399
  t("async", "swl-mk-async", !0),
370
400
  t("event", "swl-mk-event", !0),
@@ -384,26 +414,29 @@ function D(e) {
384
414
  }
385
415
  return null;
386
416
  }
387
- var O = (t) => {
388
- let { cardName: n, model: a, showPending: p = !0, autoFollow: g = !0, showTooltip: _ = !0, highlightId: v, laneWidth: y = 104, rowHeight: x = 30, headerHeight: S = 130, gutterWidth: O = 92, stickyTop: k = 0, now: A, className: j, onHoverChanged: M, onItemClicked: ee } = t, N = "swl" + s().replace(/[^a-zA-Z0-9_-]/g, ""), P = l(() => ({
389
- laneW: y,
390
- rowH: x,
417
+ var O = (n) => {
418
+ let { cardName: s, model: h, showPending: v = !0, autoFollow: y = !0, showTooltip: b = !0, highlightId: x, laneWidth: C = 104, rowHeight: w = 30, headerHeight: T = 130, gutterWidth: O = 92, stickyTop: re = 0, now: k, formatTs: A = t, formatWait: ie, className: j, style: M, onHoverChanged: N, onItemClicked: ae } = n, P = "swl" + l().replace(/[^a-zA-Z0-9_-]/g, ""), F = d(() => ({
419
+ laneW: C,
420
+ rowH: w,
391
421
  gutter: O,
392
- mid: x / 2,
393
- mk: N
422
+ mid: w / 2,
423
+ mk: P
394
424
  }), [
395
- y,
396
- x,
425
+ C,
426
+ w,
397
427
  O,
398
- N
399
- ]), F = O + a.laneOrder.length * y + 140, I = {
400
- g: P,
401
- laneOrder: a.laneOrder,
402
- laneLabels: a.laneLabels,
403
- width: F
404
- }, L = u(null), R = u(null), z = u(a);
405
- z.current = a;
406
- let [B, V] = d(null), H = u(null), U = (e) => {
428
+ P
429
+ ]), I = O + h.laneOrder.length * C + 140, L = {
430
+ g: F,
431
+ laneOrder: h.laneOrder,
432
+ laneLabels: h.laneLabels,
433
+ laneActivityClassName: h.laneActivityClassName,
434
+ laneActivityStyle: h.laneActivityStyle,
435
+ width: I,
436
+ fmtTs: A
437
+ }, R = f(null), z = f(null), B = f(h);
438
+ B.current = h;
439
+ let [V, oe] = p(null), H = f(null), U = (e) => {
407
440
  let t = e?.closest?.(".swl-hit");
408
441
  if (!t) return null;
409
442
  let n = t.dataset;
@@ -411,103 +444,120 @@ var O = (t) => {
411
444
  kind: n.kind,
412
445
  id: n.id,
413
446
  lane: n.lane,
414
- rowId: n.row == null ? void 0 : Number(n.row)
447
+ rowId: n.row
415
448
  };
416
449
  }, W = (e, t) => e === t || !!e && !!t && e.kind === t.kind && e.id === t.id, G = (e) => {
417
- let t = z.current, n = e.kind === "state" ? void 0 : r(t, e.id), i = E(t, e) ?? void 0;
450
+ let t = B.current;
451
+ if (e.kind === "step") return { steps: o(t, e.id) };
452
+ if (e.kind === "lane") return { meta: t.laneMeta[e.id] };
453
+ if (e.kind === "state") {
454
+ let n = t.rows.find((t) => String(t.id) === e.rowId);
455
+ return {
456
+ related: void 0,
457
+ process: void 0,
458
+ meta: n && n.event.type === "state" ? n.event.meta : void 0
459
+ };
460
+ }
461
+ let n = r(t, e.id), i = E(t, e) ?? void 0, a = e.kind === "pending" ? t.pending.find((t) => t.id === e.id) : void 0, s = a ? a.meta : t.spans[e.id]?.meta;
418
462
  return e.kind === "pending" ? {
419
- pending: t.pending.find((t) => t.id === e.id),
463
+ pending: a,
420
464
  span: t.spans[e.id],
421
465
  related: n,
422
- process: i
466
+ process: i,
467
+ meta: s
423
468
  } : {
424
469
  span: t.spans[e.id],
425
470
  related: n,
426
- process: i
471
+ process: i,
472
+ meta: s
427
473
  };
428
474
  }, K = (e, t) => {
429
- let n = R.current;
475
+ let n = z.current;
430
476
  n && (n.style.left = `${e + 14}px`, n.style.top = `${t + 14}px`);
431
477
  }, q = (t, n) => {
432
478
  let r = H.current;
433
479
  if (W(r, t)) return;
434
- H.current = t, V(t);
435
- let i = R.current;
436
- i && (t && _ ? (i.textContent = e(z.current, t, A ?? Date.now()), i.style.display = "block", K(n.clientX, n.clientY)) : i.style.display = "none"), M({
480
+ H.current = t, oe(t);
481
+ let i = z.current;
482
+ i && (t && b ? (i.textContent = e(B.current, t, k ?? Date.now(), A), i.style.display = "block", K(n.clientX, n.clientY)) : i.style.display = "none"), N({
437
483
  target: t,
438
484
  previous: r,
439
485
  ...t ? G(t) : {},
440
486
  clientX: n.clientX,
441
487
  clientY: n.clientY
442
488
  });
443
- }, J = (e) => {
489
+ }, se = (e) => {
444
490
  let t = U(e.target);
445
491
  t && q(t, e);
446
- }, te = (e) => {
492
+ }, ce = (e) => {
447
493
  let t = U(e.relatedTarget);
448
494
  (!t || !W(t, H.current)) && q(t, e);
449
- }, ne = (e) => {
450
- H.current && _ && K(e.clientX, e.clientY);
451
- }, re = (e) => {
495
+ }, le = (e) => {
496
+ H.current && b && K(e.clientX, e.clientY);
497
+ }, ue = (e) => {
452
498
  let t = U(e.target);
453
- t && ee({
499
+ t && ae({
454
500
  target: t,
455
501
  ...G(t)
456
502
  });
457
- }, Y = B && B.kind !== "state" ? B.id : v ?? null, { spans: X } = a, Z = l(() => new Set(Y ? r({ spans: X }, Y) : []), [Y, X]), Q = B ? E(a, B) : null, $ = u(!0);
458
- return o(() => {
459
- if (!g) return;
460
- let e = D(L.current), t = e ?? window, n = () => {
503
+ }, J = V && V.kind !== "state" && V.kind !== "step" && V.kind !== "lane" ? V.id : x ?? null, { spans: Y } = h, X = d(() => new Set(J ? r({ spans: Y }, J) : []), [J, Y]), Z = V ? E(h, V) : null, Q = V?.kind === "step" ? V.id : null, $ = f(!0);
504
+ return c(() => {
505
+ if (!y) return;
506
+ let e = D(R.current), t = e ?? window, n = () => {
461
507
  $.current = e ? e.scrollTop + e.clientHeight >= e.scrollHeight - 40 : window.innerHeight + window.scrollY >= document.documentElement.scrollHeight - 40;
462
508
  };
463
509
  return t.addEventListener("scroll", n, { passive: !0 }), () => t.removeEventListener("scroll", n);
464
- }, [g]), c(() => {
465
- if (!g || !$.current) return;
466
- let e = D(L.current);
510
+ }, [y]), u(() => {
511
+ if (!y || !$.current) return;
512
+ let e = D(R.current);
467
513
  e ? e.scrollTop = e.scrollHeight : window.scrollTo(0, document.documentElement.scrollHeight);
468
514
  }, [
469
- g,
470
- a.rows.length,
471
- a.pending.length
472
- ]), /* @__PURE__ */ h("div", {
473
- ref: L,
474
- className: f("pihanga-swimlane", j),
475
- "data-pihanga": n,
515
+ y,
516
+ h.rows.length,
517
+ h.pending.length
518
+ ]), /* @__PURE__ */ _("div", {
519
+ ref: R,
520
+ className: m("pihanga-swimlane", j),
521
+ style: M,
522
+ "data-pihanga": s,
523
+ onPointerOver: se,
524
+ onPointerOut: ce,
525
+ onPointerMove: le,
526
+ onClick: ue,
476
527
  children: [
477
- /* @__PURE__ */ m(T, { mk: N }),
478
- /* @__PURE__ */ m("div", {
528
+ /* @__PURE__ */ g(ne, { mk: P }),
529
+ /* @__PURE__ */ g("div", {
479
530
  className: "swl-header",
480
- style: { top: k },
481
- children: /* @__PURE__ */ m(w, {
482
- model: a,
483
- g: P,
484
- headH: S,
485
- width: F
531
+ style: { top: re },
532
+ children: /* @__PURE__ */ g(te, {
533
+ model: h,
534
+ g: F,
535
+ headH: T,
536
+ width: I
486
537
  })
487
538
  }),
488
- /* @__PURE__ */ h("div", {
539
+ /* @__PURE__ */ _("div", {
489
540
  className: "swl-rows",
490
- onPointerOver: J,
491
- onPointerOut: te,
492
- onPointerMove: ne,
493
- onClick: re,
494
- children: [a.rows.map((e) => /* @__PURE__ */ m(b, {
541
+ children: [h.rows.map((e, t) => /* @__PURE__ */ g(S, {
495
542
  row: e,
496
- hl: Y && i(e, "id" in e.event ? e.event.id : void 0, Y) ? Y : null,
497
- rel: "id" in e.event && e.event.type !== "done" && Z.has(e.event.id),
498
- proc: Q && i(e, void 0, Q) ? Q : null,
499
- ...I
500
- }, e.id)), p && /* @__PURE__ */ m(C, {
501
- model: a,
502
- hid: Y,
503
- related: Z,
504
- procId: Q,
505
- clock: A,
506
- ...I
543
+ hl: J && i(e, "id" in e.event ? e.event.id : void 0, J) ? J : null,
544
+ rel: "id" in e.event && e.event.type !== "done" && X.has(e.event.id),
545
+ proc: Z && i(e, void 0, Z) ? Z : null,
546
+ grouped: e.event.step != null && e.event.step === h.rows[t - 1]?.event.step,
547
+ stepHl: Q != null && a(e) === Q,
548
+ ...L
549
+ }, e.id)), v && /* @__PURE__ */ g(ee, {
550
+ model: h,
551
+ hid: J,
552
+ related: X,
553
+ procId: Z,
554
+ clock: k,
555
+ formatWait: ie,
556
+ ...L
507
557
  })]
508
558
  }),
509
- /* @__PURE__ */ m("div", {
510
- ref: R,
559
+ /* @__PURE__ */ g("div", {
560
+ ref: z,
511
561
  className: "swl-tooltip",
512
562
  role: "tooltip"
513
563
  })