tods-competition-factory 2.1.28 → 2.1.29
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 +5 -5
- package/dist/tods-competition-factory.development.cjs.js +16 -16
- 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 +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
function factoryVersion() {
|
|
6
|
-
return '2.1.
|
|
6
|
+
return '2.1.29';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const SINGLES_MATCHUP = 'SINGLES';
|
|
@@ -10164,6 +10164,9 @@ function getSideValue$1({ displaySideNumber, seedAssignments, participantId, ass
|
|
|
10164
10164
|
if (participantId) {
|
|
10165
10165
|
const seeding = getSeeding({ seedAssignments, participantId });
|
|
10166
10166
|
Object.assign(side, seeding, { participantId });
|
|
10167
|
+
if (seeding?.seedNumber && seeding?.seedValue === '') {
|
|
10168
|
+
side.seedValue = '~';
|
|
10169
|
+
}
|
|
10167
10170
|
}
|
|
10168
10171
|
else if (assignment.bye) {
|
|
10169
10172
|
Object.assign(side, { bye: true });
|
|
@@ -16991,7 +16994,8 @@ function assignDrawPosition$1({ provisionalPositioning, inContextDrawMatchUps, i
|
|
|
16991
16994
|
positionAssignment.participantId = participantId;
|
|
16992
16995
|
if (isQualifierPosition)
|
|
16993
16996
|
positionAssignment.qualifier = true;
|
|
16994
|
-
|
|
16997
|
+
const mainSeeding = structure.stage === MAIN && (!structure.stageSequence || structure.stageSequence > 1);
|
|
16998
|
+
if (mainSeeding || (structure.stage && [CONSOLATION, PLAY_OFF].includes(structure.stage))) {
|
|
16995
16999
|
const targetStage = structure.stage === QUALIFYING ? QUALIFYING : MAIN;
|
|
16996
17000
|
const targetStructure = drawDefinition.structures?.find((structure) => structure?.stage === targetStage && structure?.stageSequence === 1);
|
|
16997
17001
|
const seedAssignments = targetStructure?.seedAssignments ?? [];
|
|
@@ -26363,16 +26367,16 @@ function getValidQualifiersAction({ drawPositionInitialRounds, tournamentPartici
|
|
|
26363
26367
|
}
|
|
26364
26368
|
if (qualifyingParticipantIds.length) {
|
|
26365
26369
|
validAssignmentActions.push(definedAttributes({
|
|
26370
|
+
qualifyingParticipants: returnParticipants ? qualifyingParticipants : undefined,
|
|
26371
|
+
method: QUALIFYING_PARTICIPANT_METHOD,
|
|
26372
|
+
type: QUALIFYING_PARTICIPANT,
|
|
26373
|
+
qualifyingParticipantIds,
|
|
26366
26374
|
payload: {
|
|
26367
26375
|
qualifyingParticipantId: undefined,
|
|
26368
26376
|
drawPosition,
|
|
26369
26377
|
structureId,
|
|
26370
26378
|
drawId,
|
|
26371
26379
|
},
|
|
26372
|
-
method: QUALIFYING_PARTICIPANT_METHOD,
|
|
26373
|
-
type: QUALIFYING_PARTICIPANT,
|
|
26374
|
-
qualifyingParticipantIds,
|
|
26375
|
-
qualifyingParticipants: returnParticipants ? qualifyingParticipants : undefined,
|
|
26376
26380
|
}));
|
|
26377
26381
|
}
|
|
26378
26382
|
return { validAssignmentActions, sourceStructureIds };
|
|
@@ -26486,13 +26490,7 @@ function positionActions(params) {
|
|
|
26486
26490
|
}) || {};
|
|
26487
26491
|
let sourceStructuresComplete;
|
|
26488
26492
|
if (positionSourceStructureIds?.length) {
|
|
26489
|
-
sourceStructuresComplete = positionSourceStructureIds.
|
|
26490
|
-
const completed = isCompletedStructure({
|
|
26491
|
-
structureId: sourceStructureId,
|
|
26492
|
-
drawDefinition,
|
|
26493
|
-
});
|
|
26494
|
-
return completed && ready;
|
|
26495
|
-
}, true);
|
|
26493
|
+
sourceStructuresComplete = positionSourceStructureIds.every((sourceStructureId) => isCompletedStructure({ structureId: sourceStructureId, drawDefinition }));
|
|
26496
26494
|
}
|
|
26497
26495
|
const isWinRatioFedStructure = positionSourceStructureIds.length;
|
|
26498
26496
|
const disablePlacementActions = positionSourceStructureIds.length && !sourceStructuresComplete;
|
|
@@ -26506,6 +26504,7 @@ function positionActions(params) {
|
|
|
26506
26504
|
const validActions = [];
|
|
26507
26505
|
const { assignedPositions, positionAssignments } = structureAssignedDrawPositions({ structure });
|
|
26508
26506
|
const positionAssignment = assignedPositions?.find((assignment) => assignment.drawPosition === drawPosition);
|
|
26507
|
+
const hasPositionAssigned = !!positionAssignment;
|
|
26509
26508
|
const drawPositions = positionAssignments?.map((assignment) => assignment.drawPosition);
|
|
26510
26509
|
if (!drawPositions?.includes(drawPosition))
|
|
26511
26510
|
return { error: INVALID_DRAW_POSITION };
|
|
@@ -26534,10 +26533,10 @@ function positionActions(params) {
|
|
|
26534
26533
|
const isActiveDrawPosition = activeDrawPositions.includes(drawPosition);
|
|
26535
26534
|
if (actionsDisabled)
|
|
26536
26535
|
return {
|
|
26537
|
-
hasPositionAssigned: !!positionAssignment,
|
|
26538
26536
|
info: 'Actions Disabled for structure',
|
|
26539
26537
|
isActiveDrawPosition,
|
|
26540
26538
|
isDrawPosition: true,
|
|
26539
|
+
hasPositionAssigned,
|
|
26541
26540
|
validActions: [],
|
|
26542
26541
|
isByePosition,
|
|
26543
26542
|
};
|
|
@@ -26563,7 +26562,7 @@ function positionActions(params) {
|
|
|
26563
26562
|
});
|
|
26564
26563
|
validAssignmentActions?.forEach((action) => validActions.push(action));
|
|
26565
26564
|
}
|
|
26566
|
-
if (isAvailableAction({ policyActions, action: QUALIFYING_PARTICIPANT })) {
|
|
26565
|
+
if (isAvailableAction({ policyActions, action: QUALIFYING_PARTICIPANT }) && !isActiveDrawPosition) {
|
|
26567
26566
|
const { validAssignmentActions } = getValidQualifiersAction({
|
|
26568
26567
|
drawPositionInitialRounds,
|
|
26569
26568
|
tournamentParticipants,
|
|
@@ -26730,6 +26729,7 @@ function positionActions(params) {
|
|
|
26730
26729
|
}
|
|
26731
26730
|
if (isAvailableAction({ policyActions, action: LUCKY_PARTICIPANT }) &&
|
|
26732
26731
|
!disablePlacementActions &&
|
|
26732
|
+
!isActiveDrawPosition &&
|
|
26733
26733
|
positionAssignments) {
|
|
26734
26734
|
const { validLuckyLosersAction } = getValidLuckyLosersAction({
|
|
26735
26735
|
sourceStructuresComplete,
|
|
@@ -26760,9 +26760,9 @@ function positionActions(params) {
|
|
|
26760
26760
|
validActions.push(validModifyAssignedPairAction);
|
|
26761
26761
|
}
|
|
26762
26762
|
return {
|
|
26763
|
-
hasPositionAssigned: !!positionAssignment,
|
|
26764
26763
|
isActiveDrawPosition,
|
|
26765
26764
|
isDrawPosition: true,
|
|
26765
|
+
hasPositionAssigned,
|
|
26766
26766
|
isByePosition,
|
|
26767
26767
|
validActions,
|
|
26768
26768
|
...SUCCESS,
|