@golstats/gsc-landing 1.0.144 → 1.0.145

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.
@@ -44601,6 +44601,7 @@ const Kt = $6(), _F = {
44601
44601
  isCupTournament: !1,
44602
44602
  retries: 3,
44603
44603
  userTeamGames: [],
44604
+ userTeamGamesForVideos: [],
44604
44605
  isCupLegacyTournament: !1,
44605
44606
  tournamentScheduleKeys: [],
44606
44607
  tournamentScheduleKeysGoals: [],
@@ -44685,6 +44686,9 @@ const Kt = $6(), _F = {
44685
44686
  closestRound() {
44686
44687
  return this.userTeamGames && this.userTeamGames.length ? this.getUserTeamClosestRound(this.fullTournamentScheduleFull) : this.getNormalClosestRound(this.fullTournamentScheduleFull);
44687
44688
  },
44689
+ closestRoundVideos() {
44690
+ return this.userTeamGames && this.userTeamGames.length ? this.getUserTeamClosestRound(this.fullTournamentScheduleFullGoals, !0) : this.getNormalClosestRound(this.fullTournamentScheduleFullGoals, !0);
44691
+ },
44688
44692
  containerGridCalendarTable() {
44689
44693
  return this.elementSize.width <= 1e3 ? "container-grid-calendar-table-mobile" : "container-grid-calendar-table";
44690
44694
  },
@@ -44791,6 +44795,18 @@ const Kt = $6(), _F = {
44791
44795
  }
44792
44796
  },
44793
44797
  methods: {
44798
+ getOnlyGamesWithGoals(s) {
44799
+ return Object.entries(s).reduce((e, [t, i]) => {
44800
+ const a = i.reduce((n, r) => {
44801
+ const o = r.games.filter((c) => (c.is_live || c.game_status !== 4) && c.score[0] + c.score[1] > 0);
44802
+ return o.length && n.push({
44803
+ ...r,
44804
+ games: o
44805
+ }), n;
44806
+ }, []);
44807
+ return a.length && (e[t] = a), e;
44808
+ }, {});
44809
+ },
44794
44810
  async onClickPlaySeeker() {
44795
44811
  try {
44796
44812
  const e = await (await fetch(
@@ -45141,7 +45157,7 @@ const Kt = $6(), _F = {
45141
45157
  },
45142
45158
  async createFullTournamentScheme(s, e) {
45143
45159
  try {
45144
- this.seasonsGamesMap = /* @__PURE__ */ new Map(), this.userTeamGames = [], this.gamesOfTheDayPreMatchIds.clear();
45160
+ this.seasonsGamesMap = /* @__PURE__ */ new Map(), this.userTeamGames = [], this.userTeamGamesForVideos = [], this.gamesOfTheDayPreMatchIds.clear();
45145
45161
  let t = 0;
45146
45162
  const { seasonsAndGames: i, seasonsAndTeams: a } = await this.fetchSeasonsGamesAndTeams(
45147
45163
  s.map((d) => d.id),
@@ -45170,7 +45186,7 @@ const Kt = $6(), _F = {
45170
45186
  );
45171
45187
  return u.dateTimeMillis = R.valueOf(), u.home_team = r.find((k) => k.team_id === f.home_team), u.visiting_team = r.find((k) => k.team_id === f.visiting_team), u.game_status === 4 && g.getFullYear() === R.getFullYear() && g.getMonth() === R.getMonth() && g.getDate() === R.getDate() && this.gamesOfTheDayPreMatchIds.add(u.game_id), this.seasonsGamesMap.set(u.game_id, u), m[f.matchday_abbreviation] ? m[f.matchday_abbreviation][f.game_status === 3 ? "canceled" : f.date] ? m[f.matchday_abbreviation][f.game_status === 3 ? "canceled" : f.date].push(u) : m[f.matchday_abbreviation][f.game_status === 3 ? "canceled" : f.date] = [u] : m[f.matchday_abbreviation] = {
45172
45188
  [f.game_status === 3 ? "canceled" : f.date]: [u]
45173
- }, this.gsData && this.gsData.teamId && u.game_status === 4 && (u.home_team.team_id === this.gsData.teamId || u.visiting_team.team_id === this.gsData.teamId) && this.userTeamGames.push(u), m;
45189
+ }, this.gsData && this.gsData.teamId && u.game_status === 4 && (u.home_team.team_id === this.gsData.teamId || u.visiting_team.team_id === this.gsData.teamId) && (this.userTeamGames.push(u), u.score && u.score[0] + u.score[1] > 0 && this.userTeamGamesForVideos.push(u)), m;
45174
45190
  }, {});
45175
45191
  this.userTeamGames.sort((m, f) => m.dateTimeMillis - f.dateTimeMillis);
45176
45192
  for (let [m, f] of Object.entries(h))
@@ -45234,7 +45250,7 @@ const Kt = $6(), _F = {
45234
45250
  }
45235
45251
  } else if (this.isCup) {
45236
45252
  const u = m.replace("M", ""), g = `Jornada ${u}`;
45237
- this.isCupLegacy ? d[Zd[u] || g] = f : d[Xd[m] || g] = myArray;
45253
+ this.isCupLegacy ? d[Zd[u] || g] = f : d[Xd[m] || g] = [];
45238
45254
  } else
45239
45255
  d[Number(m.replace("M", "")).toString()] = f;
45240
45256
  else h.type === 2 ? ["PI1", "PI2"].includes(m) ? d[m] = f : d[`R${Number(m.replace("PO", ""))}`] = f : h.type === 1 && (d[Jd[m]] = f);
@@ -45280,7 +45296,7 @@ const Kt = $6(), _F = {
45280
45296
  avaible: g
45281
45297
  }), d;
45282
45298
  }, /* @__PURE__ */ new Map()).values()
45283
- ), this.gamesOfTheDayPreMatchIds.size ? this.createGameOfTheDayTimeouts() : await this.checkLiveGames();
45299
+ ), await this.checkLiveGames(), this.gamesOfTheDayPreMatchIds.size && this.createGameOfTheDayTimeouts();
45284
45300
  } catch (t) {
45285
45301
  throw new Error(t);
45286
45302
  } finally {
@@ -45384,41 +45400,42 @@ const Kt = $6(), _F = {
45384
45400
  e.push(s);
45385
45401
  return e;
45386
45402
  },
45387
- getNormalClosestRound(s) {
45388
- const t = Object.entries(
45389
- Object.entries(s).reduce((n, [r, o]) => (n[r] = [], o.forEach((c) => {
45390
- c.games.forEach((l) => {
45391
- const d = new Date(l.date_time_utc).getTime() + 66e5;
45392
- n[r].push(d);
45403
+ getNormalClosestRound(s, e = !1) {
45404
+ const i = e ? this.getOnlyGamesWithGoals(s) : s, a = Object.entries(
45405
+ Object.entries(i).reduce((o, [c, l]) => (o[c] = [], l.forEach((d) => {
45406
+ d.games.forEach((h) => {
45407
+ const m = new Date(h.date_time_utc).getTime() + 66e5;
45408
+ o[c].push(m);
45393
45409
  });
45394
- }), n), {})
45410
+ }), o), {})
45395
45411
  );
45396
- if (!t.length)
45412
+ if (!a.length)
45397
45413
  return "1";
45398
- const i = (/* @__PURE__ */ new Date()).getTime(), a = t.reduce(
45399
- (n, [r, o]) => {
45400
- let c = null;
45401
- return o.forEach((l) => {
45402
- const d = l - i;
45403
- d >= 0 && (c === null || d < c) && (c = d);
45404
- }), c && (n.shortestTime === null || c < n.shortestTime) && (n.round = r, n.shortestTime = c), n;
45414
+ const n = (/* @__PURE__ */ new Date()).getTime(), r = a.reduce(
45415
+ (o, [c, l]) => {
45416
+ let d = null;
45417
+ return l.forEach((h) => {
45418
+ const m = e ? n - h : h - n;
45419
+ m >= 0 && (d === null || m < d) && (d = m);
45420
+ }), d && (o.shortestTime === null || d < o.shortestTime) && (o.round = c, o.shortestTime = d), o;
45405
45421
  },
45406
45422
  { round: "", shortestTime: null }
45407
45423
  );
45408
- return a.shortestTime !== null ? a.round : t[t.length - 1][0];
45409
- },
45410
- getUserTeamClosestRound(s) {
45411
- let e = 1;
45412
- if (this.userTeamGames.length) {
45413
- const t = this.userTeamGames[0];
45414
- for (const [i, a] of Object.entries(s))
45415
- for (const n of a)
45416
- if (n.games.find(
45417
- (o) => o.game_id === t.game_id
45424
+ return r.shortestTime !== null ? r.round : a[a.length - 1][0];
45425
+ },
45426
+ getUserTeamClosestRound(s, e = !1) {
45427
+ let t = 1;
45428
+ const i = e ? this.userTeamGamesForVideos : this.userTeamGames;
45429
+ if (i.length) {
45430
+ const a = i[0];
45431
+ for (const [n, r] of Object.entries(s))
45432
+ for (const o of r)
45433
+ if (o.games.find(
45434
+ (l) => l.game_id === a.game_id
45418
45435
  ))
45419
- return i;
45436
+ return n;
45420
45437
  }
45421
- return e;
45438
+ return t;
45422
45439
  },
45423
45440
  async changeIndexStory(s) {
45424
45441
  if (this.arrayGamesAdd.length > 0) {
@@ -45546,7 +45563,7 @@ const Kt = $6(), _F = {
45546
45563
  beforeUnmount() {
45547
45564
  this.resetGamesLiveInterval();
45548
45565
  }
45549
- }, Kn = (s) => (Ze("data-v-087a20b0"), s = s(), Qe(), s), TF = {
45566
+ }, Kn = (s) => (Ze("data-v-1092b9ab"), s = s(), Qe(), s), TF = {
45550
45567
  class: "gsclanding",
45551
45568
  ref: "landingref"
45552
45569
  }, xF = {
@@ -45788,7 +45805,7 @@ function s7(s, e, t, i, a, n) {
45788
45805
  nextRivalTeam: n.isGenericLike || !a.nextRivalId ? { id: 0 } : { id: a.nextRivalId },
45789
45806
  user: t.user,
45790
45807
  "tournament-schedule-keys": a.tournamentScheduleKeys,
45791
- "default-match-day-key": a.selectedRound,
45808
+ "default-match-day-key": n.closestRoundVideos,
45792
45809
  seasonSelected: a.seasonSelected,
45793
45810
  tournamentSelected: a.tournamentSelected,
45794
45811
  myTournament: t.user.tournament,
@@ -45874,7 +45891,7 @@ function s7(s, e, t, i, a, n) {
45874
45891
  ], 2)
45875
45892
  ], 512);
45876
45893
  }
45877
- const h7 = /* @__PURE__ */ xt(_F, [["render", s7], ["__scopeId", "data-v-087a20b0"]]);
45894
+ const h7 = /* @__PURE__ */ xt(_F, [["render", s7], ["__scopeId", "data-v-1092b9ab"]]);
45878
45895
  export {
45879
45896
  h7 as GSCLanding
45880
45897
  };