tods-competition-factory 1.8.35 → 1.8.36

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.
@@ -2929,7 +2929,7 @@ var matchUpFormatCode = {
2929
2929
  };
2930
2930
 
2931
2931
  function factoryVersion() {
2932
- return '1.8.35';
2932
+ return '1.8.36';
2933
2933
  }
2934
2934
 
2935
2935
  function getObjectTieFormat(obj) {
@@ -29707,14 +29707,10 @@ function getParticipantEntries(params) {
29707
29707
  var getRelevantParticipantIds = function (participantId) {
29708
29708
  var _a, _b;
29709
29709
  var relevantParticipantIds = [participantId];
29710
- relevantParticipantIds.push(participantId);
29711
29710
  (_b = (_a = participantMap[participantId]) === null || _a === void 0 ? void 0 : _a.participant.individualParticipantIds) === null || _b === void 0 ? void 0 : _b.forEach(function (individualParticiapntId) {
29712
29711
  return relevantParticipantIds.push(individualParticiapntId);
29713
29712
  });
29714
- return relevantParticipantIds.some(function (obj) {
29715
- return !(targetParticipantIds === null || targetParticipantIds === void 0 ? void 0 : targetParticipantIds.length) ||
29716
- targetParticipantIds.includes(obj.relevantParticipantId);
29717
- })
29713
+ return relevantParticipantIds.some(function (id) { return !(targetParticipantIds === null || targetParticipantIds === void 0 ? void 0 : targetParticipantIds.length) || targetParticipantIds.includes(id); })
29718
29714
  ? relevantParticipantIds
29719
29715
  : [];
29720
29716
  };
@@ -45226,6 +45222,7 @@ function generatePositioningCandidate(params) {
45226
45222
  };
45227
45223
  }
45228
45224
  function swapAssignedPositions(_a) {
45225
+ var _b;
45229
45226
  var candidatePositionAssignments = _a.candidatePositionAssignments, swapOptions = _a.swapOptions;
45230
45227
  var swapOption = randomPop(swapOptions);
45231
45228
  if (!swapOption)
@@ -45233,11 +45230,11 @@ function swapAssignedPositions(_a) {
45233
45230
  var firstPosition = swapOption.drawPosition;
45234
45231
  var secondPosition = randomPop(swapOption.possibleDrawPositions);
45235
45232
  var firstAssignment = candidatePositionAssignments.find(function (assignment) { return assignment.drawPosition === firstPosition; });
45236
- var secondAssignment = candidatePositionAssignments.find(function (assignment) { return assignment.drawPosition === secondPosition; });
45233
+ var secondAssignment = (_b = candidatePositionAssignments.find(function (assignment) { return assignment.drawPosition === secondPosition; })) !== null && _b !== void 0 ? _b : {};
45237
45234
  var updatedFirstAssignmentAttributes = {
45238
- participantId: secondAssignment.participantId,
45239
- qualifier: secondAssignment.qualifier,
45240
- bye: secondAssignment.bye,
45235
+ participantId: secondAssignment === null || secondAssignment === void 0 ? void 0 : secondAssignment.participantId,
45236
+ qualifier: secondAssignment === null || secondAssignment === void 0 ? void 0 : secondAssignment.qualifier,
45237
+ bye: secondAssignment === null || secondAssignment === void 0 ? void 0 : secondAssignment.bye,
45241
45238
  };
45242
45239
  var updatedSecondAssignmentAttributes = {
45243
45240
  participantId: firstAssignment.participantId,
@@ -45383,7 +45380,7 @@ function randomUnseededSeparation(_a) {
45383
45380
  if (result.error)
45384
45381
  return decorateResult({ result: result, stack: stack });
45385
45382
  }
45386
- else {
45383
+ else if (assignment.participantId) {
45387
45384
  var result = assignDrawPosition$1(__assign({ automaticPlacement: true, inContextDrawMatchUps: inContextDrawMatchUps, tournamentRecord: tournamentRecord, drawDefinition: drawDefinition, seedBlockInfo: seedBlockInfo, structureId: structureId, matchUpsMap: matchUpsMap, event: event }, assignment));
45388
45385
  if (result.error) {
45389
45386
  return decorateResult({ result: result, stack: stack, context: { assignment: assignment } });
@@ -48135,7 +48132,9 @@ function removeStructure(_a) {
48135
48132
  return link.source.structureId !== idBeingRemoved &&
48136
48133
  link.target.structureId !== idBeingRemoved;
48137
48134
  })) || [];
48138
- if (!isMainStageSequence1 || idBeingRemoved !== structureId) {
48135
+ if (!isMainStageSequence1 ||
48136
+ (isMainStageSequence1 && qualifyingStructureIds.length) ||
48137
+ idBeingRemoved !== structureId) {
48139
48138
  drawDefinition.structures = ((_c = drawDefinition.structures) !== null && _c !== void 0 ? _c : []).filter(function (structure) {
48140
48139
  if (idBeingRemoved && idBeingRemoved === structure.structureId)
48141
48140
  removedStructureIds.push(idBeingRemoved);