pdf-factory 0.6.0 → 0.7.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/{chunk-BcutgqC9.cjs → chunk-C6qsp3rV.cjs} +1 -1
- package/dist/parser.cjs +5 -5
- package/dist/parser.cjs.map +1 -1
- package/dist/parser.js +2 -4
- package/dist/parser.js.map +1 -1
- package/dist/pdf-factory.cjs +1 -1
- package/dist/pdf-factory.cjs.map +1 -1
- package/dist/pdf-factory.js +418 -418
- package/dist/pdf-factory.js.map +1 -1
- package/package.json +3 -19
package/dist/pdf-factory.js
CHANGED
|
@@ -382,11 +382,11 @@ var _ = "itfJunior", v = "combined-tour", y = "grand-slam", b = "officials-signo
|
|
|
382
382
|
function S(e) {
|
|
383
383
|
return x[e];
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function C(e) {
|
|
386
386
|
let t = Object.values(x);
|
|
387
387
|
return e ? t.filter((t) => t.category === e) : t;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function ee(e, t, n) {
|
|
390
390
|
let r = x[e] || x["club-basic"];
|
|
391
391
|
return {
|
|
392
392
|
header: {
|
|
@@ -401,38 +401,38 @@ function te(e, t, n) {
|
|
|
401
401
|
}
|
|
402
402
|
//#endregion
|
|
403
403
|
//#region src/config/factSheetCatalog.ts
|
|
404
|
-
var
|
|
405
|
-
function
|
|
404
|
+
var w = "tournament-header", T = "contacts", E = "events", D = "entry-info", O = "venue-info", k = "accommodation", A = "transportation", j = "hospitality", M = "medical", te = "regulations", ne = "prize-money", re = "officials", ie = "sponsors", ae = "social-events", oe = "custom-notes";
|
|
405
|
+
function N(e, t = !0, n) {
|
|
406
406
|
return {
|
|
407
407
|
type: e,
|
|
408
408
|
enabled: t,
|
|
409
409
|
...n && { title: n }
|
|
410
410
|
};
|
|
411
411
|
}
|
|
412
|
-
var
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
M
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
],
|
|
412
|
+
var se = [
|
|
413
|
+
N(w),
|
|
414
|
+
N(T),
|
|
415
|
+
N(E),
|
|
416
|
+
N(D),
|
|
417
|
+
N(O),
|
|
418
|
+
N(k),
|
|
419
|
+
N(A),
|
|
420
|
+
N(j),
|
|
421
|
+
N(M),
|
|
422
|
+
N(te),
|
|
423
|
+
N(ne),
|
|
424
|
+
N(re),
|
|
425
|
+
N(ie),
|
|
426
|
+
N(ae),
|
|
427
|
+
N(oe)
|
|
428
|
+
], ce = {
|
|
429
429
|
"itf-junior": {
|
|
430
430
|
id: "itf-junior",
|
|
431
431
|
name: "ITF Junior",
|
|
432
432
|
description: "Full fact sheet with all sections — ITF header style",
|
|
433
433
|
category: "itf",
|
|
434
434
|
headerLayout: "itf",
|
|
435
|
-
sections:
|
|
435
|
+
sections: se
|
|
436
436
|
},
|
|
437
437
|
"itf-pro-circuit": {
|
|
438
438
|
id: "itf-pro-circuit",
|
|
@@ -441,15 +441,15 @@ var ce = [
|
|
|
441
441
|
category: "itf",
|
|
442
442
|
headerLayout: "itf",
|
|
443
443
|
sections: [
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
444
|
+
N(w),
|
|
445
|
+
N(T),
|
|
446
|
+
N(E),
|
|
447
|
+
N(D),
|
|
448
|
+
N(O),
|
|
449
|
+
N(ne),
|
|
450
|
+
N(re),
|
|
451
|
+
N(te),
|
|
452
|
+
N(oe)
|
|
453
453
|
]
|
|
454
454
|
},
|
|
455
455
|
"national-federation": {
|
|
@@ -458,7 +458,7 @@ var ce = [
|
|
|
458
458
|
description: "Detailed national federation fact sheet with all logistics",
|
|
459
459
|
category: "national",
|
|
460
460
|
headerLayout: "national-federation",
|
|
461
|
-
sections:
|
|
461
|
+
sections: se
|
|
462
462
|
},
|
|
463
463
|
"tour-atp-wta": {
|
|
464
464
|
id: "tour-atp-wta",
|
|
@@ -467,16 +467,16 @@ var ce = [
|
|
|
467
467
|
category: "tour",
|
|
468
468
|
headerLayout: "wta-tour",
|
|
469
469
|
sections: [
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
470
|
+
N(w),
|
|
471
|
+
N(T),
|
|
472
|
+
N(E),
|
|
473
|
+
N(ne),
|
|
474
|
+
N(re),
|
|
475
|
+
N(ie),
|
|
476
|
+
N(k),
|
|
477
|
+
N(A),
|
|
478
|
+
N(ae),
|
|
479
|
+
N(oe)
|
|
480
480
|
]
|
|
481
481
|
},
|
|
482
482
|
"club-basic": {
|
|
@@ -486,25 +486,25 @@ var ce = [
|
|
|
486
486
|
category: "club",
|
|
487
487
|
headerLayout: "minimal",
|
|
488
488
|
sections: [
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
489
|
+
N(w),
|
|
490
|
+
N(T),
|
|
491
|
+
N(E),
|
|
492
|
+
N(D),
|
|
493
|
+
N(O),
|
|
494
|
+
N(oe)
|
|
495
495
|
]
|
|
496
496
|
}
|
|
497
497
|
};
|
|
498
|
-
function
|
|
499
|
-
return
|
|
498
|
+
function le(e) {
|
|
499
|
+
return ce[e];
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
let t = Object.values(
|
|
501
|
+
function ue(e) {
|
|
502
|
+
let t = Object.values(ce);
|
|
503
503
|
return e ? t.filter((t) => t.category === e) : t;
|
|
504
504
|
}
|
|
505
505
|
//#endregion
|
|
506
506
|
//#region src/core/drawsDataToDrawData.ts
|
|
507
|
-
function
|
|
507
|
+
function P(e) {
|
|
508
508
|
let t = e.roundMatchUps || {}, n = e.roundProfile || {}, r = Object.keys(t).map(Number).sort((e, t) => e - t), i = /* @__PURE__ */ new Map();
|
|
509
509
|
for (let e of r) for (let n of t[e] || []) for (let e of n.sides || []) if (e?.drawPosition && !i.has(e.drawPosition)) {
|
|
510
510
|
let t = e.entryStatus || e.participant?.entryStatus, n = t && t !== "DIRECT_ACCEPTANCE" ? t : void 0;
|
|
@@ -548,12 +548,12 @@ function N(e) {
|
|
|
548
548
|
roundLabelMap: o
|
|
549
549
|
};
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function F(e, t) {
|
|
552
552
|
return e?.[0]?.structures?.find((e) => e.stage === t);
|
|
553
553
|
}
|
|
554
554
|
//#endregion
|
|
555
555
|
//#region src/composition/page.ts
|
|
556
|
-
function
|
|
556
|
+
function de(t, n) {
|
|
557
557
|
let r = t.orientation;
|
|
558
558
|
return r === "auto" && (r = n && n >= 32 ? "landscape" : "portrait"), new e({
|
|
559
559
|
orientation: r,
|
|
@@ -561,7 +561,7 @@ function fe(t, n) {
|
|
|
561
561
|
unit: "mm"
|
|
562
562
|
});
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function I(e, t, n, r) {
|
|
565
565
|
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = t;
|
|
566
566
|
return {
|
|
567
567
|
headerHeight: n,
|
|
@@ -573,7 +573,7 @@ function F(e, t, n, r) {
|
|
|
573
573
|
pageHeight: a
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function fe() {
|
|
577
577
|
return {
|
|
578
578
|
pageSize: "a4",
|
|
579
579
|
orientation: "auto",
|
|
@@ -587,14 +587,14 @@ function pe() {
|
|
|
587
587
|
}
|
|
588
588
|
//#endregion
|
|
589
589
|
//#region src/layout/fonts.ts
|
|
590
|
-
var
|
|
590
|
+
var pe = {
|
|
591
591
|
REGULAR: "helvetica",
|
|
592
592
|
BOLD: "helvetica"
|
|
593
|
-
},
|
|
593
|
+
}, L = {
|
|
594
594
|
NORMAL: "normal",
|
|
595
595
|
BOLD: "bold",
|
|
596
596
|
ITALIC: "italic"
|
|
597
|
-
},
|
|
597
|
+
}, R = {
|
|
598
598
|
TITLE: 16,
|
|
599
599
|
SUBTITLE: 12,
|
|
600
600
|
HEADING: 10,
|
|
@@ -602,24 +602,24 @@ var me = {
|
|
|
602
602
|
SMALL: 7,
|
|
603
603
|
TINY: 6
|
|
604
604
|
};
|
|
605
|
-
function
|
|
606
|
-
e.setFont(
|
|
605
|
+
function z(e, t, n = L.NORMAL) {
|
|
606
|
+
e.setFont(pe.REGULAR, n), e.setFontSize(t);
|
|
607
607
|
}
|
|
608
608
|
//#endregion
|
|
609
609
|
//#region src/composition/headerLayouts.ts
|
|
610
|
-
function
|
|
610
|
+
function B(e, t, n) {
|
|
611
611
|
switch (t.layout) {
|
|
612
|
-
case "grand-slam": return
|
|
613
|
-
case "itf": return
|
|
614
|
-
case "minimal": return
|
|
615
|
-
case "wta-tour": return
|
|
616
|
-
case "national-federation": return
|
|
612
|
+
case "grand-slam": return me(e, t, n);
|
|
613
|
+
case "itf": return he(e, t, n);
|
|
614
|
+
case "minimal": return ge(e, t, n);
|
|
615
|
+
case "wta-tour": return _e(e, t, n);
|
|
616
|
+
case "national-federation": return ve(e, t, n);
|
|
617
617
|
case "none": return 0;
|
|
618
618
|
}
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function me(e, t, n) {
|
|
621
621
|
let { margins: r } = n, i = e.internal.pageSize.getWidth(), a = i - r.right, o = r.top;
|
|
622
|
-
|
|
622
|
+
z(e, 18, L.BOLD), e.text(t.tournamentName.toUpperCase(), i / 2, o, { align: "center" }), o += 7, t.subtitle && (z(e, 12, L.BOLD), e.text(t.subtitle.toUpperCase(), i / 2, o, { align: "center" }), o += 6), z(e, R.BODY, L.NORMAL);
|
|
623
623
|
let s = [];
|
|
624
624
|
if (t.startDate) {
|
|
625
625
|
let e = t.endDate ? `${t.startDate} - ${t.endDate}` : t.startDate;
|
|
@@ -629,23 +629,23 @@ function he(e, t, n) {
|
|
|
629
629
|
e.text(t, a, r.top + n * 4, { align: "right" });
|
|
630
630
|
}), o += 2, e.setDrawColor(0), e.setLineWidth(.5), e.line(r.left, o, a, o), o += 3, o - r.top;
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function he(e, t, n) {
|
|
633
633
|
let { margins: r } = n, i = e.internal.pageSize.getWidth() - r.right, a = r.top;
|
|
634
|
-
|
|
634
|
+
z(e, R.TITLE, L.BOLD), e.text(t.tournamentName, r.left, a), a += 6, t.subtitle && (z(e, R.SUBTITLE, L.BOLD), e.text(t.subtitle, r.left, a), a += 5), z(e, R.SMALL, L.NORMAL);
|
|
635
635
|
let o = [];
|
|
636
636
|
t.grade && o.push(`Grade: ${t.grade}`), t.surface && o.push(`Surface: ${t.surface}`), t.supervisor && o.push(`Supervisor: ${t.supervisor}`), o.forEach((t, n) => {
|
|
637
637
|
e.text(t, i, r.top + n * 3.5, { align: "right" });
|
|
638
|
-
}),
|
|
638
|
+
}), z(e, R.BODY, L.NORMAL);
|
|
639
639
|
let s = [];
|
|
640
640
|
return t.startDate && s.push(t.startDate), t.location && s.push(t.location), t.organizer && s.push(t.organizer), s.length && (e.text(s.join(" | "), r.left, a), a += 4), a += 1, e.setDrawColor(0), e.setLineWidth(.3), e.line(r.left, a, i, a), a += 3, a - r.top;
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function ge(e, t, n) {
|
|
643
643
|
let { margins: r } = n, i = r.top;
|
|
644
|
-
|
|
644
|
+
z(e, R.SUBTITLE, L.BOLD), e.text(t.tournamentName, r.left, i);
|
|
645
645
|
let a = e.getTextWidth(t.tournamentName);
|
|
646
|
-
return t.subtitle && (
|
|
646
|
+
return t.subtitle && (z(e, R.BODY, L.NORMAL), e.text(` - ${t.subtitle}`, r.left + a, i)), i += 6, i - r.top;
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function _e(e, t, n) {
|
|
649
649
|
let { margins: r } = n, i = e.internal.pageSize.getWidth(), a = i - r.right, o = i / 2, s = r.top;
|
|
650
650
|
if (t.leftLogoBase64) try {
|
|
651
651
|
e.addImage(t.leftLogoBase64, "PNG", r.left, s - 2, 12, 12);
|
|
@@ -653,9 +653,9 @@ function ve(e, t, n) {
|
|
|
653
653
|
if (t.rightLogoBase64) try {
|
|
654
654
|
e.addImage(t.rightLogoBase64, "PNG", a - 12, s - 2, 12, 12);
|
|
655
655
|
} catch {}
|
|
656
|
-
|
|
656
|
+
z(e, 14, L.BOLD), e.text(t.tournamentName, o, s, { align: "center" }), s += 5;
|
|
657
657
|
let c = [t.city, t.country].filter(Boolean).join(", ");
|
|
658
|
-
c && (
|
|
658
|
+
c && (z(e, R.BODY, L.NORMAL), e.setTextColor(80), e.text(c.toUpperCase(), o, s, { align: "center" }), e.setTextColor(0), s += 4);
|
|
659
659
|
let l = [];
|
|
660
660
|
if (t.startDate) {
|
|
661
661
|
let e = t.endDate ? `${t.startDate} - ${t.endDate}` : t.startDate;
|
|
@@ -665,20 +665,20 @@ function ve(e, t, n) {
|
|
|
665
665
|
let e = t.currency ? `${t.currency} ${t.prizeMoney}` : t.prizeMoney;
|
|
666
666
|
l.push(e);
|
|
667
667
|
}
|
|
668
|
-
return t.surface && l.push(t.surface), l.length && (
|
|
668
|
+
return t.surface && l.push(t.surface), l.length && (z(e, R.SMALL, L.NORMAL), e.text(l.join(" | "), o, s, { align: "center" }), s += 4), t.sectionLabel && (z(e, R.SMALL, L.BOLD), e.text(t.sectionLabel.toUpperCase(), a, s, { align: "right" }), s += 3), s += 1, e.setDrawColor(0), e.setLineWidth(.3), e.line(r.left, s, a, s), s += 3, s - r.top;
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function ve(e, t, n) {
|
|
671
671
|
let { margins: r } = n, i = e.internal.pageSize.getWidth() - r.right, a = r.top;
|
|
672
672
|
if (t.rightLogoBase64) try {
|
|
673
673
|
e.addImage(t.rightLogoBase64, "PNG", i - 14, a - 2, 14, 14);
|
|
674
674
|
} catch {}
|
|
675
|
-
|
|
675
|
+
z(e, R.TITLE, L.BOLD), e.text(t.tournamentName, r.left, a), a += 6, t.subtitle && (z(e, R.HEADING, L.BOLD), e.text(t.subtitle, r.left, a), a += 4), z(e, R.TINY, L.NORMAL), e.setTextColor(80);
|
|
676
676
|
let o = [];
|
|
677
677
|
return t.startDate && o.push(t.startDate), t.organizer && o.push(t.organizer), (t.city || t.country) && o.push([t.city, t.country].filter(Boolean).join(", ")), t.tournamentId && o.push(`ID: ${t.tournamentId}`), t.grade && o.push(`Grade: ${t.grade}`), t.chiefUmpire && o.push(`Umpire: ${t.chiefUmpire}`), o.length && (e.text(o.join(" | "), r.left, a), a += 3), e.setTextColor(0), a += 1, e.setDrawColor(0), e.setLineWidth(.3), e.line(r.left, a, i, a), a += 3, a - r.top;
|
|
678
678
|
}
|
|
679
679
|
//#endregion
|
|
680
680
|
//#region src/composition/tournamentBridge.ts
|
|
681
|
-
function
|
|
681
|
+
function ye(e) {
|
|
682
682
|
let t = e.person;
|
|
683
683
|
if (t?.standardFamilyName) {
|
|
684
684
|
let e = t.standardGivenName || "";
|
|
@@ -686,62 +686,62 @@ function be(e) {
|
|
|
686
686
|
}
|
|
687
687
|
return e.participantName || "";
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function be(e, t) {
|
|
690
690
|
return e.find((e) => e.participantRole === t);
|
|
691
691
|
}
|
|
692
|
-
function
|
|
692
|
+
function xe(e, t) {
|
|
693
693
|
return e.find((e) => e.participantRole === "OFFICIAL" && e.participantRoleResponsibilities?.some((e) => e.toUpperCase().includes(t.toUpperCase())));
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function Se(e) {
|
|
696
696
|
let t = (e.venues?.[0])?.addresses?.[0], n = [];
|
|
697
697
|
return t?.city && n.push(t.city), t?.state && n.push(t.state), (t?.countryCode || e.hostCountryCode) && n.push(t?.countryCode || e.hostCountryCode || ""), n.join(", ");
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function Ce(e) {
|
|
700
700
|
return e.venues?.[0]?.addresses?.[0]?.city;
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function we(e) {
|
|
703
703
|
return e.venues?.[0]?.addresses?.[0]?.countryCode || e.hostCountryCode;
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function Te(e) {
|
|
706
706
|
if (e.tournamentTier) {
|
|
707
707
|
let t = e.tournamentTier;
|
|
708
708
|
return t.system ? t.system + " " + (t.value || "") : t.value;
|
|
709
709
|
}
|
|
710
710
|
return e.tournamentLevel;
|
|
711
711
|
}
|
|
712
|
-
function
|
|
712
|
+
function Ee(e) {
|
|
713
713
|
let t = e.totalPrizeMoney?.[0];
|
|
714
714
|
if (t) return String(t.amount);
|
|
715
715
|
}
|
|
716
|
-
function
|
|
716
|
+
function De(e) {
|
|
717
717
|
return e.totalPrizeMoney?.[0]?.currencyCode;
|
|
718
718
|
}
|
|
719
|
-
function
|
|
720
|
-
let { layout: n = "itf", sectionLabel: r, overrides: i } = t, a = e.participants || [], o =
|
|
719
|
+
function Oe(e, t = {}) {
|
|
720
|
+
let { layout: n = "itf", sectionLabel: r, overrides: i } = t, a = e.participants || [], o = be(a, "DIRECTOR"), s = xe(a, "REFEREE"), c = xe(a, "CHIEF_UMPIRE") || xe(a, "UMPIRE"), l = xe(a, "SUPERVISOR") || s;
|
|
721
721
|
return {
|
|
722
722
|
layout: n,
|
|
723
723
|
tournamentName: e.formalName || e.tournamentName || "",
|
|
724
724
|
startDate: e.startDate,
|
|
725
725
|
endDate: e.endDate,
|
|
726
|
-
location:
|
|
727
|
-
city:
|
|
728
|
-
country:
|
|
726
|
+
location: Se(e),
|
|
727
|
+
city: Ce(e),
|
|
728
|
+
country: we(e),
|
|
729
729
|
surface: e.surfaceCategory,
|
|
730
|
-
grade:
|
|
730
|
+
grade: Te(e),
|
|
731
731
|
tournamentId: e.tournamentId,
|
|
732
|
-
organizer: o ?
|
|
733
|
-
supervisor: l ?
|
|
734
|
-
chiefUmpire: c ?
|
|
735
|
-
prizeMoney:
|
|
736
|
-
currency:
|
|
732
|
+
organizer: o ? ye(o) : void 0,
|
|
733
|
+
supervisor: l ? ye(l) : void 0,
|
|
734
|
+
chiefUmpire: c ? ye(c) : void 0,
|
|
735
|
+
prizeMoney: Ee(e),
|
|
736
|
+
currency: De(e),
|
|
737
737
|
sectionLabel: r,
|
|
738
738
|
...i
|
|
739
739
|
};
|
|
740
740
|
}
|
|
741
|
-
function
|
|
741
|
+
function ke(e, t = {}) {
|
|
742
742
|
let { layout: n = "standard", seedAssignments: r, prizeMoney: i, overrides: a } = t, o = (e.participants || []).filter((e) => e.participantRole === "OFFICIAL" || e.participantRole === "DIRECTOR").map((e) => ({
|
|
743
743
|
role: e.participantRoleResponsibilities?.[0] || e.participantRole || "Official",
|
|
744
|
-
name:
|
|
744
|
+
name: ye(e)
|
|
745
745
|
}));
|
|
746
746
|
return {
|
|
747
747
|
layout: n,
|
|
@@ -756,19 +756,19 @@ function Ae(e, t = {}) {
|
|
|
756
756
|
}
|
|
757
757
|
//#endregion
|
|
758
758
|
//#region src/composition/footerLayouts.ts
|
|
759
|
-
function
|
|
759
|
+
function Ae(e, t, n, r) {
|
|
760
760
|
switch (t.layout) {
|
|
761
|
-
case "standard": return
|
|
761
|
+
case "standard": return je(e, t, n, r);
|
|
762
762
|
case "seedings":
|
|
763
|
-
case "seedings-table": return
|
|
764
|
-
case "prize-money": return
|
|
763
|
+
case "seedings-table": return Me(e, t, n, r);
|
|
764
|
+
case "prize-money": return Ne(e, t, n, r);
|
|
765
765
|
case "officials":
|
|
766
|
-
case "officials-signoff": return
|
|
767
|
-
case "combined-tour": return
|
|
766
|
+
case "officials-signoff": return Pe(e, t, n, r);
|
|
767
|
+
case "combined-tour": return Fe(e, t, n, r);
|
|
768
768
|
case "none": return 0;
|
|
769
769
|
}
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function V(e) {
|
|
772
772
|
switch (e.layout) {
|
|
773
773
|
case "standard": return 8 + (e.notes?.length || 0) * 3;
|
|
774
774
|
case "seedings":
|
|
@@ -783,57 +783,57 @@ function B(e) {
|
|
|
783
783
|
case "none": return 0;
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function je(e, t, n, r) {
|
|
787
787
|
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c = a - o.bottom;
|
|
788
|
-
if (
|
|
789
|
-
|
|
788
|
+
if (z(e, R.TINY, L.NORMAL), e.setTextColor(120), t.showTimestamp && e.text(`Generated ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`, o.left, c), t.showPageNumbers && r !== void 0 && e.text(`Page ${r}`, s, c, { align: "right" }), e.setTextColor(0), c -= 3, e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, c, s, c), c -= 2, t.notes?.length) {
|
|
789
|
+
z(e, R.TINY, L.ITALIC), e.setTextColor(100);
|
|
790
790
|
for (let n = t.notes.length - 1; n >= 0; n--) e.text(t.notes[n], o.left, c), c -= 3;
|
|
791
791
|
e.setTextColor(0);
|
|
792
792
|
}
|
|
793
|
-
return
|
|
793
|
+
return V(t);
|
|
794
794
|
}
|
|
795
|
-
function
|
|
796
|
-
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c =
|
|
797
|
-
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 3,
|
|
795
|
+
function Me(e, t, n, r) {
|
|
796
|
+
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c = V(t), l = a - o.bottom - c + 4;
|
|
797
|
+
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 3, z(e, R.SMALL, L.BOLD), e.text("Seeded Players", o.left, l), l += 3;
|
|
798
798
|
let u = t.seedAssignments || [], d = (s - o.left) / 2;
|
|
799
|
-
|
|
799
|
+
z(e, R.TINY, L.NORMAL);
|
|
800
800
|
for (let t = 0; t < u.length; t++) {
|
|
801
801
|
let n = t < Math.ceil(u.length / 2) ? 0 : 1, r = n === 0 ? t : t - Math.ceil(u.length / 2), i = o.left + n * d, a = l + r * 3, s = u[t], c = s.ranking ? ` (${s.ranking})` : "";
|
|
802
802
|
e.text(`${s.seedValue}. ${s.participantName}${c}`, i, a);
|
|
803
803
|
}
|
|
804
804
|
let f = Math.ceil(u.length / 2);
|
|
805
|
-
return l += f * 3 + 2,
|
|
805
|
+
return l += f * 3 + 2, Ie(e, t, n, r, l), c;
|
|
806
806
|
}
|
|
807
|
-
function
|
|
808
|
-
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c =
|
|
809
|
-
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 3,
|
|
807
|
+
function Ne(e, t, n, r) {
|
|
808
|
+
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c = V(t), l = a - o.bottom - c + 4;
|
|
809
|
+
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 3, z(e, R.SMALL, L.BOLD), e.text("Prize Money", o.left, l), l += 3;
|
|
810
810
|
let u = t.prizeMoney || [];
|
|
811
|
-
|
|
811
|
+
z(e, R.TINY, L.NORMAL);
|
|
812
812
|
for (let t of u) {
|
|
813
813
|
let n = [t.round];
|
|
814
814
|
t.amount && n.push(t.amount), t.points && n.push(`${t.points} pts`), e.text(n.join(" — "), o.left, l), l += 2.5;
|
|
815
815
|
}
|
|
816
|
-
return l += 2,
|
|
816
|
+
return l += 2, Ie(e, t, n, r, l), c;
|
|
817
817
|
}
|
|
818
|
-
function
|
|
819
|
-
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c =
|
|
820
|
-
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 4, t.drawCeremonyDate && (
|
|
818
|
+
function Pe(e, t, n, r) {
|
|
819
|
+
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c = V(t), l = a - o.bottom - c + 4;
|
|
820
|
+
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 4, t.drawCeremonyDate && (z(e, R.TINY, L.ITALIC), e.setTextColor(80), e.text(`Draw ceremony: ${t.drawCeremonyDate}`, o.left, l), e.setTextColor(0), l += 3), t.releaseDate && (z(e, R.TINY, L.ITALIC), e.setTextColor(80), e.text(`Released: ${t.releaseDate}`, o.left, l), e.setTextColor(0), l += 3);
|
|
821
821
|
let u = t.signatureLines || (t.officials || []).map((e) => ({ role: e })), d = (s - o.left) / Math.min(u.length, 3);
|
|
822
822
|
for (let t = 0; t < u.length; t++) {
|
|
823
823
|
let n = t % 3, r = Math.floor(t / 3), i = o.left + n * d, a = l + r * 10;
|
|
824
|
-
|
|
824
|
+
z(e, R.TINY, L.ITALIC), e.setTextColor(100), e.text(u[t].role, i, a), e.setTextColor(0);
|
|
825
825
|
let s = u[t].name;
|
|
826
|
-
s && (
|
|
826
|
+
s && (z(e, R.TINY, L.BOLD), e.text(s, i, a + 3)), e.setDrawColor(150), e.setLineWidth(.15), e.line(i, a + 5, i + d - 8, a + 5);
|
|
827
827
|
}
|
|
828
828
|
let f = Math.ceil(u.length / 3);
|
|
829
|
-
return l += f * 10 + 2,
|
|
829
|
+
return l += f * 10 + 2, Ie(e, t, n, r, l), c;
|
|
830
830
|
}
|
|
831
|
-
function
|
|
832
|
-
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c =
|
|
831
|
+
function Fe(e, t, n, r) {
|
|
832
|
+
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c = V(t), l = a - o.bottom - c + 4;
|
|
833
833
|
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 3;
|
|
834
834
|
let u = s - o.left, d = o.left, f = o.left + u * .55, p = l, m = l, h = t.seedAssignments || [];
|
|
835
835
|
if (h.length) {
|
|
836
|
-
|
|
836
|
+
z(e, R.SMALL, L.BOLD), e.text("Seeded Players", d, p), p += 3, z(e, R.TINY, L.NORMAL);
|
|
837
837
|
for (let t of h) {
|
|
838
838
|
let n = t.ranking ? ` (${t.ranking})` : "";
|
|
839
839
|
e.text(`${t.seedValue}. ${t.participantName}${n}`, d, p), p += 2.5;
|
|
@@ -841,22 +841,22 @@ function Ie(e, t, n, r) {
|
|
|
841
841
|
}
|
|
842
842
|
let g = t.prizeMoney || [];
|
|
843
843
|
if (g.length) {
|
|
844
|
-
|
|
844
|
+
z(e, R.SMALL, L.BOLD), e.text("Prize Money", f, m), m += 3, z(e, R.TINY, L.NORMAL);
|
|
845
845
|
for (let t of g) {
|
|
846
846
|
let n = [t.round];
|
|
847
847
|
t.amount && n.push(t.amount), t.points && n.push(`${t.points} pts`), e.text(n.join(" — "), f, m), m += 2.5;
|
|
848
848
|
}
|
|
849
849
|
}
|
|
850
850
|
if (l = Math.max(p, m) + 2, t.withdrawals?.length) {
|
|
851
|
-
|
|
851
|
+
z(e, R.TINY, L.ITALIC), e.setTextColor(80);
|
|
852
852
|
let n = t.withdrawals.map((e) => e.reason ? `${e.name} (${e.reason})` : e.name).join(", ");
|
|
853
853
|
e.text(`Withdrawals: ${n}`, o.left, l, { maxWidth: u }), e.setTextColor(0), l += 3;
|
|
854
854
|
}
|
|
855
|
-
return t.luckyLosers?.length && (
|
|
855
|
+
return t.luckyLosers?.length && (z(e, R.TINY, L.ITALIC), e.setTextColor(80), e.text(`Lucky Losers: ${t.luckyLosers.join(", ")}`, o.left, l, { maxWidth: u }), e.setTextColor(0), l += 3), t.officials?.length && (z(e, R.TINY, L.NORMAL), e.setTextColor(80), e.text(t.officials.join(" | "), o.left, l), e.setTextColor(0), l += 3), Ie(e, t, n, r, l), c;
|
|
856
856
|
}
|
|
857
|
-
function
|
|
857
|
+
function Ie(e, t, n, r, i) {
|
|
858
858
|
let a = e.internal.pageSize.getWidth(), o = e.internal.pageSize.getHeight(), { margins: s } = n, c = a - s.right, l = o - s.bottom + 2;
|
|
859
|
-
if (
|
|
859
|
+
if (z(e, R.TINY, L.NORMAL), e.setTextColor(120), t.showTimestamp && e.text(`Generated ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`, s.left, l), t.releaseDate) {
|
|
860
860
|
let n = t.showTimestamp ? s.left + 50 : s.left;
|
|
861
861
|
e.text(`Released: ${t.releaseDate}`, n, l);
|
|
862
862
|
}
|
|
@@ -864,25 +864,25 @@ function Le(e, t, n, r, i) {
|
|
|
864
864
|
}
|
|
865
865
|
//#endregion
|
|
866
866
|
//#region src/composition/seedingsFooter.ts
|
|
867
|
-
var
|
|
868
|
-
function
|
|
867
|
+
var Le = 5, Re = 2.5;
|
|
868
|
+
function ze(e, t, n, r) {
|
|
869
869
|
let i = t.seedAssignments;
|
|
870
870
|
if (!i.length) return r;
|
|
871
871
|
let a = n.page.margins, o = e.internal.pageSize.getWidth() - a.left - a.right;
|
|
872
|
-
|
|
872
|
+
z(e, 6, L.BOLD), e.text("Seeded players", a.left, r), e.setDrawColor(150), e.setLineWidth(.15), e.line(a.left, r + 1, a.left + o * .5, r + 1), r += 3;
|
|
873
873
|
let s = Math.ceil(i.length / 2), c = i.slice(0, s), l = i.slice(s), u = o * .25, d = r;
|
|
874
|
-
for (let t = 0; t < Math.max(c.length, l.length); t++) c[t] &&
|
|
874
|
+
for (let t = 0; t < Math.max(c.length, l.length); t++) c[t] && Be(e, c[t], a.left, d, u), l[t] && Be(e, l[t], a.left + u + 4, d, u), d += Re;
|
|
875
875
|
return d;
|
|
876
876
|
}
|
|
877
|
-
function
|
|
878
|
-
|
|
877
|
+
function Be(e, t, n, r, i) {
|
|
878
|
+
z(e, Le, L.BOLD), e.text(`${t.seedValue}`, n + 4, r, { align: "right" }), z(e, Le, L.NORMAL), e.text(t.participantName, n + 6, r), e.setTextColor(100), e.text(t.nationality, n + 45, r), e.setTextColor(0);
|
|
879
879
|
}
|
|
880
|
-
function
|
|
881
|
-
return e === 0 ? 0 : 4 + Math.ceil(e / 2) *
|
|
880
|
+
function Ve(e) {
|
|
881
|
+
return e === 0 ? 0 : 4 + Math.ceil(e / 2) * Re;
|
|
882
882
|
}
|
|
883
883
|
//#endregion
|
|
884
884
|
//#region src/utils/primitives.ts
|
|
885
|
-
function
|
|
885
|
+
function H(e) {
|
|
886
886
|
if (!e) return "";
|
|
887
887
|
if (e.person) {
|
|
888
888
|
let { standardFamilyName: t, standardGivenName: n } = e.person;
|
|
@@ -890,13 +890,13 @@ function V(e) {
|
|
|
890
890
|
}
|
|
891
891
|
return e.participantName || "";
|
|
892
892
|
}
|
|
893
|
-
function
|
|
893
|
+
function U(e) {
|
|
894
894
|
return e && e.person?.nationalityCode || "";
|
|
895
895
|
}
|
|
896
|
-
function
|
|
896
|
+
function He(e) {
|
|
897
897
|
return e ? `[${e}]` : "";
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function Ue(e) {
|
|
900
900
|
return e ? {
|
|
901
901
|
DIRECT_ACCEPTANCE: "DA",
|
|
902
902
|
WILDCARD: "WC",
|
|
@@ -906,31 +906,31 @@ function We(e) {
|
|
|
906
906
|
SPECIAL_EXEMPT: "SE"
|
|
907
907
|
}[e] || e : "";
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function We(e) {
|
|
910
910
|
return e ? typeof e == "string" ? e : e.scoreStringSide1 ? e.scoreStringSide1 : "" : "";
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function Ge(e) {
|
|
913
913
|
return e ? (/* @__PURE__ */ new Date(e + "T00:00:00")).toLocaleDateString("en-US", {
|
|
914
914
|
day: "2-digit",
|
|
915
915
|
month: "short",
|
|
916
916
|
year: "numeric"
|
|
917
917
|
}) : "";
|
|
918
918
|
}
|
|
919
|
-
function
|
|
919
|
+
function Ke(e) {
|
|
920
920
|
if (!e) return "";
|
|
921
921
|
let [t, n] = e.split(":"), r = parseInt(t), i = r >= 12 ? "PM" : "AM", a = r;
|
|
922
922
|
return r === 0 ? a = 12 : r > 12 && (a = r - 12), `${a}:${n} ${i}`;
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function qe(e) {
|
|
925
925
|
return e ? e.split(/\s+/).map((e) => e[0]).join("").toUpperCase() : "";
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function Je(e, t) {
|
|
928
928
|
let n = t - e + 1;
|
|
929
929
|
return n === 1 ? "F" : n === 2 ? "SF" : n === 3 ? "QF" : `R${2 ** n}`;
|
|
930
930
|
}
|
|
931
931
|
//#endregion
|
|
932
932
|
//#region src/core/extractScheduleData.ts
|
|
933
|
-
function
|
|
933
|
+
function Ye(e) {
|
|
934
934
|
let { matchUps: t = [], venues: n = [], scheduledDate: r = "" } = e, i = /* @__PURE__ */ new Set();
|
|
935
935
|
n.forEach((e) => {
|
|
936
936
|
(e.courts || []).forEach((e) => {
|
|
@@ -947,23 +947,23 @@ function Xe(e) {
|
|
|
947
947
|
for (let e of o) {
|
|
948
948
|
let t = e.schedule || {}, n = t.scheduledTime || "00:00", r = t.venueCourtId || t.courtId || "", o = a.get(r) || r;
|
|
949
949
|
o && i.add(o);
|
|
950
|
-
let c = e.sides || [], l =
|
|
950
|
+
let c = e.sides || [], l = Xe(c[0]), u = Xe(c[1]), d = {
|
|
951
951
|
courtName: o,
|
|
952
|
-
scheduledTime:
|
|
952
|
+
scheduledTime: Ke(n),
|
|
953
953
|
eventName: e.eventName || e.event?.eventName || "",
|
|
954
|
-
eventAbbr:
|
|
954
|
+
eventAbbr: qe(e.eventName || e.event?.eventName || ""),
|
|
955
955
|
roundName: e.roundName || "",
|
|
956
956
|
side1: l,
|
|
957
957
|
side2: u,
|
|
958
|
-
score:
|
|
958
|
+
score: We(e.score),
|
|
959
959
|
matchUpStatus: e.matchUpStatus,
|
|
960
|
-
notBeforeTime: t.notBeforeTime ?
|
|
960
|
+
notBeforeTime: t.notBeforeTime ? Ke(t.notBeforeTime) : void 0
|
|
961
961
|
}, f = t.notBeforeTime || n;
|
|
962
962
|
s.has(f) || s.set(f, []), s.get(f).push(d);
|
|
963
963
|
}
|
|
964
964
|
let c = [...s.keys()].sort().map((e) => ({
|
|
965
965
|
time: e,
|
|
966
|
-
label:
|
|
966
|
+
label: Ke(e) || "TBD",
|
|
967
967
|
matches: s.get(e) || []
|
|
968
968
|
}));
|
|
969
969
|
return {
|
|
@@ -972,15 +972,15 @@ function Xe(e) {
|
|
|
972
972
|
timeSlots: c
|
|
973
973
|
};
|
|
974
974
|
}
|
|
975
|
-
function
|
|
975
|
+
function Xe(e) {
|
|
976
976
|
if (!e) return {
|
|
977
977
|
name: "",
|
|
978
978
|
nationality: ""
|
|
979
979
|
};
|
|
980
980
|
let t = e.participant;
|
|
981
981
|
return t ? {
|
|
982
|
-
name:
|
|
983
|
-
nationality:
|
|
982
|
+
name: H(t),
|
|
983
|
+
nationality: U(t)
|
|
984
984
|
} : {
|
|
985
985
|
name: "",
|
|
986
986
|
nationality: ""
|
|
@@ -988,7 +988,7 @@ function Ze(e) {
|
|
|
988
988
|
}
|
|
989
989
|
//#endregion
|
|
990
990
|
//#region src/core/extractParticipantData.ts
|
|
991
|
-
function
|
|
991
|
+
function Ze(e) {
|
|
992
992
|
let { participants: t = [], eventEntries: n = [] } = e, r = /* @__PURE__ */ new Map();
|
|
993
993
|
for (let { eventName: e, entries: t } of n) for (let n of t) {
|
|
994
994
|
let t = n.participantId;
|
|
@@ -1006,17 +1006,17 @@ function Qe(e) {
|
|
|
1006
1006
|
return t.filter((e) => e.participantType === "INDIVIDUAL").map((e) => {
|
|
1007
1007
|
let t = r.get(e.participantId);
|
|
1008
1008
|
return {
|
|
1009
|
-
name:
|
|
1010
|
-
nationality:
|
|
1011
|
-
ranking:
|
|
1009
|
+
name: H(e),
|
|
1010
|
+
nationality: U(e),
|
|
1011
|
+
ranking: Qe(e),
|
|
1012
1012
|
seedValue: t?.seedValue,
|
|
1013
|
-
entryStatus:
|
|
1013
|
+
entryStatus: Ue(t?.entryStatus || ""),
|
|
1014
1014
|
events: t?.events || [],
|
|
1015
1015
|
signedIn: e.signInStatus === "SIGNED_IN"
|
|
1016
1016
|
};
|
|
1017
1017
|
}).sort((e, t) => e.name.localeCompare(t.name));
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1019
|
+
function Qe(e) {
|
|
1020
1020
|
for (let t of [e.rankings, e.ratings]) if (!(!t || typeof t != "object")) for (let e of Object.values(t)) {
|
|
1021
1021
|
let t = e?.[0]?.scaleValue;
|
|
1022
1022
|
if (t != null && t !== "") return String(t);
|
|
@@ -1025,7 +1025,7 @@ function $e(e) {
|
|
|
1025
1025
|
}
|
|
1026
1026
|
//#endregion
|
|
1027
1027
|
//#region src/core/extractCourtCardData.ts
|
|
1028
|
-
function
|
|
1028
|
+
function $e(e) {
|
|
1029
1029
|
let { matchUps: t = [], venues: n = [] } = e, r = /* @__PURE__ */ new Map();
|
|
1030
1030
|
n.forEach((e) => {
|
|
1031
1031
|
(e.courts || []).forEach((t) => {
|
|
@@ -1060,26 +1060,26 @@ function et(e) {
|
|
|
1060
1060
|
o ? u = s[0] : s.length > 1 && (u = s[1]), a.push({
|
|
1061
1061
|
courtName: n.courtName,
|
|
1062
1062
|
venueName: n.venueName,
|
|
1063
|
-
currentMatch: l ?
|
|
1064
|
-
nextMatch: u ?
|
|
1063
|
+
currentMatch: l ? et(l) : void 0,
|
|
1064
|
+
nextMatch: u ? et(u) : void 0
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
1067
|
return a.sort((e, t) => e.courtName.localeCompare(t.courtName));
|
|
1068
1068
|
}
|
|
1069
|
-
function
|
|
1069
|
+
function et(e) {
|
|
1070
1070
|
let t = e.sides || [];
|
|
1071
1071
|
return {
|
|
1072
1072
|
eventName: e.eventName || e.event?.eventName || "",
|
|
1073
1073
|
roundName: e.roundName || "",
|
|
1074
|
-
scheduledTime: e.schedule?.scheduledTime ?
|
|
1075
|
-
side1:
|
|
1076
|
-
side2:
|
|
1074
|
+
scheduledTime: e.schedule?.scheduledTime ? Ke(e.schedule.scheduledTime) : void 0,
|
|
1075
|
+
side1: tt(t[0]),
|
|
1076
|
+
side2: tt(t[1])
|
|
1077
1077
|
};
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function tt(e) {
|
|
1080
1080
|
return e?.participant ? {
|
|
1081
|
-
name:
|
|
1082
|
-
nationality:
|
|
1081
|
+
name: H(e.participant),
|
|
1082
|
+
nationality: U(e.participant)
|
|
1083
1083
|
} : {
|
|
1084
1084
|
name: "TBD",
|
|
1085
1085
|
nationality: ""
|
|
@@ -1087,7 +1087,7 @@ function nt(e) {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
//#endregion
|
|
1089
1089
|
//#region src/generators/orderOfPlay.ts
|
|
1090
|
-
function
|
|
1090
|
+
function nt(e, t = {}) {
|
|
1091
1091
|
let n = e.courts.length >= 4, r = {
|
|
1092
1092
|
pageSize: t.page?.pageSize || "a4",
|
|
1093
1093
|
orientation: t.page?.orientation || (n ? "landscape" : "portrait"),
|
|
@@ -1097,34 +1097,34 @@ function rt(e, t = {}) {
|
|
|
1097
1097
|
bottom: 10,
|
|
1098
1098
|
left: 8
|
|
1099
1099
|
}
|
|
1100
|
-
}, i =
|
|
1100
|
+
}, i = de(r), a = t.footer || {
|
|
1101
1101
|
layout: "standard",
|
|
1102
1102
|
showTimestamp: !0,
|
|
1103
1103
|
showPageNumbers: !0
|
|
1104
|
-
}, o =
|
|
1104
|
+
}, o = V(a) + (t.notes?.length ? t.notes.length * 3 : 0), s = r.margins.top;
|
|
1105
1105
|
if (t.header) {
|
|
1106
|
-
let e =
|
|
1106
|
+
let e = B(i, t.header, r);
|
|
1107
1107
|
s = r.margins.top + e;
|
|
1108
1108
|
}
|
|
1109
|
-
t.alertBanner && (s =
|
|
1109
|
+
t.alertBanner && (s = rt(i, t.alertBanner, r, s)), it(i, e, r, s, t);
|
|
1110
1110
|
let c = i.internal.pageSize.getHeight();
|
|
1111
1111
|
if (t.notes?.length) {
|
|
1112
1112
|
let e = c - r.margins.bottom - o + 2;
|
|
1113
|
-
|
|
1113
|
+
z(i, R.TINY, L.ITALIC), i.setTextColor(80);
|
|
1114
1114
|
for (let n of t.notes) i.text(n, r.margins.left, e), e += 3;
|
|
1115
1115
|
i.setTextColor(0);
|
|
1116
1116
|
}
|
|
1117
1117
|
if (t.officials?.length) {
|
|
1118
1118
|
let e = c - r.margins.bottom - 6;
|
|
1119
|
-
|
|
1119
|
+
ct(i, t.officials, r, e);
|
|
1120
1120
|
}
|
|
1121
|
-
return
|
|
1121
|
+
return Ae(i, a, r, 1), i;
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function rt(e, t, n, r) {
|
|
1124
1124
|
let { margins: i } = n, a = e.internal.pageSize.getWidth(), o = a - i.left - i.right;
|
|
1125
|
-
return e.setFillColor(200, 30, 30), e.rect(i.left, r, o, 7, "F"),
|
|
1125
|
+
return e.setFillColor(200, 30, 30), e.rect(i.left, r, o, 7, "F"), z(e, R.SMALL, L.BOLD), e.setTextColor(255, 255, 255), e.text(t, a / 2, r + 4.5, { align: "center" }), e.setTextColor(0), r + 9;
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1127
|
+
function it(e, n, r, i, a) {
|
|
1128
1128
|
let { margins: o } = r, s = n.courts, c = a.cellStyle === "compact", l = [{
|
|
1129
1129
|
header: "",
|
|
1130
1130
|
dataKey: "slot"
|
|
@@ -1135,7 +1135,7 @@ function at(e, n, r, i, a) {
|
|
|
1135
1135
|
});
|
|
1136
1136
|
let u = [];
|
|
1137
1137
|
n.timeSlots.forEach((e, t) => {
|
|
1138
|
-
let n = [], r =
|
|
1138
|
+
let n = [], r = at(e, t);
|
|
1139
1139
|
n.push({
|
|
1140
1140
|
content: r,
|
|
1141
1141
|
styles: {
|
|
@@ -1145,7 +1145,7 @@ function at(e, n, r, i, a) {
|
|
|
1145
1145
|
}
|
|
1146
1146
|
});
|
|
1147
1147
|
for (let t of s) {
|
|
1148
|
-
let r = e.matches.filter((e) => e.courtName === t), i = r.length > 0 ? r.map((e) =>
|
|
1148
|
+
let r = e.matches.filter((e) => e.courtName === t), i = r.length > 0 ? r.map((e) => ot(e, c)).join("\n---\n") : "";
|
|
1149
1149
|
n.push(i);
|
|
1150
1150
|
}
|
|
1151
1151
|
u.push(n);
|
|
@@ -1208,34 +1208,34 @@ function at(e, n, r, i, a) {
|
|
|
1208
1208
|
}
|
|
1209
1209
|
});
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1211
|
+
function at(e, t) {
|
|
1212
1212
|
return `${t + 1}`;
|
|
1213
1213
|
}
|
|
1214
|
-
function
|
|
1214
|
+
function ot(e, t) {
|
|
1215
1215
|
let n = [];
|
|
1216
1216
|
e.notBeforeTime ? n.push(`NB ${e.notBeforeTime}`) : e.scheduledTime && n.push(e.scheduledTime), (e.eventAbbr || e.roundName) && n.push(`${e.eventAbbr} ${e.roundName}`.trim());
|
|
1217
|
-
let r =
|
|
1217
|
+
let r = st(e.side1, t);
|
|
1218
1218
|
r && n.push(r), n.push("vs.");
|
|
1219
|
-
let i =
|
|
1219
|
+
let i = st(e.side2, t);
|
|
1220
1220
|
return i && n.push(i), e.score ? n.push(e.score) : e.matchUpStatus === "IN_PROGRESS" && n.push("In progress"), n.join("\n");
|
|
1221
1221
|
}
|
|
1222
|
-
function
|
|
1222
|
+
function st(e, t) {
|
|
1223
1223
|
return e.name ? t || e.nationality ? `${e.name} (${e.nationality})` : e.name : "TBD";
|
|
1224
1224
|
}
|
|
1225
|
-
function
|
|
1225
|
+
function ct(e, t, n, r) {
|
|
1226
1226
|
let { margins: i } = n, a = e.internal.pageSize.getWidth();
|
|
1227
|
-
e.setDrawColor(120), e.setLineWidth(.2), e.line(i.left, r - 2, a - i.right, r - 2),
|
|
1227
|
+
e.setDrawColor(120), e.setLineWidth(.2), e.line(i.left, r - 2, a - i.right, r - 2), z(e, R.TINY, L.NORMAL);
|
|
1228
1228
|
let o = (a - i.left - i.right) / t.length;
|
|
1229
1229
|
t.forEach((t, n) => {
|
|
1230
1230
|
let a = i.left + n * o;
|
|
1231
|
-
|
|
1231
|
+
z(e, R.TINY, L.ITALIC), e.setTextColor(100), e.text(t.role, a, r), z(e, R.TINY, L.BOLD), e.setTextColor(0), e.text(t.name, a, r + 3);
|
|
1232
1232
|
});
|
|
1233
1233
|
}
|
|
1234
1234
|
//#endregion
|
|
1235
1235
|
//#region src/layout/headers.ts
|
|
1236
|
-
function
|
|
1236
|
+
function lt(e, t, n = 15) {
|
|
1237
1237
|
let r = e.internal.pageSize.getWidth(), i = n;
|
|
1238
|
-
|
|
1238
|
+
z(e, R.TITLE, L.BOLD), e.text(t.tournamentName, 15, i), i += 7, t.subtitle && (z(e, R.SUBTITLE, L.BOLD), e.text(t.subtitle, 15, i), i += 6), z(e, R.BODY, L.NORMAL);
|
|
1239
1239
|
let a = [];
|
|
1240
1240
|
if (t.startDate) {
|
|
1241
1241
|
let e = t.endDate ? `${t.startDate} - ${t.endDate}` : t.startDate;
|
|
@@ -1247,11 +1247,11 @@ function U(e, t, n = 15) {
|
|
|
1247
1247
|
}
|
|
1248
1248
|
function W(e, t, n) {
|
|
1249
1249
|
let r = e.internal.pageSize.getWidth(), i = e.internal.pageSize.getHeight();
|
|
1250
|
-
|
|
1250
|
+
z(e, R.SMALL, L.ITALIC), e.setTextColor(120), e.text(t, 15, i - 10), n !== void 0 && e.text(`Page ${n}`, r - 15, i - 10, { align: "right" }), e.setTextColor(0);
|
|
1251
1251
|
}
|
|
1252
1252
|
//#endregion
|
|
1253
1253
|
//#region src/layout/tables.ts
|
|
1254
|
-
var
|
|
1254
|
+
var ut = {
|
|
1255
1255
|
compact: {
|
|
1256
1256
|
styles: {
|
|
1257
1257
|
fontSize: 7,
|
|
@@ -1408,12 +1408,12 @@ var G = {
|
|
|
1408
1408
|
};
|
|
1409
1409
|
//#endregion
|
|
1410
1410
|
//#region src/generators/playerList.ts
|
|
1411
|
-
function
|
|
1411
|
+
function dt(n, r = {}) {
|
|
1412
1412
|
let { header: i, includeRanking: a = !0, includeEvents: o = !0 } = r, s = new e({
|
|
1413
1413
|
orientation: "portrait",
|
|
1414
1414
|
format: "a4"
|
|
1415
1415
|
}), c = 15;
|
|
1416
|
-
i && (c =
|
|
1416
|
+
i && (c = lt(s, {
|
|
1417
1417
|
...i,
|
|
1418
1418
|
subtitle: i.subtitle || "Player List"
|
|
1419
1419
|
}));
|
|
@@ -1454,7 +1454,7 @@ function ut(n, r = {}) {
|
|
|
1454
1454
|
events: e.events.join(", ")
|
|
1455
1455
|
}));
|
|
1456
1456
|
return t(s, {
|
|
1457
|
-
...
|
|
1457
|
+
...ut.playerList,
|
|
1458
1458
|
startY: c,
|
|
1459
1459
|
columns: l,
|
|
1460
1460
|
body: u,
|
|
@@ -1492,16 +1492,16 @@ function ut(n, r = {}) {
|
|
|
1492
1492
|
}
|
|
1493
1493
|
//#endregion
|
|
1494
1494
|
//#region src/generators/signInSheet.ts
|
|
1495
|
-
function
|
|
1495
|
+
function ft(n, r = {}) {
|
|
1496
1496
|
let { header: i, eventName: a, signInDate: o, signInTime: s } = r, c = new e({
|
|
1497
1497
|
orientation: "portrait",
|
|
1498
1498
|
format: "a4"
|
|
1499
1499
|
}), l = 15;
|
|
1500
|
-
if (i && (l =
|
|
1500
|
+
if (i && (l = lt(c, {
|
|
1501
1501
|
...i,
|
|
1502
1502
|
subtitle: i.subtitle || "Player Sign-In Sheet"
|
|
1503
1503
|
})), a || o) {
|
|
1504
|
-
|
|
1504
|
+
z(c, R.BODY, L.NORMAL);
|
|
1505
1505
|
let e = [];
|
|
1506
1506
|
a && e.push(`Event: ${a}`), o && e.push(`Date: ${o}`), s && e.push(`Time: ${s}`), c.text(e.join(" | "), 15, l), l += 6;
|
|
1507
1507
|
}
|
|
@@ -1614,18 +1614,18 @@ function dt(n, r = {}) {
|
|
|
1614
1614
|
}
|
|
1615
1615
|
//#endregion
|
|
1616
1616
|
//#region src/generators/courtCard.ts
|
|
1617
|
-
function
|
|
1617
|
+
function pt(t, n = {}) {
|
|
1618
1618
|
let { tournamentName: r = "", pageSize: i = "a5", cardsPerPage: a = 1 } = n, o = new e({
|
|
1619
1619
|
orientation: "landscape",
|
|
1620
1620
|
format: i
|
|
1621
1621
|
});
|
|
1622
1622
|
return t.forEach((e, t) => {
|
|
1623
|
-
t > 0 && o.addPage(),
|
|
1623
|
+
t > 0 && o.addPage(), mt(o, e, r, a);
|
|
1624
1624
|
}), o;
|
|
1625
1625
|
}
|
|
1626
|
-
function
|
|
1626
|
+
function mt(e, n, r, i) {
|
|
1627
1627
|
let a = e.internal.pageSize.getWidth(), o = a / 2, s = 15;
|
|
1628
|
-
if (r && (
|
|
1628
|
+
if (r && (z(e, R.BODY, L.NORMAL), e.setTextColor(100), e.text(r, o, s, { align: "center" }), e.setTextColor(0), s += 8), z(e, 28, L.BOLD), e.text(n.courtName, o, s, { align: "center" }), s += 5, n.venueName && (z(e, R.HEADING, L.NORMAL), e.setTextColor(100), e.text(n.venueName, o, s, { align: "center" }), e.setTextColor(0)), s += 8, e.setDrawColor(0), e.setLineWidth(1), e.line(30, s, a - 30, s), s += 8, n.currentMatch && (z(e, R.HEADING, L.BOLD), e.setTextColor(30, 60, 120), e.text("NOW PLAYING", o, s, { align: "center" }), e.setTextColor(0), s += 6, z(e, R.BODY, L.ITALIC), e.text(`${n.currentMatch.eventName} - ${n.currentMatch.roundName}`, o, s, { align: "center" }), s += 8, t(e, {
|
|
1629
1629
|
startY: s,
|
|
1630
1630
|
margin: {
|
|
1631
1631
|
left: 25,
|
|
@@ -1659,58 +1659,58 @@ function pt(e, n, r, i) {
|
|
|
1659
1659
|
}]
|
|
1660
1660
|
]
|
|
1661
1661
|
}), s = e.lastAutoTable?.finalY || s + 40, s += 8), n.nextMatch) {
|
|
1662
|
-
e.setDrawColor(180), e.setLineWidth(.3), e.line(50, s, a - 50, s), s += 6,
|
|
1662
|
+
e.setDrawColor(180), e.setLineWidth(.3), e.line(50, s, a - 50, s), s += 6, z(e, R.BODY, L.BOLD), e.setTextColor(100);
|
|
1663
1663
|
let t = n.nextMatch.scheduledTime ? `UP NEXT (${n.nextMatch.scheduledTime})` : "UP NEXT";
|
|
1664
|
-
e.text(t, o, s, { align: "center" }), e.setTextColor(0), s += 5,
|
|
1664
|
+
e.text(t, o, s, { align: "center" }), e.setTextColor(0), s += 5, z(e, R.BODY, L.NORMAL), e.text(`${n.nextMatch.eventName} - ${n.nextMatch.roundName}`, o, s, { align: "center" }), s += 5, z(e, R.HEADING, L.NORMAL), e.text(`${n.nextMatch.side1.name} vs. ${n.nextMatch.side2.name}`, o, s, { align: "center" });
|
|
1665
1665
|
}
|
|
1666
1666
|
}
|
|
1667
1667
|
//#endregion
|
|
1668
1668
|
//#region src/generators/matchCard.ts
|
|
1669
|
-
function
|
|
1669
|
+
function ht(t, n = {}) {
|
|
1670
1670
|
let { cardsPerPage: r = 2, includeScoreBoxes: i = !0 } = n, a = new e({
|
|
1671
1671
|
orientation: "landscape",
|
|
1672
1672
|
format: "a5"
|
|
1673
1673
|
});
|
|
1674
1674
|
return t.forEach((e, t) => {
|
|
1675
|
-
t > 0 && (r === 1 || t % r === 0) && a.addPage(),
|
|
1675
|
+
t > 0 && (r === 1 || t % r === 0) && a.addPage(), gt(a, e, r === 2 && t % 2 == 1 ? a.internal.pageSize.getHeight() / 2 : 5, i);
|
|
1676
1676
|
}), a;
|
|
1677
1677
|
}
|
|
1678
|
-
function
|
|
1678
|
+
function gt(e, t, n, r) {
|
|
1679
1679
|
let i = e.internal.pageSize.getWidth(), a = i / 2, o = n;
|
|
1680
|
-
if (t.tournamentName && (
|
|
1681
|
-
|
|
1680
|
+
if (t.tournamentName && (z(e, R.BODY, L.NORMAL), e.setTextColor(100), e.text(t.tournamentName, a, o, { align: "center" }), e.setTextColor(0), o += 5), z(e, R.HEADING, L.BOLD), e.text(`${t.eventName} - ${t.roundName}`, a, o, { align: "center" }), o += 5, t.courtName || t.scheduledTime) {
|
|
1681
|
+
z(e, R.BODY, L.NORMAL);
|
|
1682
1682
|
let n = [];
|
|
1683
1683
|
t.courtName && n.push(`Court: ${t.courtName}`), t.scheduledTime && n.push(`Time: ${t.scheduledTime}`), e.text(n.join(" "), a, o, { align: "center" }), o += 5;
|
|
1684
1684
|
}
|
|
1685
|
-
if (e.setDrawColor(0), e.setLineWidth(.5), e.line(10, o, i - 10, o), o += 6,
|
|
1686
|
-
e.setDrawColor(0), e.setLineWidth(.5), e.line(10, o, i - 10, o), o += 4,
|
|
1685
|
+
if (e.setDrawColor(0), e.setLineWidth(.5), e.line(10, o, i - 10, o), o += 6, _t(e, t.side1, 10, o, i), o += 8, z(e, R.BODY, L.ITALIC), e.setTextColor(120), e.text("vs.", a, o, { align: "center" }), e.setTextColor(0), o += 6, _t(e, t.side2, 10, o, i), o += 8, r) {
|
|
1686
|
+
e.setDrawColor(0), e.setLineWidth(.5), e.line(10, o, i - 10, o), o += 4, z(e, R.SMALL, L.BOLD), e.text("Score:", 10, o);
|
|
1687
1687
|
for (let t = 0; t < 5; t++) {
|
|
1688
1688
|
let n = 28 + t * 15;
|
|
1689
|
-
e.rect(n, o - 4, 12, 8),
|
|
1689
|
+
e.rect(n, o - 4, 12, 8), z(e, R.TINY, L.NORMAL), e.setTextColor(150), e.text(`Set ${t + 1}`, n + 12 / 2, o - 5, { align: "center" }), e.setTextColor(0);
|
|
1690
1690
|
}
|
|
1691
|
-
o += 14,
|
|
1691
|
+
o += 14, z(e, R.SMALL, L.NORMAL), e.text("Umpire:", 10, o), e.setDrawColor(150), e.setLineWidth(.3), e.line(30, o, 90, o), e.text("Signature:", i - 10 - 70, o), e.line(i - 10 - 40, o, i - 10, o);
|
|
1692
1692
|
}
|
|
1693
1693
|
}
|
|
1694
|
-
function
|
|
1695
|
-
|
|
1694
|
+
function _t(e, t, n, r, i) {
|
|
1695
|
+
z(e, 14, L.BOLD);
|
|
1696
1696
|
let a = t.seedValue ? `[${t.seedValue}] ` : "";
|
|
1697
|
-
e.text(`${a}${t.name}`, n, r),
|
|
1697
|
+
e.text(`${a}${t.name}`, n, r), z(e, R.HEADING, L.NORMAL), e.setTextColor(80), e.text(t.nationality, i - n, r, { align: "right" }), e.setTextColor(0);
|
|
1698
1698
|
}
|
|
1699
1699
|
//#endregion
|
|
1700
1700
|
//#region src/core/extractDrawData.ts
|
|
1701
|
-
function
|
|
1701
|
+
function vt(e) {
|
|
1702
1702
|
let { drawDefinition: t, participants: n = [] } = e;
|
|
1703
|
-
if (!t) return
|
|
1703
|
+
if (!t) return bt();
|
|
1704
1704
|
let r = e.structureId ? t.structures?.find((t) => t.structureId === e.structureId) : t.structures?.[0];
|
|
1705
|
-
if (!r) return
|
|
1705
|
+
if (!r) return bt();
|
|
1706
1706
|
let i = /* @__PURE__ */ new Map();
|
|
1707
1707
|
n.forEach((e) => i.set(e.participantId, e));
|
|
1708
1708
|
let a = r.positionAssignments || [], o = (r.matchUps || []).reduce((e, t) => Math.max(e, t.roundNumber || 0), 0), s = e.structureId ? a.length : t.drawSize || a.length, c = e.structureId ? o : Math.log2(s), l = r.seedAssignments || [], u = a.map((e) => {
|
|
1709
1709
|
let t = e.participantId ? i.get(e.participantId) : void 0, n = l.find((t) => t.participantId === e.participantId);
|
|
1710
1710
|
return {
|
|
1711
1711
|
drawPosition: e.drawPosition,
|
|
1712
|
-
participantName: t ?
|
|
1713
|
-
nationality: t ?
|
|
1712
|
+
participantName: t ? H(t) : "",
|
|
1713
|
+
nationality: t ? U(t) : "",
|
|
1714
1714
|
seedValue: n?.seedValue,
|
|
1715
1715
|
entryStatus: e.entryStatus,
|
|
1716
1716
|
isBye: e.bye === !0
|
|
@@ -1719,17 +1719,17 @@ function _t(e) {
|
|
|
1719
1719
|
roundNumber: e.roundNumber,
|
|
1720
1720
|
roundPosition: e.roundPosition,
|
|
1721
1721
|
drawPositions: e.drawPositions || [],
|
|
1722
|
-
score:
|
|
1722
|
+
score: We(e.score),
|
|
1723
1723
|
winningSide: e.winningSide,
|
|
1724
1724
|
matchUpStatus: e.matchUpStatus
|
|
1725
1725
|
})), f = l.filter((e) => e.participantId).map((e) => {
|
|
1726
1726
|
let t = i.get(e.participantId);
|
|
1727
1727
|
return {
|
|
1728
1728
|
seedValue: e.seedValue,
|
|
1729
|
-
participantName: t ?
|
|
1730
|
-
nationality: t ?
|
|
1729
|
+
participantName: t ? H(t) : "",
|
|
1730
|
+
nationality: t ? U(t) : ""
|
|
1731
1731
|
};
|
|
1732
|
-
}).sort((e, t) => e.seedValue - t.seedValue), p =
|
|
1732
|
+
}).sort((e, t) => e.seedValue - t.seedValue), p = yt(d, c, e.processedMatchUps);
|
|
1733
1733
|
return {
|
|
1734
1734
|
drawName: t.drawName || "",
|
|
1735
1735
|
drawSize: s,
|
|
@@ -1741,10 +1741,10 @@ function _t(e) {
|
|
|
1741
1741
|
roundLabelMap: p
|
|
1742
1742
|
};
|
|
1743
1743
|
}
|
|
1744
|
-
function
|
|
1745
|
-
return
|
|
1744
|
+
function G(e, t) {
|
|
1745
|
+
return Je(e, t);
|
|
1746
1746
|
}
|
|
1747
|
-
function
|
|
1747
|
+
function yt(e, t, n) {
|
|
1748
1748
|
if (n?.length) {
|
|
1749
1749
|
let e = {};
|
|
1750
1750
|
for (let t of n) t.roundNumber && !e[t.roundNumber] && (e[t.roundNumber] = t.abbreviatedRoundName || t.roundName || `R${t.roundNumber}`);
|
|
@@ -1759,14 +1759,14 @@ function vt(e, t, n) {
|
|
|
1759
1759
|
return (r.get(e) || 0) <= Math.ceil(n / 2);
|
|
1760
1760
|
})) {
|
|
1761
1761
|
let e = {};
|
|
1762
|
-
for (let n of i) e[n] =
|
|
1762
|
+
for (let n of i) e[n] = Je(n, t);
|
|
1763
1763
|
return e;
|
|
1764
1764
|
}
|
|
1765
1765
|
let a = {};
|
|
1766
1766
|
for (let e of i) a[e] = `R${e}`;
|
|
1767
1767
|
return a;
|
|
1768
1768
|
}
|
|
1769
|
-
function
|
|
1769
|
+
function bt() {
|
|
1770
1770
|
return {
|
|
1771
1771
|
drawName: "",
|
|
1772
1772
|
drawSize: 0,
|
|
@@ -1779,13 +1779,13 @@ function yt() {
|
|
|
1779
1779
|
}
|
|
1780
1780
|
//#endregion
|
|
1781
1781
|
//#region src/renderers/formatEntry.ts
|
|
1782
|
-
function
|
|
1782
|
+
function xt(e, t) {
|
|
1783
1783
|
if (e.isBye) return "Bye";
|
|
1784
1784
|
if (!e.participantName) return "";
|
|
1785
1785
|
let n = St(e.participantName, t), r = Ct(e.nationality, t), i = e.seedValue ? wt(e.seedValue, t) : "", a = e.entryStatus ? Et(e.entryStatus, t) : "", o = [];
|
|
1786
1786
|
return t.seedPosition === "before-position" && i && o.push(i), o.push(n), t.seedPosition === "after-name" && i && o.push(i), r && o.push(r), t.seedPosition === "after-country" && i && o.push(i), a && o.push(a), o.join(" ");
|
|
1787
1787
|
}
|
|
1788
|
-
function
|
|
1788
|
+
function K(e, t) {
|
|
1789
1789
|
if (e.isBye) return {
|
|
1790
1790
|
name: "Bye",
|
|
1791
1791
|
nationality: ""
|
|
@@ -1856,15 +1856,15 @@ function q(e, t) {
|
|
|
1856
1856
|
//#endregion
|
|
1857
1857
|
//#region src/renderers/traditionalDraw.ts
|
|
1858
1858
|
function Dt(e, t, n) {
|
|
1859
|
-
let r = n || Math.log2(e), i = (t.contentHeight - 9) / e, a = i < 3.5, o = a ? .8 : 1.5, s = r, c = o * (s + 1), l = i < 2, u = a ? .18 : .3, d = Math.min(a ? 38 : 65, t.contentWidth * u), f = t.contentWidth - d - c, p = l ? 8 : 0, m = f - p, h = Math.min(65, Math.max(8, m / Math.max(1, s))), g = h + p, _ =
|
|
1860
|
-
return i < 2.5 ? _ = 5 : i < 3.5 && (_ =
|
|
1859
|
+
let r = n || Math.log2(e), i = (t.contentHeight - 9) / e, a = i < 3.5, o = a ? .8 : 1.5, s = r, c = o * (s + 1), l = i < 2, u = a ? .18 : .3, d = Math.min(a ? 38 : 65, t.contentWidth * u), f = t.contentWidth - d - c, p = l ? 8 : 0, m = f - p, h = Math.min(65, Math.max(8, m / Math.max(1, s))), g = h + p, _ = R.SMALL;
|
|
1860
|
+
return i < 2.5 ? _ = 5 : i < 3.5 && (_ = R.TINY), {
|
|
1861
1861
|
lineHeight: i,
|
|
1862
1862
|
roundColumnWidth: h,
|
|
1863
1863
|
firstRoundWidth: d,
|
|
1864
1864
|
secondRoundWidth: g,
|
|
1865
1865
|
connectorGap: o,
|
|
1866
1866
|
fontSize: _,
|
|
1867
|
-
scoreFontSize: a ? 5 :
|
|
1867
|
+
scoreFontSize: a ? 5 : R.TINY
|
|
1868
1868
|
};
|
|
1869
1869
|
}
|
|
1870
1870
|
function J(e, t, n, r, i = 0, a) {
|
|
@@ -1901,9 +1901,9 @@ function jt(e, t) {
|
|
|
1901
1901
|
return n;
|
|
1902
1902
|
}
|
|
1903
1903
|
function Mt(e, t, n, r, i) {
|
|
1904
|
-
let a = 1.5, o = e / ((t.get(n[0])?.length || 1) * 2), s = o < 3.5, c = Math.min(s ? 50 : 60, i.contentWidth * .25), l = i.contentWidth - c - a * (r + 1), u = Math.max(8, l / Math.max(1, r)), d =
|
|
1905
|
-
o < 2.5 ? d = 5 : o < 3.5 && (d =
|
|
1906
|
-
let f = s ? 5 :
|
|
1904
|
+
let a = 1.5, o = e / ((t.get(n[0])?.length || 1) * 2), s = o < 3.5, c = Math.min(s ? 50 : 60, i.contentWidth * .25), l = i.contentWidth - c - a * (r + 1), u = Math.max(8, l / Math.max(1, r)), d = R.SMALL;
|
|
1905
|
+
o < 2.5 ? d = 5 : o < 3.5 && (d = R.TINY);
|
|
1906
|
+
let f = s ? 5 : R.TINY;
|
|
1907
1907
|
return {
|
|
1908
1908
|
feedConfig: {
|
|
1909
1909
|
lineHeight: o,
|
|
@@ -1977,7 +1977,7 @@ function Pt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
1977
1977
|
}
|
|
1978
1978
|
if (a.score) {
|
|
1979
1979
|
let t = q(a.score, c);
|
|
1980
|
-
|
|
1980
|
+
z(e, p, L.NORMAL), e.setTextColor(60, 60, 160);
|
|
1981
1981
|
let n = h.midY + p * .12;
|
|
1982
1982
|
e.text(t, x - 1, n, { align: "right" }), e.setTextColor(0);
|
|
1983
1983
|
}
|
|
@@ -2020,19 +2020,19 @@ function zt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2020
2020
|
if (_?.winningSide) {
|
|
2021
2021
|
let t = _.drawPositions[_.winningSide - 1], n = o.get(t);
|
|
2022
2022
|
if (n) {
|
|
2023
|
-
|
|
2024
|
-
let { name: t } =
|
|
2023
|
+
z(e, d + 1, L.BOLD);
|
|
2024
|
+
let { name: t } = K(n, p);
|
|
2025
2025
|
if (e.text(t, m + 1, g - .5), _.score) {
|
|
2026
2026
|
let t = q(_.score, p);
|
|
2027
|
-
|
|
2027
|
+
z(e, f, L.NORMAL), e.setTextColor(60, 60, 160), e.text(t, m + 1, g + f * .4), e.setTextColor(0);
|
|
2028
2028
|
}
|
|
2029
2029
|
}
|
|
2030
2030
|
}
|
|
2031
2031
|
}
|
|
2032
2032
|
function Bt(e, t, n, r, i, a, o, s, c) {
|
|
2033
|
-
|
|
2033
|
+
z(e, r.fontSize <= R.TINY ? 5.5 : R.SMALL, L.BOLD), e.setTextColor(40);
|
|
2034
2034
|
for (let l = 0; l < s; l++) {
|
|
2035
|
-
let s = t[l], u =
|
|
2035
|
+
let s = t[l], u = G(s, n.totalRounds), d = n.roundLabelMap?.[s] || i.roundLabels[u] || u, f = o(l), p = l === 0 ? r.firstRoundWidth : c;
|
|
2036
2036
|
e.text(d, f + p / 2, a.contentY + 2, { align: "center" }), e.setDrawColor(160), e.setLineWidth(.15), e.line(f + 2, a.contentY + 3.5, f + p - 2, a.contentY + 3.5);
|
|
2037
2037
|
}
|
|
2038
2038
|
let l = o(s);
|
|
@@ -2075,7 +2075,7 @@ function Ht(e, t, n, r, i, a, o, s, c, l) {
|
|
|
2075
2075
|
}
|
|
2076
2076
|
function Ut(e, t, n, r, i, a, o, s) {
|
|
2077
2077
|
let c = q(t.score, n);
|
|
2078
|
-
if (
|
|
2078
|
+
if (z(e, r.scoreFontSize, L.NORMAL), e.setTextColor(60, 60, 160), i * 2 < r.scoreFontSize * 1.2) {
|
|
2079
2079
|
let t = a + Kt(o + 1, r) - 1;
|
|
2080
2080
|
e.text(c, t, s - .5, { align: "right" });
|
|
2081
2081
|
} else {
|
|
@@ -2091,19 +2091,19 @@ function Wt(e, t, n, r, i, a, o) {
|
|
|
2091
2091
|
if (d?.winningSide) {
|
|
2092
2092
|
let i = d.drawPositions[d.winningSide - 1], a = Zt(t.slots, i);
|
|
2093
2093
|
if (a) {
|
|
2094
|
-
|
|
2095
|
-
let { name: t } =
|
|
2094
|
+
z(e, r.fontSize + 1, L.BOLD);
|
|
2095
|
+
let { name: t } = K(a, n);
|
|
2096
2096
|
if (e.text(t, s + 1, u - .5), d.score) {
|
|
2097
2097
|
let t = q(d.score, n);
|
|
2098
|
-
|
|
2098
|
+
z(e, r.scoreFontSize, L.NORMAL), e.setTextColor(60, 60, 160), e.text(t, s + 1, u + r.scoreFontSize * .4), e.setTextColor(0);
|
|
2099
2099
|
}
|
|
2100
2100
|
}
|
|
2101
2101
|
}
|
|
2102
2102
|
}
|
|
2103
2103
|
function Gt(e, t, n, r, i, a, o, s, c) {
|
|
2104
|
-
|
|
2104
|
+
z(e, r.fontSize <= R.TINY ? 5.5 : R.SMALL, L.BOLD), e.setTextColor(40);
|
|
2105
2105
|
for (let c = 0; c < t; c++) {
|
|
2106
|
-
let l = n - t + c + 1, u =
|
|
2106
|
+
let l = n - t + c + 1, u = G(l, n), d = s?.[l] || i.roundLabels[u] || u, f = qt(c, r, a), p = Kt(c, r), m = f + p / 2;
|
|
2107
2107
|
e.text(d, m, o, { align: "center" }), e.setDrawColor(160), e.setLineWidth(.15), e.line(f + 2, o + 1.5, f + p - 2, o + 1.5);
|
|
2108
2108
|
}
|
|
2109
2109
|
if (!c) {
|
|
@@ -2123,12 +2123,12 @@ function qt(e, t, n) {
|
|
|
2123
2123
|
}
|
|
2124
2124
|
function Jt(e, t, n, r, i, a, o, s) {
|
|
2125
2125
|
let c = i.fontSize <= 5 ? 4 : 5, l = i.fontSize <= 5 ? 5 : 6, u = s || i.firstRoundWidth, d = i.lineHeight < 2 ? .15 : .3;
|
|
2126
|
-
|
|
2126
|
+
z(e, i.scoreFontSize, L.NORMAL), e.setTextColor(120), e.text(`${n}`, a, o - d, { align: "left" }), e.setTextColor(0), t?.nationality && (z(e, i.scoreFontSize, L.NORMAL), e.setTextColor(100), e.text(t.nationality, a + c + l - 1, o - d, { align: "right" }), e.setTextColor(0));
|
|
2127
2127
|
let f = a + c + l, p = a + u;
|
|
2128
2128
|
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(f, o, p, o), !t) return;
|
|
2129
|
-
let { name: m } =
|
|
2129
|
+
let { name: m } = K(t, r);
|
|
2130
2130
|
if (!m) return;
|
|
2131
|
-
|
|
2131
|
+
z(e, i.fontSize, t.isBye ? L.ITALIC : L.NORMAL), t.isBye && e.setTextColor(150);
|
|
2132
2132
|
let h = p - f - 2, g = m;
|
|
2133
2133
|
e.getTextWidth(m) > h && (g = Xt(t.participantName));
|
|
2134
2134
|
let _ = i.lineHeight < 2 ? .2 : .5;
|
|
@@ -2146,7 +2146,7 @@ function Yt(e, t, n, r, i, a) {
|
|
|
2146
2146
|
default: s = `[${t.seedValue}]`;
|
|
2147
2147
|
}
|
|
2148
2148
|
let c = s ? `${o} ${s}` : o;
|
|
2149
|
-
|
|
2149
|
+
z(e, r.fontSize, L.BOLD), e.text(c, i + 1, a - .5);
|
|
2150
2150
|
}
|
|
2151
2151
|
function Xt(e) {
|
|
2152
2152
|
let t = e.match(/^([^,]+),\s*(.+)/);
|
|
@@ -2175,49 +2175,49 @@ function $t(e, t) {
|
|
|
2175
2175
|
//#endregion
|
|
2176
2176
|
//#region src/renderers/mirroredDraw.ts
|
|
2177
2177
|
function en(e, t, n, r) {
|
|
2178
|
-
let i = n.page.margins, a = r.contentY + 9, o = r.contentHeight - 9, s = t.drawSize / 2, c = Math.log2(s), l = r.contentWidth, u = Math.min(30, l * .08), d = (l - u) / 2, f = i.left + d, p = o / s, m = p < 3.5, h = m ? .8 : 1.5, g = Math.min(m ? 30 : 50, d * .22), _ = c, v = d - g - h * (_ + 1), y = Math.max(8, v / Math.max(1, _)), b =
|
|
2179
|
-
p < 2.5 ? b = 5 : m && (b =
|
|
2180
|
-
let x = m ? 5 :
|
|
2178
|
+
let i = n.page.margins, a = r.contentY + 9, o = r.contentHeight - 9, s = t.drawSize / 2, c = Math.log2(s), l = r.contentWidth, u = Math.min(30, l * .08), d = (l - u) / 2, f = i.left + d, p = o / s, m = p < 3.5, h = m ? .8 : 1.5, g = Math.min(m ? 30 : 50, d * .22), _ = c, v = d - g - h * (_ + 1), y = Math.max(8, v / Math.max(1, _)), b = R.SMALL;
|
|
2179
|
+
p < 2.5 ? b = 5 : m && (b = R.TINY);
|
|
2180
|
+
let x = m ? 5 : R.TINY, S = {
|
|
2181
2181
|
lineHeight: p,
|
|
2182
2182
|
roundColumnWidth: y,
|
|
2183
2183
|
firstRoundWidth: g,
|
|
2184
2184
|
connectorGap: h,
|
|
2185
2185
|
fontSize: b,
|
|
2186
2186
|
scoreFontSize: x
|
|
2187
|
-
},
|
|
2187
|
+
}, C = t.slots.filter((e) => e.drawPosition <= s), ee = t.slots.filter((e) => e.drawPosition > s), w = t.matchUps.filter((e) => e.drawPositions.every((e) => e <= s)), T = t.matchUps.filter((e) => e.drawPositions.every((e) => e > s)), E = ee.map((e) => ({
|
|
2188
2188
|
...e,
|
|
2189
2189
|
drawPosition: e.drawPosition - s
|
|
2190
|
-
})),
|
|
2191
|
-
for (let e of
|
|
2192
|
-
let
|
|
2193
|
-
for (let [, e] of
|
|
2194
|
-
|
|
2190
|
+
})), D = /* @__PURE__ */ new Map();
|
|
2191
|
+
for (let e of T) D.has(e.roundNumber) || D.set(e.roundNumber, []), D.get(e.roundNumber).push(e);
|
|
2192
|
+
let O = [];
|
|
2193
|
+
for (let [, e] of D) e.sort((e, t) => e.roundPosition - t.roundPosition), e.forEach((e, t) => {
|
|
2194
|
+
O.push({
|
|
2195
2195
|
...e,
|
|
2196
2196
|
drawPositions: e.drawPositions.map((e) => e - s),
|
|
2197
2197
|
roundPosition: t + 1
|
|
2198
2198
|
});
|
|
2199
2199
|
});
|
|
2200
|
-
let
|
|
2201
|
-
for (let e of
|
|
2202
|
-
let
|
|
2203
|
-
for (let [, e] of
|
|
2204
|
-
|
|
2200
|
+
let k = /* @__PURE__ */ new Map();
|
|
2201
|
+
for (let e of w) k.has(e.roundNumber) || k.set(e.roundNumber, []), k.get(e.roundNumber).push(e);
|
|
2202
|
+
let A = [];
|
|
2203
|
+
for (let [, e] of k) e.sort((e, t) => e.roundPosition - t.roundPosition), e.forEach((e, t) => {
|
|
2204
|
+
A.push({
|
|
2205
2205
|
...e,
|
|
2206
2206
|
roundPosition: t + 1
|
|
2207
2207
|
});
|
|
2208
2208
|
});
|
|
2209
|
-
rn(e, c, t.totalRounds, S, n, i.left, i.left + l, r.contentY + 2, t.roundLabelMap),
|
|
2210
|
-
let
|
|
2211
|
-
if (
|
|
2209
|
+
rn(e, c, t.totalRounds, S, n, i.left, i.left + l, r.contentY + 2, t.roundLabelMap), z(e, m ? 5.5 : R.SMALL, L.BOLD), e.setTextColor(40), e.text("Winner", f + u / 2, r.contentY + 2, { align: "center" }), e.setDrawColor(160), e.setLineWidth(.15), e.line(f + 2, r.contentY + 3.5, f + u - 2, r.contentY + 3.5), e.setTextColor(0), tn(e, C, A, c, S, n, i.left, a, t.totalRounds), nn(e, E, O, c, S, n, i.left + l, a, t.totalRounds);
|
|
2210
|
+
let j = t.matchUps.find((e) => e.roundNumber === t.totalRounds);
|
|
2211
|
+
if (j) {
|
|
2212
2212
|
let r = a + o / 2;
|
|
2213
|
-
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(f + 2, r, f + u - 2, r),
|
|
2214
|
-
let i =
|
|
2213
|
+
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(f + 2, r, f + u - 2, r), j.winningSide) {
|
|
2214
|
+
let i = j.drawPositions[j.winningSide - 1], a = t.slots.find((e) => e.drawPosition === i);
|
|
2215
2215
|
if (a) {
|
|
2216
|
-
let { name: t } =
|
|
2217
|
-
|
|
2216
|
+
let { name: t } = K(a, n);
|
|
2217
|
+
z(e, b + 1, L.BOLD), e.text(t, f + u / 2, r - 1, { align: "center" });
|
|
2218
2218
|
}
|
|
2219
2219
|
}
|
|
2220
|
-
|
|
2220
|
+
j.score && (z(e, x, L.NORMAL), e.setTextColor(60, 60, 160), e.text(q(j.score, n), f + u / 2, r + x * .4, { align: "center" }), e.setTextColor(0));
|
|
2221
2221
|
}
|
|
2222
2222
|
}
|
|
2223
2223
|
function tn(e, t, n, r, i, a, o, s, c) {
|
|
@@ -2236,12 +2236,12 @@ function tn(e, t, n, r, i, a, o, s, c) {
|
|
|
2236
2236
|
if (t < r - 1 && b?.winningSide) {
|
|
2237
2237
|
let t = b.drawPositions[b.winningSide - 1], n = l.get(t);
|
|
2238
2238
|
if (n) {
|
|
2239
|
-
|
|
2239
|
+
z(e, i.fontSize, L.BOLD);
|
|
2240
2240
|
let t = n.participantName;
|
|
2241
2241
|
e.getTextWidth(t) > i.roundColumnWidth - 2 && (t = cn(t)), e.text(t, y + 1, _ - .5);
|
|
2242
2242
|
}
|
|
2243
2243
|
}
|
|
2244
|
-
b?.score && t < r - 1 && (
|
|
2244
|
+
b?.score && t < r - 1 && (z(e, i.scoreFontSize, L.NORMAL), e.setTextColor(60, 60, 160), e.text(q(b.score, a), y + 1, _ - .5 + i.scoreFontSize * .4), e.setTextColor(0));
|
|
2245
2245
|
}
|
|
2246
2246
|
}
|
|
2247
2247
|
}
|
|
@@ -2261,7 +2261,7 @@ function nn(e, t, n, r, i, a, o, s, c) {
|
|
|
2261
2261
|
if (t < r - 1 && b?.winningSide) {
|
|
2262
2262
|
let t = b.drawPositions[b.winningSide - 1], n = l.get(t);
|
|
2263
2263
|
if (n) {
|
|
2264
|
-
|
|
2264
|
+
z(e, i.fontSize, L.BOLD);
|
|
2265
2265
|
let t = n.participantName;
|
|
2266
2266
|
e.getTextWidth(t) > i.roundColumnWidth - 2 && (t = cn(t));
|
|
2267
2267
|
let r = y;
|
|
@@ -2270,15 +2270,15 @@ function nn(e, t, n, r, i, a, o, s, c) {
|
|
|
2270
2270
|
}
|
|
2271
2271
|
if (b?.score && t < r - 1) {
|
|
2272
2272
|
let t = y;
|
|
2273
|
-
|
|
2273
|
+
z(e, i.scoreFontSize, L.NORMAL), e.setTextColor(60, 60, 160), e.text(q(b.score, a), t + i.roundColumnWidth - 1, _ - .5 + i.scoreFontSize * .4, { align: "right" }), e.setTextColor(0);
|
|
2274
2274
|
}
|
|
2275
2275
|
}
|
|
2276
2276
|
}
|
|
2277
2277
|
}
|
|
2278
2278
|
function rn(e, t, n, r, i, a, o, s, c) {
|
|
2279
|
-
|
|
2279
|
+
z(e, r.fontSize <= R.TINY ? 5.5 : R.SMALL, L.BOLD), e.setTextColor(40);
|
|
2280
2280
|
for (let l = 0; l < t; l++) {
|
|
2281
|
-
let u = n - t + l + 1, d =
|
|
2281
|
+
let u = n - t + l + 1, d = G(u, n), f = c?.[u] || i.roundLabels[d] || d, p = l === 0 ? r.firstRoundWidth : r.roundColumnWidth, m = an(l, r, a);
|
|
2282
2282
|
e.text(f, m + p / 2, s, { align: "center" }), e.setDrawColor(160), e.setLineWidth(.15), e.line(m + 2, s + 1.5, m + p - 2, s + 1.5);
|
|
2283
2283
|
let h = on(l, r, o);
|
|
2284
2284
|
e.text(f, h + p / 2, s, { align: "center" }), e.line(h + 2, s + 1.5, h + p - 2, s + 1.5);
|
|
@@ -2293,11 +2293,11 @@ function on(e, t, n) {
|
|
|
2293
2293
|
}
|
|
2294
2294
|
function sn(e, t, n, r, i, a, o) {
|
|
2295
2295
|
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(r, i, r + a, i), !t || t.isBye) {
|
|
2296
|
-
t?.isBye && (
|
|
2296
|
+
t?.isBye && (z(e, n.fontSize, L.ITALIC), e.setTextColor(150), o === "ltr" ? e.text("Bye", r + 1, i - .3) : e.text("Bye", r + a - 1, i - .3, { align: "right" }), e.setTextColor(0));
|
|
2297
2297
|
return;
|
|
2298
2298
|
}
|
|
2299
2299
|
let s = t.seedValue ? `[${t.seedValue}]` : "";
|
|
2300
|
-
|
|
2300
|
+
z(e, n.fontSize, L.NORMAL);
|
|
2301
2301
|
let c = t.participantName, l = s ? `${s} ${c}` : c;
|
|
2302
2302
|
e.getTextWidth(l) > a - 2 && (c = cn(t.participantName), l = s ? `${s} ${c}` : c), o === "ltr" ? e.text(l, r + 1, i - .3) : e.text(l, r + a - 1, i - .3, { align: "right" });
|
|
2303
2303
|
}
|
|
@@ -2313,23 +2313,23 @@ function ln(e, t, n) {
|
|
|
2313
2313
|
//#endregion
|
|
2314
2314
|
//#region src/renderers/backdrawDraw.ts
|
|
2315
2315
|
function un(e, t, n, r) {
|
|
2316
|
-
let i = n.page.margins, a = r.contentY + 9, o = r.contentHeight - 9, s = r.contentWidth, c = t.mainDraw.matchUps, l = t.mainDraw.slots, u = t.consolation.matchUps, d = t.consolation.slots, f = new Map(l.map((e) => [e.drawPosition, e])), p = new Map(d.map((e) => [e.drawPosition, e])), m = c.filter((e) => e.roundNumber === 1).sort((e, t) => e.roundPosition - t.roundPosition), h = m.length, g = h * 2, _ = Math.max(...c.map((e) => e.roundNumber)), v = _ - 1, y = u.length > 0 ? Math.max(...u.map((e) => e.roundNumber)) : 0, b = 1.5, x = s - 28 - b * 4, S = v + 1,
|
|
2317
|
-
|
|
2318
|
-
let
|
|
2319
|
-
yn(e, _, y, t, n,
|
|
2316
|
+
let i = n.page.margins, a = r.contentY + 9, o = r.contentHeight - 9, s = r.contentWidth, c = t.mainDraw.matchUps, l = t.mainDraw.slots, u = t.consolation.matchUps, d = t.consolation.slots, f = new Map(l.map((e) => [e.drawPosition, e])), p = new Map(d.map((e) => [e.drawPosition, e])), m = c.filter((e) => e.roundNumber === 1).sort((e, t) => e.roundPosition - t.roundPosition), h = m.length, g = h * 2, _ = Math.max(...c.map((e) => e.roundNumber)), v = _ - 1, y = u.length > 0 ? Math.max(...u.map((e) => e.roundNumber)) : 0, b = 1.5, x = s - 28 - b * 4, S = v + 1, C = Math.max(y + 1, 1), ee = x * (S / (S + C)), w = x - ee, T = i.left + w + b, E = S > 0 ? (ee - b * S) / S : 0, D = T + 28 + b, O = C > 0 ? (w - b * C) / C : 0, k = i.left + w, A = o / g, j = A < 3.5, M = R.SMALL;
|
|
2317
|
+
A < 2.5 ? M = 5 : j && (M = R.TINY);
|
|
2318
|
+
let te = j ? 5 : R.TINY;
|
|
2319
|
+
yn(e, _, y, t, n, T, 28, D, E, k, O, b, r.contentY + 2, M), dn(e, m, h, f, T, 28, b, D, k, a, A, M, y), pn(e, c, f, _, h, D, E, b, a, A, M, te, n, t.mainDraw.roundLabelMap), mn(e, u, p, y, k, O, b, a, A, h, M, te, n, t.consolation.roundLabelMap);
|
|
2320
2320
|
}
|
|
2321
2321
|
function dn(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
2322
2322
|
for (let p = 0; p < n; p++) {
|
|
2323
2323
|
let n = t[p], m = l + p * u * 2, h = m + u, g = (m + h) / 2, _ = n.drawPositions[0], v = n.drawPositions[1], y = u * .9;
|
|
2324
2324
|
e.setDrawColor(40), e.setLineWidth(.3), e.rect(i, m, a, y), e.rect(i, h, a, y);
|
|
2325
2325
|
let b = _ ? r.get(_) : void 0, x = v ? r.get(v) : void 0;
|
|
2326
|
-
|
|
2326
|
+
z(e, d, L.NORMAL), _ && fn(e, _, b, n.winningSide === 1, i, m, y, a, d), v && fn(e, v, x, n.winningSide === 2, i, h, y, a, d), e.setDrawColor(40), e.setLineWidth(.25), e.line(i + a, m + y / 2, i + a + o, m + y / 2), e.line(i + a, h + y / 2, i + a + o, h + y / 2), e.line(i + a + o, m + y / 2, i + a + o, h + y / 2), e.line(i + a + o, g, s, g), f > 0 && (e.line(i, m + y / 2, i - o, m + y / 2), e.line(i, h + y / 2, i - o, h + y / 2), e.line(i - o, m + y / 2, i - o, h + y / 2), e.line(i - o, g, c, g));
|
|
2327
2327
|
}
|
|
2328
2328
|
}
|
|
2329
2329
|
function fn(e, t, n, r, i, a, o, s, c) {
|
|
2330
|
-
if (e.setTextColor(120),
|
|
2330
|
+
if (e.setTextColor(120), z(e, c, L.NORMAL), e.text(`${t}`, i + 1, a + o / 2 + c * .12), e.setTextColor(0), n?.participantName) {
|
|
2331
2331
|
let t = bn(n.participantName);
|
|
2332
|
-
|
|
2332
|
+
z(e, c, r ? L.BOLD : L.NORMAL), e.text(t, i + 5, a + o / 2 + c * .12, { maxWidth: s - 6 });
|
|
2333
2333
|
}
|
|
2334
2334
|
}
|
|
2335
2335
|
function pn(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
@@ -2341,7 +2341,7 @@ function pn(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2341
2341
|
let t = _ + o;
|
|
2342
2342
|
e.line(t + s, p, t + s, v), e.line(t, p, t + s, p), e.line(t, v, t + s, v), e.line(t + s, y, _ + o + s + o + s > 0 ? a + (i + 1) * (o + s) : t + s + 5, y);
|
|
2343
2343
|
}
|
|
2344
|
-
l.score && (
|
|
2344
|
+
l.score && (z(e, d, L.NORMAL), e.setTextColor(60, 60, 160), e.text(q(l.score, f), _ + o - 1, y + d * .12, { align: "right" }), e.setTextColor(0));
|
|
2345
2345
|
}
|
|
2346
2346
|
}
|
|
2347
2347
|
let m = a + (r - 2) * (o + s) + o + s, h = c + (2 ** (r - 1) - 1) * l / 2 + l * 2 ** (r - 2);
|
|
@@ -2350,8 +2350,8 @@ function pn(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2350
2350
|
if (g?.winningSide) {
|
|
2351
2351
|
let t = n.get(g.drawPositions[g.winningSide - 1]);
|
|
2352
2352
|
if (t) {
|
|
2353
|
-
let { name: n } =
|
|
2354
|
-
|
|
2353
|
+
let { name: n } = K(t, f);
|
|
2354
|
+
z(e, u + 1, L.BOLD), e.text(n, m + 1, h - .5);
|
|
2355
2355
|
}
|
|
2356
2356
|
}
|
|
2357
2357
|
}
|
|
@@ -2368,14 +2368,14 @@ function hn(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
|
2368
2368
|
let t = a - (r + 2) * (o + s);
|
|
2369
2369
|
e.line(_ - s, y, t + o, y);
|
|
2370
2370
|
}
|
|
2371
|
-
l.score && (
|
|
2371
|
+
l.score && (z(e, d, L.NORMAL), e.setTextColor(60, 60, 160), e.text(q(l.score, f), _ + 1, y + d * .12), e.setTextColor(0));
|
|
2372
2372
|
}
|
|
2373
2373
|
}
|
|
2374
2374
|
function gn(e, t, n, r, i, a, o) {
|
|
2375
2375
|
if (!t) return;
|
|
2376
2376
|
let s = n.get(t);
|
|
2377
2377
|
if (!s?.participantName) return;
|
|
2378
|
-
|
|
2378
|
+
z(e, r, L.BOLD);
|
|
2379
2379
|
let c = s.participantName;
|
|
2380
2380
|
e.getTextWidth(c) > a - 2 && (c = bn(c)), e.text(c, i + a - 1, o - .3, { align: "right" });
|
|
2381
2381
|
}
|
|
@@ -2387,8 +2387,8 @@ function _n(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
2387
2387
|
if (p?.winningSide) {
|
|
2388
2388
|
let t = n.get(p.drawPositions[p.winningSide - 1]);
|
|
2389
2389
|
if (t) {
|
|
2390
|
-
let { name: n } =
|
|
2391
|
-
|
|
2390
|
+
let { name: n } = K(t, u);
|
|
2391
|
+
z(e, l + 1, L.BOLD), e.text(n, d + a - 1, f - .5, { align: "right" });
|
|
2392
2392
|
}
|
|
2393
2393
|
}
|
|
2394
2394
|
}
|
|
@@ -2396,7 +2396,7 @@ function vn(e, t, n, r, i, a, o, s, c) {
|
|
|
2396
2396
|
if (t.drawPositions[0]) {
|
|
2397
2397
|
let a = n.get(t.drawPositions[0]);
|
|
2398
2398
|
if (a?.participantName) {
|
|
2399
|
-
|
|
2399
|
+
z(e, s, L.BOLD);
|
|
2400
2400
|
let t = a.participantName;
|
|
2401
2401
|
e.getTextWidth(t) > o - 2 && (t = bn(t)), e.text(t, r + 1, i - .3);
|
|
2402
2402
|
}
|
|
@@ -2404,14 +2404,14 @@ function vn(e, t, n, r, i, a, o, s, c) {
|
|
|
2404
2404
|
if (t.drawPositions[1]) {
|
|
2405
2405
|
let i = n.get(t.drawPositions[1]);
|
|
2406
2406
|
if (i?.participantName) {
|
|
2407
|
-
|
|
2407
|
+
z(e, s, L.BOLD);
|
|
2408
2408
|
let t = i.participantName;
|
|
2409
2409
|
e.getTextWidth(t) > o - 2 && (t = bn(t)), e.text(t, r + 1, a - .3);
|
|
2410
2410
|
}
|
|
2411
2411
|
}
|
|
2412
2412
|
}
|
|
2413
2413
|
function yn(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2414
|
-
|
|
2414
|
+
z(e, p <= R.TINY ? 5.5 : R.SMALL, L.BOLD), e.setTextColor(40);
|
|
2415
2415
|
let m = r.mainDraw.roundLabelMap?.[1] || "R1";
|
|
2416
2416
|
e.text(m, a + o / 2, f, { align: "center" });
|
|
2417
2417
|
for (let n = 0; n < t - 1; n++) {
|
|
@@ -2449,7 +2449,7 @@ function Sn(e, t, n, r) {
|
|
|
2449
2449
|
let a = Cn(s, r);
|
|
2450
2450
|
o + a > r.contentY + r.contentHeight && (e.addPage(), o = r.contentY);
|
|
2451
2451
|
let c = s.abbreviation === "E";
|
|
2452
|
-
|
|
2452
|
+
z(e, c ? R.HEADING : R.BODY, L.BOLD), c || e.setTextColor(30, 60, 120);
|
|
2453
2453
|
let l = c ? `Main Draw (${s.name})` : `${s.name} Draw`;
|
|
2454
2454
|
e.text(l, i.left, o), c || e.setTextColor(0), o += c ? 5 : 4;
|
|
2455
2455
|
let u = {
|
|
@@ -2486,8 +2486,8 @@ function Tn(e) {
|
|
|
2486
2486
|
let t = e.participantId ? r.get(e.participantId) : void 0, n = i.find((t) => t.participantId === e.participantId);
|
|
2487
2487
|
return {
|
|
2488
2488
|
drawPosition: e.drawPosition,
|
|
2489
|
-
participantName: t ?
|
|
2490
|
-
nationality: t ?
|
|
2489
|
+
participantName: t ? H(t) : "",
|
|
2490
|
+
nationality: t ? U(t) : "",
|
|
2491
2491
|
seedValue: n?.seedValue,
|
|
2492
2492
|
isBye: e.bye === !0
|
|
2493
2493
|
};
|
|
@@ -2517,8 +2517,8 @@ function Tn(e) {
|
|
|
2517
2517
|
let t = r.get(e.participantId);
|
|
2518
2518
|
return {
|
|
2519
2519
|
seedValue: e.seedValue,
|
|
2520
|
-
participantName: t ?
|
|
2521
|
-
nationality: t ?
|
|
2520
|
+
participantName: t ? H(t) : "",
|
|
2521
|
+
nationality: t ? U(t) : ""
|
|
2522
2522
|
};
|
|
2523
2523
|
}),
|
|
2524
2524
|
roundLabelMap: p
|
|
@@ -2534,7 +2534,7 @@ function En(e, t, n, r) {
|
|
|
2534
2534
|
}, s = [...t].filter((e) => e.drawData.drawSize > 0).sort((e, t) => (o[e.stage] ?? 9) - (o[t.stage] ?? 9));
|
|
2535
2535
|
for (let t of s) {
|
|
2536
2536
|
let o = t.stage === "MAIN", s = t.drawData.drawSize * 3.5 + 8;
|
|
2537
|
-
a + s > r.contentY + r.contentHeight && a > r.contentY + 10 && (e.addPage(), a = r.contentY), a += 3,
|
|
2537
|
+
a + s > r.contentY + r.contentHeight && a > r.contentY + 10 && (e.addPage(), a = r.contentY), a += 3, z(e, o ? R.HEADING : R.BODY, L.BOLD), o || e.setTextColor(120, 40, 40), e.text(t.name, i.left, a), o || e.setTextColor(0), a += o ? 4 : 3;
|
|
2538
2538
|
let c = {
|
|
2539
2539
|
...r,
|
|
2540
2540
|
contentY: a,
|
|
@@ -2547,12 +2547,12 @@ function En(e, t, n, r) {
|
|
|
2547
2547
|
//#region src/renderers/doubleEliminationDraw.ts
|
|
2548
2548
|
function Dn(e, t, n, r) {
|
|
2549
2549
|
let i = n.page.margins, a = r.contentHeight, o = a * .44, s = a * .44, c = r.contentWidth - 30 - 8, l = On(t.winnersBracket), u = r.contentY + 3;
|
|
2550
|
-
|
|
2550
|
+
z(e, R.BODY, L.BOLD), e.setTextColor(30, 80, 30), e.text("Winner's Bracket", i.left, u), e.setTextColor(0), u += 3, J(e, l, n, {
|
|
2551
2551
|
...r,
|
|
2552
2552
|
contentY: u,
|
|
2553
2553
|
contentHeight: o - 6,
|
|
2554
2554
|
contentWidth: c
|
|
2555
|
-
}), u = r.contentY + o + 6,
|
|
2555
|
+
}), u = r.contentY + o + 6, z(e, R.BODY, L.BOLD), e.setTextColor(140, 40, 40), e.text("Loser's Bracket (Backdraw)", i.left, u), e.setTextColor(0), u += 3;
|
|
2556
2556
|
let d = {
|
|
2557
2557
|
...r,
|
|
2558
2558
|
contentY: u,
|
|
@@ -2561,23 +2561,23 @@ function Dn(e, t, n, r) {
|
|
|
2561
2561
|
};
|
|
2562
2562
|
J(e, t.losersBracket, n, d);
|
|
2563
2563
|
let f = i.left + c + 8, p = r.contentY + a / 2;
|
|
2564
|
-
if (
|
|
2564
|
+
if (z(e, R.SMALL, L.BOLD), e.text("Decider", f + 28 / 2, p - 14 - 4, { align: "center" }), e.setDrawColor(60), e.setLineWidth(.5), e.rect(f, p - 14 - 1, 28, 14), e.setLineWidth(.2), e.line(f, p - 14 / 2 - 1, f + 28, p - 14 / 2 - 1), t.deciderMatch?.matchUps?.length) {
|
|
2565
2565
|
let n = t.deciderMatch.matchUps[0], r = new Map(t.deciderMatch.slots.map((e) => [e.drawPosition, e]));
|
|
2566
2566
|
if (n.drawPositions[0]) {
|
|
2567
2567
|
let t = r.get(n.drawPositions[0]);
|
|
2568
2568
|
if (t?.participantName) {
|
|
2569
2569
|
let r = n.winningSide === 1;
|
|
2570
|
-
|
|
2570
|
+
z(e, R.TINY, r ? L.BOLD : L.NORMAL), e.text(t.participantName, f + 1, p - 14 / 2 - 3, { maxWidth: 26 });
|
|
2571
2571
|
}
|
|
2572
2572
|
}
|
|
2573
2573
|
if (n.drawPositions[1]) {
|
|
2574
2574
|
let t = r.get(n.drawPositions[1]);
|
|
2575
2575
|
if (t?.participantName) {
|
|
2576
2576
|
let r = n.winningSide === 2;
|
|
2577
|
-
|
|
2577
|
+
z(e, R.TINY, r ? L.BOLD : L.NORMAL), e.text(t.participantName, f + 1, p - 3, { maxWidth: 26 });
|
|
2578
2578
|
}
|
|
2579
2579
|
}
|
|
2580
|
-
n.score && (
|
|
2580
|
+
n.score && (z(e, R.TINY, L.NORMAL), e.setTextColor(60, 60, 160), e.text(n.score, f + 28 - 1, p - 14 + 2, { align: "right" }), e.setTextColor(0));
|
|
2581
2581
|
}
|
|
2582
2582
|
}
|
|
2583
2583
|
function On(e) {
|
|
@@ -2595,9 +2595,9 @@ function Mn(e, t, n, r) {
|
|
|
2595
2595
|
let i = n.page.margins, a = /* @__PURE__ */ new Map();
|
|
2596
2596
|
for (let e of t.matchUps) a.has(e.roundNumber) || a.set(e.roundNumber, []), a.get(e.roundNumber).push(e);
|
|
2597
2597
|
let o = new Map(t.slots.map((e) => [e.drawPosition, e])), s = [...a.keys()].sort((e, t) => e - t), c = s.length, l = r.contentY + 7, u = r.contentHeight - 7, d = Math.min(55, (r.contentWidth - (c - 1) * 6) / c), f = a.get(s[0])?.length || 1, p = Math.min(An, (u - (f + 1) * jn) / f);
|
|
2598
|
-
|
|
2598
|
+
z(e, R.SMALL, L.BOLD), e.setTextColor(30, 60, 120);
|
|
2599
2599
|
for (let a = 0; a < c; a++) {
|
|
2600
|
-
let o = s[a], c = n.roundLabels[
|
|
2600
|
+
let o = s[a], c = n.roundLabels[G(o, t.totalRounds)] || G(o, t.totalRounds), l = i.left + a * (d + 6);
|
|
2601
2601
|
e.text(c, l + d / 2, r.contentY + 3, { align: "center" });
|
|
2602
2602
|
}
|
|
2603
2603
|
e.setTextColor(0);
|
|
@@ -2610,23 +2610,23 @@ function Mn(e, t, n, r) {
|
|
|
2610
2610
|
}
|
|
2611
2611
|
}
|
|
2612
2612
|
function Nn(e, t, n, r, i, a, o, s) {
|
|
2613
|
-
let c = s < 10 ? 5 :
|
|
2613
|
+
let c = s < 10 ? 5 : R.TINY;
|
|
2614
2614
|
e.setDrawColor(100), e.setLineWidth(.3), e.rect(i, a, o, s);
|
|
2615
2615
|
let l = a + s / 2;
|
|
2616
2616
|
e.setLineWidth(.15), e.line(i, l, i + o, l);
|
|
2617
2617
|
let u = t.drawPositions[0] ? n.get(t.drawPositions[0]) : void 0;
|
|
2618
2618
|
if (u) {
|
|
2619
|
-
let n =
|
|
2620
|
-
|
|
2619
|
+
let n = xt(u, r);
|
|
2620
|
+
z(e, c, t.winningSide === 1 ? L.BOLD : L.NORMAL), e.text(n, i + kn, l - c * .15, { maxWidth: o - 2 * kn });
|
|
2621
2621
|
}
|
|
2622
2622
|
let d = t.drawPositions[1] ? n.get(t.drawPositions[1]) : void 0;
|
|
2623
2623
|
if (d) {
|
|
2624
|
-
let n =
|
|
2625
|
-
|
|
2624
|
+
let n = xt(d, r);
|
|
2625
|
+
z(e, c, t.winningSide === 2 ? L.BOLD : L.NORMAL), e.text(n, i + kn, l + c * .55, { maxWidth: o - 2 * kn });
|
|
2626
2626
|
}
|
|
2627
2627
|
if (t.score) {
|
|
2628
2628
|
let n = q(t.score, r);
|
|
2629
|
-
|
|
2629
|
+
z(e, c, L.NORMAL), e.setTextColor(60, 60, 160), e.text(n, i + o - kn, a + c * .5, { align: "right" }), e.setTextColor(0);
|
|
2630
2630
|
}
|
|
2631
2631
|
}
|
|
2632
2632
|
//#endregion
|
|
@@ -2725,7 +2725,7 @@ function Hn(e, t = {}) {
|
|
|
2725
2725
|
...t,
|
|
2726
2726
|
maxPositionsPerPage: 64
|
|
2727
2727
|
});
|
|
2728
|
-
let n = Y(e.drawSize, t), r =
|
|
2728
|
+
let n = Y(e.drawSize, t), r = I(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2729
2729
|
return J(n.doc, e, n.format, r), X(n), n.doc;
|
|
2730
2730
|
}
|
|
2731
2731
|
function Un(e, t = {}) {
|
|
@@ -2736,10 +2736,10 @@ function Un(e, t = {}) {
|
|
|
2736
2736
|
});
|
|
2737
2737
|
for (let t = 0; t < r.length; t++) {
|
|
2738
2738
|
t > 0 && n.doc.addPage();
|
|
2739
|
-
let i =
|
|
2739
|
+
let i = B(n.doc, {
|
|
2740
2740
|
...n.headerConfig,
|
|
2741
2741
|
subtitle: r[t].label
|
|
2742
|
-
}, n.pageConfig), a =
|
|
2742
|
+
}, n.pageConfig), a = I(n.doc, n.pageConfig, i, n.footerH);
|
|
2743
2743
|
if (r[t].slots.length > 0 || r[t].matchUps.length > 0) {
|
|
2744
2744
|
let i = r[t], o = i.endPosition - i.startPosition + 1, s = {
|
|
2745
2745
|
...e,
|
|
@@ -2756,31 +2756,31 @@ function Un(e, t = {}) {
|
|
|
2756
2756
|
return X(n), n.doc;
|
|
2757
2757
|
}
|
|
2758
2758
|
function Wn(e, t = {}) {
|
|
2759
|
-
let n = e.totalRounds >= 5 || e.slots.length >= 12, r = Y(e.drawSize, t, n), i =
|
|
2759
|
+
let n = e.totalRounds >= 5 || e.slots.length >= 12, r = Y(e.drawSize, t, n), i = I(r.doc, r.pageConfig, r.headerH, r.footerH);
|
|
2760
2760
|
return J(r.doc, e, r.format, i), X(r), r.doc;
|
|
2761
2761
|
}
|
|
2762
2762
|
function Gn(e, t = {}) {
|
|
2763
|
-
let n = Y(Math.max(...e.map((e) => e.drawData.drawSize), 8), t), r =
|
|
2763
|
+
let n = Y(Math.max(...e.map((e) => e.drawData.drawSize), 8), t), r = I(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2764
2764
|
return En(n.doc, e, n.format, r), Zn(n, 1), X(n), n.doc;
|
|
2765
2765
|
}
|
|
2766
2766
|
function Kn(e, t = {}) {
|
|
2767
|
-
let n = Y(e.mainStructure?.drawSize || 8, t), r =
|
|
2767
|
+
let n = Y(e.mainStructure?.drawSize || 8, t), r = I(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2768
2768
|
return Sn(n.doc, e, n.format, r), Zn(n, 1), X(n), n.doc;
|
|
2769
2769
|
}
|
|
2770
2770
|
function qn(e, t = {}) {
|
|
2771
|
-
let n = Y(e.drawSize, t, !0), r =
|
|
2771
|
+
let n = Y(e.drawSize, t, !0), r = I(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2772
2772
|
return en(n.doc, e, n.format, r), X(n), n.doc;
|
|
2773
2773
|
}
|
|
2774
2774
|
function Jn(e, t = {}) {
|
|
2775
|
-
let n = Y(e.mainDraw.drawSize, t, !0), r =
|
|
2775
|
+
let n = Y(e.mainDraw.drawSize, t, !0), r = I(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2776
2776
|
return un(n.doc, e, n.format, r), X(n), n.doc;
|
|
2777
2777
|
}
|
|
2778
2778
|
function Yn(e, t = {}) {
|
|
2779
|
-
let n = Y(Math.max(e.winnersBracket.drawSize, e.losersBracket.drawSize, 8), t, !0), r =
|
|
2779
|
+
let n = Y(Math.max(e.winnersBracket.drawSize, e.losersBracket.drawSize, 8), t, !0), r = I(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2780
2780
|
return Dn(n.doc, e, n.format, r), X(n), n.doc;
|
|
2781
2781
|
}
|
|
2782
2782
|
function Xn(e, t = {}) {
|
|
2783
|
-
let n = Y(e.drawSize, t), r =
|
|
2783
|
+
let n = Y(e.drawSize, t), r = I(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2784
2784
|
return Mn(n.doc, e, n.format, r), X(n), n.doc;
|
|
2785
2785
|
}
|
|
2786
2786
|
function Y(e, t, n) {
|
|
@@ -2795,24 +2795,24 @@ function Y(e, t, n) {
|
|
|
2795
2795
|
layout: "standard",
|
|
2796
2796
|
showPageNumbers: !0,
|
|
2797
2797
|
showTimestamp: !0
|
|
2798
|
-
}, s =
|
|
2798
|
+
}, s = de(i, e), c = V(o);
|
|
2799
2799
|
return {
|
|
2800
2800
|
doc: s,
|
|
2801
2801
|
pageConfig: i,
|
|
2802
2802
|
headerConfig: a,
|
|
2803
2803
|
footerConfig: o,
|
|
2804
2804
|
format: r,
|
|
2805
|
-
headerH:
|
|
2805
|
+
headerH: B(s, a, i),
|
|
2806
2806
|
footerH: c
|
|
2807
2807
|
};
|
|
2808
2808
|
}
|
|
2809
2809
|
function Zn(e, t) {
|
|
2810
2810
|
let n = e.doc.getNumberOfPages();
|
|
2811
|
-
for (let r = t + 1; r <= n; r++) e.doc.setPage(r),
|
|
2811
|
+
for (let r = t + 1; r <= n; r++) e.doc.setPage(r), B(e.doc, e.headerConfig, e.pageConfig);
|
|
2812
2812
|
}
|
|
2813
2813
|
function X(e) {
|
|
2814
2814
|
let t = e.doc.getNumberOfPages();
|
|
2815
|
-
for (let n = 1; n <= t; n++) e.doc.setPage(n),
|
|
2815
|
+
for (let n = 1; n <= t; n++) e.doc.setPage(n), Ae(e.doc, e.footerConfig, e.pageConfig, n);
|
|
2816
2816
|
e.doc.setPage(t);
|
|
2817
2817
|
}
|
|
2818
2818
|
//#endregion
|
|
@@ -2882,17 +2882,17 @@ function er(e, t) {
|
|
|
2882
2882
|
}, f;
|
|
2883
2883
|
try {
|
|
2884
2884
|
if (c && l) f = Yn({
|
|
2885
|
-
winnersBracket: s ?
|
|
2885
|
+
winnersBracket: s ? P(s) : tr(),
|
|
2886
2886
|
losersBracket: nr(r),
|
|
2887
2887
|
deciderMatch: rr(r)
|
|
2888
2888
|
}, d);
|
|
2889
2889
|
else if (c) f = Gn(o.map((e) => ({
|
|
2890
2890
|
name: e.structureName,
|
|
2891
2891
|
stage: e.stage,
|
|
2892
|
-
drawData:
|
|
2892
|
+
drawData: P(e)
|
|
2893
2893
|
})), d);
|
|
2894
2894
|
else if (s) {
|
|
2895
|
-
let e =
|
|
2895
|
+
let e = P(s);
|
|
2896
2896
|
f = u === "single-page" ? Hn(e, d) : Un(e, d);
|
|
2897
2897
|
}
|
|
2898
2898
|
} catch (e) {
|
|
@@ -2925,12 +2925,12 @@ function tr() {
|
|
|
2925
2925
|
};
|
|
2926
2926
|
}
|
|
2927
2927
|
function nr(e) {
|
|
2928
|
-
let t =
|
|
2929
|
-
return t ?
|
|
2928
|
+
let t = F(e.drawsData, "CONSOLATION");
|
|
2929
|
+
return t ? P(t) : tr();
|
|
2930
2930
|
}
|
|
2931
2931
|
function rr(e) {
|
|
2932
|
-
let t =
|
|
2933
|
-
return t ?
|
|
2932
|
+
let t = F(e.drawsData, "PLAY_OFF");
|
|
2933
|
+
return t ? P(t) : void 0;
|
|
2934
2934
|
}
|
|
2935
2935
|
function ir(e, t, n) {
|
|
2936
2936
|
if (e.header?.layout === "none") return;
|
|
@@ -3045,12 +3045,12 @@ function lr(e) {
|
|
|
3045
3045
|
function ur(e, t) {
|
|
3046
3046
|
let n = cr(t.tournamentEngine, e.eventId);
|
|
3047
3047
|
if (!n.success) return n;
|
|
3048
|
-
let r =
|
|
3048
|
+
let r = Ze({
|
|
3049
3049
|
participants: n.participants,
|
|
3050
3050
|
eventEntries: n.eventEntries
|
|
3051
3051
|
}), i = sr(e.composition, "playerList"), a;
|
|
3052
3052
|
try {
|
|
3053
|
-
a =
|
|
3053
|
+
a = dt(r, {
|
|
3054
3054
|
header: or(e.composition),
|
|
3055
3055
|
includeRanking: i?.includeRanking,
|
|
3056
3056
|
includeEvents: i?.includeEvents,
|
|
@@ -3077,12 +3077,12 @@ function dr(e, t) {
|
|
|
3077
3077
|
};
|
|
3078
3078
|
let n = cr(t.tournamentEngine, e.eventId);
|
|
3079
3079
|
if (!n.success) return n;
|
|
3080
|
-
let r =
|
|
3080
|
+
let r = Ze({
|
|
3081
3081
|
participants: n.participants,
|
|
3082
3082
|
eventEntries: n.eventEntries
|
|
3083
3083
|
}), i;
|
|
3084
3084
|
try {
|
|
3085
|
-
i =
|
|
3085
|
+
i = ft(r, {
|
|
3086
3086
|
header: or(e.composition),
|
|
3087
3087
|
eventName: n.eventName
|
|
3088
3088
|
});
|
|
@@ -3103,13 +3103,13 @@ function dr(e, t) {
|
|
|
3103
3103
|
function fr(e, t) {
|
|
3104
3104
|
let n = t.tournamentEngine, r = gr(n, e.venueId);
|
|
3105
3105
|
if (!r.success) return r;
|
|
3106
|
-
let i =
|
|
3106
|
+
let i = $e({
|
|
3107
3107
|
matchUps: r.matchUps,
|
|
3108
3108
|
venues: r.venues,
|
|
3109
3109
|
scheduledDate: e.scheduledDate
|
|
3110
3110
|
}), a = pr(e.composition, n), o = sr(e.composition, "courtCard"), s;
|
|
3111
3111
|
try {
|
|
3112
|
-
s =
|
|
3112
|
+
s = pt(i, {
|
|
3113
3113
|
tournamentName: a,
|
|
3114
3114
|
cardsPerPage: o?.cardsPerPage
|
|
3115
3115
|
});
|
|
@@ -3164,7 +3164,7 @@ function mr(e, t) {
|
|
|
3164
3164
|
}
|
|
3165
3165
|
})), c;
|
|
3166
3166
|
try {
|
|
3167
|
-
c =
|
|
3167
|
+
c = ht(s, {
|
|
3168
3168
|
cardsPerPage: 2,
|
|
3169
3169
|
includeScoreBoxes: !0
|
|
3170
3170
|
});
|
|
@@ -3188,13 +3188,13 @@ function hr(e, t) {
|
|
|
3188
3188
|
};
|
|
3189
3189
|
let n = t.tournamentEngine, r = gr(n, e.venueId);
|
|
3190
3190
|
if (!r.success) return r;
|
|
3191
|
-
let i =
|
|
3191
|
+
let i = Ye({
|
|
3192
3192
|
matchUps: r.matchUps,
|
|
3193
3193
|
venues: r.venues,
|
|
3194
3194
|
scheduledDate: e.scheduledDate
|
|
3195
3195
|
}), a = Qn(e.composition), o;
|
|
3196
3196
|
try {
|
|
3197
|
-
o =
|
|
3197
|
+
o = nt(i, a);
|
|
3198
3198
|
} catch (e) {
|
|
3199
3199
|
return {
|
|
3200
3200
|
success: !1,
|
|
@@ -3460,15 +3460,15 @@ function wr(e) {
|
|
|
3460
3460
|
let n = e.positionAssignments || [], i = e.seedAssignments || [], a = n.filter((e) => e.participantId).map((e) => {
|
|
3461
3461
|
let t = r.get(e.participantId), n = i.find((t) => t.participantId === e.participantId);
|
|
3462
3462
|
return {
|
|
3463
|
-
participantName: t ?
|
|
3464
|
-
nationality: t ?
|
|
3463
|
+
participantName: t ? H(t) : "",
|
|
3464
|
+
nationality: t ? U(t) : "",
|
|
3465
3465
|
seedValue: n?.seedValue,
|
|
3466
3466
|
groupPosition: e.drawPosition
|
|
3467
3467
|
};
|
|
3468
3468
|
}).sort((e, t) => e.groupPosition - t.groupPosition), o = [];
|
|
3469
3469
|
for (let t of e.matchUps || []) {
|
|
3470
3470
|
if (!t.drawPositions || t.drawPositions.length < 2) continue;
|
|
3471
|
-
let [e, n] = t.drawPositions, r =
|
|
3471
|
+
let [e, n] = t.drawPositions, r = We(t.score);
|
|
3472
3472
|
r && o.push({
|
|
3473
3473
|
rowPosition: e,
|
|
3474
3474
|
colPosition: n,
|
|
@@ -3504,7 +3504,7 @@ var Tr = [
|
|
|
3504
3504
|
];
|
|
3505
3505
|
function kr(e, n, r, i, a) {
|
|
3506
3506
|
let o = r.page.margins, s = n.participants.length;
|
|
3507
|
-
|
|
3507
|
+
z(e, R.HEADING, L.BOLD), e.text(n.groupName, o.left, a), a += 5;
|
|
3508
3508
|
let c = [
|
|
3509
3509
|
"#",
|
|
3510
3510
|
"Player",
|
|
@@ -3674,8 +3674,8 @@ function Nr(e) {
|
|
|
3674
3674
|
let t = e.participantId ? r.get(e.participantId) : void 0, n = o.find((t) => t.participantId === e.participantId);
|
|
3675
3675
|
return {
|
|
3676
3676
|
drawPosition: e.drawPosition,
|
|
3677
|
-
participantName: t ?
|
|
3678
|
-
nationality: t ?
|
|
3677
|
+
participantName: t ? H(t) : "",
|
|
3678
|
+
nationality: t ? U(t) : "",
|
|
3679
3679
|
seedValue: n?.seedValue,
|
|
3680
3680
|
isBye: e.bye === !0
|
|
3681
3681
|
};
|
|
@@ -3739,10 +3739,10 @@ function Fr(e, t = Pr, n) {
|
|
|
3739
3739
|
}
|
|
3740
3740
|
function Ir(e, t) {
|
|
3741
3741
|
if (e.setDrawColor(150), e.setLineWidth(.3), e.rect(t.x, t.y, t.width, t.height), t.isBye) {
|
|
3742
|
-
|
|
3742
|
+
z(e, R.SMALL, L.ITALIC), e.setTextColor(150), e.text("Bye", t.x + 2, t.y + t.height / 2 + 1.5), e.setTextColor(0);
|
|
3743
3743
|
return;
|
|
3744
3744
|
}
|
|
3745
|
-
t.participantName && (t.seed ? (
|
|
3745
|
+
t.participantName && (t.seed ? (z(e, R.TINY, L.BOLD), e.text(`[${t.seed}]`, t.x + 1, t.y + t.height / 2 + 1), z(e, R.SMALL, L.NORMAL), e.text(t.participantName, t.x + 9, t.y + t.height / 2 + 1)) : (z(e, R.SMALL, L.NORMAL), e.text(t.participantName, t.x + 2, t.y + t.height / 2 + 1)), t.nationality && (z(e, R.TINY, L.NORMAL), e.setTextColor(100), e.text(t.nationality, t.x + t.width - 2, t.y + t.height / 2 + 1, { align: "right" }), e.setTextColor(0)));
|
|
3746
3746
|
}
|
|
3747
3747
|
function Lr(e, t, n) {
|
|
3748
3748
|
e.setDrawColor(100), e.setLineWidth(.3);
|
|
@@ -3757,7 +3757,7 @@ function Lr(e, t, n) {
|
|
|
3757
3757
|
}
|
|
3758
3758
|
}
|
|
3759
3759
|
function Rr(e, t, n, r) {
|
|
3760
|
-
|
|
3760
|
+
z(e, R.TINY, L.NORMAL), e.setTextColor(60, 60, 180), e.text(t, n, r), e.setTextColor(0);
|
|
3761
3761
|
}
|
|
3762
3762
|
//#endregion
|
|
3763
3763
|
//#region src/generators/drawSheet.ts
|
|
@@ -3768,7 +3768,7 @@ function zr(t, n = {}) {
|
|
|
3768
3768
|
}), s = 15;
|
|
3769
3769
|
if (r) {
|
|
3770
3770
|
let e = `${t.drawName} - ${t.drawType.replace(/_/g, " ")} (${t.drawSize})`;
|
|
3771
|
-
s =
|
|
3771
|
+
s = lt(o, {
|
|
3772
3772
|
...r,
|
|
3773
3773
|
subtitle: e
|
|
3774
3774
|
});
|
|
@@ -3784,9 +3784,9 @@ function Br(e, t, n, r) {
|
|
|
3784
3784
|
startX: 15,
|
|
3785
3785
|
startY: n
|
|
3786
3786
|
}, f = Fr(t.drawSize, d, s), p = new Map(t.slots.map((e) => [e.drawPosition, e]));
|
|
3787
|
-
|
|
3787
|
+
z(e, R.SMALL, L.BOLD);
|
|
3788
3788
|
for (let t = 0; t < c; t++) {
|
|
3789
|
-
let r = d.startX + t * (d.slotWidth + d.roundGap), i =
|
|
3789
|
+
let r = d.startX + t * (d.slotWidth + d.roundGap), i = G(t + 1, c);
|
|
3790
3790
|
e.text(i, r + d.slotWidth / 2, n - 2, { align: "center" });
|
|
3791
3791
|
}
|
|
3792
3792
|
if (f.length > 0) {
|
|
@@ -3839,7 +3839,7 @@ function Vr(e, n, r) {
|
|
|
3839
3839
|
entry: e.entryStatus || ""
|
|
3840
3840
|
}));
|
|
3841
3841
|
return t(e, {
|
|
3842
|
-
...
|
|
3842
|
+
...ut.compact,
|
|
3843
3843
|
startY: r,
|
|
3844
3844
|
columns: i,
|
|
3845
3845
|
body: a,
|
|
@@ -3865,7 +3865,7 @@ function Vr(e, n, r) {
|
|
|
3865
3865
|
}), e.lastAutoTable?.finalY || r + 20;
|
|
3866
3866
|
}
|
|
3867
3867
|
function Hr(e, n, r) {
|
|
3868
|
-
|
|
3868
|
+
z(e, R.HEADING, L.BOLD), e.text("Seeded Players", 15, r), r += 4;
|
|
3869
3869
|
let i = [
|
|
3870
3870
|
{
|
|
3871
3871
|
header: "Seed",
|
|
@@ -3885,7 +3885,7 @@ function Hr(e, n, r) {
|
|
|
3885
3885
|
nat: e.nationality
|
|
3886
3886
|
}));
|
|
3887
3887
|
return t(e, {
|
|
3888
|
-
...
|
|
3888
|
+
...ut.compact,
|
|
3889
3889
|
startY: r,
|
|
3890
3890
|
columns: i,
|
|
3891
3891
|
body: a,
|
|
@@ -3913,14 +3913,14 @@ function Ur(n, r = {}) {
|
|
|
3913
3913
|
}), c = 15;
|
|
3914
3914
|
if (i) {
|
|
3915
3915
|
let e = n.scheduledDate ? `Order of Play - ${n.scheduledDate}` : "Order of Play";
|
|
3916
|
-
c =
|
|
3916
|
+
c = lt(s, {
|
|
3917
3917
|
...i,
|
|
3918
3918
|
subtitle: e
|
|
3919
3919
|
});
|
|
3920
3920
|
}
|
|
3921
3921
|
let l = n.courts, u = a ? l : l.map(Gr);
|
|
3922
3922
|
for (let e of n.timeSlots) {
|
|
3923
|
-
|
|
3923
|
+
z(s, R.BODY, L.BOLD), s.setTextColor(30, 60, 120), s.text(e.label, 15, c), s.setTextColor(0), c += 4;
|
|
3924
3924
|
let n = u.map((e) => ({
|
|
3925
3925
|
header: e,
|
|
3926
3926
|
dataKey: e
|
|
@@ -3939,7 +3939,7 @@ function Ur(n, r = {}) {
|
|
|
3939
3939
|
}), d.push(t);
|
|
3940
3940
|
}
|
|
3941
3941
|
t(s, {
|
|
3942
|
-
...
|
|
3942
|
+
...ut.schedule,
|
|
3943
3943
|
startY: c,
|
|
3944
3944
|
columns: n,
|
|
3945
3945
|
body: d,
|
|
@@ -3950,7 +3950,7 @@ function Ur(n, r = {}) {
|
|
|
3950
3950
|
}), c = s.lastAutoTable?.finalY + 6 || c + 20;
|
|
3951
3951
|
}
|
|
3952
3952
|
if (o?.length) {
|
|
3953
|
-
c += 4,
|
|
3953
|
+
c += 4, z(s, R.SMALL, L.ITALIC), s.setTextColor(80);
|
|
3954
3954
|
for (let e of o) s.text(e, 15, c), c += 4;
|
|
3955
3955
|
s.setTextColor(0);
|
|
3956
3956
|
}
|
|
@@ -4000,8 +4000,8 @@ function Zr(e, t = {}) {
|
|
|
4000
4000
|
bottom: 12,
|
|
4001
4001
|
left: 15
|
|
4002
4002
|
}
|
|
4003
|
-
}, r =
|
|
4004
|
-
t.header && (d = i.top +
|
|
4003
|
+
}, r = de(n), { margins: i } = n, a = r.internal.pageSize.getWidth(), o = r.internal.pageSize.getHeight(), s = a - i.left - i.right, c = t.accentColor || Xr, l = t.footer || { layout: "none" }, u = V(l), d = i.top;
|
|
4004
|
+
t.header && (d = i.top + B(r, t.header, n) + 3);
|
|
4005
4005
|
let f = ni(e);
|
|
4006
4006
|
for (let [e, a] of f) {
|
|
4007
4007
|
d + 30 > o - i.bottom - u && (ri(r, t, n, l), r.addPage(), d = i.top), d = Qr(r, e, i.left, d, s);
|
|
@@ -4012,26 +4012,26 @@ function Zr(e, t = {}) {
|
|
|
4012
4012
|
}
|
|
4013
4013
|
d += 4;
|
|
4014
4014
|
}
|
|
4015
|
-
return t.disclaimer && (d += 2,
|
|
4015
|
+
return t.disclaimer && (d += 2, z(r, R.TINY, L.ITALIC), r.setTextColor(100), r.text(t.disclaimer, a / 2, d, { align: "center" }), r.setTextColor(0)), ri(r, t, n, l), r;
|
|
4016
4016
|
}
|
|
4017
4017
|
function Qr(e, t, n, r, i) {
|
|
4018
|
-
return
|
|
4018
|
+
return z(e, R.HEADING, L.BOLD), e.setTextColor(40), e.text(t.toUpperCase(), n + i / 2, r, { align: "center" }), e.setTextColor(0), r + 7;
|
|
4019
4019
|
}
|
|
4020
4020
|
function $r(e, t, n, r, i, a, o) {
|
|
4021
4021
|
let s = n ? `Not before ${t}` : `Starting at ${t}`;
|
|
4022
|
-
return e.setFillColor(o[0], o[1], o[2]), e.rect(r + 20, i, a - 40, 5, "F"),
|
|
4022
|
+
return e.setFillColor(o[0], o[1], o[2]), e.rect(r + 20, i, a - 40, 5, "F"), z(e, R.SMALL, L.ITALIC), e.setTextColor(255, 255, 255), e.text(s, r + a / 2, i + 3.5, { align: "center" }), e.setTextColor(0), i + 7;
|
|
4023
4023
|
}
|
|
4024
4024
|
function ei(e, t, n, r, i) {
|
|
4025
4025
|
let a = n + 15, o = i - 30, s = r;
|
|
4026
|
-
|
|
4026
|
+
z(e, R.TINY, L.ITALIC), e.setTextColor(100);
|
|
4027
4027
|
let c = t.eventAbbr ? `${t.eventAbbr} ${t.roundName}` : t.roundName;
|
|
4028
|
-
e.text(c, a + o - 2, r + 3, { align: "right" }), e.setTextColor(0), t.score && (
|
|
4028
|
+
e.text(c, a + o - 2, r + 3, { align: "right" }), e.setTextColor(0), t.score && (z(e, R.SMALL, L.BOLD), e.setTextColor(120, 50, 140), e.text(t.score, a + o / 2, r + 3, { align: "center" }), e.setTextColor(0), r += 4), r += 2, r = ti(e, t.side1, a, r, o), z(e, R.TINY, L.ITALIC), e.setTextColor(120), e.text("vs", a + o / 2, r + 2.5, { align: "center" }), e.setTextColor(0), r += 4, r = ti(e, t.side2, a, r, o), r += 2;
|
|
4029
4029
|
let l = r - s;
|
|
4030
4030
|
return e.setDrawColor(180), e.setLineWidth(.3), e.rect(a, s, o, l), r + 2;
|
|
4031
4031
|
}
|
|
4032
4032
|
function ti(e, t, n, r, i) {
|
|
4033
|
-
if (!t.name || t.name === "TBD") return
|
|
4034
|
-
|
|
4033
|
+
if (!t.name || t.name === "TBD") return z(e, R.BODY, L.ITALIC), e.setTextColor(150), e.text("TBD", n + 10, r + 3), e.setTextColor(0), r + 4;
|
|
4034
|
+
z(e, R.BODY, L.NORMAL);
|
|
4035
4035
|
let a = t.nationality ? `${t.name} ${t.nationality}` : t.name;
|
|
4036
4036
|
return e.text(a, n + 10, r + 3), r + 4;
|
|
4037
4037
|
}
|
|
@@ -4050,10 +4050,10 @@ function ri(e, t, n, r) {
|
|
|
4050
4050
|
let r = (a - i.left - i.right) / t.officials.length;
|
|
4051
4051
|
t.officials.forEach((t, a) => {
|
|
4052
4052
|
let o = i.left + a * r;
|
|
4053
|
-
|
|
4053
|
+
z(e, R.TINY, L.BOLD), e.text(t.role, o, n), z(e, R.TINY, L.NORMAL), e.text(t.name, o, n + 3);
|
|
4054
4054
|
});
|
|
4055
4055
|
}
|
|
4056
|
-
|
|
4056
|
+
Ae(e, r, n);
|
|
4057
4057
|
}
|
|
4058
4058
|
//#endregion
|
|
4059
4059
|
//#region src/generators/report.ts
|
|
@@ -4062,10 +4062,10 @@ function ii(n, r, i = {}) {
|
|
|
4062
4062
|
orientation: i.orientation || "portrait",
|
|
4063
4063
|
format: "a4"
|
|
4064
4064
|
}), o = 15;
|
|
4065
|
-
if (i.header ? o =
|
|
4065
|
+
if (i.header ? o = lt(a, {
|
|
4066
4066
|
...i.header,
|
|
4067
4067
|
subtitle: i.header.subtitle || i.title
|
|
4068
|
-
}) : i.title && (
|
|
4068
|
+
}) : i.title && (z(a, R.SUBTITLE, L.BOLD), a.text(i.title, 15, o), o += 8), n.length === 0) return z(a, R.BODY, L.ITALIC), a.text("No columns defined", 15, o), W(a, `Generated ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`, 1), a;
|
|
4069
4069
|
let s = n.map((e) => ({
|
|
4070
4070
|
header: e.title,
|
|
4071
4071
|
dataKey: e.key
|
|
@@ -4082,7 +4082,7 @@ function ii(n, r, i = {}) {
|
|
|
4082
4082
|
cellWidth: e.width
|
|
4083
4083
|
});
|
|
4084
4084
|
return t(a, {
|
|
4085
|
-
...
|
|
4085
|
+
...ut.report,
|
|
4086
4086
|
startY: o,
|
|
4087
4087
|
columns: s,
|
|
4088
4088
|
body: c,
|
|
@@ -4115,10 +4115,10 @@ function ai(e) {
|
|
|
4115
4115
|
return t.trim();
|
|
4116
4116
|
}
|
|
4117
4117
|
function Q(e, t, n) {
|
|
4118
|
-
return
|
|
4118
|
+
return z(e, R.HEADING, L.BOLD), e.setTextColor(40), e.text(t.toUpperCase(), Z, n), e.setTextColor(0), n += 1.5, e.setDrawColor(180), e.setLineWidth(.2), e.line(Z, n, e.internal.pageSize.getWidth() - Z, n), n += 4, n;
|
|
4119
4119
|
}
|
|
4120
4120
|
function oi(e, t, n, r) {
|
|
4121
|
-
|
|
4121
|
+
z(e, R.BODY, L.NORMAL);
|
|
4122
4122
|
let i = r || e.internal.pageSize.getWidth() - Z * 2, a = e.splitTextToSize(t, i);
|
|
4123
4123
|
return e.text(a, Z, n), n + a.length * 3.2;
|
|
4124
4124
|
}
|
|
@@ -4137,7 +4137,7 @@ function si(e, t, n) {
|
|
|
4137
4137
|
left: Z
|
|
4138
4138
|
}
|
|
4139
4139
|
};
|
|
4140
|
-
return n +
|
|
4140
|
+
return n + B(e, Oe(t, { layout: "itf" }), r);
|
|
4141
4141
|
}
|
|
4142
4142
|
function ci(e, n, r) {
|
|
4143
4143
|
let i = (n.participants || []).filter((e) => e.participantRole && e.participantRole !== "COMPETITOR");
|
|
@@ -4230,16 +4230,16 @@ function ui(e, t, n) {
|
|
|
4230
4230
|
i.push("Entry Fees: " + e);
|
|
4231
4231
|
}
|
|
4232
4232
|
if (!i.length) return n;
|
|
4233
|
-
n = $(e, n, 10 + i.length * 3.5), n = Q(e, "Entry Information", n),
|
|
4233
|
+
n = $(e, n, 10 + i.length * 3.5), n = Q(e, "Entry Information", n), z(e, R.BODY, L.NORMAL);
|
|
4234
4234
|
for (let t of i) e.text(t, Z, n), n += 3.5;
|
|
4235
4235
|
return n + 3;
|
|
4236
4236
|
}
|
|
4237
4237
|
function di(e, t, n) {
|
|
4238
4238
|
let r = t.venues || [];
|
|
4239
4239
|
if (!r.length) return n;
|
|
4240
|
-
n = $(e, n, 15), n = Q(e, "Venue", n),
|
|
4240
|
+
n = $(e, n, 15), n = Q(e, "Venue", n), z(e, R.BODY, L.NORMAL);
|
|
4241
4241
|
for (let t of r) {
|
|
4242
|
-
|
|
4242
|
+
z(e, R.BODY, L.BOLD), e.text(t.venueName || "Venue", Z, n), n += 3.5, z(e, R.BODY, L.NORMAL);
|
|
4243
4243
|
let r = t.addresses?.[0];
|
|
4244
4244
|
if (r) {
|
|
4245
4245
|
let t = [
|
|
@@ -4306,7 +4306,7 @@ function fi(e, n, r, i) {
|
|
|
4306
4306
|
function pi(e, t, n) {
|
|
4307
4307
|
let r = t.totalPrizeMoney;
|
|
4308
4308
|
if (!r?.length) return n;
|
|
4309
|
-
n = $(e, n, 10), n = Q(e, "Prize Money", n),
|
|
4309
|
+
n = $(e, n, 10), n = Q(e, "Prize Money", n), z(e, R.BODY, L.NORMAL);
|
|
4310
4310
|
for (let t of r) e.text(t.currencyCode + " " + t.amount.toLocaleString(), Z, n), n += 3.5;
|
|
4311
4311
|
return n + 3;
|
|
4312
4312
|
}
|
|
@@ -4352,14 +4352,14 @@ function hi(e, t, n) {
|
|
|
4352
4352
|
}
|
|
4353
4353
|
if (r.regulations?.length) for (let e of r.regulations) i.push((e.name || "Regulation") + (e.url ? " — " + e.url : ""));
|
|
4354
4354
|
if (r.dressCode && i.push("Dress Code: " + r.dressCode), r.contingencyPlan && i.push("Contingency: " + r.contingencyPlan), !i.length) return n;
|
|
4355
|
-
n = $(e, n, 10 + i.length * 3.5), n = Q(e, "Regulations", n),
|
|
4355
|
+
n = $(e, n, 10 + i.length * 3.5), n = Q(e, "Regulations", n), z(e, R.BODY, L.NORMAL);
|
|
4356
4356
|
for (let t of i) e.text(t, Z, n), n += 3.5;
|
|
4357
4357
|
return n + 3;
|
|
4358
4358
|
}
|
|
4359
4359
|
function gi(e, t, n) {
|
|
4360
4360
|
let r = t.registrationProfile?.sponsors;
|
|
4361
4361
|
if (!r?.length) return n;
|
|
4362
|
-
n = $(e, n, 10), n = Q(e, "Sponsors", n),
|
|
4362
|
+
n = $(e, n, 10), n = Q(e, "Sponsors", n), z(e, R.BODY, L.NORMAL);
|
|
4363
4363
|
for (let t of r) {
|
|
4364
4364
|
let r = t.tier ? " [" + t.tier + "]" : "";
|
|
4365
4365
|
e.text(t.name + r, Z, n), n += 3.5;
|
|
@@ -4370,9 +4370,9 @@ function _i(e, t, n) {
|
|
|
4370
4370
|
let r = t.registrationProfile?.socialEvents;
|
|
4371
4371
|
if (!r?.length) return n;
|
|
4372
4372
|
let i = t.registrationProfile;
|
|
4373
|
-
n = $(e, n, 15), n = Q(e, "Social Events & Ceremonies", n),
|
|
4373
|
+
n = $(e, n, 15), n = Q(e, "Social Events & Ceremonies", n), z(e, R.BODY, L.NORMAL), i?.drawCeremonyDate && (e.text("Draw Ceremony: " + i.drawCeremonyDate, Z, n), n += 3.5), i?.awardsCeremonyDate && (e.text("Awards Ceremony: " + i.awardsCeremonyDate, Z, n), n += 3.5);
|
|
4374
4374
|
for (let t of r) {
|
|
4375
|
-
|
|
4375
|
+
z(e, R.BODY, L.BOLD), e.text(t.name, Z, n), n += 3.5, z(e, R.BODY, L.NORMAL);
|
|
4376
4376
|
let r = [
|
|
4377
4377
|
t.date,
|
|
4378
4378
|
t.time,
|
|
@@ -4406,7 +4406,7 @@ var yi = {
|
|
|
4406
4406
|
"custom-notes": vi
|
|
4407
4407
|
};
|
|
4408
4408
|
function bi(t, n = {}) {
|
|
4409
|
-
let { templateId: r = "itf-junior" } = n, i =
|
|
4409
|
+
let { templateId: r = "itf-junior" } = n, i = le(r)?.sections || le("itf-junior").sections, a = n.enabledSections ? new Set(n.enabledSections) : null, o = new e({
|
|
4410
4410
|
orientation: "portrait",
|
|
4411
4411
|
format: "a4"
|
|
4412
4412
|
}), s = Z;
|
|
@@ -4446,17 +4446,17 @@ function xi(e, t = {}) {
|
|
|
4446
4446
|
format: o
|
|
4447
4447
|
};
|
|
4448
4448
|
if (u && d) return Yn({
|
|
4449
|
-
winnersBracket: f ?
|
|
4450
|
-
losersBracket:
|
|
4451
|
-
deciderMatch:
|
|
4449
|
+
winnersBracket: f ? P(f) : Si(),
|
|
4450
|
+
losersBracket: F(n, "CONSOLATION") ? P(F(n, "CONSOLATION")) : Si(),
|
|
4451
|
+
deciderMatch: F(n, "PLAY_OFF") ? P(F(n, "PLAY_OFF")) : void 0
|
|
4452
4452
|
}, p);
|
|
4453
4453
|
if (u) return Gn(l.map((e) => ({
|
|
4454
4454
|
name: e.structureName,
|
|
4455
4455
|
stage: e.stage,
|
|
4456
|
-
drawData:
|
|
4456
|
+
drawData: P(e)
|
|
4457
4457
|
})), p);
|
|
4458
4458
|
let m = t.structureId && l.find((e) => e.structureId === t.structureId) || f;
|
|
4459
|
-
if (!m) return
|
|
4459
|
+
if (!m) return de({
|
|
4460
4460
|
pageSize: "a4",
|
|
4461
4461
|
orientation: "portrait",
|
|
4462
4462
|
margins: {
|
|
@@ -4466,7 +4466,7 @@ function xi(e, t = {}) {
|
|
|
4466
4466
|
left: 15
|
|
4467
4467
|
}
|
|
4468
4468
|
});
|
|
4469
|
-
let g =
|
|
4469
|
+
let g = P(m);
|
|
4470
4470
|
return t.mirrored ? qn(g, p) : t.splitPages || g.drawSize >= 256 ? Un(g, {
|
|
4471
4471
|
...p,
|
|
4472
4472
|
maxPositionsPerPage: t.maxPositionsPerPage || 32
|
|
@@ -4484,6 +4484,6 @@ function Si() {
|
|
|
4484
4484
|
};
|
|
4485
4485
|
}
|
|
4486
4486
|
//#endregion
|
|
4487
|
-
export { x as COMPOSITION_CATALOG, Sr as DRAW_MODAL_TABS,
|
|
4487
|
+
export { x as COMPOSITION_CATALOG, Sr as DRAW_MODAL_TABS, ce as FACT_SHEET_CATALOG, pe as FONT, vr as FOOTER_LAYOUT_OPTIONS, _r as HEADER_LAYOUT_OPTIONS, br as ORIENTATION_OPTIONS, yr as PAGE_SIZE_OPTIONS, m as PRESETS, Cr as SCHEDULE_MODAL_TABS, R as SIZE, xr as SPLIT_STRATEGY_OPTIONS, L as STYLE, ut as TABLE_STYLES, ke as buildFooterFromTournament, Oe as buildHeaderFromTournament, Fr as calculateBracketPositions, de as createDoc, Lr as drawBracketConnectors, Ir as drawBracketSlot, W as drawPageFooter, lt as drawTournamentHeader, Ue as entryStatusDisplay, qe as eventAbbreviation, $n as executePrint, Nr as extractCompassData, Tn as extractConsolationStructures, $e as extractCourtCardData, vt as extractDrawData, Ze as extractParticipantData, wr as extractRoundRobinData, Ye as extractScheduleData, F as findStructure, Ge as formatDate, q as formatMatchScore, xt as formatPlayerEntry, We as formatScore, Ke as formatTime, Jn as generateBackdrawPDF, Kn as generateCompassDrawPDF, Gn as generateConsolationDrawPDF, pt as generateCourtCardPDF, Yn as generateDoubleEliminationPDF, Bn as generateDrawPDF, zr as generateDrawSheetPDF, bi as generateFactSheet, Wn as generateFeedInDrawPDF, xi as generateFromEventData, Xn as generateLuckyDrawPDF, ht as generateMatchCardPDF, qn as generateMirroredDrawPDF, nt as generateOrderOfPlayPDF, nt as generateScheduleV2PDF, dt as generatePlayerListPDF, ii as generateReportPDF, Ur as generateSchedulePDF, Zr as generateSequentialOOP, ft as generateSignInSheetPDF, Un as generateSplitDrawPDF, Hn as generateTraditionalDrawPDF, S as getCatalogPreset, fe as getDefaultPageConfig, le as getFactSheetTemplate, I as getPageRegions, h as getPreset, G as getRoundLabel, C as listCatalogPresets, ue as listFactSheetTemplates, V as measureFooterHeight, Ve as measureSeedingsHeight, ee as mergeCatalogPreset, g as mergePreset, U as nationality, H as participantName, Sn as renderCompassDraw, En as renderConsolationDraw, Dn as renderDoubleEliminationDraw, Ae as renderFooter, B as renderHeader, Mn as renderLuckyDraw, kr as renderRoundRobinGroup, ze as renderSeedingsFooter, J as renderTraditionalDraw, qr as resolveCompositionConfig, Je as roundName, He as seedDisplay, z as setFont, Fn as splitDraw, P as structureToDrawData };
|
|
4488
4488
|
|
|
4489
4489
|
//# sourceMappingURL=pdf-factory.js.map
|