@golstats/gsc-top-player 1.0.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.
Files changed (154) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +137 -0
  3. package/dist/FilterConditions-55d68355-Dpbg-_AB.js +191 -0
  4. package/dist/FilterField-59a73e38-j9kmr0oF.js +21 -0
  5. package/dist/FilterSubcategories-a9b32cc9-DwhgmIwf.js +42 -0
  6. package/dist/atajada.svg +57 -0
  7. package/dist/backarrow.svg +3 -0
  8. package/dist/cancha-3d.png +0 -0
  9. package/dist/contorno-escudo.svg +3 -0
  10. package/dist/css/fonts.css +91 -0
  11. package/dist/favicon.ico +0 -0
  12. package/dist/field-green-posesion.png +0 -0
  13. package/dist/fin-del-partido.svg +44 -0
  14. package/dist/fonts/BebasNeue-Bold.otf +0 -0
  15. package/dist/fonts/BebasNeue-Bold.ttf +0 -0
  16. package/dist/fonts/BebasNeue-Bold.woff2 +0 -0
  17. package/dist/fonts/BebasNeue-Book.otf +0 -0
  18. package/dist/fonts/BebasNeue-Book.ttf +0 -0
  19. package/dist/fonts/BebasNeue-Book.woff2 +0 -0
  20. package/dist/fonts/BebasNeue-Light.otf +0 -0
  21. package/dist/fonts/BebasNeue-Light.ttf +0 -0
  22. package/dist/fonts/BebasNeue-Light.woff2 +0 -0
  23. package/dist/fonts/BebasNeue-Regular.otf +0 -0
  24. package/dist/fonts/BebasNeue-Regular.ttf +0 -0
  25. package/dist/fonts/BebasNeue-Regular.woff2 +0 -0
  26. package/dist/fonts/BebasNeue-Thin.otf +0 -0
  27. package/dist/fonts/BebasNeue-Thin.ttf +0 -0
  28. package/dist/fonts/BebasNeue-Thin.woff2 +0 -0
  29. package/dist/fonts/Montserrat-Black.otf +0 -0
  30. package/dist/fonts/Montserrat-BlackItalic.otf +0 -0
  31. package/dist/fonts/Montserrat-Bold.otf +0 -0
  32. package/dist/fonts/Montserrat-BoldItalic.otf +0 -0
  33. package/dist/fonts/Montserrat-ExtraBold.otf +0 -0
  34. package/dist/fonts/Montserrat-ExtraBoldItalic.otf +0 -0
  35. package/dist/fonts/Montserrat-ExtraLight.otf +0 -0
  36. package/dist/fonts/Montserrat-ExtraLightItalic.otf +0 -0
  37. package/dist/fonts/Montserrat-Italic.otf +0 -0
  38. package/dist/fonts/Montserrat-Light.otf +0 -0
  39. package/dist/fonts/Montserrat-LightItalic.otf +0 -0
  40. package/dist/fonts/Montserrat-Medium.otf +0 -0
  41. package/dist/fonts/Montserrat-MediumItalic.otf +0 -0
  42. package/dist/fonts/Montserrat-Regular.otf +0 -0
  43. package/dist/fonts/Montserrat-SemiBold.otf +0 -0
  44. package/dist/fonts/Montserrat-SemiBoldItalic.otf +0 -0
  45. package/dist/fonts/Montserrat-Thin.otf +0 -0
  46. package/dist/fonts/Montserrat-ThinItalic.otf +0 -0
  47. package/dist/fonts/Oswald-Bold.ttf +0 -0
  48. package/dist/fonts/Oswald-ExtraLight.ttf +0 -0
  49. package/dist/fonts/Oswald-Light.ttf +0 -0
  50. package/dist/fonts/Oswald-Medium.ttf +0 -0
  51. package/dist/fonts/Oswald-Regular.ttf +0 -0
  52. package/dist/fonts/Oswald-SemiBold.ttf +0 -0
  53. package/dist/fonts/Poppins-Black.otf +0 -0
  54. package/dist/fonts/Poppins-BlackItalic.otf +0 -0
  55. package/dist/fonts/Poppins-Bold.otf +0 -0
  56. package/dist/fonts/Poppins-BoldItalic.otf +0 -0
  57. package/dist/fonts/Poppins-ExtraBold.otf +0 -0
  58. package/dist/fonts/Poppins-ExtraBoldItalic.otf +0 -0
  59. package/dist/fonts/Poppins-ExtraLight.otf +0 -0
  60. package/dist/fonts/Poppins-ExtraLightItalic.otf +0 -0
  61. package/dist/fonts/Poppins-Italic.otf +0 -0
  62. package/dist/fonts/Poppins-Light.otf +0 -0
  63. package/dist/fonts/Poppins-LightItalic.otf +0 -0
  64. package/dist/fonts/Poppins-Medium.otf +0 -0
  65. package/dist/fonts/Poppins-MediumItalic.otf +0 -0
  66. package/dist/fonts/Poppins-Regular.otf +0 -0
  67. package/dist/fonts/Poppins-SemiBold.otf +0 -0
  68. package/dist/fonts/Poppins-SemiBoldItalic.otf +0 -0
  69. package/dist/fonts/Poppins-Thin.otf +0 -0
  70. package/dist/fonts/Poppins-ThinItalic.otf +0 -0
  71. package/dist/fuera-de-lugar.svg +58 -0
  72. package/dist/gol.svg +49 -0
  73. package/dist/group-427321178.svg +8 -0
  74. package/dist/group-427321179.svg +5 -0
  75. package/dist/group-427321501.svg +5 -0
  76. package/dist/gsc-top-player.css +1 -0
  77. package/dist/gsc-top-player.es.js +4 -0
  78. package/dist/gsc-top-player.umd.js +15 -0
  79. package/dist/icn-arrow-expand.svg +3 -0
  80. package/dist/icn-cambio.svg +27 -0
  81. package/dist/icn-expand-arrow.svg +3 -0
  82. package/dist/icn-expand-arrow1.svg +3 -0
  83. package/dist/icn-falta.svg +43 -0
  84. package/dist/icn-filter.svg +12 -0
  85. package/dist/icn-filter1.svg +12 -0
  86. package/dist/icn-filter2.svg +12 -0
  87. package/dist/icn-golstats.png +0 -0
  88. package/dist/icn-play.svg +10 -0
  89. package/dist/icn-tarjeta-amarilla.svg +4 -0
  90. package/dist/icn-tarjeta-roja.svg +4 -0
  91. package/dist/icn-tiro-a-porteria.svg +36 -0
  92. package/dist/icn-tiros-de-esquina.svg +55 -0
  93. package/dist/index-oO1T2oQg.js +12265 -0
  94. package/dist/inicia-el-partido.svg +46 -0
  95. package/dist/jugada-peligrosa.svg +91 -0
  96. package/dist/line-white.png +0 -0
  97. package/dist/line.png +0 -0
  98. package/dist/next-arrow.svg +3 -0
  99. package/dist/nextarrow.svg +3 -0
  100. package/dist/penal-fallado.svg +195 -0
  101. package/dist/penal-marcado.svg +190 -0
  102. package/dist/play-icn.svg +3 -0
  103. package/dist/public/images/cancha-horizontal-raw.jpg +0 -0
  104. package/dist/public/images/cancha-horizontal.jpg +0 -0
  105. package/dist/public/images/canchaRPH.svg +30 -0
  106. package/dist/public/images/events/atajada.svg +57 -0
  107. package/dist/public/images/events/cambio.svg +27 -0
  108. package/dist/public/images/events/falta.svg +43 -0
  109. package/dist/public/images/events/favicon.ico +0 -0
  110. package/dist/public/images/events/fin-del-partido.svg +44 -0
  111. package/dist/public/images/events/fuera-de-lugar.svg +58 -0
  112. package/dist/public/images/events/generic.svg +1 -0
  113. package/dist/public/images/events/gol.svg +49 -0
  114. package/dist/public/images/events/icn-cambio.svg +6 -0
  115. package/dist/public/images/events/icn-falta.svg +4 -0
  116. package/dist/public/images/events/icn-play.svg +3 -0
  117. package/dist/public/images/events/icn-tarjeta-amarilla.svg +4 -0
  118. package/dist/public/images/events/icn-tarjeta-roja.svg +4 -0
  119. package/dist/public/images/events/icn-tiro-a-porteria.svg +36 -0
  120. package/dist/public/images/events/icn-tiros-de-esquina.svg +18 -0
  121. package/dist/public/images/events/inicia-el-partido.svg +46 -0
  122. package/dist/public/images/events/jugada-peligrosa.svg +91 -0
  123. package/dist/public/images/events/penal-fallado.svg +195 -0
  124. package/dist/public/images/events/penal-marcado.svg +190 -0
  125. package/dist/public/images/events/tiempo-agregado.svg +75 -0
  126. package/dist/public/images/events/tiro-a-porteria.svg +81 -0
  127. package/dist/public/images/events/tiro-de-esquina.svg +55 -0
  128. package/dist/public/images/events/var.png +0 -0
  129. package/dist/public/images/events/var.svg +31 -0
  130. package/dist/shape.svg +3 -0
  131. package/dist/styles.css +1191 -0
  132. package/dist/tiempo-agregado.svg +75 -0
  133. package/dist/tiro-a-porteria.svg +81 -0
  134. package/dist/var.png +0 -0
  135. package/dist/var.svg +31 -0
  136. package/package.json +69 -0
  137. package/src/App.vue +40 -0
  138. package/src/components/comparative/categories.js +137 -0
  139. package/src/components/comparative/composable-filters.js +10 -0
  140. package/src/components/comparative/computedProperties.js +327 -0
  141. package/src/components/comparative/filtersTypes.js +117 -0
  142. package/src/components/comparative/gsc-button.vue +209 -0
  143. package/src/components/comparative/gsc-expanded-info-player.vue +710 -0
  144. package/src/components/comparative/gsc-head-titles.vue +1482 -0
  145. package/src/components/comparative/gsc-header-tops.vue +1192 -0
  146. package/src/components/comparative/gsc-row.vue +1810 -0
  147. package/src/components/comparative/gsc-top.vue +1517 -0
  148. package/src/components/comparative/gsc-tops-full.vue +2463 -0
  149. package/src/components/comparative/nationalities-catalog.js +233 -0
  150. package/src/components/comparative/playsTypes.js +142 -0
  151. package/src/components/comparative/useElementSize.js +23 -0
  152. package/src/components/gsc-top-player.vue +69 -0
  153. package/src/index.js +5 -0
  154. package/src/main.js +4 -0
@@ -0,0 +1,2463 @@
1
+ <template>
2
+ <div ref="myDivRefTopsFull">
3
+ <template v-for="(category, index) in categoryView" :key="index">
4
+ <div :class="toniKroosWrapperClass">
5
+ <GSCTopCategory
6
+ :is-widget="isWidget"
7
+ :team-widget="teamWidget"
8
+ :time-live-comparative-avanced="timeLiveComparativeAvanced"
9
+ :is-team="isTeam"
10
+ :carrousel="carrousel"
11
+ :arrow="arrow"
12
+ :border-width="0"
13
+ :can-play-videos="canPlayVideos"
14
+ border-radius="12px"
15
+ :game-id="gameId"
16
+ :game="game"
17
+ :typeData="typeData"
18
+ :category="category.id"
19
+ :type-table="typeTable"
20
+ :categoryName="category.name"
21
+ :season-selected="seasonSelected"
22
+ :season="seasonActive"
23
+ :filter-team="teamselect"
24
+ :key="updateTables"
25
+ />
26
+ </div>
27
+ </template>
28
+ </div>
29
+ </template>
30
+
31
+ <script>
32
+ import axios from 'axios'
33
+ import computedProperties from './computedProperties.js'
34
+ import useElementSize from './useElementSize'
35
+ import GSCTopCategory from '@/components/comparative/gsc-top.vue'
36
+
37
+ import { filtersTypes, personalDataSubFiltersTypes } from '@golstats/gsc-filters'
38
+
39
+ import '@@/@golstats/gsc-switch-component/dist/style.css'
40
+ import '@@/@golstats/gsc-season-select/dist/style.css'
41
+ import '@@/@golstats/gsc-tournament-select/dist/style.css'
42
+ import '@@/@golstats/gsc-dropdown/dist/style.css'
43
+ import '@@/@golstats/gsc-filters/dist/style.css'
44
+ import '@@/@golstats/gsc-label/dist/style.css'
45
+ import '@@/@golstats/gsc-filterperteam/dist/style.css'
46
+
47
+ import nationalitiesCatalog from '@/components/comparative/nationalities-catalog.js'
48
+ import { getButtonFilterProps } from '@/components/comparative/composable-filters.js'
49
+ const buttonFilterProps = ref(getButtonFilterProps())
50
+
51
+ import { ref } from 'vue'
52
+ export default {
53
+ components: {
54
+ GSCTopCategory,
55
+ },
56
+ computed: {
57
+ ...computedProperties.computed,
58
+ filterChangePredefined() {
59
+ return this.filtersPredefinedF
60
+ },
61
+ filterChange() {
62
+ const filtersaux2 = {
63
+ zone: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
64
+ playingAs: [1, 2],
65
+ sections: [1, 2, 3, 4, 5, 6],
66
+ matchResult: [1, 2, 3],
67
+ arrayAgeRange: [1, 60],
68
+ typeZone: 1,
69
+ setNationalitiesIds: this.fVnationalities,
70
+ setPositionsIds: [1, 2, 3, 4, 5, 6, 7, 8, 9],
71
+ booleanAreNationalTeamsVisible: false,
72
+ setAvailableNationalTeamsPlayersIds: new Set(),
73
+ }
74
+ const filtersaux2Const = JSON.stringify(filtersaux2)
75
+ if (JSON.stringify(this.filters) != filtersaux2Const) {
76
+ return filtersaux2Const
77
+ }
78
+ return filtersaux2Const
79
+ },
80
+ filterGolstats() {
81
+ return this.FVfilterGolstats
82
+ },
83
+ filterButtonProps() {
84
+ const buttonFilterPropsValues = {
85
+ ...buttonFilterProps.value,
86
+ }
87
+ return buttonFilterPropsValues
88
+ },
89
+ },
90
+ props: {
91
+ timeLiveComparativeAvanced: {
92
+ type: Number,
93
+ default: 60000,
94
+ },
95
+ currentSeasonId: {
96
+ type: Number,
97
+ default: 0,
98
+ },
99
+ typeData: {
100
+ type: Number,
101
+ default: 1,
102
+ },
103
+ canPlayVideos: {
104
+ type: Boolean,
105
+ default: false,
106
+ },
107
+ carrousel: {
108
+ type: Boolean,
109
+ default: false,
110
+ },
111
+ arrow: {
112
+ type: Boolean,
113
+ default: false,
114
+ },
115
+ teamId: {
116
+ type: Number,
117
+ default: 0,
118
+ },
119
+ gameId: {
120
+ type: Number,
121
+ default: 0,
122
+ },
123
+ isWidget: {
124
+ type: Boolean,
125
+ default: false,
126
+ },
127
+ seasonSelected: {
128
+ type: Object,
129
+ default: () => ({}),
130
+ },
131
+ categoryView: {
132
+ type: Array,
133
+ default: () => [],
134
+ },
135
+ teamWidget: {
136
+ type: Number,
137
+ default: 0,
138
+ },
139
+ game: {
140
+ type: Object,
141
+ default: () => ({}),
142
+ },
143
+ teamselect: {
144
+ type: Number,
145
+ default: 0,
146
+ },
147
+ seasonActive: {
148
+ type: Number,
149
+ default: 0,
150
+ },
151
+ defaultSection: {
152
+ type: String,
153
+ default: 'Jugadores',
154
+ },
155
+ backgroundOdd: { type: String, default: '#172531' },
156
+ backgroundEven: { type: String, default: '#0d1d29' },
157
+ tournamentsApiUrl: {
158
+ type: String,
159
+ default: '',
160
+ },
161
+ },
162
+ watch: {
163
+ async seasonActive() {
164
+ if (this.seasonActive != 0) {
165
+ this.teams = []
166
+ const data = await this.fetchTeams()
167
+ for (let index = 0; index < data.teams.length; index++) {
168
+ this.teams.push({
169
+ id: data.teams[index].team_id,
170
+ team: data.teams[index].colloquial_name,
171
+ logo: data.teams[index].logo,
172
+ })
173
+ }
174
+ }
175
+ },
176
+ },
177
+ setup() {
178
+ const myDivRefTopsFull = ref('myDivRefTopsFull')
179
+ const { elementSize } = useElementSize(myDivRefTopsFull)
180
+ return {
181
+ myDivRefTopsFull,
182
+ elementSize,
183
+ }
184
+ },
185
+
186
+ data() {
187
+ return {
188
+ showfiltersPc: false,
189
+ positions: [
190
+ {
191
+ name: 'Portero',
192
+ fullname: 'POR',
193
+ },
194
+ {
195
+ name: 'Defensa central',
196
+ fullname: 'DFC',
197
+ },
198
+ {
199
+ name: 'Lateral por izquierda',
200
+ fullname: 'LI',
201
+ },
202
+ {
203
+ name: 'Lateral por derecha',
204
+ fullname: 'LD',
205
+ },
206
+ {
207
+ name: 'Volante por izquierda',
208
+ fullname: 'VI',
209
+ },
210
+ {
211
+ name: 'Volante por derecha',
212
+ fullname: 'VD',
213
+ },
214
+ {
215
+ name: 'Volante defensivo',
216
+ fullname: 'VDF',
217
+ },
218
+ {
219
+ name: 'Volante ofensivo',
220
+ fullname: 'VO',
221
+ },
222
+ {
223
+ name: 'Delantero',
224
+ fullname: 'DEL',
225
+ },
226
+ {
227
+ name: 'Desconocida',
228
+ fullname: 'Desc',
229
+ },
230
+ ],
231
+ arrayFiltersPlays: [],
232
+ filtersPredefinedF: {},
233
+ categoryPredefinedActive: false,
234
+ categoryPredefined: 0,
235
+ typeTable: 0,
236
+ keyUpdateFilter: 0,
237
+ loadingActive: false,
238
+ isTeam: false,
239
+ arrayPredefinedFilters: [],
240
+ arrayCategoryFilter: [
241
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
242
+ ],
243
+ arrayCategoryFilterFull: [
244
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
245
+ ],
246
+ FVsetAvailableNationalTeamsPlayersIds: new Set(),
247
+ showOnlyCategories: false,
248
+ showFullCategory: 0,
249
+ categoryName: '',
250
+ showFullTable: false,
251
+ expansionPanelModePropsTypePlays: {
252
+ isExpansionPanel: false,
253
+ templateProps: {
254
+ boxShadow: '0px 4px 4px rgba(0, 0, 0, 0)',
255
+ width: '400px',
256
+ maxWidth: '400px',
257
+ },
258
+ expansionPanelProps: {
259
+ width: '400px',
260
+ borderRadius: '8px',
261
+ },
262
+ fieldComponentProps: {
263
+ widthContainer: '400px',
264
+ },
265
+ },
266
+ expansionPanelModeProps: {
267
+ isExpansionPanel: false,
268
+ templateProps: {
269
+ boxShadow: '0px 4px 4px rgba(0, 0, 0, 0)',
270
+ },
271
+ expansionPanelProps: {
272
+ width: '400px',
273
+ borderRadius: '8px',
274
+ fontFamily: "'Poppins-Regular'",
275
+ },
276
+ fieldComponentProps: {
277
+ widthContainer: '100%',
278
+ title: 'Elige el área o zona de cancha',
279
+ titleFontSize: '13px',
280
+ },
281
+ },
282
+ expansionPanelModePropsMobil: {
283
+ isExpansionPanel: true,
284
+ templateProps: {
285
+ boxShadow: '0px 4px 4px rgba(0, 0, 0, 0)',
286
+ padding: '20px 0',
287
+ },
288
+ expansionPanelProps: {
289
+ width: '300px',
290
+ borderRadius: '8px',
291
+ height: '45px',
292
+ fontColor: 'rgba(255,255,255, 0.7)',
293
+ textFontSize: '14px',
294
+ textFontFamily: "'Poppins-Regular'",
295
+ padding: '0px 10px',
296
+ },
297
+ fieldComponentProps: {
298
+ widthContainer: '100%',
299
+ title: 'Elige el área o zona de cancha',
300
+ titleFontSize: '12px',
301
+ widthField: 268,
302
+ widthFieldGrid: '268px',
303
+ heightField: 180,
304
+ heightFieldGrid: '180px',
305
+ heightContainer: '280px',
306
+ },
307
+ },
308
+ expansionPanelModePropsMobil270: {
309
+ isExpansionPanel: true,
310
+ templateProps: {
311
+ boxShadow: '0px 4px 4px rgba(0, 0, 0, 0)',
312
+ padding: '20px 0',
313
+ },
314
+ expansionPanelProps: {
315
+ width: '270px',
316
+ borderRadius: '8px',
317
+ height: '45px',
318
+ fontColor: 'rgba(255,255,255, 0.7)',
319
+ textFontSize: '14px',
320
+ textFontFamily: "'Poppins-Regular'",
321
+ padding: '0px 10px',
322
+ },
323
+ fieldComponentProps: {
324
+ widthContainer: '100%',
325
+ title: 'Elige el área o zona de cancha',
326
+ titleFontSize: '12px',
327
+ widthField: 268,
328
+ widthFieldGrid: '268px',
329
+ heightField: 180,
330
+ heightFieldGrid: '180px',
331
+ heightContainer: '280px',
332
+ },
333
+ },
334
+ filters: {
335
+ zone: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
336
+ playingAs: [1, 2],
337
+ sections: [1, 2, 3, 4, 5, 6],
338
+ matchResult: [1, 2, 3],
339
+ arrayAgeRange: [1, 60],
340
+ typeZone: 1,
341
+ setNationalitiesIds: this.setNationalitiesIds,
342
+ setPositionsIds: [1, 2, 3, 4, 5, 6, 7, 8, 9],
343
+ booleanAreNationalTeamsVisible: false,
344
+ setAvailableNationalTeamsPlayersIds: new Set(),
345
+ },
346
+ categoriesPlaysTypes: {
347
+ offensive: {
348
+ title: 'Ofensivo',
349
+ categories: [
350
+ {
351
+ name: 'Goles',
352
+ isSelected: true,
353
+ id: 1,
354
+ },
355
+ {
356
+ name: 'Tiros a gol',
357
+ isSelected: true,
358
+ id: 6,
359
+ },
360
+ {
361
+ name: 'Tiros a gol con destino a portería',
362
+ isSelected: true,
363
+ id: 7,
364
+ },
365
+ {
366
+ name: 'Asistencias',
367
+ isSelected: true,
368
+ id: 4,
369
+ },
370
+ {
371
+ name: 'Centros',
372
+ isSelected: true,
373
+ id: 10,
374
+ },
375
+ {
376
+ name: 'Centros acertados',
377
+ isSelected: true,
378
+ id: 11,
379
+ },
380
+ {
381
+ name: 'Participaciones en gol',
382
+ isSelected: true,
383
+ id: 5,
384
+ },
385
+ {
386
+ name: '1vs1 exitosos ofensivos',
387
+ isSelected: true,
388
+ id: 12,
389
+ },
390
+ {
391
+ name: '1vs1 exitosos ofensivos que terminan en gol',
392
+ isSelected: true,
393
+ id: 13,
394
+ },
395
+ {
396
+ name: 'Balones ganados en área rival',
397
+ isSelected: true,
398
+ id: 17,
399
+ },
400
+ {
401
+ name: 'Cabeceos en área rival',
402
+ isSelected: true,
403
+ id: 8,
404
+ },
405
+ {
406
+ name: 'Tiros de esquina',
407
+ isSelected: true,
408
+ id: 23,
409
+ },
410
+ ],
411
+ },
412
+ defensive: {
413
+ title: 'Defensivo',
414
+ categories: [
415
+ {
416
+ name: '1vs1 defensivos exitosos',
417
+ isSelected: true,
418
+ id: 14,
419
+ },
420
+ {
421
+ name: 'Cabeceo en área propia',
422
+ isSelected: true,
423
+ id: 9,
424
+ },
425
+ {
426
+ name: 'Balones ganados en área propia',
427
+ isSelected: true,
428
+ id: 16,
429
+ },
430
+ {
431
+ name: 'Rechaces',
432
+ isSelected: true,
433
+ id: 15,
434
+ },
435
+ {
436
+ name: 'Atajadas',
437
+ isSelected: true,
438
+ id: 22,
439
+ },
440
+ ],
441
+ },
442
+ possession: {
443
+ title: 'Posesión',
444
+ categories: [
445
+ {
446
+ name: 'Pases acertados',
447
+ isSelected: true,
448
+ id: 2,
449
+ },
450
+ {
451
+ name: 'Balones recuperados en disputa',
452
+ isSelected: true,
453
+ id: 3,
454
+ },
455
+ ],
456
+ },
457
+ offenses: {
458
+ title: 'Infracciones',
459
+ categories: [
460
+ {
461
+ name: 'Faltas cometidas',
462
+ isSelected: true,
463
+ id: 18,
464
+ },
465
+ {
466
+ name: 'Faltas recibidas',
467
+ isSelected: true,
468
+ id: 19,
469
+ },
470
+ {
471
+ name: 'Tarjetas amarillas',
472
+ isSelected: true,
473
+ id: 20,
474
+ },
475
+ {
476
+ name: 'Tarjetas rojas',
477
+ isSelected: true,
478
+ id: 21,
479
+ },
480
+ ],
481
+ },
482
+ offensesConditions: {
483
+ areYellowCardSelected: false,
484
+ areRedCardSelected: false,
485
+ areFoulsCommittedSelected: false,
486
+ },
487
+ },
488
+ categoriesDefault: [
489
+ {
490
+ id: 1,
491
+ name: 'Goles',
492
+ isSelected: false,
493
+ },
494
+ {
495
+ id: 2,
496
+ name: 'Pases acertados',
497
+ isSelected: false,
498
+ },
499
+ {
500
+ id: 23,
501
+ name: 'Tiros de Esquina',
502
+ isSelected: false,
503
+ },
504
+ {
505
+ id: 3,
506
+ name: 'Balones recuperados en disputa',
507
+ isSelected: false,
508
+ },
509
+ {
510
+ id: 4,
511
+ name: 'Asistencias',
512
+ isSelected: false,
513
+ },
514
+ {
515
+ id: 5,
516
+ name: 'Participaciones en gol',
517
+ isSelected: false,
518
+ },
519
+ {
520
+ id: 6,
521
+ name: 'Tiros a gol',
522
+ isSelected: false,
523
+ },
524
+ {
525
+ id: 7,
526
+ name: 'Tiros a gol que llegaron a la portería',
527
+ isSelected: false,
528
+ },
529
+ {
530
+ id: 8,
531
+ name: 'Cabeceos en área rival',
532
+ isSelected: false,
533
+ },
534
+ {
535
+ id: 9,
536
+ name: 'Cabeceos en área propia',
537
+ isSelected: false,
538
+ },
539
+ {
540
+ id: 10,
541
+ name: 'Centros',
542
+ isSelected: false,
543
+ },
544
+ {
545
+ id: 11,
546
+ name: 'Centros acertados',
547
+ isSelected: false,
548
+ },
549
+ {
550
+ id: 12,
551
+ name: '1vs1 exitosos ofensivos',
552
+ isSelected: false,
553
+ },
554
+ {
555
+ id: 13,
556
+ name: '1vs1 exitosos ofensivos que terminaron en gol',
557
+ isSelected: false,
558
+ },
559
+ {
560
+ id: 14,
561
+ name: '1vs1 defensivos exitoso',
562
+ isSelected: false,
563
+ },
564
+ {
565
+ id: 15,
566
+ name: 'Rechaces',
567
+ isSelected: false,
568
+ },
569
+ {
570
+ id: 16,
571
+ name: 'Balones ganados en área propia',
572
+ isSelected: false,
573
+ },
574
+ {
575
+ id: 17,
576
+ name: 'Balones ganados en área rival',
577
+ isSelected: false,
578
+ },
579
+ {
580
+ id: 18,
581
+ name: 'Faltas cometidas',
582
+ isSelected: false,
583
+ },
584
+ {
585
+ id: 19,
586
+ name: 'Faltas recibidas',
587
+ isSelected: false,
588
+ },
589
+ {
590
+ id: 20,
591
+ name: 'Tarjetas amarillas',
592
+ isSelected: false,
593
+ },
594
+ {
595
+ id: 21,
596
+ name: 'Tarjetas rojas',
597
+ isSelected: false,
598
+ },
599
+ {
600
+ id: 22,
601
+ name: 'Atajadas',
602
+ isSelected: false,
603
+ },
604
+ ],
605
+ isCup: false,
606
+ arrayPredefinedOrigin: [],
607
+ indexPredefinedFiltersSelected: 0,
608
+ predefinedFiltersMatchLapse: [],
609
+ predefinedFiltersPlayingAs: [],
610
+ predefinedFiltersSections: [],
611
+ updateTables: 0,
612
+ updateTablesfull: 0,
613
+ optionSelected: 'Jugadores',
614
+ optionSelectedSubmenu: 'Todas las jugadas',
615
+ tournamentsUrl: 'https://17zyhpyc7c.execute-api.us-west-2.amazonaws.com/prod/tournaments',
616
+ teamsUrl: 'https://d2oco6mqmc.execute-api.us-west-2.amazonaws.com/prod/teamsBySeason/',
617
+ urlFilter:
618
+ 'https://cqqxaonvm6.execute-api.us-east-2.amazonaws.com/prod/gs2/tops/filters?categories=',
619
+ retries: 3,
620
+ teams: [],
621
+ updateFilterGolstats: 0,
622
+ updateFilterPlaytypesGolstats: 0,
623
+ arrayTournaments: [],
624
+ arraySeasons: {},
625
+ seasonBytournament: [],
626
+ filtersTypes: filtersTypes,
627
+ token:
628
+ 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE',
629
+ fVnationalities: new Set(),
630
+ fVzone: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
631
+ fVplayingAs: [1, 2],
632
+ fVsections: [1, 2, 3, 4, 5, 6],
633
+ fVmatchResult: [1, 2, 3],
634
+ fVarrayAgeRange: [10, 40],
635
+ FVeligible: [],
636
+ FVYear: 1900,
637
+ fVtypeZone: 2,
638
+ fVsetPositionsIds: [1, 2, 3, 4, 5, 6, 7, 8, 9],
639
+ currentIndex: -1,
640
+ delay: 800,
641
+ tournamentSelected: 0,
642
+ tournamentSelectedObj: {},
643
+ FVfilterGolstats: [],
644
+ updateFilterField: 0,
645
+ openMenuMobil: false,
646
+ selectedTournament: { seasons: [] },
647
+ selectedSeasonObj: {},
648
+ }
649
+ },
650
+ methods: {
651
+ getnameshort(namePlayerShort) {
652
+ var NameArrayHomeBench = namePlayerShort.split(',')
653
+ var lastArrayNameBench = NameArrayHomeBench[0].split(' ')
654
+ var ArrayNameBench = NameArrayHomeBench[1].trim().split(' ')
655
+ var lastNameHomeBench = ''
656
+ if (lastArrayNameBench.length == 2 || lastArrayNameBench.length == 1) {
657
+ if (lastArrayNameBench[0].length < 4) {
658
+ lastNameHomeBench = lastArrayNameBench[0] + ' ' + lastArrayNameBench[1]
659
+ } else {
660
+ lastNameHomeBench = lastArrayNameBench[0]
661
+ }
662
+ } else {
663
+ if (lastArrayNameBench.length == 3) {
664
+ lastNameHomeBench = lastArrayNameBench[0] + ' ' + lastArrayNameBench[1]
665
+ } else {
666
+ if (lastArrayNameBench.length == 4) {
667
+ lastNameHomeBench =
668
+ lastArrayNameBench[1] + ' ' + lastArrayNameBench[2] + ' ' + lastArrayNameBench[3]
669
+ }
670
+ }
671
+ }
672
+ var nameHomeBench =
673
+ ArrayNameBench[ArrayNameBench.length - 1] != ''
674
+ ? ArrayNameBench[ArrayNameBench.length - 1].charAt(0)
675
+ : ArrayNameBench[ArrayNameBench.length - 2]
676
+ ? ArrayNameBench[ArrayNameBench.length - 2].charAt(0)
677
+ : ''
678
+ lastNameHomeBench = lastNameHomeBench.replace(',', '')
679
+ return nameHomeBench + '. ' + lastNameHomeBench
680
+ },
681
+ setUpTournamentsToFilter() {
682
+ this.tournamentsToFilter.forEach((tournament) => {
683
+ const isSameTournament = tournament.id === this.selectedTournament.id
684
+ tournament.isSelected = isSameTournament
685
+ tournament.isDefaultTournament = isSameTournament
686
+ })
687
+ },
688
+ async onClickDeleteFilter() {
689
+ if (this.optionSelectedSubmenu == 'Predeterminados') {
690
+ this.resetPredefinedTeamAll()
691
+ } else {
692
+ this.arrayFiltersPlays = []
693
+ setTimeout(() => {
694
+ // Reset completado
695
+ }, 200)
696
+ }
697
+ },
698
+ clickOpenFilters() {
699
+ this.showfiltersPc = true
700
+ },
701
+ clickCloseFilters() {
702
+ this.showfiltersPc = false
703
+ },
704
+ async selectedSeason(season) {
705
+ if (this.seasonActive !== season.id) {
706
+ this.seasonActive = season.id
707
+ this.resetPredefinedTeamAll()
708
+ this.$emit('change-season-id', season.id)
709
+ }
710
+ },
711
+ changeTournament(tournament) {
712
+ if (tournament.id !== this.selectedTournament.id) {
713
+ this.selectedTournament = tournament
714
+ this.tournamentSelectedObj = { propName: 'id', value: tournament.id }
715
+ this.teamselect = 0
716
+ this.resetPredefinedTeamAll() //resetpredeterminados
717
+ this.setUpTournamentsToFilter()
718
+ }
719
+ },
720
+ changeTournamentMovil(item) {
721
+ this.tournamentSelectedObj = { propName: 'id', value: item.id }
722
+ this.seasonBytournament = item.seasons
723
+ this.teamselect = 0
724
+ },
725
+ selectedSeasonMovil(item) {
726
+ this.seasonActive = item.id
727
+ },
728
+ setRelevantCategoriesPlayer(positionId) {
729
+ return positionId === 1
730
+ ? [39, 40, 52, 53, 54, 55, 323, 324, 608, 774, 802]
731
+ : [
732
+ 10, 12, 14, 15, 27, 35, 61, 217, 257, 466, 519, 607, 702, 730, 98, 101, 109, 112, 121,
733
+ 122, 127, 128, 135, 136, 141, 142, 161, 170, 179, 211, 232, 235, 239, 242, 282, 284,
734
+ 289, 291, 296, 485, 486, 487, 488,
735
+ ]
736
+ },
737
+
738
+ setOpenMedia(data) {
739
+ this.$emit('openmedia', data)
740
+ },
741
+
742
+ setMediaData(data) {
743
+ const videoPlayerSection = 1
744
+ const playerType = 2
745
+ const playListType = playerType
746
+ let playerIds = [data.id]
747
+ let teamId = data.team_id
748
+ const jsonConfig = {
749
+ seasonId: data.season_id,
750
+ // seasons: data.seasons,
751
+ isFeaturedPlayers: false,
752
+ mainSectionType: videoPlayerSection,
753
+ playListType: playListType,
754
+ gameIds: null,
755
+ playerIds: playerIds,
756
+ goalkeeperIds: [],
757
+ categoryIds: this.setRelevantCategoriesPlayer(data.position),
758
+ teamId: teamId || 0,
759
+ matchResult: [1, 2, 3],
760
+ categorySingleName: '',
761
+ isRivalSubject: false,
762
+ avoidCategorySingleName: false,
763
+ currentPlayIndex: 0,
764
+ playData: null,
765
+ lastClashedGameId: null,
766
+ tournamentsLastClashes: null,
767
+ advancedFilter: {
768
+ playListTitle: 'Jugadas Relevantes',
769
+ },
770
+ }
771
+ this.$emit('openmedia', jsonConfig)
772
+ },
773
+ clickprofile(data) {
774
+ if (data.isTeam) {
775
+ this.$emit('openProfileTeam', { teamId: data.id, seasonId: this.seasonActive })
776
+ } else {
777
+ this.$emit('openProfilePlayer', {
778
+ playerId: data.id,
779
+ teamId: data.teamId,
780
+ seasonId: this.seasonActive,
781
+ })
782
+ }
783
+ },
784
+
785
+ viewprofile(data, seasonId, teamId) {
786
+ this.$emit('openProfilePlayer', {
787
+ playerId: data,
788
+ teamId,
789
+ seasonId: seasonId ? seasonId : this.seasonActive,
790
+ })
791
+ },
792
+
793
+ openMenuFilters() {
794
+ this.openMenuMobil = !this.openMenuMobil
795
+ this.showfiltersPc = true
796
+ },
797
+ clickexpand() {
798
+ // Método eliminado - relacionado con scouting
799
+ },
800
+ async getScoutingData() {
801
+ this.arrayFiltersPlays = []
802
+ this.loadingActive = true
803
+
804
+ const axiosInstance = axios.create({ headers: { Authorization: `${this.token}` } })
805
+ const { data } = await axiosInstance.post(
806
+ 'https://eh9nhj69z7.execute-api.us-west-2.amazonaws.com/prod/players/productivity',
807
+ this.filterScounting,
808
+ { headers: { 'Content-Type': 'application/json' } },
809
+ )
810
+
811
+ if (this.filterScounting.tournaments.length > 0) {
812
+ var indiceFilterOnPlays = this.arrayFiltersPlays.findIndex(
813
+ (objeto) => objeto.type === 'onFiltersTournaments',
814
+ )
815
+ if (indiceFilterOnPlays !== -1) {
816
+ this.arrayFiltersPlays[indiceFilterOnPlays].name =
817
+ this.filterScounting.tournaments.length > 1
818
+ ? 'Ligas ' + this.filterScounting.tournaments.length
819
+ : this.nameLeagueSelected != ''
820
+ ? this.nameLeagueSelected
821
+ : 'Liga MX'
822
+ } else {
823
+ this.arrayFiltersPlays.push({
824
+ name:
825
+ this.filterScounting.tournaments.length > 1
826
+ ? 'Ligas ' + this.filterScounting.tournaments.length
827
+ : this.nameLeagueSelected != ''
828
+ ? this.nameLeagueSelected
829
+ : 'Liga MX',
830
+ type: 'onFiltersTournaments',
831
+ })
832
+ }
833
+ }
834
+
835
+ this.rowScoutingData = []
836
+ for (let index = 0; index < data.length; index++) {
837
+ const element = data[index]
838
+ let arrayDateOfBirth = data[index].dob.split('T')
839
+ let dateOfBirth = arrayDateOfBirth[0].split('-')
840
+ var dataRow = {
841
+ position: index + 1,
842
+ player_name: this.abrevName(data[index].name),
843
+ player_photo:
844
+ 'https://golstatsimages.blob.core.windows.net/players-profile/' +
845
+ data[index].player_id +
846
+ '.png',
847
+ total: data[index].total.toFixed(0),
848
+ id: data[index].player_id,
849
+ player_age: this.calcularEdad(data[index].dob),
850
+ team_abrev: data[index].teams[0].acronym,
851
+ team_name: data[index].teams[0].team_name,
852
+ team_logo:
853
+ 'https://golstatsimages.blob.core.windows.net/teams-80/' +
854
+ data[index].teams[0].team_id +
855
+ '.png',
856
+ player_position: data[index].position_id,
857
+ player_country_flag:
858
+ 'https://golstatsimages.blob.core.windows.net/flags/' +
859
+ data[index].nationality_id +
860
+ '.jpg',
861
+ date: dateOfBirth[2] + '.' + dateOfBirth[1] + '.' + dateOfBirth[0].substring(2, 4),
862
+ team_id: data[index].team_id,
863
+ nationality_name: nationalitiesCatalog[data[index].nationality_id],
864
+ player_games: data[index].games_played,
865
+ player_min: data[index].minutes_played,
866
+ league_name: data[index].tournament_name,
867
+ seasons: data[index].seasons,
868
+ season_id: data[index].seasons[0],
869
+ }
870
+ this.rowScoutingData.push(dataRow)
871
+ }
872
+
873
+ if (this.seasonsFilterSelected != 0) {
874
+ const datateams = await this.fetchTeamsScouting(this.seasonsFilterSelected)
875
+ this.teamselect = 0
876
+ this.teamselectrec = 0
877
+ this.teamsscouting = []
878
+ for (let index = 0; index < datateams.teams.length; index++) {
879
+ this.teamsscouting.push({
880
+ id: datateams.teams[index].team_id,
881
+ team: datateams.teams[index].colloquial_name,
882
+ logo: datateams.teams[index].logo,
883
+ })
884
+ }
885
+ }
886
+ this.loadingActive = false
887
+ },
888
+ abrevName(name) {
889
+ var NameArrayHome = name.split(',')
890
+ var lastArrayName = NameArrayHome[0].split(' ')
891
+ var ArrayName = NameArrayHome[1].trim().split(' ')
892
+ var lastNameHome = ''
893
+ if (lastArrayName.length == 2 || lastArrayName.length == 1) {
894
+ if (lastArrayName[0].length < 4) {
895
+ lastNameHome = lastArrayName[0] + ' ' + lastArrayName[1]
896
+ } else {
897
+ lastNameHome = lastArrayName[0]
898
+ }
899
+ } else {
900
+ if (lastArrayName.length == 3) {
901
+ lastNameHome = lastArrayName[0] + ' ' + lastArrayName[1]
902
+ } else {
903
+ if (lastArrayName.length == 4) {
904
+ lastNameHome = lastArrayName[1] + ' ' + lastArrayName[2] + ' ' + lastArrayName[3]
905
+ }
906
+ }
907
+ }
908
+ var nameHome =
909
+ ArrayName[ArrayName.length - 1] != ''
910
+ ? ArrayName[ArrayName.length - 1].charAt(0)
911
+ : ArrayName[ArrayName.length - 2]
912
+ ? ArrayName[ArrayName.length - 2].charAt(0)
913
+ : ''
914
+ lastNameHome = lastNameHome.replace(',', '')
915
+ var abrevNamePlayerHome = nameHome + '. ' + lastNameHome
916
+ return abrevNamePlayerHome
917
+ },
918
+ calcularEdad(fechaNacimiento) {
919
+ // Parsea la fecha de nacimiento en formato "YYYY-MM-DD"
920
+ var fechaNac = new Date(fechaNacimiento)
921
+
922
+ // Obtiene la fecha actual
923
+ var fechaActual = new Date()
924
+
925
+ // Calcula la diferencia en milisegundos entre las dos fechas
926
+ var diferencia = fechaActual - fechaNac
927
+
928
+ // Convierte la diferencia de milisegundos a años
929
+ var edadEnAnios = Math.floor(diferencia / (1000 * 60 * 60 * 24 * 365.25))
930
+
931
+ return edadEnAnios
932
+ },
933
+ async onFiltersTournaments(ObjectFilter) {
934
+ this.modifidFiltersFlag = true
935
+ var data = []
936
+ for (let index = 0; index < ObjectFilter.length; index++) {
937
+ if (ObjectFilter[index].isSelected) {
938
+ data.push(ObjectFilter[index].id)
939
+ }
940
+ }
941
+ if (data.length == 0) {
942
+ data = [1]
943
+ }
944
+ if (data.length == 1) {
945
+ for (let index = 0; index < ObjectFilter.length; index++) {
946
+ if (ObjectFilter[index].isSelected) {
947
+ this.nameLeagueSelected = ObjectFilter[index].name
948
+ this.seasonsFilterSelected = ObjectFilter[index].seasons[0].id
949
+ }
950
+ }
951
+ } else {
952
+ this.seasonsFilterSelected = 0
953
+ if (data.length > 0) {
954
+ this.nameLeagueSelected = data.length + ' Ligas'
955
+ }
956
+ }
957
+ this.filterScounting.tournaments = data
958
+ this.filterScounting.seasonId = ObjectFilter[0].seasons[0].id
959
+ },
960
+ onFiltersPersonalData(ObjectFilter) {
961
+ this.modifidFiltersFlag = true
962
+ if (ObjectFilter.hasOwnProperty('ageByRange')) {
963
+ const min = ObjectFilter.ageByRange.min == 0 ? 10 : ObjectFilter.ageByRange.min
964
+ const max = ObjectFilter.ageByRange.max == 0 ? 40 : ObjectFilter.ageByRange.max
965
+ this.filterScounting.range_age = [min, max]
966
+ this.filterScounting.age_or_year = 1
967
+ } else {
968
+ this.filterScounting.range_age = []
969
+ }
970
+ if (ObjectFilter.hasOwnProperty('year')) {
971
+ this.filterScounting.year = ObjectFilter.year
972
+ this.filterScounting.age_or_year = 0
973
+ } else {
974
+ this.filterScounting.year = 0
975
+ }
976
+
977
+ var dataNationalities = []
978
+ if (ObjectFilter.hasOwnProperty('nationalities')) {
979
+ for (let index = 0; index < ObjectFilter.nationalities.length; index++) {
980
+ if (ObjectFilter.nationalities[index].isSelected) {
981
+ dataNationalities.push(ObjectFilter.nationalities[index].id)
982
+ }
983
+ }
984
+ if (dataNationalities.length == 0) {
985
+ dataNationalities = [
986
+ 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
987
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
988
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
989
+ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 221, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94,
990
+ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
991
+ 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
992
+ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
993
+ 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163,
994
+ 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180,
995
+ 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
996
+ 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
997
+ 215, 216, 217, 218, 219, 220, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232,
998
+ 233, 234, 236, 237, 239,
999
+ ]
1000
+ }
1001
+ }
1002
+ this.filterScounting.elegibles = []
1003
+ if (ObjectFilter.hasOwnProperty('eligibility')) {
1004
+ this.filterScounting.elegibles = [ObjectFilter.eligibility[0].id]
1005
+ }
1006
+
1007
+ var dataPositions = []
1008
+ for (let index = 0; index < ObjectFilter.positions.length; index++) {
1009
+ if (ObjectFilter.positions[index].isSelected) {
1010
+ dataPositions.push(ObjectFilter.positions[index].id)
1011
+ }
1012
+ }
1013
+ if (dataPositions.length == 0) {
1014
+ dataPositions = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
1015
+ }
1016
+ this.filterScounting.positions = dataPositions
1017
+ this.filterScounting.nationalities = dataNationalities
1018
+ },
1019
+ onFiltersUniverse(ObjectFilter) {
1020
+ this.modifidFiltersFlag = true
1021
+ this.filterScounting.minutes_played = Number(ObjectFilter.minutesPlayed)
1022
+ this.filterScounting.last_months = Number(ObjectFilter.lastMonths)
1023
+ this.filterScounting.minutes_played_avg = Number(ObjectFilter.percentMinutesPlayed)
1024
+ this.filterScounting.type_stats = ObjectFilter.statistics.averagePerGame
1025
+ ? 3
1026
+ : ObjectFilter.statistics.averagePerMinute
1027
+ ? 2
1028
+ : 1
1029
+ },
1030
+ onFiltersProductivity(ObjectFilter) {
1031
+ this.modifidFiltersFlag = true
1032
+ var dataCategories = []
1033
+ for (let index = 0; index < ObjectFilter.productivityFilters.length; index++) {
1034
+ dataCategories[ObjectFilter.productivityFilters[index].priority - 1] = {
1035
+ name: ObjectFilter.productivityFilters[index].name,
1036
+ ids: ObjectFilter.productivityFilters[index].id,
1037
+ }
1038
+ }
1039
+ if (dataCategories.length == 0) {
1040
+ dataCategories = [
1041
+ /* { name: 'Goles', ids: [12] },
1042
+ { name: 'Asistencias', ids: [10] },
1043
+ { name: 'Participaciones en gol', ids: [27] },
1044
+ { name: 'Cabeceos en área rival', ids: [330, 333, 423, 577, 578, 331, 334, 424] },
1045
+ { name: 'Tiros a gol totales', ids: [91, 95, 92, 93, 96, 97] }*/
1046
+ ]
1047
+ }
1048
+ this.filterScounting.categories = dataCategories
1049
+ this.filterScounting.fouls = ObjectFilter.offensesConditions.areFoulsCommittedSelected
1050
+ this.filterScounting.yellow_cards = ObjectFilter.offensesConditions.areYellowCardsSelected
1051
+ this.filterScounting.red_cards = ObjectFilter.offensesConditions.areRedCardsSelected
1052
+ },
1053
+ onFiltersGolStats(ObjectFilter) {
1054
+ if (ObjectFilter.length > 0) {
1055
+ var indiceFilterOnPlays = this.arrayFiltersPlays.findIndex(
1056
+ (objeto) => objeto.type === 'onFiltersPredefined',
1057
+ )
1058
+ if (indiceFilterOnPlays !== -1) {
1059
+ this.arrayFiltersPlays[indiceFilterOnPlays].name = ObjectFilter[0].name
1060
+ } else {
1061
+ this.arrayFiltersPlays.push({ name: ObjectFilter[0].name, type: 'onFiltersPredefined' })
1062
+ }
1063
+ this.filtersPredefinedF = ObjectFilter[0].filters
1064
+ } else {
1065
+ var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1066
+ (objeto) => objeto.type === 'onFiltersPredefined',
1067
+ )
1068
+ if (this.FVfilterGolstats.length > 0 && indiceFilterOnPlaysAuxC !== -1) {
1069
+ this.filtersPredefinedF = this.filters
1070
+ for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1071
+ this.FVfilterGolstats[index].isSelected = false
1072
+ }
1073
+ var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1074
+ (objeto) => objeto.type === 'onFiltersPredefined',
1075
+ )
1076
+ if (indiceFilterOnPlaysAuxC !== -1) {
1077
+ this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1078
+ }
1079
+ this.updateFilterGolstats += 1
1080
+ }
1081
+ }
1082
+ },
1083
+ shouldRender(index) {
1084
+ // Check if the element at the given index should be rendered
1085
+ return index <= this.currentIndex
1086
+ },
1087
+ renderNext() {
1088
+ // Render the next element after a delay
1089
+ this.currentIndex++
1090
+ if (this.currentIndex < this.categoriesDefault.length) {
1091
+ setTimeout(() => {
1092
+ this.$nextTick(() => {
1093
+ this.renderNext()
1094
+ })
1095
+ }, this.delay)
1096
+ }
1097
+ },
1098
+ async onFiltersPlaysTypes(idplaytype) {
1099
+ if (idplaytype.length > 0) {
1100
+ this.categoryPredefinedActive = true
1101
+ this.loadingActive = true
1102
+ this.categoryPredefined = idplaytype[0].id
1103
+
1104
+ var indiceFilterOnPredefinedCategory = this.arrayFiltersPlays.findIndex(
1105
+ (objeto) => objeto.type === 'onFiltersPredefined',
1106
+ )
1107
+
1108
+ if (this.categoriesDefault.length > 0 && indiceFilterOnPredefinedCategory !== -1) {
1109
+ this.FVfilterGolstats = []
1110
+ this.filtersPredefinedF = {}
1111
+
1112
+ this.arrayFiltersPlays.splice(indiceFilterOnPredefinedCategory, 1)
1113
+ var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1114
+ (objeto) => objeto.type === 'onFiltersPredefined',
1115
+ )
1116
+
1117
+ if (indiceFilterOnPlaysAuxC !== -1) {
1118
+ for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1119
+ this.FVfilterGolstats[index].isSelected = false
1120
+ }
1121
+ if (indiceFilterOnPlaysAuxC !== -1) {
1122
+ this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1123
+ }
1124
+ this.updateFilterGolstats += 1
1125
+ }
1126
+ }
1127
+ this.updateTables += 1
1128
+ setTimeout(() => {
1129
+ this.loadingActive = false
1130
+ }, 1000)
1131
+ await this.getPredefinedfilters(idplaytype[0])
1132
+ if (this.FVfilterGolstats.length > 0) {
1133
+ this.onFiltersGolStats([this.FVfilterGolstats[0]])
1134
+ this.FVfilterGolstats[0].isSelected = true
1135
+ }
1136
+ } else {
1137
+ var indiceFilterOnPredefinedCategory = this.arrayFiltersPlays.findIndex(
1138
+ (objeto) => objeto.type === 'onFiltersPredefinedCategory',
1139
+ )
1140
+
1141
+ if (this.categoriesDefault.length > 0 && indiceFilterOnPredefinedCategory !== -1) {
1142
+ this.categoryPredefinedActive = false
1143
+ this.categoryPredefined = 0
1144
+ this.FVfilterGolstats = []
1145
+ this.filtersPredefinedF = this.filters
1146
+
1147
+ this.arrayFiltersPlays.splice(indiceFilterOnPredefinedCategory, 1)
1148
+ for (let indexD = 0; indexD < this.categoriesDefault.length; indexD++) {
1149
+ this.categoriesDefault[indexD].isSelected = false
1150
+ }
1151
+ this.updateFilterPlaytypesGolstats += 1
1152
+ //filtro golstats
1153
+ var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1154
+ (objeto) => objeto.type === 'onFiltersPredefined',
1155
+ )
1156
+ if (this.FVfilterGolstats.length > 0 && indiceFilterOnPlaysAuxC !== -1) {
1157
+ for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1158
+ this.FVfilterGolstats[index].isSelected = false
1159
+ }
1160
+ if (indiceFilterOnPlaysAuxC !== -1) {
1161
+ this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1162
+ }
1163
+ this.updateFilterGolstats += 1
1164
+ }
1165
+ }
1166
+ }
1167
+ },
1168
+ deleteCategoryFilter() {
1169
+ this.categoryName = ''
1170
+ this.showFullCategory = 0
1171
+ this.showFullTable = false
1172
+ //this.updateTables -= 1
1173
+ delete this.filters.aux
1174
+ },
1175
+ onShowFullTable(data) {
1176
+ this.categoryName = data.categoryName
1177
+ this.showFullCategory = data.category
1178
+ this.showFullTable = true
1179
+ this.loadingActive = true
1180
+ setTimeout(() => {
1181
+ this.filters = {
1182
+ zone: this.fVzone,
1183
+ playingAs: this.fVplayingAs,
1184
+ sections: this.fVsections,
1185
+ matchResult: this.fVmatchResult,
1186
+ arrayAgeRange: this.fVarrayAgeRange,
1187
+ typeZone: this.fVtypeZone,
1188
+ setNationalitiesIds: this.fVnationalities,
1189
+ setPositionsIds: this.fVsetPositionsIds,
1190
+ setYear: this.FVYear,
1191
+ aux: this.getRandomNumber(1, 10000),
1192
+ booleanAreNationalTeamsVisible: this.FVbooleanAreNationalTeamsVisible,
1193
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1194
+ }
1195
+ this.loadingActive = false
1196
+ }, 1000)
1197
+
1198
+ //this.updateTables += 1
1199
+ },
1200
+ getRandomNumber(min, max) {
1201
+ return Math.floor(Math.random() * (max - min + 1)) + min
1202
+ },
1203
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1204
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1205
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1206
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1207
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1208
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1209
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1210
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1211
+ applyFiltersBtn(aplyval) {},
1212
+ onFiltersPlays(plays) {
1213
+ this.arrayCategoryFilter = []
1214
+ this.arrayCategoryFilterFull = []
1215
+ if (plays.playsCategories.length == 0) {
1216
+ for (
1217
+ let index = 0;
1218
+ index < this.categoriesPlaysTypes.offensive.categories.length;
1219
+ index++
1220
+ ) {
1221
+ this.arrayCategoryFilter.push(this.categoriesPlaysTypes.offensive.categories[index].id)
1222
+ this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1223
+ }
1224
+ for (
1225
+ let index = 0;
1226
+ index < this.categoriesPlaysTypes.defensive.categories.length;
1227
+ index++
1228
+ ) {
1229
+ this.arrayCategoryFilter.push(this.categoriesPlaysTypes.defensive.categories[index].id)
1230
+ this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1231
+ }
1232
+ for (
1233
+ let index = 0;
1234
+ index < this.categoriesPlaysTypes.possession.categories.length;
1235
+ index++
1236
+ ) {
1237
+ this.arrayCategoryFilter.push(this.categoriesPlaysTypes.possession.categories[index].id)
1238
+ this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1239
+ }
1240
+ for (let index = 0; index < this.categoriesPlaysTypes.offenses.categories.length; index++) {
1241
+ this.arrayCategoryFilter.push(this.categoriesPlaysTypes.offenses.categories[index].id)
1242
+ this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1243
+ }
1244
+ } else {
1245
+ for (let index = 0; index < plays.playsCategories.length; index++) {
1246
+ if (plays.playsCategories[index].isSelected) {
1247
+ this.arrayCategoryFilter.push(plays.playsCategories[index].id)
1248
+ this.arrayCategoryFilterFull.push(plays.playsCategories[index])
1249
+ }
1250
+ }
1251
+ }
1252
+ var indiceFilterOnPlays = this.arrayFiltersPlays.findIndex(
1253
+ (objeto) => objeto.type === 'onFiltersPlays',
1254
+ )
1255
+ if (this.arrayCategoryFilter.length > 0 && this.arrayCategoryFilter.length != 23) {
1256
+ if (this.arrayCategoryFilter.length == 1) {
1257
+ if (indiceFilterOnPlays != -1) {
1258
+ this.arrayFiltersPlays[indiceFilterOnPlays].name = this.arrayCategoryFilterFull[0].name
1259
+ } else {
1260
+ this.arrayFiltersPlays.push({
1261
+ name: this.arrayCategoryFilterFull[0].name,
1262
+ type: 'onFiltersPlays',
1263
+ })
1264
+ }
1265
+ } else {
1266
+ if (indiceFilterOnPlays != -1) {
1267
+ this.arrayFiltersPlays[indiceFilterOnPlays].name =
1268
+ this.arrayCategoryFilterFull.length + ' Tipos de jugadas'
1269
+ } else {
1270
+ this.arrayFiltersPlays.push({
1271
+ name: this.arrayCategoryFilterFull.length + ' Tipos de jugadas',
1272
+ type: 'onFiltersPlays',
1273
+ })
1274
+ }
1275
+ }
1276
+ } else {
1277
+ if (indiceFilterOnPlays !== -1) {
1278
+ this.arrayFiltersPlays.splice(indiceFilterOnPlays, 1)
1279
+ }
1280
+ }
1281
+ },
1282
+ async deleteLabelFilter(deleteFilterValID) {
1283
+ var indiceFilterOnPlays = this.arrayFiltersPlays.findIndex(
1284
+ (objeto) => objeto.type === deleteFilterValID,
1285
+ )
1286
+ if (indiceFilterOnPlays !== -1) {
1287
+ if (deleteFilterValID == 'onFiltersTournaments') {
1288
+ this.arrayFiltersPlays = []
1289
+ setTimeout(() => {
1290
+ // Reset completado
1291
+ }, 200)
1292
+ }
1293
+ if (deleteFilterValID == 'onFiltersPlays') {
1294
+ for (
1295
+ let index = 0;
1296
+ index < this.categoriesPlaysTypes.offensive.categories.length;
1297
+ index++
1298
+ ) {
1299
+ this.categoriesPlaysTypes.offensive.categories[index].isSelected = true
1300
+ }
1301
+ for (
1302
+ let index = 0;
1303
+ index < this.categoriesPlaysTypes.defensive.categories.length;
1304
+ index++
1305
+ ) {
1306
+ this.categoriesPlaysTypes.defensive.categories[index].isSelected = true
1307
+ this.arrayCategoryFilter.push()
1308
+ this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1309
+ }
1310
+ for (
1311
+ let index = 0;
1312
+ index < this.categoriesPlaysTypes.possession.categories.length;
1313
+ index++
1314
+ ) {
1315
+ this.categoriesPlaysTypes.possession.categories[index].isSelected = true
1316
+ }
1317
+ for (
1318
+ let index = 0;
1319
+ index < this.categoriesPlaysTypes.offenses.categories.length;
1320
+ index++
1321
+ ) {
1322
+ this.categoriesPlaysTypes.offenses.categories[index].isSelected = true
1323
+ }
1324
+ }
1325
+ if (deleteFilterValID == 'onFiltersField') {
1326
+ this.fVzone = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
1327
+
1328
+ this.filters = {
1329
+ zone: this.fVzone,
1330
+ playingAs: this.fVplayingAs,
1331
+ sections: this.fVsections,
1332
+ matchResult: this.fVmatchResult,
1333
+ arrayAgeRange: this.fVarrayAgeRange,
1334
+ typeZone: this.fVtypeZone,
1335
+ setNationalitiesIds: this.fVnationalities,
1336
+ setPositionsIds: this.fVsetPositionsIds,
1337
+ setYear: this.FVYear,
1338
+ booleanAreNationalTeamsVisible: false,
1339
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1340
+ }
1341
+ }
1342
+ if (deleteFilterValID == 'onFiltersPredefined') {
1343
+ this.filtersPredefinedF = this.filters
1344
+ for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1345
+ this.FVfilterGolstats[index].isSelected = false
1346
+ }
1347
+ this.updateFilterGolstats += 1
1348
+ this.resetPredefinedTeamAll()
1349
+ }
1350
+ if (deleteFilterValID == 'onFiltersPredefinedCategory') {
1351
+ this.categoryPredefinedActive = false
1352
+ this.categoryPredefined = 0
1353
+ this.FVfilterGolstats = []
1354
+ this.filtersPredefinedF = this.filters
1355
+ var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1356
+ (objeto) => objeto.type === 'onFiltersPredefined',
1357
+ )
1358
+ if (indiceFilterOnPlaysAuxC !== -1) {
1359
+ this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1360
+ }
1361
+ for (let indexD = 0; indexD < this.categoriesDefault.length; indexD++) {
1362
+ this.categoriesDefault[indexD].isSelected = false
1363
+ }
1364
+ this.updateFilterPlaytypesGolstats += 1
1365
+ }
1366
+ if (deleteFilterValID == 'onFiltersDetailsTime') {
1367
+ this.detailsObject.gameSections[0].isSelected = true
1368
+ this.detailsObject.gameSections[1].isSelected = true
1369
+ this.detailsObject.gameSections[2].isSelected = true
1370
+ this.detailsObject.gameSections[3].isSelected = true
1371
+ this.detailsObject.gameSections[4].isSelected = true
1372
+ this.detailsObject.gameSections[5].isSelected = true
1373
+ this.fVsections = [1, 2, 3, 4, 5, 6]
1374
+
1375
+ this.filters = {
1376
+ zone: this.fVzone,
1377
+ playingAs: this.fVplayingAs,
1378
+ sections: this.fVsections,
1379
+ matchResult: this.fVmatchResult,
1380
+ arrayAgeRange: this.fVarrayAgeRange,
1381
+ typeZone: this.fVtypeZone,
1382
+ setNationalitiesIds: this.fVnationalities,
1383
+ setPositionsIds: this.fVsetPositionsIds,
1384
+ setYear: this.FVYear,
1385
+ booleanAreNationalTeamsVisible: false,
1386
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1387
+ }
1388
+ }
1389
+ if (deleteFilterValID == 'onFiltersDetailsPlayingAs') {
1390
+ this.detailsObject.playingAs[0].isSelected = true
1391
+ this.detailsObject.playingAs[1].isSelected = true
1392
+ this.fVplayingAs = [1, 2]
1393
+ this.filters = {
1394
+ zone: this.fVzone,
1395
+ playingAs: this.fVplayingAs,
1396
+ sections: this.fVsections,
1397
+ matchResult: this.fVmatchResult,
1398
+ arrayAgeRange: this.fVarrayAgeRange,
1399
+ typeZone: this.fVtypeZone,
1400
+ setNationalitiesIds: this.fVnationalities,
1401
+ setPositionsIds: this.fVsetPositionsIds,
1402
+ setYear: this.FVYear,
1403
+ booleanAreNationalTeamsVisible: false,
1404
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1405
+ }
1406
+ }
1407
+ if (deleteFilterValID == 'onFiltersNationality') {
1408
+ this.fVnationalities.add(138)
1409
+ this.fVnationalities.add(222)
1410
+ this.fVnationalities.add(163)
1411
+ this.fVnationalities.add(51)
1412
+ this.fVnationalities.add(226)
1413
+ this.fVnationalities.add(10)
1414
+ this.fVnationalities.add(223)
1415
+ this.fVnationalities.add(96)
1416
+ this.fVnationalities.add(171)
1417
+ this.fVnationalities.add(198)
1418
+ this.fVnationalities.add(105)
1419
+ this.fVnationalities.add(80)
1420
+ this.fVnationalities.add(29)
1421
+ this.fVnationalities.add(74)
1422
+ this.fVnationalities.add(216)
1423
+ this.fVnationalities.add(196)
1424
+ this.fVnationalities.add(64)
1425
+ this.fVnationalities.add(155)
1426
+ this.fVnationalities.add(156)
1427
+ this.fVnationalities.add(89)
1428
+ this.fVnationalities.add(106)
1429
+ this.fVnationalities.add(81)
1430
+ this.fVnationalities.add(233)
1431
+ this.fVnationalities.add(204)
1432
+ this.filters = {
1433
+ zone: this.fVzone,
1434
+ playingAs: this.fVplayingAs,
1435
+ sections: this.fVsections,
1436
+ matchResult: this.fVmatchResult,
1437
+ arrayAgeRange: this.fVarrayAgeRange,
1438
+ typeZone: this.fVtypeZone,
1439
+ setNationalitiesIds: this.fVnationalities,
1440
+ setPositionsIds: this.fVsetPositionsIds,
1441
+ setYear: this.FVYear,
1442
+ booleanAreNationalTeamsVisible: false,
1443
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1444
+ }
1445
+ const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1446
+ personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.NATIONALITY)
1447
+ }
1448
+ if (deleteFilterValID == 'onFiltersPosition') {
1449
+ this.fVsetPositionsIds = [1, 2, 3, 4, 5, 6, 7, 8, 9]
1450
+ this.filters = {
1451
+ zone: this.fVzone,
1452
+ playingAs: this.fVplayingAs,
1453
+ sections: this.fVsections,
1454
+ matchResult: this.fVmatchResult,
1455
+ arrayAgeRange: this.fVarrayAgeRange,
1456
+ typeZone: this.fVtypeZone,
1457
+ setNationalitiesIds: this.fVnationalities,
1458
+ setPositionsIds: this.fVsetPositionsIds,
1459
+ setYear: this.FVYear,
1460
+ booleanAreNationalTeamsVisible: false,
1461
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1462
+ }
1463
+ const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1464
+ personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.POSITION)
1465
+ }
1466
+ if (deleteFilterValID == 'onFiltersAge') {
1467
+ this.fVarrayAgeRange = [10, 40]
1468
+ this.filters = {
1469
+ zone: this.fVzone,
1470
+ playingAs: this.fVplayingAs,
1471
+ sections: this.fVsections,
1472
+ matchResult: this.fVmatchResult,
1473
+ arrayAgeRange: this.fVarrayAgeRange,
1474
+ typeZone: this.fVtypeZone,
1475
+ setNationalitiesIds: this.fVnationalities,
1476
+ setPositionsIds: this.fVsetPositionsIds,
1477
+ setYear: this.FVYear,
1478
+ booleanAreNationalTeamsVisible: false,
1479
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1480
+ }
1481
+ const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1482
+ personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.AGE_RANGE)
1483
+ }
1484
+ if (deleteFilterValID == 'onFiltersElegibility') {
1485
+ const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1486
+ personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.ELIGIBILITY)
1487
+ }
1488
+ if (deleteFilterValID == 'onFiltersYear') {
1489
+ const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1490
+ personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.YEAR)
1491
+ this.FVYear = 1900
1492
+ this.filters = {
1493
+ zone: this.fVzone,
1494
+ playingAs: this.fVplayingAs,
1495
+ sections: this.fVsections,
1496
+ matchResult: this.fVmatchResult,
1497
+ arrayAgeRange: this.fVarrayAgeRange,
1498
+ typeZone: this.fVtypeZone,
1499
+ setNationalitiesIds: this.fVnationalities,
1500
+ setPositionsIds: this.fVsetPositionsIds,
1501
+ setYear: this.FVYear,
1502
+ booleanAreNationalTeamsVisible: false,
1503
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1504
+ }
1505
+ }
1506
+ }
1507
+
1508
+ this.arrayFiltersPlays.splice(indiceFilterOnPlays, 1)
1509
+ },
1510
+ clickAll() {
1511
+ // Método eliminado - relacionado con scouting
1512
+ },
1513
+ clickAllAll() {
1514
+ // Método eliminado - relacionado con scouting
1515
+ },
1516
+ clickTeam() {
1517
+ // Método eliminado - relacionado con scouting
1518
+ },
1519
+ clickTeamScouting() {
1520
+ // Método eliminado - relacionado con scouting
1521
+ },
1522
+ resetFilterTeamAndPlayers() {
1523
+ this.filters = {
1524
+ zone: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
1525
+ playingAs: [1, 2],
1526
+ sections: [1, 2, 3, 4, 5, 6],
1527
+ matchResult: [1, 2, 3],
1528
+ arrayAgeRange: [1, 60],
1529
+ typeZone: 1,
1530
+ setNationalitiesIds: this.setNationalitiesIds, //PROBABELMENTE SE OCUPE LLENAR
1531
+ setPositionsIds: [1, 2, 3, 4, 5, 6, 7, 8, 9], //PROBABELMENTE SE OCUPE LLENAR
1532
+ setYear: this.FVYear,
1533
+ booleanAreNationalTeamsVisible: false,
1534
+ setAvailableNationalTeamsPlayersIds: new Set(),
1535
+ }
1536
+ },
1537
+ async changeTabsGeneral(idchange) {
1538
+ this.resetPredefinedTeamAll()
1539
+ this.showfiltersPc = true
1540
+ this.optionSelected = idchange
1541
+ this.optionSelectedSubmenu = 'Todas las jugadas'
1542
+ this.filtersPredefinedF = {}
1543
+ this.categoryPredefinedActive = false
1544
+ this.categoryPredefined = 0
1545
+ if (idchange == 'Equipos') {
1546
+ this.typeTable = 1
1547
+ this.isTeam = true
1548
+ this.updateTables += 1
1549
+ this.arrayFiltersPlays = []
1550
+ this.teamselect = 0
1551
+ this.resetFilterTeamAndPlayers()
1552
+ }
1553
+ if (idchange == 'Jugadores') {
1554
+ this.typeTable = 0
1555
+ this.isTeam = false
1556
+ this.teamselect = 0
1557
+ this.updateTables += 1
1558
+ this.resetFilterTeamAndPlayers()
1559
+ }
1560
+ },
1561
+ resetPredefinedTeamAll() {
1562
+ var indiceFilterOnPredefinedCategory = this.arrayFiltersPlays.findIndex(
1563
+ (objeto) => objeto.type === 'onFiltersPredefined',
1564
+ )
1565
+
1566
+ if (this.categoriesDefault.length > 0 && indiceFilterOnPredefinedCategory !== -1) {
1567
+ this.categoryPredefinedActive = false
1568
+ this.categoryPredefined = 0
1569
+ this.FVfilterGolstats = []
1570
+ this.filtersPredefinedF = {}
1571
+
1572
+ this.arrayFiltersPlays.splice(indiceFilterOnPredefinedCategory, 1)
1573
+ for (let indexD = 0; indexD < this.categoriesDefault.length; indexD++) {
1574
+ this.categoriesDefault[indexD].isSelected = false
1575
+ }
1576
+ this.updateFilterPlaytypesGolstats += 1
1577
+ //filtro golstats
1578
+ var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1579
+ (objeto) => objeto.type === 'onFiltersPredefined',
1580
+ )
1581
+
1582
+ if (indiceFilterOnPlaysAuxC !== -1) {
1583
+ for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1584
+ this.FVfilterGolstats[index].isSelected = false
1585
+ }
1586
+ if (indiceFilterOnPlaysAuxC !== -1) {
1587
+ this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1588
+ }
1589
+ this.updateFilterGolstats += 1
1590
+ }
1591
+ }
1592
+ },
1593
+ changeTabsSubmenu(idchange) {
1594
+ if (idchange != 'Predeterminados') {
1595
+ this.resetPredefinedTeamAll()
1596
+ } else {
1597
+ this.arrayFiltersPlays = []
1598
+ }
1599
+
1600
+ this.optionSelectedSubmenu = idchange
1601
+ },
1602
+
1603
+ async fetchTournaments() {
1604
+ const axiosInstance = axios.create({
1605
+ headers: {
1606
+ Authorization: `${this.token}`,
1607
+ },
1608
+ })
1609
+ const { data } = await axiosInstance.get(this.tournamentsUrl)
1610
+ return data
1611
+ },
1612
+ async fetchTeams() {
1613
+ const axiosInstance = axios.create({
1614
+ headers: {
1615
+ Authorization: `${this.token}`,
1616
+ },
1617
+ })
1618
+ const { data } = await axiosInstance.get(this.teamsUrl + this.seasonActive)
1619
+ return data
1620
+ },
1621
+ async fetchTeamsScouting(season) {
1622
+ const axiosInstance = axios.create({
1623
+ headers: {
1624
+ Authorization: `${this.token}`,
1625
+ },
1626
+ })
1627
+ const { data } = await axiosInstance.get(this.teamsUrl + season)
1628
+ return data
1629
+ },
1630
+ async getPredefinedfilters(category) {
1631
+ this.arrayPredefinedFilters = []
1632
+ this.arrayPredefinedOrigin = []
1633
+ var url = ''
1634
+ if (category.id == 1) {
1635
+ url = this.urlFilter
1636
+ } else {
1637
+ url = this.urlFilter
1638
+ }
1639
+
1640
+ const axiosInstance = axios.create({
1641
+ headers: {
1642
+ Authorization: `${this.token}`,
1643
+ },
1644
+ })
1645
+ const { data } = await axiosInstance.get(url + category.id)
1646
+ Object.keys(data[0].match_lapse_combinations).forEach((key) => {
1647
+ this.predefinedFiltersMatchLapse[key.toString()] = data[0].match_lapse_combinations[key]
1648
+ })
1649
+ Object.keys(data[0].playing_as_combinations).forEach((key) => {
1650
+ this.predefinedFiltersPlayingAs[key.toString()] = data[0].playing_as_combinations[key]
1651
+ })
1652
+ Object.keys(data[0].field_sections_combinations).forEach((key) => {
1653
+ this.predefinedFiltersSections[key.toString()] = data[0].field_sections_combinations[key]
1654
+ })
1655
+ if (data[0]) {
1656
+ for (let indexRecord = 0; indexRecord < data[0].filter_records.length; indexRecord++) {
1657
+ var filterText = data[0].description
1658
+
1659
+ if (data[0].filter_records[indexRecord].field_sections !== undefined) {
1660
+ const filterFieldSearch = data[0].filter_records[indexRecord].field_sections.toString()
1661
+ if (
1662
+ this.predefinedFiltersSections[filterFieldSearch] ||
1663
+ this.predefinedFiltersSections[filterFieldSearch] == ''
1664
+ ) {
1665
+ if (this.predefinedFiltersSections[filterFieldSearch] == '') {
1666
+ filterText = filterText.replace(
1667
+ ' [en {field_sections}]',
1668
+ this.predefinedFiltersSections[filterFieldSearch],
1669
+ )
1670
+ } else {
1671
+ filterText = filterText.replace(
1672
+ '{field_sections}',
1673
+ this.predefinedFiltersSections[filterFieldSearch],
1674
+ )
1675
+ }
1676
+ }
1677
+ }
1678
+ if (data[0].filter_records[indexRecord].match_lapse !== undefined) {
1679
+ const filterMatchSearch = data[0].filter_records[indexRecord].match_lapse.toString()
1680
+ if (
1681
+ this.predefinedFiltersMatchLapse[filterMatchSearch] ||
1682
+ this.predefinedFiltersMatchLapse[filterMatchSearch] == ''
1683
+ ) {
1684
+ if (this.predefinedFiltersMatchLapse[filterMatchSearch] == '') {
1685
+ filterText = filterText.replace(
1686
+ ' [durante {match_lapse}]',
1687
+ this.predefinedFiltersMatchLapse[filterMatchSearch],
1688
+ )
1689
+ } else {
1690
+ filterText = filterText.replace(
1691
+ '{match_lapse}',
1692
+ this.predefinedFiltersMatchLapse[filterMatchSearch],
1693
+ )
1694
+ }
1695
+ }
1696
+ }
1697
+ if (data[0].filter_records[indexRecord].playing_as !== undefined) {
1698
+ const filterPlayingAsSearch = data[0].filter_records[indexRecord].playing_as.toString()
1699
+ if (
1700
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch] ||
1701
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch] == ''
1702
+ ) {
1703
+ if (this.predefinedFiltersPlayingAs[filterPlayingAsSearch] == '') {
1704
+ filterText = filterText.replace(
1705
+ ' [jugando como {playing_as}]',
1706
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch],
1707
+ )
1708
+ } else {
1709
+ filterText = filterText.replace(
1710
+ '{playing_as}',
1711
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch],
1712
+ )
1713
+ }
1714
+ }
1715
+ }
1716
+ if (data[0].filter_records[indexRecord].section_type !== undefined) {
1717
+ if (this.optionSelected == 'Jugadores') {
1718
+ filterText = filterText.replace('{section_type}', 'Jugadores')
1719
+ } else {
1720
+ filterText = filterText.replace('{section_type}', 'Equipos')
1721
+ }
1722
+ }
1723
+
1724
+ filterText = filterText.replace(/\[/g, '')
1725
+ filterText = filterText.replace(/\]/g, '')
1726
+ filterText = filterText.replace('{category_name}', data[0].category_name)
1727
+ const filterNameItem = filterText.split(': ')
1728
+ var textFinal = filterNameItem[1]
1729
+ if (textFinal.length > 129 && this.windowWidth > 1358) {
1730
+ textFinal = textFinal.substring(0, 129)
1731
+ textFinal =
1732
+ textFinal +
1733
+ "<span id='showIDtootip' class='dots' style='width: 100px; height: 20px; background: red; z-index: 6;'" +
1734
+ '>...</span>'
1735
+ }
1736
+
1737
+ if (!this.isCup || data[0].filter_records[indexRecord].playing_as.length === 2) {
1738
+ this.arrayPredefinedFilters.push({
1739
+ id: indexRecord,
1740
+ category_name: category.name,
1741
+ id_category: data[0].id,
1742
+ title: filterNameItem[0] + ':',
1743
+ text: filterNameItem[1],
1744
+ textOrigin: data[0].description,
1745
+ titledots: textFinal,
1746
+ filtersPredefined: {
1747
+ matchResult: data[0].filter_records[indexRecord].match_result,
1748
+ playingAs: data[0].filter_records[indexRecord].playing_as,
1749
+ sections: data[0].filter_records[indexRecord].match_lapse,
1750
+ type: this.optionSelected == 'Equipos' ? 2 : 1,
1751
+ typeZone: data[0].type_zone,
1752
+ zone: data[0].filter_records[indexRecord].field_sections,
1753
+ end_age: 0,
1754
+ start_age: 0,
1755
+ nationalities: [],
1756
+ elegible: [],
1757
+ positions: [],
1758
+ },
1759
+ })
1760
+ }
1761
+ }
1762
+
1763
+ var arrayFVfilterGolstats = []
1764
+ for (let index = 0; index < this.arrayPredefinedFilters.length; index++) {
1765
+ var numfilterApply = 0
1766
+ var nations = new Set()
1767
+ var objectFilterApply = {}
1768
+
1769
+ var TextFinalSub = this.arrayPredefinedFilters[index].text.replace(/\*.*?\*/, '')
1770
+ TextFinalSub = TextFinalSub.replace(/\*/g, '')
1771
+ TextFinalSub = TextFinalSub.replace(/ +/g, ' ')
1772
+ if (this.arrayPredefinedFilters[index].filtersPredefined.elegible.length > 0) {
1773
+ numfilterApply += 1
1774
+ }
1775
+ if (
1776
+ this.arrayPredefinedFilters[index].filtersPredefined.end_age.length != 0 ||
1777
+ this.arrayPredefinedFilters[index].filtersPredefined.start_age.length != 0
1778
+ ) {
1779
+ numfilterApply += 1
1780
+ }
1781
+ if (
1782
+ this.arrayPredefinedFilters[index].filtersPredefined.end_age != 0 &&
1783
+ this.arrayPredefinedFilters[index].filtersPredefined.start_age != 0
1784
+ ) {
1785
+ objectFilterApply.arrayAgeRange = [
1786
+ this.arrayPredefinedFilters[index].filtersPredefined.start_age,
1787
+ this.arrayPredefinedFilters[index].filtersPredefined.end_age,
1788
+ ]
1789
+ } else {
1790
+ if (
1791
+ this.arrayPredefinedFilters[index].filtersPredefined.end_age == 0 &&
1792
+ this.arrayPredefinedFilters[index].filtersPredefined.start_age == 0
1793
+ ) {
1794
+ objectFilterApply.arrayAgeRange = [1, 60]
1795
+ } else {
1796
+ if (
1797
+ this.arrayPredefinedFilters[index].filtersPredefined.start_age != 0 &&
1798
+ this.arrayPredefinedFilters[index].filtersPredefined.end_age == 0
1799
+ ) {
1800
+ objectFilterApply.arrayAgeRange = [
1801
+ this.arrayPredefinedFilters[index].filtersPredefined.start_age,
1802
+ 60,
1803
+ ]
1804
+ } else {
1805
+ objectFilterApply.arrayAgeRange = [
1806
+ 1,
1807
+ this.arrayPredefinedFilters[index].filtersPredefined.end_age,
1808
+ ]
1809
+ }
1810
+ }
1811
+ }
1812
+ if (this.arrayPredefinedFilters[index].filtersPredefined.matchResult.length != 3) {
1813
+ numfilterApply += 1
1814
+ }
1815
+ objectFilterApply.matchResult =
1816
+ this.arrayPredefinedFilters[index].filtersPredefined.matchResult
1817
+ if (this.arrayPredefinedFilters[index].filtersPredefined.nationalities.length > 0) {
1818
+ numfilterApply += 1
1819
+ }
1820
+ if (this.arrayPredefinedFilters[index].filtersPredefined.nationalities.length != 0) {
1821
+ for (
1822
+ let indexNA = 0;
1823
+ indexNA < this.arrayPredefinedFilters[index].filtersPredefined.nationalities.length;
1824
+ indexNA++
1825
+ ) {
1826
+ nations.add(
1827
+ this.arrayPredefinedFilters[index].filtersPredefined.nationalities[indexNA],
1828
+ )
1829
+ }
1830
+ objectFilterApply.setNationalitiesIds = nations
1831
+ } else {
1832
+ nations.add(138)
1833
+ nations.add(222)
1834
+ nations.add(163)
1835
+ nations.add(51)
1836
+ nations.add(226)
1837
+ nations.add(10)
1838
+ nations.add(223)
1839
+ nations.add(96)
1840
+ nations.add(171)
1841
+ nations.add(198)
1842
+ nations.add(105)
1843
+ nations.add(80)
1844
+ nations.add(29)
1845
+ nations.add(74)
1846
+ nations.add(216)
1847
+ nations.add(196)
1848
+ nations.add(64)
1849
+ nations.add(155)
1850
+ nations.add(156)
1851
+ nations.add(89)
1852
+ nations.add(106)
1853
+ nations.add(81)
1854
+ nations.add(233)
1855
+ nations.add(204)
1856
+ objectFilterApply.setNationalitiesIds = nations
1857
+ }
1858
+ if (this.arrayPredefinedFilters[index].filtersPredefined.playingAs.length != 2) {
1859
+ numfilterApply += 1
1860
+ }
1861
+ objectFilterApply.playingAs =
1862
+ this.arrayPredefinedFilters[index].filtersPredefined.playingAs
1863
+ if (this.arrayPredefinedFilters[index].filtersPredefined.positions.length > 0) {
1864
+ numfilterApply += 1
1865
+ }
1866
+ if (this.arrayPredefinedFilters[index].filtersPredefined.positions.length > 0) {
1867
+ objectFilterApply.setPositionsIds =
1868
+ this.arrayPredefinedFilters[index].filtersPredefined.positions
1869
+ } else {
1870
+ objectFilterApply.setPositionsIds = [1, 2, 3, 4, 5, 6, 7, 8, 9]
1871
+ }
1872
+ if (this.arrayPredefinedFilters[index].filtersPredefined.sections.length != 6) {
1873
+ numfilterApply += 1
1874
+ }
1875
+ if (this.arrayPredefinedFilters[index].filtersPredefined.sections.length > 0) {
1876
+ objectFilterApply.sections =
1877
+ this.arrayPredefinedFilters[index].filtersPredefined.sections
1878
+ } else {
1879
+ objectFilterApply.sections = [1, 2, 3, 4, 5, 6]
1880
+ }
1881
+ if (this.arrayPredefinedFilters[index].filtersPredefined.zone.length != 16) {
1882
+ numfilterApply += 1
1883
+ }
1884
+ if (this.arrayPredefinedFilters[index].filtersPredefined.zone.length > 0) {
1885
+ objectFilterApply.zone = this.arrayPredefinedFilters[index].filtersPredefined.zone
1886
+ } else {
1887
+ objectFilterApply.zone = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
1888
+ }
1889
+ objectFilterApply.typeZone = this.arrayPredefinedFilters[index].filtersPredefined.typeZone
1890
+ arrayFVfilterGolstats.push({
1891
+ id: index + 1,
1892
+ name: TextFinalSub,
1893
+ isSelected: false,
1894
+ value: numfilterApply,
1895
+ filters: objectFilterApply,
1896
+ })
1897
+ }
1898
+ this.FVfilterGolstats = arrayFVfilterGolstats
1899
+ this.updateFilterGolstats += 1
1900
+ this.arrayPredefinedOrigin = JSON.parse(JSON.stringify(this.arrayPredefinedFilters))
1901
+ }
1902
+ },
1903
+ getTextFilterPredefinedCustom() {
1904
+ this.setDinamicFilters(this.filterEmitAux)
1905
+
1906
+ var filterTextCustom =
1907
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].textOrigin
1908
+
1909
+ const filterFieldSearch = this.arrayPredefinedFilters[
1910
+ this.indexPredefinedFiltersSelected
1911
+ ].filtersPredefined.zone
1912
+ .sort((a, b) => a - b)
1913
+ .toString()
1914
+
1915
+ if (
1916
+ this.predefinedFiltersSections[filterFieldSearch] ||
1917
+ this.predefinedFiltersSections[filterFieldSearch] == ''
1918
+ ) {
1919
+ if (this.predefinedFiltersSections[filterFieldSearch] == '') {
1920
+ filterTextCustom = filterTextCustom.replace(
1921
+ ' [en {field_sections}]',
1922
+ this.predefinedFiltersSections[filterFieldSearch],
1923
+ )
1924
+ } else {
1925
+ filterTextCustom = filterTextCustom.replace(
1926
+ '{field_sections}',
1927
+ this.predefinedFiltersSections[filterFieldSearch],
1928
+ )
1929
+ }
1930
+ } else {
1931
+ filterTextCustom = filterTextCustom.replace(
1932
+ '{field_sections}',
1933
+ this.predefinedFiltersSections['other'],
1934
+ )
1935
+ }
1936
+ var flagPosi = false
1937
+ if (
1938
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1939
+ .nationalities.size > 0
1940
+ ) {
1941
+ if (
1942
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1943
+ .nationalities.size == this.setNationalityIds.size
1944
+ ) {
1945
+ filterTextCustom = filterTextCustom.replace('[{nationality}]', '')
1946
+ filterTextCustom = filterTextCustom.replace(
1947
+ '[de las nacionalidades y posiciones seleccionadas]',
1948
+ '',
1949
+ )
1950
+ filterTextCustom = filterTextCustom.replace('[de las nacionalidades seleccionadas]', '')
1951
+ } else {
1952
+ if (
1953
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1954
+ .nationalities.size == 1
1955
+ ) {
1956
+ filterTextCustom = filterTextCustom.replace(
1957
+ '[{nationality}]',
1958
+ this.$t(
1959
+ `gentilicios[${
1960
+ [
1961
+ ...this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected]
1962
+ .filtersPredefined.nationalities,
1963
+ ][0]
1964
+ }]`,
1965
+ ),
1966
+ )
1967
+ filterTextCustom = filterTextCustom.replace(
1968
+ '[de las nacionalidades y posiciones seleccionadas]',
1969
+ '',
1970
+ )
1971
+ filterTextCustom = filterTextCustom.replace('[de las nacionalidades seleccionadas]', '')
1972
+ } else {
1973
+ if (
1974
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1975
+ .positions.size > 0 &&
1976
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1977
+ .positions.size != this.setPositionsIds.size
1978
+ ) {
1979
+ flagPosi = true
1980
+ filterTextCustom = filterTextCustom.replace('[{nationality}]', '')
1981
+ filterTextCustom = filterTextCustom.replace(
1982
+ '[de las nacionalidades seleccionadas]',
1983
+ '',
1984
+ )
1985
+ } else {
1986
+ filterTextCustom = filterTextCustom.replace('[{nationality}]', '')
1987
+ filterTextCustom = filterTextCustom.replace(
1988
+ '[de las nacionalidades y posiciones seleccionadas]',
1989
+ '',
1990
+ )
1991
+ }
1992
+ }
1993
+ }
1994
+ } else {
1995
+ filterTextCustom = filterTextCustom.replace('[{nationality}]', '')
1996
+ filterTextCustom = filterTextCustom.replace(
1997
+ '[de las nacionalidades y posiciones seleccionadas]',
1998
+ '',
1999
+ )
2000
+ filterTextCustom = filterTextCustom.replace('[de las nacionalidades seleccionadas]', '')
2001
+ }
2002
+ if (
2003
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2004
+ .nationalities.size > 0
2005
+ ) {
2006
+ if (flagPosi) {
2007
+ filterTextCustom = filterTextCustom.replace('[de las posiciones seleccionadas]', '')
2008
+ } else {
2009
+ if (
2010
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2011
+ .positions.size == this.setPositionsIds.size
2012
+ ) {
2013
+ filterTextCustom = filterTextCustom.replace('[de las posiciones seleccionadas]', '')
2014
+ }
2015
+ }
2016
+ } else {
2017
+ filterTextCustom = filterTextCustom.replace('[de las posiciones seleccionadas]', '')
2018
+ }
2019
+ if (
2020
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2021
+ .start_age != 0 &&
2022
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2023
+ .end_age != 0
2024
+ ) {
2025
+ if (
2026
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2027
+ .start_age != this.arrayAgeRange[0] &&
2028
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2029
+ .end_age != this.arrayAgeRange[1]
2030
+ ) {
2031
+ if (
2032
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2033
+ .start_age ==
2034
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2035
+ .end_age
2036
+ ) {
2037
+ filterTextCustom = filterTextCustom.replace('[de {min_age} a {max_age} años]', '')
2038
+ filterTextCustom = filterTextCustom.replace(
2039
+ '[de {min_age} años]',
2040
+ '[de ' +
2041
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2042
+ .start_age +
2043
+ ' años]',
2044
+ )
2045
+ } else {
2046
+ filterTextCustom = filterTextCustom.replace('[de {min_age} años]', '')
2047
+ filterTextCustom = filterTextCustom.replace(
2048
+ '[de {min_age} a {max_age} años]',
2049
+ '[de ' +
2050
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2051
+ .start_age +
2052
+ ' a ' +
2053
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2054
+ .end_age +
2055
+ ' años]',
2056
+ )
2057
+ }
2058
+ } else {
2059
+ if (
2060
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2061
+ .start_age != this.arrayAgeRange[0] ||
2062
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2063
+ .end_age != this.arrayAgeRange[1]
2064
+ ) {
2065
+ if (
2066
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2067
+ .start_age ==
2068
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2069
+ .end_age
2070
+ ) {
2071
+ filterTextCustom = filterTextCustom.replace('[de {min_age} a {max_age} años]', '')
2072
+ filterTextCustom = filterTextCustom.replace(
2073
+ '[de {min_age} años]',
2074
+ '[de ' +
2075
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2076
+ .start_age +
2077
+ ' años]',
2078
+ )
2079
+ } else {
2080
+ filterTextCustom = filterTextCustom.replace('[de {min_age} años]', '')
2081
+ filterTextCustom = filterTextCustom.replace(
2082
+ '[de {min_age} a {max_age} años]',
2083
+ '[de ' +
2084
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2085
+ .start_age +
2086
+ ' a ' +
2087
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2088
+ .end_age +
2089
+ ' años]',
2090
+ )
2091
+ }
2092
+ } else {
2093
+ filterTextCustom = filterTextCustom.replace('[de {min_age} a {max_age} años]', '')
2094
+ filterTextCustom = filterTextCustom.replace('[de {min_age} años]', '')
2095
+ }
2096
+ }
2097
+ } else {
2098
+ filterTextCustom = filterTextCustom.replace('[de {min_age} años]', '')
2099
+ filterTextCustom = filterTextCustom.replace('[de {min_age} a {max_age} años]', '')
2100
+ }
2101
+ const filterMatchSearch = this.arrayPredefinedFilters[
2102
+ this.indexPredefinedFiltersSelected
2103
+ ].filtersPredefined.sections
2104
+ .sort()
2105
+ .toString()
2106
+ if (
2107
+ this.predefinedFiltersMatchLapse[filterMatchSearch] ||
2108
+ this.predefinedFiltersMatchLapse[filterMatchSearch] == ''
2109
+ ) {
2110
+ if (this.predefinedFiltersMatchLapse[filterMatchSearch] == '') {
2111
+ filterTextCustom = filterTextCustom.replace(
2112
+ ' [durante {match_lapse}]',
2113
+ this.predefinedFiltersMatchLapse[filterMatchSearch],
2114
+ )
2115
+ } else {
2116
+ filterTextCustom = filterTextCustom.replace(
2117
+ '{match_lapse}',
2118
+ this.predefinedFiltersMatchLapse[filterMatchSearch],
2119
+ )
2120
+ }
2121
+ } else {
2122
+ filterTextCustom = filterTextCustom.replace(
2123
+ '{match_lapse}',
2124
+ ' ' + this.predefinedFiltersMatchLapse['other'],
2125
+ )
2126
+ var textfilterMatchAlternative = ''
2127
+ if (filterMatchSearch.includes(1)) {
2128
+ textfilterMatchAlternative = textfilterMatchAlternative + '0-15, '
2129
+ }
2130
+ if (filterMatchSearch.includes(2)) {
2131
+ textfilterMatchAlternative = textfilterMatchAlternative + '16-30, '
2132
+ }
2133
+ if (filterMatchSearch.includes(3)) {
2134
+ textfilterMatchAlternative = textfilterMatchAlternative + '31-45, '
2135
+ }
2136
+ if (filterMatchSearch.includes(4)) {
2137
+ textfilterMatchAlternative = textfilterMatchAlternative + '46-60, '
2138
+ }
2139
+ if (filterMatchSearch.includes(5)) {
2140
+ textfilterMatchAlternative = textfilterMatchAlternative + '61-75, '
2141
+ }
2142
+ if (filterMatchSearch.includes(6)) {
2143
+ textfilterMatchAlternative = textfilterMatchAlternative + '76-90, '
2144
+ }
2145
+ textfilterMatchAlternative = textfilterMatchAlternative.slice(0, -2)
2146
+ textfilterMatchAlternative = textfilterMatchAlternative.replace(/,([^,]*)$/, ' y ' + '$1')
2147
+ filterTextCustom = filterTextCustom.replace(
2148
+ '{match_lapse_selected}',
2149
+ textfilterMatchAlternative,
2150
+ )
2151
+ }
2152
+ const filterPlayingAsSearch = this.arrayPredefinedFilters[
2153
+ this.indexPredefinedFiltersSelected
2154
+ ].filtersPredefined.playingAs
2155
+ .sort()
2156
+ .toString()
2157
+ if (
2158
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch] ||
2159
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch] == ''
2160
+ ) {
2161
+ if (this.predefinedFiltersPlayingAs[filterPlayingAsSearch] == '') {
2162
+ filterTextCustom = filterTextCustom.replace(
2163
+ ' [jugando como {playing_as}]',
2164
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch],
2165
+ )
2166
+ } else {
2167
+ filterTextCustom = filterTextCustom.replace(
2168
+ '{playing_as}',
2169
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch],
2170
+ )
2171
+ }
2172
+ }
2173
+ if (this.typeSelected == 1) {
2174
+ if (this.getUser.tournament == 1001) {
2175
+ if (this.category.id == 22) {
2176
+ filterTextCustom = filterTextCustom.replace('{section_type}', 'Porteras')
2177
+ } else {
2178
+ filterTextCustom = filterTextCustom.replace('{section_type}', 'Jugadoras')
2179
+ }
2180
+ } else {
2181
+ if (this.category.id == 22) {
2182
+ filterTextCustom = filterTextCustom.replace('{section_type}', 'Porteros')
2183
+ } else {
2184
+ filterTextCustom = filterTextCustom.replace('{section_type}', 'Jugadores')
2185
+ }
2186
+ }
2187
+ } else {
2188
+ filterTextCustom = filterTextCustom.replace('{section_type}', 'Equipos')
2189
+ }
2190
+ filterTextCustom = filterTextCustom.replace(/\[/g, '')
2191
+ filterTextCustom = filterTextCustom.replace(/\]/g, '')
2192
+ filterTextCustom = filterTextCustom.replace(
2193
+ '{category_name}',
2194
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].category_name,
2195
+ )
2196
+ const filterNameItem = filterTextCustom.split(': ')
2197
+ let textFinal =
2198
+ filterNameItem[1].charAt(0).toUpperCase() + filterNameItem[1].toLowerCase().slice(1)
2199
+ let textForDots =
2200
+ filterNameItem[1].charAt(0).toUpperCase() + filterNameItem[1].toLowerCase().slice(1)
2201
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].text = textFinal
2202
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].title =
2203
+ filterNameItem[0] + ':'
2204
+
2205
+ const matches = textForDots.match(/\*/g)
2206
+ if (matches && matches.length) {
2207
+ if (matches.length % 2 === 0) {
2208
+ for (let i = 1; i <= matches.length; i++) {
2209
+ if (i % 2 === 0) {
2210
+ // textForDots = textForDots.replace('*', '</span>');
2211
+ } else {
2212
+ textForDots = textForDots.replace('*', '<span style="color: #ffff03" >')
2213
+ }
2214
+ }
2215
+ } else {
2216
+ textForDots = textForDots.replaceAll('*', '')
2217
+ }
2218
+ }
2219
+
2220
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].titledots = textForDots
2221
+ },
2222
+ intervalidtops(id) {
2223
+ this.$emit('intervalidtops', id)
2224
+ },
2225
+ },
2226
+ mounted() {
2227
+ if (sessionStorage.getItem('sidpdfil') !== null) {
2228
+ sessionStorage.setItem('sidpdfil', 0)
2229
+ }
2230
+ this.renderNext()
2231
+
2232
+ if (this.teamId !== 0) {
2233
+ this.clickTeam(this.teamId)
2234
+ }
2235
+
2236
+ if (this.defaultSection !== 'Jugadores') {
2237
+ this.changeTabsGeneral(this.defaultSection)
2238
+ }
2239
+ },
2240
+ async created() {
2241
+ try {
2242
+ const axiosInstance4 = axios.create({
2243
+ headers: { 'Content-Type': 'application/json' },
2244
+ })
2245
+ axiosInstance4.interceptors.request.use((config) => {
2246
+ delete config.headers.Authorization
2247
+ return config
2248
+ })
2249
+ const data = await axiosInstance4.get(
2250
+ 'https://golstats-microservices.s3.us-west-2.amazonaws.com/eligibles/elegibles.json',
2251
+ { headers: { 'Content-Type': 'application/json' } },
2252
+ )
2253
+
2254
+ this.fVnationalities.add(138)
2255
+ this.fVnationalities.add(222)
2256
+ this.fVnationalities.add(163)
2257
+ this.fVnationalities.add(51)
2258
+ this.fVnationalities.add(226)
2259
+ this.fVnationalities.add(10)
2260
+ this.fVnationalities.add(223)
2261
+ this.fVnationalities.add(96)
2262
+ this.fVnationalities.add(171)
2263
+ this.fVnationalities.add(198)
2264
+ this.fVnationalities.add(105)
2265
+ this.fVnationalities.add(80)
2266
+ this.fVnationalities.add(29)
2267
+ this.fVnationalities.add(74)
2268
+ this.fVnationalities.add(216)
2269
+ this.fVnationalities.add(196)
2270
+ this.fVnationalities.add(64)
2271
+ this.fVnationalities.add(155)
2272
+ this.fVnationalities.add(156)
2273
+ this.fVnationalities.add(89)
2274
+ this.fVnationalities.add(106)
2275
+ this.fVnationalities.add(81)
2276
+ this.fVnationalities.add(233)
2277
+ this.fVnationalities.add(204)
2278
+ } catch (e) {
2279
+ throw new Error(e)
2280
+ }
2281
+ },
2282
+ }
2283
+ </script>
2284
+ <style lang="scss">
2285
+ .cont-leyemd-multipleleagues {
2286
+ width: 100%;
2287
+ height: 20px;
2288
+ display: inline-flex;
2289
+ align-content: center;
2290
+ justify-content: center;
2291
+ align-items: center;
2292
+ }
2293
+ .img-leyemd-multipleleagues {
2294
+ margin-right: 20px;
2295
+ }
2296
+
2297
+ .HiddenFilters {
2298
+ display: none;
2299
+ }
2300
+ .overlay-loading {
2301
+ position: fixed; /* Sit on top of the page content */
2302
+ display: flex; /* Hidden by default */
2303
+ flex-direction: column;
2304
+ justify-content: center;
2305
+ align-items: center;
2306
+ width: 100%; /* Full width (cover the whole page) */
2307
+ height: 100%; /* Full height (cover the whole page) */
2308
+ top: 0;
2309
+ left: 0;
2310
+ right: 0;
2311
+ bottom: 0;
2312
+ background-color: rgba(0, 0, 0, 0.5); /* Black background with opacity */
2313
+ z-index: 100; /* Specify a stack order in case you're using a different order for other elements */
2314
+
2315
+ &__spinner {
2316
+ height: 70px;
2317
+ -webkit-animation: spin 2s linear infinite; /* Safari */
2318
+ animation: spin 2s linear infinite;
2319
+
2320
+ & > img {
2321
+ height: 70px;
2322
+ object-fit: contain;
2323
+ }
2324
+ }
2325
+
2326
+ &__text {
2327
+ font-size: 1.4rem;
2328
+ margin-top: 0.8em;
2329
+ color: white;
2330
+ font-family: 'Poppins-Regular';
2331
+ }
2332
+ }
2333
+
2334
+ /* Safari */
2335
+ @-webkit-keyframes spin {
2336
+ 0% {
2337
+ -webkit-transform: rotate(0deg);
2338
+ }
2339
+ 100% {
2340
+ -webkit-transform: rotate(360deg);
2341
+ }
2342
+ }
2343
+
2344
+ @keyframes spin {
2345
+ 0% {
2346
+ transform: rotate(0deg);
2347
+ }
2348
+ 100% {
2349
+ transform: rotate(360deg);
2350
+ }
2351
+ }
2352
+ </style>
2353
+ <style module lang="scss">
2354
+ @import '/css/fonts.css';
2355
+ @import '/styles.css';
2356
+ .containerScountingBtncom {
2357
+ width: 100%;
2358
+ height: 35px;
2359
+ margin-top: 15px;
2360
+ display: inline-flex;
2361
+ justify-content: center;
2362
+ align-items: center;
2363
+ align-content: center;
2364
+ }
2365
+ .btnDeleteAplicacom {
2366
+ width: 190px;
2367
+ height: 32px;
2368
+ background-color: rgba(255, 255, 255, 0.1);
2369
+ border-radius: 20px;
2370
+ text-align: center;
2371
+ font-size: 12px;
2372
+ font-family: 'Poppins-Regular';
2373
+ display: inline-flex;
2374
+ justify-content: center;
2375
+ align-items: center;
2376
+ align-content: center;
2377
+ }
2378
+ .btnDeleteAplicacom:hover {
2379
+ background-color: rgba(255, 255, 255, 0.8);
2380
+ color: #313131;
2381
+ cursor: pointer;
2382
+ }
2383
+ .SearchBtnBarcom {
2384
+ width: 85px;
2385
+ height: 32px;
2386
+ margin-left: 10px;
2387
+ font-family: 'Poppins-Medium';
2388
+ background-color: rgb(203, 238, 107);
2389
+ color: #313131;
2390
+ text-align: center;
2391
+ font-size: 12px;
2392
+ line-height: 32px;
2393
+ border-radius: 35px;
2394
+ }
2395
+ .SearchBtnBarcom:hover {
2396
+ background-color: rgb(155, 198, 36);
2397
+ color: #313131;
2398
+ cursor: pointer;
2399
+ }
2400
+ .btnLeyendTxtcom {
2401
+ font-family: 'Poppins-Regular';
2402
+ font-size: 15px;
2403
+ color: #e4e5e6;
2404
+ margin-left: 5px;
2405
+ text-align: center;
2406
+ margin-top: 50px;
2407
+ }
2408
+ .BtnSearchScountingcom {
2409
+ width: 65px;
2410
+ height: 40px;
2411
+ margin-left: 10px;
2412
+ font-family: 'Poppins-Medium';
2413
+ background-color: rgb(203, 238, 107);
2414
+ color: #313131;
2415
+ text-align: center;
2416
+ line-height: 40px;
2417
+ border-radius: 5px;
2418
+ @media only screen and (max-width: 760px) {
2419
+ width: auto;
2420
+ margin-left: 0;
2421
+ }
2422
+ }
2423
+ .BtnSearchScountingcom:hover {
2424
+ background-color: rgb(155, 198, 36);
2425
+ color: #313131;
2426
+ cursor: pointer;
2427
+ }
2428
+ .containerPredefinedcom {
2429
+ width: 94%;
2430
+ height: 830px;
2431
+ border: 1px solid #717c86;
2432
+ border-radius: 8px;
2433
+ }
2434
+ .containerPredefinedScountingcom {
2435
+ width: 100% !important;
2436
+ height: 300px;
2437
+ margin-top: 20px;
2438
+ display: inline-block;
2439
+ border-radius: 8px;
2440
+ }
2441
+ .titleContainerPredefinedcom {
2442
+ font-family: 'Poppins-Medium';
2443
+ margin: 0 auto;
2444
+ text-align: center;
2445
+ width: 100%;
2446
+ font-size: 14px;
2447
+ color: #ffffff;
2448
+ margin-top: 340px;
2449
+ margin-bottom: 7px;
2450
+ }
2451
+ .subtitleContainerPredefinedcom {
2452
+ font-family: 'Poppins-Regular';
2453
+ margin: 0 auto;
2454
+ text-align: center;
2455
+ width: 100%;
2456
+ font-size: 13px;
2457
+ color: rgba(255, 255, 255, 0.7);
2458
+
2459
+ & > span {
2460
+ font-family: 'Poppins-SemiBold';
2461
+ }
2462
+ }
2463
+ </style>