@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/index.js CHANGED
@@ -95,7 +95,7 @@ function ucs2length(str) {
95
95
  return length;
96
96
  }
97
97
  var validate_diagram_default = validate10;
98
- 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" } }};
98
+ 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" } }};
99
99
  function validate11(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
100
100
  let vErrors = null;
101
101
  let errors = 0;
@@ -155,34 +155,79 @@ function validate11(data, { instancePath = "", parentData, parentDataProperty, r
155
155
  }
156
156
  }
157
157
  }
158
+ const _errs8 = errors;
159
+ const _errs9 = errors;
160
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
161
+ if (data2.type === void 0 && ("type")) {
162
+ const err3 = {};
163
+ if (vErrors === null) {
164
+ vErrors = [err3];
165
+ } else {
166
+ vErrors.push(err3);
167
+ }
168
+ errors++;
169
+ } else {
170
+ if (data2.type !== void 0) {
171
+ let data4 = data2.type;
172
+ if (!(data4 === "leaf" || data4 === "node")) {
173
+ const err4 = {};
174
+ if (vErrors === null) {
175
+ vErrors = [err4];
176
+ } else {
177
+ vErrors.push(err4);
178
+ }
179
+ errors++;
180
+ }
181
+ }
182
+ }
183
+ }
184
+ var valid9 = _errs9 === errors;
185
+ if (valid9) {
186
+ const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
187
+ if (vErrors === null) {
188
+ vErrors = [err5];
189
+ } else {
190
+ vErrors.push(err5);
191
+ }
192
+ errors++;
193
+ } else {
194
+ errors = _errs8;
195
+ if (vErrors !== null) {
196
+ if (_errs8) {
197
+ vErrors.length = _errs8;
198
+ } else {
199
+ vErrors = null;
200
+ }
201
+ }
202
+ }
158
203
  if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
159
204
  if (data2.type !== void 0) {
160
- let data4 = data2.type;
161
- const _errs8 = errors;
162
- const _errs9 = errors;
163
- if (!(data4 === "commit" || data4 === "branch")) {
164
- const err3 = {};
205
+ let data5 = data2.type;
206
+ const _errs13 = errors;
207
+ const _errs14 = errors;
208
+ if (!(data5 === "commit" || data5 === "branch")) {
209
+ const err6 = {};
165
210
  if (vErrors === null) {
166
- vErrors = [err3];
211
+ vErrors = [err6];
167
212
  } else {
168
- vErrors.push(err3);
213
+ vErrors.push(err6);
169
214
  }
170
215
  errors++;
171
216
  }
172
- var valid9 = _errs9 === errors;
173
- if (valid9) {
174
- const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
217
+ var valid13 = _errs14 === errors;
218
+ if (valid13) {
219
+ const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
175
220
  if (vErrors === null) {
176
- vErrors = [err4];
221
+ vErrors = [err7];
177
222
  } else {
178
- vErrors.push(err4);
223
+ vErrors.push(err7);
179
224
  }
180
225
  errors++;
181
226
  } else {
182
- errors = _errs8;
227
+ errors = _errs13;
183
228
  if (vErrors !== null) {
184
- if (_errs8) {
185
- vErrors.length = _errs8;
229
+ if (_errs13) {
230
+ vErrors.length = _errs13;
186
231
  } else {
187
232
  vErrors = null;
188
233
  }
@@ -190,29 +235,29 @@ function validate11(data, { instancePath = "", parentData, parentDataProperty, r
190
235
  }
191
236
  }
192
237
  if (data2.at !== void 0) {
193
- const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
238
+ const err8 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
194
239
  if (vErrors === null) {
195
- vErrors = [err5];
240
+ vErrors = [err8];
196
241
  } else {
197
- vErrors.push(err5);
242
+ vErrors.push(err8);
198
243
  }
199
244
  errors++;
200
245
  }
201
246
  if (data2.into !== void 0) {
202
- const err6 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
247
+ const err9 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
203
248
  if (vErrors === null) {
204
- vErrors = [err6];
249
+ vErrors = [err9];
205
250
  } else {
206
- vErrors.push(err6);
251
+ vErrors.push(err9);
207
252
  }
208
253
  errors++;
209
254
  }
210
255
  if (data2.color !== void 0) {
211
- const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
256
+ const err10 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
212
257
  if (vErrors === null) {
213
- vErrors = [err7];
258
+ vErrors = [err10];
214
259
  } else {
215
- vErrors.push(err7);
260
+ vErrors.push(err10);
216
261
  }
217
262
  errors++;
218
263
  }
@@ -302,31 +347,309 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
302
347
  }
303
348
  }
304
349
  }
350
+ const _errs8 = errors;
351
+ const _errs9 = errors;
305
352
  if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
306
- if (data2.at !== void 0) {
307
- const err3 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
353
+ if (data2.type === void 0 && ("type")) {
354
+ const err3 = {};
308
355
  if (vErrors === null) {
309
356
  vErrors = [err3];
310
357
  } else {
311
358
  vErrors.push(err3);
312
359
  }
313
360
  errors++;
361
+ } else {
362
+ if (data2.type !== void 0) {
363
+ let data4 = data2.type;
364
+ if (!(data4 === "leaf" || data4 === "node")) {
365
+ const err4 = {};
366
+ if (vErrors === null) {
367
+ vErrors = [err4];
368
+ } else {
369
+ vErrors.push(err4);
370
+ }
371
+ errors++;
372
+ }
373
+ }
374
+ }
375
+ }
376
+ var valid9 = _errs9 === errors;
377
+ if (valid9) {
378
+ const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
379
+ if (vErrors === null) {
380
+ vErrors = [err5];
381
+ } else {
382
+ vErrors.push(err5);
383
+ }
384
+ errors++;
385
+ } else {
386
+ errors = _errs8;
387
+ if (vErrors !== null) {
388
+ if (_errs8) {
389
+ vErrors.length = _errs8;
390
+ } else {
391
+ vErrors = null;
392
+ }
393
+ }
394
+ }
395
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
396
+ if (data2.at !== void 0) {
397
+ const err6 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
398
+ if (vErrors === null) {
399
+ vErrors = [err6];
400
+ } else {
401
+ vErrors.push(err6);
402
+ }
403
+ errors++;
314
404
  }
315
405
  if (data2.into !== void 0) {
316
- const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
406
+ const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
317
407
  if (vErrors === null) {
318
- vErrors = [err4];
408
+ vErrors = [err7];
319
409
  } else {
320
- vErrors.push(err4);
410
+ vErrors.push(err7);
321
411
  }
322
412
  errors++;
323
413
  }
324
414
  if (data2.color !== void 0) {
325
- const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
415
+ const err8 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
416
+ if (vErrors === null) {
417
+ vErrors = [err8];
418
+ } else {
419
+ vErrors.push(err8);
420
+ }
421
+ errors++;
422
+ }
423
+ }
424
+ }
425
+ }
426
+ }
427
+ }
428
+ }
429
+ }
430
+ validate17.errors = vErrors;
431
+ return errors === 0;
432
+ }
433
+ function validate20(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
434
+ let vErrors = null;
435
+ let errors = 0;
436
+ if (Array.isArray(data)) {
437
+ const len0 = data.length;
438
+ for (let i0 = 0; i0 < len0; i0++) {
439
+ let data0 = data[i0];
440
+ if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
441
+ if (data0.events !== void 0) {
442
+ let data1 = data0.events;
443
+ if (Array.isArray(data1)) {
444
+ const len1 = data1.length;
445
+ for (let i1 = 0; i1 < len1; i1++) {
446
+ let data2 = data1[i1];
447
+ const _errs4 = errors;
448
+ const _errs5 = errors;
449
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
450
+ if (data2.type === void 0 && ("type")) {
451
+ const err0 = {};
452
+ if (vErrors === null) {
453
+ vErrors = [err0];
454
+ } else {
455
+ vErrors.push(err0);
456
+ }
457
+ errors++;
458
+ } else {
459
+ if (data2.type !== void 0) {
460
+ let data3 = data2.type;
461
+ if (!(data3 === "leaf" || data3 === "node")) {
462
+ const err1 = {};
463
+ if (vErrors === null) {
464
+ vErrors = [err1];
465
+ } else {
466
+ vErrors.push(err1);
467
+ }
468
+ errors++;
469
+ }
470
+ }
471
+ }
472
+ }
473
+ var valid6 = _errs5 === errors;
474
+ if (valid6) {
475
+ const err2 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
476
+ if (vErrors === null) {
477
+ vErrors = [err2];
478
+ } else {
479
+ vErrors.push(err2);
480
+ }
481
+ errors++;
482
+ } else {
483
+ errors = _errs4;
484
+ if (vErrors !== null) {
485
+ if (_errs4) {
486
+ vErrors.length = _errs4;
487
+ } else {
488
+ vErrors = null;
489
+ }
490
+ }
491
+ }
492
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
493
+ if (data2.type !== void 0) {
494
+ let data4 = data2.type;
495
+ const _errs9 = errors;
496
+ const _errs10 = errors;
497
+ if (!(data4 === "commit" || data4 === "branch")) {
498
+ const err3 = {};
499
+ if (vErrors === null) {
500
+ vErrors = [err3];
501
+ } else {
502
+ vErrors.push(err3);
503
+ }
504
+ errors++;
505
+ }
506
+ var valid10 = _errs10 === errors;
507
+ if (valid10) {
508
+ const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
509
+ if (vErrors === null) {
510
+ vErrors = [err4];
511
+ } else {
512
+ vErrors.push(err4);
513
+ }
514
+ errors++;
515
+ } else {
516
+ errors = _errs9;
517
+ if (vErrors !== null) {
518
+ if (_errs9) {
519
+ vErrors.length = _errs9;
520
+ } else {
521
+ vErrors = null;
522
+ }
523
+ }
524
+ }
525
+ }
526
+ }
527
+ }
528
+ }
529
+ }
530
+ }
531
+ }
532
+ }
533
+ validate20.errors = vErrors;
534
+ return errors === 0;
535
+ }
536
+ function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
537
+ let vErrors = null;
538
+ let errors = 0;
539
+ if (Array.isArray(data)) {
540
+ const len0 = data.length;
541
+ for (let i0 = 0; i0 < len0; i0++) {
542
+ let data0 = data[i0];
543
+ if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
544
+ if (data0.events !== void 0) {
545
+ let data1 = data0.events;
546
+ if (Array.isArray(data1)) {
547
+ const len1 = data1.length;
548
+ for (let i1 = 0; i1 < len1; i1++) {
549
+ let data2 = data1[i1];
550
+ const _errs3 = errors;
551
+ const _errs4 = errors;
552
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
553
+ if (data2.type === void 0 && ("type")) {
554
+ const err0 = {};
555
+ if (vErrors === null) {
556
+ vErrors = [err0];
557
+ } else {
558
+ vErrors.push(err0);
559
+ }
560
+ errors++;
561
+ } else {
562
+ if (data2.type !== void 0) {
563
+ let data3 = data2.type;
564
+ if (!(data3 === "now" || data3 === "mark" || data3 === "span")) {
565
+ const err1 = {};
566
+ if (vErrors === null) {
567
+ vErrors = [err1];
568
+ } else {
569
+ vErrors.push(err1);
570
+ }
571
+ errors++;
572
+ }
573
+ }
574
+ }
575
+ }
576
+ var valid5 = _errs4 === errors;
577
+ if (valid5) {
578
+ const err2 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/not", keyword: "not", params: {}, message: "must NOT be valid" };
579
+ if (vErrors === null) {
580
+ vErrors = [err2];
581
+ } else {
582
+ vErrors.push(err2);
583
+ }
584
+ errors++;
585
+ } else {
586
+ errors = _errs3;
587
+ if (vErrors !== null) {
588
+ if (_errs3) {
589
+ vErrors.length = _errs3;
590
+ } else {
591
+ vErrors = null;
592
+ }
593
+ }
594
+ }
595
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
596
+ if (data2.type !== void 0) {
597
+ let data4 = data2.type;
598
+ const _errs8 = errors;
599
+ const _errs9 = errors;
600
+ if (!(data4 === "commit" || data4 === "branch")) {
601
+ const err3 = {};
602
+ if (vErrors === null) {
603
+ vErrors = [err3];
604
+ } else {
605
+ vErrors.push(err3);
606
+ }
607
+ errors++;
608
+ }
609
+ var valid9 = _errs9 === errors;
610
+ if (valid9) {
611
+ const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
612
+ if (vErrors === null) {
613
+ vErrors = [err4];
614
+ } else {
615
+ vErrors.push(err4);
616
+ }
617
+ errors++;
618
+ } else {
619
+ errors = _errs8;
620
+ if (vErrors !== null) {
621
+ if (_errs8) {
622
+ vErrors.length = _errs8;
623
+ } else {
624
+ vErrors = null;
625
+ }
626
+ }
627
+ }
628
+ }
629
+ if (data2.at !== void 0) {
630
+ const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
326
631
  if (vErrors === null) {
327
632
  vErrors = [err5];
328
633
  } else {
329
- vErrors.push(err5);
634
+ vErrors.push(err5);
635
+ }
636
+ errors++;
637
+ }
638
+ if (data2.into !== void 0) {
639
+ const err6 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
640
+ if (vErrors === null) {
641
+ vErrors = [err6];
642
+ } else {
643
+ vErrors.push(err6);
644
+ }
645
+ errors++;
646
+ }
647
+ if (data2.color !== void 0) {
648
+ const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
649
+ if (vErrors === null) {
650
+ vErrors = [err7];
651
+ } else {
652
+ vErrors.push(err7);
330
653
  }
331
654
  errors++;
332
655
  }
@@ -337,13 +660,13 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
337
660
  }
338
661
  }
339
662
  }
340
- validate17.errors = vErrors;
663
+ validate22.errors = vErrors;
341
664
  return errors === 0;
342
665
  }
343
- var schema45 = { "enum": ["blue", "amber", "green", "violet", "rose", "slate", "coin"] };
666
+ var schema57 = { "enum": ["blue", "amber", "green", "violet", "rose", "slate", "coin"] };
344
667
  var pattern0 = new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$", "u");
345
668
  var func3 = ucs2length;
346
- function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
669
+ function validate27(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
347
670
  let vErrors = null;
348
671
  let errors = 0;
349
672
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -445,7 +768,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
445
768
  if (data.color !== void 0) {
446
769
  let data3 = data.color;
447
770
  if (!(data3 === "blue" || data3 === "amber" || data3 === "green" || data3 === "violet" || data3 === "rose" || data3 === "slate" || data3 === "coin")) {
448
- 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" };
771
+ 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" };
449
772
  if (vErrors === null) {
450
773
  vErrors = [err9];
451
774
  } else {
@@ -485,11 +808,11 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
485
808
  }
486
809
  errors++;
487
810
  }
488
- validate22.errors = vErrors;
811
+ validate27.errors = vErrors;
489
812
  return errors === 0;
490
813
  }
491
814
  var pattern3 = new RegExp("^(/|https?://)", "u");
492
- function validate24(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
815
+ function validate29(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
493
816
  let vErrors = null;
494
817
  let errors = 0;
495
818
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -591,7 +914,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
591
914
  if (data.color !== void 0) {
592
915
  let data3 = data.color;
593
916
  if (!(data3 === "blue" || data3 === "amber" || data3 === "green" || data3 === "violet" || data3 === "rose" || data3 === "slate" || data3 === "coin")) {
594
- 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" };
917
+ 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" };
595
918
  if (vErrors === null) {
596
919
  vErrors = [err9];
597
920
  } else {
@@ -675,11 +998,11 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
675
998
  }
676
999
  errors++;
677
1000
  }
678
- validate24.errors = vErrors;
1001
+ validate29.errors = vErrors;
679
1002
  return errors === 0;
680
1003
  }
681
1004
  var pattern4 = new RegExp("^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$", "u");
682
- function validate27(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
1005
+ function validate32(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
683
1006
  let vErrors = null;
684
1007
  let errors = 0;
685
1008
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -765,10 +1088,10 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
765
1088
  }
766
1089
  errors++;
767
1090
  }
768
- validate27.errors = vErrors;
1091
+ validate32.errors = vErrors;
769
1092
  return errors === 0;
770
1093
  }
771
- function validate26(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
1094
+ function validate31(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
772
1095
  let vErrors = null;
773
1096
  let errors = 0;
774
1097
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -882,8 +1205,8 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
882
1205
  }
883
1206
  const len1 = data3.length;
884
1207
  for (let i1 = 0; i1 < len1; i1++) {
885
- if (!validate27(data3[i1], { instancePath: instancePath + "/meters/" + i1, parentData: data3, parentDataProperty: i1, rootData })) {
886
- vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);
1208
+ if (!validate32(data3[i1], { instancePath: instancePath + "/meters/" + i1, parentData: data3, parentDataProperty: i1, rootData })) {
1209
+ vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);
887
1210
  errors = vErrors.length;
888
1211
  }
889
1212
  }
@@ -906,10 +1229,10 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
906
1229
  }
907
1230
  errors++;
908
1231
  }
909
- validate26.errors = vErrors;
1232
+ validate31.errors = vErrors;
910
1233
  return errors === 0;
911
1234
  }
912
- function validate31(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
1235
+ function validate36(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
913
1236
  let vErrors = null;
914
1237
  let errors = 0;
915
1238
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -995,13 +1318,13 @@ function validate31(data, { instancePath = "", parentData, parentDataProperty, r
995
1318
  }
996
1319
  errors++;
997
1320
  }
998
- validate31.errors = vErrors;
1321
+ validate36.errors = vErrors;
999
1322
  return errors === 0;
1000
1323
  }
1001
- 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" } } }] };
1324
+ 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" } } }] };
1002
1325
  var pattern14 = new RegExp("^[0-9a-f]{4,40}$", "u");
1003
- var schema72 = { "properties": { "kind": { "enum": ["envelope", "tag", "coin", "none"] }}};
1004
- function validate34(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
1326
+ var schema84 = { "properties": { "kind": { "enum": ["envelope", "tag", "coin", "none"] }}};
1327
+ function validate39(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
1005
1328
  let vErrors = null;
1006
1329
  let errors = 0;
1007
1330
  const _errs1 = errors;
@@ -1127,7 +1450,7 @@ function validate34(data, { instancePath = "", parentData, parentDataProperty, r
1127
1450
  if (data.kind !== void 0) {
1128
1451
  let data1 = data.kind;
1129
1452
  if (!(data1 === "envelope" || data1 === "tag" || data1 === "coin" || data1 === "none")) {
1130
- 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" };
1453
+ 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" };
1131
1454
  if (vErrors === null) {
1132
1455
  vErrors = [err8];
1133
1456
  } else {
@@ -1167,10 +1490,10 @@ function validate34(data, { instancePath = "", parentData, parentDataProperty, r
1167
1490
  }
1168
1491
  errors++;
1169
1492
  }
1170
- validate34.errors = vErrors;
1493
+ validate39.errors = vErrors;
1171
1494
  return errors === 0;
1172
1495
  }
1173
- function validate33(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
1496
+ function validate38(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
1174
1497
  let vErrors = null;
1175
1498
  let errors = 0;
1176
1499
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -1312,15 +1635,15 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
1312
1635
  }
1313
1636
  }
1314
1637
  if (data.carry !== void 0) {
1315
- if (!validate34(data.carry, { instancePath: instancePath + "/carry", parentData: data, parentDataProperty: "carry", rootData })) {
1316
- vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);
1638
+ if (!validate39(data.carry, { instancePath: instancePath + "/carry", parentData: data, parentDataProperty: "carry", rootData })) {
1639
+ vErrors = vErrors === null ? validate39.errors : vErrors.concat(validate39.errors);
1317
1640
  errors = vErrors.length;
1318
1641
  }
1319
1642
  }
1320
1643
  if (data.labelSide !== void 0) {
1321
1644
  let data5 = data.labelSide;
1322
1645
  if (!(data5 === "above" || data5 === "below" || data5 === "left" || data5 === "right")) {
1323
- 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" };
1646
+ 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" };
1324
1647
  if (vErrors === null) {
1325
1648
  vErrors = [err13];
1326
1649
  } else {
@@ -1586,7 +1909,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
1586
1909
  if (data.color !== void 0) {
1587
1910
  let data14 = data.color;
1588
1911
  if (!(data14 === "blue" || data14 === "amber" || data14 === "green" || data14 === "violet" || data14 === "rose" || data14 === "slate" || data14 === "coin")) {
1589
- 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" };
1912
+ 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" };
1590
1913
  if (vErrors === null) {
1591
1914
  vErrors = [err38];
1592
1915
  } else {
@@ -2114,7 +2437,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
2114
2437
  if (data.color !== void 0) {
2115
2438
  let data31 = data.color;
2116
2439
  if (!(data31 === "blue" || data31 === "amber" || data31 === "green" || data31 === "violet" || data31 === "rose" || data31 === "slate" || data31 === "coin")) {
2117
- 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" };
2440
+ 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" };
2118
2441
  if (vErrors === null) {
2119
2442
  vErrors = [err88];
2120
2443
  } else {
@@ -2262,7 +2585,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
2262
2585
  }
2263
2586
  if (data.shape !== void 0) {
2264
2587
  if (!(data.shape === "box")) {
2265
- 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" };
2588
+ 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" };
2266
2589
  if (vErrors === null) {
2267
2590
  vErrors = [err102];
2268
2591
  } else {
@@ -2274,7 +2597,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
2274
2597
  if (data.color !== void 0) {
2275
2598
  let data37 = data.color;
2276
2599
  if (!(data37 === "blue" || data37 === "amber" || data37 === "green" || data37 === "violet" || data37 === "rose" || data37 === "slate" || data37 === "coin")) {
2277
- 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" };
2600
+ 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" };
2278
2601
  if (vErrors === null) {
2279
2602
  vErrors = [err103];
2280
2603
  } else {
@@ -2292,13 +2615,10 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
2292
2615
  }
2293
2616
  errors++;
2294
2617
  }
2295
- } else if (tag0 === "strip") {
2296
- const _errs117 = errors;
2297
- let valid45 = false;
2298
- const _errs118 = errors;
2618
+ } else if (tag0 === "leaf") {
2299
2619
  if (data && typeof data == "object" && !Array.isArray(data)) {
2300
- if (data.value === void 0) {
2301
- const err105 = { instancePath, schemaPath: "#/oneOf/8/anyOf/0/required", keyword: "required", params: { missingProperty: "value" }, message: "must have required property 'value'" };
2620
+ if (data.type === void 0) {
2621
+ const err105 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
2302
2622
  if (vErrors === null) {
2303
2623
  vErrors = [err105];
2304
2624
  } else {
@@ -2306,38 +2626,285 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
2306
2626
  }
2307
2627
  errors++;
2308
2628
  }
2629
+ if (data.id === void 0) {
2630
+ const err106 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
2631
+ if (vErrors === null) {
2632
+ vErrors = [err106];
2633
+ } else {
2634
+ vErrors.push(err106);
2635
+ }
2636
+ errors++;
2637
+ }
2638
+ for (const key8 in data) {
2639
+ if (!(key8 === "type" || key8 === "id" || key8 === "hash")) {
2640
+ const err107 = { instancePath, schemaPath: "#/oneOf/8/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key8 }, message: "must NOT have additional properties" };
2641
+ if (vErrors === null) {
2642
+ vErrors = [err107];
2643
+ } else {
2644
+ vErrors.push(err107);
2645
+ }
2646
+ errors++;
2647
+ }
2648
+ }
2649
+ if (data.type !== void 0) {
2650
+ if ("leaf" !== data.type) {
2651
+ const err108 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/8/properties/type/const", keyword: "const", params: { allowedValue: "leaf" }, message: "must be equal to constant" };
2652
+ if (vErrors === null) {
2653
+ vErrors = [err108];
2654
+ } else {
2655
+ vErrors.push(err108);
2656
+ }
2657
+ errors++;
2658
+ }
2659
+ }
2660
+ if (data.id !== void 0) {
2661
+ let data39 = data.id;
2662
+ if (typeof data39 === "string") {
2663
+ if (!pattern0.test(data39)) {
2664
+ const err109 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
2665
+ if (vErrors === null) {
2666
+ vErrors = [err109];
2667
+ } else {
2668
+ vErrors.push(err109);
2669
+ }
2670
+ errors++;
2671
+ }
2672
+ } else {
2673
+ const err110 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2674
+ if (vErrors === null) {
2675
+ vErrors = [err110];
2676
+ } else {
2677
+ vErrors.push(err110);
2678
+ }
2679
+ errors++;
2680
+ }
2681
+ }
2682
+ if (data.hash !== void 0) {
2683
+ let data40 = data.hash;
2684
+ if (typeof data40 === "string") {
2685
+ if (!pattern14.test(data40)) {
2686
+ 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}$"' };
2687
+ if (vErrors === null) {
2688
+ vErrors = [err111];
2689
+ } else {
2690
+ vErrors.push(err111);
2691
+ }
2692
+ errors++;
2693
+ }
2694
+ } else {
2695
+ const err112 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2696
+ if (vErrors === null) {
2697
+ vErrors = [err112];
2698
+ } else {
2699
+ vErrors.push(err112);
2700
+ }
2701
+ errors++;
2702
+ }
2703
+ }
2704
+ } else {
2705
+ const err113 = { instancePath, schemaPath: "#/oneOf/8/type", keyword: "type", params: { type: "object" }, message: "must be object" };
2706
+ if (vErrors === null) {
2707
+ vErrors = [err113];
2708
+ } else {
2709
+ vErrors.push(err113);
2710
+ }
2711
+ errors++;
2712
+ }
2713
+ } else if (tag0 === "node") {
2714
+ if (data && typeof data == "object" && !Array.isArray(data)) {
2715
+ if (data.type === void 0) {
2716
+ const err114 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
2717
+ if (vErrors === null) {
2718
+ vErrors = [err114];
2719
+ } else {
2720
+ vErrors.push(err114);
2721
+ }
2722
+ errors++;
2723
+ }
2724
+ if (data.id === void 0) {
2725
+ const err115 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
2726
+ if (vErrors === null) {
2727
+ vErrors = [err115];
2728
+ } else {
2729
+ vErrors.push(err115);
2730
+ }
2731
+ errors++;
2732
+ }
2733
+ if (data.children === void 0) {
2734
+ const err116 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "children" }, message: "must have required property 'children'" };
2735
+ if (vErrors === null) {
2736
+ vErrors = [err116];
2737
+ } else {
2738
+ vErrors.push(err116);
2739
+ }
2740
+ errors++;
2741
+ }
2742
+ for (const key9 in data) {
2743
+ if (!(key9 === "type" || key9 === "id" || key9 === "children" || key9 === "hash")) {
2744
+ const err117 = { instancePath, schemaPath: "#/oneOf/9/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key9 }, message: "must NOT have additional properties" };
2745
+ if (vErrors === null) {
2746
+ vErrors = [err117];
2747
+ } else {
2748
+ vErrors.push(err117);
2749
+ }
2750
+ errors++;
2751
+ }
2752
+ }
2753
+ if (data.type !== void 0) {
2754
+ if ("node" !== data.type) {
2755
+ const err118 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/9/properties/type/const", keyword: "const", params: { allowedValue: "node" }, message: "must be equal to constant" };
2756
+ if (vErrors === null) {
2757
+ vErrors = [err118];
2758
+ } else {
2759
+ vErrors.push(err118);
2760
+ }
2761
+ errors++;
2762
+ }
2763
+ }
2764
+ if (data.id !== void 0) {
2765
+ let data42 = data.id;
2766
+ if (typeof data42 === "string") {
2767
+ if (!pattern0.test(data42)) {
2768
+ const err119 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
2769
+ if (vErrors === null) {
2770
+ vErrors = [err119];
2771
+ } else {
2772
+ vErrors.push(err119);
2773
+ }
2774
+ errors++;
2775
+ }
2776
+ } else {
2777
+ const err120 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2778
+ if (vErrors === null) {
2779
+ vErrors = [err120];
2780
+ } else {
2781
+ vErrors.push(err120);
2782
+ }
2783
+ errors++;
2784
+ }
2785
+ }
2786
+ if (data.children !== void 0) {
2787
+ let data43 = data.children;
2788
+ if (Array.isArray(data43)) {
2789
+ if (data43.length < 1) {
2790
+ const err121 = { instancePath: instancePath + "/children", schemaPath: "#/oneOf/9/properties/children/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
2791
+ if (vErrors === null) {
2792
+ vErrors = [err121];
2793
+ } else {
2794
+ vErrors.push(err121);
2795
+ }
2796
+ errors++;
2797
+ }
2798
+ const len0 = data43.length;
2799
+ for (let i0 = 0; i0 < len0; i0++) {
2800
+ let data44 = data43[i0];
2801
+ if (typeof data44 === "string") {
2802
+ if (!pattern0.test(data44)) {
2803
+ const err122 = { instancePath: instancePath + "/children/" + i0, schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
2804
+ if (vErrors === null) {
2805
+ vErrors = [err122];
2806
+ } else {
2807
+ vErrors.push(err122);
2808
+ }
2809
+ errors++;
2810
+ }
2811
+ } else {
2812
+ const err123 = { instancePath: instancePath + "/children/" + i0, schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2813
+ if (vErrors === null) {
2814
+ vErrors = [err123];
2815
+ } else {
2816
+ vErrors.push(err123);
2817
+ }
2818
+ errors++;
2819
+ }
2820
+ }
2821
+ } else {
2822
+ const err124 = { instancePath: instancePath + "/children", schemaPath: "#/oneOf/9/properties/children/type", keyword: "type", params: { type: "array" }, message: "must be array" };
2823
+ if (vErrors === null) {
2824
+ vErrors = [err124];
2825
+ } else {
2826
+ vErrors.push(err124);
2827
+ }
2828
+ errors++;
2829
+ }
2830
+ }
2831
+ if (data.hash !== void 0) {
2832
+ let data45 = data.hash;
2833
+ if (typeof data45 === "string") {
2834
+ if (!pattern14.test(data45)) {
2835
+ 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}$"' };
2836
+ if (vErrors === null) {
2837
+ vErrors = [err125];
2838
+ } else {
2839
+ vErrors.push(err125);
2840
+ }
2841
+ errors++;
2842
+ }
2843
+ } else {
2844
+ const err126 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2845
+ if (vErrors === null) {
2846
+ vErrors = [err126];
2847
+ } else {
2848
+ vErrors.push(err126);
2849
+ }
2850
+ errors++;
2851
+ }
2852
+ }
2853
+ } else {
2854
+ const err127 = { instancePath, schemaPath: "#/oneOf/9/type", keyword: "type", params: { type: "object" }, message: "must be object" };
2855
+ if (vErrors === null) {
2856
+ vErrors = [err127];
2857
+ } else {
2858
+ vErrors.push(err127);
2859
+ }
2860
+ errors++;
2861
+ }
2862
+ } else if (tag0 === "strip") {
2863
+ const _errs142 = errors;
2864
+ let valid56 = false;
2865
+ const _errs143 = errors;
2866
+ if (data && typeof data == "object" && !Array.isArray(data)) {
2867
+ if (data.value === void 0) {
2868
+ const err128 = { instancePath, schemaPath: "#/oneOf/10/anyOf/0/required", keyword: "required", params: { missingProperty: "value" }, message: "must have required property 'value'" };
2869
+ if (vErrors === null) {
2870
+ vErrors = [err128];
2871
+ } else {
2872
+ vErrors.push(err128);
2873
+ }
2874
+ errors++;
2875
+ }
2309
2876
  }
2310
- var _valid0 = _errs118 === errors;
2311
- valid45 = valid45 || _valid0;
2312
- if (!valid45) {
2313
- const _errs119 = errors;
2877
+ var _valid0 = _errs143 === errors;
2878
+ valid56 = valid56 || _valid0;
2879
+ if (!valid56) {
2880
+ const _errs144 = errors;
2314
2881
  if (data && typeof data == "object" && !Array.isArray(data)) {
2315
2882
  if (data.tag === void 0) {
2316
- const err106 = { instancePath, schemaPath: "#/oneOf/8/anyOf/1/required", keyword: "required", params: { missingProperty: "tag" }, message: "must have required property 'tag'" };
2883
+ const err129 = { instancePath, schemaPath: "#/oneOf/10/anyOf/1/required", keyword: "required", params: { missingProperty: "tag" }, message: "must have required property 'tag'" };
2317
2884
  if (vErrors === null) {
2318
- vErrors = [err106];
2885
+ vErrors = [err129];
2319
2886
  } else {
2320
- vErrors.push(err106);
2887
+ vErrors.push(err129);
2321
2888
  }
2322
2889
  errors++;
2323
2890
  }
2324
2891
  }
2325
- var _valid0 = _errs119 === errors;
2326
- valid45 = valid45 || _valid0;
2892
+ var _valid0 = _errs144 === errors;
2893
+ valid56 = valid56 || _valid0;
2327
2894
  }
2328
- if (!valid45) {
2329
- const err107 = { instancePath, schemaPath: "#/oneOf/8/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
2895
+ if (!valid56) {
2896
+ const err130 = { instancePath, schemaPath: "#/oneOf/10/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
2330
2897
  if (vErrors === null) {
2331
- vErrors = [err107];
2898
+ vErrors = [err130];
2332
2899
  } else {
2333
- vErrors.push(err107);
2900
+ vErrors.push(err130);
2334
2901
  }
2335
2902
  errors++;
2336
2903
  } else {
2337
- errors = _errs117;
2904
+ errors = _errs142;
2338
2905
  if (vErrors !== null) {
2339
- if (_errs117) {
2340
- vErrors.length = _errs117;
2906
+ if (_errs142) {
2907
+ vErrors.length = _errs142;
2341
2908
  } else {
2342
2909
  vErrors = null;
2343
2910
  }
@@ -2345,151 +2912,151 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
2345
2912
  }
2346
2913
  if (data && typeof data == "object" && !Array.isArray(data)) {
2347
2914
  if (data.type === void 0) {
2348
- const err108 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
2915
+ const err131 = { instancePath, schemaPath: "#/oneOf/10/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
2349
2916
  if (vErrors === null) {
2350
- vErrors = [err108];
2917
+ vErrors = [err131];
2351
2918
  } else {
2352
- vErrors.push(err108);
2919
+ vErrors.push(err131);
2353
2920
  }
2354
2921
  errors++;
2355
2922
  }
2356
2923
  if (data.field === void 0) {
2357
- const err109 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "field" }, message: "must have required property 'field'" };
2924
+ const err132 = { instancePath, schemaPath: "#/oneOf/10/required", keyword: "required", params: { missingProperty: "field" }, message: "must have required property 'field'" };
2358
2925
  if (vErrors === null) {
2359
- vErrors = [err109];
2926
+ vErrors = [err132];
2360
2927
  } else {
2361
- vErrors.push(err109);
2928
+ vErrors.push(err132);
2362
2929
  }
2363
2930
  errors++;
2364
2931
  }
2365
- for (const key8 in data) {
2366
- if (!(key8 === "type" || key8 === "field" || key8 === "value" || key8 === "tag")) {
2367
- const err110 = { instancePath, schemaPath: "#/oneOf/8/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key8 }, message: "must NOT have additional properties" };
2932
+ for (const key10 in data) {
2933
+ if (!(key10 === "type" || key10 === "field" || key10 === "value" || key10 === "tag")) {
2934
+ const err133 = { instancePath, schemaPath: "#/oneOf/10/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key10 }, message: "must NOT have additional properties" };
2368
2935
  if (vErrors === null) {
2369
- vErrors = [err110];
2936
+ vErrors = [err133];
2370
2937
  } else {
2371
- vErrors.push(err110);
2938
+ vErrors.push(err133);
2372
2939
  }
2373
2940
  errors++;
2374
2941
  }
2375
2942
  }
2376
2943
  if (data.type !== void 0) {
2377
2944
  if ("strip" !== data.type) {
2378
- const err111 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/8/properties/type/const", keyword: "const", params: { allowedValue: "strip" }, message: "must be equal to constant" };
2945
+ const err134 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/10/properties/type/const", keyword: "const", params: { allowedValue: "strip" }, message: "must be equal to constant" };
2379
2946
  if (vErrors === null) {
2380
- vErrors = [err111];
2947
+ vErrors = [err134];
2381
2948
  } else {
2382
- vErrors.push(err111);
2949
+ vErrors.push(err134);
2383
2950
  }
2384
2951
  errors++;
2385
2952
  }
2386
2953
  }
2387
2954
  if (data.field !== void 0) {
2388
- let data39 = data.field;
2389
- if (typeof data39 === "string") {
2390
- if (func3(data39) < 1) {
2391
- const err112 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
2955
+ let data47 = data.field;
2956
+ if (typeof data47 === "string") {
2957
+ if (func3(data47) < 1) {
2958
+ const err135 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
2392
2959
  if (vErrors === null) {
2393
- vErrors = [err112];
2960
+ vErrors = [err135];
2394
2961
  } else {
2395
- vErrors.push(err112);
2962
+ vErrors.push(err135);
2396
2963
  }
2397
2964
  errors++;
2398
2965
  }
2399
2966
  } else {
2400
- const err113 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2967
+ const err136 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2401
2968
  if (vErrors === null) {
2402
- vErrors = [err113];
2969
+ vErrors = [err136];
2403
2970
  } else {
2404
- vErrors.push(err113);
2971
+ vErrors.push(err136);
2405
2972
  }
2406
2973
  errors++;
2407
2974
  }
2408
2975
  }
2409
2976
  if (data.value !== void 0) {
2410
- let data40 = data.value;
2411
- if (typeof data40 === "string") {
2412
- if (func3(data40) < 1) {
2413
- const err114 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
2977
+ let data48 = data.value;
2978
+ if (typeof data48 === "string") {
2979
+ if (func3(data48) < 1) {
2980
+ const err137 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
2414
2981
  if (vErrors === null) {
2415
- vErrors = [err114];
2982
+ vErrors = [err137];
2416
2983
  } else {
2417
- vErrors.push(err114);
2984
+ vErrors.push(err137);
2418
2985
  }
2419
2986
  errors++;
2420
2987
  }
2421
2988
  } else {
2422
- const err115 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2989
+ const err138 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2423
2990
  if (vErrors === null) {
2424
- vErrors = [err115];
2991
+ vErrors = [err138];
2425
2992
  } else {
2426
- vErrors.push(err115);
2993
+ vErrors.push(err138);
2427
2994
  }
2428
2995
  errors++;
2429
2996
  }
2430
2997
  }
2431
2998
  if (data.tag !== void 0) {
2432
- let data41 = data.tag;
2433
- if (typeof data41 === "string") {
2434
- if (func3(data41) < 1) {
2435
- const err116 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
2999
+ let data49 = data.tag;
3000
+ if (typeof data49 === "string") {
3001
+ if (func3(data49) < 1) {
3002
+ const err139 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
2436
3003
  if (vErrors === null) {
2437
- vErrors = [err116];
3004
+ vErrors = [err139];
2438
3005
  } else {
2439
- vErrors.push(err116);
3006
+ vErrors.push(err139);
2440
3007
  }
2441
3008
  errors++;
2442
3009
  }
2443
3010
  } else {
2444
- const err117 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
3011
+ const err140 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2445
3012
  if (vErrors === null) {
2446
- vErrors = [err117];
3013
+ vErrors = [err140];
2447
3014
  } else {
2448
- vErrors.push(err117);
3015
+ vErrors.push(err140);
2449
3016
  }
2450
3017
  errors++;
2451
3018
  }
2452
3019
  }
2453
3020
  } else {
2454
- const err118 = { instancePath, schemaPath: "#/oneOf/8/type", keyword: "type", params: { type: "object" }, message: "must be object" };
3021
+ const err141 = { instancePath, schemaPath: "#/oneOf/10/type", keyword: "type", params: { type: "object" }, message: "must be object" };
2455
3022
  if (vErrors === null) {
2456
- vErrors = [err118];
3023
+ vErrors = [err141];
2457
3024
  } else {
2458
- vErrors.push(err118);
3025
+ vErrors.push(err141);
2459
3026
  }
2460
3027
  errors++;
2461
3028
  }
2462
3029
  } else {
2463
- const err119 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "mapping", tag: "type", tagValue: tag0 }, message: 'value of tag "type" must be in oneOf' };
3030
+ const err142 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "mapping", tag: "type", tagValue: tag0 }, message: 'value of tag "type" must be in oneOf' };
2464
3031
  if (vErrors === null) {
2465
- vErrors = [err119];
3032
+ vErrors = [err142];
2466
3033
  } else {
2467
- vErrors.push(err119);
3034
+ vErrors.push(err142);
2468
3035
  }
2469
3036
  errors++;
2470
3037
  }
2471
3038
  } else {
2472
- const err120 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "tag", tag: "type", tagValue: tag0 }, message: 'tag "type" must be string' };
3039
+ const err143 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "tag", tag: "type", tagValue: tag0 }, message: 'tag "type" must be string' };
2473
3040
  if (vErrors === null) {
2474
- vErrors = [err120];
3041
+ vErrors = [err143];
2475
3042
  } else {
2476
- vErrors.push(err120);
3043
+ vErrors.push(err143);
2477
3044
  }
2478
3045
  errors++;
2479
3046
  }
2480
3047
  } else {
2481
- const err121 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
3048
+ const err144 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
2482
3049
  if (vErrors === null) {
2483
- vErrors = [err121];
3050
+ vErrors = [err144];
2484
3051
  } else {
2485
- vErrors.push(err121);
3052
+ vErrors.push(err144);
2486
3053
  }
2487
3054
  errors++;
2488
3055
  }
2489
- validate33.errors = vErrors;
3056
+ validate38.errors = vErrors;
2490
3057
  return errors === 0;
2491
3058
  }
2492
- function validate30(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3059
+ function validate35(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
2493
3060
  let vErrors = null;
2494
3061
  let errors = 0;
2495
3062
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -2611,8 +3178,8 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
2611
3178
  }
2612
3179
  const len0 = data3.length;
2613
3180
  for (let i0 = 0; i0 < len0; i0++) {
2614
- if (!validate31(data3[i0], { instancePath: instancePath + "/sources/" + i0, parentData: data3, parentDataProperty: i0, rootData })) {
2615
- vErrors = vErrors === null ? validate31.errors : vErrors.concat(validate31.errors);
3181
+ if (!validate36(data3[i0], { instancePath: instancePath + "/sources/" + i0, parentData: data3, parentDataProperty: i0, rootData })) {
3182
+ vErrors = vErrors === null ? validate36.errors : vErrors.concat(validate36.errors);
2616
3183
  errors = vErrors.length;
2617
3184
  }
2618
3185
  }
@@ -2631,8 +3198,8 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
2631
3198
  if (Array.isArray(data5)) {
2632
3199
  const len1 = data5.length;
2633
3200
  for (let i1 = 0; i1 < len1; i1++) {
2634
- if (!validate33(data5[i1], { instancePath: instancePath + "/events/" + i1, parentData: data5, parentDataProperty: i1, rootData })) {
2635
- vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors);
3201
+ if (!validate38(data5[i1], { instancePath: instancePath + "/events/" + i1, parentData: data5, parentDataProperty: i1, rootData })) {
3202
+ vErrors = vErrors === null ? validate38.errors : vErrors.concat(validate38.errors);
2636
3203
  errors = vErrors.length;
2637
3204
  }
2638
3205
  }
@@ -2655,10 +3222,10 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
2655
3222
  }
2656
3223
  errors++;
2657
3224
  }
2658
- validate30.errors = vErrors;
3225
+ validate35.errors = vErrors;
2659
3226
  return errors === 0;
2660
3227
  }
2661
- function validate38(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3228
+ function validate43(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
2662
3229
  let vErrors = null;
2663
3230
  let errors = 0;
2664
3231
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -2736,10 +3303,10 @@ function validate38(data, { instancePath = "", parentData, parentDataProperty, r
2736
3303
  }
2737
3304
  errors++;
2738
3305
  }
2739
- validate38.errors = vErrors;
3306
+ validate43.errors = vErrors;
2740
3307
  return errors === 0;
2741
3308
  }
2742
- function validate41(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3309
+ function validate46(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
2743
3310
  let vErrors = null;
2744
3311
  let errors = 0;
2745
3312
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -2847,10 +3414,10 @@ function validate41(data, { instancePath = "", parentData, parentDataProperty, r
2847
3414
  }
2848
3415
  errors++;
2849
3416
  }
2850
- validate41.errors = vErrors;
3417
+ validate46.errors = vErrors;
2851
3418
  return errors === 0;
2852
3419
  }
2853
- function validate40(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3420
+ function validate45(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
2854
3421
  let vErrors = null;
2855
3422
  let errors = 0;
2856
3423
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -2888,8 +3455,8 @@ function validate40(data, { instancePath = "", parentData, parentDataProperty, r
2888
3455
  }
2889
3456
  const len0 = data0.length;
2890
3457
  for (let i0 = 0; i0 < len0; i0++) {
2891
- if (!validate41(data0[i0], { instancePath: instancePath + "/paths/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
2892
- vErrors = vErrors === null ? validate41.errors : vErrors.concat(validate41.errors);
3458
+ if (!validate46(data0[i0], { instancePath: instancePath + "/paths/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
3459
+ vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors);
2893
3460
  errors = vErrors.length;
2894
3461
  }
2895
3462
  }
@@ -2912,10 +3479,10 @@ function validate40(data, { instancePath = "", parentData, parentDataProperty, r
2912
3479
  }
2913
3480
  errors++;
2914
3481
  }
2915
- validate40.errors = vErrors;
3482
+ validate45.errors = vErrors;
2916
3483
  return errors === 0;
2917
3484
  }
2918
- function validate45(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3485
+ function validate50(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
2919
3486
  let vErrors = null;
2920
3487
  let errors = 0;
2921
3488
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -2992,10 +3559,10 @@ function validate45(data, { instancePath = "", parentData, parentDataProperty, r
2992
3559
  }
2993
3560
  errors++;
2994
3561
  }
2995
- validate45.errors = vErrors;
3562
+ validate50.errors = vErrors;
2996
3563
  return errors === 0;
2997
3564
  }
2998
- function validate44(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3565
+ function validate49(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
2999
3566
  let vErrors = null;
3000
3567
  let errors = 0;
3001
3568
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3033,8 +3600,8 @@ function validate44(data, { instancePath = "", parentData, parentDataProperty, r
3033
3600
  }
3034
3601
  const len0 = data0.length;
3035
3602
  for (let i0 = 0; i0 < len0; i0++) {
3036
- if (!validate45(data0[i0], { instancePath: instancePath + "/branches/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
3037
- vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors);
3603
+ if (!validate50(data0[i0], { instancePath: instancePath + "/branches/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
3604
+ vErrors = vErrors === null ? validate50.errors : vErrors.concat(validate50.errors);
3038
3605
  errors = vErrors.length;
3039
3606
  }
3040
3607
  }
@@ -3057,11 +3624,11 @@ function validate44(data, { instancePath = "", parentData, parentDataProperty, r
3057
3624
  }
3058
3625
  errors++;
3059
3626
  }
3060
- validate44.errors = vErrors;
3627
+ validate49.errors = vErrors;
3061
3628
  return errors === 0;
3062
3629
  }
3063
- var pattern22 = new RegExp("^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$", "u");
3064
- function validate49(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3630
+ var pattern27 = new RegExp("^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$", "u");
3631
+ function validate54(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3065
3632
  let vErrors = null;
3066
3633
  let errors = 0;
3067
3634
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3128,7 +3695,7 @@ function validate49(data, { instancePath = "", parentData, parentDataProperty, r
3128
3695
  if (data.length !== void 0) {
3129
3696
  let data1 = data.length;
3130
3697
  if (typeof data1 === "string") {
3131
- if (!pattern22.test(data1)) {
3698
+ if (!pattern27.test(data1)) {
3132
3699
  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)$"' };
3133
3700
  if (vErrors === null) {
3134
3701
  vErrors = [err6];
@@ -3202,10 +3769,10 @@ function validate49(data, { instancePath = "", parentData, parentDataProperty, r
3202
3769
  }
3203
3770
  errors++;
3204
3771
  }
3205
- validate49.errors = vErrors;
3772
+ validate54.errors = vErrors;
3206
3773
  return errors === 0;
3207
3774
  }
3208
- function validate51(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3775
+ function validate56(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3209
3776
  let vErrors = null;
3210
3777
  let errors = 0;
3211
3778
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3315,10 +3882,10 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
3315
3882
  }
3316
3883
  errors++;
3317
3884
  }
3318
- validate51.errors = vErrors;
3885
+ validate56.errors = vErrors;
3319
3886
  return errors === 0;
3320
3887
  }
3321
- function validate53(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3888
+ function validate58(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3322
3889
  let vErrors = null;
3323
3890
  let errors = 0;
3324
3891
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3398,7 +3965,7 @@ function validate53(data, { instancePath = "", parentData, parentDataProperty, r
3398
3965
  if (data.color !== void 0) {
3399
3966
  let data2 = data.color;
3400
3967
  if (!(data2 === "blue" || data2 === "amber" || data2 === "green" || data2 === "violet" || data2 === "rose" || data2 === "slate" || data2 === "coin")) {
3401
- 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" };
3968
+ 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" };
3402
3969
  if (vErrors === null) {
3403
3970
  vErrors = [err7];
3404
3971
  } else {
@@ -3453,10 +4020,10 @@ function validate53(data, { instancePath = "", parentData, parentDataProperty, r
3453
4020
  }
3454
4021
  errors++;
3455
4022
  }
3456
- validate53.errors = vErrors;
4023
+ validate58.errors = vErrors;
3457
4024
  return errors === 0;
3458
4025
  }
3459
- function validate55(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4026
+ function validate60(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3460
4027
  let vErrors = null;
3461
4028
  let errors = 0;
3462
4029
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3543,10 +4110,10 @@ function validate55(data, { instancePath = "", parentData, parentDataProperty, r
3543
4110
  }
3544
4111
  errors++;
3545
4112
  }
3546
- validate55.errors = vErrors;
4113
+ validate60.errors = vErrors;
3547
4114
  return errors === 0;
3548
4115
  }
3549
- function validate57(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4116
+ function validate62(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3550
4117
  let vErrors = null;
3551
4118
  let errors = 0;
3552
4119
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3634,10 +4201,10 @@ function validate57(data, { instancePath = "", parentData, parentDataProperty, r
3634
4201
  }
3635
4202
  errors++;
3636
4203
  }
3637
- validate57.errors = vErrors;
4204
+ validate62.errors = vErrors;
3638
4205
  return errors === 0;
3639
4206
  }
3640
- function validate48(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4207
+ function validate53(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3641
4208
  let vErrors = null;
3642
4209
  let errors = 0;
3643
4210
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3671,14 +4238,14 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
3671
4238
  }
3672
4239
  }
3673
4240
  if (data.scale !== void 0) {
3674
- if (!validate49(data.scale, { instancePath: instancePath + "/scale", parentData: data, parentDataProperty: "scale", rootData })) {
3675
- vErrors = vErrors === null ? validate49.errors : vErrors.concat(validate49.errors);
4241
+ if (!validate54(data.scale, { instancePath: instancePath + "/scale", parentData: data, parentDataProperty: "scale", rootData })) {
4242
+ vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);
3676
4243
  errors = vErrors.length;
3677
4244
  }
3678
4245
  }
3679
4246
  if (data.period !== void 0) {
3680
- if (!validate51(data.period, { instancePath: instancePath + "/period", parentData: data, parentDataProperty: "period", rootData })) {
3681
- vErrors = vErrors === null ? validate51.errors : vErrors.concat(validate51.errors);
4247
+ if (!validate56(data.period, { instancePath: instancePath + "/period", parentData: data, parentDataProperty: "period", rootData })) {
4248
+ vErrors = vErrors === null ? validate56.errors : vErrors.concat(validate56.errors);
3682
4249
  errors = vErrors.length;
3683
4250
  }
3684
4251
  }
@@ -3696,8 +4263,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
3696
4263
  }
3697
4264
  const len0 = data2.length;
3698
4265
  for (let i0 = 0; i0 < len0; i0++) {
3699
- if (!validate53(data2[i0], { instancePath: instancePath + "/rows/" + i0, parentData: data2, parentDataProperty: i0, rootData })) {
3700
- vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);
4266
+ if (!validate58(data2[i0], { instancePath: instancePath + "/rows/" + i0, parentData: data2, parentDataProperty: i0, rootData })) {
4267
+ vErrors = vErrors === null ? validate58.errors : vErrors.concat(validate58.errors);
3701
4268
  errors = vErrors.length;
3702
4269
  }
3703
4270
  }
@@ -3716,8 +4283,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
3716
4283
  if (Array.isArray(data4)) {
3717
4284
  const len1 = data4.length;
3718
4285
  for (let i1 = 0; i1 < len1; i1++) {
3719
- if (!validate55(data4[i1], { instancePath: instancePath + "/points/" + i1, parentData: data4, parentDataProperty: i1, rootData })) {
3720
- vErrors = vErrors === null ? validate55.errors : vErrors.concat(validate55.errors);
4286
+ if (!validate60(data4[i1], { instancePath: instancePath + "/points/" + i1, parentData: data4, parentDataProperty: i1, rootData })) {
4287
+ vErrors = vErrors === null ? validate60.errors : vErrors.concat(validate60.errors);
3721
4288
  errors = vErrors.length;
3722
4289
  }
3723
4290
  }
@@ -3732,8 +4299,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
3732
4299
  }
3733
4300
  }
3734
4301
  if (data.zoom !== void 0) {
3735
- if (!validate57(data.zoom, { instancePath: instancePath + "/zoom", parentData: data, parentDataProperty: "zoom", rootData })) {
3736
- vErrors = vErrors === null ? validate57.errors : vErrors.concat(validate57.errors);
4302
+ if (!validate62(data.zoom, { instancePath: instancePath + "/zoom", parentData: data, parentDataProperty: "zoom", rootData })) {
4303
+ vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);
3737
4304
  errors = vErrors.length;
3738
4305
  }
3739
4306
  }
@@ -3746,7 +4313,7 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
3746
4313
  }
3747
4314
  errors++;
3748
4315
  }
3749
- validate48.errors = vErrors;
4316
+ validate53.errors = vErrors;
3750
4317
  return errors === 0;
3751
4318
  }
3752
4319
  var func2 = Object.prototype.hasOwnProperty;
@@ -4130,84 +4697,35 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
4130
4697
  errors++;
4131
4698
  }
4132
4699
  if (data.steps !== void 0) {
4133
- let data22 = data.steps;
4134
- if (Array.isArray(data22)) {
4135
- const len1 = data22.length;
4136
- for (let i1 = 0; i1 < len1; i1++) {
4137
- let data23 = data22[i1];
4138
- if (data23 && typeof data23 == "object" && !Array.isArray(data23)) {
4139
- if (data23.events !== void 0) {
4140
- let data24 = data23.events;
4141
- if (Array.isArray(data24)) {
4142
- const len2 = data24.length;
4143
- for (let i2 = 0; i2 < len2; i2++) {
4144
- let data25 = data24[i2];
4145
- if (data25 && typeof data25 == "object" && !Array.isArray(data25)) {
4146
- if (data25.type !== void 0) {
4147
- let data26 = data25.type;
4148
- const _errs62 = errors;
4149
- const _errs63 = errors;
4150
- if (!(data26 === "commit" || data26 === "branch")) {
4151
- const err23 = {};
4152
- if (vErrors === null) {
4153
- vErrors = [err23];
4154
- } else {
4155
- vErrors.push(err23);
4156
- }
4157
- errors++;
4158
- }
4159
- var valid31 = _errs63 === errors;
4160
- if (valid31) {
4161
- 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" };
4162
- if (vErrors === null) {
4163
- vErrors = [err24];
4164
- } else {
4165
- vErrors.push(err24);
4166
- }
4167
- errors++;
4168
- } else {
4169
- errors = _errs62;
4170
- if (vErrors !== null) {
4171
- if (_errs62) {
4172
- vErrors.length = _errs62;
4173
- } else {
4174
- vErrors = null;
4175
- }
4176
- }
4177
- }
4178
- }
4179
- }
4180
- }
4181
- }
4182
- }
4183
- }
4184
- }
4700
+ if (!validate20(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
4701
+ vErrors = vErrors === null ? validate20.errors : vErrors.concat(validate20.errors);
4702
+ errors = vErrors.length;
4185
4703
  }
4186
4704
  }
4187
4705
  if (data.state !== void 0) {
4188
- const err25 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4706
+ const err23 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4189
4707
  if (vErrors === null) {
4190
- vErrors = [err25];
4708
+ vErrors = [err23];
4191
4709
  } else {
4192
- vErrors.push(err25);
4710
+ vErrors.push(err23);
4193
4711
  }
4194
4712
  errors++;
4195
4713
  }
4196
4714
  if (data.git !== void 0) {
4197
- const err26 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4715
+ const err24 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4198
4716
  if (vErrors === null) {
4199
- vErrors = [err26];
4717
+ vErrors = [err24];
4200
4718
  } else {
4201
- vErrors.push(err26);
4719
+ vErrors.push(err24);
4202
4720
  }
4203
4721
  errors++;
4204
4722
  }
4205
4723
  if (data.regions !== void 0) {
4206
- const err27 = { instancePath: instancePath + "/regions", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4724
+ const err25 = { instancePath: instancePath + "/regions", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4207
4725
  if (vErrors === null) {
4208
- vErrors = [err27];
4726
+ vErrors = [err25];
4209
4727
  } else {
4210
- vErrors.push(err27);
4728
+ vErrors.push(err25);
4211
4729
  }
4212
4730
  errors++;
4213
4731
  }
@@ -4216,72 +4734,178 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
4216
4734
  valid21 = _valid3;
4217
4735
  ifClause3 = "then";
4218
4736
  } else {
4219
- const _errs73 = errors;
4737
+ const _errs66 = errors;
4738
+ const _errs67 = errors;
4739
+ let valid27 = true;
4740
+ const _errs68 = errors;
4220
4741
  if (data && typeof data == "object" && !Array.isArray(data)) {
4221
- if (data.boxes !== void 0) {
4222
- let data30 = data.boxes;
4223
- if (Array.isArray(data30)) {
4224
- if (data30.length < 1) {
4225
- 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" };
4742
+ if (data.kind === void 0 && ("kind")) {
4743
+ const err26 = {};
4744
+ if (vErrors === null) {
4745
+ vErrors = [err26];
4746
+ } else {
4747
+ vErrors.push(err26);
4748
+ }
4749
+ errors++;
4750
+ } else {
4751
+ if (data.kind !== void 0) {
4752
+ if ("tree" !== data.kind) {
4753
+ const err27 = {};
4226
4754
  if (vErrors === null) {
4227
- vErrors = [err28];
4755
+ vErrors = [err27];
4228
4756
  } else {
4229
- vErrors.push(err28);
4757
+ vErrors.push(err27);
4758
+ }
4759
+ errors++;
4760
+ }
4761
+ }
4762
+ }
4763
+ }
4764
+ var _valid4 = _errs68 === errors;
4765
+ errors = _errs67;
4766
+ if (vErrors !== null) {
4767
+ if (_errs67) {
4768
+ vErrors.length = _errs67;
4769
+ } else {
4770
+ vErrors = null;
4771
+ }
4772
+ }
4773
+ let ifClause4;
4774
+ if (_valid4) {
4775
+ const _errs70 = errors;
4776
+ if (data && typeof data == "object" && !Array.isArray(data)) {
4777
+ if (data.steps !== void 0) {
4778
+ if (!validate22(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
4779
+ vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);
4780
+ errors = vErrors.length;
4781
+ }
4782
+ }
4783
+ if (data.strip !== void 0) {
4784
+ if (!validate13(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
4785
+ vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
4786
+ errors = vErrors.length;
4787
+ }
4788
+ }
4789
+ if (data.state !== void 0) {
4790
+ const err28 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4791
+ if (vErrors === null) {
4792
+ vErrors = [err28];
4793
+ } else {
4794
+ vErrors.push(err28);
4795
+ }
4796
+ errors++;
4797
+ }
4798
+ if (data.git !== void 0) {
4799
+ const err29 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4800
+ if (vErrors === null) {
4801
+ vErrors = [err29];
4802
+ } else {
4803
+ vErrors.push(err29);
4804
+ }
4805
+ errors++;
4806
+ }
4807
+ if (data.time !== void 0) {
4808
+ const err30 = { instancePath: instancePath + "/time", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4809
+ if (vErrors === null) {
4810
+ vErrors = [err30];
4811
+ } else {
4812
+ vErrors.push(err30);
4813
+ }
4814
+ errors++;
4815
+ }
4816
+ if (data.regions !== void 0) {
4817
+ const err31 = { instancePath: instancePath + "/regions", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4818
+ if (vErrors === null) {
4819
+ vErrors = [err31];
4820
+ } else {
4821
+ vErrors.push(err31);
4822
+ }
4823
+ errors++;
4824
+ }
4825
+ }
4826
+ var _valid4 = _errs70 === errors;
4827
+ valid27 = _valid4;
4828
+ ifClause4 = "then";
4829
+ } else {
4830
+ const _errs85 = errors;
4831
+ if (data && typeof data == "object" && !Array.isArray(data)) {
4832
+ if (data.boxes !== void 0) {
4833
+ let data33 = data.boxes;
4834
+ if (Array.isArray(data33)) {
4835
+ if (data33.length < 1) {
4836
+ 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" };
4837
+ if (vErrors === null) {
4838
+ vErrors = [err32];
4839
+ } else {
4840
+ vErrors.push(err32);
4841
+ }
4842
+ errors++;
4230
4843
  }
4231
- errors++;
4232
4844
  }
4233
4845
  }
4234
- }
4235
- if (data.steps !== void 0) {
4236
- if (!validate11(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
4237
- vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);
4238
- errors = vErrors.length;
4846
+ if (data.steps !== void 0) {
4847
+ if (!validate11(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
4848
+ vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);
4849
+ errors = vErrors.length;
4850
+ }
4239
4851
  }
4240
- }
4241
- if (data.strip !== void 0) {
4242
- if (!validate13(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
4243
- vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
4244
- errors = vErrors.length;
4852
+ if (data.strip !== void 0) {
4853
+ if (!validate13(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
4854
+ vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
4855
+ errors = vErrors.length;
4856
+ }
4245
4857
  }
4246
- }
4247
- if (data.state !== void 0) {
4248
- const err29 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4249
- if (vErrors === null) {
4250
- vErrors = [err29];
4251
- } else {
4252
- vErrors.push(err29);
4858
+ if (data.state !== void 0) {
4859
+ const err33 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4860
+ if (vErrors === null) {
4861
+ vErrors = [err33];
4862
+ } else {
4863
+ vErrors.push(err33);
4864
+ }
4865
+ errors++;
4253
4866
  }
4254
- errors++;
4255
- }
4256
- if (data.git !== void 0) {
4257
- const err30 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4258
- if (vErrors === null) {
4259
- vErrors = [err30];
4260
- } else {
4261
- vErrors.push(err30);
4867
+ if (data.git !== void 0) {
4868
+ const err34 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4869
+ if (vErrors === null) {
4870
+ vErrors = [err34];
4871
+ } else {
4872
+ vErrors.push(err34);
4873
+ }
4874
+ errors++;
4262
4875
  }
4263
- errors++;
4264
- }
4265
- if (data.time !== void 0) {
4266
- const err31 = { instancePath: instancePath + "/time", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4267
- if (vErrors === null) {
4268
- vErrors = [err31];
4269
- } else {
4270
- vErrors.push(err31);
4876
+ if (data.time !== void 0) {
4877
+ const err35 = { instancePath: instancePath + "/time", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4878
+ if (vErrors === null) {
4879
+ vErrors = [err35];
4880
+ } else {
4881
+ vErrors.push(err35);
4882
+ }
4883
+ errors++;
4271
4884
  }
4272
- errors++;
4273
4885
  }
4886
+ var _valid4 = _errs85 === errors;
4887
+ valid27 = _valid4;
4888
+ ifClause4 = "else";
4889
+ }
4890
+ if (!valid27) {
4891
+ const err36 = { instancePath, schemaPath: "#/else/else/else/else/if", keyword: "if", params: { failingKeyword: ifClause4 }, message: 'must match "' + ifClause4 + '" schema' };
4892
+ if (vErrors === null) {
4893
+ vErrors = [err36];
4894
+ } else {
4895
+ vErrors.push(err36);
4896
+ }
4897
+ errors++;
4274
4898
  }
4275
- var _valid3 = _errs73 === errors;
4899
+ var _valid3 = _errs66 === errors;
4276
4900
  valid21 = _valid3;
4277
4901
  ifClause3 = "else";
4278
4902
  }
4279
4903
  if (!valid21) {
4280
- const err32 = { instancePath, schemaPath: "#/else/else/else/if", keyword: "if", params: { failingKeyword: ifClause3 }, message: 'must match "' + ifClause3 + '" schema' };
4904
+ const err37 = { instancePath, schemaPath: "#/else/else/else/if", keyword: "if", params: { failingKeyword: ifClause3 }, message: 'must match "' + ifClause3 + '" schema' };
4281
4905
  if (vErrors === null) {
4282
- vErrors = [err32];
4906
+ vErrors = [err37];
4283
4907
  } else {
4284
- vErrors.push(err32);
4908
+ vErrors.push(err37);
4285
4909
  }
4286
4910
  errors++;
4287
4911
  }
@@ -4290,11 +4914,11 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
4290
4914
  ifClause2 = "else";
4291
4915
  }
4292
4916
  if (!valid15) {
4293
- const err33 = { instancePath, schemaPath: "#/else/else/if", keyword: "if", params: { failingKeyword: ifClause2 }, message: 'must match "' + ifClause2 + '" schema' };
4917
+ const err38 = { instancePath, schemaPath: "#/else/else/if", keyword: "if", params: { failingKeyword: ifClause2 }, message: 'must match "' + ifClause2 + '" schema' };
4294
4918
  if (vErrors === null) {
4295
- vErrors = [err33];
4919
+ vErrors = [err38];
4296
4920
  } else {
4297
- vErrors.push(err33);
4921
+ vErrors.push(err38);
4298
4922
  }
4299
4923
  errors++;
4300
4924
  }
@@ -4303,21 +4927,21 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
4303
4927
  ifClause1 = "else";
4304
4928
  }
4305
4929
  if (!valid6) {
4306
- const err34 = { instancePath, schemaPath: "#/else/if", keyword: "if", params: { failingKeyword: ifClause1 }, message: 'must match "' + ifClause1 + '" schema' };
4930
+ const err39 = { instancePath, schemaPath: "#/else/if", keyword: "if", params: { failingKeyword: ifClause1 }, message: 'must match "' + ifClause1 + '" schema' };
4307
4931
  if (vErrors === null) {
4308
- vErrors = [err34];
4932
+ vErrors = [err39];
4309
4933
  } else {
4310
- vErrors.push(err34);
4934
+ vErrors.push(err39);
4311
4935
  }
4312
4936
  errors++;
4313
4937
  }
4314
4938
  if (data && typeof data == "object" && !Array.isArray(data)) {
4315
4939
  if (data.sequence !== void 0) {
4316
- const err35 = { instancePath: instancePath + "/sequence", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4940
+ const err40 = { instancePath: instancePath + "/sequence", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
4317
4941
  if (vErrors === null) {
4318
- vErrors = [err35];
4942
+ vErrors = [err40];
4319
4943
  } else {
4320
- vErrors.push(err35);
4944
+ vErrors.push(err40);
4321
4945
  }
4322
4946
  errors++;
4323
4947
  }
@@ -4327,245 +4951,245 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
4327
4951
  ifClause0 = "else";
4328
4952
  }
4329
4953
  if (!valid0) {
4330
- const err36 = { instancePath, schemaPath: "#/if", keyword: "if", params: { failingKeyword: ifClause0 }, message: 'must match "' + ifClause0 + '" schema' };
4954
+ const err41 = { instancePath, schemaPath: "#/if", keyword: "if", params: { failingKeyword: ifClause0 }, message: 'must match "' + ifClause0 + '" schema' };
4331
4955
  if (vErrors === null) {
4332
- vErrors = [err36];
4956
+ vErrors = [err41];
4333
4957
  } else {
4334
- vErrors.push(err36);
4958
+ vErrors.push(err41);
4335
4959
  }
4336
4960
  errors++;
4337
4961
  }
4338
4962
  if (data && typeof data == "object" && !Array.isArray(data)) {
4339
4963
  if (data.version === void 0) {
4340
- const err37 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "version" }, message: "must have required property 'version'" };
4964
+ const err42 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "version" }, message: "must have required property 'version'" };
4341
4965
  if (vErrors === null) {
4342
- vErrors = [err37];
4966
+ vErrors = [err42];
4343
4967
  } else {
4344
- vErrors.push(err37);
4968
+ vErrors.push(err42);
4345
4969
  }
4346
4970
  errors++;
4347
4971
  }
4348
4972
  if (data.kind === void 0) {
4349
- const err38 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "kind" }, message: "must have required property 'kind'" };
4973
+ const err43 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "kind" }, message: "must have required property 'kind'" };
4350
4974
  if (vErrors === null) {
4351
- vErrors = [err38];
4975
+ vErrors = [err43];
4352
4976
  } else {
4353
- vErrors.push(err38);
4977
+ vErrors.push(err43);
4354
4978
  }
4355
4979
  errors++;
4356
4980
  }
4357
4981
  if (data.title === void 0) {
4358
- const err39 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "title" }, message: "must have required property 'title'" };
4982
+ const err44 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "title" }, message: "must have required property 'title'" };
4359
4983
  if (vErrors === null) {
4360
- vErrors = [err39];
4984
+ vErrors = [err44];
4361
4985
  } else {
4362
- vErrors.push(err39);
4986
+ vErrors.push(err44);
4363
4987
  }
4364
4988
  errors++;
4365
4989
  }
4366
4990
  if (data.boxes === void 0) {
4367
- const err40 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "boxes" }, message: "must have required property 'boxes'" };
4991
+ const err45 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "boxes" }, message: "must have required property 'boxes'" };
4368
4992
  if (vErrors === null) {
4369
- vErrors = [err40];
4993
+ vErrors = [err45];
4370
4994
  } else {
4371
- vErrors.push(err40);
4995
+ vErrors.push(err45);
4372
4996
  }
4373
4997
  errors++;
4374
4998
  }
4375
4999
  if (data.steps === void 0) {
4376
- const err41 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "steps" }, message: "must have required property 'steps'" };
5000
+ const err46 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "steps" }, message: "must have required property 'steps'" };
4377
5001
  if (vErrors === null) {
4378
- vErrors = [err41];
5002
+ vErrors = [err46];
4379
5003
  } else {
4380
- vErrors.push(err41);
5004
+ vErrors.push(err46);
4381
5005
  }
4382
5006
  errors++;
4383
5007
  }
4384
5008
  for (const key0 in data) {
4385
5009
  if (!func2.call(schema11.properties, key0)) {
4386
- const err42 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
5010
+ const err47 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
4387
5011
  if (vErrors === null) {
4388
- vErrors = [err42];
5012
+ vErrors = [err47];
4389
5013
  } else {
4390
- vErrors.push(err42);
5014
+ vErrors.push(err47);
4391
5015
  }
4392
5016
  errors++;
4393
5017
  }
4394
5018
  }
4395
5019
  if (data.version !== void 0) {
4396
- let data37 = data.version;
4397
- if (!(typeof data37 == "number" && (!(data37 % 1) && !isNaN(data37)) && isFinite(data37))) {
4398
- const err43 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
5020
+ let data40 = data.version;
5021
+ if (!(typeof data40 == "number" && (!(data40 % 1) && !isNaN(data40)) && isFinite(data40))) {
5022
+ const err48 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
4399
5023
  if (vErrors === null) {
4400
- vErrors = [err43];
5024
+ vErrors = [err48];
4401
5025
  } else {
4402
- vErrors.push(err43);
5026
+ vErrors.push(err48);
4403
5027
  }
4404
5028
  errors++;
4405
5029
  }
4406
- if (typeof data37 == "number" && isFinite(data37)) {
4407
- if (data37 < 1 || isNaN(data37)) {
4408
- const err44 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
5030
+ if (typeof data40 == "number" && isFinite(data40)) {
5031
+ if (data40 < 1 || isNaN(data40)) {
5032
+ const err49 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
4409
5033
  if (vErrors === null) {
4410
- vErrors = [err44];
5034
+ vErrors = [err49];
4411
5035
  } else {
4412
- vErrors.push(err44);
5036
+ vErrors.push(err49);
4413
5037
  }
4414
5038
  errors++;
4415
5039
  }
4416
5040
  }
4417
5041
  }
4418
5042
  if (data.kind !== void 0) {
4419
- let data38 = data.kind;
4420
- if (!(data38 === "sequence" || data38 === "architecture" || data38 === "state" || data38 === "git" || data38 === "time")) {
4421
- 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" };
5043
+ let data41 = data.kind;
5044
+ if (!(data41 === "sequence" || data41 === "architecture" || data41 === "state" || data41 === "git" || data41 === "time" || data41 === "tree")) {
5045
+ 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" };
4422
5046
  if (vErrors === null) {
4423
- vErrors = [err45];
5047
+ vErrors = [err50];
4424
5048
  } else {
4425
- vErrors.push(err45);
5049
+ vErrors.push(err50);
4426
5050
  }
4427
5051
  errors++;
4428
5052
  }
4429
5053
  }
4430
5054
  if (data.title !== void 0) {
4431
- let data39 = data.title;
4432
- if (typeof data39 === "string") {
4433
- if (func3(data39) < 1) {
4434
- const err46 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
5055
+ let data42 = data.title;
5056
+ if (typeof data42 === "string") {
5057
+ if (func3(data42) < 1) {
5058
+ const err51 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
4435
5059
  if (vErrors === null) {
4436
- vErrors = [err46];
5060
+ vErrors = [err51];
4437
5061
  } else {
4438
- vErrors.push(err46);
5062
+ vErrors.push(err51);
4439
5063
  }
4440
5064
  errors++;
4441
5065
  }
4442
5066
  } else {
4443
- const err47 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5067
+ const err52 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
4444
5068
  if (vErrors === null) {
4445
- vErrors = [err47];
5069
+ vErrors = [err52];
4446
5070
  } else {
4447
- vErrors.push(err47);
5071
+ vErrors.push(err52);
4448
5072
  }
4449
5073
  errors++;
4450
5074
  }
4451
5075
  }
4452
5076
  if (data.view !== void 0) {
4453
- let data40 = data.view;
4454
- if (!(data40 === "fixed" || data40 === "follow")) {
4455
- 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" };
5077
+ let data43 = data.view;
5078
+ if (!(data43 === "fixed" || data43 === "follow")) {
5079
+ 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" };
4456
5080
  if (vErrors === null) {
4457
- vErrors = [err48];
5081
+ vErrors = [err53];
4458
5082
  } else {
4459
- vErrors.push(err48);
5083
+ vErrors.push(err53);
4460
5084
  }
4461
5085
  errors++;
4462
5086
  }
4463
5087
  }
4464
5088
  if (data.regions !== void 0) {
4465
- let data41 = data.regions;
4466
- if (Array.isArray(data41)) {
4467
- const len3 = data41.length;
4468
- for (let i3 = 0; i3 < len3; i3++) {
4469
- if (!validate22(data41[i3], { instancePath: instancePath + "/regions/" + i3, parentData: data41, parentDataProperty: i3, rootData })) {
4470
- vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);
5089
+ let data44 = data.regions;
5090
+ if (Array.isArray(data44)) {
5091
+ const len1 = data44.length;
5092
+ for (let i1 = 0; i1 < len1; i1++) {
5093
+ if (!validate27(data44[i1], { instancePath: instancePath + "/regions/" + i1, parentData: data44, parentDataProperty: i1, rootData })) {
5094
+ vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);
4471
5095
  errors = vErrors.length;
4472
5096
  }
4473
5097
  }
4474
5098
  } else {
4475
- const err49 = { instancePath: instancePath + "/regions", schemaPath: "#/properties/regions/type", keyword: "type", params: { type: "array" }, message: "must be array" };
5099
+ const err54 = { instancePath: instancePath + "/regions", schemaPath: "#/properties/regions/type", keyword: "type", params: { type: "array" }, message: "must be array" };
4476
5100
  if (vErrors === null) {
4477
- vErrors = [err49];
5101
+ vErrors = [err54];
4478
5102
  } else {
4479
- vErrors.push(err49);
5103
+ vErrors.push(err54);
4480
5104
  }
4481
5105
  errors++;
4482
5106
  }
4483
5107
  }
4484
5108
  if (data.boxes !== void 0) {
4485
- let data43 = data.boxes;
4486
- if (Array.isArray(data43)) {
4487
- const len4 = data43.length;
4488
- for (let i4 = 0; i4 < len4; i4++) {
4489
- if (!validate24(data43[i4], { instancePath: instancePath + "/boxes/" + i4, parentData: data43, parentDataProperty: i4, rootData })) {
4490
- vErrors = vErrors === null ? validate24.errors : vErrors.concat(validate24.errors);
5109
+ let data46 = data.boxes;
5110
+ if (Array.isArray(data46)) {
5111
+ const len2 = data46.length;
5112
+ for (let i2 = 0; i2 < len2; i2++) {
5113
+ if (!validate29(data46[i2], { instancePath: instancePath + "/boxes/" + i2, parentData: data46, parentDataProperty: i2, rootData })) {
5114
+ vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);
4491
5115
  errors = vErrors.length;
4492
5116
  }
4493
5117
  }
4494
5118
  } else {
4495
- const err50 = { instancePath: instancePath + "/boxes", schemaPath: "#/properties/boxes/type", keyword: "type", params: { type: "array" }, message: "must be array" };
5119
+ const err55 = { instancePath: instancePath + "/boxes", schemaPath: "#/properties/boxes/type", keyword: "type", params: { type: "array" }, message: "must be array" };
4496
5120
  if (vErrors === null) {
4497
- vErrors = [err50];
5121
+ vErrors = [err55];
4498
5122
  } else {
4499
- vErrors.push(err50);
5123
+ vErrors.push(err55);
4500
5124
  }
4501
5125
  errors++;
4502
5126
  }
4503
5127
  }
4504
5128
  if (data.strip !== void 0) {
4505
- if (!validate26(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
4506
- vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors);
5129
+ if (!validate31(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
5130
+ vErrors = vErrors === null ? validate31.errors : vErrors.concat(validate31.errors);
4507
5131
  errors = vErrors.length;
4508
5132
  }
4509
5133
  }
4510
5134
  if (data.steps !== void 0) {
4511
- let data46 = data.steps;
4512
- if (Array.isArray(data46)) {
4513
- if (data46.length < 1) {
4514
- const err51 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
5135
+ let data49 = data.steps;
5136
+ if (Array.isArray(data49)) {
5137
+ if (data49.length < 1) {
5138
+ const err56 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
4515
5139
  if (vErrors === null) {
4516
- vErrors = [err51];
5140
+ vErrors = [err56];
4517
5141
  } else {
4518
- vErrors.push(err51);
5142
+ vErrors.push(err56);
4519
5143
  }
4520
5144
  errors++;
4521
5145
  }
4522
- const len5 = data46.length;
4523
- for (let i5 = 0; i5 < len5; i5++) {
4524
- if (!validate30(data46[i5], { instancePath: instancePath + "/steps/" + i5, parentData: data46, parentDataProperty: i5, rootData })) {
4525
- vErrors = vErrors === null ? validate30.errors : vErrors.concat(validate30.errors);
5146
+ const len3 = data49.length;
5147
+ for (let i3 = 0; i3 < len3; i3++) {
5148
+ if (!validate35(data49[i3], { instancePath: instancePath + "/steps/" + i3, parentData: data49, parentDataProperty: i3, rootData })) {
5149
+ vErrors = vErrors === null ? validate35.errors : vErrors.concat(validate35.errors);
4526
5150
  errors = vErrors.length;
4527
5151
  }
4528
5152
  }
4529
5153
  } else {
4530
- const err52 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/type", keyword: "type", params: { type: "array" }, message: "must be array" };
5154
+ const err57 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/type", keyword: "type", params: { type: "array" }, message: "must be array" };
4531
5155
  if (vErrors === null) {
4532
- vErrors = [err52];
5156
+ vErrors = [err57];
4533
5157
  } else {
4534
- vErrors.push(err52);
5158
+ vErrors.push(err57);
4535
5159
  }
4536
5160
  errors++;
4537
5161
  }
4538
5162
  }
4539
5163
  if (data.sequence !== void 0) {
4540
- if (!validate38(data.sequence, { instancePath: instancePath + "/sequence", parentData: data, parentDataProperty: "sequence", rootData })) {
4541
- vErrors = vErrors === null ? validate38.errors : vErrors.concat(validate38.errors);
5164
+ if (!validate43(data.sequence, { instancePath: instancePath + "/sequence", parentData: data, parentDataProperty: "sequence", rootData })) {
5165
+ vErrors = vErrors === null ? validate43.errors : vErrors.concat(validate43.errors);
4542
5166
  errors = vErrors.length;
4543
5167
  }
4544
5168
  }
4545
5169
  if (data.state !== void 0) {
4546
- if (!validate40(data.state, { instancePath: instancePath + "/state", parentData: data, parentDataProperty: "state", rootData })) {
4547
- vErrors = vErrors === null ? validate40.errors : vErrors.concat(validate40.errors);
5170
+ if (!validate45(data.state, { instancePath: instancePath + "/state", parentData: data, parentDataProperty: "state", rootData })) {
5171
+ vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors);
4548
5172
  errors = vErrors.length;
4549
5173
  }
4550
5174
  }
4551
5175
  if (data.git !== void 0) {
4552
- if (!validate44(data.git, { instancePath: instancePath + "/git", parentData: data, parentDataProperty: "git", rootData })) {
4553
- vErrors = vErrors === null ? validate44.errors : vErrors.concat(validate44.errors);
5176
+ if (!validate49(data.git, { instancePath: instancePath + "/git", parentData: data, parentDataProperty: "git", rootData })) {
5177
+ vErrors = vErrors === null ? validate49.errors : vErrors.concat(validate49.errors);
4554
5178
  errors = vErrors.length;
4555
5179
  }
4556
5180
  }
4557
5181
  if (data.time !== void 0) {
4558
- if (!validate48(data.time, { instancePath: instancePath + "/time", parentData: data, parentDataProperty: "time", rootData })) {
4559
- vErrors = vErrors === null ? validate48.errors : vErrors.concat(validate48.errors);
5182
+ if (!validate53(data.time, { instancePath: instancePath + "/time", parentData: data, parentDataProperty: "time", rootData })) {
5183
+ vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);
4560
5184
  errors = vErrors.length;
4561
5185
  }
4562
5186
  }
4563
5187
  } else {
4564
- const err53 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5188
+ const err58 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
4565
5189
  if (vErrors === null) {
4566
- vErrors = [err53];
5190
+ vErrors = [err58];
4567
5191
  } else {
4568
- vErrors.push(err53);
5192
+ vErrors.push(err58);
4569
5193
  }
4570
5194
  errors++;
4571
5195
  }
@@ -4575,11 +5199,12 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
4575
5199
 
4576
5200
  // src/words.ts
4577
5201
  var keys = (table) => Object.keys(table);
4578
- var KINDS = keys({ sequence: true, architecture: true, state: true, git: true, time: true });
5202
+ var KINDS = keys({ sequence: true, architecture: true, state: true, git: true, time: true, tree: true });
4579
5203
  var STATE_ENDS = ["start", "finish"];
4580
5204
  var TIME_HEADS = ["scale", "period", "row", "point", "zoom", "mark", "span"];
4581
5205
  var NOW = "now";
4582
- var HEADS = ["group", "end", "box", "strip", "step", "say", "code", "source", "act", "note", "set", "branch", "commit", ...TIME_HEADS];
5206
+ var TREE_HEADS = ["leaf", "node"];
5207
+ var HEADS = ["group", "end", "box", "strip", "step", "say", "code", "source", "act", "note", "set", "branch", "commit", ...TIME_HEADS, ...TREE_HEADS];
4583
5208
  var AS = "as";
4584
5209
  var ON = "on";
4585
5210
  var COPY = "copy";
@@ -4587,6 +5212,7 @@ var MERGE = "merge";
4587
5212
  var FROM = "from";
4588
5213
  var HEAD = "HEAD";
4589
5214
  var AT = "at";
5215
+ var OF = "of";
4590
5216
  var ATTRS = {
4591
5217
  diagram: ["view"],
4592
5218
  group: ["note", "color", "icon"],
@@ -4598,6 +5224,8 @@ var ATTRS = {
4598
5224
  strip: ["meter"],
4599
5225
  branch: ["note"],
4600
5226
  commit: ["hash", "note"],
5227
+ leaf: ["hash"],
5228
+ node: ["hash"],
4601
5229
  scale: ["from"],
4602
5230
  period: ["from"],
4603
5231
  row: ["color", "empty"],
@@ -4621,7 +5249,7 @@ var OLD_HEADS = {
4621
5249
 
4622
5250
  // src/schema.ts
4623
5251
  var COLORS = ["blue", "amber", "green", "violet", "rose", "slate", "coin"];
4624
- var EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span"];
5252
+ var EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span", "leaf", "node"];
4625
5253
  var ABSENT = "#/definitions/absent/not";
4626
5254
  var ABSENT_KINDS = { regions: "sequence / architecture / state", at: "time", into: "time", color: "time", meters: "time" };
4627
5255
  var NOT_ALLOWED = {
@@ -4632,6 +5260,8 @@ var GIT_EVENT = /\/events\/items\/properties\/type\/not$/u;
4632
5260
  var GIT_EVENTS = ["commit", "branch"];
4633
5261
  var TIME_EVENT = /\/events\/items\/not$/u;
4634
5262
  var TIME_EVENTS = ["now", "mark", "span"];
5263
+ var TREE_EVENT = /\/events\/items\/allOf\/0\/not$/u;
5264
+ var TREE_EVENTS = ["leaf", "node"];
4635
5265
  var DURATION = /^\^\[0-9\]\+\(\\\.\[0-9\]\+\)\?\(([a-z|]+)\)\$$/u;
4636
5266
  var RATIO = /%\)\$$/u;
4637
5267
  var escape = (key2) => key2.replaceAll("~", "~0").replaceAll("/", "~1");
@@ -4662,6 +5292,7 @@ function toFieldError(error, errors, m) {
4662
5292
  if (RESERVED_ID.test(error.schemaPath)) return { pointer: at, message: m.reserved(STATE_ENDS) };
4663
5293
  if (GIT_EVENT.test(error.schemaPath)) return { pointer: at, message: m.kindOnly(GIT_EVENTS, "git") };
4664
5294
  if (TIME_EVENT.test(error.schemaPath)) return { pointer: `${at}/type`, message: m.kindOnly(TIME_EVENTS, "time") };
5295
+ if (TREE_EVENT.test(error.schemaPath)) return { pointer: `${at}/type`, message: m.kindOnly(TREE_EVENTS, "tree") };
4665
5296
  const last = at.slice(at.lastIndexOf("/") + 1);
4666
5297
  if (error.schemaPath === ABSENT) return { pointer: at, message: m.not({ field: last, kind: ABSENT_KINDS[last] ?? last }) };
4667
5298
  const allowed = NOT_ALLOWED[last];
@@ -4750,7 +5381,7 @@ var ja2 = () => {
4750
5381
  emptyCode: "code \u306E\u5F8C\u308D\u306B\u547D\u4EE4\u3092\u66F8\u304F",
4751
5382
  sourceShape: "source \u306F source <\u540D\u524D> [url: <URL>] \u306E\u5F62\u3067\u66F8\u304F",
4752
5383
  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",
4753
- 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",
5384
+ 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",
4754
5385
  nestedGroup: "group \u306E\u4E2D\u306B group \u306F\u66F8\u3051\u306A\u3044\u3002\u5148\u306B end \u3067\u9589\u3058\u308B",
4755
5386
  strayEnd: "end \u306E\u524D\u306B\u3001\u9589\u3058\u308B group \u304C\u7121\u3044",
4756
5387
  endTakesNothing: "end \u306E\u5F8C\u308D\u306B\u306F\u4F55\u3082\u66F8\u304B\u306A\u3044",
@@ -4798,6 +5429,15 @@ var ja2 = () => {
4798
5429
  headReserved: (name2) => `${name2} \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`,
4799
5430
  badHash: "hash \u306F 0 \u304B\u3089 9 \u3068 a \u304B\u3089 f \u306E\u5B57\u3067 4 \u304B\u3089 40 \u5B57\u306B\u3059\u308B",
4800
5431
  timeOnly: (word) => `${word} \u306F time (\u6642\u9593\u8EF8\u306E\u56F3) \u3067\u3060\u3051\u66F8\u3051\u308B`,
5432
+ treeOnly: (word) => `${word} \u306E\u884C\u306F tree (\u6728\u306E\u56F3) \u3067\u3060\u3051\u66F8\u3051\u308B`,
5433
+ 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",
5434
+ noLeaves: "leaf \u306E\u884C\u3067\u8449\u3092 1 \u3064\u4EE5\u4E0A\u66F8\u304F",
5435
+ leafShape: "leaf \u306F leaf <\u540D\u672D> [hash: <hash>] \u306E\u5F62\u3067\u66F8\u304F",
5436
+ nodeShape: "node \u306F node <\u540D\u672D> of <\u5B50>, <\u5B50> [hash: <hash>] \u306E\u5F62\u3067\u66F8\u304F",
5437
+ 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`,
5438
+ 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`,
5439
+ 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`,
5440
+ 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`,
4801
5441
  timeTwice: (word) => `${word} \u306F 1 \u3064\u3060\u3051\u5BA3\u8A00\u3059\u308B`,
4802
5442
  noScale: "scale \u306E\u884C\u3067\u76EE\u76DB\u308A\u3092\u5BA3\u8A00\u3059\u308B",
4803
5443
  noRows: "row \u306E\u884C\u3067\u5370\u306E\u5217\u3092 1 \u3064\u4EE5\u4E0A\u5BA3\u8A00\u3059\u308B",
@@ -4863,7 +5503,7 @@ var en2 = () => {
4863
5503
  emptyCode: "Write the command after code",
4864
5504
  sourceShape: "Write a source as source <name> [url: <URL>]",
4865
5505
  declarationInStep: "Write group, box, strip, branch, scale, period, row, point and zoom before the first step",
4866
- stepLineBeforeStep: "Write lines, say, code, source, act, note, set, commit, branch cuts, now, mark and span under a step",
5506
+ stepLineBeforeStep: "Write lines, say, code, source, act, note, set, commit, branch cuts, now, mark, span, leaf and node under a step",
4867
5507
  nestedGroup: "A group cannot hold another group. Close it with end first",
4868
5508
  strayEnd: "There is no group for this end to close",
4869
5509
  endTakesNothing: "Write nothing after end",
@@ -4911,6 +5551,15 @@ var en2 = () => {
4911
5551
  headReserved: (name2) => `${name2} names where you are in a git diagram and cannot be an id`,
4912
5552
  badHash: "Write a hash as 4 to 40 characters of 0-9 and a-f",
4913
5553
  timeOnly: (word) => `${word} can be written only in time diagrams`,
5554
+ treeOnly: (word) => `${word} lines can be written only in tree diagrams`,
5555
+ treeNoGroup: "A tree diagram takes no group. Write the tree boxes with leaf and node lines",
5556
+ noLeaves: "Write at least one leaf with a leaf line",
5557
+ leafShape: "Write a leaf as leaf <id> [hash: <hash>]",
5558
+ nodeShape: "Write a node as node <id> of <child>, <child> [hash: <hash>]",
5559
+ noTreeChild: (id) => `No leaf or node named ${id} has been written yet. A child must be an id written earlier with leaf or node`,
5560
+ 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`,
5561
+ twoParents: (id) => `${id} is already a child of another node. A tree box has only one parent`,
5562
+ 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`,
4914
5563
  timeTwice: (word) => `Declare only one ${word}`,
4915
5564
  noScale: "Declare the scale with a scale line",
4916
5565
  noRows: "Declare at least one row with a row line",
@@ -4990,6 +5639,8 @@ var ID = /^[^\s[\]「」=:]+$/u;
4990
5639
  var EDGE = /^([^\s:[\]]+?)\s*->\s*([^\s:[\]]+)/du;
4991
5640
  var COMMIT = new RegExp(`^commit\\s+([^\\s[]+)(?:\\s+${ON}\\s+([^\\s[]+))?(?:\\s+${COPY}\\s+([^\\s[]+))?(?:\\s+${MERGE}\\s+([^\\s[]+))?`, "du");
4992
5641
  var CUT = new RegExp(`^([^\\s[]+)\\s+${FROM}(?:\\s+([^\\s[]+))?\\s*$`, "du");
5642
+ var LEAF = /^leaf\s+([^\s[]+)/du;
5643
+ var NODE = new RegExp(`^node\\s+([^\\s[]+)\\s+${OF}\\s+`, "du");
4993
5644
  var HASH = /^[0-9a-f]{4,40}$/u;
4994
5645
  var URL_FORM = /^(\/|https?:\/\/)/u;
4995
5646
  var SCALE = /^scale\s+(\S+)\s+(\S+)\s+([^\s[]+)/du;
@@ -5155,6 +5806,9 @@ function parseLines(lines, m) {
5155
5806
  const isState = kind === "state";
5156
5807
  const isGit = kind === "git";
5157
5808
  const isTime = kind === "time";
5809
+ const isTree = kind === "tree";
5810
+ const trees = /* @__PURE__ */ new Map();
5811
+ const parents = /* @__PURE__ */ new Map();
5158
5812
  let scale;
5159
5813
  let period;
5160
5814
  const rows = [];
@@ -5202,6 +5856,7 @@ function parseLines(lines, m) {
5202
5856
  if (!boxes.some((box) => box.id === id) && !points.some((point) => point.id === id)) throw fail(source, at, m.undeclaredNote(id));
5203
5857
  return id;
5204
5858
  }
5859
+ if (isTree && trees.has(id)) return id;
5205
5860
  if (!isState || !isOneOf(STATE_ENDS, id)) return boxAt(source, id, at);
5206
5861
  if (id === "start" !== (side2 === "from")) throw fail(source, at, id === "start" ? m.intoStart : m.outOfFinish);
5207
5862
  return id;
@@ -5252,6 +5907,7 @@ function parseLines(lines, m) {
5252
5907
  }
5253
5908
  if (!isGit && (word === "branch" || word === "commit")) throw fail(source, 0, m.gitOnly(word));
5254
5909
  if (!isTime && isOneOf(TIME_HEADS, word)) throw fail(source, 0, m.timeOnly(word));
5910
+ if (!isTree && isOneOf(TREE_HEADS, word)) throw fail(source, 0, m.treeOnly(word));
5255
5911
  if (!isOneOf(HEADS, word)) {
5256
5912
  const old = oldForm(text2, building !== void 0);
5257
5913
  throw fail(source, 0, old ? m.oldForm(old.word, old.shape) : m.unknownHead(word));
@@ -5342,14 +5998,29 @@ function parseLines(lines, m) {
5342
5998
  case "span":
5343
5999
  inStep(source).events.push(readSpan(source));
5344
6000
  break;
6001
+ case "leaf": {
6002
+ const step = inStep(source);
6003
+ step.events.push(readLeaf(source));
6004
+ break;
6005
+ }
6006
+ case "node": {
6007
+ const step = inStep(source);
6008
+ step.events.push(readNode(source));
6009
+ break;
6010
+ }
5345
6011
  }
5346
6012
  }
5347
6013
  if (group) throw fail(group.source, 0, m.unclosedGroup(group.id));
5348
6014
  settle();
5349
6015
  finish();
5350
6016
  if (isGit && branches.length === 0) throw fail(head, 0, m.noBranches);
5351
- if (boxes.length === 0 && !isGit && !isTime) throw fail(head, 0, m.noBoxes);
6017
+ if (isTree && trees.size === 0) throw fail(head, 0, m.noLeaves);
6018
+ if (boxes.length === 0 && !isGit && !isTime && !isTree) throw fail(head, 0, m.noBoxes);
5352
6019
  if (steps.length === 0) throw fail(head, 0, m.noSteps);
6020
+ const roots = [...trees.keys()].filter((id) => !parents.has(id));
6021
+ const [root, stray] = roots;
6022
+ const strayAt = stray === void 0 ? void 0 : trees.get(stray);
6023
+ if (root !== void 0 && stray !== void 0 && strayAt) throw fail(strayAt.source, strayAt.at, m.manyRoots(stray, root));
5353
6024
  return {
5354
6025
  version: FORMAT_VERSION,
5355
6026
  kind,
@@ -5530,6 +6201,7 @@ function parseLines(lines, m) {
5530
6201
  function readGroup(source) {
5531
6202
  beforeSteps(source);
5532
6203
  if (isGit) throw fail(source, 0, m.gitNoGroup);
6204
+ if (isTree) throw fail(source, 0, m.treeNoGroup);
5533
6205
  if (group) throw fail(source, 0, m.nestedGroup);
5534
6206
  const declared = readDeclared(source, "group", ATTRS.group, m);
5535
6207
  if (regions.some((region) => region.id === declared.id)) {
@@ -5624,6 +6296,53 @@ function parseLines(lines, m) {
5624
6296
  tips.set(branch, from);
5625
6297
  return { type: "branch", branch, from };
5626
6298
  }
6299
+ function readLeaf(source) {
6300
+ const text2 = source.text;
6301
+ const found = LEAF.exec(text2);
6302
+ const id = found?.[1];
6303
+ if (!found || id === void 0) throw fail(source, 0, m.leafShape);
6304
+ const idAt = found.indices?.[1]?.[0] ?? 0;
6305
+ if (!ID.test(id)) throw fail(source, idAt, m.badId(id));
6306
+ declare(source, id, idAt);
6307
+ trees.set(id, { source, at: idAt });
6308
+ const rest2 = skipSpaces(text2, found[0].length);
6309
+ if (rest2 < text2.length && text2[rest2] !== "[") throw fail(source, rest2, m.leafShape);
6310
+ const hash = treeHash(source, rest2, ATTRS.leaf);
6311
+ return { type: "leaf", id, ...hash !== void 0 ? { hash } : {} };
6312
+ }
6313
+ function readNode(source) {
6314
+ const text2 = source.text;
6315
+ const found = NODE.exec(text2);
6316
+ const id = found?.[1];
6317
+ if (!found || id === void 0) throw fail(source, 0, m.nodeShape);
6318
+ const idAt = found.indices?.[1]?.[0] ?? 0;
6319
+ if (!ID.test(id)) throw fail(source, idAt, m.badId(id));
6320
+ declare(source, id, idAt);
6321
+ const children = [];
6322
+ let end = found[0].length;
6323
+ for (; ; ) {
6324
+ const start = skipSpaces(text2, end);
6325
+ end = start;
6326
+ while (end < text2.length && text2[end] !== "," && text2[end] !== "[") end++;
6327
+ const child = text2.slice(start, end).trim();
6328
+ if (child === "" || !ID.test(child)) throw fail(source, start, m.nodeShape);
6329
+ if (!trees.has(child)) throw fail(source, start, ids.has(child) && child !== id ? m.notTreeBox(child) : m.noTreeChild(child));
6330
+ if (parents.has(child)) throw fail(source, start, m.twoParents(child));
6331
+ parents.set(child, id);
6332
+ children.push(child);
6333
+ if (text2[end] !== ",") break;
6334
+ end++;
6335
+ }
6336
+ const hash = treeHash(source, end, ATTRS.node);
6337
+ trees.set(id, { source, at: idAt });
6338
+ return { type: "node", id, children, ...hash !== void 0 ? { hash } : {} };
6339
+ }
6340
+ function treeHash(source, at, keys2) {
6341
+ if (at >= source.text.length) return void 0;
6342
+ const hash = readAttrs(source, at, keys2, m).get("hash");
6343
+ if (hash && !HASH.test(hash.value)) throw fail(source, hash.at, m.badHash);
6344
+ return hash?.value;
6345
+ }
5627
6346
  function readStrip(source) {
5628
6347
  beforeSteps(source);
5629
6348
  if (strip2) throw fail(source, 0, m.stripTwice);
@@ -5880,6 +6599,10 @@ function event(e, kind) {
5880
6599
  ])}`;
5881
6600
  case "branch":
5882
6601
  return `${e.branch} ${FROM} ${e.from}`;
6602
+ case "leaf":
6603
+ return `leaf ${e.id}${attrs([["hash", e.hash]])}`;
6604
+ case "node":
6605
+ return `node ${e.id} ${OF} ${e.children.join(", ")}${attrs([["hash", e.hash]])}`;
5883
6606
  }
5884
6607
  }
5885
6608
  function timeBlocks(time) {
@@ -6236,6 +6959,15 @@ var TYPE = {
6236
6959
  gitId: text(11, 700),
6237
6960
  gitHash: text(10.5, 600, "mono"),
6238
6961
  gitNote: text(10.5, 650),
6962
+ /**
6963
+ * 木の図 (#3233) の、箱の中の値 (hash) と名札、根の箱の値と名札、葉の下の札の字。
6964
+ * 値を持たない箱の名札は箱の名前 (`boxName`) の字で描く
6965
+ */
6966
+ treeHash: text(13.5, 700, "mono"),
6967
+ treeName: text(10.5, 600),
6968
+ rootHash: text(15, 700, "mono"),
6969
+ rootName: text(11, 700),
6970
+ treeCard: text(11.5, 650),
6239
6971
  /**
6240
6972
  * 時間軸の図 (#3165)。拡大の帯の列の上の字、印の列の名前、時刻の字、区切りの名前と目盛りの番号の範囲、
6241
6973
  * 節目の名札と状態、範囲の括弧の字、空きの枠の字、物差しの線の字。和文を含む字は同じ大きさと太さの和文の字で描く
@@ -6328,6 +7060,36 @@ var LOOK = {
6328
7060
  labelUnder: 50,
6329
7061
  colors: ["blue", "violet", "green", "amber", "rose"]
6330
7062
  },
7063
+ /**
7064
+ * 木の図 (#3233)。step 2 で本人が選んだ「根を上」の試作 (`.context/propose/merkle-look/`) の寸法を写す。
7065
+ * 木の箱は幅の下限 `w`、高さ `h`、字の左右の余白 `padX`、角の丸み `radius`。根の箱は `root` の幅の下限と高さと角の丸みを持ち、
7066
+ * 左に絵柄を置いて (`iconX` は箱の左端から絵柄の左端まで)、`textX` から字を左に揃えて並べ、右に `padR` を空ける。
7067
+ * `nameY` と `hashY` は根の箱の真ん中から名札と値の基準線まで。ほかの箱の値と名札は `hashY` と `nameY`、1 行の字は `oneY` に置く。
7068
+ * 葉は書いた順に横に並べ、隣の葉の箱の間を `slotGap` 空ける。根の上端は図の上の余白から `top` 下げ、深さの段の真ん中どうしは `row` 離す。
7069
+ * `card` は値を持つ葉の下の名札の札で、葉の真ん中から札の真ん中まで `drop`、高さ `h`、幅の下限 `minW`、
7070
+ * 字の左右の余白 `padX`、絵柄の幅 `icon` と絵柄と字の間 `gap`、絵柄の縮み `glyph`、角の丸み `radius`。
7071
+ * `boxGap` は木と木でない箱の列の間、`badgeAlong` は木の線を走る段の番号を、曲がり角から横の線に沿って進める長さ。
7072
+ * `faint` は木の線を運ぶ物が通った段から後に、運ぶ物を送りも受けもしていない木の箱を薄く出す濃さ。`color` と `rootColor` は木の箱と根の箱の色
7073
+ */
7074
+ tree: {
7075
+ w: 74,
7076
+ h: 44,
7077
+ padX: 10,
7078
+ radius: 10,
7079
+ root: { w: 112, h: 54, radius: 13, iconX: 10, textX: 46, padR: 14, nameY: -4, hashY: 14 },
7080
+ hashY: -1,
7081
+ nameY: 14,
7082
+ oneY: 4.5,
7083
+ slotGap: 12,
7084
+ top: 16,
7085
+ row: 102,
7086
+ card: { drop: 78, h: 30, minW: 70, padX: 10, icon: 12, gap: 6, glyph: 0.62, radius: 9 },
7087
+ boxGap: 24,
7088
+ badgeAlong: 22,
7089
+ faint: 0.42,
7090
+ color: "violet",
7091
+ rootColor: "green"
7092
+ },
6331
7093
  /**
6332
7094
  * 時間軸の図 (#3165)。見本帳の試作 (`scenes/finality.js`) の寸法を写す。
6333
7095
  * 図の幅は `width` で、時間軸は左の `axisX` から右の余白 `right` の手前まで。印の列の名前が長い時は、名前の右に `gutterGap` を空けて軸を右へ寄せる。
@@ -6431,7 +7193,10 @@ var LOOK = {
6431
7193
  timePoint: 1.75,
6432
7194
  timeFlag: 1.8,
6433
7195
  timeNeedle: 1.25,
6434
- timeMeter: 1.25
7196
+ timeMeter: 1.25,
7197
+ tree: 1.5,
7198
+ treeTrail: 2.6,
7199
+ treeCon: 1.3
6435
7200
  },
6436
7201
  shadow: { near: 0.8, far: 4, nearY: 1, farY: 3 },
6437
7202
  mini: { w: 168, pad: 8, title: 14, inset: 12, radius: 10 },
@@ -7162,7 +7927,7 @@ function arrange(diagram, groups, slots, rooms) {
7162
7927
  };
7163
7928
  const inset = LOOK.edge.inset;
7164
7929
  const gapX = (col, toRight) => toRight ? colLeft[col] + colW[col] + (between[col] ?? A.columnGap) / 2 : colLeft[col] - (between[col - 1] ?? A.columnGap) / 2;
7165
- const route = (from, to) => {
7930
+ const route2 = (from, to) => {
7166
7931
  const a = byId.get(from);
7167
7932
  const b = byId.get(to);
7168
7933
  if (from === to) return loopUnder(a);
@@ -7235,7 +8000,7 @@ function arrange(diagram, groups, slots, rooms) {
7235
8000
  event: event2,
7236
8001
  from: edge2.from,
7237
8002
  to: edge2.to,
7238
- points: route(edge2.from, edge2.to),
8003
+ points: route2(edge2.from, edge2.to),
7239
8004
  color: edgeColor(edge2, colors),
7240
8005
  carry: edge2.carry
7241
8006
  }));
@@ -7532,11 +8297,11 @@ function layoutGit(diagram) {
7532
8297
  col.set(c.id, k);
7533
8298
  laneLast.set(c.branch, k);
7534
8299
  }
7535
- const linesOf = (c) => [
8300
+ const linesOf2 = (c) => [
7536
8301
  ...c.hash !== void 0 ? [{ text: c.hash, style: TYPE.gitHash }] : [],
7537
8302
  ...c.note !== void 0 ? [{ text: c.note, style: TYPE.gitNote }] : []
7538
8303
  ];
7539
- const textW = (c) => Math.max(0, ...linesOf(c).map((line2) => textWidth(line2.text, line2.style)));
8304
+ const textW = (c) => Math.max(0, ...linesOf2(c).map((line2) => textWidth(line2.text, line2.style)));
7540
8305
  const tagW = (ref) => textWidth(ref, hasWide(ref) ? TYPE.carrierJa : TYPE.carrier) + C.tagPadX * 2;
7541
8306
  const refWidth = Math.max(0, ...walked.refs.map((r) => tagW(r.name)));
7542
8307
  const pitch = Math.max(G.pitch, ...walked.made.map((c) => textW(c) + G.textGap), refWidth + G.textGap);
@@ -7551,7 +8316,7 @@ function layoutGit(diagram) {
7551
8316
  })
7552
8317
  );
7553
8318
  const extraRows = (branch) => Math.max(0, ...walked.made.filter((c) => c.branch === branch).map((c) => (walked.rows.get(c.id) ?? 0) - 2)) * G.row;
7554
- const topText = walked.made.some((c) => laneIndex.get(c.branch) === 0 && linesOf(c).length > 0);
8319
+ const topText = walked.made.some((c) => laneIndex.get(c.branch) === 0 && linesOf2(c).length > 0);
7555
8320
  const lanes = [];
7556
8321
  let y = margin;
7557
8322
  walked.branches.forEach((id, i) => {
@@ -7569,7 +8334,7 @@ function layoutGit(diagram) {
7569
8334
  const isTop = laneIndex.get(c.branch) === 0;
7570
8335
  const cx = x0 + pitch * (col.get(c.id) ?? 0) + (isTop ? 0 : pitch / 2);
7571
8336
  const cy = lane.line;
7572
- const lines = linesOf(c);
8337
+ const lines = linesOf2(c);
7573
8338
  const baselines = lines.map((_, k) => isTop ? cy - G.above - (lines.length - 1 - k) * G.lineStep : cy + G.under + k * G.lineStep);
7574
8339
  const boxes2 = lines.map((line2, k) => textBox(line2.text, cx, baselines[k], line2.style, "middle"));
7575
8340
  const text2 = boxes2.length === 0 ? void 0 : { ...union(boxes2), lines: lines.map((line2) => line2.text), baselines };
@@ -8129,7 +8894,7 @@ function layoutState(diagram, lang) {
8129
8894
  };
8130
8895
  const exitX = (box) => starts && box === first ? box.cx + T.side.entry : box.cx;
8131
8896
  const finishOf = (id) => ends.find((e) => e.kind === "finish" && e.box === id);
8132
- const route = (from, to) => {
8897
+ const route2 = (from, to) => {
8133
8898
  if (from === "start") {
8134
8899
  const start = ends.find((e) => e.kind === "start");
8135
8900
  const target = byId.get(to);
@@ -8173,7 +8938,7 @@ function layoutState(diagram, lang) {
8173
8938
  event: event2,
8174
8939
  from: edge2.from,
8175
8940
  to: edge2.to,
8176
- points: route(edge2.from, edge2.to),
8941
+ points: route2(edge2.from, edge2.to),
8177
8942
  color: colorOf(edge2, colors),
8178
8943
  carry: edge2.carry,
8179
8944
  ...settle ? { settle } : {},
@@ -8190,7 +8955,7 @@ function layoutState(diagram, lang) {
8190
8955
  e.points = e.points.map(([x, y]) => flat ? [x, y + d] : [x + d, y]);
8191
8956
  outward.set(e, flat ? d > 0 ? "below" : "above" : d > 0 ? "right" : "left");
8192
8957
  }
8193
- const paths = notTaken.map((p) => ({ from: p.from, to: p.to, points: route(p.from, p.to) }));
8958
+ const paths = notTaken.map((p) => ({ from: p.from, to: p.to, points: route2(p.from, p.to) }));
8194
8959
  const badgeAt = (edge2, taken, lines2) => edge2.from === edge2.to ? loopBadge(edge2.points) : badgeOnPath(edge2.points, taken, lines2);
8195
8960
  const labels = [];
8196
8961
  const marks = ends.flatMap((e) => e.text === "" ? [] : [textBox(e.text, ...markText(e), TYPE.regionNote)]);
@@ -8723,6 +9488,321 @@ function labelsOf2(diagram, layout) {
8723
9488
  return labels;
8724
9489
  }
8725
9490
 
9491
+ // src/layout/tree.ts
9492
+ var isTreeLayout = (layout) => layout.kind === "tree";
9493
+ function grow2(diagram) {
9494
+ const boxes = new Set(diagram.boxes.map((b) => b.id));
9495
+ const byId = /* @__PURE__ */ new Set();
9496
+ const parents = /* @__PURE__ */ new Map();
9497
+ const grown = [];
9498
+ diagram.steps.forEach((step, s) => {
9499
+ step.events.forEach((e, k) => {
9500
+ if (e.type !== "leaf" && e.type !== "node" || byId.has(e.id) || boxes.has(e.id)) return;
9501
+ const children = e.type === "node" ? [...new Set(e.children)].filter((c) => byId.has(c) && !parents.has(c)) : [];
9502
+ for (const c of children) parents.set(c, e.id);
9503
+ grown.push({ id: e.id, kind: e.type, children, step: s, event: k, ...e.hash !== void 0 ? { hash: e.hash } : {} });
9504
+ byId.add(e.id);
9505
+ });
9506
+ });
9507
+ return { grown, parents };
9508
+ }
9509
+ function linesOf(g, root) {
9510
+ if (g.hash === void 0) return [{ text: g.id, style: TYPE.boxName }];
9511
+ if (root)
9512
+ return [
9513
+ { text: g.id, style: TYPE.rootName },
9514
+ { text: g.hash, style: TYPE.rootHash }
9515
+ ];
9516
+ if (g.kind === "leaf") return [{ text: g.hash, style: TYPE.treeHash }];
9517
+ return [
9518
+ { text: g.hash, style: TYPE.treeHash },
9519
+ { text: g.id, style: TYPE.treeName }
9520
+ ];
9521
+ }
9522
+ function route(a, b) {
9523
+ const i = LOOK.edge.inset;
9524
+ const top = Math.max(a.y, b.y);
9525
+ const bottom = Math.min(a.y + a.h, b.y + b.h);
9526
+ if (bottom > top) {
9527
+ const y = (top + bottom) / 2;
9528
+ return b.x >= a.x + a.w ? [
9529
+ [a.x + a.w + i, y],
9530
+ [b.x - i, y]
9531
+ ] : [
9532
+ [a.x - i, y],
9533
+ [b.x + b.w + i, y]
9534
+ ];
9535
+ }
9536
+ const left = Math.max(a.x, b.x);
9537
+ const right = Math.min(a.x + a.w, b.x + b.w);
9538
+ if (right > left) {
9539
+ const x = (left + right) / 2;
9540
+ return b.y >= a.y + a.h ? [
9541
+ [x, a.y + a.h + i],
9542
+ [x, b.y - i]
9543
+ ] : [
9544
+ [x, a.y - i],
9545
+ [x, b.y + b.h + i]
9546
+ ];
9547
+ }
9548
+ const ax = a.x + a.w / 2;
9549
+ const ty = b.y + b.h / 2;
9550
+ return [
9551
+ [ax, b.y > a.y ? a.y + a.h + i : a.y - i],
9552
+ [ax, ty],
9553
+ [b.x > ax ? b.x - i : b.x + b.w + i, ty]
9554
+ ];
9555
+ }
9556
+ function layoutTree(diagram) {
9557
+ const { margin, gap, box: B, tree: T, badge: BD } = LOOK;
9558
+ const { grown, parents } = grow2(diagram);
9559
+ const tops = grown.filter((g) => !parents.has(g.id));
9560
+ const rootId = tops[tops.length - 1]?.id;
9561
+ const byId = new Map(grown.map((g) => [g.id, g]));
9562
+ const depth = /* @__PURE__ */ new Map();
9563
+ const walk2 = (id, d) => {
9564
+ depth.set(id, d);
9565
+ for (const c of byId.get(id)?.children ?? []) walk2(c, d + 1);
9566
+ };
9567
+ for (const t of tops) walk2(t.id, 0);
9568
+ const texts = new Map(grown.map((g) => [g.id, linesOf(g, g.id === rootId)]));
9569
+ const widest = (id) => Math.max(0, ...(texts.get(id) ?? []).map((line2) => textWidth(line2.text, line2.style)));
9570
+ 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);
9571
+ const cardW = (g) => Math.max(T.card.minW, T.card.padX * 2 + T.card.icon + T.card.gap + textWidth(g.id, TYPE.treeCard));
9572
+ const hasCard = (g) => g.kind === "leaf" && g.hash !== void 0;
9573
+ const slots = grown.filter((g) => g.children.length === 0);
9574
+ 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;
9575
+ const x0 = margin + BD.r * 2 + BD.inset;
9576
+ const xs = /* @__PURE__ */ new Map();
9577
+ slots.forEach((g, i) => xs.set(g.id, x0 + pitch * (i + 0.5)));
9578
+ const xOf = (id) => {
9579
+ const known = xs.get(id);
9580
+ if (known !== void 0) return known;
9581
+ const kids = byId.get(id)?.children ?? [];
9582
+ const x = (xOf(kids[0]) + xOf(kids[kids.length - 1])) / 2;
9583
+ xs.set(id, x);
9584
+ return x;
9585
+ };
9586
+ const top0 = margin + T.top;
9587
+ const yOf = (d) => top0 + T.root.h / 2 + d * T.row;
9588
+ const colors = boxColors(diagram);
9589
+ const nodes = grown.map((g) => {
9590
+ const root = g.id === rootId;
9591
+ const d = depth.get(g.id) ?? 0;
9592
+ const cx = xOf(g.id);
9593
+ const cy = yOf(d);
9594
+ const w = widthOf(g);
9595
+ const h = root ? T.root.h : T.h;
9596
+ const lines = texts.get(g.id) ?? [];
9597
+ const baselines = lines.length === 1 ? [cy + T.oneY] : root ? [cy + T.root.nameY, cy + T.root.hashY] : [cy + T.hashY, cy + T.nameY];
9598
+ const parent = parents.get(g.id);
9599
+ const color = root ? T.rootColor : T.color;
9600
+ colors.set(g.id, color);
9601
+ const cw = cardW(g);
9602
+ return {
9603
+ id: g.id,
9604
+ kind: g.kind,
9605
+ depth: d,
9606
+ ...parent !== void 0 ? { parent } : {},
9607
+ children: g.children,
9608
+ step: g.step,
9609
+ event: g.event,
9610
+ ...g.hash !== void 0 ? { hash: g.hash } : {},
9611
+ root,
9612
+ x: cx - w / 2,
9613
+ y: cy - h / 2,
9614
+ w,
9615
+ h,
9616
+ cx,
9617
+ cy,
9618
+ color,
9619
+ lines: lines.map((line2) => line2.text),
9620
+ baselines,
9621
+ styles: lines.map((line2) => line2.style),
9622
+ ...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 } } : {}
9623
+ };
9624
+ });
9625
+ const placed = new Map(nodes.map((n) => [n.id, n]));
9626
+ const links = nodes.flatMap(
9627
+ (p) => p.children.flatMap((id) => {
9628
+ const c = placed.get(id);
9629
+ if (!c) return [];
9630
+ const mid = (c.y + p.y + p.h) / 2;
9631
+ const points2 = [
9632
+ [c.cx, c.y - LOOK.edge.inset],
9633
+ [c.cx, mid],
9634
+ [p.cx, mid],
9635
+ [p.cx, p.y + p.h + LOOK.edge.inset]
9636
+ ];
9637
+ return [{ from: c.id, to: p.id, step: p.step, event: p.event, points: points2 }];
9638
+ })
9639
+ );
9640
+ const rooms = slotRooms(diagram);
9641
+ const treeRight = Math.max(x0, ...nodes.flatMap((n) => [n.x + n.w, ...n.card ? [n.card.x + n.card.w] : []]));
9642
+ const rootBox = nodes.find((n) => n.root);
9643
+ const ids = new Set(diagram.boxes.map((b) => b.id));
9644
+ 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] : []);
9645
+ const boxX = Math.max(treeRight + T.boxGap, (rootBox ? rootBox.x + rootBox.w : x0) + Math.max(0, ...named) + gap * 2);
9646
+ let by = rootBox?.y ?? top0;
9647
+ const boxes = diagram.boxes.map((b) => {
9648
+ const w = Math.max(boxWidth(diagram, b.id, true), slotBoxWidth(rooms.get(b.id), b.icon !== void 0, B.padX));
9649
+ const y = by;
9650
+ by += B.h + gap;
9651
+ const box = {
9652
+ id: b.id,
9653
+ name: b.name,
9654
+ ...b.sub !== void 0 ? { sub: b.sub } : {},
9655
+ ...b.icon !== void 0 ? { icon: b.icon } : {},
9656
+ color: colors.get(b.id) ?? "slate",
9657
+ x: boxX,
9658
+ y,
9659
+ w,
9660
+ h: B.h,
9661
+ cx: boxX + w / 2,
9662
+ cy: y + B.h / 2
9663
+ };
9664
+ placeSlot(box, rooms.get(b.id));
9665
+ return box;
9666
+ });
9667
+ const boxById = new Map(boxes.map((b) => [b.id, b]));
9668
+ const runs = [];
9669
+ const edges = diagram.steps.flatMap(
9670
+ (step, s) => step.events.flatMap((e, k) => {
9671
+ if (e.type !== "edge") return [];
9672
+ const a = placed.get(e.from) ?? boxById.get(e.from);
9673
+ const b = placed.get(e.to) ?? boxById.get(e.to);
9674
+ if (!a || !b) return [];
9675
+ const up = links.find((l) => l.from === e.from && l.to === e.to);
9676
+ const down = links.find((l) => l.from === e.to && l.to === e.from);
9677
+ const link = up ?? down;
9678
+ if (link) runs.push({ step: s, event: k, link: link.from });
9679
+ 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);
9680
+ return [{ step: s, event: k, from: e.from, to: e.to, points: points2, color: edgeColor(e, colors), carry: e.carry }];
9681
+ })
9682
+ );
9683
+ seatCarriers(edges, boxById, rooms);
9684
+ const layout = {
9685
+ kind: "tree",
9686
+ width: 0,
9687
+ height: 0,
9688
+ regions: [],
9689
+ boxes,
9690
+ lifelines: [],
9691
+ edges,
9692
+ labels: [],
9693
+ actions: [],
9694
+ badges: [],
9695
+ paths: [],
9696
+ ends: [],
9697
+ nodes,
9698
+ links,
9699
+ runs
9700
+ };
9701
+ layout.badges = badgesOf3(diagram, layout);
9702
+ layout.labels = labelsOf3(diagram, layout);
9703
+ const cards = nodes.flatMap((n) => n.card ? [n.card] : []);
9704
+ const solids = [...nodes, ...cards, ...boxes, ...layout.labels];
9705
+ const points = edges.flatMap((e) => e.points);
9706
+ const right = Math.max(...solids.map((r) => r.x + r.w), ...points.map(([x]) => x), x0);
9707
+ const bottom = Math.max(...solids.map((r) => r.y + r.h), ...points.map(([, y]) => y), top0);
9708
+ const width = Math.max(right + margin, stripNeed(diagram) + margin * 2);
9709
+ const strip2 = layoutStrip(diagram, margin, bottom + gap, width - margin * 2);
9710
+ layout.width = width;
9711
+ layout.height = (strip2 ? strip2.y + strip2.h : bottom) + margin;
9712
+ if (strip2) layout.strip = strip2;
9713
+ layout.badges = badgesOf3(diagram, layout);
9714
+ return layout;
9715
+ }
9716
+ function badgesOf3(diagram, layout) {
9717
+ const { r, inset } = LOOK.badge;
9718
+ const apart = r * 2 + inset;
9719
+ const taken = [];
9720
+ const out = [];
9721
+ const solids = [...layout.nodes, ...layout.nodes.flatMap((n) => n.card ? [n.card] : []), ...layout.boxes];
9722
+ 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);
9723
+ const put = (s, p, color) => {
9724
+ taken.push(p);
9725
+ out.push({ step: s, x: p[0], y: p[1], color });
9726
+ };
9727
+ const passed = /* @__PURE__ */ new Map();
9728
+ diagram.steps.forEach((step, s) => {
9729
+ const k = step.events.findIndex((e2) => e2.type === "leaf" || e2.type === "node" || e2.type === "edge");
9730
+ const first = step.events[k];
9731
+ const n = layout.nodes.find((x) => x.step === s && x.event === k);
9732
+ if (first && first.type !== "edge" && n) {
9733
+ const spots = [
9734
+ [n.x - inset - r, n.cy],
9735
+ [n.x, n.y],
9736
+ [n.x + n.w + inset + r, n.cy],
9737
+ [n.x + n.w, n.y]
9738
+ ];
9739
+ put(s, spots.find(free) ?? spots[0], n.color);
9740
+ return;
9741
+ }
9742
+ const e = layout.edges.find((x) => x.step === s && x.event === k);
9743
+ if (first?.type === "edge" && e) {
9744
+ const key2 = [e.from, e.to].sort().join("\n");
9745
+ const run = layout.runs.some((x) => x.step === s && x.event === k);
9746
+ const lines = layout.edges.filter((x) => x !== e).map((x) => x.points);
9747
+ const point = passed.get(key2) ?? (run ? onLink(e.points, free) : midway(e, free)) ?? badgeOnPath(e.points, taken, lines);
9748
+ passed.set(key2, point);
9749
+ put(s, point, e.color);
9750
+ return;
9751
+ }
9752
+ const box = step.events.flatMap((ev) => ev.type === "swap" || ev.type === "action" ? [ev.box] : []).flatMap((id) => layout.boxes.filter((b) => b.id === id))[0];
9753
+ if (box) {
9754
+ out.push({ step: s, x: box.x, y: box.y, color: box.color });
9755
+ return;
9756
+ }
9757
+ if (layout.strip && step.events.some((ev) => ev.type === "strip")) {
9758
+ out.push({ step: s, x: layout.strip.x + inset, y: layout.strip.y + inset, color: "slate" });
9759
+ return;
9760
+ }
9761
+ const before = out[out.length - 1];
9762
+ const root = layout.nodes.find((x) => x.root);
9763
+ out.push(before ? { ...before, step: s } : { step: s, x: root?.x ?? LOOK.margin, y: root?.y ?? LOOK.margin, color: root?.color ?? "slate" });
9764
+ });
9765
+ return replaceSameSpot(out);
9766
+ }
9767
+ function onLink(points, free) {
9768
+ const [p0, p1, p2] = points;
9769
+ const flat = Math.abs(p2[0] - p1[0]);
9770
+ const { r, inset } = LOOK.badge;
9771
+ if (flat >= LOOK.tree.badgeAlong + r) {
9772
+ const p = along(points, pathLength([p0, p1]) + LOOK.tree.badgeAlong);
9773
+ if (free(p)) return p;
9774
+ }
9775
+ const side2 = [p1[0] + r + inset, p1[1]];
9776
+ return free(side2) ? side2 : void 0;
9777
+ }
9778
+ function midway(e, free) {
9779
+ const length = pathLength(e.points);
9780
+ const room = carrierHalf(e.carry)[0] + LOOK.badge.r + LOOK.badge.inset;
9781
+ for (let d = 0; d <= length / 2 - room; d += 1) {
9782
+ for (const at of [length / 2 - d, length / 2 + d]) {
9783
+ const p = along(e.points, at);
9784
+ if (free(p)) return p;
9785
+ }
9786
+ }
9787
+ return void 0;
9788
+ }
9789
+ function labelsOf3(diagram, layout) {
9790
+ const labels = [];
9791
+ const cards = layout.nodes.flatMap((n) => n.card ? [n.card] : []);
9792
+ for (const e of layout.edges) {
9793
+ const source = diagram.steps[e.step]?.events[e.event];
9794
+ if (source?.type !== "edge" || source.label === void 0) continue;
9795
+ const seen = layout.badges.filter((b) => b.step <= e.step).map((b) => badgeRect([b.x, b.y]));
9796
+ labels.push(
9797
+ placeLabel(
9798
+ { step: e.step, event: e.event, text: source.label, points: e.points, color: e.color, ...source.labelSide ? { side: source.labelSide } : {}, flip: true },
9799
+ { hard: [...layout.nodes, ...layout.boxes], soft: [...cards, ...labels.filter((l) => l.step === e.step)], touch: seen }
9800
+ )
9801
+ );
9802
+ }
9803
+ return labels;
9804
+ }
9805
+
8726
9806
  // src/timeline.ts
8727
9807
  function plan(step, needle) {
8728
9808
  const out = { edges: [], events: [], busy: 0 };
@@ -8764,7 +9844,7 @@ function plan(step, needle) {
8764
9844
  return;
8765
9845
  }
8766
9846
  if (event2.type === "now" || needle && pulled(event2)) return;
8767
- if (event2.type === "commit" || event2.type === "branch") {
9847
+ if (event2.type === "commit" || event2.type === "branch" || event2.type === "leaf" || event2.type === "node") {
8768
9848
  const a = cursor;
8769
9849
  const b = a + MOTION.draw;
8770
9850
  out.edges.push({ event: e, a, b, carries: false, coin: false, named: false });
@@ -8990,6 +10070,7 @@ var ICONS = {
8990
10070
  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",
8991
10071
  code: "M -4 -6 l-5 6 l5 6 M 4 -6 l5 6 l-5 6",
8992
10072
  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",
10073
+ 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",
8993
10074
  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"
8994
10075
  };
8995
10076
 
@@ -9247,12 +10328,12 @@ var easeInOut = (t) => t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;
9247
10328
  function carrier(e, time, ctx) {
9248
10329
  const { m } = ctx;
9249
10330
  const n = LOOK.carrier.samples;
9250
- const route = e.wait ? [e.wait, ...e.points] : e.points;
9251
- const length = pathLength(route);
10331
+ const route2 = e.wait ? [e.wait, ...e.points] : e.points;
10332
+ const length = pathLength(route2);
9252
10333
  const { depart: a, arrive: b, start: from, end: gone } = time;
9253
10334
  const path2 = [];
9254
10335
  for (let k = 0; k <= n; k++) {
9255
- const [x, y] = along(route, easeInOut(k / n) * length);
10336
+ const [x, y] = along(route2, easeInOut(k / n) * length);
9256
10337
  path2.push([a + (b - a) * k / n, x, y]);
9257
10338
  }
9258
10339
  const first = path2[0];
@@ -9729,6 +10810,128 @@ function timeFocus(layout, timeline, step, parts, vw, vh) {
9729
10810
  return held;
9730
10811
  }
9731
10812
 
10813
+ // src/render/tree.ts
10814
+ var r14 = (v) => Math.round(v * 100) / 100;
10815
+ function drawTree(layout, diagram, timeline, ctx) {
10816
+ const { m } = ctx;
10817
+ const T = LOOK.tree;
10818
+ const B = LOOK.box;
10819
+ const timeOf = (step, event2) => timeline.edges.find((t) => t.step === step && t.event === event2);
10820
+ const active = /* @__PURE__ */ new Map();
10821
+ const touched = /* @__PURE__ */ new Map();
10822
+ diagram.steps.forEach((step, s) => {
10823
+ for (const e of step.events) {
10824
+ if (e.type !== "edge") continue;
10825
+ for (const id of [e.from, e.to]) {
10826
+ active.set(id, (active.get(id) ?? /* @__PURE__ */ new Set()).add(s));
10827
+ if (e.carry.kind !== "none" && !touched.has(id)) touched.set(id, s);
10828
+ }
10829
+ }
10830
+ });
10831
+ const carries = (step, event2) => {
10832
+ const e = diagram.steps[step]?.events[event2];
10833
+ return e?.type === "edge" && e.carry.kind !== "none";
10834
+ };
10835
+ 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);
10836
+ const fadeAt = fadeStep === void 0 ? void 0 : timeline.steps[fadeStep]?.start;
10837
+ const fadeOf = (id) => {
10838
+ if (fadeStep === void 0 || fadeAt === void 0) return void 0;
10839
+ const t = touched.get(id);
10840
+ if (t !== void 0 && t <= fadeStep) return void 0;
10841
+ const back = t === void 0 ? void 0 : timeline.steps[t]?.start;
10842
+ const frames = [
10843
+ [0, { opacity: 1 }],
10844
+ [fadeAt, { opacity: 1 }, EASE.inOut],
10845
+ [fadeAt + MOTION.fade, { opacity: T.faint }]
10846
+ ];
10847
+ if (back !== void 0) frames.push([back, { opacity: T.faint }, EASE.inOut], [back + MOTION.fade, { opacity: 1 }]);
10848
+ frames.push([m.last, { opacity: back === void 0 ? T.faint : 1 }, EASE.inOut], [m.total, { opacity: 1 }]);
10849
+ return m.kf(frames);
10850
+ };
10851
+ const faded = (id, markup, attrs2 = "") => {
10852
+ const fade = fadeOf(id);
10853
+ return fade ? `<g class="dg-a"${attrs2} style="${fade}">${markup}</g>` : attrs2 === "" ? markup : `<g${attrs2}>${markup}</g>`;
10854
+ };
10855
+ const drawnAt = new Map(layout.nodes.map((n) => [n.id, timeOf(n.step, n.event)?.drawn ?? 0]));
10856
+ const links = layout.links.map((l) => {
10857
+ const time = timeOf(l.step, l.event);
10858
+ if (!time) return "";
10859
+ ctx.traces.push({ from: l.from, to: l.to, points: l.points, shown: [[time.start, Number.POSITIVE_INFINITY]] });
10860
+ const kf = m.kf([
10861
+ [0, { opacity: 0, "stroke-dashoffset": 1 }],
10862
+ [time.start, { opacity: 0, "stroke-dashoffset": 1 }, EASE.inOut],
10863
+ [time.start + 0.05, { opacity: 1 }],
10864
+ [time.drawn, { "stroke-dashoffset": 0 }],
10865
+ [m.last, { opacity: 1, "stroke-dashoffset": 0 }, EASE.inOut],
10866
+ [m.total, { opacity: 0, "stroke-dashoffset": 0 }]
10867
+ ]);
10868
+ 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}"/>`);
10869
+ }).join("");
10870
+ const ties = layout.nodes.flatMap((n) => {
10871
+ if (!n.card) return [];
10872
+ const at = drawnAt.get(n.id) ?? 0;
10873
+ const d = `M ${r14(n.cx)} ${r14(n.y + n.h + LOOK.edge.inset)} V ${r14(n.card.y - LOOK.edge.inset)}`;
10874
+ return [faded(n.id, `<path class="dg-tree-con dg-a" d="${d}" style="${m.vis(at)}"/>`)];
10875
+ }).join("");
10876
+ const traced = /* @__PURE__ */ new Set();
10877
+ const trails = layout.runs.flatMap((run) => {
10878
+ const e = layout.edges.find((x) => x.step === run.step && x.event === run.event);
10879
+ if (!e || traced.has(run.link)) return [];
10880
+ const carried = timeline.carriers.find((c) => c.step === run.step && c.event === run.event);
10881
+ const time = timeOf(run.step, run.event);
10882
+ const a = carried?.depart ?? time?.start;
10883
+ const b = carried?.arrive ?? time?.drawn;
10884
+ if (a === void 0 || b === void 0) return [];
10885
+ traced.add(run.link);
10886
+ const kf = m.kf([
10887
+ [0, { opacity: 0, "stroke-dashoffset": 1 }],
10888
+ [a, { opacity: 0, "stroke-dashoffset": 1 }, EASE.inOut],
10889
+ [a + 0.05, { opacity: 1 }],
10890
+ [b, { "stroke-dashoffset": 0 }],
10891
+ [m.last, { opacity: 1, "stroke-dashoffset": 0 }, EASE.inOut],
10892
+ [m.total, { opacity: 0, "stroke-dashoffset": 0 }]
10893
+ ]);
10894
+ const d = pathOf(e.points);
10895
+ return [
10896
+ `<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>`
10897
+ ];
10898
+ }).join("");
10899
+ const cards = layout.nodes.flatMap((n) => {
10900
+ const c = n.card;
10901
+ if (!c) return [];
10902
+ const gx = c.x + T.card.padX + T.card.icon / 2;
10903
+ const cy = c.y + c.h / 2;
10904
+ 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);
10905
+ return [
10906
+ faded(
10907
+ n.id,
10908
+ `<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}`,
10909
+ ` data-tree-card="${esc(n.id)}"`
10910
+ )
10911
+ ];
10912
+ }).join("");
10913
+ const nodes = layout.nodes.map((n) => {
10914
+ const at = drawnAt.get(n.id) ?? 0;
10915
+ const on = [...active.get(n.id) ?? []].sort((x, y) => x - y);
10916
+ const act = on.length > 0 ? activeKf(ctx, on) : void 0;
10917
+ const radius = n.root ? T.root.radius : T.radius;
10918
+ 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}/>`;
10919
+ 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>` : ""}`;
10920
+ const ix = n.x + T.root.iconX + B.icon / 2;
10921
+ 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)}` : "";
10922
+ const shown2 = [[at, Number.POSITIVE_INFINITY]];
10923
+ const texts = n.lines.map((line2, k) => {
10924
+ const style = n.styles[k] ?? TYPE.boxName;
10925
+ 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";
10926
+ const baseline = n.baselines[k] ?? n.cy;
10927
+ return n.root ? write(ctx.ink, cls, n.x + T.root.textX, baseline, line2, style, shown2) : write(ctx.ink, cls, n.cx, baseline, line2, style, shown2, "middle");
10928
+ }).join("");
10929
+ const inner = faded(n.id, `${frame}${mark}${texts}`, ` data-tree-node="${esc(n.id)}"${n.root ? ` data-tree-root="${esc(n.id)}"` : ""}`);
10930
+ return `<g class="dg-popc dg-a" style="${cs(n.color)};${m.pop(at)}">${inner}</g>`;
10931
+ }).join("");
10932
+ return { links: links + ties, trails, nodes: cards + nodes };
10933
+ }
10934
+
9732
10935
  // src/render/motion.ts
9733
10936
  var r2 = (v) => Math.round(v * 100) / 100;
9734
10937
  var Motion = class {
@@ -9907,6 +11110,19 @@ var PART_CSS = [
9907
11110
  `.dg-git-n{${font(TYPE.gitNote)};fill:var(--ink2)}`,
9908
11111
  `.dg-git-old{fill:var(--surf);stroke:var(--c);stroke-width:${S.gitOrphan};stroke-dasharray:3 3;stroke-opacity:.6}`,
9909
11112
  `.dg-git-oldl{${font(TYPE.gitId)};fill:var(--ct);opacity:.55}`,
11113
+ // 木の図 (#3233)。木の線は線の灰で、運ぶ物が通った跡は運ぶ物の色で引く
11114
+ `.dg-tree-l{fill:none;stroke:var(--line);stroke-width:${S.tree};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,
11115
+ `.dg-tree-tr{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,
11116
+ `.dg-tree-h{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round}`,
11117
+ `.dg-tree-con{fill:none;stroke:var(--line);stroke-width:${S.treeCon};stroke-linecap:round;stroke-dasharray:2 3.5}`,
11118
+ `.dg-tree-card{fill:var(--surf);stroke:var(--hair);stroke-width:${S.hair}}`,
11119
+ `.dg-tree-cg{fill:none;stroke:var(--mute);stroke-width:${S.glyph};stroke-linecap:round;stroke-linejoin:round}`,
11120
+ `.dg-tree-ct{${font(TYPE.treeCard)};fill:var(--ink)}`,
11121
+ `.dg-tree-hash{${font(TYPE.treeHash)};fill:var(--ink)}`,
11122
+ `.dg-tree-name{${font(TYPE.treeName)};fill:var(--mute)}`,
11123
+ `.dg-tree-one{${font(TYPE.boxName)};fill:var(--ink)}`,
11124
+ `.dg-tree-rh{${font(TYPE.rootHash)};fill:var(--ink)}`,
11125
+ `.dg-tree-rn{${font(TYPE.rootName)};fill:var(--mute)}`,
9910
11126
  // 時間軸の図 (#3165)。和文を含む字は、末尾に j を付けた class で同じ大きさと太さの和文の字にする
9911
11127
  `.dg-tm-ep{fill:color-mix(in srgb,var(--ink) ${X.timeShade}%,transparent)}`,
9912
11128
  `.dg-tm-sep{stroke:var(--hair);stroke-width:${S.hair};stroke-dasharray:2 4}`,
@@ -10068,6 +11284,14 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
10068
11284
  L.node.push(git.commits);
10069
11285
  L.top.push(git.tags);
10070
11286
  }
11287
+ const treeLayout = isTreeLayout(layout) ? layout : void 0;
11288
+ if (treeLayout) {
11289
+ const tree = drawTree(treeLayout, diagram, timeline, ctx);
11290
+ L.base.push(tree.links);
11291
+ L.lit.push(tree.trails);
11292
+ L.node.push(tree.nodes);
11293
+ }
11294
+ const runs = new Set((treeLayout?.runs ?? []).map((r) => `${r.step}/${r.event}`));
10071
11295
  const timeLayout = isTimeLayout(layout) ? layout : void 0;
10072
11296
  if (timeLayout) {
10073
11297
  const drawn = drawTime(timeLayout, diagram, timeline, ctx, subs);
@@ -10079,7 +11303,7 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
10079
11303
  const wired = new Set((timeLayout?.wires ?? []).map((w) => `${w.step}/${w.event}`));
10080
11304
  for (const e of layout.edges) {
10081
11305
  const time = timeline.edges.find((t) => t.step === e.step && t.event === e.event);
10082
- if (!time || timeLayout && !wired.has(`${e.step}/${e.event}`)) continue;
11306
+ if (!time || timeLayout && !wired.has(`${e.step}/${e.event}`) || runs.has(`${e.step}/${e.event}`)) continue;
10083
11307
  const drawn = edge(e, time, ctx, isState);
10084
11308
  L.base.push(drawn.base);
10085
11309
  L.lit.push(drawn.lit);
@@ -10110,7 +11334,7 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
10110
11334
  }
10111
11335
  for (const time of timeline.carriers) {
10112
11336
  const e = layout.edges.find((x) => x.step === time.step && x.event === time.event);
10113
- if (e) L.top.push(carrier(e, time, ctx));
11337
+ if (e) L.top.push(carrier(e, treeLayout ? { ...time, start: time.depart, end: time.arrive + MOTION.fade } : time, ctx));
10114
11338
  }
10115
11339
  const content = Object.values(L).map((parts) => parts.join("")).join("");
10116
11340
  const { near, far, nearY, farY } = LOOK.shadow;
@@ -10148,6 +11372,15 @@ function focusParts(layout, diagram, step) {
10148
11372
  rects.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });
10149
11373
  }
10150
11374
  rects.push(...layout.labels.filter((l) => l.step === step), ...layout.actions.filter((a) => a.step === step));
11375
+ if (isTreeLayout(layout)) {
11376
+ const ends = new Set((diagram.steps[step]?.events ?? []).flatMap((e) => e.type === "edge" ? [e.from, e.to] : []));
11377
+ rects.push(...layout.nodes.filter((n) => n.step === step || ends.has(n.id)));
11378
+ for (const l of layout.links.filter((x) => x.step === step)) {
11379
+ const xs = l.points.map((p) => p[0]);
11380
+ const ys = l.points.map((p) => p[1]);
11381
+ rects.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });
11382
+ }
11383
+ }
10151
11384
  for (const event2 of diagram.steps[step]?.events ?? []) {
10152
11385
  const ids = event2.type === "edge" ? [event2.from, event2.to] : event2.type === "action" || event2.type === "swap" ? [event2.box] : [];
10153
11386
  for (const id of ids) {
@@ -10220,7 +11453,8 @@ function followView(layout, timeline, diagram, m, id, content, follow, heads) {
10220
11453
  const overview = () => {
10221
11454
  const shapes = [
10222
11455
  ...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"/>`),
10223
- ...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"/>`)
11456
+ ...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"/>`),
11457
+ ...(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"/>`)
10224
11458
  ].join("");
10225
11459
  const vp = m.move(cam.map(([t, cx, cy, , e]) => [t, mx + (cx - vw / 2) * k, my + (cy - vh / 2) * k, 1, e]));
10226
11460
  return {
@@ -10246,7 +11480,7 @@ function renderDiagram(input, options = {}) {
10246
11480
  const read = readDiagram(input, { lang });
10247
11481
  if (!read.ok) throw new Error(FIGURE_TEXT[lang].cannotDraw(read.errors.map((e) => `${e.pointer} ${e.message}`).join(" / ")));
10248
11482
  const diagram = read.diagram;
10249
- 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);
11483
+ 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);
10250
11484
  return renderLayout(diagram, layout, buildTimeline(diagram, options.still === true), options);
10251
11485
  }
10252
11486
  function renderLayout(diagram, layout, timeline, options = {}) {