@golstats/gsc-reports 1.0.78 → 1.0.80

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 (30) hide show
  1. package/README.md +2 -2
  2. package/dist/{FilterConditions-55d68355-DMqzcKBO-D2kXmeoL-DEviWylE.js → FilterConditions-55d68355-DMqzcKBO-BAniiYAp-BupK7hCt.js} +1 -1
  3. package/dist/{FilterField-59a73e38-CNaE03Ge-B0XkVQzG-V94Z81Vi.js → FilterField-59a73e38-CNaE03Ge-C_jOHZXY-lDCHt_1F.js} +1 -1
  4. package/dist/{FilterSubcategories-a9b32cc9-_h5FCZ4r-Df-aYrQw-VYuSaZOV.js → FilterSubcategories-a9b32cc9-_h5FCZ4r-B83ffZQ0-BBw7f2jE.js} +1 -1
  5. package/dist/css/fonts.css +83 -83
  6. package/dist/gsc-reports.css +1 -1
  7. package/dist/gsc-reports.es.js +1 -1
  8. package/dist/gsc-reports.umd.js +66 -65
  9. package/dist/{index-Ddsk52G7.js → index-D3dTwIm2.js} +10982 -10903
  10. package/package.json +2 -2
  11. package/src/App.vue +4 -4
  12. package/src/components/elementsTemplates/FortalezasView.vue +15 -4
  13. package/src/components/elementsTemplates/ModalConfigurarContenido.vue +1332 -1250
  14. package/src/components/elementsTemplates/ModalDeleteTemplate.vue +249 -249
  15. package/src/components/elementsTemplates/ModalSoloEscritorio.vue +83 -83
  16. package/src/components/elementsTemplates/ModalduplicateTemplate.vue +300 -300
  17. package/src/components/elementsTemplates/TooltipReportOptions.vue +97 -97
  18. package/src/components/elementsTemplates/TooltipTemplateOptions.vue +168 -168
  19. package/src/components/filters.vue +935 -935
  20. package/src/components/template-report-maker/CoverSelector.vue +165 -165
  21. package/src/components/template-report-maker/ReportView.vue +66 -66
  22. package/src/components/thumbnails-reports/AnalisisPostMatchType1.vue +741 -741
  23. package/src/components/thumbnails-reports/AnalisisPostMatchType2.vue +743 -743
  24. package/src/components/thumbnails-reports/AnalisisPrematchType3.vue +173 -173
  25. package/src/components/thumbnails-reports/AnalisisPrematchType4.vue +173 -173
  26. package/src/index.js +4 -4
  27. package/src/types.d.ts +45 -45
  28. package/src/utils/dateUtils.js +52 -52
  29. package/dist/images/cancha-horizontal.jpg +0 -0
  30. package/dist/images/canchaRPH.svg +0 -30
@@ -1,1250 +1,1332 @@
1
- <template>
2
- <div class="modal-overlay">
3
- <div class="modal-content">
4
- <!-- Botón de cerrar removido -->
5
-
6
- <div class="modal-header">
7
- <div class="header-left">
8
- <img
9
- src="https://golstatsimages.blob.core.windows.net/reports-images/icn-report-white.svg"
10
- class="icon-title"
11
- alt="icono reporte blanco"
12
- />
13
- <span class="modal-title"
14
- >Generar reporte&nbsp; - &nbsp; <span class="prepartido-text">Prepartido</span></span
15
- >
16
- </div>
17
- <div class="step-counter">
18
- Paso {{ currentStep === 0 ? 1 : currentStep }} de {{ totalSteps }}
19
- </div>
20
- </div>
21
- <div class="header-separator"></div>
22
- <div class="modal-body" :class="{ transitioning: isTransitioning }">
23
- <!-- Paso 0: Configuración inicial de opciones -->
24
- <div v-if="currentStep === 0" class="step-content">
25
- <!-- Sección Fortalezas - Solo se muestra si existen Fortalezas en el template -->
26
- <div v-if="hasFortalezas" class="content-section">
27
- <h3 class="section-title">Fortalezas</h3>
28
- <div class="title-separator"></div>
29
- <p class="section-description">
30
- Este template contiene {{ fortalezasCounts.equipo }} visualizaciones de Fortalezas de
31
- tu equipo y {{ fortalezasCounts.rival }} de tu rival. ¿Cómo prefieres que se agregue
32
- este contenido?
33
- </p>
34
- <div class="content-separator"></div>
35
- <div class="radio-group">
36
- <label class="radio-option">
37
- <input
38
- type="radio"
39
- name="fortalezas"
40
- value="automatico"
41
- v-model="fortalezasOption"
42
- />
43
- <span class="radio-custom"></span>
44
- <span class="radio-label">Automáticamente</span>
45
- </label>
46
- <label class="radio-option">
47
- <input type="radio" name="fortalezas" value="manual" v-model="fortalezasOption" />
48
- <span class="radio-custom"></span>
49
- <span class="radio-label">Manualmente</span>
50
- </label>
51
- </div>
52
- </div>
53
-
54
- <!-- Separador removido -->
55
-
56
- <!-- Sección Tiros de esquina - OCULTA POR EL MOMENTO -->
57
- <!-- <div v-if="hasCorners" class="content-section">
58
- <h3 class="section-title">Tiros de esquina</h3>
59
- <div class="title-separator"></div>
60
- <p class="section-description">
61
- Este template contiene 10 visualizaciones de Tiros de esquina de tu equipo. ¿Cómo
62
- prefieres que se agregue este contenido?
63
- </p>
64
- <div class="content-separator"></div>
65
- <div class="radio-group">
66
- <label class="radio-option">
67
- <input
68
- type="radio"
69
- name="tiros-esquina"
70
- value="automatico"
71
- v-model="tirosEsquinaOption"
72
- />
73
- <span class="radio-custom"></span>
74
- <span class="radio-label">Automáticamente</span>
75
- </label>
76
- <label class="radio-option">
77
- <input
78
- type="radio"
79
- name="tiros-esquina"
80
- value="manual"
81
- v-model="tirosEsquinaOption"
82
- />
83
- <span class="radio-custom"></span>
84
- <span class="radio-label">Manualmente</span>
85
- </label>
86
- </div>
87
- </div> -->
88
- </div>
89
-
90
- <!-- Pasos dinámicos renderizados por clave -->
91
- <!-- Usamos v-show en lugar de v-if para mantener los componentes montados y preservar el estado -->
92
- <template v-if="fortalezasCounts.equipo > 0">
93
- <div v-show="buildStepMap()[currentStep] === 'fortalezasEquipo'" class="step-content">
94
- <FortalezasView
95
- key="fortalezas-equipo"
96
- v-model="selectedFortalezasEquipo"
97
- team-initials="AME"
98
- :season-id="1772"
99
- :team-id="props.partido?.local || props.partido?.home_team"
100
- :rival-team-id="props.partido?.visita || props.partido?.visiting_team"
101
- :token="props.token"
102
- title="Fortalezas a favor de mi equipo"
103
- :total-fortalezas="fortalezasCounts.equipo"
104
- ref="fortalezasEquipoRef"
105
- />
106
- </div>
107
- </template>
108
-
109
- <template v-if="fortalezasCounts.rival > 0">
110
- <div v-show="buildStepMap()[currentStep] === 'fortalezasRival'" class="step-content">
111
- <FortalezasView
112
- key="fortalezas-rival"
113
- v-model="selectedFortalezasRival"
114
- team-initials="RIV"
115
- :season-id="1772"
116
- :team-id="props.partido?.visita || props.partido?.visiting_team"
117
- :rival-team-id="props.partido?.local || props.partido?.home_team"
118
- :token="props.token"
119
- title="Fortalezas a favor del rival"
120
- :total-fortalezas="fortalezasCounts.rival"
121
- ref="fortalezasRivalRef"
122
- />
123
- </div>
124
- </template>
125
-
126
- <div v-if="buildStepMap()[currentStep] === 'cornersEquipo'" class="step-content">
127
- <TirosEsquinaView
128
- v-model="selectedCornersEquipo"
129
- :rival="false"
130
- team-initials="AME"
131
- title="Tiros de esquina en contra de mi equipo"
132
- team-logo-url="https://golstatsimages.blob.core.windows.net/teams-80/2.png"
133
- ref="cornersEquipoRef"
134
- />
135
- </div>
136
-
137
- <div v-if="buildStepMap()[currentStep] === 'cornersRival'" class="step-content">
138
- <TirosEsquinaView
139
- v-model="selectedCornersRival"
140
- :rival="true"
141
- team-initials="RIV"
142
- title="Tiros de esquina en contra del rival"
143
- team-logo-url="https://golstatsimages.blob.core.windows.net/teams-80/1.png"
144
- ref="cornersRivalRef"
145
- />
146
- </div>
147
- </div>
148
- <div class="header-separator"></div>
149
- <div class="modal-footer">
150
- <button class="back-btn" @click="goBack">
151
- <svg
152
- width="16"
153
- height="16"
154
- viewBox="0 0 16 16"
155
- fill="none"
156
- xmlns="http://www.w3.org/2000/svg"
157
- >
158
- <path
159
- d="M10 12L6 8L10 4"
160
- stroke="white"
161
- stroke-width="2"
162
- stroke-linecap="round"
163
- stroke-linejoin="round"
164
- />
165
- </svg>
166
- Regresar
167
- </button>
168
- <div class="footer-actions">
169
- <button v-if="currentStep === 0" class="cancel-btn" @click="closeModal">Cancelar</button>
170
- <button
171
- v-if="currentStep === 1 || currentStep === 2"
172
- class="cancel-btn"
173
- @click="autocompletar"
174
- >
175
- Autocompletar
176
- </button>
177
- <button
178
- class="next-btn"
179
- :class="{ disabled: !canContinue }"
180
- :disabled="!canContinue"
181
- @click="continueToNext"
182
- >
183
- {{
184
- currentStep === 0
185
- ? fortalezasOption === 'automatico'
186
- ? 'Finalizar'
187
- : 'Siguiente'
188
- : currentStep === totalSteps
189
- ? 'Finalizar'
190
- : 'Siguiente'
191
- }}
192
- </button>
193
- </div>
194
- </div>
195
- </div>
196
- </div>
197
-
198
- <!-- Modal de confirmación para regresar al paso 0 -->
199
- <div v-if="showConfirmDialog" class="modal-overlay" @click.self="cancelGoBack">
200
- <div class="modal-content confirm-dialog">
201
- <div class="modal-header">
202
- <div class="header-left">
203
- <span class="modal-title">Confirmación</span>
204
- </div>
205
- </div>
206
- <div class="header-separator"></div>
207
- <div class="modal-body">
208
- <div class="step-content">
209
- <h3 class="confirm-dialog-title">¿Estás seguro de regresar?</h3>
210
- <p class="confirm-dialog-message">Se perderá la información seleccionada</p>
211
- </div>
212
- </div>
213
- <div class="modal-footer">
214
- <div class="footer-actions">
215
- <button class="cancel-btn" @click="cancelGoBack">Cancelar</button>
216
- <button class="next-btn" @click="confirmGoBackToStep0">Confirmar</button>
217
- </div>
218
- </div>
219
- </div>
220
- </div>
221
- </template>
222
-
223
- <script setup>
224
- import { ref, defineEmits, computed, nextTick } from 'vue'
225
- import FortalezasView from './FortalezasView.vue'
226
- import TirosEsquinaView from './TirosEsquinaView.vue'
227
-
228
- const emit = defineEmits(['close', 'back', 'next'])
229
-
230
- // Props para controlar el número de pasos
231
- const props = defineProps({
232
- hasRival: {
233
- type: Boolean,
234
- default: true,
235
- },
236
- token: {
237
- type: String,
238
- required: true,
239
- },
240
- template: {
241
- type: Object,
242
- required: false,
243
- default: null,
244
- },
245
- team: {
246
- type: Number,
247
- required: false,
248
- default: null,
249
- },
250
- partido: {
251
- type: Object,
252
- required: false,
253
- default: null,
254
- },
255
- })
256
-
257
- // Función para verificar si existe un componente Fortalezas en el template
258
- function tieneComponenteFortalezas() {
259
- if (!props.template || !props.template.pages) {
260
- return false
261
- }
262
-
263
- // Iterar sobre todas las pages del template
264
- for (const page of props.template.pages) {
265
- // Verificar si la page tiene components
266
- if (page.components && Array.isArray(page.components)) {
267
- // Buscar si existe algún componente con name === 'Fortalezas' o id === 15
268
- const tieneFortalezas = page.components.some(
269
- (component) => component.name === 'Fortalezas' || component.id === 15,
270
- )
271
- if (tieneFortalezas) {
272
- return true
273
- }
274
- }
275
- }
276
-
277
- return false
278
- }
279
-
280
- // Función para contar Fortalezas del equipo propio y del rival
281
- function contarFortalezas() {
282
- console.log(
283
- '5555555555555555 Nuevo Valor al crear fortalezas:: : : :: : : : :: : : :',
284
- props.template,
285
- )
286
- if (!props.template || !props.template.pages) {
287
- return { equipo: 0, rival: 0, total: 0 }
288
- }
289
- console.log('Nuevo Valor al crear fortalezas:: : : :: : : : :: : : :', props.template)
290
-
291
- let countEquipo = 0
292
- let countRival = 0
293
-
294
- // Iterar sobre todas las pages del template
295
- for (const page of props.template.pages) {
296
- console.log('page 11 5555555555555555555555555555555555 ', page)
297
- // Verificar si la page tiene components
298
- if (page.components && Array.isArray(page.components)) {
299
- console.log('page entro')
300
- // Filtrar componentes Fortalezas
301
- const componentesFortalezas = page.components.filter(
302
- (component) =>
303
- component.componentName === 'GSCStrengths' ||
304
- component.id === 15 ||
305
- component.name === 'Fortalezas',
306
- )
307
- console.log(
308
- 'componentesFortalezas componentesFortalezas componentesFortalezas',
309
- componentesFortalezas,
310
- )
311
- // Para cada componente Fortalezas, verificar dynamicFilters
312
- for (const component of componentesFortalezas) {
313
- // Verificar si tiene dynamicFilters y es un array
314
- if (component.dynamicFilters && Array.isArray(component.dynamicFilters)) {
315
- // Verificar la posición 1 (que es un array)
316
- if (component.dynamicFilters[1]) {
317
- // Consultar la posición 0 para determinar si es equipo propio (1) o rival (2)
318
- if (component.dynamicFilters[0] === 1) {
319
- countEquipo += component.dynamicFilters[1]
320
- } else if (component.dynamicFilters[0] === 2) {
321
- countRival += component.dynamicFilters[1]
322
- } else {
323
- if (component.dynamicFilters[0] === 3) {
324
- if (component.filterMultiple.isHomeTeam) {
325
- countEquipo += component.dynamicFilters[1]
326
- } else {
327
- countRival += component.dynamicFilters[1]
328
- }
329
- }
330
- }
331
- }
332
- }
333
- }
334
- }
335
- }
336
-
337
- return {
338
- equipo: countEquipo,
339
- rival: countRival,
340
- total: countEquipo + countRival,
341
- }
342
- }
343
-
344
- // Computed para verificar si tiene Fortalezas
345
- const hasFortalezas = computed(() => tieneComponenteFortalezas())
346
-
347
- // Computed para obtener los conteos de Fortalezas
348
- const fortalezasCounts = computed(() => contarFortalezas())
349
-
350
- // const hasCorners = false // OCULTO POR EL MOMENTO
351
- // Estado del modal
352
- const currentStep = ref(0) // 0 = configuración inicial, luego pasos dinámicos
353
- const isTransitioning = ref(false)
354
-
355
- // Modal de confirmación para regresar al paso 0
356
- const showConfirmDialog = ref(false)
357
-
358
- // Opciones seleccionadas para cada sección
359
- const fortalezasOption = ref('manual')
360
- const tirosEsquinaOption = ref('manual')
361
-
362
- // Selecciones por vista
363
- const selectedFortalezasEquipo = ref([])
364
- const selectedFortalezasRival = ref([])
365
- const selectedCornersEquipo = ref([])
366
- const selectedCornersRival = ref([])
367
-
368
- // Calcular el número total de pasos
369
- const totalSteps = computed(() => {
370
- let steps = 0
371
-
372
- // Pasos de Fortalezas
373
- if (hasFortalezas.value && fortalezasOption.value === 'manual') {
374
- // Si hay fortalezas de equipo, agregar paso 1
375
- if (fortalezasCounts.value.equipo > 0) {
376
- steps += 1
377
- }
378
- // Si hay fortalezas de rival, agregar paso (será 2 si hay equipo, 1 si no hay)
379
- if (fortalezasCounts.value.rival > 0) {
380
- steps += 1
381
- }
382
- }
383
-
384
- // Pasos de Tiros de esquina - OCULTOS POR EL MOMENTO
385
- // if (tirosEsquinaOption.value === 'manual') {
386
- // steps += props.hasRival ? 2 : 1
387
- // }
388
-
389
- return Math.max(steps, 1)
390
- })
391
-
392
- // Verificar si se puede continuar al siguiente paso
393
- const canContinue = computed(() => {
394
- if (currentStep.value === 0) {
395
- // Si no hay Fortalezas, no se puede continuar (tirosEsquina está oculto)
396
- if (!hasFortalezas.value) {
397
- return false
398
- }
399
- // Puede continuar si está en automático o en manual
400
- return fortalezasOption.value === 'automatico' || fortalezasOption.value === 'manual'
401
- }
402
- const stepMap = buildStepMap()
403
- const key = stepMap[currentStep.value]
404
-
405
- if (key === 'fortalezasEquipo') {
406
- const ref = fortalezasEquipoRef.value
407
- if (!ref) return false
408
- const selected = selectedFortalezasEquipo.value.length
409
- const totalRequerido = fortalezasCounts.value.equipo
410
- // Obtener el total de fortalezas disponibles del componente
411
- const totalDisponibles = ref.fortalezasData?.length || 0
412
-
413
- // Puede continuar si:
414
- // 1. Selecciona el total exacto requerido
415
- // 2. O si no hay suficientes disponibles, selecciona todos los disponibles
416
- return (
417
- selected === totalRequerido ||
418
- (totalDisponibles > 0 && totalDisponibles < totalRequerido && selected === totalDisponibles)
419
- )
420
- }
421
-
422
- if (key === 'fortalezasRival') {
423
- const ref = fortalezasRivalRef.value
424
- if (!ref) return false
425
- const selected = selectedFortalezasRival.value.length
426
- const totalRequerido = fortalezasCounts.value.rival
427
- // Obtener el total de fortalezas disponibles del componente
428
- const totalDisponibles = ref.fortalezasData?.length || 0
429
-
430
- // Puede continuar si:
431
- // 1. Selecciona el total exacto requerido
432
- // 2. O si no hay suficientes disponibles, selecciona todos los disponibles
433
- return (
434
- selected === totalRequerido ||
435
- (totalDisponibles > 0 && totalDisponibles < totalRequerido && selected === totalDisponibles)
436
- )
437
- }
438
-
439
- // Pasos de corners ocultos
440
- // if (key === 'cornersEquipo') return selectedCornersEquipo.value.length > 0
441
- // if (key === 'cornersRival') return selectedCornersRival.value.length > 0
442
- return false
443
- })
444
-
445
- function buildStepMap() {
446
- const order = []
447
-
448
- // Solo agregar pasos de Fortalezas si existen en el template y está en modo manual
449
- if (hasFortalezas.value && fortalezasOption.value === 'manual') {
450
- // Si hay fortalezas de equipo, agregar paso de equipo
451
- if (fortalezasCounts.value.equipo > 0) {
452
- order.push('fortalezasEquipo')
453
- }
454
- // Si hay fortalezas de rival, agregar paso de rival
455
- if (fortalezasCounts.value.rival > 0) {
456
- order.push('fortalezasRival')
457
- }
458
- }
459
-
460
- // Pasos de Tiros de esquina - OCULTOS POR EL MOMENTO
461
- // if (tirosEsquinaOption.value === 'manual') {
462
- // order.push('cornersEquipo')
463
- // if (props.hasRival) order.push('cornersRival')
464
- // }
465
-
466
- const map = {}
467
- order.forEach((k, idx) => {
468
- map[idx + 1] = k // pasos empiezan en 1
469
- })
470
- return map
471
- }
472
-
473
- // Referencias a los componentes
474
- const fortalezasEquipoRef = ref(null)
475
- const fortalezasRivalRef = ref(null)
476
- const cornersEquipoRef = ref(null)
477
- const cornersRivalRef = ref(null)
478
-
479
- function closeModal() {
480
- emit('close')
481
- }
482
-
483
- function goBack() {
484
- if (currentStep.value > 1) {
485
- // Si estamos en paso 2 o superior, solo regresar sin borrar selecciones
486
- currentStep.value--
487
- } else if (currentStep.value === 1) {
488
- // Si estamos en paso 1 y vamos al paso 0, mostrar modal de confirmación
489
- // Verificar si hay selecciones antes de mostrar el modal
490
- const tieneSelecciones =
491
- selectedFortalezasEquipo.value.length > 0 || selectedFortalezasRival.value.length > 0
492
-
493
- if (tieneSelecciones) {
494
- showConfirmDialog.value = true
495
- } else {
496
- // Si no hay selecciones, regresar directamente
497
- currentStep.value--
498
- }
499
- } else {
500
- // Si estamos en paso 0, emitir evento back
501
- emit('back')
502
- }
503
- }
504
-
505
- function confirmGoBackToStep0() {
506
- // Limpiar todas las selecciones
507
- selectedFortalezasEquipo.value = []
508
- selectedFortalezasRival.value = []
509
- selectedCornersEquipo.value = []
510
- selectedCornersRival.value = []
511
-
512
- // Cerrar el modal de confirmación
513
- showConfirmDialog.value = false
514
-
515
- // Regresar al paso 0
516
- currentStep.value--
517
- }
518
-
519
- function cancelGoBack() {
520
- // Cerrar el modal de confirmación sin hacer nada
521
- showConfirmDialog.value = false
522
- }
523
-
524
- async function continueToNext() {
525
- if (currentStep.value === 0) {
526
- // Validar que al menos una opción esté seleccionada
527
- if (!canContinue.value) {
528
- return
529
- }
530
-
531
- // Si está en automático, finalizar directamente sin construir payload
532
- if (fortalezasOption.value === 'automatico') {
533
- // Emitir evento sin payload de strengths (se generarán automáticamente)
534
- emit('next', {
535
- fortalezas: fortalezasOption.value,
536
- tirosEsquina: tirosEsquinaOption.value,
537
- selectedFortalezasEquipo: [],
538
- selectedFortalezasRival: [],
539
- strengthsPayload: {}, // Payload vacío para modo automático
540
- })
541
- return
542
- }
543
-
544
- // Si es manual, avanzar al siguiente paso
545
- // Animar transición
546
- isTransitioning.value = true
547
- setTimeout(() => {
548
- currentStep.value++
549
- isTransitioning.value = false
550
- }, 300)
551
- } else if (currentStep.value < totalSteps.value) {
552
- // Avanzar al siguiente paso
553
- isTransitioning.value = true
554
- setTimeout(() => {
555
- currentStep.value++
556
- isTransitioning.value = false
557
- }, 300)
558
- } else {
559
- // Esperar un tick para asegurar que los refs estén disponibles
560
- await nextTick()
561
-
562
- // Construir el payload de fortalezas antes de emitir
563
- const strengthsPayload = buildStrengthsPayload()
564
- console.log('Estructura de strengths emitida:', JSON.stringify(strengthsPayload, null, 2))
565
-
566
- // Emitir evento con las opciones seleccionadas y el payload de fortalezas
567
- emit('next', {
568
- fortalezas: fortalezasOption.value,
569
- tirosEsquina: tirosEsquinaOption.value,
570
- selectedFortalezasEquipo: selectedFortalezasEquipo.value,
571
- selectedFortalezasRival: selectedFortalezasRival.value,
572
- strengthsPayload,
573
- })
574
- }
575
- }
576
-
577
- // Función para construir el payload de fortalezas según la estructura requerida
578
- function buildStrengthsPayload() {
579
- console.log('=== INICIANDO buildStrengthsPayload ===')
580
- console.log('Template:', props.template)
581
- console.log('Template pages:', props.template?.pages)
582
-
583
- if (!props.template || !props.template.pages) {
584
- console.warn('No hay template o pages')
585
- return {}
586
- }
587
-
588
- const payload = {}
589
-
590
- console.log('selectedFortalezasEquipo:', selectedFortalezasEquipo.value)
591
- console.log('selectedFortalezasRival:', selectedFortalezasRival.value)
592
- console.log('fortalezasEquipoRef:', fortalezasEquipoRef.value)
593
- console.log('fortalezasRivalRef:', fortalezasRivalRef.value)
594
-
595
- // Verificar si los refs están disponibles
596
- let equipoRef = fortalezasEquipoRef.value
597
- let rivalRef = fortalezasRivalRef.value
598
-
599
- // Debug detallado de los refs
600
- if (equipoRef) {
601
- console.log('equipoRef keys:', Object.keys(equipoRef))
602
- console.log('equipoRef.fortalezasRawData:', equipoRef.fortalezasRawData)
603
- console.log('equipoRef.fortalezasRawData type:', typeof equipoRef.fortalezasRawData)
604
-
605
- // Verificar si es un ref (tiene .value)
606
- let rawDataEquipo = equipoRef.fortalezasRawData
607
- if (rawDataEquipo && typeof rawDataEquipo === 'object' && 'value' in rawDataEquipo) {
608
- console.log('⚠️ fortalezasRawData es un ref, usando .value')
609
- rawDataEquipo = rawDataEquipo.value
610
- }
611
-
612
- console.log('rawDataEquipo después de verificar ref:', rawDataEquipo)
613
- console.log('rawDataEquipo is array:', Array.isArray(rawDataEquipo))
614
- if (Array.isArray(rawDataEquipo)) {
615
- console.log('rawDataEquipo length:', rawDataEquipo.length)
616
- if (rawDataEquipo.length > 0) {
617
- console.log('Primer elemento equipoRef:', rawDataEquipo[0])
618
- }
619
- }
620
- } else {
621
- console.error(' equipoRef NO está disponible')
622
- }
623
-
624
- if (rivalRef) {
625
- console.log('rivalRef keys:', Object.keys(rivalRef))
626
- console.log('rivalRef.fortalezasRawData:', rivalRef.fortalezasRawData)
627
- console.log('rivalRef.fortalezasRawData type:', typeof rivalRef.fortalezasRawData)
628
-
629
- // Verificar si es un ref (tiene .value)
630
- let rawDataRival = rivalRef.fortalezasRawData
631
- if (rawDataRival && typeof rawDataRival === 'object' && 'value' in rawDataRival) {
632
- console.log('⚠️ fortalezasRawData es un ref, usando .value')
633
- rawDataRival = rawDataRival.value
634
- }
635
-
636
- console.log('rawDataRival después de verificar ref:', rawDataRival)
637
- console.log('rawDataRival is array:', Array.isArray(rawDataRival))
638
- if (Array.isArray(rawDataRival)) {
639
- console.log('rawDataRival length:', rawDataRival.length)
640
- if (rawDataRival.length > 0) {
641
- console.log('Primer elemento rivalRef:', rawDataRival[0])
642
- }
643
- }
644
- } else {
645
- console.error(' rivalRef NO está disponible')
646
- }
647
-
648
- // Si los refs no están disponibles, podría ser que los componentes estén ocultos con v-show
649
- if (!equipoRef && selectedFortalezasEquipo.value.length > 0) {
650
- console.warn('⚠️ Ref de equipo no disponible, pero hay selecciones')
651
- }
652
- if (!rivalRef && selectedFortalezasRival.value.length > 0) {
653
- console.warn('⚠️ Ref de rival no disponible, pero hay selecciones')
654
- }
655
-
656
- // Obtener todas las fortalezas seleccionadas ordenadas por su orden de selección
657
- const fortalezasEquipoOrdenadas = getOrderedStrengths(selectedFortalezasEquipo.value, equipoRef)
658
- const fortalezasRivalOrdenadas = getOrderedStrengths(selectedFortalezasRival.value, rivalRef)
659
-
660
- console.log('fortalezasEquipoOrdenadas:', fortalezasEquipoOrdenadas)
661
- console.log('fortalezasRivalOrdenadas:', fortalezasRivalOrdenadas)
662
-
663
- // Contadores para rastrear qué fortalezas ya se han asignado
664
- let indexEquipo = 0
665
- let indexRival = 0
666
-
667
- // Iterar sobre todas las páginas del template
668
- props.template.pages.forEach((page, pageIndex) => {
669
- const pageNumber = pageIndex + 1 // Los índices de página empiezan en 1
670
- console.log(`\n=== Página ${pageNumber} ===`)
671
- console.log('Page components:', page.components)
672
-
673
- // Verificar si la página tiene components
674
- if (page.components && Array.isArray(page.components)) {
675
- // Buscar componentes Fortalezas
676
- page.components.forEach((component, componentIndex) => {
677
- if (component.name === 'Fortalezas' || component.id === 15) {
678
- const componentNumber = componentIndex + 1 // Los índices de componente empiezan en 1
679
- console.log(`\n--- Componente ${componentNumber} (Fortalezas) ---`)
680
- console.log('Component:', component)
681
- console.log('dynamicFilters:', component.dynamicFilters)
682
-
683
- // Verificar dynamicFilters para determinar tipo y cantidad
684
- if (component.dynamicFilters && Array.isArray(component.dynamicFilters)) {
685
- const teamType = component.dynamicFilters[0] // 1 = equipo, 2 = rival
686
- const cantidadRequerida = component.dynamicFilters[1] || 0 // Cantidad de fortalezas necesarias
687
-
688
- console.log(
689
- `Tipo: ${teamType === 1 ? 'Equipo' : 'Rival'}, Cantidad requerida: ${cantidadRequerida}`,
690
- )
691
-
692
- // Obtener las fortalezas según el tipo
693
- let fortalezasAsignar = []
694
- let fortalezasOrdenadas = []
695
- let teamId = props.team
696
-
697
- if (teamType === 1) {
698
- // Fortalezas de equipo
699
- fortalezasOrdenadas = fortalezasEquipoOrdenadas
700
- console.log(
701
- `Equipo: Total ordenadas=${fortalezasOrdenadas.length}, index=${indexEquipo}, cantidad requerida=${cantidadRequerida}`,
702
- )
703
- // Tomar las siguientes N fortalezas (donde N = cantidadRequerida)
704
- if (fortalezasOrdenadas.length > indexEquipo) {
705
- fortalezasAsignar = fortalezasOrdenadas.slice(
706
- indexEquipo,
707
- indexEquipo + cantidadRequerida,
708
- )
709
- console.log(
710
- `Index equipo: ${indexEquipo}, tomando ${fortalezasAsignar.length} fortalezas de ${fortalezasOrdenadas.length} disponibles`,
711
- )
712
- } else {
713
- console.warn(
714
- `No hay suficientes fortalezas de equipo. Disponibles: ${fortalezasOrdenadas.length}, Necesarias desde índice: ${indexEquipo}`,
715
- )
716
- }
717
- indexEquipo += cantidadRequerida
718
- teamId = props.partido?.local || props.partido?.home_team || props.team
719
- } else if (teamType === 2) {
720
- // Fortalezas de rival
721
- fortalezasOrdenadas = fortalezasRivalOrdenadas
722
- console.log(
723
- `Rival: Total ordenadas=${fortalezasOrdenadas.length}, index=${indexRival}, cantidad requerida=${cantidadRequerida}`,
724
- )
725
- // Tomar las siguientes N fortalezas (donde N = cantidadRequerida)
726
- if (fortalezasOrdenadas.length > indexRival) {
727
- fortalezasAsignar = fortalezasOrdenadas.slice(
728
- indexRival,
729
- indexRival + cantidadRequerida,
730
- )
731
- console.log(
732
- `Index rival: ${indexRival}, tomando ${fortalezasAsignar.length} fortalezas de ${fortalezasOrdenadas.length} disponibles`,
733
- )
734
- } else {
735
- console.warn(
736
- `No hay suficientes fortalezas de rival. Disponibles: ${fortalezasOrdenadas.length}, Necesarias desde índice: ${indexRival}`,
737
- )
738
- }
739
- indexRival += cantidadRequerida
740
- teamId = props.partido?.visita || props.partido?.visiting_team
741
- }
742
-
743
- console.log('fortalezasAsignar:', fortalezasAsignar)
744
-
745
- // Si hay fortalezas para asignar, agregarlas al payload
746
- if (fortalezasAsignar.length > 0) {
747
- // Inicializar la estructura si no existe
748
- if (!payload[pageNumber]) {
749
- payload[pageNumber] = {}
750
- }
751
- if (!payload[pageNumber][componentNumber]) {
752
- payload[pageNumber][componentNumber] = []
753
- }
754
-
755
- // Agregar las fortalezas con su información completa
756
- fortalezasAsignar.forEach((strength, index) => {
757
- payload[pageNumber][componentNumber].push({
758
- team_id: teamId,
759
- ranking_type: strength.ranking_type || 1,
760
- precondition_id: strength.precondition_id || null,
761
- order: index + 1,
762
- name: strength.name,
763
- category_type: strength.category_type || 1,
764
- total: strength.total || 0,
765
- is_relevant: strength.is_relevant || 0,
766
- league_ranking: strength.league_ranking || 0,
767
- categories: Array.isArray(strength.categories)
768
- ? strength.categories
769
- : [strength.categories],
770
- team_contribution: strength.team_contribution || 0,
771
- })
772
- })
773
- console.log(`✓ Agregadas ${fortalezasAsignar.length} fortalezas al payload`)
774
- } else {
775
- console.warn('No hay fortalezas para asignar a este componente')
776
- }
777
- } else {
778
- console.warn('Componente no tiene dynamicFilters válido')
779
- }
780
- }
781
- })
782
- }
783
- })
784
-
785
- console.log('\n=== PAYLOAD FINAL ===')
786
- console.log(JSON.stringify(payload, null, 2))
787
- return payload
788
- }
789
-
790
- // Función auxiliar para obtener las fortalezas en el mismo orden que fueron seleccionadas
791
- // Los IDs ya vienen en el orden correcto, solo necesitamos obtener los objetos completos
792
- function getOrderedStrengths(selectedIds, fortalezasViewRef) {
793
- console.log('=== getOrderedStrengths INICIO ===')
794
- console.log('selectedIds (orden de selección):', selectedIds)
795
- console.log('fortalezasViewRef existe?:', !!fortalezasViewRef)
796
-
797
- if (!selectedIds || selectedIds.length === 0) {
798
- console.warn('No hay IDs seleccionados')
799
- return []
800
- }
801
-
802
- if (!fortalezasViewRef) {
803
- console.warn('Ref no disponible')
804
- return []
805
- }
806
-
807
- // Obtener fortalezasRawData, verificando si es un ref
808
- let fortalezasRawData = fortalezasViewRef.fortalezasRawData
809
- if (!fortalezasRawData) {
810
- console.warn('fortalezasRawData no está disponible en el ref')
811
- return []
812
- }
813
-
814
- // Si es un ref, acceder a su .value
815
- if (fortalezasRawData && typeof fortalezasRawData === 'object' && 'value' in fortalezasRawData) {
816
- console.log('⚠️ fortalezasRawData es un ref, accediendo a .value')
817
- fortalezasRawData = fortalezasRawData.value
818
- }
819
-
820
- if (!Array.isArray(fortalezasRawData)) {
821
- console.warn('fortalezasRawData no es un array:', typeof fortalezasRawData, fortalezasRawData)
822
- return []
823
- }
824
-
825
- if (fortalezasRawData.length === 0) {
826
- console.warn('fortalezasRawData está vacío')
827
- return []
828
- }
829
-
830
- console.log('fortalezasRawData length:', fortalezasRawData.length)
831
- console.log('Primeras 2 fortalezas raw:', fortalezasRawData.slice(0, 2))
832
-
833
- // Obtener las fortalezas en el mismo orden que fueron seleccionadas (sin reordenar)
834
- // El orden ya está dado por selectedIds, solo necesitamos buscar y devolver el objeto completo
835
- const selectedStrengths = selectedIds
836
- .map((id) => {
837
- console.log(`Buscando ID: ${id} (tipo: ${typeof id})`)
838
-
839
- // Buscar en los datos raw por categories (que es el id que usamos)
840
- const strength = fortalezasRawData.find((item) => {
841
- // Comparar tanto como número como string
842
- const match =
843
- item.categories === id ||
844
- item.categories === Number(id) ||
845
- String(item.categories) === String(id)
846
- if (!match && fortalezasRawData.indexOf(item) < 3) {
847
- console.log(
848
- ` Comparando: item.categories=${item.categories} (${typeof item.categories}) vs id=${id} (${typeof id})`,
849
- )
850
- }
851
- return match
852
- })
853
-
854
- if (strength) {
855
- console.log(`✓ Encontrada: ${strength.name} (categories: ${strength.categories})`)
856
- return strength
857
- }
858
-
859
- console.warn(`✗ No encontrada con categories = ${id}, intentando por id`)
860
- // Intentar buscar también por id si categories no funciona
861
- const strengthById = fortalezasRawData.find(
862
- (item) => item.id === id || item.id === Number(id) || String(item.id) === String(id),
863
- )
864
- if (strengthById) {
865
- console.log(`✓ Encontrada por id: ${strengthById.name}`)
866
- return strengthById
867
- }
868
-
869
- console.error(`✗✗ No se encontró fortaleza con id/categories = ${id}`)
870
- return null
871
- })
872
- .filter(Boolean) // Filtrar los que no se encontraron
873
-
874
- console.log(
875
- `selectedStrengths (${selectedStrengths.length} de ${selectedIds.length} encontradas):`,
876
- selectedStrengths,
877
- )
878
- console.log('=== getOrderedStrengths FIN ===')
879
- return selectedStrengths
880
- }
881
-
882
- function autocompletar() {
883
- const stepMap = buildStepMap()
884
- const key = stepMap[currentStep.value]
885
- if (key === 'fortalezasEquipo' && fortalezasEquipoRef.value)
886
- return fortalezasEquipoRef.value.autocompletar()
887
- if (key === 'fortalezasRival' && fortalezasRivalRef.value)
888
- return fortalezasRivalRef.value.autocompletar()
889
- if (key === 'cornersEquipo' && cornersEquipoRef.value)
890
- return cornersEquipoRef.value.autocompletar()
891
- if (key === 'cornersRival' && cornersRivalRef.value) return cornersRivalRef.value.autocompletar()
892
- }
893
- </script>
894
-
895
- <style scoped>
896
- .modal-overlay {
897
- position: fixed;
898
- top: 0;
899
- left: 0;
900
- width: 100vw;
901
- height: 100vh;
902
- background: rgba(0, 0, 0, 0.45);
903
- display: flex;
904
- align-items: center;
905
- justify-content: center;
906
- z-index: 3300;
907
- }
908
-
909
- .modal-content {
910
- width: 464px;
911
- background: #2e3b46;
912
- border-radius: 10px;
913
- box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.18);
914
- padding: 0;
915
- position: relative;
916
- display: flex;
917
- flex-direction: column;
918
- font-family: 'Poppins-Medium', 'Montserrat', sans-serif;
919
- }
920
-
921
- /* Estilos del botón de cerrar removidos */
922
-
923
- .header-separator {
924
- width: 100%;
925
- height: 1px;
926
- border-bottom: dashed 1px #58626b;
927
- margin: 12px 0 0 0;
928
- }
929
-
930
- .modal-header {
931
- display: flex;
932
- align-items: center;
933
- justify-content: space-between;
934
- padding: 20px 24px 0 24px;
935
- }
936
-
937
- .header-left {
938
- display: flex;
939
- align-items: center;
940
- gap: 8px;
941
- }
942
-
943
- .step-counter {
944
- font-family: Poppins-Medium;
945
- font-size: 12px;
946
- font-weight: 500;
947
- color: rgba(255, 255, 255, 0.7);
948
- }
949
-
950
- .icon-title {
951
- width: 16px;
952
- height: 16px;
953
- }
954
-
955
- .modal-title {
956
- font-family: Poppins-Medium;
957
- font-size: 14px;
958
- font-weight: 500;
959
- font-stretch: normal;
960
- font-style: normal;
961
- line-height: 1.5;
962
- letter-spacing: normal;
963
- text-align: left;
964
- color: #fff;
965
- }
966
-
967
- .prepartido-text {
968
- font-family: 'Poppins-Regular', 'BebasNeue', sans-serif;
969
- font-weight: 400;
970
- opacity: 0.7;
971
- letter-spacing: 1px;
972
- }
973
-
974
- .modal-body {
975
- flex: 1;
976
- display: flex;
977
- flex-direction: column;
978
- padding: 12px 24px 0 24px;
979
- margin-bottom: 17px;
980
- margin-top: 5px;
981
- gap: 0;
982
- position: relative;
983
- overflow: hidden;
984
- }
985
-
986
- .step-content {
987
- transition: transform 0.3s ease-in-out;
988
- }
989
-
990
- .modal-body.transitioning .step-content {
991
- transform: translateX(-100%);
992
- }
993
-
994
- .fortalezas-view {
995
- transform: translateX(100%);
996
- animation: slideIn 0.3s ease-in-out forwards;
997
- }
998
-
999
- @keyframes slideIn {
1000
- from {
1001
- transform: translateX(100%);
1002
- }
1003
- to {
1004
- transform: translateX(0);
1005
- }
1006
- }
1007
-
1008
- .content-section {
1009
- background: none;
1010
- border: solid 1px rgba(255, 255, 255, 0.4);
1011
- padding: 12px 20px 20px 20px;
1012
- margin-bottom: 0;
1013
- border-radius: 8px;
1014
- }
1015
-
1016
- .content-section:first-child {
1017
- margin-bottom: 20px;
1018
- }
1019
-
1020
- .title-separator {
1021
- width: 100%;
1022
- height: 1px;
1023
- border-top: 1px dashed rgba(255, 255, 255, 0.3);
1024
- margin: 8px 0 12px 0;
1025
- margin-left: -20px;
1026
- margin-right: -20px;
1027
- width: calc(100% + 40px);
1028
- }
1029
-
1030
- .content-separator {
1031
- width: 100%;
1032
- height: 1px;
1033
- border-top: 1px dashed rgba(255, 255, 255, 0.3);
1034
- margin: 12px 0 16px 0;
1035
- margin-left: -20px;
1036
- margin-right: -20px;
1037
- width: calc(100% + 40px);
1038
- }
1039
-
1040
- .section-title {
1041
- font-family: Poppins-Medium;
1042
- font-size: 14px;
1043
- font-weight: 600;
1044
- opacity: 0.9;
1045
- color: #fff;
1046
- margin: 0 0 12px 0;
1047
- }
1048
-
1049
- .section-description {
1050
- font-family: Poppins-Regular;
1051
- font-size: 12px;
1052
- line-height: 1.4;
1053
- opacity: 0.7;
1054
- color: #fff;
1055
- margin: 0 0 13px 0;
1056
- }
1057
-
1058
- .radio-group {
1059
- display: flex;
1060
- gap: 24px;
1061
- justify-content: center;
1062
- }
1063
-
1064
- .radio-option {
1065
- display: flex;
1066
- align-items: center;
1067
- gap: 8px;
1068
- cursor: pointer;
1069
- user-select: none;
1070
- }
1071
-
1072
- .radio-option input[type='radio'] {
1073
- display: none;
1074
- }
1075
-
1076
- .radio-custom {
1077
- width: 20px;
1078
- height: 20px;
1079
- border: 1px solid #fff;
1080
- border-radius: 50%;
1081
- position: relative;
1082
- transition: all 0.2s ease;
1083
- flex-shrink: 0;
1084
- }
1085
-
1086
- .radio-option input[type='radio']:checked + .radio-custom {
1087
- border-color: #fff; /* mantiene el aro blanco */
1088
- background-color: transparent; /* sin relleno, solo punto central */
1089
- }
1090
-
1091
- .radio-option input[type='radio']:checked + .radio-custom::after {
1092
- content: '';
1093
- position: absolute;
1094
- top: 50%;
1095
- left: 50%;
1096
- transform: translate(-50%, -50%);
1097
- width: 10px;
1098
- height: 10px;
1099
- background-color: #cbee6b; /* punto verde */
1100
- border-radius: 50%;
1101
- }
1102
-
1103
- /* Cuando el radio está seleccionado, la etiqueta pierde la opacidad */
1104
- .radio-option input[type='radio']:checked + .radio-custom + .radio-label {
1105
- opacity: 0.9;
1106
- }
1107
-
1108
- .radio-label {
1109
- font-family: Poppins-Regular;
1110
- font-size: 13px;
1111
- color: #fff;
1112
- opacity: 0.7;
1113
- }
1114
-
1115
- /* Estilos del separador removidos */
1116
-
1117
- .modal-footer {
1118
- display: flex;
1119
- justify-content: space-between;
1120
- align-items: center;
1121
- padding: 0 24px 12px 24px;
1122
- margin-top: 13px;
1123
- }
1124
-
1125
- .footer-actions {
1126
- display: flex;
1127
- align-items: center;
1128
- }
1129
-
1130
- .back-btn {
1131
- background: none;
1132
- border: none;
1133
- color: #fff;
1134
- font-size: 14px;
1135
- font-family: Poppins-Medium;
1136
- display: flex;
1137
- align-items: center;
1138
- gap: 4px;
1139
- cursor: pointer;
1140
- opacity: 0.7;
1141
- padding: 8px 0;
1142
- transition: opacity 0.2s;
1143
- }
1144
-
1145
- .back-btn:hover {
1146
- opacity: 1;
1147
- }
1148
-
1149
- .cancel-btn {
1150
- background: none;
1151
- border: none;
1152
- color: #b0bec5;
1153
- font-size: 14.9px;
1154
- font-family: Poppins-Medium;
1155
- height: 30px;
1156
- border-radius: 64px;
1157
- display: flex;
1158
- align-items: center;
1159
- justify-content: center;
1160
- cursor: pointer;
1161
- padding: 0 18px;
1162
- transition: color 0.2s;
1163
- text-decoration: underline;
1164
- }
1165
-
1166
- .cancel-btn:hover {
1167
- color: #fff;
1168
- }
1169
-
1170
- .next-btn {
1171
- width: 107px;
1172
- height: 30px;
1173
- border-radius: 79.2px;
1174
- -webkit-backdrop-filter: blur(19.8px);
1175
- backdrop-filter: blur(19.8px);
1176
- border: solid 1px #cbee6b;
1177
- background-color: rgba(255, 255, 255, 0.06);
1178
- font-family: Poppins-Medium;
1179
- font-size: 14.9px;
1180
- font-weight: 500;
1181
- color: #fff;
1182
- cursor: pointer;
1183
- transition: background 0.2s;
1184
- display: flex;
1185
- align-items: center;
1186
- justify-content: center;
1187
- }
1188
-
1189
- .next-btn:hover {
1190
- background-color: rgba(255, 255, 255, 0.12);
1191
- }
1192
-
1193
- .next-btn.disabled {
1194
- opacity: 0.5;
1195
- cursor: not-allowed;
1196
- }
1197
-
1198
- .next-btn.disabled:hover {
1199
- background-color: rgba(255, 255, 255, 0.06);
1200
- }
1201
-
1202
- /* Estilos para el modal de confirmación */
1203
- .confirm-dialog {
1204
- width: 380px;
1205
- max-width: 90%;
1206
- }
1207
-
1208
- /* Asegurar que el overlay del modal de confirmación esté por encima del modal principal */
1209
- .modal-overlay:has(.confirm-dialog) {
1210
- z-index: 3400;
1211
- }
1212
-
1213
- .confirm-dialog .modal-header {
1214
- justify-content: center;
1215
- }
1216
-
1217
- .confirm-dialog .modal-body {
1218
- text-align: center;
1219
- }
1220
-
1221
- .confirm-dialog-title {
1222
- font-family: Poppins-Medium;
1223
- font-size: 16px;
1224
- font-weight: 500;
1225
- color: #fff;
1226
- margin: 0 0 12px 0;
1227
- text-align: center;
1228
- }
1229
-
1230
- .confirm-dialog-message {
1231
- font-family: Poppins-Regular;
1232
- font-size: 14px;
1233
- color: rgba(255, 255, 255, 0.7);
1234
- margin: 0;
1235
- text-align: center;
1236
- line-height: 1.5;
1237
- }
1238
-
1239
- .confirm-dialog .modal-footer {
1240
- justify-content: center;
1241
- }
1242
-
1243
- .confirm-dialog .footer-actions {
1244
- width: 100%;
1245
- justify-content: center;
1246
- gap: 12px;
1247
- }
1248
-
1249
- /* Estilos para la vista de fortalezas movidos al componente FortalezasView.vue */
1250
- </style>
1
+ <template>
2
+ <div class="modal-overlay">
3
+ <div class="modal-content">
4
+ <!-- Botón de cerrar removido -->
5
+
6
+ <div class="modal-header">
7
+ <div class="header-left">
8
+ <img
9
+ src="https://golstatsimages.blob.core.windows.net/reports-images/icn-report-white.svg"
10
+ class="icon-title"
11
+ alt="icono reporte blanco"
12
+ />
13
+ <span class="modal-title"
14
+ >Generar reporte&nbsp; - &nbsp; <span class="prepartido-text">Prepartido</span></span
15
+ >
16
+ </div>
17
+ <div class="step-counter">
18
+ Paso {{ currentStep === 0 ? 1 : currentStep }} de {{ totalSteps }}
19
+ </div>
20
+ </div>
21
+ <div class="header-separator"></div>
22
+ <div class="modal-body" :class="{ transitioning: isTransitioning }">
23
+ <!-- Paso 0: Configuración inicial de opciones -->
24
+ <div v-if="currentStep === 0" class="step-content">
25
+ <!-- Sección Fortalezas - Solo se muestra si existen Fortalezas en el template -->
26
+ <div v-if="hasFortalezas" class="content-section">
27
+ <h3 class="section-title">Fortalezas</h3>
28
+ <div class="title-separator"></div>
29
+ <p class="section-description">
30
+ Este template contiene {{ fortalezasCounts.equipo }} visualizaciones de Fortalezas de
31
+ tu equipo y {{ fortalezasCounts.rival }} de tu rival. ¿Cómo prefieres que se agregue
32
+ este contenido?
33
+ </p>
34
+ <div class="content-separator"></div>
35
+ <div class="radio-group">
36
+ <label class="radio-option">
37
+ <input
38
+ type="radio"
39
+ name="fortalezas"
40
+ value="automatico"
41
+ v-model="fortalezasOption"
42
+ />
43
+ <span class="radio-custom"></span>
44
+ <span class="radio-label">Automáticamente</span>
45
+ </label>
46
+ <label class="radio-option">
47
+ <input type="radio" name="fortalezas" value="manual" v-model="fortalezasOption" />
48
+ <span class="radio-custom"></span>
49
+ <span class="radio-label">Manualmente</span>
50
+ </label>
51
+ </div>
52
+ </div>
53
+
54
+ <!-- Separador removido -->
55
+
56
+ <!-- Sección Tiros de esquina - OCULTA POR EL MOMENTO -->
57
+ <!-- <div v-if="hasCorners" class="content-section">
58
+ <h3 class="section-title">Tiros de esquina</h3>
59
+ <div class="title-separator"></div>
60
+ <p class="section-description">
61
+ Este template contiene 10 visualizaciones de Tiros de esquina de tu equipo. ¿Cómo
62
+ prefieres que se agregue este contenido?
63
+ </p>
64
+ <div class="content-separator"></div>
65
+ <div class="radio-group">
66
+ <label class="radio-option">
67
+ <input
68
+ type="radio"
69
+ name="tiros-esquina"
70
+ value="automatico"
71
+ v-model="tirosEsquinaOption"
72
+ />
73
+ <span class="radio-custom"></span>
74
+ <span class="radio-label">Automáticamente</span>
75
+ </label>
76
+ <label class="radio-option">
77
+ <input
78
+ type="radio"
79
+ name="tiros-esquina"
80
+ value="manual"
81
+ v-model="tirosEsquinaOption"
82
+ />
83
+ <span class="radio-custom"></span>
84
+ <span class="radio-label">Manualmente</span>
85
+ </label>
86
+ </div>
87
+ </div> -->
88
+ </div>
89
+
90
+ <!-- Pasos dinámicos renderizados por clave -->
91
+ <!-- Usamos v-show en lugar de v-if para mantener los componentes montados y preservar el estado -->
92
+ <template v-if="fortalezasCounts.equipo > 0">
93
+ <div v-show="buildStepMap()[currentStep] === 'fortalezasEquipo'" class="step-content">
94
+ <FortalezasView
95
+ key="fortalezas-equipo"
96
+ v-model="selectedFortalezasEquipo"
97
+ team-initials="AME"
98
+ :season-id="props.partido?.season_id"
99
+ :team-id="props.partido?.local || props.partido?.home_team"
100
+ :rival-team-id="props.partido?.visita || props.partido?.visiting_team"
101
+ :game-id="props.partido?.game_id || props.partido?.id"
102
+ :token="props.token"
103
+ title="Fortalezas a favor de mi equipo"
104
+ :total-fortalezas="fortalezasCounts.equipo"
105
+ ref="fortalezasEquipoRef"
106
+ />
107
+ </div>
108
+ </template>
109
+
110
+ <template v-if="fortalezasCounts.rival > 0">
111
+ <div v-show="buildStepMap()[currentStep] === 'fortalezasRival'" class="step-content">
112
+ <FortalezasView
113
+ key="fortalezas-rival"
114
+ v-model="selectedFortalezasRival"
115
+ team-initials="RIV"
116
+ :season-id="props.partido?.season_id"
117
+ :team-id="props.partido?.visita || props.partido?.visiting_team"
118
+ :rival-team-id="props.partido?.local || props.partido?.home_team"
119
+ :game-id="props.partido?.game_id || props.partido?.id"
120
+ :token="props.token"
121
+ title="Fortalezas a favor del rival"
122
+ :total-fortalezas="fortalezasCounts.rival"
123
+ ref="fortalezasRivalRef"
124
+ />
125
+ </div>
126
+ </template>
127
+
128
+ <div v-if="buildStepMap()[currentStep] === 'cornersEquipo'" class="step-content">
129
+ <TirosEsquinaView
130
+ v-model="selectedCornersEquipo"
131
+ :rival="false"
132
+ team-initials="AME"
133
+ title="Tiros de esquina en contra de mi equipo"
134
+ team-logo-url="https://golstatsimages.blob.core.windows.net/teams-80/2.png"
135
+ ref="cornersEquipoRef"
136
+ />
137
+ </div>
138
+
139
+ <div v-if="buildStepMap()[currentStep] === 'cornersRival'" class="step-content">
140
+ <TirosEsquinaView
141
+ v-model="selectedCornersRival"
142
+ :rival="true"
143
+ team-initials="RIV"
144
+ title="Tiros de esquina en contra del rival"
145
+ team-logo-url="https://golstatsimages.blob.core.windows.net/teams-80/1.png"
146
+ ref="cornersRivalRef"
147
+ />
148
+ </div>
149
+ </div>
150
+ <div class="header-separator"></div>
151
+ <div class="modal-footer">
152
+ <button class="back-btn" @click="goBack">
153
+ <svg
154
+ width="16"
155
+ height="16"
156
+ viewBox="0 0 16 16"
157
+ fill="none"
158
+ xmlns="http://www.w3.org/2000/svg"
159
+ >
160
+ <path
161
+ d="M10 12L6 8L10 4"
162
+ stroke="white"
163
+ stroke-width="2"
164
+ stroke-linecap="round"
165
+ stroke-linejoin="round"
166
+ />
167
+ </svg>
168
+ Regresar
169
+ </button>
170
+ <div class="footer-actions">
171
+ <button v-if="currentStep === 0" class="cancel-btn" @click="closeModal">Cancelar</button>
172
+ <button
173
+ v-if="currentStep === 1 || currentStep === 2"
174
+ class="cancel-btn"
175
+ @click="autocompletar"
176
+ >
177
+ Autocompletar
178
+ </button>
179
+ <button
180
+ class="next-btn"
181
+ :class="{ disabled: !canContinue }"
182
+ :disabled="!canContinue"
183
+ @click="continueToNext"
184
+ >
185
+ {{
186
+ currentStep === 0
187
+ ? fortalezasOption === 'automatico'
188
+ ? 'Finalizar'
189
+ : 'Siguiente'
190
+ : currentStep === totalSteps
191
+ ? 'Finalizar'
192
+ : 'Siguiente'
193
+ }}
194
+ </button>
195
+ </div>
196
+ </div>
197
+ </div>
198
+ </div>
199
+
200
+ <!-- Modal de confirmación para regresar al paso 0 -->
201
+ <div v-if="showConfirmDialog" class="modal-overlay" @click.self="cancelGoBack">
202
+ <div class="modal-content confirm-dialog">
203
+ <div class="modal-header">
204
+ <div class="header-left">
205
+ <span class="modal-title">Confirmación</span>
206
+ </div>
207
+ </div>
208
+ <div class="header-separator"></div>
209
+ <div class="modal-body">
210
+ <div class="step-content">
211
+ <h3 class="confirm-dialog-title">¿Estás seguro de regresar?</h3>
212
+ <p class="confirm-dialog-message">Se perderá la información seleccionada</p>
213
+ </div>
214
+ </div>
215
+ <div class="modal-footer">
216
+ <div class="footer-actions">
217
+ <button class="cancel-btn" @click="cancelGoBack">Cancelar</button>
218
+ <button class="next-btn" @click="confirmGoBackToStep0">Confirmar</button>
219
+ </div>
220
+ </div>
221
+ </div>
222
+ </div>
223
+ </template>
224
+
225
+ <script setup>
226
+ import { ref, defineEmits, computed, nextTick } from 'vue'
227
+ import FortalezasView from './FortalezasView.vue'
228
+ import TirosEsquinaView from './TirosEsquinaView.vue'
229
+
230
+ const emit = defineEmits(['close', 'back', 'next'])
231
+
232
+ // Props para controlar el número de pasos
233
+ const props = defineProps({
234
+ hasRival: {
235
+ type: Boolean,
236
+ default: true,
237
+ },
238
+ token: {
239
+ type: String,
240
+ required: true,
241
+ },
242
+ template: {
243
+ type: Object,
244
+ required: false,
245
+ default: null,
246
+ },
247
+ team: {
248
+ type: Number,
249
+ required: false,
250
+ default: null,
251
+ },
252
+ partido: {
253
+ type: Object,
254
+ required: false,
255
+ default: null,
256
+ },
257
+ })
258
+
259
+ // Función para verificar si existe un componente Fortalezas en el template
260
+ function tieneComponenteFortalezas() {
261
+ if (!props.template || !props.template.pages) {
262
+ return false
263
+ }
264
+
265
+ // Iterar sobre todas las pages del template
266
+ for (const page of props.template.pages) {
267
+ // Verificar si la page tiene components
268
+ if (page.components && Array.isArray(page.components)) {
269
+ // Buscar si existe algún componente con name === 'Fortalezas' o id === 15
270
+ const tieneFortalezas = page.components.some(
271
+ (component) =>
272
+ component.title === 'Fortalezas' ||
273
+ component.id === 15 ||
274
+ component.componentName === 'GSCStrengths',
275
+ )
276
+ if (tieneFortalezas) {
277
+ return true
278
+ }
279
+ }
280
+ }
281
+
282
+ return false
283
+ }
284
+
285
+ // Función para contar Fortalezas del equipo propio y del rival
286
+ function contarFortalezas() {
287
+ console.log(
288
+ '5555555555555555 Nuevo Valor al crear fortalezas:: : : :: : : : :: : : :',
289
+ props.template,
290
+ )
291
+ if (!props.template || !props.template.pages) {
292
+ return { equipo: 0, rival: 0, total: 0 }
293
+ }
294
+ console.log('Nuevo Valor al crear fortalezas:: : : :: : : : :: : : :', props.template)
295
+
296
+ let countEquipo = 0
297
+ let countRival = 0
298
+
299
+ // Iterar sobre todas las pages del template
300
+ for (const page of props.template.pages) {
301
+ console.log('page 11 5555555555555555555555555555555555 ', page)
302
+ // Verificar si la page tiene components
303
+ if (page.components && Array.isArray(page.components)) {
304
+ console.log('page entro')
305
+ // Filtrar componentes Fortalezas
306
+ const componentesFortalezas = page.components.filter(
307
+ (component) =>
308
+ component.componentName === 'GSCStrengths' ||
309
+ component.id === 15 ||
310
+ component.name === 'Fortalezas',
311
+ )
312
+ console.log(
313
+ 'componentesFortalezas componentesFortalezas componentesFortalezas',
314
+ componentesFortalezas,
315
+ )
316
+ // Para cada componente Fortalezas, verificar dynamicFilters
317
+ for (const component of componentesFortalezas) {
318
+ // Verificar si tiene dynamicFilters y es un array
319
+ if (component.dynamicFilters && Array.isArray(component.dynamicFilters)) {
320
+ // Verificar la posición 1 (que es un array)
321
+ if (component.dynamicFilters[1]) {
322
+ // Consultar la posición 0 para determinar si es equipo propio (1) o rival (2)
323
+ if (component.dynamicFilters[0] === 1) {
324
+ countEquipo += component.dynamicFilters[1]
325
+ } else if (component.dynamicFilters[0] === 2) {
326
+ countRival += component.dynamicFilters[1]
327
+ } else {
328
+ if (component.dynamicFilters[0] === 3) {
329
+ if (component.filterMultiple.isHomeTeam) {
330
+ countEquipo += component.dynamicFilters[1]
331
+ } else {
332
+ countRival += component.dynamicFilters[1]
333
+ }
334
+ }
335
+ }
336
+ }
337
+ }
338
+ }
339
+ }
340
+ }
341
+ console.log('CONTADOR FINAL DE FORTALEZAS: ', {
342
+ equipo: countEquipo,
343
+ rival: countRival,
344
+ total: countEquipo + countRival,
345
+ })
346
+ return {
347
+ equipo: countEquipo,
348
+ rival: countRival,
349
+ total: countEquipo + countRival,
350
+ }
351
+ }
352
+
353
+ // Computed para verificar si tiene Fortalezas
354
+ const hasFortalezas = computed(() => tieneComponenteFortalezas())
355
+
356
+ // Computed para obtener los conteos de Fortalezas
357
+ const fortalezasCounts = computed(() => contarFortalezas())
358
+
359
+ // const hasCorners = false // OCULTO POR EL MOMENTO
360
+ // Estado del modal
361
+ const currentStep = ref(0) // 0 = configuración inicial, luego pasos dinámicos
362
+ const isTransitioning = ref(false)
363
+
364
+ // Modal de confirmación para regresar al paso 0
365
+ const showConfirmDialog = ref(false)
366
+
367
+ // Opciones seleccionadas para cada sección
368
+ const fortalezasOption = ref('manual')
369
+ const tirosEsquinaOption = ref('manual')
370
+
371
+ // Selecciones por vista
372
+ const selectedFortalezasEquipo = ref([])
373
+ const selectedFortalezasRival = ref([])
374
+ const selectedCornersEquipo = ref([])
375
+ const selectedCornersRival = ref([])
376
+
377
+ // Calcular el número total de pasos
378
+ const totalSteps = computed(() => {
379
+ let steps = 0
380
+
381
+ // Pasos de Fortalezas
382
+ if (hasFortalezas.value && fortalezasOption.value === 'manual') {
383
+ // Si hay fortalezas de equipo, agregar paso 1
384
+ if (fortalezasCounts.value.equipo > 0) {
385
+ steps += 1
386
+ }
387
+ // Si hay fortalezas de rival, agregar paso (será 2 si hay equipo, 1 si no hay)
388
+ if (fortalezasCounts.value.rival > 0) {
389
+ steps += 1
390
+ }
391
+ }
392
+
393
+ // Pasos de Tiros de esquina - OCULTOS POR EL MOMENTO
394
+ // if (tirosEsquinaOption.value === 'manual') {
395
+ // steps += props.hasRival ? 2 : 1
396
+ // }
397
+
398
+ return Math.max(steps, 1)
399
+ })
400
+
401
+ // Verificar si se puede continuar al siguiente paso
402
+ const canContinue = computed(() => {
403
+ if (currentStep.value === 0) {
404
+ // Si no hay Fortalezas, no se puede continuar (tirosEsquina está oculto)
405
+ if (!hasFortalezas.value) {
406
+ return false
407
+ }
408
+ // Puede continuar si está en automático o en manual
409
+ return fortalezasOption.value === 'automatico' || fortalezasOption.value === 'manual'
410
+ }
411
+ const stepMap = buildStepMap()
412
+ const key = stepMap[currentStep.value]
413
+
414
+ if (key === 'fortalezasEquipo') {
415
+ const ref = fortalezasEquipoRef.value
416
+ if (!ref) return false
417
+ const selected = selectedFortalezasEquipo.value.length
418
+ const totalRequerido = fortalezasCounts.value.equipo
419
+ // Obtener el total de fortalezas disponibles del componente
420
+ const totalDisponibles = ref.fortalezasData?.length || 0
421
+
422
+ // Puede continuar si:
423
+ // 1. Selecciona el total exacto requerido
424
+ // 2. O si no hay suficientes disponibles, selecciona todos los disponibles
425
+ return (
426
+ selected === totalRequerido ||
427
+ (totalDisponibles > 0 && totalDisponibles < totalRequerido && selected === totalDisponibles)
428
+ )
429
+ }
430
+
431
+ if (key === 'fortalezasRival') {
432
+ const ref = fortalezasRivalRef.value
433
+ if (!ref) return false
434
+ const selected = selectedFortalezasRival.value.length
435
+ const totalRequerido = fortalezasCounts.value.rival
436
+ // Obtener el total de fortalezas disponibles del componente
437
+ const totalDisponibles = ref.fortalezasData?.length || 0
438
+
439
+ // Puede continuar si:
440
+ // 1. Selecciona el total exacto requerido
441
+ // 2. O si no hay suficientes disponibles, selecciona todos los disponibles
442
+ return (
443
+ selected === totalRequerido ||
444
+ (totalDisponibles > 0 && totalDisponibles < totalRequerido && selected === totalDisponibles)
445
+ )
446
+ }
447
+
448
+ // Pasos de corners ocultos
449
+ // if (key === 'cornersEquipo') return selectedCornersEquipo.value.length > 0
450
+ // if (key === 'cornersRival') return selectedCornersRival.value.length > 0
451
+ return false
452
+ })
453
+
454
+ function buildStepMap() {
455
+ const order = []
456
+
457
+ // Solo agregar pasos de Fortalezas si existen en el template y está en modo manual
458
+ if (hasFortalezas.value && fortalezasOption.value === 'manual') {
459
+ // Si hay fortalezas de equipo, agregar paso de equipo
460
+ if (fortalezasCounts.value.equipo > 0) {
461
+ order.push('fortalezasEquipo')
462
+ }
463
+ // Si hay fortalezas de rival, agregar paso de rival
464
+ if (fortalezasCounts.value.rival > 0) {
465
+ order.push('fortalezasRival')
466
+ }
467
+ }
468
+
469
+ // Pasos de Tiros de esquina - OCULTOS POR EL MOMENTO
470
+ // if (tirosEsquinaOption.value === 'manual') {
471
+ // order.push('cornersEquipo')
472
+ // if (props.hasRival) order.push('cornersRival')
473
+ // }
474
+
475
+ const map = {}
476
+ order.forEach((k, idx) => {
477
+ map[idx + 1] = k // pasos empiezan en 1
478
+ })
479
+ return map
480
+ }
481
+
482
+ // Referencias a los componentes
483
+ const fortalezasEquipoRef = ref(null)
484
+ const fortalezasRivalRef = ref(null)
485
+ const cornersEquipoRef = ref(null)
486
+ const cornersRivalRef = ref(null)
487
+
488
+ function closeModal() {
489
+ emit('close')
490
+ }
491
+
492
+ function goBack() {
493
+ if (currentStep.value > 1) {
494
+ // Si estamos en paso 2 o superior, solo regresar sin borrar selecciones
495
+ currentStep.value--
496
+ } else if (currentStep.value === 1) {
497
+ // Si estamos en paso 1 y vamos al paso 0, mostrar modal de confirmación
498
+ // Verificar si hay selecciones antes de mostrar el modal
499
+ const tieneSelecciones =
500
+ selectedFortalezasEquipo.value.length > 0 || selectedFortalezasRival.value.length > 0
501
+
502
+ if (tieneSelecciones) {
503
+ showConfirmDialog.value = true
504
+ } else {
505
+ // Si no hay selecciones, regresar directamente
506
+ currentStep.value--
507
+ }
508
+ } else {
509
+ // Si estamos en paso 0, emitir evento back
510
+ emit('back')
511
+ }
512
+ }
513
+
514
+ function confirmGoBackToStep0() {
515
+ // Limpiar todas las selecciones
516
+ selectedFortalezasEquipo.value = []
517
+ selectedFortalezasRival.value = []
518
+ selectedCornersEquipo.value = []
519
+ selectedCornersRival.value = []
520
+
521
+ // Cerrar el modal de confirmación
522
+ showConfirmDialog.value = false
523
+
524
+ // Regresar al paso 0
525
+ currentStep.value--
526
+ }
527
+
528
+ function cancelGoBack() {
529
+ // Cerrar el modal de confirmación sin hacer nada
530
+ showConfirmDialog.value = false
531
+ }
532
+
533
+ async function continueToNext() {
534
+ if (currentStep.value === 0) {
535
+ // Validar que al menos una opción esté seleccionada
536
+ if (!canContinue.value) {
537
+ return
538
+ }
539
+
540
+ // Si está en automático, finalizar directamente sin construir payload
541
+ if (fortalezasOption.value === 'automatico') {
542
+ // Emitir evento sin payload de strengths (se generarán automáticamente)
543
+ emit('next', {
544
+ fortalezas: fortalezasOption.value,
545
+ tirosEsquina: tirosEsquinaOption.value,
546
+ selectedFortalezasEquipo: [],
547
+ selectedFortalezasRival: [],
548
+ strengthsPayload: {}, // Payload vacío para modo automático
549
+ })
550
+ return
551
+ }
552
+
553
+ // Si es manual, avanzar al siguiente paso
554
+ // Animar transición
555
+ isTransitioning.value = true
556
+ setTimeout(() => {
557
+ currentStep.value++
558
+ isTransitioning.value = false
559
+ }, 300)
560
+ } else if (currentStep.value < totalSteps.value) {
561
+ // Avanzar al siguiente paso
562
+ isTransitioning.value = true
563
+ setTimeout(() => {
564
+ currentStep.value++
565
+ isTransitioning.value = false
566
+ }, 300)
567
+ } else {
568
+ // Esperar un tick para asegurar que los refs estén disponibles
569
+ await nextTick()
570
+
571
+ // Construir el payload de fortalezas antes de emitir
572
+ const strengthsPayload = buildStrengthsPayload()
573
+ console.log('Estructura de strengths emitida:', JSON.stringify(strengthsPayload, null, 2))
574
+
575
+ // Emitir evento con las opciones seleccionadas y el payload de fortalezas
576
+ emit('next', {
577
+ fortalezas: fortalezasOption.value,
578
+ tirosEsquina: tirosEsquinaOption.value,
579
+ selectedFortalezasEquipo: selectedFortalezasEquipo.value,
580
+ selectedFortalezasRival: selectedFortalezasRival.value,
581
+ strengthsPayload,
582
+ })
583
+ }
584
+ }
585
+
586
+ // Función para construir el payload de fortalezas según la estructura requerida
587
+ function buildStrengthsPayload() {
588
+ console.log('=== INICIANDO buildStrengthsPayload ===')
589
+ console.log('Template:', props.template)
590
+ console.log('Template pages:', props.template?.pages)
591
+
592
+ if (!props.template || !props.template.pages) {
593
+ console.warn('No hay template o pages')
594
+ return {}
595
+ }
596
+
597
+ const payload = {}
598
+
599
+ console.log('selectedFortalezasEquipo:', selectedFortalezasEquipo.value)
600
+ console.log('selectedFortalezasRival:', selectedFortalezasRival.value)
601
+ console.log('fortalezasEquipoRef:', fortalezasEquipoRef.value)
602
+ console.log('fortalezasRivalRef:', fortalezasRivalRef.value)
603
+
604
+ // Verificar si los refs están disponibles
605
+ let equipoRef = fortalezasEquipoRef.value
606
+ let rivalRef = fortalezasRivalRef.value
607
+
608
+ // Debug detallado de los refs
609
+ if (equipoRef) {
610
+ console.log('equipoRef keys:', Object.keys(equipoRef))
611
+ console.log('equipoRef.fortalezasRawData:', equipoRef.fortalezasRawData)
612
+ console.log('equipoRef.fortalezasRawData type:', typeof equipoRef.fortalezasRawData)
613
+
614
+ // Verificar si es un ref (tiene .value)
615
+ let rawDataEquipo = equipoRef.fortalezasRawData
616
+ if (rawDataEquipo && typeof rawDataEquipo === 'object' && 'value' in rawDataEquipo) {
617
+ console.log('⚠️ fortalezasRawData es un ref, usando .value')
618
+ rawDataEquipo = rawDataEquipo.value
619
+ }
620
+
621
+ console.log('rawDataEquipo después de verificar ref:', rawDataEquipo)
622
+ console.log('rawDataEquipo is array:', Array.isArray(rawDataEquipo))
623
+ if (Array.isArray(rawDataEquipo)) {
624
+ console.log('rawDataEquipo length:', rawDataEquipo.length)
625
+ if (rawDataEquipo.length > 0) {
626
+ console.log('Primer elemento equipoRef:', rawDataEquipo[0])
627
+ }
628
+ }
629
+ } else {
630
+ console.error('❌ equipoRef NO está disponible')
631
+ }
632
+
633
+ if (rivalRef) {
634
+ console.log('rivalRef keys:', Object.keys(rivalRef))
635
+ console.log('rivalRef.fortalezasRawData:', rivalRef.fortalezasRawData)
636
+ console.log('rivalRef.fortalezasRawData type:', typeof rivalRef.fortalezasRawData)
637
+
638
+ // Verificar si es un ref (tiene .value)
639
+ let rawDataRival = rivalRef.fortalezasRawData
640
+ if (rawDataRival && typeof rawDataRival === 'object' && 'value' in rawDataRival) {
641
+ console.log('⚠️ fortalezasRawData es un ref, usando .value')
642
+ rawDataRival = rawDataRival.value
643
+ }
644
+
645
+ console.log('rawDataRival después de verificar ref:', rawDataRival)
646
+ console.log('rawDataRival is array:', Array.isArray(rawDataRival))
647
+ if (Array.isArray(rawDataRival)) {
648
+ console.log('rawDataRival length:', rawDataRival.length)
649
+ if (rawDataRival.length > 0) {
650
+ console.log('Primer elemento rivalRef:', rawDataRival[0])
651
+ }
652
+ }
653
+ } else {
654
+ console.error('❌ rivalRef NO está disponible')
655
+ }
656
+
657
+ // Si los refs no están disponibles, podría ser que los componentes estén ocultos con v-show
658
+ if (!equipoRef && selectedFortalezasEquipo.value.length > 0) {
659
+ console.warn('⚠️ Ref de equipo no disponible, pero hay selecciones')
660
+ }
661
+ if (!rivalRef && selectedFortalezasRival.value.length > 0) {
662
+ console.warn('⚠️ Ref de rival no disponible, pero hay selecciones')
663
+ }
664
+
665
+ // Obtener todas las fortalezas seleccionadas ordenadas por su orden de selección
666
+ const fortalezasEquipoOrdenadas = getOrderedStrengths(selectedFortalezasEquipo.value, equipoRef)
667
+ const fortalezasRivalOrdenadas = getOrderedStrengths(selectedFortalezasRival.value, rivalRef)
668
+
669
+ console.log('fortalezasEquipoOrdenadas:', fortalezasEquipoOrdenadas)
670
+ console.log('fortalezasRivalOrdenadas:', fortalezasRivalOrdenadas)
671
+
672
+ // Contadores para rastrear qué fortalezas ya se han asignado
673
+ let indexEquipo = 0
674
+ let indexRival = 0
675
+
676
+ // Iterar sobre todas las páginas del template
677
+ props.template.pages.forEach((page, pageIndex) => {
678
+ const pageNumber = pageIndex + 1 // Los índices de página empiezan en 1
679
+ console.log(`\n=== Página ${pageNumber} ===`)
680
+ console.log('Page components:', page.components)
681
+
682
+ // Verificar si la página tiene components
683
+ if (page.components && Array.isArray(page.components)) {
684
+ // Buscar componentes Fortalezas - usar la misma condición que en contarFortalezas
685
+ page.components.forEach((component, componentIndex) => {
686
+ const esComponenteFortalezas =
687
+ component.componentName === 'GSCStrengths' ||
688
+ component.id === 15 ||
689
+ component.name === 'Fortalezas' ||
690
+ component.title === 'Fortalezas'
691
+
692
+ if (esComponenteFortalezas) {
693
+ const componentNumber = componentIndex + 1 // Los índices de componente empiezan en 1
694
+ console.log(
695
+ `\n--- Componente ${componentNumber} (Fortalezas) en página ${pageNumber} ---`,
696
+ )
697
+ console.log('Component:', component)
698
+ console.log('Component properties:', {
699
+ name: component.name,
700
+ title: component.title,
701
+ componentName: component.componentName,
702
+ id: component.id,
703
+ })
704
+ console.log('dynamicFilters:', component.dynamicFilters)
705
+
706
+ // Verificar dynamicFilters para determinar tipo y cantidad
707
+ if (component.dynamicFilters && Array.isArray(component.dynamicFilters)) {
708
+ const teamType = component.dynamicFilters[0] // 1 = equipo, 2 = rival, 3 = dinámico
709
+ const cantidadRequerida = component.dynamicFilters[1] || 0 // Cantidad de fortalezas necesarias
710
+
711
+ console.log(
712
+ `Tipo: ${teamType === 1 ? 'Equipo' : teamType === 2 ? 'Rival' : 'Dinámico (3)'}, Cantidad requerida: ${cantidadRequerida}`,
713
+ )
714
+
715
+ // Obtener las fortalezas según el tipo
716
+ let fortalezasAsignar = []
717
+ let fortalezasOrdenadas = []
718
+ let teamId = props.team
719
+
720
+ if (teamType === 1) {
721
+ // Fortalezas de equipo
722
+ fortalezasOrdenadas = fortalezasEquipoOrdenadas
723
+ console.log(
724
+ `Equipo: Total ordenadas=${fortalezasOrdenadas.length}, index=${indexEquipo}, cantidad requerida=${cantidadRequerida}`,
725
+ )
726
+ // Tomar las siguientes N fortalezas (donde N = cantidadRequerida)
727
+ if (fortalezasOrdenadas.length > indexEquipo) {
728
+ fortalezasAsignar = fortalezasOrdenadas.slice(
729
+ indexEquipo,
730
+ indexEquipo + cantidadRequerida,
731
+ )
732
+ console.log(
733
+ `Index equipo: ${indexEquipo}, tomando ${fortalezasAsignar.length} fortalezas de ${fortalezasOrdenadas.length} disponibles`,
734
+ )
735
+ } else {
736
+ console.warn(
737
+ `No hay suficientes fortalezas de equipo. Disponibles: ${fortalezasOrdenadas.length}, Necesarias desde índice: ${indexEquipo}`,
738
+ )
739
+ }
740
+ indexEquipo += cantidadRequerida
741
+ teamId = props.partido?.local || props.partido?.home_team || props.team
742
+ } else if (teamType === 2) {
743
+ // Fortalezas de rival
744
+ fortalezasOrdenadas = fortalezasRivalOrdenadas
745
+ console.log(
746
+ `Rival: Total ordenadas=${fortalezasOrdenadas.length}, index=${indexRival}, cantidad requerida=${cantidadRequerida}`,
747
+ )
748
+ // Tomar las siguientes N fortalezas (donde N = cantidadRequerida)
749
+ if (fortalezasOrdenadas.length > indexRival) {
750
+ fortalezasAsignar = fortalezasOrdenadas.slice(
751
+ indexRival,
752
+ indexRival + cantidadRequerida,
753
+ )
754
+ console.log(
755
+ `Index rival: ${indexRival}, tomando ${fortalezasAsignar.length} fortalezas de ${fortalezasOrdenadas.length} disponibles`,
756
+ )
757
+ } else {
758
+ console.warn(
759
+ `No hay suficientes fortalezas de rival. Disponibles: ${fortalezasOrdenadas.length}, Necesarias desde índice: ${indexRival}`,
760
+ )
761
+ }
762
+ indexRival += cantidadRequerida
763
+ teamId = props.partido?.visita || props.partido?.visiting_team
764
+ } else if (teamType === 3) {
765
+ // Tipo dinámico: depende de filterMultiple.isHomeTeam
766
+ if (component.filterMultiple && component.filterMultiple.isHomeTeam) {
767
+ // Es equipo
768
+ fortalezasOrdenadas = fortalezasEquipoOrdenadas
769
+ console.log(
770
+ `Dinámico (Equipo): Total ordenadas=${fortalezasOrdenadas.length}, index=${indexEquipo}, cantidad requerida=${cantidadRequerida}`,
771
+ )
772
+ if (fortalezasOrdenadas.length > indexEquipo) {
773
+ fortalezasAsignar = fortalezasOrdenadas.slice(
774
+ indexEquipo,
775
+ indexEquipo + cantidadRequerida,
776
+ )
777
+ console.log(
778
+ `Index equipo: ${indexEquipo}, tomando ${fortalezasAsignar.length} fortalezas de ${fortalezasOrdenadas.length} disponibles`,
779
+ )
780
+ } else {
781
+ console.warn(
782
+ `No hay suficientes fortalezas de equipo. Disponibles: ${fortalezasOrdenadas.length}, Necesarias desde índice: ${indexEquipo}`,
783
+ )
784
+ }
785
+ indexEquipo += cantidadRequerida
786
+ teamId = props.partido?.local || props.partido?.home_team || props.team
787
+ } else {
788
+ // Es rival
789
+ fortalezasOrdenadas = fortalezasRivalOrdenadas
790
+ console.log(
791
+ `Dinámico (Rival): Total ordenadas=${fortalezasOrdenadas.length}, index=${indexRival}, cantidad requerida=${cantidadRequerida}`,
792
+ )
793
+ if (fortalezasOrdenadas.length > indexRival) {
794
+ fortalezasAsignar = fortalezasOrdenadas.slice(
795
+ indexRival,
796
+ indexRival + cantidadRequerida,
797
+ )
798
+ console.log(
799
+ `Index rival: ${indexRival}, tomando ${fortalezasAsignar.length} fortalezas de ${fortalezasOrdenadas.length} disponibles`,
800
+ )
801
+ } else {
802
+ console.warn(
803
+ `No hay suficientes fortalezas de rival. Disponibles: ${fortalezasOrdenadas.length}, Necesarias desde índice: ${indexRival}`,
804
+ )
805
+ }
806
+ indexRival += cantidadRequerida
807
+ teamId = props.partido?.visita || props.partido?.visiting_team
808
+ }
809
+ }
810
+
811
+ console.log('fortalezasAsignar:', fortalezasAsignar)
812
+
813
+ // Si hay fortalezas para asignar, agregarlas al payload
814
+ if (fortalezasAsignar.length > 0) {
815
+ // Inicializar la estructura si no existe
816
+ if (!payload[pageNumber]) {
817
+ payload[pageNumber] = {}
818
+ }
819
+ if (!payload[pageNumber][componentNumber]) {
820
+ payload[pageNumber][componentNumber] = []
821
+ }
822
+
823
+ // Agregar las fortalezas con su información completa
824
+ fortalezasAsignar.forEach((strength, index) => {
825
+ payload[pageNumber][componentNumber].push({
826
+ team_id: teamId,
827
+ ranking_type: strength.ranking_type || 1,
828
+ precondition_id: strength.precondition_id || null,
829
+ order: index + 1,
830
+ name: strength.name,
831
+ category_type: strength.category_type || 1,
832
+ total: strength.total || 0,
833
+ is_relevant: strength.is_relevant || 0,
834
+ league_ranking: strength.league_ranking || 0,
835
+ categories: Array.isArray(strength.categories)
836
+ ? strength.categories
837
+ : [strength.categories],
838
+ team_contribution: strength.team_contribution || 0,
839
+ })
840
+ })
841
+ console.log(
842
+ `✓ Agregadas ${fortalezasAsignar.length} fortalezas al payload para componente ${componentNumber} en página ${pageNumber}`,
843
+ )
844
+ console.log(
845
+ `Payload actual para página ${pageNumber}:`,
846
+ JSON.stringify(payload[pageNumber], null, 2),
847
+ )
848
+ } else {
849
+ console.warn(
850
+ `⚠️ No hay fortalezas para asignar al componente ${componentNumber} en página ${pageNumber}. IndexEquipo: ${indexEquipo}, IndexRival: ${indexRival}`,
851
+ )
852
+ }
853
+ } else {
854
+ console.warn(
855
+ `⚠️ Componente ${componentIndex + 1} en página ${pageNumber} no tiene dynamicFilters válido`,
856
+ )
857
+ console.warn('Component:', component)
858
+ }
859
+ }
860
+ })
861
+ console.log(
862
+ `\n✓ Página ${pageNumber} procesada. Componentes de Fortalezas encontrados y procesados.`,
863
+ )
864
+ }
865
+ })
866
+
867
+ console.log('\n=== PAYLOAD FINAL ===')
868
+ console.log(JSON.stringify(payload, null, 2))
869
+ return payload
870
+ }
871
+
872
+ // Función auxiliar para obtener las fortalezas en el mismo orden que fueron seleccionadas
873
+ // Los IDs ya vienen en el orden correcto, solo necesitamos obtener los objetos completos
874
+ function getOrderedStrengths(selectedIds, fortalezasViewRef) {
875
+ console.log('=== getOrderedStrengths INICIO ===')
876
+ console.log('selectedIds (orden de selección):', selectedIds)
877
+ console.log('fortalezasViewRef existe?:', !!fortalezasViewRef)
878
+
879
+ if (!selectedIds || selectedIds.length === 0) {
880
+ console.warn('No hay IDs seleccionados')
881
+ return []
882
+ }
883
+
884
+ if (!fortalezasViewRef) {
885
+ console.warn('Ref no disponible')
886
+ return []
887
+ }
888
+
889
+ // Obtener fortalezasRawData, verificando si es un ref
890
+ let fortalezasRawData = fortalezasViewRef.fortalezasRawData
891
+ if (!fortalezasRawData) {
892
+ console.warn('fortalezasRawData no está disponible en el ref')
893
+ return []
894
+ }
895
+
896
+ // Si es un ref, acceder a su .value
897
+ if (fortalezasRawData && typeof fortalezasRawData === 'object' && 'value' in fortalezasRawData) {
898
+ console.log('⚠️ fortalezasRawData es un ref, accediendo a .value')
899
+ fortalezasRawData = fortalezasRawData.value
900
+ }
901
+
902
+ if (!Array.isArray(fortalezasRawData)) {
903
+ console.warn('fortalezasRawData no es un array:', typeof fortalezasRawData, fortalezasRawData)
904
+ return []
905
+ }
906
+
907
+ if (fortalezasRawData.length === 0) {
908
+ console.warn('fortalezasRawData está vacío')
909
+ return []
910
+ }
911
+
912
+ console.log('fortalezasRawData length:', fortalezasRawData.length)
913
+ console.log('Primeras 2 fortalezas raw:', fortalezasRawData.slice(0, 2))
914
+
915
+ // Obtener las fortalezas en el mismo orden que fueron seleccionadas (sin reordenar)
916
+ // El orden ya está dado por selectedIds, solo necesitamos buscar y devolver el objeto completo
917
+ const selectedStrengths = selectedIds
918
+ .map((id) => {
919
+ console.log(`Buscando ID: ${id} (tipo: ${typeof id})`)
920
+
921
+ // Buscar en los datos raw por categories (que es el id que usamos)
922
+ const strength = fortalezasRawData.find((item) => {
923
+ // Comparar tanto como número como string
924
+ const match =
925
+ item.categories === id ||
926
+ item.categories === Number(id) ||
927
+ String(item.categories) === String(id)
928
+ if (!match && fortalezasRawData.indexOf(item) < 3) {
929
+ console.log(
930
+ ` Comparando: item.categories=${item.categories} (${typeof item.categories}) vs id=${id} (${typeof id})`,
931
+ )
932
+ }
933
+ return match
934
+ })
935
+
936
+ if (strength) {
937
+ console.log(`✓ Encontrada: ${strength.name} (categories: ${strength.categories})`)
938
+ return strength
939
+ }
940
+
941
+ console.warn(`✗ No encontrada con categories = ${id}, intentando por id`)
942
+ // Intentar buscar también por id si categories no funciona
943
+ const strengthById = fortalezasRawData.find(
944
+ (item) => item.id === id || item.id === Number(id) || String(item.id) === String(id),
945
+ )
946
+ if (strengthById) {
947
+ console.log(`✓ Encontrada por id: ${strengthById.name}`)
948
+ return strengthById
949
+ }
950
+
951
+ console.error(`✗✗ No se encontró fortaleza con id/categories = ${id}`)
952
+ return null
953
+ })
954
+ .filter(Boolean) // Filtrar los que no se encontraron
955
+
956
+ console.log(
957
+ `selectedStrengths (${selectedStrengths.length} de ${selectedIds.length} encontradas):`,
958
+ selectedStrengths,
959
+ )
960
+ console.log('=== getOrderedStrengths FIN ===')
961
+ return selectedStrengths
962
+ }
963
+
964
+ function autocompletar() {
965
+ const stepMap = buildStepMap()
966
+ const key = stepMap[currentStep.value]
967
+ if (key === 'fortalezasEquipo' && fortalezasEquipoRef.value)
968
+ return fortalezasEquipoRef.value.autocompletar()
969
+ if (key === 'fortalezasRival' && fortalezasRivalRef.value)
970
+ return fortalezasRivalRef.value.autocompletar()
971
+ if (key === 'cornersEquipo' && cornersEquipoRef.value)
972
+ return cornersEquipoRef.value.autocompletar()
973
+ if (key === 'cornersRival' && cornersRivalRef.value) return cornersRivalRef.value.autocompletar()
974
+ }
975
+ </script>
976
+
977
+ <style scoped>
978
+ .modal-overlay {
979
+ position: fixed;
980
+ top: 0;
981
+ left: 0;
982
+ width: 100vw;
983
+ height: 100vh;
984
+ background: rgba(0, 0, 0, 0.45);
985
+ display: flex;
986
+ align-items: center;
987
+ justify-content: center;
988
+ z-index: 3300;
989
+ }
990
+
991
+ .modal-content {
992
+ width: 464px;
993
+ background: #2e3b46;
994
+ border-radius: 10px;
995
+ box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.18);
996
+ padding: 0;
997
+ position: relative;
998
+ display: flex;
999
+ flex-direction: column;
1000
+ font-family: 'Poppins-Medium', 'Montserrat', sans-serif;
1001
+ }
1002
+
1003
+ /* Estilos del botón de cerrar removidos */
1004
+
1005
+ .header-separator {
1006
+ width: 100%;
1007
+ height: 1px;
1008
+ border-bottom: dashed 1px #58626b;
1009
+ margin: 12px 0 0 0;
1010
+ }
1011
+
1012
+ .modal-header {
1013
+ display: flex;
1014
+ align-items: center;
1015
+ justify-content: space-between;
1016
+ padding: 20px 24px 0 24px;
1017
+ }
1018
+
1019
+ .header-left {
1020
+ display: flex;
1021
+ align-items: center;
1022
+ gap: 8px;
1023
+ }
1024
+
1025
+ .step-counter {
1026
+ font-family: Poppins-Medium;
1027
+ font-size: 12px;
1028
+ font-weight: 500;
1029
+ color: rgba(255, 255, 255, 0.7);
1030
+ }
1031
+
1032
+ .icon-title {
1033
+ width: 16px;
1034
+ height: 16px;
1035
+ }
1036
+
1037
+ .modal-title {
1038
+ font-family: Poppins-Medium;
1039
+ font-size: 14px;
1040
+ font-weight: 500;
1041
+ font-stretch: normal;
1042
+ font-style: normal;
1043
+ line-height: 1.5;
1044
+ letter-spacing: normal;
1045
+ text-align: left;
1046
+ color: #fff;
1047
+ }
1048
+
1049
+ .prepartido-text {
1050
+ font-family: 'Poppins-Regular', 'BebasNeue', sans-serif;
1051
+ font-weight: 400;
1052
+ opacity: 0.7;
1053
+ letter-spacing: 1px;
1054
+ }
1055
+
1056
+ .modal-body {
1057
+ flex: 1;
1058
+ display: flex;
1059
+ flex-direction: column;
1060
+ padding: 12px 24px 0 24px;
1061
+ margin-bottom: 17px;
1062
+ margin-top: 5px;
1063
+ gap: 0;
1064
+ position: relative;
1065
+ overflow: hidden;
1066
+ }
1067
+
1068
+ .step-content {
1069
+ transition: transform 0.3s ease-in-out;
1070
+ }
1071
+
1072
+ .modal-body.transitioning .step-content {
1073
+ transform: translateX(-100%);
1074
+ }
1075
+
1076
+ .fortalezas-view {
1077
+ transform: translateX(100%);
1078
+ animation: slideIn 0.3s ease-in-out forwards;
1079
+ }
1080
+
1081
+ @keyframes slideIn {
1082
+ from {
1083
+ transform: translateX(100%);
1084
+ }
1085
+ to {
1086
+ transform: translateX(0);
1087
+ }
1088
+ }
1089
+
1090
+ .content-section {
1091
+ background: none;
1092
+ border: solid 1px rgba(255, 255, 255, 0.4);
1093
+ padding: 12px 20px 20px 20px;
1094
+ margin-bottom: 0;
1095
+ border-radius: 8px;
1096
+ }
1097
+
1098
+ .content-section:first-child {
1099
+ margin-bottom: 20px;
1100
+ }
1101
+
1102
+ .title-separator {
1103
+ width: 100%;
1104
+ height: 1px;
1105
+ border-top: 1px dashed rgba(255, 255, 255, 0.3);
1106
+ margin: 8px 0 12px 0;
1107
+ margin-left: -20px;
1108
+ margin-right: -20px;
1109
+ width: calc(100% + 40px);
1110
+ }
1111
+
1112
+ .content-separator {
1113
+ width: 100%;
1114
+ height: 1px;
1115
+ border-top: 1px dashed rgba(255, 255, 255, 0.3);
1116
+ margin: 12px 0 16px 0;
1117
+ margin-left: -20px;
1118
+ margin-right: -20px;
1119
+ width: calc(100% + 40px);
1120
+ }
1121
+
1122
+ .section-title {
1123
+ font-family: Poppins-Medium;
1124
+ font-size: 14px;
1125
+ font-weight: 600;
1126
+ opacity: 0.9;
1127
+ color: #fff;
1128
+ margin: 0 0 12px 0;
1129
+ }
1130
+
1131
+ .section-description {
1132
+ font-family: Poppins-Regular;
1133
+ font-size: 12px;
1134
+ line-height: 1.4;
1135
+ opacity: 0.7;
1136
+ color: #fff;
1137
+ margin: 0 0 13px 0;
1138
+ }
1139
+
1140
+ .radio-group {
1141
+ display: flex;
1142
+ gap: 24px;
1143
+ justify-content: center;
1144
+ }
1145
+
1146
+ .radio-option {
1147
+ display: flex;
1148
+ align-items: center;
1149
+ gap: 8px;
1150
+ cursor: pointer;
1151
+ user-select: none;
1152
+ }
1153
+
1154
+ .radio-option input[type='radio'] {
1155
+ display: none;
1156
+ }
1157
+
1158
+ .radio-custom {
1159
+ width: 20px;
1160
+ height: 20px;
1161
+ border: 1px solid #fff;
1162
+ border-radius: 50%;
1163
+ position: relative;
1164
+ transition: all 0.2s ease;
1165
+ flex-shrink: 0;
1166
+ }
1167
+
1168
+ .radio-option input[type='radio']:checked + .radio-custom {
1169
+ border-color: #fff; /* mantiene el aro blanco */
1170
+ background-color: transparent; /* sin relleno, solo punto central */
1171
+ }
1172
+
1173
+ .radio-option input[type='radio']:checked + .radio-custom::after {
1174
+ content: '';
1175
+ position: absolute;
1176
+ top: 50%;
1177
+ left: 50%;
1178
+ transform: translate(-50%, -50%);
1179
+ width: 10px;
1180
+ height: 10px;
1181
+ background-color: #cbee6b; /* punto verde */
1182
+ border-radius: 50%;
1183
+ }
1184
+
1185
+ /* Cuando el radio está seleccionado, la etiqueta pierde la opacidad */
1186
+ .radio-option input[type='radio']:checked + .radio-custom + .radio-label {
1187
+ opacity: 0.9;
1188
+ }
1189
+
1190
+ .radio-label {
1191
+ font-family: Poppins-Regular;
1192
+ font-size: 13px;
1193
+ color: #fff;
1194
+ opacity: 0.7;
1195
+ }
1196
+
1197
+ /* Estilos del separador removidos */
1198
+
1199
+ .modal-footer {
1200
+ display: flex;
1201
+ justify-content: space-between;
1202
+ align-items: center;
1203
+ padding: 0 24px 12px 24px;
1204
+ margin-top: 13px;
1205
+ }
1206
+
1207
+ .footer-actions {
1208
+ display: flex;
1209
+ align-items: center;
1210
+ }
1211
+
1212
+ .back-btn {
1213
+ background: none;
1214
+ border: none;
1215
+ color: #fff;
1216
+ font-size: 14px;
1217
+ font-family: Poppins-Medium;
1218
+ display: flex;
1219
+ align-items: center;
1220
+ gap: 4px;
1221
+ cursor: pointer;
1222
+ opacity: 0.7;
1223
+ padding: 8px 0;
1224
+ transition: opacity 0.2s;
1225
+ }
1226
+
1227
+ .back-btn:hover {
1228
+ opacity: 1;
1229
+ }
1230
+
1231
+ .cancel-btn {
1232
+ background: none;
1233
+ border: none;
1234
+ color: #b0bec5;
1235
+ font-size: 14.9px;
1236
+ font-family: Poppins-Medium;
1237
+ height: 30px;
1238
+ border-radius: 64px;
1239
+ display: flex;
1240
+ align-items: center;
1241
+ justify-content: center;
1242
+ cursor: pointer;
1243
+ padding: 0 18px;
1244
+ transition: color 0.2s;
1245
+ text-decoration: underline;
1246
+ }
1247
+
1248
+ .cancel-btn:hover {
1249
+ color: #fff;
1250
+ }
1251
+
1252
+ .next-btn {
1253
+ width: 107px;
1254
+ height: 30px;
1255
+ border-radius: 79.2px;
1256
+ -webkit-backdrop-filter: blur(19.8px);
1257
+ backdrop-filter: blur(19.8px);
1258
+ border: solid 1px #cbee6b;
1259
+ background-color: rgba(255, 255, 255, 0.06);
1260
+ font-family: Poppins-Medium;
1261
+ font-size: 14.9px;
1262
+ font-weight: 500;
1263
+ color: #fff;
1264
+ cursor: pointer;
1265
+ transition: background 0.2s;
1266
+ display: flex;
1267
+ align-items: center;
1268
+ justify-content: center;
1269
+ }
1270
+
1271
+ .next-btn:hover {
1272
+ background-color: rgba(255, 255, 255, 0.12);
1273
+ }
1274
+
1275
+ .next-btn.disabled {
1276
+ opacity: 0.5;
1277
+ cursor: not-allowed;
1278
+ }
1279
+
1280
+ .next-btn.disabled:hover {
1281
+ background-color: rgba(255, 255, 255, 0.06);
1282
+ }
1283
+
1284
+ /* Estilos para el modal de confirmación */
1285
+ .confirm-dialog {
1286
+ width: 380px;
1287
+ max-width: 90%;
1288
+ }
1289
+
1290
+ /* Asegurar que el overlay del modal de confirmación esté por encima del modal principal */
1291
+ .modal-overlay:has(.confirm-dialog) {
1292
+ z-index: 3400;
1293
+ }
1294
+
1295
+ .confirm-dialog .modal-header {
1296
+ justify-content: center;
1297
+ }
1298
+
1299
+ .confirm-dialog .modal-body {
1300
+ text-align: center;
1301
+ }
1302
+
1303
+ .confirm-dialog-title {
1304
+ font-family: Poppins-Medium;
1305
+ font-size: 16px;
1306
+ font-weight: 500;
1307
+ color: #fff;
1308
+ margin: 0 0 12px 0;
1309
+ text-align: center;
1310
+ }
1311
+
1312
+ .confirm-dialog-message {
1313
+ font-family: Poppins-Regular;
1314
+ font-size: 14px;
1315
+ color: rgba(255, 255, 255, 0.7);
1316
+ margin: 0;
1317
+ text-align: center;
1318
+ line-height: 1.5;
1319
+ }
1320
+
1321
+ .confirm-dialog .modal-footer {
1322
+ justify-content: center;
1323
+ }
1324
+
1325
+ .confirm-dialog .footer-actions {
1326
+ width: 100%;
1327
+ justify-content: center;
1328
+ gap: 12px;
1329
+ }
1330
+
1331
+ /* Estilos para la vista de fortalezas movidos al componente FortalezasView.vue */
1332
+ </style>