courthive-components 0.8.11 → 0.9.0

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.
@@ -51,7 +51,7 @@ var GS, Et = "colors", si = "sizes", fe = "space", w0 = { gap: fe, gridGap: fe,
51
51
  let i = r.length;
52
52
  for (; i; ) t = 33 * t ^ r.charCodeAt(--i);
53
53
  return t;
54
- })(5381, JSON.stringify(e)) >>> 0), Jc = ["themed", "global", "styled", "onevar", "resonevar", "allvar", "inline"], C0 = (e) => {
54
+ })(5381, JSON.stringify(e)) >>> 0), Zc = ["themed", "global", "styled", "onevar", "resonevar", "allvar", "inline"], C0 = (e) => {
55
55
  if (e.href && !e.href.startsWith(location.origin)) return !1;
56
56
  try {
57
57
  return !!e.cssRules;
@@ -92,7 +92,7 @@ var GS, Et = "colors", si = "sizes", fe = "space", w0 = { gap: fe, gridGap: fe,
92
92
  ++c;
93
93
  const { cssText: p } = l;
94
94
  if (!p.startsWith("--sxs")) continue;
95
- const m = p.slice(14, -3).trim().split(/\s+/), f = Jc[m[0]];
95
+ const m = p.slice(14, -3).trim().split(/\s+/), f = Zc[m[0]];
96
96
  f && (t || (t = { sheet: o, reset: i, rules: {}, toString: r }), t.rules[f] = { group: d, index: c, cache: new Set(m) });
97
97
  }
98
98
  if (t) break;
@@ -106,10 +106,10 @@ var GS, Et = "colors", si = "sizes", fe = "space", w0 = { gap: fe, gridGap: fe,
106
106
  t = { sheet: e ? (e.head || e).appendChild(document.createElement("style")).sheet : o("", "text/css"), rules: {}, reset: i, toString: r };
107
107
  }
108
108
  const { sheet: a, rules: s } = t;
109
- for (let o = Jc.length - 1; o >= 0; --o) {
110
- const c = Jc[o];
109
+ for (let o = Zc.length - 1; o >= 0; --o) {
110
+ const c = Zc[o];
111
111
  if (!s[c]) {
112
- const u = Jc[o + 1], l = s[u] ? s[u].index : a.cssRules.length;
112
+ const u = Zc[o + 1], l = s[u] ? s[u].index : a.cssRules.length;
113
113
  a.insertRule("@media{}", l), a.insertRule(`--sxs{--sxs:${o}}`, l), s[c] = { group: a.cssRules[l + 1], index: l, cache: /* @__PURE__ */ new Set([o]) };
114
114
  }
115
115
  k0(s[c]);
@@ -125,7 +125,7 @@ var GS, Et = "colors", si = "sizes", fe = "space", w0 = { gap: fe, gridGap: fe,
125
125
  } catch {
126
126
  }
127
127
  };
128
- }, Kc = /* @__PURE__ */ Symbol(), x0 = Yu(), F0 = (e, t) => x0(e, (() => (...r) => {
128
+ }, Xc = /* @__PURE__ */ Symbol(), x0 = Yu(), F0 = (e, t) => x0(e, (() => (...r) => {
129
129
  let i = { type: null, composers: /* @__PURE__ */ new Set() };
130
130
  for (const n of r) if (n != null) if (n[Id]) {
131
131
  i.type == null && (i.type = n[Id].type);
@@ -157,13 +157,13 @@ var GS, Et = "colors", si = "sizes", fe = "space", w0 = { gap: fe, gridGap: fe,
157
157
  }, _0 = (e, t, r) => {
158
158
  const [i, n, a, s] = B0(t.composers), o = typeof t.type == "function" || t.type.$$typeof ? ((d) => {
159
159
  function p() {
160
- for (let m = 0; m < p[Kc].length; m++) {
161
- const [f, h] = p[Kc][m];
160
+ for (let m = 0; m < p[Xc].length; m++) {
161
+ const [f, h] = p[Xc][m];
162
162
  d.rules[f].apply(h);
163
163
  }
164
- return p[Kc] = [], null;
164
+ return p[Xc] = [], null;
165
165
  }
166
- return p[Kc] = [], p.rules = {}, Jc.forEach(((m) => p.rules[m] = { apply: (f) => p[Kc].push([m, f]) })), p;
166
+ return p[Xc] = [], p.rules = {}, Zc.forEach(((m) => p.rules[m] = { apply: (f) => p[Xc].push([m, f]) })), p;
167
167
  })(r) : null, c = (o || r).rules, u = `.${i}${n.length > 1 ? `:where(.${n.slice(1).join(".")})` : ""}`, l = (d) => {
168
168
  d = typeof d == "object" && d || V0;
169
169
  const { css: p, ...m } = d, f = {};
@@ -736,7 +736,7 @@ var S1 = Object.defineProperty, Pe = (e, t) => {
736
736
  for (var r in t) S1(e, r, { get: t[r], enumerable: !0 });
737
737
  };
738
738
  function Dp() {
739
- return "2.2.36";
739
+ return "2.2.38";
740
740
  }
741
741
  var dg = {};
742
742
  Pe(dg, { competitionGovernor: () => Gw, drawsGovernor: () => LP, entriesGovernor: () => HR, eventGovernor: () => ZR, generationGovernor: () => gE, matchUpFormatGovernor: () => uu, matchUpGovernor: () => bE, mocksGovernor: () => uS, participantGovernor: () => UA, policyGovernor: () => IR, publishingGovernor: () => GA, queryGovernor: () => wR, reportGovernor: () => QA, scheduleGovernor: () => JA, scoreGovernor: () => Yy, tieFormatGovernor: () => lC, tournamentGovernor: () => UC, venueGovernor: () => OC });
@@ -778,7 +778,7 @@ function qw(e) {
778
778
  let t = pe(e);
779
779
  if (!isNaN(t)) return t === 0 ? !1 : (t & -t) === 1;
780
780
  }
781
- function fc(e) {
781
+ function hc(e) {
782
782
  if (isNaN(e)) return !1;
783
783
  for (; !$i(e); ) e++;
784
784
  return e;
@@ -815,7 +815,7 @@ function P1(e) {
815
815
  function Ur(e) {
816
816
  return Array.isArray(e) ? e.map((t) => [Math.random(), t]).sort((t, r) => t[0] - r[0]).map((t) => t[1]) : [];
817
817
  }
818
- function Wo(e) {
818
+ function qo(e) {
819
819
  return ge(e) ? e : 1 / 0;
820
820
  }
821
821
  function Wr(e) {
@@ -849,7 +849,7 @@ function te(e, t) {
849
849
  function Ji(e, t) {
850
850
  return t.reduce((r, i, n) => (i === e && r.push(n), r), []);
851
851
  }
852
- function St(e, t) {
852
+ function vt(e, t) {
853
853
  return !Array.isArray(e) || !Array.isArray(t) ? [] : e.filter((r) => t.indexOf(r) !== -1).filter((r, i, n) => n.indexOf(r) === i);
854
854
  }
855
855
  function ZS(e, t) {
@@ -931,7 +931,7 @@ function k1(e) {
931
931
  return [t.length, r, i].map((n) => n.toString(36)).join("");
932
932
  }
933
933
  function Tp(e, t) {
934
- return !Array.isArray(e) || !ct(t) ? !1 : St(e, Ww[t]).length;
934
+ return !Array.isArray(e) || !ct(t) ? !1 : vt(e, Ww[t]).length;
935
935
  }
936
936
  var x = { success: !0 }, Zw = "error", x1 = { SUCCESS: x, ERROR: Zw };
937
937
  function eD({ collectionValueProfiles: e, matchUpCount: t }) {
@@ -948,7 +948,7 @@ function eD({ collectionValueProfiles: e, matchUpCount: t }) {
948
948
  }
949
949
  var F1 = {};
950
950
  Pe(F1, { addNotice: () => Ue, callListener: () => wh, createInstanceState: () => yO, cycleMutationStatus: () => $g, deepCopyEnabled: () => Gg, deleteNotice: () => Wg, deleteNotices: () => rl, disableNotifications: () => pT, enableNotifications: () => vd, getDevContext: () => ei, getMethods: () => hT, getNotices: () => gT, getProvider: () => Dh, getTopics: () => fi, getTournamentId: () => Zs, getTournamentRecord: () => qg, getTournamentRecords: () => eo, globalLog: () => UT, handleCaughtError: () => Vp, hasTopic: () => _p, removeTournamentRecord: () => yT, setDeepCopy: () => Uu, setDevContext: () => yu, setGlobalLog: () => dT, setGlobalMethods: () => mT, setGlobalSubscriptions: () => SO, setMethods: () => fT, setStateMethods: () => ST, setStateProvider: () => IO, setSubscriptions: () => vO, setTournamentId: () => Su, setTournamentRecord: () => IT, setTournamentRecords: () => Bp, timeKeeper: () => UO });
951
- var mh = { message: "Chronological error; time violation.", code: "ANACHRONISM" }, gu = { message: "Duplicate entry", code: "DUPLICATE_ENTRY" }, tD = { message: "Cannot remove main structure", code: "ERR_CANNOT_REMOVE_MAIN_STRUCTURE" }, fh = { message: "records must be an object with tournamentId keys", code: "ERR_INVALID_TOURNAMENTS" }, mt = { message: "Missing tournamentRecords", code: "ERR_MISSING_TOURNAMENTS" }, J = { message: "Missing tournamentRecord", code: "ERR_MISSING_TOURNAMENT" }, Ku = { message: "Invalid tournamentRecord", code: "ERR_INVALID_TOURNAMENT" }, qo = { message: "Missing tournamentId", code: "ERR_MISSING_TOURNAMENT_ID" }, Ms = { message: "Invalid drawDefinition", code: "ERR_INVALID_DRAWDEF" }, ne = { message: "Missing drawDefinition", code: "ERR_MISSING_DRAWDEF" }, rD = { message: "Existing drawDefinition(s)", code: "ERR_EXISTING_DRAWDEFS" }, Zr = { message: "drawDefinition not found", code: "ERR_NOT_FOUND_DRAWDEF" }, ss = { message: "Invalid structure", code: "ERR_INVALID_STRUCTURE" }, fg = { message: "Incomplete source structure", code: "ERR_INCOMPLETE_STRUCTURE" }, hg = { message: "Invalid drawPosition for seedAssignment", code: "ERR_INVALID_SEEDING_POSITION" }, Ho = { message: "drawPosition already assigned", code: "ERR_EXISTING_POSITION_ASSIGNMENT" }, iD = { message: "Schedule not cleared", code: "ERR_UNCHANGED_SCHEDULE_NOT_CLEARED" }, nD = { message: "drawPosition not cleared", code: "ERR_FAILURE_POSITION_NOT_CLEARED" }, L1 = { message: "drawPosition not found", code: "ERR_NOT_FOUND_DRAW_POSITION" }, gg = { message: "Unrecognized drawType", code: "ERR_UNRECOGNIZED_DRAW_TYPE" }, Xu = { message: "Missing drawPositions", code: "ERR_MISSING_DRAW_POSITIONS" }, Pp = { message: "drawPosition is active", code: "ERR_ACTIVE_DRAW_POSITION" }, _1 = { message: "drawPosition is occupied", code: "ERR_OCCUPIED_DRAW_POSITION" }, hc = { message: "Invlid drawPosition", code: "ERR_INVALID_DRAW_POSITION" }, gc = { message: "Missing drawPosition", code: "ERR_MISSING_DRAW_POSITION" }, Ig = { message: "Invalid drawType", code: "ERR_INVALID_DRAW_TYPE" }, bp = { message: "Invalid drawSize", code: "ERR_INVALID_DRAW_SIZE" }, aD = { message: "Cannot set drawSize to be less than existing entries", code: "ERR_INVALID_DRAW_SIZE_MISMATCH" }, Qu = { message: "Missing drawSize", code: "ERR_MISSING_DRAW_SIZE" }, zi = { message: "Missing drawId", code: "ERR_MISSING_DRAW_ID" }, sD = { message: "drawId exists", code: "ERR_EXISTING_DRAW_ID" }, oD = { message: "participantId cannot be assigned to multiple seedNumbers", code: "INVALID_PARTICIPANT_SEEDING" }, cD = { message: "seedsCount greater than drawSize", code: "ERR_INVALID_SEED_COUNT" }, uD = { message: "Missing seedCountThresholds", code: "ERR_MISSING_SEED_COUNT_THRESHOLD" }, lD = { message: "Invalid action", code: "ERR_INVALID_ACTION" }, hh = { message: "Invalid assignment", code: "ERR_INVALID_ASSIGNMENT" }, dD = { message: "Missing seedAssignments", code: "ERR_MISSING_SEED_ASSIGNMENTS" }, pD = { message: "Invalid seedNumber", code: "ERR_INVALID_SEED_NUMBER" }, mD = { message: "Invalid seedPosition", code: "ERR_INVALID_SEED_POSITION" }, yg = { message: "Missing targetLink", code: "ERR_MISSING_LINK_TARGET" }, fD = { message: "Existing round", code: "ERR_EXISTING_ROUND" }, B1 = { message: "Missing roundNumber", code: "ERR_MISSING_ROUND_NUMBER" }, ri = { message: "Missing structureId", code: "ERR_MISSING_STRUCTURE_ID" }, lt = { message: "structure not found", code: "ERR_NOT_FOUND_STRUCTURE" }, Ug = { message: "Missing structures", code: "ERR_MISSING_STRUCTURES" }, os = { message: "Missing structure", code: "ERR_MISSING_STRUCTURE" }, Sg = { message: "Missing MAIN structure", code: "ERR_MISSING_MAIN_STRUCTURE" }, hD = { message: "drawDefinition contains unlinked structures", code: "ERR_MISSING_STRUCTURE_LINKS" }, bn = { message: "Invalid eventType", code: "ERR_INVALID_EVENT_TYPE" }, it = { message: "Missing event / eventId", code: "ERR_MISSING_EVENT_ID" }, li = { message: "Event not found", code: "ERR_NOT_FOUND_EVENT" }, gD = { message: "Event exists", code: "ERR_EXISTING_EVENT" }, ID = { message: "Missing entries", code: "ERR_MISSING_ENTRIES" }, yD = { message: "Invalid entries", code: "ERR_INVALID_ENTRIES" }, vg = { message: "Missing assignments", code: "ERR_MISSING_ASSIGNMENTS" }, UD = { message: "Missing stage", code: "ERR_MISSING_STAGE" }, cs = { message: "Invalid stage", code: "ERR_INVALID_STAGE" }, SD = { message: "stageSequence limit", code: "ERR_LIMIT_STAGE_SEQUENCE" }, vD = { message: "Missing positionAssignments", code: "ERR_MISSING_POSITION_ASSIGNMENTS" }, wD = { message: "Cannot Assign BYE status if no assignment: { bye: true }", code: "ERR_UNCHANGED_CANNOT_ASSIGN_BYE" }, gh = { message: "Unrecognized matchUpStatus", code: "ERR_UNRECOGNIZED_MATCHUP_STATUS" }, Ju = { message: "Unrecognized matchUpFormat", code: "ERR_UNRECOGNIZED_MATCHUP_FORMAT" }, Ud = { message: "Incompatible matchUpStatus", code: "ERR_INCOMPATIBLE_MATCHUP_STATUS" }, V1 = { message: "Propagated exits downstream", code: "ERR_PROPAGATED_EXITS_DOWNSTREAM" }, Ic = { message: "Invalid matchUpStatus", code: "ERR_INVALID_MATCHUP_STATUS" }, Un = { message: "Invalid tieFormat", code: "ERR_INVALID_TIE_FORMAT" }, wg = { message: "Invalid matchUpFormat", code: "ERR_INVALID_MATCHUP_FORMAT" }, Dg = { message: "Missing matchUpFormat", code: "ERR_MISSING_MATCHUP_FORMAT" }, DD = { message: "Missing collectionDefinition", code: "ERR_MISSING_COLLECTION_DEFINITION" }, yc = { message: "Missing tieFormat", code: "ERR_MISSING_TIE_FORMAT" }, yr = { message: "Missing matchUpId", code: "ERR_MISSING_MATCHUP_ID" }, Ys = { message: "Missing matchUpIds", code: "ERR_MISSING_MATCHUP_IDS" }, pr = { message: "matchUp not found", code: "ERR_NOT_FOUND_MATCHUP" }, ra = { message: "Missing matchUps", code: "ERR_MISSING_MATCHUPS" }, Mr = { message: "Missing matchUp", code: "ERR_MISSING_MATCHUP" }, Fr = { message: "Invalid matchUp", code: "ERR_INVALID_MATCHUP" }, Tg = { message: "Missing policyType", code: "ERR_MISSING_POLICY_TYPE" }, Mp = { message: "Missing policyDefinitions", code: "ERR_MISSING_POLICY_DEFINITIONS" }, j1 = { message: "Missing seeding policy", code: "ERR_MISSING_POLICY_SEEDING" }, TD = { message: "Missing avoidance policy", code: "ERR_MISSING_POLICY_AVOIDANCE" }, Pg = { message: "Missing policy attributes", code: "ERR_MISSING_POLICY_ATTRIBUTES" }, PD = { message: "Invalid policyDefinitions", code: "ERR_INVALID_POLICY_DEFINITIONS" }, bg = { message: "existing policyType", code: "ERR_EXISTING_POLICY_TYPE" }, G1 = { message: "Policy not attached", code: "ERR_FAILURE_POLICY_NOT_ATTACHED" }, Zu = { message: "Policy not found", code: "ERR_NOT_FOUND_POLICY" }, $1 = { message: "Missing scoring policy / matchUpFormats", code: "ERR_MISSING_POLICY_SCORING_MATCHUP_FORMATS" }, Mg = { message: "Invalid sideNumber", code: "ERR_INVALID_SIDE_NUMBER" }, W1 = { message: "Invalid setNumber", code: "ERR_INVALID_SET_NUMBER" }, Np = { message: "Missing setObject", code: "ERR_MISSING_SET_ATTRIBUTE" }, q1 = { message: "Missing setNumber", code: "ERR_MISSING_SET_NUMBER" }, H1 = { message: "Missing sideNumber", code: "ERR_MISSING_SIDE_NUMBER" }, Ks = { message: "Missing courtId", code: "ERR_MISSING_COURT_ID" }, ce = { message: "Missing value", code: "ERR_MISSING_VALUE" }, bD = { message: "Missing birthdate", code: "ERR_MISSING_BIRTH_DATE" }, MD = { message: "Missing date", code: "ERR_MISSING_DATE" }, ND = { message: "No valid dates", code: "ERR_NO_VALID_DATES" }, _d = { message: "Invalid bookings", code: "ERR_INVALID_BOOKINGS" }, Sd = { message: "Invalid dateAvailability", code: "ERR_INVALID_DATE_AVAILABILITY" }, RD = { message: "Missing dateAvailability", code: "ERR_MISSING_DATE_AVAILABILITY" }, Ht = { message: "Invalid Date", code: "ERR_INVALID_DATE" }, Si = { message: "Invalid time", code: "ERR_INVALID_TIME" }, ED = { message: "Invalid tournament dates", code: "ERR_INVALID_DATES_TOURNAMENT" }, Ih = { message: "Invalid game scores", code: "ERR_INVALID_SCORES_GAME" }, AD = { message: "Invalid score", code: "ERR_INVALID_SCORE" }, Rp = { message: "Invalid winningSide", code: "ERR_INVALID_WINNING_SIDE" }, z1 = { message: "No participants generated", code: "ERR_NO_PARTICIPANTS_GENERATED" }, Ng = { message: "Cannot modify tieFormat", code: "ERR_UNCHANGED_CANNOT_MODIFY_TIEFORMAT" }, CD = { message: "Cannot modify participantType", code: "ERR_UNCHANGED_CANNOT_MODIFY_PARTICIPANT_TYPE" }, Ep = { message: "Cannot remove participants", code: "ERR_UNCHANGED_CANNOT_REMOVE_PARTICIPANTS" }, yh = { message: "Participant category mismatch", code: "ERR_CATEGORY_MISMATCH" }, Ap = { message: "Cannot change winningSide", code: "ERR_UNCHANGED_CANNOT_CHANGE_WINNING_SIDE" }, Xs = { message: "Invalid participant", code: "ERR_INVALID_PARTICIPANT" }, Wi = { message: "Invalid participantId", code: "ERR_INVALID_PARTICIPANT_ID" }, Gr = { message: "Invalid participantIds", code: "ERR_INVALID_PARTICIPANT_IDS" }, OD = { message: "Invalid participantRole", code: "ERR_INVALID_PARTICIPANT_ROLE" }, qi = { message: "Invalid participantType", code: "ERR_INVALID_PARTICIPANT_TYPE" }, kD = { message: "Missing participantRole", code: "ERR_MISSING_PARTICIPANT_ROLE" }, Qs = { message: "Missing participant", code: "ERR_MISSING_PARTICIPANT" }, el = { message: "Missing participants", code: "ERR_MISSING_PARTICIPANTS" }, xt = { message: "Missing participantId", code: "ERR_MISSING_PARTICIPANT_ID" }, xD = { message: "Missing qualified participants", code: "ERR_MISSING_QUALIFIED_PARTICIPANTS" }, Tt = { message: "Participant Not Found", code: "ERR_NOT_FOUND_PARTICIPANT" }, FD = { message: "participantId exists", code: "ERR_EXISTING_PARTICIPANT_ID" }, Y1 = { message: "participant pair exists", code: "ERR_EXISTING_PARTICIPANT_PAIR" }, LD = { message: "No participant removed", code: "ERR_UNCHANGED_NO_PARTICIPANT_REMOVED" }, Ma = { message: "Missing participantIds", code: "ERR_MISSING_PARTICIPANT_IDS" }, _D = { message: "Missing participantsCount", code: "ERR_MISSING_PARTICIPANT_COUNT" }, BD = { message: "Participant not checked in", code: "ERR_UNCHANGED_PARTICIPANT_NOT_CHECKED_IN" }, VD = { message: "Missing person details", code: "ERR_MISSING_PERSON_DETAILS" }, Uc = { message: "Existing participant drawPosition assignment", code: "ERR_EXISTING_PARTICIPANT_DRAW_POSITION_ASSIGNMENT" }, Cp = { message: "Existing participant", code: "ERR_EXISTING_PARTICIPANT" }, Rg = { message: "participantsCount exceeds drawSize", code: "ERR_INVALID_PARTICIPANT_COUNT" }, Uh = { message: "Invalid entry status", code: "ERR_INVALID_ENTRY_STATUS" }, jD = { message: "Participant Entry Not Found", code: "ERR_NOT_FOUND_PARTICIPANT_ENTRY" }, K1 = { message: "Participant not entered in stage", code: "ERR_UNCHANGED_PARTICIPANT_NOT_ENTERED" }, X1 = { message: "Participant not found in stageSequence", code: "ERR_NOT_FOUND_PARTICIPANT_IN_STAGE" }, GD = { message: "entryStatus not allowed in stage", code: "ERR_INVALID_ENTRY_STATUS_IN_STAGE" }, $D = { message: "entryStatus not allowed for event", code: "ERR_INVALID_ENTRY_STATUS_IN_EVENT" }, Sh = { message: "No stage space available for entryStatus", code: "ERR_UNCHANGED_NO_AVAILABLE_STAGE_SPACE" }, Eg = { message: "Insufficient drawPositions to accommodate qualifiers", code: "ERR_UNCHANGED_NO_DRAW_POSITIONS_FOR_QUALIFIERS" }, Ag = { message: "Insufficient drawPositions to accommodate entries", code: "ERR_INSUFFICIENT_DRAW_POSITIONS" }, WD = { message: "Missing penaltyType", code: "ERR_MISSING_PENALTY_TYPE" }, Cg = { message: "Missing penaltyId", code: "ERR_MISSING_PENALTY_ID" }, zo = { message: "Penalty not found", code: "ERR_NOT_FOUND_PENALTY" }, qD = { message: "Missing courtsCount/courtNames", code: "ERR_MISSING_COURTS_INFO" }, Sc = { message: "Court not found", code: "ERR_NOT_FOUND_COURT" }, HD = { message: "Court exists", code: "ERR_EXISTING_COURT" }, zD = { message: "Venue exists", code: "ERR_EXISTING_VENUE" }, Js = { message: "Venue not found", code: "ERR_NOT_FOUND_VENUE" }, Na = { message: "Missing venueId", code: "ERR_MISSING_VENUE_ID" }, YD = { message: "Invalid endTime", code: "ERR_INVALID_END_TIME" }, Og = { message: "Existing endTime", code: "ERR_EXISTING_END_TIME" }, KD = { message: "Invalid stopTime", code: "ERR_INVALID_STOP_TIME" }, XD = { message: "Invalid startTime", code: "ERR_INVALID_START_TIME" }, Q1 = { message: "Invalid resumeTime", code: "ERR_INVALID_RESUME_TIME" }, kg = { message: "Invalid timeItem", code: "ERR_INVALID_TIME_ITEMS" }, QD = { message: "Missing async state provider", code: "ERR_MISSING_ASYNC_STATE_PROVIDER" }, xg = { message: "Missing timeItem", code: "ERR_MISSING_TIME_ITEM" }, Fg = { message: "Missing timeItems", code: "ERR_MISSING_TIME_ITEMS" }, Op = { message: "Missing context", code: "ERR_MISSING_CONTEXT" }, JD = { message: "Missing schedule", code: "ERR_MISSING_SCHEDULE" }, Fs = { message: "Invalid scaleItem", code: "ERR_INVALID_SCALE_ITEM" }, ZD = { message: "Modifications failed", code: "ERR_FAILURE_MODIFICATIONS" }, vc = { message: "No modifications applied", code: "ERR_UNCHANGED_NO_MODIFICATIONS_APPLIED" }, eT = { message: "Unable to assign court", code: "ERR_UNCHANGED_COURT_NOT_ASSIGNED" }, kp = { message: "No Candidates", code: "ERR_UNCHANGED_NO_CANDIDATES" }, tT = { message: "Invalid configuration", code: "ERR_INVALID_CONFIG" }, rT = { message: "Invalid collectionDefinition", code: "ERR_INVALID_COLLECTION_DEFINITION" }, ia = { message: "Invalid object", code: "ERR_INVALID_OBJECT" }, ru = { message: "Invalid gender", code: "ERR_INVALID_GENDER" }, Iu = { message: "Invalid category", code: "ERR_INVALID_CATEGORY" }, z = { message: "Invalid values", code: "ERR_INVALID_VALUES" }, iT = { message: "Duplicate value", code: "ERR_DUPLICATE_VALUE" }, Lg = { message: "Team not found", code: "ERR_NOT_FOUND_TEAM" }, nT = { message: "No valid actions", code: "ERR_NO_VALID_ACTIONS" }, xp = { message: "No valid attributes", code: "ERR_NO_VALID_ATTRIBUTES" }, _g = { message: "Value unchanged", code: "ABORT_UNCHANGED" }, Kt = { message: "Not found", code: "ERR_NOT_FOUND" }, Fp = { message: "Not implemented", code: "ERR_NOT_IMPLEMENTED" }, aT = { message: "Existing flight", code: "ERR_EXISTING_FLIGHT" }, Bg = { message: "Existing flight profile", code: "ERR_EXISTING_FLIGHT_PROFILE" }, sT = { message: "Existing outcome", code: "ERR_EXISTING_OUTCOME" }, oT = { message: "Existing matchUpId", code: "ERR_EXISTING_MATCHUP_ID" }, vh = { message: "Existing stage", code: "ERR_EXISTING_STAGE" }, Vg = { message: "Existing structure", code: "ERR_EXISTING_STRUCTURE" }, Lp = { message: "Method not found", code: "ERR_NOT_FOUND_METHOD" }, cT = { message: "Scheduled matchUps", code: "ERR_SCHEDULED_MATCHUPS" }, tl = { message: "Scores present", code: "ERR_SCORES_PRESENT" }, J1 = { ANACHRONISM: mh, CANNOT_CHANGE_WINNING_SIDE: Ap, CANNOT_MODIFY_TIEFORMAT: Ng, CANNOT_MODIFY_PARTICIPANT_TYPE: CD, CANNOT_REMOVE_MAIN_STRUCTURE: tD, CANNOT_REMOVE_PARTICIPANTS: Ep, CATEGORY_MISMATCH: yh, COURT_EXISTS: HD, COURT_NOT_FOUND: Sc, DRAW_DEFINITION_NOT_FOUND: Zr, DRAW_ID_EXISTS: sD, DRAW_POSITION_ACTIVE: Pp, DRAW_POSITION_ASSIGNED: Ho, DRAW_POSITION_NOT_CLEARED: nD, DRAW_POSITION_NOT_FOUND: L1, DRAW_SIZE_MISMATCH: aD, DUPLICATE_ENTRY: gu, DUPLICATE_VALUE: iT, ENTRY_STATUS_NOT_ALLOWED_FOR_EVENT: $D, ENTRY_STATUS_NOT_ALLOWED_IN_STAGE: GD, EVENT_EXISTS: gD, EVENT_NOT_FOUND: li, EXISTING_DRAW_DEFINITIONS: rD, EXISTING_END_TIME: Og, EXISTING_FLIGHT: aT, EXISTING_MATCHUP_ID: oT, EXISTING_OUTCOME: sT, EXISTING_PARTICIPANT_DRAW_POSITION_ASSIGNMENT: Uc, EXISTING_PARTICIPANT: Cp, EXISTING_POLICY_TYPE: bg, EXISTING_PROFILE: Bg, EXISTING_ROUND: fD, EXISTING_STAGE: vh, EXISTING_STRUCTURE: Vg, INCOMPATIBLE_MATCHUP_STATUS: Ud, INCOMPLETE_SOURCE_STRUCTURE: fg, INSUFFICIENT_DRAW_POSITIONS: Ag, INVALID_ACTION: lD, INVALID_ASSIGNMENT: hh, INVALID_BOOKINGS: _d, INVALID_CATEGORY: Iu, INVALID_COLLECTION_DEFINITION: rT, INVALID_CONFIGURATION: tT, INVALID_DATE_AVAILABILITY: Sd, INVALID_DATE: Ht, INVALID_DRAW_DEFINITION: Ms, INVALID_DRAW_POSITION_FOR_SEEDING: hg, INVALID_DRAW_POSITION: hc, INVALID_DRAW_SIZE: bp, INVALID_END_TIME: YD, INVALID_ENTRIES: yD, INVALID_EVENT_TYPE: bn, INVALID_GAME_SCORES: Ih, INVALID_GENDER: ru, INVALID_MATCHUP_FORMAT: wg, INVALID_MATCHUP_STATUS: Ic, INVALID_MATCHUP_STATUS_BYE: wD, INVALID_MATCHUP: Fr, INVALID_OBJECT: ia, INVALID_PARTICIPANT_ID: Wi, INVALID_PARTICIPANT_IDS: Gr, INVALID_PARTICIPANT_ROLE: OD, INVALID_PARTICIPANT_SEEDING: oD, INVALID_PARTICIPANT_TYPE: qi, INVALID_PARTICIPANT: Xs, INVALID_POLICY_DEFINITION: PD, INVALID_RECORDS: fh, INVALID_SCALE_ITEM: Fs, INVALID_SEED_NUMBER: pD, INVALID_SEED_POSITION: mD, INVALID_SET_NUMBER: W1, INVALID_SIDE_NUMBER: Mg, INVALID_SCORE: AD, INVALID_STAGE: cs, INVALID_START_TIME: XD, INVALID_STRUCTURE: ss, INVALID_STOP_TIME: KD, INVALID_TIE_FORMAT: Un, INVALID_TIME: Si, INVALID_TIME_ITEM: kg, INVALID_TOURNAMENT_DATES: ED, INVALID_TOURNAMENT_RECORD: Ku, INVALID_VALUES: z, INVALID_WINNING_SIDE: Rp, MATCHUP_NOT_FOUND: pr, METHOD_NOT_FOUND: Lp, MISSING_ASSIGNMENTS: vg, MISSING_ASYNC_STATE_PROVIDER: QD, MISSING_AVOIDANCE_POLICY: TD, MISSING_BIRTH_DATE: bD, MISSING_COLLECTION_DEFINITION: DD, MISSING_COURT_ID: Ks, MISSING_COURTS_INFO: qD, MISSING_DATE_AVAILABILITY: RD, MISSING_DATE: MD, MISSING_DRAW_DEFINITION: ne, MISSING_DRAW_ID: zi, MISSING_DRAW_POSITION: gc, MISSING_DRAW_POSITIONS: Xu, MISSING_DRAW_SIZE: Qu, MISSING_ENTRIES: ID, MISSING_EVENT: it, MISSING_QUALIFIED_PARTICIPANTS: xD, MISSING_MATCHUP_FORMAT: Dg, MISSING_MATCHUP_ID: yr, MISSING_MATCHUP_IDS: Ys, MISSING_MATCHUP: Mr, MISSING_MATCHUPS: ra, MISSING_PARTICIPANT_COUNT: _D, MISSING_PARTICIPANT_ID: xt, MISSING_PARTICIPANT_IDS: Ma, MISSING_PARTICIPANT_ROLE: kD, MISSING_PARTICIPANT: Qs, MISSING_PARTICIPANTS: el, MISSING_PENALTY_ID: Cg, MISSING_PENALTY_TYPE: WD, MISSING_PERSON_DETAILS: VD, MISSING_POLICY_ATTRIBUTES: Pg, MISSING_POLICY_DEFINITION: Mp, MISSING_POLICY_TYPE: Tg, MISSING_POSITION_ASSIGNMENTS: vD, MISSING_ROUND_NUMBER: B1, MISSING_SCHEDULE: JD, MISSING_SCORING_POLICY: $1, MISSING_SEED_ASSIGNMENTS: dD, MISSING_SEEDCOUNT_THRESHOLDS: uD, MISSING_SEEDING_POLICY: j1, MISSING_SET_NUMBER: q1, MISSING_SET_OBJECT: Np, MISSING_SIDE_NUMBER: H1, MISSING_STAGE: UD, MISSING_STRUCTURE_ID: ri, MISSING_STRUCTURE: os, MISSING_MAIN_STRUCTURE: Sg, MISSING_STRUCTURES: Ug, MISSING_TARGET_LINK: yg, MISSING_TIE_FORMAT: yc, MISSING_TIME_ITEM: xg, MISSING_TIME_ITEMS: Fg, MISSING_TOURNAMENT_ID: qo, MISSING_TOURNAMENT_RECORD: J, MISSING_TOURNAMENT_RECORDS: mt, MISSING_VALUE: ce, MISSING_VENUE_ID: Na, MODIFICATIONS_FAILED: ZD, NO_CANDIDATES: kp, NO_DRAW_POSITIONS_AVAILABLE_FOR_QUALIFIERS: Eg, NO_MODIFICATIONS_APPLIED: vc, NO_STAGE_SPACE_AVAILABLE_FOR_ENTRY_STATUS: Sh, NO_PARTICIPANT_REMOVED: LD, NO_VALID_ACTIONS: nT, NO_VALID_ATTRIBUTES: xp, NO_VALID_DATES: ND, NOT_FOUND: Kt, NOT_IMPLEMENTED: Fp, PARTICIPANT_COUNT_EXCEEDS_DRAW_SIZE: Rg, PARTICIPANT_ID_EXISTS: FD, PARTICIPANT_NOT_CHECKED_IN: BD, PARTICIPANT_NOT_FOUND: Tt, PARTICIPANT_PAIR_EXISTS: Y1, PENALTY_NOT_FOUND: zo, POLICY_NOT_ATTACHED: G1, POLICY_NOT_FOUND: Zu, SCHEDULE_NOT_CLEARED: iD, SCHEDULED_MATCHUPS: cT, SCORES_PRESENT: tl, SEEDSCOUNT_GREATER_THAN_DRAW_SIZE: cD, STAGE_SEQUENCE_LIMIT: SD, STRUCTURE_NOT_FOUND: lt, TEAM_NOT_FOUND: Lg, UNABLE_TO_ASSIGN_COURT: eT, UNLINKED_STRUCTURES: hD, UNRECOGNIZED_DRAW_TYPE: gg, UNRECOGNIZED_MATCHUP_FORMAT: Ju, UNRECOGNIZED_MATCHUP_STATUS: gh, VALUE_UNCHANGED: _g, VENUE_EXISTS: zD }, ut = { disableNotifications: !1, tournamentId: void 0, tournamentRecords: {}, subscriptions: {}, modified: !1, methods: {}, notices: [] }, uT = { addNotice: lO, callListener: hO, cycleMutationStatus: uO, deleteNotice: mO, deleteNotices: pO, disableNotifications: Z1, enableNotifications: eO, getMethods: jg, getNotices: dO, getTopics: fO, getTournamentId: lT, getTournamentRecord: tO, getTournamentRecords: rO, removeTournamentRecord: sO, setMethods: cO, setSubscriptions: oO, setTournamentId: nO, setTournamentRecord: iO, setTournamentRecords: aO, handleCaughtError: gO };
951
+ var mh = { message: "Chronological error; time violation.", code: "ANACHRONISM" }, gu = { message: "Duplicate entry", code: "DUPLICATE_ENTRY" }, tD = { message: "Cannot remove main structure", code: "ERR_CANNOT_REMOVE_MAIN_STRUCTURE" }, fh = { message: "records must be an object with tournamentId keys", code: "ERR_INVALID_TOURNAMENTS" }, mt = { message: "Missing tournamentRecords", code: "ERR_MISSING_TOURNAMENTS" }, J = { message: "Missing tournamentRecord", code: "ERR_MISSING_TOURNAMENT" }, Ku = { message: "Invalid tournamentRecord", code: "ERR_INVALID_TOURNAMENT" }, Ho = { message: "Missing tournamentId", code: "ERR_MISSING_TOURNAMENT_ID" }, Ms = { message: "Invalid drawDefinition", code: "ERR_INVALID_DRAWDEF" }, ne = { message: "Missing drawDefinition", code: "ERR_MISSING_DRAWDEF" }, rD = { message: "Existing drawDefinition(s)", code: "ERR_EXISTING_DRAWDEFS" }, Zr = { message: "drawDefinition not found", code: "ERR_NOT_FOUND_DRAWDEF" }, ss = { message: "Invalid structure", code: "ERR_INVALID_STRUCTURE" }, fg = { message: "Incomplete source structure", code: "ERR_INCOMPLETE_STRUCTURE" }, hg = { message: "Invalid drawPosition for seedAssignment", code: "ERR_INVALID_SEEDING_POSITION" }, zo = { message: "drawPosition already assigned", code: "ERR_EXISTING_POSITION_ASSIGNMENT" }, iD = { message: "Schedule not cleared", code: "ERR_UNCHANGED_SCHEDULE_NOT_CLEARED" }, nD = { message: "drawPosition not cleared", code: "ERR_FAILURE_POSITION_NOT_CLEARED" }, L1 = { message: "drawPosition not found", code: "ERR_NOT_FOUND_DRAW_POSITION" }, gg = { message: "Unrecognized drawType", code: "ERR_UNRECOGNIZED_DRAW_TYPE" }, Xu = { message: "Missing drawPositions", code: "ERR_MISSING_DRAW_POSITIONS" }, Pp = { message: "drawPosition is active", code: "ERR_ACTIVE_DRAW_POSITION" }, _1 = { message: "drawPosition is occupied", code: "ERR_OCCUPIED_DRAW_POSITION" }, gc = { message: "Invlid drawPosition", code: "ERR_INVALID_DRAW_POSITION" }, Ic = { message: "Missing drawPosition", code: "ERR_MISSING_DRAW_POSITION" }, Ig = { message: "Invalid drawType", code: "ERR_INVALID_DRAW_TYPE" }, bp = { message: "Invalid drawSize", code: "ERR_INVALID_DRAW_SIZE" }, aD = { message: "Cannot set drawSize to be less than existing entries", code: "ERR_INVALID_DRAW_SIZE_MISMATCH" }, Qu = { message: "Missing drawSize", code: "ERR_MISSING_DRAW_SIZE" }, zi = { message: "Missing drawId", code: "ERR_MISSING_DRAW_ID" }, sD = { message: "drawId exists", code: "ERR_EXISTING_DRAW_ID" }, oD = { message: "participantId cannot be assigned to multiple seedNumbers", code: "INVALID_PARTICIPANT_SEEDING" }, cD = { message: "seedsCount greater than drawSize", code: "ERR_INVALID_SEED_COUNT" }, uD = { message: "Missing seedCountThresholds", code: "ERR_MISSING_SEED_COUNT_THRESHOLD" }, lD = { message: "Invalid action", code: "ERR_INVALID_ACTION" }, hh = { message: "Invalid assignment", code: "ERR_INVALID_ASSIGNMENT" }, dD = { message: "Missing seedAssignments", code: "ERR_MISSING_SEED_ASSIGNMENTS" }, pD = { message: "Invalid seedNumber", code: "ERR_INVALID_SEED_NUMBER" }, mD = { message: "Invalid seedPosition", code: "ERR_INVALID_SEED_POSITION" }, yg = { message: "Missing targetLink", code: "ERR_MISSING_LINK_TARGET" }, fD = { message: "Existing round", code: "ERR_EXISTING_ROUND" }, B1 = { message: "Missing roundNumber", code: "ERR_MISSING_ROUND_NUMBER" }, ri = { message: "Missing structureId", code: "ERR_MISSING_STRUCTURE_ID" }, lt = { message: "structure not found", code: "ERR_NOT_FOUND_STRUCTURE" }, Ug = { message: "Missing structures", code: "ERR_MISSING_STRUCTURES" }, os = { message: "Missing structure", code: "ERR_MISSING_STRUCTURE" }, Sg = { message: "Missing MAIN structure", code: "ERR_MISSING_MAIN_STRUCTURE" }, hD = { message: "drawDefinition contains unlinked structures", code: "ERR_MISSING_STRUCTURE_LINKS" }, bn = { message: "Invalid eventType", code: "ERR_INVALID_EVENT_TYPE" }, it = { message: "Missing event / eventId", code: "ERR_MISSING_EVENT_ID" }, li = { message: "Event not found", code: "ERR_NOT_FOUND_EVENT" }, gD = { message: "Event exists", code: "ERR_EXISTING_EVENT" }, ID = { message: "Missing entries", code: "ERR_MISSING_ENTRIES" }, yD = { message: "Invalid entries", code: "ERR_INVALID_ENTRIES" }, vg = { message: "Missing assignments", code: "ERR_MISSING_ASSIGNMENTS" }, UD = { message: "Missing stage", code: "ERR_MISSING_STAGE" }, cs = { message: "Invalid stage", code: "ERR_INVALID_STAGE" }, SD = { message: "stageSequence limit", code: "ERR_LIMIT_STAGE_SEQUENCE" }, vD = { message: "Missing positionAssignments", code: "ERR_MISSING_POSITION_ASSIGNMENTS" }, wD = { message: "Cannot Assign BYE status if no assignment: { bye: true }", code: "ERR_UNCHANGED_CANNOT_ASSIGN_BYE" }, gh = { message: "Unrecognized matchUpStatus", code: "ERR_UNRECOGNIZED_MATCHUP_STATUS" }, Ju = { message: "Unrecognized matchUpFormat", code: "ERR_UNRECOGNIZED_MATCHUP_FORMAT" }, Ud = { message: "Incompatible matchUpStatus", code: "ERR_INCOMPATIBLE_MATCHUP_STATUS" }, V1 = { message: "Propagated exits downstream", code: "ERR_PROPAGATED_EXITS_DOWNSTREAM" }, yc = { message: "Invalid matchUpStatus", code: "ERR_INVALID_MATCHUP_STATUS" }, Un = { message: "Invalid tieFormat", code: "ERR_INVALID_TIE_FORMAT" }, wg = { message: "Invalid matchUpFormat", code: "ERR_INVALID_MATCHUP_FORMAT" }, Dg = { message: "Missing matchUpFormat", code: "ERR_MISSING_MATCHUP_FORMAT" }, DD = { message: "Missing collectionDefinition", code: "ERR_MISSING_COLLECTION_DEFINITION" }, Uc = { message: "Missing tieFormat", code: "ERR_MISSING_TIE_FORMAT" }, yr = { message: "Missing matchUpId", code: "ERR_MISSING_MATCHUP_ID" }, Ys = { message: "Missing matchUpIds", code: "ERR_MISSING_MATCHUP_IDS" }, pr = { message: "matchUp not found", code: "ERR_NOT_FOUND_MATCHUP" }, ra = { message: "Missing matchUps", code: "ERR_MISSING_MATCHUPS" }, Mr = { message: "Missing matchUp", code: "ERR_MISSING_MATCHUP" }, Fr = { message: "Invalid matchUp", code: "ERR_INVALID_MATCHUP" }, Tg = { message: "Missing policyType", code: "ERR_MISSING_POLICY_TYPE" }, Mp = { message: "Missing policyDefinitions", code: "ERR_MISSING_POLICY_DEFINITIONS" }, j1 = { message: "Missing seeding policy", code: "ERR_MISSING_POLICY_SEEDING" }, TD = { message: "Missing avoidance policy", code: "ERR_MISSING_POLICY_AVOIDANCE" }, Pg = { message: "Missing policy attributes", code: "ERR_MISSING_POLICY_ATTRIBUTES" }, PD = { message: "Invalid policyDefinitions", code: "ERR_INVALID_POLICY_DEFINITIONS" }, bg = { message: "existing policyType", code: "ERR_EXISTING_POLICY_TYPE" }, G1 = { message: "Policy not attached", code: "ERR_FAILURE_POLICY_NOT_ATTACHED" }, Zu = { message: "Policy not found", code: "ERR_NOT_FOUND_POLICY" }, $1 = { message: "Missing scoring policy / matchUpFormats", code: "ERR_MISSING_POLICY_SCORING_MATCHUP_FORMATS" }, Mg = { message: "Invalid sideNumber", code: "ERR_INVALID_SIDE_NUMBER" }, W1 = { message: "Invalid setNumber", code: "ERR_INVALID_SET_NUMBER" }, Np = { message: "Missing setObject", code: "ERR_MISSING_SET_ATTRIBUTE" }, q1 = { message: "Missing setNumber", code: "ERR_MISSING_SET_NUMBER" }, H1 = { message: "Missing sideNumber", code: "ERR_MISSING_SIDE_NUMBER" }, Ks = { message: "Missing courtId", code: "ERR_MISSING_COURT_ID" }, ce = { message: "Missing value", code: "ERR_MISSING_VALUE" }, bD = { message: "Missing birthdate", code: "ERR_MISSING_BIRTH_DATE" }, MD = { message: "Missing date", code: "ERR_MISSING_DATE" }, ND = { message: "No valid dates", code: "ERR_NO_VALID_DATES" }, _d = { message: "Invalid bookings", code: "ERR_INVALID_BOOKINGS" }, Sd = { message: "Invalid dateAvailability", code: "ERR_INVALID_DATE_AVAILABILITY" }, RD = { message: "Missing dateAvailability", code: "ERR_MISSING_DATE_AVAILABILITY" }, Ht = { message: "Invalid Date", code: "ERR_INVALID_DATE" }, Si = { message: "Invalid time", code: "ERR_INVALID_TIME" }, ED = { message: "Invalid tournament dates", code: "ERR_INVALID_DATES_TOURNAMENT" }, Ih = { message: "Invalid game scores", code: "ERR_INVALID_SCORES_GAME" }, AD = { message: "Invalid score", code: "ERR_INVALID_SCORE" }, Rp = { message: "Invalid winningSide", code: "ERR_INVALID_WINNING_SIDE" }, z1 = { message: "No participants generated", code: "ERR_NO_PARTICIPANTS_GENERATED" }, Ng = { message: "Cannot modify tieFormat", code: "ERR_UNCHANGED_CANNOT_MODIFY_TIEFORMAT" }, CD = { message: "Cannot modify participantType", code: "ERR_UNCHANGED_CANNOT_MODIFY_PARTICIPANT_TYPE" }, Ep = { message: "Cannot remove participants", code: "ERR_UNCHANGED_CANNOT_REMOVE_PARTICIPANTS" }, yh = { message: "Participant category mismatch", code: "ERR_CATEGORY_MISMATCH" }, Ap = { message: "Cannot change winningSide", code: "ERR_UNCHANGED_CANNOT_CHANGE_WINNING_SIDE" }, Xs = { message: "Invalid participant", code: "ERR_INVALID_PARTICIPANT" }, Wi = { message: "Invalid participantId", code: "ERR_INVALID_PARTICIPANT_ID" }, Gr = { message: "Invalid participantIds", code: "ERR_INVALID_PARTICIPANT_IDS" }, OD = { message: "Invalid participantRole", code: "ERR_INVALID_PARTICIPANT_ROLE" }, qi = { message: "Invalid participantType", code: "ERR_INVALID_PARTICIPANT_TYPE" }, kD = { message: "Missing participantRole", code: "ERR_MISSING_PARTICIPANT_ROLE" }, Qs = { message: "Missing participant", code: "ERR_MISSING_PARTICIPANT" }, el = { message: "Missing participants", code: "ERR_MISSING_PARTICIPANTS" }, xt = { message: "Missing participantId", code: "ERR_MISSING_PARTICIPANT_ID" }, xD = { message: "Missing qualified participants", code: "ERR_MISSING_QUALIFIED_PARTICIPANTS" }, Tt = { message: "Participant Not Found", code: "ERR_NOT_FOUND_PARTICIPANT" }, FD = { message: "participantId exists", code: "ERR_EXISTING_PARTICIPANT_ID" }, Y1 = { message: "participant pair exists", code: "ERR_EXISTING_PARTICIPANT_PAIR" }, LD = { message: "No participant removed", code: "ERR_UNCHANGED_NO_PARTICIPANT_REMOVED" }, Ma = { message: "Missing participantIds", code: "ERR_MISSING_PARTICIPANT_IDS" }, _D = { message: "Missing participantsCount", code: "ERR_MISSING_PARTICIPANT_COUNT" }, BD = { message: "Participant not checked in", code: "ERR_UNCHANGED_PARTICIPANT_NOT_CHECKED_IN" }, VD = { message: "Missing person details", code: "ERR_MISSING_PERSON_DETAILS" }, Sc = { message: "Existing participant drawPosition assignment", code: "ERR_EXISTING_PARTICIPANT_DRAW_POSITION_ASSIGNMENT" }, Cp = { message: "Existing participant", code: "ERR_EXISTING_PARTICIPANT" }, Rg = { message: "participantsCount exceeds drawSize", code: "ERR_INVALID_PARTICIPANT_COUNT" }, Uh = { message: "Invalid entry status", code: "ERR_INVALID_ENTRY_STATUS" }, jD = { message: "Participant Entry Not Found", code: "ERR_NOT_FOUND_PARTICIPANT_ENTRY" }, K1 = { message: "Participant not entered in stage", code: "ERR_UNCHANGED_PARTICIPANT_NOT_ENTERED" }, X1 = { message: "Participant not found in stageSequence", code: "ERR_NOT_FOUND_PARTICIPANT_IN_STAGE" }, GD = { message: "entryStatus not allowed in stage", code: "ERR_INVALID_ENTRY_STATUS_IN_STAGE" }, $D = { message: "entryStatus not allowed for event", code: "ERR_INVALID_ENTRY_STATUS_IN_EVENT" }, Sh = { message: "No stage space available for entryStatus", code: "ERR_UNCHANGED_NO_AVAILABLE_STAGE_SPACE" }, Eg = { message: "Insufficient drawPositions to accommodate qualifiers", code: "ERR_UNCHANGED_NO_DRAW_POSITIONS_FOR_QUALIFIERS" }, Ag = { message: "Insufficient drawPositions to accommodate entries", code: "ERR_INSUFFICIENT_DRAW_POSITIONS" }, WD = { message: "Missing penaltyType", code: "ERR_MISSING_PENALTY_TYPE" }, Cg = { message: "Missing penaltyId", code: "ERR_MISSING_PENALTY_ID" }, Yo = { message: "Penalty not found", code: "ERR_NOT_FOUND_PENALTY" }, qD = { message: "Missing courtsCount/courtNames", code: "ERR_MISSING_COURTS_INFO" }, vc = { message: "Court not found", code: "ERR_NOT_FOUND_COURT" }, HD = { message: "Court exists", code: "ERR_EXISTING_COURT" }, zD = { message: "Venue exists", code: "ERR_EXISTING_VENUE" }, Js = { message: "Venue not found", code: "ERR_NOT_FOUND_VENUE" }, Na = { message: "Missing venueId", code: "ERR_MISSING_VENUE_ID" }, YD = { message: "Invalid endTime", code: "ERR_INVALID_END_TIME" }, Og = { message: "Existing endTime", code: "ERR_EXISTING_END_TIME" }, KD = { message: "Invalid stopTime", code: "ERR_INVALID_STOP_TIME" }, XD = { message: "Invalid startTime", code: "ERR_INVALID_START_TIME" }, Q1 = { message: "Invalid resumeTime", code: "ERR_INVALID_RESUME_TIME" }, kg = { message: "Invalid timeItem", code: "ERR_INVALID_TIME_ITEMS" }, QD = { message: "Missing async state provider", code: "ERR_MISSING_ASYNC_STATE_PROVIDER" }, xg = { message: "Missing timeItem", code: "ERR_MISSING_TIME_ITEM" }, Fg = { message: "Missing timeItems", code: "ERR_MISSING_TIME_ITEMS" }, Op = { message: "Missing context", code: "ERR_MISSING_CONTEXT" }, JD = { message: "Missing schedule", code: "ERR_MISSING_SCHEDULE" }, Fs = { message: "Invalid scaleItem", code: "ERR_INVALID_SCALE_ITEM" }, ZD = { message: "Modifications failed", code: "ERR_FAILURE_MODIFICATIONS" }, wc = { message: "No modifications applied", code: "ERR_UNCHANGED_NO_MODIFICATIONS_APPLIED" }, eT = { message: "Unable to assign court", code: "ERR_UNCHANGED_COURT_NOT_ASSIGNED" }, kp = { message: "No Candidates", code: "ERR_UNCHANGED_NO_CANDIDATES" }, tT = { message: "Invalid configuration", code: "ERR_INVALID_CONFIG" }, rT = { message: "Invalid collectionDefinition", code: "ERR_INVALID_COLLECTION_DEFINITION" }, ia = { message: "Invalid object", code: "ERR_INVALID_OBJECT" }, ru = { message: "Invalid gender", code: "ERR_INVALID_GENDER" }, Iu = { message: "Invalid category", code: "ERR_INVALID_CATEGORY" }, z = { message: "Invalid values", code: "ERR_INVALID_VALUES" }, iT = { message: "Duplicate value", code: "ERR_DUPLICATE_VALUE" }, Lg = { message: "Team not found", code: "ERR_NOT_FOUND_TEAM" }, nT = { message: "No valid actions", code: "ERR_NO_VALID_ACTIONS" }, xp = { message: "No valid attributes", code: "ERR_NO_VALID_ATTRIBUTES" }, _g = { message: "Value unchanged", code: "ABORT_UNCHANGED" }, Kt = { message: "Not found", code: "ERR_NOT_FOUND" }, Fp = { message: "Not implemented", code: "ERR_NOT_IMPLEMENTED" }, aT = { message: "Existing flight", code: "ERR_EXISTING_FLIGHT" }, Bg = { message: "Existing flight profile", code: "ERR_EXISTING_FLIGHT_PROFILE" }, sT = { message: "Existing outcome", code: "ERR_EXISTING_OUTCOME" }, oT = { message: "Existing matchUpId", code: "ERR_EXISTING_MATCHUP_ID" }, vh = { message: "Existing stage", code: "ERR_EXISTING_STAGE" }, Vg = { message: "Existing structure", code: "ERR_EXISTING_STRUCTURE" }, Lp = { message: "Method not found", code: "ERR_NOT_FOUND_METHOD" }, cT = { message: "Scheduled matchUps", code: "ERR_SCHEDULED_MATCHUPS" }, tl = { message: "Scores present", code: "ERR_SCORES_PRESENT" }, J1 = { ANACHRONISM: mh, CANNOT_CHANGE_WINNING_SIDE: Ap, CANNOT_MODIFY_TIEFORMAT: Ng, CANNOT_MODIFY_PARTICIPANT_TYPE: CD, CANNOT_REMOVE_MAIN_STRUCTURE: tD, CANNOT_REMOVE_PARTICIPANTS: Ep, CATEGORY_MISMATCH: yh, COURT_EXISTS: HD, COURT_NOT_FOUND: vc, DRAW_DEFINITION_NOT_FOUND: Zr, DRAW_ID_EXISTS: sD, DRAW_POSITION_ACTIVE: Pp, DRAW_POSITION_ASSIGNED: zo, DRAW_POSITION_NOT_CLEARED: nD, DRAW_POSITION_NOT_FOUND: L1, DRAW_SIZE_MISMATCH: aD, DUPLICATE_ENTRY: gu, DUPLICATE_VALUE: iT, ENTRY_STATUS_NOT_ALLOWED_FOR_EVENT: $D, ENTRY_STATUS_NOT_ALLOWED_IN_STAGE: GD, EVENT_EXISTS: gD, EVENT_NOT_FOUND: li, EXISTING_DRAW_DEFINITIONS: rD, EXISTING_END_TIME: Og, EXISTING_FLIGHT: aT, EXISTING_MATCHUP_ID: oT, EXISTING_OUTCOME: sT, EXISTING_PARTICIPANT_DRAW_POSITION_ASSIGNMENT: Sc, EXISTING_PARTICIPANT: Cp, EXISTING_POLICY_TYPE: bg, EXISTING_PROFILE: Bg, EXISTING_ROUND: fD, EXISTING_STAGE: vh, EXISTING_STRUCTURE: Vg, INCOMPATIBLE_MATCHUP_STATUS: Ud, INCOMPLETE_SOURCE_STRUCTURE: fg, INSUFFICIENT_DRAW_POSITIONS: Ag, INVALID_ACTION: lD, INVALID_ASSIGNMENT: hh, INVALID_BOOKINGS: _d, INVALID_CATEGORY: Iu, INVALID_COLLECTION_DEFINITION: rT, INVALID_CONFIGURATION: tT, INVALID_DATE_AVAILABILITY: Sd, INVALID_DATE: Ht, INVALID_DRAW_DEFINITION: Ms, INVALID_DRAW_POSITION_FOR_SEEDING: hg, INVALID_DRAW_POSITION: gc, INVALID_DRAW_SIZE: bp, INVALID_END_TIME: YD, INVALID_ENTRIES: yD, INVALID_EVENT_TYPE: bn, INVALID_GAME_SCORES: Ih, INVALID_GENDER: ru, INVALID_MATCHUP_FORMAT: wg, INVALID_MATCHUP_STATUS: yc, INVALID_MATCHUP_STATUS_BYE: wD, INVALID_MATCHUP: Fr, INVALID_OBJECT: ia, INVALID_PARTICIPANT_ID: Wi, INVALID_PARTICIPANT_IDS: Gr, INVALID_PARTICIPANT_ROLE: OD, INVALID_PARTICIPANT_SEEDING: oD, INVALID_PARTICIPANT_TYPE: qi, INVALID_PARTICIPANT: Xs, INVALID_POLICY_DEFINITION: PD, INVALID_RECORDS: fh, INVALID_SCALE_ITEM: Fs, INVALID_SEED_NUMBER: pD, INVALID_SEED_POSITION: mD, INVALID_SET_NUMBER: W1, INVALID_SIDE_NUMBER: Mg, INVALID_SCORE: AD, INVALID_STAGE: cs, INVALID_START_TIME: XD, INVALID_STRUCTURE: ss, INVALID_STOP_TIME: KD, INVALID_TIE_FORMAT: Un, INVALID_TIME: Si, INVALID_TIME_ITEM: kg, INVALID_TOURNAMENT_DATES: ED, INVALID_TOURNAMENT_RECORD: Ku, INVALID_VALUES: z, INVALID_WINNING_SIDE: Rp, MATCHUP_NOT_FOUND: pr, METHOD_NOT_FOUND: Lp, MISSING_ASSIGNMENTS: vg, MISSING_ASYNC_STATE_PROVIDER: QD, MISSING_AVOIDANCE_POLICY: TD, MISSING_BIRTH_DATE: bD, MISSING_COLLECTION_DEFINITION: DD, MISSING_COURT_ID: Ks, MISSING_COURTS_INFO: qD, MISSING_DATE_AVAILABILITY: RD, MISSING_DATE: MD, MISSING_DRAW_DEFINITION: ne, MISSING_DRAW_ID: zi, MISSING_DRAW_POSITION: Ic, MISSING_DRAW_POSITIONS: Xu, MISSING_DRAW_SIZE: Qu, MISSING_ENTRIES: ID, MISSING_EVENT: it, MISSING_QUALIFIED_PARTICIPANTS: xD, MISSING_MATCHUP_FORMAT: Dg, MISSING_MATCHUP_ID: yr, MISSING_MATCHUP_IDS: Ys, MISSING_MATCHUP: Mr, MISSING_MATCHUPS: ra, MISSING_PARTICIPANT_COUNT: _D, MISSING_PARTICIPANT_ID: xt, MISSING_PARTICIPANT_IDS: Ma, MISSING_PARTICIPANT_ROLE: kD, MISSING_PARTICIPANT: Qs, MISSING_PARTICIPANTS: el, MISSING_PENALTY_ID: Cg, MISSING_PENALTY_TYPE: WD, MISSING_PERSON_DETAILS: VD, MISSING_POLICY_ATTRIBUTES: Pg, MISSING_POLICY_DEFINITION: Mp, MISSING_POLICY_TYPE: Tg, MISSING_POSITION_ASSIGNMENTS: vD, MISSING_ROUND_NUMBER: B1, MISSING_SCHEDULE: JD, MISSING_SCORING_POLICY: $1, MISSING_SEED_ASSIGNMENTS: dD, MISSING_SEEDCOUNT_THRESHOLDS: uD, MISSING_SEEDING_POLICY: j1, MISSING_SET_NUMBER: q1, MISSING_SET_OBJECT: Np, MISSING_SIDE_NUMBER: H1, MISSING_STAGE: UD, MISSING_STRUCTURE_ID: ri, MISSING_STRUCTURE: os, MISSING_MAIN_STRUCTURE: Sg, MISSING_STRUCTURES: Ug, MISSING_TARGET_LINK: yg, MISSING_TIE_FORMAT: Uc, MISSING_TIME_ITEM: xg, MISSING_TIME_ITEMS: Fg, MISSING_TOURNAMENT_ID: Ho, MISSING_TOURNAMENT_RECORD: J, MISSING_TOURNAMENT_RECORDS: mt, MISSING_VALUE: ce, MISSING_VENUE_ID: Na, MODIFICATIONS_FAILED: ZD, NO_CANDIDATES: kp, NO_DRAW_POSITIONS_AVAILABLE_FOR_QUALIFIERS: Eg, NO_MODIFICATIONS_APPLIED: wc, NO_STAGE_SPACE_AVAILABLE_FOR_ENTRY_STATUS: Sh, NO_PARTICIPANT_REMOVED: LD, NO_VALID_ACTIONS: nT, NO_VALID_ATTRIBUTES: xp, NO_VALID_DATES: ND, NOT_FOUND: Kt, NOT_IMPLEMENTED: Fp, PARTICIPANT_COUNT_EXCEEDS_DRAW_SIZE: Rg, PARTICIPANT_ID_EXISTS: FD, PARTICIPANT_NOT_CHECKED_IN: BD, PARTICIPANT_NOT_FOUND: Tt, PARTICIPANT_PAIR_EXISTS: Y1, PENALTY_NOT_FOUND: Yo, POLICY_NOT_ATTACHED: G1, POLICY_NOT_FOUND: Zu, SCHEDULE_NOT_CLEARED: iD, SCHEDULED_MATCHUPS: cT, SCORES_PRESENT: tl, SEEDSCOUNT_GREATER_THAN_DRAW_SIZE: cD, STAGE_SEQUENCE_LIMIT: SD, STRUCTURE_NOT_FOUND: lt, TEAM_NOT_FOUND: Lg, UNABLE_TO_ASSIGN_COURT: eT, UNLINKED_STRUCTURES: hD, UNRECOGNIZED_DRAW_TYPE: gg, UNRECOGNIZED_MATCHUP_FORMAT: Ju, UNRECOGNIZED_MATCHUP_STATUS: gh, VALUE_UNCHANGED: _g, VENUE_EXISTS: zD }, ut = { disableNotifications: !1, tournamentId: void 0, tournamentRecords: {}, subscriptions: {}, modified: !1, methods: {}, notices: [] }, uT = { addNotice: lO, callListener: hO, cycleMutationStatus: uO, deleteNotice: mO, deleteNotices: pO, disableNotifications: Z1, enableNotifications: eO, getMethods: jg, getNotices: dO, getTopics: fO, getTournamentId: lT, getTournamentRecord: tO, getTournamentRecords: rO, removeTournamentRecord: sO, setMethods: cO, setSubscriptions: oO, setTournamentId: nO, setTournamentRecord: iO, setTournamentRecords: aO, handleCaughtError: gO };
952
952
  function Z1() {
953
953
  ut.disableNotifications = !0;
954
954
  }
@@ -1028,7 +1028,7 @@ function gO({ engineName: e, methodName: t, params: r, err: i }) {
1028
1028
  var Qe = { timers: { default: { elapsedTime: 0 } }, globalSubscriptions: {}, deepCopyAttributes: { stringify: [], ignore: [], toJSON: [] }, globalMethods: [], deepCopy: !0 }, Xt = uT, ev = ["addNotice", "callListener", "cycleMutationStatus", "deleteNotice", "deleteNotices", "disableNotifications", "enableNotifications", "getMethods", "getNotices", "getTopics", "getTournamentId", "getTournamentRecord", "getTournamentRecords", "removeTournamentRecord", "setSubscriptions", "setTournamentId", "setTournamentRecord", "setTournamentRecords"];
1029
1029
  function IO(e) {
1030
1030
  if (typeof e != "object") throw new Error("Global state provider can not be undefined or null");
1031
- if (St(Object.keys(e), ev).length !== ev.length) throw new Error("Global state provider is missing required methods");
1031
+ if (vt(Object.keys(e), ev).length !== ev.length) throw new Error("Global state provider is missing required methods");
1032
1032
  return Xt = e, { success: !0 };
1033
1033
  }
1034
1034
  function yO() {
@@ -1324,7 +1324,7 @@ function Vd(e) {
1324
1324
  function EO(e) {
1325
1325
  return typeof e != "object" || Array.isArray(e) ? !1 : Object.prototype.toString.call(e) === "[object Date]";
1326
1326
  }
1327
- function wc(e) {
1327
+ function Dc(e) {
1328
1328
  let t = typeof e == "string" ? e?.split(" ") : [];
1329
1329
  return e && t?.length > 1 && !["AM", "PM"].includes(t[1].toUpperCase()) ? !1 : !!(!e || ja.test(ro(e, !0, !0)));
1330
1330
  }
@@ -1365,7 +1365,7 @@ function wu(e) {
1365
1365
  let t = e instanceof Date && e || !isNaN(e) && new Date(e) || !1;
1366
1366
  return t && !isNaN(t.valueOf());
1367
1367
  }
1368
- function Yo(e, t) {
1368
+ function Ko(e, t) {
1369
1369
  if (!xr(e) || !xr(t)) return [];
1370
1370
  let r = ve(e) + "T00:00", i = ve(t) + "T00:00", n = new Date(r), a = new Date(i), s = wu(a) && wu(n) && u(n, a), o = [], c = 0;
1371
1371
  if (s) {
@@ -1405,7 +1405,7 @@ function at(e) {
1405
1405
  function ve(e) {
1406
1406
  return Ha(e) || nn.test(e) ? e.split("T")[0] : void 0;
1407
1407
  }
1408
- function Zc(e, t) {
1408
+ function eu(e, t) {
1409
1409
  let r = new Date(e);
1410
1410
  return r.setDate(r.getDate() + t), ve(r.toISOString());
1411
1411
  }
@@ -1476,7 +1476,7 @@ function Mn(e, t) {
1476
1476
  let r = new Date(e), i = new Date(t);
1477
1477
  return r.getFullYear() === i.getFullYear() && r.getMonth() === i.getMonth() && r.getDate() === i.getDate();
1478
1478
  }
1479
- var MT = { addDays: Xg, addWeek: BO, addMinutesToTimeString: kr, convertTime: ro, getIsoDateString: Vd, getUTCdateString: Yg, DateHHMM: AO, extractDate: ve, extractTime: at, formatDate: Ti, getDateByWeek: VO, isISODateString: Ha, isDate: wu, isTimeString: Kg, offsetDate: jd, offsetTime: kO, sameDay: Mn, timeStringMinutes: ke, timeToDate: Nt, timeUTC: OO, validTimeValue: wc, validDateString: Bd, timeValidation: ja, dateValidation: nn }, GO = (e, t) => e.filter(Boolean).every((r) => typeof r === t), $O = (e) => e.filter(Boolean).every(ft);
1479
+ var MT = { addDays: Xg, addWeek: BO, addMinutesToTimeString: kr, convertTime: ro, getIsoDateString: Vd, getUTCdateString: Yg, DateHHMM: AO, extractDate: ve, extractTime: at, formatDate: Ti, getDateByWeek: VO, isISODateString: Ha, isDate: wu, isTimeString: Kg, offsetDate: jd, offsetTime: kO, sameDay: Mn, timeStringMinutes: ke, timeToDate: Nt, timeUTC: OO, validTimeValue: Dc, validDateString: Bd, timeValidation: ja, dateValidation: nn }, GO = (e, t) => e.filter(Boolean).every((r) => typeof r === t), $O = (e) => e.filter(Boolean).every(ft);
1480
1480
  function Ls(e) {
1481
1481
  let t = e.category;
1482
1482
  if (typeof t != "object") return { error: Iu };
@@ -1484,7 +1484,7 @@ function Ls(e) {
1484
1484
  if (!(GO([r, i, n, o], "string") && $O([a, s]) && [i, n].filter(Boolean).every(xr))) return { error: Iu };
1485
1485
  let u = e.consideredDate ?? ve((/* @__PURE__ */ new Date()).toLocaleDateString("sv"));
1486
1486
  if (!xr(u)) return { error: Ht };
1487
- let [l] = u.split("-").slice(0, 3).map((L) => parseInt(L)), d = Zc(u, -1), [p, m] = d.split("-").slice(1, 3).map((L) => parseInt(L)), f = `${ci(p)}-${ci(m)}`, h = Zc(u, 1), [g, I] = h.split("-").slice(1, 3).map((L) => parseInt(L)), y = `${ci(g)}-${ci(I)}`, U = s && Zc(u, -1 * 365 * s), w = a && Zc(u, -1 * 365 * a), v = [], D = (L) => !v.includes(L) && v.push(L);
1487
+ let [l] = u.split("-").slice(0, 3).map((L) => parseInt(L)), d = eu(u, -1), [p, m] = d.split("-").slice(1, 3).map((L) => parseInt(L)), f = `${ci(p)}-${ci(m)}`, h = eu(u, 1), [g, I] = h.split("-").slice(1, 3).map((L) => parseInt(L)), y = `${ci(g)}-${ci(I)}`, U = s && eu(u, -1 * 365 * s), w = a && eu(u, -1 * 365 * a), v = [], D = (L) => !v.includes(L) && v.push(L);
1488
1488
  r = r ?? o;
1489
1489
  let S = /^([UO]?)(\d{1,2})([UO]?)$/, T = /^C(\d{1,2})-(\d{1,2})$/, b = r?.includes("-"), P = b && r?.match(T), M = r?.match(S), N = (L, _) => `${L}-${_}`, R = (L) => {
1490
1490
  let _ = l - L, B = N(_, y);
@@ -1565,7 +1565,7 @@ function WO(e) {
1565
1565
  let { tieFormat: t, stack: r } = e;
1566
1566
  return !e || !t || !Ce(t) ? F({ result: { error: Un }, context: { tieFormat: t, message: "tieformat must be an object" }, stack: r }) : Ce(t.winCriteria) ? Array.isArray(t.collectionDefinitions) ? { ...x } : F({ result: { error: Un }, context: { tieFormat: t, message: "collectionDefinitions must be an array" }, stack: r }) : F({ result: { error: Un }, context: { tieFormat: t, message: "tieformat.winCritiera must be an object" }, stack: r });
1567
1567
  }
1568
- var Ko = "resourceSubType", Xo = "resourceType", Qo = "identifier", qO = { RESOURCE_SUB_TYPE: Ko, RESOURCE_TYPE: Xo, IDENTIFIER: Qo };
1568
+ var Xo = "resourceSubType", Qo = "resourceType", Jo = "identifier", qO = { RESOURCE_SUB_TYPE: Xo, RESOURCE_TYPE: Qo, IDENTIFIER: Jo };
1569
1569
  function ie(e, t, r, i, n = 0) {
1570
1570
  if (Dh().makeDeepCopy) return Dh().makeDeepCopy(e, t, r, i);
1571
1571
  let a = Gg(), { stringify: s, toJSON: o, ignore: c, modulate: u } = a || {};
@@ -1607,19 +1607,19 @@ var RT = { collectionDefinitions: [{ collectionName: "Male Singles", matchUpForm
1607
1607
  return s.hydrate ? (i = { winCriteria: { valueGoal: s.valueGoal }, collectionDefinitions: [{ collectionId: o(0), matchUpFormat: BT, collectionName: "Doubles", matchUpType: We, ...s.doubles }, { collectionId: o(1), matchUpFormat: Pi, collectionName: "Singles", matchUpType: Ye, ...s.singles }] }, s.tieFormatName && (i.tieFormatName = s.tieFormatName)) : (s.collectionDefinitions.forEach((c, u) => c.collectionId = o(u)), i = s), e?.hydrateCollections && i.collectionDefinitions.forEach((c) => {
1608
1608
  n && !c.category && (c.category = n), a && !c.gender && (c.gender = a);
1609
1609
  }), i;
1610
- }, zn = ek, an = "SINGLES", _s = "SINGLES", di = "DOUBLES", Yn = "DOUBLES", Ot = "TEAM", Hr = "TEAM", tk = "RATING", rk = "BOTH", ik = { AGE: "AGE", BOTH: rk, DOUBLES: di, DOUBLES_EVENT: Yn, RATING: tk, SINGLES: an, SINGLES_EVENT: _s, TEAM_EVENT: Hr, TEAM: Ot }, re = "MAIN", oe = "QUALIFYING", sr = "CONSOLATION", zt = "VOLUNTARY_CONSOLATION", yt = "PLAY_OFF", $p = [re, oe, sr, yt, zt], Bs = { [oe]: 1, [re]: 2, [yt]: 3, [sr]: 3, [zt]: 4 }, dP = "finishingPositions", pP = "aggregateEventStructures", mP = { [re]: 1, [yt]: 2, [sr]: 3, [oe]: 4, [zt]: 5 }, nk = { [yt]: 1, [re]: 2, [sr]: 3, [oe]: 4, [zt]: 5 }, Wp = "CLUSTER", ak = "SEPARATE", za = "WATERFALL", qp = "ITEM", Pr = "CONTAINER", wi = "DRAW", Hp = "RANDOM", Di = "TOP_DOWN", Ya = "BOTTOM_UP", Nn = "POSITION", Rn = "WINNER", En = "LOSER", sn = "FIRST_MATCHUP", zr = "AD_HOC", sk = "AD_HOC", Dc = "FEED_IN", Jo = "COMPASS", Zo = "OLYMPIC", ok = "SINGLE_ELIMINATION", Zi = "SINGLE_ELIMINATION", ol = "DOUBLE_ELIMINATION", ec = "FIRST_MATCH_LOSER_CONSOLATION", cl = "FIRST_ROUND_LOSER_CONSOLATION", us = "LUCKY_DRAW", zp = "CURTIS_CONSOLATION", ck = "CURTIS_CONSOLATION", Zg = "FEED_IN_CHAMPIONSHIP_TO_SF", Tu = "FEED_IN_CHAMPIONSHIP_TO_SF", eI = "FEED_IN_CHAMPIONSHIP_TO_QF", Pu = "FEED_IN_CHAMPIONSHIP_TO_QF", tI = "FEED_IN_CHAMPIONSHIP_TO_R16", bu = "FEED_IN_CHAMPIONSHIP_TO_R16", fP = "MODIFIED_FEED_IN_CHAMPIONSHIP", Mu = "MODIFIED_FEED_IN_CHAMPIONSHIP", ul = "FEED_IN_CHAMPIONSHIP", uk = "DOUBLE_ROUND_ROBIN", Ri = "ROUND_ROBIN", An = "ROUND_ROBIN_WITH_PLAYOFF", hP = "DECIDER", gP = "BACKDRAW", rI = { 0: { name: "East", abbreviation: "E" }, "0-1": { name: "West", abbreviation: "W" }, "0-2": { name: "North", abbreviation: "N" }, "0-3": { name: "Northeast", abbreviation: "NE" }, "0-1-1": { name: "South", abbreviation: "S" }, "0-1-2": { name: "Southwest", abbreviation: "SW" }, "0-2-1": { name: "Northwest", abbreviation: "NW" }, "0-1-1-1": { name: "Southeast", abbreviation: "SE" } }, iI = { 0: { name: "East", abbreviation: "E" }, "0-1": { name: "West", abbreviation: "W" }, "0-2": { name: "North", abbreviation: "N" }, "0-1-1": { name: "South", abbreviation: "S" } }, Ka = "WIN_RATIO", io = "ROUND_OUTCOME", IP = [Jo, zp, Pu, bu, Tu, ul, eI, tI, Zg, ec, cl, us, Mu, Zo, yt, An], lk = [zr, Jo, zp, ol, Pu, bu, Tu, ul, Dc, ec, cl, us, Mu, Zo, yt, Ri, An, Zi], yP = { MAIN: re, QUALIFYING: oe, CONSOLATION: sr, ITEM: qp, CONTAINER: Pr, FIRST_MATCHUP: sn, WINNER: Rn, LOSER: En, AD_HOC: zr, FEED_IN: Dc, FLEX_ROUNDS: sk, COMPASS: Jo, PLAY_OFF: yt, OLYMPIC: Zo, KNOCKOUT: ok, SINGLE_ELIMINATION: Zi, DOUBLE_ELIMINATION: ol, CURTIS: zp, FICSF: Zg, FICQF: eI, FICR16: tI, MFIC: fP, VOLUNTARY_CONSOLATION: zt, FIRST_MATCH_LOSER_CONSOLATION: ec, FIRST_ROUND_LOSER_CONSOLATION: cl, MODIFIED_FEED_IN_CHAMPIONSHIP: Mu, FEED_IN_CHAMPIONSHIP_TO_R16: bu, FEED_IN_CHAMPIONSHIP_TO_QF: Pu, FEED_IN_CHAMPIONSHIP_TO_SF: Tu, FEED_IN_CHAMPIONSHIP: ul, LUCKY_DRAW: us, ROUND_ROBIN_WITH_PLAYOFF: An, ROUND_ROBIN: Ri, DECIDER: hP, BACKDRAW: gP, COMPASS_ATTRIBUTES: rI, OLYMPIC_ATTRIBUTES: iI, DRAW: wi, RANDOM: Hp, TOP_DOWN: Di, BOTTOM_UP: Ya, WATERFALL: za, WIN_RATIO: Ka, ROUND_OUTCOME: io, MULTI_STRUCTURE_DRAWS: IP, generatedDrawTypes: lk, stageOrder: Bs, finishOrder: mP, AGGREGATE_EVENT_STRUCTURES: pP, FINISHING_POSITIONS: dP }, dk = yP, mr = "tournamentRecords", nI = "policyDefinitions", Bt = "tournamentRecord", aI = "onlineResource", hr = "drawDefinition", UP = "tieFormatName", sI = "matchUpFormat", Cn = "participantId", SP = "scheduleDates", pk = "tournamentId", mk = "scheduleDate", fk = "roundNumber", Yp = "structureId", oI = "participant", ll = "matchUpIds", vP = "entryStage", hk = "policyType", wP = "structures", cI = "eventType", dn = "matchUpId", Kp = "tieFormat", Xp = "inContext", Qp = "structure", Jp = "courtIds", gk = "personId", Zp = "venueIds", uI = "matchUps", DP = "courtId", TP = "eventId", Ln = "matchUp", PP = "drawId", bi = "error", na = "event", Tc = "param", lI = "uuids", Ik = "averageMatchUpMinutes", yk = "recoveryMinutes", Uk = "periodLength", Sk = "number", Or = "object", ur = "array", ir = "_validate", bP = "_message", ti = "_invalid", Ar = "_ofType", dI = "_anyOf", tc = "_oneOf", ov = { [aI]: (e) => St(Object.keys(e), [Ko, Xo, Qo]).length === 3, [UP]: (e) => e && zn({ namedFormat: e }), [lI]: (e) => !e || Array.isArray(e) && e.every(ct), [Kp]: (e) => !Nr({ tieFormat: e }).error, [cI]: (e) => [an, di, Ot].includes(e), [vP]: (e) => $p.includes(e) }, vk = { [mr]: mt, [Bt]: J, [nI]: Mp, [hr]: ne, [Cn]: xt, [sI]: Dg, [pk]: qo, [Yp]: ri, [ll]: Ys, [oI]: Qs, [aI]: ia, [cI]: bn, [wP]: Ug, [dn]: yr, [Kp]: Un, [Qp]: os, [DP]: Ks, [uI]: ra, [TP]: li, [Ln]: Mr, [Jp]: ce, [Zp]: ce, [PP]: zi, [na]: it }, wk = { [mr]: Or, [nI]: Or, [Bt]: Or, [hr]: Or, [aI]: Or, [SP]: ur, [oI]: Or, [ll]: ur, [wP]: ur, [Kp]: Or, [Qp]: Or, [Jp]: ur, [Zp]: ur, [uI]: ur, [Ln]: Or, [na]: Or, [lI]: ur };
1610
+ }, zn = ek, an = "SINGLES", _s = "SINGLES", di = "DOUBLES", Yn = "DOUBLES", Ot = "TEAM", Hr = "TEAM", tk = "RATING", rk = "BOTH", ik = { AGE: "AGE", BOTH: rk, DOUBLES: di, DOUBLES_EVENT: Yn, RATING: tk, SINGLES: an, SINGLES_EVENT: _s, TEAM_EVENT: Hr, TEAM: Ot }, re = "MAIN", oe = "QUALIFYING", sr = "CONSOLATION", zt = "VOLUNTARY_CONSOLATION", Ut = "PLAY_OFF", $p = [re, oe, sr, Ut, zt], Bs = { [oe]: 1, [re]: 2, [Ut]: 3, [sr]: 3, [zt]: 4 }, dP = "finishingPositions", pP = "aggregateEventStructures", mP = { [re]: 1, [Ut]: 2, [sr]: 3, [oe]: 4, [zt]: 5 }, nk = { [Ut]: 1, [re]: 2, [sr]: 3, [oe]: 4, [zt]: 5 }, Wp = "CLUSTER", ak = "SEPARATE", za = "WATERFALL", qp = "ITEM", Pr = "CONTAINER", wi = "DRAW", Hp = "RANDOM", Di = "TOP_DOWN", Ya = "BOTTOM_UP", Nn = "POSITION", Rn = "WINNER", En = "LOSER", sn = "FIRST_MATCHUP", zr = "AD_HOC", sk = "AD_HOC", Tc = "FEED_IN", Zo = "COMPASS", ec = "OLYMPIC", ok = "SINGLE_ELIMINATION", Zi = "SINGLE_ELIMINATION", ol = "DOUBLE_ELIMINATION", tc = "FIRST_MATCH_LOSER_CONSOLATION", cl = "FIRST_ROUND_LOSER_CONSOLATION", us = "LUCKY_DRAW", zp = "CURTIS_CONSOLATION", ck = "CURTIS_CONSOLATION", Zg = "FEED_IN_CHAMPIONSHIP_TO_SF", Tu = "FEED_IN_CHAMPIONSHIP_TO_SF", eI = "FEED_IN_CHAMPIONSHIP_TO_QF", Pu = "FEED_IN_CHAMPIONSHIP_TO_QF", tI = "FEED_IN_CHAMPIONSHIP_TO_R16", bu = "FEED_IN_CHAMPIONSHIP_TO_R16", fP = "MODIFIED_FEED_IN_CHAMPIONSHIP", Mu = "MODIFIED_FEED_IN_CHAMPIONSHIP", ul = "FEED_IN_CHAMPIONSHIP", uk = "DOUBLE_ROUND_ROBIN", Ri = "ROUND_ROBIN", An = "ROUND_ROBIN_WITH_PLAYOFF", hP = "DECIDER", gP = "BACKDRAW", rI = { 0: { name: "East", abbreviation: "E" }, "0-1": { name: "West", abbreviation: "W" }, "0-2": { name: "North", abbreviation: "N" }, "0-3": { name: "Northeast", abbreviation: "NE" }, "0-1-1": { name: "South", abbreviation: "S" }, "0-1-2": { name: "Southwest", abbreviation: "SW" }, "0-2-1": { name: "Northwest", abbreviation: "NW" }, "0-1-1-1": { name: "Southeast", abbreviation: "SE" } }, iI = { 0: { name: "East", abbreviation: "E" }, "0-1": { name: "West", abbreviation: "W" }, "0-2": { name: "North", abbreviation: "N" }, "0-1-1": { name: "South", abbreviation: "S" } }, Ka = "WIN_RATIO", io = "ROUND_OUTCOME", IP = [Zo, zp, Pu, bu, Tu, ul, eI, tI, Zg, tc, cl, us, Mu, ec, Ut, An], lk = [zr, Zo, zp, ol, Pu, bu, Tu, ul, Tc, tc, cl, us, Mu, ec, Ut, Ri, An, Zi], yP = { MAIN: re, QUALIFYING: oe, CONSOLATION: sr, ITEM: qp, CONTAINER: Pr, FIRST_MATCHUP: sn, WINNER: Rn, LOSER: En, AD_HOC: zr, FEED_IN: Tc, FLEX_ROUNDS: sk, COMPASS: Zo, PLAY_OFF: Ut, OLYMPIC: ec, KNOCKOUT: ok, SINGLE_ELIMINATION: Zi, DOUBLE_ELIMINATION: ol, CURTIS: zp, FICSF: Zg, FICQF: eI, FICR16: tI, MFIC: fP, VOLUNTARY_CONSOLATION: zt, FIRST_MATCH_LOSER_CONSOLATION: tc, FIRST_ROUND_LOSER_CONSOLATION: cl, MODIFIED_FEED_IN_CHAMPIONSHIP: Mu, FEED_IN_CHAMPIONSHIP_TO_R16: bu, FEED_IN_CHAMPIONSHIP_TO_QF: Pu, FEED_IN_CHAMPIONSHIP_TO_SF: Tu, FEED_IN_CHAMPIONSHIP: ul, LUCKY_DRAW: us, ROUND_ROBIN_WITH_PLAYOFF: An, ROUND_ROBIN: Ri, DECIDER: hP, BACKDRAW: gP, COMPASS_ATTRIBUTES: rI, OLYMPIC_ATTRIBUTES: iI, DRAW: wi, RANDOM: Hp, TOP_DOWN: Di, BOTTOM_UP: Ya, WATERFALL: za, WIN_RATIO: Ka, ROUND_OUTCOME: io, MULTI_STRUCTURE_DRAWS: IP, generatedDrawTypes: lk, stageOrder: Bs, finishOrder: mP, AGGREGATE_EVENT_STRUCTURES: pP, FINISHING_POSITIONS: dP }, dk = yP, mr = "tournamentRecords", nI = "policyDefinitions", Bt = "tournamentRecord", aI = "onlineResource", hr = "drawDefinition", UP = "tieFormatName", sI = "matchUpFormat", Cn = "participantId", SP = "scheduleDates", pk = "tournamentId", mk = "scheduleDate", fk = "roundNumber", Yp = "structureId", oI = "participant", ll = "matchUpIds", vP = "entryStage", hk = "policyType", wP = "structures", cI = "eventType", dn = "matchUpId", Kp = "tieFormat", Xp = "inContext", Qp = "structure", Jp = "courtIds", gk = "personId", Zp = "venueIds", uI = "matchUps", DP = "courtId", TP = "eventId", Ln = "matchUp", PP = "drawId", bi = "error", na = "event", Pc = "param", lI = "uuids", Ik = "averageMatchUpMinutes", yk = "recoveryMinutes", Uk = "periodLength", Sk = "number", Or = "object", ur = "array", ir = "_validate", bP = "_message", ti = "_invalid", Ar = "_ofType", dI = "_anyOf", rc = "_oneOf", ov = { [aI]: (e) => vt(Object.keys(e), [Xo, Qo, Jo]).length === 3, [UP]: (e) => e && zn({ namedFormat: e }), [lI]: (e) => !e || Array.isArray(e) && e.every(ct), [Kp]: (e) => !Nr({ tieFormat: e }).error, [cI]: (e) => [an, di, Ot].includes(e), [vP]: (e) => $p.includes(e) }, vk = { [mr]: mt, [Bt]: J, [nI]: Mp, [hr]: ne, [Cn]: xt, [sI]: Dg, [pk]: Ho, [Yp]: ri, [ll]: Ys, [oI]: Qs, [aI]: ia, [cI]: bn, [wP]: Ug, [dn]: yr, [Kp]: Un, [Qp]: os, [DP]: Ks, [uI]: ra, [TP]: li, [Ln]: Mr, [Jp]: ce, [Zp]: ce, [PP]: zi, [na]: it }, wk = { [mr]: Or, [nI]: Or, [Bt]: Or, [hr]: Or, [aI]: Or, [SP]: ur, [oI]: Or, [ll]: ur, [wP]: ur, [Kp]: Or, [Qp]: Or, [Jp]: ur, [Zp]: ur, [uI]: ur, [Ln]: Or, [na]: Or, [lI]: ur };
1611
1611
  function se(e, t, r) {
1612
1612
  if (!e && !Ce(e)) return { error: z };
1613
1613
  if (!t?.length || e?._bypassParamCheck) return { valid: !0 };
1614
1614
  if (!Array.isArray(t)) return { error: z };
1615
1615
  let { paramError: i, errorParam: n } = Pk(e, t);
1616
1616
  if (!i) return { valid: !0 };
1617
- let a = i[ir] && (i[bi] || i[ti]) || e?.[n] === void 0 && (i[bi] || i[ti] || vk[n] || z) || z, s = n ?? (i[tc] && Object.keys(i[tc]).join(", "));
1617
+ let a = i[ir] && (i[bi] || i[ti]) || e?.[n] === void 0 && (i[bi] || i[ti] || vk[n] || z) || z, s = n ?? (i[rc] && Object.keys(i[rc]).join(", "));
1618
1618
  return F({ info: { param: s, message: i[bP] }, result: { error: a }, stack: r });
1619
1619
  }
1620
1620
  function MP(e, t) {
1621
1621
  let r = Object.keys(e), i = Object.keys(t);
1622
- return St(r, i);
1622
+ return vt(r, i);
1623
1623
  }
1624
1624
  function Dk(e, t) {
1625
1625
  if (!t) return;
@@ -1654,7 +1654,7 @@ function Mk(e, t) {
1654
1654
  return Vr(t) ? t(e) : !0;
1655
1655
  }
1656
1656
  var pI = "DYNAMIC", ya = "RANKING", fa = "RATING", Xa = "SCALE", vn = "SEEDING", Nk = { RANKING: ya, RATING: fa, SCALE: Xa, SEEDING: vn };
1657
- function Pc(e) {
1657
+ function bc(e) {
1658
1658
  let t = se(e, [{ [oI]: !0 }]);
1659
1659
  if (t.error) return t;
1660
1660
  let r = e.participant.timeItems?.filter(({ itemType: n }) => n?.startsWith(Xa) && [ya, fa, vn].includes(n.split(".")[1])), i = { ratings: {}, rankings: {}, seedings: {} };
@@ -1696,13 +1696,13 @@ function Vs(e) {
1696
1696
  }
1697
1697
  }
1698
1698
  }
1699
- var bh = "voluntaryConsolation", $n = "competitiveBands", mI = "roundRobinTally", On = "positionActions", Yt = "matchUpActions", wd = "rankingPoints", Kn = "roundNaming", bc = "participant", Nu = "progression", Ra = "scheduling", Ru = "avoidance", Rk = "participant", Ek = "display", pi = "scoring", vi = "seeding", rc = "feedIn", Ak = "audit", qd = "draws", Ck = { POLICY_TYPE_VOLUNTARY_CONSOLATION: bh, POLICY_TYPE_COMPETITIVE_BANDS: $n, POLICY_TYPE_ROUND_ROBIN_TALLY: mI, POLICY_TYPE_POSITION_ACTIONS: On, POLICY_TYPE_MATCHUP_ACTIONS: Yt, POLICY_TYPE_RANKING_POINTS: wd, POLICY_TYPE_ROUND_NAMING: Kn, POLICY_TYPE_PARTICIPANT: bc, POLICY_TYPE_PROGRESSION: Nu, POLICY_TYPE_SCHEDULING: Ra, POLICY_TYPE_AVOIDANCE: Ru, POLICY_TYPE_DISPLAY: Ek, POLICY_TYPE_PRIVACY: Rk, POLICY_TYPE_FEED_IN: rc, POLICY_TYPE_SCORING: pi, POLICY_TYPE_SEEDING: vi, POLICY_TYPE_AUDIT: Ak, POLICY_TYPE_DRAWS: qd };
1699
+ var bh = "voluntaryConsolation", $n = "competitiveBands", mI = "roundRobinTally", On = "positionActions", Yt = "matchUpActions", wd = "rankingPoints", Kn = "roundNaming", Mc = "participant", Nu = "progression", Ra = "scheduling", Ru = "avoidance", Rk = "participant", Ek = "display", pi = "scoring", vi = "seeding", ic = "feedIn", Ak = "audit", qd = "draws", Ck = { POLICY_TYPE_VOLUNTARY_CONSOLATION: bh, POLICY_TYPE_COMPETITIVE_BANDS: $n, POLICY_TYPE_ROUND_ROBIN_TALLY: mI, POLICY_TYPE_POSITION_ACTIONS: On, POLICY_TYPE_MATCHUP_ACTIONS: Yt, POLICY_TYPE_RANKING_POINTS: wd, POLICY_TYPE_ROUND_NAMING: Kn, POLICY_TYPE_PARTICIPANT: Mc, POLICY_TYPE_PROGRESSION: Nu, POLICY_TYPE_SCHEDULING: Ra, POLICY_TYPE_AVOIDANCE: Ru, POLICY_TYPE_DISPLAY: Ek, POLICY_TYPE_PRIVACY: Rk, POLICY_TYPE_FEED_IN: ic, POLICY_TYPE_SCORING: pi, POLICY_TYPE_SEEDING: vi, POLICY_TYPE_AUDIT: Ak, POLICY_TYPE_DRAWS: qd };
1700
1700
  function Ua({ tournamentParticipants: e = [], policyDefinitions: t = {}, contextProfile: r, participantId: i, internalUse: n, personId: a }) {
1701
1701
  let s = e.find((c) => i && c.participantId === i || a && c.person && c.person.personId === a), o = ie(s, !1, n);
1702
1702
  if (o) {
1703
- let c = t?.[bc];
1703
+ let c = t?.[Mc];
1704
1704
  if (r?.withScaleValues) {
1705
- let { ratings: u, rankings: l } = Pc({ participant: o });
1705
+ let { ratings: u, rankings: l } = bc({ participant: o });
1706
1706
  o.rankings = l, o.ratings = u;
1707
1707
  }
1708
1708
  if (c?.participant) return Vs({ template: c.participant, source: o });
@@ -1798,7 +1798,7 @@ function De({ discover: e, element: t, name: r, ...i }) {
1798
1798
  let n = t.extensions.find((a) => a?.name === r);
1799
1799
  return { extension: n, info: n ? void 0 : Kt };
1800
1800
  }
1801
- var Fk = "activeSuspension", Eu = "appliedPolicies", AP = "context", rm = "delegatedOutcome", ji = "disabled", js = "disableAutoCalc", im = "disableLinks", Hd = "display", Ga = "drawDeletions", Lk = "drawProfile", zd = "entryProfile", _k = "eventProfile", Bk = "eventWithdrawalRequests", Vk = "factory", Ei = "flightProfile", Mh = "groupingAttribute", Xn = "lineUps", Qa = "linkedTournamentsIds", nm = "matchUpHistory", gI = "participantRepresentatives", Mc = "personRequests", jo = "positionActions", jk = "rankingPoints", Gk = "registration", pn = "roundTarget", pl = "scheduleLimits", Qn = "scheduleTiming", Gs = "schedulingProfile", $k = "statusDetail", ic = "subOrder", Jn = "tally", iu = "tieFormatModification", CP = { ACTIVE_SUSPENSION: Fk, APPLIED_POLICIES: Eu, CONTEXT: AP, DELEGATED_OUTCOME: rm, DISABLED: ji, DISABLE_LINKS: im, DISABLE_AUTO_CALC: js, DISPLAY: Hd, DRAW_DELETIONS: Ga, DRAW_PROFILE: Lk, ENTRY_PROFILE: zd, EVENT_PROFILE: _k, EVENT_WITHDRAWAL_REQUESTS: Bk, FLIGHT_PROFILE: Ei, GROUPING_ATTRIBUTE: Mh, LINEUPS: Xn, LINKED_TOURNAMENTS: Qa, MATCHUP_HISTORY: nm, PARTICIPANT_REPRESENTATIVES: gI, PERSON_REQUESTS: Mc, POSITION_ACTIONS: jo, RANKING_POINTS: jk, REGISTRATION: Gk, ROUND_TARGET: pn, SCHEDULE_LIMITS: pl, SCHEDULE_TIMING: Qn, SCHEDULING_PROFILE: Gs, STATUS_DETAIL: $k, SUB_ORDER: ic, TALLY: Jn, TIE_FORMAT_MODIFICATIONS: iu, FACTORY: Vk }, cv = [rm, ji, js, im, Ei, Xn, Qa, nm, gI, Mc, pn, pl, Qn, Gs, ic, Jn, iu];
1801
+ var Fk = "activeSuspension", Eu = "appliedPolicies", AP = "context", rm = "delegatedOutcome", ji = "disabled", js = "disableAutoCalc", im = "disableLinks", Hd = "display", Ga = "drawDeletions", Lk = "drawProfile", zd = "entryProfile", _k = "eventProfile", Bk = "eventWithdrawalRequests", Vk = "factory", Ei = "flightProfile", Mh = "groupingAttribute", Xn = "lineUps", Qa = "linkedTournamentsIds", nm = "matchUpHistory", gI = "participantRepresentatives", Nc = "personRequests", Go = "positionActions", jk = "rankingPoints", Gk = "registration", pn = "roundTarget", pl = "scheduleLimits", Qn = "scheduleTiming", Gs = "schedulingProfile", $k = "statusDetail", nc = "subOrder", Jn = "tally", iu = "tieFormatModification", CP = { ACTIVE_SUSPENSION: Fk, APPLIED_POLICIES: Eu, CONTEXT: AP, DELEGATED_OUTCOME: rm, DISABLED: ji, DISABLE_LINKS: im, DISABLE_AUTO_CALC: js, DISPLAY: Hd, DRAW_DELETIONS: Ga, DRAW_PROFILE: Lk, ENTRY_PROFILE: zd, EVENT_PROFILE: _k, EVENT_WITHDRAWAL_REQUESTS: Bk, FLIGHT_PROFILE: Ei, GROUPING_ATTRIBUTE: Mh, LINEUPS: Xn, LINKED_TOURNAMENTS: Qa, MATCHUP_HISTORY: nm, PARTICIPANT_REPRESENTATIVES: gI, PERSON_REQUESTS: Nc, POSITION_ACTIONS: Go, RANKING_POINTS: jk, REGISTRATION: Gk, ROUND_TARGET: pn, SCHEDULE_LIMITS: pl, SCHEDULE_TIMING: Qn, SCHEDULING_PROFILE: Gs, STATUS_DETAIL: $k, SUB_ORDER: nc, TALLY: Jn, TIE_FORMAT_MODIFICATIONS: iu, FACTORY: Vk }, cv = [rm, ji, js, im, Ei, Xn, Qa, nm, gI, Nc, pn, pl, Qn, Gs, nc, Jn, iu];
1802
1802
  function OP({ tournamentRecords: e }) {
1803
1803
  if (typeof e != "object" || !Object.keys(e).length) return { error: mt };
1804
1804
  let t = dl({ tournamentRecords: e }), { tournamentIds: r } = t;
@@ -1811,9 +1811,9 @@ function kP({ tournamentRecords: e }) {
1811
1811
  }
1812
1812
  function xP({ tournamentRecords: e, tournamentId: t }) {
1813
1813
  if (typeof e != "object") return { error: z };
1814
- if (!t) return { error: qo };
1814
+ if (!t) return { error: Ho };
1815
1815
  let r = dl({ tournamentRecords: e }), { tournamentIds: i } = r;
1816
- if (!i.includes(t)) return { error: qo };
1816
+ if (!i.includes(t)) return { error: Ho };
1817
1817
  let n;
1818
1818
  return i.every((a) => {
1819
1819
  let s = e[a], { extension: o } = De({ element: s, name: Qa });
@@ -1838,17 +1838,17 @@ function ml({ tournamentRecords: e }) {
1838
1838
  })) };
1839
1839
  }
1840
1840
  var LP = {};
1841
- Pe(LP, { adHocPositionSwap: () => RM, addAdHocMatchUps: () => Om, addDrawDefinitionTimeItem: () => yy, addFinishingRounds: () => Nl, addGoesTo: () => Za, addPlayoffStructures: () => Cm, addQualifyingStructure: () => NM, addVoluntaryConsolationStage: () => vM, addVoluntaryConsolationStructure: () => ay, allPlayoffPositionsFilled: () => hy, alternateDrawPositionAssignment: () => uM, assignDrawPosition: () => eN, assignDrawPositionBye: () => ai, attachConsolationStructures: () => XM, attachPlayoffStructures: () => ky, attachQualifyingStructure: () => Iy, attachStructures: () => Am, autoSeeding: () => zV, automatedPlayoffPositioning: () => xc, automatedPositioning: () => _l, checkValidEntries: () => Fm, deleteAdHocMatchUps: () => rN, drawMatic: () => aU, findDrawDefinition: () => By, generateAdHocMatchUps: () => Lm, generateAdHocRounds: () => nU, generateAndPopulatePlayoffStructures: () => Cy, generateDrawDefinition: () => td, generateDrawMaticRound: () => zy, generateDrawStructuresAndLinks: () => Wy, generateDrawTypeAndModifyDrawDefinition: () => qy, generateQualifyingStructure: () => Ty, generateVoluntaryConsolation: () => MN, getAssignedParticipantIds: () => Is, getAvailableMatchUpsCount: () => km, getAvailablePlayoffProfiles: () => jl, getDrawDefinitionTimeItem: () => FI, getDrawParticipantRepresentativeIds: () => Ly, getDrawStructures: () => Ai, getDrawTypeCoercion: () => zl, getEligibleVoluntaryConsolationParticipants: () => Fy, getMatchUpsMap: () => er, getParticipantIdFinishingPositions: () => _y, getPositionAssignments: () => _u, getPositionsPlayedOff: () => Fc, getRandomQualifierList: () => Gy, getSeedingThresholds: () => uy, getSeedsCount: () => Yl, getStructureSeedAssignments: () => mi, getTeamLineUp: () => Ja, getValidGroupSizes: () => Fl, isAdHoc: () => Rr, isCompletedStructure: () => Fn, isValidForQualifying: () => $y, luckyLoserDrawPositionAssignment: () => iM, modifyDrawDefinition: () => QM, modifyDrawName: () => xy, modifySeedAssignment: () => fM, mutate: () => _P, positionActions: () => jy, pruneDrawDefinition: () => ZM, qualifierDrawPositionAssignment: () => gy, qualifierProgression: () => hM, query: () => aN, removeDrawPositionAssignment: () => xu, removeRoundMatchUps: () => iN, removeSeededParticipant: () => MM, removeStructure: () => UM, renameStructures: () => yM, resetDrawDefinition: () => JM, resetQualifyingStructure: () => wM, resetVoluntaryConsolationStructure: () => eb, setDrawParticipantRepresentativeIds: () => BP, setPositionAssignments: () => oM, setStructureOrder: () => gM, setSubOrder: () => nN, shiftAdHocRounds: () => sM, swapAdHocRounds: () => cM, swapDrawPositionAssignments: () => PM, updateTeamLineUp: () => yo, withdrawParticipantAtDrawPosition: () => Kb });
1841
+ Pe(LP, { adHocPositionSwap: () => RM, addAdHocMatchUps: () => Om, addDrawDefinitionTimeItem: () => yy, addFinishingRounds: () => Nl, addGoesTo: () => Za, addPlayoffStructures: () => Cm, addQualifyingStructure: () => NM, addVoluntaryConsolationStage: () => vM, addVoluntaryConsolationStructure: () => ay, allPlayoffPositionsFilled: () => hy, alternateDrawPositionAssignment: () => uM, assignDrawPosition: () => eN, assignDrawPositionBye: () => ai, attachConsolationStructures: () => XM, attachPlayoffStructures: () => ky, attachQualifyingStructure: () => Iy, attachStructures: () => Am, autoSeeding: () => zV, automatedPlayoffPositioning: () => Fc, automatedPositioning: () => _l, checkValidEntries: () => Fm, deleteAdHocMatchUps: () => rN, drawMatic: () => aU, findDrawDefinition: () => By, generateAdHocMatchUps: () => Lm, generateAdHocRounds: () => nU, generateAndPopulatePlayoffStructures: () => Cy, generateDrawDefinition: () => td, generateDrawMaticRound: () => zy, generateDrawStructuresAndLinks: () => Wy, generateDrawTypeAndModifyDrawDefinition: () => qy, generateQualifyingStructure: () => Ty, generateVoluntaryConsolation: () => MN, getAssignedParticipantIds: () => Is, getAvailableMatchUpsCount: () => km, getAvailablePlayoffProfiles: () => jl, getDrawDefinitionTimeItem: () => FI, getDrawParticipantRepresentativeIds: () => Ly, getDrawStructures: () => Ai, getDrawTypeCoercion: () => zl, getEligibleVoluntaryConsolationParticipants: () => Fy, getMatchUpsMap: () => er, getParticipantIdFinishingPositions: () => _y, getPositionAssignments: () => _u, getPositionsPlayedOff: () => Lc, getRandomQualifierList: () => Gy, getSeedingThresholds: () => uy, getSeedsCount: () => Yl, getStructureSeedAssignments: () => mi, getTeamLineUp: () => Ja, getValidGroupSizes: () => Fl, isAdHoc: () => Rr, isCompletedStructure: () => Fn, isValidForQualifying: () => $y, luckyLoserDrawPositionAssignment: () => iM, modifyDrawDefinition: () => QM, modifyDrawName: () => xy, modifySeedAssignment: () => fM, mutate: () => _P, positionActions: () => jy, pruneDrawDefinition: () => ZM, qualifierDrawPositionAssignment: () => gy, qualifierProgression: () => hM, query: () => aN, removeDrawPositionAssignment: () => xu, removeRoundMatchUps: () => iN, removeSeededParticipant: () => MM, removeStructure: () => UM, renameStructures: () => yM, resetDrawDefinition: () => JM, resetQualifyingStructure: () => wM, resetVoluntaryConsolationStructure: () => eb, setDrawParticipantRepresentativeIds: () => BP, setPositionAssignments: () => oM, setStructureOrder: () => gM, setSubOrder: () => nN, shiftAdHocRounds: () => sM, swapAdHocRounds: () => cM, swapDrawPositionAssignments: () => PM, updateTeamLineUp: () => yo, withdrawParticipantAtDrawPosition: () => Kb });
1842
1842
  var _P = {};
1843
- Pe(_P, { adHocPositionSwap: () => RM, addAdHocMatchUps: () => Om, addDrawDefinitionTimeItem: () => yy, addPlayoffStructures: () => Cm, addQualifyingStructure: () => NM, addVoluntaryConsolationStage: () => vM, addVoluntaryConsolationStructure: () => ay, alternateDrawPositionAssignment: () => uM, assignDrawPosition: () => eN, assignDrawPositionBye: () => ai, attachConsolationStructures: () => XM, attachPlayoffStructures: () => ky, attachQualifyingStructure: () => Iy, attachStructures: () => Am, automatedPlayoffPositioning: () => xc, automatedPositioning: () => _l, deleteAdHocMatchUps: () => rN, luckyLoserDrawPositionAssignment: () => iM, modifyDrawDefinition: () => QM, modifyDrawName: () => xy, modifySeedAssignment: () => fM, pruneDrawDefinition: () => ZM, qualifierDrawPositionAssignment: () => gy, qualifierProgression: () => hM, removeDrawPositionAssignment: () => xu, removeRoundMatchUps: () => iN, removeSeededParticipant: () => MM, removeStructure: () => UM, renameStructures: () => yM, resetDrawDefinition: () => JM, resetQualifyingStructure: () => wM, resetVoluntaryConsolationStructure: () => eb, setDrawParticipantRepresentativeIds: () => BP, setPositionAssignments: () => oM, setStructureOrder: () => gM, setSubOrder: () => nN, shiftAdHocRounds: () => sM, swapAdHocRounds: () => cM, swapDrawPositionAssignments: () => PM, updateTeamLineUp: () => yo, withdrawParticipantAtDrawPosition: () => Kb });
1843
+ Pe(_P, { adHocPositionSwap: () => RM, addAdHocMatchUps: () => Om, addDrawDefinitionTimeItem: () => yy, addPlayoffStructures: () => Cm, addQualifyingStructure: () => NM, addVoluntaryConsolationStage: () => vM, addVoluntaryConsolationStructure: () => ay, alternateDrawPositionAssignment: () => uM, assignDrawPosition: () => eN, assignDrawPositionBye: () => ai, attachConsolationStructures: () => XM, attachPlayoffStructures: () => ky, attachQualifyingStructure: () => Iy, attachStructures: () => Am, automatedPlayoffPositioning: () => Fc, automatedPositioning: () => _l, deleteAdHocMatchUps: () => rN, luckyLoserDrawPositionAssignment: () => iM, modifyDrawDefinition: () => QM, modifyDrawName: () => xy, modifySeedAssignment: () => fM, pruneDrawDefinition: () => ZM, qualifierDrawPositionAssignment: () => gy, qualifierProgression: () => hM, removeDrawPositionAssignment: () => xu, removeRoundMatchUps: () => iN, removeSeededParticipant: () => MM, removeStructure: () => UM, renameStructures: () => yM, resetDrawDefinition: () => JM, resetQualifyingStructure: () => wM, resetVoluntaryConsolationStructure: () => eb, setDrawParticipantRepresentativeIds: () => BP, setPositionAssignments: () => oM, setStructureOrder: () => gM, setSubOrder: () => nN, shiftAdHocRounds: () => sM, swapAdHocRounds: () => cM, swapDrawPositionAssignments: () => PM, updateTeamLineUp: () => yo, withdrawParticipantAtDrawPosition: () => Kb });
1844
1844
  var II = (e) => (t) => e[t], yI = (e = []) => e.map($t).filter(Boolean), Nh = (e = []) => e.map(be).filter(Boolean), be = (e = {}) => II(e)("participantId"), $t = (e = {}) => II(e)("matchUpId"), Au = (e = {}) => II(e)("drawId");
1845
1845
  function BP({ representativeParticipantIds: e, drawDefinition: t }) {
1846
1846
  if (!t) return { error: Zr };
1847
1847
  if (!Array.isArray(e)) return { error: z };
1848
1848
  let r = Nh(t?.entries || []);
1849
- return e.length && St(e, r).length < e.length ? { error: z } : em({ drawDefinition: t, extension: { name: gI, value: e } });
1849
+ return e.length && vt(e, r).length < e.length ? { error: z } : em({ drawDefinition: t, extension: { name: gI, value: e } });
1850
1850
  }
1851
- var Lr = "ABANDONED", no = "AWAITING_RESULT", mn = "CANCELLED", Ut = "COMPLETED", Nc = "DEAD_RUBBER", ze = "DEFAULTED", kt = "DOUBLE_DEFAULT", dt = "DOUBLE_WALKOVER", ki = "IN_PROGRESS", Yr = "INCOMPLETE", UI = "NOT_PLAYED", jt = "RETIRED", Aa = "SUSPENDED", vt = "TO_BE_PLAYED", nt = "WALKOVER", Wk = [no, Ut, ze, ki, Yr, jt, Aa], VP = [no, Ut, ze, dt, kt, ki, Yr, jt, Aa, nt], jP = [Lr, no, "BYE", mn, Ut, Nc, ze, dt, kt, ki, Yr, UI, jt, Aa, vt, nt], GP = ["BYE", dt, kt, Ut, ze, jt, nt], $P = [Lr, no, mn, Nc, ki, Yr, UI, Aa, vt, void 0], Ft = [mn, Lr, Ut, Nc, ze, dt, kt, jt, nt], SI = [Lr, Ut, ze, dt, kt, ki, jt, nt], WP = [ki, Yr, Aa, vt], am = { ABANDONED: Lr, AWAITING_RESULT: no, BYE: "BYE", CANCELLED: mn, COMPLETED: Ut, DEAD_RUBBER: Nc, DEFAULTED: ze, DOUBLE_WALKOVER: dt, DOUBLE_DEFAULT: kt, IN_PROGRESS: ki, INCOMPLETE: Yr, NOT_PLAYED: UI, RETIRED: jt, SUSPENDED: Aa, TO_BE_PLAYED: vt, WALKOVER: nt };
1851
+ var Lr = "ABANDONED", no = "AWAITING_RESULT", mn = "CANCELLED", St = "COMPLETED", Rc = "DEAD_RUBBER", ze = "DEFAULTED", kt = "DOUBLE_DEFAULT", dt = "DOUBLE_WALKOVER", ki = "IN_PROGRESS", Yr = "INCOMPLETE", UI = "NOT_PLAYED", jt = "RETIRED", Aa = "SUSPENDED", wt = "TO_BE_PLAYED", nt = "WALKOVER", Wk = [no, St, ze, ki, Yr, jt, Aa], VP = [no, St, ze, dt, kt, ki, Yr, jt, Aa, nt], jP = [Lr, no, "BYE", mn, St, Rc, ze, dt, kt, ki, Yr, UI, jt, Aa, wt, nt], GP = ["BYE", dt, kt, St, ze, jt, nt], $P = [Lr, no, mn, Rc, ki, Yr, UI, Aa, wt, void 0], Ft = [mn, Lr, St, Rc, ze, dt, kt, jt, nt], SI = [Lr, St, ze, dt, kt, ki, jt, nt], WP = [ki, Yr, Aa, wt], am = { ABANDONED: Lr, AWAITING_RESULT: no, BYE: "BYE", CANCELLED: mn, COMPLETED: St, DEAD_RUBBER: Rc, DEFAULTED: ze, DOUBLE_WALKOVER: dt, DOUBLE_DEFAULT: kt, IN_PROGRESS: ki, INCOMPLETE: Yr, NOT_PLAYED: UI, RETIRED: jt, SUSPENDED: Aa, TO_BE_PLAYED: wt, WALKOVER: nt };
1852
1852
  function ao(e, t, r) {
1853
1853
  let i = (d) => De({ element: d, name: pn })?.extension?.value, n = r?.deprioritizeCompleted, a = r?.mode === pP && nk, s = r?.mode === dP && mP, o = s || a || Bs, c = (d) => d?.stage === re && d?.stageSequence === 1, u = (d) => c(d) ? -1 : o[d?.stage], l = (d) => d?.matchUps.every(({ matchUpStatus: p }) => Ft.includes(p) ? 1 : -1);
1854
1854
  return n && l(e) - l(t) || a && u(e) - u(t) || (e?.stage && o[e.stage] || 0) - (t?.stage && o[t.stage] || 0) || (i(e) || 0) - (i(t) || 0) || !s && !a && (t?.positionAssignments?.length ?? 1 / 0) - (e?.positionAssignments?.length ?? 1 / 0) || (e?.stageSequence ?? 0) - (t?.stageSequence ?? 0) || (Yd(e) || 0) - (Yd(t) || 0);
@@ -1968,8 +1968,8 @@ function xI({ drawPositions: e, structure: t }) {
1968
1968
  }
1969
1969
  function um(e) {
1970
1970
  let { appliedPolicies: t, positionAction: r, drawDefinition: i } = e;
1971
- if (t?.audit?.[jo] === !1) return;
1972
- let { extension: n } = De({ name: jo, element: i }), a = Array.isArray(n?.value) ? n?.value ?? [] : [];
1971
+ if (t?.audit?.[Go] === !1) return;
1972
+ let { extension: n } = De({ name: Go, element: i }), a = Array.isArray(n?.value) ? n?.value ?? [] : [];
1973
1973
  if (!a?.length) {
1974
1974
  let o = i.structures.find((c) => c.stage === re);
1975
1975
  if (o) {
@@ -1977,10 +1977,10 @@ function um(e) {
1977
1977
  a.push({ name: "initialMainAssignments", initialAssignments: c });
1978
1978
  }
1979
1979
  }
1980
- let s = { value: a.concat(r), name: jo };
1980
+ let s = { value: a.concat(r), name: Go };
1981
1981
  Le({ element: i, extension: s });
1982
1982
  }
1983
- function Rc({ tournamentRecord: e, drawDefinition: t, event: r }) {
1983
+ function Ec({ tournamentRecord: e, drawDefinition: t, event: r }) {
1984
1984
  let i = (e?.events || r && [r])?.map((o) => o?.drawDefinitions).flat().filter(Boolean) || t && [t] || [], n = {}, a = {}, s = i.map((o) => o?.structures?.filter((c) => c?.structures)).flat().filter(Boolean);
1985
1985
  for (let o of s) {
1986
1986
  let { structures: c, structureId: u } = o ?? {};
@@ -2125,7 +2125,7 @@ function ab({ withIndividualParticipants: e, convertExtensions: t, tournamentRec
2125
2125
  I.missingParticipantIds.length && u.push(...I.missingParticipantIds);
2126
2126
  }
2127
2127
  if (i && (l[f].participant.signedIn = ex(m)), n) {
2128
- let { ratings: I, rankings: y, seedings: U } = Pc({ participant: m });
2128
+ let { ratings: I, rankings: y, seedings: U } = bc({ participant: m });
2129
2129
  l[f].participant.seedings = U, l[f].participant.rankings = y, l[f].participant.ratings = I;
2130
2130
  }
2131
2131
  (c || o) && ib({ participant: l[f].participant, withISO2: o, withIOC: c });
@@ -2171,7 +2171,7 @@ function ps({ participantsProfile: e, useParticipantMap: t, tournamentRecord: r,
2171
2171
  (e?.withIOC || e?.withISO2) && a.forEach((o) => ib({ participant: o, ...e }));
2172
2172
  let s;
2173
2173
  if ((n || e?.withGroupings) && a?.length && ({ participantsWithGroupings: a, groupInfo: s } = dm({ participantsProfile: e, deepCopy: !1, participants: a })), e?.withScaleValues && a?.length) for (let o of a) {
2174
- let { ratings: c, rankings: u } = Pc({ participant: o });
2174
+ let { ratings: c, rankings: u } = bc({ participant: o });
2175
2175
  o.rankings = u, o.ratings = c;
2176
2176
  }
2177
2177
  return { participants: a, groupInfo: s };
@@ -2227,7 +2227,7 @@ function yl({ drawDefinition: e }) {
2227
2227
  let { extension: t } = De({ element: e, name: zd });
2228
2228
  return { entryProfile: t?.value || {} };
2229
2229
  }
2230
- var Mi = "ALTERNATE", Ul = "CONFIRMED", _r = "DIRECT_ACCEPTANCE", Sl = "FEED_IN", vl = "JUNIOR_EXEMPT", Zn = "LUCKY_LOSER", wl = "ORGANISER_ACCEPTANCE", Dl = "QUALIFIER", nx = "REGISTERED", Tl = "SPECIAL_EXEMPT", Ii = "UNGROUPED", fs = "UNPAIRED", nc = "WILDCARD", kn = "WITHDRAWN", Td = [Ul, _r, vl, wl, Tl], ob = [Sl, Zn, Dl], hs = [Ul, _r, Sl, vl, wl, Tl, nc], xi = [Ul, _r, vl, Zn, Dl, wl, Tl, nc], cb = [Mi, Ul, _r, Sl, vl, Zn, wl, Dl, nx, Tl, Ii, fs, nc, kn], ax = { ALTERNATE: Mi, CONFIRMED: Ul, DIRECT_ACCEPTANCE: _r, DIRECT_ENTRY_STATUSES: hs, DRAW_SPECIFIC_STATUSES: ob, EQUIVALENT_ACCEPTANCE_STATUSES: Td, FEED_IN: Sl, JUNIOR_EXEMPT: vl, LUCKY_LOSER: Zn, ORGANISER_ACCEPTANCE: wl, QUALIFIER: Dl, SPECIAL_EXEMPT: Tl, STRUCTURE_SELECTED_STATUSES: xi, UNGROUPED: Ii, UNPAIRED: fs, VALID_ENTRY_STATUSES: cb, WILDCARD: nc, WITHDRAWN: kn };
2230
+ var Mi = "ALTERNATE", Ul = "CONFIRMED", _r = "DIRECT_ACCEPTANCE", Sl = "FEED_IN", vl = "JUNIOR_EXEMPT", Zn = "LUCKY_LOSER", wl = "ORGANISER_ACCEPTANCE", Dl = "QUALIFIER", nx = "REGISTERED", Tl = "SPECIAL_EXEMPT", Ii = "UNGROUPED", fs = "UNPAIRED", ac = "WILDCARD", kn = "WITHDRAWN", Td = [Ul, _r, vl, wl, Tl], ob = [Sl, Zn, Dl], hs = [Ul, _r, Sl, vl, wl, Tl, ac], xi = [Ul, _r, vl, Zn, Dl, wl, Tl, ac], cb = [Mi, Ul, _r, Sl, vl, Zn, wl, Dl, nx, Tl, Ii, fs, ac, kn], ax = { ALTERNATE: Mi, CONFIRMED: Ul, DIRECT_ACCEPTANCE: _r, DIRECT_ENTRY_STATUSES: hs, DRAW_SPECIFIC_STATUSES: ob, EQUIVALENT_ACCEPTANCE_STATUSES: Td, FEED_IN: Sl, JUNIOR_EXEMPT: vl, LUCKY_LOSER: Zn, ORGANISER_ACCEPTANCE: wl, QUALIFIER: Dl, SPECIAL_EXEMPT: Tl, STRUCTURE_SELECTED_STATUSES: xi, UNGROUPED: Ii, UNPAIRED: fs, VALID_ENTRY_STATUSES: cb, WILDCARD: ac, WITHDRAWN: kn };
2231
2231
  function jI({ stage: e, drawDefinition: t }) {
2232
2232
  let { entryProfile: r } = yl({ drawDefinition: t }), i = Object.keys(r).includes(e);
2233
2233
  if (!i && $p.includes(e)) {
@@ -2252,7 +2252,7 @@ function so({ provisionalPositioning: e, placementGroup: t, drawDefinition: r, s
2252
2252
  let p = De({ name: pn, element: d })?.extension?.value, m = c && d.entryStage === c || o?.length && d.entryStage && o.includes(d.entryStage), f = !n || d.entryStatus && n.includes(d.entryStatus), h = d.entryStageSequence ?? 1;
2253
2253
  return m && (!i || h === i) && f && (!s || !p || s === p) ? l.concat(d) : l;
2254
2254
  }, []) ?? [];
2255
- if (a && c === yt) {
2255
+ if (a && c === Ut) {
2256
2256
  let { playoffEntries: l, error: d } = cx({ provisionalPositioning: e, drawDefinition: r, structureId: a });
2257
2257
  return d && console.log("playoff entries error"), (l?.length ? l : u).filter((p) => !t || p.placementGroup === t);
2258
2258
  }
@@ -2275,7 +2275,7 @@ function cx({ provisionalPositioning: e, drawDefinition: t, structureId: r }) {
2275
2275
  });
2276
2276
  (!e || m) && f.forEach((h) => {
2277
2277
  let g = p[h], { groupOrder: I, provisionalOrder: y, GEMscore: U } = g, w = I || e && y, v = [...a ?? []].sort(Ct).indexOf(w) + 1;
2278
- i.push({ entryStage: yt, entryStatus: Sl, placementGroup: v, groupingValue: d, participantId: h, GEMscore: U });
2278
+ i.push({ entryStage: Ut, entryStatus: Sl, placementGroup: v, groupingValue: d, participantId: h, GEMscore: U });
2279
2279
  });
2280
2280
  });
2281
2281
  }
@@ -2290,7 +2290,7 @@ function mi({ provisionalPositioning: e, returnAllProxies: t, drawDefinition: r,
2290
2290
  let o = Ke({ structure: n }).positionAssignments;
2291
2291
  if (a || !n) return { seedAssignments: [], error: lt };
2292
2292
  i || (i = n.structureId);
2293
- let { stage: c, stageSequence: u } = n, l = c === yt && r && so({ provisionalPositioning: e, drawDefinition: r, stageSequence: u, structureId: i, stage: c }), d = l ? l.filter((f) => f.placementGroup === 1).sort((f, h) => f.GEMscore < h.GEMscore && 1 || f.GEMscore > h.GEMscore && -1 || 0).map((f, h) => {
2293
+ let { stage: c, stageSequence: u } = n, l = c === Ut && r && so({ provisionalPositioning: e, drawDefinition: r, stageSequence: u, structureId: i, stage: c }), d = l ? l.filter((f) => f.placementGroup === 1).sort((f, h) => f.GEMscore < h.GEMscore && 1 || f.GEMscore > h.GEMscore && -1 || 0).map((f, h) => {
2294
2294
  let g = h + 1;
2295
2295
  return { participantId: f.participantId, seedValue: g, seedProxy: !0, seedNumber: g };
2296
2296
  }) : [], p = d?.slice(0, t ? d.length : o.length / 2);
@@ -2400,7 +2400,7 @@ function Dr({ matchUps: e = [], interpolate: t }) {
2400
2400
  let D = v?.filter(Boolean) || [];
2401
2401
  if (!D?.length) return [void 0, void 0];
2402
2402
  if (d < 3 && D?.length === 2) return v?.slice().sort(Ct);
2403
- let S = St(h, D).length !== D?.length;
2403
+ let S = vt(h, D).length !== D?.length;
2404
2404
  if (D?.length && S) return D?.length === 1 ? [D[0], void 0] : v?.slice().sort(Ct);
2405
2405
  let T = (w - 1) * 2;
2406
2406
  return I.slice(T, T + 2).map((b) => D?.find((P) => b.includes(P)));
@@ -2468,7 +2468,7 @@ function lb({ drawDefinition: e }) {
2468
2468
  }
2469
2469
  return { exitProfiles: t };
2470
2470
  function a({ exitProfiles: s, exitProfile: o, structureId: c, targetRound: u, aggregator: l, stage: d }) {
2471
- s[c] || (s[c] = []), o === "0" && [sr, yt].includes(d) || s[c].push(o);
2471
+ s[c] || (s[c] = []), o === "0" && [sr, Ut].includes(d) || s[c].push(o);
2472
2472
  let p = i.filter((m) => m.source.structureId === c && m.source.roundNumber >= u);
2473
2473
  for (let m of p) {
2474
2474
  let f = m.source.roundNumber, h = m.target.roundNumber, g = m.target.structureId, I = r.find((U) => U.structureId === g).stage, y = [I, g, h, f].join("|");
@@ -2505,7 +2505,7 @@ function Rr({ structure: e }) {
2505
2505
  let t = e.matchUps || e.roundMatchUps && Object.values(e.roundMatchUps).flat(), r = !!t?.find((n) => n?.roundPosition), i = !!t?.find((n) => n?.drawPositions?.length);
2506
2506
  return !e?.structures && e?.stage !== zt && (!t.length || !r && !i);
2507
2507
  }
2508
- var $I = { [Kn]: { policyName: "Round Naming Default", namingConventions: { round: "Round", pre: "Pre" }, qualifyingFinishMap: { 1: "Final" }, abbreviatedRoundNamingMap: { 1: "F", 2: "SF", 4: "QF" }, roundNamingMap: { 1: "Final", 2: "Semifinal", 4: "Quarterfinal" }, affixes: { roundNumber: "R", preFeedRound: "Q", preQualifying: "P" }, stageConstants: { [re]: "", [yt]: "P", [oe]: "Q", [sr]: "C" } } }, mx = $I;
2508
+ var $I = { [Kn]: { policyName: "Round Naming Default", namingConventions: { round: "Round", pre: "Pre" }, qualifyingFinishMap: { 1: "Final" }, abbreviatedRoundNamingMap: { 1: "F", 2: "SF", 4: "QF" }, roundNamingMap: { 1: "Final", 2: "Semifinal", 4: "Quarterfinal" }, affixes: { roundNumber: "R", preFeedRound: "Q", preQualifying: "P" }, stageConstants: { [re]: "", [Ut]: "P", [oe]: "Q", [sr]: "C" } } }, mx = $I;
2509
2509
  function db({ roundNamingPolicy: e, drawDefinition: t, structure: r, matchUps: i }) {
2510
2510
  let { roundProfile: n, roundMatchUps: a } = Dr({ matchUps: i }), { structureAbbreviation: s, stage: o } = r, c = Rr({ structure: r }), u = GI({ structure: r }), l = r.structures, d = {}, p = $I[Kn], m = r.stage === oe, f = m ? Math.max(...(t?.structures ?? []).filter((N) => N.stage === oe).map(({ stageSequence: N }) => N ?? 1), 0) : 0, h = (r.stageSequence ?? 1) < f ? r.stageSequence ?? 1 : "", g = h && (e?.affixes?.preQualifying || p.affixes.preQualifying) || "", I = e?.roundNamingMap || p.roundNamingMap || {}, y = e?.abbreviatedRoundNamingMap || p.abbreviatedRoundNamingMap || {}, U = e?.affixes?.preFeedRound || p.affixes.preFeedRound, w = e?.affixes?.roundNumber || p.affixes.roundNumber, v = (e?.namingConventions || p.namingConventions).round, D = o && o !== re ? o[0] : "", S = e?.stageConstants || p.stageConstants, T = o && S?.[o] || D, b = `${g}${T}${h}`, P = n ? Object.keys(n) : [], M = m && S?.[oe] ? `${S?.[oe]}-` : "";
2511
2511
  if (l || c || u) Object.assign(d, ...P.map((N) => {
@@ -2723,7 +2723,7 @@ function mo({ tournamentRecords: e, tournamentRecord: t, courtId: r }) {
2723
2723
  if (u.success) return u.venue && Ml({ tournamentRecord: t, venue: u.venue }), { ...x, court: n, venue: a };
2724
2724
  }
2725
2725
  }
2726
- return F({ result: { error: Sc }, stack: i });
2726
+ return F({ result: { error: vc }, stack: i });
2727
2727
  }
2728
2728
  function YI(e) {
2729
2729
  return ie(mo(e), !1, !0);
@@ -2736,7 +2736,7 @@ function Im({ tournamentRecord: e, internalUse: t, courtId: r }) {
2736
2736
  let n = i.court && (({ altitude: a, courtId: s, courtName: o, courtDimensions: c, latitude: u, longitude: l, surfaceCategory: d, surfaceType: p, surfacedDate: m, pace: f, notes: h }) => ({ altitude: a, courtId: s, courtName: o, courtDimensions: c, latitude: u, longitude: l, surfaceCategory: d, surfaceType: p, surfacedDate: m, pace: f, notes: h }))(i.court);
2737
2737
  return { ...x, courtInfo: ie(n, !1, t) };
2738
2738
  }
2739
- function ac(e) {
2739
+ function sc(e) {
2740
2740
  let t = se(e, [{ [Bt]: !0 }, { venueId: !0, [bi]: Na }]);
2741
2741
  if (t.error) return t;
2742
2742
  let { tournamentRecord: r, venueId: i } = e, n = Bn({ tournamentRecord: r, venueId: i });
@@ -2751,7 +2751,7 @@ function xx({ matchUp: e }) {
2751
2751
  return a && (!i || r(a) > r(i)) ? a : i;
2752
2752
  }, void 0)?.itemValue };
2753
2753
  }
2754
- function wt({ event: e, eventId: t }) {
2754
+ function Dt({ event: e, eventId: t }) {
2755
2755
  if (!e) return { error: it };
2756
2756
  let r = De({ name: Ei, element: e })?.extension, i = t ? ie(r?.value, !1, !0) : r?.value;
2757
2757
  return t && e.drawDefinitions?.forEach((n) => {
@@ -2769,7 +2769,7 @@ function Er(e) {
2769
2769
  let p = (d?.drawDefinitions ?? []).find((m) => m.drawId === i);
2770
2770
  if (p) u = p, c = a[d.eventId].tournamentId;
2771
2771
  else {
2772
- let m = (d && wt({ event: d })?.flightProfile)?.flights?.find((f) => f.drawId === i);
2772
+ let m = (d && Dt({ event: d })?.flightProfile)?.flights?.find((f) => f.drawId === i);
2773
2773
  if (m) return c = a[d.eventId].tournamentId, { entries: m.drawEntries, drawName: m.drawName, tournamentId: c, drawId: i };
2774
2774
  }
2775
2775
  return p;
@@ -2803,12 +2803,12 @@ function ym(e) {
2803
2803
  ({ averageMinutes: O = 0, recoveryMinutes: L = 0, typeChangeRecoveryMinutes: _ = 0 } = gm({ timingDetails: K, eventType: G })), (O || L) && (k = f ? kr(at(f), L) : kr(P, O + L)), _ && (B = f ? kr(at(f), _) : kr(P, O + _));
2804
2804
  }
2805
2805
  !N && P && (N = ve(P));
2806
- let $ = Vd({ scheduledDate: N, scheduledTime: P }), j = {}, V = (a && E && ac({ tournamentRecord: a, venueId: E }))?.venueData || {};
2806
+ let $ = Vd({ scheduledDate: N, scheduledTime: P }), j = {}, V = (a && E && sc({ tournamentRecord: a, venueId: E }))?.venueData || {};
2807
2807
  E && (j[E] = V);
2808
2808
  let { venueName: H, venueAbbreviation: W, courtsInfo: Y } = V, q = (C && Y?.find((K) => K.courtId === C))?.courtName;
2809
2809
  for (let K of b || []) {
2810
2810
  if (!a) break;
2811
- K.venueId && !j[K.venueid] && (j[K.venueId] = ac({ venueId: K.venueId, tournamentRecord: a })?.venueData);
2811
+ K.venueId && !j[K.venueid] && (j[K.venueId] = sc({ venueId: K.venueId, tournamentRecord: a })?.venueData);
2812
2812
  let X = j[K.venueId];
2813
2813
  K.venueName = X?.venueName;
2814
2814
  let Q = X?.courtsInfo?.find((Z) => Z.courtId === K.courtId);
@@ -2864,7 +2864,7 @@ function Ci({ tournamentParticipants: e, tournamentRecord: t, participantIds: r
2864
2864
  if (!Array.isArray(r) || r.length > 2) return { error: Gr };
2865
2865
  if (!r.length) return F({ result: { error: Ma }, stack: i });
2866
2866
  e = e ?? t?.participants ?? [];
2867
- let n = e.filter((o) => o.participantType === we && St(r, o.individualParticipantIds).length === r.length && o.individualParticipantIds.length === r.length), a = n[0];
2867
+ let n = e.filter((o) => o.participantType === we && vt(r, o.individualParticipantIds).length === r.length && o.individualParticipantIds.length === r.length), a = n[0];
2868
2868
  if (!a) return F({ result: { error: Tt }, stack: i });
2869
2869
  let s = ie(n.slice(1), !1, !0);
2870
2870
  return { participant: ie(a), duplicatedPairParticipants: s, ...x };
@@ -2946,7 +2946,7 @@ function Rb({ scheduleVisibilityFilters: e, sourceDrawPositionRanges: t, tournam
2946
2946
  Object.assign(Ie, ie({ sides: Te }, !0, !0));
2947
2947
  }
2948
2948
  if (r && Ie.sides) {
2949
- let Se = p?.[bc], He = (Ee) => {
2949
+ let Se = p?.[Mc], He = (Ee) => {
2950
2950
  let Oe = g?.[Ee]?.participant;
2951
2951
  return Oe && Vs({ template: Se?.participant, source: Oe });
2952
2952
  };
@@ -3087,7 +3087,7 @@ function Sm({ requireParticipants: e = !0, scheduleVisibilityFilters: t, tournam
3087
3087
  function Wx({ drawDefinition: e, roundNumber: t, structureId: r }) {
3088
3088
  if (!e) return { error: ne };
3089
3089
  if (!r) return { error: ri };
3090
- let { links: i } = Ec({ drawDefinition: e, structureId: r }), n = i.source.reduce((s, o) => !o.source.roundNumber || o.source.roundNumber === t ? s.concat(o) : s, []), a = i.target.reduce((s, o) => !o.target.roundNumber || o.target.roundNumber === t ? s.concat(o) : s, []);
3090
+ let { links: i } = Ac({ drawDefinition: e, structureId: r }), n = i.source.reduce((s, o) => !o.source.roundNumber || o.source.roundNumber === t ? s.concat(o) : s, []), a = i.target.reduce((s, o) => !o.target.roundNumber || o.target.roundNumber === t ? s.concat(o) : s, []);
3091
3091
  return { links: { source: n, target: a } };
3092
3092
  }
3093
3093
  function kf({ finishingPositions: e, linkCondition: t, linkType: r, source: i }) {
@@ -3097,7 +3097,7 @@ function kf({ finishingPositions: e, linkCondition: t, linkType: r, source: i })
3097
3097
  });
3098
3098
  return [Rn, En].includes(n?.linkType) && !n?.source?.roundNumber ? F({ result: { error: z }, stack: "getTargetLink", context: n }) : n;
3099
3099
  }
3100
- function Ec({ drawDefinition: e, structureId: t, roundNumber: r }) {
3100
+ function Ac({ drawDefinition: e, structureId: t, roundNumber: r }) {
3101
3101
  return e ? t ? { links: (e.links || []).filter(Boolean).reduce((i, n) => (n.source?.structureId === t && (!r || n.source.roundNumber === r) && (i.source = i.source.concat(n)), n.target?.structureId === t && (!r || n.target.roundNumber === r) && (i.target = i.target.concat(n)), i), { source: [], target: [] }) } : { error: ri } : { error: ne };
3102
3102
  }
3103
3103
  function qx({ structureMatchUps: e, matchUp: t }) {
@@ -3188,7 +3188,7 @@ function Kx(e) {
3188
3188
  }
3189
3189
  function Eb({ matchUp: e, drawDefinition: t, inContextDrawMatchUps: r }) {
3190
3190
  let { matchUpId: i, matchUpStatus: n, structureId: a } = e || {};
3191
- if (!e || !a || e?.matchUpStatus === vt) return { matchUp: e };
3191
+ if (!e || !a || e?.matchUpStatus === wt) return { matchUp: e };
3192
3192
  if (n === "BYE") {
3193
3193
  let s;
3194
3194
  return e.winnerMatchUpId ? s = r.find(({ matchUpId: o }) => o === e.winnerMatchUpId) : { winnerMatchUp: s } = Tr({ inContextDrawMatchUps: r, drawDefinition: t, matchUpId: i })?.targetMatchUps || {}, Eb({ matchUp: s, drawDefinition: t, inContextDrawMatchUps: r });
@@ -3201,12 +3201,12 @@ function Ff(e) {
3201
3201
  function Rt(e) {
3202
3202
  let t = "getAllDrawMatchUps";
3203
3203
  Object.assign(e, { requireParticipants: !1 });
3204
- let r = Ac(e);
3204
+ let r = Cc(e);
3205
3205
  if (r.error) return F({ result: r, stack: t });
3206
3206
  let { abandonedMatchUps: i, completedMatchUps: n, upcomingMatchUps: a, pendingMatchUps: s, byeMatchUps: o, matchUpsMap: c } = r;
3207
3207
  return { matchUps: (i ?? []).concat(...n ?? [], ...a ?? [], ...s ?? [], ...o ?? []), matchUpsMap: c };
3208
3208
  }
3209
- function Ac(e) {
3209
+ function Cc(e) {
3210
3210
  if (!e?.drawDefinition) return { error: ne };
3211
3211
  let { tournamentParticipants: t, contextContent: r, matchUpsMap: i } = e, { scheduleVisibilityFilters: n, tournamentAppliedPolicies: a, requireParticipants: s, participantsProfile: o, afterRecoveryTimes: c, policyDefinitions: u, tournamentRecord: l, usePublishState: d, contextFilters: p, matchUpFilters: m, scheduleTiming: f, participantMap: h, publishStatus: g, contextProfile: I, drawDefinition: y, nextMatchUps: U, inContext: w, context: v, event: D } = e, S = [], T = [], b = [], P = [], M = [];
3212
3212
  I && !r && (r = sa({ policyDefinitions: u, tournamentRecord: l, contextProfile: I, event: D }));
@@ -3403,13 +3403,13 @@ function KI({ matchUpStatus: e, winningSide: t, tieMatchUps: r, sides: i, score:
3403
3403
  return _t({ score: n }) || s || t && a || e && Qx({ matchUpStatus: e }) && ![ze, nt, ki].includes(e);
3404
3404
  }
3405
3405
  function El(e) {
3406
- let { drawDefinition: t, findContainer: r, structureId: i, event: n } = e, a = e.structure, { containedStructures: s } = Rc({ drawDefinition: t }), o = i ? s[i] || [] : [], c = { isCollectionMatchUp: !1 };
3406
+ let { drawDefinition: t, findContainer: r, structureId: i, event: n } = e, a = e.structure, { containedStructures: s } = Ec({ drawDefinition: t }), o = i ? s[i] || [] : [], c = { isCollectionMatchUp: !1 };
3407
3407
  if (!a) {
3408
3408
  let S = me({ drawDefinition: t, structureId: i });
3409
3409
  if (S.error) return S;
3410
3410
  a = r ? S.containingStructure ?? S.structure : S.structure;
3411
3411
  }
3412
- if (Rr({ structure: a })) return { structure: a, isAdHoc: !0, error: hc };
3412
+ if (Rr({ structure: a })) return { structure: a, isAdHoc: !0, error: gc };
3413
3413
  let { matchUps: u } = Rt({ inContext: !0, matchUpFilters: c, drawDefinition: t, event: n }), l = u?.filter((S) => S.structureId === i || o.includes(S.structureId)), { matchUpDependencies: d } = Fi({ drawIds: [t.drawId], matchUps: u, drawDefinition: t }), p = [], m = [], f = {}, h = [];
3414
3414
  for (let S of u ?? []) {
3415
3415
  if (S.structureId === i || o.includes(S.structureId)) {
@@ -3461,10 +3461,10 @@ function ai({ provisionalPositioning: e, isPositionAction: t, tournamentRecord:
3461
3461
  let m = !!(a && s.drawMatchUps.find((M) => M.loserMatchUpId === a?.matchUpId && dr(M.matchUpStatus)));
3462
3462
  if (p?.includes(n) && !m) return { error: Pp };
3463
3463
  let f = d?.find((M) => M.drawPosition === n);
3464
- if (!f) return { error: hc };
3464
+ if (!f) return { error: gc };
3465
3465
  let { filled: h, containsBye: g, assignedParticipantId: I } = tF(f);
3466
3466
  if (g) return { ...x };
3467
- if (h && !g && !m) return F({ result: { error: Ho }, stack: l });
3467
+ if (h && !g && !m) return F({ result: { error: zo }, stack: l });
3468
3468
  let y = xe({ tournamentRecord: r, drawDefinition: i, event: u }).appliedPolicies ?? {}, U = Rt({ inContext: !0, drawDefinition: i, matchUpsMap: s }).matchUps ?? [], w = { isCollectionMatchUp: !1 }, { matchUps: v } = _e({ provisionalPositioning: e, drawDefinition: i, matchUpFilters: w, matchUpsMap: s, structure: c });
3469
3469
  if (d?.forEach((M) => {
3470
3470
  M.drawPosition === n && (M.bye = !0, m && (M.participantId = void 0));
@@ -3507,11 +3507,11 @@ function QI({ drawPositionToAdvance: e, inContextDrawMatchUps: t, sourceDrawPosi
3507
3507
  }
3508
3508
  function iF({ drawPositionToAdvance: e, inContextDrawMatchUps: t, sourceDrawPositions: r, tournamentRecord: i, drawDefinition: n, winnerMatchUp: a, matchUpsMap: s, event: o }) {
3509
3509
  let c = "advanceWinner", u = s.drawMatchUps.find((A) => A.matchUpId === a.matchUpId), l = t.find((A) => A.matchUpId === a.matchUpId)?.structureId, { structure: d } = me({ drawDefinition: n, structureId: l }), { positionAssignments: p } = Ke({ structure: d }), m = p?.find(({ drawPosition: A }) => A === e)?.bye, f = u.drawPositions?.filter(Boolean), h = p?.filter((A) => f?.includes(A.drawPosition)), g = p?.find(({ drawPosition: A }) => A === e), I = r?.find((A) => A !== e), y = (I && h?.find(({ drawPosition: A }) => A === I))?.bye, U = m && y;
3510
- if (U && console.log({ isByeAdvancedBye: U }), f?.length > 1 && m && !y) return F({ result: { error: Ho }, stack: c });
3510
+ if (U && console.log({ isByeAdvancedBye: U }), f?.length > 1 && m && !y) return F({ result: { error: zo }, stack: c });
3511
3511
  let w = f?.find((A) => A !== e), v = U, D = [...(u.drawPositions || []).filter(Boolean), void 0, void 0].slice(0, 2), S = D.map((A) => !A && !v || A === e ? (v = !0, e) : A).sort(Ct);
3512
- if (!v) return console.log("@@@@@@@", { advancingAssignmentIsBye: g, drawPositionToAdvance: e, existingAssignments: h }), F({ result: { error: Ho }, stack: c });
3512
+ if (!v) return console.log("@@@@@@@", { advancingAssignmentIsBye: g, drawPositionToAdvance: e, existingAssignments: h }), F({ result: { error: zo }, stack: c });
3513
3513
  let T = p?.find(({ drawPosition: A }) => A === w)?.bye, b = p?.find(({ drawPosition: A }) => A === e)?.bye;
3514
- Object.assign(u, { matchUpStatus: b || T ? "BYE" : vt, score: void 0, winningSide: void 0, drawPositions: S });
3514
+ Object.assign(u, { matchUpStatus: b || T ? "BYE" : wt, score: void 0, winningSide: void 0, drawPositions: S });
3515
3515
  let P = u.drawPositions.find((A) => !D.includes(A));
3516
3516
  $r({ method: c, color: "brightyellow", changedDrawPosition: P, pairedDrawPositionIsBye: T, drawPositionIsBye: b }), Ae({ tournamentId: i?.tournamentId, matchUp: u, eventId: o?.eventId, context: c, drawDefinition: n });
3517
3517
  let { targetLinks: { loserTargetLink: M }, targetMatchUps: { loserMatchUp: N, loserTargetDrawPosition: R } } = Tr({ matchUpId: a.matchUpId, inContextDrawMatchUps: t, drawDefinition: n });
@@ -3538,12 +3538,12 @@ function kb({ positionAssignments: e, tournamentRecord: t, drawDefinition: r, ma
3538
3538
  let { matchUps: s } = _e({ drawDefinition: r, matchUpsMap: i, structure: n, event: a });
3539
3539
  s.forEach((o) => {
3540
3540
  let c = e.filter(({ drawPosition: u }) => o.drawPositions?.includes(u)).filter((u) => u.bye).length;
3541
- o.winningSide || (Object.assign(o, { matchUpStatus: c ? "BYE" : vt }), Ae({ tournamentId: t?.tournamentId, context: "modifyRoundRobinMatchUpsStatus", eventId: a?.eventId, drawDefinition: r, matchUp: o }));
3541
+ o.winningSide || (Object.assign(o, { matchUpStatus: c ? "BYE" : wt }), Ae({ tournamentId: t?.tournamentId, context: "modifyRoundRobinMatchUpsStatus", eventId: a?.eventId, drawDefinition: r, matchUp: o }));
3542
3542
  });
3543
3543
  }
3544
3544
  function Al(e) {
3545
3545
  let { inContextDrawMatchUps: t, participantId: r, drawPosition: i } = e, { tournamentRecord: n, drawDefinition: a, structureId: s, matchUpsMap: o, event: c } = e, { structure: u } = me({ drawDefinition: a, structureId: s }), l = (Lt({ drawDefinition: a, structure: u }).positionAssignments || []).find((p) => r && p.participantId === r || i && p.drawPosition === i);
3546
- if (l && r && !i && (i = l?.drawPosition), !i) return { error: gc };
3546
+ if (l && r && !i && (i = l?.drawPosition), !i) return { error: Ic };
3547
3547
  r || (r = l?.participantId);
3548
3548
  let { activeDrawPositions: d } = El({ drawDefinition: a, structureId: s });
3549
3549
  return d.includes(i) ? { error: Pp } : (t || ({ matchUps: t } = Rt({ inContext: !0, drawDefinition: a, matchUpsMap: o })), Lh({ inContextDrawMatchUps: t, tournamentRecord: n, drawDefinition: a, structureId: s, drawPosition: i, matchUpsMap: o, event: c }).drawPositionCleared ? (wa({ tournamentId: n?.tournamentId, drawDefinition: a, structure: u, event: c }), { ...x, participantId: r }) : { error: nD });
@@ -3587,7 +3587,7 @@ function xb({ inContextDrawMatchUps: e, positionAssignments: t, tournamentRecord
3587
3587
  let S = (e?.find((T) => T.matchUpId === n.matchUpId)?.sides ?? []).reduce((T, b, P) => b.drawPosition === a ? P : T, void 0);
3588
3588
  S !== void 0 && n.sides?.[S]?.lineUp && (delete n.sides?.[S].lineUp, Ae({ tournamentId: r?.tournamentId, context: `${u}-TEAM`, eventId: c?.eventId, matchUp: n, drawDefinition: i }));
3589
3589
  }
3590
- let h = Tr({ matchUpId: n.matchUpId, inContextDrawMatchUps: e, drawDefinition: i }), { targetLinks: { winnerTargetLink: g }, targetMatchUps: { loserMatchUp: I, winnerMatchUp: y, loserMatchUpDrawPositionIndex: U } } = h, w = t.filter(({ drawPosition: S }) => n.drawPositions?.includes(S)).filter((S) => S.bye).length, v = w && "BYE" || n.matchUpStatus && dr(n.matchUpStatus) && n.matcHUpStatus || vt;
3590
+ let h = Tr({ matchUpId: n.matchUpId, inContextDrawMatchUps: e, drawDefinition: i }), { targetLinks: { winnerTargetLink: g }, targetMatchUps: { loserMatchUp: I, winnerMatchUp: y, loserMatchUpDrawPositionIndex: U } } = h, w = t.filter(({ drawPosition: S }) => n.drawPositions?.includes(S)).filter((S) => S.bye).length, v = w && "BYE" || n.matchUpStatus && dr(n.matchUpStatus) && n.matcHUpStatus || wt;
3591
3591
  n.matchUpStatus = v, n.matchUpStatus && dr(n.matchUpStatus) && (n.winningSide = void 0);
3592
3592
  let D = l?.find((S) => !n.drawPositions?.includes(S));
3593
3593
  if (l?.includes(a) && d === n.matchUpStatus && p === n.winningSide || (D && $r({ method: u, color: "brightyellow", removedDrawPosition: D }), Ae({ tournamentId: r?.tournamentId, context: `${u}-${a}`, eventId: c?.eventId, matchUp: n, drawDefinition: i })), I && I.structureId !== h.matchUp.structureId && !w) {
@@ -3651,9 +3651,9 @@ function Jd({ autoEntryPositions: e = !0, ignoreAssignment: t, tournamentRecord:
3651
3651
  let P = Ua({ tournamentParticipants: h, participantId: b })?.participantType;
3652
3652
  return !(P && [we, br].includes(P) && Ba(a)) && !(a && d?.eventType && P === Me && [di, Hr].includes(d.eventType) && [Mi, ...Td].includes(a));
3653
3653
  })) return { error: Uh };
3654
- let g = d && wt({ event: d }).flightProfile, I = g?.flights?.find((b) => b.drawId === u), y = (b) => {
3654
+ let g = d && Dt({ event: d }).flightProfile, I = g?.flights?.find((b) => b.drawId === u), y = (b) => {
3655
3655
  let P = (b || []).filter((N) => !l || !N.entryStage || l === N.entryStage).filter(({ participantId: N }) => n.includes(N)), M = (N) => a && f.includes(N.participantId) && !(Td.includes(N.entryStatus) && Td.includes(a));
3656
- return P.every((N) => M(N) && !t ? !1 : (a && (N.entryStatus = a, delete N.entryPosition), s && (N.entryStage = s, delete N.entryPosition), o && (o.value ? Le({ element: N, extension: o }) : Sr({ element: N, name: o.name })), !0)) ? { ...x } : { error: Uc };
3656
+ return P.every((N) => M(N) && !t ? !1 : (a && (N.entryStatus = a, delete N.entryPosition), s && (N.entryStage = s, delete N.entryPosition), o && (o.value ? Le({ element: N, extension: o }) : Sr({ element: N, name: o.name })), !0)) ? { ...x } : { error: Sc };
3657
3657
  }, U = ({ flight: b, drawDefinition: P }) => {
3658
3658
  d && (d.entries = Gi({ entries: d.entries ?? [] })), b && (b.drawEntries = Gi({ entries: b.drawEntries })), P && (P.entries = Gi({ entries: P.entries }));
3659
3659
  }, w = (b) => {
@@ -3711,7 +3711,7 @@ function Dn({ requireTimeStamp: e, scaleAttributes: t, participant: r }) {
3711
3711
  return { ...x, scaleItem: void 0 };
3712
3712
  }
3713
3713
  function sF({ publishedSeeding: e, usePublishState: t, withSeeding: r, participant: i, event: n }) {
3714
- let a = {}, s = (l) => [Xa, vn, n.eventType, l].join("."), o = Object.assign({}, ...(i.timeItems || []).filter(({ itemType: l }) => l.split(".")[1] === vn).map(({ itemType: l, itemValue: d }) => ({ [l]: d }))), c = (e?.stageSeedingScaleNames && Object.values(e?.stageSeedingScaleNames) || Array.isArray(e?.seedingScaleNames) && e.seedingScaleNames || []).map(s), u = St(Object.keys(o), c);
3714
+ let a = {}, s = (l) => [Xa, vn, n.eventType, l].join("."), o = Object.assign({}, ...(i.timeItems || []).filter(({ itemType: l }) => l.split(".")[1] === vn).map(({ itemType: l, itemValue: d }) => ({ [l]: d }))), c = (e?.stageSeedingScaleNames && Object.values(e?.stageSeedingScaleNames) || Array.isArray(e?.seedingScaleNames) && e.seedingScaleNames || []).map(s), u = vt(Object.keys(o), c);
3715
3715
  if ((!t || !Object.keys(o).length && !e?.drawIds?.length || u.length) && u.length) {
3716
3716
  if (e?.stageSeedingScaleNames) {
3717
3717
  let l = Object.keys(e.stageSeedingScaleNames).map((p) => {
@@ -3904,7 +3904,7 @@ function lF(e) {
3904
3904
  }, S = { withMatchUps: I || d, withEvents: U || d, withDraws: w || d, withPotentialMatchUps: l, withRankingProfile: d, withScheduleItems: p, scheduleAnalysis: m, withTeamMatchUps: f, withStatistics: h, participantMap: c, withOpponents: g, withSeeding: y }, T = [], b = {}, P = [], M = {}, N = {}, R = {}, A = ({ eventType: E, scaleNames: C, participantId: k }) => c[k]?.participant?.rankings?.[E]?.find((O) => C.includes(O.scaleName))?.scaleValue;
3905
3905
  for (let E of n?.events || []) {
3906
3906
  if (t?.eventIds && !t.eventIds.includes(E.eventId)) continue;
3907
- let { drawDefinitions: C = [], extensions: k = [], eventType: O, eventName: L, category: _, entries: B, eventId: G, gender: $ } = E, { flightProfile: j } = wt({ event: E }), V = j?.flights ?? [], H = ho({ event: E }).publishState;
3907
+ let { drawDefinitions: C = [], extensions: k = [], eventType: O, eventName: L, category: _, entries: B, eventId: G, gender: $ } = E, { flightProfile: j } = Dt({ event: E }), V = j?.flights ?? [], H = ho({ event: E }).publishState;
3908
3908
  H && (M[G] = H);
3909
3909
  let W = H?.status?.publishedSeeding;
3910
3910
  if (U || y || d) {
@@ -3941,8 +3941,8 @@ function lF(e) {
3941
3941
  if (!c[It] || c[It].draws?.[X]) return;
3942
3942
  let je = y && Ie, Vt = je ? {} : void 0, Yi = je ? et?.[Te]?.seedValue || et?.[Te]?.seedNumber : void 0, Zt = Yi ? et?.[Te] : void 0, Li = je ? Ne?.[Te]?.seedValue || Ne?.[Te]?.seedNumber : void 0, hn = Li ? Ne?.[Te] : void 0;
3943
3943
  Vt && Yi && (Vt[re] = Zt), Vt && Li && (Vt[oe] = hn);
3944
- let Yc = Yi || Li;
3945
- Yc && (c[It].participant.seedings[O] || (c[It].participant.seedings[O] = []), Zt && c[It].participant.seedings[O].push({ ...Zt, scaleName: X }), hn && c[It].participant.seedings[O].push({ ...hn, scaleName: X }), Vt && (c[It].events[G].seedAssignments || (c[It].events[G].seedAssignments = {}), Object.keys(Vt).forEach((jS) => c[It].events[G].seedAssignments[jS] = Vt[jS]))), (w || d) && (c[It].draws[X] = ae({ seedAssignments: Vt, entryPosition: Oe, entryStatus: He, entryStage: Ee, seedValue: Yc, eventId: G, ranking: qt, drawId: X }, !1, !1, !0));
3944
+ let Kc = Yi || Li;
3945
+ Kc && (c[It].participant.seedings[O] || (c[It].participant.seedings[O] = []), Zt && c[It].participant.seedings[O].push({ ...Zt, scaleName: X }), hn && c[It].participant.seedings[O].push({ ...hn, scaleName: X }), Vt && (c[It].events[G].seedAssignments || (c[It].events[G].seedAssignments = {}), Object.keys(Vt).forEach((jS) => c[It].events[G].seedAssignments[jS] = Vt[jS]))), (w || d) && (c[It].draws[X] = ae({ seedAssignments: Vt, entryPosition: Oe, entryStatus: He, entryStage: Ee, seedValue: Kc, eventId: G, ranking: qt, drawId: X }, !1, !1, !0));
3946
3946
  };
3947
3947
  [Ii, fs].includes(He) || (gt(Te), (c[Te].participant.individualParticipantIds || [])?.forEach(gt));
3948
3948
  }
@@ -4043,7 +4043,7 @@ function gn(e) {
4043
4043
  function dF({ drawEntryStatuses: e, tournamentEvents: t }) {
4044
4044
  let r = ({ entryStatus: i }) => Array.isArray(e) ? e.includes(i) : !0;
4045
4045
  return ye(t.reduce((i, n) => {
4046
- let { flightProfile: a } = wt({ event: n }), s = a?.flights?.map(({ drawEntries: c }) => Array.isArray(c) ? c.filter(r).map(be) : []).flat() || [], o = n.drawDefinitions?.map(({ entries: c }) => c ? c.filter(r).map(be) : []) || [];
4046
+ let { flightProfile: a } = Dt({ event: n }), s = a?.flights?.map(({ drawEntries: c }) => Array.isArray(c) ? c.filter(r).map(be) : []).flat() || [], o = n.drawDefinitions?.map(({ entries: c }) => c ? c.filter(r).map(be) : []) || [];
4047
4047
  return i.concat(...s, ...o);
4048
4048
  }, []));
4049
4049
  }
@@ -4066,7 +4066,7 @@ function pt(e) {
4066
4066
  }), ae({ ...q, scheduleConflicts: u ? Object.values(W) : void 0, draws: S || n ? ue : void 0, events: D || n ? Object.values(Z) : void 0, matchUps: U || n ? Object.values(Q) : void 0, opponents: y ? he : void 0, potentialMatchUps: L ? Object.values(H) : void 0, statistics: f ? Object.values(K) : void 0, scheduleItems: o ? Y : void 0 }, !1, !1, !0);
4067
4067
  }, B = /* @__PURE__ */ new Map();
4068
4068
  for (let H of Object.keys(M)) B.set(H, _(M[H]));
4069
- let G = [...B.values()], $ = s?.[bc]?.participant, j = Ol({ participants: G, participantFilters: r, tournamentRecord: c });
4069
+ let G = [...B.values()], $ = s?.[Mc]?.participant, j = Ol({ participants: G, participantFilters: r, tournamentRecord: c });
4070
4070
  if (t) {
4071
4071
  let H = Ce(t) ? t : void 0;
4072
4072
  for (let W of j) for (let Y of W.individualParticipantIds ?? []) {
@@ -4083,7 +4083,7 @@ function Rs({ participantId: e, drawDefinition: t, entryStatus: r, entryStage: i
4083
4083
  let n = t.entries?.find((a) => a.participantId === e && (!r || r === a.entryStatus) && (!i || i === a.entryStage));
4084
4084
  return e && n;
4085
4085
  }
4086
- function Cc(e) {
4086
+ function Oc(e) {
4087
4087
  let { provisionalPositioning: t, drawDefinition: r, stageSequence: i, structureId: n, stage: a } = e;
4088
4088
  if (!r) return { error: ne };
4089
4089
  let { entryProfile: s } = yl({ drawDefinition: r }), o = a && i && s?.[a]?.stageSequence?.[i]?.qualifiersCount || a && s?.[a]?.qualifiersCount || 0, c = {};
@@ -4112,7 +4112,7 @@ function Zd({ stage: e, drawDefinition: t }) {
4112
4112
  return r?.[e]?.drawSize || 0;
4113
4113
  }
4114
4114
  function mF(e) {
4115
- let { provisionalPositioning: t, drawDefinition: r, stageSequence: i, stage: n } = e, a = Zd({ stage: n, drawDefinition: r }), { qualifiersCount: s } = Cc({ provisionalPositioning: t, drawDefinition: r, stageSequence: i, stage: n });
4115
+ let { provisionalPositioning: t, drawDefinition: r, stageSequence: i, stage: n } = e, a = Zd({ stage: n, drawDefinition: r }), { qualifiersCount: s } = Oc({ provisionalPositioning: t, drawDefinition: r, stageSequence: i, stage: n });
4116
4116
  return a && a - s;
4117
4117
  }
4118
4118
  function Lb({ stage: e, drawDefinition: t }) {
@@ -4120,8 +4120,8 @@ function Lb({ stage: e, drawDefinition: t }) {
4120
4120
  }
4121
4121
  function _b({ entryStatus: e = _r, drawDefinition: t, stageSequence: r, stage: i }) {
4122
4122
  if (e === Mi) return sx({ stage: i, drawDefinition: t }) ? { positionsAvailable: 1 / 0, ...x } : { error: GD };
4123
- let n = mF({ drawDefinition: t, stageSequence: r, stage: i }), a = ox({ drawDefinition: t, stage: i }), s = Ah({ entryStatus: nc, drawDefinition: t, stage: i }), o = Ah({ entryStatus: _r, drawDefinition: t, stage: i }), c = s + o, u = c >= n, l = n - c;
4124
- return i !== zt && u ? { error: Sh } : e === nc ? s < a ? { ...x } : { error: Sh } : { positionsAvailable: l, ...x };
4123
+ let n = mF({ drawDefinition: t, stageSequence: r, stage: i }), a = ox({ drawDefinition: t, stage: i }), s = Ah({ entryStatus: ac, drawDefinition: t, stage: i }), o = Ah({ entryStatus: _r, drawDefinition: t, stage: i }), c = s + o, u = c >= n, l = n - c;
4124
+ return i !== zt && u ? { error: Sh } : e === ac ? s < a ? { ...x } : { error: Sh } : { positionsAvailable: l, ...x };
4125
4125
  }
4126
4126
  function ZI(e) {
4127
4127
  let t = se(e, [{ [hr]: !0, [vP]: !0 }]);
@@ -4169,7 +4169,7 @@ function ey({ suppressDuplicateEntries: e = !0, autoEntryPositions: t = !0, entr
4169
4169
  let h = fF({ stageSequence: r, suppressDuplicateEntries: e, autoEntryPositions: t, stage: c, ignoreStageSpace: i, participantIds: n, drawDefinition: a, entryStatus: s, roundTarget: o, extension: u });
4170
4170
  if (h.error) return h;
4171
4171
  }
4172
- let { flightProfile: m } = wt({ event: d }), f = m?.flights.find((h) => h.drawId === l);
4172
+ let { flightProfile: m } = Dt({ event: d }), f = m?.flights.find((h) => h.drawId === l);
4173
4173
  return f?.drawEntries && (n.forEach((h) => {
4174
4174
  let g = s === Zn && _f({ participantId: h, entryStatus: s, flight: f }), I = c === zt && _f({ participantId: h, entryStage: c, flight: f });
4175
4175
  !(s !== Zn && c !== zt && _f({ flight: f, participantId: h })) && !g && !I && f.drawEntries.push({ participantId: h, entryStatus: s, entryStage: c });
@@ -4184,21 +4184,21 @@ function kl({ autoEntryPositions: e = !0, participantIds: t = [], entryStatuses:
4184
4184
  if (!n?.eventId) return { error: it };
4185
4185
  if (!Array.isArray(t) || t.some((d) => !ct(d))) return F({ result: { error: Wi }, stack: a });
4186
4186
  let s = (n.drawDefinitions ?? []).flatMap((d) => Is({ drawDefinition: d }).assignedParticipantIds ?? []), o = (r?.length && n.entries?.filter((d) => d.entryStatus && r.includes(d.entryStatus)) || []).map(be).filter((d) => !s.includes(d)), c = (i && n.entries?.filter((d) => d.entryStage && d.entryStage === i) || []).map(be).filter((d) => !s.includes(d));
4187
- if (t.length ? t = t.filter((d) => (!r?.length || o.includes(d)) && (!i || c.includes(d))) : o.length && c.length ? t = St(o, c) : o.length ? t = o : c.length && (t = c), t?.length && s.some((d) => t.includes(d))) return F({ result: { error: Uc }, stack: a });
4187
+ if (t.length ? t = t.filter((d) => (!r?.length || o.includes(d)) && (!i || c.includes(d))) : o.length && c.length ? t = vt(o, c) : o.length ? t = o : c.length && (t = c), t?.length && s.some((d) => t.includes(d))) return F({ result: { error: Sc }, stack: a });
4188
4188
  if (!t?.length) return { ...x, participantIdsRemoved: [] };
4189
4189
  let u = [];
4190
4190
  n.entries = (n.entries ?? []).filter((d) => {
4191
4191
  let p = !t.includes(d?.participantId);
4192
4192
  return p || u.push(d.participantId), p;
4193
4193
  }), e && (n.entries = Gi({ entries: n.entries }));
4194
- let { flightProfile: l } = wt({ event: n });
4194
+ let { flightProfile: l } = Dt({ event: n });
4195
4195
  return l?.flights?.forEach((d) => {
4196
4196
  d.drawEntries = (d.drawEntries || []).filter((p) => !t.includes(p.participantId));
4197
4197
  }), n.drawDefinitions?.forEach((d) => {
4198
4198
  d.entries = (d.entries ?? []).filter((p) => !t.includes(p.participantId));
4199
4199
  }), { ...x, participantIdsRemoved: u };
4200
4200
  }
4201
- var Bb = { [Yt]: { policyName: "matchUpActionsDefault", enabledStructures: [{ stages: [], stageSequences: [], enabledActions: [], disabledActions: [] }], participants: { enforceCategory: !0, enforceGender: !0 }, processCodes: { substitution: ["RANKING.IGNORE", "RATING.IGNORE"] }, substituteAfterCompleted: !1, substituteWithoutScore: !1 } }, Oc = Bb;
4201
+ var Bb = { [Yt]: { policyName: "matchUpActionsDefault", enabledStructures: [{ stages: [], stageSequences: [], enabledActions: [], disabledActions: [] }], participants: { enforceCategory: !0, enforceGender: !0 }, processCodes: { substitution: ["RANKING.IGNORE", "RATING.IGNORE"] }, substituteAfterCompleted: !1, substituteWithoutScore: !1 } }, kc = Bb;
4202
4202
  function en(e) {
4203
4203
  let { suppressDuplicateEntries: t = !0, entryStatus: r = _r, autoEntryPositions: i = !0, enforceGender: n = !0, entryStageSequence: a, policyDefinitions: s, entryStage: o = re, tournamentRecord: c, ignoreStageSpace: u, drawDefinition: l, roundTarget: d, extensions: p, extension: m, drawId: f, event: h } = e, g = "addEventEntries";
4204
4204
  if (!Array.isArray(e.participantIds)) return F({ result: { error: Gr }, stack: g });
@@ -4206,7 +4206,7 @@ function en(e) {
4206
4206
  if (!h) return { error: it };
4207
4207
  if (!I?.length) return F({ result: { error: Ma }, stack: g });
4208
4208
  if (!h?.eventId) return { error: li };
4209
- let y = xe({ tournamentRecord: c, event: h }).appliedPolicies ?? {}, U = s?.[Yt] ?? y?.[Yt] ?? Oc[Yt], w = (n ?? U?.participants?.enforceGender) !== !1, v = [], D = [];
4209
+ let y = xe({ tournamentRecord: c, event: h }).appliedPolicies ?? {}, U = s?.[Yt] ?? y?.[Yt] ?? kc[Yt], w = (n ?? U?.participants?.enforceGender) !== !1, v = [], D = [];
4210
4210
  if (p && (!Array.isArray(p) || !p.every((E) => on({ extension: E }))) || m && !on({ extension: m })) return F({ context: ae({ extension: m, extensions: p }), result: { error: z }, info: "Invalid extension(s)", stack: g });
4211
4211
  let S = !!c, T = [], b, P = c?.participants?.filter((E) => {
4212
4212
  if (!I.includes(E.participantId)) return !1;
@@ -4295,9 +4295,9 @@ function go(e) {
4295
4295
  if (!a) return { ...x };
4296
4296
  let s = (i.events || [])?.filter(({ eventType: f }) => f === Ot).map((f) => f?.drawDefinitions?.map(({ drawId: h }) => h)).flat(1 / 0), o = pt({ participantFilters: { participantIds: n }, tournamentRecord: i, withDraws: !0 }).participants ?? [], c = (f) => {
4297
4297
  let h = (Qt({ matchUpFilters: { drawIds: f, matchUpTypes: [We] }, tournamentRecord: i }).matchUps ?? []).flatMap(({ sides: g }) => g?.map(({ participantId: I }) => I || [])).filter(Boolean);
4298
- return St(h, n);
4298
+ return vt(h, n);
4299
4299
  }, u = s?.length ? c(s) : [], l = o.filter((f) => f.draws?.filter((h) => (!s?.length || !s?.includes(h.drawId)) && h.positionAssignments).length);
4300
- if (u?.length || l.length) return { error: Uc };
4300
+ if (u?.length || l.length) return { error: Sc };
4301
4301
  let d = {}, p = {};
4302
4302
  for (let f of i.events || []) {
4303
4303
  let h = kl({ participantIds: n, event: f });
@@ -4319,7 +4319,7 @@ function go(e) {
4319
4319
  function Hb({ selected: e = !0, drawDefinition: t, entryStatuses: r, drawId: i, event: n, stage: a }) {
4320
4320
  let s = n.entries ?? [];
4321
4321
  if (i) {
4322
- let { flightProfile: c } = wt({ event: n }), u = c?.flights?.find((l) => l.drawId === i);
4322
+ let { flightProfile: c } = Dt({ event: n }), u = c?.flights?.find((l) => l.drawId === i);
4323
4323
  u ? s = u.drawEntries : t.entries && (s = t?.entries);
4324
4324
  }
4325
4325
  let o = s.filter((c) => (!r?.length || !c.entryStatus || r.includes(c.entryStatus)) && (!a || !c.entryStage || c.entryStage === a) && (!e || c.entryStatus && xi.includes(c.entryStatus)));
@@ -4451,7 +4451,7 @@ function SF({ structureOrder: e, matchUpType: t, groupSize: r, drawSize: i, idPr
4451
4451
  return l.reduce((f, h, g) => h.includes(m) ? g + 1 : f, void 0);
4452
4452
  }
4453
4453
  function p(m) {
4454
- let f = Dm(m), h = d(f), g = [1, i], I = vF({ structureOrder: e, drawPositions: m, roundNumber: h, idPrefix: n, uuids: s }), y = { matchUpStatus: h ? vt : "BYE", matchUpType: t, finishingPositionRange: { winner: g, loser: g }, drawPositions: m, roundNumber: h, matchUpId: I };
4454
+ let f = Dm(m), h = d(f), g = [1, i], I = vF({ structureOrder: e, drawPositions: m, roundNumber: h, idPrefix: n, uuids: s }), y = { matchUpStatus: h ? wt : "BYE", matchUpType: t, finishingPositionRange: { winner: g, loser: g }, drawPositions: m, roundNumber: h, matchUpId: I };
4455
4455
  return a && (y.isMock = !0), y;
4456
4456
  }
4457
4457
  }
@@ -4461,7 +4461,7 @@ function vF({ structureOrder: e, drawPositions: t, roundNumber: r, idPrefix: i,
4461
4461
  function oy(e) {
4462
4462
  let { roundRobinGroupsCount: t, participantsCount: r, cluster: i } = e;
4463
4463
  if (!ge(r)) return { seedBlocks: void 0, ...F({ result: { error: z }, context: { participantsCount: r }, stack: "getSeedBlocks" }) };
4464
- let n = fc(r);
4464
+ let n = hc(r);
4465
4465
  if (t) {
4466
4466
  let m = Math.min(t, n), f = [], h = 1;
4467
4467
  for (te(0, m).forEach(() => {
@@ -4512,7 +4512,7 @@ function uy({ roundRobinGroupsCount: e, participantsCount: t }) {
4512
4512
  let { seedGroups: r } = cy({ drawSize: t, roundRobinGroupsCount: e }), i = r?.map((n) => Math.min(...n)) || [];
4513
4513
  return { ...x, seedingThresholds: i };
4514
4514
  }
4515
- function sc(e) {
4515
+ function oc(e) {
4516
4516
  if (!e) return 1 / 0;
4517
4517
  if (ge(e)) return pe(e);
4518
4518
  let t = e.split("-")[0];
@@ -4626,7 +4626,7 @@ function Jb(e) {
4626
4626
  }).filter(Boolean), S = c?.filter((N) => h?.includes(N.participantId)).map((N) => N.seedNumber), T = (p?.seedNumbers || []).filter((N) => !S?.includes(N)), b = c?.filter((N) => T.includes(N.seedNumber)).map((N) => N.participantId), P = d?.seeding?.duplicateSeedNumbers;
4627
4627
  return { nextSeedBlock: p, unplacedSeedParticipantIds: P === void 0 || P ? D : b, unplacedSeedNumbers: T, unfilledPositions: w, unplacedSeedAssignments: I };
4628
4628
  function M(N, R) {
4629
- let A = N.filter((k) => !R.includes(k.participantId)), E = Math.min(...A.map((k) => sc(k.seedValue))), C = A.filter((k) => sc(k.seedValue) === E);
4629
+ let A = N.filter((k) => !R.includes(k.participantId)), E = Math.min(...A.map((k) => oc(k.seedValue))), C = A.filter((k) => oc(k.seedValue) === E);
4630
4630
  return Ur(C).pop();
4631
4631
  }
4632
4632
  }
@@ -4634,10 +4634,10 @@ function Ll(e) {
4634
4634
  if (typeof e == "string") return e;
4635
4635
  if (typeof e == "object") return e.positioning;
4636
4636
  }
4637
- function kc({ provisionalPositioning: e, tournamentRecord: t, drawDefinition: r, seedingProfile: i, participantId: n, seedBlockInfo: a, structureId: s, seedNumber: o, seedValue: c, eventId: u, event: l }) {
4637
+ function xc({ provisionalPositioning: e, tournamentRecord: t, drawDefinition: r, seedingProfile: i, participantId: n, seedBlockInfo: a, structureId: s, seedNumber: o, seedValue: c, eventId: u, event: l }) {
4638
4638
  let d = "assignSeed", { structure: p } = me({ drawDefinition: r, structureId: s }), { positionAssignments: m } = Lt({ structure: p }), f = mi({ provisionalPositioning: e, drawDefinition: r, structure: p }).seedAssignments, h = f.map((v) => v.seedNumber), g = Rs({ drawDefinition: r, participantId: n });
4639
4639
  if (n && !g) return F({ result: { error: Wi }, context: { participantId: n }, stack: d });
4640
- let I = l ? wt({ event: l }).flightProfile?.flights?.length : 0, y = I && I > 1, U = m?.find((v) => v.participantId === n)?.drawPosition;
4640
+ let I = l ? Dt({ event: l }).flightProfile?.flights?.length : 0, y = I && I > 1, U = m?.find((v) => v.participantId === n)?.drawPosition;
4641
4641
  if (U && !ep({ drawPosition: U, drawDefinition: r, seedBlockInfo: a, structureId: s, seedNumber: o })) return F({ result: { error: hg }, context: { assignedDrawPosition: U }, info: "invalid seed position", stack: d });
4642
4642
  h.includes(o) || f.push({ seedNumber: o, seedValue: c });
4643
4643
  let w;
@@ -4691,7 +4691,7 @@ function Es({ inContextDrawMatchUps: e, sourceMatchUpStatus: t, tournamentRecord
4691
4691
  let d = e.find((R) => R.matchUpId === c), p = d?.structureId, m = n?.structures?.find((R) => R.structureId === p);
4692
4692
  if (!m) return { error: lt };
4693
4693
  let f = o?.drawMatchUps?.find((R) => R.matchUpId === c), h = f?.drawPositions ?? [], { positionAdded: g, positionAssigned: I, updatedDrawPositions: y } = MF({ drawPositions: h, drawPosition: s }), { positionAssignments: U } = Ke({ drawDefinition: n, structure: m }), w = U?.filter((R) => y.includes(R.drawPosition))?.find(({ bye: R }) => R), v = f?.matchUpStatus && dr(f.matchUpStatus) && y.filter(Boolean).length < 2;
4694
- a = w && "BYE" || a || v && f.matchUpStatus || f?.matchUpStatus && [dt, kt].includes(f.matchUpStatus) && f.matchUpStatus || vt;
4694
+ a = w && "BYE" || a || v && f.matchUpStatus || f?.matchUpStatus && [dt, kt].includes(f.matchUpStatus) && f.matchUpStatus || wt;
4695
4695
  let D = !!(dr(f?.matchUpStatus) && f?.winningSide);
4696
4696
  if (f && g) {
4697
4697
  e = Rt({ inContext: !0, drawDefinition: n, matchUpsMap: o }).matchUps ?? [];
@@ -4723,16 +4723,16 @@ function Es({ inContextDrawMatchUps: e, sourceMatchUpStatus: t, tournamentRecord
4723
4723
  let R = e?.find(({ matchUpId: C }) => C === f.matchUpId), A = (R?.sides ?? []).reduce((C, k, O) => k.drawPosition === s ? O : C, void 0), E = U?.find((C) => C.drawPosition === s)?.participantId;
4724
4724
  E && A !== void 0 && ly({ inContextTargetMatchUp: R, drawPositionSideIndex: A, teamParticipantId: E, tournamentRecord: r, drawDefinition: n, matchUp: f });
4725
4725
  }
4726
- if (M?.linkCondition === sn && y.filter(Boolean).length === 2 && !w && N.filter(({ drawPositions: R, roundNumber: A }) => A === 1 && wr(R, y)).every(({ matchUpStatus: R }) => [Ut, jt].includes(R)) && b) {
4726
+ if (M?.linkCondition === sn && y.filter(Boolean).length === 2 && !w && N.filter(({ drawPositions: R, roundNumber: A }) => A === 1 && wr(R, y)).every(({ matchUpStatus: R }) => [St, jt].includes(R)) && b) {
4727
4727
  let { structureId: R } = b, A = ai({ drawPosition: P, tournamentRecord: r, drawDefinition: n, structureId: R, matchUpsMap: o, event: u });
4728
4728
  if (A.error) return A;
4729
4729
  }
4730
- return I ? { ...x } : F({ result: { error: Ho }, context: { drawPosition: s }, stack: l });
4730
+ return I ? { ...x } : F({ result: { error: zo }, context: { drawPosition: s }, stack: l });
4731
4731
  }
4732
4732
  function rM({ inContextDrawMatchUps: e, drawDefinition: t, assignments: r, matchUpsMap: i, structure: n }) {
4733
- let a = Rc({ drawDefinition: t })?.containedStructures?.[n.structureId]?.map(({ structureId: l }) => l) || [];
4733
+ let a = Ec({ drawDefinition: t })?.containedStructures?.[n.structureId]?.map(({ structureId: l }) => l) || [];
4734
4734
  a.push(n?.structureId);
4735
- let s = r?.map(({ drawPosition: l }) => l) || [], o = e?.filter((l) => a.includes(l.structureId) && St(l.drawPositions ?? [], s).length) ?? [], c = o.map(({ matchUpId: l }) => l), u = i?.drawMatchUps?.filter((l) => c.includes(l.matchUpId)) ?? [];
4735
+ let s = r?.map(({ drawPosition: l }) => l) || [], o = e?.filter((l) => a.includes(l.structureId) && vt(l.drawPositions ?? [], s).length) ?? [], c = o.map(({ matchUpId: l }) => l), u = i?.drawMatchUps?.filter((l) => c.includes(l.matchUpId)) ?? [];
4736
4736
  return { drawPositions: s, matchUps: u, targetMatchUps: o };
4737
4737
  }
4738
4738
  function dy({ lineUp: e }) {
@@ -4799,8 +4799,8 @@ function cn({ provisionalPositioning: e, inContextDrawMatchUps: t, isQualifierPo
4799
4799
  let { seedAssignments: g } = mi({ provisionalPositioning: e, drawDefinition: a, structure: h }), I = g?.find((P) => P.participantId === o)?.seedNumber, { appliedPolicies: y } = xe({ tournamentRecord: n, drawDefinition: a, structure: h, event: p });
4800
4800
  if (I && !ep({ seedNumber: I, appliedPolicies: y, drawDefinition: a, seedBlockInfo: c, drawPosition: u, structureId: d })) return F({ result: { error: hg }, context: { drawPosition: u }, stack: m });
4801
4801
  let U = Lt({ structure: h }).positionAssignments || [], w = U?.find((P) => P.drawPosition === u);
4802
- if (!w) return F({ result: { error: hc }, context: { drawPosition: u }, stack: m });
4803
- if (U?.map(be).includes(o)) return F({ result: { error: Uc }, context: { drawPosition: u }, stack: m });
4802
+ if (!w) return F({ result: { error: gc }, context: { drawPosition: u }, stack: m });
4803
+ if (U?.map(be).includes(o)) return F({ result: { error: Sc }, context: { drawPosition: u }, stack: m });
4804
4804
  let { containsParticipant: v, containsBye: D } = b(w);
4805
4805
  if (D) {
4806
4806
  let P = Al({ inContextDrawMatchUps: t, tournamentRecord: n, drawDefinition: a, drawPosition: u, structureId: d, matchUpsMap: l, event: p });
@@ -4811,11 +4811,11 @@ function cn({ provisionalPositioning: e, inContextDrawMatchUps: t, isQualifierPo
4811
4811
  if (P.includes(u)) return F({ result: { error: Pp }, stack: m });
4812
4812
  py({ assignments: [w], inContextDrawMatchUps: t, tournamentRecord: n, drawDefinition: a, matchUpsMap: l, structure: h });
4813
4813
  }
4814
- if (w.participantId = o, r && (w.qualifier = !0), h.stage === re && (!h.stageSequence || h.stageSequence > 1) || h.stage && [sr, yt].includes(h.stage)) {
4814
+ if (w.participantId = o, r && (w.qualifier = !0), h.stage === re && (!h.stageSequence || h.stageSequence > 1) || h.stage && [sr, Ut].includes(h.stage)) {
4815
4815
  let P = h.stage === oe ? oe : re, M = (a.structures?.find((N) => N?.stage === P && N?.stageSequence === 1)?.seedAssignments ?? []).find((N) => N.participantId === o);
4816
4816
  if (M?.participantId) {
4817
4817
  let { participantId: N, seedNumber: R, seedValue: A } = M;
4818
- kc({ eventId: p?.eventId, provisionalPositioning: e, tournamentRecord: n, drawDefinition: a, seedingProfile: s, participantId: N, seedNumber: R, seedValue: A, structureId: d, event: p });
4818
+ xc({ eventId: p?.eventId, provisionalPositioning: e, tournamentRecord: n, drawDefinition: a, seedingProfile: s, participantId: N, seedNumber: R, seedValue: A, structureId: d, event: p });
4819
4819
  }
4820
4820
  }
4821
4821
  if (h.structureType !== Pr) NF({ provisionalPositioning: e, inContextDrawMatchUps: t, sourceMatchUpStatus: i, tournamentRecord: n, drawDefinition: a, drawPosition: u, matchUpsMap: l, structure: h, event: p });
@@ -4908,7 +4908,7 @@ function oM({ structurePositionAssignments: e, provisionalPositioning: t, tourna
4908
4908
  let d = l.structure;
4909
4909
  if (!d) return { error: lt };
4910
4910
  let p = Ke({ structure: d }).positionAssignments?.map(({ drawPosition: g }) => g), m = u?.map(({ drawPosition: g }) => g);
4911
- if (St(p, m).length !== p?.length) return F({ result: { error: z }, info: "drawPositions do not match", stack: a });
4911
+ if (vt(p, m).length !== p?.length) return F({ result: { error: z }, info: "drawPositions do not match", stack: a });
4912
4912
  let f = er({ drawDefinition: i }), { matchUps: h } = Rt({ inContext: !0, drawDefinition: i, matchUpsMap: f });
4913
4913
  for (let g of u || []) {
4914
4914
  let { drawPosition: I, participantId: y, bye: U, qualifier: w } = g;
@@ -5208,7 +5208,7 @@ function $F({ provisionalPositioning: e, inContextDrawMatchUps: t, unseededByePo
5208
5208
  let { positionAssignments: f } = Lt({ structure: l }), { seedAssignments: h } = mi({ provisionalPositioning: e, drawDefinition: a, structure: l }), g = h?.map((b) => b.participantId).filter(Boolean), { stage: I, stageSequence: y } = l, U = I === oe ? De({ element: l, name: pn })?.extension?.value : void 0, w = so({ provisionalPositioning: e, drawDefinition: a, stageSequence: y, entryStatuses: hs, structureId: u, roundTarget: U, stage: I }), v = w.filter((b) => !g?.includes(b.participantId)).map((b) => b.participantId), D = f?.filter((b) => !b.participantId && !b.bye && !b.qualifier).map((b) => b.drawPosition);
5209
5209
  if (!i && v.length > (D?.length || 0)) return F({ result: { error: Ag }, context: { unseededParticipantsCount: v.length, unfilledDrawPositionsCount: D?.length }, stack: m });
5210
5210
  let { appliedPolicies: S } = xe({ tournamentRecord: n, drawDefinition: a, event: p }), T = S?.[Ru];
5211
- if (l.stage === yt) {
5211
+ if (l.stage === Ut) {
5212
5212
  let b = w.reduce((P, M) => (P[M.groupingValue] || (P[M.groupingValue] = []), P[M.groupingValue].push(M.participantId), P), {});
5213
5213
  Object.keys(b).length && (T || (T = { policyName: "Playoff Avoidance" }), T.policyAttributes || (T.policyAttributes = []), T.policyAttributes.push({ groupings: b }));
5214
5214
  }
@@ -5243,7 +5243,7 @@ function qF(e) {
5243
5243
  }
5244
5244
  function HF({ drawDefinition: e, structure: t, structureId: r }) {
5245
5245
  t || ({ structure: t } = me({ drawDefinition: e, structureId: r })), r || ({ structureId: r } = t);
5246
- let { positionAssignments: i } = Lt({ structure: t }), { stage: n, stageSequence: a } = t, { qualifiersCount: s, roundQualifiersCounts: o } = Cc({ drawDefinition: e, stageSequence: a, structureId: r, stage: n }), c = (o ? Object.keys(o) : []).map((h) => pe(h)), { matchUps: u } = _e({ structure: t }), { roundProfile: l } = Dr({ matchUps: u }), d = Object.assign({}, ...c.filter((h) => l?.[h]).map((h) => ({ [h]: l?.[h]?.drawPositions?.filter(Boolean) ?? [] }))), p = i?.filter((h) => h.qualifier).map((h) => h.drawPosition), m = s - (p?.length ?? 0), f = p?.length;
5246
+ let { positionAssignments: i } = Lt({ structure: t }), { stage: n, stageSequence: a } = t, { qualifiersCount: s, roundQualifiersCounts: o } = Oc({ drawDefinition: e, stageSequence: a, structureId: r, stage: n }), c = (o ? Object.keys(o) : []).map((h) => pe(h)), { matchUps: u } = _e({ structure: t }), { roundProfile: l } = Dr({ matchUps: u }), d = Object.assign({}, ...c.filter((h) => l?.[h]).map((h) => ({ [h]: l?.[h]?.drawPositions?.filter(Boolean) ?? [] }))), p = i?.filter((h) => h.qualifier).map((h) => h.drawPosition), m = s - (p?.length ?? 0), f = p?.length;
5247
5247
  return { unplacedRoundQualifierCounts: Object.assign({}, ...c.map((h) => {
5248
5248
  let g = i?.filter((I) => I.qualifier && d[h]?.drawPositions?.includes(I.drawPosition)).map((I) => I.drawPosition);
5249
5249
  return { [h]: (o?.[h] ?? 0) - (g?.length ?? 0) };
@@ -5268,7 +5268,7 @@ function zF({ provisionalPositioning: e, inContextDrawMatchUps: t, tournamentRec
5268
5268
  let f = [];
5269
5269
  for (let h of l) {
5270
5270
  let g = d.pop();
5271
- if (!g) return { error: gc };
5271
+ if (!g) return { error: Ic };
5272
5272
  f.push(g);
5273
5273
  let I = cn({ provisionalPositioning: e, inContextDrawMatchUps: t, tournamentRecord: r, drawDefinition: i, seedingProfile: n, participantId: h, seedBlockInfo: a, drawPosition: g, matchUpsMap: c, structureId: o, event: u });
5274
5274
  if (!I.success) return I;
@@ -5318,7 +5318,7 @@ function eL({ provisionalPositioning: e, relevantMatchUps: t, appliedPolicies: r
5318
5318
  a || (a = Io({ provisionalPositioning: e, appliedPolicies: r, drawDefinition: i, seedingProfile: n, structure: o }));
5319
5319
  let { isFeedIn: c, isLuckyStructure: u, isContainer: l } = a, { validSeedBlocks: d } = a;
5320
5320
  r?.seeding?.containerByesIgnoreSeeding && (d = []);
5321
- let p = YF({ provisionalPositioning: e, drawDefinition: i, structure: o }) ?? [], m = ye([].concat(...t.map((w) => w.drawPositions))), f = p.filter((w) => m.includes(w.drawPosition)), h = (w, v) => sc(w.seedValue) - sc(v.seedValue), g = d.reduce((w, v) => {
5321
+ let p = YF({ provisionalPositioning: e, drawDefinition: i, structure: o }) ?? [], m = ye([].concat(...t.map((w) => w.drawPositions))), f = p.filter((w) => m.includes(w.drawPosition)), h = (w, v) => oc(w.seedValue) - oc(v.seedValue), g = d.reduce((w, v) => {
5322
5322
  let D = f.filter((S) => v.drawPositions?.includes(S.drawPosition)).sort(h);
5323
5323
  return w.concat(...D);
5324
5324
  }, []).map((w) => w.drawPosition), I = KF({ orderedSortedFirstRoundSeededDrawPositions: g, validSeedBlocks: d, byesToPlace: s }), y = gv({ orderedSeedDrawPositions: g, relevantMatchUps: t }).slice(0, s), U = gv({ orderedSeedDrawPositions: I, relevantMatchUps: t }).slice(0, s);
@@ -5355,7 +5355,7 @@ function tL({ provisionalPositioning: e, seedOrderByePositions: t, isLuckyStruct
5355
5355
  return { unseededByePositions: A };
5356
5356
  }
5357
5357
  function rL({ provisionalPositioning: e, drawDefinition: t, matchUpsMap: r, structure: i, event: n }) {
5358
- let a = { isCollectionMatchUp: !1 }, { matchUps: s, roundMatchUps: o } = _e({ afterRecoveryTimes: !1, provisionalPositioning: e, drawDefinition: t, matchUpFilters: a, matchUpsMap: r, structure: i, event: n }), c = o?.[1] || [], u = i?.structureType === Pr, l = u ? s : c, d = u ? i?.structures?.length || 0 : s.length, { structureId: p, stage: m, stageSequence: f } = i, h = so({ entryStatuses: xi, provisionalPositioning: e, drawDefinition: t, stageSequence: f, structureId: p, stage: m }), { qualifiersCount: g } = Cc({ provisionalPositioning: e, drawDefinition: t, stageSequence: f, structureId: p, stage: m }), I = h.length + g, { positionAssignments: y, unassignedPositions: U } = Lt({ structure: i }), w = U?.map((P) => P.drawPosition), v = y?.filter((P) => P.bye).length, D = y?.filter((P) => P.bye).map((P) => P.drawPosition), S = l.map((P) => P.drawPositions).filter((P) => P?.reduce((M, N) => !D?.includes(N) && M, !0)).flat(1 / 0).filter((P) => w?.includes(P)), T = y?.length, b = T ? T - I : 0;
5358
+ let a = { isCollectionMatchUp: !1 }, { matchUps: s, roundMatchUps: o } = _e({ afterRecoveryTimes: !1, provisionalPositioning: e, drawDefinition: t, matchUpFilters: a, matchUpsMap: r, structure: i, event: n }), c = o?.[1] || [], u = i?.structureType === Pr, l = u ? s : c, d = u ? i?.structures?.length || 0 : s.length, { structureId: p, stage: m, stageSequence: f } = i, h = so({ entryStatuses: xi, provisionalPositioning: e, drawDefinition: t, stageSequence: f, structureId: p, stage: m }), { qualifiersCount: g } = Oc({ provisionalPositioning: e, drawDefinition: t, stageSequence: f, structureId: p, stage: m }), I = h.length + g, { positionAssignments: y, unassignedPositions: U } = Lt({ structure: i }), w = U?.map((P) => P.drawPosition), v = y?.filter((P) => P.bye).length, D = y?.filter((P) => P.bye).map((P) => P.drawPosition), S = l.map((P) => P.drawPositions).filter((P) => P?.reduce((M, N) => !D?.includes(N) && M, !0)).flat(1 / 0).filter((P) => w?.includes(P)), T = y?.length, b = T ? T - I : 0;
5359
5359
  return b > d && i.stageSequence === 1 && i.stage !== sr && (b = d), { placedByes: v, byesCount: b, relevantMatchUps: l, placedByePositions: D, roundMatchUps: o, positionsToAvoidDoubleBye: S };
5360
5360
  }
5361
5361
  function Iv({ provisionalPositioning: e, tournamentRecord: t, appliedPolicies: r, drawDefinition: i, seedBlockInfo: n, seedingProfile: a, matchUpsMap: s, structureId: o, structure: c, seedLimit: u, seedsOnly: l, event: d }) {
@@ -5382,7 +5382,7 @@ function _l(e) {
5382
5382
  if (y.error) return g(y);
5383
5383
  let U = y.structure;
5384
5384
  if (!U) return { error: lt };
5385
- let w = e.appliedPolicies || xe({ drawDefinition: t, structure: U, event: f })?.appliedPolicies, { qualifiersCount: v } = Cc({ stageSequence: U.stageSequence, provisionalPositioning: i, stage: U.stage, drawDefinition: t, structureId: u }), D = hs;
5385
+ let w = e.appliedPolicies || xe({ drawDefinition: t, structure: U, event: f })?.appliedPolicies, { qualifiersCount: v } = Oc({ stageSequence: U.stageSequence, provisionalPositioning: i, stage: U.stage, drawDefinition: t, structureId: u }), D = hs;
5386
5386
  if (!so({ stageSequence: U.stageSequence, provisionalPositioning: i, stage: U.stage, placementGroup: o, drawDefinition: t, entryStatuses: D, structureId: u })?.length && !v) return I({ ...x });
5387
5387
  let S = e.matchUpsMap ?? er({ drawDefinition: t }), T = e.inContextDrawMatchUps ?? Rt({ inContext: !0, drawDefinition: t, matchUpsMap: S })?.matchUps, b = [], P = Io({ provisionalPositioning: i, appliedPolicies: w, drawDefinition: t, seedingProfile: c, structure: U });
5388
5388
  if (P.error) return P;
@@ -5415,7 +5415,7 @@ function _l(e) {
5415
5415
  let { positionAssignments: A } = Ke({ drawDefinition: t, structure: U });
5416
5416
  return Je({ drawDefinition: t, structureIds: [u] }), r || vd(), { positionAssignments: A, conflicts: R, ...x, positioningReport: h };
5417
5417
  }
5418
- function xc(e) {
5418
+ function Fc(e) {
5419
5419
  let { applyPositioning: t = !0, provisionalPositioning: r, tournamentRecord: i, drawDefinition: n, seedingProfile: a, structureId: s, placeByes: o, seedsOnly: c } = e;
5420
5420
  if (!n) return { error: Zr };
5421
5421
  if (!Fn({ drawDefinition: n, structureId: s }) && !r) return { error: fg };
@@ -5449,7 +5449,7 @@ function gy({ qualifyingParticipantId: e, tournamentRecord: t, drawDefinition: r
5449
5449
  return my({ positionActionName: "qualifierDrawPositionAssignment", participantId: e, isQualifierPosition: !0, tournamentRecord: t, drawDefinition: r, drawPosition: i, structureId: n });
5450
5450
  }
5451
5451
  function Fu({ targetRoundNumber: e, finishingPosition: t, drawDefinition: r, structureId: i, linkType: n }) {
5452
- let { links: a } = Ec({ drawDefinition: r, structureId: i }) || {}, s = (a?.target || []).filter(({ linkType: o }) => o === n).filter(({ target: o }) => !e || e === o.roundNumber).map((o) => {
5452
+ let { links: a } = Ac({ drawDefinition: r, structureId: i }) || {}, s = (a?.target || []).filter(({ linkType: o }) => o === n).filter(({ target: o }) => !e || e === o.roundNumber).map((o) => {
5453
5453
  let c = o.source.structureId, { structure: u } = me({ structureId: c, drawDefinition: r });
5454
5454
  if (!(t && u?.finishingPosition !== t)) return o;
5455
5455
  }).filter(Boolean);
@@ -5513,7 +5513,7 @@ function gM({ drawDefinition: e, orderMap: t }) {
5513
5513
  return e ? ((typeof t != "object" || !Object.values(t).every((r) => ge(r))) && F({ result: { error: z }, context: { orderMap: t } }), e.structures || (e.structures = []), e.structures.forEach((r) => {
5514
5514
  let i = t[r.structureId];
5515
5515
  i && (r.structureOrder = i);
5516
- }), e.structures.sort((r, i) => Wo(r.structureOrder) - Wo(i.structureOrder)), { ...x }) : { error: ne };
5516
+ }), e.structures.sort((r, i) => qo(r.structureOrder) - qo(i.structureOrder)), { ...x }) : { error: ne };
5517
5517
  }
5518
5518
  function bm({ drawDefinition: e }) {
5519
5519
  let t = e.structures ?? [], r = e.links ?? [], i = /* @__PURE__ */ new Map(), n = (g) => {
@@ -5567,7 +5567,7 @@ function bm({ drawDefinition: e }) {
5567
5567
  return ye(I.concat(...y));
5568
5568
  });
5569
5569
  });
5570
- let l = o[0], d = (g, I) => St(g, I).length === g.length, p = o.slice(1).reduce((g, I) => g && d(I, l), !0), m = [l].filter(Boolean), f = [l].filter(Boolean);
5570
+ let l = o[0], d = (g, I) => vt(g, I).length === g.length, p = o.slice(1).reduce((g, I) => g && d(I, l), !0), m = [l].filter(Boolean), f = [l].filter(Boolean);
5571
5571
  t.forEach((g) => {
5572
5572
  let { structureId: I, stage: y } = g;
5573
5573
  m.find((U) => U.includes(I)) || (m.push([I]), y !== zt && f.push([I]));
@@ -5689,7 +5689,7 @@ function dL({ idBeingRemoved: e, drawDefinition: t }) {
5689
5689
  function rp({ stageSequence: e = 1, drawDefinition: t, drawSize: r, stage: i }) {
5690
5690
  if (!t) return { error: ne };
5691
5691
  if (!jI({ drawDefinition: t, stage: i })) return { error: cs };
5692
- let n = ux({ drawDefinition: t, stage: i }), { qualifiersCount: a } = Cc({ drawDefinition: t, stageSequence: e, stage: i }), s = n + a;
5692
+ let n = ux({ drawDefinition: t, stage: i }), { qualifiersCount: a } = Oc({ drawDefinition: t, stageSequence: e, stage: i }), s = n + a;
5693
5693
  if (r < s) return { error: aD };
5694
5694
  let { entryProfile: o } = VI({ attributes: [{ [i]: { drawSize: r } }], drawDefinition: t });
5695
5695
  return Je({ drawDefinition: t }), { ...x, entryProfile: o };
@@ -5796,7 +5796,7 @@ function Vl({ collectionPositionOffset: e = 0, collectionDefinition: t, matchUps
5796
5796
  };
5797
5797
  return te(0, l).map((p) => {
5798
5798
  let m = e + p + 1;
5799
- return { sides: [{ sideNumber: 1 }, { sideNumber: 2 }], matchUpId: d(p), matchUpStatus: vt, collectionPosition: m, collectionId: c, processCodes: u, matchUpType: o, isMock: n };
5799
+ return { sides: [{ sideNumber: 1 }, { sideNumber: 2 }], matchUpId: d(p), matchUpStatus: wt, collectionPosition: m, collectionId: c, processCodes: u, matchUpType: o, isMock: n };
5800
5800
  });
5801
5801
  }
5802
5802
  function Dy({ roundPosition: e, roundNumber: t, idPrefix: r, uuids: i }) {
@@ -5809,7 +5809,7 @@ function ip({ includeMatchUpType: e, matchUpType: t, roundNumber: r, matchUps: i
5809
5809
  d && (m.roundNumber = d), f && d && (f.roundNumber = d);
5810
5810
  let h = Dy({ roundPosition: l, roundNumber: r, idPrefix: n, uuids: s }), g = { roundPosition: l, children: [m, f], matchUpId: h };
5811
5811
  u.push(g);
5812
- let I = { drawPositions: g.children.map((y) => y?.drawPosition).filter(Boolean), matchUpStatus: vt, matchUpId: g.matchUpId, roundPosition: l, roundNumber: r };
5812
+ let I = { drawPositions: g.children.map((y) => y?.drawPosition).filter(Boolean), matchUpStatus: wt, matchUpId: g.matchUpId, roundPosition: l, roundNumber: r };
5813
5813
  e && t && (I.matchUpType = t), a && (I.isMock = !0), i.push(I), l++, c += 2;
5814
5814
  }
5815
5815
  return { roundNodes: u, matchUps: i };
@@ -5883,7 +5883,7 @@ function NL({ includeMatchUpType: e, drawPosition: t, roundNumber: r, matchUpTyp
5883
5883
  for (let h = 0; h < l; h++) {
5884
5884
  let g = p.shift(), I = { drawPosition: g, fed: u + 1, feed: !0 }, y = c[h];
5885
5885
  y.roundNumber = r - 1;
5886
- let U = Dy({ roundPosition: y.roundPosition, roundNumber: r, idPrefix: n, uuids: o }), w = { roundPosition: y.roundPosition, drawPositions: [g], matchUpStatus: vt, roundNumber: r, matchUpId: U };
5886
+ let U = Dy({ roundPosition: y.roundPosition, roundNumber: r, idPrefix: n, uuids: o }), w = { roundPosition: y.roundPosition, drawPositions: [g], matchUpStatus: wt, roundNumber: r, matchUpId: U };
5887
5887
  e && (w.matchUpType = i), s && (w.isMock = !0), a.push(w);
5888
5888
  let v = { children: [y, I] };
5889
5889
  m.push(v);
@@ -5926,7 +5926,7 @@ function RL({ drawSize: e }) {
5926
5926
  let t = Math.ceil(Math.log(e) / Math.log(2));
5927
5927
  return te(0, t).reverse().map((r) => Math.pow(2, r));
5928
5928
  }
5929
- function Go(e) {
5929
+ function $o(e) {
5930
5930
  let { finishingPositionOffset: t = 0, addNameBaseToAttributeName: r, playoffStructureNameBase: i, finishingPositionNaming: n, finishingPositionLimit: a, playoffAttributes: s, stageSequence: o = 1, exitProfile: c = "0", exitProfileLimit: u, roundOffsetLimit: l, roundOffset: d = 0, drawDefinition: p, staggeredEntry: m, sequenceLimit: f, stage: h = re, drawSize: g, idPrefix: I, isMock: y, uuids: U } = e;
5931
5931
  if (!(!s || !u || s?.[c]) || g < 2 || f && o > f) return {};
5932
5932
  let w = [], v = [], D = [], S = e.matchUpType ?? p?.matchUpType, T = t + 1, b = t + g, P = `${T}-${b}`, M = s?.[c], N = i && `${i} ` || "", R = s?.[P] ?? n?.[P], A = e.structureName || R?.name || M?.name && (r ? `${N}${M?.name}` : M.name) || `${N}${P}`, E = R?.abbreviation ?? M?.abbreviation, C = e.structureId ?? M?.structureId ?? U?.pop(), k = { idPrefix: I && `${I}-${A}-RP`, finishingPositionOffset: t, matchUpType: S, drawSize: g, isMock: y, uuids: U }, { matchUps: O } = m ? Pa(k) : un(k), L = ui({ structureAbbreviation: E, stageSequence: o, structureName: A, matchUpType: S, roundOffset: d, structureId: C, matchUps: O, stage: h });
@@ -5938,7 +5938,7 @@ function Go(e) {
5938
5938
  if (j < 2) return;
5939
5939
  let V = g / Math.pow(2, $) + t;
5940
5940
  if (a && V + 1 > a) return;
5941
- let { structures: H, structureId: W, matchUps: Y, links: q } = Go({ finishingPositionOffset: V, exitProfile: `${c}-${$}`, roundOffset: d + $, stageSequence: o + 1, drawSize: j, addNameBaseToAttributeName: r, playoffStructureNameBase: i, finishingPositionNaming: n, finishingPositionLimit: a, playoffAttributes: s, exitProfileLimit: u, roundOffsetLimit: l, drawDefinition: p, sequenceLimit: f, matchUpType: S, idPrefix: I, uuids: U, stage: h });
5941
+ let { structures: H, structureId: W, matchUps: Y, links: q } = $o({ finishingPositionOffset: V, exitProfile: `${c}-${$}`, roundOffset: d + $, stageSequence: o + 1, drawSize: j, addNameBaseToAttributeName: r, playoffStructureNameBase: i, finishingPositionNaming: n, finishingPositionLimit: a, playoffAttributes: s, exitProfileLimit: u, roundOffsetLimit: l, drawDefinition: p, sequenceLimit: f, matchUpType: S, idPrefix: I, uuids: U, stage: h });
5942
5942
  if (L.structureId && W) {
5943
5943
  let K = { linkType: En, source: { roundNumber: $, structureId: L.structureId }, target: { roundNumber: 1, feedProfile: Di, structureId: W } };
5944
5944
  q && L && q.push(K), q?.length && D.push(...q);
@@ -5971,7 +5971,7 @@ function EM(e) {
5971
5971
  function AL(e) {
5972
5972
  return EM(e).map((t) => te(t[0], t[1] && t[1] + 1 || t[0] + 1));
5973
5973
  }
5974
- function Fc({ drawDefinition: e, structureIds: t, matchUpsMap: r }) {
5974
+ function Lc({ drawDefinition: e, structureIds: t, matchUpsMap: r }) {
5975
5975
  if (t && !Array.isArray(t)) return { error: z, context: { structureIds: t } };
5976
5976
  if (!e) return { error: ne };
5977
5977
  t = t ?? (e.structures ?? []).filter((a) => a.stage !== oe).map(({ structureId: a }) => a);
@@ -5985,7 +5985,7 @@ function AM({ excludeRoundNumbers: e = [], playoffPositions: t = [], drawDefinit
5985
5985
  if (!r) return { error: ne };
5986
5986
  if (!i) return { error: ri };
5987
5987
  if (!t) return { error: ce, info: "missing playoffPositions" };
5988
- let n = Fc({ drawDefinition: r });
5988
+ let n = Lc({ drawDefinition: r });
5989
5989
  if (n.error) return n;
5990
5990
  let a = n.positionsPlayedOff, s = t.filter((I) => !a.includes(I)), o = Sv({ finishingPositions: s, drawDefinition: r, structureId: i }), c = Object.values(o).reduce((I, y) => I.includes(y.roundNumber) ? I : I.concat(y.roundNumber), []).map((I) => pe(I)).filter((I) => !e.includes(I)), u = Sv({ finishingPositions: a, drawDefinition: r, structureId: i }), l = u ? Object.values(u) : [], d = u ? l.reduce((I, y) => I.includes(y.roundNumber) ? I : I.concat(y.roundNumber), []).map((I) => pe(I)) : [], p = c.filter((I) => !d.includes(I)).sort(Ct), { roundProfile: m } = Py({ drawDefinition: r, structureId: i }), f = p.map((I) => {
5991
5991
  let y = m?.[I].finishingPositionRange.loser, [U, w] = y ?? [0, 0];
@@ -6001,7 +6001,7 @@ function CL({ playoffSourceRounds: e, roundProfile: t }) {
6001
6001
  }
6002
6002
  function jl({ drawDefinition: e, structureId: t }) {
6003
6003
  if (!e) return { error: ne };
6004
- let { matchUps: r, matchUpsMap: i } = vr({ inContext: !0, drawDefinition: e }), { positionsNotPlayedOff: n, positionsPlayedOff: a } = Fc({ drawDefinition: e, matchUpsMap: i }), { structures: s } = Ai({ drawDefinition: e }), o = s.filter((u) => !t && u.stage !== zt || u.structureId === t), c = {};
6004
+ let { matchUps: r, matchUpsMap: i } = vr({ inContext: !0, drawDefinition: e }), { positionsNotPlayedOff: n, positionsPlayedOff: a } = Lc({ drawDefinition: e, matchUpsMap: i }), { structures: s } = Ai({ drawDefinition: e }), o = s.filter((u) => !t && u.stage !== zt || u.structureId === t), c = {};
6005
6005
  for (let u of o) {
6006
6006
  let l = u?.structureId, d = OL({ playoffPositions: n, drawDefinition: e, structure: u, matchUps: r }), { error: p, ...m } = d;
6007
6007
  if (p) return d;
@@ -6010,9 +6010,9 @@ function jl({ drawDefinition: e, structureId: t }) {
6010
6010
  return t ? { positionsPlayedOff: a, ...c[t] } : { availablePlayoffProfiles: Object.values(c), availablePlayoffRounds: Object.values(c), positionsPlayedOff: a };
6011
6011
  }
6012
6012
  function OL({ playoffPositions: e, drawDefinition: t, structure: r, matchUps: i }) {
6013
- let n = r?.structureId, { links: a } = Ec({ drawDefinition: t, structureId: n });
6013
+ let n = r?.structureId, { links: a } = Ac({ drawDefinition: t, structureId: n });
6014
6014
  if (r.structureType === Pr || r.structures) {
6015
- let m = Ke({ structure: r })?.positionAssignments?.length, f = r.structures.length, h = (m ?? 0) / f, g = a.source?.flatMap(({ source: P }) => P?.finishingPositions || []) || [], I = te(1, h + 1).filter((P) => !g.includes(P)), y = i.find((P) => P.containerStructureId === n && P.finishingPositionRange)?.finishingPositionRange?.winner || [0, 1], U = a?.source.map(({ target: P }) => P.structureId), { positionsPlayedOff: w = [], positionsNotPlayedOff: v = [] } = Fc({ structureIds: U, drawDefinition: t }), D = [...w, ...v], S = te(y[0], y[1] + 1).filter((P) => !D.includes(P)), T = Wt(S, S.length / I.length), b = I.map((P, M) => {
6015
+ let m = Ke({ structure: r })?.positionAssignments?.length, f = r.structures.length, h = (m ?? 0) / f, g = a.source?.flatMap(({ source: P }) => P?.finishingPositions || []) || [], I = te(1, h + 1).filter((P) => !g.includes(P)), y = i.find((P) => P.containerStructureId === n && P.finishingPositionRange)?.finishingPositionRange?.winner || [0, 1], U = a?.source.map(({ target: P }) => P.structureId), { positionsPlayedOff: w = [], positionsNotPlayedOff: v = [] } = Lc({ structureIds: U, drawDefinition: t }), D = [...w, ...v], S = te(y[0], y[1] + 1).filter((P) => !D.includes(P)), T = Wt(S, S.length / I.length), b = I.map((P, M) => {
6016
6016
  let N = T[M], R = [Math.min(...N || []), Math.max(...N || [])].join("-");
6017
6017
  return { finishingPosition: P, finishingPositions: N, finishingPositionRange: R };
6018
6018
  });
@@ -6065,7 +6065,7 @@ function kM(e) {
6065
6065
  return { consolationStructure: b, links: P };
6066
6066
  }).map((D) => D.links).flat();
6067
6067
  if (w.push(...v), l >= 4 && l <= 16 || l > 32) {
6068
- let { matchUps: D } = un({ idPrefix: d && `${d}-p3t4`, finishingPositionOffset: 2, drawSize: 2, matchUpType: c, isMock: p }), S = n?.["3-4"]?.name ?? ar(yt), T = a?.[S] || S, b = t ? `${t} ${T}` : T, P = ga({ structureId: m?.pop(), matchUps: D, stageSequence: 2, stage: yt, structureName: b, matchUpType: c }), M = { linkType: En, source: { roundNumber: g - 1, structureId: y.structureId }, target: { structureId: P.structureId, feedProfile: Di, roundNumber: 1 } };
6068
+ let { matchUps: D } = un({ idPrefix: d && `${d}-p3t4`, finishingPositionOffset: 2, drawSize: 2, matchUpType: c, isMock: p }), S = n?.["3-4"]?.name ?? ar(Ut), T = a?.[S] || S, b = t ? `${t} ${T}` : T, P = ga({ structureId: m?.pop(), matchUps: D, stageSequence: 2, stage: Ut, structureName: b, matchUpType: c }), M = { linkType: En, source: { roundNumber: g - 1, structureId: y.structureId }, target: { structureId: P.structureId, feedProfile: Di, roundNumber: 1 } };
6069
6069
  U.push(P), w.push(M);
6070
6070
  }
6071
6071
  }
@@ -6076,7 +6076,7 @@ function xL({ playoffStructureNameBase: e, stageSequence: t = 1, playoffAttribut
6076
6076
  return { consolationStructure: ga({ matchUps: m, stage: sr, structureName: I, stageSequence: t, matchUpType: a, structureId: s }), consolationRoundsCount: f };
6077
6077
  }
6078
6078
  function Ds(e) {
6079
- let { finishingPositionOffset: t, stageSequence: r = 1, playoffAttributes: i, feedsFromFinal: n, staggeredEntry: a, structureName: s, stage: o = re, structureId: c, matchUpType: u, skipRounds: l, feedRounds: d, idPrefix: p, drawSize: m, isMock: f, uuids: h, fmlc: g } = e, I = e.feedPolicy || e.policyDefinitions?.[rc] || e.appliedPolicies?.[rc], y = { finishingPositionOffset: t, matchUpType: u, skipRounds: l, drawSize: m, idPrefix: p, isMock: f, uuids: h }, { matchUps: U } = a ? Pa(y) : un(y), w = ui({ structureName: s || i?.["0"]?.name || ar(re), structureId: c || h?.pop(), stageSequence: r, matchUpType: u, matchUps: U, stage: o }), v = [w], D = [], S = m / 2, { matchUps: T, roundsCount: b } = Pa({ finishingPositionOffset: S, idPrefix: p && `${p}-c`, isConsolation: !0, feedsFromFinal: n, baseDrawSize: S, matchUpType: u, feedRounds: d, skipRounds: l, isMock: f, uuids: h, fmlc: g });
6079
+ let { finishingPositionOffset: t, stageSequence: r = 1, playoffAttributes: i, feedsFromFinal: n, staggeredEntry: a, structureName: s, stage: o = re, structureId: c, matchUpType: u, skipRounds: l, feedRounds: d, idPrefix: p, drawSize: m, isMock: f, uuids: h, fmlc: g } = e, I = e.feedPolicy || e.policyDefinitions?.[ic] || e.appliedPolicies?.[ic], y = { finishingPositionOffset: t, matchUpType: u, skipRounds: l, drawSize: m, idPrefix: p, isMock: f, uuids: h }, { matchUps: U } = a ? Pa(y) : un(y), w = ui({ structureName: s || i?.["0"]?.name || ar(re), structureId: c || h?.pop(), stageSequence: r, matchUpType: u, matchUps: U, stage: o }), v = [w], D = [], S = m / 2, { matchUps: T, roundsCount: b } = Pa({ finishingPositionOffset: S, idPrefix: p && `${p}-c`, isConsolation: !0, feedsFromFinal: n, baseDrawSize: S, matchUpType: u, feedRounds: d, skipRounds: l, isMock: f, uuids: h, fmlc: g });
6080
6080
  if (m > 2) {
6081
6081
  let P = i?.["0-1"]?.name ?? ar(sr), M = e.playoffStructureNameBase ? `${e.playoffStructureNameBase} ${P}` : P, N = ui({ matchUps: T, structureId: h?.pop(), stage: sr, stageSequence: 1, structureName: M, matchUpType: u });
6082
6082
  v.push(N);
@@ -6086,7 +6086,7 @@ function Ds(e) {
6086
6086
  return { ...x, structures: v, links: D };
6087
6087
  }
6088
6088
  function xM({ requireSequential: e = !0, playoffMatchUpFormat: t, playoffAttributes: r, sourceStructureId: i, policyDefinitions: n, stageSequence: a, drawDefinition: s, playoffGroups: o, matchUpType: c, feedPolicy: u, groupCount: l, idPrefix: d, isMock: p, uuids: m }) {
6089
- u = u || n?.[rc];
6089
+ u = u || n?.[ic];
6090
6090
  let f = "processPlayoffGroups", h = 0, g = [], I = [], y = [], { error: U, positionRangeMap: w } = kL({ structureId: i, drawDefinition: s, playoffGroups: o });
6091
6091
  if (U) return F({ result: { error: U }, stack: f });
6092
6092
  if (!(!w || o?.every((v) => {
@@ -6096,29 +6096,29 @@ function xM({ requireSequential: e = !0, playoffMatchUpFormat: t, playoffAttribu
6096
6096
  return (!e || S) && D.every((T) => w[T]);
6097
6097
  }))) return F({ context: { validFinishingPositions: Object.values(w) }, result: { error: z }, stack: f });
6098
6098
  for (let v of o) {
6099
- let D = v.finishingPositions, S = w && D.map((E) => w[E]?.finishingPositions).flat(), T = l * D.length, b = fc(T), P = b === 2 && Zi || v.drawType || Zi;
6099
+ let D = v.finishingPositions, S = w && D.map((E) => w[E]?.finishingPositions).flat(), T = l * D.length, b = hc(T), P = b === 2 && Zi || v.drawType || Zi;
6100
6100
  S && (h = Math.min(...S) - 1);
6101
- let M = S && `${Math.min(...S)}-${Math.max(...S)}`, N = v.structureName || M && v.playoffAttributes?.[M]?.name || v.playoffAttributes?.["0"]?.name, R = { addNameBaseToAttributeName: v.addNameBaseToAttributeName, playoffStructureNameBase: v.playoffStructureNameBase, finishingPositionNaming: v.finishingPositionNaming, finishingPositionLimit: v.finishingPositionLimit, structureId: v.structureId ?? m?.pop(), playoffAttributes: v.playoffAttributes, structureNameMap: v.structureNameMap, sequenceLimit: v.sequenceLimit, structureName: N, idPrefix: d && `${d}-po`, appliedPolicies: n, finishingPositionOffset: h, stage: yt, stageSequence: a, matchUpType: c, drawSize: b, isMock: p, uuids: m }, A = ({ playoffStructures: E, playoffLinks: C }) => {
6101
+ let M = S && `${Math.min(...S)}-${Math.max(...S)}`, N = v.structureName || M && v.playoffAttributes?.[M]?.name || v.playoffAttributes?.["0"]?.name, R = { addNameBaseToAttributeName: v.addNameBaseToAttributeName, playoffStructureNameBase: v.playoffStructureNameBase, finishingPositionNaming: v.finishingPositionNaming, finishingPositionLimit: v.finishingPositionLimit, structureId: v.structureId ?? m?.pop(), playoffAttributes: v.playoffAttributes, structureNameMap: v.structureNameMap, sequenceLimit: v.sequenceLimit, structureName: N, idPrefix: d && `${d}-po`, appliedPolicies: n, finishingPositionOffset: h, stage: Ut, stageSequence: a, matchUpType: c, drawSize: b, isMock: p, uuids: m }, A = ({ playoffStructures: E, playoffLinks: C }) => {
6102
6102
  let [k] = E, O = ld({ playoffStructureId: k.structureId, finishingPositions: D, sourceStructureId: i });
6103
6103
  y.push(O), y.push(...C), I.push(...E), g.push({ structureId: k.structureId, finishingPositions: D }), h += T;
6104
6104
  };
6105
6105
  if (P === Zi) {
6106
- let { matchUps: E } = un({ finishingPositionLimit: h + T, idPrefix: d && `${d}-po`, finishingPositionOffset: h, matchUpType: c, drawSize: b, isMock: p, uuids: m }), C = ui({ structureId: v.structureId ?? m?.pop(), matchUpFormat: t, stage: yt, structureName: N, stageSequence: a, matchUps: E });
6106
+ let { matchUps: E } = un({ finishingPositionLimit: h + T, idPrefix: d && `${d}-po`, finishingPositionOffset: h, matchUpType: c, drawSize: b, isMock: p, uuids: m }), C = ui({ structureId: v.structureId ?? m?.pop(), matchUpFormat: t, stage: Ut, structureName: N, stageSequence: a, matchUps: E });
6107
6107
  I.push(C);
6108
6108
  let k = ld({ playoffStructureId: C.structureId, finishingPositions: D, sourceStructureId: i });
6109
6109
  y.push(k), h += T, g.push({ structureId: C.structureId, finishingPositions: D });
6110
- } else if ([Jo, Zo, yt].includes(P)) {
6111
- let E = { playoffAttributes: v.playoffAttributes ?? r, playoffStructureNameBase: v.playoffStructureNameBase, structureId: v.structureId ?? m?.pop(), structureName: v.structureName, idPrefix: d && `${d}-po`, addNameBaseToAttributeName: !0, finishingPositionOffset: h, stage: yt, roundOffset: 0, stageSequence: a, drawSize: b, isMock: p, uuids: m };
6112
- P === Jo ? Object.assign(E, { playoffAttributes: v?.playoffAttributes ?? r ?? rI, roundOffsetLimit: 3 }) : P === Zo && Object.assign(E, { playoffAttributes: v?.playoffAttributes ?? r ?? iI, roundOffsetLimit: 2 });
6113
- let C = Go(E);
6110
+ } else if ([Zo, ec, Ut].includes(P)) {
6111
+ let E = { playoffAttributes: v.playoffAttributes ?? r, playoffStructureNameBase: v.playoffStructureNameBase, structureId: v.structureId ?? m?.pop(), structureName: v.structureName, idPrefix: d && `${d}-po`, addNameBaseToAttributeName: !0, finishingPositionOffset: h, stage: Ut, roundOffset: 0, stageSequence: a, drawSize: b, isMock: p, uuids: m };
6112
+ P === Zo ? Object.assign(E, { playoffAttributes: v?.playoffAttributes ?? r ?? rI, roundOffsetLimit: 3 }) : P === ec && Object.assign(E, { playoffAttributes: v?.playoffAttributes ?? r ?? iI, roundOffsetLimit: 2 });
6113
+ let C = $o(E);
6114
6114
  if (C.error) return C;
6115
6115
  if (C.links?.length && y.push(...C.links), C.structures?.length && I.push(...C.structures), I.sort(ao), C.structureId) {
6116
6116
  let k = ld({ playoffStructureId: C.structureId, finishingPositions: D, sourceStructureId: i });
6117
6117
  y.push(k), g.push({ structureId: C.structureId, finishingPositions: D });
6118
6118
  }
6119
6119
  h += T;
6120
- } else if ([ec, ul, bu, Pu, Tu, Mu].includes(P)) {
6121
- let E = [m?.pop(), m?.pop()], C = { playoffStructureNameBase: v.playoffStructureNameBase, structureId: v.structureId ?? m?.pop(), playoffAttributes: v.playoffAttributes, idPrefix: d && `${d}-po`, finishingPositionOffset: h, uuids: E, stage: yt, structureName: N, matchUpType: c, feedPolicy: u, drawSize: b, isMock: p }, k = { [ec]: { fmlc: !0, feedRounds: 1 }, [Mu]: { feedRounds: 1 }, [bu]: { feedsFromFinal: 3 }, [Pu]: { feedsFromFinal: 2 }, [Tu]: { feedsFromFinal: 1 } };
6120
+ } else if ([tc, ul, bu, Pu, Tu, Mu].includes(P)) {
6121
+ let E = [m?.pop(), m?.pop()], C = { playoffStructureNameBase: v.playoffStructureNameBase, structureId: v.structureId ?? m?.pop(), playoffAttributes: v.playoffAttributes, idPrefix: d && `${d}-po`, finishingPositionOffset: h, uuids: E, stage: Ut, structureName: N, matchUpType: c, feedPolicy: u, drawSize: b, isMock: p }, k = { [tc]: { fmlc: !0, feedRounds: 1 }, [Mu]: { feedRounds: 1 }, [bu]: { feedsFromFinal: 3 }, [Pu]: { feedsFromFinal: 2 }, [Tu]: { feedsFromFinal: 1 } };
6122
6122
  Object.assign(C, k[P] || {});
6123
6123
  let { structures: O, links: L } = Ds(C), [_] = O, B = ld({ playoffStructureId: _.structureId, finishingPositions: D, sourceStructureId: i });
6124
6124
  y.push(B), y.push(...L), I.push(...O), g.push({ structureId: _.structureId, finishingPositions: D }), h += T;
@@ -6132,7 +6132,7 @@ function xM({ requireSequential: e = !0, playoffMatchUpFormat: t, playoffAttribu
6132
6132
  let { structures: E, links: C } = kM(R);
6133
6133
  A({ playoffStructures: E, playoffLinks: C });
6134
6134
  } else if ([zr].includes(P)) {
6135
- let E = ui({ structureId: v.structureId ?? m?.pop(), structureName: v.structureName, finishingPosition: Dd, stage: yt, stageSequence: a, matchUps: [] });
6135
+ let E = ui({ structureId: v.structureId ?? m?.pop(), structureName: v.structureName, finishingPosition: Dd, stage: Ut, stageSequence: a, matchUps: [] });
6136
6136
  A({ playoffStructures: [E], playoffLinks: [] });
6137
6137
  }
6138
6138
  }
@@ -6161,7 +6161,7 @@ function FL(e) {
6161
6161
  let b = De({ element: T, name: Jn })?.extension?.value?.groupOrder;
6162
6162
  b && (D[b] || (D[b] = []), D[b].push(T.participantId));
6163
6163
  });
6164
- let S = xc({ provisionalPositioning: e.provisionalPositioning, structureId: r, applyPositioning: !0, event: e.event, tournamentRecord: n, drawDefinition: a });
6164
+ let S = Fc({ provisionalPositioning: e.provisionalPositioning, structureId: r, applyPositioning: !0, event: e.event, tournamentRecord: n, drawDefinition: a });
6165
6165
  return S.error && S.error?.code !== fg.code ? F({ result: S, stack: t }) : { structures: d, links: p, positionsPlayedOff: h, drawDefinition: a, ...x };
6166
6166
  }
6167
6167
  function Lo({ value: e, sourceRange: t, targetRange: r }) {
@@ -6270,7 +6270,7 @@ function $L({ participantResults: e, groupingTotal: t, matchUpFormat: r, tallyPo
6270
6270
  });
6271
6271
  }
6272
6272
  function Gl({ participantIds: e, pressureRating: t, groupingTotal: r, matchUpFormat: i, tallyPolicy: n, perPlayer: a, matchUps: s }) {
6273
- let o = {}, c = n?.excludeMatchUpStatuses || [], u = s?.filter((m) => (m.tieMatchUps || !c.includes(m.matchUpStatus)) && (!e?.length || St(e, [_o(m, 0), _o(m, 1)]).length === 2)), l = u?.flatMap(({ score: m, tieMatchUps: f }) => f ? f.filter(({ matchUpStatus: h }) => !c.includes(h)).flatMap(({ score: h }) => h?.sets?.length ?? 0) : m?.sets?.length ?? 0)?.reduce((m, f) => m + f, 0), d = (m) => m?.sets?.reduce((f, h) => f + (h?.side1Score ?? 0) + (h?.side2Score ?? 0), 0) ?? 0, p = u?.flatMap(({ score: m, tieMatchUps: f }) => f ? f.filter(({ matchUpStatus: h }) => !c.includes(h)).flatMap(({ score: h }) => d(h)) : d(m))?.reduce((m, f) => m + f, 0);
6273
+ let o = {}, c = n?.excludeMatchUpStatuses || [], u = s?.filter((m) => (m.tieMatchUps || !c.includes(m.matchUpStatus)) && (!e?.length || vt(e, [_o(m, 0), _o(m, 1)]).length === 2)), l = u?.flatMap(({ score: m, tieMatchUps: f }) => f ? f.filter(({ matchUpStatus: h }) => !c.includes(h)).flatMap(({ score: h }) => h?.sets?.length ?? 0) : m?.sets?.length ?? 0)?.reduce((m, f) => m + f, 0), d = (m) => m?.sets?.reduce((f, h) => f + (h?.side1Score ?? 0) + (h?.side2Score ?? 0), 0) ?? 0, p = u?.flatMap(({ score: m, tieMatchUps: f }) => f ? f.filter(({ matchUpStatus: h }) => !c.includes(h)).flatMap(({ score: h }) => d(h)) : d(m))?.reduce((m, f) => m + f, 0);
6274
6274
  for (let m of u ?? []) {
6275
6275
  let { matchUpStatus: f, tieMatchUps: h, tieFormat: g, score: I, winningSide: y, sides: U } = m, w = g && m._disableAutoCalc && g.collectionDefinitions.every(({ scoreValue: S }) => S), v = y && WL(m), D = y && qL(m);
6276
6276
  if (!v && !D) if (f && Ft.includes(f)) {
@@ -6444,7 +6444,7 @@ function JL({ participantIds: e, participantResults: t }) {
6444
6444
  if (t[e[1]].victories.includes(e[0])) return e.reverse().map((r) => ({ resolved: !0, participantId: r }));
6445
6445
  }
6446
6446
  }
6447
- function Lc({ policyDefinitions: e, generateReport: t, pressureRating: r, matchUpFormat: i, matchUps: n = [], subOrderMap: a, perPlayer: s }) {
6447
+ function _c({ policyDefinitions: e, generateReport: t, pressureRating: r, matchUpFormat: i, matchUps: n = [], subOrderMap: a, perPlayer: s }) {
6448
6448
  if (!n?.length || !yi(n)) return { error: ra };
6449
6449
  let o = ye(n.map(({ structureId: w }) => w));
6450
6450
  if (o.length !== 1) return F({ result: { error: z, info: "Maximum one structureId" }, stack: "tallyParticipantResults", context: { structureIds: o } });
@@ -6478,7 +6478,7 @@ function ZL({ participantResults: e }) {
6478
6478
  }
6479
6479
  function WM({ positionAssignments: e }) {
6480
6480
  let t = (e || []).filter(Kr(Cn)).map((n) => {
6481
- let { extension: a } = De({ element: n, name: ic }), s = pe(a?.value), o = !isNaN(s) && s;
6481
+ let { extension: a } = De({ element: n, name: nc }), s = pe(a?.value), o = !isNaN(s) && s;
6482
6482
  return o && { participantId: n.participantId, subOrder: o };
6483
6483
  }).filter(Boolean), r = t.map(({ subOrder: n }) => n), i = Wr(r);
6484
6484
  return { subOrderMap: Object.assign({}, ...t.filter(({ subOrder: n }) => i[n] === 1).map(({ participantId: n, subOrder: a }) => ({ [n]: a }))) };
@@ -6486,15 +6486,15 @@ function WM({ positionAssignments: e }) {
6486
6486
  function Ny({ positionAssignments: e, tournamentRecord: t, drawDefinition: r, matchUpFormat: i, matchUps: n, event: a }) {
6487
6487
  if (!yi(n)) return { error: z };
6488
6488
  if (!e) return { error: z };
6489
- let { policyDefinitions: s } = aa({ policyTypes: [mI], tournamentRecord: t, drawDefinition: r, event: a }), { subOrderMap: o } = WM({ positionAssignments: e }), c = n.length ? Lc({ policyDefinitions: s, matchUpFormat: i, subOrderMap: o, matchUps: n }) : void 0;
6489
+ let { policyDefinitions: s } = aa({ policyTypes: [mI], tournamentRecord: t, drawDefinition: r, event: a }), { subOrderMap: o } = WM({ positionAssignments: e }), c = n.length ? _c({ policyDefinitions: s, matchUpFormat: i, subOrderMap: o, matchUps: n }) : void 0;
6490
6490
  if (c?.error) return c;
6491
6491
  let { participantResults: u = {}, bracketComplete: l, report: d } = c ?? {}, p = Object.keys(u);
6492
6492
  return e.forEach((m) => {
6493
6493
  let { participantId: f } = m;
6494
6494
  if (p.includes(f)) {
6495
6495
  let h = { value: u[f], name: Jn };
6496
- Le({ element: m, extension: h }), u[f].ties || Sr({ element: m, name: ic });
6497
- } else Sr({ element: m, name: Jn }), Sr({ element: m, name: ic });
6496
+ Le({ element: m, extension: h }), u[f].ties || Sr({ element: m, name: nc });
6497
+ } else Sr({ element: m, name: Jn }), Sr({ element: m, name: nc });
6498
6498
  }), Je({ drawDefinition: r }), { ...x, participantResults: u, bracketComplete: l, report: d };
6499
6499
  }
6500
6500
  function qM({ matchUps: e, matchUpId: t }) {
@@ -6516,7 +6516,7 @@ function Rm(e) {
6516
6516
  function Ry(e) {
6517
6517
  return Ce(e) ? Ce(e.element) ? (e.element.notes && delete e.element.notes, { ...x }) : { error: z } : { error: ce };
6518
6518
  }
6519
- var Em = { matchUpStatus: vt, matchUpStatusCodes: [], score: { scoreStringSide1: "", scoreStringSide2: "", sets: void 0 }, matchUpFormat: void 0, winningSide: void 0 };
6519
+ var Em = { matchUpStatus: wt, matchUpStatusCodes: [], score: { scoreStringSide1: "", scoreStringSide2: "", sets: void 0 }, matchUpFormat: void 0, winningSide: void 0 };
6520
6520
  function tn(e) {
6521
6521
  let t = "modifyMatchUpScore", r = e.matchUpFormat, i = e.matchUp, n, { matchUpStatusCodes: a, tournamentRecord: s, drawDefinition: o, matchUpStatus: c, removeScore: u, winningSide: l, matchUpId: d, event: p, notes: m, score: f } = e, h = e.appliedPolicies && Object.keys(e.appliedPolicies).length ? e.appliedPolicies : xe({ policyTypes: [pi], tournamentRecord: s, drawDefinition: o, structure: n, event: p })?.appliedPolicies, g = i.matchUpType === rt;
6522
6522
  if (g && o) {
@@ -6556,7 +6556,7 @@ function tn(e) {
6556
6556
  function Ey(e) {
6557
6557
  let { propagateExitStatus: t, matchUpStatusCodes: r, autoCalcDisabled: i, inContextMatchUp: n, matchUpStatus: a, dualMatchUp: s, structure: o, matchUp: c } = e, u = Rl({ matchUpStatus: a }) || [mn, Lr].includes(a) && s || i, l = c?.sides?.map((h) => h.participantId).filter(Boolean).length || n?.sides?.map((h) => h.participantId).filter(Boolean).length, d = "attemptToModifyScore";
6558
6558
  if (!(Rr({ structure: o }) && l === 1 || a === ze && l || e_({ structure: o, matchUp: c, inContextMatchUp: n }) || e.appliedPolicies?.[pi]?.requireParticipantsForScoring === !1 || dr(a) && l === 1 && t)) return F({ result: { error: vg }, stack: d });
6559
- let p = [nt].includes(a), m = u ? a : e.winningSide && Ut || Yr, f = tn({ ...e, winningSide: e.winningSide, matchUpStatusCodes: u && r || [], matchUpStatus: m, removeScore: p });
6559
+ let p = [nt].includes(a), m = u ? a : e.winningSide && St || Yr, f = tn({ ...e, winningSide: e.winningSide, matchUpStatusCodes: u && r || [], matchUpStatus: m, removeScore: p });
6560
6560
  return F({ result: f, stack: d });
6561
6561
  }
6562
6562
  function e_({ structure: e, matchUp: t, inContextMatchUp: r }) {
@@ -6580,7 +6580,7 @@ function t_({ collectionDefinition: e, groupValueNumbers: t, groupValueGroups: r
6580
6580
  }) : ge(f) ? a.forEach((y) => {
6581
6581
  y.score?.sets?.forEach((U) => {
6582
6582
  let { side1TiebreakScore: w = 0, side2TiebreakScore: v = 0, side1Score: D = 0, side2Score: S = 0 } = U;
6583
- (y.matchUpStatus === Ut || y.winningSide || U.winningSide) && (D || S ? (s[0] += D, s[1] += S) : (w || v) && U.winningSide && (s[U.winningSide - 1] += 1));
6583
+ (y.matchUpStatus === St || y.winningSide || U.winningSide) && (D || S ? (s[0] += D, s[1] += S) : (w || v) && U.winningSide && (s[U.winningSide - 1] += 1));
6584
6584
  });
6585
6585
  }) : Array.isArray(u) && a.forEach((y) => {
6586
6586
  if (y.winningSide) {
@@ -6607,7 +6607,7 @@ function $l(e) {
6607
6607
  if (!Array.isArray(t) || t.length !== 2 || isNaN(t.reduce((w, v) => w + v))) return { error: z };
6608
6608
  if (!s) return { error: Mr };
6609
6609
  let c = Ir({ matchUp: s, drawDefinition: i, structure: a, event: o })?.tieFormat || e?.tieFormat;
6610
- if (!c) return { error: yc };
6610
+ if (!c) return { error: Uc };
6611
6611
  let u = Nr({ tieFormat: c });
6612
6612
  if (u.error) return u;
6613
6613
  let l = c?.collectionDefinitions || [], d = s?.tieMatchUps ?? [], p = [0, 0], { groupValueGroups: m, groupValueNumbers: f } = HM(c);
@@ -6628,7 +6628,7 @@ function $l(e) {
6628
6628
  if (w ? U = h.map((S, T) => ({ sideNumber: T + 1, points: S })).find(({ points: S }) => S >= w)?.sideNumber : v && d.every((S) => S.matchUpStatus && Ft.includes(S.matchUpStatus) || S.winningSide) && h[0] !== h[1] && (U = h[0] > h[1] ? 1 : 2), !U && D) {
6629
6629
  let S = s.matchUpId, T = s.hasContext ? s : n?.drawMatchUps?.[S] || i && st({ inContext: !0, drawDefinition: i, matchUpId: S })?.matchUp;
6630
6630
  if (T) {
6631
- let { completedTieMatchUps: b, order: P } = Lc({ matchUps: [T] });
6631
+ let { completedTieMatchUps: b, order: P } = _c({ matchUps: [T] });
6632
6632
  if (b && P?.length) {
6633
6633
  let M = P[0].participantId;
6634
6634
  U = T.sides.find(({ participantId: N }) => N === M)?.sideNumber;
@@ -6681,7 +6681,7 @@ function oa(e) {
6681
6681
  p.tieFormat = tr(h);
6682
6682
  let g = $l({ drawDefinition: r, matchUpsMap: a, structure: m, matchUp: p, event: o }), { winningSide: I, set: y, scoreStringSide1: U, scoreStringSide2: w } = g, v = y?.side1Score || y?.side2Score;
6683
6683
  if (t && !p.score && !v) return { ...x };
6684
- let D = { scoreStringSide1: U, scoreStringSide2: w, sets: y ? [y] : [] }, S = I && [1, 2].includes(I), T = S && Ut || KI({ matchUpStatus: i ?? p.matchUpStatus, tieMatchUps: p.tieMatchUps, winningSide: p.winningSide, score: D }) && ki || vt, b = !!(p.winningSide && !S), P = p.tieMatchUps.find(({ score: N, winningSide: R, matchUpStatus: A }) => N?.sets?.length && (N.sets[0].side1Score || N.sets[0].side2Score) || A && Ft.includes(A) || R), M;
6684
+ let D = { scoreStringSide1: U, scoreStringSide2: w, sets: y ? [y] : [] }, S = I && [1, 2].includes(I), T = S && St || KI({ matchUpStatus: i ?? p.matchUpStatus, tieMatchUps: p.tieMatchUps, winningSide: p.winningSide, score: D }) && ki || wt, b = !!(p.winningSide && !S), P = p.tieMatchUps.find(({ score: N, winningSide: R, matchUpStatus: A }) => N?.sets?.length && (N.sets[0].side1Score || N.sets[0].side2Score) || A && Ft.includes(A) || R), M;
6685
6685
  if (p.tieFormat && !S && !P) {
6686
6686
  let N = Ir({ drawDefinition: r, structure: m, event: o })?.tieFormat;
6687
6687
  N && JSON.stringify(h) === JSON.stringify(N) && (p.tieFormatId = void 0, p.tieFormat = void 0, M = !0);
@@ -6710,7 +6710,7 @@ function i_({ winnerMatchUpDrawPositionIndex: e, inContextDrawMatchUps: t, proje
6710
6710
  }
6711
6711
  if (y?.seedAssignments && y.structureId !== v) {
6712
6712
  let P = y.seedAssignments.find(({ participantId: N }) => N === w), M = P?.participantId;
6713
- P && M && kc({ eventId: u?.eventId, structureId: v, ...P, tournamentRecord: a, drawDefinition: c, participantId: M });
6713
+ P && M && xc({ eventId: u?.eventId, structureId: v, ...P, tournamentRecord: a, drawDefinition: c, participantId: M });
6714
6714
  }
6715
6715
  } else {
6716
6716
  let f = Es({ matchUpId: u.matchUpId, drawPosition: n, inContextDrawMatchUps: t, sourceMatchUpStatus: i, tournamentRecord: a, sourceMatchUpId: o, drawDefinition: c, matchUpsMap: d });
@@ -6751,10 +6751,10 @@ function n_(e) {
6751
6751
  let j = k[0], V = cn({ participantId: P, structureId: N, drawPosition: j, inContextDrawMatchUps: r, sourceMatchUpStatus: a, tournamentRecord: o, drawDefinition: u, matchUpsMap: p, event: m });
6752
6752
  if (V.error) return F({ result: V, stack: f });
6753
6753
  if (!V.error && C && n) return { stack: f, context: { progressExitStatus: !0, loserParticipantId: P } };
6754
- } else return F({ context: { loserDrawPosition: s, loserTargetLink: c, targetDrawPositionIsUnfilled: O }, result: { error: O ? hc : _1 }, stack: f });
6754
+ } else return F({ context: { loserDrawPosition: s, loserTargetLink: c, targetDrawPositionIsUnfilled: O }, result: { error: O ? gc : _1 }, stack: f });
6755
6755
  if (v?.seedAssignments && v.structureId !== N) {
6756
6756
  let j = v.seedAssignments.find(({ participantId: H }) => H === P), V = j?.participantId;
6757
- j && V && kc({ eventId: l?.eventId, structureId: N, ...j, tournamentRecord: o, drawDefinition: u, participantId: V });
6757
+ j && V && xc({ eventId: l?.eventId, structureId: N, ...j, tournamentRecord: o, drawDefinition: u, participantId: V });
6758
6758
  }
6759
6759
  if (d && i) {
6760
6760
  let j = d.sides?.find((V) => V.sideNumber === 3 - i);
@@ -6791,12 +6791,12 @@ function YM(e) {
6791
6791
  if (D) {
6792
6792
  let T = s ? s - 1 : f - 1, b = 1 - T, P = D[T], M = D[b], N = {}, { targetLinks: { loserTargetLink: R, winnerTargetLink: A, byeTargetLink: E }, targetMatchUps: { winnerMatchUpDrawPositionIndex: C, loserMatchUpDrawPositionIndex: k, winnerMatchUp: O, loserMatchUp: L, byeMatchUp: _ } } = h;
6793
6793
  if (O) {
6794
- let B = i_({ sourceMatchUpStatus: i && d || Ut, winnerMatchUpDrawPositionIndex: C, sourceMatchUpId: g, inContextDrawMatchUps: a, projectedWinningSide: s, winningDrawPosition: P, tournamentRecord: u, winnerTargetLink: A, drawDefinition: l, winnerMatchUp: O, dualMatchUp: p, matchUpsMap: m, event: U });
6794
+ let B = i_({ sourceMatchUpStatus: i && d || St, winnerMatchUpDrawPositionIndex: C, sourceMatchUpId: g, inContextDrawMatchUps: a, projectedWinningSide: s, winningDrawPosition: P, tournamentRecord: u, winnerTargetLink: A, drawDefinition: l, winnerMatchUp: O, dualMatchUp: p, matchUpsMap: m, event: U });
6795
6795
  if (B.error) return F({ result: B, stack: t });
6796
6796
  }
6797
6797
  if (L) {
6798
- let B = n_({ sourceMatchUpStatus: i && d || Ut, loserMatchUpDrawPositionIndex: k, inContextDrawMatchUps: a, projectedWinningSide: s, propagateExitStatus: o, loserDrawPosition: M, tournamentRecord: u, loserTargetLink: R, drawDefinition: l, loserMatchUp: L, matchUpsMap: m, dualMatchUp: p, event: U });
6799
- if (B.context?.progressExitStatus && Object.assign(N, B.context, { sourceMatchUpStatus: i && d || Ut, sourceMatchUpStatusCodes: c || [], loserMatchUp: L, matchUpsMap: m }), B.error) return F({ result: B, stack: t });
6798
+ let B = n_({ sourceMatchUpStatus: i && d || St, loserMatchUpDrawPositionIndex: k, inContextDrawMatchUps: a, projectedWinningSide: s, propagateExitStatus: o, loserDrawPosition: M, tournamentRecord: u, loserTargetLink: R, drawDefinition: l, loserMatchUp: L, matchUpsMap: m, dualMatchUp: p, event: U });
6799
+ if (B.context?.progressExitStatus && Object.assign(N, B.context, { sourceMatchUpStatus: i && d || St, sourceMatchUpStatusCodes: c || [], loserMatchUp: L, matchUpsMap: m }), B.error) return F({ result: B, stack: t });
6800
6800
  }
6801
6801
  if (_) {
6802
6802
  let B = _.drawPositions || [], G = Math.min(...B.filter(Boolean)), $ = E.target.structureId, j = ai({ drawPosition: G, structureId: $, tournamentRecord: u, drawDefinition: l, event: U });
@@ -6829,7 +6829,7 @@ function Cy(e) {
6829
6829
  for (let W of A ?? []) {
6830
6830
  let Y = E?.find((he) => he.roundNumber === W);
6831
6831
  if (!Y) return F({ result: { error: z }, context: { roundNumber: W }, stack: t });
6832
- let q = Y.finishingPositions.length, K = Math.min(...Y.finishingPositions) - 1, X = 2, Q = W && M?.[W] && X + M[W] - 1, Z = Go({ exitProfile: `0-${W}`, addNameBaseToAttributeName: n, playoffStructureNameBase: a, finishingPositionOffset: K, playoffAttributes: c, exitProfileLimit: p, stage: yt, roundOffset: 0, drawDefinition: U, sequenceLimit: Q, stageSequence: X, drawSize: q, idPrefix: h, isMock: g, uuids: y, finishingPositionNaming: s, finishingPositionLimit: o, roundOffsetLimit: l });
6832
+ let q = Y.finishingPositions.length, K = Math.min(...Y.finishingPositions) - 1, X = 2, Q = W && M?.[W] && X + M[W] - 1, Z = $o({ exitProfile: `0-${W}`, addNameBaseToAttributeName: n, playoffStructureNameBase: a, finishingPositionOffset: K, playoffAttributes: c, exitProfileLimit: p, stage: Ut, roundOffset: 0, drawDefinition: U, sequenceLimit: Q, stageSequence: X, drawSize: q, idPrefix: h, isMock: g, uuids: y, finishingPositionNaming: s, finishingPositionLimit: o, roundOffsetLimit: l });
6833
6833
  if (Z.error) return F({ result: Z, stack: t });
6834
6834
  let { structures: ee, links: ue } = Z;
6835
6835
  if (ee?.length && C.push(...ee), ue?.length && k.push(...ue), Z.structureId && W) {
@@ -7011,7 +7011,7 @@ function bv(e, t) {
7011
7011
  }
7012
7012
  function xy({ tournamentRecord: e, drawDefinition: t, flightProfile: r, drawName: i, drawId: n, event: a }) {
7013
7013
  if (!i || typeof i != "string") return F({ result: { error: z }, context: { drawName: i } });
7014
- r || (r = wt({ event: a }).flightProfile);
7014
+ r || (r = Dt({ event: a }).flightProfile);
7015
7015
  let s = r?.flights?.find((o) => o.drawId === n);
7016
7016
  if (s) {
7017
7017
  s.drawName = i;
@@ -7022,7 +7022,7 @@ function xy({ tournamentRecord: e, drawDefinition: t, flightProfile: r, drawName
7022
7022
  }
7023
7023
  function QM({ tournamentRecord: e, drawDefinition: t, drawUpdates: r, drawId: i, event: n }) {
7024
7024
  if (!Ce(r)) return { error: z };
7025
- let a = wt({ event: n }).flightProfile, s = r.drawName && xy({ drawName: r.drawName, tournamentRecord: e, drawDefinition: t, flightProfile: a, drawId: i, event: n });
7025
+ let a = Dt({ event: n }).flightProfile, s = r.drawName && xy({ drawName: r.drawName, tournamentRecord: e, drawDefinition: t, flightProfile: a, drawId: i, event: n });
7026
7026
  if (s?.error) return s?.error;
7027
7027
  let o = s?.flight || a?.flights?.find((c) => c.drawId === i);
7028
7028
  if (!o && !t) return { error: ne };
@@ -7050,7 +7050,7 @@ function JM({ tournamentRecord: e, removeScheduling: t, drawDefinition: r }) {
7050
7050
  }
7051
7051
  }
7052
7052
  }
7053
- r.extensions = r.extensions.filter((s) => s.name !== jo);
7053
+ r.extensions = r.extensions.filter((s) => s.name !== Go);
7054
7054
  let a = (r.structures || []).map(({ structureId: s }) => s);
7055
7055
  return Je({ drawDefinition: r, structureIds: a }), { ...x };
7056
7056
  }
@@ -7068,7 +7068,7 @@ function Hl({ tournamentRecord: e }) {
7068
7068
  a += R?.length ?? 0;
7069
7069
  let A = (N?.length ?? 0) - (R?.length ?? 0), { roundMatchUps: E, roundProfile: C, roundNumbers: k, maxMatchUpsCount: O } = Dr({ matchUps: T }), L = C && Object.keys(C).filter((G) => !C[G].inactiveRound).map((G) => parseInt(G)), _ = C && Object.keys(C).filter((G) => C[G].inactiveRound).map((G) => parseInt(G)), B = C && Object.values(C).every((G) => G.inactiveRound);
7070
7070
  return { positionsAssignedCount: R?.length ?? 0, maxWinningSideFirstRoundPosition: M, unassignedPositionsCount: A, inactiveStructure: B, maxMatchUpsCount: O, inactiveRounds: _, roundMatchUps: E, activeRounds: L, roundNumbers: k, roundProfile: C, structureId: D, stageSequence: v, orderNumber: S, stage: w };
7071
- }), d = l.find((U) => U.orderNumber === 2 && U.stageSequence === 1), p = l.filter(({ inactiveStructure: U }) => !U).length, { links: m } = Ec({ structureId: d.structureId, drawDefinition: i }), f = pe(d.activeRounds[0]) === 1 && d.activeRounds.length === 1 && p === 1, h = l?.every(({ inactiveStructure: U }) => U), g = !m.length && d.activeRounds.length && (d.roundProfile[1].inactiveCount || d.inactiveRounds.length), I = i.drawId;
7071
+ }), d = l.find((U) => U.orderNumber === 2 && U.stageSequence === 1), p = l.filter(({ inactiveStructure: U }) => !U).length, { links: m } = Ac({ structureId: d.structureId, drawDefinition: i }), f = pe(d.activeRounds[0]) === 1 && d.activeRounds.length === 1 && p === 1, h = l?.every(({ inactiveStructure: U }) => U), g = !m.length && d.activeRounds.length && (d.roundProfile[1].inactiveCount || d.inactiveRounds.length), I = i.drawId;
7072
7072
  a && !s && t.positionsNoOutcomes.push(I), h && t.inactive.push(I), f && t.matchPlay.push(I), g && t.canBePruned.push(I);
7073
7073
  let y = { matchUpsWithWinningSideCount: s, matchUpsNoOutcomeCount: o, positionsAssignedCount: a, allStructuresLinked: c, structuresData: l, inactiveDraw: h, isMatchPlay: f, drawId: I };
7074
7074
  t.drawAnalysis[I] = y;
@@ -7100,7 +7100,7 @@ function ZM({ matchPlayDrawPositions: e = !0, tournamentRecord: t, drawDefinitio
7100
7100
  }
7101
7101
  function eN({ tournamentRecord: e, drawDefinition: t, participantId: r, drawPosition: i, structureId: n, qualifier: a, event: s, bye: o }) {
7102
7102
  if (!t) return { error: ne };
7103
- if (!i) return { error: gc };
7103
+ if (!i) return { error: Ic };
7104
7104
  if (!n) return { error: ri };
7105
7105
  if (o) {
7106
7106
  let c = ai({ tournamentRecord: e, drawDefinition: t, drawPosition: i, structureId: n, event: s });
@@ -7125,7 +7125,7 @@ function tN(e) {
7125
7125
  return t = t.filter((c) => !o.includes(c)), e.roundNumbers && !t.length && (t = o), { existingMatchUps: a, matchUpIds: t, structureId: i, structure: n };
7126
7126
  }
7127
7127
  function rN(e) {
7128
- let t = se(e, [{ [hr]: !0 }, { [tc]: { [ll]: !1, roundNumbers: !1 }, [ti]: z, [Ar]: ur }]);
7128
+ let t = se(e, [{ [hr]: !0 }, { [rc]: { [ll]: !1, roundNumbers: !1 }, [ti]: z, [Ar]: ur }]);
7129
7129
  if (t.error) return t;
7130
7130
  let { removeIncomplete: r = !1, removeUnAssigned: i = !0, removeCompleted: n = !1, tournamentRecord: a, drawDefinition: s, event: o } = e, c = tN(e);
7131
7131
  if (c.error) return c;
@@ -7201,21 +7201,21 @@ function Om(e) {
7201
7201
  function nN({ tournamentRecord: e, drawDefinition: t, drawPosition: r, structureId: i, subOrder: n, event: a }) {
7202
7202
  if (!t) return { error: ne };
7203
7203
  if (!i) return { error: ri };
7204
- if (!r) return { error: gc };
7204
+ if (!r) return { error: Ic };
7205
7205
  let { structure: s } = me({ drawDefinition: t, structureId: i });
7206
7206
  if (!s) return { error: lt };
7207
7207
  let o = s;
7208
7208
  s.structures && s.structureType === Pr && (o = s.structures?.find((m) => m.positionAssignments?.find((f) => f.drawPosition === r)));
7209
7209
  let c = o?.positionAssignments, u = c?.find((m) => m.drawPosition === r);
7210
- u && Le({ element: u, extension: { name: ic, value: n } });
7210
+ u && Le({ element: u, extension: { name: nc, value: n } });
7211
7211
  let l = (a?.eventType === rt || t.matchUpType === rt || (a?.tieFormat ?? t?.tieFormat ?? s?.tieFormat)) && { matchUpTypes: [rt] }, { matchUps: d } = _e({ structure: o, afterRecoveryTimes: !1, inContext: !0, matchUpFilters: l, event: a }), p = s?.matchUpFormat ?? t.matchUpFormat;
7212
7212
  return Ny({ positionAssignments: c, tournamentRecord: e, drawDefinition: t, matchUpFormat: p, matchUps: d, event: a }), Je({ drawDefinition: t, structureIds: [i] }), { ...x };
7213
7213
  }
7214
7214
  var aN = {};
7215
- Pe(aN, { addGoesTo: () => Za, allPlayoffPositionsFilled: () => hy, checkValidEntries: () => Fm, findDrawDefinition: () => By, getAssignedParticipantIds: () => Is, getAvailableMatchUpsCount: () => km, getAvailablePlayoffProfiles: () => jl, getDrawDefinitionTimeItem: () => FI, getDrawParticipantRepresentativeIds: () => Ly, getDrawStructures: () => Ai, getDrawTypeCoercion: () => zl, getEligibleVoluntaryConsolationParticipants: () => Fy, getMatchUpsMap: () => er, getParticipantIdFinishingPositions: () => _y, getPositionAssignments: () => _u, getPositionsPlayedOff: () => Fc, getRandomQualifierList: () => Gy, getSeedingThresholds: () => uy, getSeedsCount: () => Yl, getStructureSeedAssignments: () => mi, getTeamLineUp: () => Ja, getValidGroupSizes: () => Fl, isAdHoc: () => Rr, isCompletedStructure: () => Fn, isValidForQualifying: () => $y, positionActions: () => jy });
7215
+ Pe(aN, { addGoesTo: () => Za, allPlayoffPositionsFilled: () => hy, checkValidEntries: () => Fm, findDrawDefinition: () => By, getAssignedParticipantIds: () => Is, getAvailableMatchUpsCount: () => km, getAvailablePlayoffProfiles: () => jl, getDrawDefinitionTimeItem: () => FI, getDrawParticipantRepresentativeIds: () => Ly, getDrawStructures: () => Ai, getDrawTypeCoercion: () => zl, getEligibleVoluntaryConsolationParticipants: () => Fy, getMatchUpsMap: () => er, getParticipantIdFinishingPositions: () => _y, getPositionAssignments: () => _u, getPositionsPlayedOff: () => Lc, getRandomQualifierList: () => Gy, getSeedingThresholds: () => uy, getSeedsCount: () => Yl, getStructureSeedAssignments: () => mi, getTeamLineUp: () => Ja, getValidGroupSizes: () => Fl, isAdHoc: () => Rr, isCompletedStructure: () => Fn, isValidForQualifying: () => $y, positionActions: () => jy });
7216
7216
  function Fy({ excludedMatchUpStatuses: e = [], includeEventParticipants: t, includeQualifyingStage: r, finishingRoundLimit: i, policyDefinitions: n, roundNumberLimit: a, tournamentRecord: s, drawDefinition: o, matchUpsLimit: c, requirePlay: u, requireLoss: l, allEntries: d, winsLimit: p, event: m }) {
7217
7217
  if (!o) return { error: ne };
7218
- let f = [re, yt];
7218
+ let f = [re, Ut];
7219
7219
  r && f.push(oe);
7220
7220
  let h = m?.eventType ? { matchUpTypes: [m.eventType] } : void 0, g = o?.matchUpType ? { matchUpTypes: [o.matchUpType] } : void 0, I = t && m ? Vn({ contextFilters: { stages: f }, matchUpFilters: h, tournamentRecord: s, inContext: !0, event: m })?.matchUps ?? [] : vr({ contextFilters: { stages: f }, matchUpFilters: g, tournamentRecord: s, inContext: !0, drawDefinition: o })?.matchUps ?? [], y = so({ stage: zt, drawDefinition: o }).map(({ participantId: k }) => k), U = {}, w = {}, v = {}, D = {};
7221
7221
  n || (n = aa({ policyTypes: [bh], tournamentRecord: s, drawDefinition: o, event: m }).policyDefinitions);
@@ -7269,7 +7269,7 @@ function o_({ tournamentParticipants: e, drawDefinition: t, event: r }) {
7269
7269
  function _y({ byeAdvancements: e = !1, tournamentRecord: t, drawDefinition: r }) {
7270
7270
  if (!r) return { error: ne };
7271
7271
  let { participantIds: i, participantIdMatchUps: n } = o_({ tournamentParticipants: t?.participants, drawDefinition: r }), a = i?.map((s) => {
7272
- let o = n[s].filter((d) => [Ut, "BYE"].includes(d.matchUpStatus) || d.winningSide), c = o.map((d) => {
7272
+ let o = n[s].filter((d) => [St, "BYE"].includes(d.matchUpStatus) || d.winningSide), c = o.map((d) => {
7273
7273
  let p = d.sides.find((f) => f.bye), m = d.sides.find((f) => f.participantId === s).sideNumber;
7274
7274
  return (d.winningSide || e && p && m) === m ? d.finishingPositionRange.winner : d.finishingPositionRange.loser;
7275
7275
  }), u = (d) => Math.abs(d[0] - d[1]), l = c.reduce((d, p) => d && u(d) < u(p) ? d : p, void 0);
@@ -7281,7 +7281,7 @@ function xa({ tournamentRecords: e, tournamentRecord: t, tournamentId: r, drawId
7281
7281
  if (!t && !e) return { error: J };
7282
7282
  if (!i) return { error: zi };
7283
7283
  if (!t && e) {
7284
- if (typeof r != "string" && (r = zM({ tournamentRecords: e, drawId: i }), !r)) return { error: qo };
7284
+ if (typeof r != "string" && (r = zM({ tournamentRecords: e, drawId: i }), !r)) return { error: Ho };
7285
7285
  if (t = e[r], !t) return { error: J };
7286
7286
  }
7287
7287
  let n = t && Er({ tournamentRecord: t, drawId: i });
@@ -7347,9 +7347,9 @@ function p_({ specifiedPolicyDefinitions: e, inContextDrawMatchUps: t, matchUpPa
7347
7347
  }
7348
7348
  function m_({ tournamentParticipants: e = [], possiblyDisablingAction: t, activeDrawPositions: r, positionAssignments: i, returnParticipants: n, appliedPolicies: a, drawDefinition: s, drawPosition: o, validActions: c, structureId: u, structure: l, drawId: d, event: p }) {
7349
7349
  if (r.includes(o)) return {};
7350
- let m = c.find((S) => S.type === Ws)?.availableParticipantIds, f = a?.[On]?.otherFlightEntries, h = a?.[On]?.restrictQualifyingAlternates, g = (s.entries ?? []).filter(({ entryStage: S }) => !h || (l.stage === oe ? S === oe : S !== oe)).sort((S, T) => (S.entryPosition ?? 1 / 0) - (T.entryPosition ?? 1 / 0)).map(({ participantId: S }) => S).filter(Boolean), { allPositionedParticipantIds: I } = qP({ drawDefinition: s }), y = i.map((S) => S.participantId).filter(Boolean), U = g.filter((S) => l.stage && [oe, re, yt].includes(l.stage) ? !I?.includes(S) : !y.includes(S)), w = (p?.entries ?? []).filter((S) => S.entryStatus === Mi && gN({ restrictQualifyingAlternates: h, structure: l, entry: S }) && (l.stage && [oe, re, yt].includes(l.stage) ? !I?.includes(S.participantId) : !y.includes(S.participantId))).sort((S, T) => (S.entryPosition ?? 1 / 0) - (T.entryPosition ?? 1 / 0)).map((S) => S.participantId), v = ye(U.concat(w));
7350
+ let m = c.find((S) => S.type === Ws)?.availableParticipantIds, f = a?.[On]?.otherFlightEntries, h = a?.[On]?.restrictQualifyingAlternates, g = (s.entries ?? []).filter(({ entryStage: S }) => !h || (l.stage === oe ? S === oe : S !== oe)).sort((S, T) => (S.entryPosition ?? 1 / 0) - (T.entryPosition ?? 1 / 0)).map(({ participantId: S }) => S).filter(Boolean), { allPositionedParticipantIds: I } = qP({ drawDefinition: s }), y = i.map((S) => S.participantId).filter(Boolean), U = g.filter((S) => l.stage && [oe, re, Ut].includes(l.stage) ? !I?.includes(S) : !y.includes(S)), w = (p?.entries ?? []).filter((S) => S.entryStatus === Mi && gN({ restrictQualifyingAlternates: h, structure: l, entry: S }) && (l.stage && [oe, re, Ut].includes(l.stage) ? !I?.includes(S.participantId) : !y.includes(S.participantId))).sort((S, T) => (S.entryPosition ?? 1 / 0) - (T.entryPosition ?? 1 / 0)).map((S) => S.participantId), v = ye(U.concat(w));
7351
7351
  if (f) {
7352
- let S = (p ? wt({ event: p }).flightProfile : void 0)?.flights?.filter((T) => T.drawId !== d).map((T) => T.drawEntries.filter((b) => b.participantId && ![kn, Ii, fs].includes(b.entryStatus) && !g.includes(b.participantId)).map(({ participantId: b }) => b)).flat().filter(Boolean);
7352
+ let S = (p ? Dt({ event: p }).flightProfile : void 0)?.flights?.filter((T) => T.drawId !== d).map((T) => T.drawEntries.filter((b) => b.participantId && ![kn, Ii, fs].includes(b.entryStatus) && !g.includes(b.participantId)).map(({ participantId: b }) => b)).flat().filter(Boolean);
7353
7353
  S?.length && v.push(...S);
7354
7354
  }
7355
7355
  m?.length && (v = v.filter((S) => !m.includes(S)));
@@ -7375,7 +7375,7 @@ function h_({ restrictAdHocRoundParticipants: e, tournamentParticipants: t, matc
7375
7375
  }), y.length && p.push({ payload: { drawId: l, matchUpId: o, structureId: a, sideNumber: s }, method: Nv, type: Ws, availableParticipantIds: y, participantsAvailable: U });
7376
7376
  let w = d?.entries ?? [], v = f_({ eventEntries: w, structure: c }), D = ye(g.concat(v));
7377
7377
  if (i) {
7378
- let T = (d ? wt({ event: d }) : void 0)?.flights?.filter((b) => b.drawId !== l).flatMap((b) => b.drawEntries.filter((P) => P.participantId && ![kn, Ii, fs].includes(P.entryStatus)).map(({ participantId: P }) => P)).filter(Boolean);
7378
+ let T = (d ? Dt({ event: d }) : void 0)?.flights?.filter((b) => b.drawId !== l).flatMap((b) => b.drawEntries.filter((P) => P.participantId && ![kn, Ii, fs].includes(P.entryStatus)).map(({ participantId: P }) => P)).filter(Boolean);
7379
7379
  T?.length && D.push(...T);
7380
7380
  }
7381
7381
  D = D.filter((T) => !r.includes(T) && !y.includes(T) && (!e || !I.includes(T)));
@@ -7410,7 +7410,7 @@ function xm(e) {
7410
7410
  if (!p) return { error: pr };
7411
7411
  let f = xe({ tournamentRecord: u, drawDefinition: t, structure: m, event: r }).appliedPolicies ?? {};
7412
7412
  Object.assign(f, n ?? {});
7413
- let h = f?.[On]?.otherFlightEntries, g = f?.[Yt] ?? Oc[Yt], { enabledStructures: I } = oN({ actionType: Gh, appliedPolicies: f, drawDefinition: t, structure: m }), { policyActions: y } = cN({ enabledStructures: I, drawDefinition: t, structure: m }), U = e.matchUpsMap ?? er({ drawDefinition: t }), w = e.inContextDrawMatchUps ?? Rt({ tournamentParticipants: l, inContext: !0, drawDefinition: t, matchUpsMap: U, event: r }).matchUps, v = w?.find((q) => q.matchUpId === c), D = o && v?.sides?.find((q) => q.sideNumber === o), S = v?.sides?.map((q) => q.participantId || q.participant?.participantid).filter(Boolean) ?? [], { assignedPositions: T, allPositionsAssigned: b } = Lt({ structure: m }), { structureId: P } = m ?? {}, M = [];
7413
+ let h = f?.[On]?.otherFlightEntries, g = f?.[Yt] ?? kc[Yt], { enabledStructures: I } = oN({ actionType: Gh, appliedPolicies: f, drawDefinition: t, structure: m }), { policyActions: y } = cN({ enabledStructures: I, drawDefinition: t, structure: m }), U = e.matchUpsMap ?? er({ drawDefinition: t }), w = e.inContextDrawMatchUps ?? Rt({ tournamentParticipants: l, inContext: !0, drawDefinition: t, matchUpsMap: U, event: r }).matchUps, v = w?.find((q) => q.matchUpId === c), D = o && v?.sides?.find((q) => q.sideNumber === o), S = v?.sides?.map((q) => q.participantId || q.participant?.participantid).filter(Boolean) ?? [], { assignedPositions: T, allPositionsAssigned: b } = Lt({ structure: m }), { structureId: P } = m ?? {}, M = [];
7414
7414
  if (!P) return { validActions: M };
7415
7415
  let N = Rr({ structure: m }), R = !!p.collectionId;
7416
7416
  if (N && !R) {
@@ -7457,7 +7457,7 @@ function g_({ tournamentParticipants: e = [], sourceStructuresComplete: t, possi
7457
7457
  function I_({ positionSourceStructureIds: e, unassignedParticipantIds: t, possiblyDisablingAction: r, provisionalPositioning: i, tournamentParticipants: n, isWinRatioFedStructure: a, positionAssignments: s, returnParticipants: o, appliedPolicies: c, drawDefinition: u, seedingProfile: l, isByePosition: d, drawPosition: p, structureId: m, event: f }) {
7458
7458
  let { drawId: h } = u, g = [], I, y, U = [], w = c?.[vi]?.validSeedPositions?.ignore;
7459
7459
  if (w || ({ unplacedSeedParticipantIds: I, unplacedSeedAssignments: y, unfilledPositions: U } = Jb({ provisionalPositioning: i, returnAllProxies: !0, randomize: !0, drawDefinition: u, seedingProfile: l, structureId: m })), U?.length || (U = s.filter((v) => !v.participantId && !v.bye && !v.qualifier).map((v) => v.drawPosition)), d || g.push({ payload: { drawId: h, structureId: m, drawPosition: p, isPositionAction: !0 }, willDisableLinks: r, method: vL, type: "BYE" }), a && w) {
7460
- let v = s.map((P) => P.participantId).filter(Boolean), D = { structureIds: e }, { completedMatchUps: S } = Ac({ inContext: !0, matchUpFilters: D, drawDefinition: u }), T = ye((S ?? []).filter(({ matchUpType: P }) => f?.eventType !== Ot || P === Ot)?.map(({ sides: P }) => P?.map(be)).flat().filter((P) => P && !v.includes(P))), b = o ? n?.filter((P) => T?.includes(P.participantId)).map((P) => ie(P, void 0, !0)) : void 0;
7460
+ let v = s.map((P) => P.participantId).filter(Boolean), D = { structureIds: e }, { completedMatchUps: S } = Cc({ inContext: !0, matchUpFilters: D, drawDefinition: u }), T = ye((S ?? []).filter(({ matchUpType: P }) => f?.eventType !== Ot || P === Ot)?.map(({ sides: P }) => P?.map(be)).flat().filter((P) => P && !v.includes(P))), b = o ? n?.filter((P) => T?.includes(P.participantId)).map((P) => ie(P, void 0, !0)) : void 0;
7461
7461
  return b?.forEach((P) => {
7462
7462
  let M = (u.entries ?? []).find((N) => N.participantId === P.participantId);
7463
7463
  P.entryPosition = M?.entryPosition;
@@ -7475,7 +7475,7 @@ function I_({ positionSourceStructureIds: e, unassignedParticipantIds: t, possib
7475
7475
  return { validAssignmentActions: g };
7476
7476
  }
7477
7477
  function y_(e, t) {
7478
- return e.bye || sc(e.seedValue) < sc(t.seedValue) || e.seedValue && !t.seedValue ? -1 : (e.seedNumber || 0) - (t.seedNumber || 0);
7478
+ return e.bye || oc(e.seedValue) < oc(t.seedValue) || e.seedValue && !t.seedValue ? -1 : (e.seedNumber || 0) - (t.seedNumber || 0);
7479
7479
  }
7480
7480
  function U_({ drawPositionInitialRounds: e, tournamentParticipants: t, positionAssignments: r, returnParticipants: i, appliedPolicies: n, drawDefinition: a, drawPosition: s, structureId: o, drawId: c }) {
7481
7481
  let u = [], l = [], d = [], p = [], m = r.map((v) => v.participantId).filter(Boolean), f = n?.[On], h = !f?.disableRoundRestrictions && e[s], g = f?.requireCompletedStructures, { sourceStructureIds: I, relevantLinks: y } = Fu({ targetRoundNumber: h, linkType: Rn, drawDefinition: a, structureId: o }) || {};
@@ -7530,7 +7530,7 @@ function jy(e) {
7530
7530
  let d = l.containingStructure || l.structure;
7531
7531
  if (!d) return { error: lt };
7532
7532
  let p = d.structureId;
7533
- if (l = El({ drawDefinition: s, structureId: p }), o === void 0 && !l.isAdHoc) return { error: gc };
7533
+ if (l = El({ drawDefinition: s, structureId: p }), o === void 0 && !l.isAdHoc) return { error: Ic };
7534
7534
  if (l.isAdHoc) return xm(e);
7535
7535
  if (l.error) return l;
7536
7536
  let { drawPositionInitialRounds: m, inactiveDrawPositions: f, activeDrawPositions: h, byeDrawPositions: g } = l, I = xe({ tournamentRecord: a, drawDefinition: s, structure: d, event: c }).appliedPolicies ?? {};
@@ -7538,7 +7538,7 @@ function jy(e) {
7538
7538
  let { actionsPolicy: y, enabledStructures: U, actionsDisabled: w } = oN({ actionType: Rd, appliedPolicies: I, drawDefinition: s, structure: d }), v = y?.activePositionOverrides || [], { sourceStructureIds: D } = Fu({ finishingPosition: Ka, targetRoundNumber: 1, linkType: Nn, drawDefinition: s, structureId: p }) || {}, S;
7539
7539
  D?.length && (S = D.every((Y) => Fn({ structureId: Y, drawDefinition: s })));
7540
7540
  let T = D.length, b = D.length && !S, { policyActions: P } = cN({ enabledStructures: U, drawDefinition: s, structure: d }), M = ![oe, re].includes(d.stage) || d.stageSequence !== 1, { drawId: N } = s, R = [], { assignedPositions: A, positionAssignments: E } = Lt({ structure: d }), C = A?.find((Y) => Y.drawPosition === o), k = !!C;
7541
- if (!E?.map((Y) => Y.drawPosition)?.includes(o)) return { error: hc };
7541
+ if (!E?.map((Y) => Y.drawPosition)?.includes(o)) return { error: gc };
7542
7542
  let { stage: O, stageSequence: L } = d, _ = [O];
7543
7543
  O === sr && _.push(re), O === re && _.push(sr);
7544
7544
  let B = so({ entryStatuses: hs, provisionalPositioning: n, drawDefinition: s, stageSequence: L, structureId: p, stages: _ }), G = Is({ drawDefinition: s, stages: _ }).assignedParticipantIds ?? [], $ = B.filter((Y) => !G.includes(Y.participantId)).map((Y) => Y.participantId), j = g.includes(o), V = h.includes(o);
@@ -7607,9 +7607,9 @@ var Gy = ({ drawDefinition: e }) => {
7607
7607
  function $y({ structureId: e, drawDefinition: t }) {
7608
7608
  if (!t) return { error: ne };
7609
7609
  if (!ct(e)) return { error: z };
7610
- let r = Ec({ drawDefinition: t, structureId: e });
7610
+ let r = Ac({ drawDefinition: t, structureId: e });
7611
7611
  if (r.error) return r;
7612
- let i = r.links.target.flatMap((a) => a.target.feedProfile).filter(Boolean), n = !St([Ya, Di, Hp, za], i).length;
7612
+ let i = r.links.target.flatMap((a) => a.target.feedProfile).filter(Boolean), n = !vt([Ya, Di, Hp, za], i).length;
7613
7613
  return { ...x, valid: n };
7614
7614
  }
7615
7615
  function _u({ tournamentRecord: e, drawDefinition: t, stage: r = re, structureId: i, structure: n }) {
@@ -7621,7 +7621,7 @@ function _u({ tournamentRecord: e, drawDefinition: t, stage: r = re, structureId
7621
7621
  }
7622
7622
  function IN({ participantsCount: e, participantCount: t }) {
7623
7623
  if (e = e ?? t, !e) return { error: z };
7624
- let r = fc(e);
7624
+ let r = hc(e);
7625
7625
  return r ? { drawSize: r } : F({ result: { error: z }, stack: "getEliminationDrawSize", context: { participantsCount: e } });
7626
7626
  }
7627
7627
  function Yl(e) {
@@ -7647,7 +7647,7 @@ function Fm({ consideredEntries: e, policyDefinitions: t, tournamentRecord: r, a
7647
7647
  if ((!s || !n) && r && ({ participants: s, participantMap: n } = pt({ tournamentRecord: r })), !s) return { error: el };
7648
7648
  if (!Array.isArray(s)) return { error: z };
7649
7649
  if (!o) return { error: it };
7650
- let c = t?.[Yt] ?? i?.[Yt] ?? Oc[Yt], u = (a ?? c?.participants?.enforceGender) !== !1, { eventType: l, gender: d } = o, p = l === Yn, m = l === Hr && Ge || p && we || Me, f = Object.assign({}, ...(e ?? o.entries ?? []).map((I) => ({ [I.participantId]: I.entryStatus }))), h = Object.keys(f), g = s.filter((I) => h.includes(I.participantId)).filter((I) => {
7650
+ let c = t?.[Yt] ?? i?.[Yt] ?? kc[Yt], u = (a ?? c?.participants?.enforceGender) !== !1, { eventType: l, gender: d } = o, p = l === Yn, m = l === Hr && Ge || p && we || Me, f = Object.assign({}, ...(e ?? o.entries ?? []).map((I) => ({ [I.participantId]: I.entryStatus }))), h = Object.keys(f), g = s.filter((I) => h.includes(I.participantId)).filter((I) => {
7651
7651
  let y = v_({ participant: I, participantType: m, eventType: l, entryStatusMap: f }), U = w_({ genderEnforced: u, participantMap: n, eventGender: d, participant: I, isDoubles: p, mismatch: y });
7652
7652
  return y || !U;
7653
7653
  });
@@ -7708,7 +7708,7 @@ function UN(e) {
7708
7708
  function T_(e) {
7709
7709
  let { drawDefinition: t, structureOptions: r, requireSequential: i } = e, n = { structureName: ar(re), ...e, stage: re }, { structures: a, groupCount: s } = xl(n);
7710
7710
  if (s < 1) return { error: tT };
7711
- let o = r?.playoffGroups || [{ finishingPositions: [1], structureName: ar(yt) }], [c] = a, { structures: u, links: l } = xM({ sourceStructureId: c.structureId, requireSequential: i, drawDefinition: t, playoffGroups: o, groupCount: s, ...e });
7711
+ let o = r?.playoffGroups || [{ finishingPositions: [1], structureName: ar(Ut) }], [c] = a, { structures: u, links: l } = xM({ sourceStructureId: c.structureId, requireSequential: i, drawDefinition: t, playoffGroups: o, groupCount: s, ...e });
7712
7712
  return u && a.push(...u), { ...x, structures: a, links: l };
7713
7713
  }
7714
7714
  function P_({ mainStructure: e, consolationStructure: t, deciderStructure: r }) {
@@ -7723,7 +7723,7 @@ function b_({ structureName: e, matchUpType: t, idPrefix: r, drawSize: i, isMock
7723
7723
  s.push(c);
7724
7724
  let u = i / 2, { matchUps: l } = Pa({ finishingPositionOffset: u, idPrefix: r && `${r}-c`, drawSize: i - 1, isConsolation: !0, matchUpType: t, isMock: n, uuids: a }), d = ga({ structureName: ar(gP), matchUps: l, structureId: a?.pop(), stage: sr, stageSequence: 2, matchUpType: t });
7725
7725
  s.push(d);
7726
- let { matchUps: p } = un({ idPrefix: r && `${r}-p1t2`, drawSize: 2, matchUpType: t, isMock: n }), m = ga({ structureName: ar(hP), matchUps: p, structureId: a?.pop(), stageSequence: 3, stage: yt, matchUpType: t });
7726
+ let { matchUps: p } = un({ idPrefix: r && `${r}-p1t2`, drawSize: 2, matchUpType: t, isMock: n }), m = ga({ structureName: ar(hP), matchUps: p, structureId: a?.pop(), stageSequence: 3, stage: Ut, matchUpType: t });
7727
7727
  s.push(m);
7728
7728
  let f = P_({ mainStructure: c, consolationStructure: d, deciderStructure: m });
7729
7729
  return { structures: s, links: f, ...x };
@@ -7758,7 +7758,7 @@ function N_(e) {
7758
7758
  return n;
7759
7759
  }
7760
7760
  function SN(e) {
7761
- let { playoffAttributes: t, stageSequence: r = 1, stage: i = re, tieFormat: n, matchUpType: a, drawSize: s, uuids: o } = e, c = () => !e.isMock && !e.idPrefix ? void 0 : `${e.drawDefinition.drawId}-s-0`, u = e.structureId || c() || o?.pop(), l = e.appliedPolicies ?? xe(e), d = e.policyDefinitions?.[rc] || l?.[rc];
7761
+ let { playoffAttributes: t, stageSequence: r = 1, stage: i = re, tieFormat: n, matchUpType: a, drawSize: s, uuids: o } = e, c = () => !e.isMock && !e.idPrefix ? void 0 : `${e.drawDefinition.drawId}-s-0`, u = e.structureId || c() || o?.pop(), l = e.appliedPolicies ?? xe(e), d = e.policyDefinitions?.[ic] || l?.[ic];
7762
7762
  e.skipRounds = e.skipRounds || s <= 4 && (d?.feedFromMainFinal ? 0 : 1) || 0;
7763
7763
  let p = e.structureName ?? t?.["0"]?.name ?? ar(re), m = () => {
7764
7764
  let { matchUps: f } = un(e);
@@ -7767,10 +7767,10 @@ function SN(e) {
7767
7767
  return { generators: { [zr]: () => ({ structures: [ui({ finishingPosition: Ka, stageSequence: r, structureName: p, matchUps: [], matchUpType: a, structureId: u, stage: i })], links: [], ...x }), [us]: () => {
7768
7768
  let { matchUps: f } = M_(e);
7769
7769
  return { structures: [ui({ stageSequence: r, structureName: p, matchUpType: a, structureId: u, matchUps: f, stage: i })], links: [], ...x };
7770
- }, [Zi]: () => m(), [ol]: () => b_(e), [Jo]: () => Go({ ...e, roundOffsetLimit: 3, playoffAttributes: t ?? rI }), [Zo]: () => Go({ ...e, roundOffsetLimit: 2, playoffAttributes: t ?? iI }), [yt]: () => Go(e), [Dc]: () => {
7770
+ }, [Zi]: () => m(), [ol]: () => b_(e), [Zo]: () => $o({ ...e, roundOffsetLimit: 3, playoffAttributes: t ?? rI }), [ec]: () => $o({ ...e, roundOffsetLimit: 2, playoffAttributes: t ?? iI }), [Ut]: () => $o(e), [Tc]: () => {
7771
7771
  let { matchUps: f } = Pa({ drawSize: s, uuids: o, matchUpType: a });
7772
7772
  return { structures: [ui({ stageSequence: r, structureName: p, matchUpType: a, structureId: u, stage: re, tieFormat: n, matchUps: f })], links: [], ...x };
7773
- }, [cl]: () => CM(e), [ec]: () => Ds({ ...e, feedRounds: 1, fmlc: !0 }), [fP]: () => Ds({ ...e, feedRounds: 1 }), [Zg]: () => Ds({ ...e, feedsFromFinal: 1 }), [eI]: () => Ds({ ...e, feedsFromFinal: 2 }), [tI]: () => Ds({ ...e, feedsFromFinal: 3 }), [ul]: () => Ds(e), [zp]: () => kM(e), [Ri]: () => xl(e), [An]: () => T_(e) } };
7773
+ }, [cl]: () => CM(e), [tc]: () => Ds({ ...e, feedRounds: 1, fmlc: !0 }), [fP]: () => Ds({ ...e, feedRounds: 1 }), [Zg]: () => Ds({ ...e, feedsFromFinal: 1 }), [eI]: () => Ds({ ...e, feedsFromFinal: 2 }), [tI]: () => Ds({ ...e, feedsFromFinal: 3 }), [ul]: () => Ds(e), [zp]: () => kM(e), [Ri]: () => xl(e), [An]: () => T_(e) } };
7774
7774
  }
7775
7775
  function Wy(e) {
7776
7776
  let { enforceMinimumDrawSize: t = !0, overwriteExisting: r, appliedPolicies: i, qualifyingOnly: n, staggeredEntry: a, drawDefinition: s, tieFormat: o, isMock: c, uuids: u } = e || {}, l = pe(e.drawSize), d = e.drawTypeCoercion ?? zl({ appliedPolicies: i, drawType: e.drawType }), p = "generateDrawStructuresAndLinks", m = UN({ drawType: e.drawType, enforceMinimumDrawSize: t, drawTypeCoercion: d, drawSize: l });
@@ -7799,7 +7799,7 @@ function Wy(e) {
7799
7799
  if (M?.error) return M;
7800
7800
  let { qualifyingDrawPositionsCount: N, qualifyingDetails: R, qualifiersCount: A } = M || { qualifyingDrawPositionsCount: S, qualifiersCount: T };
7801
7801
  N && (M?.structures && h.push(...M.structures), M?.links && g.push(...M.links)), Object.assign(e, ae({ drawSize: l, matchUpType: I, tieFormat: o }));
7802
- let E = f !== zr && (!l || l < 2 || !a && ![Dc, us].includes(f) && ([An, Ri].includes(f) && l < 3 || ![Ri, An].includes(f) && !$i(l)));
7802
+ let E = f !== zr && (!l || l < 2 || !a && ![Tc, us].includes(f) && ([An, Ri].includes(f) && l < 3 || ![Ri, An].includes(f) && !$i(l)));
7803
7803
  if (E && !N) return F({ context: { drawSize: l, invalidDrawSize: E }, result: { error: bp }, stack: p });
7804
7804
  let { generators: C, error: k } = SN(e);
7805
7805
  if (k) return { error: k };
@@ -7893,7 +7893,7 @@ function vN(e) {
7893
7893
  DN({ participant: d, scaleItem: m, removePriorValues: r }), c.push(d), s++;
7894
7894
  }
7895
7895
  }
7896
- let u = s ? void 0 : vc, { topics: l } = fi();
7896
+ let u = s ? void 0 : wc, { topics: l } = fi();
7897
7897
  if (l.includes(or) && s && Ue({ topic: or, payload: { tournamentId: i.tournamentId, participants: c } }), a) {
7898
7898
  let { eventId: d, drawId: p, ...m } = a, f = m.scaleAttributes?.scaleType && [m.scaleAttributes.scaleType];
7899
7899
  if (Object.keys(m).length) {
@@ -7932,7 +7932,7 @@ function Hy(e) {
7932
7932
  }
7933
7933
  return { ...x };
7934
7934
  }
7935
- function oc(e) {
7935
+ function cc(e) {
7936
7936
  let { tournamentRecord: t, scaleAttributes: r, participantId: i } = e, n = e.tournamentRecords || t && { [t.tournamentId]: t } || {};
7937
7937
  if (!i) return { error: xt };
7938
7938
  let { participant: a, tournamentId: s } = Ca({ tournamentRecords: n, tournamentRecord: t, participantId: i });
@@ -7965,7 +7965,7 @@ function PN(e) {
7965
7965
  let { sideNumber: B, participant: G } = _;
7966
7966
  return B && { [B]: [G?.participantId, ...G?.individualParticipantIds ?? []].filter(Boolean).flat() };
7967
7967
  })), N = Object.assign({}, ...Object.values(M).flat().map((_) => {
7968
- let B = m[_], G = !s || B ? oc({ scaleAttributes: P, tournamentRecord: n, participantId: _ }).scaleItem : void 0, $ = oc({ tournamentRecord: n, scaleAttributes: b, participantId: _ }).scaleItem, j = p ? { [p]: void 0 } : void 0;
7968
+ let B = m[_], G = !s || B ? cc({ scaleAttributes: P, tournamentRecord: n, participantId: _ }).scaleItem : void 0, $ = cc({ tournamentRecord: n, scaleAttributes: b, participantId: _ }).scaleItem, j = p ? { [p]: void 0 } : void 0;
7969
7969
  return _ && { [_]: G ?? $ ?? { scaleName: g, eventType: T, scaleDate: U, scaleType: fa, scaleValue: j } };
7970
7970
  })), R = w ? fr(w) : {}, A = R?.bestOf || 1, E = R?.setsTo || 1, C = o ? A & E : A, k = v?.sets && C_(v.sets) || S === 1 && [1, 0] || [0, 1], O = S ? M[S] : [], L = S ? M[3 - S] : [];
7971
7971
  for (let _ of O) {
@@ -8001,7 +8001,7 @@ function Lm(e) {
8001
8001
  let y = g?.participantIds ?? [void 0, void 0];
8002
8002
  y.push(void 0, void 0);
8003
8003
  let U = y.slice(0, 2).map((v, D) => ae({ sideNumber: D + 1, participantId: v })), w = t[I] ?? f(I) ?? Be();
8004
- return { roundNumber: m, matchUpStatus: vt, matchUpId: w, sides: U };
8004
+ return { roundNumber: m, matchUpStatus: wt, matchUpId: w, sides: U };
8005
8005
  });
8006
8006
  if (h?.length) {
8007
8007
  let g = Ir({ drawDefinition: r, event: s })?.tieFormat;
@@ -8159,8 +8159,8 @@ function G_({ encounters: e, tournamentParticipants: t, encounterValue: r, sameT
8159
8159
  function MN(e) {
8160
8160
  let { drawType: t = Zi, attachConsolation: r = !0, applyPositioning: i = !0, tournamentRecord: n, staggeredEntry: a, automated: s, placeByes: o, isMock: c, event: u } = e, l = e?.drawDefinition;
8161
8161
  if (!l) return { error: ne };
8162
- let d = zt, p = so({ stageSequence: 1, drawDefinition: l, stage: d }), m = [Ri, ol, An].includes(t) ? p.length : fc(p.length);
8163
- if (!a && t === Dc && p.length < 2 || t === Ri && p.length < 3) return { error: bp };
8162
+ let d = zt, p = so({ stageSequence: 1, drawDefinition: l, stage: d }), m = [Ri, ol, An].includes(t) ? p.length : hc(p.length);
8163
+ if (!a && t === Tc && p.length < 2 || t === Ri && p.length < 3) return { error: bp };
8164
8164
  let { tieFormat: f, matchUpType: h } = e;
8165
8165
  if (f) {
8166
8166
  let M = Nr({ tieFormat: f });
@@ -8212,7 +8212,7 @@ function Tn(e) {
8212
8212
  }
8213
8213
  }
8214
8214
  function $_({ matchUpStatus: e }) {
8215
- let t = { [jt]: "RET", [nt]: "WO", [kt]: "DF/DF", [dt]: "WO/WO", [Aa]: "SUS", [Lr]: "ABN", [ze]: "DEF", [Nc]: "DR" };
8215
+ let t = { [jt]: "RET", [nt]: "WO", [kt]: "DF/DF", [dt]: "WO/WO", [Aa]: "SUS", [Lr]: "ABN", [ze]: "DEF", [Rc]: "DR" };
8216
8216
  return e && t[e] || "";
8217
8217
  }
8218
8218
  function W_(e, t) {
@@ -8355,10 +8355,10 @@ function Xh({ analysis: e, scoreString: t, sets: r, lowSide: i }) {
8355
8355
  if (t = s, o) return { scoreString: t, sets: r, outcomeRemoved: !0 };
8356
8356
  let c = r[r.length - 1] || {}, u = Object.values(c).filter((h) => h !== void 0).length;
8357
8357
  c.setNumber && u === 1 && (r = r.slice(0, r.length - 1), c = r[r.length - 1] || {});
8358
- let { tiebreakSet: l } = e.setFormat, { tiebreakTo: d, NoAD: p } = l || {}, { isTiebreakEntry: m } = $o({ brackets: is, scoreString: t }), f = tB(t);
8358
+ let { tiebreakSet: l } = e.setFormat, { tiebreakTo: d, NoAD: p } = l || {}, { isTiebreakEntry: m } = Wo({ brackets: is, scoreString: t }), f = tB(t);
8359
8359
  if (f >= 0) {
8360
8360
  n = t.slice(0, f);
8361
- let { isTiebreakEntry: h } = $o({ brackets: Hs, scoreString: n }), { lastOpenBracketIndex: g, isTiebreakEntry: I } = $o({ brackets: is, scoreString: n }), y = n && n[n.length - 1].trim(), U = n && !isNaN(y), w = e.isIncompleteSetScore;
8361
+ let { isTiebreakEntry: h } = Wo({ brackets: Hs, scoreString: n }), { lastOpenBracketIndex: g, isTiebreakEntry: I } = Wo({ brackets: is, scoreString: n }), y = n && n[n.length - 1].trim(), U = n && !isNaN(y), w = e.isIncompleteSetScore;
8362
8362
  if (m && I) {
8363
8363
  let v = n.slice(g + 1).split(Pn), D = v?.length > 0 && v[0] !== void 0 && !isNaN(parseInt(v[0])) && parseInt(v[0]) || void 0, S = v?.length > 1 && v[1] !== void 0 && parseInt(v[1]) || void 0, T = [D, S];
8364
8364
  if (S) {
@@ -8389,7 +8389,7 @@ function Xh({ analysis: e, scoreString: t, sets: r, lowSide: i }) {
8389
8389
  }
8390
8390
  return { scoreString: t, sets: r };
8391
8391
  }
8392
- function $o({ brackets: e = Hs, scoreString: t }) {
8392
+ function Wo({ brackets: e = Hs, scoreString: t }) {
8393
8393
  if (!t) return {};
8394
8394
  let [r, i] = e.split(""), n = t.split(""), a = Math.max(...Ji(r, n)), s = Math.max(...Ji(i, n));
8395
8395
  return { isTiebreakEntry: a > s, lastOpenBracketIndex: a };
@@ -8502,7 +8502,7 @@ function nB(e) {
8502
8502
  function aB({ analysis: e, auto: t, lowSide: r, scoreString: i = "", sets: n, value: a }) {
8503
8503
  let s, o, { tiebreakSet: { tiebreakTo: c, NoAD: u } } = e.setFormat, [l] = is.split("");
8504
8504
  if (e.isMatchTiebreakEntry || (i += l), n[e.setNumber - 1]) {
8505
- let { lastOpenBracketIndex: d } = $o({ brackets: is, scoreString: i }), p = (i.slice((d ?? 0) + 1) + (t ? "" : a)).split(Pn);
8505
+ let { lastOpenBracketIndex: d } = Wo({ brackets: is, scoreString: i }), p = (i.slice((d ?? 0) + 1) + (t ? "" : a)).split(Pn);
8506
8506
  if ((p[r - 1]?.length || 0) >= 2) o = "tiebreak digit limit";
8507
8507
  else if (t) {
8508
8508
  r === 1 && (p[0] = (p[0] || "") + a), r === 2 && (p[1] = (p[1] || "") + a);
@@ -8537,7 +8537,7 @@ function sB({ analysis: e, lowSide: t, scoreString: r, value: i }) {
8537
8537
  }
8538
8538
  }
8539
8539
  function oB({ matchUpFormat: e, scoreString: t, winningSide: r, value: i, sets: n }) {
8540
- let a = (n?.filter((L) => L?.winningSide)?.length || 0) + (r ? 0 : 1), s = fr(e), o = a === s?.bestOf, c = o && s?.finalSetFormat || s?.setFormat || {}, u = c?.timed, l = o && n[s?.bestOf - 1], d = l?.winningSide, { isTiebreakEntry: p } = $o({ brackets: Hs, scoreString: t }), { isTiebreakEntry: m } = $o({ brackets: is, scoreString: t }), f = p || m, h = !!c.tiebreakSet, g = t?.[t.length - 1]?.trim(), I = t && !isNaN(g), y = !f && g === Os, U = p && jf.includes(g), w = m && jf.includes(g), v = m && g === Pn, D = t?.split(""), [S] = is.split(""), T = D && Math.max(...Ji(S, D)), b = D && Math.max(...Ji(Pn, D)), P = D && b > T, M = n[n.length - 1]?.winningSide, N = n?.length && !M, R = GN.find((L) => t?.indexOf(L) >= 0), A = !isNaN(i), E = i === Bm, C = ap.includes(i), k = t?.split("").find((L) => jf.includes(L)), O = C && m && !w && (v || !eB({ scoreString: t }));
8540
+ let a = (n?.filter((L) => L?.winningSide)?.length || 0) + (r ? 0 : 1), s = fr(e), o = a === s?.bestOf, c = o && s?.finalSetFormat || s?.setFormat || {}, u = c?.timed, l = o && n[s?.bestOf - 1], d = l?.winningSide, { isTiebreakEntry: p } = Wo({ brackets: Hs, scoreString: t }), { isTiebreakEntry: m } = Wo({ brackets: is, scoreString: t }), f = p || m, h = !!c.tiebreakSet, g = t?.[t.length - 1]?.trim(), I = t && !isNaN(g), y = !f && g === Os, U = p && jf.includes(g), w = m && jf.includes(g), v = m && g === Pn, D = t?.split(""), [S] = is.split(""), T = D && Math.max(...Ji(S, D)), b = D && Math.max(...Ji(Pn, D)), P = D && b > T, M = n[n.length - 1]?.winningSide, N = n?.length && !M, R = GN.find((L) => t?.indexOf(L) >= 0), A = !isNaN(i), E = i === Bm, C = ap.includes(i), k = t?.split("").find((L) => jf.includes(L)), O = C && m && !w && (v || !eB({ scoreString: t }));
8541
8541
  return { isTiebreakSetValue: h && A, matchUpScoringFormat: s, setNumber: a, setFormat: c, matchTiebreakHasJoiner: P, isGameScoreEntry: N, isSpace: E, isCloser: C, isTiebreakCloser: C && k && f && I, isDecidingSet: o, isTiebreakSet: h, isTimedSet: u, isNumericEnding: I, isNumericValue: A, hasOpener: k, hasOutcome: R, finalSet: l, finalSetIsComplete: d, lastSetIsComplete: M, isInvalidSetTiebreakValue: E && f && U, isInvalidMatchTiebreakValue: O, isTiebreakEntry: f, isSetTiebreakEntry: p, isMatchTiebreakEntry: m, isIncompleteSetScore: y, isIncompleteSetTiebreak: U, isIncompleteMatchTiebreak: w, isPartialMatchTiebreakValue: v };
8542
8542
  }
8543
8543
  function cR(e) {
@@ -8587,7 +8587,7 @@ function cR(e) {
8587
8587
  if (l) {
8588
8588
  n = n?.filter(Boolean);
8589
8589
  let { matchUpWinningSide: h } = Ev({ sets: n, winningSide: a, matchUpStatus: s, matchUpFormat: o });
8590
- return a = h, h && (!s || [vt, Yr].includes(s)) ? (s = q_, n = n.filter((g) => {
8590
+ return a = h, h && (!s || [wt, Yr].includes(s)) ? (s = q_, n = n.filter((g) => {
8591
8591
  let { side1Score: I, side2Score: y, side1TiebreakScore: U, side2TiebreakScore: w } = g;
8592
8592
  return I || y || U || w;
8593
8593
  })) : i && !a && ![qN, WN, zN].includes(s) && (s = void 0), { updated: l, scoreString: i, sets: n, winningSide: a, matchUpStatus: s, info: d };
@@ -8621,7 +8621,7 @@ function Ed(e) {
8621
8621
  function hB(e) {
8622
8622
  return /^\(\d+-\d+\)$/.test(e) || /^\[\d+-\d+\]$/.test(e);
8623
8623
  }
8624
- function cc(e) {
8624
+ function uc(e) {
8625
8625
  let t = ((r) => r?.split("-").join("").split("/").join(""))(e);
8626
8626
  if (/^\d+$/.test(t) && t.length === 2) {
8627
8627
  let r = t.split("");
@@ -8795,7 +8795,7 @@ function UB({ score: e }) {
8795
8795
  let p = t(i[0]).split("");
8796
8796
  if (Math.abs(p.reduce((m, f) => +m - +f, 0)) === 1) return i[1] = r(i[1]), { score: i.join("") };
8797
8797
  }
8798
- let o = i.map((p) => hB(p) && "bracket" || cc(p) && "set");
8798
+ let o = i.map((p) => hB(p) && "bracket" || uc(p) && "set");
8799
8799
  if (o.includes("set") && o.includes("bracket")) {
8800
8800
  let p, m = "";
8801
8801
  return i.forEach((f, h) => {
@@ -8820,7 +8820,7 @@ function UB({ score: e }) {
8820
8820
  let d = /(\d+-\d+)\((\d+)-(\d+)\)$/;
8821
8821
  if (d.test(e)) {
8822
8822
  let [p, m, f] = e.match(d).slice(1), h = Math.max(m, f) >= 10;
8823
- !cc(p) && h && (e = e.replace(d, `${p} [${m}-${f}]`));
8823
+ !uc(p) && h && (e = e.replace(d, `${p} [${m}-${f}]`));
8824
8824
  }
8825
8825
  return u = [], e = e.split(" ").map((p) => {
8826
8826
  let m = /^\((.*)\)$/, f = m.test(p), h = new RegExp(Zy).test(p) && "super" || new RegExp(Bu).test(p) && "tiebreak" || new RegExp(Gm).test(p) && "standard" || "unknown";
@@ -8939,7 +8939,7 @@ function vB({ score: e, matchUpStatus: t }) {
8939
8939
  e = r.map((o) => {
8940
8940
  if (o.endsWith("]")) {
8941
8941
  let c = o.split("[");
8942
- if (cc(c[0])) return c[0] + `(${c[1].slice(0, c[1].length - 1)})`;
8942
+ if (uc(c[0])) return c[0] + `(${c[1].slice(0, c[1].length - 1)})`;
8943
8943
  }
8944
8944
  return o;
8945
8945
  }).join(" ");
@@ -8973,7 +8973,7 @@ function vB({ score: e, matchUpStatus: t }) {
8973
8973
  }).join(" "), r = e?.split(" "), n = new RegExp(/^\((\d[-/]+\d)\)(\d+)$/), e = r.map((o) => {
8974
8974
  if (n.test(o)) {
8975
8975
  let [c, u] = Array.from(o.match(n)).slice(1);
8976
- return cc(c) ? `${c}(${u})` : c;
8976
+ return uc(c) ? `${c}(${u})` : c;
8977
8977
  }
8978
8978
  return o;
8979
8979
  }).join(" "), r = e?.split(" "), n = new RegExp(/^1-0\((\d+)\)$/), e = r.map((o) => {
@@ -9026,7 +9026,7 @@ function wB({ score: e, attributes: t, identifier: r }) {
9026
9026
  }
9027
9027
  }
9028
9028
  let c = Wr(e.split(""));
9029
- c["("] === 1 && c[")"] === 1 && e.startsWith("(") && e.endsWith(")") && (e = e.slice(1, e.length - 1), c["-"] === 1 && cc(e) && ft(t?.removed) && (e = e + `(${t.removed})`, t.removed = void 0));
9029
+ c["("] === 1 && c[")"] === 1 && e.startsWith("(") && e.endsWith(")") && (e = e.slice(1, e.length - 1), c["-"] === 1 && uc(e) && ft(t?.removed) && (e = e + `(${t.removed})`, t.removed = void 0));
9030
9030
  let u = /\(\)/g;
9031
9031
  return u.test(e) && (e = e.replace(u, "").trim()), { score: e };
9032
9032
  }
@@ -9153,7 +9153,7 @@ function DB({ score: e, matchUpStatus: t, attributes: r }) {
9153
9153
  e = a.map((l, d) => {
9154
9154
  if (new RegExp(Bu).test(l)) {
9155
9155
  let m = l.slice(3), f = l.slice(0, 3), h = f.split("-");
9156
- if (!cc(f) && !t) {
9156
+ if (!uc(f) && !t) {
9157
9157
  let g = Math.max(...h), I = f.indexOf(g), y = [g, g - 1];
9158
9158
  return I && y.reverse(), y.join("-") + m;
9159
9159
  }
@@ -9342,9 +9342,10 @@ function eU(e, t, r, i) {
9342
9342
  if (d) return i ? { isValid: !0 } : h === 0 && g === 0 ? { isValid: !1, error: "Tiebreak-only set requires both scores" } : I < l ? { isValid: !1, error: `Tiebreak-only set winner must reach at least ${l}, got ${I}` } : U < 2 ? { isValid: !1, error: `Tiebreak-only set must be won by at least 2 points, got ${I}-${y}` } : I === l && y > l - 2 ? { isValid: !1, error: `Tiebreak-only set at ${l}-${y} requires playing past ${l}` } : I > l && U !== 2 ? { isValid: !1, error: `Tiebreak-only set past ${l} must be won by exactly 2 points, got ${I}-${y}` } : { isValid: !0 };
9343
9343
  let w = p !== void 0 || m !== void 0, v = s && I === s + 1 && y === s;
9344
9344
  if (w || v) {
9345
- if (s) {
9346
- if (I !== s + 1) return { isValid: !1, error: `Tiebreak set winner must have ${s + 1} games, got ${I}` };
9347
- if (y !== s) return { isValid: !1, error: `Tiebreak set loser must have ${s} games when tied, got ${y}` };
9345
+ if (s && o) {
9346
+ let D = o === s ? s + 1 : s, S = o;
9347
+ if (I !== D) return { isValid: !1, error: `Tiebreak set winner must have ${D} games, got ${I}` };
9348
+ if (y !== S) return { isValid: !1, error: `Tiebreak set loser must have ${S} games, got ${y}` };
9348
9349
  }
9349
9350
  if (w && c) {
9350
9351
  let D = Math.max(p || 0, m || 0), S = Math.min(p || 0, m || 0), T = D - S, b = c.tiebreakTo || 7;
@@ -9359,10 +9360,12 @@ function eU(e, t, r, i) {
9359
9360
  }
9360
9361
  if (i) return s && (I > s + 10 || y > s + 10) ? { isValid: !1, error: `Set score ${I}-${y} exceeds expected range for ${s}-game sets` } : { isValid: !0 };
9361
9362
  if (s && I < s) return { isValid: !1, error: `Set winner must reach ${s} games, got ${I}` };
9362
- if (U < 2) return { isValid: !1, error: `Set must be won by at least 2 games, got ${I}-${y}` };
9363
+ let D = o && I === s && y === o && U === 1;
9364
+ if (U < 2 && !D) return { isValid: !1, error: `Set must be won by at least 2 games, got ${I}-${y}` };
9363
9365
  if (o) {
9364
- if (y >= o) return { isValid: !1, error: `When tied at ${o}-${o}, must play tiebreak. Use format like ${o + 1}-${o}(5)` };
9365
- if (I > s + 1) return { isValid: !1, error: `With tiebreak format, set score cannot exceed ${s + 1}-${s - 1}. Got ${I}-${y}` };
9366
+ if (y >= o && !D) return { isValid: !1, error: `When tied at ${o}-${o}, must play tiebreak. Use format like ${o + 1}-${o}(5)` };
9367
+ let S = o === s ? s + 1 : s;
9368
+ if (I > S) return { isValid: !1, error: `With tiebreak format, set score cannot exceed ${S}-${o}. Got ${I}-${y}` };
9366
9369
  } else if (I > s + 10) return { isValid: !1, error: `Set score ${I}-${y} exceeds reasonable limits` };
9367
9370
  }
9368
9371
  return { isValid: !0 };
@@ -9390,7 +9393,7 @@ function tU({ existingMatchUpStatus: e, matchUpFormat: t, matchUpStatus: r, winn
9390
9393
  }
9391
9394
  return L.setTo ? !(!L.noTiebreak && E > L.setTo + 1) : !0;
9392
9395
  }), w = (!t || p === g) && m === 1 && s.indexOf(p) + 1 || void 0;
9393
- return { valid: !!(U && (i && u > l && i === w || i && y || !i && !w && (![Ut, ze, jt, nt].includes(I) || f && I === Ut))) };
9396
+ return { valid: !!(U && (i && u > l && i === w || i && y || !i && !w && (![St, ze, jt, nt].includes(I) || f && I === St))) };
9394
9397
  }
9395
9398
  function rU({ existingMatchUpStatus: e, matchUpFormat: t, matchUpStatus: r, winningSide: i, score: n }) {
9396
9399
  if (typeof n != "object") return { error: z };
@@ -9456,8 +9459,13 @@ function op({ tiebreakTo: e = 7, scoreString: t = "", matchUpFormat: r }) {
9456
9459
  } else {
9457
9460
  let U = (l && s.replace(l[0], "") || d && s.replace(d[0], "") || s).split("-").map((w) => Number.parseInt(w));
9458
9461
  if (f = U[0], h = U[1], y = f > h && 1 || f < h && 2 || void 0, l) {
9459
- let w = l[1], v = Wm({ lowValue: w, isSide1: y === 2, tiebreakTo: e });
9460
- Array.isArray(v) && ([g, I] = v);
9462
+ let w = l[1], v = e;
9463
+ if (i) {
9464
+ let S = o === n && i.finalSetFormat ? i.finalSetFormat : i.setFormat;
9465
+ S?.tiebreakFormat?.tiebreakTo && (v = S.tiebreakFormat.tiebreakTo);
9466
+ }
9467
+ let D = Wm({ lowValue: w, isSide1: y === 2, tiebreakTo: v });
9468
+ Array.isArray(D) && ([g, I] = D);
9461
9469
  }
9462
9470
  if (d && !p) {
9463
9471
  let w = d[1].split("-").map((v) => Number.parseInt(v));
@@ -9541,7 +9549,7 @@ function HB(e) {
9541
9549
  t.structures = t.structures?.filter(({ structureId: v }) => v !== r), t.links = t.links?.filter(({ source: v }) => v.structureId !== r);
9542
9550
  let { qualifiersCount: m, qualifyingDrawPositionsCount: f, qualifyingDetails: h } = p ?? {};
9543
9551
  f && (p?.structures && t.structures?.push(...p.structures), p?.links && t.links?.push(...p.links));
9544
- let g = t.structures?.find(({ stage: v, stageSequence: D }) => v === re && D === 1), { qualifiersCount: I } = Cc({ stageSequence: 1, drawDefinition: t, structureId: s, stage: re }), y = Math.max(m ?? 0, I ?? 0), U = SM({ qualifiersCount: y, drawDefinition: t, stage: re });
9552
+ let g = t.structures?.find(({ stage: v, stageSequence: D }) => v === re && D === 1), { qualifiersCount: I } = Oc({ stageSequence: 1, drawDefinition: t, structureId: s, stage: re }), y = Math.max(m ?? 0, I ?? 0), U = SM({ qualifiersCount: y, drawDefinition: t, stage: re });
9545
9553
  if (U.error || (U = rp({ drawSize: f, stage: oe, drawDefinition: t }), U.error)) return U;
9546
9554
  zB({ drawDefinition: t, drawEntries: a, event: l });
9547
9555
  let w = YB({ mainStructure: g, qualifyingDetails: h, drawDefinition: t });
@@ -9652,7 +9660,7 @@ function eV({ requireParticipantCount: e = !0, enforcePolicyLimits: t = !0, draw
9652
9660
  function vo({ sortDescending: e = !1, tournamentRecord: t, scaleAttributes: r, scaleSortMethod: i, stageSequence: n, entries: a, event: s, stage: o }) {
9653
9661
  if (!t) return { error: J };
9654
9662
  return a = a ?? s?.entries ?? [], { scaledEntries: a.filter((l) => (!o || !l.entryStage || l.entryStage === o) && (!n || !l.entryStageSequence || l.entryStageSequence === n) && xi.includes(l.entryStatus)).map((l) => {
9655
- let { participantId: d } = l, { scaleItem: p } = oc({ tournamentRecord: t, scaleAttributes: r, participantId: d });
9663
+ let { participantId: d } = l, { scaleItem: p } = cc({ tournamentRecord: t, scaleAttributes: r, participantId: d });
9656
9664
  return { ...l, ...p };
9657
9665
  }).filter((l) => {
9658
9666
  let d = l.scaleValue;
@@ -9693,7 +9701,7 @@ function nV(e) {
9693
9701
  let { provisionalPositioning: t, enteredParticipantIds: r, seededParticipants: i, tournamentRecord: n, appliedPolicies: a, drawDefinition: s, seedingProfile: o, structureId: c, structure: u, event: l } = e, d = u ? Io({ provisionalPositioning: t, appliedPolicies: a, drawDefinition: s, seedingProfile: o, structure: u }) : void 0;
9694
9702
  i.filter(({ participantId: p }) => r.includes(p)).filter((p) => !p.seedNumber || p.seedNumber <= i.length).sort((p, m) => p.seedNumber < m.seedNumber ? -1 : p.seedNumber < m.seedNumber ? 1 : 0).forEach((p) => {
9695
9703
  let { participantId: m, seedNumber: f, seedValue: h } = p;
9696
- kc({ provisionalPositioning: t, tournamentRecord: n, drawDefinition: s, seedingProfile: o, participantId: m, seedBlockInfo: d, structureId: c, seedNumber: f, seedValue: h, event: l });
9704
+ xc({ provisionalPositioning: t, tournamentRecord: n, drawDefinition: s, seedingProfile: o, participantId: m, seedBlockInfo: d, structureId: c, seedNumber: f, seedValue: h, event: l });
9697
9705
  });
9698
9706
  }
9699
9707
  function aV(e) {
@@ -9702,7 +9710,7 @@ function aV(e) {
9702
9710
  let f = sV({ ...e }) || c && oV({ ...e }), h = f?.length ?? 0;
9703
9711
  h < t && (t = h), f?.filter(({ participantId: g }) => i.includes(g)).slice(0, a || t).forEach((g, I) => {
9704
9712
  let y = I + 1, { participantId: U, scaleValue: w } = g, v = n?.[y] || w || y;
9705
- kc({ provisionalPositioning: r, tournamentRecord: s, drawDefinition: o, seedingProfile: u, participantId: U, structureId: l, seedNumber: y, seedValue: v, event: d });
9713
+ xc({ provisionalPositioning: r, tournamentRecord: s, drawDefinition: o, seedingProfile: u, participantId: U, structureId: l, seedNumber: y, seedValue: v, event: d });
9706
9714
  });
9707
9715
  }
9708
9716
  function sV(e) {
@@ -9866,7 +9874,7 @@ function SV(e) {
9866
9874
  return { qualifyingConflicts: h, error: void 0 };
9867
9875
  }
9868
9876
  var wR = {};
9869
- Pe(wR, { addGoesTo: () => Za, allCompetitionMatchUps: () => Hi, allDrawMatchUps: () => vr, allEventMatchUps: () => Vn, allPlayoffPositionsFilled: () => hy, allTournamentMatchUps: () => Qt, analyzeDraws: () => Hl, analyzeMatchUp: () => Gu, analyzeTournament: () => gU, bulkUpdatePublishedEventIds: () => yU, calculateWinCriteria: () => Do, categoryCanContain: () => al, checkMatchUpIsComplete: () => $a, checkValidEntries: () => Fm, compareTieFormats: () => ta, competitionScheduleMatchUps: () => ed, courtGridRows: () => rf, credits: () => vV, drawMatchUps: () => CU, eventMatchUps: () => sf, filterMatchUps: () => Wn, filterParticipants: () => Ol, findDrawDefinition: () => By, findExtension: () => De, findVenue: () => Bn, getAggregateTeamResults: () => hU, getAllDrawMatchUps: () => Rt, getAllEventData: () => UU, getAllStructureMatchUps: () => _e, getAllowedDrawTypes: () => qm, getAllowedMatchUpFormats: () => pU, getAppliedPolicies: () => xe, getAssignedParticipantIds: () => Is, getAvailableMatchUpsCount: () => km, getAvailablePlayoffProfiles: () => jl, getCategoryAgeDetails: () => Ls, getCheckedInParticipantIds: () => lo, getCompetitionDateRange: () => zm, getCompetitionMatchUps: () => ju, getCompetitionParticipants: () => oU, getCompetitionPenalties: () => mU, getCompetitionVenues: () => Xl, getCourtInfo: () => Im, getCourts: () => OU, getDrawData: () => Xm, getDrawDefinitionTimeItem: () => FI, getDrawParticipantRepresentativeIds: () => Ly, getDrawStructures: () => Ai, getDrawTypeCoercion: () => zl, getEligibleVoluntaryConsolationParticipants: () => Fy, getEntriesAndSeedsCount: () => nf, getEvent: () => FU, getEventData: () => Qm, getEventMatchUpFormatTiming: () => DU, getEventProperties: () => kU, getEventPublishStatus: () => Ui, getEventStructures: () => Pm, getEventTimeItem: () => gl, getEvents: () => xU, getFlightProfile: () => wt, getHomeParticipantId: () => MU, getLinkedTournamentIds: () => ml, getMatchUpCompetitiveProfile: () => Pl, getMatchUpContextIds: () => NU, getMatchUpDailyLimits: () => cf, getMatchUpDailyLimitsUpdate: () => TU, getMatchUpDependencies: () => Fi, getMatchUpFormat: () => RU, getMatchUpFormatTiming: () => bl, getMatchUpFormatTimingUpdate: () => wU, getMatchUpScheduleDetails: () => ym, getMatchUpType: () => Um, getMatchUpsMap: () => er, getMatchUpsStats: () => EU, getMatchUpsToSchedule: () => Jm, getMaxEntryPosition: () => vU, getModifiedMatchUpFormatTiming: () => af, getPairedParticipant: () => Ci, getParticipantEventDetails: () => cU, getParticipantIdFinishingPositions: () => _y, getParticipantMembership: () => uU, getParticipantResults: () => Gl, getParticipantScaleItem: () => oc, getParticipantSchedules: () => lU, getParticipantSignInStatus: () => dU, getParticipantTimeItem: () => LI, getParticipants: () => pt, getPersonRequests: () => Ss, getPolicyDefinitions: () => aa, getPositionAssignments: () => _u, getPositionsPlayedOff: () => Fc, getPredictiveAccuracy: () => bU, getProfileRounds: () => tf, getPublishState: () => ho, getRandomQualifierList: () => Gy, getRoundMatchUps: () => Dr, getRounds: () => AU, getScaleValues: () => Pc, getScaledEntries: () => vo, getScheduledRoundsDetails: () => Ql, getSchedulingProfile: () => ua, getSchedulingProfileIssues: () => SU, getSeedingThresholds: () => uy, getSeedsCount: () => Yl, getStructureSeedAssignments: () => mi, getTeamLineUp: () => Ja, getTieFormat: () => Km, getTimeItem: () => gi, getTournamentIds: () => dl, getTournamentInfo: () => wo, getTournamentPenalties: () => Hm, getTournamentPersons: () => fU, getTournamentPoints: () => Ym, getTournamentPublishStatus: () => Cl, getTournamentStructures: () => fy, getTournamentTimeItem: () => pm, getValidGroupSizes: () => Fl, getVenueData: () => ac, getVenuesAndCourts: () => ca, isAdHoc: () => Rr, isCompletedStructure: () => Fn, isValidForQualifying: () => $y, isValidMatchUpFormat: () => qr, matchUpActions: () => xm, participantScaleItem: () => Dn, participantScheduledMatchUps: () => PU, positionActions: () => jy, publicFindCourt: () => YI, publicFindVenue: () => zI, tallyParticipantResults: () => Lc, tieFormatGenderValidityCheck: () => jp, tournamentMatchUps: () => of, validMatchUp: () => mm, validMatchUps: () => yi, validateCollectionDefinition: () => sl, validateLineUp: () => Tm });
9877
+ Pe(wR, { addGoesTo: () => Za, allCompetitionMatchUps: () => Hi, allDrawMatchUps: () => vr, allEventMatchUps: () => Vn, allPlayoffPositionsFilled: () => hy, allTournamentMatchUps: () => Qt, analyzeDraws: () => Hl, analyzeMatchUp: () => Gu, analyzeTournament: () => gU, bulkUpdatePublishedEventIds: () => yU, calculateWinCriteria: () => Do, categoryCanContain: () => al, checkMatchUpIsComplete: () => $a, checkValidEntries: () => Fm, compareTieFormats: () => ta, competitionScheduleMatchUps: () => ed, courtGridRows: () => rf, credits: () => vV, drawMatchUps: () => CU, eventMatchUps: () => sf, filterMatchUps: () => Wn, filterParticipants: () => Ol, findDrawDefinition: () => By, findExtension: () => De, findVenue: () => Bn, getAggregateTeamResults: () => hU, getAllDrawMatchUps: () => Rt, getAllEventData: () => UU, getAllStructureMatchUps: () => _e, getAllowedDrawTypes: () => qm, getAllowedMatchUpFormats: () => pU, getAppliedPolicies: () => xe, getAssignedParticipantIds: () => Is, getAvailableMatchUpsCount: () => km, getAvailablePlayoffProfiles: () => jl, getCategoryAgeDetails: () => Ls, getCheckedInParticipantIds: () => lo, getCompetitionDateRange: () => zm, getCompetitionMatchUps: () => ju, getCompetitionParticipants: () => oU, getCompetitionPenalties: () => mU, getCompetitionVenues: () => Xl, getCourtInfo: () => Im, getCourts: () => OU, getDrawData: () => Xm, getDrawDefinitionTimeItem: () => FI, getDrawParticipantRepresentativeIds: () => Ly, getDrawStructures: () => Ai, getDrawTypeCoercion: () => zl, getEligibleVoluntaryConsolationParticipants: () => Fy, getEntriesAndSeedsCount: () => nf, getEvent: () => FU, getEventData: () => Qm, getEventMatchUpFormatTiming: () => DU, getEventProperties: () => kU, getEventPublishStatus: () => Ui, getEventStructures: () => Pm, getEventTimeItem: () => gl, getEvents: () => xU, getFlightProfile: () => Dt, getHomeParticipantId: () => MU, getLinkedTournamentIds: () => ml, getMatchUpCompetitiveProfile: () => Pl, getMatchUpContextIds: () => NU, getMatchUpDailyLimits: () => cf, getMatchUpDailyLimitsUpdate: () => TU, getMatchUpDependencies: () => Fi, getMatchUpFormat: () => RU, getMatchUpFormatTiming: () => bl, getMatchUpFormatTimingUpdate: () => wU, getMatchUpScheduleDetails: () => ym, getMatchUpType: () => Um, getMatchUpsMap: () => er, getMatchUpsStats: () => EU, getMatchUpsToSchedule: () => Jm, getMaxEntryPosition: () => vU, getModifiedMatchUpFormatTiming: () => af, getPairedParticipant: () => Ci, getParticipantEventDetails: () => cU, getParticipantIdFinishingPositions: () => _y, getParticipantMembership: () => uU, getParticipantResults: () => Gl, getParticipantScaleItem: () => cc, getParticipantSchedules: () => lU, getParticipantSignInStatus: () => dU, getParticipantTimeItem: () => LI, getParticipants: () => pt, getPersonRequests: () => Ss, getPolicyDefinitions: () => aa, getPositionAssignments: () => _u, getPositionsPlayedOff: () => Lc, getPredictiveAccuracy: () => bU, getProfileRounds: () => tf, getPublishState: () => ho, getRandomQualifierList: () => Gy, getRoundMatchUps: () => Dr, getRounds: () => AU, getScaleValues: () => bc, getScaledEntries: () => vo, getScheduledRoundsDetails: () => Ql, getSchedulingProfile: () => ua, getSchedulingProfileIssues: () => SU, getSeedingThresholds: () => uy, getSeedsCount: () => Yl, getStructureSeedAssignments: () => mi, getTeamLineUp: () => Ja, getTieFormat: () => Km, getTimeItem: () => gi, getTournamentIds: () => dl, getTournamentInfo: () => wo, getTournamentPenalties: () => Hm, getTournamentPersons: () => fU, getTournamentPoints: () => Ym, getTournamentPublishStatus: () => Cl, getTournamentStructures: () => fy, getTournamentTimeItem: () => pm, getValidGroupSizes: () => Fl, getVenueData: () => sc, getVenuesAndCourts: () => ca, isAdHoc: () => Rr, isCompletedStructure: () => Fn, isValidForQualifying: () => $y, isValidMatchUpFormat: () => qr, matchUpActions: () => xm, participantScaleItem: () => Dn, participantScheduledMatchUps: () => PU, positionActions: () => jy, publicFindCourt: () => YI, publicFindVenue: () => zI, tallyParticipantResults: () => _c, tieFormatGenderValidityCheck: () => jp, tournamentMatchUps: () => of, validMatchUp: () => mm, validMatchUps: () => yi, validateCollectionDefinition: () => sl, validateLineUp: () => Tm });
9870
9878
  function vV() {
9871
9879
  return `
9872
9880
  This project would not have been possible without the generous input and patience
@@ -9890,7 +9898,7 @@ function vV() {
9890
9898
  `;
9891
9899
  }
9892
9900
  var DR = {};
9893
- Pe(DR, { filterParticipants: () => Ol, getCompetitionParticipants: () => oU, getPairedParticipant: () => Ci, getParticipantEventDetails: () => cU, getParticipantMembership: () => uU, getParticipantScaleItem: () => oc, getParticipantSchedules: () => lU, getParticipantSignInStatus: () => dU, getParticipantTimeItem: () => LI, getParticipants: () => pt, getScaleValues: () => Pc, participantScaleItem: () => Dn, validateLineUp: () => Tm });
9901
+ Pe(DR, { filterParticipants: () => Ol, getCompetitionParticipants: () => oU, getPairedParticipant: () => Ci, getParticipantEventDetails: () => cU, getParticipantMembership: () => uU, getParticipantScaleItem: () => cc, getParticipantSchedules: () => lU, getParticipantSignInStatus: () => dU, getParticipantTimeItem: () => LI, getParticipants: () => pt, getScaleValues: () => bc, participantScaleItem: () => Dn, validateLineUp: () => Tm });
9894
9902
  function oU(e) {
9895
9903
  let { tournamentRecords: t } = e || {};
9896
9904
  if (typeof t != "object" || !Object.keys(t).length) return { error: mt };
@@ -9985,7 +9993,7 @@ function mU({ tournamentRecords: e }) {
9985
9993
  function PR({ event: e }) {
9986
9994
  return { eventInfo: (({ eventId: t, eventName: r, eventType: i, eventLevel: n, surfaceCategory: a, matchUpFormat: s, category: o, gender: c, startDate: u, endDate: l, ballType: d, discipline: p, onlineResources: m, notes: f }) => ({ eventId: t, eventName: r, eventType: i, eventLevel: n, surfaceCategory: a, matchUpFormat: s, category: o, gender: c, startDate: u, endDate: l, ballType: d, discipline: p, onlineResources: m, notes: f }))(e) };
9987
9995
  }
9988
- var wV = { [bc]: { policyName: "Staff Privacy Policy", participant: { contacts: !1, individualParticipants: !1, individualParticipantIds: !1, onlineResources: !1, participantName: !0, participantOtherName: !0, participantId: !0, participantRole: !0, participantRoleResponsibilities: !0, participantStatus: !0, penalties: !1, representing: !0, participantType: !0, person: { addresses: !1, biographicalInformation: !1, birthDate: !1, contacts: !1, nationalityCode: !0, nativeFamilyName: !1, nativeGivenName: !1, onlineResources: !1, otherNames: !0, parentOrganisationId: !1, passportFamilyName: !1, passportGivenName: !1, personId: !1, personOtherIds: !1, previousNames: !1, sex: !1, standardFamilyName: !0, standardGivenName: !0, status: !1, tennisId: !1, wheelchair: !0 } } } }, DV = wV;
9996
+ var wV = { [Mc]: { policyName: "Staff Privacy Policy", participant: { contacts: !1, individualParticipants: !1, individualParticipantIds: !1, onlineResources: !1, participantName: !0, participantOtherName: !0, participantId: !0, participantRole: !0, participantRoleResponsibilities: !0, participantStatus: !0, penalties: !1, representing: !0, participantType: !0, person: { addresses: !1, biographicalInformation: !1, birthDate: !1, contacts: !1, nationalityCode: !0, nativeFamilyName: !1, nativeGivenName: !1, onlineResources: !1, otherNames: !0, parentOrganisationId: !1, passportFamilyName: !1, passportGivenName: !1, personId: !1, personOtherIds: !1, previousNames: !1, sex: !1, standardFamilyName: !0, standardGivenName: !0, status: !1, tennisId: !1, wheelchair: !0 } } } }, DV = wV;
9989
9997
  function wo(e) {
9990
9998
  let { tournamentRecord: t } = e ?? {};
9991
9999
  if (!t) return { error: J };
@@ -10241,7 +10249,7 @@ function Km({ tournamentRecord: e, drawDefinition: t, structureId: r, matchUpId:
10241
10249
  return { ...x, matchUp: c?.matchUp, structureDefaultTieFormat: tr(u), eventDefaultTieFormat: tr(d), drawDefaultTieFormat: tr(l), tieFormat: tr(p), structure: n };
10242
10250
  }
10243
10251
  var RR = {};
10244
- Pe(RR, { bulkUpdatePublishedEventIds: () => yU, getAllEventData: () => UU, getCourtInfo: () => Im, getDrawData: () => Xm, getEventData: () => Qm, getEventPublishStatus: () => Ui, getPublishState: () => ho, getTournamentPublishStatus: () => Cl, getVenueData: () => ac });
10252
+ Pe(RR, { bulkUpdatePublishedEventIds: () => yU, getAllEventData: () => UU, getCourtInfo: () => Im, getDrawData: () => Xm, getEventData: () => Qm, getEventPublishStatus: () => Ui, getPublishState: () => ho, getTournamentPublishStatus: () => Cl, getVenueData: () => sc });
10245
10253
  function yU({ tournamentRecord: e, outcomes: t }) {
10246
10254
  if (!e) return { error: J };
10247
10255
  if (!t?.length) return { error: ce, info: "Missing outcomes" };
@@ -10328,7 +10336,7 @@ function UU({ tournamentRecord: e, policyDefinitions: t }) {
10328
10336
  if (!e) return { error: J };
10329
10337
  let r = e.events || [], i = e?.participants || [], { tournamentInfo: n } = wo({ tournamentRecord: e }), { venues: a } = ca({ tournamentRecord: e }), s = r.map((o) => {
10330
10338
  let { eventId: c } = o, u = PR({ event: o }).eventInfo, l = Il({ tournamentRecord: e, event: o }).scheduleTiming, d = (o.drawDefinitions || []).map((m) => {
10331
- let f = (({ drawId: U, drawName: w, matchUpFormat: v, updatedAt: D }) => ({ matchUpFormat: v, updatedAt: D, drawName: w, drawId: U }))(m), { abandonedMatchUps: h, completedMatchUps: g, upcomingMatchUps: I, pendingMatchUps: y } = Ac({ requireParticipants: !0, tournamentParticipants: i, context: { eventId: c }, policyDefinitions: t, tournamentRecord: e, inContext: !0, scheduleTiming: l, drawDefinition: m, event: o });
10339
+ let f = (({ drawId: U, drawName: w, matchUpFormat: v, updatedAt: D }) => ({ matchUpFormat: v, updatedAt: D, drawName: w, drawId: U }))(m), { abandonedMatchUps: h, completedMatchUps: g, upcomingMatchUps: I, pendingMatchUps: y } = Cc({ requireParticipants: !0, tournamentParticipants: i, context: { eventId: c }, policyDefinitions: t, tournamentRecord: e, inContext: !0, scheduleTiming: l, drawDefinition: m, event: o });
10332
10340
  return { drawInfo: f, matchUps: { abandonedMatchUps: h, completedMatchUps: g, upcomingMatchUps: I, pendingMatchUps: y } };
10333
10341
  }), p = Ui({ event: o });
10334
10342
  return Object.assign(u, { drawsData: d, publish: p }), u;
@@ -10353,13 +10361,13 @@ function Xm(e) {
10353
10361
  }).sort((L, _) => ao(L, _, m)).map((L) => {
10354
10362
  if (!L) return;
10355
10363
  let _ = L?.structureId, B = [];
10356
- L.stage && [re, sr, yt].includes(L.stage) && (B = y), L?.stage === oe && (B = I[L.stageSequence ?? 0]);
10364
+ L.stage && [re, sr, Ut].includes(L.stage) && (B = y), L?.stage === oe && (B = I[L.stageSequence ?? 0]);
10357
10365
  let { matchUps: G, roundMatchUps: $, roundProfile: j } = _e({ seedAssignments: L?.seedAssignments?.length ? void 0 : B, context: { drawId: g.drawId, ...f }, hydrateParticipants: e.hydrateParticipants, participantsProfile: e.participantsProfile, tournamentParticipants: t, policyDefinitions: i, tournamentRecord: n, usePublishState: s, publishStatus: b, contextProfile: l, drawDefinition: d, inContext: a, structure: L, event: h }), { positionAssignments: V } = Ke({ structure: L }), H = V?.filter(Kr(Cn)).map((K) => {
10358
10366
  let X = De({ element: K, name: Jn })?.extension?.value, { drawPosition: Q, participantId: Z } = K;
10359
10367
  return A = !0, { participantResult: X, participantId: Z, drawPosition: Q };
10360
10368
  });
10361
10369
  if (G.length && (!H?.length && e.allParticipantResults || u && !L.structures)) {
10362
- let { subOrderMap: K } = WM({ positionAssignments: V }), X = G.some((Z) => Z.matchUpType === Jr) ? G.filter((Z) => Z.matchUpType === Jr) : G, Q = Lc({ matchUpFormat: L.matchUpFormat, matchUps: X, policyDefinitions: i, pressureRating: c, subOrderMap: K });
10370
+ let { subOrderMap: K } = WM({ positionAssignments: V }), X = G.some((Z) => Z.matchUpType === Jr) ? G.filter((Z) => Z.matchUpType === Jr) : G, Q = _c({ matchUpFormat: L.matchUpFormat, matchUps: X, policyDefinitions: i, pressureRating: c, subOrderMap: K });
10363
10371
  U = Q?.report, H = V?.filter(Kr(Cn)).map((Z) => {
10364
10372
  let { drawPosition: ee, participantId: ue } = Z;
10365
10373
  return A = !0, { participantResult: ue && Q?.participantResults?.[ue], participantId: ue, drawPosition: ee };
@@ -10367,10 +10375,10 @@ function Xm(e) {
10367
10375
  }
10368
10376
  let W = L ? (({ stageSequence: K, structureName: X, structureType: Q, matchUpFormat: Z, stage: ee }) => ({ stageSequence: K, structureName: X, structureType: Q, matchUpFormat: Z, stage: ee }))(L) : {}, Y = De({ element: L, name: Hd }).extension?.value;
10369
10377
  W.display = Y?.[OR] ?? Y, W.sourceStructureIds = v[_], W.hasDrawFeedProfile = D[_], W.positionAssignments = V, W.structureActive = G.reduce((K, X) => {
10370
- let Q = [dt, kt, ki, Ut, mn, ze, jt, nt].includes(X.matchUpStatus);
10378
+ let Q = [dt, kt, ki, St, mn, ze, jt, nt].includes(X.matchUpStatus);
10371
10379
  return K || Q || !!X.winningSide || !!X.score?.scoreStringSide1;
10372
10380
  }, !1);
10373
- let q = G.reduce((K, X) => K && ["BYE", Ut, jt, nt, ze, Lr].includes(X.matchUpStatus), !!G.length);
10381
+ let q = G.reduce((K, X) => K && ["BYE", St, jt, nt, ze, Lr].includes(X.matchUpStatus), !!G.length);
10374
10382
  return W.structureCompleted = q, k[_] = q, W.structureActive && (R = !0), { ...W, participantResults: H, seedAssignments: B, roundMatchUps: $, roundProfile: j, structureId: _, report: U };
10375
10383
  });
10376
10384
  return O.forEach((L) => {
@@ -10404,14 +10412,14 @@ function Qm(e) {
10404
10412
  }, S = d.drawDefinitions || [], T = !n || I ? S.filter(v).map((R) => (({ drawInfo: A, structures: E }) => ({ ...A, structures: E }))(Xm({ allParticipantResults: e.allParticipantResults, hydrateParticipants: e.hydrateParticipants, context: { eventId: p, tournamentId: m, endDate: f }, pressureRating: e.pressureRating, refreshResults: e.refreshResults, includePositionAssignments: t, tournamentParticipants: y, eventPublishState: g, noDeepCopy: !0, policyDefinitions: i, tournamentRecord: u, usePublishState: n, contextProfile: s, drawDefinition: R, publishStatus: h, sortConfig: o, event: d }))).map(({ structures: R, ...A }) => {
10405
10413
  let E = R?.filter(({ stage: C, structureId: k }) => w({ structureId: k, drawId: A.drawId }) && U({ stage: C, drawId: A.drawId })).map((C) => D({ drawId: A.drawId, structure: C }));
10406
10414
  return { ...A, structures: E };
10407
- }).filter((R) => R.structures?.length) : void 0, b = (Array.isArray(u.venues) ? u.venues : []).map((R) => (({ venueData: A }) => ({ ...A }))(ac({ venueId: R.venueId, tournamentRecord: u }))), P = (({ eventId: R, eventName: A, eventType: E, eventLevel: C, surfaceCategory: k, matchUpFormat: O, category: L, gender: _, startDate: B, endDate: G, ballType: $, discipline: j }) => ({ eventId: R, eventName: A, eventType: E, eventLevel: C, surfaceCategory: k, matchUpFormat: O, category: L, gender: _, startDate: B, endDate: G, ballType: $, discipline: j }))(d);
10415
+ }).filter((R) => R.structures?.length) : void 0, b = (Array.isArray(u.venues) ? u.venues : []).map((R) => (({ venueData: A }) => ({ ...A }))(sc({ venueId: R.venueId, tournamentRecord: u }))), P = (({ eventId: R, eventName: A, eventType: E, eventLevel: C, surfaceCategory: k, matchUpFormat: O, category: L, gender: _, startDate: B, endDate: G, ballType: $, discipline: j }) => ({ eventId: R, eventName: A, eventType: E, eventLevel: C, surfaceCategory: k, matchUpFormat: O, category: L, gender: _, startDate: B, endDate: G, ballType: $, discipline: j }))(d);
10408
10416
  P.display = De({ element: d, name: Hd }).extension?.value;
10409
10417
  let { tournamentInfo: M } = wo({ tournamentRecord: u }), N = { tournamentInfo: M, venuesData: b, eventInfo: P, drawsData: T };
10410
10418
  return N.eventInfo.publishState = g, N.eventInfo.published = g?.status?.published, { ...x, eventData: N, participants: y };
10411
10419
  }
10412
10420
  var kR = {};
10413
10421
  Pe(kR, { courtGridRows: () => rf, findVenue: () => Bn, getMatchUpsToSchedule: () => Jm, getPersonRequests: () => Ss, getProfileRounds: () => tf, getScheduledRoundsDetails: () => Ql, getSchedulingProfile: () => ua, getSchedulingProfileIssues: () => SU, publicFindCourt: () => YI });
10414
- function uc({ matchUpPotentialParticipantIds: e, matchUpNotBeforeTimes: t, timeAfterRecovery: r, matchUp: i }) {
10422
+ function lc({ matchUpPotentialParticipantIds: e, matchUpNotBeforeTimes: t, timeAfterRecovery: r, matchUp: i }) {
10415
10423
  let { individualParticipantIds: n } = lm(i);
10416
10424
  r = r ?? i.schedule?.timeAfterRecovery;
10417
10425
  let a = (u) => {
@@ -10429,11 +10437,11 @@ function Jm(e) {
10429
10437
  let t = se(e, [{ [uI]: !0 }]);
10430
10438
  if (t.error) return t;
10431
10439
  let { matchUpPotentialParticipantIds: r, dateScheduledMatchUpIds: i = [], scheduleCompletedMatchUps: n, matchUpNotBeforeTimes: a, matchUpScheduleTimes: s, orderedMatchUpIds: o, clearDate: c, matchUps: u } = e, l = s ? Object.keys(s) : [], d = (o ?? []).map((m) => u.find((f) => f.matchUpId === m)).filter(Boolean).filter((m) => {
10432
- let f = !c && (i.includes(m.matchUpId) || l.includes(m.matchUpId)), h = ["BYE", ze, Ut, Lr, jt, nt, dt, kt].includes(m?.matchUpStatus);
10440
+ let f = !c && (i.includes(m.matchUpId) || l.includes(m.matchUpId)), h = ["BYE", ze, St, Lr, jt, nt, dt, kt].includes(m?.matchUpStatus);
10433
10441
  return n || !f && !m.winningSide && !h;
10434
10442
  }), p = r && a ? d.reduce((m, f) => {
10435
10443
  let { drawId: h, tournamentId: g } = f;
10436
- return m.matchUpMap[g] || (m.matchUpMap[g] = {}), m.matchUpMap[g][h] ? m.matchUpMap[g][h].push(f) : m.matchUpMap[g][h] = [f], uc({ matchUpPotentialParticipantIds: r, matchUpNotBeforeTimes: a, matchUp: f }), m;
10444
+ return m.matchUpMap[g] || (m.matchUpMap[g] = {}), m.matchUpMap[g][h] ? m.matchUpMap[g][h].push(f) : m.matchUpMap[g][h] = [f], lc({ matchUpPotentialParticipantIds: r, matchUpNotBeforeTimes: a, matchUp: f }), m;
10437
10445
  }, { matchUpMap: {} }).matchUpMap : {};
10438
10446
  return { matchUpsToSchedule: d, matchUpMap: p };
10439
10447
  }
@@ -10451,7 +10459,7 @@ function Ql(e) {
10451
10459
  if (t.error) return t;
10452
10460
  let { scheduleCompletedMatchUps: r, periodLength: i = 30 } = e, n = e.tournamentRecords || e.tournamentRecord && { [e.tournamentRecord.tournamentId]: e.tournamentRecord } || {};
10453
10461
  if (typeof n != "object") return { error: mt };
10454
- let a = {}, s = [], o = e.rounds.toSorted((f, h) => (f.sortOrder ?? 0) - (h.sortOrder ?? 0)), c = e.containedStructureIds ?? Object.assign({}, ...Object.values(n).map((f) => Rc({ tournamentRecord: f }).containedStructures)), u = e.matchUps ?? Hi({ nextMatchUps: !0, tournamentRecords: n }).matchUps, l = 0, d = {}, p = {}, m = {};
10462
+ let a = {}, s = [], o = e.rounds.toSorted((f, h) => (f.sortOrder ?? 0) - (h.sortOrder ?? 0)), c = e.containedStructureIds ?? Object.assign({}, ...Object.values(n).map((f) => Ec({ tournamentRecord: f }).containedStructures)), u = e.matchUps ?? Hi({ nextMatchUps: !0, tournamentRecords: n }).matchUps, l = 0, d = {}, p = {}, m = {};
10455
10463
  return { scheduledRoundsDetails: o.flatMap((f) => {
10456
10464
  let h = f.periodLength || i, g = [];
10457
10465
  c?.[f.structureId] ? g.push(...c[f.structureId]) : g.push(f.structureId);
@@ -10556,13 +10564,13 @@ function ua({ tournamentRecords: e, tournamentRecord: t }) {
10556
10564
  let { venueIds: n } = Xl({ requireCourts: !0, tournamentRecords: e }), { eventIds: a, drawIds: s } = Ay({ tournamentRecords: e }), { updatedSchedulingProfile: o, modifications: c, issues: u } = xR({ schedulingProfile: i, venueIds: n, eventIds: a, drawIds: s });
10557
10565
  if (c) {
10558
10566
  i = o;
10559
- let l = _c({ tournamentRecords: e, tournamentRecord: t, schedulingProfile: i });
10567
+ let l = Bc({ tournamentRecords: e, tournamentRecord: t, schedulingProfile: i });
10560
10568
  return l.error ? l : { schedulingProfile: i, modifications: c, issues: u };
10561
10569
  }
10562
10570
  }
10563
10571
  return { schedulingProfile: i, modifications: 0 };
10564
10572
  }
10565
- function _c({ tournamentRecords: e, tournamentRecord: t, schedulingProfile: r }) {
10573
+ function Bc({ tournamentRecords: e, tournamentRecord: t, schedulingProfile: r }) {
10566
10574
  let i = ef({ tournamentRecords: e, schedulingProfile: r });
10567
10575
  return i.error ? i : r ? Le({ tournamentRecords: e, discover: !0, extension: { name: Gs, value: r } }) : Sr({ element: t, name: Gs, tournamentRecords: e, discover: !0 });
10568
10576
  }
@@ -10573,7 +10581,7 @@ function Jl(e) {
10573
10581
  return { success: !u, modifications: u, issues: l };
10574
10582
  }
10575
10583
  let { venueIds: i } = Xl({ tournamentRecords: r }), { eventIds: n, drawIds: a } = Ay({ tournamentRecords: r }), { updatedSchedulingProfile: s, modifications: o, issues: c } = xR({ schedulingProfile: e.schedulingProfile, venueIds: i, eventIds: n, drawIds: a });
10576
- return o ? { ..._c({ schedulingProfile: s, tournamentRecords: r }), modifications: o, issues: c } : { ...x, modifications: o, issues: c };
10584
+ return o ? { ...Bc({ schedulingProfile: s, tournamentRecords: r }), modifications: o, issues: c } : { ...x, modifications: o, issues: c };
10577
10585
  }
10578
10586
  function SU(e) {
10579
10587
  let { scheduleDates: t = [], tournamentRecords: r, periodLength: i = 30 } = e ?? {};
@@ -10595,7 +10603,7 @@ function SU(e) {
10595
10603
  }), v;
10596
10604
  };
10597
10605
  if (g?.forEach((w, v) => {
10598
- let D = g.slice(v + 1), S = St(D, y?.[w]?.matchUpIds || []);
10606
+ let D = g.slice(v + 1), S = vt(D, y?.[w]?.matchUpIds || []);
10599
10607
  S.length && h.push({ matchUpId: w, shouldBeAfter: S });
10600
10608
  }), h.length) {
10601
10609
  a += h.length;
@@ -10621,7 +10629,7 @@ function Ss(e) {
10621
10629
  if (i.error) return i;
10622
10630
  let n = {};
10623
10631
  for (let a of Object.values(t)) {
10624
- let { extension: s } = De({ element: a, name: Mc }), o = s?.value || [];
10632
+ let { extension: s } = De({ element: a, name: Nc }), o = s?.value || [];
10625
10633
  for (let c of o) {
10626
10634
  let { personId: u, requests: l } = c || {};
10627
10635
  n[u] || (n[u] = []);
@@ -10704,7 +10712,7 @@ function vU(e) {
10704
10712
  return Math.max(...t.filter((n) => (!i || i === n.entryStage) && (!r || n.entryStatus === r) && !isNaN(n.entryPosition)).map(({ entryPosition: n }) => pe(n || 0)), 0);
10705
10713
  }
10706
10714
  var LR = {};
10707
- Pe(LR, { allCompetitionMatchUps: () => Hi, allDrawMatchUps: () => vr, allEventMatchUps: () => Vn, allTournamentMatchUps: () => Qt, analyzeMatchUp: () => Gu, calculateWinCriteria: () => Do, checkMatchUpIsComplete: () => $a, competitionScheduleMatchUps: () => ed, drawMatchUps: () => CU, eventMatchUps: () => sf, filterMatchUps: () => Wn, getAllDrawMatchUps: () => Rt, getAllStructureMatchUps: () => _e, getCheckedInParticipantIds: () => lo, getCompetitionMatchUps: () => ju, getEventMatchUpFormatTiming: () => DU, getHomeParticipantId: () => MU, getMatchUpCompetitiveProfile: () => Pl, getMatchUpContextIds: () => NU, getMatchUpDailyLimits: () => cf, getMatchUpDailyLimitsUpdate: () => TU, getMatchUpDependencies: () => Fi, getMatchUpFormat: () => RU, getMatchUpFormatTiming: () => bl, getMatchUpFormatTimingUpdate: () => wU, getMatchUpScheduleDetails: () => ym, getMatchUpType: () => Um, getMatchUpsStats: () => EU, getModifiedMatchUpFormatTiming: () => af, getParticipantResults: () => Gl, getPredictiveAccuracy: () => bU, getRoundMatchUps: () => Dr, getRounds: () => AU, isValidMatchUpFormat: () => qr, matchUpActions: () => xm, participantScheduledMatchUps: () => PU, tallyParticipantResults: () => Lc, tournamentMatchUps: () => of, validMatchUp: () => mm, validMatchUps: () => yi });
10715
+ Pe(LR, { allCompetitionMatchUps: () => Hi, allDrawMatchUps: () => vr, allEventMatchUps: () => Vn, allTournamentMatchUps: () => Qt, analyzeMatchUp: () => Gu, calculateWinCriteria: () => Do, checkMatchUpIsComplete: () => $a, competitionScheduleMatchUps: () => ed, drawMatchUps: () => CU, eventMatchUps: () => sf, filterMatchUps: () => Wn, getAllDrawMatchUps: () => Rt, getAllStructureMatchUps: () => _e, getCheckedInParticipantIds: () => lo, getCompetitionMatchUps: () => ju, getEventMatchUpFormatTiming: () => DU, getHomeParticipantId: () => MU, getMatchUpCompetitiveProfile: () => Pl, getMatchUpContextIds: () => NU, getMatchUpDailyLimits: () => cf, getMatchUpDailyLimitsUpdate: () => TU, getMatchUpDependencies: () => Fi, getMatchUpFormat: () => RU, getMatchUpFormatTiming: () => bl, getMatchUpFormatTimingUpdate: () => wU, getMatchUpScheduleDetails: () => ym, getMatchUpType: () => Um, getMatchUpsStats: () => EU, getModifiedMatchUpFormatTiming: () => af, getParticipantResults: () => Gl, getPredictiveAccuracy: () => bU, getRoundMatchUps: () => Dr, getRounds: () => AU, isValidMatchUpFormat: () => qr, matchUpActions: () => xm, participantScheduledMatchUps: () => PU, tallyParticipantResults: () => _c, tournamentMatchUps: () => of, validMatchUp: () => mm, validMatchUps: () => yi });
10708
10716
  function _R({ tournamentRecords: e, extensionName: t }) {
10709
10717
  if (typeof e != "object" || !Object.keys(e).length) return { error: mt };
10710
10718
  let r = [], i;
@@ -10819,7 +10827,7 @@ function sf(e) {
10819
10827
  !t && l && ({ participants: t, participantMap: i, groupInfo: M } = ps({ participantsProfile: s, useParticipantMap: u, tournamentRecord: l, contextProfile: f, inContext: I })), f && !r && (r = sa({ policyDefinitions: c, tournamentRecord: l, contextProfile: f, event: U }));
10820
10828
  let N = Ui({ event: U });
10821
10829
  return { ...(U.drawDefinitions ?? []).reduce((R, A) => {
10822
- let E = Ac({ hydrateParticipants: e.hydrateParticipants, context: P, tournamentAppliedPolicies: n, scheduleVisibilityFilters: a, tournamentParticipants: t, participantsProfile: s, afterRecoveryTimes: o, policyDefinitions: c, tournamentRecord: l, usePublishState: d, contextContent: r, contextFilters: p, matchUpFilters: m, participantMap: i, publishStatus: N, contextProfile: f, drawDefinition: A, nextMatchUps: h, inContext: I, event: U });
10830
+ let E = Cc({ hydrateParticipants: e.hydrateParticipants, context: P, tournamentAppliedPolicies: n, scheduleVisibilityFilters: a, tournamentParticipants: t, participantsProfile: s, afterRecoveryTimes: o, policyDefinitions: c, tournamentRecord: l, usePublishState: d, contextContent: r, contextFilters: p, matchUpFilters: m, participantMap: i, publishStatus: N, contextProfile: f, drawDefinition: A, nextMatchUps: h, inContext: I, event: U });
10823
10831
  return Object.keys(E)?.forEach((C) => {
10824
10832
  Array.isArray(E[C]) && (R[C] || (R[C] = []), R[C] = R[C].concat(E[C]));
10825
10833
  }), R;
@@ -10831,7 +10839,7 @@ function of(e) {
10831
10839
  d && !t && (t = sa({ policyDefinitions: a, tournamentRecord: s, contextProfile: d }));
10832
10840
  let { appliedPolicies: U } = xe({ tournamentRecord: s }), w = u?.eventIds ?? [];
10833
10841
  return { ...h.filter((v) => !w.includes(v.eventId)).map((v) => {
10834
- let D = { eventDrawsCount: wt({ event: v }).flightProfile?.flights?.length || v.drawDefinitions?.length || 0, ...m };
10842
+ let D = { eventDrawsCount: Dt({ event: v }).flightProfile?.flights?.length || v.drawDefinitions?.length || 0, ...m };
10835
10843
  return sf({ hydrateParticipants: e.hydrateParticipants, context: D, tournamentAppliedPolicies: U, scheduleVisibilityFilters: r, participantsProfile: i, afterRecoveryTimes: n, policyDefinitions: a, tournamentRecord: s, usePublishState: c, contextFilters: u, contextProfile: d, contextContent: t, matchUpFilters: l, participantMap: I, participants: g, tournamentId: f, nextMatchUps: p, inContext: o, event: v });
10836
10844
  }).reduce((v, D) => ((D && Object.keys(D).filter((S) => !["success", "matchUpsMap"].includes(S)))?.forEach((S) => {
10837
10845
  Array.isArray(D[S]) && (v[S] || (v[S] = []), v[S] = v[S].concat(D[S]), v.matchUpsCount !== void 0 ? v.matchUpsCount += D[S].length : v.matchUpsCount = D[S].length);
@@ -10851,10 +10859,10 @@ function ju({ scheduleVisibilityFilters: e, hydrateParticipants: t, participants
10851
10859
  }
10852
10860
  function ed(e) {
10853
10861
  if (typeof e?.tournamentRecords != "object" || !Object.keys(e?.tournamentRecords).length) return { error: mt };
10854
- let { courts: t, venues: r } = ca(e), i = ua(e).schedulingProfile, { sortDateMatchUps: n = !0, courtCompletedMatchUps: a, alwaysReturnCompleted: s, activeTournamentId: o, tournamentRecords: c, withCourtGridRows: u, minCourtGridRows: l, usePublishState: d, status: p = ni, sortCourtsData: m } = e, f = o ?? Zs() ?? Object.keys(c)[0], h = d ? Cl({ tournamentRecord: c[f], status: p }) : void 0, g = s ? ju({ ...e, matchUpFilters: { ...e.matchUpFilters, matchUpStatuses: [Ut] }, contextFilters: e.contextFilters }).completedMatchUps : [];
10862
+ let { courts: t, venues: r } = ca(e), i = ua(e).schedulingProfile, { sortDateMatchUps: n = !0, courtCompletedMatchUps: a, alwaysReturnCompleted: s, activeTournamentId: o, tournamentRecords: c, withCourtGridRows: u, minCourtGridRows: l, usePublishState: d, status: p = ni, sortCourtsData: m } = e, f = o ?? Zs() ?? Object.keys(c)[0], h = d ? Cl({ tournamentRecord: c[f], status: p }) : void 0, g = s ? ju({ ...e, matchUpFilters: { ...e.matchUpFilters, matchUpStatuses: [St] }, contextFilters: e.contextFilters }).completedMatchUps : [];
10855
10863
  if (d && !h?.orderOfPlay?.published) return { completedMatchUps: g, dateMatchUps: [], courtsData: [], venues: r };
10856
10864
  let I, y;
10857
- d && ({ drawIds: I, detailsMap: y } = OV({ tournamentRecords: c })), I?.length && (e.contextFilters || (e.contextFilters = {}), e.contextFilters?.drawIds ? e.contextFilters.drawIds = e.contextFilters.drawIds.filter((R) => I.includes(R)) : e.contextFilters.drawIds = I), h?.eventIds?.length && (e.matchUpFilters || (e.matchUpFilters = {}), e.matchUpFilters?.eventIds && e.matchUpFilters.eventIds.length ? e.matchUpFilters.eventIds = e.matchUpFilters.eventIds.filter((R) => h.eventIds.includes(R)) : e.matchUpFilters.eventIds = h.eventIds), h?.scheduledDates?.length && (e.matchUpFilters || (e.matchUpFilters = {}), e.matchUpFilters.scheduledDates && e.matchUpFilters.scheduledDates.length ? e.matchUpFilters.scheduledDates = e.matchUpFilters.scheduledDates.filter((R) => h.scheduledDates.includes(R)) : e.matchUpFilters.scheduledDates = h.scheduledDates), s && (e.matchUpFilters || (e.matchUpFilters = {}), e.matchUpFilters?.excludeMatchUpStatuses?.length ? e.matchUpFilters.excludeMatchUpStatuses.includes(Ut) || e.matchUpFilters.excludeMatchUpStatuses.push(Ut) : e.matchUpFilters.excludeMatchUpStatuses = [Ut]);
10865
+ d && ({ drawIds: I, detailsMap: y } = OV({ tournamentRecords: c })), I?.length && (e.contextFilters || (e.contextFilters = {}), e.contextFilters?.drawIds ? e.contextFilters.drawIds = e.contextFilters.drawIds.filter((R) => I.includes(R)) : e.contextFilters.drawIds = I), h?.eventIds?.length && (e.matchUpFilters || (e.matchUpFilters = {}), e.matchUpFilters?.eventIds && e.matchUpFilters.eventIds.length ? e.matchUpFilters.eventIds = e.matchUpFilters.eventIds.filter((R) => h.eventIds.includes(R)) : e.matchUpFilters.eventIds = h.eventIds), h?.scheduledDates?.length && (e.matchUpFilters || (e.matchUpFilters = {}), e.matchUpFilters.scheduledDates && e.matchUpFilters.scheduledDates.length ? e.matchUpFilters.scheduledDates = e.matchUpFilters.scheduledDates.filter((R) => h.scheduledDates.includes(R)) : e.matchUpFilters.scheduledDates = h.scheduledDates), s && (e.matchUpFilters || (e.matchUpFilters = {}), e.matchUpFilters?.excludeMatchUpStatuses?.length ? e.matchUpFilters.excludeMatchUpStatuses.includes(St) || e.matchUpFilters.excludeMatchUpStatuses.push(St) : e.matchUpFilters.excludeMatchUpStatuses = [St]);
10858
10866
  let { completedMatchUps: U, upcomingMatchUps: w, pendingMatchUps: v, groupInfo: D, mappedParticipants: S } = ju({ ...e, matchUpFilters: e.matchUpFilters, contextFilters: e.contextFilters }), T = [...w ?? [], ...v ?? []];
10859
10867
  y && (!I?.length || Object.keys(y).length) && (T = T.filter((R) => {
10860
10868
  let { drawId: A, structureId: E, stage: C } = R;
@@ -10906,7 +10914,7 @@ function bU(e) {
10906
10914
  if (t && !yi(t)) return { error: z, context: { matchUps: t } };
10907
10915
  let f = Gt[u], h = f?.ascending ?? e.ascending ?? !1, g = f?.accessor ?? e.valueAccessor, I = Array.isArray(f?.range) ? Math.abs(f.range[0] - f.range[1]) : 0, y = ge(d) && I ? (d ?? 0 / 100) * I : e.zoneMargin ?? I, U = { withScaleValues: !0, withCompetitiveness: !0 }, w = { matchUpTypes: c ? [c] : [Ye, We] }, v = i?.participants;
10908
10916
  t?.[0]?.hasContext ? p ? t = t.filter((A) => A.drawId === p) : l && (t = t.filter((A) => A.eventId === l)) : t === void 0 && (t = p && !n && [] || !p && l && !m && [] || p && vr({ inContext: !0, drawDefinition: n, contextFilters: w, contextProfile: U, participants: v })?.matchUps || !p && l && Vn({ inContext: !0, contextFilters: w, contextProfile: U, participants: v, event: m })?.matchUps || Qt({ tournamentRecord: i, contextFilters: w, contextProfile: U })?.matchUps || []), c && (t = t.filter((A) => A.matchUpType === c));
10909
- let D = t.filter(({ winningSide: A, score: E, sides: C, matchUpStatus: k }) => ![jt, ze, nt, Nc, Lr].includes(k ?? "") && _t({ score: E }) && C?.length === 2 && A), S = FV({ matchUps: D, excludeMargin: a, exclusionRule: s, valueAccessor: g, ascending: h, scaleName: u }), T = !o || Pt(Ye)(c) ? y : (y || 0) * 2, b = y ? D.map(({ competitiveProfile: A, matchUpType: E, score: C, sides: k }) => {
10917
+ let D = t.filter(({ winningSide: A, score: E, sides: C, matchUpStatus: k }) => ![jt, ze, nt, Rc, Lr].includes(k ?? "") && _t({ score: E }) && C?.length === 2 && A), S = FV({ matchUps: D, excludeMargin: a, exclusionRule: s, valueAccessor: g, ascending: h, scaleName: u }), T = !o || Pt(Ye)(c) ? y : (y || 0) * 2, b = y ? D.map(({ competitiveProfile: A, matchUpType: E, score: C, sides: k }) => {
10910
10918
  let O = VR({ singlesForDoubles: r, valueAccessor: g, matchUpType: E, scaleName: u, sides: k }), L = Math.abs(O[0].value - O[1].value);
10911
10919
  return { competitiveness: A?.competitiveness, valuesGap: L, score: C };
10912
10920
  }).filter(({ valuesGap: A }) => A <= T) : [], P = xV({ zoneData: b }), M = P && [].concat(Object.values(P)).flat().length, N = M && Object.assign({}, ...Object.keys(P).map((A) => ({ [A]: Math.round(1e4 * P[A].length / M) / 100 }))), R = D.length - (b?.length || 0);
@@ -10999,7 +11007,7 @@ function NU({ matchUps: e, matchUpId: t }) {
10999
11007
  let r = e.find((o) => o.matchUpId === t), { drawId: i, eventId: n, structureId: a, tournamentId: s } = r || {};
11000
11008
  return { matchUpId: t, drawId: i, eventId: n, structureId: a, tournamentId: s };
11001
11009
  }
11002
- function Bc(e, t) {
11010
+ function Vc(e, t) {
11003
11011
  if (!Ce(e)) return { error: z };
11004
11012
  if (!Array.isArray(t)) return { error: z };
11005
11013
  let r = {};
@@ -11024,7 +11032,7 @@ function LV({ params: e, param: t, attr: r, error: i }) {
11024
11032
  function RU(e) {
11025
11033
  let { structureId: t, matchUpId: r, event: i } = e, n = e.drawDefinition, a = se(e, [{ [Bt]: !0 }, { [dI]: { [Yp]: !1, [dn]: !1, [PP]: !1, [na]: !1 } }]);
11026
11034
  if (a[bi]) return a;
11027
- let s = Bc(e, [{ [Tc]: Ln, [bi]: ce }])?.matchUp;
11035
+ let s = Vc(e, [{ [Pc]: Ln, [bi]: ce }])?.matchUp;
11028
11036
  if (r && s?.error) return s;
11029
11037
  !n && s?.drawDefinition && (n = s?.drawDefinition);
11030
11038
  let o = s?.structure;
@@ -11096,7 +11104,7 @@ function Gu(e) {
11096
11104
  }
11097
11105
  function CU({ participants: e, tournamentAppliedPolicies: t, scheduleVisibilityFilters: r, participantsProfile: i, afterRecoveryTimes: n, policyDefinitions: a, useParticipantMap: s, tournamentRecord: o, usePublishState: c, contextFilters: u, contextContent: l, matchUpFilters: d, participantMap: p, publishStatus: m, contextProfile: f, drawDefinition: h, nextMatchUps: g, tournamentId: I, inContext: y, context: U, event: w }) {
11098
11106
  let { eventId: v, eventName: D, endDate: S, eventType: T, category: b, gender: P } = w ?? {}, M = { ...U, ...ae({ surfaceCategory: w?.surfaceCategory ?? o?.surfaceCategory, indoorOutDoor: w?.indoorOutdoor ?? o?.indoorOutdoor, endDate: S ?? w?.endDate ?? o?.endDate, tournamentId: I ?? o?.tournamentId, eventName: D, eventType: T, category: b, eventId: v, gender: P }) }, N;
11099
- return !e?.length && o && ({ participants: e, participantMap: p, groupInfo: N } = ps({ participantsProfile: i, useParticipantMap: s, tournamentRecord: o, contextProfile: f, inContext: y })), w && f && !l && (l = sa({ policyDefinitions: a, tournamentRecord: o, contextProfile: f, drawDefinition: h, event: w })), { ...Ac({ context: M, tournamentAppliedPolicies: t, scheduleVisibilityFilters: r, tournamentParticipants: e, participantsProfile: i, afterRecoveryTimes: n, policyDefinitions: a, tournamentRecord: o, usePublishState: c, participantMap: p, contextContent: l, contextFilters: u, matchUpFilters: d, publishStatus: m, contextProfile: f, drawDefinition: h, nextMatchUps: g, inContext: y, event: w }), groupInfo: N };
11107
+ return !e?.length && o && ({ participants: e, participantMap: p, groupInfo: N } = ps({ participantsProfile: i, useParticipantMap: s, tournamentRecord: o, contextProfile: f, inContext: y })), w && f && !l && (l = sa({ policyDefinitions: a, tournamentRecord: o, contextProfile: f, drawDefinition: h, event: w })), { ...Cc({ context: M, tournamentAppliedPolicies: t, scheduleVisibilityFilters: r, tournamentParticipants: e, participantsProfile: i, afterRecoveryTimes: n, policyDefinitions: a, tournamentRecord: o, usePublishState: c, participantMap: p, contextContent: l, contextFilters: u, matchUpFilters: d, publishStatus: m, contextProfile: f, drawDefinition: h, nextMatchUps: g, inContext: y, event: w }), groupInfo: N };
11100
11108
  }
11101
11109
  var jR = {};
11102
11110
  Pe(jR, { getCompetitionVenues: () => Xl, getCourts: () => OU, getVenuesAndCourts: () => ca, publicFindVenue: () => zI });
@@ -11107,7 +11115,7 @@ function OU({ tournamentRecord: e, venueId: t, venueIds: r }) {
11107
11115
  }).flat() } : { error: J };
11108
11116
  }
11109
11117
  var GR = {};
11110
- Pe(GR, { categoryCanContain: () => al, getCategoryAgeDetails: () => Ls, getEvent: () => FU, getEventProperties: () => kU, getEventStructures: () => Pm, getEventTimeItem: () => gl, getEvents: () => xU, getFlightProfile: () => wt, getScaledEntries: () => vo });
11118
+ Pe(GR, { categoryCanContain: () => al, getCategoryAgeDetails: () => Ls, getEvent: () => FU, getEventProperties: () => kU, getEventStructures: () => Pm, getEventTimeItem: () => gl, getEvents: () => xU, getFlightProfile: () => Dt, getScaledEntries: () => vo });
11111
11119
  function kU({ tournamentRecord: e, event: t }) {
11112
11120
  if (!e) return { error: J };
11113
11121
  if (!t) return { error: it };
@@ -11125,7 +11133,7 @@ function xU({ tournamentRecord: e, withScaleValues: t, scaleEventType: r, inCont
11125
11133
  if (!e) return { error: J };
11126
11134
  let { tournamentId: o } = e, c = (e.events ?? []).filter(({ eventId: l }) => !n || Array.isArray(n) && n.includes(l)).map((l) => {
11127
11135
  let d = l.drawDefinitions?.map(Au);
11128
- if (a?.length && !St(a, d).length) return;
11136
+ if (a?.length && !vt(a, d).length) return;
11129
11137
  let p = ie(l);
11130
11138
  return i && Object.assign(p, { tournamentId: o }), s && Object.assign(p, s), p;
11131
11139
  }).filter(Boolean), u = {};
@@ -11197,7 +11205,7 @@ function xU({ tournamentRecord: e, withScaleValues: t, scaleEventType: r, inCont
11197
11205
  let T = Is({ drawDefinition: D }).assignedParticipantIds ?? [];
11198
11206
  u[f].draws[S] || (u[f].draws[S] = { ratingsStats: {}, ratings: {}, ranking: {} }), U.push(S), y(S, T);
11199
11207
  }
11200
- let v = wt({ event: p }).flightProfile;
11208
+ let v = Dt({ event: p }).flightProfile;
11201
11209
  for (let D of v?.flights ?? []) {
11202
11210
  let S = D.drawId;
11203
11211
  if (w(S)) continue;
@@ -11259,7 +11267,7 @@ function WV(e) {
11259
11267
  return o && s && Fm({ consideredEntries: t, policyDefinitions: i, appliedPolicies: r, participantMap: a, enforceGender: n, participants: s, event: o });
11260
11268
  }
11261
11269
  function qV(e) {
11262
- return !e.drawSize && e.consideredEntries.length && ![zr, ol, Dc, Ri, An].includes(e.drawType ?? "") && fc(e.consideredEntries.length) || e.drawSize && pe(e.drawSize) || !1;
11270
+ return !e.drawSize && e.consideredEntries.length && ![zr, ol, Tc, Ri, An].includes(e.drawType ?? "") && hc(e.consideredEntries.length) || e.drawSize && pe(e.drawSize) || !1;
11263
11271
  }
11264
11272
  function HV(e) {
11265
11273
  let { tournamentRecord: t, event: r, ignoreAllowedDrawTypes: i, drawType: n } = e, a = !i && t && qm({ tournamentRecord: t, categoryType: r?.category?.categoryType, categoryName: r?.category?.categoryName });
@@ -11388,11 +11396,11 @@ function XR({ autoEntryPositions: e = !0, participantIds: t, drawDefinition: r,
11388
11396
  if (!i) return { error: zi };
11389
11397
  if (!t?.length) return { error: Ma };
11390
11398
  let s = Is({ drawDefinition: r, stages: n }).assignedParticipantIds ?? [];
11391
- if (wr(s, t)) return { error: Uc };
11399
+ if (wr(s, t)) return { error: Sc };
11392
11400
  let o = (l) => {
11393
11401
  let d = l.participantId;
11394
11402
  return !t.includes(d);
11395
- }, { flightProfile: c } = wt({ event: a }), u = c?.flights?.find((l) => l.drawId === i);
11403
+ }, { flightProfile: c } = Dt({ event: a }), u = c?.flights?.find((l) => l.drawId === i);
11396
11404
  return u?.drawEntries && (u.drawEntries = u.drawEntries.filter(o), e && (u.drawEntries = Gi({ entries: u.drawEntries }))), r?.entries && (r.entries = r.entries.filter(o), e && (r.entries = Gi({ entries: r.entries }))), { ...x };
11397
11405
  }
11398
11406
  function ln(e) {
@@ -11418,7 +11426,7 @@ function ln(e) {
11418
11426
  if (!s.individualParticipantIds.reduce((y, U) => I.includes(U) && y, !0)) return F({ result: { error: Gr }, stack: t });
11419
11427
  }
11420
11428
  } else return F({ result: { error: Ma }, stack: t });
11421
- let h = p.filter((I) => I.participantType === we).map((I) => ({ individualParticipantIds: I.individualParticipantIds, participant: I })), g = s.participantType === we && h.find((I) => St(I.individualParticipantIds, s.individualParticipantIds).length === 2);
11429
+ let h = p.filter((I) => I.participantType === we).map((I) => ({ individualParticipantIds: I.individualParticipantIds, participant: I })), g = s.participantType === we && h.find((I) => vt(I.individualParticipantIds, s.individualParticipantIds).length === 2);
11422
11430
  if (g && !r) return { ...x, existingParticipant: !0, participant: i && ie(g.participant) };
11423
11431
  if (!s.participantName) {
11424
11432
  let I = p.filter((U) => s.individualParticipantIds?.includes(U.participantId)), y = I.map((U) => U.person?.standardFamilyName).filter(Boolean).join("/");
@@ -11477,14 +11485,14 @@ function QR(e) {
11477
11485
  return Qr(c.gender) && (v.sort(vm), (!Va(v[0]) || !Ts(v[1])) && (D = !0)), D;
11478
11486
  });
11479
11487
  if (p.length) return { error: Gr, invalidParticipantIdPairs: p };
11480
- let m = n.map((w) => ({ participantId: u?.pop() ?? Be(), participantRole: nr, individualParticipantIds: w, participantType: we })), f = r ? m : m.filter((w) => !l.find((v) => St(v, w.individualParticipantIds).length === 2)), h, g = [];
11488
+ let m = n.map((w) => ({ participantId: u?.pop() ?? Be(), participantRole: nr, individualParticipantIds: w, participantType: we })), f = r ? m : m.filter((w) => !l.find((v) => vt(v, w.individualParticipantIds).length === 2)), h, g = [];
11481
11489
  if (f) {
11482
11490
  let w = Oi({ allowDuplicateParticipantIdPairs: r, participants: f, returnParticipants: !0, tournamentRecord: s });
11483
11491
  if (w.error) return w;
11484
11492
  g = w.participants || [], h = w.info;
11485
11493
  }
11486
11494
  let I = n.map((w) => {
11487
- let v = g.find((S) => St(S.individualParticipantIds, w).length === 2);
11495
+ let v = g.find((S) => vt(S.individualParticipantIds, w).length === 2);
11488
11496
  if (v) return v;
11489
11497
  let { participant: D } = Ci({ tournamentRecord: s, participantIds: w });
11490
11498
  return D;
@@ -11500,7 +11508,7 @@ function JR({ entryStatus: e = _r, unpairedParticipantIds: t = [], participantId
11500
11508
  if (c.length) return { error: Gr, invalidParticipantIds: c };
11501
11509
  let u = r.filter((h) => h.length !== 2);
11502
11510
  if (u.length) return { error: Gr, invalidParticipantIdPairs: u };
11503
- let l = s.filter((h) => h.participantType === we).map((h) => h.individualParticipantIds), d = r.filter((h) => !l.find((g) => St(g, h).length === 2)).map((h) => ({ participantType: we, participantRole: nr, individualParticipantIds: h })), p = Oi({ participants: d, tournamentRecord: n });
11511
+ let l = s.filter((h) => h.participantType === we).map((h) => h.individualParticipantIds), d = r.filter((h) => !l.find((g) => vt(g, h).length === 2)).map((h) => ({ participantType: we, participantRole: nr, individualParticipantIds: h })), p = Oi({ participants: d, tournamentRecord: n });
11504
11512
  if (p.error) return p;
11505
11513
  let m = r.map((h) => {
11506
11514
  let { participant: g } = Ci({ tournamentRecord: n, participantIds: h });
@@ -11509,14 +11517,14 @@ function JR({ entryStatus: e = _r, unpairedParticipantIds: t = [], participantId
11509
11517
  return a.entries = (a.entries ?? []).filter((h) => h.entryStage === i), a.entries = a.entries.concat(...m, ...f), { ...x };
11510
11518
  }
11511
11519
  var ZR = {};
11512
- Pe(ZR, { addDrawDefinition: () => rd, addEvent: () => Vc, addFlight: () => pf, assignSeedPositions: () => pE, attachFlightProfile: () => qU, categoryCanContain: () => al, deleteDrawDefinitions: () => uf, deleteEvents: () => fE, deleteFlightAndFlightDraw: () => lE, deleteFlightProfileAndFlightDraws: () => aE, generate: () => eE, generateEventsFromTieFormat: () => rE, getCategoryAgeDetails: () => Ls, getEvent: () => FU, getEventProperties: () => kU, getEventStructures: () => Pm, getEventTimeItem: () => gl, getEvents: () => xU, getFlightProfile: () => wt, getScaledEntries: () => vo, modifyEvent: () => hE, modifyEventMatchUpFormatTiming: () => sE, modifyPairAssignment: () => dE, mutate: () => iE, query: () => GR, refreshEventDrawOrder: () => WU, removeEventMatchUpFormatTiming: () => lf, removeScaleValues: () => HU, removeSeeding: () => mE, setEventDates: () => GU, setEventDisplay: () => df, setEventEndDate: () => jU, setEventStartDate: () => VU, updateDrawIdsOrder: () => $U, validateCategory: () => Du });
11520
+ Pe(ZR, { addDrawDefinition: () => rd, addEvent: () => jc, addFlight: () => pf, assignSeedPositions: () => pE, attachFlightProfile: () => qU, categoryCanContain: () => al, deleteDrawDefinitions: () => uf, deleteEvents: () => fE, deleteFlightAndFlightDraw: () => lE, deleteFlightProfileAndFlightDraws: () => aE, generate: () => eE, generateEventsFromTieFormat: () => rE, getCategoryAgeDetails: () => Ls, getEvent: () => FU, getEventProperties: () => kU, getEventStructures: () => Pm, getEventTimeItem: () => gl, getEvents: () => xU, getFlightProfile: () => Dt, getScaledEntries: () => vo, modifyEvent: () => hE, modifyEventMatchUpFormatTiming: () => sE, modifyPairAssignment: () => dE, mutate: () => iE, query: () => GR, refreshEventDrawOrder: () => WU, removeEventMatchUpFormatTiming: () => lf, removeScaleValues: () => HU, removeSeeding: () => mE, setEventDates: () => GU, setEventDisplay: () => df, setEventEndDate: () => jU, setEventStartDate: () => VU, updateDrawIdsOrder: () => $U, validateCategory: () => Du });
11513
11521
  var eE = {};
11514
11522
  Pe(eE, { generateEventsFromTieFormat: () => rE });
11515
11523
  function YV({ tournamentId: e, event: t }) {
11516
11524
  return t ? (Ue({ payload: { tournamentId: e, event: t }, key: t.eventId, topic: HP }), { ...x }) : { error: it };
11517
11525
  }
11518
11526
  var KV = { collectionDefinitions: [{ collectionName: "Doubles", matchUpCount: 3, matchUpFormat: "SET1-S:8/TB7@7", matchUpType: "DOUBLES", matchUpValue: 1 }, { collectionName: "Singles", matchUpCount: 6, matchUpFormat: "SET3-S:6/TB7", matchUpType: "SINGLES", matchUpValue: 1 }], tieFormatName: "COLLEGE_D3", winCriteria: { valueGoal: 5 } }, XV = { collectionDefinitions: [{ collectionName: "Doubles", collectionValue: 1, matchUpCount: 3, matchUpFormat: "SET1-S:6/TB7", matchUpType: "DOUBLES" }, { collectionName: "Singles", matchUpCount: 6, matchUpFormat: "SET3-S:6/TB7", matchUpType: "SINGLES", matchUpValue: 1 }], tieFormatName: "COLLEGE_DEFAULT", winCriteria: { valueGoal: 5 } }, QV = { collectionDefinitions: [{ collectionName: "Doubles", matchUpCount: 3, matchUpFormat: "SET1-S:8/TB7", matchUpType: "DOUBLES", matchUpValue: 1 }, { collectionName: "Singles", matchUpCount: 6, matchUpFormat: "SET3-S:6/TB7", matchUpType: "SINGLES", matchUpValue: 1 }], tieFormatName: "COLLEGE_JUCO", winCriteria: { valueGoal: 5 } }, tE = { COLLEGE_D3: KV, COLLEGE_DEFAULT: XV, COLLEGE_JUCO: QV, DOMINANT_DUO: VT, DOMINANT_DUO_MIXED: xT, LAVER_CUP: qT, TEAM_DOUBLES_3_AGGREGATION: ET, TIME_TENNIS_DUAL: FT, TIME_TENNIS_PRO_CIRCUIT: kT, USTA_BREWER_CUP: LT, USTA_OZAKI_CUP: _T, USTA_COLLEGE: jT, USTA_GOLD_TEAM_CHALLENGE: RT, USTA_INTERSECTIONAL: OT, USTA_LEVEL_1: GT, USTA_SECTION_BATTLE: CT, USTA_SOUTHERN_LEVEL_5: AT, USTA_TOC: HT, USTA_WTT_ITT: $T, USTA_ZONAL: WT };
11519
- function Vc({ suppressNotifications: e, tournamentRecord: t, internalUse: r, event: i }) {
11527
+ function jc({ suppressNotifications: e, tournamentRecord: t, internalUse: r, event: i }) {
11520
11528
  if (!t) return { error: J };
11521
11529
  if (t.events || (t.events = []), !i) return { error: it };
11522
11530
  let { startDate: n, endDate: a } = t;
@@ -11552,7 +11560,7 @@ function Vc({ suppressNotifications: e, tournamentRecord: t, internalUse: r, eve
11552
11560
  }
11553
11561
  }
11554
11562
  function rE(e) {
11555
- let t = se(e, [{ [tc]: { [Kp]: !0, [UP]: !0 } }, { [Bt]: !0 }]);
11563
+ let t = se(e, [{ [rc]: { [Kp]: !0, [UP]: !0 } }, { [Bt]: !0 }]);
11556
11564
  if (t.error) return t;
11557
11565
  let r = e.tieFormat || zn({ namedFormat: e.tieFormatName }), i = e.uuids || [NT(r.collectionDefinitions.length)], n = { [At]: [], [rr]: [] };
11558
11566
  if (e.addEntriesFromTeams) {
@@ -11576,20 +11584,20 @@ function rE(e) {
11576
11584
  }
11577
11585
  }
11578
11586
  if (a.push(l), e.addEvents !== !1) {
11579
- let d = Vc({ internalUse: !0, tournamentRecord: e.tournamentRecord, event: l });
11587
+ let d = jc({ internalUse: !0, tournamentRecord: e.tournamentRecord, event: l });
11580
11588
  if (d.error) return d;
11581
11589
  }
11582
11590
  }
11583
11591
  return { ...x, events: a };
11584
11592
  }
11585
11593
  var iE = {};
11586
- Pe(iE, { addDrawDefinition: () => rd, addEvent: () => Vc, addFlight: () => pf, assignSeedPositions: () => pE, attachFlightProfile: () => qU, deleteDrawDefinitions: () => uf, deleteEvents: () => fE, deleteFlightAndFlightDraw: () => lE, deleteFlightProfileAndFlightDraws: () => aE, modifyEvent: () => hE, modifyEventMatchUpFormatTiming: () => sE, modifyPairAssignment: () => dE, refreshEventDrawOrder: () => WU, removeEventMatchUpFormatTiming: () => lf, removeScaleValues: () => HU, removeSeeding: () => mE, setEventDates: () => GU, setEventDisplay: () => df, setEventEndDate: () => jU, setEventStartDate: () => VU, updateDrawIdsOrder: () => $U, validateCategory: () => Du });
11587
- function jc({ removePriorValues: e = !0, status: t = ni, statusObject: r, event: i }) {
11594
+ Pe(iE, { addDrawDefinition: () => rd, addEvent: () => jc, addFlight: () => pf, assignSeedPositions: () => pE, attachFlightProfile: () => qU, deleteDrawDefinitions: () => uf, deleteEvents: () => fE, deleteFlightAndFlightDraw: () => lE, deleteFlightProfileAndFlightDraws: () => aE, modifyEvent: () => hE, modifyEventMatchUpFormatTiming: () => sE, modifyPairAssignment: () => dE, refreshEventDrawOrder: () => WU, removeEventMatchUpFormatTiming: () => lf, removeScaleValues: () => HU, removeSeeding: () => mE, setEventDates: () => GU, setEventDisplay: () => df, setEventEndDate: () => jU, setEventStartDate: () => VU, updateDrawIdsOrder: () => $U, validateCategory: () => Du });
11595
+ function Gc({ removePriorValues: e = !0, status: t = ni, statusObject: r, event: i }) {
11588
11596
  if (!Ce(r)) return { error: z };
11589
11597
  let n = Ui({ event: i, status: t }), a = `${Oa}.${ka}`, s = { itemValue: { [t]: { ...n, ...r } }, itemType: a };
11590
11598
  return So({ timeItem: s, removePriorValues: e, event: i });
11591
11599
  }
11592
- function Gc(e) {
11600
+ function $c(e) {
11593
11601
  let t = se(e, [{ [Bt]: !0, [na]: !0 }, { eventDataParams: !1, [Ar]: Or }]);
11594
11602
  if (t.error) return t;
11595
11603
  let { includePositionAssignments: r, removePriorValues: i, tournamentRecord: n, status: a = ni, event: s, drawIdsToRemove: o, drawIdsToAdd: c } = e, { appliedPolicies: u } = xe({ tournamentRecord: n, event: s }), l = { ...u, ...e.policyDefinitions }, d = s?.drawDefinitions?.map(({ drawId: v }) => v) ?? [], p = e.drawDetails ? Object.keys(e.drawDetails) : [], m = p.length ? [] : e.drawIds, f = (c ?? []).concat(...o ?? [], ...m ?? [], ...p), h = f.filter((v) => !d.includes(v));
@@ -11615,7 +11623,7 @@ function Gc(e) {
11615
11623
  }
11616
11624
  (R.length || N.length) && (I[v].stageDetails = T);
11617
11625
  }
11618
- jc({ statusObject: { drawDetails: I }, removePriorValues: i, status: a, event: s });
11626
+ Gc({ statusObject: { drawDetails: I }, removePriorValues: i, status: a, event: s });
11619
11627
  let { topics: y } = fi(), U = y.includes(Eh), w = U || e.returnEventData ? Qm({ includePositionAssignments: r, ...e.eventDataParams, usePublishState: !0, tournamentRecord: n, policyDefinitions: l, event: s })?.eventData : void 0;
11620
11628
  return U && Ue({ payload: { eventData: w, tournamentId: n.tournamentId }, topic: Eh }), { ...x, eventData: w };
11621
11629
  }
@@ -11632,7 +11640,7 @@ function uf(e) {
11632
11640
  if (!i?.drawDefinitions) return F({ info: "event has no drawDefinition", result: { ...x }, stack: t });
11633
11641
  let h = i.drawDefinitions.map(({ drawId: T }) => T);
11634
11642
  if (r.length || (r = h), r = r.filter((T) => h.includes(T)), !r.length) return F({ info: "nothing to do; no matching drawIds in event.", result: { ...x }, stack: t });
11635
- let g = ie(wt({ event: i }).flightProfile, !1, !0), I = ({ participantId: T, drawPosition: b, qualifier: P, bye: M }) => ({ bye: M, qualifier: P, drawPosition: b, participantId: T }), y = c ?? u?.[pi]?.allowDeletionWithScoresPresent?.drawDefinitions, U = Ui({ event: i }) ?? {}, w = U.drawIds ?? (U.drawDetails && Object.keys(U.drawDetails)) ?? [], v, D = [], S = i.drawDefinitions.filter((T) => {
11643
+ let g = ie(Dt({ event: i }).flightProfile, !1, !0), I = ({ participantId: T, drawPosition: b, qualifier: P, bye: M }) => ({ bye: M, qualifier: P, drawPosition: b, participantId: T }), y = c ?? u?.[pi]?.allowDeletionWithScoresPresent?.drawDefinitions, U = Ui({ event: i }) ?? {}, w = U.drawIds ?? (U.drawDetails && Object.keys(U.drawDetails)) ?? [], v, D = [], S = i.drawDefinitions.filter((T) => {
11636
11644
  if (r.includes(T.drawId)) {
11637
11645
  let b = vr({ event: i, drawDefinition: T })?.matchUps ?? [];
11638
11646
  if (b.some(({ score: L }) => _t({ score: L })) && !y) return D.push(T.drawId), !0;
@@ -11650,7 +11658,7 @@ function uf(e) {
11650
11658
  if (i.drawDefinitions = S, g && Ea({ event: i, extension: { name: Ei, value: g } }), Jl({ tournamentRecord: a }), v) {
11651
11659
  let T = {};
11652
11660
  for (let P of w) T[P] = U.drawDetails?.[P] ?? { published: !0 };
11653
- let b = jc({ statusObject: { drawDetails: T }, event: i });
11661
+ let b = Gc({ statusObject: { drawDetails: T }, event: i });
11654
11662
  if (b.error) return { error: b.error };
11655
11663
  }
11656
11664
  if (f.length) if (_p(qn)) {
@@ -11660,7 +11668,7 @@ function uf(e) {
11660
11668
  fn({ element: i, timeItem: { itemType: Ga, itemValue: b }, removePriorValues: !0 });
11661
11669
  } else ZV({ appliedPolicies: u, event: i, deletedDrawsDetail: p, auditData: s });
11662
11670
  if (m.length && _n({ tournamentId: a?.tournamentId, matchUpIds: m }), r.forEach((T) => Yk({ drawId: T })), n && v) {
11663
- let T = Gc({ ...e.eventDataParams, drawIdsToRemove: r, policyDefinitions: l, tournamentRecord: a, event: i });
11671
+ let T = $c({ ...e.eventDataParams, drawIdsToRemove: r, policyDefinitions: l, tournamentRecord: a, event: i });
11664
11672
  if (T.error) return { ...x, info: T.error };
11665
11673
  }
11666
11674
  return { ...x };
@@ -11673,7 +11681,7 @@ function ZV({ appliedPolicies: e, event: t, deletedDrawsDetail: r, auditData: i
11673
11681
  function aE({ autoPublish: e = !0, tournamentRecord: t, auditData: r, event: i, force: n }) {
11674
11682
  if (!t) return { error: J };
11675
11683
  if (!i) return { error: it };
11676
- let { flightProfile: a } = wt({ event: i });
11684
+ let { flightProfile: a } = Dt({ event: i });
11677
11685
  if (a) {
11678
11686
  let s = a.flights?.map(({ drawId: c }) => c).filter(Boolean), o = uf({ eventId: i.eventId, tournamentRecord: t, autoPublish: e, auditData: r, drawIds: s, event: i, force: n });
11679
11687
  return o.error ? o : tm({ event: i, name: Ei });
@@ -11805,12 +11813,12 @@ function $U({ event: e, orderedDrawIdsMap: t }) {
11805
11813
  if (ye(r).length !== r.length) return { error: z, info: "drawOrder values must be unique" };
11806
11814
  if (e.drawDefinitions?.length) {
11807
11815
  let n = (e.drawDefinitions || []).map(({ drawId: s }) => s), a = Object.keys(t);
11808
- if (a?.length && St(n, a).length !== n.length) return { error: z, info: "Missing drawIds" };
11816
+ if (a?.length && vt(n, a).length !== n.length) return { error: z, info: "Missing drawIds" };
11809
11817
  e.drawDefinitions.forEach((s) => {
11810
11818
  s.drawOrder = t[s.drawId];
11811
11819
  });
11812
11820
  }
11813
- let { flightProfile: i } = wt({ event: e });
11821
+ let { flightProfile: i } = Dt({ event: e });
11814
11822
  return i?.flights?.forEach((n) => {
11815
11823
  n.flightNumber = t[n.drawId];
11816
11824
  }), { ...x };
@@ -11818,14 +11826,14 @@ function $U({ event: e, orderedDrawIdsMap: t }) {
11818
11826
  function WU({ tournamentRecord: e, event: t }) {
11819
11827
  if (!e) return { error: J };
11820
11828
  if (!t) return { error: it };
11821
- let { flightProfile: r } = wt({ event: t }), i = r?.flights && Object.assign({}, ...r.flights.sort((n, a) => n.flightNumber - a.flightNumber).map((n, a) => ({ [n.drawId]: a + 1 }))) || t.drawDefinitions?.length && Object.assign({}, ...t.drawDefinitions.sort((n, a) => n.drawOrder - a.drawOrder).map((n, a) => ({ [n.drawId]: a + 1 }))) || void 0;
11829
+ let { flightProfile: r } = Dt({ event: t }), i = r?.flights && Object.assign({}, ...r.flights.sort((n, a) => n.flightNumber - a.flightNumber).map((n, a) => ({ [n.drawId]: a + 1 }))) || t.drawDefinitions?.length && Object.assign({}, ...t.drawDefinitions.sort((n, a) => n.drawOrder - a.drawOrder).map((n, a) => ({ [n.drawId]: a + 1 }))) || void 0;
11822
11830
  return i ? $U({ event: t, orderedDrawIdsMap: i }) : { ...x };
11823
11831
  }
11824
11832
  function lE({ autoPublish: e = !0, tournamentRecord: t, auditData: r, drawId: i, event: n, force: a }) {
11825
11833
  if (!t) return { error: J };
11826
11834
  if (!i) return { error: zi };
11827
11835
  if (!n) return { error: it };
11828
- let { flightProfile: s } = wt({ event: n });
11836
+ let { flightProfile: s } = Dt({ event: n });
11829
11837
  if (s && s.flights?.find((o) => o.drawId === i)) {
11830
11838
  let o = s.flights.filter((u) => u.drawId !== i), c = { name: Ei, value: { ...s, flights: o } };
11831
11839
  Ea({ event: n, extension: c });
@@ -11850,7 +11858,7 @@ function dE(e) {
11850
11858
  if (I.error) return I;
11851
11859
  m = I.participant.participantId;
11852
11860
  }
11853
- let { flightProfile: f } = wt({ event: o });
11861
+ let { flightProfile: f } = Dt({ event: o });
11854
11862
  if (a) {
11855
11863
  let g = f?.flights?.find(({ drawId: I }) => I === a.drawId);
11856
11864
  g && (g.drawEntries = g.drawEntries.map((I) => I.participantId === s ? { ...I, participantId: m } : I)), a.entries = a.entries.map((I) => I.participantId === s ? { ...I, participantId: m } : I);
@@ -11874,7 +11882,7 @@ function rd(e) {
11874
11882
  u.drawDefinitions || (u.drawDefinitions = []);
11875
11883
  let { drawId: l, drawName: d, entries: p } = c, { entries: m } = u, f = 0;
11876
11884
  if (n !== void 0 && n !== u.drawDefinitions.length) return { error: z, info: "drawDefintions count mismatch" };
11877
- let { flightProfile: h } = wt({ event: u }), g = t && h?.flights?.find((N) => N.flightNumber === t.flightNumber), I = h?.links?.find((N) => N?.target?.drawId === l)?.source?.drawId;
11885
+ let { flightProfile: h } = Dt({ event: u }), g = t && h?.flights?.find((N) => N.flightNumber === t.flightNumber), I = h?.links?.find((N) => N?.target?.drawId === l)?.source?.drawId;
11878
11886
  if (I && !u.drawDefinitions.find((N) => N.drawId === I)) return F({ result: { error: ne }, info: { sourceDrawId: I } });
11879
11887
  if (g && g.drawId !== c.drawId) return F({ result: { error: Ms }, info: { relevantFlight: g } });
11880
11888
  let y = p?.every(({ participantId: N, entryStatus: R }) => {
@@ -11928,17 +11936,17 @@ function pE(e) {
11928
11936
  let h = Object.values(f), g = h.map((I) => I?.participantId).filter(Boolean);
11929
11937
  if (g.length !== Yw(g).length) return { error: oD };
11930
11938
  for (let I of h) {
11931
- let y = kc({ ...I, provisionalPositioning: t, tournamentRecord: i, drawDefinition: n, seedingProfile: a, structureId: s, event: u });
11939
+ let y = xc({ ...I, provisionalPositioning: t, tournamentRecord: i, drawDefinition: n, seedingProfile: a, structureId: s, event: u });
11932
11940
  if (y?.error) return y;
11933
11941
  y?.success && l++;
11934
11942
  }
11935
- return l ? { ...x, modifications: l } : { error: vc };
11943
+ return l ? { ...x, modifications: l } : { error: wc };
11936
11944
  }
11937
11945
  function qU({ deleteExisting: e, event: t, flightProfile: r }) {
11938
11946
  let i = "attachFlightProfile";
11939
11947
  if (!r) return F({ result: { error: ce }, stack: i });
11940
11948
  if (!t) return F({ result: { error: it }, stack: i });
11941
- let { flightProfile: n } = wt({ event: t });
11949
+ let { flightProfile: n } = Dt({ event: t });
11942
11950
  return n && !e ? F({ result: { error: Bg }, stack: i }) : t.drawDefinitions?.length ? F({ result: { error: rD }, stack: i }) : (Ea({ event: t, extension: { name: Ei, value: r } }), { flightProfile: ie(r, !1, !0), ...x });
11943
11951
  }
11944
11952
  function t2({ tournamentRecord: e, scaleAttributes: t, participantIds: r }) {
@@ -11955,7 +11963,7 @@ function HU({ tournamentRecord: e, scaleAttributes: t, drawDefinition: r, entryS
11955
11963
  if (i && !Array.isArray(i)) return F({ result: { error: z }, info: es("entryStatus"), stack: "removeScaleValues" });
11956
11964
  let o = a.entries;
11957
11965
  if (n) {
11958
- let { flightProfile: u } = wt({ event: a }), l = u?.flights?.find((d) => d.drawId === n);
11966
+ let { flightProfile: u } = Dt({ event: a }), l = u?.flights?.find((d) => d.drawId === n);
11959
11967
  l ? o = l.drawEntries : o = r?.entries;
11960
11968
  }
11961
11969
  let c = (o || []).filter((u) => (!s || !u.entryStage || u.entryStage === s) && (!i || i.includes(u.entryStatus))).map(be);
@@ -11976,7 +11984,7 @@ function df({ removePriorValues: e, tournamentRecord: t, displaySettings: r, sta
11976
11984
  r.draws[s].scheduleDetails = c;
11977
11985
  }
11978
11986
  }
11979
- let a = jc({ statusObject: { displaySettings: r }, removePriorValues: e, status: i, event: n });
11987
+ let a = Gc({ statusObject: { displaySettings: r }, removePriorValues: e, status: i, event: n });
11980
11988
  return a.error ? a : { ...x };
11981
11989
  }
11982
11990
  function mE({ tournamentRecord: e, drawDefinition: t, entryStatuses: r, scaleName: i, drawId: n, event: a, stage: s }) {
@@ -12010,7 +12018,7 @@ function fE(e) {
12010
12018
  function hE(e) {
12011
12019
  let t = se(e, [{ tournamentRecord: !0, eventId: !0, event: !0 }, { eventUpdates: !0, _ofType: Or }]);
12012
12020
  if (t.error) return t;
12013
- let { eventUpdates: r, event: i } = e, n = "modifyEvent", a = n2(e), s = a2({ enteredParticipants: a }), { enteredParticipantGenders: o, enteredParticipantTypes: c } = s, u = wt({ event: i })?.flightProfile?.flights, l = !i.drawDefinitions?.length && !u?.length, d = s2({ noFlightsNoDraws: l, enteredParticipantGenders: o, eventUpdates: r, stack: n });
12021
+ let { eventUpdates: r, event: i } = e, n = "modifyEvent", a = n2(e), s = a2({ enteredParticipants: a }), { enteredParticipantGenders: o, enteredParticipantTypes: c } = s, u = Dt({ event: i })?.flightProfile?.flights, l = !i.drawDefinitions?.length && !u?.length, d = s2({ noFlightsNoDraws: l, enteredParticipantGenders: o, eventUpdates: r, stack: n });
12014
12022
  if (d.error) return d;
12015
12023
  let p = o2({ enteredParticipantTypes: c, eventUpdates: r, stack: n });
12016
12024
  if (p.error) return p;
@@ -12082,9 +12090,9 @@ function pf({ qualifyingPositions: e, drawEntries: t = [], drawName: r, drawId:
12082
12090
  if (!r) return F({ result: { error: ce }, stack: s });
12083
12091
  if (t?.length) {
12084
12092
  let m = (n.entries ?? []).map(be), f = t.map(be);
12085
- if (St(f, m).length !== f.length) return F({ result: { error: z }, stack: s });
12093
+ if (vt(f, m).length !== f.length) return F({ result: { error: z }, stack: s });
12086
12094
  }
12087
- let o = wt({ event: n })?.flightProfile, c = o?.flights?.map(({ flightNumber: m }) => !isNaN(m) && pe(m))?.filter(Boolean) || [], u = Math.max(0, ...c) + 1, l = { drawId: i || Be(), flightNumber: u, drawEntries: t, drawName: r };
12095
+ let o = Dt({ event: n })?.flightProfile, c = o?.flights?.map(({ flightNumber: m }) => !isNaN(m) && pe(m))?.filter(Boolean) || [], u = Math.max(0, ...c) + 1, l = { drawId: i || Be(), flightNumber: u, drawEntries: t, drawName: r };
12088
12096
  if (a && (l.stage = a), e && (l.qualifyingPositions = e), (o?.flights || []).find(({ drawId: m }) => m === l.drawId)) return F({ result: { error: aT }, stack: s });
12089
12097
  let d = (o?.flights || []).concat(l), p = { name: Ei, value: { ...o || {}, flights: d } };
12090
12098
  return Ea({ event: n, extension: p });
@@ -12095,7 +12103,7 @@ var c2 = "splitLevelBased", IE = "splitWaterfall", yE = "splitShuttle", u2 = { S
12095
12103
  function l2(e) {
12096
12104
  let { drawNameRoot: t = "Flight", attachFlightProfile: r, tournamentRecord: i, scaleAttributes: n, scaleSortMethod: a, deleteExisting: s, sortDescending: o, drawNames: c = [], flightsCount: u, splitMethod: l, uuids: d = [], event: p, stage: m } = e;
12097
12105
  if (!p) return { error: it };
12098
- let f = p.entries ?? [], { flightProfile: h } = wt({ event: p });
12106
+ let f = p.entries ?? [], { flightProfile: h } = Dt({ event: p });
12099
12107
  if (h && r && !s) return { error: Bg };
12100
12108
  let g = e.scaledEntries ?? vo({ tournamentRecord: i, scaleAttributes: n, scaleSortMethod: a, sortDescending: o, event: p, stage: m }).scaledEntries, I = g.map(be), y = Ur(f.filter(({ participantId: P }) => !I.includes(P)).filter((P) => (!m || !P.entryStage || P.entryStage === m) && (!P.entryStatus || hs.includes(P.entryStatus)))), U = g.concat(...y), w = U.length, v = Math.ceil(w / u), D = Wt(U, v);
12101
12109
  l === IE ? D = lh(U, u) : l === yE && (D = lh(U, u, !0));
@@ -12257,7 +12265,7 @@ function zU(e) {
12257
12265
  if (!e) return { error: ce };
12258
12266
  let t = se(e, [{ dates: !1, [ir]: (s) => Array.isArray(s) && s.every(xr) }, { uuids: !1, [ir]: (s) => Array.isArray(s) && s.every(ct) }, { startTime: !1, endTime: !1, [ir]: Kg }, { idPrefix: !1, namePrefix: !1, [ir]: ct }, { count: !0, [ir]: ft }]);
12259
12267
  if (t.error) return t;
12260
- let { startDate: r, endDate: i } = e.tournamentRecord ?? {}, n = e.dates || r && i && Yo(r, i) || [], a = te(1, e.count + 1).map((s) => ae({ courtId: e.uuids?.pop() ?? (e.idPrefix && `${e.idPrefix}-${s}`) ?? Be(), courtName: e.courtNames?.pop() ?? (e.namePrefix && `${e.namePrefix} ${s}`), dateAvailability: n.map((o) => ({ startTime: e.startTime ?? "08:00", endTime: e.endTime ?? "20:00", date: o })) }));
12268
+ let { startDate: r, endDate: i } = e.tournamentRecord ?? {}, n = e.dates || r && i && Ko(r, i) || [], a = te(1, e.count + 1).map((s) => ae({ courtId: e.uuids?.pop() ?? (e.idPrefix && `${e.idPrefix}-${s}`) ?? Be(), courtName: e.courtNames?.pop() ?? (e.namePrefix && `${e.namePrefix} ${s}`), dateAvailability: n.map((o) => ({ startTime: e.startTime ?? "08:00", endTime: e.endTime ?? "20:00", date: o })) }));
12261
12269
  return { ...x, courts: a };
12262
12270
  }
12263
12271
  var wE = {};
@@ -12266,7 +12274,7 @@ function id({ court: e, date: t }) {
12266
12274
  let r = t && e.dateAvailability.find((n) => Mn(n.date, t)), i = e.dateAvailability.find((n) => !n.date);
12267
12275
  return r || i;
12268
12276
  }
12269
- function $c(e) {
12277
+ function Wc(e) {
12270
12278
  let t = se(e, [{ courtDate: !0, _ofType: Or }]);
12271
12279
  if (t.error) return t;
12272
12280
  let { includeBookingTypes: r = [], courtDate: i } = e, n = [], a = Nt(i.startTime);
@@ -12279,7 +12287,7 @@ function $c(e) {
12279
12287
  }
12280
12288
  function I2({ averageMatchUpMinutes: e, includeBookingTypes: t, periodStartTime: r, periodEndTime: i }) {
12281
12289
  let n = (s) => {
12282
- let { timeSlots: o } = $c({ includeBookingTypes: t, courtDate: s });
12290
+ let { timeSlots: o } = Wc({ includeBookingTypes: t, courtDate: s });
12283
12291
  return !!o?.filter(a)?.length;
12284
12292
  };
12285
12293
  function a(s) {
@@ -12313,7 +12321,7 @@ function mf(e) {
12313
12321
  });
12314
12322
  c.sort((p, m) => ke(p.startTime) - ke(m.startTime));
12315
12323
  let l = () => u.map((p) => {
12316
- let m = p.dateAvailability, { timeSlots: f = [] } = $c({ courtDate: m });
12324
+ let m = p.dateAvailability, { timeSlots: f = [] } = Wc({ courtDate: m });
12317
12325
  return { courtName: p.courtName, courtId: p.courtId, timeSlots: f };
12318
12326
  }).flat(), d = [];
12319
12327
  for (let p of c) {
@@ -12340,7 +12348,7 @@ function TE(e) {
12340
12348
  let { startTime: t = "8:00", endTime: r = "20:30", count: i = 10, date: n } = e ?? {};
12341
12349
  return te(0, i).map(() => ({ dateAvailability: [{ date: n, startTime: t, endTime: r }] }));
12342
12350
  }
12343
- function lc({ scheduleDate: e, startTime: t, endTime: r, courts: i }) {
12351
+ function dc({ scheduleDate: e, startTime: t, endTime: r, courts: i }) {
12344
12352
  let n = t && "startTime" || r && "endTime" || void 0;
12345
12353
  return i.reduce((a, s) => {
12346
12354
  let o = id({ date: e, court: s }), c = n && (o?.[n] || s[n]);
@@ -12348,13 +12356,13 @@ function lc({ scheduleDate: e, startTime: t, endTime: r, courts: i }) {
12348
12356
  }, void 0);
12349
12357
  }
12350
12358
  function y2({ averageMinutes: e, startTime: t, endTime: r, courts: i, date: n }) {
12351
- t = t || lc({ courts: i, scheduleDate: n, startTime: !0 }), r = r || lc({ courts: i, scheduleDate: n, endTime: !0 });
12359
+ t = t || dc({ courts: i, scheduleDate: n, startTime: !0 }), r = r || dc({ courts: i, scheduleDate: n, endTime: !0 });
12352
12360
  let a;
12353
12361
  if (t && r) {
12354
12362
  let s = Nt(t), o = Nt(r);
12355
12363
  for (let c of i || []) {
12356
12364
  if (!Array.isArray(c.dateAvailability)) continue;
12357
- let u = id({ court: c, date: n }), { timeSlots: l } = $c({ courtDate: u });
12365
+ let u = id({ court: c, date: n }), { timeSlots: l } = Wc({ courtDate: u });
12358
12366
  l?.forEach((d) => {
12359
12367
  let p = Nt(d.startTime), m = Nt(d.endTime);
12360
12368
  if (p > o || p < s || m < s) return !1;
@@ -12391,10 +12399,10 @@ function YU(e) {
12391
12399
  return T.concat(...P);
12392
12400
  }, []).flat(), timingProfile: S, totalMatchUps: g };
12393
12401
  }
12394
- var PE = { getCourtsAvailableAtPeriodStart: DE, generateTimeSlots: $c, getScheduleTimes: YU, courtGenerator: TE }, U2 = PE, uu = {};
12402
+ var PE = { getCourtsAvailableAtPeriodStart: DE, generateTimeSlots: Wc, getScheduleTimes: YU, courtGenerator: TE }, U2 = PE, uu = {};
12395
12403
  Pe(uu, { isValid: () => qr, isValidMatchUpFormat: () => qr, parse: () => fr, stringify: () => Gp });
12396
12404
  var bE = {};
12397
- Pe(bE, { allCompetitionMatchUps: () => Hi, allDrawMatchUps: () => vr, allEventMatchUps: () => Vn, allTournamentMatchUps: () => Qt, analyzeMatchUp: () => Gu, applyLineUps: () => KE, assignMatchUpSideParticipant: () => NE, assignTieMatchUpParticipantId: () => lp, bulkMatchUpStatusUpdate: () => qE, calculateWinCriteria: () => Do, checkInParticipant: () => XU, checkMatchUpIsComplete: () => $a, checkOutParticipant: () => KU, competitionScheduleMatchUps: () => ed, disableTieAutoCalc: () => GE, drawMatchUps: () => CU, enableTieAutoCalc: () => BE, eventMatchUps: () => sf, filterMatchUps: () => Wn, findMatchUp: () => IU, getAllDrawMatchUps: () => Rt, getAllStructureMatchUps: () => _e, getCheckedInParticipantIds: () => lo, getCompetitionMatchUps: () => ju, getEventMatchUpFormatTiming: () => DU, getHomeParticipantId: () => MU, getMatchUpCompetitiveProfile: () => Pl, getMatchUpContextIds: () => NU, getMatchUpDailyLimits: () => cf, getMatchUpDailyLimitsUpdate: () => TU, getMatchUpDependencies: () => Fi, getMatchUpFormat: () => RU, getMatchUpFormatTiming: () => bl, getMatchUpFormatTimingUpdate: () => wU, getMatchUpScheduleDetails: () => ym, getMatchUpType: () => Um, getMatchUpsStats: () => EU, getModifiedMatchUpFormatTiming: () => af, getParticipantResults: () => Gl, getPredictiveAccuracy: () => bU, getRoundMatchUps: () => Dr, getRounds: () => AU, isValidMatchUpFormat: () => qr, matchUpActions: () => xm, mutate: () => ME, participantScheduledMatchUps: () => PU, query: () => LR, removeDelegatedOutcome: () => VE, removeMatchUpSideParticipant: () => ZU, removeTieMatchUpParticipantId: () => EE, replaceTieMatchUpParticipantId: () => JU, resetAdHocMatchUps: () => zE, resetMatchUpLineUps: () => sS, resetScorecard: () => cS, resetTieFormat: () => oS, setDelegatedOutcome: () => HE, setMatchUpFormat: () => $E, setMatchUpStatus: () => nd, setOrderOfFinish: () => YE, substituteParticipant: () => jE, tallyParticipantResults: () => Lc, toggleParticipantCheckInState: () => hf, tournamentMatchUps: () => of, updateTieMatchUpScore: () => oa, validMatchUp: () => mm, validMatchUps: () => yi });
12405
+ Pe(bE, { allCompetitionMatchUps: () => Hi, allDrawMatchUps: () => vr, allEventMatchUps: () => Vn, allTournamentMatchUps: () => Qt, analyzeMatchUp: () => Gu, applyLineUps: () => KE, assignMatchUpSideParticipant: () => NE, assignTieMatchUpParticipantId: () => lp, bulkMatchUpStatusUpdate: () => qE, calculateWinCriteria: () => Do, checkInParticipant: () => XU, checkMatchUpIsComplete: () => $a, checkOutParticipant: () => KU, competitionScheduleMatchUps: () => ed, disableTieAutoCalc: () => GE, drawMatchUps: () => CU, enableTieAutoCalc: () => BE, eventMatchUps: () => sf, filterMatchUps: () => Wn, findMatchUp: () => IU, getAllDrawMatchUps: () => Rt, getAllStructureMatchUps: () => _e, getCheckedInParticipantIds: () => lo, getCompetitionMatchUps: () => ju, getEventMatchUpFormatTiming: () => DU, getHomeParticipantId: () => MU, getMatchUpCompetitiveProfile: () => Pl, getMatchUpContextIds: () => NU, getMatchUpDailyLimits: () => cf, getMatchUpDailyLimitsUpdate: () => TU, getMatchUpDependencies: () => Fi, getMatchUpFormat: () => RU, getMatchUpFormatTiming: () => bl, getMatchUpFormatTimingUpdate: () => wU, getMatchUpScheduleDetails: () => ym, getMatchUpType: () => Um, getMatchUpsStats: () => EU, getModifiedMatchUpFormatTiming: () => af, getParticipantResults: () => Gl, getPredictiveAccuracy: () => bU, getRoundMatchUps: () => Dr, getRounds: () => AU, isValidMatchUpFormat: () => qr, matchUpActions: () => xm, mutate: () => ME, participantScheduledMatchUps: () => PU, query: () => LR, removeDelegatedOutcome: () => VE, removeMatchUpSideParticipant: () => ZU, removeTieMatchUpParticipantId: () => EE, replaceTieMatchUpParticipantId: () => JU, resetAdHocMatchUps: () => zE, resetMatchUpLineUps: () => sS, resetScorecard: () => cS, resetTieFormat: () => oS, setDelegatedOutcome: () => HE, setMatchUpFormat: () => $E, setMatchUpStatus: () => nd, setOrderOfFinish: () => YE, substituteParticipant: () => jE, tallyParticipantResults: () => _c, toggleParticipantCheckInState: () => hf, tournamentMatchUps: () => of, updateTieMatchUpScore: () => oa, validMatchUp: () => mm, validMatchUps: () => yi });
12398
12406
  var ME = {};
12399
12407
  Pe(ME, { applyLineUps: () => KE, assignMatchUpSideParticipant: () => NE, assignTieMatchUpParticipantId: () => lp, bulkMatchUpStatusUpdate: () => qE, checkInParticipant: () => XU, checkOutParticipant: () => KU, disableTieAutoCalc: () => GE, enableTieAutoCalc: () => BE, findMatchUp: () => IU, removeDelegatedOutcome: () => VE, removeMatchUpSideParticipant: () => ZU, removeTieMatchUpParticipantId: () => EE, replaceTieMatchUpParticipantId: () => JU, resetAdHocMatchUps: () => zE, resetMatchUpLineUps: () => sS, resetScorecard: () => cS, resetTieFormat: () => oS, setDelegatedOutcome: () => HE, setMatchUpFormat: () => $E, setMatchUpStatus: () => nd, setOrderOfFinish: () => YE, substituteParticipant: () => jE, toggleParticipantCheckInState: () => hf, updateTieMatchUpScore: () => oa });
12400
12408
  function NE({ tournamentRecord: e, drawDefinition: t, participantId: r, sideNumber: i, matchUpId: n, event: a }) {
@@ -12425,7 +12433,7 @@ function Xr({ removePriorValues: e, tournamentRecord: t, duplicateValues: r, dra
12425
12433
  function KU(e) {
12426
12434
  let t = [{ [Bt]: !0 }, { [hr]: !0 }, { [Cn]: !0 }, { [dn]: !0 }], r = se(e, t);
12427
12435
  if (r.error) return r;
12428
- let i = Bc(e, [{ [Tc]: Ln, attr: { [Xp]: !0 } }]);
12436
+ let i = Vc(e, [{ [Pc]: Ln, attr: { [Xp]: !0 } }]);
12429
12437
  if (i.error) return i;
12430
12438
  let { tournamentRecord: n, drawDefinition: a, participantId: s, matchUpId: o } = e, c = i?.matchUp?.matchUp, { matchUpStatus: u, score: l } = c ?? {};
12431
12439
  if (u && SI.includes(u) || u && Ft.includes(u) || _t({ score: l })) return { error: lD };
@@ -12444,7 +12452,7 @@ function KU(e) {
12444
12452
  function XU(e) {
12445
12453
  let t = [{ [Bt]: !0 }, { [hr]: !0 }, { [Cn]: !0 }, { [dn]: !0 }], r = se(e, t);
12446
12454
  if (r[bi]) return r;
12447
- let i = Bc(e, [{ [Tc]: Ln, attr: { [Xp]: !0 } }]);
12455
+ let i = Vc(e, [{ [Pc]: Ln, attr: { [Xp]: !0 } }]);
12448
12456
  if (i[bi]) return i;
12449
12457
  let { tournamentRecord: n, drawDefinition: a, participantId: s, matchUpId: o } = e, c = lo({ matchUp: i?.matchUp?.matchUp });
12450
12458
  if (c?.error) return c;
@@ -12458,7 +12466,7 @@ function hf(e) {
12458
12466
  if (t.error) return t;
12459
12467
  let r = e.tournamentId ?? e.activeTournamentId, i = e.tournamentRecord ?? (r && e.tournamentRecords?.[r]);
12460
12468
  if (!i) return { error: J };
12461
- let n = Bc(e, [{ [Tc]: Ln, attr: { [Xp]: !0 }, [bi]: pr }]).matchUp?.matchUp;
12469
+ let n = Vc(e, [{ [Pc]: Ln, attr: { [Xp]: !0 }, [bi]: pr }]).matchUp?.matchUp;
12462
12470
  if (!n) return { error: pr };
12463
12471
  let { checkedInParticipantIds: a = [] } = lo({ matchUp: n }), { participantId: s, matchUpId: o, drawDefinition: c } = e;
12464
12472
  return s && a.includes(s) ? KU({ tournamentRecord: i, drawDefinition: c, participantId: s, matchUpId: o, matchUp: n }) : XU({ tournamentRecord: i, drawDefinition: c, participantId: s, matchUpId: o, matchUp: n });
@@ -12487,7 +12495,7 @@ function JU(e) {
12487
12495
  let y = pt({ tournamentRecord: n, participantFilters: { participantIds: [i, a] } })?.participants ?? [];
12488
12496
  if (y.length !== 2) return F({ result: { error: xt }, stack: r });
12489
12497
  if (y[0].participantType !== y[1].participantType) return F({ result: { error: qi }, stack: r });
12490
- let { appliedPolicies: U } = xe({ tournamentRecord: n, drawDefinition: s, event: c }), w = e.policyDefinitions?.[Yt] ?? U?.[Yt] ?? Oc[Yt], v = y.find(({ participantId: O }) => O === a);
12498
+ let { appliedPolicies: U } = xe({ tournamentRecord: n, drawDefinition: s, event: c }), w = e.policyDefinitions?.[Yt] ?? U?.[Yt] ?? kc[Yt], v = y.find(({ participantId: O }) => O === a);
12491
12499
  if ((e.enforceGender ?? w?.participants?.enforceGender) !== !1 && rn(l?.gender) && lr(l?.gender) !== lr(v?.person?.sex)) return { error: Xs, info: "Gender mismatch" };
12492
12500
  let D = w?.processCodes?.substitution;
12493
12501
  Wl({ tournamentId: n.tournamentId, eventId: c.eventId, inContextDualMatchUp: u, drawDefinition: s, dualMatchUp: m });
@@ -12553,7 +12561,7 @@ function S2({ individualParticipantIds: e, groupingParticipantId: t, tournamentR
12553
12561
  let i = (r.events || []).filter((a) => a?.eventType === Ot && a?.entries?.some((s) => s.participantId === t)), n = (a) => !e.includes(a.participantId);
12554
12562
  for (let a of i) {
12555
12563
  a.entries = (a.entries || []).filter(n);
12556
- let { flightProfile: s } = wt({ event: a });
12564
+ let { flightProfile: s } = Dt({ event: a });
12557
12565
  s?.flights?.forEach((o) => {
12558
12566
  o.drawEntries = (o.drawEntries || []).filter(n);
12559
12567
  }), a?.drawDefinitions?.forEach((o) => {
@@ -12628,7 +12636,7 @@ function lp(e) {
12628
12636
  i = i ?? (e.sideNumber ? c?.sides?.find((_) => _.sideNumber === e.sideNumber)?.participantId : void 0);
12629
12637
  let I = pt({ participantFilters: { participantIds: [s] }, tournamentRecord: n })?.participants?.[0];
12630
12638
  if (!I) return F({ result: { error: Tt }, stack: r });
12631
- let { appliedPolicies: y } = xe({ tournamentRecord: n, drawDefinition: a, event: o }), U = e.policyDefinitions?.[Yt] ?? y?.[Yt] ?? Oc[Yt];
12639
+ let { appliedPolicies: y } = xe({ tournamentRecord: n, drawDefinition: a, event: o }), U = e.policyDefinitions?.[Yt] ?? y?.[Yt] ?? kc[Yt];
12632
12640
  if ((e.enforceGender ?? U?.participants?.enforceGender) !== !1 && rn(u?.gender) && lr(u?.gender) !== lr(I.person?.sex)) return { error: Xs, info: "Gender mismatch" };
12633
12641
  let { individualParticipantIds: w, participantType: v } = I;
12634
12642
  if (Pt(Ye)(f) && v !== Me) return { error: qi };
@@ -12636,7 +12644,7 @@ function lp(e) {
12636
12644
  if (!S) return { error: Lg };
12637
12645
  if (i || (i = S.participantId), !i) return { error: Tt };
12638
12646
  let T = l?.find((_) => _.participantId === S?.participantId)?.drawPosition, b = h?.sides?.find((_) => _.participantId === i)?.sideNumber, P = u?.sides?.find((_) => T && _.drawPosition === T)?.sideNumber, M = b ?? P ?? e.sideNumber;
12639
- if (!g) return { error: yc };
12647
+ if (!g) return { error: Uc };
12640
12648
  if (!g.collectionDefinitions?.find((_) => _.collectionId === m)) return { error: DD };
12641
12649
  Wl({ tournamentId: n.tournamentId, eventId: o.eventId, inContextDualMatchUp: c, drawDefinition: a, dualMatchUp: h });
12642
12650
  let N = h?.sides?.find((_) => _.sideNumber === M), R = u?.sides?.find((_) => _.sideNumber === M), A = (N?.lineUp ?? Ja({ participantId: i, drawDefinition: a })?.lineUp)?.filter((_) => _.collectionAssignments?.find((B) => B.collectionPosition === d && B.collectionId === m && !B.previousParticipantId))?.map((_) => _?.participantId), E = A?.length > 1 && A || (v === we ? I.individualParticipantIds : [s]), C = RE({ collectionPosition: d, teamParticipantId: i, dualMatchUpSide: N, drawDefinition: a, participantIds: E, collectionId: m });
@@ -12693,7 +12701,7 @@ function EE(e) {
12693
12701
  if (!i) return F({ result: { error: xt }, stack: a });
12694
12702
  let s = QU(e);
12695
12703
  if (s.error) return s;
12696
- let { appliedPolicies: o } = xe({ tournamentRecord: t, drawDefinition: r, event: n }), c = (e.policyDefinitions?.[Yt] ?? o?.[Yt] ?? Oc[Yt])?.processCodes?.substitution, { inContextDualMatchUp: u, inContextTieMatchUp: l, relevantAssignments: d, collectionPosition: p, teamParticipants: m, collectionId: f, matchUpType: h, dualMatchUp: g, tieMatchUp: I, tieFormat: y } = s;
12704
+ let { appliedPolicies: o } = xe({ tournamentRecord: t, drawDefinition: r, event: n }), c = (e.policyDefinitions?.[Yt] ?? o?.[Yt] ?? kc[Yt])?.processCodes?.substitution, { inContextDualMatchUp: u, inContextTieMatchUp: l, relevantAssignments: d, collectionPosition: p, teamParticipants: m, collectionId: f, matchUpType: h, dualMatchUp: g, tieMatchUp: I, tieFormat: y } = s;
12697
12705
  if (!g) return F({ result: { error: Mr }, stack: a });
12698
12706
  let U = l?.sides?.find((M) => M.participant?.participantId === i || M.participant?.individualParticipantIds?.includes(i));
12699
12707
  if (!U) return F({ result: { error: Tt }, stack: a });
@@ -12775,12 +12783,12 @@ function b2({ inContextDrawMatchUps: e, positionAssignments: t, sourceMatchUpSta
12775
12783
  }
12776
12784
  u.drawPositions = (u.drawPositions || []).map((m) => m === i ? void 0 : m).filter(Boolean);
12777
12785
  let p = t.filter(({ drawPosition: m }) => u.drawPositions?.includes(m)).filter((m) => m.bye).length;
12778
- return u.matchUpStatus = p && "BYE" || dr(u.matchUpStatus) && u.matchUpStatus || vt, dr(u.matchUpStatus) && (u.winningSide = void 0), u.matchUpStatusCodes && tM({ inContextDrawMatchUps: e, sourceMatchUpStatus: r, sourceMatchUpId: a, matchUpsMap: c, matchUp: u }), Ae({ tournamentId: n?.tournamentId, eventId: l?.eventId, context: `${d}-${i}`, drawDefinition: s, matchUp: u }), { ...x };
12786
+ return u.matchUpStatus = p && "BYE" || dr(u.matchUpStatus) && u.matchUpStatus || wt, dr(u.matchUpStatus) && (u.winningSide = void 0), u.matchUpStatusCodes && tM({ inContextDrawMatchUps: e, sourceMatchUpStatus: r, sourceMatchUpId: a, matchUpsMap: c, matchUp: u }), Ae({ tournamentId: n?.tournamentId, eventId: l?.eventId, context: `${d}-${i}`, drawDefinition: s, matchUp: u }), { ...x };
12779
12787
  }
12780
- function Wc(e) {
12788
+ function qc(e) {
12781
12789
  let { dualWinningSideChange: t, inContextDrawMatchUps: r, tournamentRecord: i, drawDefinition: n, matchUpStatus: a, matchUpsMap: s, dualMatchUp: o, targetData: c, matchUpId: u, structure: l, event: d } = e, p = !!e.matchUp.collectionId, m = Rr({ structure: l }), { drawPositions: f, winningSide: h } = c.matchUp || {};
12782
12790
  if (!m && !f) return { error: Xu };
12783
- let { targetLinks: { loserTargetLink: g, winnerTargetLink: I, byeTargetLink: y }, targetMatchUps: { loserMatchUp: U, winnerMatchUp: w, byeMatchUp: v } } = c, D = tn({ ...e, matchUpStatus: a || vt, removeWinningSide: !0 });
12791
+ let { targetLinks: { loserTargetLink: g, winnerTargetLink: I, byeTargetLink: y }, targetMatchUps: { loserMatchUp: U, winnerMatchUp: w, byeMatchUp: v } } = c, D = tn({ ...e, matchUpStatus: a || wt, removeWinningSide: !0 });
12784
12792
  if (D.error) return D;
12785
12793
  let S;
12786
12794
  if (p) {
@@ -12852,7 +12860,7 @@ function N2(e) {
12852
12860
  }
12853
12861
  function R2({ tournamentRecord: e, drawDefinition: t, structure: r, matchUp: i }) {
12854
12862
  let n = "attemptToSetMatchUpStatusBYE";
12855
- if (i?.winningSide) return F({ result: { error: Ic }, context: { matchUpStatus: "BYE" }, stack: n });
12863
+ if (i?.winningSide) return F({ result: { error: yc }, context: { matchUpStatus: "BYE" }, stack: n });
12856
12864
  let { positionAssignments: a } = Lt({ structure: r }), s = a?.filter((o) => o.bye).map((o) => o.drawPosition);
12857
12865
  return i.drawPositions?.some((o) => s?.includes(o)) ? (i.matchUpStatus = "BYE", i.matchUpStatusCodes = [], Ae({ tournamentId: e?.tournamentId, context: n, drawDefinition: t, matchUp: i }), { ...x }) : F({ result: { error: wD }, info: "matchUp does not include BYE", stack: n });
12858
12866
  }
@@ -12882,7 +12890,7 @@ function Hv(e) {
12882
12890
  let { inContextDrawMatchUps: t, tournamentRecord: r, drawDefinition: i, sourceMatchUp: n, targetMatchUp: a, matchUpsMap: s } = e, o = i.structures.find(({ structureId: V }) => V === a.structureId), c = e.matchUpStatus === kt ? kt : dt, u = e.matchUpStatus === kt ? ze : nt, l = "conditionallyAdvanceDrawPosition", d = s.drawMatchUps.find((V) => V.matchUpId === a.matchUpId);
12883
12891
  if (!d) return { error: Mr };
12884
12892
  let p = n?.drawPositions || [], m = d.drawPositions?.filter(Boolean), f = n?.structureId === a.structureId;
12885
- if (f && wr(p, m) && (m = m.filter((V) => !p.includes(V))), f && m.length > 1) return F({ result: { error: Ho }, stack: l });
12893
+ if (f && wr(p, m) && (m = m.filter((V) => !p.includes(V))), f && m.length > 1) return F({ result: { error: zo }, stack: l });
12886
12894
  let { pairedPreviousMatchUpIsDoubleExit: h, pairedPreviousMatchUp: g } = Zb(e), I = Tr({ matchUpId: a.matchUpId, inContextDrawMatchUps: t, drawDefinition: i }), { targetMatchUps: y, targetLinks: U } = I, { loserTargetDrawPosition: w, winnerMatchUp: v, loserMatchUp: D } = y;
12887
12895
  if (D) {
12888
12896
  let { loserTargetLink: V } = U, H = CE({ loserTargetDrawPosition: w, loserMatchUp: D, tournamentRecord: r, loserTargetLink: V, drawDefinition: i, matchUpsMap: s });
@@ -12933,11 +12941,11 @@ function pd(e) {
12933
12941
  return e === dt ? nt : e === kt ? ze : e;
12934
12942
  }
12935
12943
  function E2(e) {
12936
- let { tournamentRecord: t, drawDefinition: r, matchUpStatus: i, structure: n, matchUp: a } = e, s = !!(a.tieMatchUps && !a.rondPosition && e.inContextDrawMatchUps.find((I) => I.matchUpId === a.matchUpId).containerStructureId), o = "attemptToSetMatchUpStatus", c = i === "BYE", u = a.winningSide, l = [dt, kt].includes(i), d = Rl({ matchUpStatus: i }), p = Fh({ matchUpStatus: i }), m = !d && !p, f = e.matchUpTieId || u && d && !l, h = u && l, g = () => tn({ ...e, removeScore: [mn, nt].includes(i), matchUpStatus: i || vt });
12937
- return m && { error: gh } || f && Cd(e) || h && A2(e) || u && Wc(e) || p && g() || c && R2({ tournamentRecord: t, drawDefinition: r, structure: n, matchUp: a }) || !d && { error: gh } || l && C2(e) || s && Cd(e) || e.propagateExitStatus && Cd(e) || F({ result: { error: Ic, info: "matchUpStatus: " + i }, stack: o });
12944
+ let { tournamentRecord: t, drawDefinition: r, matchUpStatus: i, structure: n, matchUp: a } = e, s = !!(a.tieMatchUps && !a.rondPosition && e.inContextDrawMatchUps.find((I) => I.matchUpId === a.matchUpId).containerStructureId), o = "attemptToSetMatchUpStatus", c = i === "BYE", u = a.winningSide, l = [dt, kt].includes(i), d = Rl({ matchUpStatus: i }), p = Fh({ matchUpStatus: i }), m = !d && !p, f = e.matchUpTieId || u && d && !l, h = u && l, g = () => tn({ ...e, removeScore: [mn, nt].includes(i), matchUpStatus: i || wt });
12945
+ return m && { error: gh } || f && Cd(e) || h && A2(e) || u && qc(e) || p && g() || c && R2({ tournamentRecord: t, drawDefinition: r, structure: n, matchUp: a }) || !d && { error: gh } || l && C2(e) || s && Cd(e) || e.propagateExitStatus && Cd(e) || F({ result: { error: yc, info: "matchUpStatus: " + i }, stack: o });
12938
12946
  }
12939
12947
  function A2(e) {
12940
- let t = Wc(e);
12948
+ let t = qc(e);
12941
12949
  return t.error ? t : lu(e);
12942
12950
  }
12943
12951
  function C2(e) {
@@ -12947,7 +12955,7 @@ function C2(e) {
12947
12955
  function Cd(e) {
12948
12956
  let t = "scoreModification";
12949
12957
  if (e.isCollectionMatchUp && e.dualMatchUp?.winningSide && !e.projectedWinningSide) {
12950
- let n = Wc(e);
12958
+ let n = qc(e);
12951
12959
  if (n.error) return F({ result: n, stack: t });
12952
12960
  }
12953
12961
  let r = !!e.matchUp.collectionId, i = tn({ ...e });
@@ -12962,8 +12970,8 @@ function O2({ drawDefinition: e, structure: t, matchUp: r }) {
12962
12970
  let { drawPositions: i } = r, { positionAssignments: n } = Ke({ drawDefinition: e, structure: t }), a = n?.filter(({ drawPosition: c }) => i?.includes(c))?.map((c) => {
12963
12971
  let { extension: u } = De({ element: c, name: Jn });
12964
12972
  return u?.value?.groupOrder;
12965
- }), { containerStructures: s } = Rc({ drawDefinition: e }), o = s[t.structureId];
12966
- return { structureIds: Ec({ drawDefinition: e, structureId: o })?.links?.source?.filter((c) => wr(a, c.source?.finishingPositions || [])).map((c) => c.source.structureId) };
12973
+ }), { containerStructures: s } = Ec({ drawDefinition: e }), o = s[t.structureId];
12974
+ return { structureIds: Ac({ drawDefinition: e, structureId: o })?.links?.source?.filter((c) => wr(a, c.source?.finishingPositions || [])).map((c) => c.source.structureId) };
12967
12975
  }
12968
12976
  function OE({ drawDefinition: e, structure: t, matchUp: r }) {
12969
12977
  let i = [];
@@ -12977,7 +12985,7 @@ function k2(e) {
12977
12985
  let t, { inContextDrawMatchUps: r, inContextMatchUp: i, drawDefinition: n, winningSide: a } = e, s = e.targetData.targetLinks?.winnerTargetLink;
12978
12986
  if (s.target.feedProfile === wi) {
12979
12987
  let o = i.sides.find(({ sideNumber: u }) => u !== a).participantId, c = r.find((u) => u.structureId === s.target.structureId && u.roundNumber === s.target.roundNumber && u.sides.some(({ participantId: l }) => l === o));
12980
- if (c?.matchUpStatus === vt) {
12988
+ if (c?.matchUpStatus === wt) {
12981
12989
  let u = Tr({ matchUpId: c.matchUpId, inContextDrawMatchUps: r, drawDefinition: n });
12982
12990
  if (!rs({ inContextDrawMatchUps: r, drawDefinition: n, targetData: u })) {
12983
12991
  let { structure: l } = me({ structureId: c.structureId, drawDefinition: n }), d = Ke({ structure: l }).positionAssignments;
@@ -12999,7 +13007,7 @@ function x2(e) {
12999
13007
  let t, { inContextDrawMatchUps: r, inContextMatchUp: i, drawDefinition: n, winningSide: a } = e, s = e.targetData.targetLinks?.winnerTargetLink;
13000
13008
  if (s.target.feedProfile === wi) {
13001
13009
  let o = i.sides.find(({ sideNumber: l }) => l === a)?.participantId, c = r.filter((l) => l.structureId === s.target.structureId && l.roundNumber === s.target.roundNumber && l.sides.some(({ participantId: d, qualifier: p }) => p && !d)), u = Br(c);
13002
- if (u?.matchUpStatus === vt) {
13010
+ if (u?.matchUpStatus === wt) {
13003
13011
  let l = Tr({ matchUpId: u.matchUpId, inContextDrawMatchUps: r, drawDefinition: n });
13004
13012
  if (!rs({ inContextDrawMatchUps: r, drawDefinition: n, targetData: l })) {
13005
13013
  let d = u.sides.find((f) => f.qualifier && !f.participantId)?.drawPosition, { structure: p } = me({ structureId: u.structureId, drawDefinition: n });
@@ -13024,7 +13032,7 @@ function F2(e) {
13024
13032
  if (l.winningSide && l.winningSide !== c) {
13025
13033
  let { connectedStructureIds: f } = OE({ drawDefinition: s, structure: u, matchUp: l });
13026
13034
  f.length && (console.log({ connectedStructureIds: f }), r = !0);
13027
- let h = Wc(e);
13035
+ let h = qc(e);
13028
13036
  if (h.error) return h;
13029
13037
  }
13030
13038
  let d = YM(e);
@@ -13063,7 +13071,7 @@ function zv(e) {
13063
13071
  $r({ method: u, structureName: o?.structureName, iteration: c });
13064
13072
  let l = Tr({ matchUpId: a.matchUpId, inContextDrawMatchUps: t, drawDefinition: i }), { targetMatchUps: { winnerMatchUp: d } } = l, p = s?.drawMatchUps.find((w) => w.matchUpId === a.matchUpId), m = [], f, h, g;
13065
13073
  if (a.feedRound) g = d?.drawPositions?.filter(Boolean)?.find((w) => a.drawPositions.includes(w));
13066
- else if (!n) g = St(a?.drawPositions || [], d?.drawPositions || [])?.[0];
13074
+ else if (!n) g = vt(a?.drawPositions || [], d?.drawPositions || [])?.[0];
13067
13075
  else if (h = eM({ structureId: o.structureId, matchUp: n, matchUpsMap: s })?.pairedPreviousMatchUp, f = [dt, kt].includes(h?.matchUpStatus), m = h?.drawPositions?.filter(Boolean) || [], [...Ft, "BYE"].includes(h?.matchUpStatus) || h?.winningSide) {
13068
13076
  let w = n.drawPositions || [], v = a.drawPositions?.filter(Boolean);
13069
13077
  wr(w, v) && (v = v?.filter((D) => !w.includes(D))), g = w.concat(m).find((D) => v?.includes(D));
@@ -13078,13 +13086,13 @@ function zv(e) {
13078
13086
  return I = tn({ ...e, matchUpId: a.matchUpId, matchUp: p, removeWinningSide: !0, matchUpStatusCodes: [], matchUpStatus: y, removeScore: U, score: { scoreStringSide1: "", scoreStringSide2: "", sets: void 0 } }), I.error ? F({ result: I, stack: u }) : { ...x };
13079
13087
  }
13080
13088
  function L2({ pairedPreviousDoubleExit: e, noContextTargetMatchUp: t }) {
13081
- return t.matchUpStatus === "BYE" ? "BYE" : e ? [kt, ze].includes(t?.matchUpStatus) ? ze : nt : vt;
13089
+ return t.matchUpStatus === "BYE" ? "BYE" : e ? [kt, ze].includes(t?.matchUpStatus) ? ze : nt : wt;
13082
13090
  }
13083
13091
  function _2(e) {
13084
13092
  let t, { inContextDrawMatchUps: r, inContextMatchUp: i, drawDefinition: n } = e, a = e.targetData.targetLinks?.winnerTargetLink;
13085
13093
  if (a.target.feedProfile === wi) {
13086
13094
  let s = i.sides?.find(({ sideNumber: c }) => c === i.winningSide)?.participantId, o = r.find((c) => c.structureId === a.target.structureId && c.roundNumber === a.target.roundNumber && c.sides?.some(({ participantId: u }) => u === s));
13087
- if (o && o.matchUpStatus === vt) {
13095
+ if (o && o.matchUpStatus === wt) {
13088
13096
  let c = Tr({ matchUpId: o.matchUpId, inContextDrawMatchUps: r, drawDefinition: n });
13089
13097
  if (!rs({ inContextDrawMatchUps: r, drawDefinition: n, targetData: c })) {
13090
13098
  let { structure: u } = me({ structureId: o.structureId, drawDefinition: n }), l = Ke({ structure: u }).positionAssignments;
@@ -13112,7 +13120,7 @@ function B2(e) {
13112
13120
  if (w?._disableAutoCalc && v !== !1) return Ey({ ...e, removeWinningSide: l });
13113
13121
  let { connectedStructureIds: D } = OE({ drawDefinition: U, structure: y, matchUp: t });
13114
13122
  D.length && (console.log({ connectedStructureIds: D }), I = !0), Object.assign(e, { removeScore: g });
13115
- let S = Wc(e);
13123
+ let S = qc(e);
13116
13124
  if (S.error) return S;
13117
13125
  if (e.removingQualifier && e.appliedPolicies?.[Nu]?.autoRemoveQualifiers) {
13118
13126
  let T = _2(e);
@@ -13121,13 +13129,13 @@ function B2(e) {
13121
13129
  return { ...x, connectedStructures: I };
13122
13130
  };
13123
13131
  if (l && n && e.isCollectionMatchUp) return Yv(e);
13124
- let p = [mn, Lr].includes(r) && e.dualWinningSideChange, m = r && r !== vt, f = e.propagateExitStatus && dr(r), h = (n || p || f) && F2(e) || o && d(u) || m && E2(e) || l && d(u) || t && Yv({ ...e, removeScore: !0 }) || { ...x };
13132
+ let p = [mn, Lr].includes(r) && e.dualWinningSideChange, m = r && r !== wt, f = e.propagateExitStatus && dr(r), h = (n || p || f) && F2(e) || o && d(u) || m && E2(e) || l && d(u) || t && Yv({ ...e, removeScore: !0 }) || { ...x };
13125
13133
  return F({ result: h, stack: a });
13126
13134
  }
13127
13135
  function Yv(e) {
13128
13136
  let t = "ndd:scoreModification";
13129
13137
  if (e.isCollectionMatchUp && e.dualMatchUp?.winningSide && !e.projectedWinningSide && !e.autoCalcDisabled) {
13130
- let i = Wc(e);
13138
+ let i = qc(e);
13131
13139
  if (i.error) return i;
13132
13140
  }
13133
13141
  let r = tn({ ...e });
@@ -13140,7 +13148,7 @@ function Yv(e) {
13140
13148
  function eS(e) {
13141
13149
  let t = se(e, [{ [Bt]: !0, [hr]: !0, [dn]: !0 }, { homeParticipantId: !0, [bi]: xt }]);
13142
13150
  if (t.error) return t;
13143
- let r = Bc(e, [{ [Tc]: Ln, attr: { [Xp]: !0 } }]);
13151
+ let r = Vc(e, [{ [Pc]: Ln, attr: { [Xp]: !0 } }]);
13144
13152
  if (r.error) return r;
13145
13153
  let i = r?.matchUp?.matchUp?.sides?.map((l) => l?.participantId);
13146
13154
  if (e.homeParticipantId && !i?.includes(e.homeParticipantId)) return { error: Wi };
@@ -13154,7 +13162,7 @@ function xE({ timeStamp: e, schedule: t, matchUp: r }) {
13154
13162
  function Fa(e) {
13155
13163
  let t = "addMatchUpScheduledTime", r = e.matchUp, { removePriorValues: i, tournamentRecord: n, drawDefinition: a, disableNotice: s, scheduledTime: o, matchUpId: c } = e;
13156
13164
  if (!c) return F({ result: { error: yr }, stack: t });
13157
- if (!wc(o)) return F({ result: { error: Si }, stack: t });
13165
+ if (!Dc(o)) return F({ result: { error: Si }, stack: t });
13158
13166
  if (!r) {
13159
13167
  let m = st({ drawDefinition: a, matchUpId: c });
13160
13168
  if (m.error) return F({ result: m, stack: t });
@@ -13211,7 +13219,7 @@ function Uf({ removePriorValues: e, tournamentRecords: t, tournamentRecord: r, d
13211
13219
  }
13212
13220
  return Xr({ duplicateValues: !1, removePriorValues: e, tournamentRecord: r, drawDefinition: i, disableNotice: n, matchUpId: s, timeItem: { itemType: xn, itemDate: a, itemValue: u } });
13213
13221
  }
13214
- function qc({ removePriorValues: e, tournamentRecords: t, tournamentRecord: r, drawDefinition: i, disableNotice: n, matchUpId: a, venueId: s }) {
13222
+ function Hc({ removePriorValues: e, tournamentRecords: t, tournamentRecord: r, drawDefinition: i, disableNotice: n, matchUpId: a, venueId: s }) {
13215
13223
  if (!r) return { error: J };
13216
13224
  if (!a) return { error: yr };
13217
13225
  if (s) {
@@ -13227,7 +13235,7 @@ function To({ removePriorValues: e, tournamentRecords: t, tournamentRecord: r, d
13227
13235
  let c = mo({ tournamentRecords: t, tournamentRecord: r, courtId: o });
13228
13236
  if (c.error) return c;
13229
13237
  let u = c.venue?.venueId;
13230
- qc({ tournamentRecords: t, tournamentRecord: r, drawDefinition: i, disableNotice: n, matchUpId: s, venueId: u });
13238
+ Hc({ tournamentRecords: t, tournamentRecord: r, drawDefinition: i, disableNotice: n, matchUpId: s, venueId: u });
13231
13239
  }
13232
13240
  return Xr({ duplicateValues: !1, removePriorValues: e, tournamentRecord: r, drawDefinition: i, disableNotice: n, matchUpId: s, timeItem: { itemType: Ta, itemDate: a, itemValue: o } });
13233
13241
  }
@@ -13294,7 +13302,7 @@ function Sf(e) {
13294
13302
  if (E?.error) return F({ result: E, stack: t, context: { courtId: U } });
13295
13303
  }
13296
13304
  if (R !== void 0) {
13297
- let E = qc({ disableNotice: !0, removePriorValues: o, tournamentRecords: c, tournamentRecord: u, drawDefinition: l, matchUpId: m, venueId: R });
13305
+ let E = Hc({ disableNotice: !0, removePriorValues: o, tournamentRecords: c, tournamentRecord: u, drawDefinition: l, matchUpId: m, venueId: R });
13298
13306
  if (E?.error) return F({ result: E, stack: t, context: { venueId: R } });
13299
13307
  }
13300
13308
  if (v !== void 0 && ge(v)) {
@@ -13325,7 +13333,7 @@ function LE({ removePriorValues: e, tournamentRecord: t, drawDefinition: r, disa
13325
13333
  }
13326
13334
  function rS({ removePriorValues: e, tournamentRecord: t, drawDefinition: r, disableNotice: i, matchUpId: n, startTime: a, event: s }) {
13327
13335
  if (!n) return { error: yr };
13328
- if (!wc(a)) return { error: Si };
13336
+ if (!Dc(a)) return { error: Si };
13329
13337
  let { matchUp: o } = st({ drawDefinition: r, event: s, matchUpId: n }), { scheduledDate: c } = po({ matchUp: o }), u = (o?.timeItems ?? []).filter((l) => [Hn, wn, ea].includes(l?.itemType)).map((l) => Qi(l.itemValue, c)).reduce((l, d) => !l || d < l ? d : l, void 0);
13330
13338
  if (!u || Qi(a, c) < u) {
13331
13339
  o?.timeItems && (o.timeItems = o.timeItems.filter((d) => d.itemType !== Bi));
@@ -13335,7 +13343,7 @@ function rS({ removePriorValues: e, tournamentRecord: t, drawDefinition: r, disa
13335
13343
  }
13336
13344
  function iS({ validateTimeSeries: e = !0, removePriorValues: t, tournamentRecord: r, drawDefinition: i, disableNotice: n, matchUpId: a, endTime: s, event: o }) {
13337
13345
  if (!a) return { error: yr };
13338
- if (!wc(s)) return { error: Si };
13346
+ if (!Dc(s)) return { error: Si };
13339
13347
  let { matchUp: c } = st({ drawDefinition: i, event: o, matchUpId: a }), { scheduledDate: u } = po({ matchUp: c }), l = (c?.timeItems ?? []).filter((d) => [Bi, wn, Hn].includes(d?.itemType)).map((d) => Qi(d.itemValue, u)).reduce((d, p) => !d || p > d ? p : d, void 0);
13340
13348
  if (!e || !l || Qi(s, u) > l) {
13341
13349
  c?.timeItems && (c.timeItems = c.timeItems.filter((p) => p.itemType !== ea));
@@ -13345,7 +13353,7 @@ function iS({ validateTimeSeries: e = !0, removePriorValues: t, tournamentRecord
13345
13353
  }
13346
13354
  function nS({ removePriorValues: e, tournamentRecord: t, drawDefinition: r, disableNotice: i, matchUpId: n, stopTime: a, event: s }) {
13347
13355
  if (!n) return { error: yr };
13348
- if (!wc(a)) return { error: Si };
13356
+ if (!Dc(a)) return { error: Si };
13349
13357
  let { matchUp: o } = st({ drawDefinition: r, event: s, matchUpId: n }), { scheduledDate: c } = po({ matchUp: o }), u = o?.timeItems ?? [];
13350
13358
  if (u.reduce((f, h) => h.itemType === ea || f, void 0)) return { error: Og };
13351
13359
  let l = u.filter((f) => [Bi, wn, Hn].includes(f?.itemType)).sort((f, h) => Qi(f.itemValue, c) - Qi(h.itemValue, c)), d = l[l.length - 1], p = d && d.itemType === Hn, m = l.filter((f) => !p || f.createdAt !== d.createdAt).map((f) => Qi(f.itemValue, c)).reduce((f, h) => !f || h > f ? h : f, void 0);
@@ -13360,7 +13368,7 @@ function nS({ removePriorValues: e, tournamentRecord: t, drawDefinition: r, disa
13360
13368
  }
13361
13369
  function aS({ removePriorValues: e, tournamentRecord: t, drawDefinition: r, disableNotice: i, resumeTime: n, matchUpId: a, event: s }) {
13362
13370
  if (!a) return { error: yr };
13363
- if (!wc(n)) return { error: Si };
13371
+ if (!Dc(n)) return { error: Si };
13364
13372
  let { matchUp: o } = st({ drawDefinition: r, event: s, matchUpId: a }), { scheduledDate: c } = po({ matchUp: o }), u = o?.timeItems ?? [];
13365
13373
  if (u.reduce((f, h) => h.itemType === ea || f, void 0)) return { error: Og };
13366
13374
  let l = u.filter((f) => [Bi, wn, Hn].includes(f?.itemType)).sort((f, h) => Qi(f.itemValue, c) - Qi(h.itemValue, c)), d = l[l.length - 1], p = d && d.itemType === wn, m = l.filter((f) => !p || f.createdAt !== d.createdAt).map((f) => Qi(f.itemValue, c)).reduce((f, h) => !f || h > f ? h : f, void 0);
@@ -13399,19 +13407,19 @@ function G2(e) {
13399
13407
  S && (S.participantId = d), T && (T.participantId = u);
13400
13408
  }), tn({ ...e });
13401
13409
  }
13402
- function Hc(e) {
13410
+ function zc(e) {
13403
13411
  let t = "setMatchUpStatus";
13404
13412
  e.matchUpStatus && [nt, dt].includes(e.matchUpStatus) && (e.score = void 0);
13405
13413
  let { allowChangePropagation: r, disableScoreValidation: i, propagateExitStatus: n, tournamentRecords: a, tournamentRecord: s, disableAutoCalc: o, enableAutoCalc: c, drawDefinition: u, matchUpStatus: l, winningSide: d, matchUpId: p, event: m, score: f } = e;
13406
13414
  if (!u) return { error: ne };
13407
- if (l && [mn, Yr, Lr, vt].includes(l) && d) return { error: z, winningSide: d, matchUpStatus: l };
13408
- if (![void 0, ...jP].includes(l)) return F({ result: { error: Ic }, info: "matchUpStatus does not exist", stack: "setMatchUpStatus" });
13415
+ if (l && [mn, Yr, Lr, wt].includes(l) && d) return { error: z, winningSide: d, matchUpStatus: l };
13416
+ if (![void 0, ...jP].includes(l)) return F({ result: { error: yc }, info: "matchUpStatus does not exist", stack: "setMatchUpStatus" });
13409
13417
  let h = er({ drawDefinition: u }), { matchUps: g } = Rt({ nextMatchUps: !0, tournamentRecord: s, inContext: !0, drawDefinition: u, matchUpsMap: h, event: m }), I = h.drawMatchUps.find(($) => $.matchUpId === p), y = g?.find(($) => $.matchUpId === p);
13410
13418
  if (!I || !g) return { error: pr };
13411
13419
  if ((I.winningSide || d) && l === "BYE") return { context: "Cannot have Bye with winningSide", error: Ud, matchUpStatus: l };
13412
13420
  let U = y?.structureId, { structure: w } = me({ drawDefinition: u, structureId: U }), v = Pt(rt)(I.matchUpType), D = y?.drawPositions?.filter(Boolean), S = y?.matchUpTieId, T = Tr({ matchUpId: S || p, inContextDrawMatchUps: g, drawDefinition: u });
13413
13421
  Object.assign(e, { inContextDrawMatchUps: g, inContextMatchUp: y, matchUpTieId: S, matchUpsMap: h, targetData: T, structure: w, matchUp: I });
13414
- let b = l === vt && f?.scoreStringSide1 === "" && f?.scoreStringSide2 === "" && !d;
13422
+ let b = l === wt && f?.scoreStringSide1 === "" && f?.scoreStringSide2 === "" && !d;
13415
13423
  if (V2(e) && b) return { error: V1 };
13416
13424
  let P = rs(e), M;
13417
13425
  if (v) {
@@ -13464,7 +13472,7 @@ function $2(e) {
13464
13472
  return r === t.winningSide || i && !n ? _E(e) : F({ stack: "winningSideWithDownstreamDependencies", result: { error: Ap }, context: { winningSide: r, matchUp: t } });
13465
13473
  }
13466
13474
  function _E(e) {
13467
- let { tournamentRecord: t, matchUp: r, event: i } = e, n = e.isCollectionMatchUp && r.winningSide && !e.winningSide && !_t({ score: e.score }), a = e.isCollectionMatchUp ? e.matchUpStatus || n && vt || e.winningSide && Ut || Yr : e.matchUpStatus || Ut, s = e.removeScore || [mn, nt].includes(a) && ![Yr, Lr].includes(a), o = tn({ ...e, matchUpStatus: a, removeWinningSide: n, removeScore: s });
13475
+ let { tournamentRecord: t, matchUp: r, event: i } = e, n = e.isCollectionMatchUp && r.winningSide && !e.winningSide && !_t({ score: e.score }), a = e.isCollectionMatchUp ? e.matchUpStatus || n && wt || e.winningSide && St || Yr : e.matchUpStatus || St, s = e.removeScore || [mn, nt].includes(a) && ![Yr, Lr].includes(a), o = tn({ ...e, matchUpStatus: a, removeWinningSide: n, removeScore: s });
13468
13476
  if (o.error) return o;
13469
13477
  if (e.isCollectionMatchUp) {
13470
13478
  let { matchUpTieId: c, drawDefinition: u, matchUpsMap: l } = e, d = oa({ appliedPolicies: e.appliedPolicies, matchUpId: c, tournamentRecord: t, drawDefinition: u, matchUpsMap: l, event: i });
@@ -13476,12 +13484,12 @@ function _E(e) {
13476
13484
  function W2({ assignedDrawPositions: e, propagateExitStatus: t, inContextMatchUp: r, appliedPolicies: i, drawDefinition: n, matchUpStatus: a, structure: s, matchUp: o }) {
13477
13485
  if (i?.[pi]?.requireParticipantsForScoring === !1) return { ...x };
13478
13486
  let c = r?.sides?.map((d) => d.participantId).filter(Boolean).length, u = o?.sides ? [] : Ke({ structureId: s?.structureId, drawDefinition: n }).positionAssignments, l = c && c === 2 || o.collectionId && Rr({ structure: s }) && c && c >= 1 || e?.length === 2 && u?.filter((d) => e.includes(d.drawPosition)).every((d) => d.participantId);
13479
- return a && [nt, ze, dt].includes(a) && c === 1 && t ? { ...x } : a && VP.includes(a) && !l ? F({ info: "matchUpStatus requires assigned participants", context: { matchUpStatus: a, requiredParticipants: l }, result: { error: Ic } }) : { ...x };
13487
+ return a && [nt, ze, dt].includes(a) && c === 1 && t ? { ...x } : a && VP.includes(a) && !l ? F({ info: "matchUpStatus requires assigned participants", context: { matchUpStatus: a, requiredParticipants: l }, result: { error: yc } }) : { ...x };
13480
13488
  }
13481
13489
  function BE({ tournamentRecord: e, drawDefinition: t, matchUpId: r, event: i }) {
13482
13490
  if (!t) return { error: ne };
13483
13491
  let { matchUp: n } = st({ drawDefinition: t, matchUpId: r, event: i });
13484
- return n?.matchUpType !== Jr ? { error: Fr } : Hc({ enableAutoCalc: !0, tournamentRecord: e, drawDefinition: t, matchUpId: r, event: i });
13492
+ return n?.matchUpType !== Jr ? { error: Fr } : zc({ enableAutoCalc: !0, tournamentRecord: e, drawDefinition: t, matchUpId: r, event: i });
13485
13493
  }
13486
13494
  function VE({ drawDefinition: e, event: t, matchUpId: r }) {
13487
13495
  if (!e) return { error: ne };
@@ -13526,7 +13534,7 @@ function $E(e) {
13526
13534
  for (let S of v.structures || []) {
13527
13535
  if (Array.isArray(p) && !p.includes(S.stage) || Array.isArray(s) && !s.includes(S.stageSequence) || I?.length && !I.includes(S.structureId)) continue;
13528
13536
  I?.length && S.matchUpFormat !== o && (S.matchUpFormat = o, D.push(S.structureId), g += 1);
13529
- let T = ((h || a) && _e({ matchUpFilters: { matchUpStatuses: [vt] }, structure: S }).matchUps) ?? [], b = (a && _e({ matchUpFilters: { matchUpStatuses: [vt] }, contextFilters: { scheduledDates: a }, afterRecoveryTimes: !1, inContext: !0, structure: S }).matchUps) ?? [];
13537
+ let T = ((h || a) && _e({ matchUpFilters: { matchUpStatuses: [wt] }, structure: S }).matchUps) ?? [], b = (a && _e({ matchUpFilters: { matchUpStatuses: [wt] }, contextFilters: { scheduledDates: a }, afterRecoveryTimes: !1, inContext: !0, structure: S }).matchUps) ?? [];
13530
13538
  if (T?.length) {
13531
13539
  let P = b ? b.map($t) : T.map($t);
13532
13540
  for (let M of T) P.includes(M.matchUpId) && (M.matchUpFormat = a?.length ? o : void 0, Ae({ tournamentId: i?.tournamentId, eventId: f?.eventId, context: t, drawDefinition: v, matchUp: M }));
@@ -13540,7 +13548,7 @@ function $E(e) {
13540
13548
  Je({ structureIds: S, drawDefinition: D });
13541
13549
  }
13542
13550
  else v.matchUpFormat !== o && (v.matchUpFormat = o, g += 1);
13543
- return g ? { ...x, modificationsCount: g } : { ...x, info: vc };
13551
+ return g ? { ...x, modificationsCount: g } : { ...x, info: wc };
13544
13552
  }
13545
13553
  function sS({ inheritance: e = !0, tournamentRecord: t, drawDefinition: r, matchUpId: i, event: n }) {
13546
13554
  if (!r) return { error: ne };
@@ -13577,7 +13585,7 @@ function H2({ sourceMatchUpStatusCodes: e, propagateExitStatus: t, sourceMatchUp
13577
13585
  let U = g.sideNumber === 1 ? 2 : 1;
13578
13586
  h[U - 1] = y, p = dt, f = void 0;
13579
13587
  }
13580
- let I = Hc({ matchUpStatus: p, matchUpId: s.matchUpId, matchUpStatusCodes: h, allowChangePropagation: !0, propagateExitStatus: t, tournamentRecord: n, drawDefinition: a, winningSide: f, event: c });
13588
+ let I = zc({ matchUpStatus: p, matchUpId: s.matchUpId, matchUpStatusCodes: h, allowChangePropagation: !0, propagateExitStatus: t, tournamentRecord: n, drawDefinition: a, winningSide: f, event: c });
13581
13589
  return F({ result: I, stack: u, context: { progressExitStatus: !0 } });
13582
13590
  }
13583
13591
  return F({ result: { error: Mr }, stack: u });
@@ -13603,7 +13611,7 @@ function nd(e) {
13603
13611
  let { score: v } = WE({ ...y, setTBlast: U });
13604
13612
  y.score = v, y.score.sets = y.score.sets.filter((D) => D.side1Score || D.side2Score || D.side1TiebreakScore || D.side2TiebreakScore);
13605
13613
  }
13606
- let w = Hc({ matchUpStatusCodes: y?.matchUpStatusCodes, matchUpStatus: y?.matchUpStatus, winningSide: y?.winningSide, allowChangePropagation: I, disableScoreValidation: n, score: y?.score, propagateExitStatus: a, tournamentRecords: i, policyDefinitions: s, tournamentRecord: o, disableAutoCalc: c, enableAutoCalc: u, drawDefinition: l, matchUpFormat: h, matchUpId: d, schedule: p, event: m, notes: f });
13614
+ let w = zc({ matchUpStatusCodes: y?.matchUpStatusCodes, matchUpStatus: y?.matchUpStatus, winningSide: y?.winningSide, allowChangePropagation: I, disableScoreValidation: n, score: y?.score, propagateExitStatus: a, tournamentRecords: i, policyDefinitions: s, tournamentRecord: o, disableAutoCalc: c, enableAutoCalc: u, drawDefinition: l, matchUpFormat: h, matchUpId: d, schedule: p, event: m, notes: f });
13607
13615
  if (w.context?.progressExitStatus) {
13608
13616
  let v = !0, D = 0;
13609
13617
  for (; v && D < 10; ) {
@@ -13664,7 +13672,7 @@ function HE(e) {
13664
13672
  function oS(e) {
13665
13673
  let t = "resetTieFormat", { drawDefinition: r, event: i, uuids: n } = e, a = se(e, [{ [Bt]: !0, [dn]: !0 }], t);
13666
13674
  if (a.error) return a;
13667
- let s = Bc(e, [{ [Tc]: Ln }]);
13675
+ let s = Vc(e, [{ [Pc]: Ln }]);
13668
13676
  if (s[bi]) return s;
13669
13677
  let o = e.tournamentRecord?.tournamentId, { matchUp: c, structure: u } = s?.matchUp ?? {};
13670
13678
  if (!c?.tieMatchUps) return F({ result: { error: Fr }, info: "Must be a TEAM matchUp", stack: t });
@@ -13676,7 +13684,7 @@ function oS(e) {
13676
13684
  let { matchUpCount: g, collectionId: I } = h;
13677
13685
  p.push(I);
13678
13686
  let y = (c.tieMatchUps || []).filter((U) => U.collectionId === I);
13679
- if (y.length > g) y.sort((U, w) => (U.matchUpStatus === vt ? 1 : 0) - (w.matchUpStatus === vt ? 1 : 0)), m.push(...y.slice(0, g)), d.push(...y.slice(3).map($t));
13687
+ if (y.length > g) y.sort((U, w) => (U.matchUpStatus === wt ? 1 : 0) - (w.matchUpStatus === wt ? 1 : 0)), m.push(...y.slice(0, g)), d.push(...y.slice(3).map($t));
13680
13688
  else if (m.push(...y), y.length < g) {
13681
13689
  let U = g - y.length, w = Vl({ collectionDefinition: h, matchUpsLimit: U, matchUp: c, uuids: n });
13682
13690
  f.push(...w);
@@ -13696,7 +13704,7 @@ function cS(e) {
13696
13704
  let l = Tr({ inContextDrawMatchUps: o, drawDefinition: r, matchUpId: i }), d = u?.structureId, { structure: p } = me({ drawDefinition: r, structureId: d });
13697
13705
  if (Object.assign(e, { inContextDrawMatchUps: o, inContextMatchUp: u, matchUpsMap: s, targetData: l, structure: p, matchUp: c }), rs(e)) return { error: Ap };
13698
13706
  if (c.tieMatchUps?.length) for (let h of c.tieMatchUps) {
13699
- let g = Hc({ matchUpId: h.matchUpId, matchUpTieId: i, winningSide: void 0, removeScore: !0, tournamentRecord: t, drawDefinition: r, event: n });
13707
+ let g = zc({ matchUpId: h.matchUpId, matchUpTieId: i, winningSide: void 0, removeScore: !0, tournamentRecord: t, drawDefinition: r, event: n });
13700
13708
  if (g.error) return F({ result: g, stack: a });
13701
13709
  }
13702
13710
  let m = xe({ tournamentRecord: t, drawDefinition: r, event: n })?.appliedPolicies, f = oa({ event: e.event, removeScore: !0, tournamentRecord: t, appliedPolicies: m, drawDefinition: r, matchUpsMap: s, matchUpId: i });
@@ -13714,7 +13722,7 @@ function cS(e) {
13714
13722
  return { ...x };
13715
13723
  }
13716
13724
  function zE(e) {
13717
- let t = se(e, [{ [hr]: !0, [na]: !0 }, { [tc]: { [ll]: !1, roundNumbers: !1 }, [bP]: "At least one must be provided", [Ar]: ur }]);
13725
+ let t = se(e, [{ [hr]: !0, [na]: !0 }, { [rc]: { [ll]: !1, roundNumbers: !1 }, [bP]: "At least one must be provided", [Ar]: ur }]);
13718
13726
  if (t.error) return t;
13719
13727
  let r = tN(e);
13720
13728
  if (r.error) return r;
@@ -13724,7 +13732,7 @@ function zE(e) {
13724
13732
  let l = cS({ tiebreakReset: !0, tournamentRecord: a, drawDefinition: s, matchUpId: c, event: o });
13725
13733
  if (l.error || e.removeAssignments && sS({ inheritance: !1, drawDefinition: s, matchUpId: c }).error) return l;
13726
13734
  }
13727
- let u = Hc({ winningSide: void 0, removeScore: !0, tournamentRecord: a, drawDefinition: s, matchUpId: c, event: o });
13735
+ let u = zc({ winningSide: void 0, removeScore: !0, tournamentRecord: a, drawDefinition: s, matchUpId: c, event: o });
13728
13736
  if (u.error) return u;
13729
13737
  if (e.removeAssignments) {
13730
13738
  let l = ZU({ ...e, matchUpId: c });
@@ -13737,13 +13745,13 @@ function K2({ tournamentRecord: e, drawDefinition: t, finishingOrder: r }) {
13737
13745
  if (!t) return { error: ne };
13738
13746
  let i = "setOrderOfFinish";
13739
13747
  if (!Array.isArray(r)) return F({ info: es("finishingOrder"), result: { error: z }, stack: i });
13740
- let { completedMatchUps: n, matchUpsMap: a } = Ac({ inContext: !0, drawDefinition: t }), s = n?.map($t) ?? [], o = r.map($t), { matchUpTypes: c, roundNumbers: u, structureIds: l, matchUpTieIds: d } = (n ?? []).filter(({ matchUpId: y }) => o.includes(y)).reduce((y, U) => {
13748
+ let { completedMatchUps: n, matchUpsMap: a } = Cc({ inContext: !0, drawDefinition: t }), s = n?.map($t) ?? [], o = r.map($t), { matchUpTypes: c, roundNumbers: u, structureIds: l, matchUpTieIds: d } = (n ?? []).filter(({ matchUpId: y }) => o.includes(y)).reduce((y, U) => {
13741
13749
  let { matchUpTieId: w, matchUpType: v, roundNumber: D, structureId: S } = U;
13742
13750
  return y.matchUpTypes.includes(v) || y.matchUpTypes.push(v), y.roundNumbers.includes(D) || y.roundNumbers.push(D), y.structureIds.includes(S) || y.structureIds.push(S), y.matchUpTieIds.includes(w) || y.matchUpTieIds.push(w), y;
13743
13751
  }, { matchUpTypes: [], roundNumbers: [], structureIds: [], matchUpTieIds: [] });
13744
13752
  if (c.length > 1 || d.length > 1 || u.length > 1 || l.length > 1) return F({ info: "matchUpType, structureId and roundNumber must be equivalent", result: { error: z }, stack: i });
13745
13753
  let p, m, f = {}, h = [], g = [];
13746
- if (!r.every(({ orderOfFinish: y, matchUpId: U }) => (h.push(U), y && g.push(y), f[U] = y, p = s.includes(U), m = y === void 0 || ge(y) && Math.floor(y) > 0, p && m))) return F({ result: { error: p ? z : Ic }, info: !p && "matchUps must be completed" || !m && "orderOfFinish must be integer > 0 or undefined" || void 0, stack: i });
13754
+ if (!r.every(({ orderOfFinish: y, matchUpId: U }) => (h.push(U), y && g.push(y), f[U] = y, p = s.includes(U), m = y === void 0 || ge(y) && Math.floor(y) > 0, p && m))) return F({ result: { error: p ? z : yc }, info: !p && "matchUps must be completed" || !m && "orderOfFinish must be integer > 0 or undefined" || void 0, stack: i });
13747
13755
  let I = n?.filter((y) => y.structureId === l[0] && y.roundNumber === u[0] && y.matchUpType === c[0] && y.matchUpTieId === d[0] && !h.includes(y.matchUpId));
13748
13756
  for (let y of I ?? []) {
13749
13757
  let { orderOfFinish: U } = y || {};
@@ -13822,9 +13830,9 @@ function KE(e) {
13822
13830
  return Ae({ tournamentId: t?.tournamentId, context: s, drawDefinition: r, matchUp: g }), { ...x };
13823
13831
  }
13824
13832
  var uS = {};
13825
- Pe(uS, { anonymizeTournamentRecord: () => IA, generate: () => XE, generateEventWithDraw: () => Pf, generateOutcome: () => IS, generateOutcomeFromScoreString: () => lS, generateParticipants: () => zc, generateTournamentRecord: () => hA, modifyTournamentRecord: () => yA, mutate: () => gA });
13833
+ Pe(uS, { anonymizeTournamentRecord: () => IA, generate: () => XE, generateEventWithDraw: () => Pf, generateOutcome: () => IS, generateOutcomeFromScoreString: () => lS, generateParticipants: () => Yc, generateTournamentRecord: () => hA, modifyTournamentRecord: () => yA, mutate: () => gA });
13826
13834
  var XE = {};
13827
- Pe(XE, { generateEventWithDraw: () => Pf, generateOutcome: () => IS, generateOutcomeFromScoreString: () => lS, generateParticipants: () => zc, generateTournamentRecord: () => hA });
13835
+ Pe(XE, { generateEventWithDraw: () => Pf, generateOutcome: () => IS, generateOutcomeFromScoreString: () => lS, generateParticipants: () => Yc, generateTournamentRecord: () => hA });
13828
13836
  function lS(e) {
13829
13837
  let { matchUpFormat: t, matchUpStatus: r, winningSide: i, scoreString: n, setTBlast: a } = e;
13830
13838
  if (!n) return { outcome: { ...Em, winningSide: i, matchUpStatus: r } };
@@ -13855,7 +13863,7 @@ function $u({ matchUpPotentialParticipantIds: e, individualParticipantProfiles:
13855
13863
  ad({ individualParticipantProfiles: t, participantId: f });
13856
13864
  let h = t[f].priorMatchUpType !== c.matchUpType && d || l;
13857
13865
  m.includes(f) ? X2({ individualParticipantProfiles: t, drawId: c.drawId, recoveryValue: h, participantId: f, scheduleTime: o }) : (t[f].timeAfterRecovery = h, t[f].bookings.push({ scheduleTime: o, timeAfterRecovery: h }));
13858
- }), uc({ matchUpPotentialParticipantIds: e, matchUpNotBeforeTimes: n, timeAfterRecovery: l, matchUp: c });
13866
+ }), lc({ matchUpPotentialParticipantIds: e, matchUpNotBeforeTimes: n, timeAfterRecovery: l, matchUp: c });
13859
13867
  }
13860
13868
  function QE({ matchUpScheduleTimes: e, matchUpDependencies: t, scheduleTime: r, matchUpId: i, details: n }) {
13861
13869
  let a, s = n.minutesMap?.[i]?.recoveryMinutes, o = (n.minutesMap?.[i]?.averageMinutes || 0) + (s || 0), c = kr(r, o), u = t?.[i]?.dependentMatchUpIds || [];
@@ -13937,7 +13945,7 @@ function ej({ calculateStartTimeFromCourts: e = !0, remainingScheduleTimes: t, d
13937
13945
  if (s && !a && (a = { [s.tournamentId]: s }), typeof a != "object" || !Object.keys(a).length) return { error: mt };
13938
13946
  o = o ?? ff({ recoveryMinutes: r, averageMatchUpMinutes: i });
13939
13947
  let { courts: m, venues: f } = ca({ dates: [c], ignoreDisabled: !0, tournamentRecords: a }), h = m?.filter((v) => !l || l.includes(v.venueId)) ?? [];
13940
- u = u ?? lc({ courts: h, scheduleDate: c, startTime: !0 }), p = p ?? lc({ courts: h, scheduleDate: c, endTime: !0 });
13948
+ u = u ?? dc({ courts: h, scheduleDate: c, startTime: !0 }), p = p ?? dc({ courts: h, scheduleDate: c, endTime: !0 });
13941
13949
  let { bookings: g, dateScheduledMatchUps: I } = vf({ defaultRecoveryMinutes: r, averageMatchUpMinutes: i, tournamentRecords: a, scheduleDate: c, periodLength: o, venueIds: l, matchUps: d }), y = { calculateStartTimeFromCourts: e, remainingScheduleTimes: t, averageMatchUpMinutes: i, clearScheduleDates: n, date: c, periodLength: o, startTime: u, bookings: g, endTime: p, courts: h }, { scheduleTimes: U } = YU(y), w = l?.length === 1 && l[0] || f?.length === 1 && f[0].venueId || void 0;
13942
13950
  return { dateScheduledMatchUpIds: I?.map(Kr("matchUpId")), dateScheduledMatchUps: I, scheduleTimes: U, venueId: w };
13943
13951
  }
@@ -14024,7 +14032,7 @@ function Wu({ scheduleCompletedMatchUps: e = !1, scheduleByeMatchUps: t = !1, er
14024
14032
  function od(e) {
14025
14033
  let { scheduleCompletedMatchUps: t = !1, scheduleByeMatchUps: r = !1, errorOnAnachronism: i, matchUpContextIds: n, removePriorValues: a, tournamentRecords: s, checkChronology: o, matchUpDetails: c, schedule: u } = e;
14026
14034
  if (e.matchUpIds && !n) return Wu(e);
14027
- let l = se(e, [{ [mr]: !0 }, { [tc]: { matchUpContextIds: !1, matchUpDetails: !1 }, [ti]: z, [Ar]: ur }]);
14035
+ let l = se(e, [{ [mr]: !0 }, { [rc]: { matchUpContextIds: !1, matchUpDetails: !1 }, [ti]: z, [Ar]: ur }]);
14028
14036
  if (l.error) return l;
14029
14037
  if ((!c || n) && !u) return { error: ce, info: "schedule is required" };
14030
14038
  let d = [], p = 0, { matchUpDependencies: m } = Fi({ tournamentRecords: s });
@@ -14049,7 +14057,7 @@ function ij({ schedulingProfileModifications: e, checkPotentialRequestConflicts:
14049
14057
  y[R] = {}, U[R] = {}, g[R] = {}, I[R] = {}, D[R] = [], S[R] = [], T[R] = [], b[R] = [];
14050
14058
  let O = {};
14051
14059
  m.forEach((H) => {
14052
- H.schedule?.scheduledDate && Mn(R, ve(H.schedule.scheduledDate)) && uc({ matchUpPotentialParticipantIds: E, matchUpNotBeforeTimes: O, matchUp: H });
14060
+ H.schedule?.scheduledDate && Mn(R, ve(H.schedule.scheduledDate)) && lc({ matchUpPotentialParticipantIds: E, matchUpNotBeforeTimes: O, matchUp: H });
14053
14061
  });
14054
14062
  let { allDateScheduledByeMatchUpDetails: L, venueScheduledRoundDetails: _, allDateMatchUpIds: B } = JE({ matchUpPotentialParticipantIds: E, individualParticipantProfiles: C, scheduleCompletedMatchUps: r, containedStructureIds: a, matchUpNotBeforeTimes: O, matchUpScheduleTimes: v, matchUpDependencies: s, clearScheduleDates: c, tournamentRecords: u, useGarman: !0, periodLength: p, scheduleDate: R, matchUps: m, courts: f, venues: A }), G = 10, $ = 0, j, V = 10;
14055
14063
  for (; !j; ) {
@@ -14090,7 +14098,7 @@ function ij({ schedulingProfileModifications: e, checkPotentialRequestConflicts:
14090
14098
  let Z = v[Q];
14091
14099
  if (Z) {
14092
14100
  let ee = Z.split(":").map(ci).join(":"), ue = `${ve(R)}T${ee}`;
14093
- h ? D[R].push(Q) : (Fa({ drawDefinition: X, scheduledTime: ue, matchUpId: Q }).success && D[R].push(Q), H && qc({ tournamentRecord: q, drawDefinition: X, matchUpId: Q, venueId: H }));
14101
+ h ? D[R].push(Q) : (Fa({ drawDefinition: X, scheduledTime: ue, matchUpId: Q }).success && D[R].push(Q), H && Hc({ tournamentRecord: q, drawDefinition: X, matchUpId: Q, venueId: H }));
14094
14102
  }
14095
14103
  });
14096
14104
  });
@@ -14109,9 +14117,9 @@ function ij({ schedulingProfileModifications: e, checkPotentialRequestConflicts:
14109
14117
  }
14110
14118
  function Kv({ averageMinutes: e, startTime: t, endTime: r, court: i, date: n }) {
14111
14119
  if (!Array.isArray(i.dateAvailability)) return { error: ce, stack: "getEarliestCourtTime" };
14112
- let a = lc({ scheduleDate: n, courts: [i], startTime: !0 }), s = lc({ scheduleDate: n, courts: [i], endTime: !0 });
14120
+ let a = dc({ scheduleDate: n, courts: [i], startTime: !0 }), s = dc({ scheduleDate: n, courts: [i], endTime: !0 });
14113
14121
  t = t || a, r = r || s;
14114
- let o = id({ court: i, date: n }), { timeSlots: c } = $c({ courtDate: o }), u = Nt(t), l = Nt(r);
14122
+ let o = id({ court: i, date: n }), { timeSlots: c } = Wc({ courtDate: o }), u = Nt(t), l = Nt(r);
14115
14123
  return { earliestCourtTime: c?.reduce((d, p) => {
14116
14124
  let m = Nt(p.startTime), f = Nt(p.endTime);
14117
14125
  if (m > l || f < u) return d;
@@ -14135,7 +14143,7 @@ function nj({ schedulingProfileModifications: e, checkPotentialRequestConflicts:
14135
14143
  g[N] = {}, I[N] = {}, v[N] = [], D[N] = [], S[N] = [], T[N] = [];
14136
14144
  let k = {};
14137
14145
  m?.forEach((X) => {
14138
- X.schedule?.scheduledDate && Mn(N, ve(X.schedule.scheduledDate)) && uc({ matchUpPotentialParticipantIds: A, matchUpNotBeforeTimes: k, matchUp: X });
14146
+ X.schedule?.scheduledDate && Mn(N, ve(X.schedule.scheduledDate)) && lc({ matchUpPotentialParticipantIds: A, matchUpNotBeforeTimes: k, matchUp: X });
14139
14147
  });
14140
14148
  let { allDateScheduledByeMatchUpDetails: O, allDateScheduledMatchUpIds: L, venueScheduledRoundDetails: _, allDateMatchUpIds: B } = JE({ matchUpPotentialParticipantIds: A, individualParticipantProfiles: E, scheduleCompletedMatchUps: r, containedStructureIds: a, matchUpNotBeforeTimes: k, matchUpScheduleTimes: w, matchUpDependencies: s, clearScheduleDates: c, tournamentRecords: u, periodLength: l, scheduleDate: N, matchUps: m, courts: f, venues: R }), G = m?.filter(({ matchUpId: X }) => L.includes(X)), { bookings: $ } = vf({ dateScheduledMatchUps: G, tournamentRecords: u, scheduleDate: N, periodLength: l }), { virtualCourts: j } = mf({ scheduleDate: N, periodLength: l, bookings: $, courts: f }), V = j?.reduce((X, Q) => {
14141
14149
  let { earliestCourtTime: Z, courtEndTime: ee } = Kv({ date: N, averageMinutes: 0, court: Q });
@@ -14252,7 +14260,7 @@ function Df(e) {
14252
14260
  let d = ua({ tournamentRecords: a });
14253
14261
  if (d.error) return d;
14254
14262
  if (!d.schedulingProfile.length) return { ...x };
14255
- let { modifications: p, issues: m = [], schedulingProfile: f = [] } = d, h = Object.assign({}, ...Object.values(a).map((b) => Rc({ tournamentRecord: b }).containedStructures)), g = n.map((b) => {
14263
+ let { modifications: p, issues: m = [], schedulingProfile: f = [] } = d, h = Object.assign({}, ...Object.values(a).map((b) => Ec({ tournamentRecord: b }).containedStructures)), g = n.map((b) => {
14256
14264
  if (xr(b)) return ve(b);
14257
14265
  }).filter(Boolean), I = f.map((b) => b.scheduleDate).map((b) => xr(b) && ve(b)).filter((b) => b && (!n.length || g.includes(b)));
14258
14266
  if (!I.length) return { error: ND };
@@ -14368,7 +14376,7 @@ function pp({ nameRoot: e = "TEAM", count: t = 1 } = {}) {
14368
14376
  let r = Ur(uj).slice(0, t);
14369
14377
  return r.length < t && te(0, t - r.length).forEach((i) => r.push(`${e} ${i + 1}`)), { names: r };
14370
14378
  }
14371
- function zc(e) {
14379
+ function Yc(e) {
14372
14380
  let { scaledParticipantsCount: t, rankingRange: r } = e, { ratingsParameters: i = Gt, valuesInstanceLimit: n, ratingsValues: a = [], consideredDate: s, categories: o, category: c, nationalityCodesCount: u, nationalityCodeType: l, nationalityCodes: d, participantsCount: p = 32, participantType: m, teamSize: f = 8, personIds: h, idPrefix: g, uuids: I, personExtensions: y, addressProps: U, gendersCount: w, matchUpType: v, personData: D, sex: S, inContext: T, withISO2: b, withIOC: P, scaleAllParticipants: M } = e, N = m === we || v === qa, R = m === Ge || v === Ge;
14373
14381
  r && (!Array.isArray(r) || !r.every((de) => ft(de)) || r.length !== 2) && (r = void 0), t = M ? p : t;
14374
14382
  let A = 1e3, E = t && t > A ? t : A;
@@ -14501,7 +14509,7 @@ function lj({ participantsProfile: e, eventProfiles: t, drawProfiles: r }) {
14501
14509
  }
14502
14510
  function aA({ participantsProfile: e, tournamentRecord: t, eventProfiles: r, drawProfiles: i, startDate: n, uuids: a }) {
14503
14511
  if (e?.participantsCount === 0) return { addedCount: 0, ...x };
14504
- let { participantsCount: s, participantType: o, largestTeamDraw: c, largestTeamSize: u, gendersCount: l } = lj({ participantsProfile: e, eventProfiles: r, drawProfiles: i }), d = e?.teamKey, p = zc({ consideredDate: n, ...e, participantsCount: s, participantType: o, gendersCount: l, uuids: a }).participants, m = 0, f = Oi({ tournamentRecord: t, participants: p });
14512
+ let { participantsCount: s, participantType: o, largestTeamDraw: c, largestTeamSize: u, gendersCount: l } = lj({ participantsProfile: e, eventProfiles: r, drawProfiles: i }), d = e?.teamKey, p = Yc({ consideredDate: n, ...e, participantsCount: s, participantType: o, gendersCount: l, uuids: a }).participants, m = 0, f = Oi({ tournamentRecord: t, participants: p });
14505
14513
  if (f.error) return f;
14506
14514
  if (m += f.addedCount, d) {
14507
14515
  let y = hS({ tournamentRecord: t, ...d });
@@ -14532,9 +14540,9 @@ function IS(e) {
14532
14540
  if (!qr({ matchUpFormat: n })) return { error: wg };
14533
14541
  if (typeof i != "object") return { error: z };
14534
14542
  if (t > 100 && (t = 100), isNaN(t) || isNaN(a) || isNaN(s)) return { error: z };
14535
- let o = Object.keys(i).filter((P) => Object.keys(am).includes(P) && P !== Ut);
14543
+ let o = Object.keys(i).filter((P) => Object.keys(am).includes(P) && P !== St);
14536
14544
  if (Object.keys(o).reduce((P, M) => P + i[M], 0) > 100) return { error: z, matchUpStatusProfile: i };
14537
- let c = o.reduce((P, M) => (P.pointer = P.pointer + i[M], P.valueMap.push([P.pointer, M]), P), { pointer: 0, valueMap: [] }), u = oi(1, 100), l = (c.valueMap.find((P) => u <= P[0]) ?? [100, Ut])[1], d = { sets: [], scoreStringSide1: "", side2ScoreString: "" };
14545
+ let c = o.reduce((P, M) => (P.pointer = P.pointer + i[M], P.valueMap.push([P.pointer, M]), P), { pointer: 0, valueMap: [] }), u = oi(1, 100), l = (c.valueMap.find((P) => u <= P[0]) ?? [100, St])[1], d = { sets: [], scoreStringSide1: "", side2ScoreString: "" };
14538
14546
  if (dr(l)) {
14539
14547
  r = r || oi(1, 2);
14540
14548
  let P = { score: d, matchUpStatus: l, winningSide: r };
@@ -14632,7 +14640,7 @@ function mp(e) {
14632
14640
  }
14633
14641
  }
14634
14642
  }
14635
- let m = typeof r == "string" && r, f = m && Ut, h = u.length === 2 && u[0].finishingPosition === Ka && St(u.map(({ stage: I }) => I), [re, yt]).length === 2, g = u.map(({ structureId: I }) => I);
14643
+ let m = typeof r == "string" && r, f = m && St, h = u.length === 2 && u[0].finishingPosition === Ka && vt(u.map(({ stage: I }) => I), [re, Ut]).length === 2, g = u.map(({ structureId: I }) => I);
14636
14644
  for (let I of g) {
14637
14645
  if (l >= a) break;
14638
14646
  let y = s.structures.find((v) => v.structureId === I), U = _e({ contextFilters: { matchUpTypes: [We, Ye] }, afterRecoveryTimes: !1, tournamentRecord: n, inContext: !0, drawDefinition: s, matchUpsMap: p, structure: y, event: o }).matchUps;
@@ -14647,7 +14655,7 @@ function mp(e) {
14647
14655
  l += 1;
14648
14656
  }
14649
14657
  }
14650
- h && y.finishingPosition === Ka && e.completeRoundRobinPlayoffs && xc({ structureId: y.structureId, applyPositioning: !0, drawDefinition: s });
14658
+ h && y.finishingPosition === Ka && e.completeRoundRobinPlayoffs && Fc({ structureId: y.structureId, applyPositioning: !0, drawDefinition: s });
14651
14659
  }
14652
14660
  return { ...x, completedCount: l };
14653
14661
  }
@@ -14664,7 +14672,7 @@ function mj(e) {
14664
14672
  return nd({ policyDefinitions: i, tournamentRecord: r, drawDefinition: n, matchUpFormat: s, matchUpId: d, outcome: p, event: l });
14665
14673
  }
14666
14674
  function uA({ matchUpStatusProfile: e, completeAllMatchUps: t, randomWinningSide: r, tournamentRecord: i, drawProfiles: n, isMock: a, event: s }) {
14667
- let o = wt({ event: s }).flightProfile, { eventName: c, eventType: u, category: l } = s, { startDate: d } = i, p = [], m = l?.categoryName || l?.ageCategoryCode || l?.ratingType, f = s.drawDefinitions?.map(({ drawId: h }) => h);
14675
+ let o = Dt({ event: s }).flightProfile, { eventName: c, eventType: u, category: l } = s, { startDate: d } = i, p = [], m = l?.categoryName || l?.ageCategoryCode || l?.ratingType, f = s.drawDefinitions?.map(({ drawId: h }) => h);
14668
14676
  if (Array.isArray(o?.flights)) for (let [h, g] of o.flights.entries()) {
14669
14677
  let { drawId: I, stage: y, drawName: U, drawEntries: w } = g;
14670
14678
  p.push(g.drawId);
@@ -14693,7 +14701,7 @@ function uA({ matchUpStatusProfile: e, completeAllMatchUps: t, randomWinningSide
14693
14701
  if (v?.drawType === An) {
14694
14702
  let k = M.structures?.find((_) => _.stage === re);
14695
14703
  if (!k) return { error: lt };
14696
- let O = xc({ structureId: k.structureId, tournamentRecord: i, drawDefinition: M });
14704
+ let O = Fc({ structureId: k.structureId, tournamentRecord: i, drawDefinition: M });
14697
14705
  if (O.error) return { error: O.error, drawIds: [] };
14698
14706
  let L = R ? R - (C ?? 0) : void 0;
14699
14707
  if (O = mp({ completeAllMatchUps: !R && t, completionGoal: R ? L : void 0, matchUpStatusProfile: e, randomWinningSide: r, tournamentRecord: i, drawDefinition: M, matchUpFormat: A, event: s }), O.error) return { error: O.error, drawIds: [] };
@@ -14704,7 +14712,7 @@ function uA({ matchUpStatusProfile: e, completeAllMatchUps: t, randomWinningSide
14704
14712
  return { ...x, drawIds: p };
14705
14713
  }
14706
14714
  function lA(e) {
14707
- let { participantsProfile: t = {}, uniqueParticipantsCount: r, ratingsParameters: i, tournamentRecord: n, eventProfile: a, eventIndex: s, event: o, uuids: c } = e, { category: u, gender: l, eventType: d } = o, p = Pt(an)(d) && Me || Pt(di)(d) && we || d, m = r[re] || 0, f = r[oe] || 0, h = a.drawProfiles?.length ? m + f : a.participantsProfile?.participantsCount ?? 0, g = rn(l) ? l : void 0, I = t?.idPrefix ? `E-${s}-${t?.idPrefix}` : void 0, { participants: y } = zc({ uuids: a.uuids || c, ...t, scaledParticipantsCount: a.scaledParticipantsCount, consideredDate: n?.startDate, rankingRange: a.rankingRange, participantType: p, participantsCount: h, ratingsParameters: i, category: u, idPrefix: I, sex: g }), U = Oi({ tournamentRecord: n, participants: y });
14715
+ let { participantsProfile: t = {}, uniqueParticipantsCount: r, ratingsParameters: i, tournamentRecord: n, eventProfile: a, eventIndex: s, event: o, uuids: c } = e, { category: u, gender: l, eventType: d } = o, p = Pt(an)(d) && Me || Pt(di)(d) && we || d, m = r[re] || 0, f = r[oe] || 0, h = a.drawProfiles?.length ? m + f : a.participantsProfile?.participantsCount ?? 0, g = rn(l) ? l : void 0, I = t?.idPrefix ? `E-${s}-${t?.idPrefix}` : void 0, { participants: y } = Yc({ uuids: a.uuids || c, ...t, scaledParticipantsCount: a.scaledParticipantsCount, consideredDate: n?.startDate, rankingRange: a.rankingRange, participantType: p, participantsCount: h, ratingsParameters: i, category: u, idPrefix: I, sex: g }), U = Oi({ tournamentRecord: n, participants: y });
14708
14716
  if (U.error) return U;
14709
14717
  let w = y?.filter(({ participantType: D }) => D === p), v = y?.map(be);
14710
14718
  return { uniqueDrawParticipants: w, uniqueParticipantIds: v };
@@ -14742,7 +14750,7 @@ function pA(e) {
14742
14750
  }
14743
14751
  if (Array.isArray(P) && P.forEach((q) => So({ event: W, timeItem: q })), typeof y == "object") for (let q of Object.keys(y)) ts({ policyDefinitions: { [q]: y[q] }, event: j });
14744
14752
  j.category && (j.category.categoryName = $);
14745
- let V, H = Vc({ suppressNotifications: !1, internalUse: !0, tournamentRecord: u, event: j });
14753
+ let V, H = jc({ suppressNotifications: !1, internalUse: !0, tournamentRecord: u, event: j });
14746
14754
  if (H.error) return H;
14747
14755
  let W = H?.event, { stageParticipants: Y } = oA({ allUniqueParticipantIds: t, stageParticipantsCount: C, eventParticipantType: L, targetParticipants: E });
14748
14756
  if (U?.length) {
@@ -14758,7 +14766,7 @@ function pA(e) {
14758
14766
  if (K.error) return K;
14759
14767
  }
14760
14768
  }
14761
- return p && Gc({ tournamentRecord: u, event: W }), { drawIds: V, eventId: R, uniqueParticipantIds: B };
14769
+ return p && $c({ tournamentRecord: u, event: W }), { drawIds: V, eventId: R, uniqueParticipantIds: B };
14762
14770
  }
14763
14771
  function yS({ tournamentRecords: e, scheduleDate: t, venueId: r, round: i }) {
14764
14772
  if (!xr(t)) return { error: Ht };
@@ -14773,12 +14781,12 @@ function yS({ tournamentRecords: e, scheduleDate: t, venueId: r, round: i }) {
14773
14781
  let u = ["notBeforeTime"], l = (p) => Object.keys(p).filter((m) => !u.includes(m)).sort().map((m) => Ce(p[m]) ? l(p[m]) : p[m]).flat().join("|");
14774
14782
  if (c.rounds.find((p) => l(p) === l(i))) return F({ result: { error: fD }, stack: n });
14775
14783
  c.rounds.push(i);
14776
- let d = _c({ tournamentRecords: e, schedulingProfile: s });
14784
+ let d = Bc({ tournamentRecords: e, schedulingProfile: s });
14777
14785
  return d.error ? d : { ...x };
14778
14786
  }
14779
14787
  function hj({ schedulingProfile: e, tournamentRecord: t }) {
14780
14788
  if (typeof e != "object") return { error: z };
14781
- let r = Rc({ tournamentRecord: t }).containedStructures, i = Qt({ tournamentRecord: t }).matchUps ?? [], { tournamentId: n } = t, a = [];
14789
+ let r = Ec({ tournamentRecord: t }).containedStructures, i = Qt({ tournamentRecord: t }).matchUps ?? [], { tournamentId: n } = t, a = [];
14782
14790
  for (let s of e) {
14783
14791
  let { scheduleDate: o, venues: c = [] } = s;
14784
14792
  for (let u of c) {
@@ -14786,7 +14794,7 @@ function hj({ schedulingProfile: e, tournamentRecord: t }) {
14786
14794
  for (let p of l) {
14787
14795
  let { drawId: m, winnerFinishingPositionRange: f, roundSegment: h } = p, g = i.filter((I) => {
14788
14796
  let y = f?.indexOf("-") > 0 && f.split("-").map((w) => +w), U = I.finishingPositionRange?.winner;
14789
- return I.drawId === m && (!p.roundNumber || I.roundNumber === p.roundNumber) && (!U || !y || St(U, y).length === 2 || ye(U).length === ye(y).length && St(U, y).length === ye(U).length);
14797
+ return I.drawId === m && (!p.roundNumber || I.roundNumber === p.roundNumber) && (!U || !y || vt(U, y).length === 2 || ye(U).length === ye(y).length && vt(U, y).length === ye(U).length);
14790
14798
  })[0];
14791
14799
  if (g) {
14792
14800
  let { eventId: I, roundNumber: y, drawName: U, structureName: w, roundName: v } = g, D = g.structureId;
@@ -14820,7 +14828,7 @@ function Pf(e) {
14820
14828
  let ht = lr(tt);
14821
14829
  ht && rn(tt) && Ne[ht] && (Re[ht] = G * Ne[ht]);
14822
14830
  }), $e = et * ((G || 0) + K));
14823
- let Ze = i?.idPrefix ? `D-${f}-${i?.idPrefix}` : void 0, Ie = zc({ ...i, scaledParticipantsCount: p.scaledParticipantsCount || i.scaledParticipantsCount, participantsCount: $e, consideredDate: l?.startDate, sex: _ || i?.sex, rankingRange: p.rankingRange, uuids: p.uuids || h, ratingsParameters: u, participantType: V, gendersCount: Re, idPrefix: Ze, category: k }).participants;
14831
+ let Ze = i?.idPrefix ? `D-${f}-${i?.idPrefix}` : void 0, Ie = Yc({ ...i, scaledParticipantsCount: p.scaledParticipantsCount || i.scaledParticipantsCount, participantsCount: $e, consideredDate: l?.startDate, sex: _ || i?.sex, rankingRange: p.rankingRange, uuids: p.uuids || h, ratingsParameters: u, participantType: V, gendersCount: Re, idPrefix: Ze, category: k }).participants;
14824
14832
  if (Q.category && (Q.category.categoryName = W), l) {
14825
14833
  let tt = Oi({ participants: Ie, tournamentRecord: l });
14826
14834
  if (tt.error) return tt;
@@ -14889,7 +14897,7 @@ function Pf(e) {
14889
14897
  if (U === An) {
14890
14898
  let Ze = de.structures?.find((ht) => ht.stage === re);
14891
14899
  if (!Ze) return { error: lt };
14892
- xc({ structureId: Ze.structureId, tournamentRecord: l, drawDefinition: de });
14900
+ Fc({ structureId: Ze.structureId, tournamentRecord: l, drawDefinition: de });
14893
14901
  let Ie = M ? M - (Ne ?? 0) : void 0, tt = mp({ completionGoal: M ? Ie : void 0, matchUpStatusProfile: n, completeAllMatchUps: a, randomWinningSide: c, tournamentRecord: l, drawDefinition: de, matchUpFormat: y, event: Q });
14894
14902
  if (tt.error) return tt;
14895
14903
  }
@@ -14897,16 +14905,16 @@ function Pf(e) {
14897
14905
  if (M && $e({ completionGoal: M }), p.outcomes) {
14898
14906
  let { matchUps: Re } = vr({ inContext: !0, drawDefinition: de, event: Q });
14899
14907
  for (let et of p.outcomes) {
14900
- let { matchUpStatus: Ne = Ut, matchUpStatusCodes: Ze, stageSequence: Ie = 1, matchUpIndex: tt = 0, structureOrder: ht, matchUpFormat: Se, drawPositions: He, roundPosition: Ee, stage: Oe = re, roundNumber: Te, winningSide: qt, scoreString: gt } = et, It = Re?.reduce((Zt, Li) => {
14901
- let { structureId: hn, matchUpId: Yc } = Li;
14902
- return Zt[hn] ? Zt[hn].push(Yc) : Zt[hn] = [Yc], Zt;
14903
- }, {}) ?? [], je = Object.assign({}, ...Object.keys(It).map((Zt, Li) => ({ [Zt]: Li + 1 }))), Vt = Re?.filter((Zt) => (!Oe || Zt.stage === Oe) && (!Ie || Zt.stageSequence === Ie) && (!Te || Zt.roundNumber === Te) && (!Ee || Zt.roundPosition === Ee) && (!ht || je[Zt.structureId] === ht) && (!He || St(He, Zt.drawPositions).length === 2))?.[tt], Yi = cA({ matchUpStatusCodes: Ze, tournamentRecord: l, drawDefinition: de, targetMatchUp: Vt, matchUpFormat: Se, matchUpStatus: Ne, scoreString: gt, winningSide: qt });
14908
+ let { matchUpStatus: Ne = St, matchUpStatusCodes: Ze, stageSequence: Ie = 1, matchUpIndex: tt = 0, structureOrder: ht, matchUpFormat: Se, drawPositions: He, roundPosition: Ee, stage: Oe = re, roundNumber: Te, winningSide: qt, scoreString: gt } = et, It = Re?.reduce((Zt, Li) => {
14909
+ let { structureId: hn, matchUpId: Kc } = Li;
14910
+ return Zt[hn] ? Zt[hn].push(Kc) : Zt[hn] = [Kc], Zt;
14911
+ }, {}) ?? [], je = Object.assign({}, ...Object.keys(It).map((Zt, Li) => ({ [Zt]: Li + 1 }))), Vt = Re?.filter((Zt) => (!Oe || Zt.stage === Oe) && (!Ie || Zt.stageSequence === Ie) && (!Te || Zt.roundNumber === Te) && (!Ee || Zt.roundPosition === Ee) && (!ht || je[Zt.structureId] === ht) && (!He || vt(He, Zt.drawPositions).length === 2))?.[tt], Yi = cA({ matchUpStatusCodes: Ze, tournamentRecord: l, drawDefinition: de, targetMatchUp: Vt, matchUpFormat: Se, matchUpStatus: Ne, scoreString: gt, winningSide: qt });
14904
14912
  if (Yi?.error) return Yi;
14905
14913
  }
14906
14914
  }
14907
14915
  a && $e({ completeAllMatchUps: a });
14908
14916
  }
14909
- L && Gc({ tournamentRecord: l, event: Q });
14917
+ L && $c({ tournamentRecord: l, event: Q });
14910
14918
  } else {
14911
14919
  let le = pf({ drawEntries: de.entries, drawName: C || U, qualifyingPositions: D, drawId: ot, event: Q, stage: B });
14912
14920
  if (le.error) return le;
@@ -15010,7 +15018,7 @@ function SS({ tournamentRecord: e, ignoreExistingVenues: t, venueProfiles: r, uu
15010
15018
  return v;
15011
15019
  }
15012
15020
  s.push(l);
15013
- let D = Yo(n, a), S = !Array.isArray(d) && [{ startTime: p, endTime: m }].concat(D.map((T) => ({ date: Ti(T), startTime: p, endTime: m })));
15021
+ let D = Ko(n, a), S = !Array.isArray(d) && [{ startTime: p, endTime: m }].concat(D.map((T) => ({ date: Ti(T), startTime: p, endTime: m })));
15014
15022
  if (h || g) {
15015
15023
  let T = US({ dateAvailability: d || S, tournamentRecord: e, courtTimings: f, courtsCount: h, courtNames: g, startTime: p, idPrefix: y, courtIds: U, endTime: m, venueId: l, dates: D });
15016
15024
  if (T.error) return T;
@@ -15024,11 +15032,11 @@ function Uj(e) {
15024
15032
  let d = [], { tieFormatName: p = Wd, teamProfiles: m = [], teamsCount: f = 0, category: h, idPrefix: g, gender: I } = l, y = l.leagueName ?? l.eventName ?? `League ${c + 1}`, U = l.leagueId ?? l.eventId ?? o?.pop() ?? Be();
15025
15033
  i.push(U);
15026
15034
  let w = Ce(l.tieFormat) && l.tieFormat || zn({ event: { eventId: U, category: h, gender: I }, namedFormat: p, isMock: e.isMock }) || void 0;
15027
- if (!w) return { error: yc };
15035
+ if (!w) return { error: Uc };
15028
15036
  let v = Math.max(f, m.length), D = te(0, v), { genders: S, teamSize: T } = gS({ tieFormat: w, drawSize: v }), b = { [rr]: 0, [to]: 0, [Gn]: 0, [At]: 0, ANY: 0 };
15029
15037
  Object.keys(S).forEach((M) => b[M] += S[M]);
15030
15038
  for (let M of D) {
15031
- let N = m?.[M]?.teamName ?? `Team ${M + 1}`, R = m?.[M]?.teamId || o?.pop() || Be(), A = l.startDate ?? e.startDate, E = zc({ ...l?.participantsProfile, participantsCount: T, consideredDate: A, gendersCount: b, category: h, uuids: o }).participants, C = E.map((G) => G.participantId), k = Ge, O = R ?? dp({ participantType: k, idPrefix: g, index: M, uuids: o });
15039
+ let N = m?.[M]?.teamName ?? `Team ${M + 1}`, R = m?.[M]?.teamId || o?.pop() || Be(), A = l.startDate ?? e.startDate, E = Yc({ ...l?.participantsProfile, participantsCount: T, consideredDate: A, gendersCount: b, category: h, uuids: o }).participants, C = E.map((G) => G.participantId), k = Ge, O = R ?? dp({ participantType: k, idPrefix: g, index: M, uuids: o });
15032
15040
  d.push({ participantId: O, entryStatus: _r, entryStage: re });
15033
15041
  let L = m?.[M]?.venueIds ?? [], _ = { participantId: O, participantRole: nr, participantName: N, individualParticipantIds: C, participantType: k, homeVenueIds: L };
15034
15042
  L.forEach((G) => !n.includes(G) && n.push(G)), s.push(...C), s.push(O);
@@ -15096,7 +15104,7 @@ function vj(e) {
15096
15104
  if (c.error) return c;
15097
15105
  let { drawId: u, eventId: l, event: d, uniqueParticipantIds: p } = c;
15098
15106
  if (o?.addEvent !== !1) {
15099
- if (c = Vc({ suppressNotifications: !1, internalUse: !0, tournamentRecord: t, event: d }), c.error) return c;
15107
+ if (c = jc({ suppressNotifications: !1, internalUse: !0, tournamentRecord: t, event: d }), c.error) return c;
15100
15108
  u && a.push(u), n.push(l);
15101
15109
  }
15102
15110
  p?.length && i.push(...p), s += 1;
@@ -15207,7 +15215,7 @@ function IA({ keepExtensions: e = [], anonymizeParticipantNames: t = !0, tournam
15207
15215
  Array.isArray(C?.value) && C?.value.forEach((O) => {
15208
15216
  O.tournamentId = c[O.tournamentId], O.structureId = c[O.structureId], O.eventId = c[O.eventId], O.drawId = c[O.drawId];
15209
15217
  });
15210
- let { extension: k } = De({ element: r, name: Mc });
15218
+ let { extension: k } = De({ element: r, name: Nc });
15211
15219
  return Array.isArray(k?.value) && k?.value.forEach((O) => {
15212
15220
  O.personId = c[O.personId];
15213
15221
  }), { ...x };
@@ -15241,7 +15249,7 @@ function yA(e) {
15241
15249
  if (V.error || (V = uA({ matchUpStatusProfile: i, completeAllMatchUps: n, randomWinningSide: o, tournamentRecord: u, drawProfiles: C, isMock: h, event: N }), V.error)) return V;
15242
15250
  U.push(...V.drawIds);
15243
15251
  }
15244
- k && Gc({ tournamentRecord: u, event: N });
15252
+ k && $c({ tournamentRecord: u, event: N });
15245
15253
  } else {
15246
15254
  let R = pA({ startDate: u.startDate, allUniqueParticipantIds: I, matchUpStatusProfile: i, participantsProfile: r, completeAllMatchUps: n, autoEntryPositions: a, randomWinningSide: o, ratingsParameters: M, tournamentRecord: u, eventProfile: P, eventIndex: b, uuids: g });
15247
15255
  if (R.error) return R;
@@ -15256,13 +15264,13 @@ function yA(e) {
15256
15264
  let M = Pf({ startDate: u.startDate, allUniqueParticipantIds: I, matchUpStatusProfile: i, participantsProfile: r, completeAllMatchUps: n, autoEntryPositions: a, hydrateCollections: s, randomWinningSide: o, ratingsParameters: t, tournamentRecord: u, drawProfile: P, drawIndex: b, uuids: g });
15257
15265
  if (M.error) return M;
15258
15266
  let { drawId: N, eventId: R, event: A, uniqueParticipantIds: E } = M;
15259
- if (M = Vc({ tournamentRecord: u, event: A, internalUse: !0 }), M.error) return M;
15267
+ if (M = jc({ tournamentRecord: u, event: A, internalUse: !0 }), M.error) return M;
15260
15268
  N && U.push(N), y.push(R), E?.length && I.push(...E), b += 1;
15261
15269
  }
15262
15270
  }
15263
15271
  let D = m?.length ? SS({ tournamentRecord: u, venueProfiles: m }) : [], S, T = {};
15264
15272
  if (c?.length) {
15265
- let b = { [u.tournamentId]: u }, P = _c({ tournamentRecords: b, schedulingProfile: c });
15273
+ let b = { [u.tournamentId]: u }, P = Bc({ tournamentRecords: b, schedulingProfile: c });
15266
15274
  if (P.error) return P;
15267
15275
  if (l) {
15268
15276
  let { tournamentId: M } = u, N = { [M]: u };
@@ -15272,7 +15280,7 @@ function yA(e) {
15272
15280
  return { totalParticipantsCount: u.participants.length, scheduledRounds: S, schedulerResult: T, ...x, eventIds: y, venueIds: D, drawIds: U };
15273
15281
  }
15274
15282
  var UA = {};
15275
- Pe(UA, { addDynamicRatings: () => Hy, addIndividualParticipantIds: () => gf, addParticipant: () => ln, addParticipants: () => Oi, addPenalty: () => VA, addPersonRequests: () => PA, addPersons: () => jA, createGroupParticipant: () => AA, createTeamsFromParticipantAttributes: () => hS, deleteParticipants: () => go, filterParticipants: () => Ol, findParticipant: () => EA, getCompetitionParticipants: () => oU, getPairedParticipant: () => Ci, getParticipantEventDetails: () => cU, getParticipantMembership: () => uU, getParticipantScaleItem: () => oc, getParticipantSchedules: () => lU, getParticipantSignInStatus: () => dU, getParticipantTimeItem: () => LI, getParticipants: () => pt, getScaleValues: () => Pc, mergeParticipants: () => BA, modifyIndividualParticipantIds: () => bA, modifyParticipant: () => If, modifyParticipantName: () => CA, modifyParticipantOtherName: () => NA, modifyParticipantsSignInStatus: () => MA, modifyPenalty: () => LA, modifyPersonRequests: () => DA, mutate: () => SA, participantScaleItem: () => Dn, query: () => DR, regenerateParticipantNames: () => RA, removeIndividualParticipantIds: () => iy, removeParticipantIdsFromAllTeams: () => wm, removePenalty: () => xA, removePersonRequests: () => TA, removeRatings: () => kA, scaledTeamAssignment: () => OA, setParticipantScaleItem: () => Kl, setParticipantScaleItems: () => vN, validateLineUp: () => Tm });
15283
+ Pe(UA, { addDynamicRatings: () => Hy, addIndividualParticipantIds: () => gf, addParticipant: () => ln, addParticipants: () => Oi, addPenalty: () => VA, addPersonRequests: () => PA, addPersons: () => jA, createGroupParticipant: () => AA, createTeamsFromParticipantAttributes: () => hS, deleteParticipants: () => go, filterParticipants: () => Ol, findParticipant: () => EA, getCompetitionParticipants: () => oU, getPairedParticipant: () => Ci, getParticipantEventDetails: () => cU, getParticipantMembership: () => uU, getParticipantScaleItem: () => cc, getParticipantSchedules: () => lU, getParticipantSignInStatus: () => dU, getParticipantTimeItem: () => LI, getParticipants: () => pt, getScaleValues: () => bc, mergeParticipants: () => BA, modifyIndividualParticipantIds: () => bA, modifyParticipant: () => If, modifyParticipantName: () => CA, modifyParticipantOtherName: () => NA, modifyParticipantsSignInStatus: () => MA, modifyPenalty: () => LA, modifyPersonRequests: () => DA, mutate: () => SA, participantScaleItem: () => Dn, query: () => DR, regenerateParticipantNames: () => RA, removeIndividualParticipantIds: () => iy, removeParticipantIdsFromAllTeams: () => wm, removePenalty: () => xA, removePersonRequests: () => TA, removeRatings: () => kA, scaledTeamAssignment: () => OA, setParticipantScaleItem: () => Kl, setParticipantScaleItems: () => vN, validateLineUp: () => Tm });
15276
15284
  var SA = {};
15277
15285
  Pe(SA, { addDynamicRatings: () => Hy, addIndividualParticipantIds: () => gf, addParticipant: () => ln, addParticipants: () => Oi, addPenalty: () => VA, addPersonRequests: () => PA, addPersons: () => jA, createGroupParticipant: () => AA, createTeamsFromParticipantAttributes: () => hS, deleteParticipants: () => go, findParticipant: () => EA, mergeParticipants: () => BA, modifyIndividualParticipantIds: () => bA, modifyParticipant: () => If, modifyParticipantName: () => CA, modifyParticipantOtherName: () => NA, modifyParticipantsSignInStatus: () => MA, modifyPenalty: () => LA, modifyPersonRequests: () => DA, regenerateParticipantNames: () => RA, removeIndividualParticipantIds: () => iy, removeParticipantIdsFromAllTeams: () => wm, removePenalty: () => xA, removePersonRequests: () => TA, removeRatings: () => kA, scaledTeamAssignment: () => OA, setParticipantScaleItem: () => Kl, setParticipantScaleItems: () => vN });
15278
15286
  function vA(e = 0) {
@@ -15300,7 +15308,7 @@ function vS(e) {
15300
15308
  let u = r[c];
15301
15309
  u.length && o.push({ personId: c, requests: u });
15302
15310
  }
15303
- Object.keys(o).length && Le({ element: a, extension: { value: o, name: Mc } });
15311
+ Object.keys(o).length && Le({ element: a, extension: { value: o, name: Nc } });
15304
15312
  }
15305
15313
  return { ...x };
15306
15314
  }
@@ -15329,7 +15337,7 @@ function TA(e) {
15329
15337
  if (n && o?.[n]) c(n);
15330
15338
  else if (o) for (let l of Object.keys(o)) c(l);
15331
15339
  }
15332
- return u || !o || !Object.keys(o).length ? Sr({ name: Mc, tournamentRecords: t, discover: !0 }) : vS({ tournamentRecords: t, personRequests: o });
15340
+ return u || !o || !Object.keys(o).length ? Sr({ name: Nc, tournamentRecords: t, discover: !0 }) : vS({ tournamentRecords: t, personRequests: o });
15333
15341
  }
15334
15342
  function PA(e) {
15335
15343
  let { tournamentRecords: t, personId: r, requests: i } = e, n = se(e, [{ [mr]: !0, [gk]: !0 }, { requests: !0, [Ar]: ur, [ti]: z }]);
@@ -15504,7 +15512,7 @@ function OA({ clearExistingAssignments: e = !0, individualParticipantIds: t, rev
15504
15512
  I.entries = (I.entries ?? []).filter((S) => !v.includes(S.participantId)), (I.drawDefinitions ?? []).forEach((S) => {
15505
15513
  S.entries = (S.entries ?? []).filter((T) => !v.includes(T.participantId));
15506
15514
  });
15507
- let { flightProfile: D } = wt({ event: I });
15515
+ let { flightProfile: D } = Dt({ event: I });
15508
15516
  (D?.flights || []).forEach((S) => {
15509
15517
  S.drawEntries = (S.drawEntries || []).filter((T) => !v.includes(T.participantId));
15510
15518
  });
@@ -15524,7 +15532,7 @@ function xA(e) {
15524
15532
  if (typeof t != "object" || !Object.keys(t).length) return { error: mt };
15525
15533
  for (let r of Object.values(t)) {
15526
15534
  let i = bj({ ...e, tournamentRecord: r });
15527
- if (i.error && i.error !== zo) return i;
15535
+ if (i.error && i.error !== Yo) return i;
15528
15536
  }
15529
15537
  return { ...x };
15530
15538
  }
@@ -15535,7 +15543,7 @@ function bj({ tournamentRecord: e, penaltyId: t }) {
15535
15543
  return r.forEach((s) => {
15536
15544
  let o = !1;
15537
15545
  s.penalties = (s.penalties ?? []).filter((c) => (c.penaltyId === t && (o = !0, n || (a = c, n = !0)), o && i.push(s), c.penaltyId !== t));
15538
- }), a && Ue({ topic: or, payload: { tournamentId: e.tournamentId, participants: i } }), a ? { ...x, penalty: a } : { error: zo };
15546
+ }), a && Ue({ topic: or, payload: { tournamentId: e.tournamentId, participants: i } }), a ? { ...x, penalty: a } : { error: Yo };
15539
15547
  }
15540
15548
  var Mj = ({ penaltyId: e = Be() } = {}) => ({ refereeParticipantId: void 0, penaltyCode: void 0, penaltyType: void 0, extensions: void 0, matchUpId: void 0, createdAt: void 0, issuedAt: void 0, notes: void 0, penaltyId: e }), FA = Mj;
15541
15549
  function LA(e) {
@@ -15543,9 +15551,9 @@ function LA(e) {
15543
15551
  if (typeof t != "object" || !Object.keys(t).length) return { error: mt };
15544
15552
  for (let r of Object.values(t)) {
15545
15553
  let i = Nj({ ...e, tournamentRecord: r });
15546
- if (i.error && i.error !== zo || i.success) return i;
15554
+ if (i.error && i.error !== Yo || i.success) return i;
15547
15555
  }
15548
- return { error: zo };
15556
+ return { error: Yo };
15549
15557
  }
15550
15558
  function Nj({ tournamentRecord: e, modifications: t, penaltyId: r }) {
15551
15559
  if (!e) return { error: J };
@@ -15557,7 +15565,7 @@ function Nj({ tournamentRecord: e, modifications: t, penaltyId: r }) {
15557
15565
  return i.forEach((c) => {
15558
15566
  let u = !1;
15559
15567
  c.penalties = (c.penalties ?? []).map((l) => (l.penaltyId === r && (u = !0, a.forEach((d) => Object.assign(l, { [d]: t[d] })), s || (s = l)), l)), u && o.push(c);
15560
- }), s && Ue({ topic: or, payload: { tournamentId: e.tournamentId, participants: o } }), s ? { ...x, penalty: s } : { error: zo };
15568
+ }), s && Ue({ topic: or, payload: { tournamentId: e.tournamentId, participants: o } }), s ? { ...x, penalty: s } : { error: Yo };
15561
15569
  }
15562
15570
  function _A(e, t, r) {
15563
15571
  return !e && t ? t : e && !t || typeof e != "object" || typeof t != "object" ? e : ye(Object.keys(e).concat(Object.keys(t))).reduce((i, n) => {
@@ -15629,14 +15637,14 @@ function jA({ participantRole: e = nr, tournamentRecord: t, persons: r }) {
15629
15637
  return { ...x, addedCount: m, newPersonIds: n };
15630
15638
  }
15631
15639
  var GA = {};
15632
- Pe(GA, { bulkUpdatePublishedEventIds: () => yU, getAllEventData: () => UU, getCourtInfo: () => Im, getDrawData: () => Xm, getEventData: () => Qm, getEventPublishStatus: () => Ui, getPublishState: () => ho, getTournamentPublishStatus: () => Cl, getVenueData: () => ac, mutate: () => $A, publishEvent: () => Gc, publishEventSeeding: () => WA, publishOrderOfPlay: () => KA, publishParticipants: () => YA, query: () => RR, setEventDisplay: () => df, unPublishEvent: () => XA, unPublishEventSeeding: () => qA, unPublishOrderOfPlay: () => zA, unPublishParticipants: () => HA });
15640
+ Pe(GA, { bulkUpdatePublishedEventIds: () => yU, getAllEventData: () => UU, getCourtInfo: () => Im, getDrawData: () => Xm, getEventData: () => Qm, getEventPublishStatus: () => Ui, getPublishState: () => ho, getTournamentPublishStatus: () => Cl, getVenueData: () => sc, mutate: () => $A, publishEvent: () => $c, publishEventSeeding: () => WA, publishOrderOfPlay: () => KA, publishParticipants: () => YA, query: () => RR, setEventDisplay: () => df, unPublishEvent: () => XA, unPublishEventSeeding: () => qA, unPublishOrderOfPlay: () => zA, unPublishParticipants: () => HA });
15633
15641
  var $A = {};
15634
- Pe($A, { publishEvent: () => Gc, publishEventSeeding: () => WA, publishOrderOfPlay: () => KA, publishParticipants: () => YA, setEventDisplay: () => df, unPublishEvent: () => XA, unPublishEventSeeding: () => qA, unPublishOrderOfPlay: () => zA, unPublishParticipants: () => HA });
15642
+ Pe($A, { publishEvent: () => $c, publishEventSeeding: () => WA, publishOrderOfPlay: () => KA, publishParticipants: () => YA, setEventDisplay: () => df, unPublishEvent: () => XA, unPublishEventSeeding: () => qA, unPublishOrderOfPlay: () => zA, unPublishParticipants: () => HA });
15635
15643
  function WA({ removePriorValues: e = !0, stageSeedingScaleNames: t, seedingScaleNames: r, tournamentRecord: i, status: n = ni, drawIds: a = [], event: s }) {
15636
15644
  if (!i) return { error: J };
15637
15645
  if (!s) return { error: it };
15638
15646
  let o = Ui({ event: s, status: n }), c = (o?.seeding?.seedingScaleNames || r) && { ...o?.seeding?.seedingScaleNames, ...r }, u = (o?.seeding?.stageSeedingScaleNames || t) && { ...o?.seeding?.stageSeedingScaleNames, ...t }, l = ae({ stageSeedingScaleNames: u, seedingScaleNames: c, published: !0, drawIds: a });
15639
- return jc({ statusObject: { seeding: l }, removePriorValues: e, status: n, event: s }), Ue({ topic: XP, payload: { tournamentId: i.tournamentId, eventId: s.eventId, drawIds: a } }), { ...x };
15647
+ return Gc({ statusObject: { seeding: l }, removePriorValues: e, status: n, event: s }), Ue({ topic: XP, payload: { tournamentId: i.tournamentId, eventId: s.eventId, drawIds: a } }), { ...x };
15640
15648
  }
15641
15649
  function qA({ removePriorValues: e = !0, seedingScaleNames: t, tournamentRecord: r, status: i = ni, drawIds: n, stages: a, event: s }) {
15642
15650
  if (!r) return { error: J };
@@ -15645,7 +15653,7 @@ function qA({ removePriorValues: e = !0, seedingScaleNames: t, tournamentRecord:
15645
15653
  if (o) {
15646
15654
  let c = o.seeding;
15647
15655
  if (Array.isArray(a) && c.stageSeedingScaleNames) for (let u of a) c.stageSeedingScaleNames[u] && delete c.stageSeedingScaleNames[u];
15648
- Array.isArray(t) && c?.seedingScaleNames && (c.seedingScaleNames = c.seedingScaleNames.filter((u) => !t.includes(u))), Array.isArray(n) && c?.drawIds && (c.drawIds = c.drawIds.filter((u) => !n.includes(u))), (!Object.values(c.stageSeedingScaleNames ?? {}).length && !c.seedingScaleNames?.length && !c.drawIds?.length || !a && !t && !n?.length) && (delete c.stageSeedingScaleNames, delete c.seedingScaleNames, delete c.drawIds, c.published = !1), jc({ statusObject: { seeding: c }, removePriorValues: e, status: i, event: s });
15656
+ Array.isArray(t) && c?.seedingScaleNames && (c.seedingScaleNames = c.seedingScaleNames.filter((u) => !t.includes(u))), Array.isArray(n) && c?.drawIds && (c.drawIds = c.drawIds.filter((u) => !n.includes(u))), (!Object.values(c.stageSeedingScaleNames ?? {}).length && !c.seedingScaleNames?.length && !c.drawIds?.length || !a && !t && !n?.length) && (delete c.stageSeedingScaleNames, delete c.seedingScaleNames, delete c.drawIds, c.published = !1), Gc({ statusObject: { seeding: c }, removePriorValues: e, status: i, event: s });
15649
15657
  }
15650
15658
  return Ue({ topic: OI, payload: { tournamentId: r.tournamentId, eventId: s.eventId } }), { ...x };
15651
15659
  }
@@ -15709,7 +15717,7 @@ function XA({ removePriorValues: e = !0, tournamentRecord: t, status: r = ni, ev
15709
15717
  if (!t) return { error: J };
15710
15718
  if (!i) return { error: it };
15711
15719
  let n = `${Oa}.${ka}`, { timeItem: a } = gl({ itemType: n, event: i }), s = a?.itemValue || { [r]: {} };
15712
- return delete s[r].structureIds, delete s[r].drawDetails, delete s[r].drawIds, So({ event: i, timeItem: { itemValue: s, itemType: n }, removePriorValues: e }), jc({ statusObject: { structureIds: void 0, drawIds: void 0, seeding: void 0 }, removePriorValues: e, status: r, event: i }), Ue({ topic: CI, payload: { tournamentId: t.tournamentId, eventId: i.eventId } }), { eventId: i.eventId, ...x };
15720
+ return delete s[r].structureIds, delete s[r].drawDetails, delete s[r].drawIds, So({ event: i, timeItem: { itemValue: s, itemType: n }, removePriorValues: e }), Gc({ statusObject: { structureIds: void 0, drawIds: void 0, seeding: void 0 }, removePriorValues: e, status: r, event: i }), Ue({ topic: CI, payload: { tournamentId: t.tournamentId, eventId: i.eventId } }), { eventId: i.eventId, ...x };
15713
15721
  }
15714
15722
  var QA = {};
15715
15723
  Pe(QA, { getEntryStatusReports: () => xj, getParticipantStats: () => kj, getStructureReports: () => Lj, getVenuesReport: () => Bj });
@@ -15739,7 +15747,7 @@ function kj({ withCompetitiveProfiles: e, opponentParticipantId: t, withIndividu
15739
15747
  N && (N.participantName = M.participantName);
15740
15748
  }
15741
15749
  }
15742
- let b = ({ side: P, individualParticipantIds: M }) => P.participantId && (!M?.length || M.includes(P.participantId)) && [P.participantId] || P.participant?.individualParticipantIds?.length && (!M?.length || St(M, P.participant?.individualParticipantIds).length === P.participant?.individualParticipantIds?.length) && P.participant.individualParticipantIds;
15750
+ let b = ({ side: P, individualParticipantIds: M }) => P.participantId && (!M?.length || M.includes(P.participantId)) && [P.participantId] || P.participant?.individualParticipantIds?.length && (!M?.length || vt(M, P.participant?.individualParticipantIds).length === P.participant?.individualParticipantIds?.length) && P.participant.individualParticipantIds;
15743
15751
  if (f.size) {
15744
15752
  let P = (M, N) => {
15745
15753
  for (let R of S) {
@@ -15888,7 +15896,7 @@ function Fj({ eventType: e, matchUps: t, eventId: r, drawId: i }) {
15888
15896
  }
15889
15897
  function Lj(e) {
15890
15898
  let { tournamentRecord: t, extensionProfiles: r, firstFlightOnly: i, firstStageSequenceOnly: n = !0 } = e;
15891
- if (!t) return { error: qo };
15899
+ if (!t) return { error: Ho };
15892
15900
  let a = [], s = {}, o = {}, c = [], u = Object.assign({}, ...(r ?? []).map(({ name: h, label: g, accessor: I }) => {
15893
15901
  let y = De({ element: t, name: h })?.extension?.value, U = I ? Ns({ element: y, accessor: I })?.value : y;
15894
15902
  return { [g ?? h]: U };
@@ -15901,8 +15909,8 @@ function Lj(e) {
15901
15909
  let D = I?.find((A) => A.name === Ei)?.value?.flights?.map((A) => ({ [A.drawId]: A.flightNumber })), S = D && Object.assign({}, ...D), T = I?.find((A) => A.name === Ga), b = h?.find((A) => A.itemType === Ga), P = T?.value?.length ?? b?.itemValue ?? 0, M = Object.values(S ?? {}), N = S && Math.min(...M), R = p(h);
15902
15910
  return o[w] = { seedingBasis: R ? JSON.stringify(R) : void 0, totalPositionManipulations: 0, maxPositionManipulations: 0, generatedDrawsCount: 0, drawDeletionsCount: P, tournamentId: l, eventId: w }, g.filter((A) => !i || !D || S[A.drawId] === N).flatMap((A) => {
15903
15911
  let { matchUpFormat: E, tieFormat: C, timeItems: k, extensions: O, structures: L, drawName: _, drawType: B, drawId: G } = A, { matchUpFormatCounts: $, matchUpsCount: j, avgConfidence: V, pctNoRating: H, avgWTN: W } = Fj({ eventType: y, matchUps: d, drawId: G }), Y = p(k) ?? R, q = _j({ extensions: O }), K = q?.length ?? 0;
15904
- return m({ positionManipulations: q }), o[w].totalPositionManipulations += K, o[w].generatedDrawsCount += 1, K > o[w].maxPositionManipulations && (o[w].maxPositionManipulations = K), L?.filter((X) => (X.stageSequence === 1 || !n) && [oe, re, sr, yt].includes(X.stage)).map((X) => {
15905
- let Q = [re, yt].includes(X.stage) ? d.find((It) => It.structureId === X.structureId && It.finishingRound === 1 && It.winningSide) : void 0;
15912
+ return m({ positionManipulations: q }), o[w].totalPositionManipulations += K, o[w].generatedDrawsCount += 1, K > o[w].maxPositionManipulations && (o[w].maxPositionManipulations = K), L?.filter((X) => (X.stageSequence === 1 || !n) && [oe, re, sr, Ut].includes(X.stage)).map((X) => {
15913
+ let Q = [re, Ut].includes(X.stage) ? d.find((It) => It.structureId === X.structureId && It.finishingRound === 1 && It.winningSide) : void 0;
15906
15914
  X.stage === re && a.push({ eventName: U, drawName: _, structureId: X.structureId });
15907
15915
  let Z = Q?.sides?.find((It) => It.sideNumber === Q.winningSide)?.participant, ee = Z?.participantType === br && Z.participantId, ue = Z?.participantType === we ? Z.individualParticipants : [], he = hp({ participant: ue?.[0] ?? Z, eventType: y }), { personId: qe, personOtherId: Fe, tennisId: Xe, confidence: Mt, wtnRating: Jt } = he || {}, bt = hp({ participant: ue?.[1], eventType: y }), { personId: de, personOtherId: ot, tennisId: le, confidence: $e, wtnRating: Re } = bt || {}, { ageCategoryCode: et, categoryName: Ne, subType: Ze } = v ?? {}, Ie = X.matchUpFormat ?? E, tt = ($[Ie] ?? 0) / j * 100, { tieFormatName: ht, tieFormatDesc: Se } = cp(C), { tieFormatName: He, tieFormatDesc: Ee } = cp(X.tieFormat), Oe = Se === Ee, Te = !Oe && He, qt = X.tieFormat && !Oe && Ee, gt = q?.filter((It) => It.structureId === X.structureId)?.length ?? 0;
15908
15916
  return { ...u, tournamentId: l, eventId: w, structureId: X.structureId, drawId: G, eventType: y, category: Ze, categoryName: Ne, ageCategoryCode: et, flightNumber: S?.[G], drawType: B, stage: X.stage, seedingBasis: Y ? JSON.stringify(Y) : void 0, winningPersonId: qe, winningPersonOtherId: Fe, winningPersonTennisId: Xe, winningPersonWTNrating: Jt, winningPersonWTNconfidence: Mt, winningPerson2Id: de, winningPerson2OtherId: ot, winningPerson2TennisId: le, winningPerson2WTNrating: Re, winningPerson2WTNconfidence: $e, winningTeamId: ee, positionManipulations: gt, pctNoRating: H, matchUpFormat: Ie, pctInitialMatchUpFormat: tt, matchUpsCount: j, drawTieFormatName: ht, drawTieFormatDesc: Se, tieFormatName: Te, tieFormatDesc: qt, avgConfidence: V, avgWTN: W };
@@ -15914,7 +15922,7 @@ function Lj(e) {
15914
15922
  }), { eventStructureReports: Object.values(o), structureReports: f, flightReports: c };
15915
15923
  }
15916
15924
  function _j({ extensions: e }) {
15917
- return e?.find(({ name: t }) => t === jo)?.value?.slice(1);
15925
+ return e?.find(({ name: t }) => t === Go)?.value?.slice(1);
15918
15926
  }
15919
15927
  function Bj({ ignoreDisabled: e = !0, tournamentRecords: t, tournamentId: r, venueIds: i = [], dates: n = [] }) {
15920
15928
  if (!Array.isArray(n)) return { error: z, dates: n };
@@ -15934,7 +15942,7 @@ function Vj(e, t, r) {
15934
15942
  return e.forEach((o) => {
15935
15943
  let c = 0, u = 0, l = 0;
15936
15944
  for (let m of n) {
15937
- let f = m.dateAvailability.find((g) => g.date === o), h = (f && $c({ courtDate: f }).timeSlots)?.reduce((g, I) => {
15945
+ let f = m.dateAvailability.find((g) => g.date === o), h = (f && Wc({ courtDate: f }).timeSlots)?.reduce((g, I) => {
15938
15946
  let { startTime: y, endTime: U } = I, w = ke(U) - ke(y);
15939
15947
  return g + w;
15940
15948
  }, 0);
@@ -15950,9 +15958,9 @@ function Vj(e, t, r) {
15950
15958
  }), { venueId: i, venueName: a, venueReport: s };
15951
15959
  }
15952
15960
  var JA = {};
15953
- Pe(JA, { addMatchUpCourtOrder: () => tS, addMatchUpEndTime: () => iS, addMatchUpOfficial: () => LE, addMatchUpResumeTime: () => aS, addMatchUpScheduleItems: () => Sf, addMatchUpScheduledDate: () => yf, addMatchUpScheduledTime: () => Fa, addMatchUpStartTime: () => rS, addMatchUpStopTime: () => nS, addSchedulingProfileRound: () => yS, allocateTeamMatchUpCourts: () => Uf, assignMatchUpCourt: () => To, assignMatchUpVenue: () => qc, bulkRescheduleMatchUps: () => sC, bulkScheduleMatchUps: () => od, bulkScheduleTournamentMatchUps: () => Wu, bulkUpdateCourtAssignments: () => rC, calculateScheduleTimes: () => wS, clearMatchUpSchedule: () => cC, clearScheduledMatchUps: () => wf, courtGridRows: () => rf, findMatchUpFormatTiming: () => Zm, findVenue: () => Bn, generateBookings: () => vf, generateVirtualCourts: () => mf, getMatchUpsToSchedule: () => Jm, getPersonRequests: () => Ss, getProfileRounds: () => tf, getScheduledRoundsDetails: () => Ql, getSchedulingProfile: () => ua, getSchedulingProfileIssues: () => SU, matchUpScheduleChange: () => oC, modifyMatchUpFormatTiming: () => BU, mutate: () => ZA, proAutoSchedule: () => tC, proConflicts: () => nC, publicFindCourt: () => YI, query: () => kR, removeEventMatchUpFormatTiming: () => lf, removeMatchUpCourtAssignment: () => eC, reorderUpcomingMatchUps: () => aC, scheduleMatchUps: () => iC, scheduleProfileRounds: () => Df, setMatchUpDailyLimits: () => uC, setMatchUpHomeParticipantId: () => eS, setSchedulingProfile: () => _c, toggleParticipantCheckInState: () => hf, validateSchedulingProfile: () => ef });
15961
+ Pe(JA, { addMatchUpCourtOrder: () => tS, addMatchUpEndTime: () => iS, addMatchUpOfficial: () => LE, addMatchUpResumeTime: () => aS, addMatchUpScheduleItems: () => Sf, addMatchUpScheduledDate: () => yf, addMatchUpScheduledTime: () => Fa, addMatchUpStartTime: () => rS, addMatchUpStopTime: () => nS, addSchedulingProfileRound: () => yS, allocateTeamMatchUpCourts: () => Uf, assignMatchUpCourt: () => To, assignMatchUpVenue: () => Hc, bulkRescheduleMatchUps: () => sC, bulkScheduleMatchUps: () => od, bulkScheduleTournamentMatchUps: () => Wu, bulkUpdateCourtAssignments: () => rC, calculateScheduleTimes: () => wS, clearMatchUpSchedule: () => cC, clearScheduledMatchUps: () => wf, courtGridRows: () => rf, findMatchUpFormatTiming: () => Zm, findVenue: () => Bn, generateBookings: () => vf, generateVirtualCourts: () => mf, getMatchUpsToSchedule: () => Jm, getPersonRequests: () => Ss, getProfileRounds: () => tf, getScheduledRoundsDetails: () => Ql, getSchedulingProfile: () => ua, getSchedulingProfileIssues: () => SU, matchUpScheduleChange: () => oC, modifyMatchUpFormatTiming: () => BU, mutate: () => ZA, proAutoSchedule: () => tC, proConflicts: () => nC, publicFindCourt: () => YI, query: () => kR, removeEventMatchUpFormatTiming: () => lf, removeMatchUpCourtAssignment: () => eC, reorderUpcomingMatchUps: () => aC, scheduleMatchUps: () => iC, scheduleProfileRounds: () => Df, setMatchUpDailyLimits: () => uC, setMatchUpHomeParticipantId: () => eS, setSchedulingProfile: () => Bc, toggleParticipantCheckInState: () => hf, validateSchedulingProfile: () => ef });
15954
15962
  var ZA = {};
15955
- Pe(ZA, { addMatchUpCourtOrder: () => tS, addMatchUpEndTime: () => iS, addMatchUpOfficial: () => LE, addMatchUpResumeTime: () => aS, addMatchUpScheduleItems: () => Sf, addMatchUpScheduledDate: () => yf, addMatchUpScheduledTime: () => Fa, addMatchUpStartTime: () => rS, addMatchUpStopTime: () => nS, addSchedulingProfileRound: () => yS, allocateTeamMatchUpCourts: () => Uf, assignMatchUpCourt: () => To, assignMatchUpVenue: () => qc, bulkRescheduleMatchUps: () => sC, bulkScheduleMatchUps: () => od, bulkScheduleTournamentMatchUps: () => Wu, bulkUpdateCourtAssignments: () => rC, calculateScheduleTimes: () => wS, clearMatchUpSchedule: () => cC, clearScheduledMatchUps: () => wf, findMatchUpFormatTiming: () => Zm, generateBookings: () => vf, generateVirtualCourts: () => mf, matchUpScheduleChange: () => oC, modifyMatchUpFormatTiming: () => BU, proAutoSchedule: () => tC, proConflicts: () => nC, removeEventMatchUpFormatTiming: () => lf, removeMatchUpCourtAssignment: () => eC, reorderUpcomingMatchUps: () => aC, scheduleMatchUps: () => iC, scheduleProfileRounds: () => Df, setMatchUpDailyLimits: () => uC, setMatchUpHomeParticipantId: () => eS, setSchedulingProfile: () => _c, toggleParticipantCheckInState: () => hf, validateSchedulingProfile: () => ef });
15963
+ Pe(ZA, { addMatchUpCourtOrder: () => tS, addMatchUpEndTime: () => iS, addMatchUpOfficial: () => LE, addMatchUpResumeTime: () => aS, addMatchUpScheduleItems: () => Sf, addMatchUpScheduledDate: () => yf, addMatchUpScheduledTime: () => Fa, addMatchUpStartTime: () => rS, addMatchUpStopTime: () => nS, addSchedulingProfileRound: () => yS, allocateTeamMatchUpCourts: () => Uf, assignMatchUpCourt: () => To, assignMatchUpVenue: () => Hc, bulkRescheduleMatchUps: () => sC, bulkScheduleMatchUps: () => od, bulkScheduleTournamentMatchUps: () => Wu, bulkUpdateCourtAssignments: () => rC, calculateScheduleTimes: () => wS, clearMatchUpSchedule: () => cC, clearScheduledMatchUps: () => wf, findMatchUpFormatTiming: () => Zm, generateBookings: () => vf, generateVirtualCourts: () => mf, matchUpScheduleChange: () => oC, modifyMatchUpFormatTiming: () => BU, proAutoSchedule: () => tC, proConflicts: () => nC, removeEventMatchUpFormatTiming: () => lf, removeMatchUpCourtAssignment: () => eC, reorderUpcomingMatchUps: () => aC, scheduleMatchUps: () => iC, scheduleProfileRounds: () => Df, setMatchUpDailyLimits: () => uC, setMatchUpHomeParticipantId: () => eS, setSchedulingProfile: () => Bc, toggleParticipantCheckInState: () => hf, validateSchedulingProfile: () => ef });
15956
15964
  function wS({ calculateStartTimeFromCourts: e = !0, defaultRecoveryMinutes: t = 0, averageMatchUpMinutes: r = 90, remainingScheduleTimes: i, clearScheduleDates: n, tournamentRecords: a, periodLength: s, scheduleDate: o, startTime: c, venueIds: u, endTime: l }) {
15957
15965
  if (typeof a != "object" || !Object.keys(a).length) return { error: mt };
15958
15966
  s = s ?? ff({ recoveryMinutes: t, averageMatchUpMinutes: r });
@@ -16050,7 +16058,7 @@ function iC(e) {
16050
16058
  if (w.error) return w;
16051
16059
  let v = e.competitionMatchUps ?? Hi({ nextMatchUps: !0, tournamentRecords: t }).matchUps ?? [], D = e.matchUpDependencies ?? Fi({ includeParticipantDependencies: !0, matchUps: v, tournamentRecords: t }).matchUpDependencies;
16052
16060
  v.forEach((V) => {
16053
- V.schedule?.scheduledDate && Mn(f, ve(V.schedule.scheduledDate)) && uc({ matchUpPotentialParticipantIds: s, matchUpNotBeforeTimes: c, matchUp: V });
16061
+ V.schedule?.scheduledDate && Mn(f, ve(V.schedule.scheduledDate)) && lc({ matchUpPotentialParticipantIds: s, matchUpNotBeforeTimes: c, matchUp: V });
16054
16062
  });
16055
16063
  let S = h.map((V) => v.find((H) => H.matchUpId === V)).filter(Boolean), { venueId: T, scheduleTimes: b, dateScheduledMatchUpIds: P } = wS({ tournamentRecords: t, remainingScheduleTimes: d, startTime: at(I), endTime: at(y), scheduleDate: ve(f), averageMatchUpMinutes: i, clearScheduleDates: p, periodLength: m, venueIds: g }), M = {}, N = [], R = {}, A = {}, E = {};
16056
16064
  v.filter(({ matchUpId: V }) => P?.includes(V)).forEach((V) => {
@@ -16063,7 +16071,7 @@ function iC(e) {
16063
16071
  }
16064
16072
  });
16065
16073
  let C = S.filter((V) => {
16066
- let H = P?.includes(V.matchUpId), W = ["BYE", ze, Ut, Lr, jt, nt].includes(V?.matchUpStatus);
16074
+ let H = P?.includes(V.matchUpId), W = ["BYE", ze, St, Lr, jt, nt].includes(V?.matchUpStatus);
16067
16075
  return !H && !V.winningSide && !W;
16068
16076
  }), { matchUpMap: k, overLimitMatchUpIds: O, participantIdsAtLimit: L } = C.reduce((V, H) => {
16069
16077
  let { drawId: W, tournamentId: Y, matchUpType: q } = H, { participantIdsAtLimit: K, relevantParticipantIds: X } = fS({ individualParticipantProfiles: o, matchUpPotentialParticipantIds: s, matchUpDailyLimits: u, matchUp: H });
@@ -16071,7 +16079,7 @@ function iC(e) {
16071
16079
  ad({ individualParticipantProfiles: o, participantId: Q });
16072
16080
  let Z = o[Q].counters;
16073
16081
  Z[q] ? Z[q] += 1 : Z[q] = 1, Z[Ni] ? Z[Ni] += 1 : Z[Ni] = 1;
16074
- }), V.matchUpMap[Y] || (V.matchUpMap[Y] = {}), V.matchUpMap[Y][W] ? V.matchUpMap[Y][W].push(H) : V.matchUpMap[Y][W] = [H], uc({ matchUpPotentialParticipantIds: s, matchUpNotBeforeTimes: c, matchUp: H }), V);
16082
+ }), V.matchUpMap[Y] || (V.matchUpMap[Y] = {}), V.matchUpMap[Y][W] ? V.matchUpMap[Y][W].push(H) : V.matchUpMap[Y][W] = [H], lc({ matchUpPotentialParticipantIds: s, matchUpNotBeforeTimes: c, matchUp: H }), V);
16075
16083
  }, { matchUpMap: {}, overLimitMatchUpIds: [], participantIdsAtLimit: [] });
16076
16084
  C = C.filter(({ matchUpId: V }) => !O.includes(V));
16077
16085
  let _ = 0, B = b?.length ?? 0, { personRequests: G } = Ss({ tournamentRecords: t, requestType: sd });
@@ -16101,7 +16109,7 @@ function iC(e) {
16101
16109
  let K = R[q];
16102
16110
  if (K) {
16103
16111
  let X = K.split(":").map(ci).join(":"), Q = `${ve(f)}T${X}`;
16104
- U ? $.push(q) : (Fa({ drawDefinition: Y, matchUpId: q, scheduledTime: Q }).success && $.push(q), T && qc({ tournamentRecords: t, tournamentRecord: H, drawDefinition: Y, matchUpId: q, venueId: T }));
16112
+ U ? $.push(q) : (Fa({ drawDefinition: Y, matchUpId: q, scheduledTime: Q }).success && $.push(q), T && Hc({ tournamentRecords: t, tournamentRecord: H, drawDefinition: Y, matchUpId: q, venueId: T }));
16105
16113
  }
16106
16114
  });
16107
16115
  });
@@ -16218,7 +16226,7 @@ function jj({ tournamentRecord: e, scheduleChange: t, matchUpIds: r, dryRun: i }
16218
16226
  let b = l.find((E) => E.matchUpId === T)?.schedule, { scheduledTime: P, scheduledDate: M } = b, N, R, A;
16219
16227
  if (!N && o && M) {
16220
16228
  let E = ve(M);
16221
- A = Zc(E, o), N = new Date(A) < new Date(p) || new Date(A) > new Date(m);
16229
+ A = eu(E, o), N = new Date(A) < new Date(p) || new Date(A) > new Date(m);
16222
16230
  }
16223
16231
  if (s && P) {
16224
16232
  let E = ve(P), C = ke(at(P)) + s;
@@ -16261,7 +16269,7 @@ function oC(e) {
16261
16269
  let v = y({ tournamentId: m, sourceCourtId: s, matchUpId: p, matchUp: g, courtId: a, drawId: d, tournamentRecords: r, courtDayDate: o });
16262
16270
  if (v.success && I++, v.error) return F({ result: v, stack: t, info: "target" });
16263
16271
  } else return { error: ce };
16264
- return I ? x : F({ result: { error: vc }, stack: t });
16272
+ return I ? x : F({ result: { error: wc }, stack: t });
16265
16273
  function y(w) {
16266
16274
  let { tournamentRecords: v, tournamentId: D, matchUp: S, drawId: T } = w, b = v[D], { drawDefinition: P } = xa({ tournamentRecord: b, drawId: T });
16267
16275
  return S.matchUpType === rt ? U({ ...w, tournamentRecord: b, drawDefinition: P }) : To({ ...w, tournamentRecord: b, drawDefinition: P });
@@ -16313,13 +16321,13 @@ function ns({ drawDefinition: e, structureId: t, matchUpId: r, structure: i, mat
16313
16321
  }
16314
16322
  c = au({ item: i, drawDefinition: e, structure: i, event: s }) || Ki(e) || Ki(s);
16315
16323
  } else c = Ki(e) || Ki(s);
16316
- return c ? { ...x, structure: i, tieFormat: c, matchUp: n } : F({ result: { error: yc }, stack: o });
16324
+ return c ? { ...x, structure: i, tieFormat: c, matchUp: n } : F({ result: { error: Uc }, stack: o });
16317
16325
  }
16318
16326
  function gp({ matchUp: e, updateInProgressMatchUps: t }) {
16319
16327
  return !e.winningSide && ![Ft].includes(e.matchUpStatus) && (t || e.matchUpStatus !== ki && !_t(e));
16320
16328
  }
16321
16329
  function zf({ from: e, to: t }) {
16322
- let r = Object.keys(e), i = St(r, Object.keys(t)).length === r.length, n = r.filter((s) => e[s] !== t[s]).map((s) => ({ countChange: t[s] - e[s], collectionId: s })), a = r.every((s) => e[s] === t[s]);
16330
+ let r = Object.keys(e), i = vt(r, Object.keys(t)).length === r.length, n = r.filter((s) => e[s] !== t[s]).map((s) => ({ countChange: t[s] - e[s], collectionId: s })), a = r.every((s) => e[s] === t[s]);
16323
16331
  return { equivalent: i && a, matchUpsCountChanges: n };
16324
16332
  }
16325
16333
  function Gj({ updateInProgressMatchUps: e, tournamentRecord: t, drawDefinition: r, structure: i, tieFormat: n, eventId: a, matchUp: s, event: o, uuids: c }) {
@@ -16368,7 +16376,7 @@ function Gj({ updateInProgressMatchUps: e, tournamentRecord: t, drawDefinition:
16368
16376
  let { changes: E, changesArePossible: C } = Zv({ matchUp: P, check: A });
16369
16377
  if (C && !P.tieFormat) v({ changes: E, matchUp: P, tieFormat: n, uuids: c });
16370
16378
  else if (D) (!P.tieFormat || ta({ ancestor: D, descendant: P.tieFormat }).different) && (P.tieFormat = D, N = !0);
16371
- else return F({ result: { error: yc }, stack: u });
16379
+ else return F({ result: { error: Uc }, stack: u });
16372
16380
  }
16373
16381
  N && (T += 1, Ae({ tournamentId: t?.tournamentId, drawDefinition: r, context: u, eventId: a, matchUp: P }));
16374
16382
  }
@@ -16391,7 +16399,7 @@ function Gj({ updateInProgressMatchUps: e, tournamentRecord: t, drawDefinition:
16391
16399
  function Zv({ check: e, matchUp: t }) {
16392
16400
  let r = "", i = [];
16393
16401
  return { changesArePossible: e.matchUpsCountChanges.every(({ collectionId: n, countChange: a }) => {
16394
- let s = t.tieMatchUps.filter((c) => c.collectionId === n && c.matchUpStatus === vt).map(Kr("matchUpId")), o = s.length + a >= 0 || a > 0;
16402
+ let s = t.tieMatchUps.filter((c) => c.collectionId === n && c.matchUpStatus === wt).map(Kr("matchUpId")), o = s.length + a >= 0 || a > 0;
16395
16403
  return !o && a < 0 && (r = "Insufficient TO_BE_PLAYED matchUps"), i.push({ toBePlayedTieMatchUpIds: s, collectionId: n, countChange: a }), o;
16396
16404
  }), changes: i, cannotChangeReaon: r };
16397
16405
  }
@@ -16418,7 +16426,7 @@ function DS({ updateInProgressMatchUps: e = !1, tournamentRecord: t, collectionO
16418
16426
  let $ = eD({ matchUpCount: o ?? N?.matchUpCount ?? 0, collectionValueProfiles: g });
16419
16427
  if ($.errors) return F({ result: { error: z }, info: $.errors, stack: v });
16420
16428
  } else if (A && !ge(A)) return F({ result: { error: z }, info: "value is not an integer", context: { value: A }, stack: v });
16421
- let E = ($, j) => St(Object.keys($), Object.keys(j)).length === Object.keys($).length && St(Object.values($), Object.values(j)).length === Object.values($).length, C = g && (!N.collectionValueProfiles || !E(N.collectionValueProfiles, g)), k = ge(I) && N.collectionValue !== I || ge(y) && N.matchUpValue !== y || ge(U) && N.scoreValue !== U || ge(w) && N.setValue !== w || C, O = [];
16429
+ let E = ($, j) => vt(Object.keys($), Object.keys(j)).length === Object.keys($).length && vt(Object.values($), Object.values(j)).length === Object.values($).length, C = g && (!N.collectionValueProfiles || !E(N.collectionValueProfiles, g)), k = ge(I) && N.collectionValue !== I || ge(y) && N.matchUpValue !== y || ge(U) && N.scoreValue !== U || ge(w) && N.setValue !== w || C, O = [];
16422
16430
  if (k && (R.collectionValueProfiles = void 0, R.collectionValue = void 0, R.matchUpValue = void 0, R.scoreValue = void 0, R.setValue = void 0, Object.assign(R, D), O.push({ collectionId: c, ...ae(D) })), (ge(U) || ge(w)) && R.collectionGroupNumber) {
16423
16431
  let $ = R.collectionGroupNumber;
16424
16432
  M.collectionDefinitions = M.collectionDefinitions.map((j) => {
@@ -16440,7 +16448,7 @@ function DS({ updateInProgressMatchUps: e = !1, tournamentRecord: t, collectionO
16440
16448
  }
16441
16449
  function $j({ updateInProgressMatchUps: e, drawDefinition: t, structureId: r, structure: i, matchUpId: n, matchUp: a }) {
16442
16450
  let s = [];
16443
- return n && a ? s = [a] : r && i ? s = _e({ matchUpFilters: { matchUpTypes: [rt] }, structure: i })?.matchUps ?? [] : t && (s = vr({ matchUpFilters: { matchUpTypes: [rt] }, drawDefinition: t })?.matchUps ?? []), { targetMatchUps: s.filter((o) => !o.winningSide && o.matchUpStatus !== Ut && (e || o.matchUpStatus !== ki && !_t(o))) };
16451
+ return n && a ? s = [a] : r && i ? s = _e({ matchUpFilters: { matchUpTypes: [rt] }, structure: i })?.matchUps ?? [] : t && (s = vr({ matchUpFilters: { matchUpTypes: [rt] }, drawDefinition: t })?.matchUps ?? []), { targetMatchUps: s.filter((o) => !o.winningSide && o.matchUpStatus !== St && (e || o.matchUpStatus !== ki && !_t(o))) };
16444
16452
  }
16445
16453
  function Wj({ updateInProgressMatchUps: e, tournamentRecord: t, drawDefinition: r, targetMatchUps: i, tieFormat: n, event: a }) {
16446
16454
  for (let s of i) {
@@ -16489,12 +16497,12 @@ function mC({ updateInProgressMatchUps: e = !0, collectionGroupNumber: t, tourna
16489
16497
  }
16490
16498
  return F({ result: { ...d, modifiedCollectionIds: I }, stack: l });
16491
16499
  }
16492
- function dc({ tieFormat: e, orderMap: t }) {
16500
+ function pc({ tieFormat: e, orderMap: t }) {
16493
16501
  let r = tr(e);
16494
16502
  return r.collectionDefinitions?.forEach((i) => {
16495
16503
  let n = t[i.collectionId];
16496
16504
  n && (i.collectionOrder = n);
16497
- }), r.collectionDefinitions?.sort((i, n) => Wo(i.collectionOrder) - Wo(n.collectionOrder)), r;
16505
+ }), r.collectionDefinitions?.sort((i, n) => qo(i.collectionOrder) - qo(n.collectionOrder)), r;
16498
16506
  }
16499
16507
  function fC({ tournamentRecord: e, drawDefinition: t, structureId: r, matchUpId: i, orderMap: n, eventId: a, matchUp: s, event: o }) {
16500
16508
  if (typeof n != "object" || !Object.values(n).every((l) => ge(l))) return F({ result: { error: z }, context: { orderMap: n } });
@@ -16507,8 +16515,8 @@ function fC({ tournamentRecord: e, drawDefinition: t, structureId: r, matchUpId:
16507
16515
  if (l?.error) return l;
16508
16516
  if (s = l.matchUp, !s) return { error: Mr };
16509
16517
  let d = Km({ tournamentRecord: e, matchUpId: i, structure: u, drawDefinition: t, event: o })?.tieFormat;
16510
- s.tieFormat = dc({ tieFormat: d, orderMap: n }), Ae({ tournamentId: e?.tournamentId, eventId: o?.eventId, drawDefinition: t, matchUp: s });
16511
- } else if (r) if (u?.tieFormat) u.tieFormat = dc({ tieFormat: u.tieFormat, orderMap: n }), hC({ eventId: o?.eventId, tournamentRecord: e, drawDefinition: t, structure: u, orderMap: n }), Je({ drawDefinition: t, structureIds: [u.structureId] });
16518
+ s.tieFormat = pc({ tieFormat: d, orderMap: n }), Ae({ tournamentId: e?.tournamentId, eventId: o?.eventId, drawDefinition: t, matchUp: s });
16519
+ } else if (r) if (u?.tieFormat) u.tieFormat = pc({ tieFormat: u.tieFormat, orderMap: n }), hC({ eventId: o?.eventId, tournamentRecord: e, drawDefinition: t, structure: u, orderMap: n }), Je({ drawDefinition: t, structureIds: [u.structureId] });
16512
16520
  else if (t.tieFormat) ng({ structureIds: [r], tournamentRecord: e, drawDefinition: t, orderMap: n, event: o });
16513
16521
  else if (o?.tieFormat) ew({ structureIds: [r], tournamentRecord: e, orderMap: n, event: o });
16514
16522
  else return { error: Kt };
@@ -16517,20 +16525,20 @@ function fC({ tournamentRecord: e, drawDefinition: t, structureId: r, matchUpId:
16517
16525
  return { ...x };
16518
16526
  }
16519
16527
  function ew({ tournamentRecord: e, structureIds: t, orderMap: r, event: i }) {
16520
- let n = dc({ tieFormat: i.tieFormat, orderMap: r });
16528
+ let n = pc({ tieFormat: i.tieFormat, orderMap: r });
16521
16529
  t?.length || (i.tieFormat = n);
16522
16530
  for (let a of i.drawDefinitions ?? []) ng({ tournamentRecord: e, drawDefinition: a, structureIds: t, orderMap: r, event: i });
16523
16531
  }
16524
16532
  function ng({ tournamentRecord: e, drawDefinition: t, structureIds: r, orderMap: i, event: n }) {
16525
- let a = t.tieFormat ?? n?.tieFormat, s = dc({ tieFormat: a, orderMap: i });
16533
+ let a = t.tieFormat ?? n?.tieFormat, s = pc({ tieFormat: a, orderMap: i });
16526
16534
  r?.length || (t.tieFormat = s);
16527
16535
  let o = [];
16528
- for (let c of t.structures ?? []) r?.length && !r.includes(c.structureId) || ((c.tieFormat || r?.includes(c.structureId)) && (c.tieFormat = dc({ tieFormat: c.tieFormat ?? t.tieFormat ?? n?.tieFormat, orderMap: i })), hC({ eventId: n?.eventId, tournamentRecord: e, drawDefinition: t, structure: c, orderMap: i }), o.push(c.structureId));
16536
+ for (let c of t.structures ?? []) r?.length && !r.includes(c.structureId) || ((c.tieFormat || r?.includes(c.structureId)) && (c.tieFormat = pc({ tieFormat: c.tieFormat ?? t.tieFormat ?? n?.tieFormat, orderMap: i })), hC({ eventId: n?.eventId, tournamentRecord: e, drawDefinition: t, structure: c, orderMap: i }), o.push(c.structureId));
16529
16537
  Je({ drawDefinition: t, structureIds: o });
16530
16538
  }
16531
16539
  function hC({ tournamentRecord: e, drawDefinition: t, structure: r, orderMap: i, eventId: n }) {
16532
16540
  let a = _e({ matchUpFilters: { matchUpTypes: [rt] }, structure: r })?.matchUps;
16533
- for (let s of a) s.tieFormat && (s.tieFormat = dc({ tieFormat: s.tieFormat, orderMap: i }), Ae({ tournamentId: e?.tournamentId, drawDefinition: t, eventId: n, matchUp: s }));
16541
+ for (let s of a) s.tieFormat && (s.tieFormat = pc({ tieFormat: s.tieFormat, orderMap: i }), Ae({ tournamentId: e?.tournamentId, drawDefinition: t, eventId: n, matchUp: s }));
16534
16542
  }
16535
16543
  function TS({ updateInProgressMatchUps: e = !0, tieFormatComparison: t, tournamentRecord: r, drawDefinition: i, tieFormatName: n, collectionId: a, structureId: s, matchUpId: o, eventId: c, matchUp: u, event: l }) {
16536
16544
  let d = "removeCollectionDefinition", p = u ? void 0 : ns({ drawDefinition: i, structureId: s, matchUpId: o, eventId: c, event: l });
@@ -16553,14 +16561,14 @@ function TS({ updateInProgressMatchUps: e = !0, tieFormatComparison: t, tourname
16553
16561
  o && u ? v = [u] : s && m ? v = _e({ matchUpFilters: { matchUpTypes: [rt] }, structure: m })?.matchUps ?? [] : i ? v = vr({ matchUpFilters: { matchUpTypes: [rt] }, drawDefinition: i })?.matchUps ?? [] : l && (v = Vn({ matchUpFilters: { matchUpTypes: [rt] } })?.matchUps ?? []);
16554
16562
  let D = (v || []).filter((M) => {
16555
16563
  let N = M.tieMatchUps?.filter((A) => A.collectionId === a)?.some(_t), R = t && M.tieFormat ? ta({ descendant: M.tieFormat, ancestor: h })?.different : !1;
16556
- return e && !N || !M.winningSide && M.matchUpStatus !== Ut && (e || M.matchUpStatus !== ki && !_t(M) && !R);
16564
+ return e && !N || !M.winningSide && M.matchUpStatus !== St && (e || M.matchUpStatus !== ki && !_t(M) && !R);
16557
16565
  });
16558
- if (!D.length) return { error: vc };
16566
+ if (!D.length) return { error: wc };
16559
16567
  let { appliedPolicies: S } = xe({ tournamentRecord: r });
16560
16568
  if (o && u && e) {
16561
16569
  let M = u.tieMatchUps?.filter((N) => N.collectionId === a);
16562
16570
  for (let N of M ?? []) {
16563
- let R = Hc({ matchUpId: N.matchUpId, tieMatchUpId: u?.matchUpId, winningSide: void 0, removeScore: !0, tournamentRecord: r, appliedPolicies: S, drawDefinition: i, event: l });
16571
+ let R = zc({ matchUpId: N.matchUpId, tieMatchUpId: u?.matchUpId, winningSide: void 0, removeScore: !0, tournamentRecord: r, appliedPolicies: S, drawDefinition: i, event: l });
16564
16572
  if (R.error || (R = st({ drawDefinition: i, matchUpId: o }), R.error)) return R;
16565
16573
  u = R?.matchUp;
16566
16574
  }
@@ -16691,7 +16699,7 @@ function IC({ updateInProgressMatchUps: e = !1, tieFormatComparison: t, modified
16691
16699
  if (P.error) return F({ result: P, stack: d });
16692
16700
  P.tieFormat && (S = P.tieFormat);
16693
16701
  }
16694
- return f?.tieFormatName !== T ? (S.tieFormatName = T, D.push({ tieFormatName: T })) : (D.length || v.length || U.length) && (delete S.tieFormatName, D.push("tieFormatName removed: modifications without new tieFormatName")), S.collectionDefinitions = S.collectionDefinitions.sort((b, P) => Wo(b.collectionOrder) - Wo(P.collectionOrder)).map((b, P) => ({ ...b, collectionOrder: P + 1 })), { processedTieFormat: tr(S), modifications: D, ...x };
16702
+ return f?.tieFormatName !== T ? (S.tieFormatName = T, D.push({ tieFormatName: T })) : (D.length || v.length || U.length) && (delete S.tieFormatName, D.push("tieFormatName removed: modifications without new tieFormatName")), S.collectionDefinitions = S.collectionDefinitions.sort((b, P) => qo(b.collectionOrder) - qo(P.collectionOrder)).map((b, P) => ({ ...b, collectionOrder: P + 1 })), { processedTieFormat: tr(S), modifications: D, ...x };
16695
16703
  }
16696
16704
  function yC({ tournamentRecord: e }) {
16697
16705
  if (!e) return { error: J };
@@ -16775,7 +16783,7 @@ function bC(e) {
16775
16783
  } else Ro({ element: u, onlineResource: i });
16776
16784
  } else if (o) {
16777
16785
  let u = (r.venues ?? []).filter((l) => !c || l.venueId === c).flatMap((l) => (l.courts ?? []).filter((d) => d.courtId === o))?.[0];
16778
- if (!u) return F({ result: { error: Sc } });
16786
+ if (!u) return F({ result: { error: vc } });
16779
16787
  Ro({ element: u, onlineResource: i });
16780
16788
  } else if (c) {
16781
16789
  let u = (r.venues ?? []).find((l) => l.venueId === c);
@@ -16785,7 +16793,7 @@ function bC(e) {
16785
16793
  return { ...x };
16786
16794
  }
16787
16795
  function Ro({ element: e, onlineResource: t }) {
16788
- let r = (e.onlineResources ?? []).filter((i) => !(i?.[Ko] === t[Ko] && i?.[Xo] === t[Xo] && i?.[Qo] === t[Qo]));
16796
+ let r = (e.onlineResources ?? []).filter((i) => !(i?.[Xo] === t[Xo] && i?.[Qo] === t[Qo] && i?.[Jo] === t[Jo]));
16789
16797
  e.onlineResources = r;
16790
16798
  }
16791
16799
  function MC(e) {
@@ -16804,7 +16812,7 @@ function MC(e) {
16804
16812
  } else Eo({ element: u, onlineResource: i });
16805
16813
  } else if (o) {
16806
16814
  let u = (r.venues ?? []).filter((l) => !c || l.venueId === c).flatMap((l) => (l.courts ?? []).filter((d) => d.courtId === o))?.[0];
16807
- if (!u) return F({ result: { error: Sc } });
16815
+ if (!u) return F({ result: { error: vc } });
16808
16816
  Eo({ element: u, onlineResource: i });
16809
16817
  } else if (c) {
16810
16818
  let u = (r.venues ?? []).find((l) => l.venueId === c);
@@ -16814,7 +16822,7 @@ function MC(e) {
16814
16822
  return { ...x };
16815
16823
  }
16816
16824
  function Eo({ element: e, onlineResource: t }) {
16817
- let r = (e.onlineResources ?? []).filter((i) => i?.[Ko] !== t[Ko] && i?.[Xo] !== t[Xo] && i?.[Qo] !== t[Qo]);
16825
+ let r = (e.onlineResources ?? []).filter((i) => i?.[Xo] !== t[Xo] && i?.[Qo] !== t[Qo] && i?.[Jo] !== t[Jo]);
16818
16826
  return r.push(t), e.onlineResources = r, { ...x };
16819
16827
  }
16820
16828
  function NC({ tournamentRecord: e, promotionalName: t, tournamentName: r, formalName: i }) {
@@ -16832,7 +16840,7 @@ function EC({ tournamentRecord: e, categories: t }) {
16832
16840
  }
16833
16841
  function Xj({ tournamentRecord: e }) {
16834
16842
  if (!e) return { error: J };
16835
- let { startDate: t, endDate: r } = e, i = Yo(t, r), n = [];
16843
+ let { startDate: t, endDate: r } = e, i = Ko(t, r), n = [];
16836
16844
  for (let a of e.venues || []) a?.courts?.length && n.push(...a.courts);
16837
16845
  for (let a of n) {
16838
16846
  let { startTime: s, endTime: o } = (a.dateAvailability ?? []).reduce((l, d) => {
@@ -16854,9 +16862,9 @@ function Nf(e) {
16854
16862
  }
16855
16863
  let o;
16856
16864
  (r && t.startDate && new Date(r) > new Date(t.startDate) || i && t.endDate && new Date(i) < new Date(t.endDate)) && (o = !0);
16857
- let c = Yo(t.startDate, t.endDate);
16865
+ let c = Ko(t.startDate, t.endDate);
16858
16866
  r && (t.startDate = r), i && (t.endDate = i);
16859
- let u = Yo(t.startDate, t.endDate), l = c.filter((m) => !u.includes(m)), d = u.filter((m) => !c.includes(m));
16867
+ let u = Ko(t.startDate, t.endDate), l = c.filter((m) => !u.includes(m)), d = u.filter((m) => !c.includes(m));
16860
16868
  for (let m of t.events ?? []) r && m.startDate && new Date(m.startDate) < new Date(r) && (m.startDate = r), i && m.startDate && new Date(m.startDate) > new Date(i) && (m.startDate = r ?? i), i && m.endDate && new Date(m.endDate) > new Date(i) && (m.endDate = i), r && m.endDate && new Date(m.endDate) < new Date(r) && (m.endDate = i ?? r);
16861
16869
  r && t.endDate && new Date(r) > new Date(t.endDate) && (t.endDate = r), i && t.startDate && new Date(i) < new Date(t.startDate) && (t.startDate = i), a && (t.activeDates = a), n && (t.weekdays = n);
16862
16870
  let p = o && Qj({ tournamentRecord: t })?.unscheduledMatchUpIds;
@@ -17066,7 +17074,7 @@ function GC(e) {
17066
17074
  if (a.error) return a;
17067
17075
  let s, o;
17068
17076
  for (let c of Object.values(n)) {
17069
- if (o = nG({ tournamentRecord: c, disableNotice: r, courtId: t, force: i }), o.error && o.error !== Sc) return o;
17077
+ if (o = nG({ tournamentRecord: c, disableNotice: r, courtId: t, force: i }), o.error && o.error !== vc) return o;
17070
17078
  o.success && (s = !0);
17071
17079
  }
17072
17080
  return s ? { ...x } : o;
@@ -17144,12 +17152,12 @@ function cG({ tournamentRecord: e, modifications: t, venueId: r, force: i }) {
17144
17152
  }
17145
17153
  if (t.courts) for (let g of t.courts) {
17146
17154
  let { courtId: I } = g || {}, y = ES({ modifications: g, disableNotice: !0, tournamentRecord: e, venueMatchUps: s, courtId: I, force: i });
17147
- if (y.error === Sc && (y = bf({ disableNotice: !0, tournamentRecord: e, venueId: r, court: g })), y.error) return y;
17155
+ if (y.error === vc && (y = bf({ disableNotice: !0, tournamentRecord: e, venueId: r, court: g })), y.error) return y;
17148
17156
  }
17149
17157
  return Jl({ tournamentRecord: e }), c && Ue({ payload: { venue: c, tournamentId: e.tournamentId }, topic: ds, key: c?.venueId }), { ...x, venue: ie(c) };
17150
17158
  }
17151
17159
  var AS = {};
17152
- Pe(AS, { JSON2CSV: () => hG, UUID: () => Be, UUIDS: () => NT, allNumeric: () => Xw, attributeFilter: () => Vs, chunkArray: () => Wt, chunkByNth: () => lh, chunkSizeProfile: () => Kw, constantToString: () => ar, countValues: () => b1, createMap: () => Jw, dateTime: () => MT, definedAttributes: () => ae, dehydrateMatchUps: () => dG, extractAttributes: () => Ab, flattenJSON: () => CS, generateDateRange: () => Yo, generateHashCode: () => k1, generateRange: () => te, generateTimeCode: () => vA, groupValues: () => zw, hasAttributeValues: () => O1, instanceCount: () => Wr, intersection: () => St, isConvertableInteger: () => ge, isNumeric: () => ft, isOdd: () => qw, isPowerOf2: () => $i, makeDeepCopy: () => ie, matchUpScheduleSort: () => lG, matchUpSort: () => fo, nearestPowerOf2: () => mg, nextPowerOf2: () => fc, noNulls: () => P1, noNumeric: () => Qw, numericSort: () => Ct, occurrences: () => N1, overlap: () => wr, randomMember: () => Br, randomPop: () => jr, shuffleArray: () => Ur, structureSort: () => ao, subSort: () => R1, undefinedToNull: () => dh, unique: () => ye, visualizeScheduledMatchUps: () => uG });
17160
+ Pe(AS, { JSON2CSV: () => hG, UUID: () => Be, UUIDS: () => NT, allNumeric: () => Xw, attributeFilter: () => Vs, chunkArray: () => Wt, chunkByNth: () => lh, chunkSizeProfile: () => Kw, constantToString: () => ar, countValues: () => b1, createMap: () => Jw, dateTime: () => MT, definedAttributes: () => ae, dehydrateMatchUps: () => dG, extractAttributes: () => Ab, flattenJSON: () => CS, generateDateRange: () => Ko, generateHashCode: () => k1, generateRange: () => te, generateTimeCode: () => vA, groupValues: () => zw, hasAttributeValues: () => O1, instanceCount: () => Wr, intersection: () => vt, isConvertableInteger: () => ge, isNumeric: () => ft, isOdd: () => qw, isPowerOf2: () => $i, makeDeepCopy: () => ie, matchUpScheduleSort: () => lG, matchUpSort: () => fo, nearestPowerOf2: () => mg, nextPowerOf2: () => hc, noNulls: () => P1, noNumeric: () => Qw, numericSort: () => Ct, occurrences: () => N1, overlap: () => wr, randomMember: () => Br, randomPop: () => jr, shuffleArray: () => Ur, structureSort: () => ao, subSort: () => R1, undefinedToNull: () => dh, unique: () => ye, visualizeScheduledMatchUps: () => uG });
17153
17161
  function uG({ scheduledMatchUps: e, showGlobalLog: t }) {
17154
17162
  eF();
17155
17163
  let r = e?.reduce((n, { structureId: a }) => n.includes(a) ? n : n.concat(a), []), i = Array.isArray(r) && { ...r.map((n) => {
@@ -17518,7 +17526,7 @@ var Kf = !1;
17518
17526
  xS.importMethods(dg, !0, 1);
17519
17527
  var YC = xS, AG = { getTournamentPoints: Ym }, CG = AG, OG = { calculateNewRatings: TN, generateDynamicRatings: PN }, kG = OG, xG = { ...CG, ...kG };
17520
17528
  xS.importMethods(xG);
17521
- var FG = { [Ru]: { roundsToSeparate: void 0, policyName: "Nationality Code", policyAttributes: [{ key: "person.nationalityCode" }, { key: "individualParticipants.person.nationalityCode" }] } }, LG = { [On]: { policyName: "positionActionsUnrestricted", enabledStructures: [], otherFlightEntries: !0, disableRoundRestrictions: !0, activePositionOverrides: [As, cu] } }, _G = { [On]: { policyName: "positionActionsNoMovement", enabledStructures: [{ stages: [], stageSequences: [], enabledActions: [As, Lu, qs], disabledActions: [] }] } }, BG = { [On]: { policyName: "positionActionsDisabled", enabledStructures: !1 } }, VG = { [bc]: { policyName: "Participant Privacy Policy", participant: { contacts: !1, individualParticipants: { onlineResources: !1, participantName: !0, participantOtherName: !0, participantId: !0, participantRole: !0, participantStatus: !0, penalties: !1, rankings: !0, ratings: !0, representing: !0, participantRoleResponsibilities: !1, participantType: !0, person: { addresses: !1, biographicalInformation: !1, birthDate: !1, contacts: !1, nationalityCode: !0, nativeFamilyName: !1, nativeGivenName: !1, onlineResources: !1, otherNames: !0, parentOrganisationId: !1, passportFamilyName: !1, passportGivenName: !1, personId: !1, personOtherIds: !1, previousNames: !1, sex: !1, standardFamilyName: !0, standardGivenName: !0, status: !1, tennisId: !1, wheelchair: !0 } }, individualParticipantIds: !0, onlineResources: !1, participantName: !0, participantOtherName: !0, participantId: !0, participantRole: !0, participantStatus: !0, penalties: !1, rankings: !0, ratings: !0, representing: !0, participantRoleResponsibilities: !1, participantType: !0, person: { addresses: !1, biographicalInformation: !1, birthDate: !1, contacts: !1, nationalityCode: !0, nativeFamilyName: !1, nativeGivenName: !1, onlineResources: !1, otherNames: !0, parentOrganisationId: !1, passportFamilyName: !1, passportGivenName: !1, personId: !1, personOtherIds: !1, previousNames: !1, sex: !1, standardFamilyName: !0, standardGivenName: !0, status: !1, tennisId: !1, wheelchair: !0 } } } }, jG = { [pi]: { processCodes: { incompleteAssignmentsOnDefault: ["RANKING.IGNORE"] }, defaultMatchUpFormat: Pi, allowDeletionWithScoresPresent: { drawDefinitions: !1, structures: !1 }, requireParticipantsForScoring: !1, requireAllPositionsAssigned: void 0, allowChangePropagation: !1, stage: { [re]: { stageSequence: { 1: { requireAllPositionsAssigned: !0 } } } }, matchUpFormats: [], matchUpStatusCodes: { [Lr]: [], [mn]: [], [ze]: [], [Yr]: [], [jt]: [], [nt]: [] } } }, Xf = "Personal circumstance", GG = { [pi]: { requireAllPositionsAssigned: !1, stage: { [re]: { stageSequence: { 1: { requireAllPositionsAssigned: !0 } } } }, defaultMatchUpFormat: Pi, matchUpFormats: [{ description: "Best of 3 tiebreak sets", matchUpFormat: Pi, categoryNames: [], categoryTypes: [] }, { description: "Two tiebreak sets, 7-point match tiebreak at one set all", matchUpFormat: "SET3-S:6/TB7-F:TB7" }, { description: "Two tiebreak sets, 10-point match tiebreak at one set all", matchUpFormat: "SET3-S:6/TB7-F:TB10" }, { description: "One standard tiebreak set to 6, 7-point tiebreak at 6 games all", matchUpFormat: "SET1-S:6/TB7" }, { description: "Best of 3 sets to 4", matchUpFormat: "SET3-S:4/TB7" }, { description: "Two out of three short sets to 4 with 5-point tiebreak at 3 games all", matchUpFormat: "SET3-S:4/TB5@3" }, { description: "One short set to 4, 7-point tiebreak at 4 games all", matchUpFormat: "SET1-S:4/TB7" }, { description: "One short set to 4, 5-point tiebreak at 3 games all", matchUpFormat: "SET1-S:4/TB5@3" }, { description: "Two short sets to 4, 10-point match tiebreak at one set all", matchUpFormat: "SET3-S:4/TB7-F:TB10" }, { description: "Two short sets to 4, 7-point match tiebreak at one set all", matchUpFormat: "SET3-S:4/TB7-F:TB7" }, { description: "One no advantage set to 5, tiebreak to 9 at 4-4", matchUpFormat: "SET1-S:5/TB9@4" }, { description: "One set to 6 with deciding game at 5 games all", matchUpFormat: "SET1-S:6NOAD" }, { description: "One short set to 4, deciding game is played at 3 games all", matchUpFormat: "SET1-S:4NOAD" }, { description: "Two short sets to 4 with deciding game at 3-3, 7-point match tiebreak at one set all", matchUpFormat: "SET3-S:4NOAD-F:TB7" }, { description: "8 game pro-set with 7 point tiebreak at 8 games all", matchUpFormat: "SET1-S:8/TB7" }, { description: "8 game pro-set with 7 point tiebreak at 7 games all", matchUpFormat: "SET1-S:8/TB7@7" }, { description: "Best of 3 10-point tiebreak games", matchUpFormat: "SET3-S:TB10" }, { description: "One 10-point tiebreak game", matchUpFormat: "SET1-S:TB10" }, { description: "Timed 20 minute game - game based", matchUpFormat: "SET1-S:T20" }], matchUpStatusCodes: { [Lr]: [{ matchUpStatusCodeDisplay: "Abandoned", label: "Abandoned match", matchUpStatusCode: "OA" }], [mn]: [{ matchUpStatusCodeDisplay: "Unplayed or Cancelled", label: "Cancelled match", matchUpStatusCode: "OC" }], [Yr]: [{ matchUpStatusCodeDisplay: "Incomplete", label: "Incomplete match", matchUpStatusCode: "OI" }], [ze]: [{ description: "Disqualification for cause or ineligibility", label: "Disqualification (ineligibility)", matchUpStatusCodeDisplay: "Def [dq]", matchUpStatusCode: "DQ" }, { description: "Misconduct before or between matches", label: "Misconduct", matchUpStatusCodeDisplay: "Def [cond]", matchUpStatusCode: "DM" }, { description: "Failure to start match because of adult discipline", label: "Fail. (adult discipline)", matchUpStatusCodeDisplay: "Def [ad]", matchUpStatusCode: "D5" }, { description: "Refusal to start match for reason other than adult discipline, injury, illness, or personal circumstance. (After the Referee has conclusively confirmed that a player refuses to play a match, the Referee need not wait until the scheduled time of the match to records the result.)", label: "Refusal to start match", matchUpStatusCodeDisplay: "Def [refsl]", matchUpStatusCode: "D4" }, { label: "Not showing up", matchUpStatusCodeDisplay: "Def [ns]", matchUpStatusCode: "D6" }, { description: "Lateness for match including, but not limited to, intending to play but mistakenly arriving at the wrong time, location, or without proper equipment", label: "Lateness for match", matchUpStatusCodeDisplay: "Score + Def [late]", matchUpStatusCode: "D7" }, { label: "Double default", matchUpStatusCodeDisplay: "Def/Def", matchUpStatusCode: "DD" }, { description: "Refusal to continue playing a match for reason other than injury, illness, personal circumstance, or adult discipline", label: "Refusal to continue match", matchUpStatusCodeDisplay: "Def [refsl]", matchUpStatusCode: "D9" }, { description: "Default for receiving an injection, IV, or supplemental oxygen", label: "Default (PEDs)", matchUpStatusCodeDisplay: "Def [med]", matchUpStatusCode: "DI" }, { description: "Default under Point Penalty System", label: "Default (Point Penalty System)", matchUpStatusCodeDisplay: "Def [pps]", matchUpStatusCode: "DP" }], [nt]: [{ matchUpStatusCodeDisplay: "Wo [inj]", matchUpStatusCode: "W1", label: "Injury" }, { matchUpStatusCodeDisplay: "Wo [ill]", matchUpStatusCode: "W2", label: "Illness" }, { matchUpStatusCodeDisplay: "Wo [pc]", label: Xf, matchUpStatusCode: "W3" }, { matchUpStatusCodeDisplay: "Wo/Wo", matchUpStatusCode: "WOWO", label: "Double walkover" }, { matchUpStatusCodeDisplay: "Wo [Tae]", label: "Tournament Administrative Error", matchUpStatusCode: "W4" }, { matchUpStatusCodeDisplay: "Wo/Withdrawn", matchUpStatusCode: "W5", label: "Withdrawn" }], [jt]: [{ matchUpStatusCodeDisplay: "Ret [inj]", matchUpStatusCode: "RJ", label: "Injury" }, { matchUpStatusCodeDisplay: "Ret [ill]", matchUpStatusCode: "RI", label: "Illness" }, { matchUpStatusCodeDisplay: "Ret [pc]", label: Xf, matchUpStatusCode: "RC" }, { description: "Retirement because of adult discipline", label: "Ret. (adult discipline)", matchUpStatusCodeDisplay: "Ret [ad]", matchUpStatusCode: "RD" }, { description: "A player who retires from a match remains eligible for consolations, place playoffs, doubles and subsequent round robin matches", matchUpStatusCodeDisplay: "Ret [elg]", label: "Ret. (eligible)", matchUpStatusCode: "RU" }], [kn]: [{ matchUpStatusCodeDisplay: "Wd [inj]", matchUpStatusCode: "WD.INJ", label: "Injury" }, { matchUpStatusCodeDisplay: "Wd [ill]", matchUpStatusCode: "WD.ILL", label: "Illness" }, { matchUpStatusCodeDisplay: "Wd [pc]", label: Xf, matchUpStatusCode: "WD.PC" }, { matchUpStatusCodeDisplay: "Wd/Wd", matchUpStatusCode: "WD.WD", label: "Double withdrawal" }, { label: "Tournament Administrative Error", matchUpStatusCodeDisplay: "Wd [Tae]", matchUpStatusCode: "WD.TAE" }] } } }, $G = { [vi]: { seedingProfile: { positioning: Wp }, validSeedPositions: { ignore: !0 }, duplicateSeedNumbers: !0, drawSizeProgression: !0, policyName: "ITF SEEDING", seedsCountThresholds: [{ drawSize: 4, minimumParticipantCount: 3, seedsCount: 2 }, { drawSize: 16, minimumParticipantCount: 12, seedsCount: 4 }, { drawSize: 32, minimumParticipantCount: 24, seedsCount: 8 }, { drawSize: 64, minimumParticipantCount: 48, seedsCount: 16 }, { drawSize: 128, minimumParticipantCount: 97, seedsCount: 32 }, { drawSize: 256, minimumParticipantCount: 192, seedsCount: 64 }] } }, WG = { POLICY_AVOIDANCE_COUNTRY: FG, POLICY_POSITION_ACTIONS_DEFAULT: sN, POLICY_POSITION_ACTIONS_DISABLED: BG, POLICY_POSITION_ACTIONS_NO_MOVEMENT: _G, POLICY_POSITION_ACTIONS_UNRESTRICTED: LG, POLICY_PRIVACY_DEFAULT: VG, POLICY_ROUND_NAMING_DEFAULT: $I, POLICY_SCHEDULING_DEFAULT: BR, POLICY_SCORING_DEFAULT: jG, POLICY_SCORING_USTA: GG, POLICY_SEEDING_ITF: $G, POLICY_SEEDING_DEFAULT: vR }, qG = { ratingsParameters: Gt, matchUpFormats: JO, countryToFlag: rb, tieFormats: tE, countries: ha, policies: WG, flagIOC: Xk }, HG = {};
17529
+ var FG = { [Ru]: { roundsToSeparate: void 0, policyName: "Nationality Code", policyAttributes: [{ key: "person.nationalityCode" }, { key: "individualParticipants.person.nationalityCode" }] } }, LG = { [On]: { policyName: "positionActionsUnrestricted", enabledStructures: [], otherFlightEntries: !0, disableRoundRestrictions: !0, activePositionOverrides: [As, cu] } }, _G = { [On]: { policyName: "positionActionsNoMovement", enabledStructures: [{ stages: [], stageSequences: [], enabledActions: [As, Lu, qs], disabledActions: [] }] } }, BG = { [On]: { policyName: "positionActionsDisabled", enabledStructures: !1 } }, VG = { [Mc]: { policyName: "Participant Privacy Policy", participant: { contacts: !1, individualParticipants: { onlineResources: !1, participantName: !0, participantOtherName: !0, participantId: !0, participantRole: !0, participantStatus: !0, penalties: !1, rankings: !0, ratings: !0, representing: !0, participantRoleResponsibilities: !1, participantType: !0, person: { addresses: !1, biographicalInformation: !1, birthDate: !1, contacts: !1, nationalityCode: !0, nativeFamilyName: !1, nativeGivenName: !1, onlineResources: !1, otherNames: !0, parentOrganisationId: !1, passportFamilyName: !1, passportGivenName: !1, personId: !1, personOtherIds: !1, previousNames: !1, sex: !1, standardFamilyName: !0, standardGivenName: !0, status: !1, tennisId: !1, wheelchair: !0 } }, individualParticipantIds: !0, onlineResources: !1, participantName: !0, participantOtherName: !0, participantId: !0, participantRole: !0, participantStatus: !0, penalties: !1, rankings: !0, ratings: !0, representing: !0, participantRoleResponsibilities: !1, participantType: !0, person: { addresses: !1, biographicalInformation: !1, birthDate: !1, contacts: !1, nationalityCode: !0, nativeFamilyName: !1, nativeGivenName: !1, onlineResources: !1, otherNames: !0, parentOrganisationId: !1, passportFamilyName: !1, passportGivenName: !1, personId: !1, personOtherIds: !1, previousNames: !1, sex: !1, standardFamilyName: !0, standardGivenName: !0, status: !1, tennisId: !1, wheelchair: !0 } } } }, jG = { [pi]: { processCodes: { incompleteAssignmentsOnDefault: ["RANKING.IGNORE"] }, defaultMatchUpFormat: Pi, allowDeletionWithScoresPresent: { drawDefinitions: !1, structures: !1 }, requireParticipantsForScoring: !1, requireAllPositionsAssigned: void 0, allowChangePropagation: !1, stage: { [re]: { stageSequence: { 1: { requireAllPositionsAssigned: !0 } } } }, matchUpFormats: [], matchUpStatusCodes: { [Lr]: [], [mn]: [], [ze]: [], [Yr]: [], [jt]: [], [nt]: [] } } }, Xf = "Personal circumstance", GG = { [pi]: { requireAllPositionsAssigned: !1, stage: { [re]: { stageSequence: { 1: { requireAllPositionsAssigned: !0 } } } }, defaultMatchUpFormat: Pi, matchUpFormats: [{ description: "Best of 3 tiebreak sets", matchUpFormat: Pi, categoryNames: [], categoryTypes: [] }, { description: "Two tiebreak sets, 7-point match tiebreak at one set all", matchUpFormat: "SET3-S:6/TB7-F:TB7" }, { description: "Two tiebreak sets, 10-point match tiebreak at one set all", matchUpFormat: "SET3-S:6/TB7-F:TB10" }, { description: "One standard tiebreak set to 6, 7-point tiebreak at 6 games all", matchUpFormat: "SET1-S:6/TB7" }, { description: "Best of 3 sets to 4", matchUpFormat: "SET3-S:4/TB7" }, { description: "Two out of three short sets to 4 with 5-point tiebreak at 3 games all", matchUpFormat: "SET3-S:4/TB5@3" }, { description: "One short set to 4, 7-point tiebreak at 4 games all", matchUpFormat: "SET1-S:4/TB7" }, { description: "One short set to 4, 5-point tiebreak at 3 games all", matchUpFormat: "SET1-S:4/TB5@3" }, { description: "Two short sets to 4, 10-point match tiebreak at one set all", matchUpFormat: "SET3-S:4/TB7-F:TB10" }, { description: "Two short sets to 4, 7-point match tiebreak at one set all", matchUpFormat: "SET3-S:4/TB7-F:TB7" }, { description: "One no advantage set to 5, tiebreak to 9 at 4-4", matchUpFormat: "SET1-S:5/TB9@4" }, { description: "One set to 6 with deciding game at 5 games all", matchUpFormat: "SET1-S:6NOAD" }, { description: "One short set to 4, deciding game is played at 3 games all", matchUpFormat: "SET1-S:4NOAD" }, { description: "Two short sets to 4 with deciding game at 3-3, 7-point match tiebreak at one set all", matchUpFormat: "SET3-S:4NOAD-F:TB7" }, { description: "8 game pro-set with 7 point tiebreak at 8 games all", matchUpFormat: "SET1-S:8/TB7" }, { description: "8 game pro-set with 7 point tiebreak at 7 games all", matchUpFormat: "SET1-S:8/TB7@7" }, { description: "Best of 3 10-point tiebreak games", matchUpFormat: "SET3-S:TB10" }, { description: "One 10-point tiebreak game", matchUpFormat: "SET1-S:TB10" }, { description: "Timed 20 minute game - game based", matchUpFormat: "SET1-S:T20" }], matchUpStatusCodes: { [Lr]: [{ matchUpStatusCodeDisplay: "Abandoned", label: "Abandoned match", matchUpStatusCode: "OA" }], [mn]: [{ matchUpStatusCodeDisplay: "Unplayed or Cancelled", label: "Cancelled match", matchUpStatusCode: "OC" }], [Yr]: [{ matchUpStatusCodeDisplay: "Incomplete", label: "Incomplete match", matchUpStatusCode: "OI" }], [ze]: [{ description: "Disqualification for cause or ineligibility", label: "Disqualification (ineligibility)", matchUpStatusCodeDisplay: "Def [dq]", matchUpStatusCode: "DQ" }, { description: "Misconduct before or between matches", label: "Misconduct", matchUpStatusCodeDisplay: "Def [cond]", matchUpStatusCode: "DM" }, { description: "Failure to start match because of adult discipline", label: "Fail. (adult discipline)", matchUpStatusCodeDisplay: "Def [ad]", matchUpStatusCode: "D5" }, { description: "Refusal to start match for reason other than adult discipline, injury, illness, or personal circumstance. (After the Referee has conclusively confirmed that a player refuses to play a match, the Referee need not wait until the scheduled time of the match to records the result.)", label: "Refusal to start match", matchUpStatusCodeDisplay: "Def [refsl]", matchUpStatusCode: "D4" }, { label: "Not showing up", matchUpStatusCodeDisplay: "Def [ns]", matchUpStatusCode: "D6" }, { description: "Lateness for match including, but not limited to, intending to play but mistakenly arriving at the wrong time, location, or without proper equipment", label: "Lateness for match", matchUpStatusCodeDisplay: "Score + Def [late]", matchUpStatusCode: "D7" }, { label: "Double default", matchUpStatusCodeDisplay: "Def/Def", matchUpStatusCode: "DD" }, { description: "Refusal to continue playing a match for reason other than injury, illness, personal circumstance, or adult discipline", label: "Refusal to continue match", matchUpStatusCodeDisplay: "Def [refsl]", matchUpStatusCode: "D9" }, { description: "Default for receiving an injection, IV, or supplemental oxygen", label: "Default (PEDs)", matchUpStatusCodeDisplay: "Def [med]", matchUpStatusCode: "DI" }, { description: "Default under Point Penalty System", label: "Default (Point Penalty System)", matchUpStatusCodeDisplay: "Def [pps]", matchUpStatusCode: "DP" }], [nt]: [{ matchUpStatusCodeDisplay: "Wo [inj]", matchUpStatusCode: "W1", label: "Injury" }, { matchUpStatusCodeDisplay: "Wo [ill]", matchUpStatusCode: "W2", label: "Illness" }, { matchUpStatusCodeDisplay: "Wo [pc]", label: Xf, matchUpStatusCode: "W3" }, { matchUpStatusCodeDisplay: "Wo/Wo", matchUpStatusCode: "WOWO", label: "Double walkover" }, { matchUpStatusCodeDisplay: "Wo [Tae]", label: "Tournament Administrative Error", matchUpStatusCode: "W4" }, { matchUpStatusCodeDisplay: "Wo/Withdrawn", matchUpStatusCode: "W5", label: "Withdrawn" }], [jt]: [{ matchUpStatusCodeDisplay: "Ret [inj]", matchUpStatusCode: "RJ", label: "Injury" }, { matchUpStatusCodeDisplay: "Ret [ill]", matchUpStatusCode: "RI", label: "Illness" }, { matchUpStatusCodeDisplay: "Ret [pc]", label: Xf, matchUpStatusCode: "RC" }, { description: "Retirement because of adult discipline", label: "Ret. (adult discipline)", matchUpStatusCodeDisplay: "Ret [ad]", matchUpStatusCode: "RD" }, { description: "A player who retires from a match remains eligible for consolations, place playoffs, doubles and subsequent round robin matches", matchUpStatusCodeDisplay: "Ret [elg]", label: "Ret. (eligible)", matchUpStatusCode: "RU" }], [kn]: [{ matchUpStatusCodeDisplay: "Wd [inj]", matchUpStatusCode: "WD.INJ", label: "Injury" }, { matchUpStatusCodeDisplay: "Wd [ill]", matchUpStatusCode: "WD.ILL", label: "Illness" }, { matchUpStatusCodeDisplay: "Wd [pc]", label: Xf, matchUpStatusCode: "WD.PC" }, { matchUpStatusCodeDisplay: "Wd/Wd", matchUpStatusCode: "WD.WD", label: "Double withdrawal" }, { label: "Tournament Administrative Error", matchUpStatusCodeDisplay: "Wd [Tae]", matchUpStatusCode: "WD.TAE" }] } } }, $G = { [vi]: { seedingProfile: { positioning: Wp }, validSeedPositions: { ignore: !0 }, duplicateSeedNumbers: !0, drawSizeProgression: !0, policyName: "ITF SEEDING", seedsCountThresholds: [{ drawSize: 4, minimumParticipantCount: 3, seedsCount: 2 }, { drawSize: 16, minimumParticipantCount: 12, seedsCount: 4 }, { drawSize: 32, minimumParticipantCount: 24, seedsCount: 8 }, { drawSize: 64, minimumParticipantCount: 48, seedsCount: 16 }, { drawSize: 128, minimumParticipantCount: 97, seedsCount: 32 }, { drawSize: 256, minimumParticipantCount: 192, seedsCount: 64 }] } }, WG = { POLICY_AVOIDANCE_COUNTRY: FG, POLICY_POSITION_ACTIONS_DEFAULT: sN, POLICY_POSITION_ACTIONS_DISABLED: BG, POLICY_POSITION_ACTIONS_NO_MOVEMENT: _G, POLICY_POSITION_ACTIONS_UNRESTRICTED: LG, POLICY_PRIVACY_DEFAULT: VG, POLICY_ROUND_NAMING_DEFAULT: $I, POLICY_SCHEDULING_DEFAULT: BR, POLICY_SCORING_DEFAULT: jG, POLICY_SCORING_USTA: GG, POLICY_SEEDING_ITF: $G, POLICY_SEEDING_DEFAULT: vR }, qG = { ratingsParameters: Gt, matchUpFormats: JO, countryToFlag: rb, tieFormats: tE, countries: ha, policies: WG, flagIOC: Xk }, HG = {};
17522
17530
  Pe(HG, { activeMatchUpStatuses: () => SI, auditConstants: () => JV, completedMatchUpStatuses: () => Ft, directingMatchUpStatuses: () => GP, displayConstants: () => NV, drawDefinitionConstants: () => yP, entryStatusConstants: () => ax, errorConditionConstants: () => J1, eventConstants: () => ik, extensionConstants: () => CP, flightConstants: () => u2, genderConstants: () => Hg, keyValueConstants: () => Z_, matchUpActionConstants: () => d_, matchUpStatusConstants: () => am, matchUpTypes: () => v1, nonDirectingMatchUpStatuses: () => $P, particicipantsRequiredMatchUpStatuses: () => VP, participantConstants: () => Kk, participantRoles: () => ry, participantTypes: () => nu, penaltyConstants: () => l$, policyConstants: () => Ck, positionActionConstants: () => DL, ratingConstants: () => LL, recoveryTimeRequiredMatchUpStatuses: () => Wk, requestConstants: () => J2, resourceContants: () => qO, resultConstants: () => x1, scaleConstants: () => Nk, scheduleConstants: () => Ex, sortingConstants: () => g2, surfaceConstants: () => g$, tieFormatConstants: () => ZO, timeItemConstants: () => Mx, topicConstants: () => Hk, tournamentConstants: () => TC, upcomingMatchUpStatuses: () => WP, validMatchUpStatuses: () => jP, venueConstants: () => U$, weekdayConstants: () => oE });
17523
17531
  var zG = "Coaching", YG = "Ball Abuse", KG = "Racket Abuse", XG = "Verbal Abuse", QG = "INELIGIBILITY", JG = "Physical Abuse", ZG = "Unsportmanlike Conduct", e$ = "Dress Code Violation", t$ = "Equipment Violation", r$ = "Leaving the court", i$ = "Failure to complete", n$ = "No Show", a$ = "Other", s$ = "REFUSAL_TO_PLAY", o$ = "PROHIBITED_SUBSTANCE", c$ = "Puncuality", u$ = "Failure to sign in", l$ = { COACHING: zG, BALL_ABUSE: YG, RACKET_ABUSE: KG, VERBAL_ABUSE: XG, PHYSICAL_ABUSE: JG, INELIGIBILITY: QG, UNSPORTSMANLIKE_CONDUCT: ZG, PROHIBITED_SUBSTANCE: o$, DRESS_CODE_VIOLATION: e$, EQUIMENT_VIOLATION: t$, LEAVING_THE_COURT: r$, REFUSAL_TO_PLAY: s$, FAILURE_TO_COMPLETE: i$, NO_SHOW: n$, OTHER: a$, PUNCTUALITY: c$, FAILUIRE_TO_SIGN_IN: u$ }, d$ = "CLAY", p$ = "HARD", m$ = "GRASS", f$ = "CARPET", h$ = "ARTIFICIAL", g$ = { CLAY: d$, HARD: p$, GRASS: m$, CARPET: f$, ARTIFICIAL: h$ }, I$ = "INDOOR", y$ = "OUTDOOR", U$ = { INDOOR: I$, OUTDOOR: y$ };
17524
17532
  const S$ = Ve({
@@ -19030,7 +19038,7 @@ const t0 = [
19030
19038
  function xd(e) {
19031
19039
  return typeof e == "function";
19032
19040
  }
19033
- let jn, Dt;
19041
+ let jn, yt;
19034
19042
  const Jf = "Timed set", Bo = "Tiebreak", yw = "No-Ad", In = "Set", pu = "Ad", cr = {
19035
19043
  setFormat: {
19036
19044
  descriptor: "Best of",
@@ -19060,11 +19068,11 @@ function Uw(e) {
19060
19068
  }
19061
19069
  function r0() {
19062
19070
  const e = Uw();
19063
- Dt = {
19071
+ yt = {
19064
19072
  bestOf: cr.setFormat.bestOf,
19065
19073
  setFormat: e
19066
- }, document.getElementById("finalSetOption")?.checked && (Dt.finalSetFormat = Uw(1));
19067
- const r = dg.scoreGovernor.stringifyMatchUpFormat(Dt), i = t0.some((a) => a.format === r), n = document.getElementById("matchUpFormatSelector");
19074
+ }, document.getElementById("finalSetOption")?.checked && (yt.finalSetFormat = Uw(1));
19075
+ const r = dg.scoreGovernor.stringifyMatchUpFormat(yt), i = t0.some((a) => a.format === r), n = document.getElementById("matchUpFormatSelector");
19068
19076
  if (n) {
19069
19077
  const a = n.value, s = i ? r : "Custom";
19070
19078
  if (a !== s) {
@@ -19187,14 +19195,14 @@ const ws = (e, t) => t && e.finalSetFormat || e.setFormat, ko = [
19187
19195
  id: "minutes",
19188
19196
  timed: !0
19189
19197
  }
19190
- ], eu = {
19198
+ ], Vo = {
19191
19199
  changeWhat: (e, t, r) => {
19192
19200
  const i = r === In, n = t ? "finalSetTiebreakToggle" : "setTiebreakToggle", a = document.getElementById(n);
19193
19201
  a.style.display = i ? "" : gr, ko.forEach((s) => {
19194
19202
  if (s.whats) {
19195
19203
  const { prefix: o = "", suffix: c = "", pluralize: u } = s, l = s.whats.includes(r), d = t ? `${s.id}-${t}` : s.id, p = document.getElementById(d);
19196
19204
  if (p.style.display === gr && l) {
19197
- const m = Dt.bestOf, f = !t && u && m > 1 ? "s" : "", h = s.defaultValue;
19205
+ const m = yt.bestOf, f = !t && u && m > 1 ? "s" : "", h = s.defaultValue;
19198
19206
  p.innerHTML = `${o}${h}${f}${c}${yn}`, cr[t ? "finalSetFormat" : "setFormat"][s.id] = h;
19199
19207
  }
19200
19208
  p.style.display = l ? "" : gr;
@@ -19245,7 +19253,7 @@ function vq({
19245
19253
  config: r,
19246
19254
  modalConfig: i
19247
19255
  } = {}) {
19248
- jn = e, Dt = uu.parse(jn);
19256
+ jn = e, yt = uu.parse(jn);
19249
19257
  const n = NW(
19250
19258
  jn,
19251
19259
  uu.parse
@@ -19257,7 +19265,7 @@ function vq({
19257
19265
  }, s = [
19258
19266
  {
19259
19267
  onClick: () => {
19260
- Vo(), t?.("");
19268
+ jo(), t?.("");
19261
19269
  },
19262
19270
  label: "Cancel",
19263
19271
  intent: "none",
@@ -19268,13 +19276,13 @@ function vq({
19268
19276
  intent: "is-info",
19269
19277
  close: !0,
19270
19278
  onClick: () => {
19271
- Vo(), a();
19279
+ jo(), a();
19272
19280
  }
19273
19281
  }
19274
19282
  ], o = "switch is-rounded is-danger", c = document.createElement("div");
19275
19283
  c.addEventListener("click", (R) => {
19276
19284
  const A = R.target;
19277
- !A.closest(".dropdown") && !A.classList.contains("mfcButton") && Vo();
19285
+ !A.closest(".dropdown") && !A.classList.contains("mfcButton") && jo();
19278
19286
  });
19279
19287
  const u = document.createElement("div");
19280
19288
  u.id = "matchUpFormatString", u.innerHTML = jn, u.style.fontSize = "1.5em", u.style.color = "blue", u.style.marginBottom = "1em", c.appendChild(u);
@@ -19296,23 +19304,23 @@ function vq({
19296
19304
  A.value = R.value || "", A.text = R.label || "", A.style.backgroundColor = "#ffffff", A.style.color = "#363636", R.selected && (A.selected = !0), p.appendChild(A);
19297
19305
  }
19298
19306
  p.onchange = (R) => {
19299
- jn = R.target.value, _i(jn), Dt = uu.parse(jn), cr.setFormat = Dt.setFormat, cr.setFormat.bestOf = Dt.bestOf, Dt.finalSetFormat && (cr.finalSetFormat = Dt.finalSetFormat);
19300
- const A = Dt.finalSetFormat;
19307
+ jn = R.target.value, _i(jn), yt = uu.parse(jn), cr.setFormat = yt.setFormat, cr.setFormat.bestOf = yt.bestOf, yt.finalSetFormat && (cr.finalSetFormat = yt.finalSetFormat), Vo.updateFinalSetVisibility(null, 0, yt.bestOf);
19308
+ const A = yt.finalSetFormat;
19301
19309
  w.style.display = A ? "" : gr, v.style.display = A ? "" : gr, y.checked = A;
19302
19310
  const E = A?.tiebreakSet?.tiebreakTo && !A?.setTo;
19303
19311
  S.checked = !!A?.tiebreakFormat, S.style.display = E ? gr : "";
19304
19312
  const C = document.getElementById("finalSetTiebreakToggle");
19305
- C && (C.style.display = E ? gr : ""), h.checked = Dt.setFormat.tiebreakFormat, ko.forEach((k) => {
19313
+ C && (C.style.display = E ? gr : ""), h.checked = yt.setFormat.tiebreakFormat, ko.forEach((k) => {
19306
19314
  if (k.getValue) {
19307
- const O = k.getValue(Dt), L = document.getElementById(k.id);
19315
+ const O = k.getValue(yt), L = document.getElementById(k.id);
19308
19316
  if (L && O) {
19309
- const { prefix: _ = "", suffix: B = "", pluralize: G } = k, $ = Dt.bestOf, j = G && $ > 1 ? "s" : "";
19317
+ const { prefix: _ = "", suffix: B = "", pluralize: G } = k, $ = yt.bestOf, j = G && $ > 1 ? "s" : "";
19310
19318
  L.innerHTML = `${_}${O}${j}${B}${yn}`, L.style.display = "";
19311
19319
  } else L && (L.style.display = gr);
19312
19320
  if (A) {
19313
- const _ = k.getValue(Dt, !0), B = document.getElementById(`${k.id}-1`);
19321
+ const _ = k.getValue(yt, !0), B = document.getElementById(`${k.id}-1`);
19314
19322
  if (B && _) {
19315
- const { prefix: G = "", suffix: $ = "", pluralize: j } = k, V = Dt.bestOf, H = j && V > 1 ? "s" : "";
19323
+ const { prefix: G = "", suffix: $ = "", pluralize: j } = k, V = yt.bestOf, H = j && V > 1 ? "s" : "";
19316
19324
  B.innerHTML = `${G}${_}${H}${$}${yn}`, B.style.display = "";
19317
19325
  } else B && (B.style.display = gr);
19318
19326
  }
@@ -19321,19 +19329,19 @@ function vq({
19321
19329
  }, l.appendChild(p), c.appendChild(l);
19322
19330
  const m = document.createElement("div");
19323
19331
  m.style.display = "flex", m.style.flexWrap = "wrap", m.style.gap = "0.5em", m.style.marginBottom = "1em", ko.map((R) => {
19324
- const A = R.getValue ? R.getValue(Dt) : void 0;
19332
+ const A = R.getValue ? R.getValue(yt) : void 0;
19325
19333
  return Sw({ ...R, value: A });
19326
19334
  }).forEach((R) => m.appendChild(R)), m.id = "setFormat", c.appendChild(m);
19327
19335
  const f = document.createElement("div");
19328
19336
  f.className = "field", f.style.fontSize = "1em";
19329
19337
  const h = document.createElement("input");
19330
- h.className = o, h.name = "setTiebreak", h.id = "setTiebreak", h.type = "checkbox", h.checked = !!Dt.setFormat.tiebreakFormat, h.onchange = (R) => {
19338
+ h.className = o, h.name = "setTiebreak", h.id = "setTiebreak", h.type = "checkbox", h.checked = !!yt.setFormat.tiebreakFormat, h.onchange = (R) => {
19331
19339
  const A = R.target.checked;
19332
19340
  ko.filter(({ tb: E }) => E).forEach((E) => {
19333
19341
  const C = document.getElementById(E.id);
19334
19342
  if (C) {
19335
19343
  if (C.style.display === gr && A) {
19336
- const { prefix: k = "", suffix: O = "", pluralize: L, defaultValue: _ } = E, B = Dt.bestOf, G = L && B > 1 ? "s" : "";
19344
+ const { prefix: k = "", suffix: O = "", pluralize: L, defaultValue: _ } = E, B = yt.bestOf, G = L && B > 1 ? "s" : "";
19337
19345
  C.innerHTML = `${k}${_}${G}${O}${yn}`;
19338
19346
  }
19339
19347
  C.style.display = A ? "" : gr;
@@ -19342,29 +19350,29 @@ function vq({
19342
19350
  }, f.appendChild(h);
19343
19351
  const g = document.createElement("label");
19344
19352
  g.setAttribute("for", "setTiebreak"), g.id = "setTiebreakToggle", g.innerHTML = "Tiebreak", g.style.marginRight = "1em", f.appendChild(g);
19345
- const I = Dt.bestOf > 1, y = document.createElement("input");
19346
- y.className = "switch is-rounded is-info", y.type = "checkbox", y.name = "finalSetOption", y.checked = !!Dt.finalSetFormat, y.id = "finalSetOption", y.style.display = I ? "" : "none", y.onchange = (R) => {
19353
+ const I = yt.bestOf > 1, y = document.createElement("input");
19354
+ y.className = "switch is-rounded is-info", y.type = "checkbox", y.name = "finalSetOption", y.checked = !!yt.finalSetFormat, y.id = "finalSetOption", y.style.display = I ? "" : "none", y.onchange = (R) => {
19347
19355
  const A = R.target.checked;
19348
19356
  w.style.display = A ? "" : gr, v.style.display = A ? "" : gr, _i();
19349
19357
  }, f.appendChild(y);
19350
19358
  const U = document.createElement("label");
19351
19359
  U.setAttribute("for", "finalSetOption"), U.innerHTML = "Final set", U.style.display = I ? "" : "none", f.appendChild(U), c.appendChild(f);
19352
19360
  const w = document.createElement("div");
19353
- w.style.display = Dt.finalSetFormat ? "flex" : gr, w.style.flexWrap = "wrap", w.style.gap = "0.5em", w.style.marginBottom = "1em", w.id = "finalSetFormat", [{ label: "<div style='font-weight: bold'>Final set</div>", options: [], finalSet: !0 }].concat(
19361
+ w.style.display = yt.finalSetFormat ? "flex" : gr, w.style.flexWrap = "wrap", w.style.gap = "0.5em", w.style.marginBottom = "1em", w.id = "finalSetFormat", [{ label: "<div style='font-weight: bold'>Final set</div>", options: [], finalSet: !0 }].concat(
19354
19362
  ko.map((R) => {
19355
- const A = R.getValue ? R.getValue(Dt, !0) : void 0;
19363
+ const A = R.getValue ? R.getValue(yt, !0) : void 0;
19356
19364
  return { ...R, value: A };
19357
19365
  })
19358
19366
  ).filter((R) => R.finalSet !== !1).map((R) => Sw({ ...R, index: 1 })).forEach((R) => w.appendChild(R)), c.appendChild(w);
19359
19367
  const v = document.createElement("div");
19360
- v.id = "finalSetConfig", v.style.display = Dt.finalSetFormat ? "" : gr, v.className = "field", v.style.fontSize = "1em";
19361
- const D = Dt.finalSetFormat?.tiebreakSet?.tiebreakTo && !Dt.finalSetFormat?.setTo, S = document.createElement("input");
19362
- S.className = o, S.name = "finalSetTiebreak", S.id = "finalSetTiebreak", S.type = "checkbox", S.checked = Dt.finalSetFormat ? !!Dt.finalSetFormat.tiebreakFormat : !!Dt.setFormat.tiebreakFormat, S.style.display = D ? gr : "", v.onchange = (R) => {
19368
+ v.id = "finalSetConfig", v.style.display = yt.finalSetFormat ? "" : gr, v.className = "field", v.style.fontSize = "1em";
19369
+ const D = yt.finalSetFormat?.tiebreakSet?.tiebreakTo && !yt.finalSetFormat?.setTo, S = document.createElement("input");
19370
+ S.className = o, S.name = "finalSetTiebreak", S.id = "finalSetTiebreak", S.type = "checkbox", S.checked = yt.finalSetFormat ? !!yt.finalSetFormat.tiebreakFormat : !!yt.setFormat.tiebreakFormat, S.style.display = D ? gr : "", v.onchange = (R) => {
19363
19371
  const A = R.target.checked;
19364
19372
  ko.filter(({ tb: E }) => E).forEach((E) => {
19365
19373
  const C = document.getElementById(`${E.id}-1`);
19366
19374
  if (C.style.display === gr && A) {
19367
- const { prefix: k = "", suffix: O = "", pluralize: L, defaultValue: _ } = E, B = Dt.bestOf, G = L && B > 1 ? "s" : "";
19375
+ const { prefix: k = "", suffix: O = "", pluralize: L, defaultValue: _ } = E, B = yt.bestOf, G = L && B > 1 ? "s" : "";
19368
19376
  C.innerHTML = `${k}${_}${G}${O}${yn}`;
19369
19377
  }
19370
19378
  C.style.display = A ? "" : gr;
@@ -19401,16 +19409,16 @@ function vq({
19401
19409
  config: M
19402
19410
  });
19403
19411
  return setTimeout(() => {
19404
- if (Dt.finalSetFormat?.tiebreakSet?.tiebreakTo && !Dt.finalSetFormat?.setTo) {
19412
+ if (yt.finalSetFormat?.tiebreakSet?.tiebreakTo && !yt.finalSetFormat?.setTo) {
19405
19413
  const A = document.getElementById("what-1");
19406
- A && (A.innerHTML = `${Bo}${yn}`), eu.changeWhat(new Event("click"), 1, Bo);
19414
+ A && (A.innerHTML = `${Bo}${yn}`), Vo.changeWhat(new Event("click"), 1, Bo);
19407
19415
  }
19408
19416
  const R = document.querySelector(".modal.is-active");
19409
19417
  if (R) {
19410
19418
  const A = new MutationObserver((E) => {
19411
19419
  E.forEach((C) => {
19412
19420
  C.removedNodes.forEach((k) => {
19413
- k === R && (Vo(), A.disconnect());
19421
+ k === R && (jo(), A.disconnect());
19414
19422
  });
19415
19423
  });
19416
19424
  });
@@ -19430,23 +19438,23 @@ function EW(e) {
19430
19438
  const { e: t, id: r, button: i, pluralize: n, options: a, onChange: s, onChangeCallback: o, index: c, prefix: u = "", suffix: l = "" } = e, d = cr.setFormat.bestOf || 1, p = !c && n && d > 1 ? "s" : "", f = (xd(a) ? a(c) : a).map((h) => ({
19431
19439
  text: `${h}${p}`,
19432
19440
  onClick: () => {
19433
- i.innerHTML = `${u}${h}${p}${l}${yn}`, s && xd(eu[s]) && eu[s](t, c, h), o && xd(eu[o]) && eu[o](t, c, h), cr[c ? "finalSetFormat" : "setFormat"][r] = h, _i();
19441
+ i.innerHTML = `${u}${h}${p}${l}${yn}`, s && xd(Vo[s]) && Vo[s](t, c, h), o && xd(Vo[o]) && Vo[o](t, c, h), cr[c ? "finalSetFormat" : "setFormat"][r] = h, _i();
19434
19442
  }
19435
19443
  }));
19436
19444
  AW(t, f);
19437
19445
  }
19438
19446
  let tu = null, mu = null;
19439
- function Vo() {
19447
+ function jo() {
19440
19448
  tu && document.body.contains(tu) && tu.remove(), mu && (document.removeEventListener("click", mu), mu = null), tu = null;
19441
19449
  }
19442
19450
  function AW(e, t) {
19443
- Vo();
19451
+ jo();
19444
19452
  const r = document.createElement("div");
19445
19453
  r.className = "dropdown is-active", r.style.position = "absolute", r.style.zIndex = "10000";
19446
19454
  const i = document.createElement("div");
19447
19455
  i.className = "dropdown-menu", i.style.backgroundColor = "white", i.style.border = "1px solid #ddd", i.style.borderRadius = "4px", i.style.boxShadow = "0 2px 8px rgba(0,0,0,0.15)";
19448
19456
  const n = () => {
19449
- Vo();
19457
+ jo();
19450
19458
  };
19451
19459
  t.forEach((s) => {
19452
19460
  const o = document.createElement("div");
@@ -19468,7 +19476,7 @@ function AW(e, t) {
19468
19476
  }, 100);
19469
19477
  }
19470
19478
  function wq() {
19471
- return "0.8.11";
19479
+ return "0.9.0";
19472
19480
  }
19473
19481
  function Xi(e) {
19474
19482
  return typeof e == "function";
@@ -19773,14 +19781,14 @@ function LS(e, t, r) {
19773
19781
  function i0(e, t, r) {
19774
19782
  return e < t ? t : e > r ? r : e;
19775
19783
  }
19776
- function pc(e, t, r = {}, i = 0, n = "") {
19784
+ function mc(e, t, r = {}, i = 0, n = "") {
19777
19785
  const a = Object.keys(r).reduce((o, c) => {
19778
19786
  let u = r[c];
19779
19787
  return typeof u == "function" && (u = u(i)), `${o} ${c}="${u}"`;
19780
19788
  }, e);
19781
19789
  n += `<${a}></${e}>`;
19782
19790
  const s = i + 1;
19783
- return s < t ? pc(e, t, r, s, n) : n;
19791
+ return s < t ? mc(e, t, r, s, n) : n;
19784
19792
  }
19785
19793
  function _S(e) {
19786
19794
  return e.replace(/>\s+/g, ">").replace(/\s+</, "<");
@@ -19791,7 +19799,7 @@ function sg(e) {
19791
19799
  function bo() {
19792
19800
  return (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0);
19793
19801
  }
19794
- function mc(...e) {
19802
+ function fc(...e) {
19795
19803
  switch (e.length) {
19796
19804
  case 0:
19797
19805
  return bo();
@@ -20026,7 +20034,7 @@ function d0(e, t) {
20026
20034
  const r = typeof t == "function" ? t : (i) => i instanceof Element && i.matches(t);
20027
20035
  return l0(e.composedPath(), r, e.currentTarget);
20028
20036
  }
20029
- const Xc = {
20037
+ const Qc = {
20030
20038
  en: {
20031
20039
  days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
20032
20040
  daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
@@ -20139,7 +20147,7 @@ function ih(e, t) {
20139
20147
  "pickLevel" in r && (I = rh(r.pickLevel, m, 2), delete r.pickLevel), I !== m && (I > m && ("minDate" in r || (r.minDate = p), "maxDate" in r || (r.maxDate = l)), s && !r.datesDisabled && (r.datesDisabled = []), m = i.pickLevel = I);
20140
20148
  let y = p, U = l;
20141
20149
  if ("minDate" in r) {
20142
- const D = mc(0, 0, 1);
20150
+ const D = fc(0, 0, 1);
20143
20151
  y = r.minDate === null ? D : Mw(r.minDate, o, u, y), y !== D && (y = Wa(y, m, !1)), delete r.minDate;
20144
20152
  }
20145
20153
  if ("maxDate" in r && (U = r.maxDate === null ? void 0 : Mw(r.maxDate, o, u, U), U !== void 0 && (U = Wa(U, m, !0)), delete r.maxDate), U < y ? (p = i.minDate = U, l = i.maxDate = y) : (p !== y && (p = i.minDate = y), l !== U && (l = i.maxDate = U)), r.datesDisabled) {
@@ -20257,11 +20265,11 @@ const Rw = (e) => e.map((t) => `<button type="button" class="%buttonClass% ${t}"
20257
20265
  </div>
20258
20266
  </div>
20259
20267
  </div>`), XW = _S(`<div class="days">
20260
- <div class="days-of-week">${pc("span", 7, { class: "dow" })}</div>
20261
- <div class="datepicker-grid">${pc("span", 42)}</div>
20268
+ <div class="days-of-week">${mc("span", 7, { class: "dow" })}</div>
20269
+ <div class="datepicker-grid">${mc("span", 42)}</div>
20262
20270
  </div>`), QW = _S(`<div class="week-numbers calendar-weeks">
20263
20271
  <div class="days-of-week"><span class="dow"></span></div>
20264
- <div class="weeks">${pc("span", 6, { class: "week" })}</div>
20272
+ <div class="weeks">${mc("span", 6, { class: "week" })}</div>
20265
20273
  </div>`);
20266
20274
  class VS {
20267
20275
  constructor(t, r) {
@@ -20359,8 +20367,8 @@ class JW extends VS {
20359
20367
  }
20360
20368
  // Apply update on the focused date to view's settings
20361
20369
  updateFocus() {
20362
- const t = new Date(this.picker.viewDate), r = t.getFullYear(), i = t.getMonth(), n = mc(r, i, 1), a = xs(n, this.weekStart, this.weekStart);
20363
- this.first = n, this.last = mc(r, i + 1, 0), this.start = a, this.focused = this.picker.viewDate;
20370
+ const t = new Date(this.picker.viewDate), r = t.getFullYear(), i = t.getMonth(), n = fc(r, i, 1), a = xs(n, this.weekStart, this.weekStart);
20371
+ this.first = n, this.last = fc(r, i + 1, 0), this.start = a, this.focused = this.picker.viewDate;
20364
20372
  }
20365
20373
  // Apply update on the selected dates to view's settings
20366
20374
  updateSelection() {
@@ -20424,7 +20432,7 @@ class ZW extends VS {
20424
20432
  });
20425
20433
  }
20426
20434
  init(t, r = !0) {
20427
- r && (this.grid = this.element, this.element.classList.add("months", "datepicker-grid"), this.grid.appendChild(ba(pc("span", 12, { "data-month": (i) => i }))), this.first = 0, this.last = 11), super.init(t);
20435
+ r && (this.grid = this.element, this.element.classList.add("months", "datepicker-grid"), this.grid.appendChild(ba(mc("span", 12, { "data-month": (i) => i }))), this.first = 0, this.last = 11), super.init(t);
20428
20436
  }
20429
20437
  setOptions(t) {
20430
20438
  if (t.locale && (this.monthNames = t.locale.monthsShort), "minDate" in t)
@@ -20439,7 +20447,7 @@ class ZW extends VS {
20439
20447
  this.maxYear = this.maxMonth = this.maxDate = void 0;
20440
20448
  else {
20441
20449
  const r = new Date(t.maxDate);
20442
- this.maxYear = r.getFullYear(), this.maxMonth = r.getMonth(), this.maxDate = mc(this.maxYear, this.maxMonth + 1, 0);
20450
+ this.maxYear = r.getFullYear(), this.maxMonth = r.getMonth(), this.maxDate = fc(this.maxYear, this.maxMonth + 1, 0);
20443
20451
  }
20444
20452
  t.checkDisabled && (this.checkDisabled = this.isMinView || t.datesDisabled === null ? t.checkDisabled : () => !1), "beforeShowMonth" in t && (this.beforeShow = typeof t.beforeShowMonth == "function" ? t.beforeShowMonth : void 0);
20445
20453
  }
@@ -20499,10 +20507,10 @@ class Aw extends VS {
20499
20507
  super(t, r);
20500
20508
  }
20501
20509
  init(t, r = !0) {
20502
- r && (this.navStep = this.step * 10, this.beforeShowOption = `beforeShow${eq(this.cellClass)}`, this.grid = this.element, this.element.classList.add(this.name, "datepicker-grid"), this.grid.appendChild(ba(pc("span", 12)))), super.init(t);
20510
+ r && (this.navStep = this.step * 10, this.beforeShowOption = `beforeShow${eq(this.cellClass)}`, this.grid = this.element, this.element.classList.add(this.name, "datepicker-grid"), this.grid.appendChild(ba(mc("span", 12)))), super.init(t);
20503
20511
  }
20504
20512
  setOptions(t) {
20505
- if ("minDate" in t && (t.minDate === void 0 ? this.minYear = this.minDate = void 0 : (this.minYear = Co(t.minDate, this.step), this.minDate = mc(this.minYear, 0, 1))), "maxDate" in t && (t.maxDate === void 0 ? this.maxYear = this.maxDate = void 0 : (this.maxYear = Co(t.maxDate, this.step), this.maxDate = mc(this.maxYear, 11, 31))), t.checkDisabled && (this.checkDisabled = this.isMinView || t.datesDisabled === null ? t.checkDisabled : () => !1), this.beforeShowOption in t) {
20513
+ if ("minDate" in t && (t.minDate === void 0 ? this.minYear = this.minDate = void 0 : (this.minYear = Co(t.minDate, this.step), this.minDate = fc(this.minYear, 0, 1))), "maxDate" in t && (t.maxDate === void 0 ? this.maxYear = this.maxDate = void 0 : (this.maxYear = Co(t.maxDate, this.step), this.maxDate = fc(this.maxYear, 11, 31))), t.checkDisabled && (this.checkDisabled = this.isMinView || t.datesDisabled === null ? t.checkDisabled : () => !1), this.beforeShowOption in t) {
20506
20514
  const r = t[this.beforeShowOption];
20507
20515
  this.beforeShow = typeof r == "function" ? r : void 0;
20508
20516
  }
@@ -20969,7 +20977,7 @@ class v0 {
20969
20977
  * @return {String} formatted date
20970
20978
  */
20971
20979
  static formatDate(t, r, i) {
20972
- return ud(t, r, i && Xc[i] || Xc.en);
20980
+ return ud(t, r, i && Qc[i] || Qc.en);
20973
20981
  }
20974
20982
  /**
20975
20983
  * Parse date string
@@ -20987,14 +20995,14 @@ class v0 {
20987
20995
  * @return {Number} time value of parsed date
20988
20996
  */
20989
20997
  static parseDate(t, r, i) {
20990
- return zs(t, r, i && Xc[i] || Xc.en);
20998
+ return zs(t, r, i && Qc[i] || Qc.en);
20991
20999
  }
20992
21000
  /**
20993
21001
  * @type {Object} - Installed locales in `[languageCode]: localeObject` format
20994
21002
  * en`:_English (US)_ is pre-installed.
20995
21003
  */
20996
21004
  static get locales() {
20997
- return Xc;
21005
+ return Qc;
20998
21006
  }
20999
21007
  /**
21000
21008
  * @type {Boolean} - Whether the picker element is shown. `true` whne shown
@@ -21238,7 +21246,7 @@ function fq(e, t, r, i) {
21238
21246
  [r, "changeDate", t]
21239
21247
  ]), new v0(r, i, e);
21240
21248
  }
21241
- function Qc(e, t) {
21249
+ function Jc(e, t) {
21242
21250
  if (e._updating)
21243
21251
  return;
21244
21252
  e._updating = !0;
@@ -21261,14 +21269,14 @@ class hq {
21261
21269
  if (i.length < 2)
21262
21270
  return;
21263
21271
  t.rangepicker = this, this.element = t, this.inputs = i = i.slice(0, 2), Object.freeze(i), this.allowOneSidedRange = !!r.allowOneSidedRange;
21264
- const n = Qc.bind(null, this), a = Bw(r), s = this.datepickers = [];
21272
+ const n = Jc.bind(null, this), a = Bw(r), s = this.datepickers = [];
21265
21273
  i.forEach((o) => {
21266
21274
  fq(this, n, o, a);
21267
21275
  }), Object.freeze(s), Object.defineProperty(this, "dates", {
21268
21276
  get() {
21269
21277
  return s.map((o) => o.dates[0]);
21270
21278
  }
21271
- }), s[0].dates.length > 0 ? Qc(this, { target: i[0] }) : s[1].dates.length > 0 && Qc(this, { target: i[1] });
21279
+ }), s[0].dates.length > 0 ? Jc(this, { target: i[0] }) : s[1].dates.length > 0 && Jc(this, { target: i[1] });
21272
21280
  }
21273
21281
  /**
21274
21282
  * Set new values to the config options
@@ -21340,7 +21348,7 @@ class hq {
21340
21348
  inputs: [a, s],
21341
21349
  dates: [o, c]
21342
21350
  } = this;
21343
- this._updating = !0, i.setDate(t), n.setDate(r), delete this._updating, n.dates[0] !== c ? Qc(this, { target: s }) : i.dates[0] !== o && Qc(this, { target: a });
21351
+ this._updating = !0, i.setDate(t), n.setDate(r), delete this._updating, n.dates[0] !== c ? Jc(this, { target: s }) : i.dates[0] !== o && Jc(this, { target: a });
21344
21352
  }
21345
21353
  }
21346
21354
  function gq(e, t, r, i, n) {