@cardenelabs/dragon 0.45.0 → 0.45.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/cli.cjs +70 -29
  2. package/dist/cli.cjs.map +1 -1
  3. package/dist/cli.js +70 -29
  4. package/dist/cli.js.map +1 -1
  5. package/dist/export.cjs +70 -29
  6. package/dist/export.cjs.map +1 -1
  7. package/dist/export.js +70 -29
  8. package/dist/export.js.map +1 -1
  9. package/dist/index.cjs +70 -29
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.js +70 -29
  12. package/dist/index.js.map +1 -1
  13. package/dist/light/{chunk-VRAW7VAQ.cjs → chunk-5OQV42W3.cjs} +50 -19
  14. package/dist/light/chunk-5OQV42W3.cjs.map +1 -0
  15. package/dist/light/chunk-CLS6JVKK.cjs.map +1 -1
  16. package/dist/light/{chunk-JNSHZTPF.js → chunk-EHTQUCW4.js} +49 -18
  17. package/dist/light/chunk-EHTQUCW4.js.map +1 -0
  18. package/dist/light/{chunk-OUQ44P45.cjs → chunk-JCEKXALJ.cjs} +81 -81
  19. package/dist/light/{chunk-OUQ44P45.cjs.map → chunk-JCEKXALJ.cjs.map} +1 -1
  20. package/dist/light/{chunk-6ZUKJ3VO.js → chunk-YEQSLVIN.js} +2 -2
  21. package/dist/light/{git-C4RVNFT6.js → git-GESUYKGR.js} +3 -3
  22. package/dist/light/{git-I7D7RIW2.cjs → git-K3KAAAWW.cjs} +59 -59
  23. package/dist/light/{git-I7D7RIW2.cjs.map → git-K3KAAAWW.cjs.map} +1 -1
  24. package/dist/light/index.cjs +231 -219
  25. package/dist/light/index.cjs.map +1 -1
  26. package/dist/light/index.js +31 -19
  27. package/dist/light/index.js.map +1 -1
  28. package/dist/light/{lineup-YEG4HHEI.js → lineup-2V2U7HZH.js} +3 -3
  29. package/dist/light/{lineup-FAIKTH3Y.cjs → lineup-623J25LU.cjs} +40 -40
  30. package/dist/light/{lineup-FAIKTH3Y.cjs.map → lineup-623J25LU.cjs.map} +1 -1
  31. package/dist/light/{state-ZZUK6AQT.cjs → state-OZVCHX7H.cjs} +41 -41
  32. package/dist/light/{state-ZZUK6AQT.cjs.map → state-OZVCHX7H.cjs.map} +1 -1
  33. package/dist/light/{state-P3LIVI3K.js → state-T4OTVING.js} +2 -2
  34. package/dist/light/{time-B5WUQOFP.js → time-6WEMD4FQ.js} +3 -3
  35. package/dist/light/{time-64DJKYAL.cjs → time-PQCPVQOE.cjs} +84 -84
  36. package/dist/light/{time-64DJKYAL.cjs.map → time-PQCPVQOE.cjs.map} +1 -1
  37. package/dist/light/{tree-66EH4QVI.cjs → tree-6D7KI57H.cjs} +62 -62
  38. package/dist/light/{tree-66EH4QVI.cjs.map → tree-6D7KI57H.cjs.map} +1 -1
  39. package/dist/light/{tree-5HPREYW2.js → tree-ZJZQI5QT.js} +3 -3
  40. package/dist/player.global.js +3 -3
  41. package/package.json +1 -1
  42. package/src/layout/scene.ts +58 -16
  43. package/src/look/values.ts +1 -1
  44. package/src/render/draw.ts +34 -14
  45. package/dist/light/chunk-JNSHZTPF.js.map +0 -1
  46. package/dist/light/chunk-VRAW7VAQ.cjs.map +0 -1
  47. /package/dist/light/{chunk-6ZUKJ3VO.js.map → chunk-YEQSLVIN.js.map} +0 -0
  48. /package/dist/light/{git-C4RVNFT6.js.map → git-GESUYKGR.js.map} +0 -0
  49. /package/dist/light/{lineup-YEG4HHEI.js.map → lineup-2V2U7HZH.js.map} +0 -0
  50. /package/dist/light/{state-P3LIVI3K.js.map → state-T4OTVING.js.map} +0 -0
  51. /package/dist/light/{time-B5WUQOFP.js.map → time-6WEMD4FQ.js.map} +0 -0
  52. /package/dist/light/{tree-5HPREYW2.js.map → tree-ZJZQI5QT.js.map} +0 -0
@@ -7,7 +7,7 @@ var _chunkCLS6JVKKcjs = require('./chunk-CLS6JVKK.cjs');
7
7
 
8
8
 
9
9
 
10
- var _chunkOUQ44P45cjs = require('./chunk-OUQ44P45.cjs');
10
+ var _chunkJCEKXALJcjs = require('./chunk-JCEKXALJ.cjs');
11
11
 
12
12
 
13
13
 
@@ -27,7 +27,7 @@ var _chunkOUQ44P45cjs = require('./chunk-OUQ44P45.cjs');
27
27
 
28
28
 
29
29
 
30
- var _chunkVRAW7VAQcjs = require('./chunk-VRAW7VAQ.cjs');
30
+ var _chunk5OQV42W3cjs = require('./chunk-5OQV42W3.cjs');
31
31
 
32
32
  // src/layout/git.ts
33
33
  function walk(diagram) {
@@ -174,7 +174,7 @@ function walk(diagram) {
174
174
  return { branches, made, links, moves, refs, tags, rows: most };
175
175
  }
176
176
  function cubic(p0, c1, c2, p3) {
177
- const n = _chunkVRAW7VAQcjs.LOOK.git.samples;
177
+ const n = _chunk5OQV42W3cjs.LOOK.git.samples;
178
178
  return Array.from({ length: n }, (_, k) => {
179
179
  const t = (k + 1) / n;
180
180
  const u = 1 - t;
@@ -189,7 +189,7 @@ function elbow(from, to) {
189
189
  function fork(p, tx, ty) {
190
190
  const sign = ty > p.cy ? 1 : -1;
191
191
  const p0 = [p.cx, p.cy + sign * p.r];
192
- const turn = Math.max(0, Math.min(_chunkVRAW7VAQcjs.LOOK.git.turn, tx - p.cx));
192
+ const turn = Math.max(0, Math.min(_chunk5OQV42W3cjs.LOOK.git.turn, tx - p.cx));
193
193
  const p3 = [p.cx + turn, ty];
194
194
  const curve = cubic(p0, [p0[0], p0[1] + (ty - p0[1]) * 0.7], [p.cx + turn * 0.2, ty], p3);
195
195
  return [p0, ...curve, ...tx > p3[0] ? [[tx, ty]] : []];
@@ -198,7 +198,7 @@ function join(p, c) {
198
198
  const sign = c.cy < p.cy ? 1 : -1;
199
199
  const p0 = [p.cx + p.r, p.cy];
200
200
  const p3 = [c.cx, c.cy + sign * c.r];
201
- const turn = Math.max(0, Math.min(_chunkVRAW7VAQcjs.LOOK.git.turn, c.cx - p0[0]));
201
+ const turn = Math.max(0, Math.min(_chunk5OQV42W3cjs.LOOK.git.turn, c.cx - p0[0]));
202
202
  const h = [c.cx - turn, p.cy];
203
203
  const curve = cubic(h, [c.cx - turn * 0.2, p.cy], [c.cx, p3[1] + (p.cy - p3[1]) * 0.7], p3);
204
204
  return [p0, ...h[0] > p0[0] ? [h] : [], ...curve];
@@ -206,7 +206,7 @@ function join(p, c) {
206
206
  function copyLine(p, c) {
207
207
  if (Math.abs(p.cy - c.cy) < 0.5) {
208
208
  const top = p.cy - p.r;
209
- const lift = _chunkVRAW7VAQcjs.LOOK.git.turn * 0.7;
209
+ const lift = _chunk5OQV42W3cjs.LOOK.git.turn * 0.7;
210
210
  return [[p.cx, top], ...cubic([p.cx, top], [p.cx, top - lift], [c.cx, top - lift], [c.cx, top])];
211
211
  }
212
212
  const sign = c.cy < p.cy ? -1 : 1;
@@ -216,7 +216,7 @@ function copyLine(p, c) {
216
216
  return [p0, ...cubic(p0, [p0[0], p0[1] + mid], [p3[0], p3[1] - mid], p3)];
217
217
  }
218
218
  function layoutGit(diagram) {
219
- const { margin, gap, box: B, region: R, git: G, carrier: C } = _chunkVRAW7VAQcjs.LOOK;
219
+ const { margin, gap, box: B, region: R, git: G, carrier: C } = _chunk5OQV42W3cjs.LOOK;
220
220
  const walked = walk(diagram);
221
221
  const notes = new Map((_nullishCoalesce(_optionalChain([diagram, 'access', _14 => _14.git, 'optionalAccess', _15 => _15.branches]), () => ( []))).map((b) => [b.id, b.note]));
222
222
  const laneIndex = new Map(walked.branches.map((id, i) => [id, i]));
@@ -229,14 +229,14 @@ function layoutGit(diagram) {
229
229
  laneLast.set(c.branch, k);
230
230
  }
231
231
  const linesOf = (c) => [
232
- ...c.hash !== void 0 ? [{ text: c.hash, style: _chunkVRAW7VAQcjs.TYPE.gitHash }] : [],
233
- ...c.note !== void 0 ? [{ text: c.note, style: _chunkVRAW7VAQcjs.TYPE.gitNote }] : []
232
+ ...c.hash !== void 0 ? [{ text: c.hash, style: _chunk5OQV42W3cjs.TYPE.gitHash }] : [],
233
+ ...c.note !== void 0 ? [{ text: c.note, style: _chunk5OQV42W3cjs.TYPE.gitNote }] : []
234
234
  ];
235
- const textW = (c) => Math.max(0, ...linesOf(c).map((line) => _chunkVRAW7VAQcjs.textWidth.call(void 0, line.text, line.style)));
236
- const tagW = (ref) => _chunkVRAW7VAQcjs.textWidth.call(void 0, ref, _chunkVRAW7VAQcjs.hasWide.call(void 0, ref) ? _chunkVRAW7VAQcjs.TYPE.carrierJa : _chunkVRAW7VAQcjs.TYPE.carrier) + C.tagPadX * 2;
235
+ const textW = (c) => Math.max(0, ...linesOf(c).map((line) => _chunk5OQV42W3cjs.textWidth.call(void 0, line.text, line.style)));
236
+ const tagW = (ref) => _chunk5OQV42W3cjs.textWidth.call(void 0, ref, _chunk5OQV42W3cjs.hasWide.call(void 0, ref) ? _chunk5OQV42W3cjs.TYPE.carrierJa : _chunk5OQV42W3cjs.TYPE.carrier) + C.tagPadX * 2;
237
237
  const refWidth = Math.max(0, ...walked.refs.map((r) => tagW(r.name)));
238
238
  const pitch = Math.max(G.pitch, ...walked.made.map((c) => textW(c) + G.textGap), refWidth + G.textGap);
239
- const headers = walked.branches.map((id) => ({ w: Math.max(R.icon, _chunkVRAW7VAQcjs.textWidth.call(void 0, id, _chunkVRAW7VAQcjs.TYPE.regionName), _chunkVRAW7VAQcjs.textWidth.call(void 0, _nullishCoalesce(notes.get(id), () => ( "")), _chunkVRAW7VAQcjs.TYPE.regionNote)) }));
239
+ const headers = walked.branches.map((id) => ({ w: Math.max(R.icon, _chunk5OQV42W3cjs.textWidth.call(void 0, id, _chunk5OQV42W3cjs.TYPE.regionName), _chunk5OQV42W3cjs.textWidth.call(void 0, _nullishCoalesce(notes.get(id), () => ( "")), _chunk5OQV42W3cjs.TYPE.regionNote)) }));
240
240
  const headerRight = margin + R.inset + Math.max(0, ...headers.map((h) => h.w));
241
241
  const firstHalf = Math.max(G.r, ...walked.made.filter((c) => col.get(c.id) === 0 && laneIndex.get(c.branch) === 0).map((c) => textW(c) / 2), refWidth / 2);
242
242
  const x0 = Math.max(G.x0, headerRight + gap + firstHalf);
@@ -267,7 +267,7 @@ function layoutGit(diagram) {
267
267
  const cy = lane.line;
268
268
  const lines = linesOf(c);
269
269
  const baselines = lines.map((_, k) => isTop ? cy - G.above - (lines.length - 1 - k) * G.lineStep : cy + G.under + k * G.lineStep);
270
- const boxes2 = lines.map((line, k) => _chunkVRAW7VAQcjs.textBox.call(void 0, line.text, cx, baselines[k], line.style, "middle"));
270
+ const boxes2 = lines.map((line, k) => _chunk5OQV42W3cjs.textBox.call(void 0, line.text, cx, baselines[k], line.style, "middle"));
271
271
  const text = boxes2.length === 0 ? void 0 : { ...union(boxes2), lines: lines.map((line) => line.text), baselines };
272
272
  const color = c.copy !== void 0 ? colorOf(_nullishCoalesce(_optionalChain([walked, 'access', _27 => _27.made, 'access', _28 => _28.find, 'call', _29 => _29((m) => m.id === c.copy), 'optionalAccess', _30 => _30.branch]), () => ( c.branch))) : colorOf(c.branch);
273
273
  return {
@@ -330,7 +330,7 @@ function layoutGit(diagram) {
330
330
  };
331
331
  });
332
332
  const tags = walked.tags.map((t) => ({ ...tagRect(t.ref, t.slot), ref: t.ref, step: t.step }));
333
- const colors = _chunkVRAW7VAQcjs.boxColors.call(void 0, diagram);
333
+ const colors = _chunk5OQV42W3cjs.boxColors.call(void 0, diagram);
334
334
  const right = Math.max(
335
335
  x0,
336
336
  ...commits.flatMap((c) => [c.cx + c.r, ...c.text ? [c.text.x + c.text.w] : []]),
@@ -340,7 +340,7 @@ function layoutGit(diagram) {
340
340
  const boxX = right + G.boxGap;
341
341
  const firstCy = _nullishCoalesce(_optionalChain([(_nullishCoalesce(lanes[1], () => ( lanes[0]))), 'optionalAccess', _40 => _40.line]), () => ( margin + B.h / 2));
342
342
  const boxes = diagram.boxes.map((b, i) => {
343
- const w = _chunkVRAW7VAQcjs.boxWidth.call(void 0, diagram, b.id, true);
343
+ const w = _chunk5OQV42W3cjs.boxWidth.call(void 0, diagram, b.id, true);
344
344
  const cy = firstCy + i * (B.h + gap);
345
345
  return {
346
346
  id: b.id,
@@ -394,11 +394,11 @@ function layoutGit(diagram) {
394
394
  layout.badges = badgesOf(diagram, layout);
395
395
  layout.labels = labelsOf(diagram, layout);
396
396
  const contentRight = Math.max(right, ...boxes.map((b) => b.x + b.w), ...layout.labels.map((l) => l.x + l.w)) + R.pad;
397
- const width = Math.max(contentRight + margin, _chunkVRAW7VAQcjs.stripNeed.call(void 0, diagram) + margin * 2);
397
+ const width = Math.max(contentRight + margin, _chunk5OQV42W3cjs.stripNeed.call(void 0, diagram) + margin * 2);
398
398
  for (const region of regions) region.w = width - margin * 2;
399
399
  for (const lane of lanes) lane.w = width - margin * 2;
400
400
  const bottom = Math.max(lanesBottom, ...boxes.map((b) => b.y + b.h), ...layout.labels.map((l) => l.y + l.h));
401
- const strip = _chunkVRAW7VAQcjs.layoutStrip.call(void 0, diagram, margin, bottom + gap, width - margin * 2);
401
+ const strip = _chunk5OQV42W3cjs.layoutStrip.call(void 0, diagram, margin, bottom + gap, width - margin * 2);
402
402
  layout.width = width;
403
403
  layout.height = (strip ? strip.y + strip.h : bottom) + margin;
404
404
  if (strip) layout.strip = strip;
@@ -421,7 +421,7 @@ function firstMark(layout, step) {
421
421
  return marks[0];
422
422
  }
423
423
  function besideCommit(c, taken, avoid) {
424
- const { r, inset } = _chunkVRAW7VAQcjs.LOOK.badge;
424
+ const { r, inset } = _chunk5OQV42W3cjs.LOOK.badge;
425
425
  const d = c.r + inset + r;
426
426
  const apart = r * 2 + inset;
427
427
  const spots = [
@@ -430,22 +430,22 @@ function besideCommit(c, taken, avoid) {
430
430
  [c.cx - d, c.cy],
431
431
  [c.cx, c.cy - d]
432
432
  ];
433
- return spots.find((p) => taken.every(([x, y]) => Math.hypot(p[0] - x, p[1] - y) >= apart) && avoid.every((a) => _chunkVRAW7VAQcjs.gapBetween.call(void 0, _chunkVRAW7VAQcjs.badgeRect.call(void 0, p), a) >= _chunkVRAW7VAQcjs.LOOK.label.touch));
433
+ return spots.find((p) => taken.every(([x, y]) => Math.hypot(p[0] - x, p[1] - y) >= apart) && avoid.every((a) => _chunk5OQV42W3cjs.gapBetween.call(void 0, _chunk5OQV42W3cjs.badgeRect.call(void 0, p), a) >= _chunk5OQV42W3cjs.LOOK.label.touch));
434
434
  }
435
435
  function clearOnPath(points, taken, avoid) {
436
- const { r, inset, along: start, short } = _chunkVRAW7VAQcjs.LOOK.badge;
437
- const length = _chunkVRAW7VAQcjs.pathLength.call(void 0, points);
436
+ const { r, inset, along: start, short } = _chunk5OQV42W3cjs.LOOK.badge;
437
+ const length = _chunk5OQV42W3cjs.pathLength.call(void 0, points);
438
438
  const first = length < short ? Math.min(r + 1, length / 2) : start;
439
439
  const apart = r * 2 + inset;
440
440
  for (let d = first; d <= length; d += 1) {
441
- const p = _chunkVRAW7VAQcjs.along.call(void 0, points, d);
442
- const rect = _chunkVRAW7VAQcjs.badgeRect.call(void 0, p);
443
- if (taken.every(([x, y]) => Math.hypot(p[0] - x, p[1] - y) >= apart) && avoid.every((a) => _chunkVRAW7VAQcjs.gapBetween.call(void 0, rect, a) >= _chunkVRAW7VAQcjs.LOOK.label.touch)) return p;
441
+ const p = _chunk5OQV42W3cjs.along.call(void 0, points, d);
442
+ const rect = _chunk5OQV42W3cjs.badgeRect.call(void 0, p);
443
+ if (taken.every(([x, y]) => Math.hypot(p[0] - x, p[1] - y) >= apart) && avoid.every((a) => _chunk5OQV42W3cjs.gapBetween.call(void 0, rect, a) >= _chunk5OQV42W3cjs.LOOK.label.touch)) return p;
444
444
  }
445
445
  return void 0;
446
446
  }
447
447
  function badgesOf(diagram, layout) {
448
- const { inset } = _chunkVRAW7VAQcjs.LOOK.badge;
448
+ const { inset } = _chunk5OQV42W3cjs.LOOK.badge;
449
449
  const taken = [];
450
450
  const all = [...layout.links.map((l) => l.points), ...layout.moves.flatMap((m) => m.line ? [m.line] : [])];
451
451
  const out = [];
@@ -458,7 +458,7 @@ function badgesOf(diagram, layout) {
458
458
  const near = _optionalChain([mark, 'optionalAccess', _43 => _43.target]) ? besideCommit(mark.target, taken, avoid) : void 0;
459
459
  if (mark && (mark.points || near)) {
460
460
  const points = mark.points;
461
- const point = _nullishCoalesce(near, () => ( (points ? _nullishCoalesce(clearOnPath(points, taken, avoid), () => ( _chunkVRAW7VAQcjs.badgeOnPath.call(void 0, points, taken, all.filter((p) => p !== points)))) : [0, 0])));
461
+ const point = _nullishCoalesce(near, () => ( (points ? _nullishCoalesce(clearOnPath(points, taken, avoid), () => ( _chunk5OQV42W3cjs.badgeOnPath.call(void 0, points, taken, all.filter((p) => p !== points)))) : [0, 0])));
462
462
  taken.push(point);
463
463
  out.push({ step: s, x: point[0], y: point[1], color: mark.color });
464
464
  return;
@@ -481,12 +481,12 @@ function badgesOf(diagram, layout) {
481
481
  }
482
482
  const before = out[out.length - 1];
483
483
  const lane = layout.lanes[0];
484
- out.push(before ? { ...before, step: s } : { step: s, x: (_nullishCoalesce(_optionalChain([lane, 'optionalAccess', _48 => _48.x]), () => ( 0))) + (_nullishCoalesce(_optionalChain([lane, 'optionalAccess', _49 => _49.w]), () => ( 0))) - inset - _chunkVRAW7VAQcjs.LOOK.badge.r, y: (_nullishCoalesce(_optionalChain([lane, 'optionalAccess', _50 => _50.y]), () => ( 0))) + inset + _chunkVRAW7VAQcjs.LOOK.badge.r, color: _nullishCoalesce(_optionalChain([lane, 'optionalAccess', _51 => _51.color]), () => ( "slate")) });
484
+ out.push(before ? { ...before, step: s } : { step: s, x: (_nullishCoalesce(_optionalChain([lane, 'optionalAccess', _48 => _48.x]), () => ( 0))) + (_nullishCoalesce(_optionalChain([lane, 'optionalAccess', _49 => _49.w]), () => ( 0))) - inset - _chunk5OQV42W3cjs.LOOK.badge.r, y: (_nullishCoalesce(_optionalChain([lane, 'optionalAccess', _50 => _50.y]), () => ( 0))) + inset + _chunk5OQV42W3cjs.LOOK.badge.r, color: _nullishCoalesce(_optionalChain([lane, 'optionalAccess', _51 => _51.color]), () => ( "slate")) });
485
485
  });
486
- return _chunkVRAW7VAQcjs.replaceSameSpot.call(void 0, out);
486
+ return _chunk5OQV42W3cjs.replaceSameSpot.call(void 0, out);
487
487
  }
488
488
  function labelsOf(diagram, layout) {
489
- const G = _chunkVRAW7VAQcjs.LOOK.git;
489
+ const G = _chunk5OQV42W3cjs.LOOK.git;
490
490
  const labels = [];
491
491
  const circles = layout.commits.map((c) => ({ x: c.cx - c.r, y: c.cy - c.r, w: c.r * 2, h: c.r * 2 }));
492
492
  const texts = layout.commits.flatMap((c) => c.text ? [c.text] : []);
@@ -497,15 +497,15 @@ function labelsOf(diagram, layout) {
497
497
  const target = layout.commits.find((c) => c.id === source.to);
498
498
  if (!target) continue;
499
499
  const top = _optionalChain([layout, 'access', _57 => _57.lanes, 'access', _58 => _58[0], 'optionalAccess', _59 => _59.id]) === target.branch;
500
- const w = _chunkVRAW7VAQcjs.textWidth.call(void 0, source.label, _chunkVRAW7VAQcjs.hasWide.call(void 0, source.label) ? _chunkVRAW7VAQcjs.TYPE.labelJa : _chunkVRAW7VAQcjs.TYPE.label) + _chunkVRAW7VAQcjs.LOOK.label.padX * 2;
500
+ const w = _chunk5OQV42W3cjs.textWidth.call(void 0, source.label, _chunk5OQV42W3cjs.hasWide.call(void 0, source.label) ? _chunk5OQV42W3cjs.TYPE.labelJa : _chunk5OQV42W3cjs.TYPE.label) + _chunk5OQV42W3cjs.LOOK.label.padX * 2;
501
501
  const [mx] = move.line.reduce((sum, p) => [sum[0] + p[0] / move.line.length, 0], [0, 0]);
502
502
  const rows = Math.max(0, ...layout.tags.filter((t) => t.step === move.step && Math.abs(t.x + t.w / 2 - target.cx) < 0.5).map((t) => target.cy - t.y));
503
503
  const side = _nullishCoalesce(source.labelSide, () => ( (top ? "above" : "below")));
504
- const base = source.labelSide !== void 0 ? void 0 : top ? { x: mx - w / 2, y: target.cy - Math.max(rows, (_nullishCoalesce(_optionalChain([layout, 'access', _60 => _60.lanes, 'access', _61 => _61[0], 'optionalAccess', _62 => _62.tagBase]), () => ( G.tag))) + _chunkVRAW7VAQcjs.LOOK.carrier.tagH / 2) - _chunkVRAW7VAQcjs.LOOK.label.soft - _chunkVRAW7VAQcjs.LOOK.label.h } : { x: mx - w / 2, y: target.cy + G.labelUnder };
505
- const seen = layout.badges.filter((b) => b.step <= move.step).map((b) => _chunkVRAW7VAQcjs.badgeRect.call(void 0, [b.x, b.y]));
504
+ const base = source.labelSide !== void 0 ? void 0 : top ? { x: mx - w / 2, y: target.cy - Math.max(rows, (_nullishCoalesce(_optionalChain([layout, 'access', _60 => _60.lanes, 'access', _61 => _61[0], 'optionalAccess', _62 => _62.tagBase]), () => ( G.tag))) + _chunk5OQV42W3cjs.LOOK.carrier.tagH / 2) - _chunk5OQV42W3cjs.LOOK.label.soft - _chunk5OQV42W3cjs.LOOK.label.h } : { x: mx - w / 2, y: target.cy + G.labelUnder };
505
+ const seen = layout.badges.filter((b) => b.step <= move.step).map((b) => _chunk5OQV42W3cjs.badgeRect.call(void 0, [b.x, b.y]));
506
506
  const tags = layout.tags.filter((t) => t.step === move.step);
507
507
  labels.push(
508
- _chunkVRAW7VAQcjs.placeLabel.call(void 0,
508
+ _chunk5OQV42W3cjs.placeLabel.call(void 0,
509
509
  { step: move.step, event: move.event, text: source.label, points: move.line, color: move.color, side, ...base ? { base } : {} },
510
510
  { hard: [...circles, ...layout.boxes], soft: [...texts, ...tags, ...headers, ...labels.filter((l) => l.step === move.step)], touch: seen }
511
511
  )
@@ -518,30 +518,30 @@ function labelsOf(diagram, layout) {
518
518
  var r1 = (v) => Math.round(v * 100) / 100;
519
519
  var center = (r) => [r.x + r.w / 2, r.y + r.h / 2];
520
520
  function tagShape(text, sh) {
521
- const C = _chunkVRAW7VAQcjs.LOOK.carrier;
522
- const ja = _chunkVRAW7VAQcjs.hasWide.call(void 0, text);
523
- const w = _chunkVRAW7VAQcjs.textWidth.call(void 0, text, ja ? _chunkVRAW7VAQcjs.TYPE.carrierJa : _chunkVRAW7VAQcjs.TYPE.carrier) + C.tagPadX * 2;
524
- return `<rect class="dg-car" x="${r1(-w / 2)}" y="${-C.tagH / 2}" width="${r1(w)}" height="${C.tagH}" rx="${C.tagH / 2}" ${sh}/><text class="dg-car-t${ja ? " dg-car-tj" : ""}" y="${_chunkVRAW7VAQcjs.LOOK.baseline.carrier}" text-anchor="middle">${_chunkOUQ44P45cjs.esc.call(void 0, text)}</text>`;
521
+ const C = _chunk5OQV42W3cjs.LOOK.carrier;
522
+ const ja = _chunk5OQV42W3cjs.hasWide.call(void 0, text);
523
+ const w = _chunk5OQV42W3cjs.textWidth.call(void 0, text, ja ? _chunk5OQV42W3cjs.TYPE.carrierJa : _chunk5OQV42W3cjs.TYPE.carrier) + C.tagPadX * 2;
524
+ return `<rect class="dg-car" x="${r1(-w / 2)}" y="${-C.tagH / 2}" width="${r1(w)}" height="${C.tagH}" rx="${C.tagH / 2}" ${sh}/><text class="dg-car-t${ja ? " dg-car-tj" : ""}" y="${_chunk5OQV42W3cjs.LOOK.baseline.carrier}" text-anchor="middle">${_chunkJCEKXALJcjs.esc.call(void 0, text)}</text>`;
525
525
  }
526
526
  function drawGit(layout, diagram, timeline, ctx) {
527
527
  const { m } = ctx;
528
- const G = _chunkVRAW7VAQcjs.LOOK.git;
528
+ const G = _chunk5OQV42W3cjs.LOOK.git;
529
529
  const timeOf = (step, event) => timeline.edges.find((t) => t.step === step && t.event === event);
530
530
  const links = layout.links.map((l) => {
531
531
  const time = timeOf(l.step, l.event);
532
532
  if (!time) return "";
533
533
  ctx.traces.push({ from: l.from, to: l.to, points: l.points, shown: [[time.start, Number.POSITIVE_INFINITY]] });
534
- const d = _chunkOUQ44P45cjs.pathOf.call(void 0, l.points);
535
- if (l.kind === "copy") return `<g style="${_chunkOUQ44P45cjs.cs.call(void 0, l.color)}"><path class="dg-git-cp dg-a" d="${d}" style="${m.vis(time.start, m.last)}"/></g>`;
534
+ const d = _chunkJCEKXALJcjs.pathOf.call(void 0, l.points);
535
+ if (l.kind === "copy") return `<g style="${_chunkJCEKXALJcjs.cs.call(void 0, l.color)}"><path class="dg-git-cp dg-a" d="${d}" style="${m.vis(time.start, m.last)}"/></g>`;
536
536
  const kf = m.kf([
537
537
  [0, { opacity: 0, "stroke-dashoffset": 1 }],
538
- [time.start, { opacity: 0, "stroke-dashoffset": 1 }, _chunkVRAW7VAQcjs.EASE.inOut],
538
+ [time.start, { opacity: 0, "stroke-dashoffset": 1 }, _chunk5OQV42W3cjs.EASE.inOut],
539
539
  [time.start + 0.05, { opacity: 1 }],
540
540
  [time.drawn, { "stroke-dashoffset": 0 }],
541
- [m.last, { opacity: 1, "stroke-dashoffset": 0 }, _chunkVRAW7VAQcjs.EASE.inOut],
541
+ [m.last, { opacity: 1, "stroke-dashoffset": 0 }, _chunk5OQV42W3cjs.EASE.inOut],
542
542
  [m.total, { opacity: 0, "stroke-dashoffset": 0 }]
543
543
  ]);
544
- return `<g style="${_chunkOUQ44P45cjs.cs.call(void 0, l.color)}"><path class="dg-git-l dg-a" pathLength="1" d="${d}" style="${kf}"/></g>`;
544
+ return `<g style="${_chunkJCEKXALJcjs.cs.call(void 0, l.color)}"><path class="dg-git-l dg-a" pathLength="1" d="${d}" style="${kf}"/></g>`;
545
545
  }).join("");
546
546
  const commits = layout.commits.map((c) => {
547
547
  const at = _nullishCoalesce(_optionalChain([timeOf, 'call', _63 => _63(c.step, c.event), 'optionalAccess', _64 => _64.drawn]), () => ( 0));
@@ -550,14 +550,14 @@ function drawGit(layout, diagram, timeline, ctx) {
550
550
  const lines2 = (_nullishCoalesce(_optionalChain([c, 'access', _65 => _65.text, 'optionalAccess', _66 => _66.lines]), () => ( []))).map((line, k) => {
551
551
  const hash = k === 0 && c.hash !== void 0;
552
552
  const baseline = _nullishCoalesce(_optionalChain([c, 'access', _67 => _67.text, 'optionalAccess', _68 => _68.baselines, 'access', _69 => _69[k]]), () => ( c.cy));
553
- return _chunkOUQ44P45cjs.write.call(void 0, ctx.ink, hash ? "dg-git-h" : "dg-git-n", c.cx, baseline, line, hash ? _chunkVRAW7VAQcjs.TYPE.gitHash : _chunkVRAW7VAQcjs.TYPE.gitNote, [[at, Number.POSITIVE_INFINITY]], "middle");
553
+ return _chunkJCEKXALJcjs.write.call(void 0, ctx.ink, hash ? "dg-git-h" : "dg-git-n", c.cx, baseline, line, hash ? _chunk5OQV42W3cjs.TYPE.gitHash : _chunk5OQV42W3cjs.TYPE.gitNote, [[at, Number.POSITIVE_INFINITY]], "middle");
554
554
  }).join("");
555
- const id = `<text class="dg-git-id" x="${r1(c.cx)}" y="${r1(c.cy + _chunkVRAW7VAQcjs.LOOK.baseline.badge)}" text-anchor="middle">${_chunkOUQ44P45cjs.esc.call(void 0, c.id)}</text>`;
555
+ const id = `<text class="dg-git-id" x="${r1(c.cx)}" y="${r1(c.cy + _chunk5OQV42W3cjs.LOOK.baseline.badge)}" text-anchor="middle">${_chunkJCEKXALJcjs.esc.call(void 0, c.id)}</text>`;
556
556
  const node = `<g class="dg-popc dg-a" style="${m.pop(at)}"><circle class="dg-git-c" cx="${r1(c.cx)}" cy="${r1(c.cy)}" r="${c.r}" ${ctx.sh}/>${id}</g>`;
557
557
  const text = lines2 === "" ? "" : `<g class="dg-a" style="${m.vis(at)}">${lines2}</g>`;
558
558
  const orphanAt = c.orphan === void 0 ? void 0 : _optionalChain([timeOf, 'call', _70 => _70(c.orphan, _nullishCoalesce(c.orphanEvent, () => ( 0))), 'optionalAccess', _71 => _71.drawn]);
559
- const orphan = orphanAt === void 0 ? "" : `<g class="dg-a" data-orphan="${_chunkOUQ44P45cjs.esc.call(void 0, c.id)}" style="${m.vis(orphanAt, m.last, { f: 0.5 })}"><circle class="dg-git-old" cx="${r1(c.cx)}" cy="${r1(c.cy)}" r="${G.orphan}"/><text class="dg-git-oldl" x="${r1(c.cx)}" y="${r1(c.cy + _chunkVRAW7VAQcjs.LOOK.baseline.badge)}" text-anchor="middle">${_chunkOUQ44P45cjs.esc.call(void 0, c.id)}</text></g>`;
560
- return `<g data-commit="${_chunkOUQ44P45cjs.esc.call(void 0, c.id)}" style="${_chunkOUQ44P45cjs.cs.call(void 0, c.color)}">${node}${text}${orphan}</g>`;
559
+ const orphan = orphanAt === void 0 ? "" : `<g class="dg-a" data-orphan="${_chunkJCEKXALJcjs.esc.call(void 0, c.id)}" style="${m.vis(orphanAt, m.last, { f: 0.5 })}"><circle class="dg-git-old" cx="${r1(c.cx)}" cy="${r1(c.cy)}" r="${G.orphan}"/><text class="dg-git-oldl" x="${r1(c.cx)}" y="${r1(c.cy + _chunk5OQV42W3cjs.LOOK.baseline.badge)}" text-anchor="middle">${_chunkJCEKXALJcjs.esc.call(void 0, c.id)}</text></g>`;
560
+ return `<g data-commit="${_chunkJCEKXALJcjs.esc.call(void 0, c.id)}" style="${_chunkJCEKXALJcjs.cs.call(void 0, c.color)}">${node}${text}${orphan}</g>`;
561
561
  }).join("");
562
562
  const lines = layout.moves.flatMap((mv) => {
563
563
  const time = timeOf(mv.step, mv.event);
@@ -566,21 +566,21 @@ function drawGit(layout, diagram, timeline, ctx) {
566
566
  ctx.traces.push({ from: mv.ref, to: _nullishCoalesce(mv.target, () => ( mv.ref)), points: mv.line, shown: [[time.start, end + 0.4]] });
567
567
  const kf = m.kf([
568
568
  [0, { opacity: 0, "stroke-dashoffset": 1 }],
569
- [time.start, { opacity: 0, "stroke-dashoffset": 1 }, _chunkVRAW7VAQcjs.EASE.inOut],
569
+ [time.start, { opacity: 0, "stroke-dashoffset": 1 }, _chunk5OQV42W3cjs.EASE.inOut],
570
570
  [time.start + 0.05, { opacity: 1 }],
571
571
  [time.drawn, { "stroke-dashoffset": 0 }],
572
- [end, { opacity: 1 }, _chunkVRAW7VAQcjs.EASE.inOut],
572
+ [end, { opacity: 1 }, _chunk5OQV42W3cjs.EASE.inOut],
573
573
  [end + 0.4, { opacity: 0 }],
574
574
  [m.total, { opacity: 0, "stroke-dashoffset": 0 }]
575
575
  ]);
576
- return [`<g style="${_chunkOUQ44P45cjs.cs.call(void 0, mv.color)}"><path class="dg-e-on dg-a" pathLength="1" d="${_chunkOUQ44P45cjs.pathOf.call(void 0, mv.line)}" style="${kf}"/></g>`];
576
+ return [`<g style="${_chunkJCEKXALJcjs.cs.call(void 0, mv.color)}"><path class="dg-e-on dg-a" pathLength="1" d="${_chunkJCEKXALJcjs.pathOf.call(void 0, mv.line)}" style="${kf}"/></g>`];
577
577
  }).join("");
578
578
  const carried = timeline.carriers.flatMap((t) => {
579
579
  const mv = layout.moves.find((x) => x.step === t.step && x.event === t.event && x.line);
580
580
  const source = _optionalChain([diagram, 'access', _72 => _72.steps, 'access', _73 => _73[t.step], 'optionalAccess', _74 => _74.events, 'access', _75 => _75[t.event]]);
581
581
  if (!_optionalChain([mv, 'optionalAccess', _76 => _76.line]) || _optionalChain([source, 'optionalAccess', _77 => _77.type]) !== "edge") return [];
582
582
  const edge = { step: t.step, event: t.event, from: mv.ref, to: _nullishCoalesce(mv.target, () => ( mv.ref)), points: mv.line, color: mv.color, carry: source.carry };
583
- return [_chunkOUQ44P45cjs.carrier.call(void 0, edge, { ...t, start: t.depart, end: t.arrive + _chunkVRAW7VAQcjs.MOTION.fade }, ctx)];
583
+ return [_chunkJCEKXALJcjs.carrier.call(void 0, edge, { ...t, start: t.depart, end: t.arrive + _chunk5OQV42W3cjs.MOTION.fade }, ctx)];
584
584
  }).join("");
585
585
  const refs = [...new Set(layout.moves.map((mv) => mv.ref))];
586
586
  const tags = refs.map((ref) => tagMotion(ref, layout.moves.filter((mv) => mv.ref === ref), timeOf, ctx)).join("") + carried;
@@ -604,19 +604,19 @@ function tagMotion(ref, list, timeOf, ctx) {
604
604
  const to = mv.to ? center(mv.to) : void 0;
605
605
  leave(a);
606
606
  if (mv.carried && from && to && on) {
607
- points.push([a + _chunkVRAW7VAQcjs.MOTION.fade, from[0], from[1]], [b - _chunkVRAW7VAQcjs.MOTION.fade, to[0], to[1]]);
608
- fades.push([a, { opacity: 1 }, _chunkVRAW7VAQcjs.EASE.inOut], [a + _chunkVRAW7VAQcjs.MOTION.fade, { opacity: 0 }], [b - _chunkVRAW7VAQcjs.MOTION.fade, { opacity: 0 }, _chunkVRAW7VAQcjs.EASE.out], [b, { opacity: 1 }]);
607
+ points.push([a + _chunk5OQV42W3cjs.MOTION.fade, from[0], from[1]], [b - _chunk5OQV42W3cjs.MOTION.fade, to[0], to[1]]);
608
+ fades.push([a, { opacity: 1 }, _chunk5OQV42W3cjs.EASE.inOut], [a + _chunk5OQV42W3cjs.MOTION.fade, { opacity: 0 }], [b - _chunk5OQV42W3cjs.MOTION.fade, { opacity: 0 }, _chunk5OQV42W3cjs.EASE.out], [b, { opacity: 1 }]);
609
609
  rest = { rect: mv.to, since: b };
610
610
  continue;
611
611
  }
612
612
  if (from) points.push([a, from[0], from[1]]);
613
613
  if (to) points.push([b, to[0], to[1]]);
614
614
  if (to && !on) {
615
- const show = from ? a : b - _chunkVRAW7VAQcjs.MOTION.fade;
616
- fades.push([show, { opacity: 0 }, _chunkVRAW7VAQcjs.EASE.out], [show + _chunkVRAW7VAQcjs.MOTION.fade, { opacity: 1 }]);
615
+ const show = from ? a : b - _chunk5OQV42W3cjs.MOTION.fade;
616
+ fades.push([show, { opacity: 0 }, _chunk5OQV42W3cjs.EASE.out], [show + _chunk5OQV42W3cjs.MOTION.fade, { opacity: 1 }]);
617
617
  on = true;
618
618
  } else if (!to && on) {
619
- fades.push([b, { opacity: 1 }, _chunkVRAW7VAQcjs.EASE.inOut], [b + _chunkVRAW7VAQcjs.MOTION.untilFade, { opacity: 0 }]);
619
+ fades.push([b, { opacity: 1 }, _chunk5OQV42W3cjs.EASE.inOut], [b + _chunk5OQV42W3cjs.MOTION.untilFade, { opacity: 0 }]);
620
620
  on = false;
621
621
  }
622
622
  if (mv.to) rest = { rect: mv.to, since: b };
@@ -625,13 +625,13 @@ function tagMotion(ref, list, timeOf, ctx) {
625
625
  if (points.length === 0) return "";
626
626
  const first = points[0];
627
627
  const last = points[points.length - 1];
628
- if (on) fades.push([m.last, { opacity: 1 }, _chunkVRAW7VAQcjs.EASE.inOut], [m.total, { opacity: 0 }]);
628
+ if (on) fades.push([m.last, { opacity: 1 }, _chunk5OQV42W3cjs.EASE.inOut], [m.total, { opacity: 0 }]);
629
629
  else fades.push([m.total, { opacity: 0 }]);
630
630
  const style = m.move([[0, first[1], first[2]], ...points, [m.total, last[1], last[2]]], fades);
631
- return `<g class="dg-a" data-ref="${_chunkOUQ44P45cjs.esc.call(void 0, ref)}" style="${style}">${tagShape(ref, ctx.sh)}</g>`;
631
+ return `<g class="dg-a" data-ref="${_chunkJCEKXALJcjs.esc.call(void 0, ref)}" style="${style}">${tagShape(ref, ctx.sh)}</g>`;
632
632
  }
633
633
 
634
634
 
635
635
 
636
636
  exports.drawGit = drawGit; exports.layoutGit = layoutGit;
637
- //# sourceMappingURL=git-I7D7RIW2.cjs.map
637
+ //# sourceMappingURL=git-K3KAAAWW.cjs.map