tods-competition-factory 2.2.26 → 2.2.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +3 -3
- package/dist/tods-competition-factory.development.cjs.js +45 -107
- package/dist/tods-competition-factory.development.cjs.js.map +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js.map +1 -1
- package/package.json +45 -36
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
function factoryVersion() {
|
|
6
|
-
return '2.2.
|
|
6
|
+
return '2.2.27';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const SINGLES_MATCHUP = 'SINGLES';
|
|
@@ -1462,7 +1462,7 @@ function addNotice$1({ topic, payload, key }, isGlobalSubscription) {
|
|
|
1462
1462
|
return { ...SUCCESS };
|
|
1463
1463
|
}
|
|
1464
1464
|
function getMethods$1() {
|
|
1465
|
-
return syncGlobalState.methods;
|
|
1465
|
+
return syncGlobalState.methods ?? {};
|
|
1466
1466
|
}
|
|
1467
1467
|
function getNotices$1({ topic }) {
|
|
1468
1468
|
return syncGlobalState.notices.filter((notice) => notice.topic === topic).map((notice) => notice.payload);
|
|
@@ -2908,7 +2908,7 @@ function makeDeepCopy(sourceObject, convertExtensions, internalUse, removeExtens
|
|
|
2908
2908
|
if (getProvider().makeDeepCopy)
|
|
2909
2909
|
return getProvider().makeDeepCopy(sourceObject, convertExtensions, internalUse, removeExtensions);
|
|
2910
2910
|
const deepCopy = deepCopyEnabled();
|
|
2911
|
-
const { stringify, toJSON, ignore, modulate } = deepCopy;
|
|
2911
|
+
const { stringify, toJSON, ignore, modulate } = deepCopy || {};
|
|
2912
2912
|
if ((!deepCopy?.enabled && !internalUse) ||
|
|
2913
2913
|
typeof sourceObject !== 'object' ||
|
|
2914
2914
|
isFunction(sourceObject) ||
|
|
@@ -5422,7 +5422,7 @@ function structureAssignedDrawPositions({ drawDefinition, structureId, structure
|
|
|
5422
5422
|
const assignedPositions = positionAssignments?.filter((assignment) => {
|
|
5423
5423
|
return assignment.participantId ?? assignment.bye ?? assignment.qualifier;
|
|
5424
5424
|
});
|
|
5425
|
-
const allPositionsAssigned = positionAssignments?.length === assignedPositions?.length;
|
|
5425
|
+
const allPositionsAssigned = positionAssignments && positionAssignments?.length === assignedPositions?.length;
|
|
5426
5426
|
const unassignedPositions = positionAssignments?.filter((assignment) => {
|
|
5427
5427
|
return !assignment.participantId && !assignment.bye && !assignment.qualifier;
|
|
5428
5428
|
});
|
|
@@ -9093,7 +9093,7 @@ function getMatchUpParticipantIds({ matchUp }) {
|
|
|
9093
9093
|
?.map((side) => side.participant?.individualParticipants)
|
|
9094
9094
|
.filter(Boolean) ?? [];
|
|
9095
9095
|
const nestedIndividualParticipantIds = nestedIndividualParticipants.map((participants) => (participants ?? []).map((participant) => participant?.participantId).filter(Boolean));
|
|
9096
|
-
const individualParticipantIds = [...sideIndividualParticipantIds, ...nestedIndividualParticipantIds.flat()].filter(Boolean);
|
|
9096
|
+
const individualParticipantIds = [...sideIndividualParticipantIds, ...nestedIndividualParticipantIds.flat()].filter(Boolean) ?? [];
|
|
9097
9097
|
const allRelevantParticipantIds = unique(individualParticipantIds.concat(sideParticipantIds)).filter(Boolean) ?? [];
|
|
9098
9098
|
return {
|
|
9099
9099
|
nestedIndividualParticipantIds,
|
|
@@ -9559,12 +9559,6 @@ function venueAdd({ tournamentRecord, disableNotice, context, venue }) {
|
|
|
9559
9559
|
addExtension({ element: venue, extension });
|
|
9560
9560
|
}
|
|
9561
9561
|
tournamentRecord.venues.push(venue);
|
|
9562
|
-
if (!disableNotice) {
|
|
9563
|
-
addNotice({
|
|
9564
|
-
payload: { venue, tournamentId: tournamentRecord.tournamentId },
|
|
9565
|
-
topic: ADD_VENUE,
|
|
9566
|
-
});
|
|
9567
|
-
}
|
|
9568
9562
|
return { ...SUCCESS, venue: makeDeepCopy(venue) };
|
|
9569
9563
|
}
|
|
9570
9564
|
else {
|
|
@@ -11589,7 +11583,6 @@ function allEventMatchUps(params) {
|
|
|
11589
11583
|
const hydratedParticipantResult = hydrateParticipants({
|
|
11590
11584
|
participantsProfile,
|
|
11591
11585
|
useParticipantMap,
|
|
11592
|
-
policyDefinitions,
|
|
11593
11586
|
tournamentRecord,
|
|
11594
11587
|
contextProfile,
|
|
11595
11588
|
inContext,
|
|
@@ -11644,7 +11637,6 @@ function allTournamentMatchUps(params) {
|
|
|
11644
11637
|
({ participants, participantMap } = hydrateParticipants({
|
|
11645
11638
|
participantsProfile,
|
|
11646
11639
|
useParticipantMap,
|
|
11647
|
-
policyDefinitions,
|
|
11648
11640
|
tournamentRecord,
|
|
11649
11641
|
contextProfile,
|
|
11650
11642
|
inContext,
|
|
@@ -11751,7 +11743,6 @@ function allDrawMatchUps(params) {
|
|
|
11751
11743
|
} = hydrateParticipants({
|
|
11752
11744
|
participantsProfile,
|
|
11753
11745
|
useParticipantMap,
|
|
11754
|
-
policyDefinitions,
|
|
11755
11746
|
tournamentRecord,
|
|
11756
11747
|
contextProfile,
|
|
11757
11748
|
inContext,
|
|
@@ -12698,7 +12689,7 @@ function clearDrawPosition(params) {
|
|
|
12698
12689
|
const positionAssignments = structureAssignedDrawPositions({
|
|
12699
12690
|
drawDefinition,
|
|
12700
12691
|
structure,
|
|
12701
|
-
}).positionAssignments;
|
|
12692
|
+
}).positionAssignments || [];
|
|
12702
12693
|
const existingAssignment = positionAssignments.find((assignment) => (participantId && assignment.participantId === participantId) ||
|
|
12703
12694
|
(drawPosition && assignment.drawPosition === drawPosition));
|
|
12704
12695
|
if (existingAssignment && participantId && !drawPosition) {
|
|
@@ -12749,7 +12740,7 @@ function drawPositionRemovals({ inContextDrawMatchUps, tournamentRecord, drawDef
|
|
|
12749
12740
|
const positionAssignments = structureAssignedDrawPositions({
|
|
12750
12741
|
drawDefinition,
|
|
12751
12742
|
structure,
|
|
12752
|
-
}).positionAssignments;
|
|
12743
|
+
}).positionAssignments || [];
|
|
12753
12744
|
const drawPositionCleared = positionAssignments.some((assignment) => {
|
|
12754
12745
|
if (assignment.drawPosition === drawPosition) {
|
|
12755
12746
|
delete assignment.participantId;
|
|
@@ -18164,7 +18155,6 @@ function randomUnseededSeparation({ provisionalPositioning, unseededParticipantI
|
|
|
18164
18155
|
const result = assignDrawPositionBye({
|
|
18165
18156
|
tournamentRecord,
|
|
18166
18157
|
drawDefinition,
|
|
18167
|
-
seedBlockInfo,
|
|
18168
18158
|
structureId,
|
|
18169
18159
|
matchUpsMap,
|
|
18170
18160
|
event,
|
|
@@ -18175,7 +18165,6 @@ function randomUnseededSeparation({ provisionalPositioning, unseededParticipantI
|
|
|
18175
18165
|
}
|
|
18176
18166
|
else if (assignment.participantId) {
|
|
18177
18167
|
const result = assignDrawPosition$1({
|
|
18178
|
-
automaticPlacement: true,
|
|
18179
18168
|
inContextDrawMatchUps,
|
|
18180
18169
|
tournamentRecord,
|
|
18181
18170
|
drawDefinition,
|
|
@@ -18291,9 +18280,7 @@ function positionUnseededParticipants({ provisionalPositioning, inContextDrawMat
|
|
|
18291
18280
|
matchUpsMap,
|
|
18292
18281
|
structureId,
|
|
18293
18282
|
avoidance,
|
|
18294
|
-
drawSize
|
|
18295
|
-
entries,
|
|
18296
|
-
});
|
|
18283
|
+
drawSize});
|
|
18297
18284
|
}
|
|
18298
18285
|
else {
|
|
18299
18286
|
return randomUnseededDistribution({
|
|
@@ -18480,9 +18467,7 @@ function positionSeedBlock({ provisionalPositioning, inContextDrawMatchUps, tour
|
|
|
18480
18467
|
drawDefinition,
|
|
18481
18468
|
seedingProfile,
|
|
18482
18469
|
seedBlockInfo,
|
|
18483
|
-
structureId
|
|
18484
|
-
event,
|
|
18485
|
-
});
|
|
18470
|
+
structureId});
|
|
18486
18471
|
const { appliedPolicies } = getAppliedPolicies({ drawDefinition });
|
|
18487
18472
|
const { avoidance } = appliedPolicies ?? {};
|
|
18488
18473
|
if (avoidance && participants && unplacedSeedParticipantIds?.length > 2) ;
|
|
@@ -19318,13 +19303,13 @@ function qualifierProgression({ targetRoundNumber = 1, tournamentRecord, drawDef
|
|
|
19318
19303
|
targetRoundNumber,
|
|
19319
19304
|
linkType: WINNER,
|
|
19320
19305
|
drawDefinition,
|
|
19321
|
-
});
|
|
19306
|
+
}) || {};
|
|
19322
19307
|
const { relevantLinks: roundRobinSourceLinks } = getSourceStructureIdsAndRelevantLinks({
|
|
19323
19308
|
structureId: mainStructure.structureId,
|
|
19324
19309
|
targetRoundNumber,
|
|
19325
19310
|
linkType: POSITION,
|
|
19326
19311
|
drawDefinition,
|
|
19327
|
-
});
|
|
19312
|
+
}) || {};
|
|
19328
19313
|
for (const sourceLink of eliminationSourceLinks) {
|
|
19329
19314
|
const structure = drawDefinition.structures?.find((structure) => structure.structureId === sourceLink.source.structureId);
|
|
19330
19315
|
if (structure?.stage !== QUALIFYING)
|
|
@@ -19869,12 +19854,6 @@ function setStageQualifiersCount({ qualifiersCount = 0, drawDefinition, stage })
|
|
|
19869
19854
|
if (!stageExists({ drawDefinition, stage })) {
|
|
19870
19855
|
return { error: INVALID_STAGE };
|
|
19871
19856
|
}
|
|
19872
|
-
if (stage !== MAIN) {
|
|
19873
|
-
return {
|
|
19874
|
-
error: DRAW_SIZE_MISMATCH,
|
|
19875
|
-
info: 'qualifiersCount can only be set for main stage',
|
|
19876
|
-
};
|
|
19877
|
-
}
|
|
19878
19857
|
modifyEntryProfile({
|
|
19879
19858
|
attributes: [{ [stage]: { qualifiersCount } }],
|
|
19880
19859
|
drawDefinition,
|
|
@@ -21753,7 +21732,6 @@ function generateAndPopulateRRplayoffStructures(params) {
|
|
|
21753
21732
|
sourceStructureId,
|
|
21754
21733
|
playoffGroups,
|
|
21755
21734
|
groupCount,
|
|
21756
|
-
groupSize,
|
|
21757
21735
|
...params,
|
|
21758
21736
|
});
|
|
21759
21737
|
if (processResult.error)
|
|
@@ -23229,7 +23207,6 @@ function attemptToModifyScore(params) {
|
|
|
23229
23207
|
...params,
|
|
23230
23208
|
matchUpStatusCodes: (matchUpStatusIsValid && matchUpStatusCodes) || [],
|
|
23231
23209
|
matchUpStatus: updatedMatchUpStatus,
|
|
23232
|
-
context: stack,
|
|
23233
23210
|
removeScore,
|
|
23234
23211
|
});
|
|
23235
23212
|
return decorateResult({ result, stack });
|
|
@@ -23560,7 +23537,7 @@ function updateTieMatchUpScore(params) {
|
|
|
23560
23537
|
}) ||
|
|
23561
23538
|
{};
|
|
23562
23539
|
const tournamentId = params.tournamentId || params.tournamentRecord?.tournamentId;
|
|
23563
|
-
findTournamentId({ tournamentRecords, ...params });
|
|
23540
|
+
tournamentRecords && findTournamentId({ tournamentRecords, ...params });
|
|
23564
23541
|
const tournamentRecord = tournamentId && tournamentRecords[tournamentId];
|
|
23565
23542
|
if (!tournamentRecord)
|
|
23566
23543
|
return { error: MISSING_TOURNAMENT_RECORD };
|
|
@@ -24035,7 +24012,6 @@ function directParticipants(params) {
|
|
|
24035
24012
|
const result = directLoser({
|
|
24036
24013
|
sourceMatchUpStatus: (matchUpStatusIsValid && matchUpStatus) || COMPLETED$1,
|
|
24037
24014
|
loserMatchUpDrawPositionIndex,
|
|
24038
|
-
sourceMatchUpId: matchUpId,
|
|
24039
24015
|
inContextDrawMatchUps,
|
|
24040
24016
|
projectedWinningSide,
|
|
24041
24017
|
loserDrawPosition,
|
|
@@ -24043,7 +24019,6 @@ function directParticipants(params) {
|
|
|
24043
24019
|
loserTargetLink,
|
|
24044
24020
|
drawDefinition,
|
|
24045
24021
|
loserMatchUp,
|
|
24046
|
-
winningSide,
|
|
24047
24022
|
matchUpsMap,
|
|
24048
24023
|
dualMatchUp,
|
|
24049
24024
|
event,
|
|
@@ -26427,9 +26402,7 @@ function getValidAssignmentActions({ positionSourceStructureIds, unassignedParti
|
|
|
26427
26402
|
randomize: true,
|
|
26428
26403
|
drawDefinition,
|
|
26429
26404
|
seedingProfile,
|
|
26430
|
-
structureId
|
|
26431
|
-
event,
|
|
26432
|
-
});
|
|
26405
|
+
structureId});
|
|
26433
26406
|
({ unplacedSeedParticipantIds, unplacedSeedAssignments, unfilledPositions } = result);
|
|
26434
26407
|
}
|
|
26435
26408
|
if (!unfilledPositions?.length) {
|
|
@@ -26529,7 +26502,7 @@ function getValidQualifiersAction({ drawPositionInitialRounds, tournamentPartici
|
|
|
26529
26502
|
linkType: WINNER,
|
|
26530
26503
|
drawDefinition,
|
|
26531
26504
|
structureId,
|
|
26532
|
-
});
|
|
26505
|
+
}) || {};
|
|
26533
26506
|
if (eliminationSoureStructureIds?.length)
|
|
26534
26507
|
sourceStructureIds.push(...eliminationSoureStructureIds);
|
|
26535
26508
|
const { sourceStructureIds: roundRobinSourceStructureIds, relevantLinks: roundRobinSourceLinks } = getSourceStructureIdsAndRelevantLinks({
|
|
@@ -26537,7 +26510,7 @@ function getValidQualifiersAction({ drawPositionInitialRounds, tournamentPartici
|
|
|
26537
26510
|
linkType: POSITION,
|
|
26538
26511
|
drawDefinition,
|
|
26539
26512
|
structureId,
|
|
26540
|
-
});
|
|
26513
|
+
}) || {};
|
|
26541
26514
|
if (roundRobinSourceStructureIds?.length)
|
|
26542
26515
|
sourceStructureIds.push(...roundRobinSourceStructureIds);
|
|
26543
26516
|
for (const sourceLink of eliminationSourceLinks) {
|
|
@@ -26726,7 +26699,7 @@ function positionActions(params) {
|
|
|
26726
26699
|
linkType: POSITION,
|
|
26727
26700
|
drawDefinition,
|
|
26728
26701
|
structureId,
|
|
26729
|
-
});
|
|
26702
|
+
}) || {};
|
|
26730
26703
|
let sourceStructuresComplete;
|
|
26731
26704
|
if (positionSourceStructureIds?.length) {
|
|
26732
26705
|
sourceStructuresComplete = positionSourceStructureIds.every((sourceStructureId) => isCompletedStructure({ structureId: sourceStructureId, drawDefinition }));
|
|
@@ -27256,7 +27229,7 @@ function generateQualifyingStructures({ hasExistingDrawDefinition, qualifyingPro
|
|
|
27256
27229
|
const structureProfiles = roundTargetProfile.structureProfiles || [];
|
|
27257
27230
|
roundTarget = roundTargetProfile.roundTarget || roundTarget;
|
|
27258
27231
|
let stageSequence = 1, targetRoundQualifiersCount = 0, finalQualifyingRoundNumber, finalQualifyingStructureId, linkType;
|
|
27259
|
-
for (const structureProfile of (structureProfiles).sort(sequenceSort)) {
|
|
27232
|
+
for (const structureProfile of (structureProfiles || []).sort(sequenceSort)) {
|
|
27260
27233
|
let drawSize = coerceEven(structureProfile.drawSize || structureProfile.participantsCount);
|
|
27261
27234
|
const { qualifyingRoundNumber, structureOptions, matchUpFormat, structureName, structureId, drawType } = structureProfile;
|
|
27262
27235
|
const matchUpType = structureProfile.matchUpType;
|
|
@@ -27440,7 +27413,6 @@ function generateRoundRobinWithPlayOff(params) {
|
|
|
27440
27413
|
drawDefinition,
|
|
27441
27414
|
playoffGroups,
|
|
27442
27415
|
groupCount,
|
|
27443
|
-
groupSize,
|
|
27444
27416
|
...params,
|
|
27445
27417
|
});
|
|
27446
27418
|
if (playoffStructures)
|
|
@@ -28798,16 +28770,13 @@ function generateDrawMaticRound(params) {
|
|
|
28798
28770
|
const paringParams = {
|
|
28799
28771
|
tournamentParticipants,
|
|
28800
28772
|
possiblePairings,
|
|
28801
|
-
participantIds,
|
|
28802
28773
|
uniquePairings,
|
|
28803
|
-
drawDefinition,
|
|
28804
28774
|
maxIterations,
|
|
28805
28775
|
adHocRatings,
|
|
28806
28776
|
deltaObjects,
|
|
28807
28777
|
valueObjects,
|
|
28808
28778
|
eventType,
|
|
28809
28779
|
scaleName,
|
|
28810
|
-
structure,
|
|
28811
28780
|
salted,
|
|
28812
28781
|
};
|
|
28813
28782
|
const { candidatesCount, participantIdPairings, deltaCandidate, iterations, candidate } = getPairings(paringParams);
|
|
@@ -31433,7 +31402,7 @@ function handleNumeric(params) {
|
|
|
31433
31402
|
if (allNumeric)
|
|
31434
31403
|
score = onlyNumbers.join('');
|
|
31435
31404
|
const numbers = allNumeric ? onlyNumbers.map((n) => parseInt(n)) : score.split('').map((n) => parseInt(n));
|
|
31436
|
-
setBuilder({ score });
|
|
31405
|
+
const { sets } = setBuilder({ score });
|
|
31437
31406
|
if (numbers.length === 6) ;
|
|
31438
31407
|
if (score.length === 3 && getDiff(numbers.slice(0, 2)) === 1) {
|
|
31439
31408
|
const [s1, s2, tb] = numbers;
|
|
@@ -33092,9 +33061,9 @@ function scaledEntriesSeeding(params) {
|
|
|
33092
33061
|
let seedsCount = params.seedsCount;
|
|
33093
33062
|
const { provisionalPositioning, enteredParticipantIds, seedAssignmentProfile, assignSeedsCount, tournamentRecord, drawDefinition, seedByRanking, seedingProfile, structureId, event, } = params;
|
|
33094
33063
|
const { categoryName, ageCategoryCode } = event?.category || {};
|
|
33095
|
-
|
|
33096
|
-
const scaledEntries = getSeedingScaleEntries({ ...params
|
|
33097
|
-
(seedByRanking && getRankingScaleEntries({ ...params
|
|
33064
|
+
event?.eventType;
|
|
33065
|
+
const scaledEntries = getSeedingScaleEntries({ ...params}) ||
|
|
33066
|
+
(seedByRanking && getRankingScaleEntries({ ...params}));
|
|
33098
33067
|
const scaledEntriesCount = scaledEntries?.length ?? 0;
|
|
33099
33068
|
if (scaledEntriesCount < seedsCount)
|
|
33100
33069
|
seedsCount = scaledEntriesCount;
|
|
@@ -33187,7 +33156,6 @@ function generateNewDrawDefinition(params) {
|
|
|
33187
33156
|
const positioningReports = [];
|
|
33188
33157
|
let conflicts = [];
|
|
33189
33158
|
const addResult = addEntries({
|
|
33190
|
-
suppressDuplicateEntries,
|
|
33191
33159
|
ignoreStageSpace,
|
|
33192
33160
|
drawDefinition,
|
|
33193
33161
|
drawEntries,
|
|
@@ -33253,7 +33221,7 @@ const definitionTemplate = () => ({
|
|
|
33253
33221
|
});
|
|
33254
33222
|
|
|
33255
33223
|
function newDrawDefinition(params) {
|
|
33256
|
-
const { drawId = UUID(), processCodes, matchUpType, drawType } = params;
|
|
33224
|
+
const { drawId = UUID(), processCodes, matchUpType, drawType } = params ?? {};
|
|
33257
33225
|
const drawDefinition = definitionTemplate();
|
|
33258
33226
|
return Object.assign(drawDefinition, {
|
|
33259
33227
|
processCodes,
|
|
@@ -33675,7 +33643,7 @@ function credits() {
|
|
|
33675
33643
|
This project would not have been possible without the generous input and patience
|
|
33676
33644
|
of tournament organizers and directors who worked with early versions of CourtHive/TMX.
|
|
33677
33645
|
|
|
33678
|
-
Thanks to Pavel, Ivan, Mladen, Zdenko, Antonia, Jakov, Kreso, Barry, Jeff, Bobby... to name just a few.
|
|
33646
|
+
Thanks to Miro, Pavel, Ivan, Mladen, Zdenko, Antonia, Jakov, Kreso, Barry, Jeff, Bobby... to name just a few.
|
|
33679
33647
|
|
|
33680
33648
|
The project would not have even begun without the support of Miro, or the introduction by Sretchko.
|
|
33681
33649
|
The project would not have succeeded without the enthusiasm of Randy and Bruce.
|
|
@@ -34036,7 +34004,8 @@ function getTournamentInfo(params) {
|
|
|
34036
34004
|
for (const event of tournamentRecord.events ?? []) {
|
|
34037
34005
|
if (!params?.usePublishState || publishedEventIds.includes(event.eventId)) {
|
|
34038
34006
|
const info = extractEventInfo({ event }).eventInfo;
|
|
34039
|
-
|
|
34007
|
+
if (info)
|
|
34008
|
+
eventInfo.push(info);
|
|
34040
34009
|
}
|
|
34041
34010
|
}
|
|
34042
34011
|
tournamentInfo.timeItemValues = getTimeItemValues({ element: tournamentRecord });
|
|
@@ -35277,7 +35246,6 @@ function getEventData(params) {
|
|
|
35277
35246
|
const eventPublishState = getPublishState({ event }).publishState ?? {};
|
|
35278
35247
|
const eventPublished = !!eventPublishState?.status?.published;
|
|
35279
35248
|
const { participants: tournamentParticipants } = getParticipants({
|
|
35280
|
-
withGroupings: true,
|
|
35281
35249
|
withEvents: false,
|
|
35282
35250
|
withDraws: false,
|
|
35283
35251
|
policyDefinitions,
|
|
@@ -36718,7 +36686,6 @@ function eventMatchUps(params) {
|
|
|
36718
36686
|
groupInfo,
|
|
36719
36687
|
} = hydrateParticipants({
|
|
36720
36688
|
participantsProfile,
|
|
36721
|
-
policyDefinitions,
|
|
36722
36689
|
useParticipantMap,
|
|
36723
36690
|
tournamentRecord,
|
|
36724
36691
|
contextProfile,
|
|
@@ -36779,7 +36746,6 @@ function tournamentMatchUps(params) {
|
|
|
36779
36746
|
const events = tournamentRecord?.events ?? [];
|
|
36780
36747
|
const { participants, participantMap, groupInfo } = hydrateParticipants({
|
|
36781
36748
|
participantsProfile,
|
|
36782
|
-
policyDefinitions,
|
|
36783
36749
|
tournamentRecord,
|
|
36784
36750
|
contextProfile,
|
|
36785
36751
|
inContext,
|
|
@@ -36854,7 +36820,6 @@ function getCompetitionMatchUps({ scheduleVisibilityFilters, hydrateParticipants
|
|
|
36854
36820
|
scheduleVisibilityFilters,
|
|
36855
36821
|
hydrateParticipants,
|
|
36856
36822
|
participantsProfile,
|
|
36857
|
-
useParticipantMap,
|
|
36858
36823
|
policyDefinitions,
|
|
36859
36824
|
tournamentRecord,
|
|
36860
36825
|
usePublishState,
|
|
@@ -37795,7 +37760,6 @@ function drawMatchUps({ participants: tournamentParticipants, tournamentAppliedP
|
|
|
37795
37760
|
groupInfo,
|
|
37796
37761
|
} = hydrateParticipants({
|
|
37797
37762
|
participantsProfile,
|
|
37798
|
-
policyDefinitions,
|
|
37799
37763
|
useParticipantMap,
|
|
37800
37764
|
tournamentRecord,
|
|
37801
37765
|
contextProfile,
|
|
@@ -40000,9 +39964,7 @@ function modifyEventMatchUpFormatTiming(params) {
|
|
|
40000
39964
|
recoveryTimes: validRecoveryMinutes && newRecoveryTimes,
|
|
40001
39965
|
tournamentRecord,
|
|
40002
39966
|
matchUpFormat,
|
|
40003
|
-
eventId
|
|
40004
|
-
event,
|
|
40005
|
-
});
|
|
39967
|
+
eventId});
|
|
40006
39968
|
}
|
|
40007
39969
|
|
|
40008
39970
|
function removeEventMatchUpFormatTiming(params) {
|
|
@@ -43308,7 +43270,6 @@ function removeDirectedParticipants(params) {
|
|
|
43308
43270
|
if (byeMatchUp) {
|
|
43309
43271
|
const drawPosition = Math.min(...byeMatchUp.drawPositions);
|
|
43310
43272
|
removeDirectedBye({
|
|
43311
|
-
sourceMatchUpId: matchUpId,
|
|
43312
43273
|
targetLink: byeTargetLink,
|
|
43313
43274
|
inContextDrawMatchUps,
|
|
43314
43275
|
drawDefinition,
|
|
@@ -43498,7 +43459,6 @@ function doubleExitAdvancement(params) {
|
|
|
43498
43459
|
tournamentRecord,
|
|
43499
43460
|
loserTargetLink,
|
|
43500
43461
|
drawDefinition,
|
|
43501
|
-
loserMatchUp,
|
|
43502
43462
|
matchUpsMap,
|
|
43503
43463
|
event,
|
|
43504
43464
|
});
|
|
@@ -43562,7 +43522,6 @@ function conditionallyAdvanceDrawPosition(params) {
|
|
|
43562
43522
|
const { loserTargetLink } = targetLinks;
|
|
43563
43523
|
const result = advanceByeToLoserMatchUp({
|
|
43564
43524
|
loserTargetDrawPosition: nextLoserTargetDrawPosition,
|
|
43565
|
-
loserMatchUp: nextLoserMatchUp,
|
|
43566
43525
|
tournamentRecord,
|
|
43567
43526
|
loserTargetLink,
|
|
43568
43527
|
drawDefinition,
|
|
@@ -43644,7 +43603,6 @@ function conditionallyAdvanceDrawPosition(params) {
|
|
|
43644
43603
|
winningSide: walkoverWinningSide,
|
|
43645
43604
|
matchUp: noContextTargetMatchUp,
|
|
43646
43605
|
matchUpStatusCodes,
|
|
43647
|
-
context: stack,
|
|
43648
43606
|
matchUpStatus,
|
|
43649
43607
|
});
|
|
43650
43608
|
if (result.error)
|
|
@@ -43687,7 +43645,6 @@ function conditionallyAdvanceDrawPosition(params) {
|
|
|
43687
43645
|
matchUpStatus: EXIT,
|
|
43688
43646
|
matchUpStatusCodes: [],
|
|
43689
43647
|
removeScore: true,
|
|
43690
|
-
context: stack,
|
|
43691
43648
|
drawDefinition,
|
|
43692
43649
|
winningSide,
|
|
43693
43650
|
});
|
|
@@ -43741,7 +43698,6 @@ function conditionallyAdvanceDrawPosition(params) {
|
|
|
43741
43698
|
matchUp: noContextNextWinnerMatchUp,
|
|
43742
43699
|
matchUpStatusCodes: [],
|
|
43743
43700
|
removeScore: true,
|
|
43744
|
-
context: stack,
|
|
43745
43701
|
drawDefinition,
|
|
43746
43702
|
matchUpStatus,
|
|
43747
43703
|
});
|
|
@@ -43843,7 +43799,7 @@ function scoreModification$1(params) {
|
|
|
43843
43799
|
return decorateResult({ result, stack });
|
|
43844
43800
|
}
|
|
43845
43801
|
const isCollectionMatchUp = Boolean(params.matchUp.collectionId);
|
|
43846
|
-
const result = modifyMatchUpScore({ ...params
|
|
43802
|
+
const result = modifyMatchUpScore({ ...params});
|
|
43847
43803
|
if (isCollectionMatchUp) {
|
|
43848
43804
|
const { matchUpTieId, drawDefinition, matchUpsMap } = params;
|
|
43849
43805
|
const tieMatchUpResult = updateTieMatchUpScore({
|
|
@@ -44244,7 +44200,6 @@ function conditionallyRemoveDrawPosition(params) {
|
|
|
44244
44200
|
matchUp: noContextTargetMatchUp,
|
|
44245
44201
|
removeWinningSide: true,
|
|
44246
44202
|
matchUpStatusCodes: [],
|
|
44247
|
-
context: stack,
|
|
44248
44203
|
matchUpStatus,
|
|
44249
44204
|
removeScore,
|
|
44250
44205
|
score: {
|
|
@@ -44390,7 +44345,7 @@ function scoreModification(params) {
|
|
|
44390
44345
|
if (result.error)
|
|
44391
44346
|
return result;
|
|
44392
44347
|
}
|
|
44393
|
-
const result = modifyMatchUpScore({ ...params
|
|
44348
|
+
const result = modifyMatchUpScore({ ...params});
|
|
44394
44349
|
if (params.isCollectionMatchUp) {
|
|
44395
44350
|
const { matchUpTieId, drawDefinition, event, matchUpsMap } = params;
|
|
44396
44351
|
const { removeWinningSide } = updateTieMatchUpScore({
|
|
@@ -45195,7 +45150,7 @@ function swapWinnerLoser(params) {
|
|
|
45195
45150
|
if (existingLoserAssignment)
|
|
45196
45151
|
existingLoserAssignment.participantId = existingWinnerParticipantId;
|
|
45197
45152
|
});
|
|
45198
|
-
return modifyMatchUpScore({ ...params
|
|
45153
|
+
return modifyMatchUpScore({ ...params});
|
|
45199
45154
|
}
|
|
45200
45155
|
|
|
45201
45156
|
function setMatchUpState(params) {
|
|
@@ -45485,7 +45440,6 @@ function applyMatchUpValues(params) {
|
|
|
45485
45440
|
...params,
|
|
45486
45441
|
matchUpStatus: newMatchUpStatus,
|
|
45487
45442
|
removeWinningSide,
|
|
45488
|
-
context: 'sms',
|
|
45489
45443
|
removeScore,
|
|
45490
45444
|
});
|
|
45491
45445
|
if (result.error)
|
|
@@ -47018,17 +46972,8 @@ function getGroupedRounds({ scheduledRoundsDetails, greatestAverageMinutes, garm
|
|
|
47018
46972
|
if (roundDetails.hash === lastHash || garmanSinglePass) {
|
|
47019
46973
|
groupedMatchUpIds = groupedMatchUpIds.concat(roundDetails.matchUpIds);
|
|
47020
46974
|
}
|
|
47021
|
-
if (roundDetails.hash !== lastHash &&
|
|
47022
|
-
|
|
47023
|
-
groupedRounds.push({
|
|
47024
|
-
averageMinutes,
|
|
47025
|
-
recoveryMinutes,
|
|
47026
|
-
roundPeriodLength,
|
|
47027
|
-
matchUpIds: groupedMatchUpIds,
|
|
47028
|
-
});
|
|
47029
|
-
groupedMatchUpIds = roundDetails.matchUpIds;
|
|
47030
|
-
}
|
|
47031
|
-
averageMinutes = garmanSinglePass ? greatestAverageMinutes : roundDetails.averageMinutes;
|
|
46975
|
+
if (roundDetails.hash !== lastHash && false) ;
|
|
46976
|
+
averageMinutes = greatestAverageMinutes ;
|
|
47032
46977
|
recoveryMinutes = roundDetails.recoveryMinutes;
|
|
47033
46978
|
roundPeriodLength = roundDetails.roundPeriodLength;
|
|
47034
46979
|
}
|
|
@@ -48225,7 +48170,6 @@ function scheduleProfileRounds(params) {
|
|
|
48225
48170
|
schedulingProfile,
|
|
48226
48171
|
personRequests,
|
|
48227
48172
|
periodLength,
|
|
48228
|
-
useGarman,
|
|
48229
48173
|
matchUps,
|
|
48230
48174
|
dryRun,
|
|
48231
48175
|
courts,
|
|
@@ -48739,7 +48683,8 @@ var lastNames = [
|
|
|
48739
48683
|
"Wolin",
|
|
48740
48684
|
"Wirt",
|
|
48741
48685
|
"Waschuk",
|
|
48742
|
-
"Wormwood"
|
|
48686
|
+
"Wormwood",
|
|
48687
|
+
"Zecic"
|
|
48743
48688
|
];
|
|
48744
48689
|
var firstFemale = [
|
|
48745
48690
|
"Ada",
|
|
@@ -48859,6 +48804,7 @@ var firstMale = [
|
|
|
48859
48804
|
"Masanobu",
|
|
48860
48805
|
"Maurits",
|
|
48861
48806
|
"Michael",
|
|
48807
|
+
"Miro",
|
|
48862
48808
|
"Mustapha",
|
|
48863
48809
|
"Neil",
|
|
48864
48810
|
"Nikola",
|
|
@@ -49360,10 +49306,10 @@ function genRatings(params) {
|
|
|
49360
49306
|
const { categoryName, ageCategoryCode, ratingType } = category;
|
|
49361
49307
|
const scaleName = category.categoryName || category.ratingType || category.ageCategoryCode;
|
|
49362
49308
|
if ((categoryName || ageCategoryCode) && !ratingType) {
|
|
49363
|
-
const [start, end] = rankingRange;
|
|
49309
|
+
const [start, end] = rankingRange || [];
|
|
49364
49310
|
singlesRankings[scaleName] = shuffleArray(generateRange(start, end)).slice(0, scaledParticipantsCount || randomInt(20, 30));
|
|
49365
49311
|
if ([PAIR, TEAM].includes(participantType)) {
|
|
49366
|
-
const [start, end] = rankingRange;
|
|
49312
|
+
const [start, end] = rankingRange || [];
|
|
49367
49313
|
doublesRankings[scaleName] = shuffleArray(generateRange(start, end)).slice(0, scaledParticipantsCount || randomInt(20, 30));
|
|
49368
49314
|
}
|
|
49369
49315
|
}
|
|
@@ -50192,9 +50138,7 @@ function generateFlightDrawDefinitions({ matchUpStatusProfile, completeAllMatchU
|
|
|
50192
50138
|
let result = automatedPlayoffPositioning({
|
|
50193
50139
|
structureId: mainStructure.structureId,
|
|
50194
50140
|
tournamentRecord,
|
|
50195
|
-
drawDefinition
|
|
50196
|
-
event,
|
|
50197
|
-
});
|
|
50141
|
+
drawDefinition});
|
|
50198
50142
|
if (result.error)
|
|
50199
50143
|
return { error: result.error, drawIds: [] };
|
|
50200
50144
|
const playoffCompletionGoal = completionGoal ? completionGoal - (completedCount ?? 0) : undefined;
|
|
@@ -50870,9 +50814,7 @@ function generateEventWithDraw(params) {
|
|
|
50870
50814
|
automatedPlayoffPositioning({
|
|
50871
50815
|
structureId: mainStructure.structureId,
|
|
50872
50816
|
tournamentRecord,
|
|
50873
|
-
drawDefinition
|
|
50874
|
-
event,
|
|
50875
|
-
});
|
|
50817
|
+
drawDefinition});
|
|
50876
50818
|
const playoffCompletionGoal = completionGoal ? completionGoal - (completedCount ?? 0) : undefined;
|
|
50877
50819
|
const result = completeDrawMatchUps({
|
|
50878
50820
|
completionGoal: completionGoal ? playoffCompletionGoal : undefined,
|
|
@@ -51311,7 +51253,6 @@ function processLeagueProfiles(params) {
|
|
|
51311
51253
|
consideredDate,
|
|
51312
51254
|
gendersCount,
|
|
51313
51255
|
category,
|
|
51314
|
-
gender,
|
|
51315
51256
|
uuids,
|
|
51316
51257
|
}).participants;
|
|
51317
51258
|
const individualParticipantIds = participants.map((participant) => participant.participantId);
|
|
@@ -51719,7 +51660,6 @@ function anonymizeTournamentRecord({ keepExtensions = [], anonymizeParticipantNa
|
|
|
51719
51660
|
[gender]: generatePersons({
|
|
51720
51661
|
category: { ageCategoryCode: 'O18' },
|
|
51721
51662
|
count: gendersCount[gender],
|
|
51722
|
-
addressProps: { citiesCount: 10 },
|
|
51723
51663
|
personExtensions: [],
|
|
51724
51664
|
consideredDate,
|
|
51725
51665
|
sex: gender,
|
|
@@ -53990,12 +53930,12 @@ function getStructureReports(params) {
|
|
|
53990
53930
|
participant: individualParticipants?.[0] || winningParticipant,
|
|
53991
53931
|
eventType,
|
|
53992
53932
|
});
|
|
53993
|
-
const { personId: winningPersonId, personOtherId: winningPersonOtherId, tennisId: winningPersonTennisId, confidence: confidence1, wtnRating: wtnRating1, } = winningPersonWTN;
|
|
53933
|
+
const { personId: winningPersonId, personOtherId: winningPersonOtherId, tennisId: winningPersonTennisId, confidence: confidence1, wtnRating: wtnRating1, } = winningPersonWTN || {};
|
|
53994
53934
|
const winningPerson2WTN = getDetailsWTN({
|
|
53995
53935
|
participant: individualParticipants?.[1],
|
|
53996
53936
|
eventType,
|
|
53997
53937
|
});
|
|
53998
|
-
const { personId: winningPerson2Id, personOtherId: winningPerson2OtherId, tennisId: winningPerson2TennisId, confidence: confidence2, wtnRating: wtnRating2, } = winningPerson2WTN;
|
|
53938
|
+
const { personId: winningPerson2Id, personOtherId: winningPerson2OtherId, tennisId: winningPerson2TennisId, confidence: confidence2, wtnRating: wtnRating2, } = winningPerson2WTN || {};
|
|
53999
53939
|
const { ageCategoryCode, categoryName, subType } = category ?? {};
|
|
54000
53940
|
const matchUpFormat = s.matchUpFormat || drawMatchUpFormat;
|
|
54001
53941
|
const matchUpsInitialFormat = matchUpFormatCounts[matchUpFormat] || 0;
|
|
@@ -56321,9 +56261,7 @@ function removeCollectionDefinition({ updateInProgressMatchUps = true, tieFormat
|
|
|
56321
56261
|
else if (event) {
|
|
56322
56262
|
matchUps =
|
|
56323
56263
|
allEventMatchUps({
|
|
56324
|
-
matchUpFilters: { matchUpTypes: [TEAM$2] }
|
|
56325
|
-
drawDefinition,
|
|
56326
|
-
})?.matchUps ?? [];
|
|
56264
|
+
matchUpFilters: { matchUpTypes: [TEAM$2] }})?.matchUps ?? [];
|
|
56327
56265
|
}
|
|
56328
56266
|
const targetMatchUps = (matchUps || []).filter((matchUp) => {
|
|
56329
56267
|
const collectionMatchUps = matchUp.tieMatchUps?.filter((tieMatchUp) => tieMatchUp.collectionId === collectionId);
|
|
@@ -56902,12 +56840,12 @@ function aggregateTieFormats({ tournamentRecord, }) {
|
|
|
56902
56840
|
addedCount += 1;
|
|
56903
56841
|
}
|
|
56904
56842
|
};
|
|
56905
|
-
|
|
56906
|
-
checkTieFormat({ tieFormat: event.tieFormat
|
|
56843
|
+
event.eventType;
|
|
56844
|
+
checkTieFormat({ tieFormat: event.tieFormat});
|
|
56907
56845
|
for (const drawDefinition of event.drawDefinitions ?? []) {
|
|
56908
|
-
checkTieFormat({ tieFormat: drawDefinition.tieFormat
|
|
56846
|
+
checkTieFormat({ tieFormat: drawDefinition.tieFormat});
|
|
56909
56847
|
for (const structure of drawDefinition.structures ?? []) {
|
|
56910
|
-
checkTieFormat({ tieFormat: structure.tieFormat
|
|
56848
|
+
checkTieFormat({ tieFormat: structure.tieFormat});
|
|
56911
56849
|
}
|
|
56912
56850
|
}
|
|
56913
56851
|
const setTieFormatId = (matchUpId, tieFormatId) => {
|