tods-competition-factory 1.7.14 → 1.7.16
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/forge/generate.mjs +175 -142
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.d.ts +2 -2
- package/dist/forge/query.mjs +10 -14
- package/dist/forge/query.mjs.map +1 -1
- package/dist/forge/transform.mjs +58 -73
- package/dist/forge/transform.mjs.map +1 -1
- package/dist/index.mjs +212 -170
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +263 -218
- 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
package/dist/forge/generate.mjs
CHANGED
|
@@ -1864,19 +1864,15 @@ function findEvent({
|
|
|
1864
1864
|
}) {
|
|
1865
1865
|
const stack = "findEvent";
|
|
1866
1866
|
if (!tournamentRecord)
|
|
1867
|
-
return {
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
stack
|
|
1873
|
-
})
|
|
1874
|
-
};
|
|
1875
|
-
const events = tournamentRecord?.events || [];
|
|
1867
|
+
return decorateResult({
|
|
1868
|
+
result: { error: MISSING_TOURNAMENT_RECORD },
|
|
1869
|
+
stack
|
|
1870
|
+
});
|
|
1871
|
+
const events = tournamentRecord?.events ?? [];
|
|
1876
1872
|
if (drawId) {
|
|
1877
1873
|
let drawDefinition;
|
|
1878
1874
|
const event = events.find((event2) => {
|
|
1879
|
-
const drawDefinitions = event2?.drawDefinitions
|
|
1875
|
+
const drawDefinitions = event2?.drawDefinitions ?? [];
|
|
1880
1876
|
const targetDrawDefinition = drawDefinitions.find(
|
|
1881
1877
|
(drawDefinition2) => drawDefinition2.drawId === drawId
|
|
1882
1878
|
);
|
|
@@ -1935,7 +1931,7 @@ function addExtension(params) {
|
|
|
1935
1931
|
});
|
|
1936
1932
|
if (!params.element.extensions)
|
|
1937
1933
|
params.element.extensions = [];
|
|
1938
|
-
const creationTime = params
|
|
1934
|
+
const creationTime = params?.creationTime ?? true;
|
|
1939
1935
|
if (creationTime) {
|
|
1940
1936
|
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
1941
1937
|
Object.assign(params.extension, { createdAt });
|
|
@@ -2140,7 +2136,7 @@ function findCourt({
|
|
|
2140
2136
|
} else if (tournamentRecords) {
|
|
2141
2137
|
const linkedTournamentIds = getLinkedTournamentIds({
|
|
2142
2138
|
tournamentRecords
|
|
2143
|
-
}).linkedTournamentIds
|
|
2139
|
+
}).linkedTournamentIds ?? [];
|
|
2144
2140
|
const relevantIds = linkedTournamentIds[tournamentRecord.tournamentId];
|
|
2145
2141
|
for (const tournamentId of relevantIds) {
|
|
2146
2142
|
const record = tournamentRecords[tournamentId];
|
|
@@ -5352,8 +5348,8 @@ function getSeedGroups({
|
|
|
5352
5348
|
return {
|
|
5353
5349
|
seedGroups: void 0,
|
|
5354
5350
|
...decorateResult({
|
|
5355
|
-
result: { error: INVALID_VALUES },
|
|
5356
5351
|
context: { roundRobinGroupsCount },
|
|
5352
|
+
result: { error: INVALID_VALUES },
|
|
5357
5353
|
stack
|
|
5358
5354
|
})
|
|
5359
5355
|
};
|
|
@@ -11006,9 +11002,7 @@ function assignMatchUpDrawPosition({
|
|
|
11006
11002
|
return { ...SUCCESS };
|
|
11007
11003
|
} else {
|
|
11008
11004
|
return decorateResult({
|
|
11009
|
-
result: {
|
|
11010
|
-
error: DRAW_POSITION_ASSIGNED
|
|
11011
|
-
},
|
|
11005
|
+
result: { error: DRAW_POSITION_ASSIGNED },
|
|
11012
11006
|
context: { drawPosition },
|
|
11013
11007
|
stack
|
|
11014
11008
|
});
|
|
@@ -11347,7 +11341,7 @@ function removeSubsequentRoundsParticipant({
|
|
|
11347
11341
|
const positionAssignments = getPositionAssignments({
|
|
11348
11342
|
drawDefinition,
|
|
11349
11343
|
structureId
|
|
11350
|
-
}).positionAssignments
|
|
11344
|
+
}).positionAssignments ?? [];
|
|
11351
11345
|
relevantMatchUps?.forEach(
|
|
11352
11346
|
(matchUp) => removeDrawPosition({
|
|
11353
11347
|
drawPosition: targetDrawPosition,
|
|
@@ -11377,7 +11371,7 @@ function removeDrawPosition({
|
|
|
11377
11371
|
const initialDrawPositions = targetMatchUp.drawPositions?.slice();
|
|
11378
11372
|
const initialMatchUpStatus = targetMatchUp.matchUpStatus;
|
|
11379
11373
|
const initialWinningSide = targetMatchUp.winningSide;
|
|
11380
|
-
matchUpsMap = matchUpsMap
|
|
11374
|
+
matchUpsMap = matchUpsMap ?? getMatchUpsMap({ drawDefinition });
|
|
11381
11375
|
const mappedMatchUps = matchUpsMap.mappedMatchUps;
|
|
11382
11376
|
const matchUps = mappedMatchUps[structure.structureId].matchUps;
|
|
11383
11377
|
const { initialRoundNumber } = getInitialRoundNumber({
|
|
@@ -11385,7 +11379,7 @@ function removeDrawPosition({
|
|
|
11385
11379
|
matchUps
|
|
11386
11380
|
});
|
|
11387
11381
|
if (targetMatchUp.roundNumber && initialRoundNumber && targetMatchUp.roundNumber > initialRoundNumber) {
|
|
11388
|
-
const drawPositions = (targetMatchUp.drawPositions
|
|
11382
|
+
const drawPositions = (targetMatchUp.drawPositions ?? []).map(
|
|
11389
11383
|
(currentDrawPosition) => currentDrawPosition === drawPosition ? void 0 : currentDrawPosition
|
|
11390
11384
|
);
|
|
11391
11385
|
targetMatchUp.drawPositions = drawPositions;
|
|
@@ -11394,7 +11388,7 @@ function removeDrawPosition({
|
|
|
11394
11388
|
const inContextTargetMatchUp = inContextDrawMatchUps?.find(
|
|
11395
11389
|
(matchUp) => matchUp.matchUpId === targetMatchUp.matchUpId
|
|
11396
11390
|
);
|
|
11397
|
-
const sides = inContextTargetMatchUp?.sides
|
|
11391
|
+
const sides = inContextTargetMatchUp?.sides ?? [];
|
|
11398
11392
|
const drawPositionSideIndex = sides.reduce(
|
|
11399
11393
|
(index, side, i) => side.drawPosition === drawPosition ? i : index,
|
|
11400
11394
|
void 0
|
|
@@ -12823,11 +12817,7 @@ function positionByes({
|
|
|
12823
12817
|
}
|
|
12824
12818
|
|
|
12825
12819
|
function positionQualifiers(params) {
|
|
12826
|
-
|
|
12827
|
-
if (!structure)
|
|
12828
|
-
({ structure } = findStructure(params));
|
|
12829
|
-
if (!structureId)
|
|
12830
|
-
({ structureId } = structure);
|
|
12820
|
+
const structure = params.structure ?? findStructure(params).structure;
|
|
12831
12821
|
const stack = "positionQualifiers";
|
|
12832
12822
|
const qualifierDrawPositions = [];
|
|
12833
12823
|
if (structure.stage === CONSOLATION) {
|
|
@@ -16363,31 +16353,25 @@ function validateTieFormat(params) {
|
|
|
16363
16353
|
if (!params || !tieFormat || typeof tieFormat !== "object") {
|
|
16364
16354
|
errors.push("tieFormat must be an object");
|
|
16365
16355
|
return decorateResult({
|
|
16366
|
-
result: {
|
|
16367
|
-
|
|
16368
|
-
|
|
16369
|
-
stack
|
|
16370
|
-
}
|
|
16356
|
+
result: { error: INVALID_TIE_FORMAT },
|
|
16357
|
+
context: { tieFormat, errors },
|
|
16358
|
+
stack
|
|
16371
16359
|
});
|
|
16372
16360
|
}
|
|
16373
16361
|
if (typeof tieFormat.winCriteria !== "object") {
|
|
16374
16362
|
errors.push("tieFormat.winCriteria must be an object");
|
|
16375
16363
|
return decorateResult({
|
|
16376
|
-
result: {
|
|
16377
|
-
|
|
16378
|
-
|
|
16379
|
-
stack
|
|
16380
|
-
}
|
|
16364
|
+
result: { error: INVALID_TIE_FORMAT },
|
|
16365
|
+
context: { tieFormat, errors },
|
|
16366
|
+
stack
|
|
16381
16367
|
});
|
|
16382
16368
|
}
|
|
16383
16369
|
if (!Array.isArray(tieFormat.collectionDefinitions)) {
|
|
16384
16370
|
errors.push(mustBeAnArray("tieFormat.collectionDefinitions"));
|
|
16385
16371
|
return decorateResult({
|
|
16386
|
-
result: {
|
|
16387
|
-
|
|
16388
|
-
|
|
16389
|
-
stack
|
|
16390
|
-
}
|
|
16372
|
+
result: { error: INVALID_TIE_FORMAT },
|
|
16373
|
+
context: { tieFormat, errors },
|
|
16374
|
+
stack
|
|
16391
16375
|
});
|
|
16392
16376
|
}
|
|
16393
16377
|
let aggregateValueImperative;
|
|
@@ -16420,11 +16404,9 @@ function validateTieFormat(params) {
|
|
|
16420
16404
|
);
|
|
16421
16405
|
}
|
|
16422
16406
|
return decorateResult({
|
|
16423
|
-
|
|
16424
|
-
|
|
16425
|
-
|
|
16426
|
-
stack
|
|
16427
|
-
}
|
|
16407
|
+
context: { tieFormat, errors, aggregateValueImperative },
|
|
16408
|
+
result: { error: INVALID_TIE_FORMAT },
|
|
16409
|
+
stack
|
|
16428
16410
|
});
|
|
16429
16411
|
}
|
|
16430
16412
|
const collectionIds = tieFormat.collectionDefinitions.map(
|
|
@@ -16435,11 +16417,9 @@ function validateTieFormat(params) {
|
|
|
16435
16417
|
const result = { valid, errors };
|
|
16436
16418
|
if (!valid) {
|
|
16437
16419
|
return decorateResult({
|
|
16438
|
-
result: {
|
|
16439
|
-
|
|
16440
|
-
|
|
16441
|
-
stack
|
|
16442
|
-
}
|
|
16420
|
+
result: { error: INVALID_TIE_FORMAT },
|
|
16421
|
+
context: { tieFormat, errors },
|
|
16422
|
+
stack
|
|
16443
16423
|
});
|
|
16444
16424
|
}
|
|
16445
16425
|
return result;
|
|
@@ -17199,7 +17179,8 @@ function directLoser(params) {
|
|
|
17199
17179
|
if (result.error)
|
|
17200
17180
|
return decorateResult({ result, stack });
|
|
17201
17181
|
} else if (loserParticipantId && isFeedRound) {
|
|
17202
|
-
|
|
17182
|
+
unfilledTargetMatchUpDrawPositions.sort(numericSort);
|
|
17183
|
+
const fedDrawPosition = unfilledTargetMatchUpDrawPositions[0];
|
|
17203
17184
|
const result = assignDrawPosition({
|
|
17204
17185
|
participantId: loserParticipantId,
|
|
17205
17186
|
structureId: targetStructureId,
|
|
@@ -17464,7 +17445,7 @@ function generateAndPopulatePlayoffStructures(params) {
|
|
|
17464
17445
|
drawDefinition
|
|
17465
17446
|
});
|
|
17466
17447
|
if (!structure)
|
|
17467
|
-
return decorateResult({ result: { error: STRUCTURE_NOT_FOUND } });
|
|
17448
|
+
return decorateResult({ result: { error: STRUCTURE_NOT_FOUND }, stack });
|
|
17468
17449
|
if (structure.structureType === CONTAINER || structure.structures) {
|
|
17469
17450
|
return generateAndPopulateRRplayoffStructures({
|
|
17470
17451
|
sourceStructureId: structure.structureId,
|
|
@@ -19014,10 +18995,8 @@ function addParticipant({
|
|
|
19014
18995
|
});
|
|
19015
18996
|
} else if (participant.individualParticipantIds.length !== 2 && !pairOverride) {
|
|
19016
18997
|
return decorateResult({
|
|
19017
|
-
|
|
19018
|
-
|
|
19019
|
-
info: "PAIR must be 2 individualParticipantIds"
|
|
19020
|
-
},
|
|
18998
|
+
info: "PAIR must be 2 individualParticipantIds",
|
|
18999
|
+
result: { error: INVALID_PARTICIPANT_IDS },
|
|
19021
19000
|
stack
|
|
19022
19001
|
});
|
|
19023
19002
|
} else {
|
|
@@ -20933,14 +20912,14 @@ function addDrawDefinition(params) {
|
|
|
20933
20912
|
if (relevantFlight && !drawEntriesPresentInFlight) {
|
|
20934
20913
|
return decorateResult({
|
|
20935
20914
|
result: {
|
|
20936
|
-
error: INVALID_DRAW_DEFINITION
|
|
20937
|
-
|
|
20938
|
-
|
|
20939
|
-
|
|
20940
|
-
|
|
20941
|
-
|
|
20942
|
-
|
|
20943
|
-
|
|
20915
|
+
error: INVALID_DRAW_DEFINITION
|
|
20916
|
+
},
|
|
20917
|
+
context: {
|
|
20918
|
+
drawEntriesPresentInFlight,
|
|
20919
|
+
matchingEventEntries,
|
|
20920
|
+
relevantFlight
|
|
20921
|
+
},
|
|
20922
|
+
info: "Draw entries are not present in flight or do not match entryStatuses"
|
|
20944
20923
|
});
|
|
20945
20924
|
}
|
|
20946
20925
|
if (modifyEventEntries) {
|
|
@@ -20959,9 +20938,9 @@ function addDrawDefinition(params) {
|
|
|
20959
20938
|
if (eventEntries && !matchingEventEntries)
|
|
20960
20939
|
return decorateResult({
|
|
20961
20940
|
result: {
|
|
20962
|
-
|
|
20941
|
+
info: "Draw entries do not match event entryStatuses",
|
|
20963
20942
|
context: { matchingEventEntries, eventEntries },
|
|
20964
|
-
|
|
20943
|
+
error: INVALID_DRAW_DEFINITION
|
|
20965
20944
|
}
|
|
20966
20945
|
});
|
|
20967
20946
|
const flightNumbers = flightProfile?.flights?.map(
|
|
@@ -21308,7 +21287,7 @@ function newDrawDefinition({
|
|
|
21308
21287
|
return Object.assign(drawDefinition, { drawId, drawType, matchUpType });
|
|
21309
21288
|
}
|
|
21310
21289
|
|
|
21311
|
-
var collectionDefinitions$
|
|
21290
|
+
var collectionDefinitions$f = [
|
|
21312
21291
|
{
|
|
21313
21292
|
collectionName: "Male Singles",
|
|
21314
21293
|
matchUpFormat: "SET3-S:6/TB7",
|
|
@@ -21350,17 +21329,17 @@ var collectionDefinitions$e = [
|
|
|
21350
21329
|
gender: "MIXED"
|
|
21351
21330
|
}
|
|
21352
21331
|
];
|
|
21353
|
-
var tieFormatName$
|
|
21354
|
-
var winCriteria$
|
|
21332
|
+
var tieFormatName$f = "USTA_GOLD_TEAM_CHALLENGE";
|
|
21333
|
+
var winCriteria$f = {
|
|
21355
21334
|
valueGoal: 9
|
|
21356
21335
|
};
|
|
21357
21336
|
var USTA_GOLD_TEAM_CHALLENGE_FORMAT = {
|
|
21358
|
-
collectionDefinitions: collectionDefinitions$
|
|
21359
|
-
tieFormatName: tieFormatName$
|
|
21360
|
-
winCriteria: winCriteria$
|
|
21337
|
+
collectionDefinitions: collectionDefinitions$f,
|
|
21338
|
+
tieFormatName: tieFormatName$f,
|
|
21339
|
+
winCriteria: winCriteria$f
|
|
21361
21340
|
};
|
|
21362
21341
|
|
|
21363
|
-
var collectionDefinitions$
|
|
21342
|
+
var collectionDefinitions$e = [
|
|
21364
21343
|
{
|
|
21365
21344
|
collectionName: "Round 1",
|
|
21366
21345
|
matchUpCount: 3,
|
|
@@ -21383,19 +21362,19 @@ var collectionDefinitions$d = [
|
|
|
21383
21362
|
scoreValue: 1
|
|
21384
21363
|
}
|
|
21385
21364
|
];
|
|
21386
|
-
var tieFormatName$
|
|
21365
|
+
var tieFormatName$e = "Doubles Shuffle";
|
|
21387
21366
|
var unrestrictedSelections = true;
|
|
21388
|
-
var winCriteria$
|
|
21367
|
+
var winCriteria$e = {
|
|
21389
21368
|
aggregateValue: true
|
|
21390
21369
|
};
|
|
21391
21370
|
var TEAM_AGGREGATION_TIE_FORMAT = {
|
|
21392
|
-
collectionDefinitions: collectionDefinitions$
|
|
21393
|
-
tieFormatName: tieFormatName$
|
|
21371
|
+
collectionDefinitions: collectionDefinitions$e,
|
|
21372
|
+
tieFormatName: tieFormatName$e,
|
|
21394
21373
|
unrestrictedSelections: unrestrictedSelections,
|
|
21395
|
-
winCriteria: winCriteria$
|
|
21374
|
+
winCriteria: winCriteria$e
|
|
21396
21375
|
};
|
|
21397
21376
|
|
|
21398
|
-
var collectionDefinitions$
|
|
21377
|
+
var collectionDefinitions$d = [
|
|
21399
21378
|
{
|
|
21400
21379
|
collectionName: "Male Singles",
|
|
21401
21380
|
gender: "MALE",
|
|
@@ -21421,17 +21400,17 @@ var collectionDefinitions$c = [
|
|
|
21421
21400
|
matchUpValue: 1
|
|
21422
21401
|
}
|
|
21423
21402
|
];
|
|
21424
|
-
var tieFormatName$
|
|
21425
|
-
var winCriteria$
|
|
21403
|
+
var tieFormatName$d = "USTA_SOUTHERN_LEVEL_5";
|
|
21404
|
+
var winCriteria$d = {
|
|
21426
21405
|
valueGoal: 8
|
|
21427
21406
|
};
|
|
21428
21407
|
var USTA_SOUTHERN_LEVEL_5_TIE_FORMAT = {
|
|
21429
|
-
collectionDefinitions: collectionDefinitions$
|
|
21430
|
-
tieFormatName: tieFormatName$
|
|
21431
|
-
winCriteria: winCriteria$
|
|
21408
|
+
collectionDefinitions: collectionDefinitions$d,
|
|
21409
|
+
tieFormatName: tieFormatName$d,
|
|
21410
|
+
winCriteria: winCriteria$d
|
|
21432
21411
|
};
|
|
21433
21412
|
|
|
21434
|
-
var collectionDefinitions$
|
|
21413
|
+
var collectionDefinitions$c = [
|
|
21435
21414
|
{
|
|
21436
21415
|
category: {
|
|
21437
21416
|
ageCategoryCode: "16U"
|
|
@@ -21483,17 +21462,17 @@ var collectionDefinitions$b = [
|
|
|
21483
21462
|
]
|
|
21484
21463
|
}
|
|
21485
21464
|
];
|
|
21486
|
-
var tieFormatName$
|
|
21487
|
-
var winCriteria$
|
|
21465
|
+
var tieFormatName$c = "USTA_SECTION_BATTLE";
|
|
21466
|
+
var winCriteria$c = {
|
|
21488
21467
|
valueGoal: 9
|
|
21489
21468
|
};
|
|
21490
21469
|
var USTA_SECTION_BATTLE_TIE_FORMAT = {
|
|
21491
|
-
collectionDefinitions: collectionDefinitions$
|
|
21492
|
-
tieFormatName: tieFormatName$
|
|
21493
|
-
winCriteria: winCriteria$
|
|
21470
|
+
collectionDefinitions: collectionDefinitions$c,
|
|
21471
|
+
tieFormatName: tieFormatName$c,
|
|
21472
|
+
winCriteria: winCriteria$c
|
|
21494
21473
|
};
|
|
21495
21474
|
|
|
21496
|
-
var collectionDefinitions$
|
|
21475
|
+
var collectionDefinitions$b = [
|
|
21497
21476
|
{
|
|
21498
21477
|
collectionName: "Male Singles",
|
|
21499
21478
|
gender: "MALE",
|
|
@@ -21535,17 +21514,17 @@ var collectionDefinitions$a = [
|
|
|
21535
21514
|
matchUpValue: 1
|
|
21536
21515
|
}
|
|
21537
21516
|
];
|
|
21538
|
-
var tieFormatName$
|
|
21539
|
-
var winCriteria$
|
|
21517
|
+
var tieFormatName$b = "USTA_INTERSECTIONAL";
|
|
21518
|
+
var winCriteria$b = {
|
|
21540
21519
|
valueGoal: 8
|
|
21541
21520
|
};
|
|
21542
21521
|
var USTA_INTERSECTIONAL_TIE_FORMAT = {
|
|
21543
|
-
collectionDefinitions: collectionDefinitions$
|
|
21544
|
-
tieFormatName: tieFormatName$
|
|
21545
|
-
winCriteria: winCriteria$
|
|
21522
|
+
collectionDefinitions: collectionDefinitions$b,
|
|
21523
|
+
tieFormatName: tieFormatName$b,
|
|
21524
|
+
winCriteria: winCriteria$b
|
|
21546
21525
|
};
|
|
21547
21526
|
|
|
21548
|
-
var collectionDefinitions$
|
|
21527
|
+
var collectionDefinitions$a = [
|
|
21549
21528
|
{
|
|
21550
21529
|
collectionName: "Mixed Doubles",
|
|
21551
21530
|
gender: "MIXED",
|
|
@@ -21571,17 +21550,17 @@ var collectionDefinitions$9 = [
|
|
|
21571
21550
|
matchUpValue: 1
|
|
21572
21551
|
}
|
|
21573
21552
|
];
|
|
21574
|
-
var tieFormatName$
|
|
21575
|
-
var winCriteria$
|
|
21553
|
+
var tieFormatName$a = "DOMINANT_DUO_MIXED";
|
|
21554
|
+
var winCriteria$a = {
|
|
21576
21555
|
valueGoal: 2
|
|
21577
21556
|
};
|
|
21578
21557
|
var DOMINANT_DUO_MIXED_TIE_FORMAT = {
|
|
21579
|
-
collectionDefinitions: collectionDefinitions$
|
|
21580
|
-
tieFormatName: tieFormatName$
|
|
21581
|
-
winCriteria: winCriteria$
|
|
21558
|
+
collectionDefinitions: collectionDefinitions$a,
|
|
21559
|
+
tieFormatName: tieFormatName$a,
|
|
21560
|
+
winCriteria: winCriteria$a
|
|
21582
21561
|
};
|
|
21583
21562
|
|
|
21584
|
-
var collectionDefinitions$
|
|
21563
|
+
var collectionDefinitions$9 = [
|
|
21585
21564
|
{
|
|
21586
21565
|
category: {
|
|
21587
21566
|
ageCategoryCode: "14U"
|
|
@@ -21656,22 +21635,22 @@ var collectionGroups$1 = [
|
|
|
21656
21635
|
}
|
|
21657
21636
|
}
|
|
21658
21637
|
];
|
|
21659
|
-
var tieFormatName$
|
|
21660
|
-
var winCriteria$
|
|
21638
|
+
var tieFormatName$9 = "USTA_BREWER_CUP";
|
|
21639
|
+
var winCriteria$9 = {
|
|
21661
21640
|
valueGoal: 4
|
|
21662
21641
|
};
|
|
21663
21642
|
var USTA_BREWER_CUP_TIE_FORMAT = {
|
|
21664
|
-
collectionDefinitions: collectionDefinitions$
|
|
21643
|
+
collectionDefinitions: collectionDefinitions$9,
|
|
21665
21644
|
collectionGroups: collectionGroups$1,
|
|
21666
|
-
tieFormatName: tieFormatName$
|
|
21667
|
-
winCriteria: winCriteria$
|
|
21645
|
+
tieFormatName: tieFormatName$9,
|
|
21646
|
+
winCriteria: winCriteria$9
|
|
21668
21647
|
};
|
|
21669
21648
|
|
|
21670
|
-
var winCriteria$
|
|
21649
|
+
var winCriteria$8 = {
|
|
21671
21650
|
valueGoal: 23
|
|
21672
21651
|
};
|
|
21673
|
-
var tieFormatName$
|
|
21674
|
-
var collectionDefinitions$
|
|
21652
|
+
var tieFormatName$8 = "USTA_OZAKI_CUP";
|
|
21653
|
+
var collectionDefinitions$8 = [
|
|
21675
21654
|
{
|
|
21676
21655
|
category: {
|
|
21677
21656
|
ageCategoryCode: "18U"
|
|
@@ -21894,12 +21873,12 @@ var collectionDefinitions$7 = [
|
|
|
21894
21873
|
}
|
|
21895
21874
|
];
|
|
21896
21875
|
var USTA_OZAKI_CUP_TIE_FORMAT = {
|
|
21897
|
-
winCriteria: winCriteria$
|
|
21898
|
-
tieFormatName: tieFormatName$
|
|
21899
|
-
collectionDefinitions: collectionDefinitions$
|
|
21876
|
+
winCriteria: winCriteria$8,
|
|
21877
|
+
tieFormatName: tieFormatName$8,
|
|
21878
|
+
collectionDefinitions: collectionDefinitions$8
|
|
21900
21879
|
};
|
|
21901
21880
|
|
|
21902
|
-
var collectionDefinitions$
|
|
21881
|
+
var collectionDefinitions$7 = [
|
|
21903
21882
|
{
|
|
21904
21883
|
collectionName: "Doubles",
|
|
21905
21884
|
matchUpCount: 1,
|
|
@@ -21915,17 +21894,17 @@ var collectionDefinitions$6 = [
|
|
|
21915
21894
|
matchUpValue: 1
|
|
21916
21895
|
}
|
|
21917
21896
|
];
|
|
21918
|
-
var tieFormatName$
|
|
21919
|
-
var winCriteria$
|
|
21897
|
+
var tieFormatName$7 = "DOMINANT_DUO";
|
|
21898
|
+
var winCriteria$7 = {
|
|
21920
21899
|
valueGoal: 2
|
|
21921
21900
|
};
|
|
21922
21901
|
var DOMINANT_DUO_TIE_FORMAT = {
|
|
21923
|
-
collectionDefinitions: collectionDefinitions$
|
|
21924
|
-
tieFormatName: tieFormatName$
|
|
21925
|
-
winCriteria: winCriteria$
|
|
21902
|
+
collectionDefinitions: collectionDefinitions$7,
|
|
21903
|
+
tieFormatName: tieFormatName$7,
|
|
21904
|
+
winCriteria: winCriteria$7
|
|
21926
21905
|
};
|
|
21927
21906
|
|
|
21928
|
-
var collectionDefinitions$
|
|
21907
|
+
var collectionDefinitions$6 = [
|
|
21929
21908
|
{
|
|
21930
21909
|
collectionName: "Doubles",
|
|
21931
21910
|
matchUpCount: 3,
|
|
@@ -21941,17 +21920,17 @@ var collectionDefinitions$5 = [
|
|
|
21941
21920
|
matchUpValue: 1
|
|
21942
21921
|
}
|
|
21943
21922
|
];
|
|
21944
|
-
var tieFormatName$
|
|
21945
|
-
var winCriteria$
|
|
21923
|
+
var tieFormatName$6 = "USTA_COLLEGE";
|
|
21924
|
+
var winCriteria$6 = {
|
|
21946
21925
|
valueGoal: 4
|
|
21947
21926
|
};
|
|
21948
21927
|
var USTA_COLLEGE_TIE_FORMAT = {
|
|
21949
|
-
collectionDefinitions: collectionDefinitions$
|
|
21950
|
-
tieFormatName: tieFormatName$
|
|
21951
|
-
winCriteria: winCriteria$
|
|
21928
|
+
collectionDefinitions: collectionDefinitions$6,
|
|
21929
|
+
tieFormatName: tieFormatName$6,
|
|
21930
|
+
winCriteria: winCriteria$6
|
|
21952
21931
|
};
|
|
21953
21932
|
|
|
21954
|
-
var collectionDefinitions$
|
|
21933
|
+
var collectionDefinitions$5 = [
|
|
21955
21934
|
{
|
|
21956
21935
|
collectionName: "Male Singles",
|
|
21957
21936
|
matchUpCount: 6,
|
|
@@ -21981,17 +21960,17 @@ var collectionDefinitions$4 = [
|
|
|
21981
21960
|
matchUpValue: 1
|
|
21982
21961
|
}
|
|
21983
21962
|
];
|
|
21984
|
-
var tieFormatName$
|
|
21985
|
-
var winCriteria$
|
|
21963
|
+
var tieFormatName$5 = "USTA_LEVEL_1";
|
|
21964
|
+
var winCriteria$5 = {
|
|
21986
21965
|
valueGoal: 10
|
|
21987
21966
|
};
|
|
21988
21967
|
var USTA_LEVEL_1_TIE_FORMAT = {
|
|
21989
|
-
collectionDefinitions: collectionDefinitions$
|
|
21990
|
-
tieFormatName: tieFormatName$
|
|
21991
|
-
winCriteria: winCriteria$
|
|
21968
|
+
collectionDefinitions: collectionDefinitions$5,
|
|
21969
|
+
tieFormatName: tieFormatName$5,
|
|
21970
|
+
winCriteria: winCriteria$5
|
|
21992
21971
|
};
|
|
21993
21972
|
|
|
21994
|
-
var collectionDefinitions$
|
|
21973
|
+
var collectionDefinitions$4 = [
|
|
21995
21974
|
{
|
|
21996
21975
|
collectionName: "Female Doubles",
|
|
21997
21976
|
gender: "FEMALE",
|
|
@@ -22049,11 +22028,63 @@ var collectionDefinitions$3 = [
|
|
|
22049
22028
|
scoreValue: 1
|
|
22050
22029
|
}
|
|
22051
22030
|
];
|
|
22052
|
-
var tieFormatName$
|
|
22053
|
-
var winCriteria$
|
|
22031
|
+
var tieFormatName$4 = "USTA_WTT_ITT";
|
|
22032
|
+
var winCriteria$4 = {
|
|
22054
22033
|
aggregateValue: true
|
|
22055
22034
|
};
|
|
22056
22035
|
var USTA_WTT_ITT_TIE_FORMAT = {
|
|
22036
|
+
collectionDefinitions: collectionDefinitions$4,
|
|
22037
|
+
tieFormatName: tieFormatName$4,
|
|
22038
|
+
winCriteria: winCriteria$4
|
|
22039
|
+
};
|
|
22040
|
+
|
|
22041
|
+
var collectionDefinitions$3 = [
|
|
22042
|
+
{
|
|
22043
|
+
scoreValue: 1,
|
|
22044
|
+
matchUpType: "SINGLES",
|
|
22045
|
+
collectionName: "Men's Singles",
|
|
22046
|
+
matchUpFormat: "SET1-S:T60",
|
|
22047
|
+
gender: "MALE",
|
|
22048
|
+
matchUpCount: 3
|
|
22049
|
+
},
|
|
22050
|
+
{
|
|
22051
|
+
scoreValue: 1,
|
|
22052
|
+
matchUpType: "SINGLES",
|
|
22053
|
+
collectionName: "Women's Singles",
|
|
22054
|
+
matchUpFormat: "SET1-S:T60",
|
|
22055
|
+
gender: "FEMALE",
|
|
22056
|
+
matchUpCount: 3
|
|
22057
|
+
},
|
|
22058
|
+
{
|
|
22059
|
+
scoreValue: 1,
|
|
22060
|
+
matchUpType: "DOUBLES",
|
|
22061
|
+
collectionName: "Men's Doubles",
|
|
22062
|
+
matchUpFormat: "SET1-S:T60",
|
|
22063
|
+
gender: "MALE",
|
|
22064
|
+
matchUpCount: 1
|
|
22065
|
+
},
|
|
22066
|
+
{
|
|
22067
|
+
matchUpValue: 1,
|
|
22068
|
+
matchUpType: "DOUBLES",
|
|
22069
|
+
collectionName: "Women's Doubles",
|
|
22070
|
+
matchUpFormat: "SET1-S:T60",
|
|
22071
|
+
gender: "FEMALE",
|
|
22072
|
+
matchUpCount: 1
|
|
22073
|
+
},
|
|
22074
|
+
{
|
|
22075
|
+
matchUpValue: 1,
|
|
22076
|
+
matchUpType: "DOUBLES",
|
|
22077
|
+
collectionName: "Mixed Doubles",
|
|
22078
|
+
matchUpFormat: "SET1-S:T60",
|
|
22079
|
+
gender: "MIXED",
|
|
22080
|
+
matchUpCount: 1
|
|
22081
|
+
}
|
|
22082
|
+
];
|
|
22083
|
+
var tieFormatName$3 = "Time Tennis";
|
|
22084
|
+
var winCriteria$3 = {
|
|
22085
|
+
aggregateValue: true
|
|
22086
|
+
};
|
|
22087
|
+
var TIME_TENNIS_TIE_FORMAT = {
|
|
22057
22088
|
collectionDefinitions: collectionDefinitions$3,
|
|
22058
22089
|
tieFormatName: tieFormatName$3,
|
|
22059
22090
|
winCriteria: winCriteria$3
|
|
@@ -22247,6 +22278,7 @@ const DOMINANT_DUO = "DOMINANT_DUO";
|
|
|
22247
22278
|
const DOMINANT_DUO_MIXED = "DOMINANT_DUO_MIXED";
|
|
22248
22279
|
const LAVER_CUP = "LAVER_CUP";
|
|
22249
22280
|
const TEAM_DOUBLES_3_AGGREGATION = "TEAM_DOUBLES_3_AGGREGATION";
|
|
22281
|
+
const TIME_TENNIS = "TIME_TENNIS";
|
|
22250
22282
|
const USTA_BREWER_CUP = "USTA_BREWER_CUP";
|
|
22251
22283
|
const USTA_OZAKI_CUP = "USTA_OZAKI_CUP";
|
|
22252
22284
|
const USTA_COLLEGE = "USTA_COLLEGE";
|
|
@@ -22316,6 +22348,7 @@ const namedFormats = {
|
|
|
22316
22348
|
[DOMINANT_DUO]: DOMINANT_DUO_TIE_FORMAT,
|
|
22317
22349
|
[DOMINANT_DUO_MIXED]: DOMINANT_DUO_MIXED_TIE_FORMAT,
|
|
22318
22350
|
[TEAM_DOUBLES_3_AGGREGATION]: TEAM_AGGREGATION_TIE_FORMAT,
|
|
22351
|
+
[TIME_TENNIS]: TIME_TENNIS_TIE_FORMAT,
|
|
22319
22352
|
[USTA_BREWER_CUP]: USTA_BREWER_CUP_TIE_FORMAT,
|
|
22320
22353
|
[USTA_OZAKI_CUP]: USTA_OZAKI_CUP_TIE_FORMAT,
|
|
22321
22354
|
[USTA_COLLEGE]: USTA_COLLEGE_TIE_FORMAT,
|
|
@@ -22574,6 +22607,7 @@ function getScaledEntries({
|
|
|
22574
22607
|
}
|
|
22575
22608
|
|
|
22576
22609
|
function prepareStage(params) {
|
|
22610
|
+
const stack = "prepareStage";
|
|
22577
22611
|
let { seedsCount } = params;
|
|
22578
22612
|
const preparedStructureIds = params.preparedStructureIds || [];
|
|
22579
22613
|
const {
|
|
@@ -22629,7 +22663,7 @@ function prepareStage(params) {
|
|
|
22629
22663
|
({ structureId: structureId2 }) => !preparedStructureIds.includes(structureId2)
|
|
22630
22664
|
);
|
|
22631
22665
|
if (!structure)
|
|
22632
|
-
return decorateResult({ result: { error: STRUCTURE_NOT_FOUND } });
|
|
22666
|
+
return decorateResult({ result: { error: STRUCTURE_NOT_FOUND }, stack });
|
|
22633
22667
|
const structureId = structure?.structureId;
|
|
22634
22668
|
const seedBlockInfo = structure ? getValidSeedBlocks({
|
|
22635
22669
|
provisionalPositioning,
|
|
@@ -22752,7 +22786,7 @@ function prepareStage(params) {
|
|
|
22752
22786
|
positionAssignments = result?.positionAssignments;
|
|
22753
22787
|
positioningReport = result?.positioningReport;
|
|
22754
22788
|
if (result.error) {
|
|
22755
|
-
return decorateResult({ result, stack
|
|
22789
|
+
return decorateResult({ result, stack });
|
|
22756
22790
|
}
|
|
22757
22791
|
}
|
|
22758
22792
|
return {
|
|
@@ -23035,10 +23069,8 @@ function generateDrawDefinition(params) {
|
|
|
23035
23069
|
if (policyDefinitions) {
|
|
23036
23070
|
if (typeof policyDefinitions !== "object") {
|
|
23037
23071
|
return decorateResult({
|
|
23038
|
-
|
|
23039
|
-
|
|
23040
|
-
error: INVALID_VALUES
|
|
23041
|
-
},
|
|
23072
|
+
info: "policyDefinitions must be an object",
|
|
23073
|
+
result: { error: INVALID_VALUES },
|
|
23042
23074
|
stack
|
|
23043
23075
|
});
|
|
23044
23076
|
} else {
|
|
@@ -23267,8 +23299,9 @@ function generateDrawDefinition(params) {
|
|
|
23267
23299
|
for (const roundTargetProfile of params.qualifyingProfiles) {
|
|
23268
23300
|
if (!Array.isArray(roundTargetProfile.structureProfiles))
|
|
23269
23301
|
return decorateResult({
|
|
23302
|
+
info: mustBeAnArray("structureProfiles"),
|
|
23270
23303
|
result: { error: MISSING_VALUE },
|
|
23271
|
-
|
|
23304
|
+
stack
|
|
23272
23305
|
});
|
|
23273
23306
|
roundTarget = roundTargetProfile.roundTarget || roundTarget;
|
|
23274
23307
|
const sortedStructureProfiles = roundTargetProfile.structureProfiles?.sort(sequenceSort) || [];
|