tods-competition-factory 2.0.0-alpha.0 → 2.0.0-alpha.1

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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function factoryVersion() {
6
- return '2.0.0-alpha.0';
6
+ return '2.0.0-alpha.1';
7
7
  }
8
8
 
9
9
  /******************************************************************************
@@ -1651,6 +1651,67 @@ function getDevContext(contextCriteria) {
1651
1651
  return (Object.keys(contextCriteria).every(function (key) { var _a; return ((_a = globalState.devContext) === null || _a === void 0 ? void 0 : _a[key]) === contextCriteria[key]; }) && globalState.devContext);
1652
1652
  }
1653
1653
  }
1654
+ function timeKeeper(action, timer) {
1655
+ var _a, _b, _c, _d;
1656
+ if (action === void 0) { action = 'reset'; }
1657
+ if (timer === void 0) { timer = 'default'; }
1658
+ var timeNow = Date.now();
1659
+ if (action === 'report') {
1660
+ if (timer === 'allTimers') {
1661
+ var timers = Object.keys(globalState.timers);
1662
+ return timers
1663
+ .filter(function (timer) { return timer !== 'default' || globalState.timers[timer].startTime; })
1664
+ .map(function (timer) {
1665
+ var _a;
1666
+ var currentTimer = globalState.timers[timer];
1667
+ var elapsedPeriod = currentTimer.state === 'stopped'
1668
+ ? 0
1669
+ : (timeNow - ((_a = currentTimer === null || currentTimer === void 0 ? void 0 : currentTimer.startTime) !== null && _a !== void 0 ? _a : 0)) / 1000;
1670
+ var elapsedTime = currentTimer.elapsedTime + elapsedPeriod;
1671
+ return {
1672
+ state: globalState.timers[timer].state,
1673
+ elapsedTime: elapsedTime.toFixed(2),
1674
+ timer: timer,
1675
+ };
1676
+ });
1677
+ }
1678
+ else {
1679
+ var elapsedPeriod = globalState.timers[timer].state === 'stopped'
1680
+ ? 0
1681
+ : (timeNow - ((_b = (_a = globalState.timers[timer]) === null || _a === void 0 ? void 0 : _a.startTime) !== null && _b !== void 0 ? _b : 0)) / 1000;
1682
+ var elapsedTime = globalState.timers[timer].elapsedTime + elapsedPeriod;
1683
+ return {
1684
+ state: globalState.timers[timer].state,
1685
+ elapsedTime: elapsedTime.toFixed(2),
1686
+ timer: timer,
1687
+ };
1688
+ }
1689
+ }
1690
+ if (!globalState.timers[timer] || action === 'reset') {
1691
+ if (timer === 'allTimers') {
1692
+ globalState.timers = { default: { elapsedTime: 0 } };
1693
+ return true;
1694
+ }
1695
+ else {
1696
+ globalState.timers[timer] = {
1697
+ startTime: timeNow,
1698
+ state: 'active',
1699
+ elapsedTime: 0,
1700
+ };
1701
+ }
1702
+ }
1703
+ if (!globalState.timers[timer].elapsedTime)
1704
+ globalState.timers[timer].elapsedTime = 0;
1705
+ action === 'stop' &&
1706
+ globalState.timers[timer].state !== 'stopped' &&
1707
+ (globalState.timers[timer].state = 'stopped') &&
1708
+ (globalState.timers[timer].elapsedTime +=
1709
+ (timeNow - ((_d = (_c = globalState.timers[timer]) === null || _c === void 0 ? void 0 : _c.startTime) !== null && _d !== void 0 ? _d : 0)) / 1000);
1710
+ action === 'start' &&
1711
+ (globalState.timers[timer].startTime = timeNow) &&
1712
+ (globalState.timers[timer].state = 'active');
1713
+ return globalState.timers[timer];
1714
+ }
1654
1715
  function setGlobalLog(loggingFx) {
1655
1716
  if (typeof loggingFx === 'function') {
1656
1717
  globalState.globalLog = loggingFx;
@@ -1781,6 +1842,40 @@ function globalLog$1(engine, log) {
1781
1842
  }
1782
1843
  }
1783
1844
 
1845
+ var globalState$1 = {
1846
+ __proto__: null,
1847
+ addNotice: addNotice,
1848
+ callListener: callListener,
1849
+ createInstanceState: createInstanceState,
1850
+ cycleMutationStatus: cycleMutationStatus,
1851
+ deepCopyEnabled: deepCopyEnabled,
1852
+ deleteNotice: deleteNotice,
1853
+ deleteNotices: deleteNotices,
1854
+ disableNotifications: disableNotifications,
1855
+ enableNotifications: enableNotifications,
1856
+ getDevContext: getDevContext,
1857
+ getMethods: getMethods,
1858
+ getNotices: getNotices,
1859
+ getProvider: getProvider,
1860
+ getTopics: getTopics,
1861
+ getTournamentId: getTournamentId,
1862
+ getTournamentRecord: getTournamentRecord,
1863
+ getTournamentRecords: getTournamentRecords,
1864
+ globalLog: globalLog$1,
1865
+ handleCaughtError: handleCaughtError,
1866
+ removeTournamentRecord: removeTournamentRecord,
1867
+ setDeepCopy: setDeepCopy,
1868
+ setDevContext: setDevContext,
1869
+ setGlobalLog: setGlobalLog,
1870
+ setMethods: setMethods,
1871
+ setStateProvider: setStateProvider,
1872
+ setSubscriptions: setSubscriptions,
1873
+ setTournamentId: setTournamentId,
1874
+ setTournamentRecord: setTournamentRecord$1,
1875
+ setTournamentRecords: setTournamentRecords,
1876
+ timeKeeper: timeKeeper
1877
+ };
1878
+
1784
1879
  function getDefinedKeys(obj, ignoreValues, ignoreEmptyArrays) {
1785
1880
  return Object.keys(obj).filter(function (key) {
1786
1881
  return !ignoreValues.includes(obj[key]) &&
@@ -13156,31 +13251,135 @@ function getDrawPublishStatus(_a) {
13156
13251
  return details === null || details === void 0 ? void 0 : details.published;
13157
13252
  }
13158
13253
 
13159
- function getEventPublishStatuses(_a) {
13254
+ function getPublishState(_a) {
13255
+ var e_1, _b, e_2, _c, e_3, _d, e_4, _e;
13256
+ var tournamentRecord = _a.tournamentRecord, eventIds = _a.eventIds, drawIds = _a.drawIds, drawId = _a.drawId, event = _a.event;
13257
+ if (Array.isArray(eventIds) && (eventIds === null || eventIds === void 0 ? void 0 : eventIds.length)) {
13258
+ var publishState = {};
13259
+ try {
13260
+ for (var eventIds_1 = __values(eventIds), eventIds_1_1 = eventIds_1.next(); !eventIds_1_1.done; eventIds_1_1 = eventIds_1.next()) {
13261
+ var eventId = eventIds_1_1.value;
13262
+ if (!isString(eventId))
13263
+ return { error: INVALID_VALUES };
13264
+ var event_1 = findEvent({ tournamentRecord: tournamentRecord, eventId: eventId });
13265
+ if (!event_1)
13266
+ return { error: EVENT_NOT_FOUND };
13267
+ var pubStatus = getPubStatus({ event: event_1 });
13268
+ if (pubStatus.error)
13269
+ return pubStatus;
13270
+ publishState[eventId] = pubStatus;
13271
+ }
13272
+ }
13273
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
13274
+ finally {
13275
+ try {
13276
+ if (eventIds_1_1 && !eventIds_1_1.done && (_b = eventIds_1.return)) _b.call(eventIds_1);
13277
+ }
13278
+ finally { if (e_1) throw e_1.error; }
13279
+ }
13280
+ return __assign(__assign({}, SUCCESS), { publishState: publishState });
13281
+ }
13282
+ else if (!event &&
13283
+ (tournamentRecord === null || tournamentRecord === void 0 ? void 0 : tournamentRecord.events) &&
13284
+ Array.isArray(drawIds) &&
13285
+ drawIds.length) {
13286
+ var publishState = {};
13287
+ try {
13288
+ for (var _f = __values(tournamentRecord.events), _g = _f.next(); !_g.done; _g = _f.next()) {
13289
+ var event_2 = _g.value;
13290
+ var pubStatus = getPubStatus({ event: event_2 });
13291
+ if (pubStatus.error)
13292
+ return pubStatus;
13293
+ try {
13294
+ for (var drawIds_1 = (e_3 = void 0, __values(drawIds)), drawIds_1_1 = drawIds_1.next(); !drawIds_1_1.done; drawIds_1_1 = drawIds_1.next()) {
13295
+ var drawId_1 = drawIds_1_1.value;
13296
+ if (!isString(drawId_1))
13297
+ return { error: INVALID_VALUES };
13298
+ var published = pubStatus.publishState.publishedDrawIds.includes(drawId_1);
13299
+ if (published)
13300
+ publishState[drawId_1] = { published: published };
13301
+ }
13302
+ }
13303
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
13304
+ finally {
13305
+ try {
13306
+ if (drawIds_1_1 && !drawIds_1_1.done && (_d = drawIds_1.return)) _d.call(drawIds_1);
13307
+ }
13308
+ finally { if (e_3) throw e_3.error; }
13309
+ }
13310
+ }
13311
+ }
13312
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
13313
+ finally {
13314
+ try {
13315
+ if (_g && !_g.done && (_c = _f.return)) _c.call(_f);
13316
+ }
13317
+ finally { if (e_2) throw e_2.error; }
13318
+ }
13319
+ return __assign(__assign({}, SUCCESS), { publishState: publishState });
13320
+ }
13321
+ else if (event) {
13322
+ var pubStatus = getPubStatus({ event: event });
13323
+ if (pubStatus.error)
13324
+ return pubStatus;
13325
+ if (drawId) {
13326
+ return {
13327
+ publishState: __assign({ published: pubStatus.publishState.publishedDrawIds.includes(drawId) }, SUCCESS),
13328
+ };
13329
+ }
13330
+ else if (Array.isArray(drawIds) && (drawIds === null || drawIds === void 0 ? void 0 : drawIds.length)) {
13331
+ var publishState = {};
13332
+ try {
13333
+ for (var drawIds_2 = __values(drawIds), drawIds_2_1 = drawIds_2.next(); !drawIds_2_1.done; drawIds_2_1 = drawIds_2.next()) {
13334
+ var drawId_2 = drawIds_2_1.value;
13335
+ if (!isString(drawId_2))
13336
+ return { error: INVALID_VALUES };
13337
+ publishState[drawId_2] = {
13338
+ published: pubStatus.publishState.publishedDrawIds.includes(drawId_2),
13339
+ };
13340
+ return __assign(__assign({}, SUCCESS), { publishState: publishState });
13341
+ }
13342
+ }
13343
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
13344
+ finally {
13345
+ try {
13346
+ if (drawIds_2_1 && !drawIds_2_1.done && (_e = drawIds_2.return)) _e.call(drawIds_2);
13347
+ }
13348
+ finally { if (e_4) throw e_4.error; }
13349
+ }
13350
+ }
13351
+ else {
13352
+ return pubStatus;
13353
+ }
13354
+ }
13355
+ return { error: INVALID_VALUES };
13356
+ }
13357
+ function getPubStatus(_a) {
13160
13358
  var event = _a.event;
13161
13359
  var eventPubStatus = getEventPublishStatus({ event: event });
13162
- if (eventPubStatus) {
13163
- var publishedSeeding = {
13164
- published: undefined, // seeding can be present for all entries in an event when no flights have been defined
13165
- seedingScaleNames: [],
13166
- drawIds: [], // seeding can be specific to drawIds
13167
- };
13168
- if (eventPubStatus.seeding) {
13169
- Object.assign(publishedSeeding, eventPubStatus.seeding);
13170
- }
13171
- var drawDetails_1 = eventPubStatus.drawDetails, drawIds = eventPubStatus.drawIds;
13172
- var publishedDrawIds = (drawDetails_1 &&
13173
- Object.keys(drawDetails_1).filter(function (drawId) {
13174
- return getDrawPublishStatus({ drawDetails: drawDetails_1, drawId: drawId });
13175
- })) ||
13176
- drawIds ||
13177
- [];
13178
- return {
13360
+ if (!eventPubStatus)
13361
+ return { error: EVENT_NOT_FOUND };
13362
+ var publishedSeeding = {
13363
+ published: undefined, // seeding can be present for all entries in an event when no flights have been defined
13364
+ seedingScaleNames: [],
13365
+ drawIds: [], // seeding can be specific to drawIds
13366
+ };
13367
+ if (eventPubStatus.seeding) {
13368
+ Object.assign(publishedSeeding, eventPubStatus.seeding);
13369
+ }
13370
+ var drawDetails = eventPubStatus.drawDetails;
13371
+ var publishedDrawIds = (drawDetails &&
13372
+ Object.keys(drawDetails).filter(function (drawId) {
13373
+ return getDrawPublishStatus({ drawDetails: drawDetails, drawId: drawId });
13374
+ })) ||
13375
+ eventPubStatus.drawIds ||
13376
+ [];
13377
+ return __assign({ publishState: {
13378
+ published: publishedDrawIds.length > 0,
13179
13379
  publishedDrawIds: publishedDrawIds,
13180
13380
  publishedSeeding: publishedSeeding,
13181
- };
13182
- }
13183
- return undefined;
13381
+ drawDetails: drawDetails,
13382
+ } }, SUCCESS);
13184
13383
  }
13185
13384
 
13186
13385
  function processEventEntry(_a) {
@@ -13544,10 +13743,10 @@ function getParticipantEntries(params) {
13544
13743
  var _r = event_1.drawDefinitions, drawDefinitions = _r === void 0 ? [] : _r, _s = event_1.extensions, extensions = _s === void 0 ? [] : _s, eventType = event_1.eventType, eventName = event_1.eventName, category = event_1.category, entries = event_1.entries, eventId = event_1.eventId, gender = event_1.gender;
13545
13744
  var flightProfile = getFlightProfile({ event: event_1 }).flightProfile;
13546
13745
  var flights = (_c = flightProfile === null || flightProfile === void 0 ? void 0 : flightProfile.flights) !== null && _c !== void 0 ? _c : [];
13547
- var publishStatuses = getEventPublishStatuses({ event: event_1 });
13548
- var publishedSeeding = publishStatuses === null || publishStatuses === void 0 ? void 0 : publishStatuses.publishedSeeding;
13746
+ var publishStatuses = getPublishState({ event: event_1 }).publishState;
13549
13747
  if (publishStatuses)
13550
13748
  eventsPublishStatuses[eventId] = publishStatuses;
13749
+ var publishedSeeding = publishStatuses === null || publishStatuses === void 0 ? void 0 : publishStatuses.publishedSeeding;
13551
13750
  if (withEvents || withSeeding || withRankingProfile) {
13552
13751
  var extensionConversions = convertExtensions
13553
13752
  ? Object.assign.apply(Object, __spreadArray([{}], __read(extensionsToAttributes(extensions)), false)) : {};
@@ -16854,6 +17053,7 @@ function getEventData(params) {
16854
17053
  var eventId = event.eventId;
16855
17054
  var tournamentId = tournamentRecord.tournamentId, endDate = tournamentRecord.endDate;
16856
17055
  var publishStatus = getEventPublishStatus({ event: event, status: status });
17056
+ var publishState = getPublishState({ event: event }).publishState;
16857
17057
  var tournamentParticipants = getParticipants(__assign(__assign({ withGroupings: true, withEvents: false, withDraws: false }, participantsProfile), { // order is important!!
16858
17058
  tournamentRecord: tournamentRecord })).participants;
16859
17059
  var stageFilter = function (_a) {
@@ -16988,6 +17188,7 @@ function getEventData(params) {
16988
17188
  eventInfo: eventInfo,
16989
17189
  drawsData: drawsData,
16990
17190
  };
17191
+ eventData.eventInfo.publishState = publishState;
16991
17192
  eventData.eventInfo.publish = publishStatus;
16992
17193
  return __assign(__assign({}, SUCCESS), { eventData: eventData });
16993
17194
  }
@@ -17020,7 +17221,13 @@ function publishEvent(params) {
17020
17221
  });
17021
17222
  }
17022
17223
  var pubStatus = getEventPublishStatus({ event: event, status: status });
17023
- var drawDetails = (pubStatus === null || pubStatus === void 0 ? void 0 : pubStatus.drawDetails) || {};
17224
+ // filter out any drawIds that do not have corresponding drawDefinitions not in the event
17225
+ var drawDetails = Object.keys((pubStatus === null || pubStatus === void 0 ? void 0 : pubStatus.drawDetails) || {})
17226
+ .filter(function (drawId) { return eventDrawIds.includes(drawId); })
17227
+ .reduce(function (details, drawId) {
17228
+ details[drawId] = pubStatus.drawDetails[drawId];
17229
+ return details;
17230
+ }, {});
17024
17231
  var _loop_1 = function (drawId) {
17025
17232
  var e_2, _r, e_3, _s, e_4, _t, e_5, _u, e_6, _v;
17026
17233
  if (!drawIdsToValidate.length || drawIdsToValidate.includes(drawId)) {
@@ -21670,8 +21877,8 @@ function categoryCanContain(_a) {
21670
21877
  categoryDetails.ageMinDate &&
21671
21878
  new Date(childCategoryDetails.ageMaxDate) <
21672
21879
  new Date(categoryDetails.ageMinDate);
21673
- var ratingComparison = category.ratingType &&
21674
- childCategory.ratingType &&
21880
+ var ratingComparison = (category === null || category === void 0 ? void 0 : category.ratingType) &&
21881
+ (childCategory === null || childCategory === void 0 ? void 0 : childCategory.ratingType) &&
21675
21882
  category.ratingType === childCategory.ratingType;
21676
21883
  var invalidRatingRange = ratingComparison &&
21677
21884
  ((category.ratingMin &&
@@ -21686,8 +21893,8 @@ function categoryCanContain(_a) {
21686
21893
  (category.ratingMax &&
21687
21894
  childCategory.ratingMin &&
21688
21895
  childCategory.ratingMin > category.ratingMax));
21689
- var invalidBallType = category.ballType &&
21690
- childCategory.ballType &&
21896
+ var invalidBallType = (category === null || category === void 0 ? void 0 : category.ballType) &&
21897
+ (childCategory === null || childCategory === void 0 ? void 0 : childCategory.ballType) &&
21691
21898
  category.ballType !== childCategory.ballType;
21692
21899
  var valid = !invalidRatingRange &&
21693
21900
  !invalidAgeMinDate &&
@@ -40759,6 +40966,14 @@ function deriveQualifyingPositions(_a) {
40759
40966
  return qualifyingPositions;
40760
40967
  }
40761
40968
 
40969
+ function getDrawTypeCoercion(_a) {
40970
+ var _b, _c, _d, _e, _f, _g;
40971
+ var policyDefinitions = _a.policyDefinitions, appliedPolicies = _a.appliedPolicies, drawType = _a.drawType;
40972
+ var policyDefined = (_b = policyDefinitions === null || policyDefinitions === void 0 ? void 0 : policyDefinitions[POLICY_TYPE_DRAWS]) === null || _b === void 0 ? void 0 : _b.drawTypeCoercion;
40973
+ var policyApplied = (_c = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies[POLICY_TYPE_DRAWS]) === null || _c === void 0 ? void 0 : _c.drawTypeCoercion;
40974
+ return ((_g = (_f = (_e = (_d = (typeof policyDefined === 'boolean' ? policyDefined : undefined)) !== null && _d !== void 0 ? _d : (drawType && (policyDefined === null || policyDefined === void 0 ? void 0 : policyDefined[drawType]))) !== null && _e !== void 0 ? _e : (typeof policyApplied === 'boolean' ? policyApplied : undefined)) !== null && _f !== void 0 ? _f : (drawType && (policyApplied === null || policyApplied === void 0 ? void 0 : policyApplied[drawType]))) !== null && _g !== void 0 ? _g : true);
40975
+ }
40976
+
40762
40977
  // first iteration only links to a single playoff structure
40763
40978
  // future iteration should allow structureOptions to specify
40764
40979
  // groups of finishing drawPositions which playoff
@@ -41119,17 +41334,17 @@ function getGenerators(params) {
41119
41334
 
41120
41335
  function generateDrawStructuresAndLinks(params) {
41121
41336
  var e_1, _a, e_2, _b;
41122
- var _c, _d, _e, _f, _g, _h, _j, _k, _l;
41123
- var _m = params || {}, _o = _m.enforceMinimumDrawSize, enforceMinimumDrawSize = _o === void 0 ? true : _o, overwriteExisting = _m.overwriteExisting, appliedPolicies = _m.appliedPolicies, staggeredEntry = _m.staggeredEntry, // optional - specifies main structure FEED_IN for drawTypes CURTIS_CONSOLATION, FEED_IN_CHAMPIONSHIPS, FMLC
41124
- drawDefinition = _m.drawDefinition, tieFormat = _m.tieFormat, drawSize = _m.drawSize, isMock = _m.isMock, uuids = _m.uuids;
41125
- var drawTypeCoercion = (_e = (_c = params.drawTypeCoercion) !== null && _c !== void 0 ? _c : (_d = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies[POLICY_TYPE_DRAWS]) === null || _d === void 0 ? void 0 : _d.drawTypeCoercion) !== null && _e !== void 0 ? _e : true;
41337
+ var _c, _d, _e, _f, _g, _h, _j;
41338
+ var _k = params || {}, _l = _k.enforceMinimumDrawSize, enforceMinimumDrawSize = _l === void 0 ? true : _l, overwriteExisting = _k.overwriteExisting, appliedPolicies = _k.appliedPolicies, staggeredEntry = _k.staggeredEntry, // optional - specifies main structure FEED_IN for drawTypes CURTIS_CONSOLATION, FEED_IN_CHAMPIONSHIPS, FMLC
41339
+ drawDefinition = _k.drawDefinition, tieFormat = _k.tieFormat, drawSize = _k.drawSize, isMock = _k.isMock, uuids = _k.uuids;
41340
+ var drawTypeCoercion = (_c = params.drawTypeCoercion) !== null && _c !== void 0 ? _c : getDrawTypeCoercion({ appliedPolicies: appliedPolicies, drawType: params.drawType });
41126
41341
  var stack = 'generateDrawStructuresAndLinks';
41127
41342
  var drawType = (drawTypeCoercion && params.drawSize === 2 && SINGLE_ELIMINATION) ||
41128
41343
  params.drawType ||
41129
41344
  SINGLE_ELIMINATION;
41130
41345
  var structures = [], links = [];
41131
- var matchUpType = (_f = params === null || params === void 0 ? void 0 : params.matchUpType) !== null && _f !== void 0 ? _f : SINGLES;
41132
- var existingQualifyingStructures = (_g = drawDefinition === null || drawDefinition === void 0 ? void 0 : drawDefinition.structures) === null || _g === void 0 ? void 0 : _g.filter(function (_a) {
41346
+ var matchUpType = (_d = params === null || params === void 0 ? void 0 : params.matchUpType) !== null && _d !== void 0 ? _d : SINGLES;
41347
+ var existingQualifyingStructures = (_e = drawDefinition === null || drawDefinition === void 0 ? void 0 : drawDefinition.structures) === null || _e === void 0 ? void 0 : _e.filter(function (_a) {
41133
41348
  var stage = _a.stage;
41134
41349
  return stage === QUALIFYING;
41135
41350
  });
@@ -41140,11 +41355,11 @@ function generateDrawStructuresAndLinks(params) {
41140
41355
  var structureId = _a.structureId;
41141
41356
  return structureId;
41142
41357
  });
41143
- var existingMainStructure = (_h = drawDefinition === null || drawDefinition === void 0 ? void 0 : drawDefinition.structures) === null || _h === void 0 ? void 0 : _h.find(function (_a) {
41358
+ var existingMainStructure = (_f = drawDefinition === null || drawDefinition === void 0 ? void 0 : drawDefinition.structures) === null || _f === void 0 ? void 0 : _f.find(function (_a) {
41144
41359
  var stage = _a.stage, stageSequence = _a.stageSequence;
41145
41360
  return stage === MAIN && stageSequence === 1;
41146
41361
  });
41147
- var existingQualifyingLinks = (_j = drawDefinition === null || drawDefinition === void 0 ? void 0 : drawDefinition.links) === null || _j === void 0 ? void 0 : _j.filter(function (link) {
41362
+ var existingQualifyingLinks = (_g = drawDefinition === null || drawDefinition === void 0 ? void 0 : drawDefinition.links) === null || _g === void 0 ? void 0 : _g.filter(function (link) {
41148
41363
  return link.target.structureId === (existingMainStructure === null || existingMainStructure === void 0 ? void 0 : existingMainStructure.structureId) &&
41149
41364
  (existingQualifyingStructureIds === null || existingQualifyingStructureIds === void 0 ? void 0 : existingQualifyingStructureIds.includes(link.source.structureId));
41150
41365
  });
@@ -41179,7 +41394,7 @@ function generateDrawStructuresAndLinks(params) {
41179
41394
  var structure = existingQualifyingStructures === null || existingQualifyingStructures === void 0 ? void 0 : existingQualifyingStructures.find(function (structure) { return structure.structureId === qualifyingStructureId; });
41180
41395
  return getQualifiersCount(link, structure);
41181
41396
  }).filter(Boolean).reduce(function (a, b) { return a + b; }, 0);
41182
- var mainStructureIsPlaceholder = !!(existingMainStructure && !((_k = existingMainStructure === null || existingMainStructure === void 0 ? void 0 : existingMainStructure.matchUps) === null || _k === void 0 ? void 0 : _k.length));
41397
+ var mainStructureIsPlaceholder = !!(existingMainStructure && !((_h = existingMainStructure === null || existingMainStructure === void 0 ? void 0 : existingMainStructure.matchUps) === null || _h === void 0 ? void 0 : _h.length));
41183
41398
  if ((existingQualifyingStructures === null || existingQualifyingStructures === void 0 ? void 0 : existingQualifyingStructures.length) && !mainStructureIsPlaceholder) {
41184
41399
  return { error: EXISTING_STAGE };
41185
41400
  }
@@ -41196,10 +41411,10 @@ function generateDrawStructuresAndLinks(params) {
41196
41411
  if (qualifyingResult === null || qualifyingResult === void 0 ? void 0 : qualifyingResult.error) {
41197
41412
  return qualifyingResult;
41198
41413
  }
41199
- var _p = qualifyingResult || {
41414
+ var _m = qualifyingResult || {
41200
41415
  qualifyingDrawPositionsCount: existingQualifyingDrawPositionsCount,
41201
41416
  qualifiersCount: existingQualifiersCount,
41202
- }, qualifyingDrawPositionsCount = _p.qualifyingDrawPositionsCount, qualifyingDetails = _p.qualifyingDetails, qualifiersCount = _p.qualifiersCount;
41417
+ }, qualifyingDrawPositionsCount = _m.qualifyingDrawPositionsCount, qualifyingDetails = _m.qualifyingDetails, qualifiersCount = _m.qualifiersCount;
41203
41418
  if (qualifyingDrawPositionsCount) {
41204
41419
  if (qualifyingResult === null || qualifyingResult === void 0 ? void 0 : qualifyingResult.structures) {
41205
41420
  structures.push.apply(structures, __spreadArray([], __read(qualifyingResult.structures), false));
@@ -41245,7 +41460,7 @@ function generateDrawStructuresAndLinks(params) {
41245
41460
  });
41246
41461
  }
41247
41462
  }
41248
- var _q = getGenerators(params), generators = _q.generators, error = _q.error;
41463
+ var _o = getGenerators(params), generators = _o.generators, error = _o.error;
41249
41464
  if (error) {
41250
41465
  return { error: error };
41251
41466
  }
@@ -41301,18 +41516,18 @@ function generateDrawStructuresAndLinks(params) {
41301
41516
  return stage === MAIN && stageSequence === 1;
41302
41517
  });
41303
41518
  try {
41304
- for (var _r = __values(qualifyingDetails || []), _s = _r.next(); !_s.done; _s = _r.next()) {
41305
- var qualifyingDetail = _s.value;
41519
+ for (var _p = __values(qualifyingDetails || []), _q = _p.next(); !_q.done; _q = _p.next()) {
41520
+ var qualifyingDetail = _q.value;
41306
41521
  var qualifyingRoundNumber = qualifyingDetail.finalQualifyingRoundNumber, qualifyingStructureId = qualifyingDetail.finalQualifyingStructureId, targetEntryRound = qualifyingDetail.roundTarget, finishingPositions = qualifyingDetail.finishingPositions, linkType = qualifyingDetail.linkType;
41307
41522
  var link = mainStructure &&
41308
- ((_l = generateQualifyingLink({
41523
+ ((_j = generateQualifyingLink({
41309
41524
  targetStructureId: mainStructure.structureId,
41310
41525
  sourceStructureId: qualifyingStructureId,
41311
41526
  sourceRoundNumber: qualifyingRoundNumber,
41312
41527
  finishingPositions: finishingPositions,
41313
41528
  targetEntryRound: targetEntryRound,
41314
41529
  linkType: linkType,
41315
- })) === null || _l === void 0 ? void 0 : _l.link);
41530
+ })) === null || _j === void 0 ? void 0 : _j.link);
41316
41531
  if (link === null || link === void 0 ? void 0 : link.error)
41317
41532
  return link;
41318
41533
  if (link) {
@@ -41323,7 +41538,7 @@ function generateDrawStructuresAndLinks(params) {
41323
41538
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
41324
41539
  finally {
41325
41540
  try {
41326
- if (_s && !_s.done && (_b = _r.return)) _b.call(_r);
41541
+ if (_q && !_q.done && (_b = _p.return)) _b.call(_p);
41327
41542
  }
41328
41543
  finally { if (e_2) throw e_2.error; }
41329
41544
  }
@@ -41959,21 +42174,25 @@ var POLICY_SEEDING_DEFAULT = (_a$c = {},
41959
42174
 
41960
42175
  function generateDrawDefinition(params) {
41961
42176
  var _a, e_1, _b, e_2, _c, e_3, _d, e_4, _e, _f, e_5, _g, e_6, _h, _j;
41962
- var _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34;
42177
+ var _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30;
41963
42178
  var stack = 'generateDrawDefinition';
41964
- var _35 = params.considerEventEntries, considerEventEntries = _35 === void 0 ? true : _35, // in the absence of drawSize and drawEntries, look to event.entries
42179
+ var _31 = params.considerEventEntries, considerEventEntries = _31 === void 0 ? true : _31, // in the absence of drawSize and drawEntries, look to event.entries
41965
42180
  ignoreAllowedDrawTypes = params.ignoreAllowedDrawTypes, voluntaryConsolation = params.voluntaryConsolation, hydrateCollections = params.hydrateCollections, ignoreStageSpace = params.ignoreStageSpace, tournamentRecord = params.tournamentRecord, qualifyingOnly = params.qualifyingOnly, tieFormatName = params.tieFormatName, drawEntries = params.drawEntries, placeByes = params.placeByes, event = params.event;
41966
42181
  var appliedPolicies = (_k = getAppliedPolicies({
41967
42182
  tournamentRecord: tournamentRecord,
41968
42183
  event: event,
41969
42184
  }).appliedPolicies) !== null && _k !== void 0 ? _k : {};
41970
42185
  var policyDefinitions = makeDeepCopy((_l = params.policyDefinitions) !== null && _l !== void 0 ? _l : {}, false, true);
41971
- var drawTypeCoercion = (_r = (_p = (_m = params.drawTypeCoercion) !== null && _m !== void 0 ? _m : (_o = policyDefinitions === null || policyDefinitions === void 0 ? void 0 : policyDefinitions[POLICY_TYPE_DRAWS]) === null || _o === void 0 ? void 0 : _o.drawTypeCoercion) !== null && _p !== void 0 ? _p : (_q = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies[POLICY_TYPE_DRAWS]) === null || _q === void 0 ? void 0 : _q.drawTypeCoercion) !== null && _r !== void 0 ? _r : true;
42186
+ var drawTypeCoercion = (_m = params.drawTypeCoercion) !== null && _m !== void 0 ? _m : getDrawTypeCoercion({
42187
+ drawType: params.drawType,
42188
+ policyDefinitions: policyDefinitions,
42189
+ appliedPolicies: appliedPolicies,
42190
+ });
41972
42191
  var drawType = (drawTypeCoercion && params.drawSize === 2 && SINGLE_ELIMINATION) ||
41973
42192
  params.drawType ||
41974
42193
  SINGLE_ELIMINATION;
41975
- var seedingPolicy = (_s = policyDefinitions === null || policyDefinitions === void 0 ? void 0 : policyDefinitions[POLICY_TYPE_SEEDING]) !== null && _s !== void 0 ? _s : appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies[POLICY_TYPE_SEEDING];
41976
- var seedingProfile = (_w = (_t = params.seedingProfile) !== null && _t !== void 0 ? _t : (_v = (_u = seedingPolicy === null || seedingPolicy === void 0 ? void 0 : seedingPolicy.seedingProfile) === null || _u === void 0 ? void 0 : _u.drawTypes) === null || _v === void 0 ? void 0 : _v[drawType]) !== null && _w !== void 0 ? _w : seedingPolicy === null || seedingPolicy === void 0 ? void 0 : seedingPolicy.seedingProfile;
42194
+ var seedingPolicy = (_o = policyDefinitions === null || policyDefinitions === void 0 ? void 0 : policyDefinitions[POLICY_TYPE_SEEDING]) !== null && _o !== void 0 ? _o : appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies[POLICY_TYPE_SEEDING];
42195
+ var seedingProfile = (_s = (_p = params.seedingProfile) !== null && _p !== void 0 ? _p : (_r = (_q = seedingPolicy === null || seedingPolicy === void 0 ? void 0 : seedingPolicy.seedingProfile) === null || _q === void 0 ? void 0 : _q.drawTypes) === null || _r === void 0 ? void 0 : _r[drawType]) !== null && _s !== void 0 ? _s : seedingPolicy === null || seedingPolicy === void 0 ? void 0 : seedingPolicy.seedingProfile;
41977
42196
  // extend policyDefinitions only if a seedingProfile was specified in params
41978
42197
  if (params.seedingProfile) {
41979
42198
  if (!policyDefinitions[POLICY_TYPE_SEEDING]) {
@@ -41983,29 +42202,29 @@ function generateDrawDefinition(params) {
41983
42202
  }
41984
42203
  // get participants both for entry validation and for automated placement
41985
42204
  // automated placement requires them to be "inContext" for avoidance policies to work
41986
- var _36 = getParticipants({
42205
+ var _32 = getParticipants({
41987
42206
  withIndividualParticipants: true,
41988
42207
  convertExtensions: true,
41989
42208
  internalUse: true,
41990
42209
  tournamentRecord: tournamentRecord,
41991
- }), participants = _36.participants, participantMap = _36.participantMap;
41992
- var enforceGender = (_0 = (_x = params.enforceGender) !== null && _x !== void 0 ? _x : (_z = (_y = policyDefinitions === null || policyDefinitions === void 0 ? void 0 : policyDefinitions[POLICY_TYPE_MATCHUP_ACTIONS]) === null || _y === void 0 ? void 0 : _y.participants) === null || _z === void 0 ? void 0 : _z.enforceGender) !== null && _0 !== void 0 ? _0 : (_2 = (_1 = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies[POLICY_TYPE_MATCHUP_ACTIONS]) === null || _1 === void 0 ? void 0 : _1.participants) === null || _2 === void 0 ? void 0 : _2.enforceGender;
42210
+ }), participants = _32.participants, participantMap = _32.participantMap;
42211
+ var enforceGender = (_w = (_t = params.enforceGender) !== null && _t !== void 0 ? _t : (_v = (_u = policyDefinitions === null || policyDefinitions === void 0 ? void 0 : policyDefinitions[POLICY_TYPE_MATCHUP_ACTIONS]) === null || _u === void 0 ? void 0 : _u.participants) === null || _v === void 0 ? void 0 : _v.enforceGender) !== null && _w !== void 0 ? _w : (_y = (_x = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies[POLICY_TYPE_MATCHUP_ACTIONS]) === null || _x === void 0 ? void 0 : _x.participants) === null || _y === void 0 ? void 0 : _y.enforceGender;
41993
42212
  // if tournamentRecord is provided, and unless instructed to ignore valid types,
41994
42213
  // check for restrictions on allowed drawTypes
41995
42214
  var allowedDrawTypes = !ignoreAllowedDrawTypes &&
41996
42215
  tournamentRecord &&
41997
42216
  getAllowedDrawTypes({
41998
42217
  tournamentRecord: tournamentRecord,
41999
- categoryType: (_3 = event === null || event === void 0 ? void 0 : event.category) === null || _3 === void 0 ? void 0 : _3.categoryType,
42000
- categoryName: (_4 = event === null || event === void 0 ? void 0 : event.category) === null || _4 === void 0 ? void 0 : _4.categoryName,
42218
+ categoryType: (_z = event === null || event === void 0 ? void 0 : event.category) === null || _z === void 0 ? void 0 : _z.categoryType,
42219
+ categoryName: (_0 = event === null || event === void 0 ? void 0 : event.category) === null || _0 === void 0 ? void 0 : _0.categoryName,
42001
42220
  });
42002
42221
  if ((allowedDrawTypes === null || allowedDrawTypes === void 0 ? void 0 : allowedDrawTypes.length) && !allowedDrawTypes.includes(drawType)) {
42003
42222
  return decorateResult({ result: { error: INVALID_DRAW_TYPE }, stack: stack });
42004
42223
  }
42005
- var eventEntries = (_6 = (_5 = event === null || event === void 0 ? void 0 : event.entries) === null || _5 === void 0 ? void 0 : _5.filter(function (entry) {
42224
+ var eventEntries = (_2 = (_1 = event === null || event === void 0 ? void 0 : event.entries) === null || _1 === void 0 ? void 0 : _1.filter(function (entry) {
42006
42225
  return entry.entryStatus &&
42007
42226
  __spreadArray(__spreadArray([], __read(STRUCTURE_SELECTED_STATUSES), false), [QUALIFIER], false).includes(entry.entryStatus);
42008
- })) !== null && _6 !== void 0 ? _6 : [];
42227
+ })) !== null && _2 !== void 0 ? _2 : [];
42009
42228
  var consideredEntries = ((qualifyingOnly && []) ||
42010
42229
  drawEntries ||
42011
42230
  (considerEventEntries ? eventEntries : [])).filter(function (_a) {
@@ -42049,12 +42268,12 @@ function generateDrawDefinition(params) {
42049
42268
  });
42050
42269
  }
42051
42270
  var seedsCount = typeof params.seedsCount !== 'number'
42052
- ? ensureInt((_7 = params.seedsCount) !== null && _7 !== void 0 ? _7 : 0)
42053
- : (_8 = params.seedsCount) !== null && _8 !== void 0 ? _8 : 0;
42271
+ ? ensureInt((_3 = params.seedsCount) !== null && _3 !== void 0 ? _3 : 0)
42272
+ : (_4 = params.seedsCount) !== null && _4 !== void 0 ? _4 : 0;
42054
42273
  var eventType = event === null || event === void 0 ? void 0 : event.eventType;
42055
- var matchUpType = (_9 = params.matchUpType) !== null && _9 !== void 0 ? _9 : eventType;
42274
+ var matchUpType = (_5 = params.matchUpType) !== null && _5 !== void 0 ? _5 : eventType;
42056
42275
  var existingDrawDefinition = params.drawId
42057
- ? (_10 = event === null || event === void 0 ? void 0 : event.drawDefinitions) === null || _10 === void 0 ? void 0 : _10.find(function (d) { return d.drawId === params.drawId; })
42276
+ ? (_6 = event === null || event === void 0 ? void 0 : event.drawDefinitions) === null || _6 === void 0 ? void 0 : _6.find(function (d) { return d.drawId === params.drawId; })
42058
42277
  : undefined;
42059
42278
  // drawDefinition cannot have both tieFormat and matchUpFormat
42060
42279
  var tieFormat = params.tieFormat, matchUpFormat = params.matchUpFormat;
@@ -42062,16 +42281,16 @@ function generateDrawDefinition(params) {
42062
42281
  if (matchUpType === TEAM$1 && eventType === TEAM$1) {
42063
42282
  // if there is an existingDrawDefinition which has a tieFormat on MAIN structure
42064
42283
  // use this tieFormat ONLY when no tieFormat is specified in params
42065
- var existingMainTieFormat = (_12 = (_11 = existingDrawDefinition === null || existingDrawDefinition === void 0 ? void 0 : existingDrawDefinition.structures) === null || _11 === void 0 ? void 0 : _11.find(function (_a) {
42284
+ var existingMainTieFormat = (_8 = (_7 = existingDrawDefinition === null || existingDrawDefinition === void 0 ? void 0 : existingDrawDefinition.structures) === null || _7 === void 0 ? void 0 : _7.find(function (_a) {
42066
42285
  var stage = _a.stage;
42067
42286
  return stage === MAIN;
42068
- })) === null || _12 === void 0 ? void 0 : _12.tieFormat;
42287
+ })) === null || _8 === void 0 ? void 0 : _8.tieFormat;
42069
42288
  tieFormat =
42070
42289
  tieFormat ||
42071
42290
  existingMainTieFormat ||
42072
42291
  // if tieFormatName is provided and it matches the name of the tieFormat attached to parent event...
42073
42292
  (tieFormatName &&
42074
- ((_13 = event === null || event === void 0 ? void 0 : event.tieFormat) === null || _13 === void 0 ? void 0 : _13.tieFormatName) === tieFormatName &&
42293
+ ((_9 = event === null || event === void 0 ? void 0 : event.tieFormat) === null || _9 === void 0 ? void 0 : _9.tieFormatName) === tieFormatName &&
42075
42294
  event.tieFormat) ||
42076
42295
  // if the tieFormatName is not found in the factory then will use default
42077
42296
  (tieFormatName &&
@@ -42127,7 +42346,7 @@ function generateDrawDefinition(params) {
42127
42346
  var result = checkTieFormat({ tieFormat: tieFormat });
42128
42347
  if (result.error)
42129
42348
  return decorateResult({ result: result, stack: stack });
42130
- drawDefinition.tieFormat = (_14 = result.tieFormat) !== null && _14 !== void 0 ? _14 : tieFormat;
42349
+ drawDefinition.tieFormat = (_10 = result.tieFormat) !== null && _10 !== void 0 ? _10 : tieFormat;
42131
42350
  }
42132
42351
  else if (matchUpFormat) {
42133
42352
  var result = setMatchUpMatchUpFormat({
@@ -42165,8 +42384,8 @@ function generateDrawDefinition(params) {
42165
42384
  }
42166
42385
  else {
42167
42386
  try {
42168
- for (var _37 = __values(Object.keys(policyDefinitions)), _38 = _37.next(); !_38.done; _38 = _37.next()) {
42169
- var key = _38.value;
42387
+ for (var _33 = __values(Object.keys(policyDefinitions)), _34 = _33.next(); !_34.done; _34 = _33.next()) {
42388
+ var key = _34.value;
42170
42389
  if (JSON.stringify(appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies[key]) !==
42171
42390
  JSON.stringify(policyDefinitions[key])) {
42172
42391
  policiesToAttach[key] = policyDefinitions[key];
@@ -42176,7 +42395,7 @@ function generateDrawDefinition(params) {
42176
42395
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
42177
42396
  finally {
42178
42397
  try {
42179
- if (_38 && !_38.done && (_b = _37.return)) _b.call(_37);
42398
+ if (_34 && !_34.done && (_b = _33.return)) _b.call(_33);
42180
42399
  }
42181
42400
  finally { if (e_1) throw e_1.error; }
42182
42401
  }
@@ -42203,19 +42422,19 @@ function generateDrawDefinition(params) {
42203
42422
  }
42204
42423
  // ---------------------------------------------------------------------------
42205
42424
  // find existing MAIN structureId if existingDrawDefinition
42206
- var structureId = (_16 = (_15 = existingDrawDefinition === null || existingDrawDefinition === void 0 ? void 0 : existingDrawDefinition.structures) === null || _15 === void 0 ? void 0 : _15.find(function (structure) { return structure.stage === MAIN && structure.stageSequence === 1; })) === null || _16 === void 0 ? void 0 : _16.structureId;
42425
+ var structureId = (_12 = (_11 = existingDrawDefinition === null || existingDrawDefinition === void 0 ? void 0 : existingDrawDefinition.structures) === null || _11 === void 0 ? void 0 : _11.find(function (structure) { return structure.stage === MAIN && structure.stageSequence === 1; })) === null || _12 === void 0 ? void 0 : _12.structureId;
42207
42426
  var entries = drawEntries !== null && drawEntries !== void 0 ? drawEntries : eventEntries;
42208
42427
  var positioningReports = [];
42209
42428
  var drawTypeResult;
42210
42429
  var conflicts = [];
42211
42430
  var generateQualifyingPlaceholder = params.qualifyingPlaceholder &&
42212
- !((_17 = params.qualifyingProfiles) === null || _17 === void 0 ? void 0 : _17.length) &&
42431
+ !((_13 = params.qualifyingProfiles) === null || _13 === void 0 ? void 0 : _13.length) &&
42213
42432
  !existingDrawDefinition;
42214
42433
  var existingQualifyingStructures = existingDrawDefinition
42215
- ? (_18 = existingDrawDefinition.structures) === null || _18 === void 0 ? void 0 : _18.filter(function (structure) { return structure.stage === QUALIFYING; })
42434
+ ? (_14 = existingDrawDefinition.structures) === null || _14 === void 0 ? void 0 : _14.filter(function (structure) { return structure.stage === QUALIFYING; })
42216
42435
  : [];
42217
42436
  var existingQualifyingPlaceholderStructureId = (existingQualifyingStructures === null || existingQualifyingStructures === void 0 ? void 0 : existingQualifyingStructures.length) === 1 &&
42218
- !((_19 = existingQualifyingStructures[0].matchUps) === null || _19 === void 0 ? void 0 : _19.length) &&
42437
+ !((_15 = existingQualifyingStructures[0].matchUps) === null || _15 === void 0 ? void 0 : _15.length) &&
42219
42438
  existingQualifyingStructures[0].structureId;
42220
42439
  if (existingQualifyingPlaceholderStructureId) {
42221
42440
  var qualifyingProfiles = params.qualifyingProfiles;
@@ -42231,24 +42450,24 @@ function generateDrawDefinition(params) {
42231
42450
  if (qualifyingResult === null || qualifyingResult === void 0 ? void 0 : qualifyingResult.error) {
42232
42451
  return qualifyingResult;
42233
42452
  }
42234
- drawDefinition.structures = (_20 = drawDefinition.structures) === null || _20 === void 0 ? void 0 : _20.filter(function (_a) {
42453
+ drawDefinition.structures = (_16 = drawDefinition.structures) === null || _16 === void 0 ? void 0 : _16.filter(function (_a) {
42235
42454
  var structureId = _a.structureId;
42236
42455
  return structureId !== existingQualifyingPlaceholderStructureId;
42237
42456
  });
42238
- drawDefinition.links = (_21 = drawDefinition.links) === null || _21 === void 0 ? void 0 : _21.filter(function (_a) {
42457
+ drawDefinition.links = (_17 = drawDefinition.links) === null || _17 === void 0 ? void 0 : _17.filter(function (_a) {
42239
42458
  var source = _a.source;
42240
42459
  return source.structureId !== existingQualifyingPlaceholderStructureId;
42241
42460
  });
42242
- var _39 = qualifyingResult !== null && qualifyingResult !== void 0 ? qualifyingResult : {}, qualifiersCount = _39.qualifiersCount, qualifyingDrawPositionsCount = _39.qualifyingDrawPositionsCount, qualifyingDetails = _39.qualifyingDetails;
42461
+ var _35 = qualifyingResult !== null && qualifyingResult !== void 0 ? qualifyingResult : {}, qualifiersCount = _35.qualifiersCount, qualifyingDrawPositionsCount = _35.qualifyingDrawPositionsCount, qualifyingDetails = _35.qualifyingDetails;
42243
42462
  if (qualifyingDrawPositionsCount) {
42244
42463
  if (qualifyingResult === null || qualifyingResult === void 0 ? void 0 : qualifyingResult.structures) {
42245
- (_22 = drawDefinition.structures) === null || _22 === void 0 ? void 0 : _22.push.apply(_22, __spreadArray([], __read(qualifyingResult.structures), false));
42464
+ (_18 = drawDefinition.structures) === null || _18 === void 0 ? void 0 : _18.push.apply(_18, __spreadArray([], __read(qualifyingResult.structures), false));
42246
42465
  }
42247
42466
  if (qualifyingResult === null || qualifyingResult === void 0 ? void 0 : qualifyingResult.links) {
42248
- (_23 = drawDefinition.links) === null || _23 === void 0 ? void 0 : _23.push.apply(_23, __spreadArray([], __read(qualifyingResult.links), false));
42467
+ (_19 = drawDefinition.links) === null || _19 === void 0 ? void 0 : _19.push.apply(_19, __spreadArray([], __read(qualifyingResult.links), false));
42249
42468
  }
42250
42469
  }
42251
- var mainStructure = (_24 = drawDefinition.structures) === null || _24 === void 0 ? void 0 : _24.find(function (_a) {
42470
+ var mainStructure = (_20 = drawDefinition.structures) === null || _20 === void 0 ? void 0 : _20.find(function (_a) {
42252
42471
  var stage = _a.stage, stageSequence = _a.stageSequence;
42253
42472
  return stage === MAIN && stageSequence === 1;
42254
42473
  });
@@ -42274,12 +42493,12 @@ function generateDrawDefinition(params) {
42274
42493
  if (result.error)
42275
42494
  return result;
42276
42495
  try {
42277
- for (var _40 = __values((drawEntries !== null && drawEntries !== void 0 ? drawEntries : []).filter(function (_a) {
42496
+ for (var _36 = __values((drawEntries !== null && drawEntries !== void 0 ? drawEntries : []).filter(function (_a) {
42278
42497
  var entryStage = _a.entryStage;
42279
42498
  return entryStage === QUALIFYING;
42280
- })), _41 = _40.next(); !_41.done; _41 = _40.next()) {
42281
- var entry = _41.value;
42282
- var entryData = __assign(__assign({}, entry), { entryStage: (_25 = entry.entryStage) !== null && _25 !== void 0 ? _25 : MAIN, drawDefinition: drawDefinition });
42499
+ })), _37 = _36.next(); !_37.done; _37 = _36.next()) {
42500
+ var entry = _37.value;
42501
+ var entryData = __assign(__assign({}, entry), { entryStage: (_21 = entry.entryStage) !== null && _21 !== void 0 ? _21 : MAIN, drawDefinition: drawDefinition });
42283
42502
  // ignore errors (EXITING_PARTICIPANT)
42284
42503
  addDrawEntry(entryData);
42285
42504
  }
@@ -42287,23 +42506,23 @@ function generateDrawDefinition(params) {
42287
42506
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
42288
42507
  finally {
42289
42508
  try {
42290
- if (_41 && !_41.done && (_c = _40.return)) _c.call(_40);
42509
+ if (_37 && !_37.done && (_c = _36.return)) _c.call(_36);
42291
42510
  }
42292
42511
  finally { if (e_2) throw e_2.error; }
42293
42512
  }
42294
42513
  try {
42295
- for (var _42 = __values(qualifyingDetails || []), _43 = _42.next(); !_43.done; _43 = _42.next()) {
42296
- var qualifyingDetail = _43.value;
42514
+ for (var _38 = __values(qualifyingDetails || []), _39 = _38.next(); !_39.done; _39 = _38.next()) {
42515
+ var qualifyingDetail = _39.value;
42297
42516
  var qualifyingRoundNumber = qualifyingDetail.finalQualifyingRoundNumber, qualifyingStructureId = qualifyingDetail.finalQualifyingStructureId, targetEntryRound = qualifyingDetail.roundTarget, finishingPositions = qualifyingDetail.finishingPositions, linkType = qualifyingDetail.linkType;
42298
42517
  var link = mainStructure &&
42299
- ((_26 = generateQualifyingLink({
42518
+ ((_22 = generateQualifyingLink({
42300
42519
  targetStructureId: mainStructure.structureId,
42301
42520
  sourceStructureId: qualifyingStructureId,
42302
42521
  sourceRoundNumber: qualifyingRoundNumber,
42303
42522
  finishingPositions: finishingPositions,
42304
42523
  targetEntryRound: targetEntryRound,
42305
42524
  linkType: linkType,
42306
- })) === null || _26 === void 0 ? void 0 : _26.link);
42525
+ })) === null || _22 === void 0 ? void 0 : _22.link);
42307
42526
  if (link === null || link === void 0 ? void 0 : link.error)
42308
42527
  return link;
42309
42528
  if (link) {
@@ -42316,7 +42535,7 @@ function generateDrawDefinition(params) {
42316
42535
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
42317
42536
  finally {
42318
42537
  try {
42319
- if (_43 && !_43.done && (_d = _42.return)) _d.call(_42);
42538
+ if (_39 && !_39.done && (_d = _38.return)) _d.call(_38);
42320
42539
  }
42321
42540
  finally { if (e_3) throw e_3.error; }
42322
42541
  }
@@ -42335,7 +42554,7 @@ function generateDrawDefinition(params) {
42335
42554
  // if drawEntries and entryStage !== stage ignore
42336
42555
  if (drawEntries && entry.entryStage && entry.entryStage !== MAIN)
42337
42556
  continue;
42338
- var entryData = __assign(__assign({}, entry), { ignoreStageSpace: ignoreStageSpace !== null && ignoreStageSpace !== void 0 ? ignoreStageSpace : drawType === AD_HOC, entryStage: (_27 = entry.entryStage) !== null && _27 !== void 0 ? _27 : MAIN, drawDefinition: drawDefinition, drawType: drawType });
42557
+ var entryData = __assign(__assign({}, entry), { ignoreStageSpace: ignoreStageSpace !== null && ignoreStageSpace !== void 0 ? ignoreStageSpace : drawType === AD_HOC, entryStage: (_23 = entry.entryStage) !== null && _23 !== void 0 ? _23 : MAIN, drawDefinition: drawDefinition, drawType: drawType });
42339
42558
  var result = addDrawEntry(entryData);
42340
42559
  if (drawEntries && result.error) {
42341
42560
  // only report errors with drawEntries
@@ -42359,13 +42578,13 @@ function generateDrawDefinition(params) {
42359
42578
  if (structureResult.error && !structureResult.conflicts) {
42360
42579
  return structureResult;
42361
42580
  }
42362
- if ((_28 = structureResult.positioningReport) === null || _28 === void 0 ? void 0 : _28.length)
42581
+ if ((_24 = structureResult.positioningReport) === null || _24 === void 0 ? void 0 : _24.length)
42363
42582
  positioningReports.push((_f = {}, _f[MAIN] = structureResult.positioningReport, _f));
42364
42583
  structureId = structureResult.structureId;
42365
42584
  if (structureResult.conflicts)
42366
42585
  conflicts = structureResult.conflicts;
42367
42586
  if (drawType === AD_HOC && params.roundsCount) {
42368
- var entries_2 = (_29 = event === null || event === void 0 ? void 0 : event.entries) === null || _29 === void 0 ? void 0 : _29.filter(function (_a) {
42587
+ var entries_2 = (_25 = event === null || event === void 0 ? void 0 : event.entries) === null || _25 === void 0 ? void 0 : _25.filter(function (_a) {
42369
42588
  var entryStage = _a.entryStage, entryStatus = _a.entryStatus;
42370
42589
  return (!entryStage || entryStage === MAIN) &&
42371
42590
  entryStatus &&
@@ -42420,8 +42639,8 @@ function generateDrawDefinition(params) {
42420
42639
  var roundTarget = 1;
42421
42640
  params.qualifyingProfiles.sort(roundTargetSort);
42422
42641
  try {
42423
- for (var _44 = __values(params.qualifyingProfiles), _45 = _44.next(); !_45.done; _45 = _44.next()) {
42424
- var roundTargetProfile = _45.value;
42642
+ for (var _40 = __values(params.qualifyingProfiles), _41 = _40.next(); !_41.done; _41 = _40.next()) {
42643
+ var roundTargetProfile = _41.value;
42425
42644
  if (!Array.isArray(roundTargetProfile.structureProfiles))
42426
42645
  return decorateResult({
42427
42646
  info: mustBeAnArray('structureProfiles'),
@@ -42429,13 +42648,13 @@ function generateDrawDefinition(params) {
42429
42648
  stack: stack,
42430
42649
  });
42431
42650
  roundTarget = roundTargetProfile.roundTarget || roundTarget;
42432
- var sortedStructureProfiles = ((_30 = roundTargetProfile.structureProfiles) === null || _30 === void 0 ? void 0 : _30.sort(sequenceSort)) || [];
42651
+ var sortedStructureProfiles = ((_26 = roundTargetProfile.structureProfiles) === null || _26 === void 0 ? void 0 : _26.sort(sequenceSort)) || [];
42433
42652
  var sequence = 1;
42434
42653
  try {
42435
42654
  for (var sortedStructureProfiles_1 = (e_6 = void 0, __values(sortedStructureProfiles)), sortedStructureProfiles_1_1 = sortedStructureProfiles_1.next(); !sortedStructureProfiles_1_1.done; sortedStructureProfiles_1_1 = sortedStructureProfiles_1.next()) {
42436
42655
  var structureProfile = sortedStructureProfiles_1_1.value;
42437
- var qualifyingRoundNumber = structureProfile.qualifyingRoundNumber, qualifyingPositions = structureProfile.qualifyingPositions, seededParticipants = structureProfile.seededParticipants, seedingScaleName = structureProfile.seedingScaleName, _46 = structureProfile.seedsCount, seedsCount_1 = _46 === void 0 ? 0 : _46, seedByRanking = structureProfile.seedByRanking, placeByes_1 = structureProfile.placeByes, drawSize_1 = structureProfile.drawSize;
42438
- var qualifyingStageResult = prepareStage(__assign(__assign(__assign({}, drawTypeResult), params), { seedingProfile: (_31 = structureProfile.seedingProfile) !== null && _31 !== void 0 ? _31 : seedingProfile, stageSequence: sequence, qualifyingRoundNumber: qualifyingRoundNumber, preparedStructureIds: preparedStructureIds, qualifyingPositions: qualifyingPositions, seededParticipants: seededParticipants, stage: QUALIFYING, seedingScaleName: seedingScaleName, appliedPolicies: appliedPolicies, drawDefinition: drawDefinition, qualifyingOnly: qualifyingOnly, seedByRanking: seedByRanking, participants: participants, roundTarget: roundTarget, seedsCount: seedsCount_1, placeByes: placeByes_1, drawSize: drawSize_1, entries: entries }));
42656
+ var qualifyingRoundNumber = structureProfile.qualifyingRoundNumber, qualifyingPositions = structureProfile.qualifyingPositions, seededParticipants = structureProfile.seededParticipants, seedingScaleName = structureProfile.seedingScaleName, _42 = structureProfile.seedsCount, seedsCount_1 = _42 === void 0 ? 0 : _42, seedByRanking = structureProfile.seedByRanking, placeByes_1 = structureProfile.placeByes, drawSize_1 = structureProfile.drawSize;
42657
+ var qualifyingStageResult = prepareStage(__assign(__assign(__assign({}, drawTypeResult), params), { seedingProfile: (_27 = structureProfile.seedingProfile) !== null && _27 !== void 0 ? _27 : seedingProfile, stageSequence: sequence, qualifyingRoundNumber: qualifyingRoundNumber, preparedStructureIds: preparedStructureIds, qualifyingPositions: qualifyingPositions, seededParticipants: seededParticipants, stage: QUALIFYING, seedingScaleName: seedingScaleName, appliedPolicies: appliedPolicies, drawDefinition: drawDefinition, qualifyingOnly: qualifyingOnly, seedByRanking: seedByRanking, participants: participants, roundTarget: roundTarget, seedsCount: seedsCount_1, placeByes: placeByes_1, drawSize: drawSize_1, entries: entries }));
42439
42658
  if (qualifyingStageResult.error) {
42440
42659
  return qualifyingStageResult;
42441
42660
  }
@@ -42443,9 +42662,9 @@ function generateDrawDefinition(params) {
42443
42662
  preparedStructureIds.push(qualifyingStageResult.structureId);
42444
42663
  }
42445
42664
  sequence += 1;
42446
- if ((_32 = qualifyingStageResult.conflicts) === null || _32 === void 0 ? void 0 : _32.length)
42665
+ if ((_28 = qualifyingStageResult.conflicts) === null || _28 === void 0 ? void 0 : _28.length)
42447
42666
  qualifyingConflicts.push.apply(qualifyingConflicts, __spreadArray([], __read(qualifyingStageResult.conflicts), false));
42448
- if ((_33 = qualifyingStageResult.positioningReport) === null || _33 === void 0 ? void 0 : _33.length)
42667
+ if ((_29 = qualifyingStageResult.positioningReport) === null || _29 === void 0 ? void 0 : _29.length)
42449
42668
  positioningReports.push((_j = {},
42450
42669
  _j[QUALIFYING] = qualifyingStageResult.positioningReport,
42451
42670
  _j));
@@ -42464,7 +42683,7 @@ function generateDrawDefinition(params) {
42464
42683
  catch (e_5_1) { e_5 = { error: e_5_1 }; }
42465
42684
  finally {
42466
42685
  try {
42467
- if (_45 && !_45.done && (_g = _44.return)) _g.call(_44);
42686
+ if (_41 && !_41.done && (_g = _40.return)) _g.call(_40);
42468
42687
  }
42469
42688
  finally { if (e_5) throw e_5.error; }
42470
42689
  }
@@ -42488,7 +42707,7 @@ function generateDrawDefinition(params) {
42488
42707
  drawDefinition.links.push(link);
42489
42708
  }
42490
42709
  drawDefinition.drawName =
42491
- (_34 = params.drawName) !== null && _34 !== void 0 ? _34 : (drawType && constantToString(drawType));
42710
+ (_30 = params.drawName) !== null && _30 !== void 0 ? _30 : (drawType && constantToString(drawType));
42492
42711
  if (typeof voluntaryConsolation === 'object' && drawSize >= 4) {
42493
42712
  addVoluntaryConsolationStructure(__assign(__assign({}, voluntaryConsolation), { drawDefinition: drawDefinition, matchUpType: matchUpType }));
42494
42713
  }
@@ -52325,19 +52544,20 @@ function unPublishEventSeeding(_a) {
52325
52544
  }
52326
52545
 
52327
52546
  var publishingGovernor = {
52328
- getTournamentInfo: getTournamentInfo,
52329
- getVenueData: getVenueData,
52330
- getCourtInfo: getCourtInfo,
52331
52547
  getAllEventData: getAllEventData,
52332
- getEventData: getEventData,
52548
+ getCourtInfo: getCourtInfo,
52333
52549
  getDrawData: getDrawData,
52334
- unPublishEventSeeding: unPublishEventSeeding,
52550
+ getEventData: getEventData,
52551
+ getPublishState: getPublishState,
52552
+ getTournamentInfo: getTournamentInfo,
52553
+ getVenueData: getVenueData,
52554
+ publishEvent: publishEvent,
52335
52555
  publishEventSeeding: publishEventSeeding,
52556
+ publishOrderOfPlay: publishOrderOfPlay,
52336
52557
  setEventDisplay: setEventDisplay,
52337
52558
  unPublishEvent: unPublishEvent,
52338
- publishEvent: publishEvent,
52559
+ unPublishEventSeeding: unPublishEventSeeding,
52339
52560
  unPublishOrderOfPlay: unPublishOrderOfPlay,
52340
- publishOrderOfPlay: publishOrderOfPlay,
52341
52561
  };
52342
52562
 
52343
52563
  function getEligibleVoluntaryConsolationParticipants(_a) {
@@ -53304,6 +53524,54 @@ function getParticipantEventDetails(_a) {
53304
53524
  return { eventDetails: relevantEvents };
53305
53525
  }
53306
53526
 
53527
+ function getCompetitionPublishedDrawDetails(_a) {
53528
+ var e_1, _b, e_2, _c;
53529
+ var _d, _e;
53530
+ var tournamentRecords = _a.tournamentRecords;
53531
+ var drawIds = [];
53532
+ var detailsMap = {};
53533
+ try {
53534
+ for (var _f = __values(Object.values(tournamentRecords)), _g = _f.next(); !_g.done; _g = _f.next()) {
53535
+ var tournamentRecord = _g.value;
53536
+ var _loop_1 = function (event_1) {
53537
+ var eventPubStatus = getEventPublishStatus({ event: event_1 });
53538
+ var drawDetails = eventPubStatus === null || eventPubStatus === void 0 ? void 0 : eventPubStatus.drawDetails;
53539
+ if (isObject(drawDetails)) {
53540
+ Object.assign(detailsMap, drawDetails);
53541
+ drawIds.push.apply(drawIds, __spreadArray([], __read(Object.keys(drawDetails).filter(function (drawId) {
53542
+ return getDrawPublishStatus({ drawId: drawId, drawDetails: drawDetails });
53543
+ })), false));
53544
+ }
53545
+ else if ((_e = eventPubStatus === null || eventPubStatus === void 0 ? void 0 : eventPubStatus.drawIds) === null || _e === void 0 ? void 0 : _e.length) {
53546
+ // LEGACY - deprecate
53547
+ drawIds.push.apply(drawIds, __spreadArray([], __read(eventPubStatus.drawIds), false));
53548
+ }
53549
+ };
53550
+ try {
53551
+ for (var _h = (e_2 = void 0, __values((_d = tournamentRecord.events) !== null && _d !== void 0 ? _d : [])), _j = _h.next(); !_j.done; _j = _h.next()) {
53552
+ var event_1 = _j.value;
53553
+ _loop_1(event_1);
53554
+ }
53555
+ }
53556
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
53557
+ finally {
53558
+ try {
53559
+ if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
53560
+ }
53561
+ finally { if (e_2) throw e_2.error; }
53562
+ }
53563
+ }
53564
+ }
53565
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
53566
+ finally {
53567
+ try {
53568
+ if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
53569
+ }
53570
+ finally { if (e_1) throw e_1.error; }
53571
+ }
53572
+ return { drawIds: drawIds, detailsMap: detailsMap };
53573
+ }
53574
+
53307
53575
  function scheduledSortedMatchUps(_a) {
53308
53576
  var e_1, _b, e_2, _c, e_3, _d, e_4, _e;
53309
53577
  var schedulingProfile = _a.schedulingProfile, _f = _a.matchUps, matchUps = _f === void 0 ? [] : _f;
@@ -53832,53 +54100,6 @@ function competitionScheduleMatchUps(params) {
53832
54100
  : courtMatchUps;
53833
54101
  }
53834
54102
  }
53835
- function getCompetitionPublishedDrawDetails(_a) {
53836
- var e_1, _b, e_2, _c;
53837
- var _d, _e;
53838
- var tournamentRecords = _a.tournamentRecords;
53839
- var drawIds = [];
53840
- var detailsMap = {};
53841
- try {
53842
- for (var _f = __values(Object.values(tournamentRecords)), _g = _f.next(); !_g.done; _g = _f.next()) {
53843
- var tournamentRecord = _g.value;
53844
- var _loop_1 = function (event_1) {
53845
- var eventPubStatus = getEventPublishStatus({ event: event_1 });
53846
- var drawDetails = eventPubStatus === null || eventPubStatus === void 0 ? void 0 : eventPubStatus.drawDetails;
53847
- if (isObject(drawDetails)) {
53848
- Object.assign(detailsMap, drawDetails);
53849
- drawIds.push.apply(drawIds, __spreadArray([], __read(Object.keys(drawDetails).filter(function (drawId) {
53850
- return getDrawPublishStatus({ drawId: drawId, drawDetails: drawDetails });
53851
- })), false));
53852
- }
53853
- else if ((_e = eventPubStatus === null || eventPubStatus === void 0 ? void 0 : eventPubStatus.drawIds) === null || _e === void 0 ? void 0 : _e.length) {
53854
- // LEGACY - deprecate
53855
- drawIds.push.apply(drawIds, __spreadArray([], __read(eventPubStatus.drawIds), false));
53856
- }
53857
- };
53858
- try {
53859
- for (var _h = (e_2 = void 0, __values((_d = tournamentRecord.events) !== null && _d !== void 0 ? _d : [])), _j = _h.next(); !_j.done; _j = _h.next()) {
53860
- var event_1 = _j.value;
53861
- _loop_1(event_1);
53862
- }
53863
- }
53864
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
53865
- finally {
53866
- try {
53867
- if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
53868
- }
53869
- finally { if (e_2) throw e_2.error; }
53870
- }
53871
- }
53872
- }
53873
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
53874
- finally {
53875
- try {
53876
- if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
53877
- }
53878
- finally { if (e_1) throw e_1.error; }
53879
- }
53880
- return { drawIds: drawIds, detailsMap: detailsMap };
53881
- }
53882
54103
 
53883
54104
  function getParticipantMembership(_a) {
53884
54105
  var tournamentRecord = _a.tournamentRecord, participantId = _a.participantId;
@@ -55752,20 +55973,6 @@ function getParticipantSchedules(_a) {
55752
55973
  return __assign({ participantSchedules: participantSchedules }, SUCCESS);
55753
55974
  }
55754
55975
 
55755
- function getMaxEntryPosition(params) {
55756
- var _a = params.entries, entries = _a === void 0 ? [] : _a, entryStatus = params.entryStatus, stage = params.stage;
55757
- return Math.max.apply(Math, __spreadArray(__spreadArray([], __read(entries
55758
- .filter(function (entry) {
55759
- return (!stage || stage === entry.entryStage) &&
55760
- (!entryStatus || entry.entryStatus === entryStatus) &&
55761
- !isNaN(entry.entryPosition);
55762
- })
55763
- .map(function (_a) {
55764
- var entryPosition = _a.entryPosition;
55765
- return ensureInt(entryPosition || 0);
55766
- })), false), [0], false));
55767
- }
55768
-
55769
55976
  function isValidForQualifying(_a) {
55770
55977
  var structureId = _a.structureId, drawDefinition = _a.drawDefinition;
55771
55978
  if (!drawDefinition)
@@ -56164,6 +56371,20 @@ function getParticipantSignInStatus(_a) {
56164
56371
  return timeItem && timeItem.itemValue === SIGNED_IN && SIGNED_IN;
56165
56372
  }
56166
56373
 
56374
+ function getMaxEntryPosition(params) {
56375
+ var _a = params.entries, entries = _a === void 0 ? [] : _a, entryStatus = params.entryStatus, stage = params.stage;
56376
+ return Math.max.apply(Math, __spreadArray(__spreadArray([], __read(entries
56377
+ .filter(function (entry) {
56378
+ return (!stage || stage === entry.entryStage) &&
56379
+ (!entryStatus || entry.entryStatus === entryStatus) &&
56380
+ !isNaN(entry.entryPosition);
56381
+ })
56382
+ .map(function (_a) {
56383
+ var entryPosition = _a.entryPosition;
56384
+ return ensureInt(entryPosition || 0);
56385
+ })), false), [0], false));
56386
+ }
56387
+
56167
56388
  function checkIsDual(tournamentRecord) {
56168
56389
  var _a, _b, _c, _d, _e;
56169
56390
  var teamParticipants = (_a = tournamentRecord.participants) === null || _a === void 0 ? void 0 : _a.filter(function (_a) {
@@ -56244,7 +56465,6 @@ function getMatchUpFormat(params) {
56244
56465
 
56245
56466
  /**
56246
56467
  *
56247
- * @param {object} tournamentRecord - passed in automatically by tournamentEngine
56248
56468
  * @param {object[]} outcomes - array of outcomes to be applied to matchUps, relevent attributes: { eventId: string; drawId: string; }
56249
56469
  *
56250
56470
  */
@@ -57390,6 +57610,7 @@ var queryGovernor = {
57390
57610
  getCourts: getCourts,
57391
57611
  getDrawDefinitionTimeItem: getDrawDefinitionTimeItem,
57392
57612
  getDrawParticipantRepresentativeIds: getDrawParticipantRepresentativeIds,
57613
+ getDrawTypeCoercion: getDrawTypeCoercion,
57393
57614
  getEligibleVoluntaryConsolationParticipants: getEligibleVoluntaryConsolationParticipants,
57394
57615
  getEntriesAndSeedsCount: getEntriesAndSeedsCount,
57395
57616
  getEvent: getEvent,
@@ -65450,6 +65671,10 @@ var governors = {
65450
65671
  venueGovernor: venueGovernor,
65451
65672
  };
65452
65673
 
65674
+ var factoryTypes = {
65675
+ __proto__: null
65676
+ };
65677
+
65453
65678
  var forge = {};
65454
65679
 
65455
65680
  var _a$8;
@@ -65996,6 +66221,7 @@ function engineStart(engine, engineInvoke) {
65996
66221
  return processResult(engine, result);
65997
66222
  };
65998
66223
  engine.setTournamentId = function (tournamentId) { return setTournamentId(tournamentId); };
66224
+ engine.getTournamentId = function () { return getTournamentId(); };
65999
66225
  engine.setTournamentRecord = function (tournamentRecord, deepCopyOption, deepCopyAttributes) {
66000
66226
  setDeepCopy(deepCopyOption, deepCopyAttributes);
66001
66227
  var result = setTournamentRecord(tournamentRecord, deepCopyOption);
@@ -67432,17 +67658,17 @@ var factoryConstants = {
67432
67658
  exports.askEngine = askEngine;
67433
67659
  exports.asyncEngine = asyncEngine;
67434
67660
  exports.competitionEngine = competitionEngine;
67435
- exports.deleteNotices = deleteNotices;
67436
67661
  exports.drawDefinitionConstants = drawDefinitionConstants;
67437
67662
  exports.entryStatusConstants = entryStatusConstants;
67438
67663
  exports.errorConditionConstants = errorConditionConstants;
67439
67664
  exports.eventConstants = eventConstants;
67440
67665
  exports.factoryConstants = factoryConstants;
67666
+ exports.factoryTypes = factoryTypes;
67441
67667
  exports.fixtures = fixtures;
67442
67668
  exports.flightConstants = flightConstants;
67443
67669
  exports.forge = forge;
67444
67670
  exports.genderConstants = genderConstants;
67445
- exports.getNotices = getNotices;
67671
+ exports.globalState = globalState$1;
67446
67672
  exports.governors = governors;
67447
67673
  exports.keyValueConstants = keyValueConstants;
67448
67674
  exports.matchUpActionConstants = matchUpActionConstants;
@@ -67461,11 +67687,6 @@ exports.resultConstants = resultConstants;
67461
67687
  exports.scaleConstants = scaleConstants;
67462
67688
  exports.scaleEngine = scaleEngine;
67463
67689
  exports.scoreGovernor = scoreGovernor;
67464
- exports.setDeepCopy = setDeepCopy;
67465
- exports.setDevContext = setDevContext;
67466
- exports.setGlobalLog = setGlobalLog;
67467
- exports.setStateProvider = setStateProvider;
67468
- exports.setSubscriptions = setSubscriptions;
67469
67690
  exports.surfaceConstants = surfaceConstants;
67470
67691
  exports.syncEngine = engine;
67471
67692
  exports.timeItemConstants = timeItemConstants;