@cardenelabs/dragon 0.42.1 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -281,6 +281,15 @@ var TYPE = {
281
281
  gitId: text(11, 700),
282
282
  gitHash: text(10.5, 600, "mono"),
283
283
  gitNote: text(10.5, 650),
284
+ /**
285
+ * 木の図 (#3233) の、箱の中の値 (hash) と名札、根の箱の値と名札、葉の下の札の字。
286
+ * 値を持たない箱の名札は箱の名前 (`boxName`) の字で描く
287
+ */
288
+ treeHash: text(13.5, 700, "mono"),
289
+ treeName: text(10.5, 600),
290
+ rootHash: text(15, 700, "mono"),
291
+ rootName: text(11, 700),
292
+ treeCard: text(11.5, 650),
284
293
  /**
285
294
  * 時間軸の図 (#3165)。拡大の帯の列の上の字、印の列の名前、時刻の字、区切りの名前と目盛りの番号の範囲、
286
295
  * 節目の名札と状態、範囲の括弧の字、空きの枠の字、物差しの線の字。和文を含む字は同じ大きさと太さの和文の字で描く
@@ -373,6 +382,36 @@ var LOOK = {
373
382
  labelUnder: 50,
374
383
  colors: ["blue", "violet", "green", "amber", "rose"]
375
384
  },
385
+ /**
386
+ * 木の図 (#3233)。step 2 で本人が選んだ「根を上」の試作 (`.context/propose/merkle-look/`) の寸法を写す。
387
+ * 木の箱は幅の下限 `w`、高さ `h`、字の左右の余白 `padX`、角の丸み `radius`。根の箱は `root` の幅の下限と高さと角の丸みを持ち、
388
+ * 左に絵柄を置いて (`iconX` は箱の左端から絵柄の左端まで)、`textX` から字を左に揃えて並べ、右に `padR` を空ける。
389
+ * `nameY` と `hashY` は根の箱の真ん中から名札と値の基準線まで。ほかの箱の値と名札は `hashY` と `nameY`、1 行の字は `oneY` に置く。
390
+ * 葉は書いた順に横に並べ、隣の葉の箱の間を `slotGap` 空ける。根の上端は図の上の余白から `top` 下げ、深さの段の真ん中どうしは `row` 離す。
391
+ * `card` は値を持つ葉の下の名札の札で、葉の真ん中から札の真ん中まで `drop`、高さ `h`、幅の下限 `minW`、
392
+ * 字の左右の余白 `padX`、絵柄の幅 `icon` と絵柄と字の間 `gap`、絵柄の縮み `glyph`、角の丸み `radius`。
393
+ * `boxGap` は木と木でない箱の列の間、`badgeAlong` は木の線を走る段の番号を、曲がり角から横の線に沿って進める長さ。
394
+ * `faint` は木の線を運ぶ物が通った段から後に、運ぶ物を送りも受けもしていない木の箱を薄く出す濃さ。`color` と `rootColor` は木の箱と根の箱の色
395
+ */
396
+ tree: {
397
+ w: 74,
398
+ h: 44,
399
+ padX: 10,
400
+ radius: 10,
401
+ root: { w: 112, h: 54, radius: 13, iconX: 10, textX: 46, padR: 14, nameY: -4, hashY: 14 },
402
+ hashY: -1,
403
+ nameY: 14,
404
+ oneY: 4.5,
405
+ slotGap: 12,
406
+ top: 16,
407
+ row: 102,
408
+ card: { drop: 78, h: 30, minW: 70, padX: 10, icon: 12, gap: 6, glyph: 0.62, radius: 9 },
409
+ boxGap: 24,
410
+ badgeAlong: 22,
411
+ faint: 0.42,
412
+ color: "violet",
413
+ rootColor: "green"
414
+ },
376
415
  /**
377
416
  * 時間軸の図 (#3165)。見本帳の試作 (`scenes/finality.js`) の寸法を写す。
378
417
  * 図の幅は `width` で、時間軸は左の `axisX` から右の余白 `right` の手前まで。印の列の名前が長い時は、名前の右に `gutterGap` を空けて軸を右へ寄せる。
@@ -473,7 +512,10 @@ var LOOK = {
473
512
  timePoint: 1.75,
474
513
  timeFlag: 1.8,
475
514
  timeNeedle: 1.25,
476
- timeMeter: 1.25
515
+ timeMeter: 1.25,
516
+ tree: 1.5,
517
+ treeTrail: 2.6,
518
+ treeCon: 1.3
477
519
  },
478
520
  shadow: { near: 0.8, far: 4, nearY: 1, farY: 3 },
479
521
  mini: { w: 168, pad: 8, title: 14, inset: 12, radius: 10 },
@@ -1197,7 +1239,7 @@ function arrange(diagram, groups, slots, rooms) {
1197
1239
  };
1198
1240
  const inset = LOOK.edge.inset;
1199
1241
  const gapX = (col, toRight) => toRight ? colLeft[col] + colW[col] + (between[col] ?? A.columnGap) / 2 : colLeft[col] - (between[col - 1] ?? A.columnGap) / 2;
1200
- const route = (from, to) => {
1242
+ const route2 = (from, to) => {
1201
1243
  const a = byId.get(from);
1202
1244
  const b = byId.get(to);
1203
1245
  if (from === to) return loopUnder(a);
@@ -1270,7 +1312,7 @@ function arrange(diagram, groups, slots, rooms) {
1270
1312
  event,
1271
1313
  from: edge2.from,
1272
1314
  to: edge2.to,
1273
- points: route(edge2.from, edge2.to),
1315
+ points: route2(edge2.from, edge2.to),
1274
1316
  color: edgeColor(edge2, colors),
1275
1317
  carry: edge2.carry
1276
1318
  }));
@@ -1369,11 +1411,12 @@ function grow(layout, groups, slots, rooms) {
1369
1411
 
1370
1412
  // src/words.ts
1371
1413
  var keys = (table) => Object.keys(table);
1372
- var KINDS = keys({ sequence: true, architecture: true, state: true, git: true, time: true });
1414
+ var KINDS = keys({ sequence: true, architecture: true, state: true, git: true, time: true, tree: true });
1373
1415
  var STATE_ENDS = ["start", "finish"];
1374
1416
  var TIME_HEADS = ["scale", "period", "row", "point", "zoom", "mark", "span"];
1375
1417
  var NOW = "now";
1376
- var HEADS = ["group", "end", "box", "strip", "step", "say", "code", "source", "act", "note", "set", "branch", "commit", ...TIME_HEADS];
1418
+ var TREE_HEADS = ["leaf", "node"];
1419
+ var HEADS = ["group", "end", "box", "strip", "step", "say", "code", "source", "act", "note", "set", "branch", "commit", ...TIME_HEADS, ...TREE_HEADS];
1377
1420
  var AS = "as";
1378
1421
  var ON = "on";
1379
1422
  var COPY = "copy";
@@ -1381,6 +1424,7 @@ var MERGE = "merge";
1381
1424
  var FROM = "from";
1382
1425
  var HEAD = "HEAD";
1383
1426
  var AT = "at";
1427
+ var OF = "of";
1384
1428
  var ATTRS = {
1385
1429
  diagram: ["view"],
1386
1430
  group: ["note", "color", "icon"],
@@ -1392,6 +1436,8 @@ var ATTRS = {
1392
1436
  strip: ["meter"],
1393
1437
  branch: ["note"],
1394
1438
  commit: ["hash", "note"],
1439
+ leaf: ["hash"],
1440
+ node: ["hash"],
1395
1441
  scale: ["from"],
1396
1442
  period: ["from"],
1397
1443
  row: ["color", "empty"],
@@ -1613,11 +1659,11 @@ function layoutGit(diagram) {
1613
1659
  col.set(c.id, k);
1614
1660
  laneLast.set(c.branch, k);
1615
1661
  }
1616
- const linesOf = (c) => [
1662
+ const linesOf2 = (c) => [
1617
1663
  ...c.hash !== void 0 ? [{ text: c.hash, style: TYPE.gitHash }] : [],
1618
1664
  ...c.note !== void 0 ? [{ text: c.note, style: TYPE.gitNote }] : []
1619
1665
  ];
1620
- const textW = (c) => Math.max(0, ...linesOf(c).map((line) => textWidth(line.text, line.style)));
1666
+ const textW = (c) => Math.max(0, ...linesOf2(c).map((line) => textWidth(line.text, line.style)));
1621
1667
  const tagW = (ref) => textWidth(ref, hasWide(ref) ? TYPE.carrierJa : TYPE.carrier) + C.tagPadX * 2;
1622
1668
  const refWidth = Math.max(0, ...walked.refs.map((r) => tagW(r.name)));
1623
1669
  const pitch = Math.max(G.pitch, ...walked.made.map((c) => textW(c) + G.textGap), refWidth + G.textGap);
@@ -1632,7 +1678,7 @@ function layoutGit(diagram) {
1632
1678
  })
1633
1679
  );
1634
1680
  const extraRows = (branch) => Math.max(0, ...walked.made.filter((c) => c.branch === branch).map((c) => (walked.rows.get(c.id) ?? 0) - 2)) * G.row;
1635
- const topText = walked.made.some((c) => laneIndex.get(c.branch) === 0 && linesOf(c).length > 0);
1681
+ const topText = walked.made.some((c) => laneIndex.get(c.branch) === 0 && linesOf2(c).length > 0);
1636
1682
  const lanes = [];
1637
1683
  let y = margin;
1638
1684
  walked.branches.forEach((id, i) => {
@@ -1650,7 +1696,7 @@ function layoutGit(diagram) {
1650
1696
  const isTop = laneIndex.get(c.branch) === 0;
1651
1697
  const cx = x0 + pitch * (col.get(c.id) ?? 0) + (isTop ? 0 : pitch / 2);
1652
1698
  const cy = lane.line;
1653
- const lines = linesOf(c);
1699
+ const lines = linesOf2(c);
1654
1700
  const baselines = lines.map((_, k) => isTop ? cy - G.above - (lines.length - 1 - k) * G.lineStep : cy + G.under + k * G.lineStep);
1655
1701
  const boxes2 = lines.map((line, k) => textBox(line.text, cx, baselines[k], line.style, "middle"));
1656
1702
  const text2 = boxes2.length === 0 ? void 0 : { ...union(boxes2), lines: lines.map((line) => line.text), baselines };
@@ -2210,7 +2256,7 @@ function layoutState(diagram, lang) {
2210
2256
  };
2211
2257
  const exitX = (box) => starts && box === first ? box.cx + T.side.entry : box.cx;
2212
2258
  const finishOf = (id) => ends.find((e) => e.kind === "finish" && e.box === id);
2213
- const route = (from, to) => {
2259
+ const route2 = (from, to) => {
2214
2260
  if (from === "start") {
2215
2261
  const start = ends.find((e) => e.kind === "start");
2216
2262
  const target = byId.get(to);
@@ -2254,7 +2300,7 @@ function layoutState(diagram, lang) {
2254
2300
  event,
2255
2301
  from: edge2.from,
2256
2302
  to: edge2.to,
2257
- points: route(edge2.from, edge2.to),
2303
+ points: route2(edge2.from, edge2.to),
2258
2304
  color: colorOf(edge2, colors),
2259
2305
  carry: edge2.carry,
2260
2306
  ...settle ? { settle } : {},
@@ -2271,7 +2317,7 @@ function layoutState(diagram, lang) {
2271
2317
  e.points = e.points.map(([x, y]) => flat ? [x, y + d] : [x + d, y]);
2272
2318
  outward.set(e, flat ? d > 0 ? "below" : "above" : d > 0 ? "right" : "left");
2273
2319
  }
2274
- const paths = notTaken.map((p) => ({ from: p.from, to: p.to, points: route(p.from, p.to) }));
2320
+ const paths = notTaken.map((p) => ({ from: p.from, to: p.to, points: route2(p.from, p.to) }));
2275
2321
  const badgeAt = (edge2, taken, lines2) => edge2.from === edge2.to ? loopBadge(edge2.points) : badgeOnPath(edge2.points, taken, lines2);
2276
2322
  const labels = [];
2277
2323
  const marks = ends.flatMap((e) => e.text === "" ? [] : [textBox(e.text, ...markText(e), TYPE.regionNote)]);
@@ -2804,6 +2850,321 @@ function labelsOf2(diagram, layout) {
2804
2850
  return labels;
2805
2851
  }
2806
2852
 
2853
+ // src/layout/tree.ts
2854
+ var isTreeLayout = (layout) => layout.kind === "tree";
2855
+ function grow2(diagram) {
2856
+ const boxes = new Set(diagram.boxes.map((b) => b.id));
2857
+ const byId = /* @__PURE__ */ new Set();
2858
+ const parents = /* @__PURE__ */ new Map();
2859
+ const grown = [];
2860
+ diagram.steps.forEach((step, s) => {
2861
+ step.events.forEach((e, k) => {
2862
+ if (e.type !== "leaf" && e.type !== "node" || byId.has(e.id) || boxes.has(e.id)) return;
2863
+ const children = e.type === "node" ? [...new Set(e.children)].filter((c) => byId.has(c) && !parents.has(c)) : [];
2864
+ for (const c of children) parents.set(c, e.id);
2865
+ grown.push({ id: e.id, kind: e.type, children, step: s, event: k, ...e.hash !== void 0 ? { hash: e.hash } : {} });
2866
+ byId.add(e.id);
2867
+ });
2868
+ });
2869
+ return { grown, parents };
2870
+ }
2871
+ function linesOf(g, root) {
2872
+ if (g.hash === void 0) return [{ text: g.id, style: TYPE.boxName }];
2873
+ if (root)
2874
+ return [
2875
+ { text: g.id, style: TYPE.rootName },
2876
+ { text: g.hash, style: TYPE.rootHash }
2877
+ ];
2878
+ if (g.kind === "leaf") return [{ text: g.hash, style: TYPE.treeHash }];
2879
+ return [
2880
+ { text: g.hash, style: TYPE.treeHash },
2881
+ { text: g.id, style: TYPE.treeName }
2882
+ ];
2883
+ }
2884
+ function route(a, b) {
2885
+ const i = LOOK.edge.inset;
2886
+ const top = Math.max(a.y, b.y);
2887
+ const bottom = Math.min(a.y + a.h, b.y + b.h);
2888
+ if (bottom > top) {
2889
+ const y = (top + bottom) / 2;
2890
+ return b.x >= a.x + a.w ? [
2891
+ [a.x + a.w + i, y],
2892
+ [b.x - i, y]
2893
+ ] : [
2894
+ [a.x - i, y],
2895
+ [b.x + b.w + i, y]
2896
+ ];
2897
+ }
2898
+ const left = Math.max(a.x, b.x);
2899
+ const right = Math.min(a.x + a.w, b.x + b.w);
2900
+ if (right > left) {
2901
+ const x = (left + right) / 2;
2902
+ return b.y >= a.y + a.h ? [
2903
+ [x, a.y + a.h + i],
2904
+ [x, b.y - i]
2905
+ ] : [
2906
+ [x, a.y - i],
2907
+ [x, b.y + b.h + i]
2908
+ ];
2909
+ }
2910
+ const ax = a.x + a.w / 2;
2911
+ const ty = b.y + b.h / 2;
2912
+ return [
2913
+ [ax, b.y > a.y ? a.y + a.h + i : a.y - i],
2914
+ [ax, ty],
2915
+ [b.x > ax ? b.x - i : b.x + b.w + i, ty]
2916
+ ];
2917
+ }
2918
+ function layoutTree(diagram) {
2919
+ const { margin, gap, box: B, tree: T, badge: BD } = LOOK;
2920
+ const { grown, parents } = grow2(diagram);
2921
+ const tops = grown.filter((g) => !parents.has(g.id));
2922
+ const rootId = tops[tops.length - 1]?.id;
2923
+ const byId = new Map(grown.map((g) => [g.id, g]));
2924
+ const depth = /* @__PURE__ */ new Map();
2925
+ const walk2 = (id, d) => {
2926
+ depth.set(id, d);
2927
+ for (const c of byId.get(id)?.children ?? []) walk2(c, d + 1);
2928
+ };
2929
+ for (const t of tops) walk2(t.id, 0);
2930
+ const texts = new Map(grown.map((g) => [g.id, linesOf(g, g.id === rootId)]));
2931
+ const widest = (id) => Math.max(0, ...(texts.get(id) ?? []).map((line) => textWidth(line.text, line.style)));
2932
+ const widthOf = (g) => g.id === rootId ? Math.max(T.root.w, T.root.textX + widest(g.id) + T.root.padR) : Math.max(T.w, widest(g.id) + T.padX * 2);
2933
+ const cardW = (g) => Math.max(T.card.minW, T.card.padX * 2 + T.card.icon + T.card.gap + textWidth(g.id, TYPE.treeCard));
2934
+ const hasCard = (g) => g.kind === "leaf" && g.hash !== void 0;
2935
+ const slots = grown.filter((g) => g.children.length === 0);
2936
+ const pitch = Math.max(...grown.filter((g) => g.id !== rootId || g.children.length === 0).map((g) => Math.max(widthOf(g), hasCard(g) ? cardW(g) : 0)), T.w) + T.slotGap;
2937
+ const x0 = margin + BD.r * 2 + BD.inset;
2938
+ const xs = /* @__PURE__ */ new Map();
2939
+ slots.forEach((g, i) => xs.set(g.id, x0 + pitch * (i + 0.5)));
2940
+ const xOf = (id) => {
2941
+ const known = xs.get(id);
2942
+ if (known !== void 0) return known;
2943
+ const kids = byId.get(id)?.children ?? [];
2944
+ const x = (xOf(kids[0]) + xOf(kids[kids.length - 1])) / 2;
2945
+ xs.set(id, x);
2946
+ return x;
2947
+ };
2948
+ const top0 = margin + T.top;
2949
+ const yOf = (d) => top0 + T.root.h / 2 + d * T.row;
2950
+ const colors = boxColors(diagram);
2951
+ const nodes = grown.map((g) => {
2952
+ const root = g.id === rootId;
2953
+ const d = depth.get(g.id) ?? 0;
2954
+ const cx = xOf(g.id);
2955
+ const cy = yOf(d);
2956
+ const w = widthOf(g);
2957
+ const h = root ? T.root.h : T.h;
2958
+ const lines = texts.get(g.id) ?? [];
2959
+ const baselines = lines.length === 1 ? [cy + T.oneY] : root ? [cy + T.root.nameY, cy + T.root.hashY] : [cy + T.hashY, cy + T.nameY];
2960
+ const parent = parents.get(g.id);
2961
+ const color = root ? T.rootColor : T.color;
2962
+ colors.set(g.id, color);
2963
+ const cw = cardW(g);
2964
+ return {
2965
+ id: g.id,
2966
+ kind: g.kind,
2967
+ depth: d,
2968
+ ...parent !== void 0 ? { parent } : {},
2969
+ children: g.children,
2970
+ step: g.step,
2971
+ event: g.event,
2972
+ ...g.hash !== void 0 ? { hash: g.hash } : {},
2973
+ root,
2974
+ x: cx - w / 2,
2975
+ y: cy - h / 2,
2976
+ w,
2977
+ h,
2978
+ cx,
2979
+ cy,
2980
+ color,
2981
+ lines: lines.map((line) => line.text),
2982
+ baselines,
2983
+ styles: lines.map((line) => line.style),
2984
+ ...hasCard(g) ? { card: { x: cx - cw / 2, y: cy + T.card.drop - T.card.h / 2, w: cw, h: T.card.h, text: g.id } } : {}
2985
+ };
2986
+ });
2987
+ const placed = new Map(nodes.map((n) => [n.id, n]));
2988
+ const links = nodes.flatMap(
2989
+ (p) => p.children.flatMap((id) => {
2990
+ const c = placed.get(id);
2991
+ if (!c) return [];
2992
+ const mid = (c.y + p.y + p.h) / 2;
2993
+ const points2 = [
2994
+ [c.cx, c.y - LOOK.edge.inset],
2995
+ [c.cx, mid],
2996
+ [p.cx, mid],
2997
+ [p.cx, p.y + p.h + LOOK.edge.inset]
2998
+ ];
2999
+ return [{ from: c.id, to: p.id, step: p.step, event: p.event, points: points2 }];
3000
+ })
3001
+ );
3002
+ const rooms = slotRooms(diagram);
3003
+ const treeRight = Math.max(x0, ...nodes.flatMap((n) => [n.x + n.w, ...n.card ? [n.card.x + n.card.w] : []]));
3004
+ const rootBox = nodes.find((n) => n.root);
3005
+ const ids = new Set(diagram.boxes.map((b) => b.id));
3006
+ const named = edgesOf(diagram).flatMap(({ edge: edge2 }) => edge2.label !== void 0 && (ids.has(edge2.from) || ids.has(edge2.to)) ? [textWidth(edge2.label, labelStyle(edge2.label)) + LOOK.label.padX * 2] : []);
3007
+ const boxX = Math.max(treeRight + T.boxGap, (rootBox ? rootBox.x + rootBox.w : x0) + Math.max(0, ...named) + gap * 2);
3008
+ let by = rootBox?.y ?? top0;
3009
+ const boxes = diagram.boxes.map((b) => {
3010
+ const w = Math.max(boxWidth(diagram, b.id, true), slotBoxWidth(rooms.get(b.id), b.icon !== void 0, B.padX));
3011
+ const y = by;
3012
+ by += B.h + gap;
3013
+ const box = {
3014
+ id: b.id,
3015
+ name: b.name,
3016
+ ...b.sub !== void 0 ? { sub: b.sub } : {},
3017
+ ...b.icon !== void 0 ? { icon: b.icon } : {},
3018
+ color: colors.get(b.id) ?? "slate",
3019
+ x: boxX,
3020
+ y,
3021
+ w,
3022
+ h: B.h,
3023
+ cx: boxX + w / 2,
3024
+ cy: y + B.h / 2
3025
+ };
3026
+ placeSlot(box, rooms.get(b.id));
3027
+ return box;
3028
+ });
3029
+ const boxById = new Map(boxes.map((b) => [b.id, b]));
3030
+ const runs = [];
3031
+ const edges = diagram.steps.flatMap(
3032
+ (step, s) => step.events.flatMap((e, k) => {
3033
+ if (e.type !== "edge") return [];
3034
+ const a = placed.get(e.from) ?? boxById.get(e.from);
3035
+ const b = placed.get(e.to) ?? boxById.get(e.to);
3036
+ if (!a || !b) return [];
3037
+ const up = links.find((l) => l.from === e.from && l.to === e.to);
3038
+ const down = links.find((l) => l.from === e.to && l.to === e.from);
3039
+ const link = up ?? down;
3040
+ if (link) runs.push({ step: s, event: k, link: link.from });
3041
+ const points2 = up ? up.points : down ? [...down.points].reverse() : e.from === e.to ? loopUnder({ cx: a.x + a.w / 2, y: a.y, h: a.h }) : route(a, b);
3042
+ return [{ step: s, event: k, from: e.from, to: e.to, points: points2, color: edgeColor(e, colors), carry: e.carry }];
3043
+ })
3044
+ );
3045
+ seatCarriers(edges, boxById, rooms);
3046
+ const layout = {
3047
+ kind: "tree",
3048
+ width: 0,
3049
+ height: 0,
3050
+ regions: [],
3051
+ boxes,
3052
+ lifelines: [],
3053
+ edges,
3054
+ labels: [],
3055
+ actions: [],
3056
+ badges: [],
3057
+ paths: [],
3058
+ ends: [],
3059
+ nodes,
3060
+ links,
3061
+ runs
3062
+ };
3063
+ layout.badges = badgesOf3(diagram, layout);
3064
+ layout.labels = labelsOf3(diagram, layout);
3065
+ const cards = nodes.flatMap((n) => n.card ? [n.card] : []);
3066
+ const solids = [...nodes, ...cards, ...boxes, ...layout.labels];
3067
+ const points = edges.flatMap((e) => e.points);
3068
+ const right = Math.max(...solids.map((r) => r.x + r.w), ...points.map(([x]) => x), x0);
3069
+ const bottom = Math.max(...solids.map((r) => r.y + r.h), ...points.map(([, y]) => y), top0);
3070
+ const width = Math.max(right + margin, stripNeed(diagram) + margin * 2);
3071
+ const strip2 = layoutStrip(diagram, margin, bottom + gap, width - margin * 2);
3072
+ layout.width = width;
3073
+ layout.height = (strip2 ? strip2.y + strip2.h : bottom) + margin;
3074
+ if (strip2) layout.strip = strip2;
3075
+ layout.badges = badgesOf3(diagram, layout);
3076
+ return layout;
3077
+ }
3078
+ function badgesOf3(diagram, layout) {
3079
+ const { r, inset } = LOOK.badge;
3080
+ const apart = r * 2 + inset;
3081
+ const taken = [];
3082
+ const out = [];
3083
+ const solids = [...layout.nodes, ...layout.nodes.flatMap((n) => n.card ? [n.card] : []), ...layout.boxes];
3084
+ const free = (p) => taken.every(([x, y]) => Math.hypot(p[0] - x, p[1] - y) >= apart) && solids.every((s) => gapBetween(badgeRect(p), s) >= LOOK.label.touch);
3085
+ const put = (s, p, color) => {
3086
+ taken.push(p);
3087
+ out.push({ step: s, x: p[0], y: p[1], color });
3088
+ };
3089
+ const passed = /* @__PURE__ */ new Map();
3090
+ diagram.steps.forEach((step, s) => {
3091
+ const k = step.events.findIndex((e2) => e2.type === "leaf" || e2.type === "node" || e2.type === "edge");
3092
+ const first = step.events[k];
3093
+ const n = layout.nodes.find((x) => x.step === s && x.event === k);
3094
+ if (first && first.type !== "edge" && n) {
3095
+ const spots = [
3096
+ [n.x - inset - r, n.cy],
3097
+ [n.x, n.y],
3098
+ [n.x + n.w + inset + r, n.cy],
3099
+ [n.x + n.w, n.y]
3100
+ ];
3101
+ put(s, spots.find(free) ?? spots[0], n.color);
3102
+ return;
3103
+ }
3104
+ const e = layout.edges.find((x) => x.step === s && x.event === k);
3105
+ if (first?.type === "edge" && e) {
3106
+ const key = [e.from, e.to].sort().join("\n");
3107
+ const run = layout.runs.some((x) => x.step === s && x.event === k);
3108
+ const lines = layout.edges.filter((x) => x !== e).map((x) => x.points);
3109
+ const point = passed.get(key) ?? (run ? onLink(e.points, free) : midway(e, free)) ?? badgeOnPath(e.points, taken, lines);
3110
+ passed.set(key, point);
3111
+ put(s, point, e.color);
3112
+ return;
3113
+ }
3114
+ const box = step.events.flatMap((ev) => ev.type === "swap" || ev.type === "action" ? [ev.box] : []).flatMap((id) => layout.boxes.filter((b) => b.id === id))[0];
3115
+ if (box) {
3116
+ out.push({ step: s, x: box.x, y: box.y, color: box.color });
3117
+ return;
3118
+ }
3119
+ if (layout.strip && step.events.some((ev) => ev.type === "strip")) {
3120
+ out.push({ step: s, x: layout.strip.x + inset, y: layout.strip.y + inset, color: "slate" });
3121
+ return;
3122
+ }
3123
+ const before = out[out.length - 1];
3124
+ const root = layout.nodes.find((x) => x.root);
3125
+ out.push(before ? { ...before, step: s } : { step: s, x: root?.x ?? LOOK.margin, y: root?.y ?? LOOK.margin, color: root?.color ?? "slate" });
3126
+ });
3127
+ return replaceSameSpot(out);
3128
+ }
3129
+ function onLink(points, free) {
3130
+ const [p0, p1, p2] = points;
3131
+ const flat = Math.abs(p2[0] - p1[0]);
3132
+ const { r, inset } = LOOK.badge;
3133
+ if (flat >= LOOK.tree.badgeAlong + r) {
3134
+ const p = along(points, pathLength([p0, p1]) + LOOK.tree.badgeAlong);
3135
+ if (free(p)) return p;
3136
+ }
3137
+ const side2 = [p1[0] + r + inset, p1[1]];
3138
+ return free(side2) ? side2 : void 0;
3139
+ }
3140
+ function midway(e, free) {
3141
+ const length = pathLength(e.points);
3142
+ const room = carrierHalf(e.carry)[0] + LOOK.badge.r + LOOK.badge.inset;
3143
+ for (let d = 0; d <= length / 2 - room; d += 1) {
3144
+ for (const at2 of [length / 2 - d, length / 2 + d]) {
3145
+ const p = along(e.points, at2);
3146
+ if (free(p)) return p;
3147
+ }
3148
+ }
3149
+ return void 0;
3150
+ }
3151
+ function labelsOf3(diagram, layout) {
3152
+ const labels = [];
3153
+ const cards = layout.nodes.flatMap((n) => n.card ? [n.card] : []);
3154
+ for (const e of layout.edges) {
3155
+ const source = diagram.steps[e.step]?.events[e.event];
3156
+ if (source?.type !== "edge" || source.label === void 0) continue;
3157
+ const seen = layout.badges.filter((b) => b.step <= e.step).map((b) => badgeRect([b.x, b.y]));
3158
+ labels.push(
3159
+ placeLabel(
3160
+ { step: e.step, event: e.event, text: source.label, points: e.points, color: e.color, ...source.labelSide ? { side: source.labelSide } : {}, flip: true },
3161
+ { hard: [...layout.nodes, ...layout.boxes], soft: [...cards, ...labels.filter((l) => l.step === e.step)], touch: seen }
3162
+ )
3163
+ );
3164
+ }
3165
+ return labels;
3166
+ }
3167
+
2807
3168
  // src/field-messages.ts
2808
3169
  var TYPES_JA = {
2809
3170
  string: "\u6587\u5B57\u5217\u306B\u3059\u308B",
@@ -2877,7 +3238,7 @@ function ucs2length(str) {
2877
3238
  return length;
2878
3239
  }
2879
3240
  var validate_diagram_default = validate10;
2880
- var schema11 = { "properties": { "version": { "description": "\u5F62\u5F0F\u306E\u7248", "type": "integer", "minimum": 1 }, "kind": { "description": "\u56F3\u306E\u7A2E\u985E", "enum": ["sequence", "architecture", "state", "git", "time"] }, "title": { "$ref": "#/definitions/text" }, "view": { "description": "\u898B\u305B\u65B9\u3002\u66F8\u304B\u306A\u3051\u308C\u3070\u5B57\u306E\u5927\u304D\u3055\u3067\u9078\u3076\u3002fixed \u306F\u5168\u4F53\u3092\u6B62\u3081\u3066\u4E2D\u3060\u3051\u52D5\u304B\u3057\u3001follow \u306F\u5BC4\u3063\u3066\u52D5\u304B\u3057\u5168\u4F53\u56F3\u3067\u4ECA\u3069\u3053\u304B\u3092\u793A\u3059", "enum": ["fixed", "follow"] }, "regions": { "type": "array", "items": { "$ref": "#/definitions/region" } }, "boxes": { "type": "array", "items": { "$ref": "#/definitions/box" } }, "strip": { "$ref": "#/definitions/strip" }, "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/step" } }, "sequence": { "$ref": "#/definitions/sequence" }, "state": { "$ref": "#/definitions/state" }, "git": { "$ref": "#/definitions/git" }, "time": { "$ref": "#/definitions/time" } }};
3241
+ var schema11 = { "properties": { "version": { "description": "\u5F62\u5F0F\u306E\u7248", "type": "integer", "minimum": 1 }, "kind": { "description": "\u56F3\u306E\u7A2E\u985E", "enum": ["sequence", "architecture", "state", "git", "time", "tree"] }, "title": { "$ref": "#/definitions/text" }, "view": { "description": "\u898B\u305B\u65B9\u3002\u66F8\u304B\u306A\u3051\u308C\u3070\u5B57\u306E\u5927\u304D\u3055\u3067\u9078\u3076\u3002fixed \u306F\u5168\u4F53\u3092\u6B62\u3081\u3066\u4E2D\u3060\u3051\u52D5\u304B\u3057\u3001follow \u306F\u5BC4\u3063\u3066\u52D5\u304B\u3057\u5168\u4F53\u56F3\u3067\u4ECA\u3069\u3053\u304B\u3092\u793A\u3059", "enum": ["fixed", "follow"] }, "regions": { "type": "array", "items": { "$ref": "#/definitions/region" } }, "boxes": { "type": "array", "items": { "$ref": "#/definitions/box" } }, "strip": { "$ref": "#/definitions/strip" }, "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/step" } }, "sequence": { "$ref": "#/definitions/sequence" }, "state": { "$ref": "#/definitions/state" }, "git": { "$ref": "#/definitions/git" }, "time": { "$ref": "#/definitions/time" } }};
2881
3242
  function validate11(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
2882
3243
  let vErrors = null;
2883
3244
  let errors = 0;
@@ -2937,34 +3298,79 @@ function validate11(data, { instancePath = "", parentData, parentDataProperty, r
2937
3298
  }
2938
3299
  }
2939
3300
  }
3301
+ const _errs8 = errors;
3302
+ const _errs9 = errors;
3303
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
3304
+ if (data2.type === void 0 && ("type")) {
3305
+ const err3 = {};
3306
+ if (vErrors === null) {
3307
+ vErrors = [err3];
3308
+ } else {
3309
+ vErrors.push(err3);
3310
+ }
3311
+ errors++;
3312
+ } else {
3313
+ if (data2.type !== void 0) {
3314
+ let data4 = data2.type;
3315
+ if (!(data4 === "leaf" || data4 === "node")) {
3316
+ const err4 = {};
3317
+ if (vErrors === null) {
3318
+ vErrors = [err4];
3319
+ } else {
3320
+ vErrors.push(err4);
3321
+ }
3322
+ errors++;
3323
+ }
3324
+ }
3325
+ }
3326
+ }
3327
+ var valid9 = _errs9 === errors;
3328
+ if (valid9) {
3329
+ const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
3330
+ if (vErrors === null) {
3331
+ vErrors = [err5];
3332
+ } else {
3333
+ vErrors.push(err5);
3334
+ }
3335
+ errors++;
3336
+ } else {
3337
+ errors = _errs8;
3338
+ if (vErrors !== null) {
3339
+ if (_errs8) {
3340
+ vErrors.length = _errs8;
3341
+ } else {
3342
+ vErrors = null;
3343
+ }
3344
+ }
3345
+ }
2940
3346
  if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
2941
3347
  if (data2.type !== void 0) {
2942
- let data4 = data2.type;
2943
- const _errs8 = errors;
2944
- const _errs9 = errors;
2945
- if (!(data4 === "commit" || data4 === "branch")) {
2946
- const err3 = {};
3348
+ let data5 = data2.type;
3349
+ const _errs13 = errors;
3350
+ const _errs14 = errors;
3351
+ if (!(data5 === "commit" || data5 === "branch")) {
3352
+ const err6 = {};
2947
3353
  if (vErrors === null) {
2948
- vErrors = [err3];
3354
+ vErrors = [err6];
2949
3355
  } else {
2950
- vErrors.push(err3);
3356
+ vErrors.push(err6);
2951
3357
  }
2952
3358
  errors++;
2953
3359
  }
2954
- var valid9 = _errs9 === errors;
2955
- if (valid9) {
2956
- const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
3360
+ var valid13 = _errs14 === errors;
3361
+ if (valid13) {
3362
+ const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
2957
3363
  if (vErrors === null) {
2958
- vErrors = [err4];
3364
+ vErrors = [err7];
2959
3365
  } else {
2960
- vErrors.push(err4);
3366
+ vErrors.push(err7);
2961
3367
  }
2962
3368
  errors++;
2963
3369
  } else {
2964
- errors = _errs8;
3370
+ errors = _errs13;
2965
3371
  if (vErrors !== null) {
2966
- if (_errs8) {
2967
- vErrors.length = _errs8;
3372
+ if (_errs13) {
3373
+ vErrors.length = _errs13;
2968
3374
  } else {
2969
3375
  vErrors = null;
2970
3376
  }
@@ -2972,29 +3378,29 @@ function validate11(data, { instancePath = "", parentData, parentDataProperty, r
2972
3378
  }
2973
3379
  }
2974
3380
  if (data2.at !== void 0) {
2975
- const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3381
+ const err8 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
2976
3382
  if (vErrors === null) {
2977
- vErrors = [err5];
3383
+ vErrors = [err8];
2978
3384
  } else {
2979
- vErrors.push(err5);
3385
+ vErrors.push(err8);
2980
3386
  }
2981
3387
  errors++;
2982
3388
  }
2983
3389
  if (data2.into !== void 0) {
2984
- const err6 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3390
+ const err9 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
2985
3391
  if (vErrors === null) {
2986
- vErrors = [err6];
3392
+ vErrors = [err9];
2987
3393
  } else {
2988
- vErrors.push(err6);
3394
+ vErrors.push(err9);
2989
3395
  }
2990
3396
  errors++;
2991
3397
  }
2992
3398
  if (data2.color !== void 0) {
2993
- const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3399
+ const err10 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
2994
3400
  if (vErrors === null) {
2995
- vErrors = [err7];
3401
+ vErrors = [err10];
2996
3402
  } else {
2997
- vErrors.push(err7);
3403
+ vErrors.push(err10);
2998
3404
  }
2999
3405
  errors++;
3000
3406
  }
@@ -3084,31 +3490,76 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
3084
3490
  }
3085
3491
  }
3086
3492
  }
3493
+ const _errs8 = errors;
3494
+ const _errs9 = errors;
3087
3495
  if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
3088
- if (data2.at !== void 0) {
3089
- const err3 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3496
+ if (data2.type === void 0 && ("type")) {
3497
+ const err3 = {};
3090
3498
  if (vErrors === null) {
3091
3499
  vErrors = [err3];
3092
3500
  } else {
3093
3501
  vErrors.push(err3);
3094
3502
  }
3095
3503
  errors++;
3504
+ } else {
3505
+ if (data2.type !== void 0) {
3506
+ let data4 = data2.type;
3507
+ if (!(data4 === "leaf" || data4 === "node")) {
3508
+ const err4 = {};
3509
+ if (vErrors === null) {
3510
+ vErrors = [err4];
3511
+ } else {
3512
+ vErrors.push(err4);
3513
+ }
3514
+ errors++;
3515
+ }
3516
+ }
3517
+ }
3518
+ }
3519
+ var valid9 = _errs9 === errors;
3520
+ if (valid9) {
3521
+ const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
3522
+ if (vErrors === null) {
3523
+ vErrors = [err5];
3524
+ } else {
3525
+ vErrors.push(err5);
3526
+ }
3527
+ errors++;
3528
+ } else {
3529
+ errors = _errs8;
3530
+ if (vErrors !== null) {
3531
+ if (_errs8) {
3532
+ vErrors.length = _errs8;
3533
+ } else {
3534
+ vErrors = null;
3535
+ }
3536
+ }
3537
+ }
3538
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
3539
+ if (data2.at !== void 0) {
3540
+ const err6 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3541
+ if (vErrors === null) {
3542
+ vErrors = [err6];
3543
+ } else {
3544
+ vErrors.push(err6);
3545
+ }
3546
+ errors++;
3096
3547
  }
3097
3548
  if (data2.into !== void 0) {
3098
- const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3549
+ const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3099
3550
  if (vErrors === null) {
3100
- vErrors = [err4];
3551
+ vErrors = [err7];
3101
3552
  } else {
3102
- vErrors.push(err4);
3553
+ vErrors.push(err7);
3103
3554
  }
3104
3555
  errors++;
3105
3556
  }
3106
3557
  if (data2.color !== void 0) {
3107
- const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3558
+ const err8 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3108
3559
  if (vErrors === null) {
3109
- vErrors = [err5];
3560
+ vErrors = [err8];
3110
3561
  } else {
3111
- vErrors.push(err5);
3562
+ vErrors.push(err8);
3112
3563
  }
3113
3564
  errors++;
3114
3565
  }
@@ -3122,63 +3573,296 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
3122
3573
  validate17.errors = vErrors;
3123
3574
  return errors === 0;
3124
3575
  }
3125
- var schema45 = { "enum": ["blue", "amber", "green", "violet", "rose", "slate", "coin"] };
3126
- var pattern0 = new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$", "u");
3127
- var func3 = ucs2length;
3128
- function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3576
+ function validate20(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3129
3577
  let vErrors = null;
3130
3578
  let errors = 0;
3131
- if (data && typeof data == "object" && !Array.isArray(data)) {
3132
- if (data.id === void 0) {
3133
- const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
3134
- if (vErrors === null) {
3135
- vErrors = [err0];
3136
- } else {
3137
- vErrors.push(err0);
3138
- }
3139
- errors++;
3140
- }
3141
- if (data.name === void 0) {
3142
- const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "name" }, message: "must have required property 'name'" };
3143
- if (vErrors === null) {
3144
- vErrors = [err1];
3145
- } else {
3146
- vErrors.push(err1);
3147
- }
3148
- errors++;
3149
- }
3150
- for (const key0 in data) {
3151
- if (!(key0 === "id" || key0 === "name" || key0 === "note" || key0 === "color" || key0 === "icon")) {
3152
- const err2 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
3153
- if (vErrors === null) {
3154
- vErrors = [err2];
3155
- } else {
3156
- vErrors.push(err2);
3157
- }
3158
- errors++;
3159
- }
3160
- }
3161
- if (data.id !== void 0) {
3162
- let data0 = data.id;
3163
- if (typeof data0 === "string") {
3164
- if (!pattern0.test(data0)) {
3165
- const err3 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
3166
- if (vErrors === null) {
3167
- vErrors = [err3];
3168
- } else {
3169
- vErrors.push(err3);
3170
- }
3171
- errors++;
3172
- }
3173
- } else {
3174
- const err4 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
3175
- if (vErrors === null) {
3176
- vErrors = [err4];
3177
- } else {
3178
- vErrors.push(err4);
3179
- }
3180
- errors++;
3181
- }
3579
+ if (Array.isArray(data)) {
3580
+ const len0 = data.length;
3581
+ for (let i0 = 0; i0 < len0; i0++) {
3582
+ let data0 = data[i0];
3583
+ if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
3584
+ if (data0.events !== void 0) {
3585
+ let data1 = data0.events;
3586
+ if (Array.isArray(data1)) {
3587
+ const len1 = data1.length;
3588
+ for (let i1 = 0; i1 < len1; i1++) {
3589
+ let data2 = data1[i1];
3590
+ const _errs4 = errors;
3591
+ const _errs5 = errors;
3592
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
3593
+ if (data2.type === void 0 && ("type")) {
3594
+ const err0 = {};
3595
+ if (vErrors === null) {
3596
+ vErrors = [err0];
3597
+ } else {
3598
+ vErrors.push(err0);
3599
+ }
3600
+ errors++;
3601
+ } else {
3602
+ if (data2.type !== void 0) {
3603
+ let data3 = data2.type;
3604
+ if (!(data3 === "leaf" || data3 === "node")) {
3605
+ const err1 = {};
3606
+ if (vErrors === null) {
3607
+ vErrors = [err1];
3608
+ } else {
3609
+ vErrors.push(err1);
3610
+ }
3611
+ errors++;
3612
+ }
3613
+ }
3614
+ }
3615
+ }
3616
+ var valid6 = _errs5 === errors;
3617
+ if (valid6) {
3618
+ const err2 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
3619
+ if (vErrors === null) {
3620
+ vErrors = [err2];
3621
+ } else {
3622
+ vErrors.push(err2);
3623
+ }
3624
+ errors++;
3625
+ } else {
3626
+ errors = _errs4;
3627
+ if (vErrors !== null) {
3628
+ if (_errs4) {
3629
+ vErrors.length = _errs4;
3630
+ } else {
3631
+ vErrors = null;
3632
+ }
3633
+ }
3634
+ }
3635
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
3636
+ if (data2.type !== void 0) {
3637
+ let data4 = data2.type;
3638
+ const _errs9 = errors;
3639
+ const _errs10 = errors;
3640
+ if (!(data4 === "commit" || data4 === "branch")) {
3641
+ const err3 = {};
3642
+ if (vErrors === null) {
3643
+ vErrors = [err3];
3644
+ } else {
3645
+ vErrors.push(err3);
3646
+ }
3647
+ errors++;
3648
+ }
3649
+ var valid10 = _errs10 === errors;
3650
+ if (valid10) {
3651
+ const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
3652
+ if (vErrors === null) {
3653
+ vErrors = [err4];
3654
+ } else {
3655
+ vErrors.push(err4);
3656
+ }
3657
+ errors++;
3658
+ } else {
3659
+ errors = _errs9;
3660
+ if (vErrors !== null) {
3661
+ if (_errs9) {
3662
+ vErrors.length = _errs9;
3663
+ } else {
3664
+ vErrors = null;
3665
+ }
3666
+ }
3667
+ }
3668
+ }
3669
+ }
3670
+ }
3671
+ }
3672
+ }
3673
+ }
3674
+ }
3675
+ }
3676
+ validate20.errors = vErrors;
3677
+ return errors === 0;
3678
+ }
3679
+ function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3680
+ let vErrors = null;
3681
+ let errors = 0;
3682
+ if (Array.isArray(data)) {
3683
+ const len0 = data.length;
3684
+ for (let i0 = 0; i0 < len0; i0++) {
3685
+ let data0 = data[i0];
3686
+ if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
3687
+ if (data0.events !== void 0) {
3688
+ let data1 = data0.events;
3689
+ if (Array.isArray(data1)) {
3690
+ const len1 = data1.length;
3691
+ for (let i1 = 0; i1 < len1; i1++) {
3692
+ let data2 = data1[i1];
3693
+ const _errs3 = errors;
3694
+ const _errs4 = errors;
3695
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
3696
+ if (data2.type === void 0 && ("type")) {
3697
+ const err0 = {};
3698
+ if (vErrors === null) {
3699
+ vErrors = [err0];
3700
+ } else {
3701
+ vErrors.push(err0);
3702
+ }
3703
+ errors++;
3704
+ } else {
3705
+ if (data2.type !== void 0) {
3706
+ let data3 = data2.type;
3707
+ if (!(data3 === "now" || data3 === "mark" || data3 === "span")) {
3708
+ const err1 = {};
3709
+ if (vErrors === null) {
3710
+ vErrors = [err1];
3711
+ } else {
3712
+ vErrors.push(err1);
3713
+ }
3714
+ errors++;
3715
+ }
3716
+ }
3717
+ }
3718
+ }
3719
+ var valid5 = _errs4 === errors;
3720
+ if (valid5) {
3721
+ const err2 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/not", keyword: "not", params: {}, message: "must NOT be valid" };
3722
+ if (vErrors === null) {
3723
+ vErrors = [err2];
3724
+ } else {
3725
+ vErrors.push(err2);
3726
+ }
3727
+ errors++;
3728
+ } else {
3729
+ errors = _errs3;
3730
+ if (vErrors !== null) {
3731
+ if (_errs3) {
3732
+ vErrors.length = _errs3;
3733
+ } else {
3734
+ vErrors = null;
3735
+ }
3736
+ }
3737
+ }
3738
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
3739
+ if (data2.type !== void 0) {
3740
+ let data4 = data2.type;
3741
+ const _errs8 = errors;
3742
+ const _errs9 = errors;
3743
+ if (!(data4 === "commit" || data4 === "branch")) {
3744
+ const err3 = {};
3745
+ if (vErrors === null) {
3746
+ vErrors = [err3];
3747
+ } else {
3748
+ vErrors.push(err3);
3749
+ }
3750
+ errors++;
3751
+ }
3752
+ var valid9 = _errs9 === errors;
3753
+ if (valid9) {
3754
+ const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
3755
+ if (vErrors === null) {
3756
+ vErrors = [err4];
3757
+ } else {
3758
+ vErrors.push(err4);
3759
+ }
3760
+ errors++;
3761
+ } else {
3762
+ errors = _errs8;
3763
+ if (vErrors !== null) {
3764
+ if (_errs8) {
3765
+ vErrors.length = _errs8;
3766
+ } else {
3767
+ vErrors = null;
3768
+ }
3769
+ }
3770
+ }
3771
+ }
3772
+ if (data2.at !== void 0) {
3773
+ const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3774
+ if (vErrors === null) {
3775
+ vErrors = [err5];
3776
+ } else {
3777
+ vErrors.push(err5);
3778
+ }
3779
+ errors++;
3780
+ }
3781
+ if (data2.into !== void 0) {
3782
+ const err6 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3783
+ if (vErrors === null) {
3784
+ vErrors = [err6];
3785
+ } else {
3786
+ vErrors.push(err6);
3787
+ }
3788
+ errors++;
3789
+ }
3790
+ if (data2.color !== void 0) {
3791
+ const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3792
+ if (vErrors === null) {
3793
+ vErrors = [err7];
3794
+ } else {
3795
+ vErrors.push(err7);
3796
+ }
3797
+ errors++;
3798
+ }
3799
+ }
3800
+ }
3801
+ }
3802
+ }
3803
+ }
3804
+ }
3805
+ }
3806
+ validate22.errors = vErrors;
3807
+ return errors === 0;
3808
+ }
3809
+ var schema57 = { "enum": ["blue", "amber", "green", "violet", "rose", "slate", "coin"] };
3810
+ var pattern0 = new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$", "u");
3811
+ var func3 = ucs2length;
3812
+ function validate27(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3813
+ let vErrors = null;
3814
+ let errors = 0;
3815
+ if (data && typeof data == "object" && !Array.isArray(data)) {
3816
+ if (data.id === void 0) {
3817
+ const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
3818
+ if (vErrors === null) {
3819
+ vErrors = [err0];
3820
+ } else {
3821
+ vErrors.push(err0);
3822
+ }
3823
+ errors++;
3824
+ }
3825
+ if (data.name === void 0) {
3826
+ const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "name" }, message: "must have required property 'name'" };
3827
+ if (vErrors === null) {
3828
+ vErrors = [err1];
3829
+ } else {
3830
+ vErrors.push(err1);
3831
+ }
3832
+ errors++;
3833
+ }
3834
+ for (const key0 in data) {
3835
+ if (!(key0 === "id" || key0 === "name" || key0 === "note" || key0 === "color" || key0 === "icon")) {
3836
+ const err2 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
3837
+ if (vErrors === null) {
3838
+ vErrors = [err2];
3839
+ } else {
3840
+ vErrors.push(err2);
3841
+ }
3842
+ errors++;
3843
+ }
3844
+ }
3845
+ if (data.id !== void 0) {
3846
+ let data0 = data.id;
3847
+ if (typeof data0 === "string") {
3848
+ if (!pattern0.test(data0)) {
3849
+ const err3 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
3850
+ if (vErrors === null) {
3851
+ vErrors = [err3];
3852
+ } else {
3853
+ vErrors.push(err3);
3854
+ }
3855
+ errors++;
3856
+ }
3857
+ } else {
3858
+ const err4 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
3859
+ if (vErrors === null) {
3860
+ vErrors = [err4];
3861
+ } else {
3862
+ vErrors.push(err4);
3863
+ }
3864
+ errors++;
3865
+ }
3182
3866
  }
3183
3867
  if (data.name !== void 0) {
3184
3868
  let data1 = data.name;
@@ -3227,7 +3911,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
3227
3911
  if (data.color !== void 0) {
3228
3912
  let data3 = data.color;
3229
3913
  if (!(data3 === "blue" || data3 === "amber" || data3 === "green" || data3 === "violet" || data3 === "rose" || data3 === "slate" || data3 === "coin")) {
3230
- const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema45.enum }, message: "must be equal to one of the allowed values" };
3914
+ const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
3231
3915
  if (vErrors === null) {
3232
3916
  vErrors = [err9];
3233
3917
  } else {
@@ -3267,11 +3951,11 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
3267
3951
  }
3268
3952
  errors++;
3269
3953
  }
3270
- validate22.errors = vErrors;
3954
+ validate27.errors = vErrors;
3271
3955
  return errors === 0;
3272
3956
  }
3273
3957
  var pattern3 = new RegExp("^(/|https?://)", "u");
3274
- function validate24(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3958
+ function validate29(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3275
3959
  let vErrors = null;
3276
3960
  let errors = 0;
3277
3961
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3373,7 +4057,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
3373
4057
  if (data.color !== void 0) {
3374
4058
  let data3 = data.color;
3375
4059
  if (!(data3 === "blue" || data3 === "amber" || data3 === "green" || data3 === "violet" || data3 === "rose" || data3 === "slate" || data3 === "coin")) {
3376
- const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema45.enum }, message: "must be equal to one of the allowed values" };
4060
+ const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
3377
4061
  if (vErrors === null) {
3378
4062
  vErrors = [err9];
3379
4063
  } else {
@@ -3457,11 +4141,11 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
3457
4141
  }
3458
4142
  errors++;
3459
4143
  }
3460
- validate24.errors = vErrors;
4144
+ validate29.errors = vErrors;
3461
4145
  return errors === 0;
3462
4146
  }
3463
4147
  var pattern4 = new RegExp("^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$", "u");
3464
- function validate27(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4148
+ function validate32(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3465
4149
  let vErrors = null;
3466
4150
  let errors = 0;
3467
4151
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3547,10 +4231,10 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
3547
4231
  }
3548
4232
  errors++;
3549
4233
  }
3550
- validate27.errors = vErrors;
4234
+ validate32.errors = vErrors;
3551
4235
  return errors === 0;
3552
4236
  }
3553
- function validate26(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4237
+ function validate31(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3554
4238
  let vErrors = null;
3555
4239
  let errors = 0;
3556
4240
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3664,8 +4348,8 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
3664
4348
  }
3665
4349
  const len1 = data3.length;
3666
4350
  for (let i1 = 0; i1 < len1; i1++) {
3667
- if (!validate27(data3[i1], { instancePath: instancePath + "/meters/" + i1, parentData: data3, parentDataProperty: i1, rootData })) {
3668
- vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);
4351
+ if (!validate32(data3[i1], { instancePath: instancePath + "/meters/" + i1, parentData: data3, parentDataProperty: i1, rootData })) {
4352
+ vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);
3669
4353
  errors = vErrors.length;
3670
4354
  }
3671
4355
  }
@@ -3688,10 +4372,10 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
3688
4372
  }
3689
4373
  errors++;
3690
4374
  }
3691
- validate26.errors = vErrors;
4375
+ validate31.errors = vErrors;
3692
4376
  return errors === 0;
3693
4377
  }
3694
- function validate31(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4378
+ function validate36(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3695
4379
  let vErrors = null;
3696
4380
  let errors = 0;
3697
4381
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3777,13 +4461,13 @@ function validate31(data, { instancePath = "", parentData, parentDataProperty, r
3777
4461
  }
3778
4462
  errors++;
3779
4463
  }
3780
- validate31.errors = vErrors;
4464
+ validate36.errors = vErrors;
3781
4465
  return errors === 0;
3782
4466
  }
3783
- var schema68 = { "oneOf": [{ "description": "\u7DDA\u3002\u904B\u3076\u7269\u3092\u8F09\u305B\u3066\u9001\u308B\u5074\u304B\u3089\u53D7\u3051\u308B\u5074\u3078\u8D70\u308B", "type": "object", "additionalProperties": false, "required": ["type", "from", "to", "carry"], "properties": { "type": { "const": "edge" }, "from": { "$ref": "#/definitions/id" }, "to": { "$ref": "#/definitions/id" }, "label": { "$ref": "#/definitions/text" }, "carry": { "$ref": "#/definitions/carry" }, "labelSide": { "description": "\u7DDA\u306E\u540D\u524D\u3092\u7F6E\u304F\u5074 (\u5BC4\u305B\u306E\u6307\u793A)", "enum": ["above", "below", "left", "right"] }, "at": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u7DDA\u3092\u5F15\u304F\u5217\u306E\u76EE\u76DB\u308A", "$ref": "#/definitions/unit" }, "into": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u53D7\u3051\u308B\u7BB1\u3092\u9078\u3076\u5217\u306E\u76EE\u76DB\u308A\u3002\u66F8\u304B\u306A\u3051\u308C\u3070 at \u306E\u5217", "$ref": "#/definitions/unit" } } }, { "description": "\u7BB1\u306E\u4E2D\u306E\u51E6\u7406", "type": "object", "additionalProperties": false, "required": ["type", "box", "label"], "properties": { "type": { "const": "action" }, "box": { "$ref": "#/definitions/id" }, "label": { "$ref": "#/definitions/text" } } }, { "description": "\u7BB1\u306E\u4E0B\u306E\u5C0F\u3055\u306A\u5B57\u306E\u66F8\u304D\u63DB\u3048", "type": "object", "additionalProperties": false, "required": ["type", "box", "text"], "properties": { "type": { "const": "swap" }, "box": { "$ref": "#/definitions/id" }, "text": { "$ref": "#/definitions/text" }, "color": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u7BC0\u76EE\u306E\u4E38\u306E\u8272", "$ref": "#/definitions/color" } } }, { "description": "commit \u3092\u7A4D\u3080\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u7A4D\u3093\u3060\u679D\u306E\u672D\u3068\u3001\u305D\u306E\u679D\u3092\u6307\u3059 HEAD \u304C\u9032\u3080\u3002\u5F53\u3066\u76F4\u3057 (copy) \u306F\u679D\u306E\u672D\u3092\u52D5\u304B\u3055\u305A\u3001merge commit (merge) \u306F\u53D6\u308A\u8FBC\u3080\u679D\u306E\u5148\u7AEF\u3082\u89AA\u306B\u6301\u3064", "type": "object", "additionalProperties": false, "required": ["type", "id", "branch"], "properties": { "type": { "const": "commit" }, "id": { "$ref": "#/definitions/id" }, "branch": { "$ref": "#/definitions/id" }, "copy": { "$ref": "#/definitions/id" }, "merge": { "$ref": "#/definitions/id" }, "hash": { "$ref": "#/definitions/hash" }, "note": { "$ref": "#/definitions/text" } } }, { "description": "\u679D\u3092\u5207\u308B\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u679D\u306E\u672D\u3092 from \u306E commit \u3078\u7F6E\u304D\u3001HEAD \u3092\u305D\u306E\u679D\u3078\u79FB\u3059", "type": "object", "additionalProperties": false, "required": ["type", "branch", "from"], "properties": { "type": { "const": "branch" }, "branch": { "$ref": "#/definitions/id" }, "from": { "$ref": "#/definitions/id" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u4ECA\u306E\u6642\u523B\u306E\u91DD\u3092\u3001to \u306E\u76EE\u76DB\u308A\u306E\u7D42\u308F\u308A\u307E\u3067\u9032\u3081\u308B", "type": "object", "additionalProperties": false, "required": ["type", "to"], "properties": { "type": { "const": "now" }, "to": { "$ref": "#/definitions/unit" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u5370\u306E\u5217 row \u306E\u3001from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306E\u5370\u306E\u8272\u3092\u5909\u3048\u308B", "type": "object", "additionalProperties": false, "required": ["type", "row", "from", "to", "color"], "properties": { "type": { "const": "mark" }, "row": { "$ref": "#/definitions/id" }, "from": { "$ref": "#/definitions/unit" }, "to": { "$ref": "#/definitions/unit" }, "color": { "$ref": "#/definitions/color" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306B\u3001\u62EC\u5F27\u3068\u5B57\u3092\u51FA\u3059\u3002shape \u304C box \u306A\u3089\u5370\u306E\u5217\u3092\u56F2\u307F\u3001\u5B57\u3092\u7E01\u306E\u672D\u306B\u3059\u308B", "type": "object", "additionalProperties": false, "required": ["type", "from", "to", "text"], "properties": { "type": { "const": "span" }, "from": { "$ref": "#/definitions/unit" }, "to": { "$ref": "#/definitions/unit" }, "text": { "$ref": "#/definitions/text" }, "shape": { "enum": ["box"] }, "color": { "$ref": "#/definitions/color" } } }, { "description": "\u4E2D\u8EAB\u306E\u5E2F\u306E\u6B04\u306E\u5024\u3068\u672D", "type": "object", "additionalProperties": false, "required": ["type", "field"], "anyOf": [{ "required": ["value"] }, { "required": ["tag"] }], "properties": { "type": { "const": "strip" }, "field": { "$ref": "#/definitions/text" }, "value": { "$ref": "#/definitions/text" }, "tag": { "$ref": "#/definitions/text" } } }] };
4467
+ var schema80 = { "oneOf": [{ "description": "\u7DDA\u3002\u904B\u3076\u7269\u3092\u8F09\u305B\u3066\u9001\u308B\u5074\u304B\u3089\u53D7\u3051\u308B\u5074\u3078\u8D70\u308B", "type": "object", "additionalProperties": false, "required": ["type", "from", "to", "carry"], "properties": { "type": { "const": "edge" }, "from": { "$ref": "#/definitions/id" }, "to": { "$ref": "#/definitions/id" }, "label": { "$ref": "#/definitions/text" }, "carry": { "$ref": "#/definitions/carry" }, "labelSide": { "description": "\u7DDA\u306E\u540D\u524D\u3092\u7F6E\u304F\u5074 (\u5BC4\u305B\u306E\u6307\u793A)", "enum": ["above", "below", "left", "right"] }, "at": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u7DDA\u3092\u5F15\u304F\u5217\u306E\u76EE\u76DB\u308A", "$ref": "#/definitions/unit" }, "into": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u53D7\u3051\u308B\u7BB1\u3092\u9078\u3076\u5217\u306E\u76EE\u76DB\u308A\u3002\u66F8\u304B\u306A\u3051\u308C\u3070 at \u306E\u5217", "$ref": "#/definitions/unit" } } }, { "description": "\u7BB1\u306E\u4E2D\u306E\u51E6\u7406", "type": "object", "additionalProperties": false, "required": ["type", "box", "label"], "properties": { "type": { "const": "action" }, "box": { "$ref": "#/definitions/id" }, "label": { "$ref": "#/definitions/text" } } }, { "description": "\u7BB1\u306E\u4E0B\u306E\u5C0F\u3055\u306A\u5B57\u306E\u66F8\u304D\u63DB\u3048", "type": "object", "additionalProperties": false, "required": ["type", "box", "text"], "properties": { "type": { "const": "swap" }, "box": { "$ref": "#/definitions/id" }, "text": { "$ref": "#/definitions/text" }, "color": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u7BC0\u76EE\u306E\u4E38\u306E\u8272", "$ref": "#/definitions/color" } } }, { "description": "commit \u3092\u7A4D\u3080\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u7A4D\u3093\u3060\u679D\u306E\u672D\u3068\u3001\u305D\u306E\u679D\u3092\u6307\u3059 HEAD \u304C\u9032\u3080\u3002\u5F53\u3066\u76F4\u3057 (copy) \u306F\u679D\u306E\u672D\u3092\u52D5\u304B\u3055\u305A\u3001merge commit (merge) \u306F\u53D6\u308A\u8FBC\u3080\u679D\u306E\u5148\u7AEF\u3082\u89AA\u306B\u6301\u3064", "type": "object", "additionalProperties": false, "required": ["type", "id", "branch"], "properties": { "type": { "const": "commit" }, "id": { "$ref": "#/definitions/id" }, "branch": { "$ref": "#/definitions/id" }, "copy": { "$ref": "#/definitions/id" }, "merge": { "$ref": "#/definitions/id" }, "hash": { "$ref": "#/definitions/hash" }, "note": { "$ref": "#/definitions/text" } } }, { "description": "\u679D\u3092\u5207\u308B\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u679D\u306E\u672D\u3092 from \u306E commit \u3078\u7F6E\u304D\u3001HEAD \u3092\u305D\u306E\u679D\u3078\u79FB\u3059", "type": "object", "additionalProperties": false, "required": ["type", "branch", "from"], "properties": { "type": { "const": "branch" }, "branch": { "$ref": "#/definitions/id" }, "from": { "$ref": "#/definitions/id" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u4ECA\u306E\u6642\u523B\u306E\u91DD\u3092\u3001to \u306E\u76EE\u76DB\u308A\u306E\u7D42\u308F\u308A\u307E\u3067\u9032\u3081\u308B", "type": "object", "additionalProperties": false, "required": ["type", "to"], "properties": { "type": { "const": "now" }, "to": { "$ref": "#/definitions/unit" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u5370\u306E\u5217 row \u306E\u3001from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306E\u5370\u306E\u8272\u3092\u5909\u3048\u308B", "type": "object", "additionalProperties": false, "required": ["type", "row", "from", "to", "color"], "properties": { "type": { "const": "mark" }, "row": { "$ref": "#/definitions/id" }, "from": { "$ref": "#/definitions/unit" }, "to": { "$ref": "#/definitions/unit" }, "color": { "$ref": "#/definitions/color" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306B\u3001\u62EC\u5F27\u3068\u5B57\u3092\u51FA\u3059\u3002shape \u304C box \u306A\u3089\u5370\u306E\u5217\u3092\u56F2\u307F\u3001\u5B57\u3092\u7E01\u306E\u672D\u306B\u3059\u308B", "type": "object", "additionalProperties": false, "required": ["type", "from", "to", "text"], "properties": { "type": { "const": "span" }, "from": { "$ref": "#/definitions/unit" }, "to": { "$ref": "#/definitions/unit" }, "text": { "$ref": "#/definitions/text" }, "shape": { "enum": ["box"] }, "color": { "$ref": "#/definitions/color" } } }, { "description": "\u8449\u3092\u51FA\u3059\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u8449\u306E\u7BB1\u304C\u73FE\u308C\u308B\u3002hash \u3092\u66F8\u304F\u3068\u7BB1\u306B\u5024\u3092\u51FA\u3057\u3001\u540D\u672D\u3092\u8449\u306E\u4E0B\u306E\u672D\u306B\u51FA\u3059", "type": "object", "additionalProperties": false, "required": ["type", "id"], "properties": { "type": { "const": "leaf" }, "id": { "$ref": "#/definitions/id" }, "hash": { "$ref": "#/definitions/hash" } } }, { "description": "1 \u3064\u4EE5\u4E0A\u306E\u5B50\u304B\u3089\u89AA\u3092\u7D44\u3080\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u89AA\u306E\u7BB1\u3068\u3001\u5B50\u304B\u3089\u89AA\u3078\u306E\u6728\u306E\u7DDA\u304C\u73FE\u308C\u308B", "type": "object", "additionalProperties": false, "required": ["type", "id", "children"], "properties": { "type": { "const": "node" }, "id": { "$ref": "#/definitions/id" }, "children": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/id" } }, "hash": { "$ref": "#/definitions/hash" } } }, { "description": "\u4E2D\u8EAB\u306E\u5E2F\u306E\u6B04\u306E\u5024\u3068\u672D", "type": "object", "additionalProperties": false, "required": ["type", "field"], "anyOf": [{ "required": ["value"] }, { "required": ["tag"] }], "properties": { "type": { "const": "strip" }, "field": { "$ref": "#/definitions/text" }, "value": { "$ref": "#/definitions/text" }, "tag": { "$ref": "#/definitions/text" } } }] };
3784
4468
  var pattern14 = new RegExp("^[0-9a-f]{4,40}$", "u");
3785
- var schema72 = { "properties": { "kind": { "enum": ["envelope", "tag", "coin", "none"] }}};
3786
- function validate34(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4469
+ var schema84 = { "properties": { "kind": { "enum": ["envelope", "tag", "coin", "none"] }}};
4470
+ function validate39(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3787
4471
  let vErrors = null;
3788
4472
  let errors = 0;
3789
4473
  const _errs1 = errors;
@@ -3909,7 +4593,7 @@ function validate34(data, { instancePath = "", parentData, parentDataProperty, r
3909
4593
  if (data.kind !== void 0) {
3910
4594
  let data1 = data.kind;
3911
4595
  if (!(data1 === "envelope" || data1 === "tag" || data1 === "coin" || data1 === "none")) {
3912
- const err8 = { instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: schema72.properties.kind.enum }, message: "must be equal to one of the allowed values" };
4596
+ const err8 = { instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: schema84.properties.kind.enum }, message: "must be equal to one of the allowed values" };
3913
4597
  if (vErrors === null) {
3914
4598
  vErrors = [err8];
3915
4599
  } else {
@@ -3949,10 +4633,10 @@ function validate34(data, { instancePath = "", parentData, parentDataProperty, r
3949
4633
  }
3950
4634
  errors++;
3951
4635
  }
3952
- validate34.errors = vErrors;
4636
+ validate39.errors = vErrors;
3953
4637
  return errors === 0;
3954
4638
  }
3955
- function validate33(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4639
+ function validate38(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3956
4640
  let vErrors = null;
3957
4641
  let errors = 0;
3958
4642
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -4094,15 +4778,15 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
4094
4778
  }
4095
4779
  }
4096
4780
  if (data.carry !== void 0) {
4097
- if (!validate34(data.carry, { instancePath: instancePath + "/carry", parentData: data, parentDataProperty: "carry", rootData })) {
4098
- vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);
4781
+ if (!validate39(data.carry, { instancePath: instancePath + "/carry", parentData: data, parentDataProperty: "carry", rootData })) {
4782
+ vErrors = vErrors === null ? validate39.errors : vErrors.concat(validate39.errors);
4099
4783
  errors = vErrors.length;
4100
4784
  }
4101
4785
  }
4102
4786
  if (data.labelSide !== void 0) {
4103
4787
  let data5 = data.labelSide;
4104
4788
  if (!(data5 === "above" || data5 === "below" || data5 === "left" || data5 === "right")) {
4105
- const err13 = { instancePath: instancePath + "/labelSide", schemaPath: "#/oneOf/0/properties/labelSide/enum", keyword: "enum", params: { allowedValues: schema68.oneOf[0].properties.labelSide.enum }, message: "must be equal to one of the allowed values" };
4789
+ const err13 = { instancePath: instancePath + "/labelSide", schemaPath: "#/oneOf/0/properties/labelSide/enum", keyword: "enum", params: { allowedValues: schema80.oneOf[0].properties.labelSide.enum }, message: "must be equal to one of the allowed values" };
4106
4790
  if (vErrors === null) {
4107
4791
  vErrors = [err13];
4108
4792
  } else {
@@ -4368,7 +5052,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
4368
5052
  if (data.color !== void 0) {
4369
5053
  let data14 = data.color;
4370
5054
  if (!(data14 === "blue" || data14 === "amber" || data14 === "green" || data14 === "violet" || data14 === "rose" || data14 === "slate" || data14 === "coin")) {
4371
- const err38 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema45.enum }, message: "must be equal to one of the allowed values" };
5055
+ const err38 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
4372
5056
  if (vErrors === null) {
4373
5057
  vErrors = [err38];
4374
5058
  } else {
@@ -4896,7 +5580,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
4896
5580
  if (data.color !== void 0) {
4897
5581
  let data31 = data.color;
4898
5582
  if (!(data31 === "blue" || data31 === "amber" || data31 === "green" || data31 === "violet" || data31 === "rose" || data31 === "slate" || data31 === "coin")) {
4899
- const err88 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema45.enum }, message: "must be equal to one of the allowed values" };
5583
+ const err88 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
4900
5584
  if (vErrors === null) {
4901
5585
  vErrors = [err88];
4902
5586
  } else {
@@ -5028,98 +5712,342 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
5028
5712
  if (vErrors === null) {
5029
5713
  vErrors = [err100];
5030
5714
  } else {
5031
- vErrors.push(err100);
5715
+ vErrors.push(err100);
5716
+ }
5717
+ errors++;
5718
+ }
5719
+ } else {
5720
+ const err101 = { instancePath: instancePath + "/text", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5721
+ if (vErrors === null) {
5722
+ vErrors = [err101];
5723
+ } else {
5724
+ vErrors.push(err101);
5725
+ }
5726
+ errors++;
5727
+ }
5728
+ }
5729
+ if (data.shape !== void 0) {
5730
+ if (!(data.shape === "box")) {
5731
+ const err102 = { instancePath: instancePath + "/shape", schemaPath: "#/oneOf/7/properties/shape/enum", keyword: "enum", params: { allowedValues: schema80.oneOf[7].properties.shape.enum }, message: "must be equal to one of the allowed values" };
5732
+ if (vErrors === null) {
5733
+ vErrors = [err102];
5734
+ } else {
5735
+ vErrors.push(err102);
5736
+ }
5737
+ errors++;
5738
+ }
5739
+ }
5740
+ if (data.color !== void 0) {
5741
+ let data37 = data.color;
5742
+ if (!(data37 === "blue" || data37 === "amber" || data37 === "green" || data37 === "violet" || data37 === "rose" || data37 === "slate" || data37 === "coin")) {
5743
+ const err103 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
5744
+ if (vErrors === null) {
5745
+ vErrors = [err103];
5746
+ } else {
5747
+ vErrors.push(err103);
5748
+ }
5749
+ errors++;
5750
+ }
5751
+ }
5752
+ } else {
5753
+ const err104 = { instancePath, schemaPath: "#/oneOf/7/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5754
+ if (vErrors === null) {
5755
+ vErrors = [err104];
5756
+ } else {
5757
+ vErrors.push(err104);
5758
+ }
5759
+ errors++;
5760
+ }
5761
+ } else if (tag0 === "leaf") {
5762
+ if (data && typeof data == "object" && !Array.isArray(data)) {
5763
+ if (data.type === void 0) {
5764
+ const err105 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
5765
+ if (vErrors === null) {
5766
+ vErrors = [err105];
5767
+ } else {
5768
+ vErrors.push(err105);
5769
+ }
5770
+ errors++;
5771
+ }
5772
+ if (data.id === void 0) {
5773
+ const err106 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
5774
+ if (vErrors === null) {
5775
+ vErrors = [err106];
5776
+ } else {
5777
+ vErrors.push(err106);
5778
+ }
5779
+ errors++;
5780
+ }
5781
+ for (const key8 in data) {
5782
+ if (!(key8 === "type" || key8 === "id" || key8 === "hash")) {
5783
+ const err107 = { instancePath, schemaPath: "#/oneOf/8/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key8 }, message: "must NOT have additional properties" };
5784
+ if (vErrors === null) {
5785
+ vErrors = [err107];
5786
+ } else {
5787
+ vErrors.push(err107);
5788
+ }
5789
+ errors++;
5790
+ }
5791
+ }
5792
+ if (data.type !== void 0) {
5793
+ if ("leaf" !== data.type) {
5794
+ const err108 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/8/properties/type/const", keyword: "const", params: { allowedValue: "leaf" }, message: "must be equal to constant" };
5795
+ if (vErrors === null) {
5796
+ vErrors = [err108];
5797
+ } else {
5798
+ vErrors.push(err108);
5799
+ }
5800
+ errors++;
5801
+ }
5802
+ }
5803
+ if (data.id !== void 0) {
5804
+ let data39 = data.id;
5805
+ if (typeof data39 === "string") {
5806
+ if (!pattern0.test(data39)) {
5807
+ const err109 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
5808
+ if (vErrors === null) {
5809
+ vErrors = [err109];
5810
+ } else {
5811
+ vErrors.push(err109);
5812
+ }
5813
+ errors++;
5814
+ }
5815
+ } else {
5816
+ const err110 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5817
+ if (vErrors === null) {
5818
+ vErrors = [err110];
5819
+ } else {
5820
+ vErrors.push(err110);
5821
+ }
5822
+ errors++;
5823
+ }
5824
+ }
5825
+ if (data.hash !== void 0) {
5826
+ let data40 = data.hash;
5827
+ if (typeof data40 === "string") {
5828
+ if (!pattern14.test(data40)) {
5829
+ const err111 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/pattern", keyword: "pattern", params: { pattern: "^[0-9a-f]{4,40}$" }, message: 'must match pattern "^[0-9a-f]{4,40}$"' };
5830
+ if (vErrors === null) {
5831
+ vErrors = [err111];
5832
+ } else {
5833
+ vErrors.push(err111);
5834
+ }
5835
+ errors++;
5836
+ }
5837
+ } else {
5838
+ const err112 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5839
+ if (vErrors === null) {
5840
+ vErrors = [err112];
5841
+ } else {
5842
+ vErrors.push(err112);
5843
+ }
5844
+ errors++;
5845
+ }
5846
+ }
5847
+ } else {
5848
+ const err113 = { instancePath, schemaPath: "#/oneOf/8/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5849
+ if (vErrors === null) {
5850
+ vErrors = [err113];
5851
+ } else {
5852
+ vErrors.push(err113);
5853
+ }
5854
+ errors++;
5855
+ }
5856
+ } else if (tag0 === "node") {
5857
+ if (data && typeof data == "object" && !Array.isArray(data)) {
5858
+ if (data.type === void 0) {
5859
+ const err114 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
5860
+ if (vErrors === null) {
5861
+ vErrors = [err114];
5862
+ } else {
5863
+ vErrors.push(err114);
5864
+ }
5865
+ errors++;
5866
+ }
5867
+ if (data.id === void 0) {
5868
+ const err115 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
5869
+ if (vErrors === null) {
5870
+ vErrors = [err115];
5871
+ } else {
5872
+ vErrors.push(err115);
5873
+ }
5874
+ errors++;
5875
+ }
5876
+ if (data.children === void 0) {
5877
+ const err116 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "children" }, message: "must have required property 'children'" };
5878
+ if (vErrors === null) {
5879
+ vErrors = [err116];
5880
+ } else {
5881
+ vErrors.push(err116);
5882
+ }
5883
+ errors++;
5884
+ }
5885
+ for (const key9 in data) {
5886
+ if (!(key9 === "type" || key9 === "id" || key9 === "children" || key9 === "hash")) {
5887
+ const err117 = { instancePath, schemaPath: "#/oneOf/9/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key9 }, message: "must NOT have additional properties" };
5888
+ if (vErrors === null) {
5889
+ vErrors = [err117];
5890
+ } else {
5891
+ vErrors.push(err117);
5892
+ }
5893
+ errors++;
5894
+ }
5895
+ }
5896
+ if (data.type !== void 0) {
5897
+ if ("node" !== data.type) {
5898
+ const err118 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/9/properties/type/const", keyword: "const", params: { allowedValue: "node" }, message: "must be equal to constant" };
5899
+ if (vErrors === null) {
5900
+ vErrors = [err118];
5901
+ } else {
5902
+ vErrors.push(err118);
5903
+ }
5904
+ errors++;
5905
+ }
5906
+ }
5907
+ if (data.id !== void 0) {
5908
+ let data42 = data.id;
5909
+ if (typeof data42 === "string") {
5910
+ if (!pattern0.test(data42)) {
5911
+ const err119 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
5912
+ if (vErrors === null) {
5913
+ vErrors = [err119];
5914
+ } else {
5915
+ vErrors.push(err119);
5916
+ }
5917
+ errors++;
5918
+ }
5919
+ } else {
5920
+ const err120 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5921
+ if (vErrors === null) {
5922
+ vErrors = [err120];
5923
+ } else {
5924
+ vErrors.push(err120);
5925
+ }
5926
+ errors++;
5927
+ }
5928
+ }
5929
+ if (data.children !== void 0) {
5930
+ let data43 = data.children;
5931
+ if (Array.isArray(data43)) {
5932
+ if (data43.length < 1) {
5933
+ const err121 = { instancePath: instancePath + "/children", schemaPath: "#/oneOf/9/properties/children/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
5934
+ if (vErrors === null) {
5935
+ vErrors = [err121];
5936
+ } else {
5937
+ vErrors.push(err121);
5938
+ }
5939
+ errors++;
5940
+ }
5941
+ const len0 = data43.length;
5942
+ for (let i0 = 0; i0 < len0; i0++) {
5943
+ let data44 = data43[i0];
5944
+ if (typeof data44 === "string") {
5945
+ if (!pattern0.test(data44)) {
5946
+ const err122 = { instancePath: instancePath + "/children/" + i0, schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
5947
+ if (vErrors === null) {
5948
+ vErrors = [err122];
5949
+ } else {
5950
+ vErrors.push(err122);
5951
+ }
5952
+ errors++;
5953
+ }
5954
+ } else {
5955
+ const err123 = { instancePath: instancePath + "/children/" + i0, schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5956
+ if (vErrors === null) {
5957
+ vErrors = [err123];
5958
+ } else {
5959
+ vErrors.push(err123);
5960
+ }
5961
+ errors++;
5032
5962
  }
5033
- errors++;
5034
5963
  }
5035
5964
  } else {
5036
- const err101 = { instancePath: instancePath + "/text", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5965
+ const err124 = { instancePath: instancePath + "/children", schemaPath: "#/oneOf/9/properties/children/type", keyword: "type", params: { type: "array" }, message: "must be array" };
5037
5966
  if (vErrors === null) {
5038
- vErrors = [err101];
5967
+ vErrors = [err124];
5039
5968
  } else {
5040
- vErrors.push(err101);
5969
+ vErrors.push(err124);
5041
5970
  }
5042
5971
  errors++;
5043
5972
  }
5044
5973
  }
5045
- if (data.shape !== void 0) {
5046
- if (!(data.shape === "box")) {
5047
- const err102 = { instancePath: instancePath + "/shape", schemaPath: "#/oneOf/7/properties/shape/enum", keyword: "enum", params: { allowedValues: schema68.oneOf[7].properties.shape.enum }, message: "must be equal to one of the allowed values" };
5048
- if (vErrors === null) {
5049
- vErrors = [err102];
5050
- } else {
5051
- vErrors.push(err102);
5974
+ if (data.hash !== void 0) {
5975
+ let data45 = data.hash;
5976
+ if (typeof data45 === "string") {
5977
+ if (!pattern14.test(data45)) {
5978
+ const err125 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/pattern", keyword: "pattern", params: { pattern: "^[0-9a-f]{4,40}$" }, message: 'must match pattern "^[0-9a-f]{4,40}$"' };
5979
+ if (vErrors === null) {
5980
+ vErrors = [err125];
5981
+ } else {
5982
+ vErrors.push(err125);
5983
+ }
5984
+ errors++;
5052
5985
  }
5053
- errors++;
5054
- }
5055
- }
5056
- if (data.color !== void 0) {
5057
- let data37 = data.color;
5058
- if (!(data37 === "blue" || data37 === "amber" || data37 === "green" || data37 === "violet" || data37 === "rose" || data37 === "slate" || data37 === "coin")) {
5059
- const err103 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema45.enum }, message: "must be equal to one of the allowed values" };
5986
+ } else {
5987
+ const err126 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5060
5988
  if (vErrors === null) {
5061
- vErrors = [err103];
5989
+ vErrors = [err126];
5062
5990
  } else {
5063
- vErrors.push(err103);
5991
+ vErrors.push(err126);
5064
5992
  }
5065
5993
  errors++;
5066
5994
  }
5067
5995
  }
5068
5996
  } else {
5069
- const err104 = { instancePath, schemaPath: "#/oneOf/7/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5997
+ const err127 = { instancePath, schemaPath: "#/oneOf/9/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5070
5998
  if (vErrors === null) {
5071
- vErrors = [err104];
5999
+ vErrors = [err127];
5072
6000
  } else {
5073
- vErrors.push(err104);
6001
+ vErrors.push(err127);
5074
6002
  }
5075
6003
  errors++;
5076
6004
  }
5077
6005
  } else if (tag0 === "strip") {
5078
- const _errs117 = errors;
5079
- let valid45 = false;
5080
- const _errs118 = errors;
6006
+ const _errs142 = errors;
6007
+ let valid56 = false;
6008
+ const _errs143 = errors;
5081
6009
  if (data && typeof data == "object" && !Array.isArray(data)) {
5082
6010
  if (data.value === void 0) {
5083
- const err105 = { instancePath, schemaPath: "#/oneOf/8/anyOf/0/required", keyword: "required", params: { missingProperty: "value" }, message: "must have required property 'value'" };
6011
+ const err128 = { instancePath, schemaPath: "#/oneOf/10/anyOf/0/required", keyword: "required", params: { missingProperty: "value" }, message: "must have required property 'value'" };
5084
6012
  if (vErrors === null) {
5085
- vErrors = [err105];
6013
+ vErrors = [err128];
5086
6014
  } else {
5087
- vErrors.push(err105);
6015
+ vErrors.push(err128);
5088
6016
  }
5089
6017
  errors++;
5090
6018
  }
5091
6019
  }
5092
- var _valid0 = _errs118 === errors;
5093
- valid45 = valid45 || _valid0;
5094
- if (!valid45) {
5095
- const _errs119 = errors;
6020
+ var _valid0 = _errs143 === errors;
6021
+ valid56 = valid56 || _valid0;
6022
+ if (!valid56) {
6023
+ const _errs144 = errors;
5096
6024
  if (data && typeof data == "object" && !Array.isArray(data)) {
5097
6025
  if (data.tag === void 0) {
5098
- const err106 = { instancePath, schemaPath: "#/oneOf/8/anyOf/1/required", keyword: "required", params: { missingProperty: "tag" }, message: "must have required property 'tag'" };
6026
+ const err129 = { instancePath, schemaPath: "#/oneOf/10/anyOf/1/required", keyword: "required", params: { missingProperty: "tag" }, message: "must have required property 'tag'" };
5099
6027
  if (vErrors === null) {
5100
- vErrors = [err106];
6028
+ vErrors = [err129];
5101
6029
  } else {
5102
- vErrors.push(err106);
6030
+ vErrors.push(err129);
5103
6031
  }
5104
6032
  errors++;
5105
6033
  }
5106
6034
  }
5107
- var _valid0 = _errs119 === errors;
5108
- valid45 = valid45 || _valid0;
6035
+ var _valid0 = _errs144 === errors;
6036
+ valid56 = valid56 || _valid0;
5109
6037
  }
5110
- if (!valid45) {
5111
- const err107 = { instancePath, schemaPath: "#/oneOf/8/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
6038
+ if (!valid56) {
6039
+ const err130 = { instancePath, schemaPath: "#/oneOf/10/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
5112
6040
  if (vErrors === null) {
5113
- vErrors = [err107];
6041
+ vErrors = [err130];
5114
6042
  } else {
5115
- vErrors.push(err107);
6043
+ vErrors.push(err130);
5116
6044
  }
5117
6045
  errors++;
5118
6046
  } else {
5119
- errors = _errs117;
6047
+ errors = _errs142;
5120
6048
  if (vErrors !== null) {
5121
- if (_errs117) {
5122
- vErrors.length = _errs117;
6049
+ if (_errs142) {
6050
+ vErrors.length = _errs142;
5123
6051
  } else {
5124
6052
  vErrors = null;
5125
6053
  }
@@ -5127,151 +6055,151 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
5127
6055
  }
5128
6056
  if (data && typeof data == "object" && !Array.isArray(data)) {
5129
6057
  if (data.type === void 0) {
5130
- const err108 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
6058
+ const err131 = { instancePath, schemaPath: "#/oneOf/10/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
5131
6059
  if (vErrors === null) {
5132
- vErrors = [err108];
6060
+ vErrors = [err131];
5133
6061
  } else {
5134
- vErrors.push(err108);
6062
+ vErrors.push(err131);
5135
6063
  }
5136
6064
  errors++;
5137
6065
  }
5138
6066
  if (data.field === void 0) {
5139
- const err109 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "field" }, message: "must have required property 'field'" };
6067
+ const err132 = { instancePath, schemaPath: "#/oneOf/10/required", keyword: "required", params: { missingProperty: "field" }, message: "must have required property 'field'" };
5140
6068
  if (vErrors === null) {
5141
- vErrors = [err109];
6069
+ vErrors = [err132];
5142
6070
  } else {
5143
- vErrors.push(err109);
6071
+ vErrors.push(err132);
5144
6072
  }
5145
6073
  errors++;
5146
6074
  }
5147
- for (const key8 in data) {
5148
- if (!(key8 === "type" || key8 === "field" || key8 === "value" || key8 === "tag")) {
5149
- const err110 = { instancePath, schemaPath: "#/oneOf/8/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key8 }, message: "must NOT have additional properties" };
6075
+ for (const key10 in data) {
6076
+ if (!(key10 === "type" || key10 === "field" || key10 === "value" || key10 === "tag")) {
6077
+ const err133 = { instancePath, schemaPath: "#/oneOf/10/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key10 }, message: "must NOT have additional properties" };
5150
6078
  if (vErrors === null) {
5151
- vErrors = [err110];
6079
+ vErrors = [err133];
5152
6080
  } else {
5153
- vErrors.push(err110);
6081
+ vErrors.push(err133);
5154
6082
  }
5155
6083
  errors++;
5156
6084
  }
5157
6085
  }
5158
6086
  if (data.type !== void 0) {
5159
6087
  if ("strip" !== data.type) {
5160
- const err111 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/8/properties/type/const", keyword: "const", params: { allowedValue: "strip" }, message: "must be equal to constant" };
6088
+ const err134 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/10/properties/type/const", keyword: "const", params: { allowedValue: "strip" }, message: "must be equal to constant" };
5161
6089
  if (vErrors === null) {
5162
- vErrors = [err111];
6090
+ vErrors = [err134];
5163
6091
  } else {
5164
- vErrors.push(err111);
6092
+ vErrors.push(err134);
5165
6093
  }
5166
6094
  errors++;
5167
6095
  }
5168
6096
  }
5169
6097
  if (data.field !== void 0) {
5170
- let data39 = data.field;
5171
- if (typeof data39 === "string") {
5172
- if (func3(data39) < 1) {
5173
- const err112 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
6098
+ let data47 = data.field;
6099
+ if (typeof data47 === "string") {
6100
+ if (func3(data47) < 1) {
6101
+ const err135 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
5174
6102
  if (vErrors === null) {
5175
- vErrors = [err112];
6103
+ vErrors = [err135];
5176
6104
  } else {
5177
- vErrors.push(err112);
6105
+ vErrors.push(err135);
5178
6106
  }
5179
6107
  errors++;
5180
6108
  }
5181
6109
  } else {
5182
- const err113 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
6110
+ const err136 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5183
6111
  if (vErrors === null) {
5184
- vErrors = [err113];
6112
+ vErrors = [err136];
5185
6113
  } else {
5186
- vErrors.push(err113);
6114
+ vErrors.push(err136);
5187
6115
  }
5188
6116
  errors++;
5189
6117
  }
5190
6118
  }
5191
6119
  if (data.value !== void 0) {
5192
- let data40 = data.value;
5193
- if (typeof data40 === "string") {
5194
- if (func3(data40) < 1) {
5195
- const err114 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
6120
+ let data48 = data.value;
6121
+ if (typeof data48 === "string") {
6122
+ if (func3(data48) < 1) {
6123
+ const err137 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
5196
6124
  if (vErrors === null) {
5197
- vErrors = [err114];
6125
+ vErrors = [err137];
5198
6126
  } else {
5199
- vErrors.push(err114);
6127
+ vErrors.push(err137);
5200
6128
  }
5201
6129
  errors++;
5202
6130
  }
5203
6131
  } else {
5204
- const err115 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
6132
+ const err138 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5205
6133
  if (vErrors === null) {
5206
- vErrors = [err115];
6134
+ vErrors = [err138];
5207
6135
  } else {
5208
- vErrors.push(err115);
6136
+ vErrors.push(err138);
5209
6137
  }
5210
6138
  errors++;
5211
6139
  }
5212
6140
  }
5213
6141
  if (data.tag !== void 0) {
5214
- let data41 = data.tag;
5215
- if (typeof data41 === "string") {
5216
- if (func3(data41) < 1) {
5217
- const err116 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
6142
+ let data49 = data.tag;
6143
+ if (typeof data49 === "string") {
6144
+ if (func3(data49) < 1) {
6145
+ const err139 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
5218
6146
  if (vErrors === null) {
5219
- vErrors = [err116];
6147
+ vErrors = [err139];
5220
6148
  } else {
5221
- vErrors.push(err116);
6149
+ vErrors.push(err139);
5222
6150
  }
5223
6151
  errors++;
5224
6152
  }
5225
6153
  } else {
5226
- const err117 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
6154
+ const err140 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5227
6155
  if (vErrors === null) {
5228
- vErrors = [err117];
6156
+ vErrors = [err140];
5229
6157
  } else {
5230
- vErrors.push(err117);
6158
+ vErrors.push(err140);
5231
6159
  }
5232
6160
  errors++;
5233
6161
  }
5234
6162
  }
5235
6163
  } else {
5236
- const err118 = { instancePath, schemaPath: "#/oneOf/8/type", keyword: "type", params: { type: "object" }, message: "must be object" };
6164
+ const err141 = { instancePath, schemaPath: "#/oneOf/10/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5237
6165
  if (vErrors === null) {
5238
- vErrors = [err118];
6166
+ vErrors = [err141];
5239
6167
  } else {
5240
- vErrors.push(err118);
6168
+ vErrors.push(err141);
5241
6169
  }
5242
6170
  errors++;
5243
6171
  }
5244
6172
  } else {
5245
- const err119 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "mapping", tag: "type", tagValue: tag0 }, message: 'value of tag "type" must be in oneOf' };
6173
+ const err142 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "mapping", tag: "type", tagValue: tag0 }, message: 'value of tag "type" must be in oneOf' };
5246
6174
  if (vErrors === null) {
5247
- vErrors = [err119];
6175
+ vErrors = [err142];
5248
6176
  } else {
5249
- vErrors.push(err119);
6177
+ vErrors.push(err142);
5250
6178
  }
5251
6179
  errors++;
5252
6180
  }
5253
6181
  } else {
5254
- const err120 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "tag", tag: "type", tagValue: tag0 }, message: 'tag "type" must be string' };
6182
+ const err143 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "tag", tag: "type", tagValue: tag0 }, message: 'tag "type" must be string' };
5255
6183
  if (vErrors === null) {
5256
- vErrors = [err120];
6184
+ vErrors = [err143];
5257
6185
  } else {
5258
- vErrors.push(err120);
6186
+ vErrors.push(err143);
5259
6187
  }
5260
6188
  errors++;
5261
6189
  }
5262
6190
  } else {
5263
- const err121 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
6191
+ const err144 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5264
6192
  if (vErrors === null) {
5265
- vErrors = [err121];
6193
+ vErrors = [err144];
5266
6194
  } else {
5267
- vErrors.push(err121);
6195
+ vErrors.push(err144);
5268
6196
  }
5269
6197
  errors++;
5270
6198
  }
5271
- validate33.errors = vErrors;
6199
+ validate38.errors = vErrors;
5272
6200
  return errors === 0;
5273
6201
  }
5274
- function validate30(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6202
+ function validate35(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5275
6203
  let vErrors = null;
5276
6204
  let errors = 0;
5277
6205
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -5393,8 +6321,8 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
5393
6321
  }
5394
6322
  const len0 = data3.length;
5395
6323
  for (let i0 = 0; i0 < len0; i0++) {
5396
- if (!validate31(data3[i0], { instancePath: instancePath + "/sources/" + i0, parentData: data3, parentDataProperty: i0, rootData })) {
5397
- vErrors = vErrors === null ? validate31.errors : vErrors.concat(validate31.errors);
6324
+ if (!validate36(data3[i0], { instancePath: instancePath + "/sources/" + i0, parentData: data3, parentDataProperty: i0, rootData })) {
6325
+ vErrors = vErrors === null ? validate36.errors : vErrors.concat(validate36.errors);
5398
6326
  errors = vErrors.length;
5399
6327
  }
5400
6328
  }
@@ -5413,8 +6341,8 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
5413
6341
  if (Array.isArray(data5)) {
5414
6342
  const len1 = data5.length;
5415
6343
  for (let i1 = 0; i1 < len1; i1++) {
5416
- if (!validate33(data5[i1], { instancePath: instancePath + "/events/" + i1, parentData: data5, parentDataProperty: i1, rootData })) {
5417
- vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors);
6344
+ if (!validate38(data5[i1], { instancePath: instancePath + "/events/" + i1, parentData: data5, parentDataProperty: i1, rootData })) {
6345
+ vErrors = vErrors === null ? validate38.errors : vErrors.concat(validate38.errors);
5418
6346
  errors = vErrors.length;
5419
6347
  }
5420
6348
  }
@@ -5437,10 +6365,10 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
5437
6365
  }
5438
6366
  errors++;
5439
6367
  }
5440
- validate30.errors = vErrors;
6368
+ validate35.errors = vErrors;
5441
6369
  return errors === 0;
5442
6370
  }
5443
- function validate38(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6371
+ function validate43(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5444
6372
  let vErrors = null;
5445
6373
  let errors = 0;
5446
6374
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -5518,10 +6446,10 @@ function validate38(data, { instancePath = "", parentData, parentDataProperty, r
5518
6446
  }
5519
6447
  errors++;
5520
6448
  }
5521
- validate38.errors = vErrors;
6449
+ validate43.errors = vErrors;
5522
6450
  return errors === 0;
5523
6451
  }
5524
- function validate41(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6452
+ function validate46(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5525
6453
  let vErrors = null;
5526
6454
  let errors = 0;
5527
6455
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -5629,10 +6557,10 @@ function validate41(data, { instancePath = "", parentData, parentDataProperty, r
5629
6557
  }
5630
6558
  errors++;
5631
6559
  }
5632
- validate41.errors = vErrors;
6560
+ validate46.errors = vErrors;
5633
6561
  return errors === 0;
5634
6562
  }
5635
- function validate40(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6563
+ function validate45(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5636
6564
  let vErrors = null;
5637
6565
  let errors = 0;
5638
6566
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -5670,8 +6598,8 @@ function validate40(data, { instancePath = "", parentData, parentDataProperty, r
5670
6598
  }
5671
6599
  const len0 = data0.length;
5672
6600
  for (let i0 = 0; i0 < len0; i0++) {
5673
- if (!validate41(data0[i0], { instancePath: instancePath + "/paths/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
5674
- vErrors = vErrors === null ? validate41.errors : vErrors.concat(validate41.errors);
6601
+ if (!validate46(data0[i0], { instancePath: instancePath + "/paths/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
6602
+ vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors);
5675
6603
  errors = vErrors.length;
5676
6604
  }
5677
6605
  }
@@ -5694,10 +6622,10 @@ function validate40(data, { instancePath = "", parentData, parentDataProperty, r
5694
6622
  }
5695
6623
  errors++;
5696
6624
  }
5697
- validate40.errors = vErrors;
6625
+ validate45.errors = vErrors;
5698
6626
  return errors === 0;
5699
6627
  }
5700
- function validate45(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6628
+ function validate50(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5701
6629
  let vErrors = null;
5702
6630
  let errors = 0;
5703
6631
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -5774,10 +6702,10 @@ function validate45(data, { instancePath = "", parentData, parentDataProperty, r
5774
6702
  }
5775
6703
  errors++;
5776
6704
  }
5777
- validate45.errors = vErrors;
6705
+ validate50.errors = vErrors;
5778
6706
  return errors === 0;
5779
6707
  }
5780
- function validate44(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6708
+ function validate49(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5781
6709
  let vErrors = null;
5782
6710
  let errors = 0;
5783
6711
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -5815,8 +6743,8 @@ function validate44(data, { instancePath = "", parentData, parentDataProperty, r
5815
6743
  }
5816
6744
  const len0 = data0.length;
5817
6745
  for (let i0 = 0; i0 < len0; i0++) {
5818
- if (!validate45(data0[i0], { instancePath: instancePath + "/branches/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
5819
- vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors);
6746
+ if (!validate50(data0[i0], { instancePath: instancePath + "/branches/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
6747
+ vErrors = vErrors === null ? validate50.errors : vErrors.concat(validate50.errors);
5820
6748
  errors = vErrors.length;
5821
6749
  }
5822
6750
  }
@@ -5839,11 +6767,11 @@ function validate44(data, { instancePath = "", parentData, parentDataProperty, r
5839
6767
  }
5840
6768
  errors++;
5841
6769
  }
5842
- validate44.errors = vErrors;
6770
+ validate49.errors = vErrors;
5843
6771
  return errors === 0;
5844
6772
  }
5845
- var pattern22 = new RegExp("^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$", "u");
5846
- function validate49(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6773
+ var pattern27 = new RegExp("^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$", "u");
6774
+ function validate54(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5847
6775
  let vErrors = null;
5848
6776
  let errors = 0;
5849
6777
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -5910,7 +6838,7 @@ function validate49(data, { instancePath = "", parentData, parentDataProperty, r
5910
6838
  if (data.length !== void 0) {
5911
6839
  let data1 = data.length;
5912
6840
  if (typeof data1 === "string") {
5913
- if (!pattern22.test(data1)) {
6841
+ if (!pattern27.test(data1)) {
5914
6842
  const err6 = { instancePath: instancePath + "/length", schemaPath: "#/definitions/duration/pattern", keyword: "pattern", params: { pattern: "^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$" }, message: 'must match pattern "^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$"' };
5915
6843
  if (vErrors === null) {
5916
6844
  vErrors = [err6];
@@ -5984,10 +6912,10 @@ function validate49(data, { instancePath = "", parentData, parentDataProperty, r
5984
6912
  }
5985
6913
  errors++;
5986
6914
  }
5987
- validate49.errors = vErrors;
6915
+ validate54.errors = vErrors;
5988
6916
  return errors === 0;
5989
6917
  }
5990
- function validate51(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6918
+ function validate56(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5991
6919
  let vErrors = null;
5992
6920
  let errors = 0;
5993
6921
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -6097,10 +7025,10 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
6097
7025
  }
6098
7026
  errors++;
6099
7027
  }
6100
- validate51.errors = vErrors;
7028
+ validate56.errors = vErrors;
6101
7029
  return errors === 0;
6102
7030
  }
6103
- function validate53(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
7031
+ function validate58(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6104
7032
  let vErrors = null;
6105
7033
  let errors = 0;
6106
7034
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -6180,7 +7108,7 @@ function validate53(data, { instancePath = "", parentData, parentDataProperty, r
6180
7108
  if (data.color !== void 0) {
6181
7109
  let data2 = data.color;
6182
7110
  if (!(data2 === "blue" || data2 === "amber" || data2 === "green" || data2 === "violet" || data2 === "rose" || data2 === "slate" || data2 === "coin")) {
6183
- const err7 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema45.enum }, message: "must be equal to one of the allowed values" };
7111
+ const err7 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
6184
7112
  if (vErrors === null) {
6185
7113
  vErrors = [err7];
6186
7114
  } else {
@@ -6235,10 +7163,10 @@ function validate53(data, { instancePath = "", parentData, parentDataProperty, r
6235
7163
  }
6236
7164
  errors++;
6237
7165
  }
6238
- validate53.errors = vErrors;
7166
+ validate58.errors = vErrors;
6239
7167
  return errors === 0;
6240
7168
  }
6241
- function validate55(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
7169
+ function validate60(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6242
7170
  let vErrors = null;
6243
7171
  let errors = 0;
6244
7172
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -6325,10 +7253,10 @@ function validate55(data, { instancePath = "", parentData, parentDataProperty, r
6325
7253
  }
6326
7254
  errors++;
6327
7255
  }
6328
- validate55.errors = vErrors;
7256
+ validate60.errors = vErrors;
6329
7257
  return errors === 0;
6330
7258
  }
6331
- function validate57(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
7259
+ function validate62(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6332
7260
  let vErrors = null;
6333
7261
  let errors = 0;
6334
7262
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -6416,10 +7344,10 @@ function validate57(data, { instancePath = "", parentData, parentDataProperty, r
6416
7344
  }
6417
7345
  errors++;
6418
7346
  }
6419
- validate57.errors = vErrors;
7347
+ validate62.errors = vErrors;
6420
7348
  return errors === 0;
6421
7349
  }
6422
- function validate48(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
7350
+ function validate53(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6423
7351
  let vErrors = null;
6424
7352
  let errors = 0;
6425
7353
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -6453,14 +7381,14 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
6453
7381
  }
6454
7382
  }
6455
7383
  if (data.scale !== void 0) {
6456
- if (!validate49(data.scale, { instancePath: instancePath + "/scale", parentData: data, parentDataProperty: "scale", rootData })) {
6457
- vErrors = vErrors === null ? validate49.errors : vErrors.concat(validate49.errors);
7384
+ if (!validate54(data.scale, { instancePath: instancePath + "/scale", parentData: data, parentDataProperty: "scale", rootData })) {
7385
+ vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);
6458
7386
  errors = vErrors.length;
6459
7387
  }
6460
7388
  }
6461
7389
  if (data.period !== void 0) {
6462
- if (!validate51(data.period, { instancePath: instancePath + "/period", parentData: data, parentDataProperty: "period", rootData })) {
6463
- vErrors = vErrors === null ? validate51.errors : vErrors.concat(validate51.errors);
7390
+ if (!validate56(data.period, { instancePath: instancePath + "/period", parentData: data, parentDataProperty: "period", rootData })) {
7391
+ vErrors = vErrors === null ? validate56.errors : vErrors.concat(validate56.errors);
6464
7392
  errors = vErrors.length;
6465
7393
  }
6466
7394
  }
@@ -6478,8 +7406,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
6478
7406
  }
6479
7407
  const len0 = data2.length;
6480
7408
  for (let i0 = 0; i0 < len0; i0++) {
6481
- if (!validate53(data2[i0], { instancePath: instancePath + "/rows/" + i0, parentData: data2, parentDataProperty: i0, rootData })) {
6482
- vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);
7409
+ if (!validate58(data2[i0], { instancePath: instancePath + "/rows/" + i0, parentData: data2, parentDataProperty: i0, rootData })) {
7410
+ vErrors = vErrors === null ? validate58.errors : vErrors.concat(validate58.errors);
6483
7411
  errors = vErrors.length;
6484
7412
  }
6485
7413
  }
@@ -6498,8 +7426,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
6498
7426
  if (Array.isArray(data4)) {
6499
7427
  const len1 = data4.length;
6500
7428
  for (let i1 = 0; i1 < len1; i1++) {
6501
- if (!validate55(data4[i1], { instancePath: instancePath + "/points/" + i1, parentData: data4, parentDataProperty: i1, rootData })) {
6502
- vErrors = vErrors === null ? validate55.errors : vErrors.concat(validate55.errors);
7429
+ if (!validate60(data4[i1], { instancePath: instancePath + "/points/" + i1, parentData: data4, parentDataProperty: i1, rootData })) {
7430
+ vErrors = vErrors === null ? validate60.errors : vErrors.concat(validate60.errors);
6503
7431
  errors = vErrors.length;
6504
7432
  }
6505
7433
  }
@@ -6514,8 +7442,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
6514
7442
  }
6515
7443
  }
6516
7444
  if (data.zoom !== void 0) {
6517
- if (!validate57(data.zoom, { instancePath: instancePath + "/zoom", parentData: data, parentDataProperty: "zoom", rootData })) {
6518
- vErrors = vErrors === null ? validate57.errors : vErrors.concat(validate57.errors);
7445
+ if (!validate62(data.zoom, { instancePath: instancePath + "/zoom", parentData: data, parentDataProperty: "zoom", rootData })) {
7446
+ vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);
6519
7447
  errors = vErrors.length;
6520
7448
  }
6521
7449
  }
@@ -6528,7 +7456,7 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
6528
7456
  }
6529
7457
  errors++;
6530
7458
  }
6531
- validate48.errors = vErrors;
7459
+ validate53.errors = vErrors;
6532
7460
  return errors === 0;
6533
7461
  }
6534
7462
  var func2 = Object.prototype.hasOwnProperty;
@@ -6912,84 +7840,35 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
6912
7840
  errors++;
6913
7841
  }
6914
7842
  if (data.steps !== void 0) {
6915
- let data22 = data.steps;
6916
- if (Array.isArray(data22)) {
6917
- const len1 = data22.length;
6918
- for (let i1 = 0; i1 < len1; i1++) {
6919
- let data23 = data22[i1];
6920
- if (data23 && typeof data23 == "object" && !Array.isArray(data23)) {
6921
- if (data23.events !== void 0) {
6922
- let data24 = data23.events;
6923
- if (Array.isArray(data24)) {
6924
- const len2 = data24.length;
6925
- for (let i2 = 0; i2 < len2; i2++) {
6926
- let data25 = data24[i2];
6927
- if (data25 && typeof data25 == "object" && !Array.isArray(data25)) {
6928
- if (data25.type !== void 0) {
6929
- let data26 = data25.type;
6930
- const _errs62 = errors;
6931
- const _errs63 = errors;
6932
- if (!(data26 === "commit" || data26 === "branch")) {
6933
- const err23 = {};
6934
- if (vErrors === null) {
6935
- vErrors = [err23];
6936
- } else {
6937
- vErrors.push(err23);
6938
- }
6939
- errors++;
6940
- }
6941
- var valid31 = _errs63 === errors;
6942
- if (valid31) {
6943
- const err24 = { instancePath: instancePath + "/steps/" + i1 + "/events/" + i2 + "/type", schemaPath: "#/definitions/timeSteps/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
6944
- if (vErrors === null) {
6945
- vErrors = [err24];
6946
- } else {
6947
- vErrors.push(err24);
6948
- }
6949
- errors++;
6950
- } else {
6951
- errors = _errs62;
6952
- if (vErrors !== null) {
6953
- if (_errs62) {
6954
- vErrors.length = _errs62;
6955
- } else {
6956
- vErrors = null;
6957
- }
6958
- }
6959
- }
6960
- }
6961
- }
6962
- }
6963
- }
6964
- }
6965
- }
6966
- }
7843
+ if (!validate20(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
7844
+ vErrors = vErrors === null ? validate20.errors : vErrors.concat(validate20.errors);
7845
+ errors = vErrors.length;
6967
7846
  }
6968
7847
  }
6969
7848
  if (data.state !== void 0) {
6970
- const err25 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7849
+ const err23 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
6971
7850
  if (vErrors === null) {
6972
- vErrors = [err25];
7851
+ vErrors = [err23];
6973
7852
  } else {
6974
- vErrors.push(err25);
7853
+ vErrors.push(err23);
6975
7854
  }
6976
7855
  errors++;
6977
7856
  }
6978
7857
  if (data.git !== void 0) {
6979
- const err26 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7858
+ const err24 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
6980
7859
  if (vErrors === null) {
6981
- vErrors = [err26];
7860
+ vErrors = [err24];
6982
7861
  } else {
6983
- vErrors.push(err26);
7862
+ vErrors.push(err24);
6984
7863
  }
6985
7864
  errors++;
6986
7865
  }
6987
7866
  if (data.regions !== void 0) {
6988
- const err27 = { instancePath: instancePath + "/regions", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7867
+ const err25 = { instancePath: instancePath + "/regions", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
6989
7868
  if (vErrors === null) {
6990
- vErrors = [err27];
7869
+ vErrors = [err25];
6991
7870
  } else {
6992
- vErrors.push(err27);
7871
+ vErrors.push(err25);
6993
7872
  }
6994
7873
  errors++;
6995
7874
  }
@@ -6998,72 +7877,178 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
6998
7877
  valid21 = _valid3;
6999
7878
  ifClause3 = "then";
7000
7879
  } else {
7001
- const _errs73 = errors;
7880
+ const _errs66 = errors;
7881
+ const _errs67 = errors;
7882
+ let valid27 = true;
7883
+ const _errs68 = errors;
7002
7884
  if (data && typeof data == "object" && !Array.isArray(data)) {
7003
- if (data.boxes !== void 0) {
7004
- let data30 = data.boxes;
7005
- if (Array.isArray(data30)) {
7006
- if (data30.length < 1) {
7007
- const err28 = { instancePath: instancePath + "/boxes", schemaPath: "#/else/else/else/else/properties/boxes/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
7885
+ if (data.kind === void 0 && ("kind")) {
7886
+ const err26 = {};
7887
+ if (vErrors === null) {
7888
+ vErrors = [err26];
7889
+ } else {
7890
+ vErrors.push(err26);
7891
+ }
7892
+ errors++;
7893
+ } else {
7894
+ if (data.kind !== void 0) {
7895
+ if ("tree" !== data.kind) {
7896
+ const err27 = {};
7008
7897
  if (vErrors === null) {
7009
- vErrors = [err28];
7898
+ vErrors = [err27];
7010
7899
  } else {
7011
- vErrors.push(err28);
7900
+ vErrors.push(err27);
7012
7901
  }
7013
7902
  errors++;
7014
7903
  }
7015
7904
  }
7016
7905
  }
7017
- if (data.steps !== void 0) {
7018
- if (!validate11(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
7019
- vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);
7020
- errors = vErrors.length;
7021
- }
7906
+ }
7907
+ var _valid4 = _errs68 === errors;
7908
+ errors = _errs67;
7909
+ if (vErrors !== null) {
7910
+ if (_errs67) {
7911
+ vErrors.length = _errs67;
7912
+ } else {
7913
+ vErrors = null;
7022
7914
  }
7023
- if (data.strip !== void 0) {
7024
- if (!validate13(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
7025
- vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
7026
- errors = vErrors.length;
7915
+ }
7916
+ let ifClause4;
7917
+ if (_valid4) {
7918
+ const _errs70 = errors;
7919
+ if (data && typeof data == "object" && !Array.isArray(data)) {
7920
+ if (data.steps !== void 0) {
7921
+ if (!validate22(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
7922
+ vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);
7923
+ errors = vErrors.length;
7924
+ }
7027
7925
  }
7028
- }
7029
- if (data.state !== void 0) {
7030
- const err29 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7031
- if (vErrors === null) {
7032
- vErrors = [err29];
7033
- } else {
7034
- vErrors.push(err29);
7926
+ if (data.strip !== void 0) {
7927
+ if (!validate13(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
7928
+ vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
7929
+ errors = vErrors.length;
7930
+ }
7035
7931
  }
7036
- errors++;
7037
- }
7038
- if (data.git !== void 0) {
7039
- const err30 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7040
- if (vErrors === null) {
7041
- vErrors = [err30];
7042
- } else {
7043
- vErrors.push(err30);
7932
+ if (data.state !== void 0) {
7933
+ const err28 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7934
+ if (vErrors === null) {
7935
+ vErrors = [err28];
7936
+ } else {
7937
+ vErrors.push(err28);
7938
+ }
7939
+ errors++;
7940
+ }
7941
+ if (data.git !== void 0) {
7942
+ const err29 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7943
+ if (vErrors === null) {
7944
+ vErrors = [err29];
7945
+ } else {
7946
+ vErrors.push(err29);
7947
+ }
7948
+ errors++;
7949
+ }
7950
+ if (data.time !== void 0) {
7951
+ const err30 = { instancePath: instancePath + "/time", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7952
+ if (vErrors === null) {
7953
+ vErrors = [err30];
7954
+ } else {
7955
+ vErrors.push(err30);
7956
+ }
7957
+ errors++;
7958
+ }
7959
+ if (data.regions !== void 0) {
7960
+ const err31 = { instancePath: instancePath + "/regions", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7961
+ if (vErrors === null) {
7962
+ vErrors = [err31];
7963
+ } else {
7964
+ vErrors.push(err31);
7965
+ }
7966
+ errors++;
7044
7967
  }
7045
- errors++;
7046
7968
  }
7047
- if (data.time !== void 0) {
7048
- const err31 = { instancePath: instancePath + "/time", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7049
- if (vErrors === null) {
7050
- vErrors = [err31];
7051
- } else {
7052
- vErrors.push(err31);
7969
+ var _valid4 = _errs70 === errors;
7970
+ valid27 = _valid4;
7971
+ ifClause4 = "then";
7972
+ } else {
7973
+ const _errs85 = errors;
7974
+ if (data && typeof data == "object" && !Array.isArray(data)) {
7975
+ if (data.boxes !== void 0) {
7976
+ let data33 = data.boxes;
7977
+ if (Array.isArray(data33)) {
7978
+ if (data33.length < 1) {
7979
+ const err32 = { instancePath: instancePath + "/boxes", schemaPath: "#/else/else/else/else/else/properties/boxes/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
7980
+ if (vErrors === null) {
7981
+ vErrors = [err32];
7982
+ } else {
7983
+ vErrors.push(err32);
7984
+ }
7985
+ errors++;
7986
+ }
7987
+ }
7988
+ }
7989
+ if (data.steps !== void 0) {
7990
+ if (!validate11(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
7991
+ vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);
7992
+ errors = vErrors.length;
7993
+ }
7994
+ }
7995
+ if (data.strip !== void 0) {
7996
+ if (!validate13(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
7997
+ vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
7998
+ errors = vErrors.length;
7999
+ }
8000
+ }
8001
+ if (data.state !== void 0) {
8002
+ const err33 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
8003
+ if (vErrors === null) {
8004
+ vErrors = [err33];
8005
+ } else {
8006
+ vErrors.push(err33);
8007
+ }
8008
+ errors++;
8009
+ }
8010
+ if (data.git !== void 0) {
8011
+ const err34 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
8012
+ if (vErrors === null) {
8013
+ vErrors = [err34];
8014
+ } else {
8015
+ vErrors.push(err34);
8016
+ }
8017
+ errors++;
8018
+ }
8019
+ if (data.time !== void 0) {
8020
+ const err35 = { instancePath: instancePath + "/time", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
8021
+ if (vErrors === null) {
8022
+ vErrors = [err35];
8023
+ } else {
8024
+ vErrors.push(err35);
8025
+ }
8026
+ errors++;
7053
8027
  }
7054
- errors++;
7055
8028
  }
8029
+ var _valid4 = _errs85 === errors;
8030
+ valid27 = _valid4;
8031
+ ifClause4 = "else";
7056
8032
  }
7057
- var _valid3 = _errs73 === errors;
8033
+ if (!valid27) {
8034
+ const err36 = { instancePath, schemaPath: "#/else/else/else/else/if", keyword: "if", params: { failingKeyword: ifClause4 }, message: 'must match "' + ifClause4 + '" schema' };
8035
+ if (vErrors === null) {
8036
+ vErrors = [err36];
8037
+ } else {
8038
+ vErrors.push(err36);
8039
+ }
8040
+ errors++;
8041
+ }
8042
+ var _valid3 = _errs66 === errors;
7058
8043
  valid21 = _valid3;
7059
8044
  ifClause3 = "else";
7060
8045
  }
7061
8046
  if (!valid21) {
7062
- const err32 = { instancePath, schemaPath: "#/else/else/else/if", keyword: "if", params: { failingKeyword: ifClause3 }, message: 'must match "' + ifClause3 + '" schema' };
8047
+ const err37 = { instancePath, schemaPath: "#/else/else/else/if", keyword: "if", params: { failingKeyword: ifClause3 }, message: 'must match "' + ifClause3 + '" schema' };
7063
8048
  if (vErrors === null) {
7064
- vErrors = [err32];
8049
+ vErrors = [err37];
7065
8050
  } else {
7066
- vErrors.push(err32);
8051
+ vErrors.push(err37);
7067
8052
  }
7068
8053
  errors++;
7069
8054
  }
@@ -7072,11 +8057,11 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
7072
8057
  ifClause2 = "else";
7073
8058
  }
7074
8059
  if (!valid15) {
7075
- const err33 = { instancePath, schemaPath: "#/else/else/if", keyword: "if", params: { failingKeyword: ifClause2 }, message: 'must match "' + ifClause2 + '" schema' };
8060
+ const err38 = { instancePath, schemaPath: "#/else/else/if", keyword: "if", params: { failingKeyword: ifClause2 }, message: 'must match "' + ifClause2 + '" schema' };
7076
8061
  if (vErrors === null) {
7077
- vErrors = [err33];
8062
+ vErrors = [err38];
7078
8063
  } else {
7079
- vErrors.push(err33);
8064
+ vErrors.push(err38);
7080
8065
  }
7081
8066
  errors++;
7082
8067
  }
@@ -7085,21 +8070,21 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
7085
8070
  ifClause1 = "else";
7086
8071
  }
7087
8072
  if (!valid6) {
7088
- const err34 = { instancePath, schemaPath: "#/else/if", keyword: "if", params: { failingKeyword: ifClause1 }, message: 'must match "' + ifClause1 + '" schema' };
8073
+ const err39 = { instancePath, schemaPath: "#/else/if", keyword: "if", params: { failingKeyword: ifClause1 }, message: 'must match "' + ifClause1 + '" schema' };
7089
8074
  if (vErrors === null) {
7090
- vErrors = [err34];
8075
+ vErrors = [err39];
7091
8076
  } else {
7092
- vErrors.push(err34);
8077
+ vErrors.push(err39);
7093
8078
  }
7094
8079
  errors++;
7095
8080
  }
7096
8081
  if (data && typeof data == "object" && !Array.isArray(data)) {
7097
8082
  if (data.sequence !== void 0) {
7098
- const err35 = { instancePath: instancePath + "/sequence", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
8083
+ const err40 = { instancePath: instancePath + "/sequence", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7099
8084
  if (vErrors === null) {
7100
- vErrors = [err35];
8085
+ vErrors = [err40];
7101
8086
  } else {
7102
- vErrors.push(err35);
8087
+ vErrors.push(err40);
7103
8088
  }
7104
8089
  errors++;
7105
8090
  }
@@ -7109,245 +8094,245 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
7109
8094
  ifClause0 = "else";
7110
8095
  }
7111
8096
  if (!valid0) {
7112
- const err36 = { instancePath, schemaPath: "#/if", keyword: "if", params: { failingKeyword: ifClause0 }, message: 'must match "' + ifClause0 + '" schema' };
8097
+ const err41 = { instancePath, schemaPath: "#/if", keyword: "if", params: { failingKeyword: ifClause0 }, message: 'must match "' + ifClause0 + '" schema' };
7113
8098
  if (vErrors === null) {
7114
- vErrors = [err36];
8099
+ vErrors = [err41];
7115
8100
  } else {
7116
- vErrors.push(err36);
8101
+ vErrors.push(err41);
7117
8102
  }
7118
8103
  errors++;
7119
8104
  }
7120
8105
  if (data && typeof data == "object" && !Array.isArray(data)) {
7121
8106
  if (data.version === void 0) {
7122
- const err37 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "version" }, message: "must have required property 'version'" };
8107
+ const err42 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "version" }, message: "must have required property 'version'" };
7123
8108
  if (vErrors === null) {
7124
- vErrors = [err37];
8109
+ vErrors = [err42];
7125
8110
  } else {
7126
- vErrors.push(err37);
8111
+ vErrors.push(err42);
7127
8112
  }
7128
8113
  errors++;
7129
8114
  }
7130
8115
  if (data.kind === void 0) {
7131
- const err38 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "kind" }, message: "must have required property 'kind'" };
8116
+ const err43 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "kind" }, message: "must have required property 'kind'" };
7132
8117
  if (vErrors === null) {
7133
- vErrors = [err38];
8118
+ vErrors = [err43];
7134
8119
  } else {
7135
- vErrors.push(err38);
8120
+ vErrors.push(err43);
7136
8121
  }
7137
8122
  errors++;
7138
8123
  }
7139
8124
  if (data.title === void 0) {
7140
- const err39 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "title" }, message: "must have required property 'title'" };
8125
+ const err44 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "title" }, message: "must have required property 'title'" };
7141
8126
  if (vErrors === null) {
7142
- vErrors = [err39];
8127
+ vErrors = [err44];
7143
8128
  } else {
7144
- vErrors.push(err39);
8129
+ vErrors.push(err44);
7145
8130
  }
7146
8131
  errors++;
7147
8132
  }
7148
8133
  if (data.boxes === void 0) {
7149
- const err40 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "boxes" }, message: "must have required property 'boxes'" };
8134
+ const err45 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "boxes" }, message: "must have required property 'boxes'" };
7150
8135
  if (vErrors === null) {
7151
- vErrors = [err40];
8136
+ vErrors = [err45];
7152
8137
  } else {
7153
- vErrors.push(err40);
8138
+ vErrors.push(err45);
7154
8139
  }
7155
8140
  errors++;
7156
8141
  }
7157
8142
  if (data.steps === void 0) {
7158
- const err41 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "steps" }, message: "must have required property 'steps'" };
8143
+ const err46 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "steps" }, message: "must have required property 'steps'" };
7159
8144
  if (vErrors === null) {
7160
- vErrors = [err41];
8145
+ vErrors = [err46];
7161
8146
  } else {
7162
- vErrors.push(err41);
8147
+ vErrors.push(err46);
7163
8148
  }
7164
8149
  errors++;
7165
8150
  }
7166
8151
  for (const key0 in data) {
7167
8152
  if (!func2.call(schema11.properties, key0)) {
7168
- const err42 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
8153
+ const err47 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
7169
8154
  if (vErrors === null) {
7170
- vErrors = [err42];
8155
+ vErrors = [err47];
7171
8156
  } else {
7172
- vErrors.push(err42);
8157
+ vErrors.push(err47);
7173
8158
  }
7174
8159
  errors++;
7175
8160
  }
7176
8161
  }
7177
8162
  if (data.version !== void 0) {
7178
- let data37 = data.version;
7179
- if (!(typeof data37 == "number" && (!(data37 % 1) && !isNaN(data37)) && isFinite(data37))) {
7180
- const err43 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
8163
+ let data40 = data.version;
8164
+ if (!(typeof data40 == "number" && (!(data40 % 1) && !isNaN(data40)) && isFinite(data40))) {
8165
+ const err48 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
7181
8166
  if (vErrors === null) {
7182
- vErrors = [err43];
8167
+ vErrors = [err48];
7183
8168
  } else {
7184
- vErrors.push(err43);
8169
+ vErrors.push(err48);
7185
8170
  }
7186
8171
  errors++;
7187
8172
  }
7188
- if (typeof data37 == "number" && isFinite(data37)) {
7189
- if (data37 < 1 || isNaN(data37)) {
7190
- const err44 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
8173
+ if (typeof data40 == "number" && isFinite(data40)) {
8174
+ if (data40 < 1 || isNaN(data40)) {
8175
+ const err49 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
7191
8176
  if (vErrors === null) {
7192
- vErrors = [err44];
8177
+ vErrors = [err49];
7193
8178
  } else {
7194
- vErrors.push(err44);
8179
+ vErrors.push(err49);
7195
8180
  }
7196
8181
  errors++;
7197
8182
  }
7198
8183
  }
7199
8184
  }
7200
8185
  if (data.kind !== void 0) {
7201
- let data38 = data.kind;
7202
- if (!(data38 === "sequence" || data38 === "architecture" || data38 === "state" || data38 === "git" || data38 === "time")) {
7203
- const err45 = { instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: schema11.properties.kind.enum }, message: "must be equal to one of the allowed values" };
8186
+ let data41 = data.kind;
8187
+ if (!(data41 === "sequence" || data41 === "architecture" || data41 === "state" || data41 === "git" || data41 === "time" || data41 === "tree")) {
8188
+ const err50 = { instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: schema11.properties.kind.enum }, message: "must be equal to one of the allowed values" };
7204
8189
  if (vErrors === null) {
7205
- vErrors = [err45];
8190
+ vErrors = [err50];
7206
8191
  } else {
7207
- vErrors.push(err45);
8192
+ vErrors.push(err50);
7208
8193
  }
7209
8194
  errors++;
7210
8195
  }
7211
8196
  }
7212
8197
  if (data.title !== void 0) {
7213
- let data39 = data.title;
7214
- if (typeof data39 === "string") {
7215
- if (func3(data39) < 1) {
7216
- const err46 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
8198
+ let data42 = data.title;
8199
+ if (typeof data42 === "string") {
8200
+ if (func3(data42) < 1) {
8201
+ const err51 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
7217
8202
  if (vErrors === null) {
7218
- vErrors = [err46];
8203
+ vErrors = [err51];
7219
8204
  } else {
7220
- vErrors.push(err46);
8205
+ vErrors.push(err51);
7221
8206
  }
7222
8207
  errors++;
7223
8208
  }
7224
8209
  } else {
7225
- const err47 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
8210
+ const err52 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7226
8211
  if (vErrors === null) {
7227
- vErrors = [err47];
8212
+ vErrors = [err52];
7228
8213
  } else {
7229
- vErrors.push(err47);
8214
+ vErrors.push(err52);
7230
8215
  }
7231
8216
  errors++;
7232
8217
  }
7233
8218
  }
7234
8219
  if (data.view !== void 0) {
7235
- let data40 = data.view;
7236
- if (!(data40 === "fixed" || data40 === "follow")) {
7237
- const err48 = { instancePath: instancePath + "/view", schemaPath: "#/properties/view/enum", keyword: "enum", params: { allowedValues: schema11.properties.view.enum }, message: "must be equal to one of the allowed values" };
8220
+ let data43 = data.view;
8221
+ if (!(data43 === "fixed" || data43 === "follow")) {
8222
+ const err53 = { instancePath: instancePath + "/view", schemaPath: "#/properties/view/enum", keyword: "enum", params: { allowedValues: schema11.properties.view.enum }, message: "must be equal to one of the allowed values" };
7238
8223
  if (vErrors === null) {
7239
- vErrors = [err48];
8224
+ vErrors = [err53];
7240
8225
  } else {
7241
- vErrors.push(err48);
8226
+ vErrors.push(err53);
7242
8227
  }
7243
8228
  errors++;
7244
8229
  }
7245
8230
  }
7246
8231
  if (data.regions !== void 0) {
7247
- let data41 = data.regions;
7248
- if (Array.isArray(data41)) {
7249
- const len3 = data41.length;
7250
- for (let i3 = 0; i3 < len3; i3++) {
7251
- if (!validate22(data41[i3], { instancePath: instancePath + "/regions/" + i3, parentData: data41, parentDataProperty: i3, rootData })) {
7252
- vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);
8232
+ let data44 = data.regions;
8233
+ if (Array.isArray(data44)) {
8234
+ const len1 = data44.length;
8235
+ for (let i1 = 0; i1 < len1; i1++) {
8236
+ if (!validate27(data44[i1], { instancePath: instancePath + "/regions/" + i1, parentData: data44, parentDataProperty: i1, rootData })) {
8237
+ vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);
7253
8238
  errors = vErrors.length;
7254
8239
  }
7255
8240
  }
7256
8241
  } else {
7257
- const err49 = { instancePath: instancePath + "/regions", schemaPath: "#/properties/regions/type", keyword: "type", params: { type: "array" }, message: "must be array" };
8242
+ const err54 = { instancePath: instancePath + "/regions", schemaPath: "#/properties/regions/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7258
8243
  if (vErrors === null) {
7259
- vErrors = [err49];
8244
+ vErrors = [err54];
7260
8245
  } else {
7261
- vErrors.push(err49);
8246
+ vErrors.push(err54);
7262
8247
  }
7263
8248
  errors++;
7264
8249
  }
7265
8250
  }
7266
8251
  if (data.boxes !== void 0) {
7267
- let data43 = data.boxes;
7268
- if (Array.isArray(data43)) {
7269
- const len4 = data43.length;
7270
- for (let i4 = 0; i4 < len4; i4++) {
7271
- if (!validate24(data43[i4], { instancePath: instancePath + "/boxes/" + i4, parentData: data43, parentDataProperty: i4, rootData })) {
7272
- vErrors = vErrors === null ? validate24.errors : vErrors.concat(validate24.errors);
8252
+ let data46 = data.boxes;
8253
+ if (Array.isArray(data46)) {
8254
+ const len2 = data46.length;
8255
+ for (let i2 = 0; i2 < len2; i2++) {
8256
+ if (!validate29(data46[i2], { instancePath: instancePath + "/boxes/" + i2, parentData: data46, parentDataProperty: i2, rootData })) {
8257
+ vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);
7273
8258
  errors = vErrors.length;
7274
8259
  }
7275
8260
  }
7276
8261
  } else {
7277
- const err50 = { instancePath: instancePath + "/boxes", schemaPath: "#/properties/boxes/type", keyword: "type", params: { type: "array" }, message: "must be array" };
8262
+ const err55 = { instancePath: instancePath + "/boxes", schemaPath: "#/properties/boxes/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7278
8263
  if (vErrors === null) {
7279
- vErrors = [err50];
8264
+ vErrors = [err55];
7280
8265
  } else {
7281
- vErrors.push(err50);
8266
+ vErrors.push(err55);
7282
8267
  }
7283
8268
  errors++;
7284
8269
  }
7285
8270
  }
7286
8271
  if (data.strip !== void 0) {
7287
- if (!validate26(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
7288
- vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors);
8272
+ if (!validate31(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
8273
+ vErrors = vErrors === null ? validate31.errors : vErrors.concat(validate31.errors);
7289
8274
  errors = vErrors.length;
7290
8275
  }
7291
8276
  }
7292
8277
  if (data.steps !== void 0) {
7293
- let data46 = data.steps;
7294
- if (Array.isArray(data46)) {
7295
- if (data46.length < 1) {
7296
- const err51 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
8278
+ let data49 = data.steps;
8279
+ if (Array.isArray(data49)) {
8280
+ if (data49.length < 1) {
8281
+ const err56 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
7297
8282
  if (vErrors === null) {
7298
- vErrors = [err51];
8283
+ vErrors = [err56];
7299
8284
  } else {
7300
- vErrors.push(err51);
8285
+ vErrors.push(err56);
7301
8286
  }
7302
8287
  errors++;
7303
8288
  }
7304
- const len5 = data46.length;
7305
- for (let i5 = 0; i5 < len5; i5++) {
7306
- if (!validate30(data46[i5], { instancePath: instancePath + "/steps/" + i5, parentData: data46, parentDataProperty: i5, rootData })) {
7307
- vErrors = vErrors === null ? validate30.errors : vErrors.concat(validate30.errors);
8289
+ const len3 = data49.length;
8290
+ for (let i3 = 0; i3 < len3; i3++) {
8291
+ if (!validate35(data49[i3], { instancePath: instancePath + "/steps/" + i3, parentData: data49, parentDataProperty: i3, rootData })) {
8292
+ vErrors = vErrors === null ? validate35.errors : vErrors.concat(validate35.errors);
7308
8293
  errors = vErrors.length;
7309
8294
  }
7310
8295
  }
7311
8296
  } else {
7312
- const err52 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/type", keyword: "type", params: { type: "array" }, message: "must be array" };
8297
+ const err57 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7313
8298
  if (vErrors === null) {
7314
- vErrors = [err52];
8299
+ vErrors = [err57];
7315
8300
  } else {
7316
- vErrors.push(err52);
8301
+ vErrors.push(err57);
7317
8302
  }
7318
8303
  errors++;
7319
8304
  }
7320
8305
  }
7321
8306
  if (data.sequence !== void 0) {
7322
- if (!validate38(data.sequence, { instancePath: instancePath + "/sequence", parentData: data, parentDataProperty: "sequence", rootData })) {
7323
- vErrors = vErrors === null ? validate38.errors : vErrors.concat(validate38.errors);
8307
+ if (!validate43(data.sequence, { instancePath: instancePath + "/sequence", parentData: data, parentDataProperty: "sequence", rootData })) {
8308
+ vErrors = vErrors === null ? validate43.errors : vErrors.concat(validate43.errors);
7324
8309
  errors = vErrors.length;
7325
8310
  }
7326
8311
  }
7327
8312
  if (data.state !== void 0) {
7328
- if (!validate40(data.state, { instancePath: instancePath + "/state", parentData: data, parentDataProperty: "state", rootData })) {
7329
- vErrors = vErrors === null ? validate40.errors : vErrors.concat(validate40.errors);
8313
+ if (!validate45(data.state, { instancePath: instancePath + "/state", parentData: data, parentDataProperty: "state", rootData })) {
8314
+ vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors);
7330
8315
  errors = vErrors.length;
7331
8316
  }
7332
8317
  }
7333
8318
  if (data.git !== void 0) {
7334
- if (!validate44(data.git, { instancePath: instancePath + "/git", parentData: data, parentDataProperty: "git", rootData })) {
7335
- vErrors = vErrors === null ? validate44.errors : vErrors.concat(validate44.errors);
8319
+ if (!validate49(data.git, { instancePath: instancePath + "/git", parentData: data, parentDataProperty: "git", rootData })) {
8320
+ vErrors = vErrors === null ? validate49.errors : vErrors.concat(validate49.errors);
7336
8321
  errors = vErrors.length;
7337
8322
  }
7338
8323
  }
7339
8324
  if (data.time !== void 0) {
7340
- if (!validate48(data.time, { instancePath: instancePath + "/time", parentData: data, parentDataProperty: "time", rootData })) {
7341
- vErrors = vErrors === null ? validate48.errors : vErrors.concat(validate48.errors);
8325
+ if (!validate53(data.time, { instancePath: instancePath + "/time", parentData: data, parentDataProperty: "time", rootData })) {
8326
+ vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);
7342
8327
  errors = vErrors.length;
7343
8328
  }
7344
8329
  }
7345
8330
  } else {
7346
- const err53 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
8331
+ const err58 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7347
8332
  if (vErrors === null) {
7348
- vErrors = [err53];
8333
+ vErrors = [err58];
7349
8334
  } else {
7350
- vErrors.push(err53);
8335
+ vErrors.push(err58);
7351
8336
  }
7352
8337
  errors++;
7353
8338
  }
@@ -7357,7 +8342,7 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
7357
8342
 
7358
8343
  // src/schema.ts
7359
8344
  var COLORS = ["blue", "amber", "green", "violet", "rose", "slate", "coin"];
7360
- var EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span"];
8345
+ var EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span", "leaf", "node"];
7361
8346
  var ABSENT = "#/definitions/absent/not";
7362
8347
  var ABSENT_KINDS = { regions: "sequence / architecture / state", at: "time", into: "time", color: "time", meters: "time" };
7363
8348
  var NOT_ALLOWED = {
@@ -7368,6 +8353,8 @@ var GIT_EVENT = /\/events\/items\/properties\/type\/not$/u;
7368
8353
  var GIT_EVENTS = ["commit", "branch"];
7369
8354
  var TIME_EVENT = /\/events\/items\/not$/u;
7370
8355
  var TIME_EVENTS = ["now", "mark", "span"];
8356
+ var TREE_EVENT = /\/events\/items\/allOf\/0\/not$/u;
8357
+ var TREE_EVENTS = ["leaf", "node"];
7371
8358
  var DURATION = /^\^\[0-9\]\+\(\\\.\[0-9\]\+\)\?\(([a-z|]+)\)\$$/u;
7372
8359
  var RATIO = /%\)\$$/u;
7373
8360
  var escape = (key) => key.replaceAll("~", "~0").replaceAll("/", "~1");
@@ -7398,6 +8385,7 @@ function toFieldError(error, errors, m) {
7398
8385
  if (RESERVED_ID.test(error.schemaPath)) return { pointer: at2, message: m.reserved(STATE_ENDS) };
7399
8386
  if (GIT_EVENT.test(error.schemaPath)) return { pointer: at2, message: m.kindOnly(GIT_EVENTS, "git") };
7400
8387
  if (TIME_EVENT.test(error.schemaPath)) return { pointer: `${at2}/type`, message: m.kindOnly(TIME_EVENTS, "time") };
8388
+ if (TREE_EVENT.test(error.schemaPath)) return { pointer: `${at2}/type`, message: m.kindOnly(TREE_EVENTS, "tree") };
7401
8389
  const last = at2.slice(at2.lastIndexOf("/") + 1);
7402
8390
  if (error.schemaPath === ABSENT) return { pointer: at2, message: m.not({ field: last, kind: ABSENT_KINDS[last] ?? last }) };
7403
8391
  const allowed = NOT_ALLOWED[last];
@@ -7509,7 +8497,7 @@ function plan(step, needle) {
7509
8497
  return;
7510
8498
  }
7511
8499
  if (event.type === "now" || needle && pulled(event)) return;
7512
- if (event.type === "commit" || event.type === "branch") {
8500
+ if (event.type === "commit" || event.type === "branch" || event.type === "leaf" || event.type === "node") {
7513
8501
  const a = cursor;
7514
8502
  const b = a + MOTION.draw;
7515
8503
  out.edges.push({ event: e, a, b, carries: false, coin: false, named: false });
@@ -7735,6 +8723,7 @@ var ICONS = {
7735
8723
  layers: "M 0 -8 l9 4.5 l-9 4.5 l-9 -4.5 z M -9 2.5 l9 4.5 l9 -4.5",
7736
8724
  code: "M -4 -6 l-5 6 l5 6 M 4 -6 l5 6 l-5 6",
7737
8725
  paint: "M -8 8 c 0 -3 2 -5 4.5 -5 l 9 -9 l 3.5 3.5 l -9 9 c 0 2.5 -2 4.5 -5 4.5 z",
8726
+ tree: "M 0 -5 v4 M -6 -1 h12 M -6 -1 v3 M 6 -1 v3 M -9 2 h6 v6 h-6 z M 3 2 h6 v6 h-6 z M -3 -10 h6 v5 h-6 z",
7738
8727
  block: "M -9 -7 h18 a2 2 0 0 1 2 2 v10 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-10 a2 2 0 0 1 2 -2 z M -11 -2.5 h22 M -6 2.5 h8"
7739
8728
  };
7740
8729
 
@@ -7987,12 +8976,12 @@ var easeInOut = (t) => t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;
7987
8976
  function carrier(e, time, ctx) {
7988
8977
  const { m } = ctx;
7989
8978
  const n = LOOK.carrier.samples;
7990
- const route = e.wait ? [e.wait, ...e.points] : e.points;
7991
- const length = pathLength(route);
8979
+ const route2 = e.wait ? [e.wait, ...e.points] : e.points;
8980
+ const length = pathLength(route2);
7992
8981
  const { depart: a, arrive: b, start: from, end: gone } = time;
7993
8982
  const path2 = [];
7994
8983
  for (let k = 0; k <= n; k++) {
7995
- const [x, y] = along(route, easeInOut(k / n) * length);
8984
+ const [x, y] = along(route2, easeInOut(k / n) * length);
7996
8985
  path2.push([a + (b - a) * k / n, x, y]);
7997
8986
  }
7998
8987
  const first = path2[0];
@@ -8469,6 +9458,128 @@ function timeFocus(layout, timeline, step, parts, vw, vh) {
8469
9458
  return held;
8470
9459
  }
8471
9460
 
9461
+ // src/render/tree.ts
9462
+ var r14 = (v) => Math.round(v * 100) / 100;
9463
+ function drawTree(layout, diagram, timeline, ctx) {
9464
+ const { m } = ctx;
9465
+ const T = LOOK.tree;
9466
+ const B = LOOK.box;
9467
+ const timeOf = (step, event) => timeline.edges.find((t) => t.step === step && t.event === event);
9468
+ const active = /* @__PURE__ */ new Map();
9469
+ const touched = /* @__PURE__ */ new Map();
9470
+ diagram.steps.forEach((step, s) => {
9471
+ for (const e of step.events) {
9472
+ if (e.type !== "edge") continue;
9473
+ for (const id of [e.from, e.to]) {
9474
+ active.set(id, (active.get(id) ?? /* @__PURE__ */ new Set()).add(s));
9475
+ if (e.carry.kind !== "none" && !touched.has(id)) touched.set(id, s);
9476
+ }
9477
+ }
9478
+ });
9479
+ const carries = (step, event) => {
9480
+ const e = diagram.steps[step]?.events[event];
9481
+ return e?.type === "edge" && e.carry.kind !== "none";
9482
+ };
9483
+ const fadeStep = layout.runs.filter((run) => carries(run.step, run.event)).reduce((s, run) => s === void 0 ? run.step : Math.min(s, run.step), void 0);
9484
+ const fadeAt = fadeStep === void 0 ? void 0 : timeline.steps[fadeStep]?.start;
9485
+ const fadeOf = (id) => {
9486
+ if (fadeStep === void 0 || fadeAt === void 0) return void 0;
9487
+ const t = touched.get(id);
9488
+ if (t !== void 0 && t <= fadeStep) return void 0;
9489
+ const back = t === void 0 ? void 0 : timeline.steps[t]?.start;
9490
+ const frames = [
9491
+ [0, { opacity: 1 }],
9492
+ [fadeAt, { opacity: 1 }, EASE.inOut],
9493
+ [fadeAt + MOTION.fade, { opacity: T.faint }]
9494
+ ];
9495
+ if (back !== void 0) frames.push([back, { opacity: T.faint }, EASE.inOut], [back + MOTION.fade, { opacity: 1 }]);
9496
+ frames.push([m.last, { opacity: back === void 0 ? T.faint : 1 }, EASE.inOut], [m.total, { opacity: 1 }]);
9497
+ return m.kf(frames);
9498
+ };
9499
+ const faded = (id, markup, attrs = "") => {
9500
+ const fade = fadeOf(id);
9501
+ return fade ? `<g class="dg-a"${attrs} style="${fade}">${markup}</g>` : attrs === "" ? markup : `<g${attrs}>${markup}</g>`;
9502
+ };
9503
+ const drawnAt = new Map(layout.nodes.map((n) => [n.id, timeOf(n.step, n.event)?.drawn ?? 0]));
9504
+ const links = layout.links.map((l) => {
9505
+ const time = timeOf(l.step, l.event);
9506
+ if (!time) return "";
9507
+ ctx.traces.push({ from: l.from, to: l.to, points: l.points, shown: [[time.start, Number.POSITIVE_INFINITY]] });
9508
+ const kf = m.kf([
9509
+ [0, { opacity: 0, "stroke-dashoffset": 1 }],
9510
+ [time.start, { opacity: 0, "stroke-dashoffset": 1 }, EASE.inOut],
9511
+ [time.start + 0.05, { opacity: 1 }],
9512
+ [time.drawn, { "stroke-dashoffset": 0 }],
9513
+ [m.last, { opacity: 1, "stroke-dashoffset": 0 }, EASE.inOut],
9514
+ [m.total, { opacity: 0, "stroke-dashoffset": 0 }]
9515
+ ]);
9516
+ return faded(l.from, `<path class="dg-tree-l dg-a" data-tree-link="${esc(l.from)}" pathLength="1" d="${pathOf(l.points)}" style="${kf}"/>`);
9517
+ }).join("");
9518
+ const ties = layout.nodes.flatMap((n) => {
9519
+ if (!n.card) return [];
9520
+ const at2 = drawnAt.get(n.id) ?? 0;
9521
+ const d = `M ${r14(n.cx)} ${r14(n.y + n.h + LOOK.edge.inset)} V ${r14(n.card.y - LOOK.edge.inset)}`;
9522
+ return [faded(n.id, `<path class="dg-tree-con dg-a" d="${d}" style="${m.vis(at2)}"/>`)];
9523
+ }).join("");
9524
+ const traced = /* @__PURE__ */ new Set();
9525
+ const trails = layout.runs.flatMap((run) => {
9526
+ const e = layout.edges.find((x) => x.step === run.step && x.event === run.event);
9527
+ if (!e || traced.has(run.link)) return [];
9528
+ const carried = timeline.carriers.find((c) => c.step === run.step && c.event === run.event);
9529
+ const time = timeOf(run.step, run.event);
9530
+ const a = carried?.depart ?? time?.start;
9531
+ const b = carried?.arrive ?? time?.drawn;
9532
+ if (a === void 0 || b === void 0) return [];
9533
+ traced.add(run.link);
9534
+ const kf = m.kf([
9535
+ [0, { opacity: 0, "stroke-dashoffset": 1 }],
9536
+ [a, { opacity: 0, "stroke-dashoffset": 1 }, EASE.inOut],
9537
+ [a + 0.05, { opacity: 1 }],
9538
+ [b, { "stroke-dashoffset": 0 }],
9539
+ [m.last, { opacity: 1, "stroke-dashoffset": 0 }, EASE.inOut],
9540
+ [m.total, { opacity: 0, "stroke-dashoffset": 0 }]
9541
+ ]);
9542
+ const d = pathOf(e.points);
9543
+ return [
9544
+ `<g style="${cs(e.color)}"><path class="dg-tree-tr dg-a" data-tree-trail="${esc(run.link)}" pathLength="1" d="${d}" style="${kf}"/><path class="dg-tree-h dg-a" d="${arrowHead(e.points)}" style="${m.vis(b)}"/></g>`
9545
+ ];
9546
+ }).join("");
9547
+ const cards = layout.nodes.flatMap((n) => {
9548
+ const c = n.card;
9549
+ if (!c) return [];
9550
+ const gx = c.x + T.card.padX + T.card.icon / 2;
9551
+ const cy = c.y + c.h / 2;
9552
+ const text2 = write(ctx.ink, "dg-tree-ct", c.x + T.card.padX + T.card.icon + T.card.gap, cy + LOOK.baseline.label, c.text, TYPE.treeCard, ALWAYS);
9553
+ return [
9554
+ faded(
9555
+ n.id,
9556
+ `<rect class="dg-tree-card" x="${r14(c.x)}" y="${r14(c.y)}" width="${r14(c.w)}" height="${c.h}" rx="${T.card.radius}"/>${glyph("doc", gx, cy, T.card.glyph, "dg-tree-cg")}${text2}`,
9557
+ ` data-tree-card="${esc(n.id)}"`
9558
+ )
9559
+ ];
9560
+ }).join("");
9561
+ const nodes = layout.nodes.map((n) => {
9562
+ const at2 = drawnAt.get(n.id) ?? 0;
9563
+ const on = [...active.get(n.id) ?? []].sort((x, y) => x - y);
9564
+ const act = on.length > 0 ? activeKf(ctx, on) : void 0;
9565
+ const radius = n.root ? T.root.radius : T.radius;
9566
+ const rect = (cls, extra = "") => `<rect class="${cls}" x="${r14(n.x)}" y="${r14(n.y)}" width="${r14(n.w)}" height="${n.h}" rx="${radius}"${extra}/>`;
9567
+ const frame = `${act ? `<g class="dg-a" style="${act}">${rect("dg-halo")}</g>` : ""}${rect("dg-st", ` ${ctx.sh}`)}${act ? `<g class="dg-a" style="${act}">${rect("dg-on")}</g>` : ""}`;
9568
+ const ix = n.x + T.root.iconX + B.icon / 2;
9569
+ const mark = n.root ? `<rect class="dg-ic" x="${r14(ix - B.icon / 2)}" y="${r14(n.cy - B.icon / 2)}" width="${B.icon}" height="${B.icon}" rx="${B.iconRadius}"/>${glyph("tree", ix, n.cy, B.iconScale)}` : "";
9570
+ const shown = [[at2, Number.POSITIVE_INFINITY]];
9571
+ const texts = n.lines.map((line, k) => {
9572
+ const style = n.styles[k] ?? TYPE.boxName;
9573
+ const cls = style === TYPE.treeHash ? "dg-tree-hash" : style === TYPE.treeName ? "dg-tree-name" : style === TYPE.rootHash ? "dg-tree-rh" : style === TYPE.rootName ? "dg-tree-rn" : "dg-tree-one";
9574
+ const baseline = n.baselines[k] ?? n.cy;
9575
+ return n.root ? write(ctx.ink, cls, n.x + T.root.textX, baseline, line, style, shown) : write(ctx.ink, cls, n.cx, baseline, line, style, shown, "middle");
9576
+ }).join("");
9577
+ const inner = faded(n.id, `${frame}${mark}${texts}`, ` data-tree-node="${esc(n.id)}"${n.root ? ` data-tree-root="${esc(n.id)}"` : ""}`);
9578
+ return `<g class="dg-popc dg-a" style="${cs(n.color)};${m.pop(at2)}">${inner}</g>`;
9579
+ }).join("");
9580
+ return { links: links + ties, trails, nodes: cards + nodes };
9581
+ }
9582
+
8472
9583
  // src/render/motion.ts
8473
9584
  var r2 = (v) => Math.round(v * 100) / 100;
8474
9585
  var Motion = class {
@@ -8520,8 +9631,8 @@ var Motion = class {
8520
9631
  ]);
8521
9632
  }
8522
9633
  /** 少し下から浮いて出る。 */
8523
- rise(a, b = this.last, within = false) {
8524
- return this.vis(a, b, { on: { transform: "translateY(0)" }, off: { transform: `translateY(${LOOK.rise}px)` }, within });
9634
+ rise(a, b = this.last, within2 = false) {
9635
+ return this.vis(a, b, { on: { transform: "translateY(0)" }, off: { transform: `translateY(${LOOK.rise}px)` }, within: within2 });
8525
9636
  }
8526
9637
  /** 小さな所から弾んで出る。 */
8527
9638
  pop(a, b = this.last) {
@@ -8647,6 +9758,19 @@ var PART_CSS = [
8647
9758
  `.dg-git-n{${font(TYPE.gitNote)};fill:var(--ink2)}`,
8648
9759
  `.dg-git-old{fill:var(--surf);stroke:var(--c);stroke-width:${S.gitOrphan};stroke-dasharray:3 3;stroke-opacity:.6}`,
8649
9760
  `.dg-git-oldl{${font(TYPE.gitId)};fill:var(--ct);opacity:.55}`,
9761
+ // 木の図 (#3233)。木の線は線の灰で、運ぶ物が通った跡は運ぶ物の色で引く
9762
+ `.dg-tree-l{fill:none;stroke:var(--line);stroke-width:${S.tree};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,
9763
+ `.dg-tree-tr{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,
9764
+ `.dg-tree-h{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round}`,
9765
+ `.dg-tree-con{fill:none;stroke:var(--line);stroke-width:${S.treeCon};stroke-linecap:round;stroke-dasharray:2 3.5}`,
9766
+ `.dg-tree-card{fill:var(--surf);stroke:var(--hair);stroke-width:${S.hair}}`,
9767
+ `.dg-tree-cg{fill:none;stroke:var(--mute);stroke-width:${S.glyph};stroke-linecap:round;stroke-linejoin:round}`,
9768
+ `.dg-tree-ct{${font(TYPE.treeCard)};fill:var(--ink)}`,
9769
+ `.dg-tree-hash{${font(TYPE.treeHash)};fill:var(--ink)}`,
9770
+ `.dg-tree-name{${font(TYPE.treeName)};fill:var(--mute)}`,
9771
+ `.dg-tree-one{${font(TYPE.boxName)};fill:var(--ink)}`,
9772
+ `.dg-tree-rh{${font(TYPE.rootHash)};fill:var(--ink)}`,
9773
+ `.dg-tree-rn{${font(TYPE.rootName)};fill:var(--mute)}`,
8650
9774
  // 時間軸の図 (#3165)。和文を含む字は、末尾に j を付けた class で同じ大きさと太さの和文の字にする
8651
9775
  `.dg-tm-ep{fill:color-mix(in srgb,var(--ink) ${X.timeShade}%,transparent)}`,
8652
9776
  `.dg-tm-sep{stroke:var(--hair);stroke-width:${S.hair};stroke-dasharray:2 4}`,
@@ -8808,6 +9932,14 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
8808
9932
  L.node.push(git.commits);
8809
9933
  L.top.push(git.tags);
8810
9934
  }
9935
+ const treeLayout = isTreeLayout(layout) ? layout : void 0;
9936
+ if (treeLayout) {
9937
+ const tree = drawTree(treeLayout, diagram, timeline, ctx);
9938
+ L.base.push(tree.links);
9939
+ L.lit.push(tree.trails);
9940
+ L.node.push(tree.nodes);
9941
+ }
9942
+ const runs = new Set((treeLayout?.runs ?? []).map((r) => `${r.step}/${r.event}`));
8811
9943
  const timeLayout = isTimeLayout(layout) ? layout : void 0;
8812
9944
  if (timeLayout) {
8813
9945
  const drawn = drawTime(timeLayout, diagram, timeline, ctx, subs);
@@ -8819,7 +9951,7 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
8819
9951
  const wired = new Set((timeLayout?.wires ?? []).map((w) => `${w.step}/${w.event}`));
8820
9952
  for (const e of layout.edges) {
8821
9953
  const time = timeline.edges.find((t) => t.step === e.step && t.event === e.event);
8822
- if (!time || timeLayout && !wired.has(`${e.step}/${e.event}`)) continue;
9954
+ if (!time || timeLayout && !wired.has(`${e.step}/${e.event}`) || runs.has(`${e.step}/${e.event}`)) continue;
8823
9955
  const drawn = edge(e, time, ctx, isState);
8824
9956
  L.base.push(drawn.base);
8825
9957
  L.lit.push(drawn.lit);
@@ -8850,7 +9982,7 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
8850
9982
  }
8851
9983
  for (const time of timeline.carriers) {
8852
9984
  const e = layout.edges.find((x) => x.step === time.step && x.event === time.event);
8853
- if (e) L.top.push(carrier(e, time, ctx));
9985
+ if (e) L.top.push(carrier(e, treeLayout ? { ...time, start: time.depart, end: time.arrive + MOTION.fade } : time, ctx));
8854
9986
  }
8855
9987
  const content = Object.values(L).map((parts) => parts.join("")).join("");
8856
9988
  const { near, far, nearY, farY } = LOOK.shadow;
@@ -8888,6 +10020,15 @@ function focusParts(layout, diagram, step) {
8888
10020
  rects.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });
8889
10021
  }
8890
10022
  rects.push(...layout.labels.filter((l) => l.step === step), ...layout.actions.filter((a) => a.step === step));
10023
+ if (isTreeLayout(layout)) {
10024
+ const ends = new Set((diagram.steps[step]?.events ?? []).flatMap((e) => e.type === "edge" ? [e.from, e.to] : []));
10025
+ rects.push(...layout.nodes.filter((n) => n.step === step || ends.has(n.id)));
10026
+ for (const l of layout.links.filter((x) => x.step === step)) {
10027
+ const xs = l.points.map((p) => p[0]);
10028
+ const ys = l.points.map((p) => p[1]);
10029
+ rects.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });
10030
+ }
10031
+ }
8891
10032
  for (const event of diagram.steps[step]?.events ?? []) {
8892
10033
  const ids = event.type === "edge" ? [event.from, event.to] : event.type === "action" || event.type === "swap" ? [event.box] : [];
8893
10034
  for (const id of ids) {
@@ -8960,7 +10101,8 @@ function followView(layout, timeline, diagram, m, id, content, follow, heads) {
8960
10101
  const overview = () => {
8961
10102
  const shapes = [
8962
10103
  ...layout.regions.map((r3) => `<rect class="dg-mm-band" style="${cs(r3.color)}" x="${mx + r3.x * k}" y="${my + r3.y * k}" width="${r3.w * k}" height="${r3.h * k}" rx="3"/>`),
8963
- ...layout.boxes.map((b) => `<rect class="dg-mm-card" style="${cs(b.color)}" x="${mx + b.x * k}" y="${my + b.y * k}" width="${b.w * k}" height="${b.h * k}" rx="1.5"/>`)
10104
+ ...layout.boxes.map((b) => `<rect class="dg-mm-card" style="${cs(b.color)}" x="${mx + b.x * k}" y="${my + b.y * k}" width="${b.w * k}" height="${b.h * k}" rx="1.5"/>`),
10105
+ ...(isTreeLayout(layout) ? layout.nodes : []).map((n) => `<rect class="dg-mm-card" style="${cs(n.color)}" x="${mx + n.x * k}" y="${my + n.y * k}" width="${n.w * k}" height="${n.h * k}" rx="1.5"/>`)
8964
10106
  ].join("");
8965
10107
  const vp = m.move(cam.map(([t, cx, cy, , e]) => [t, mx + (cx - vw / 2) * k, my + (cy - vh / 2) * k, 1, e]));
8966
10108
  return {
@@ -8986,7 +10128,7 @@ function renderDiagram(input, options = {}) {
8986
10128
  const read2 = readDiagram(input, { lang });
8987
10129
  if (!read2.ok) throw new Error(FIGURE_TEXT[lang].cannotDraw(read2.errors.map((e) => `${e.pointer} ${e.message}`).join(" / ")));
8988
10130
  const diagram = read2.diagram;
8989
- const layout = diagram.kind === "sequence" ? layoutSequence(diagram) : diagram.kind === "state" ? layoutState(diagram, lang) : diagram.kind === "git" ? layoutGit(diagram) : diagram.kind === "time" ? layoutTime(diagram, lang) : layoutArchitecture(diagram);
10131
+ const layout = diagram.kind === "sequence" ? layoutSequence(diagram) : diagram.kind === "state" ? layoutState(diagram, lang) : diagram.kind === "git" ? layoutGit(diagram) : diagram.kind === "time" ? layoutTime(diagram, lang) : diagram.kind === "tree" ? layoutTree(diagram) : layoutArchitecture(diagram);
8990
10132
  return renderLayout(diagram, layout, buildTimeline(diagram, options.still === true), options);
8991
10133
  }
8992
10134
  function renderLayout(diagram, layout, timeline, options = {}) {
@@ -9068,11 +10210,11 @@ async function stage(browser, svg, fontCss, body, lang) {
9068
10210
  const page = await browser.newPage({ viewport: { width, height }, deviceScaleFactor: SCALE });
9069
10211
  const paused = svg.replace(/^<svg\b/, '<svg style="--play:paused;--at:0"');
9070
10212
  const html = `<!doctype html><html><head><meta charset="utf-8"><style>${fontCss}html,body{margin:0}body{${body}}svg{display:block}</style><script type="module">import * as mb from "/mediabunny.js";import * as gif from "/gifenc.js";window.__tools={mb,gif};</script></head><body>${paused}</body></html>`;
9071
- await page.route("http://localhost/**", async (route) => {
9072
- const path2 = new URL(route.request().url()).pathname;
9073
- if (path2 === "/") return route.fulfill({ contentType: "text/html; charset=utf-8", body: html });
10213
+ await page.route("http://localhost/**", async (route2) => {
10214
+ const path2 = new URL(route2.request().url()).pathname;
10215
+ if (path2 === "/") return route2.fulfill({ contentType: "text/html; charset=utf-8", body: html });
9074
10216
  const script = SCRIPTS[path2];
9075
- return script ? route.fulfill({ contentType: "text/javascript", body: readFileSync(script) }) : route.fulfill({ status: 404 });
10217
+ return script ? route2.fulfill({ contentType: "text/javascript", body: readFileSync(script) }) : route2.fulfill({ status: 404 });
9076
10218
  });
9077
10219
  await page.goto("http://localhost/");
9078
10220
  await page.waitForFunction(() => "__tools" in window);
@@ -9247,6 +10389,10 @@ function ranges(list2) {
9247
10389
  });
9248
10390
  }
9249
10391
  var hex = (code) => `U+${code.toString(16).toUpperCase()}`;
10392
+ function within(span, char) {
10393
+ const code = char.codePointAt(0) ?? -1;
10394
+ return span.some(([from, to]) => code >= from && code <= to);
10395
+ }
9250
10396
  var shapeless = (char) => /^[\s\p{Cf}\p{Cc}]$/u.test(char);
9251
10397
  function shapedIn(span) {
9252
10398
  for (const [from, to] of span) {
@@ -9265,12 +10411,9 @@ async function fontFaces(chars) {
9265
10411
  PACKAGES.flatMap(({ family, name }) => {
9266
10412
  const base = dirname(require_2.resolve(`@fontsource-variable/${name}/unicode.json`));
9267
10413
  const table = JSON.parse(readFileSync(join$1(base, "unicode.json"), "utf8"));
9268
- return Object.entries(table).map(async ([key, list2]) => {
9269
- const span = ranges(list2);
9270
- const own = chars.filter((char) => {
9271
- const code = char.codePointAt(0) ?? -1;
9272
- return span.some(([from, to]) => code >= from && code <= to);
9273
- });
10414
+ const spans = Object.entries(table).map(([key, list2]) => ({ key, span: ranges(list2) }));
10415
+ return spans.map(async ({ key, span }, index) => {
10416
+ const own = chars.filter((char) => within(span, char) && !spans.slice(index + 1).some((later) => within(later.span, char)));
9274
10417
  if (!own.length) return "";
9275
10418
  const filler = own.every(shapeless) ? shapedIn(span) ?? "" : "";
9276
10419
  const file = join$1(base, "files", `${name}-${key.replace(/[[\]]/g, "")}-wght-normal.woff2`);
@@ -9413,7 +10556,7 @@ var ja3 = () => {
9413
10556
  emptyCode: "code \u306E\u5F8C\u308D\u306B\u547D\u4EE4\u3092\u66F8\u304F",
9414
10557
  sourceShape: "source \u306F source <\u540D\u524D> [url: <URL>] \u306E\u5F62\u3067\u66F8\u304F",
9415
10558
  declarationInStep: "group \u3068 box \u3068 strip \u3068 branch \u3068\u3001scale \u3068 period \u3068 row \u3068 point \u3068 zoom \u306F\u6700\u521D\u306E step \u3088\u308A\u524D\u306B\u66F8\u304F",
9416
- stepLineBeforeStep: "\u7DDA\u3068 say \u3068 code \u3068 source \u3068 act \u3068 note \u3068 set \u3068 commit \u3068\u679D\u3092\u5207\u308B\u884C\u3068\u3001now \u3068 mark \u3068 span \u306E\u884C\u306F step \u306E\u4E0B\u306B\u66F8\u304F",
10559
+ stepLineBeforeStep: "\u7DDA\u3068 say \u3068 code \u3068 source \u3068 act \u3068 note \u3068 set \u3068 commit \u3068\u679D\u3092\u5207\u308B\u884C\u3068\u3001now \u3068 mark \u3068 span \u3068\u3001leaf \u3068 node \u306E\u884C\u306F step \u306E\u4E0B\u306B\u66F8\u304F",
9417
10560
  nestedGroup: "group \u306E\u4E2D\u306B group \u306F\u66F8\u3051\u306A\u3044\u3002\u5148\u306B end \u3067\u9589\u3058\u308B",
9418
10561
  strayEnd: "end \u306E\u524D\u306B\u3001\u9589\u3058\u308B group \u304C\u7121\u3044",
9419
10562
  endTakesNothing: "end \u306E\u5F8C\u308D\u306B\u306F\u4F55\u3082\u66F8\u304B\u306A\u3044",
@@ -9461,6 +10604,15 @@ var ja3 = () => {
9461
10604
  headReserved: (name) => `${name} \u306F\u679D\u5206\u304B\u308C\u306E\u56F3\u3067\u4ECA\u3044\u308B\u5834\u6240\u306E\u672D\u306E\u540D\u524D\u3067\u3001\u540D\u672D\u306B\u4F7F\u3048\u306A\u3044`,
9462
10605
  badHash: "hash \u306F 0 \u304B\u3089 9 \u3068 a \u304B\u3089 f \u306E\u5B57\u3067 4 \u304B\u3089 40 \u5B57\u306B\u3059\u308B",
9463
10606
  timeOnly: (word) => `${word} \u306F time (\u6642\u9593\u8EF8\u306E\u56F3) \u3067\u3060\u3051\u66F8\u3051\u308B`,
10607
+ treeOnly: (word) => `${word} \u306E\u884C\u306F tree (\u6728\u306E\u56F3) \u3067\u3060\u3051\u66F8\u3051\u308B`,
10608
+ treeNoGroup: "tree (\u6728\u306E\u56F3) \u306B\u306F group \u3092\u66F8\u3051\u306A\u3044\u3002\u6728\u306E\u7BB1\u306F leaf \u3068 node \u306E\u884C\u3067\u66F8\u304F",
10609
+ noLeaves: "leaf \u306E\u884C\u3067\u8449\u3092 1 \u3064\u4EE5\u4E0A\u66F8\u304F",
10610
+ leafShape: "leaf \u306F leaf <\u540D\u672D> [hash: <hash>] \u306E\u5F62\u3067\u66F8\u304F",
10611
+ nodeShape: "node \u306F node <\u540D\u672D> of <\u5B50>, <\u5B50> [hash: <hash>] \u306E\u5F62\u3067\u66F8\u304F",
10612
+ noTreeChild: (id) => `${id} \u3068\u3044\u3046\u8449\u304B\u89AA\u306F\u307E\u3060\u66F8\u3044\u3066\u3044\u306A\u3044\u3002\u5B50\u306F\u524D\u306B leaf \u304B node \u3067\u66F8\u3044\u305F\u540D\u672D\u306B\u3059\u308B`,
10613
+ notTreeBox: (id) => `${id} \u306F box \u306E\u884C\u3067\u7F6E\u3044\u305F\u7BB1\u3067\u3001\u6728\u306E\u7BB1\u3067\u306A\u3044\u3002\u5B50\u306F leaf \u304B node \u3067\u66F8\u3044\u305F\u540D\u672D\u306B\u3059\u308B`,
10614
+ twoParents: (id) => `${id} \u306F\u3082\u3046\u5225\u306E\u89AA\u306E\u5B50\u306B\u306A\u3063\u3066\u3044\u308B\u3002\u6728\u306E\u7BB1\u306E\u89AA\u306F 1 \u3064\u3060\u3051`,
10615
+ manyRoots: (id, root) => `${id} \u304C\u89AA\u3092\u6301\u305F\u306A\u3044\u307E\u307E\u6B8B\u308B\u3002\u6728\u306E\u6839\u306F 1 \u3064\u3060\u3051\u3067\u3001${id} \u3082 ${root} \u3082\u6700\u5F8C\u306B 1 \u3064\u306E\u6839\u3078\u7D44\u3080`,
9464
10616
  timeTwice: (word) => `${word} \u306F 1 \u3064\u3060\u3051\u5BA3\u8A00\u3059\u308B`,
9465
10617
  noScale: "scale \u306E\u884C\u3067\u76EE\u76DB\u308A\u3092\u5BA3\u8A00\u3059\u308B",
9466
10618
  noRows: "row \u306E\u884C\u3067\u5370\u306E\u5217\u3092 1 \u3064\u4EE5\u4E0A\u5BA3\u8A00\u3059\u308B",
@@ -9526,7 +10678,7 @@ var en2 = () => {
9526
10678
  emptyCode: "Write the command after code",
9527
10679
  sourceShape: "Write a source as source <name> [url: <URL>]",
9528
10680
  declarationInStep: "Write group, box, strip, branch, scale, period, row, point and zoom before the first step",
9529
- stepLineBeforeStep: "Write lines, say, code, source, act, note, set, commit, branch cuts, now, mark and span under a step",
10681
+ stepLineBeforeStep: "Write lines, say, code, source, act, note, set, commit, branch cuts, now, mark, span, leaf and node under a step",
9530
10682
  nestedGroup: "A group cannot hold another group. Close it with end first",
9531
10683
  strayEnd: "There is no group for this end to close",
9532
10684
  endTakesNothing: "Write nothing after end",
@@ -9574,6 +10726,15 @@ var en2 = () => {
9574
10726
  headReserved: (name) => `${name} names where you are in a git diagram and cannot be an id`,
9575
10727
  badHash: "Write a hash as 4 to 40 characters of 0-9 and a-f",
9576
10728
  timeOnly: (word) => `${word} can be written only in time diagrams`,
10729
+ treeOnly: (word) => `${word} lines can be written only in tree diagrams`,
10730
+ treeNoGroup: "A tree diagram takes no group. Write the tree boxes with leaf and node lines",
10731
+ noLeaves: "Write at least one leaf with a leaf line",
10732
+ leafShape: "Write a leaf as leaf <id> [hash: <hash>]",
10733
+ nodeShape: "Write a node as node <id> of <child>, <child> [hash: <hash>]",
10734
+ noTreeChild: (id) => `No leaf or node named ${id} has been written yet. A child must be an id written earlier with leaf or node`,
10735
+ notTreeBox: (id) => `${id} is a box from a box line, not a tree box. A child must be an id written with leaf or node`,
10736
+ twoParents: (id) => `${id} is already a child of another node. A tree box has only one parent`,
10737
+ manyRoots: (id, root) => `${id} is left without a parent. A tree has one root, so join ${id} and ${root} under one root by the end`,
9577
10738
  timeTwice: (word) => `Declare only one ${word}`,
9578
10739
  noScale: "Declare the scale with a scale line",
9579
10740
  noRows: "Declare at least one row with a row line",
@@ -9634,6 +10795,8 @@ var ID = /^[^\s[\]「」=:]+$/u;
9634
10795
  var EDGE = /^([^\s:[\]]+?)\s*->\s*([^\s:[\]]+)/du;
9635
10796
  var COMMIT = new RegExp(`^commit\\s+([^\\s[]+)(?:\\s+${ON}\\s+([^\\s[]+))?(?:\\s+${COPY}\\s+([^\\s[]+))?(?:\\s+${MERGE}\\s+([^\\s[]+))?`, "du");
9636
10797
  var CUT = new RegExp(`^([^\\s[]+)\\s+${FROM}(?:\\s+([^\\s[]+))?\\s*$`, "du");
10798
+ var LEAF = /^leaf\s+([^\s[]+)/du;
10799
+ var NODE = new RegExp(`^node\\s+([^\\s[]+)\\s+${OF}\\s+`, "du");
9637
10800
  var HASH = /^[0-9a-f]{4,40}$/u;
9638
10801
  var URL_FORM = /^(\/|https?:\/\/)/u;
9639
10802
  var SCALE2 = /^scale\s+(\S+)\s+(\S+)\s+([^\s[]+)/du;
@@ -9799,6 +10962,9 @@ function parseLines(lines, m) {
9799
10962
  const isState = kind === "state";
9800
10963
  const isGit = kind === "git";
9801
10964
  const isTime = kind === "time";
10965
+ const isTree = kind === "tree";
10966
+ const trees = /* @__PURE__ */ new Map();
10967
+ const parents = /* @__PURE__ */ new Map();
9802
10968
  let scale;
9803
10969
  let period;
9804
10970
  const rows = [];
@@ -9846,6 +11012,7 @@ function parseLines(lines, m) {
9846
11012
  if (!boxes.some((box) => box.id === id) && !points.some((point) => point.id === id)) throw fail(source, at2, m.undeclaredNote(id));
9847
11013
  return id;
9848
11014
  }
11015
+ if (isTree && trees.has(id)) return id;
9849
11016
  if (!isState || !isOneOf(STATE_ENDS, id)) return boxAt(source, id, at2);
9850
11017
  if (id === "start" !== (side2 === "from")) throw fail(source, at2, id === "start" ? m.intoStart : m.outOfFinish);
9851
11018
  return id;
@@ -9896,6 +11063,7 @@ function parseLines(lines, m) {
9896
11063
  }
9897
11064
  if (!isGit && (word === "branch" || word === "commit")) throw fail(source, 0, m.gitOnly(word));
9898
11065
  if (!isTime && isOneOf(TIME_HEADS, word)) throw fail(source, 0, m.timeOnly(word));
11066
+ if (!isTree && isOneOf(TREE_HEADS, word)) throw fail(source, 0, m.treeOnly(word));
9899
11067
  if (!isOneOf(HEADS, word)) {
9900
11068
  const old = oldForm(text2, building !== void 0);
9901
11069
  throw fail(source, 0, old ? m.oldForm(old.word, old.shape) : m.unknownHead(word));
@@ -9986,14 +11154,29 @@ function parseLines(lines, m) {
9986
11154
  case "span":
9987
11155
  inStep(source).events.push(readSpan(source));
9988
11156
  break;
11157
+ case "leaf": {
11158
+ const step = inStep(source);
11159
+ step.events.push(readLeaf(source));
11160
+ break;
11161
+ }
11162
+ case "node": {
11163
+ const step = inStep(source);
11164
+ step.events.push(readNode(source));
11165
+ break;
11166
+ }
9989
11167
  }
9990
11168
  }
9991
11169
  if (group) throw fail(group.source, 0, m.unclosedGroup(group.id));
9992
11170
  settle();
9993
11171
  finish();
9994
11172
  if (isGit && branches.length === 0) throw fail(head, 0, m.noBranches);
9995
- if (boxes.length === 0 && !isGit && !isTime) throw fail(head, 0, m.noBoxes);
11173
+ if (isTree && trees.size === 0) throw fail(head, 0, m.noLeaves);
11174
+ if (boxes.length === 0 && !isGit && !isTime && !isTree) throw fail(head, 0, m.noBoxes);
9996
11175
  if (steps.length === 0) throw fail(head, 0, m.noSteps);
11176
+ const roots = [...trees.keys()].filter((id) => !parents.has(id));
11177
+ const [root, stray] = roots;
11178
+ const strayAt = stray === void 0 ? void 0 : trees.get(stray);
11179
+ if (root !== void 0 && stray !== void 0 && strayAt) throw fail(strayAt.source, strayAt.at, m.manyRoots(stray, root));
9997
11180
  return {
9998
11181
  version: FORMAT_VERSION,
9999
11182
  kind,
@@ -10174,6 +11357,7 @@ function parseLines(lines, m) {
10174
11357
  function readGroup(source) {
10175
11358
  beforeSteps(source);
10176
11359
  if (isGit) throw fail(source, 0, m.gitNoGroup);
11360
+ if (isTree) throw fail(source, 0, m.treeNoGroup);
10177
11361
  if (group) throw fail(source, 0, m.nestedGroup);
10178
11362
  const declared = readDeclared(source, "group", ATTRS.group, m);
10179
11363
  if (regions.some((region) => region.id === declared.id)) {
@@ -10268,6 +11452,53 @@ function parseLines(lines, m) {
10268
11452
  tips.set(branch, from);
10269
11453
  return { type: "branch", branch, from };
10270
11454
  }
11455
+ function readLeaf(source) {
11456
+ const text2 = source.text;
11457
+ const found = LEAF.exec(text2);
11458
+ const id = found?.[1];
11459
+ if (!found || id === void 0) throw fail(source, 0, m.leafShape);
11460
+ const idAt = found.indices?.[1]?.[0] ?? 0;
11461
+ if (!ID.test(id)) throw fail(source, idAt, m.badId(id));
11462
+ declare(source, id, idAt);
11463
+ trees.set(id, { source, at: idAt });
11464
+ const rest2 = skipSpaces(text2, found[0].length);
11465
+ if (rest2 < text2.length && text2[rest2] !== "[") throw fail(source, rest2, m.leafShape);
11466
+ const hash = treeHash(source, rest2, ATTRS.leaf);
11467
+ return { type: "leaf", id, ...hash !== void 0 ? { hash } : {} };
11468
+ }
11469
+ function readNode(source) {
11470
+ const text2 = source.text;
11471
+ const found = NODE.exec(text2);
11472
+ const id = found?.[1];
11473
+ if (!found || id === void 0) throw fail(source, 0, m.nodeShape);
11474
+ const idAt = found.indices?.[1]?.[0] ?? 0;
11475
+ if (!ID.test(id)) throw fail(source, idAt, m.badId(id));
11476
+ declare(source, id, idAt);
11477
+ const children = [];
11478
+ let end = found[0].length;
11479
+ for (; ; ) {
11480
+ const start = skipSpaces(text2, end);
11481
+ end = start;
11482
+ while (end < text2.length && text2[end] !== "," && text2[end] !== "[") end++;
11483
+ const child = text2.slice(start, end).trim();
11484
+ if (child === "" || !ID.test(child)) throw fail(source, start, m.nodeShape);
11485
+ if (!trees.has(child)) throw fail(source, start, ids.has(child) && child !== id ? m.notTreeBox(child) : m.noTreeChild(child));
11486
+ if (parents.has(child)) throw fail(source, start, m.twoParents(child));
11487
+ parents.set(child, id);
11488
+ children.push(child);
11489
+ if (text2[end] !== ",") break;
11490
+ end++;
11491
+ }
11492
+ const hash = treeHash(source, end, ATTRS.node);
11493
+ trees.set(id, { source, at: idAt });
11494
+ return { type: "node", id, children, ...hash !== void 0 ? { hash } : {} };
11495
+ }
11496
+ function treeHash(source, at2, keys2) {
11497
+ if (at2 >= source.text.length) return void 0;
11498
+ const hash = readAttrs(source, at2, keys2, m).get("hash");
11499
+ if (hash && !HASH.test(hash.value)) throw fail(source, hash.at, m.badHash);
11500
+ return hash?.value;
11501
+ }
10271
11502
  function readStrip(source) {
10272
11503
  beforeSteps(source);
10273
11504
  if (strip2) throw fail(source, 0, m.stripTwice);