@golstats/gsc-reports 1.0.120 → 1.0.121
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.
- package/dist/{FilterConditions-55d68355-DMqzcKBO-CsToJXE0-B9blsVSq.js → FilterConditions-55d68355-DMqzcKBO-CsToJXE0-DpliHgxx.js} +1 -1
- package/dist/{FilterField-59a73e38-CNaE03Ge-BugbPWOu-DdkZwJgg.js → FilterField-59a73e38-CNaE03Ge-BugbPWOu-CpNSOLEJ.js} +1 -1
- package/dist/{FilterSubcategories-a9b32cc9-_h5FCZ4r-OIyEYwFv-BFq8O5Ms.js → FilterSubcategories-a9b32cc9-_h5FCZ4r-OIyEYwFv-1Nea8HbT.js} +1 -1
- package/dist/gsc-reports.css +1 -1
- package/dist/gsc-reports.es.js +1 -1
- package/dist/gsc-reports.umd.js +1 -1
- package/dist/{index-DINi_0hO.js → index-Bc9gf__q.js} +6 -6
- package/package.json +1 -1
- package/src/components/TemplatesSection.vue +1 -2
package/dist/gsc-reports.es.js
CHANGED
package/dist/gsc-reports.umd.js
CHANGED
|
@@ -7999,7 +7999,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
7999
7999
|
=== Página ${st} ===`),console.log("Page components:",ut.components),ut.components&&Array.isArray(ut.components)&&(ut.components.forEach((lt,Ot)=>{var Et,qt,Gt,Jt,Qt,lr,hr,$t;if(lt.componentName==="GSCStrengths"||lt.id===15||lt.name==="Fortalezas"||lt.title==="Fortalezas"){const Rt=Ot+1;if(console.log(`
|
|
8000
8000
|
--- Componente ${Rt} (Fortalezas) en página ${st} ---`),console.log("Component:",lt),console.log("Component properties:",{name:lt.name,title:lt.title,componentName:lt.componentName,id:lt.id}),console.log("dynamicFilters:",lt.dynamicFilters),lt.dynamicFilters&&Array.isArray(lt.dynamicFilters)){const sr=lt.dynamicFilters[0],Zt=lt.dynamicFilters[1]||0;console.log(`Tipo: ${sr===1?"Equipo":sr===2?"Rival":"Dinámico (3)"}, Cantidad requerida: ${Zt}`);let Tt=[],Pt=[],It=v.team;sr===1?(Pt=We,console.log(`Equipo: Total ordenadas=${Pt.length}, index=${rt}, cantidad requerida=${Zt}`),Pt.length>rt?(Tt=Pt.slice(rt,rt+Zt),console.log(`Index equipo: ${rt}, tomando ${Tt.length} fortalezas de ${Pt.length} disponibles`)):console.warn(`No hay suficientes fortalezas de equipo. Disponibles: ${Pt.length}, Necesarias desde índice: ${rt}`),rt+=Zt,It=((Et=v.partido)==null?void 0:Et.local)||((qt=v.partido)==null?void 0:qt.home_team)||v.team):sr===2?(Pt=Qe,console.log(`Rival: Total ordenadas=${Pt.length}, index=${dt}, cantidad requerida=${Zt}`),Pt.length>dt?(Tt=Pt.slice(dt,dt+Zt),console.log(`Index rival: ${dt}, tomando ${Tt.length} fortalezas de ${Pt.length} disponibles`)):console.warn(`No hay suficientes fortalezas de rival. Disponibles: ${Pt.length}, Necesarias desde índice: ${dt}`),dt+=Zt,It=((Gt=v.partido)==null?void 0:Gt.visita)||((Jt=v.partido)==null?void 0:Jt.visiting_team)):sr===3&&(lt.filterMultiple&<.filterMultiple.isHomeTeam?(Pt=We,console.log(`Dinámico (Equipo): Total ordenadas=${Pt.length}, index=${rt}, cantidad requerida=${Zt}`),Pt.length>rt?(Tt=Pt.slice(rt,rt+Zt),console.log(`Index equipo: ${rt}, tomando ${Tt.length} fortalezas de ${Pt.length} disponibles`)):console.warn(`No hay suficientes fortalezas de equipo. Disponibles: ${Pt.length}, Necesarias desde índice: ${rt}`),rt+=Zt,It=((Qt=v.partido)==null?void 0:Qt.local)||((lr=v.partido)==null?void 0:lr.home_team)||v.team):(Pt=Qe,console.log(`Dinámico (Rival): Total ordenadas=${Pt.length}, index=${dt}, cantidad requerida=${Zt}`),Pt.length>dt?(Tt=Pt.slice(dt,dt+Zt),console.log(`Index rival: ${dt}, tomando ${Tt.length} fortalezas de ${Pt.length} disponibles`)):console.warn(`No hay suficientes fortalezas de rival. Disponibles: ${Pt.length}, Necesarias desde índice: ${dt}`),dt+=Zt,It=((hr=v.partido)==null?void 0:hr.visita)||(($t=v.partido)==null?void 0:$t.visiting_team))),console.log("fortalezasAsignar:",Tt),Tt.length>0?(Ue[st]||(Ue[st]={}),Ue[st][Rt]||(Ue[st][Rt]=[]),Tt.forEach((vr,ur)=>{Ue[st][Rt].push({team_id:It,ranking_type:vr.ranking_type||1,precondition_id:vr.precondition_id||null,order:ur+1,name:vr.name,category_type:vr.category_type||1,total:vr.total||0,is_relevant:vr.is_relevant||0,league_ranking:vr.league_ranking||0,categories:Array.isArray(vr.categories)?vr.categories:[vr.categories],team_contribution:vr.team_contribution||0})}),console.log(`✓ Agregadas ${Tt.length} fortalezas al payload para componente ${Rt} en página ${st}`),console.log(`Payload actual para página ${st}:`,JSON.stringify(Ue[st],null,2))):console.warn(`⚠️ No hay fortalezas para asignar al componente ${Rt} en página ${st}. IndexEquipo: ${rt}, IndexRival: ${dt}`)}else console.warn(`⚠️ Componente ${Ot+1} en página ${st} no tiene dynamicFilters válido`),console.warn("Component:",lt)}}),console.log(`
|
|
8001
8001
|
✓ Página ${st} procesada. Componentes de Fortalezas encontrados y procesados.`))}),console.log(`
|
|
8002
|
-
=== PAYLOAD FINAL ===`),console.log(JSON.stringify(Ue,null,2)),Ue}function Pe(){let Ue=[];const qe=[...f.value,...g.value,...S.value,...L.value];return console.log("allSelectedCorners:",qe),console.log("selectedCornersEquipo:",f.value),console.log("selectedCornersEquipoAgainst:",g.value),console.log("selectedCornersRival:",S.value),console.log("selectedCornersRivalAgainst:",L.value),Ue=qe.map(Re=>({play_id:Re.play_id,game_id:Re.game.game_id,team_id:Re.isAgainst?Re.game.home_team===Re.team_id?Re.game.visiting_team:Re.game.home_team:Re.team_id,is_against:Re.isAgainst?1:0})),console.log("payload specificPlays:",Ue),Ue}function je(Ue,qe){if(console.log("=== getOrderedStrengths INICIO ==="),console.log("selectedIds (orden de selección):",Ue),console.log("fortalezasViewRef existe?:",!!qe),!Ue||Ue.length===0)return console.warn("No hay IDs seleccionados"),[];if(!qe)return console.warn("Ref no disponible"),[];let Re=qe.fortalezasRawData;if(!Re)return console.warn("fortalezasRawData no está disponible en el ref"),[];if(Re&&typeof Re=="object"&&"value"in Re&&(console.log("⚠️ fortalezasRawData es un ref, accediendo a .value"),Re=Re.value),!Array.isArray(Re))return console.warn("fortalezasRawData no es un array:",typeof Re,Re),[];if(Re.length===0)return console.warn("fortalezasRawData está vacío"),[];console.log("fortalezasRawData length:",Re.length),console.log("Primeras 2 fortalezas raw:",Re.slice(0,2));const We=Ue.map(Qe=>{console.log(`Buscando ID: ${Qe} (tipo: ${typeof Qe})`);const rt=Re.find(ut=>{const Ye=ut.categories===Qe||ut.categories===Number(Qe)||String(ut.categories)===String(Qe);return!Ye&&Re.indexOf(ut)<3&&console.log(` Comparando: item.categories=${ut.categories} (${typeof ut.categories}) vs id=${Qe} (${typeof Qe})`),Ye});if(rt)return console.log(`✓ Encontrada: ${rt.name} (categories: ${rt.categories})`),rt;console.warn(`✗ No encontrada con categories = ${Qe}, intentando por id`);const dt=Re.find(ut=>ut.id===Qe||ut.id===Number(Qe)||String(ut.id)===String(Qe));return dt?(console.log(`✓ Encontrada por id: ${dt.name}`),dt):(console.error(`✗✗ No se encontró fortaleza con id/categories = ${Qe}`),null)}).filter(Boolean);return console.log(`selectedStrengths (${We.length} de ${Ue.length} encontradas):`,We),console.log("=== getOrderedStrengths FIN ==="),We}function _e(){const qe=j()[a.value];if(qe==="fortalezasEquipo"&&U.value)return U.value.autocompletar();if(qe==="fortalezasRival"&&D.value)return D.value.autocompletar();if(qe==="cornersEquipo"&&F.value)return F.value.autocompletar();if(qe==="cornersEquipoAgainst"&&z.value)return z.value.autocompletar();if(qe==="cornersRival"&&X.value)return X.value.autocompletar();if(qe==="cornersRivalAgainst"&&M.value)return M.value.autocompletar()}return(Ue,qe)=>{var Re,We,Qe,rt,dt,ut,Ye,st,lt,Ot,zt,Et,qt,Gt,Jt,Qt;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",Out,[t.createElementVNode("div",Mut,[t.createElementVNode("div",Eut,[t.createElementVNode("div",Cut,[zut,t.createElementVNode("span",Vut,[t.createTextVNode("Generar reporte - "),t.createElementVNode("span",Put,t.toDisplayString(p.value),1)])]),t.createElementVNode("div",Aut," Paso "+t.toDisplayString(a.value===0?1:a.value)+" de "+t.toDisplayString(P.value),1)]),Rut,t.createElementVNode("div",{class:t.normalizeClass(["modal-body",{transitioning:T.value}])},[a.value===0?(t.openBlock(),t.createElementBlock("div",Uut,[u.value?(t.openBlock(),t.createElementBlock("div",Fut,[Iut,qut,t.createElementVNode("p",jut," Este template contiene "+t.toDisplayString(i.value.equipo)+" visualizaciones de Fortalezas de tu equipo y "+t.toDisplayString(i.value.rival)+" de tu rival. ¿Cómo prefieres que se agregue este contenido? ",1),Dut,t.createElementVNode("div",Wut,[t.createElementVNode("label",Kut,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"fortalezas",value:"automatico","onUpdate:modelValue":qe[0]||(qe[0]=lr=>d.value=lr)},null,512),[[t.vModelRadio,d.value]]),But,Xut]),t.createElementVNode("label",Gut,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"fortalezas",value:"manual","onUpdate:modelValue":qe[1]||(qe[1]=lr=>d.value=lr)},null,512),[[t.vModelRadio,d.value]]),Zut,Jut])])])):t.createCommentVNode("",!0),c.value?(t.openBlock(),t.createElementBlock("div",Hut,[Yut,Qut,t.createElementVNode("p",$ut," Este template contiene "+t.toDisplayString(c.value.homeTeamViews.length)+" visualizaciones de Tiros de esquina de tu equipo y "+t.toDisplayString(c.value.awayTeamViews.length)+" visualizaciones de tu rival. ¿Cómo prefieres que se agregue este contenido? ",1),edt,t.createElementVNode("div",tdt,[t.createElementVNode("label",rdt,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"tiros-esquina",value:"automatico","onUpdate:modelValue":qe[2]||(qe[2]=lr=>o.value=lr)},null,512),[[t.vModelRadio,o.value]]),ndt,adt]),t.createElementVNode("label",idt,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"tiros-esquina",value:"manual","onUpdate:modelValue":qe[3]||(qe[3]=lr=>o.value=lr)},null,512),[[t.vModelRadio,o.value]]),odt,sdt])])])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),i.value.equipo>0?t.withDirectives((t.openBlock(),t.createElementBlock("div",ldt,[t.createVNode(OJ,{key:"fortalezas-equipo",modelValue:l.value,"onUpdate:modelValue":qe[4]||(qe[4]=lr=>l.value=lr),"team-initials":"AME","season-id":(Re=v.partido)==null?void 0:Re.season_id,"team-id":((We=v.partido)==null?void 0:We.local)||((Qe=v.partido)==null?void 0:Qe.home_team),"rival-team-id":((rt=v.partido)==null?void 0:rt.visita)||((dt=v.partido)==null?void 0:dt.visiting_team),"game-id":((ut=v.partido)==null?void 0:ut.game_id)||((Ye=v.partido)==null?void 0:Ye.id),token:v.token,"template-type":((st=v.template)==null?void 0:st.template_type)||1,title:"Fortalezas a favor de mi equipo","total-fortalezas":i.value.equipo,ref_key:"fortalezasEquipoRef",ref:U},null,8,["modelValue","season-id","team-id","rival-team-id","game-id","token","template-type","total-fortalezas"])],512)),[[t.vShow,j()[a.value]==="fortalezasEquipo"]]):t.createCommentVNode("",!0),i.value.rival>0?t.withDirectives((t.openBlock(),t.createElementBlock("div",cdt,[t.createVNode(OJ,{key:"fortalezas-rival",modelValue:s.value,"onUpdate:modelValue":qe[5]||(qe[5]=lr=>s.value=lr),"team-initials":"RIV","season-id":(lt=v.partido)==null?void 0:lt.season_id,"team-id":((Ot=v.partido)==null?void 0:Ot.visita)||((zt=v.partido)==null?void 0:zt.visiting_team),"rival-team-id":((Et=v.partido)==null?void 0:Et.local)||((qt=v.partido)==null?void 0:qt.home_team),"game-id":((Gt=v.partido)==null?void 0:Gt.game_id)||((Jt=v.partido)==null?void 0:Jt.id),token:v.token,"template-type":((Qt=v.template)==null?void 0:Qt.template_type)||1,title:"Fortalezas a favor del rival","total-fortalezas":i.value.rival,ref_key:"fortalezasRivalRef",ref:D},null,8,["modelValue","season-id","team-id","rival-team-id","game-id","token","template-type","total-fortalezas"])],512)),[[t.vShow,j()[a.value]==="fortalezasRival"]]):t.createCommentVNode("",!0),c.value&&c.value.homeTeamViews.length>0?t.withDirectives((t.openBlock(),t.createElementBlock("div",udt,[t.createVNode(qM,{modelValue:f.value,"onUpdate:modelValue":qe[6]||(qe[6]=lr=>f.value=lr),"team-views":c.value.homeTeamViews,"is-rival":!1,"is-against-mode":!1,title:"Tiros de esquina de mi equipo","team-logo-url":e.configData.partido.localLogo,"config-data":e.configData,"user-team-id":e.team,ref_key:"cornersEquipoRef",ref:F,onCornersFetched:qe[7]||(qe[7]=lr=>I(lr,"cornersEquipo"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[t.vShow,j()[a.value]==="cornersEquipo"]]):t.createCommentVNode("",!0),c.value&&c.value.homeTeamAgainstViews.length>0?t.withDirectives((t.openBlock(),t.createElementBlock("div",ddt,[t.createVNode(qM,{modelValue:g.value,"onUpdate:modelValue":qe[8]||(qe[8]=lr=>g.value=lr),"team-views":c.value.homeTeamAgainstViews,"is-rival":!1,"is-against-mode":!0,title:"Tiros de esquina en contra de mi equipo","team-logo-url":e.configData.partido.localLogo,"config-data":e.configData,"user-team-id":e.team,ref_key:"cornersEquipoAgainstRef",ref:z,onCornersFetched:qe[9]||(qe[9]=lr=>I(lr,"cornersEquipoAgainst"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[t.vShow,j()[a.value]==="cornersEquipoAgainst"]]):t.createCommentVNode("",!0),c.value&&c.value.awayTeamViews.length>0?t.withDirectives((t.openBlock(),t.createElementBlock("div",pdt,[t.createVNode(qM,{modelValue:S.value,"onUpdate:modelValue":qe[10]||(qe[10]=lr=>S.value=lr),"is-rival":!0,"is-against-mode":!1,"team-views":c.value.awayTeamViews,title:"Tiros de esquina en contra del rival","team-logo-url":e.configData.partido.visitanteLogo,"config-data":e.configData,"user-team-id":e.team,ref_key:"cornersRivalRef",ref:X,onCornersFetched:qe[11]||(qe[11]=lr=>I(lr,"cornersRival"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[t.vShow,j()[a.value]==="cornersRival"]]):t.createCommentVNode("",!0),c.value&&c.value.awayTeamAgainstViews.length>0?t.withDirectives((t.openBlock(),t.createElementBlock("div",hdt,[t.createVNode(qM,{modelValue:L.value,"onUpdate:modelValue":qe[12]||(qe[12]=lr=>L.value=lr),"is-rival":!0,"is-against-mode":!0,"team-views":c.value.awayTeamAgainstViews,title:"Tiros de esquina en contra del rival","team-logo-url":e.configData.partido.visitanteLogo,"config-data":e.configData,"user-team-id":e.team,ref_key:"cornersRivalAgainstRef",ref:M,onCornersFetched:qe[13]||(qe[13]=lr=>I(lr,"cornersRivalAgainst"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[t.vShow,j()[a.value]==="cornersRivalAgainst"]]):t.createCommentVNode("",!0)],2),fdt,t.createElementVNode("div",mdt,[t.createElementVNode("button",{class:"back-btn",onClick:se},[ydt,t.createTextVNode(" Regresar ")]),t.createElementVNode("div",gdt,[a.value===0?(t.openBlock(),t.createElementBlock("button",{key:0,class:"cancel-btn",onClick:Y},"Cancelar")):t.createCommentVNode("",!0),k.value.includes(a.value)?(t.openBlock(),t.createElementBlock("button",{key:1,class:"cancel-btn",onClick:_e}," Autocompletar ")):t.createCommentVNode("",!0),t.createElementVNode("button",{class:t.normalizeClass(["next-btn",{disabled:!V.value}]),disabled:!V.value,onClick:be},t.toDisplayString(a.value===0?u.value&&c.value?d.value==="automatico"&&o.value==="automatico"?"Finalizar":"Siguiente":u.value?d.value==="automatico"?"Finalizar":"Siguiente":c.value?o.value==="automatico"?"Finalizar":"Siguiente":"Finalizar":a.value===P.value?"Finalizar":"Siguiente"),11,vdt)])])])]),x.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"modal-overlay",onClick:t.withModifiers(ge,["self"])},[t.createElementVNode("div",{class:"modal-content confirm-dialog"},[bdt,t.createElementVNode("div",{class:"modal-footer"},[t.createElementVNode("div",{class:"footer-actions"},[t.createElementVNode("button",{class:"cancel-btn",onClick:ge},"Cancelar"),t.createElementVNode("button",{class:"next-btn",onClick:me},"Confirmar")])])])])):t.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-479f5c78"]]),jM=e=>(t.pushScopeId("data-v-55dfb8d7"),e=e(),t.popScopeId(),e),_dt={class:"templates-header"},wdt={class:"count"},Tdt={key:0,class:"sort-options"},Sdt=["onClick"],kdt={key:0,class:"checkmark"},Ldt=[jM(()=>t.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],Ndt={key:0,class:"loading-state"},Odt=[jM(()=>t.createElementVNode("div",{class:"loading-spinner"},null,-1)),jM(()=>t.createElementVNode("p",null,"Cargando templates...",-1))],Mdt=[jM(()=>t.createElementVNode("div",{class:"inner-card"},[t.createElementVNode("div",{class:"plus"},[t.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-add@3x.png",alt:"Agregar"})]),t.createElementVNode("div",{class:"create-text"},"Crear Template")],-1))],Edt=ov({__name:"TemplatesSection",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0},searchQuery:{type:String,default:""}},emits:["switch-to-reports","open-modal-new-template","edit-template"],setup(e,{expose:r,emit:n}){const v=n,$=e,h=t.ref(!1),u=t.ref(null),i=t.ref(!1),p=t.ref(!1),c=t.ref(!1),a=t.ref(!1),k=t.ref(!1),T=t.ref(!1),x=t.ref(null),d=t.ref(!1),o=t.ref(""),l=t.ref(""),s=t.ref(""),f=t.ref(""),g=t.ref(""),S=t.ref(""),L=t.ref(""),E=t.ref(""),P=t.ref(""),V=t.ref(null),I=t.ref(null),j=t.ref(null),U=t.ref(null),D=t.ref(0),F=t.ref([]),z=t.ref(!1),X=t.ref(null);t.watch([()=>$.team,()=>$.token],()=>{$.team&&$.token&&Y()},{immediate:!1});const M=[{label:"A - Z",value:"name-asc"},{label:"Más recientes",value:"date-desc"}],Y=async()=>{try{z.value=!0,X.value=null;const dt=await z0.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates/teams/${$.team}`,{headers:{Authorization:`${$.token}`,"Content-Type":"application/json"}});dt.data&&Array.isArray(dt.data)?F.value=dt.data:dt.data&&dt.data.templates?F.value=dt.data.templates:dt.data&&dt.data.data?F.value=dt.data.data:F.value=[]}catch(dt){console.error("Error al obtener templates:",dt),console.error("Error response:",dt.response),X.value=dt.message||"Error al cargar los templates",F.value=[]}finally{z.value=!1}},se=t.computed(()=>{if(!F.value.length)return[];let dt=[...F.value];if($.searchQuery.trim()){const ut=$.searchQuery.toLowerCase().trim();dt=dt.filter(Ye=>Ye.name.toLowerCase().includes(ut))}switch(u.value){case"name-asc":return dt.sort((ut,Ye)=>ut.name.localeCompare(Ye.name));case"date-desc":return dt.sort((ut,Ye)=>new Date(Ye.created_at)-new Date(ut.created_at));default:return dt}}),me=t.computed(()=>{if(!D.value)return"grid-1-column";const dt=340,ut=20,st=D.value-40,lt=Math.floor((st+ut)/(dt+ut)),Ot=Math.max(1,lt);return Ot>=4?"grid-4-columns":Ot>=3?"grid-3-columns":Ot>=2?"grid-2-columns":"grid-1-column"}),ge=()=>{h.value=!h.value},be=dt=>{u.value=dt,h.value=!1},xe=dt=>{const ut=M.find(Ye=>Ye.value===dt);return ut?ut.label:null},Pe=dt=>{h.value&&I.value&&!I.value.contains(dt.target)&&(h.value=!1)},je=()=>{j.value&&(D.value=j.value.offsetWidth)};function _e(dt){v("edit-template",dt)}function Ue(){p.value=!1,d.value=!1}function qe(dt){x.value=dt,p.value=!1,d.value=!1,T.value=!0}function Re(){T.value=!1,p.value=!0}async function We(dt){var ut,Ye,st,lt,Ot,zt,Et,qt,Gt;try{if(T.value=!1,!x.value)return;const Jt={template_id:x.value.template.id,user_id:$.userId,tournament_id:x.value.liga.id||1,tournament_name:x.value.liga.name,season_id:x.value.partido.season_id,season_name:((ut=x.value.torneo)==null?void 0:ut.name)||"",game_id:x.value.partido.id||x.value.partido.game_id};dt.tirosEsquina==="automatico"&&(Jt.auto_specific_plays_corners=!0);const Qt=await z0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$.userId}/reports`,Jt,{headers:{Authorization:$.token,"Content-Type":"application/json"}}),lr=((Ye=Qt.data)==null?void 0:Ye.id)||((st=Qt.data)==null?void 0:st.report_id)||((Ot=(lt=Qt.data)==null?void 0:lt.data)==null?void 0:Ot.id)||((Et=(zt=Qt.data)==null?void 0:zt.data)==null?void 0:Et.report_id);if(console.log("Report ID obtenido:",lr),console.log("Strengths Payload recibido:",dt==null?void 0:dt.strengthsPayload),dt.tirosEsquina==="manual"&&dt.specificPlaysPayload){console.log("specificPlaysPayload recibido:",dt.specificPlaysPayload);try{console.log("Enviando specific plays al endpoint...");const hr=await z0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$.userId}/reports/${lr}/specific-plays-corners`,{data:dt.specificPlaysPayload},{headers:{Authorization:$.token,"Content-Type":"application/json"}});console.log("Specific plays guardados exitosamente:",hr.data)}catch(hr){console.error("Error al guardar los specific plays:",hr),console.error("Error response:",(qt=hr.response)==null?void 0:qt.data)}}if(dt!=null&&dt.strengthsPayload&&Object.keys(dt.strengthsPayload).length>0&&lr)try{console.log("Enviando strengths al endpoint...");const hr=await z0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$.userId}/reports/${lr}/strengths`,dt.strengthsPayload,{headers:{Authorization:$.token,"Content-Type":"application/json"}});console.log("Strengths guardados exitosamente:",hr.data)}catch(hr){console.error("Error al guardar las fortalezas:",hr),console.error("Error response:",(Gt=hr.response)==null?void 0:Gt.data)}else console.warn("No se enviaron strengths porque:",{hasPayload:!!(dt!=null&&dt.strengthsPayload),payloadKeys:dt!=null&&dt.strengthsPayload?Object.keys(dt.strengthsPayload).length:0,hasReportId:!!lr});v("switch-to-reports"),x.value=null}catch(Jt){console.error("Error al generar el reporte:",Jt),Jt.response&&Jt.response.status===409?x.value&&(L.value=x.value.template.id,P.value=x.value.template.template_type,V.value=x.value.template,d.value=!0,await t.nextTick(),p.value=!0):alert("Error al generar el reporte. Por favor, intenta de nuevo.")}}let Qe=null;t.onMounted(async()=>{document.addEventListener("mousedown",Pe),await t.nextTick(),je(),window.ResizeObserver?(Qe=new ResizeObserver(()=>{je()}),j.value&&Qe.observe(j.value)):window.addEventListener("resize",je),Y()});function rt(dt){v("open-modal-new-template",dt)}return t.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Pe),Qe?Qe.disconnect():window.removeEventListener("resize",je)}),r({obtenerTemplates:Y}),(dt,ut)=>{var Ye,st;return t.openBlock(),t.createElementBlock("div",{class:"templates-section",ref_key:"templatesSectionRef",ref:j},[t.createElementVNode("div",_dt,[t.createElementVNode("span",null,[t.createTextVNode("Templates "),t.createElementVNode("span",wdt,"("+t.toDisplayString(se.value.length)+")",1)]),t.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:I},[t.createElementVNode("button",{class:"sort-button",onClick:ge},[t.createTextVNode(t.toDisplayString(xe(u.value)||"Ordenar")+" ",1),t.createElementVNode("span",{class:t.normalizeClass(["dropdown-arrow",{rotated:h.value}])},null,2)]),h.value?(t.openBlock(),t.createElementBlock("div",Tdt,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(M,lt=>t.createElementVNode("div",{key:lt.value,class:t.normalizeClass(["sort-option",{selected:u.value===lt.value}]),onClick:Ot=>be(lt.value)},[t.createElementVNode("span",null,t.toDisplayString(lt.label),1),u.value===lt.value?(t.openBlock(),t.createElementBlock("span",kdt,Ldt)):t.createCommentVNode("",!0)],10,Sdt)),64))])):t.createCommentVNode("",!0)],512)]),z.value?(t.openBlock(),t.createElementBlock("div",Ndt,Odt)):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["templates-list",me.value]),ref_key:"templatesListRef",ref:U},[t.createElementVNode("div",{class:"template-card create",onClick:ut[0]||(ut[0]=lt=>i.value=!0)},Mdt),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(se.value,lt=>(t.openBlock(),t.createBlock(sot,{key:lt.id,template:lt,"user-id":e.userId,onGenerarReporte:Ot=>{L.value=lt.id,P.value=lt.template_type,V.value=lt,p.value=!0},onRenombrar:Ot=>{E.value=lt.id,o.value=Ot,l.value=lt.template_type,c.value=!0},onDuplicar:Ot=>{S.value=lt.id,s.value=Ot,a.value=!0},onEliminar:Ot=>{f.value=Ot.name,g.value=Ot.id,k.value=!0},onEditTemplate:_e},null,8,["template","user-id","onGenerarReporte","onRenombrar","onDuplicar","onEliminar"]))),128))],2)),i.value?(t.openBlock(),t.createBlock(NJ,{key:2,token:e.token,team:e.team,onClose:ut[1]||(ut[1]=lt=>i.value=!1),onOpenModalNewTemplate:rt},null,8,["token","team"])):t.createCommentVNode("",!0),p.value?(t.openBlock(),t.createBlock(Nst,{key:3,"user-id":e.userId,token:e.token,team:e.team,"template-id":L.value,"template-type":P.value,template:V.value,"show-error409-on-mount":d.value,onClose:Ue,onSwitchToReports:ut[2]||(ut[2]=lt=>dt.$emit("switch-to-reports")),onOpenConfigurarContenido:qe},null,8,["user-id","token","team","template-id","template-type","template","show-error409-on-mount"])):t.createCommentVNode("",!0),T.value?(t.openBlock(),t.createBlock(xdt,{key:4,"has-rival":!0,token:e.token,template:((Ye=x.value)==null?void 0:Ye.template)||null,team:e.team,partido:((st=x.value)==null?void 0:st.partido)||null,"config-data":x.value,onClose:ut[3]||(ut[3]=lt=>T.value=!1),onBack:Re,onNext:We},null,8,["token","template","team","partido","config-data"])):t.createCommentVNode("",!0),c.value?(t.openBlock(),t.createBlock(Wst,{key:5,initialName:o.value,token:e.token,"template-id":E.value,"template-type":l.value,"user-id":e.userId,onRefresh:ut[4]||(ut[4]=lt=>Y()),onClose:ut[5]||(ut[5]=lt=>c.value=!1),onRename:ut[6]||(ut[6]=lt=>{c.value=!1})},null,8,["initialName","token","template-id","template-type","user-id"])):t.createCommentVNode("",!0),a.value?(t.openBlock(),t.createBlock(tlt,{key:6,initialName:s.value,token:e.token,"template-id":S.value,onClose:ut[7]||(ut[7]=lt=>a.value=!1),onTemplateDuplicated:ut[8]||(ut[8]=lt=>{a.value=!1,Y()})},null,8,["initialName","token","template-id"])):t.createCommentVNode("",!0),k.value?(t.openBlock(),t.createBlock(clt,{key:7,"template-id":g.value,"user-id":e.userId,token:e.token,onClose:ut[9]||(ut[9]=lt=>k.value=!1),onTemplateDeleted:ut[10]||(ut[10]=lt=>{k.value=!1,Y()})},null,8,["template-id","user-id","token"])):t.createCommentVNode("",!0)],512)}}},[["__scopeId","data-v-55dfb8d7"]]),LA=e=>(t.pushScopeId("data-v-d17eb1eb"),e=e(),t.popScopeId(),e),Cdt={class:"tooltip-report-options"},zdt=LA(()=>t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",alt:"Renombrar reporte",class:"icon"},null,-1)),Vdt=LA(()=>t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-download.svg",alt:"Descargar reporte",class:"icon"},null,-1)),Pdt=LA(()=>t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-delete.svg",alt:"Eliminar reporte",class:"icon"},null,-1)),Adt=ov({__name:"TooltipReportOptions",emits:["ver-reporte","renombrar","editar","duplicar","descargar","eliminar"],setup(e,{emit:r}){return(n,v)=>(t.openBlock(),t.createElementBlock("div",Cdt,[t.createElementVNode("ul",null,[t.createElementVNode("li",{class:"option",onClick:v[0]||(v[0]=$=>n.$emit("renombrar"))},[zdt,t.createTextVNode(" Renombrar reporte ")]),t.createElementVNode("li",{class:"option",onClick:v[1]||(v[1]=$=>n.$emit("descargar"))},[Vdt,t.createTextVNode(" Descargar reporte ")]),t.createElementVNode("li",{class:"option",onClick:v[2]||(v[2]=$=>n.$emit("eliminar"))},[Pdt,t.createTextVNode(" Eliminar reporte ")])])]))}},[["__scopeId","data-v-d17eb1eb"]]);function U4(e){if(!e)return"";const r=new Date(e);if(isNaN(r.getTime()))return"";const n=r.getDate(),v=r.toLocaleDateString("es-ES",{month:"short"}),$=r.getFullYear();return`${n} ${v}, ${$}`}const Rdt=e=>(t.pushScopeId("data-v-bb7e7ba7"),e=e(),t.popScopeId(),e),Udt={class:"prematch-bg"},Fdt={class:"background-shields"},Idt={class:"shield-left"},qdt=["src"],jdt={class:"shield-right"},Ddt=["src"],Wdt=Rdt(()=>t.createElementVNode("div",{class:"title"},[t.createTextVNode("Análisis "),t.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),Kdt={class:"subtitle"},Bdt={class:"jornada"},Xdt={class:"fecha"},Gdt={class:"teams-row"},Zdt={class:"team team-local"},Jdt={class:"escudo-svg"},Hdt=["src"],Ydt={class:"team-name"},Qdt={class:"team team-visitor"},$dt={class:"escudo-svg"},ept=["src"],tpt={class:"team-name"},rpt=ov({__name:"AnalisisPrematchType1",props:{report:{type:Object,default:()=>({})}},setup(e){function r(v){return v?v.replace("Matchday","J").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SI").replace("Playoffs 4","SV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"):""}const n=e;return(v,$)=>(t.openBlock(),t.createElementBlock("div",Udt,[t.createElementVNode("div",Fdt,[t.createElementVNode("div",Idt,[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+n.report.game.home_team+".png",alt:"Escudo local"},null,8,qdt)]),t.createElementVNode("div",jdt,[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+n.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,Ddt)])]),Wdt,t.createElementVNode("div",Kdt,[t.createElementVNode("span",Bdt,t.toDisplayString(r(n.report.game.matchday_name)),1),t.createElementVNode("span",Xdt," - "+t.toDisplayString(t.unref(U4)(n.report.game.date_time_utc)),1)]),t.createElementVNode("div",Gdt,[t.createElementVNode("div",Zdt,[t.createElementVNode("span",Jdt,[t.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.home_team+".png"},null,8,Hdt)]),t.createElementVNode("span",Ydt,t.toDisplayString(n.report.game.home_team_acronym),1)]),t.createElementVNode("div",Qdt,[t.createElementVNode("span",$dt,[t.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.visiting_team+".png"},null,8,ept)]),t.createElementVNode("span",tpt,t.toDisplayString(n.report.game.visiting_team_acronym),1)])])]))}},[["__scopeId","data-v-bb7e7ba7"]]),n7=e=>(t.pushScopeId("data-v-7dd14646"),e=e(),t.popScopeId(),e),npt={class:"prematch-bg"},apt={class:"background-shields"},ipt={class:"shield-left"},opt=["src"],spt={class:"shield-right"},lpt=["src"],cpt=n7(()=>t.createElementVNode("div",{class:"title"},[t.createTextVNode("Análisis "),t.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),upt={class:"subtitle"},dpt={class:"jornada"},ppt={class:"fecha"},hpt={class:"teams-grid"},fpt={class:"row row-top"},mpt={class:"team team-local"},ypt={class:"escudo-svg"},gpt=["src"],vpt={class:"team-name"},bpt={class:"score"},xpt={class:"score-text"},_pt={class:"team team-visitor"},wpt={class:"team-name"},Tpt={class:"escudo-svg"},Spt=["src"],kpt={class:"row row-bottom"},Lpt={class:"team-stats"},Npt=t.createStaticVNode('<span class="stat ball" data-v-7dd14646><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-7dd14646><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path></svg></span>',1),Opt={class:"stat red"},Mpt=n7(()=>t.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})],-1)),Ept={class:"stat-number"},Cpt={class:"stat yellow"},zpt=n7(()=>t.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})],-1)),Vpt={class:"stat-number"},Ppt=n7(()=>t.createElementVNode("div",{class:"empty"},null,-1)),Apt={class:"team-stats"},Rpt={class:"stat-number"},Upt=n7(()=>t.createElementVNode("span",{class:"stat yellow"},[t.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})])],-1)),Fpt={class:"stat-number"},Ipt=n7(()=>t.createElementVNode("span",{class:"stat red"},[t.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})])],-1)),qpt=t.createStaticVNode('<span class="stat ball" data-v-7dd14646><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-7dd14646><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path></svg></span>',1),jpt=ov({__name:"AnalisisPostMatchType1",props:{report:{type:Object,default:()=>({})}},setup(e){function r(c){return c?c.replace("Matchday","J").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SI").replace("Playoffs 4","SV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"):""}const n=e,v=t.computed(()=>{var k,T,x;const c=(x=(T=(k=n.report)==null?void 0:k.game)==null?void 0:T.minutes)==null?void 0:x.home_goals_minutes;if(!Array.isArray(c)||c.length===0)return null;const a=c.map(d=>{const o=d.match(/(\d+)'$/);return o?o[1]+"'":""}).filter(d=>d!=="");if(a.length>5){const d=a.slice(0,5).join(", "),o=a.slice(5).join(", ");return`${d}
|
|
8002
|
+
=== PAYLOAD FINAL ===`),console.log(JSON.stringify(Ue,null,2)),Ue}function Pe(){let Ue=[];const qe=[...f.value,...g.value,...S.value,...L.value];return console.log("allSelectedCorners:",qe),console.log("selectedCornersEquipo:",f.value),console.log("selectedCornersEquipoAgainst:",g.value),console.log("selectedCornersRival:",S.value),console.log("selectedCornersRivalAgainst:",L.value),Ue=qe.map(Re=>({play_id:Re.play_id,game_id:Re.game.game_id,team_id:Re.isAgainst?Re.game.home_team===Re.team_id?Re.game.visiting_team:Re.game.home_team:Re.team_id,is_against:Re.isAgainst?1:0})),console.log("payload specificPlays:",Ue),Ue}function je(Ue,qe){if(console.log("=== getOrderedStrengths INICIO ==="),console.log("selectedIds (orden de selección):",Ue),console.log("fortalezasViewRef existe?:",!!qe),!Ue||Ue.length===0)return console.warn("No hay IDs seleccionados"),[];if(!qe)return console.warn("Ref no disponible"),[];let Re=qe.fortalezasRawData;if(!Re)return console.warn("fortalezasRawData no está disponible en el ref"),[];if(Re&&typeof Re=="object"&&"value"in Re&&(console.log("⚠️ fortalezasRawData es un ref, accediendo a .value"),Re=Re.value),!Array.isArray(Re))return console.warn("fortalezasRawData no es un array:",typeof Re,Re),[];if(Re.length===0)return console.warn("fortalezasRawData está vacío"),[];console.log("fortalezasRawData length:",Re.length),console.log("Primeras 2 fortalezas raw:",Re.slice(0,2));const We=Ue.map(Qe=>{console.log(`Buscando ID: ${Qe} (tipo: ${typeof Qe})`);const rt=Re.find(ut=>{const Ye=ut.categories===Qe||ut.categories===Number(Qe)||String(ut.categories)===String(Qe);return!Ye&&Re.indexOf(ut)<3&&console.log(` Comparando: item.categories=${ut.categories} (${typeof ut.categories}) vs id=${Qe} (${typeof Qe})`),Ye});if(rt)return console.log(`✓ Encontrada: ${rt.name} (categories: ${rt.categories})`),rt;console.warn(`✗ No encontrada con categories = ${Qe}, intentando por id`);const dt=Re.find(ut=>ut.id===Qe||ut.id===Number(Qe)||String(ut.id)===String(Qe));return dt?(console.log(`✓ Encontrada por id: ${dt.name}`),dt):(console.error(`✗✗ No se encontró fortaleza con id/categories = ${Qe}`),null)}).filter(Boolean);return console.log(`selectedStrengths (${We.length} de ${Ue.length} encontradas):`,We),console.log("=== getOrderedStrengths FIN ==="),We}function _e(){const qe=j()[a.value];if(qe==="fortalezasEquipo"&&U.value)return U.value.autocompletar();if(qe==="fortalezasRival"&&D.value)return D.value.autocompletar();if(qe==="cornersEquipo"&&F.value)return F.value.autocompletar();if(qe==="cornersEquipoAgainst"&&z.value)return z.value.autocompletar();if(qe==="cornersRival"&&X.value)return X.value.autocompletar();if(qe==="cornersRivalAgainst"&&M.value)return M.value.autocompletar()}return(Ue,qe)=>{var Re,We,Qe,rt,dt,ut,Ye,st,lt,Ot,zt,Et,qt,Gt,Jt,Qt;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",Out,[t.createElementVNode("div",Mut,[t.createElementVNode("div",Eut,[t.createElementVNode("div",Cut,[zut,t.createElementVNode("span",Vut,[t.createTextVNode("Generar reporte - "),t.createElementVNode("span",Put,t.toDisplayString(p.value),1)])]),t.createElementVNode("div",Aut," Paso "+t.toDisplayString(a.value===0?1:a.value)+" de "+t.toDisplayString(P.value),1)]),Rut,t.createElementVNode("div",{class:t.normalizeClass(["modal-body",{transitioning:T.value}])},[a.value===0?(t.openBlock(),t.createElementBlock("div",Uut,[u.value?(t.openBlock(),t.createElementBlock("div",Fut,[Iut,qut,t.createElementVNode("p",jut," Este template contiene "+t.toDisplayString(i.value.equipo)+" visualizaciones de Fortalezas de tu equipo y "+t.toDisplayString(i.value.rival)+" de tu rival. ¿Cómo prefieres que se agregue este contenido? ",1),Dut,t.createElementVNode("div",Wut,[t.createElementVNode("label",Kut,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"fortalezas",value:"automatico","onUpdate:modelValue":qe[0]||(qe[0]=lr=>d.value=lr)},null,512),[[t.vModelRadio,d.value]]),But,Xut]),t.createElementVNode("label",Gut,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"fortalezas",value:"manual","onUpdate:modelValue":qe[1]||(qe[1]=lr=>d.value=lr)},null,512),[[t.vModelRadio,d.value]]),Zut,Jut])])])):t.createCommentVNode("",!0),c.value?(t.openBlock(),t.createElementBlock("div",Hut,[Yut,Qut,t.createElementVNode("p",$ut," Este template contiene "+t.toDisplayString(c.value.homeTeamViews.length)+" visualizaciones de Tiros de esquina de tu equipo y "+t.toDisplayString(c.value.awayTeamViews.length)+" visualizaciones de tu rival. ¿Cómo prefieres que se agregue este contenido? ",1),edt,t.createElementVNode("div",tdt,[t.createElementVNode("label",rdt,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"tiros-esquina",value:"automatico","onUpdate:modelValue":qe[2]||(qe[2]=lr=>o.value=lr)},null,512),[[t.vModelRadio,o.value]]),ndt,adt]),t.createElementVNode("label",idt,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"tiros-esquina",value:"manual","onUpdate:modelValue":qe[3]||(qe[3]=lr=>o.value=lr)},null,512),[[t.vModelRadio,o.value]]),odt,sdt])])])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),i.value.equipo>0?t.withDirectives((t.openBlock(),t.createElementBlock("div",ldt,[t.createVNode(OJ,{key:"fortalezas-equipo",modelValue:l.value,"onUpdate:modelValue":qe[4]||(qe[4]=lr=>l.value=lr),"team-initials":"AME","season-id":(Re=v.partido)==null?void 0:Re.season_id,"team-id":((We=v.partido)==null?void 0:We.local)||((Qe=v.partido)==null?void 0:Qe.home_team),"rival-team-id":((rt=v.partido)==null?void 0:rt.visita)||((dt=v.partido)==null?void 0:dt.visiting_team),"game-id":((ut=v.partido)==null?void 0:ut.game_id)||((Ye=v.partido)==null?void 0:Ye.id),token:v.token,"template-type":((st=v.template)==null?void 0:st.template_type)||1,title:"Fortalezas a favor de mi equipo","total-fortalezas":i.value.equipo,ref_key:"fortalezasEquipoRef",ref:U},null,8,["modelValue","season-id","team-id","rival-team-id","game-id","token","template-type","total-fortalezas"])],512)),[[t.vShow,j()[a.value]==="fortalezasEquipo"]]):t.createCommentVNode("",!0),i.value.rival>0?t.withDirectives((t.openBlock(),t.createElementBlock("div",cdt,[t.createVNode(OJ,{key:"fortalezas-rival",modelValue:s.value,"onUpdate:modelValue":qe[5]||(qe[5]=lr=>s.value=lr),"team-initials":"RIV","season-id":(lt=v.partido)==null?void 0:lt.season_id,"team-id":((Ot=v.partido)==null?void 0:Ot.visita)||((zt=v.partido)==null?void 0:zt.visiting_team),"rival-team-id":((Et=v.partido)==null?void 0:Et.local)||((qt=v.partido)==null?void 0:qt.home_team),"game-id":((Gt=v.partido)==null?void 0:Gt.game_id)||((Jt=v.partido)==null?void 0:Jt.id),token:v.token,"template-type":((Qt=v.template)==null?void 0:Qt.template_type)||1,title:"Fortalezas a favor del rival","total-fortalezas":i.value.rival,ref_key:"fortalezasRivalRef",ref:D},null,8,["modelValue","season-id","team-id","rival-team-id","game-id","token","template-type","total-fortalezas"])],512)),[[t.vShow,j()[a.value]==="fortalezasRival"]]):t.createCommentVNode("",!0),c.value&&c.value.homeTeamViews.length>0?t.withDirectives((t.openBlock(),t.createElementBlock("div",udt,[t.createVNode(qM,{modelValue:f.value,"onUpdate:modelValue":qe[6]||(qe[6]=lr=>f.value=lr),"team-views":c.value.homeTeamViews,"is-rival":!1,"is-against-mode":!1,title:"Tiros de esquina de mi equipo","team-logo-url":e.configData.partido.localLogo,"config-data":e.configData,"user-team-id":e.team,ref_key:"cornersEquipoRef",ref:F,onCornersFetched:qe[7]||(qe[7]=lr=>I(lr,"cornersEquipo"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[t.vShow,j()[a.value]==="cornersEquipo"]]):t.createCommentVNode("",!0),c.value&&c.value.homeTeamAgainstViews.length>0?t.withDirectives((t.openBlock(),t.createElementBlock("div",ddt,[t.createVNode(qM,{modelValue:g.value,"onUpdate:modelValue":qe[8]||(qe[8]=lr=>g.value=lr),"team-views":c.value.homeTeamAgainstViews,"is-rival":!1,"is-against-mode":!0,title:"Tiros de esquina en contra de mi equipo","team-logo-url":e.configData.partido.localLogo,"config-data":e.configData,"user-team-id":e.team,ref_key:"cornersEquipoAgainstRef",ref:z,onCornersFetched:qe[9]||(qe[9]=lr=>I(lr,"cornersEquipoAgainst"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[t.vShow,j()[a.value]==="cornersEquipoAgainst"]]):t.createCommentVNode("",!0),c.value&&c.value.awayTeamViews.length>0?t.withDirectives((t.openBlock(),t.createElementBlock("div",pdt,[t.createVNode(qM,{modelValue:S.value,"onUpdate:modelValue":qe[10]||(qe[10]=lr=>S.value=lr),"is-rival":!0,"is-against-mode":!1,"team-views":c.value.awayTeamViews,title:"Tiros de esquina en contra del rival","team-logo-url":e.configData.partido.visitanteLogo,"config-data":e.configData,"user-team-id":e.team,ref_key:"cornersRivalRef",ref:X,onCornersFetched:qe[11]||(qe[11]=lr=>I(lr,"cornersRival"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[t.vShow,j()[a.value]==="cornersRival"]]):t.createCommentVNode("",!0),c.value&&c.value.awayTeamAgainstViews.length>0?t.withDirectives((t.openBlock(),t.createElementBlock("div",hdt,[t.createVNode(qM,{modelValue:L.value,"onUpdate:modelValue":qe[12]||(qe[12]=lr=>L.value=lr),"is-rival":!0,"is-against-mode":!0,"team-views":c.value.awayTeamAgainstViews,title:"Tiros de esquina en contra del rival","team-logo-url":e.configData.partido.visitanteLogo,"config-data":e.configData,"user-team-id":e.team,ref_key:"cornersRivalAgainstRef",ref:M,onCornersFetched:qe[13]||(qe[13]=lr=>I(lr,"cornersRivalAgainst"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[t.vShow,j()[a.value]==="cornersRivalAgainst"]]):t.createCommentVNode("",!0)],2),fdt,t.createElementVNode("div",mdt,[t.createElementVNode("button",{class:"back-btn",onClick:se},[ydt,t.createTextVNode(" Regresar ")]),t.createElementVNode("div",gdt,[a.value===0?(t.openBlock(),t.createElementBlock("button",{key:0,class:"cancel-btn",onClick:Y},"Cancelar")):t.createCommentVNode("",!0),k.value.includes(a.value)?(t.openBlock(),t.createElementBlock("button",{key:1,class:"cancel-btn",onClick:_e}," Autocompletar ")):t.createCommentVNode("",!0),t.createElementVNode("button",{class:t.normalizeClass(["next-btn",{disabled:!V.value}]),disabled:!V.value,onClick:be},t.toDisplayString(a.value===0?u.value&&c.value?d.value==="automatico"&&o.value==="automatico"?"Finalizar":"Siguiente":u.value?d.value==="automatico"?"Finalizar":"Siguiente":c.value?o.value==="automatico"?"Finalizar":"Siguiente":"Finalizar":a.value===P.value?"Finalizar":"Siguiente"),11,vdt)])])])]),x.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"modal-overlay",onClick:t.withModifiers(ge,["self"])},[t.createElementVNode("div",{class:"modal-content confirm-dialog"},[bdt,t.createElementVNode("div",{class:"modal-footer"},[t.createElementVNode("div",{class:"footer-actions"},[t.createElementVNode("button",{class:"cancel-btn",onClick:ge},"Cancelar"),t.createElementVNode("button",{class:"next-btn",onClick:me},"Confirmar")])])])])):t.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-479f5c78"]]),jM=e=>(t.pushScopeId("data-v-2565ffde"),e=e(),t.popScopeId(),e),_dt={class:"templates-header"},wdt={class:"count"},Tdt={key:0,class:"sort-options"},Sdt=["onClick"],kdt={key:0,class:"checkmark"},Ldt=[jM(()=>t.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],Ndt={key:0,class:"loading-state"},Odt=[jM(()=>t.createElementVNode("div",{class:"loading-spinner"},null,-1)),jM(()=>t.createElementVNode("p",null,"Cargando templates...",-1))],Mdt=[jM(()=>t.createElementVNode("div",{class:"inner-card"},[t.createElementVNode("div",{class:"plus"},[t.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-add@3x.png",alt:"Agregar"})]),t.createElementVNode("div",{class:"create-text"},"Crear Template")],-1))],Edt=ov({__name:"TemplatesSection",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0},searchQuery:{type:String,default:""}},emits:["switch-to-reports","open-modal-new-template","edit-template"],setup(e,{expose:r,emit:n}){const v=n,$=e,h=t.ref(!1),u=t.ref(null),i=t.ref(!1),p=t.ref(!1),c=t.ref(!1),a=t.ref(!1),k=t.ref(!1),T=t.ref(!1),x=t.ref(null),d=t.ref(!1),o=t.ref(""),l=t.ref(""),s=t.ref(""),f=t.ref(""),g=t.ref(""),S=t.ref(""),L=t.ref(""),E=t.ref(""),P=t.ref(""),V=t.ref(null),I=t.ref(null),j=t.ref(null),U=t.ref(null),D=t.ref(0),F=t.ref([]),z=t.ref(!1),X=t.ref(null);t.watch([()=>$.team,()=>$.token],()=>{$.team&&$.token&&Y()},{immediate:!1});const M=[{label:"A - Z",value:"name-asc"},{label:"Más recientes",value:"date-desc"}],Y=async()=>{try{z.value=!0,X.value=null;const dt=await z0.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates/teams/${$.team}`,{headers:{Authorization:`${$.token}`,"Content-Type":"application/json"}});dt.data&&Array.isArray(dt.data)?F.value=dt.data:dt.data&&dt.data.templates?F.value=dt.data.templates:dt.data&&dt.data.data?F.value=dt.data.data:F.value=[]}catch(dt){console.error("Error al obtener templates:",dt),console.error("Error response:",dt.response),X.value=dt.message||"Error al cargar los templates",F.value=[]}finally{z.value=!1}},se=t.computed(()=>{if(!F.value.length)return[];let dt=[...F.value];if($.searchQuery.trim()){const ut=$.searchQuery.toLowerCase().trim();dt=dt.filter(Ye=>Ye.name.toLowerCase().includes(ut))}switch(u.value){case"name-asc":return dt.sort((ut,Ye)=>ut.name.localeCompare(Ye.name));case"date-desc":return dt.sort((ut,Ye)=>new Date(Ye.created_at)-new Date(ut.created_at));default:return dt}}),me=t.computed(()=>{if(!D.value)return"grid-1-column";const dt=340,ut=20,st=D.value-40,lt=Math.floor((st+ut)/(dt+ut)),Ot=Math.max(1,lt);return Ot>=4?"grid-4-columns":Ot>=3?"grid-3-columns":Ot>=2?"grid-2-columns":"grid-1-column"}),ge=()=>{h.value=!h.value},be=dt=>{u.value=dt,h.value=!1},xe=dt=>{const ut=M.find(Ye=>Ye.value===dt);return ut?ut.label:null},Pe=dt=>{h.value&&I.value&&!I.value.contains(dt.target)&&(h.value=!1)},je=()=>{j.value&&(D.value=j.value.offsetWidth)};function _e(dt){v("edit-template",dt)}function Ue(){p.value=!1,d.value=!1}function qe(dt){x.value=dt,p.value=!1,d.value=!1,T.value=!0}function Re(){T.value=!1,p.value=!0}async function We(dt){var ut,Ye,st,lt,Ot,zt,Et,qt,Gt;try{if(T.value=!1,!x.value)return;const Jt={template_id:x.value.template.id,user_id:x.value.template.user_id,tournament_id:x.value.liga.id||1,tournament_name:x.value.liga.name,season_id:x.value.partido.season_id,season_name:((ut=x.value.torneo)==null?void 0:ut.name)||"",game_id:x.value.partido.id||x.value.partido.game_id};dt.tirosEsquina==="automatico"&&(Jt.auto_specific_plays_corners=!0);const Qt=await z0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$.userId}/reports`,Jt,{headers:{Authorization:$.token,"Content-Type":"application/json"}}),lr=((Ye=Qt.data)==null?void 0:Ye.id)||((st=Qt.data)==null?void 0:st.report_id)||((Ot=(lt=Qt.data)==null?void 0:lt.data)==null?void 0:Ot.id)||((Et=(zt=Qt.data)==null?void 0:zt.data)==null?void 0:Et.report_id);if(console.log("Report ID obtenido:",lr),console.log("Strengths Payload recibido:",dt==null?void 0:dt.strengthsPayload),dt.tirosEsquina==="manual"&&dt.specificPlaysPayload){console.log("specificPlaysPayload recibido:",dt.specificPlaysPayload);try{console.log("Enviando specific plays al endpoint...");const hr=await z0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$.userId}/reports/${lr}/specific-plays-corners`,{data:dt.specificPlaysPayload},{headers:{Authorization:$.token,"Content-Type":"application/json"}});console.log("Specific plays guardados exitosamente:",hr.data)}catch(hr){console.error("Error al guardar los specific plays:",hr),console.error("Error response:",(qt=hr.response)==null?void 0:qt.data)}}if(dt!=null&&dt.strengthsPayload&&Object.keys(dt.strengthsPayload).length>0&&lr)try{console.log("Enviando strengths al endpoint...");const hr=await z0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$.userId}/reports/${lr}/strengths`,dt.strengthsPayload,{headers:{Authorization:$.token,"Content-Type":"application/json"}});console.log("Strengths guardados exitosamente:",hr.data)}catch(hr){console.error("Error al guardar las fortalezas:",hr),console.error("Error response:",(Gt=hr.response)==null?void 0:Gt.data)}else console.warn("No se enviaron strengths porque:",{hasPayload:!!(dt!=null&&dt.strengthsPayload),payloadKeys:dt!=null&&dt.strengthsPayload?Object.keys(dt.strengthsPayload).length:0,hasReportId:!!lr});v("switch-to-reports"),x.value=null}catch(Jt){console.error("Error al generar el reporte:",Jt),Jt.response&&Jt.response.status===409?x.value&&(L.value=x.value.template.id,P.value=x.value.template.template_type,V.value=x.value.template,d.value=!0,await t.nextTick(),p.value=!0):alert("Error al generar el reporte. Por favor, intenta de nuevo.")}}let Qe=null;t.onMounted(async()=>{document.addEventListener("mousedown",Pe),await t.nextTick(),je(),window.ResizeObserver?(Qe=new ResizeObserver(()=>{je()}),j.value&&Qe.observe(j.value)):window.addEventListener("resize",je),Y()});function rt(dt){v("open-modal-new-template",dt)}return t.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Pe),Qe?Qe.disconnect():window.removeEventListener("resize",je)}),r({obtenerTemplates:Y}),(dt,ut)=>{var Ye,st;return t.openBlock(),t.createElementBlock("div",{class:"templates-section",ref_key:"templatesSectionRef",ref:j},[t.createElementVNode("div",_dt,[t.createElementVNode("span",null,[t.createTextVNode("Templates "),t.createElementVNode("span",wdt,"("+t.toDisplayString(se.value.length)+")",1)]),t.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:I},[t.createElementVNode("button",{class:"sort-button",onClick:ge},[t.createTextVNode(t.toDisplayString(xe(u.value)||"Ordenar")+" ",1),t.createElementVNode("span",{class:t.normalizeClass(["dropdown-arrow",{rotated:h.value}])},null,2)]),h.value?(t.openBlock(),t.createElementBlock("div",Tdt,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(M,lt=>t.createElementVNode("div",{key:lt.value,class:t.normalizeClass(["sort-option",{selected:u.value===lt.value}]),onClick:Ot=>be(lt.value)},[t.createElementVNode("span",null,t.toDisplayString(lt.label),1),u.value===lt.value?(t.openBlock(),t.createElementBlock("span",kdt,Ldt)):t.createCommentVNode("",!0)],10,Sdt)),64))])):t.createCommentVNode("",!0)],512)]),z.value?(t.openBlock(),t.createElementBlock("div",Ndt,Odt)):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["templates-list",me.value]),ref_key:"templatesListRef",ref:U},[t.createElementVNode("div",{class:"template-card create",onClick:ut[0]||(ut[0]=lt=>i.value=!0)},Mdt),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(se.value,lt=>(t.openBlock(),t.createBlock(sot,{key:lt.id,template:lt,"user-id":e.userId,onGenerarReporte:Ot=>{L.value=lt.id,P.value=lt.template_type,V.value=lt,p.value=!0},onRenombrar:Ot=>{E.value=lt.id,o.value=Ot,l.value=lt.template_type,c.value=!0},onDuplicar:Ot=>{S.value=lt.id,s.value=Ot,a.value=!0},onEliminar:Ot=>{f.value=Ot.name,g.value=Ot.id,k.value=!0},onEditTemplate:_e},null,8,["template","user-id","onGenerarReporte","onRenombrar","onDuplicar","onEliminar"]))),128))],2)),i.value?(t.openBlock(),t.createBlock(NJ,{key:2,token:e.token,team:e.team,onClose:ut[1]||(ut[1]=lt=>i.value=!1),onOpenModalNewTemplate:rt},null,8,["token","team"])):t.createCommentVNode("",!0),p.value?(t.openBlock(),t.createBlock(Nst,{key:3,"user-id":e.userId,token:e.token,team:e.team,"template-id":L.value,"template-type":P.value,template:V.value,"show-error409-on-mount":d.value,onClose:Ue,onSwitchToReports:ut[2]||(ut[2]=lt=>dt.$emit("switch-to-reports")),onOpenConfigurarContenido:qe},null,8,["user-id","token","team","template-id","template-type","template","show-error409-on-mount"])):t.createCommentVNode("",!0),T.value?(t.openBlock(),t.createBlock(xdt,{key:4,"has-rival":!0,token:e.token,template:((Ye=x.value)==null?void 0:Ye.template)||null,team:e.team,partido:((st=x.value)==null?void 0:st.partido)||null,"config-data":x.value,onClose:ut[3]||(ut[3]=lt=>T.value=!1),onBack:Re,onNext:We},null,8,["token","template","team","partido","config-data"])):t.createCommentVNode("",!0),c.value?(t.openBlock(),t.createBlock(Wst,{key:5,initialName:o.value,token:e.token,"template-id":E.value,"template-type":l.value,"user-id":e.userId,onRefresh:ut[4]||(ut[4]=lt=>Y()),onClose:ut[5]||(ut[5]=lt=>c.value=!1),onRename:ut[6]||(ut[6]=lt=>{c.value=!1})},null,8,["initialName","token","template-id","template-type","user-id"])):t.createCommentVNode("",!0),a.value?(t.openBlock(),t.createBlock(tlt,{key:6,initialName:s.value,token:e.token,"template-id":S.value,onClose:ut[7]||(ut[7]=lt=>a.value=!1),onTemplateDuplicated:ut[8]||(ut[8]=lt=>{a.value=!1,Y()})},null,8,["initialName","token","template-id"])):t.createCommentVNode("",!0),k.value?(t.openBlock(),t.createBlock(clt,{key:7,"template-id":g.value,"user-id":e.userId,token:e.token,onClose:ut[9]||(ut[9]=lt=>k.value=!1),onTemplateDeleted:ut[10]||(ut[10]=lt=>{k.value=!1,Y()})},null,8,["template-id","user-id","token"])):t.createCommentVNode("",!0)],512)}}},[["__scopeId","data-v-2565ffde"]]),LA=e=>(t.pushScopeId("data-v-d17eb1eb"),e=e(),t.popScopeId(),e),Cdt={class:"tooltip-report-options"},zdt=LA(()=>t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",alt:"Renombrar reporte",class:"icon"},null,-1)),Vdt=LA(()=>t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-download.svg",alt:"Descargar reporte",class:"icon"},null,-1)),Pdt=LA(()=>t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-delete.svg",alt:"Eliminar reporte",class:"icon"},null,-1)),Adt=ov({__name:"TooltipReportOptions",emits:["ver-reporte","renombrar","editar","duplicar","descargar","eliminar"],setup(e,{emit:r}){return(n,v)=>(t.openBlock(),t.createElementBlock("div",Cdt,[t.createElementVNode("ul",null,[t.createElementVNode("li",{class:"option",onClick:v[0]||(v[0]=$=>n.$emit("renombrar"))},[zdt,t.createTextVNode(" Renombrar reporte ")]),t.createElementVNode("li",{class:"option",onClick:v[1]||(v[1]=$=>n.$emit("descargar"))},[Vdt,t.createTextVNode(" Descargar reporte ")]),t.createElementVNode("li",{class:"option",onClick:v[2]||(v[2]=$=>n.$emit("eliminar"))},[Pdt,t.createTextVNode(" Eliminar reporte ")])])]))}},[["__scopeId","data-v-d17eb1eb"]]);function U4(e){if(!e)return"";const r=new Date(e);if(isNaN(r.getTime()))return"";const n=r.getDate(),v=r.toLocaleDateString("es-ES",{month:"short"}),$=r.getFullYear();return`${n} ${v}, ${$}`}const Rdt=e=>(t.pushScopeId("data-v-bb7e7ba7"),e=e(),t.popScopeId(),e),Udt={class:"prematch-bg"},Fdt={class:"background-shields"},Idt={class:"shield-left"},qdt=["src"],jdt={class:"shield-right"},Ddt=["src"],Wdt=Rdt(()=>t.createElementVNode("div",{class:"title"},[t.createTextVNode("Análisis "),t.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),Kdt={class:"subtitle"},Bdt={class:"jornada"},Xdt={class:"fecha"},Gdt={class:"teams-row"},Zdt={class:"team team-local"},Jdt={class:"escudo-svg"},Hdt=["src"],Ydt={class:"team-name"},Qdt={class:"team team-visitor"},$dt={class:"escudo-svg"},ept=["src"],tpt={class:"team-name"},rpt=ov({__name:"AnalisisPrematchType1",props:{report:{type:Object,default:()=>({})}},setup(e){function r(v){return v?v.replace("Matchday","J").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SI").replace("Playoffs 4","SV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"):""}const n=e;return(v,$)=>(t.openBlock(),t.createElementBlock("div",Udt,[t.createElementVNode("div",Fdt,[t.createElementVNode("div",Idt,[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+n.report.game.home_team+".png",alt:"Escudo local"},null,8,qdt)]),t.createElementVNode("div",jdt,[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+n.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,Ddt)])]),Wdt,t.createElementVNode("div",Kdt,[t.createElementVNode("span",Bdt,t.toDisplayString(r(n.report.game.matchday_name)),1),t.createElementVNode("span",Xdt," - "+t.toDisplayString(t.unref(U4)(n.report.game.date_time_utc)),1)]),t.createElementVNode("div",Gdt,[t.createElementVNode("div",Zdt,[t.createElementVNode("span",Jdt,[t.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.home_team+".png"},null,8,Hdt)]),t.createElementVNode("span",Ydt,t.toDisplayString(n.report.game.home_team_acronym),1)]),t.createElementVNode("div",Qdt,[t.createElementVNode("span",$dt,[t.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.visiting_team+".png"},null,8,ept)]),t.createElementVNode("span",tpt,t.toDisplayString(n.report.game.visiting_team_acronym),1)])])]))}},[["__scopeId","data-v-bb7e7ba7"]]),n7=e=>(t.pushScopeId("data-v-7dd14646"),e=e(),t.popScopeId(),e),npt={class:"prematch-bg"},apt={class:"background-shields"},ipt={class:"shield-left"},opt=["src"],spt={class:"shield-right"},lpt=["src"],cpt=n7(()=>t.createElementVNode("div",{class:"title"},[t.createTextVNode("Análisis "),t.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),upt={class:"subtitle"},dpt={class:"jornada"},ppt={class:"fecha"},hpt={class:"teams-grid"},fpt={class:"row row-top"},mpt={class:"team team-local"},ypt={class:"escudo-svg"},gpt=["src"],vpt={class:"team-name"},bpt={class:"score"},xpt={class:"score-text"},_pt={class:"team team-visitor"},wpt={class:"team-name"},Tpt={class:"escudo-svg"},Spt=["src"],kpt={class:"row row-bottom"},Lpt={class:"team-stats"},Npt=t.createStaticVNode('<span class="stat ball" data-v-7dd14646><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-7dd14646><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path></svg></span>',1),Opt={class:"stat red"},Mpt=n7(()=>t.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})],-1)),Ept={class:"stat-number"},Cpt={class:"stat yellow"},zpt=n7(()=>t.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})],-1)),Vpt={class:"stat-number"},Ppt=n7(()=>t.createElementVNode("div",{class:"empty"},null,-1)),Apt={class:"team-stats"},Rpt={class:"stat-number"},Upt=n7(()=>t.createElementVNode("span",{class:"stat yellow"},[t.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})])],-1)),Fpt={class:"stat-number"},Ipt=n7(()=>t.createElementVNode("span",{class:"stat red"},[t.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})])],-1)),qpt=t.createStaticVNode('<span class="stat ball" data-v-7dd14646><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-7dd14646><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path></svg></span>',1),jpt=ov({__name:"AnalisisPostMatchType1",props:{report:{type:Object,default:()=>({})}},setup(e){function r(c){return c?c.replace("Matchday","J").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SI").replace("Playoffs 4","SV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"):""}const n=e,v=t.computed(()=>{var k,T,x;const c=(x=(T=(k=n.report)==null?void 0:k.game)==null?void 0:T.minutes)==null?void 0:x.home_goals_minutes;if(!Array.isArray(c)||c.length===0)return null;const a=c.map(d=>{const o=d.match(/(\d+)'$/);return o?o[1]+"'":""}).filter(d=>d!=="");if(a.length>5){const d=a.slice(0,5).join(", "),o=a.slice(5).join(", ");return`${d}
|
|
8003
8003
|
${o}`}return a.join(", ")}),$=t.computed(()=>{var k,T,x;const c=(x=(T=(k=n.report)==null?void 0:k.game)==null?void 0:T.minutes)==null?void 0:x.visiting_goals_minutes;if(!Array.isArray(c)||c.length===0)return null;const a=c.map(d=>{const o=d.match(/(\d+)'$/);return o?o[1]+"'":""}).filter(d=>d!=="");if(a.length>5){const d=a.slice(0,5).join(", "),o=a.slice(5).join(", ");return`${d}
|
|
8004
8004
|
${o}`}return a.join(", ")}),h=t.computed(()=>{var a,k,T;const c=(T=(k=(a=n.report)==null?void 0:a.game)==null?void 0:k.minutes)==null?void 0:T.home_red_cards_minutes;return Array.isArray(c)&&c.length>0?c.length:null}),u=t.computed(()=>{var a,k,T;const c=(T=(k=(a=n.report)==null?void 0:a.game)==null?void 0:k.minutes)==null?void 0:T.home_yellow_cards_minutes;return Array.isArray(c)&&c.length>0?c.length:null}),i=t.computed(()=>{var a,k,T;const c=(T=(k=(a=n.report)==null?void 0:a.game)==null?void 0:k.minutes)==null?void 0:T.away_yellow_cards_minutes;return Array.isArray(c)&&c.length>0?c.length:null}),p=t.computed(()=>{var a,k,T;const c=(T=(k=(a=n.report)==null?void 0:a.game)==null?void 0:k.minutes)==null?void 0:T.away_red_cards_minutes;return Array.isArray(c)&&c.length>0?c.length:null});return(c,a)=>(t.openBlock(),t.createElementBlock("div",npt,[t.createElementVNode("div",apt,[t.createElementVNode("div",ipt,[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+e.report.game.home_team+".png",alt:"Escudo local"},null,8,opt)]),t.createElementVNode("div",spt,[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+e.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,lpt)])]),cpt,t.createElementVNode("div",upt,[t.createElementVNode("span",dpt,t.toDisplayString(r(e.report.game.matchday_name)),1),t.createElementVNode("span",ppt," - "+t.toDisplayString(t.unref(U4)(e.report.game.date_time_utc)),1)]),t.createElementVNode("div",hpt,[t.createElementVNode("div",fpt,[t.createElementVNode("div",mpt,[t.createElementVNode("span",ypt,[t.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.report.game.home_team+".png"},null,8,gpt)]),t.createElementVNode("span",vpt,t.toDisplayString(e.report.game.home_team_acronym),1)]),t.createElementVNode("div",bpt,[t.createElementVNode("span",xpt,t.toDisplayString(e.report.game.score[0])+":"+t.toDisplayString(e.report.game.score[1]),1)]),t.createElementVNode("div",_pt,[t.createElementVNode("span",wpt,t.toDisplayString(e.report.game.visiting_team_acronym),1),t.createElementVNode("span",Tpt,[t.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.report.game.visiting_team+".png"},null,8,Spt)])])]),t.createElementVNode("div",kpt,[t.createElementVNode("div",Lpt,[Npt,v.value!==null?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["stat time",{"two-lines":v.value&&v.value.includes(`
|
|
8005
8005
|
`)}])},t.toDisplayString(v.value),3)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["separator",{"two-lines":v.value&&v.value.includes(`
|
|
@@ -121160,11 +121160,11 @@ const M4t = {
|
|
|
121160
121160
|
},
|
|
121161
121161
|
setup(t) {
|
|
121162
121162
|
const e = t, r = pN(
|
|
121163
|
-
() => import("./FilterSubcategories-a9b32cc9-_h5FCZ4r-OIyEYwFv-
|
|
121163
|
+
() => import("./FilterSubcategories-a9b32cc9-_h5FCZ4r-OIyEYwFv-1Nea8HbT.js")
|
|
121164
121164
|
), g = pN(
|
|
121165
|
-
() => import("./FilterConditions-55d68355-DMqzcKBO-CsToJXE0-
|
|
121165
|
+
() => import("./FilterConditions-55d68355-DMqzcKBO-CsToJXE0-DpliHgxx.js")
|
|
121166
121166
|
), Q = pN(
|
|
121167
|
-
() => import("./FilterField-59a73e38-CNaE03Ge-BugbPWOu-
|
|
121167
|
+
() => import("./FilterField-59a73e38-CNaE03Ge-BugbPWOu-CpNSOLEJ.js")
|
|
121168
121168
|
), d = [
|
|
121169
121169
|
{
|
|
121170
121170
|
name: "Sub categorías",
|
|
@@ -293563,7 +293563,7 @@ const FP = (t) => (O0("data-v-7f431c81"), t = t(), M0(), t), $1e = { class: "cor
|
|
|
293563
293563
|
], 64);
|
|
293564
293564
|
};
|
|
293565
293565
|
}
|
|
293566
|
-
}, dve = /* @__PURE__ */ Bv(pve, [["__scopeId", "data-v-479f5c78"]]), IP = (t) => (O0("data-v-
|
|
293566
|
+
}, dve = /* @__PURE__ */ Bv(pve, [["__scopeId", "data-v-479f5c78"]]), IP = (t) => (O0("data-v-2565ffde"), t = t(), M0(), t), hve = { class: "templates-header" }, fve = { class: "count" }, mve = {
|
|
293567
293567
|
key: 0,
|
|
293568
293568
|
class: "sort-options"
|
|
293569
293569
|
}, yve = ["onClick"], gve = {
|
|
@@ -293700,7 +293700,7 @@ const FP = (t) => (O0("data-v-7f431c81"), t = t(), M0(), t), $1e = { class: "cor
|
|
|
293700
293700
|
return;
|
|
293701
293701
|
const Je = {
|
|
293702
293702
|
template_id: b.value.template.id,
|
|
293703
|
-
user_id:
|
|
293703
|
+
user_id: b.value.template.user_id,
|
|
293704
293704
|
tournament_id: b.value.liga.id || 1,
|
|
293705
293705
|
tournament_name: b.value.liga.name,
|
|
293706
293706
|
season_id: b.value.partido.season_id,
|
|
@@ -293915,7 +293915,7 @@ const FP = (t) => (O0("data-v-7f431c81"), t = t(), M0(), t), $1e = { class: "cor
|
|
|
293915
293915
|
], 512);
|
|
293916
293916
|
};
|
|
293917
293917
|
}
|
|
293918
|
-
}, Ove = /* @__PURE__ */ Bv(Lve, [["__scopeId", "data-v-
|
|
293918
|
+
}, Ove = /* @__PURE__ */ Bv(Lve, [["__scopeId", "data-v-2565ffde"]]), qV = (t) => (O0("data-v-d17eb1eb"), t = t(), M0(), t), Mve = { class: "tooltip-report-options" }, zve = /* @__PURE__ */ qV(() => /* @__PURE__ */ Jt("img", {
|
|
293919
293919
|
src: "https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",
|
|
293920
293920
|
alt: "Renombrar reporte",
|
|
293921
293921
|
class: "icon"
|
package/package.json
CHANGED
|
@@ -402,7 +402,6 @@ async function onNextFromConfigurar(options) {
|
|
|
402
402
|
try {
|
|
403
403
|
// Cerrar ModalConfigurarContenido
|
|
404
404
|
showModalConfigurarContenido.value = false
|
|
405
|
-
|
|
406
405
|
// Aquí podrías guardar las opciones si es necesario para el reporte
|
|
407
406
|
// Por ahora, generar el reporte normalmente
|
|
408
407
|
if (!configurarContenidoData.value) {
|
|
@@ -412,7 +411,7 @@ async function onNextFromConfigurar(options) {
|
|
|
412
411
|
// Generar el reporte con los datos guardados
|
|
413
412
|
const payload = {
|
|
414
413
|
template_id: configurarContenidoData.value.template.id,
|
|
415
|
-
user_id:
|
|
414
|
+
user_id: configurarContenidoData.value.template.user_id,
|
|
416
415
|
tournament_id: configurarContenidoData.value.liga.id || 1,
|
|
417
416
|
tournament_name: configurarContenidoData.value.liga.name,
|
|
418
417
|
season_id: configurarContenidoData.value.partido.season_id,
|