@golstats/gsc-reports 1.0.130 → 1.0.131

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 (25) hide show
  1. package/README.md +2 -2
  2. package/dist/{FilterConditions-55d68355-DMqzcKBO-DZiNhes--C3EVnuXA.js → FilterConditions-55d68355-DMqzcKBO-B5d657ee-Bx3MwOaz.js} +1 -1
  3. package/dist/{FilterField-59a73e38-CNaE03Ge-BsNGuVTV-CDSXbZXr.js → FilterField-59a73e38-CNaE03Ge-DAfayPkJ-xt4KSb5Q.js} +1 -1
  4. package/dist/{FilterSubcategories-a9b32cc9-_h5FCZ4r-DR0huyz3-BR06QSRk.js → FilterSubcategories-a9b32cc9-_h5FCZ4r-B7VqLyBd-qoru-7Qp.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 +4 -4
  9. package/dist/{index-BonCstdA.js → index-BZqP6GtQ.js} +25 -25
  10. package/package.json +2 -2
  11. package/src/components/elementsTemplates/ModalDeleteTemplate.vue +249 -249
  12. package/src/components/elementsTemplates/ModalSoloEscritorio.vue +83 -83
  13. package/src/components/elementsTemplates/ModalduplicateTemplate.vue +300 -300
  14. package/src/components/elementsTemplates/TooltipReportOptions.vue +97 -97
  15. package/src/components/elementsTemplates/TooltipTemplateOptions.vue +168 -168
  16. package/src/components/filters.vue +935 -935
  17. package/src/components/template-report-maker/CoverSelector.vue +165 -165
  18. package/src/components/template-report-maker/ReportView.vue +66 -66
  19. package/src/components/thumbnails-reports/AnalisisPostMatchType1.vue +741 -741
  20. package/src/components/thumbnails-reports/AnalisisPostMatchType2.vue +743 -743
  21. package/src/components/thumbnails-reports/AnalisisPrematchType3.vue +173 -173
  22. package/src/components/thumbnails-reports/AnalisisPrematchType4.vue +173 -173
  23. package/src/index.js +4 -4
  24. package/src/types.d.ts +45 -45
  25. package/src/utils/dateUtils.js +52 -52
@@ -7982,7 +7982,7 @@ uniform ${gi} ${vi} u_${$i};
7982
7982
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(y=>n.set(y)),n}static accessor(t){const r=(this[mZ]=this[mZ]={accessors:{}}).accessors,n=this.prototype;function y($){const f=o9($);r[f]||(cZt(n,$),r[f]=!0)}return eu.isArray(t)?t.forEach(y):y(t),this}};H_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),eu.reduceDescriptors(H_.prototype,({value:t},r)=>{let n=r[0].toUpperCase()+r.slice(1);return{get:()=>t,set(y){this[n]=y}}}),eu.freezeMethods(H_);function YP(t,r){const n=this||i9,y=r||n,$=H_.from(y.headers);let f=y.data;return eu.forEach(t,function(u){f=u.call(n,f,$.normalize(),r?r.status:void 0)}),$.normalize(),f}function yZ(t){return!!(t&&t.__CANCEL__)}function Hk(t,r,n){Rm.call(this,t??"canceled",Rm.ERR_CANCELED,r,n),this.name="CanceledError"}eu.inherits(Hk,Rm,{__CANCEL__:!0});function gZ(t,r,n){const y=n.config.validateStatus;!n.status||!y||y(n.status)?t(n):r(new Rm("Request failed with status code "+n.status,[Rm.ERR_BAD_REQUEST,Rm.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function uZt(t){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return r&&r[1]||""}function dZt(t,r){t=t||10;const n=new Array(t),y=new Array(t);let $=0,f=0,u;return r=r!==void 0?r:1e3,function(i){const d=Date.now(),l=y[f];u||(u=d),n[$]=i,y[$]=d;let a=f,S=0;for(;a!==$;)S+=n[a++],a=a%t;if($=($+1)%t,$===f&&(f=(f+1)%t),d-u<r)return;const T=l&&d-l;return T?Math.round(S*1e3/T):void 0}}function pZt(t,r){let n=0,y=1e3/r,$,f;const u=(i,d=Date.now())=>{n=d,$=null,f&&(clearTimeout(f),f=null),t(...i)};return[(...i)=>{const d=Date.now(),l=d-n;l>=y?u(i,d):($=i,f||(f=setTimeout(()=>{f=null,u($)},y-l)))},()=>$&&u($)]}const dO=(t,r,n=3)=>{let y=0;const $=dZt(50,250);return pZt(f=>{const u=f.loaded,i=f.lengthComputable?f.total:void 0,d=u-y,l=$(d),a=u<=i;y=u;const S={loaded:u,total:i,progress:i?u/i:void 0,bytes:d,rate:l||void 0,estimated:l&&i&&a?(i-u)/l:void 0,event:f,lengthComputable:i!=null,[r?"download":"upload"]:!0};t(S)},n)},vZ=(t,r)=>{const n=t!=null;return[y=>r[0]({lengthComputable:n,total:t,loaded:y}),r[1]]},bZ=t=>(...r)=>eu.asap(()=>t(...r)),hZt=Dx.hasStandardBrowserEnv?((t,r)=>n=>(n=new URL(n,Dx.origin),t.protocol===n.protocol&&t.host===n.host&&(r||t.port===n.port)))(new URL(Dx.origin),Dx.navigator&&/(msie|trident)/i.test(Dx.navigator.userAgent)):()=>!0,fZt=Dx.hasStandardBrowserEnv?{write(t,r,n,y,$,f,u){if(typeof document>"u")return;const i=[`${t}=${encodeURIComponent(r)}`];eu.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),eu.isString(y)&&i.push(`path=${y}`),eu.isString($)&&i.push(`domain=${$}`),f===!0&&i.push("secure"),eu.isString(u)&&i.push(`SameSite=${u}`),document.cookie=i.join("; ")},read(t){if(typeof document>"u")return null;const r=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return r?decodeURIComponent(r[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function mZt(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function yZt(t,r){return r?t.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):t}function xZ(t,r,n){let y=!mZt(r);return t&&(y||n==!1)?yZt(t,r):r}const _Z=t=>t instanceof H_?{...t}:t;function LS(t,r){r=r||{};const n={};function y(l,a,S,T){return eu.isPlainObject(l)&&eu.isPlainObject(a)?eu.merge.call({caseless:T},l,a):eu.isPlainObject(a)?eu.merge({},a):eu.isArray(a)?a.slice():a}function $(l,a,S,T){if(eu.isUndefined(a)){if(!eu.isUndefined(l))return y(void 0,l,S,T)}else return y(l,a,S,T)}function f(l,a){if(!eu.isUndefined(a))return y(void 0,a)}function u(l,a){if(eu.isUndefined(a)){if(!eu.isUndefined(l))return y(void 0,l)}else return y(void 0,a)}function i(l,a,S){if(S in r)return y(l,a);if(S in t)return y(void 0,l)}const d={url:f,method:f,data:f,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:i,headers:(l,a,S)=>$(_Z(l),_Z(a),S,!0)};return eu.forEach(Object.keys({...t,...r}),function(l){const a=d[l]||$,S=a(t[l],r[l],l);eu.isUndefined(S)&&a!==i||(n[l]=S)}),n}const wZ=t=>{const r=LS({},t);let{data:n,withXSRFToken:y,xsrfHeaderName:$,xsrfCookieName:f,headers:u,auth:i}=r;if(r.headers=u=H_.from(u),r.url=dZ(xZ(r.baseURL,r.url,r.allowAbsoluteUrls),t.params,t.paramsSerializer),i&&u.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),eu.isFormData(n)){if(Dx.hasStandardBrowserEnv||Dx.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(eu.isFunction(n.getHeaders)){const d=n.getHeaders(),l=["content-type","content-length"];Object.entries(d).forEach(([a,S])=>{l.includes(a.toLowerCase())&&u.set(a,S)})}}if(Dx.hasStandardBrowserEnv&&(y&&eu.isFunction(y)&&(y=y(r)),y||y!==!1&&hZt(r.url))){const d=$&&f&&fZt.read(f);d&&u.set($,d)}return r},gZt=typeof XMLHttpRequest<"u",vZt=gZt&&function(t){return new Promise(function(r,n){const y=wZ(t);let $=y.data;const f=H_.from(y.headers).normalize();let{responseType:u,onUploadProgress:i,onDownloadProgress:d}=y,l,a,S,T,b;function p(){T&&T(),b&&b(),y.cancelToken&&y.cancelToken.unsubscribe(l),y.signal&&y.signal.removeEventListener("abort",l)}let s=new XMLHttpRequest;s.open(y.method.toUpperCase(),y.url,!0),s.timeout=y.timeout;function c(){if(!s)return;const h=H_.from("getAllResponseHeaders"in s&&s.getAllResponseHeaders()),v={data:!u||u==="text"||u==="json"?s.responseText:s.response,status:s.status,statusText:s.statusText,headers:h,config:t,request:s};gZ(function(k){r(k),p()},function(k){n(k),p()},v),s=null}"onloadend"in s?s.onloadend=c:s.onreadystatechange=function(){!s||s.readyState!==4||s.status===0&&!(s.responseURL&&s.responseURL.indexOf("file:")===0)||setTimeout(c)},s.onabort=function(){s&&(n(new Rm("Request aborted",Rm.ECONNABORTED,t,s)),s=null)},s.onerror=function(h){const v=h&&h.message?h.message:"Network Error",k=new Rm(v,Rm.ERR_NETWORK,t,s);k.event=h||null,n(k),s=null},s.ontimeout=function(){let h=y.timeout?"timeout of "+y.timeout+"ms exceeded":"timeout exceeded";const v=y.transitional||hZ;y.timeoutErrorMessage&&(h=y.timeoutErrorMessage),n(new Rm(h,v.clarifyTimeoutError?Rm.ETIMEDOUT:Rm.ECONNABORTED,t,s)),s=null},$===void 0&&f.setContentType(null),"setRequestHeader"in s&&eu.forEach(f.toJSON(),function(h,v){s.setRequestHeader(v,h)}),eu.isUndefined(y.withCredentials)||(s.withCredentials=!!y.withCredentials),u&&u!=="json"&&(s.responseType=y.responseType),d&&([S,b]=dO(d,!0),s.addEventListener("progress",S)),i&&s.upload&&([a,T]=dO(i),s.upload.addEventListener("progress",a),s.upload.addEventListener("loadend",T)),(y.cancelToken||y.signal)&&(l=h=>{s&&(n(!h||h.type?new Hk(null,t,s):h),s.abort(),s=null)},y.cancelToken&&y.cancelToken.subscribe(l),y.signal&&(y.signal.aborted?l():y.signal.addEventListener("abort",l)));const o=uZt(y.url);if(o&&Dx.protocols.indexOf(o)===-1){n(new Rm("Unsupported protocol "+o+":",Rm.ERR_BAD_REQUEST,t));return}s.send($||null)})},bZt=(t,r)=>{const{length:n}=t=t?t.filter(Boolean):[];if(r||n){let y=new AbortController,$;const f=function(l){if(!$){$=!0,i();const a=l instanceof Error?l:this.reason;y.abort(a instanceof Rm?a:new Hk(a instanceof Error?a.message:a))}};let u=r&&setTimeout(()=>{u=null,f(new Rm(`timeout ${r} of ms exceeded`,Rm.ETIMEDOUT))},r);const i=()=>{t&&(u&&clearTimeout(u),u=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(f):l.removeEventListener("abort",f)}),t=null)};t.forEach(l=>l.addEventListener("abort",f));const{signal:d}=y;return d.unsubscribe=()=>eu.asap(i),d}},xZt=function*(t,r){let n=t.byteLength;if(n<r){yield t;return}let y=0,$;for(;y<n;)$=y+r,yield t.slice(y,$),y=$},_Zt=async function*(t,r){for await(const n of wZt(t))yield*xZt(n,r)},wZt=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const r=t.getReader();try{for(;;){const{done:n,value:y}=await r.read();if(n)break;yield y}}finally{await r.cancel()}},TZ=(t,r,n,y)=>{const $=_Zt(t,r);let f=0,u,i=d=>{u||(u=!0,y&&y(d))};return new ReadableStream({async pull(d){try{const{done:l,value:a}=await $.next();if(l){i(),d.close();return}let S=a.byteLength;if(n){let T=f+=S;n(T)}d.enqueue(new Uint8Array(a))}catch(l){throw i(l),l}},cancel(d){return i(d),$.return()}},{highWaterMark:2})},SZ=64*1024,{isFunction:pO}=eu,TZt=(({Request:t,Response:r})=>({Request:t,Response:r}))(eu.global),{ReadableStream:kZ,TextEncoder:LZ}=eu.global,CZ=(t,...r)=>{try{return!!t(...r)}catch{return!1}},SZt=t=>{t=eu.merge.call({skipUndefined:!0},TZt,t);const{fetch:r,Request:n,Response:y}=t,$=r?pO(r):typeof fetch=="function",f=pO(n),u=pO(y);if(!$)return!1;const i=$&&pO(kZ),d=$&&(typeof LZ=="function"?(p=>s=>p.encode(s))(new LZ):async p=>new Uint8Array(await new n(p).arrayBuffer())),l=f&&i&&CZ(()=>{let p=!1;const s=new n(Dx.origin,{body:new kZ,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!s}),a=u&&i&&CZ(()=>eu.isReadableStream(new y("").body)),S={stream:a&&(p=>p.body)};$&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!S[p]&&(S[p]=(s,c)=>{let o=s&&s[p];if(o)return o.call(s);throw new Rm(`Response type '${p}' is not supported`,Rm.ERR_NOT_SUPPORT,c)})});const T=async p=>{if(p==null)return 0;if(eu.isBlob(p))return p.size;if(eu.isSpecCompliantForm(p))return(await new n(Dx.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(eu.isArrayBufferView(p)||eu.isArrayBuffer(p))return p.byteLength;if(eu.isURLSearchParams(p)&&(p=p+""),eu.isString(p))return(await d(p)).byteLength},b=async(p,s)=>eu.toFiniteNumber(p.getContentLength())??T(s);return async p=>{let{url:s,method:c,data:o,signal:h,cancelToken:v,timeout:k,onDownloadProgress:L,onUploadProgress:E,responseType:P,headers:V,withCredentials:I="same-origin",fetchOptions:j}=wZ(p),F=r||fetch;P=P?(P+"").toLowerCase():"text";let D=bZt([h,v&&v.toAbortSignal()],k),U=null;const M=D&&D.unsubscribe&&(()=>{D.unsubscribe()});let X;try{if(E&&l&&c!=="get"&&c!=="head"&&(X=await b(V,o))!==0){let bt=new n(s,{method:"POST",body:o,duplex:"half"}),xt;if(eu.isFormData(o)&&(xt=bt.headers.get("content-type"))&&V.setContentType(xt),bt.body){const[Pt,qt]=vZ(X,dO(bZ(E)));o=TZ(bt.body,SZ,Pt,qt)}}eu.isString(I)||(I=I?"include":"omit");const O=f&&"credentials"in n.prototype,Y={...j,signal:D,method:c.toUpperCase(),headers:V.normalize().toJSON(),body:o,duplex:"half",credentials:O?I:void 0};U=f&&new n(s,Y);let st=await(f?F(U,j):F(s,Y));const mt=a&&(P==="stream"||P==="response");if(a&&(L||mt&&M)){const bt={};["status","statusText","headers"].forEach(_t=>{bt[_t]=st[_t]});const xt=eu.toFiniteNumber(st.headers.get("content-length")),[Pt,qt]=L&&vZ(xt,dO(bZ(L),!0))||[];st=new y(TZ(st.body,SZ,Pt,()=>{qt&&qt(),M&&M()}),bt)}P=P||"text";let yt=await S[eu.findKey(S,P)||"text"](st,p);return!mt&&M&&M(),await new Promise((bt,xt)=>{gZ(bt,xt,{data:yt,headers:H_.from(st.headers),status:st.status,statusText:st.statusText,config:p,request:U})})}catch(O){throw M&&M(),O&&O.name==="TypeError"&&/Load failed|fetch/i.test(O.message)?Object.assign(new Rm("Network Error",Rm.ERR_NETWORK,p,U),{cause:O.cause||O}):Rm.from(O,O&&O.code,p,U)}}},kZt=new Map,NZ=t=>{let r=t&&t.env||{};const{fetch:n,Request:y,Response:$}=r,f=[y,$,n];let u=f.length,i=u,d,l,a=kZt;for(;i--;)d=f[i],l=a.get(d),l===void 0&&a.set(d,l=i?new Map:SZt(r)),a=l;return l};NZ();const QP={http:DGt,xhr:vZt,fetch:{get:NZ}};eu.forEach(QP,(t,r)=>{if(t){try{Object.defineProperty(t,"name",{value:r})}catch{}Object.defineProperty(t,"adapterName",{value:r})}});const OZ=t=>`- ${t}`,LZt=t=>eu.isFunction(t)||t===null||t===!1;function CZt(t,r){t=eu.isArray(t)?t:[t];const{length:n}=t;let y,$;const f={};for(let u=0;u<n;u++){y=t[u];let i;if($=y,!LZt(y)&&($=QP[(i=String(y)).toLowerCase()],$===void 0))throw new Rm(`Unknown adapter '${i}'`);if($&&(eu.isFunction($)||($=$.get(r))))break;f[i||"#"+u]=$}if(!$){const u=Object.entries(f).map(([d,l])=>`adapter ${d} `+(l===!1?"is not supported by the environment":"is not available in the build"));let i=n?u.length>1?`since :
7983
7983
  `+u.map(OZ).join(`
7984
7984
  `):" "+OZ(u[0]):"as no adapter specified";throw new Rm("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return $}const EZ={getAdapter:CZt,adapters:QP};function $P(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Hk(null,t)}function zZ(t){return $P(t),t.headers=H_.from(t.headers),t.data=YP.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),EZ.getAdapter(t.adapter||i9.adapter,t)(t).then(function(r){return $P(t),r.data=YP.call(t,t.transformResponse,r),r.headers=H_.from(r.headers),r},function(r){return yZ(r)||($P(t),r&&r.response&&(r.response.data=YP.call(t,t.transformResponse,r.response),r.response.headers=H_.from(r.response.headers))),Promise.reject(r)})}const MZ="1.13.0",hO={};["object","boolean","number","function","string","symbol"].forEach((t,r)=>{hO[t]=function(n){return typeof n===t||"a"+(r<1?"n ":" ")+t}});const VZ={};hO.transitional=function(t,r,n){function y($,f){return"[Axios v"+MZ+"] Transitional option '"+$+"'"+f+(n?". "+n:"")}return($,f,u)=>{if(t===!1)throw new Rm(y(f," has been removed"+(r?" in "+r:"")),Rm.ERR_DEPRECATED);return r&&!VZ[f]&&(VZ[f]=!0,console.warn(y(f," has been deprecated since v"+r+" and will be removed in the near future"))),t?t($,f,u):!0}},hO.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function NZt(t,r,n){if(typeof t!="object")throw new Rm("options must be an object",Rm.ERR_BAD_OPTION_VALUE);const y=Object.keys(t);let $=y.length;for(;$-- >0;){const f=y[$],u=r[f];if(u){const i=t[f],d=i===void 0||u(i,f,t);if(d!==!0)throw new Rm("option "+f+" must be "+d,Rm.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Rm("Unknown option "+f,Rm.ERR_BAD_OPTION)}}const fO={assertOptions:NZt,validators:hO},F5=fO.validators;let CS=class{constructor(t){this.defaults=t||{},this.interceptors={request:new pZ,response:new pZ}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let y={};Error.captureStackTrace?Error.captureStackTrace(y):y=new Error;const $=y.stack?y.stack.replace(/^.+\n/,""):"";try{n.stack?$&&!String(n.stack).endsWith($.replace(/^.+\n.+\n/,""))&&(n.stack+=`
7985
- `+$):n.stack=$}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=LS(this.defaults,r);const{transitional:n,paramsSerializer:y,headers:$}=r;n!==void 0&&fO.assertOptions(n,{silentJSONParsing:F5.transitional(F5.boolean),forcedJSONParsing:F5.transitional(F5.boolean),clarifyTimeoutError:F5.transitional(F5.boolean)},!1),y!=null&&(eu.isFunction(y)?r.paramsSerializer={serialize:y}:fO.assertOptions(y,{encode:F5.function,serialize:F5.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),fO.assertOptions(r,{baseUrl:F5.spelling("baseURL"),withXsrfToken:F5.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let f=$&&eu.merge($.common,$[r.method]);$&&eu.forEach(["delete","get","head","post","put","patch","common"],b=>{delete $[b]}),r.headers=H_.concat(f,$);const u=[];let i=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(i=i&&b.synchronous,u.unshift(b.fulfilled,b.rejected))});const d=[];this.interceptors.response.forEach(function(b){d.push(b.fulfilled,b.rejected)});let l,a=0,S;if(!i){const b=[zZ.bind(this),void 0];for(b.unshift(...u),b.push(...d),S=b.length,l=Promise.resolve(r);a<S;)l=l.then(b[a++],b[a++]);return l}S=u.length;let T=r;for(;a<S;){const b=u[a++],p=u[a++];try{T=b(T)}catch(s){p.call(this,s);break}}try{l=zZ.call(this,T)}catch(b){return Promise.reject(b)}for(a=0,S=d.length;a<S;)l=l.then(d[a++],d[a++]);return l}getUri(t){t=LS(this.defaults,t);const r=xZ(t.baseURL,t.url,t.allowAbsoluteUrls);return dZ(r,t.params,t.paramsSerializer)}};eu.forEach(["delete","get","head","options"],function(t){CS.prototype[t]=function(r,n){return this.request(LS(n||{},{method:t,url:r,data:(n||{}).data}))}}),eu.forEach(["post","put","patch"],function(t){function r(n){return function(y,$,f){return this.request(LS(f||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:y,data:$}))}}CS.prototype[t]=r(),CS.prototype[t+"Form"]=r(!0)});let OZt=class uQ{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function($){n=$});const y=this;this.promise.then($=>{if(!y._listeners)return;let f=y._listeners.length;for(;f-- >0;)y._listeners[f]($);y._listeners=null}),this.promise.then=$=>{let f;const u=new Promise(i=>{y.subscribe(i),f=i}).then($);return u.cancel=function(){y.unsubscribe(f)},u},r(function($,f,u){y.reason||(y.reason=new Hk($,f,u),n(y.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const n=this._listeners.indexOf(r);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const r=new AbortController,n=y=>{r.abort(y)};return this.subscribe(n),r.signal.unsubscribe=()=>this.unsubscribe(n),r.signal}static source(){let r;return{token:new uQ(function(n){r=n}),cancel:r}}};function EZt(t){return function(r){return t.apply(null,r)}}function zZt(t){return eu.isObject(t)&&t.isAxiosError===!0}const tA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(tA).forEach(([t,r])=>{tA[r]=t});function PZ(t){const r=new CS(t),n=HG(CS.prototype.request,r);return eu.extend(n,CS.prototype,r,{allOwnKeys:!0}),eu.extend(n,r,null,{allOwnKeys:!0}),n.create=function(y){return PZ(LS(t,y))},n}const xv=PZ(i9);xv.Axios=CS,xv.CanceledError=Hk,xv.CancelToken=OZt,xv.isCancel=yZ,xv.VERSION=MZ,xv.toFormData=cO,xv.AxiosError=Rm,xv.Cancel=xv.CanceledError,xv.all=function(t){return Promise.all(t)},xv.spread=EZt,xv.isAxiosError=zZt,xv.mergeConfig=LS,xv.AxiosHeaders=H_,xv.formToJSON=t=>fZ(eu.isHTMLForm(t)?new FormData(t):t),xv.getAdapter=EZ.getAdapter,xv.HttpStatusCode=tA,xv.default=xv;const{Axios:$we,AxiosError:t5e,CanceledError:e5e,isCancel:r5e,CancelToken:n5e,VERSION:a5e,all:i5e,Cancel:o5e,isAxiosError:s5e,spread:l5e,toFormData:c5e,AxiosHeaders:u5e,HttpStatusCode:d5e,formToJSON:p5e,getAdapter:h5e,mergeConfig:f5e}=xv,MZt=["gameId","playerId","teamId","x","y","momentOfPlay","section","playId","timeSection"];let eA=null;function VZt(){return eA||(eA=MZt.reduce((t,r,n)=>(t[n]=r,t),{})),eA}const PZt=["playId","playerId","teamId","gameId","categoryId","relatedCategoriesIds","x1","y1","x2","y2","x3","y3","fieldSection","momentOfPlay","playingAs","matchLapse","matchResult","matchResultAtMomentOfPlay","relatedPlayId","touchOrder","timeSection"];let rA=null;function AZt(){return rA||(rA=PZt.reduce((t,r,n)=>(t[n]=r,t),{})),rA}const mO={TO_RIGHT:"toRight",TO_LEFT:"toLeft"},RZt={class:"modal-confirmation"},FZt={class:"modal-confirmation__container"},UZt={class:"modal-confirmation__title"},IZt={class:"modal-confirmation"},qZt={class:"modal-confirmation__container"},jZt={class:"modal-confirmation__title"},DZt={class:"specific-plays-titlecontainer"},WZt={class:"specific-plays-title"},BZt={key:0,class:"specific-plays-title-elegibility"},KZt={key:1},XZt={class:"specific-plays-controls"},GZt={class:"specific-plays-controls11"},ZZt={class:"radio-container"},JZt={key:0,width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},HZt={class:"radio-label"},YZt=["src"],QZt={class:"radio-container"},$Zt={key:0,width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tJt={class:"radio-label"},eJt=["src"],rJt={class:"cont-app-value-incement-second"},nJt={class:"contappvalueincementsecond-value"},aJt={key:0},iJt={class:"contappvalueincementsecond-controls-container"},oJt={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},sJt={class:"text-icon-info"},lJt={class:"cont-app-value-incement-second"},cJt={class:"contappvalueincementsecond-value"},uJt={key:0},dJt={class:"contappvalueincementsecond-controls-container"},pJt={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},hJt={class:"text-icon-info"},fJt={class:"cont-app-value-incement-second"},mJt={class:"contappvalueincementsecond-value"},yJt={key:0},gJt={class:"contappvalueincementsecond-controls-container"},vJt={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},bJt={class:"specific-plays-field__soccer-field"},xJt={class:"game-teams"},_Jt={class:"game-teams__team home"},wJt={key:0,class:"team-logo"},TJt=["src"],SJt={class:"game-teams__team away"},kJt={key:0,class:"team-logo"},LJt=["src"],CJt={class:"specific-plays-field__play-buttons__container"},NJt={key:1,class:"specific-plays-radio-container-movil"},OJt={class:"radio-container"},EJt={class:"radio-label"},zJt=["src"],MJt={class:"radio-container"},VJt={class:"radio-label"},PJt=["src"],AJt={key:0,class:"h-separator"},RJt={key:1,class:"corner-info"},FJt={class:"corner-info__team"},UJt=["src"],IJt={class:"corner-info__details"},qJt={class:"corner-info__details__player"},jJt={class:"corner-info__details__how-was"},yO=.6,DJt=5,WJt=10,BJt=600,KJt=600,XJt=5,GJt={__name:"GSCSpecificPlays",props:{widthContainer:{type:Number,default:1280},selectedCategoryId:{type:Number,default:31},teamIdForAnalysis:{type:Number,default:1},playIdForAnalysis:{type:Number,default:null},seasonIdForAnalysis:{type:Number,default:1325},tournamentSelected:{type:Object,default:()=>({})},advancedFilters:{type:Object,default:()=>({areConnectionsVisible:!1,arePathsVisible:!1,secondsBefore:-1,secondsAfter:1,secondsBeforeAndAfter:0})},filters:{type:Object,default:()=>({isMoment:!1,final:[1,2,3],moment:[1,2,3],playingAs:[1,2],sections:[1,2,3,4,5,6],games:[],players:[],cornertype:31,howWas:[120,126,327,133],zona:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],whathappened:[583,585,587,589,584,586,588,590,122,128,136,142,123,129,137,143,124,130,138,144,125,131,139,14,146,147,327,133],isWhatHappenedFull:!0,isZoneFull:!0})},isGameOnly:{type:Boolean,default:!1},game:{type:Object,default:()=>({id:62323,home_team:1,away_team:14,season:1325,game_status:4,home_acronym:"CHI",away_acronym:"SAN",logo_home:"https://golstatsimages.blob.core.windows.net/teams-80/1.png",logo_away:"https://golstatsimages.blob.core.windows.net/teams-80/14.png"})},gameIdForAnalysis:{type:Number,default:null},isAgainstMode:{type:Boolean,default:!1},areFiltersOpen:{type:Boolean,default:!1},isTacticVisible:{type:Boolean,default:!0},isSynchronization:{type:Boolean,default:!1},canPlayVideos:{type:Boolean,default:!0},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])},isFieldOnly:{type:Boolean,default:!0},isTemplateMode:{type:Boolean,default:!1},isCornerInfoVisible:{type:Boolean,default:!1},isNullCornerData:{type:Boolean,default:!1}},emits:["open-media-player","corners-filled","changelateralidad"],setup(t,{emit:r}){let n=0;const y=t,$=VZt(),f=AZt(),u=[{text:"Rematado fue gol",categoriesIds:[583,585,587,589]},{text:"Rematado no fue gol",categoriesIds:[584,586,588,590]},{text:"Rematado sin destino",categoriesIds:[122,128,136,142]},{text:y.tournamentSelected.is_female==1?"Ganado por portera rival":"Ganado por portero rival",categoriesIds:[123,129,137,143]},{text:y.tournamentSelected.is_female==1?"Ganado por jugadora rival":"Ganado por jugador rival",categoriesIds:[124,130,138,144]},{text:"Sin destino",categoriesIds:[125,131,139,145]}],i=new Map([[120,"Comba hacia afuera"],[134,"Comba hacia afuera"],[126,"Comba hacia adentro"],[140,"Comba hacia adentro"],[327,"Raz de área"],[146,"Raz de área"],[133,"En corto"],[147,"En corto"]]),d=u.reduce((tr,Fe)=>(Fe.categoriesIds.forEach(sr=>{tr.set(sr,Fe.text)}),tr),new Map),l={headers:{Authorization:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}},a=r,S=e.ref(null),T=e.ref("0"),b=e.ref(["-1","0"]),p=e.ref(new Map),s=e.ref(!y.isTacticVisible),c=e.ref(!1),o=e.ref([]),h=e.ref(!0),v=e.ref(!0),k=e.ref(!1),L=e.ref(!1),E=e.ref(new Map),P=e.computed(()=>{if(y.gameIdForAnalysis&&y.playIdForAnalysis&&o.value){const tr=o.value.find(Fe=>Fe.game_id===y.gameIdForAnalysis);if(tr){if(tr.corners.find(Fe=>Fe.play_id===y.playIdForAnalysis))return!1;if(tr.cornersAgainstTeam.find(Fe=>Fe.play_id===y.playIdForAnalysis))return!0}}return y.isAgainstMode}),V=e.computed(()=>{const tr=[];return U.value&&(h.value&&tr.push(y.teamIdForAnalysis),v.value&&tr.push(y.teamIdForAnalysis!==U.value.home_team?U.value.home_team:U.value.visiting_team)),tr}),I=e.computed(()=>y.widthContainer<=768?"cont-data768":"cont-data"),j=e.computed(()=>{const tr=y.widthContainer;return tr<=768?"cont-collectors768":tr<=900?"cont-collectors900":"cont-collectors"}),F=e.computed(()=>{const tr=y.widthContainer;return tr<=768?"cont-who-connected768":tr<=900?"cont-who-connected900":"cont-who-connected"}),D=e.computed(()=>o.value?o.value.findIndex(tr=>tr.isSelected):null),U=e.computed(()=>o.value?o.value[D.value]:null),M=e.ref(null),X=e.computed(()=>{const tr=o.value[D.value];let Fe=!1;if(tr){const sr=tr[`${P.value?"cornersAgainstTeam":"corners"}`].find(Ye=>Ye.isSelected);if(sr&&sr.playConnections){yt(sr);const Ye=sr.playConnections;let Te=[Ye.mainPlay];return Ye.relatedPlays&&Te.push(...Ye.relatedPlays),Te.sort((Re,Ve)=>Re.touchOrder-Ve.touchOrder),Te=Te.filter(Re=>{let Ve=!0;return Fe?!1:(O.value?Ve=!Re.isTeamForAnalysis&&Re.y1<=yO||Re.isTeamForAnalysis&&Re.y1>=yO:Ve=Re.isTeamForAnalysis&&Re.y1<=yO||!Re.isTeamForAnalysis&&Re.y1>=yO,Fe=!Ve,Ve)}),Te.forEach((Re,Ve)=>{Ve>0&&(Re.previousPlayConnection=Te[Ve-1]),Ve===Te.length-1&&(Re.isLastPlay=!0)}),Te}}return[]}),O=e.computed(()=>{const tr=o.value[D.value];if(tr){const Fe=tr[`${P.value?"cornersAgainstTeam":"corners"}`].find(sr=>sr.isSelected);return Fe?Fe.isAgainst:!1}return!1}),Y=e.computed(()=>{const tr=o.value[D.value];if(tr){mt(tr);const Fe=tr[`${P.value?"cornersAgainstTeam":"corners"}`].find(sr=>sr.isSelected);return Fe?Fe.fieldPositions:null}return null}),st=e.ref({});function mt(tr){st.value=tr}function yt(tr){M.value=tr}const bt=e.computed(()=>Y.value?Y.value.get(T.value):[]),xt=e.computed(()=>{if(Y.value){const tr=Number(b.value[0]),Fe=Number(b.value[1]),sr=[];if(Fe!==tr)for(let Ye=tr;Ye<Fe;Ye++){const Te=Y.value.get(Ye.toString()),Re=Y.value.get((Ye+1).toString());Te&&Re&&sr.push({playersPositions:Te,finalPlayersPositions:Re,areFirstPositions:Ye===tr,areFinalPositions:Ye===Fe-1})}else sr.push({playersPositions:Y.value.get(b.value[0]),finalPlayersPositions:Y.value.get(b.value[0]),areFirstPositions:!0,areFinalPositions:!0});return sr}return[]}),Pt=e.computed(()=>Y.value?Array.from(Y.value.keys()):[]);e.watch(()=>y.advancedFilters,tr=>{s.value=tr.areConnectionsVisible,c.value=tr.arePathsVisible;const Fe=tr.secondsBeforeAndAfter.toString(),sr=tr.secondsBefore.toString(),Ye=tr.secondsAfter.toString();Pt.value.includes(Fe)&&(T.value=Fe),Pt.value.includes(sr)&&(b.value[0]=sr),Pt.value.includes(Ye)&&(b.value[1]=Ye)},{immediate:!0,deep:!0}),e.watch(()=>P.value,()=>{y.isNullCornerData||Ne()}),e.watch(()=>y.teamIdForAnalysis,tr=>{tr&&!y.isNullCornerData&&Oe()},{immediate:!0});const qt=e.computed(()=>U.value?y.teamIdForAnalysis===U.value.home_team:!0);e.watch(()=>D.value,(tr,Fe)=>{if(tr!==Fe&&(T.value="0",b.value=["-1","0"],U.value)){U.value.corners.forEach(Ye=>{Ye.isSelected=!1}),U.value.cornersAgainstTeam.forEach(Ye=>{Ye.isSelected=!1});const sr=(P.value?U.value.cornersAgainstTeam:U.value.corners).filter(Ye=>Ye.isVisible);sr.length>0&&(sr[0].isSelected=!0)}}),e.watch(()=>y.filters,tr=>{tr&&It()},{deep:!0,immediate:!0}),e.watch(()=>y.isTacticVisible,tr=>{s.value=!tr});function _t(tr){a("changelateralidad",tr)}function It(){if(o.value)if(y.isSynchronization)o.value.forEach((tr,Fe)=>{tr.isVisible=!0,Fe===0&&(tr.isSelected=!0,tr.isExpanded=!0,tr.corners.forEach(sr=>{sr.isVisible=!0}),tr.cornersAgainstTeam.forEach(sr=>{sr.isVisible=!0}))});else{let tr=!1;o.value.forEach(Fe=>{if(Fe.isSelected=!1,P.value&&Fe.isSoccerFieldDataRivalLoaded||!P.value&&Fe.isSoccerFieldDataLoaded){const sr=P.value?Fe.cornersAgainstTeam:Fe.corners;if((!y.filters.games.length||y.filters.games.includes(Fe.game_id))&&y.filters.playingAs.includes(Fe.playingAs)&&(y.filters.isMoment||y.filters.final.includes(Fe.finalResult))){let Ye=0;for(const Te of sr){if(Te.isSelected=!1,y.playIdForAnalysis&&Te.play_id===y.playIdForAnalysis){Te.isVisible=!0,Te.isSelected=!0,Ye++;break}if(y.filters.cornertype!==Te.init_category_id){Te.isVisible=!1,Te.isSelected=!1;continue}if(!y.filters.howWas.some(Re=>Te.relatedCategoriesIds.has(Re))){Te.isVisible=!1,Te.isSelected=!1;continue}if(!P.value&&y.filters.players.length&&!y.filters.players.includes(Te.player_id)){Te.isVisible=!1,Te.isSelected=!1;continue}if(Te.playConnections){if(!y.filters.sections.includes(Te.playConnections.mainPlay.timeSection)){Te.isVisible=!1,Te.isSelected=!1;continue}if(!y.filters.moment.includes(Te.playConnections.mainPlay.matchResultAtMomentOfPlay)){Te.isVisible=!1,Te.isSelected=!1;continue}const Re=Te.playConnections.mainPlay;if(Re&&!y.filters.isZoneFull&&!y.filters.zona.includes(Re.fieldSection)){Te.isVisible=!1,Te.isSelected=!1;continue}}if(!y.filters.isWhatHappenedFull&&Te.relatedCategoriesIds&&!y.filters.whathappened.some(Re=>Te.relatedCategoriesIds.has(Re))){Te.isVisible=!1,Te.isSelected=!1;continue}Te.isVisible=!0,Ye===0&&(Te.isSelected=!0),Ye++}Fe.isVisible=Ye>0,Fe.isVisible&&!tr?(Fe.isSelected=!0,Fe.isExpanded=!0,tr=!0):Fe.isSelected=!1}else Fe.isVisible=!1,sr.forEach(Ye=>{Ye.isVisible=!1,Ye.isSelected=!1})}})}}function jt([tr,Fe]){const sr=Math.round(Number(Fe));if(sr===60){const Ye=Number(tr)+1;return`${Ye<100?Ye<10?"00":"0":""}${Ye}:00.000`}return`${tr}:${sr<10?"0":""}${sr}.000`}function Rt(tr,Fe,sr,Ye){tr&&tr.forEach(Te=>{Te.isHomeTeam=Te.teamId===U.value.home_team,Te.attackDirection=Ye.get(Te.playId).mainPlay.attackDirection,Te.player=Fe.get(Te.playerId)||sr.get(Te.playerId)})}function Wt(tr,Fe){const sr=Number(b.value[Fe])+tr;if(Pt.value.includes(sr.toString())){const Ye=[...b.value];Ye[Fe]=sr.toString(),Number(Ye[1])-Number(Ye[0])>=0&&(b.value=[...Ye])}}function re(tr){const Fe=Number(T.value)+tr;Pt.value.includes(Fe.toString())&&(T.value=Fe.toString())}function le(tr){if(!tr.teams||tr.teams.length===0)return;const Fe=tr.teams[0].team_id,sr=tr.teams[1].team_id;if(y.teamIdForAnalysis===Fe&&tr.home_atk_direction===1||y.teamIdForAnalysis===sr&&tr.visiting_atk_direction===1)for(let Ye=1;Ye<5;Ye++)p.value.set(Ye,Ye%2===0?mO.TO_LEFT:mO.TO_RIGHT);else for(let Ye=1;Ye<5;Ye++)p.value.set(Ye,Ye%2===0?mO.TO_RIGHT:mO.TO_LEFT)}function he(){L.value=!0}function de(){L.value=!1}async function Jt(){try{if(U.value){const tr={messages:[{queue:"gs3.tendency",message:{key:"postmatch",action:"season",data:{season_id:y.seasonIdForAnalysis,game_id:U.value.game_id}}}]};await xv.post("https://6xh1ym8shh.execute-api.us-west-2.amazonaws.com/prod/pushInternalData",tr,l)}}catch(tr){throw new Error(tr)}finally{de()}}function te(){k.value=!0}function ne(){k.value=!1}async function Le(){try{if(U.value){const tr=U.value[`${P.value?"cornersAgainstTeam":"corners"}`].find(Fe=>Fe.isSelected);if(tr){const Fe={play_id:tr.play_id,game_id:U.value.game_id,season_id:y.seasonIdForAnalysis,seconds:Number(T.value),moment_of_play:tr.moment_of_play};await xv.post(" https://bqsyfm7sij.execute-api.us-east-2.amazonaws.com/prod/sync",Fe,l)}}}catch(tr){throw new Error(tr)}finally{ne()}}async function Oe(tr){try{const Fe=E.value.get(y.teamIdForAnalysis);if(Fe){o.value=Fe,It();return}n=tr||y.seasonIdForAnalysis;const sr=(await xv.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${n}/games/teams/${y.teamIdForAnalysis}/corners`,l)).data,Ye={corners:0,cornersAgainst:0};o.value=sr.games?sr.games.reduce((Te,Re)=>{if(y.isGameOnly&&y.gameIdForAnalysis!==Re.game_id)return Te;const Ve={againstTeam:[],team:[]},br=Re.score[1]-Re.score[0];Re.dateMillis=new Date(Re.date_time_utc),Re.isVisible=!0,Re.playingAs=Re.home_team===y.teamIdForAnalysis?1:2,Re.finalResult=br===0?3:Re.playingAs===1?br>0?2:1:br<0?2:1,Re.corners.forEach(Tr=>{const Pr=Tr.team_id===y.teamIdForAnalysis;Tr.isAgainst=!Pr,(!y.playIdForAnalysis||y.playIdForAnalysis===Tr.play_id)&&(Pr?Ve.team.push(Tr):Ve.againstTeam.push(Tr))}),Re.corners=Ve.team,Re.cornersAgainstTeam=Ve.againstTeam;const cr=Re.home_team===y.teamIdForAnalysis?1:2;Ye.corners+=Re.corners.length,Ye.cornersAgainst+=Re.cornersAgainstTeam.length;const gr={...Re,isSelected:Te.length===0,isExpanded:!1,isTeamForAnalysisHomeTeam:Re.home_team===y.teamIdForAnalysis,canPlayVideos:y.canPlayVideos&&y.videoPrivilegesPlayingAs.has(cr)};return Te.push(gr),Te},[]):[],o.value=o.value.sort((Te,Re)=>Re.dateMillis-Te.dateMillis),Pe(),a("corners-filled",Ye),await Ne(),o.value.forEach(Te=>{Te.corners.concat(Te.cornersAgainstTeam).forEach(Re=>{if(Re.playConnections){const[Ve,br]=Re.moment_of_play.split(":"),[cr,gr]=br.split("."),Tr=Number(Ve)+45*Re.playConnections.mainPlay.matchLapse;Re.isSelected=!1,Re.orderValue=+`${Tr}${cr}${gr}`}}),Te.corners=Te.corners.sort((Re,Ve)=>Re.orderValue-Ve.orderValue),Te.cornersAgainstTeam=Te.cornersAgainstTeam.sort((Re,Ve)=>Re.orderValue-Ve.orderValue)}),It()}catch(Fe){throw new Error(Fe)}}async function Ne(){try{const tr=[];o.value.forEach(Fe=>{(P.value&&!Fe.isSoccerFieldDataRivalLoaded||!P.value&&!Fe.isSoccerFieldDataLoaded)&&tr.push(Xe(Fe))}),tr.length>0&&((await Promise.all(tr)).forEach((Fe,sr)=>{ir(o.value[sr],Fe)}),It()),Pe()}catch(tr){throw new Error(tr)}}function Pe(){E.value.get(y.teamIdForAnalysis)||E.value.set(y.teamIdForAnalysis,o.value)}function Xe(tr){return y.isSynchronization?xv.get(`https://golstats-microservices.s3.us-west-2.amazonaws.com/tendency/corners-${P.value?"received":"commited"}-${n}-${y.teamIdForAnalysis}-${tr.game_id}-large.json`):xv.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${n}/corners/trends/teams/${y.teamIdForAnalysis}/${tr.game_id}${P.value?"?isR=1":""}`,l)}function He(tr){const[Fe,sr]=tr.split(", ");let Ye="";const Te=Fe.split(" ");for(const Re of Te)if(Ye+=` ${Re}`,Re.length>3)break;return sr&&Fe?`${sr.trim().charAt(0)}.${Ye}`:""}function $e(tr){let[Fe,sr]=tr.split(", ");sr=(sr==null?void 0:sr.trim())||"";let Ye="";const Te=Fe.split(" "),Re=sr.includes(" ")?sr.split(" ")[0]:sr;for(const Ve of Te)if(Ye+=` ${Ve}`,Ve.length>3)break;return Re&&Fe?`${Re} ${Ye}`:""}async function ir(tr,Fe){try{if(tr&&Fe&&(!tr.isSoccerFieldDataLoaded||!tr.isSoccerFieldDataRivalLoaded)){const sr=new Map,Ye=new Map,Te=new Map;le(Fe.data),Fe.data.players&&Fe.data.players.forEach(cr=>{cr.shortName=He(cr.name),cr.firstNameAndFirstLastName=$e(cr.name),Ye.set(cr.player_id,cr)}),Fe.data.rival_players&&Fe.data.rival_players.forEach(cr=>{cr.shortName=He(cr.name),cr.firstNameAndFirstLastName=$e(cr.name),Te.set(cr.player_id,cr)}),S.value=Fe.data.teams.find(cr=>cr.team_id===y.teamIdForAnalysis),S.value&&(S.value.rival=Fe.data.teams.find(cr=>cr.team_id!==y.teamIdForAnalysis));const Re=Fe.data.data.reduce((cr,gr)=>{const Tr=gr.reduce((hr,Nr,Ir)=>(hr[f[Ir]]=Nr,hr.isHomeTeam=hr.teamId===tr.home_team,hr),{}),Pr=Tr.playId===Tr.relatedPlayId,qe=cr.get(Tr.relatedPlayId),Ge=Tr.momentOfPlay.split(":"),Je=jt(Ge);return Tr.player=Ye.get(Tr.playerId)||Te.get(Tr.playerId),Tr.isTeamForAnalysis=Tr.teamId===y.teamIdForAnalysis,Pr&&(Tr.attackDirection=p.value.get(Tr.matchLapse),sr.set(Tr.playId,Je)),qe?Pr?qe.mainPlay=Tr:qe.relatedPlays.length<XJt&&(qe.relatedPlays.push(Tr),qe.relatedPlays.length>1&&qe.relatedPlays.sort((hr,Nr)=>hr.touchOrder-Nr.touchOrder)):cr.set(Tr.playId,{mainPlay:Pr?Tr:null,relatedPlays:Pr?[]:[Tr]}),cr},new Map),Ve=Fe.data.field_positions.reduce((cr,gr)=>{const Tr=gr.reduce((qe,Ge,Je)=>(qe[$[Je]]=Ge,qe),{});Tr.isTeamForAnalysis=Tr.teamId===y.teamIdForAnalysis;const Pr=cr.get(Tr.playId);if(Pr){const qe=Pr.get(Tr.momentOfPlay);qe?qe.push(Tr):Pr.set(Tr.momentOfPlay,[Tr])}else cr.set(Tr.playId,new Map([[Tr.momentOfPlay,[Tr]]]));return cr},new Map),br=Array.from(sr.entries()).reduce((cr,[gr,Tr])=>{const Pr=[],qe=[];let Ge=null;const Je=Ve.get(gr);if(Je){const hr=y.isSynchronization?BJt:DJt,Nr=y.isSynchronization?KJt:WJt;Array.from(Je.keys()).sort().forEach(ln=>{(!Ge||qe.length<Nr)&&(ln===Tr?Ge=Je.get(ln):Ge?qe.length<Nr&&qe.push(Je.get(ln)):(Pr.length===hr&&Pr.shift(),Pr.push(Je.get(ln))))});const Ir=new Map;Pr.forEach((ln,Nn)=>{Rt(ln,Ye,Te,Re),Ir.set(`${Nn-Pr.length}`,ln)}),Rt(Ge,Ye,Te,Re),Ir.set("0",Ge),qe.forEach((ln,Nn)=>{Rt(ln,Ye,Te,Re),Ir.set(`${Nn+1}`,ln)}),cr.set(gr,Ir)}return cr},new Map);tr[`${P.value?"cornersAgainstTeam":"corners"}`].forEach(cr=>{const gr=cr.related_categories.split(",").reduce((Pr,qe,Ge)=>{const Je=Number(qe);return Ge===1&&(cr.howWasCorner=Je),Pr.array.push(Je),Pr.sett.add(Je),Pr},{array:[],sett:new Set});for(const Pr of gr.array){const qe=i.get(Pr),Ge=d.get(Pr);if(Ge&&(cr.whatHappenedName=Ge),qe&&(cr.howWasCornerName=qe),cr.howWasCornerName&&cr.whatHappenedName)break}cr.relatedCategoriesIds=gr.sett,cr.playConnections=Re.get(cr.play_id),cr.fieldPositions=br.get(cr.play_id),cr.player=Ye.get(cr.player_id)||Te.get(cr.player_id);let Tr=cr.moment_of_play.split(".")[0];Tr.startsWith("0")&&(Tr=Tr.slice(1)),cr.formattedMomentOfPlay=Tr,cr.momentOfPlayNumber=Number(Tr.replace(":","."))}),!P.value&&!tr.isSoccerFieldDataLoaded&&(tr.isSoccerFieldDataLoaded=!0),P.value&&!tr.isSoccerFieldDataRivalLoaded&&(tr.isSoccerFieldDataRivalLoaded=!0)}}catch(sr){throw new Error(sr)}}function pr(tr){const Fe=U.value[`${P.value?"cornersAgainstTeam":"corners"}`],sr={},Ye=Fe.reduce((Te,Re)=>(Re.isVisible&&(Te.add(Re.play_id),Re.isSelected&&(sr.playId=Re.play_id)),Te),new Set);a("open-media-player",{seasonId:n,mainSectionType:1,playListType:1,playsIds:Ye,playData:sr,categoryIds:P.value?["31_r","32_r"]:[31,32],teamId:y.teamIdForAnalysis,videosType:tr,isCarouselOnly:!0})}return(tr,Fe)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.withDirectives(e.createElementVNode("div",RZt,[e.createElementVNode("div",FZt,[e.createElementVNode("div",UZt," ¿Estás seguro que deseas sincronizar el tracking del partido "+e.toDisplayString(U.value?U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`]:"")+" vs "+e.toDisplayString(U.value?U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`]:"")+" ? ",1),e.createElementVNode("div",{class:"modal-confirmation__buttons"},[e.createElementVNode("div",{class:"modal-confirmation__buttons__button cancel",onClick:de}," No "),e.createElementVNode("div",{class:"modal-confirmation__buttons__button",onClick:Jt},"Sí")])])],512),[[e.vShow,L.value]]),e.withDirectives(e.createElementVNode("div",IZt,[e.createElementVNode("div",qZt,[e.createElementVNode("div",jZt," ¿Estás seguro que deseas sincronizar esta jugada en el segundo "+e.toDisplayString(T.value)+"? ",1),e.createElementVNode("div",{class:"modal-confirmation__buttons"},[e.createElementVNode("div",{class:"modal-confirmation__buttons__button cancel",onClick:ne}," No "),e.createElementVNode("div",{class:"modal-confirmation__buttons__button",onClick:Le},"Sí")])])],512),[[e.vShow,k.value]]),e.createElementVNode("div",{class:e.normalizeClass(t.widthContainer<=768?"gsc-specific-plays-movil":"gsc-specific-plays")},[e.withDirectives(e.createElementVNode("div",DZt,[e.createElementVNode("div",WZt,[t.widthContainer<=768?(e.openBlock(),e.createElementBlock("span",BZt,"Elige que quieres ver:")):(e.openBlock(),e.createElementBlock("span",KZt,"Jugadas Específicas"))])],512),[[e.vShow,!t.isFieldOnly]]),e.createElementVNode("div",{class:e.normalizeClass(I.value)},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(j.value)},[t.widthContainer>768?(e.openBlock(),e.createBlock(CKt,{key:0,"is-against-mode":P.value,"games-by-team":o.value,"are-filters-open":t.areFiltersOpen},null,8,["is-against-mode","games-by-team","are-filters-open"])):(e.openBlock(),e.createBlock(_Xt,{key:1,"is-against-mode":P.value,"games-by-team":o.value,"are-filters-open":t.areFiltersOpen},null,8,["is-against-mode","games-by-team","are-filters-open"]))],2),[[e.vShow,!t.isFieldOnly]]),e.createElementVNode("div",{class:e.normalizeClass(F.value)},[t.isSynchronization?(e.openBlock(),e.createElementBlock("div",{key:0,role:"button",class:"button-tracking",onClick:he}," Generar datos ")):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",XZt,[e.createElementVNode("div",GZt,[e.createVNode(e.unref(qP),{modelValue:s.value,"onUpdate:modelValue":Fe[0]||(Fe[0]=sr=>s.value=sr),label:"Mostrar conexiones",fontFamily:"Poppins-Regular",labelFontSize:t.widthContainer>400?"13px":"12px","label-color":"#FFF"},null,8,["modelValue","labelFontSize"]),t.widthContainer<=768&&t.isTacticVisible?(e.openBlock(),e.createBlock(e.unref(qP),{key:0,modelValue:c.value,"onUpdate:modelValue":Fe[1]||(Fe[1]=sr=>c.value=sr),label:"Mostrar recorrido",fontFamily:"Poppins-Regular",labelFontSize:t.widthContainer>400?"13px":"12px","label-color":"#FFF"},null,8,["modelValue","labelFontSize"])):e.createCommentVNode("",!0),t.widthContainer>768?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["specific-plays-radio-container",{"is-away-team":!qt.value}])},[U.value&&t.isTacticVisible?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("label",ZZt,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Fe[2]||(Fe[2]=sr=>h.value=sr),type:"checkbox",name:"radio",checked:"",style:{display:"none"}},null,512),[[e.vModelCheckbox,h.value]]),e.createElementVNode("span",{class:e.normalizeClass(qt.value?"outer-circle-home":"outer-circle-away")},[h.value?(e.openBlock(),e.createElementBlock("svg",JZt,[...Fe[16]||(Fe[16]=[e.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"},null,-1)])])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",HZt,[e.createTextVNode(e.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`])+" ",1),e.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_logo`]},null,8,YZt)])]),e.createElementVNode("label",QZt,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Fe[3]||(Fe[3]=sr=>v.value=sr),type:"checkbox",name:"radio",style:{display:"none"}},null,512),[[e.vModelCheckbox,v.value]]),e.createElementVNode("span",{class:e.normalizeClass(qt.value?"outer-circle-away":"outer-circle-home")},[v.value?(e.openBlock(),e.createElementBlock("svg",$Zt,[...Fe[17]||(Fe[17]=[e.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"},null,-1)])])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",tJt,[e.createTextVNode(e.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`])+" ",1),e.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_logo`]},null,8,eJt)])])],64)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["specific-plays-controls22",t.widthContainer<=375?"specific-plays-controls22small":""])},[t.widthContainer>768&&t.isTacticVisible&&!t.isSynchronization?(e.openBlock(),e.createBlock(e.unref(qP),{key:0,modelValue:c.value,"onUpdate:modelValue":Fe[4]||(Fe[4]=sr=>c.value=sr),label:"Mostrar recorrido",fontFamily:"Poppins-Regular",labelFontSize:"13px","label-color":"#FFF"},null,8,["modelValue"])):e.createCommentVNode("",!0),t.isTacticVisible?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.widthContainer<=768?"specify-control-incement-second-container-mobil":"specify-control-incement-second-container")},[e.createElementVNode("div",sJt,[t.widthContainer>990||t.widthContainer<=768&&t.widthContainer>=420?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode("Inicio: ")],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode("Inicio:")],64))]),Fe[29]||(Fe[29]=e.createElementVNode("div",{class:"icon-info"},null,-1)),e.createElementVNode("div",lJt,[e.createElementVNode("div",cJt,[Number(b.value[0])>0?(e.openBlock(),e.createElementBlock("span",uJt,"+")):e.createCommentVNode("",!0),e.createTextVNode(e.toDisplayString(b.value[0]),1)]),Fe[25]||(Fe[25]=e.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),e.createElementVNode("div",dJt,[e.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Fe[7]||(Fe[7]=sr=>Wt(1,0))},[(e.openBlock(),e.createElementBlock("svg",pJt,[...Fe[23]||(Fe[23]=[e.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),e.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Fe[8]||(Fe[8]=sr=>Wt(-1,0))},[...Fe[24]||(Fe[24]=[e.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])]),e.createElementVNode("div",hJt,[t.widthContainer>990||t.widthContainer<=768&&t.widthContainer>=420?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode("Fin: ")],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode("Fin:")],64))]),Fe[30]||(Fe[30]=e.createElementVNode("div",{class:"icon-info"},null,-1)),e.createElementVNode("div",fJt,[e.createElementVNode("div",mJt,[Number(b.value[1])>0?(e.openBlock(),e.createElementBlock("span",yJt,"+")):e.createCommentVNode("",!0),e.createTextVNode(e.toDisplayString(b.value[1]),1)]),Fe[28]||(Fe[28]=e.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),e.createElementVNode("div",gJt,[e.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Fe[9]||(Fe[9]=sr=>Wt(1,1))},[(e.openBlock(),e.createElementBlock("svg",vJt,[...Fe[26]||(Fe[26]=[e.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),e.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Fe[10]||(Fe[10]=sr=>Wt(-1,1))},[...Fe[27]||(Fe[27]=[e.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])])],2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.widthContainer<=768?"specify-control-incement-second-container-mobil":"specify-control-incement-second-container")},[Fe[21]||(Fe[21]=e.createElementVNode("div",{class:"icon-info"},null,-1)),Fe[22]||(Fe[22]=e.createElementVNode("div",{class:"text-icon-info"},"Segundos antes/después del cobro:",-1)),e.createElementVNode("div",rJt,[e.createElementVNode("div",nJt,[Number(T.value)>0?(e.openBlock(),e.createElementBlock("span",aJt,"+")):e.createCommentVNode("",!0),e.createTextVNode(e.toDisplayString(T.value),1)]),Fe[20]||(Fe[20]=e.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),e.createElementVNode("div",iJt,[e.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Fe[5]||(Fe[5]=sr=>re(1))},[(e.openBlock(),e.createElementBlock("svg",oJt,[...Fe[18]||(Fe[18]=[e.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),e.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Fe[6]||(Fe[6]=sr=>re(-1))},[...Fe[19]||(Fe[19]=[e.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])])],2))],64)):e.createCommentVNode("",!0),t.isSynchronization?(e.openBlock(),e.createElementBlock("div",{key:2,role:"button",class:"button-sync",onClick:te}," Guardar sincronización ")):e.createCommentVNode("",!0)],2)],512),[[e.vShow,!t.isFieldOnly]]),e.createElementVNode("div",{class:"specific-plays-field",style:e.normalizeStyle(t.widthContainer<=768?"height: auto":"")},[e.createElementVNode("div",bJt,[e.createVNode(rGt,{"width-container":t.widthContainer,"play-connections":X.value,"players-positions":bt.value,"players-positions-by-range":xt.value,"team-id-for-analysis":t.teamIdForAnalysis,"selected-category":t.filters.cornertype,"are-connections-visible":s.value,"are-position-paths-visible":c.value,"visible-teams-ids":V.value,"is-against-corner":O.value,onChangelateralidad:_t},null,8,["width-container","play-connections","players-positions","players-positions-by-range","team-id-for-analysis","selected-category","are-connections-visible","are-position-paths-visible","visible-teams-ids","is-against-corner"])]),e.createElementVNode("div",xJt,[e.createElementVNode("div",_Jt,[t.isTemplateMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",wJt,[e.createElementVNode("img",{src:st.value.home_team_logo,alt:""},null,8,TJt)])),Fe[31]||(Fe[31]=e.createElementVNode("div",{class:"bullet"},null,-1))]),e.createElementVNode("div",SJt,[t.isTemplateMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",kJt,[e.createElementVNode("img",{src:st.value.visiting_team_logo,alt:""},null,8,LJt)])),Fe[32]||(Fe[32]=e.createElementVNode("div",{class:"bullet"},null,-1))])]),U.value&&U.value.canPlayVideos&&!t.isFieldOnly?(e.openBlock(),e.createElementBlock("div",{key:0,class:"specific-plays-field__play-buttons",style:e.normalizeStyle(t.widthContainer<=768?"gap:5px; flex-direction: column;":"")},[Fe[36]||(Fe[36]=e.createElementVNode("div",{class:"specific-plays-field__play-buttons__text"},"Visualizar video:",-1)),e.createElementVNode("div",CJt,[U.value.video_types.includes(1)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"specific-plays-field__play-buttons__button",onClick:Fe[11]||(Fe[11]=sr=>pr(1))},[...Fe[33]||(Fe[33]=[e.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[e.createElementVNode("img",{src:IP,alt:""})],-1),e.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Toma TV",-1)])])):e.createCommentVNode("",!0),U.value.video_types.includes(3)?(e.openBlock(),e.createElementBlock("div",{key:1,class:"specific-plays-field__play-buttons__button",onClick:Fe[12]||(Fe[12]=sr=>pr(3))},[...Fe[34]||(Fe[34]=[e.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[e.createElementVNode("img",{src:IP,alt:""})],-1),e.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Táctica",-1)])])):e.createCommentVNode("",!0),U.value.video_types.includes(2)?(e.openBlock(),e.createElementBlock("div",{key:2,class:"specific-plays-field__play-buttons__button",onClick:Fe[13]||(Fe[13]=sr=>pr(2))},[...Fe[35]||(Fe[35]=[e.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[e.createElementVNode("img",{src:IP,alt:""})],-1),e.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Panorámica",-1)])])):e.createCommentVNode("",!0)])],4)):e.createCommentVNode("",!0)],4),t.widthContainer<=768?(e.openBlock(),e.createElementBlock("div",NJt,[U.value&&t.isTacticVisible?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("label",OJt,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Fe[14]||(Fe[14]=sr=>h.value=sr),type:"checkbox",name:"radio",checked:"",style:{display:"none"}},null,512),[[e.vModelCheckbox,h.value]]),e.createElementVNode("span",{class:e.normalizeClass(qt.value?"outer-circle-away":"outer-circle-home")},[...Fe[37]||(Fe[37]=[e.createElementVNode("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"})],-1)])],2),e.createElementVNode("span",EJt,[e.createTextVNode(e.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`])+" ",1),e.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_logo`]},null,8,zJt)])]),e.createElementVNode("label",MJt,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Fe[15]||(Fe[15]=sr=>v.value=sr),type:"checkbox",name:"radio",style:{display:"none"}},null,512),[[e.vModelCheckbox,v.value]]),e.createElementVNode("span",{class:e.normalizeClass(qt.value?"outer-circle-away":"outer-circle-home")},[...Fe[38]||(Fe[38]=[e.createElementVNode("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"})],-1)])],2),e.createElementVNode("span",VJt,[e.createTextVNode(e.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`])+" ",1),e.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_logo`]},null,8,PJt)])])],64)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2)],2),M.value&&t.isCornerInfoVisible?(e.openBlock(),e.createElementBlock("div",AJt)):e.createCommentVNode("",!0),M.value&&t.isCornerInfoVisible?(e.openBlock(),e.createElementBlock("div",RJt,[e.createElementVNode("div",FJt,[e.createElementVNode("img",{class:"corner-info__team__logo",src:`https://golstatsimages.blob.core.windows.net/teams-80/${M.value.team_id}.png`},null,8,UJt)]),e.createElementVNode("div",IJt,[e.createElementVNode("div",qJt,[Fe[39]||(Fe[39]=e.createElementVNode("span",null," Tiro de esquina ",-1)),Fe[40]||(Fe[40]=e.createElementVNode("span",{class:"separator"}," | ",-1)),e.createElementVNode("span",null,e.toDisplayString(M.value.player.firstNameAndFirstLastName),1)]),e.createElementVNode("div",jJt,[e.createElementVNode("span",null,e.toDisplayString(M.value.howWasCornerName),1),Fe[41]||(Fe[41]=e.createElementVNode("span",{class:"separator"}," | ",-1)),e.createElementVNode("span",null,e.toDisplayString(M.value.whatHappenedName),1)])])])):e.createCommentVNode("",!0)],2)],64))}},AZ=j6(GJt,[["__scopeId","data-v-abec1cab"]]),ZJt={class:"tooltip-options"},JJt={__name:"TooltipOptions",props:{optionsType:{type:String,default:"page"}},emits:["close-tooltip","change-sort","delete-page","edit","clone","delete"],setup(t,{emit:r}){const n=t,y=r,$=e.computed(()=>n.optionsType==="page");function f(){y("close-tooltip")}function u(i){y(i),f()}return(i,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"tooltip-overlay",onClick:f}),e.createElementVNode("div",ZJt,[e.createElementVNode("ul",null,[$.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("li",{class:"option",onClick:d[0]||(d[0]=l=>u("change-sort"))},[...d[4]||(d[4]=[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),e.createTextVNode(" Cambiar orden ",-1)])]),e.createElementVNode("li",{class:"option",onClick:d[1]||(d[1]=l=>u("delete-page"))},[...d[5]||(d[5]=[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),e.createTextVNode(" Eliminar ",-1)])])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("li",{class:"option",onClick:d[2]||(d[2]=l=>u("edit"))},[...d[6]||(d[6]=[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),e.createTextVNode(" Editar ",-1)])]),e.createElementVNode("li",{class:"option",onClick:d[3]||(d[3]=l=>u("delete"))},[...d[7]||(d[7]=[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),e.createTextVNode(" Eliminar ",-1)])])],64))])])],64))}},RZ=e2(JJt,[["__scopeId","data-v-998e2429"]]),HJt={class:"report-view"},YJt={class:"report-view__header"},QJt={key:0,class:"report-view__header__logo"},$Jt=["src"],tHt={class:"report-view__header__name"},eHt={__name:"ReportView",props:{view:{type:Object,default:()=>({title:"View Title"})},isEmpty:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},game:{type:Object,default:()=>null},isHomeTeam:{type:Boolean,default:!0},isFilterVisible:{type:Boolean,default:!1},viewId:{type:Number,default:0},isPostMatch:{type:Boolean,default:!1}},emits:["edit","delete"],setup(t,{emit:r}){const n=t,y=e.ref(!1),$=r,f=[1,2,3,4,6,8,14,13],u=e.computed(()=>!f.includes(n.viewId)),i=e.computed(()=>{if(n.game)if(n.view.coreView.id==17){const s=n.view.componentProps.teamselected==n.game.homeTeam.team_id?n.game.homeTeam:n.game.awayTeam;if(s&&s.logo)return s.logo}else if(n.view.coreView.id==15){const s=n.view.componentProps.data.team==n.game.homeTeam.team_id?n.game.homeTeam:n.game.awayTeam;if(s&&s.logo)return s.logo}else{const s=n.isHomeTeam?n.game.homeTeam:n.game.awayTeam;if(s&&s.logo)return s.logo}return""}),d=e.computed(()=>{const s=n.view.coreView;return s?s.id===9?n.view.w<4?n.view.title.replace("Mapeo de ",""):n.view.title:s.id===6?a(n.view):s.id===13?S(n.view):n.view.title:n.view.title}),l=new Map([[1,"último"],[2,"penúltimo"],[3,"antepenúltimo"]]);function a(s){return n.isPostMatch?s.title:`${s.title} ${l.get(s.componentProps.gameNumber)+" partido"||""}`}function S(s){try{if(!s)return"Tabla por Categoría";const c=s.dynamicFilters||[];if(!Array.isArray(c)||c.length<2)return"Tabla por Categoría";const o=c[1]||[],h=c[0]||2;if(o&&o.length>0){const v=[{value:[213,214,215,216],label:"Pases acertados por lapsos"},{value:[217],label:"Pases filtrados por lapsos"},{value:[218,219,220,221],label:"Pases no acertados por lapsos"},{value:[485,486,487,488],label:"Balones recuperados en disputa por lapsos"},{value:[489,490,491,492],label:"Balones recuperados sin disputa por lapsos"},{value:[496,497,498,499],label:"Balones perdidos en disputa por lapsos"},{value:[500,501,502,503],label:"Balones perdidos sin disputa por lapsos"},{value:[12,55,"35_r","54_r"],label:"Goles por lapsos"},{value:[511,512],label:h==2?"Tiros a gol totales por lapsos":"Tiros a gol recibidos totales por lapsos"},{value:[537,540,544,547],label:h==2?"Tiros a gol a destino por lapsos":"Tiros a gol recibidos a destino por lapsos"},{value:[13],label:h==2?"Centros por izquierda por lapsos":"Centros por derecha recibidos por lapsos"},{value:[25],label:h==2?"Centros por derecha por lapsos":"Centros por izquierda recibidos por lapsos"},{value:[11],label:"Balones ganados en área rival por lapsos"},{value:[607,608,12,55,"35_r","54_r"],label:"Oportunidad de gol por lapsos"},{value:["40_r"],label:"Goles recibidos por lapsos"},{value:["487_r","488_r","491_r","492_r"],label:"Balones recuperados en cancha rival por lapsos"},{value:["485_r","486_r","489_r","490_r"],label:"Balones recuperados en cancha propia por lapsos"}],k=(L,E)=>{if(L.length!==E.length)return!1;const P=[...L].sort(),V=[...E].sort();return P.every((I,j)=>I===V[j])};for(const L of v)if(k(o,L.value))return L.label}return"Tabla por Categoría"}catch(c){return console.error("Error en getTableCategoryTitle:",c),"Tabla por Categoría"}}function T(){p(),$("edit")}function b(){p(),$("delete")}function p(){y.value=!1}return(s,c)=>(e.openBlock(),e.createElementBlock("div",HJt,[e.createElementVNode("div",YJt,[y.value?(e.openBlock(),e.createBlock(RZ,{key:0,"options-type":"view",onClick:c[0]||(c[0]=e.withModifiers(o=>y.value=!1,["self"])),onMouseleave:c[1]||(c[1]=o=>y.value=!1),onCloseTooltip:p,onEdit:T,onDelete:b})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"report-view__header__team-and-name",style:e.normalizeStyle(t.isTemplateMode?{"max-width":"80%"}:{"max-width":"100%"})},[i.value&&u.value?(e.openBlock(),e.createElementBlock("div",QJt,[e.createElementVNode("img",{src:i.value,alt:""},null,8,$Jt)])):e.createCommentVNode("",!0),e.createElementVNode("div",tHt,e.toDisplayString(d.value),1)],4),e.withDirectives(e.createElementVNode("div",{role:"button",class:"report-view__header__actions",onClick:c[2]||(c[2]=o=>y.value=!0)},[...c[3]||(c[3]=[e.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.56953 6.28672C3.56953 7.19972 2.83253 7.93672 1.91953 7.93672C1.00653 7.93672 0.269531 7.19972 0.269531 6.28672C0.269531 5.37372 1.00653 4.63672 1.91953 4.63672C2.83253 4.63672 3.56953 5.37372 3.56953 6.28672ZM8.51953 4.63672C7.60653 4.63672 6.86953 5.37372 6.86953 6.28672C6.86953 7.19972 7.60653 7.93672 8.51953 7.93672C9.43253 7.93672 10.1695 7.19972 10.1695 6.28672C10.1695 5.37372 9.43253 4.63672 8.51953 4.63672ZM15.1195 4.63672C14.2065 4.63672 13.4695 5.37372 13.4695 6.28672C13.4695 7.19972 14.2065 7.93672 15.1195 7.93672C16.0325 7.93672 16.7695 7.19972 16.7695 6.28672C16.7695 5.37372 16.0325 4.63672 15.1195 4.63672Z",fill:"white"})],-1)])],512),[[e.vShow,t.isTemplateMode&&!t.isFilterVisible]])]),e.createElementVNode("div",{class:e.normalizeClass(["report-view__content",{"no-height":[15,1,3].includes(t.viewId)}])},[e.createElementVNode("div",{class:e.normalizeClass({"field-possession-component":t.viewId===8,"timeline-component":t.viewId===4,"field-data-by-zones-component":t.viewId===9,"center-flex-column":![8,4,9].includes(t.viewId)})},[e.renderSlot(s.$slots,"default",{},void 0,!0)],2)],2)]))}},rHt=e2(eHt,[["__scopeId","data-v-3fd87681"]]);function nHt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gO={exports:{}},FZ;function aHt(){if(FZ)return gO.exports;FZ=1;function t(){}return t.prototype={on:function(r,n,y){var $=this.e||(this.e={});return($[r]||($[r]=[])).push({fn:n,ctx:y}),this},once:function(r,n,y){var $=this;function f(){$.off(r,f),n.apply(y,arguments)}return f._=n,this.on(r,f,y)},emit:function(r){var n=[].slice.call(arguments,1),y=((this.e||(this.e={}))[r]||[]).slice(),$=0,f=y.length;for($;$<f;$++)y[$].fn.apply(y[$].ctx,n);return this},off:function(r,n){var y=this.e||(this.e={}),$=y[r],f=[];if($&&n)for(var u=0,i=$.length;u<i;u++)$[u].fn!==n&&$[u].fn._!==n&&f.push($[u]);return f.length?y[r]=f:delete y[r],this}},gO.exports=t,gO.exports.TinyEmitter=t,gO.exports}var nA,UZ;function iHt(){if(UZ)return nA;UZ=1;var t=aHt();return nA=new t,nA}var oHt=iHt();const Sd=nHt(oHt);class ru{static getElements(r,n=document){if(typeof r=="string"){const y="getElementById"in n?n:void 0;if(y&&!isNaN(+r[0])){const f=y.getElementById(r);return f?[f]:[]}let $=n.querySelectorAll(r);if(!$.length&&r[0]!=="."&&r[0]!=="#"&&($=n.querySelectorAll("."+r),$.length||($=n.querySelectorAll("#"+r)),!$.length)){const f=n.querySelector(`[gs-id="${r}"]`);return f?[f]:[]}return Array.from($)}return[r]}static getElement(r,n=document){if(typeof r=="string"){const y="getElementById"in n?n:void 0;if(!r.length)return null;if(y&&r[0]==="#")return y.getElementById(r.substring(1));if(r[0]==="#"||r[0]==="."||r[0]==="[")return n.querySelector(r);if(y&&!isNaN(+r[0]))return y.getElementById(r);let $=n.querySelector(r);return y&&!$&&($=y.getElementById(r)),$||($=n.querySelector("."+r)),$}return r}static lazyLoad(r){var n,y;return r.lazyLoad||((y=(n=r.grid)==null?void 0:n.opts)==null?void 0:y.lazyLoad)&&r.lazyLoad!==!1}static createDiv(r,n){const y=document.createElement("div");return r.forEach($=>{$&&y.classList.add($)}),n==null||n.appendChild(y),y}static shouldSizeToContent(r,n=!1){return(r==null?void 0:r.grid)&&(n?r.sizeToContent===!0||r.grid.opts.sizeToContent===!0&&r.sizeToContent===void 0:!!r.sizeToContent||r.grid.opts.sizeToContent&&r.sizeToContent!==!1)}static isIntercepted(r,n){return!(r.y>=n.y+n.h||r.y+r.h<=n.y||r.x+r.w<=n.x||r.x>=n.x+n.w)}static isTouching(r,n){return ru.isIntercepted(r,{x:n.x-.5,y:n.y-.5,w:n.w+1,h:n.h+1})}static areaIntercept(r,n){const y=r.x>n.x?r.x:n.x,$=r.x+r.w<n.x+n.w?r.x+r.w:n.x+n.w;if($<=y)return 0;const f=r.y>n.y?r.y:n.y,u=r.y+r.h<n.y+n.h?r.y+r.h:n.y+n.h;return u<=f?0:($-y)*(u-f)}static area(r){return r.w*r.h}static sort(r,n=1){return r.sort((y,$)=>{const f=n*((y.y??1e4)-($.y??1e4));return f===0?n*((y.x??1e4)-($.x??1e4)):f})}static find(r,n){return n?r.find(y=>y.id===n):void 0}static toBool(r){return typeof r=="boolean"?r:typeof r=="string"?(r=r.toLowerCase(),!(r===""||r==="no"||r==="false"||r==="0")):!!r}static toNumber(r){return r===null||r.length===0?void 0:Number(r)}static parseHeight(r){let n,y="px";if(typeof r=="string")if(r==="auto"||r==="")n=0;else{const $=r.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!$)throw new Error(`Invalid height val = ${r}`);y=$[2]||"px",n=parseFloat($[1])}else n=r;return{h:n,unit:y}}static defaults(r,...n){return n.forEach(y=>{for(const $ in y){if(!y.hasOwnProperty($))return;r[$]===null||r[$]===void 0?r[$]=y[$]:typeof y[$]=="object"&&typeof r[$]=="object"&&ru.defaults(r[$],y[$])}}),r}static same(r,n){if(typeof r!="object")return r==n;if(typeof r!=typeof n||Object.keys(r).length!==Object.keys(n).length)return!1;for(const y in r)if(r[y]!==n[y])return!1;return!0}static copyPos(r,n,y=!1){return n.x!==void 0&&(r.x=n.x),n.y!==void 0&&(r.y=n.y),n.w!==void 0&&(r.w=n.w),n.h!==void 0&&(r.h=n.h),y&&(n.minW&&(r.minW=n.minW),n.minH&&(r.minH=n.minH),n.maxW&&(r.maxW=n.maxW),n.maxH&&(r.maxH=n.maxH)),r}static samePos(r,n){return r&&n&&r.x===n.x&&r.y===n.y&&(r.w||1)===(n.w||1)&&(r.h||1)===(n.h||1)}static sanitizeMinMax(r){r.minW||delete r.minW,r.minH||delete r.minH,r.maxW||delete r.maxW,r.maxH||delete r.maxH}static removeInternalAndSame(r,n){if(!(typeof r!="object"||typeof n!="object")&&!(Array.isArray(r)||Array.isArray(n)))for(let y in r){const $=r[y],f=n[y];y[0]==="_"||$===f?delete r[y]:$&&typeof $=="object"&&f!==void 0&&(ru.removeInternalAndSame($,f),Object.keys($).length||delete r[y])}}static removeInternalForSave(r,n=!0){for(let y in r)(y[0]==="_"||r[y]===null||r[y]===void 0)&&delete r[y];delete r.grid,n&&delete r.el,r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,r.locked||delete r.locked,(r.w===1||r.w===r.minW)&&delete r.w,(r.h===1||r.h===r.minH)&&delete r.h}static throttle(r,n){let y=!1;return(...$)=>{y||(y=!0,setTimeout(()=>{r(...$),y=!1},n))}}static removePositioningStyles(r){const n=r.style;n.position&&n.removeProperty("position"),n.left&&n.removeProperty("left"),n.top&&n.removeProperty("top"),n.width&&n.removeProperty("width"),n.height&&n.removeProperty("height")}static getScrollElement(r){if(!r)return document.scrollingElement||document.documentElement;const n=getComputedStyle(r);return/(auto|scroll)/.test(n.overflow+n.overflowY)?r:ru.getScrollElement(r.parentElement)}static updateScrollPosition(r,n,y){const $=ru.getScrollElement(r);if(!$)return;const f=r.getBoundingClientRect(),u=$.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight,d=f.bottom-Math.min(u.bottom,i),l=f.top-Math.max(u.top,0),a=$.scrollTop;l<0&&y<0?r.offsetHeight>u.height?$.scrollTop+=y:$.scrollTop+=Math.abs(l)>Math.abs(y)?y:l:d>0&&y>0&&(r.offsetHeight>u.height?$.scrollTop+=y:$.scrollTop+=d>y?y:d),n.top+=$.scrollTop-a}static updateScrollResize(r,n,y){const $=ru.getScrollElement(n),f=$.clientHeight,u=$===ru.getScrollElement()?0:$.getBoundingClientRect().top,i=r.clientY-u,d=i<y,l=i>f-y;d?$.scrollBy({behavior:"smooth",top:i-y}):l&&$.scrollBy({behavior:"smooth",top:y-(f-i)})}static clone(r){return r==null||typeof r!="object"?r:r instanceof Array?[...r]:{...r}}static cloneDeep(r){const n=["parentGrid","el","grid","subGrid","engine"],y=ru.clone(r);for(const $ in y)y.hasOwnProperty($)&&typeof y[$]=="object"&&$.substring(0,2)!=="__"&&!n.find(f=>f===$)&&(y[$]=ru.cloneDeep(r[$]));return y}static cloneNode(r){const n=r.cloneNode(!0);return n.removeAttribute("id"),n}static appendTo(r,n){let y;typeof n=="string"?y=ru.getElement(n):y=n,y&&y.appendChild(r)}static addElStyles(r,n){if(n instanceof Object)for(const y in n)n.hasOwnProperty(y)&&(Array.isArray(n[y])?n[y].forEach($=>{r.style[y]=$}):r.style[y]=n[y])}static initEvent(r,n){const y={type:n.type},$={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:n.target?n.target:r.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(f=>y[f]=r[f]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(f=>y[f]=r[f]),{...y,...$}}static simulateMouseEvent(r,n,y){const $=r,f=new MouseEvent(n,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:r.screenX,screenY:r.screenY,clientX:r.clientX,clientY:r.clientY,ctrlKey:$.ctrlKey??!1,altKey:$.altKey??!1,shiftKey:$.shiftKey??!1,metaKey:$.metaKey??!1,button:0,relatedTarget:r.target});(y||r.target).dispatchEvent(f)}static getValuesFromTransformedElement(r){const n=document.createElement("div");ru.addElStyles(n,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),r.appendChild(n);const y=n.getBoundingClientRect();return r.removeChild(n),n.remove(),{xScale:1/y.width,yScale:1/y.height,xOffset:y.left,yOffset:y.top}}static swap(r,n,y){if(!r)return;const $=r[n];r[n]=r[y],r[y]=$}static canBeRotated(r){var n;return!(!r||r.w===r.h||r.locked||r.noResize||(n=r.grid)!=null&&n.opts.disableResize||r.minW&&r.minW===r.maxW||r.minH&&r.minH===r.maxH)}}class P4{constructor(r={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=r.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=r.maxRow,this._float=r.float,this.nodes=r.nodes||[],this.onChange=r.onChange}batchUpdate(r=!0,n=!0){return!!this.batchMode===r?this:(this.batchMode=r,r?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,n&&this._packNodes(),this._notify()),this)}_useEntireRowArea(r,n){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!r._moving||r._skipDown||n.y<=r.y)}_fixCollisions(r,n=r,y,$={}){if(this.sortNodes(-1),y=y||this.collide(r,n),!y)return!1;if(r._moving&&!$.nested&&!this.float&&this.swap(r,y))return!0;let f=n;!this._loading&&this._useEntireRowArea(r,n)&&(f={x:0,w:this.column,y:n.y,h:n.h},y=this.collide(r,f,$.skip));let u=!1;const i={nested:!0,pack:!1};let d=0;for(;y=y||this.collide(r,f,$.skip);){if(d++>this.nodes.length*2)throw new Error("Infinite collide check");let l;if(y.locked||this._loading||r._moving&&!r._skipDown&&n.y>r.y&&!this.float&&(!this.collide(y,{...y,y:r.y},r)||!this.collide(y,{...y,y:n.y-y.h},r))){r._skipDown=r._skipDown||n.y>r.y;const a={...n,y:y.y+y.h,...i};l=this._loading&&ru.samePos(r,a)?!0:this.moveNode(r,a),(y.locked||this._loading)&&l?ru.copyPos(n,r):!y.locked&&l&&$.pack&&(this._packNodes(),n.y=y.y+y.h,ru.copyPos(r,n)),u=u||l}else l=this.moveNode(y,{...y,y:n.y+n.h,skip:r,...i});if(!l)return u;y=void 0}return u}collide(r,n=r,y){const $=r._id,f=y==null?void 0:y._id;return this.nodes.find(u=>u._id!==$&&u._id!==f&&ru.isIntercepted(u,n))}collideAll(r,n=r,y){const $=r._id,f=y==null?void 0:y._id;return this.nodes.filter(u=>u._id!==$&&u._id!==f&&ru.isIntercepted(u,n))}directionCollideCoverage(r,n,y){if(!n.rect||!r._rect)return;const $=r._rect,f={...n.rect};f.y>$.y?(f.h+=f.y-$.y,f.y=$.y):f.h+=$.y-f.y,f.x>$.x?(f.w+=f.x-$.x,f.x=$.x):f.w+=$.x-f.x;let u,i=.5;for(let d of y){if(d.locked||!d._rect)break;const l=d._rect;let a=Number.MAX_VALUE,S=Number.MAX_VALUE;$.y<l.y?a=(f.y+f.h-l.y)/l.h:$.y+$.h>l.y+l.h&&(a=(l.y+l.h-f.y)/l.h),$.x<l.x?S=(f.x+f.w-l.x)/l.w:$.x+$.w>l.x+l.w&&(S=(l.x+l.w-f.x)/l.w);const T=Math.min(S,a);T>i&&(i=T,u=d)}return n.collide=u,u}cacheRects(r,n,y,$,f,u){return this.nodes.forEach(i=>i._rect={y:i.y*n+y,x:i.x*r+u,w:i.w*r-u-$,h:i.h*n-y-f}),this}swap(r,n){if(!n||n.locked||!r||r.locked)return!1;function y(){const f=n.x,u=n.y;return n.x=r.x,n.y=r.y,r.h!=n.h?(r.x=f,r.y=n.y+n.h):r.w!=n.w?(r.x=n.x+n.w,r.y=u):(r.x=f,r.y=u),r._dirty=n._dirty=!0,!0}let $;if(r.w===n.w&&r.h===n.h&&(r.x===n.x||r.y===n.y)&&($=ru.isTouching(r,n)))return y();if($!==!1){if(r.w===n.w&&r.x===n.x&&($||($=ru.isTouching(r,n)))){if(n.y<r.y){const f=r;r=n,n=f}return y()}if($!==!1){if(r.h===n.h&&r.y===n.y&&($||($=ru.isTouching(r,n)))){if(n.x<r.x){const f=r;r=n,n=f}return y()}return!1}}}isAreaEmpty(r,n,y,$){const f={x:r||0,y:n||0,w:y||1,h:$||1};return!this.collide(f)}compact(r="compact",n=!0){if(this.nodes.length===0)return this;n&&this.sortNodes();const y=this.batchMode;y||this.batchUpdate();const $=this._inColumnResize;$||(this._inColumnResize=!0);const f=this.nodes;return this.nodes=[],f.forEach((u,i,d)=>{let l;u.locked||(u.autoPosition=!0,r==="list"&&i&&(l=d[i-1])),this.addNode(u,!1,l)}),$||delete this._inColumnResize,y||this.batchUpdate(!1),this}set float(r){this._float!==r&&(this._float=r||!1,r||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(r=1){return this.nodes=ru.sort(this.nodes,r),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(r=>{if(r._updating||r._orig===void 0||r.y===r._orig.y)return;let n=r.y;for(;n>r._orig.y;)--n,this.collide(r,{x:r.x,y:n,w:r.w,h:r.h})||(r._dirty=!0,r.y=n)}):this.nodes.forEach((r,n)=>{if(!r.locked)for(;r.y>0;){const y=n===0?0:r.y-1;if(!(n===0||!this.collide(r,{x:r.x,y,w:r.w,h:r.h})))break;r._dirty=r.y!==y,r.y=y}}),this)}prepareNode(r,n){r._id=r._id??P4._idSeq++;const y=r.id;if(y){let f=1;for(;this.nodes.find(u=>u.id===r.id&&u!==r);)r.id=y+"_"+f++}(r.x===void 0||r.y===void 0||r.x===null||r.y===null)&&(r.autoPosition=!0);const $={x:0,y:0,w:1,h:1};return ru.defaults(r,$),r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,ru.sanitizeMinMax(r),typeof r.x=="string"&&(r.x=Number(r.x)),typeof r.y=="string"&&(r.y=Number(r.y)),typeof r.w=="string"&&(r.w=Number(r.w)),typeof r.h=="string"&&(r.h=Number(r.h)),isNaN(r.x)&&(r.x=$.x,r.autoPosition=!0),isNaN(r.y)&&(r.y=$.y,r.autoPosition=!0),isNaN(r.w)&&(r.w=$.w),isNaN(r.h)&&(r.h=$.h),this.nodeBoundFix(r,n),r}nodeBoundFix(r,n){const y=r._orig||ru.copyPos({},r);if(r.maxW&&(r.w=Math.min(r.w||1,r.maxW)),r.maxH&&(r.h=Math.min(r.h||1,r.maxH)),r.minW&&(r.w=Math.max(r.w||1,r.minW)),r.minH&&(r.h=Math.max(r.h||1,r.minH)),(r.x||0)+(r.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&r._id!=null&&this.findCacheLayout(r,this.defaultColumn)===-1){const $={...r};$.autoPosition||$.x===void 0?(delete $.x,delete $.y):$.x=Math.min(this.defaultColumn-1,$.x),$.w=Math.min(this.defaultColumn,$.w||1),this.cacheOneLayout($,this.defaultColumn)}return r.w>this.column?r.w=this.column:r.w<1&&(r.w=1),this.maxRow&&r.h>this.maxRow?r.h=this.maxRow:r.h<1&&(r.h=1),r.x<0&&(r.x=0),r.y<0&&(r.y=0),r.x+r.w>this.column&&(n?r.w=this.column-r.x:r.x=this.column-r.w),this.maxRow&&r.y+r.h>this.maxRow&&(n?r.h=this.maxRow-r.y:r.y=this.maxRow-r.h),ru.samePos(r,y)||(r._dirty=!0),this}getDirtyNodes(r){return r?this.nodes.filter(n=>n._dirty&&!ru.samePos(n,n._orig)):this.nodes.filter(n=>n._dirty)}_notify(r){if(this.batchMode||!this.onChange)return this;const n=(r||[]).concat(this.getDirtyNodes());return this.onChange(n),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(r=>{delete r._dirty,delete r._lastTried}),this)}saveInitial(){return this.nodes.forEach(r=>{r._orig=ru.copyPos({},r),delete r._dirty}),this._hasLocked=this.nodes.some(r=>r.locked),this}restoreInitial(){return this.nodes.forEach(r=>{!r._orig||ru.samePos(r,r._orig)||(ru.copyPos(r,r._orig),r._dirty=!0)}),this._notify(),this}findEmptyPosition(r,n=this.nodes,y=this.column,$){const f=$?$.y*y+($.x+$.w):0;let u=!1;for(let i=f;!u;++i){const d=i%y,l=Math.floor(i/y);if(d+r.w>y)continue;const a={x:d,y:l,w:r.w,h:r.h};n.find(S=>ru.isIntercepted(a,S))||((r.x!==d||r.y!==l)&&(r._dirty=!0),r.x=d,r.y=l,delete r.autoPosition,u=!0)}return u}addNode(r,n=!1,y){const $=this.nodes.find(u=>u._id===r._id);if($)return $;this._inColumnResize?this.nodeBoundFix(r):this.prepareNode(r),delete r._temporaryRemoved,delete r._removeDOM;let f;return r.autoPosition&&this.findEmptyPosition(r,this.nodes,this.column,y)&&(delete r.autoPosition,f=!0),this.nodes.push(r),n&&this.addedNodes.push(r),f||this._fixCollisions(r),this.batchMode||this._packNodes()._notify(),r}removeNode(r,n=!0,y=!1){return this.nodes.find($=>$._id===r._id)?(y&&this.removedNodes.push(r),n&&(r._removeDOM=!0),this.nodes=this.nodes.filter($=>$._id!==r._id),r._isAboutToRemove||this._packNodes(),this._notify([r]),this):this}removeAll(r=!0,n=!0){if(delete this._layouts,!this.nodes.length)return this;r&&this.nodes.forEach($=>$._removeDOM=!0);const y=this.nodes;return this.removedNodes=n?y:[],this.nodes=[],this._notify(y)}moveNodeCheck(r,n){if(!this.changedPosConstrain(r,n))return!1;if(n.pack=!0,!this.maxRow)return this.moveNode(r,n);let y;const $=new P4({column:this.column,float:this.float,nodes:this.nodes.map(u=>u._id===r._id?(y={...u},y):{...u})});if(!y)return!1;const f=$.moveNode(y,n)&&$.getRow()<=Math.max(this.getRow(),this.maxRow);if(!f&&!n.resizing&&n.collide){const u=n.collide.el.gridstackNode;if(this.swap(r,u))return this._notify(),!0}return f?($.nodes.filter(u=>u._dirty).forEach(u=>{const i=this.nodes.find(d=>d._id===u._id);i&&(ru.copyPos(i,u),i._dirty=!0)}),this._notify(),!0):!1}willItFit(r){if(delete r._willFitPos,!this.maxRow)return!0;const n=new P4({column:this.column,float:this.float,nodes:this.nodes.map($=>({...$}))}),y={...r};return this.cleanupNode(y),delete y.el,delete y._id,delete y.content,delete y.grid,n.addNode(y),n.getRow()<=this.maxRow?(r._willFitPos=ru.copyPos({},y),!0):!1}changedPosConstrain(r,n){return n.w=n.w||r.w,n.h=n.h||r.h,r.x!==n.x||r.y!==n.y?!0:(r.maxW&&(n.w=Math.min(n.w,r.maxW)),r.maxH&&(n.h=Math.min(n.h,r.maxH)),r.minW&&(n.w=Math.max(n.w,r.minW)),r.minH&&(n.h=Math.max(n.h,r.minH)),r.w!==n.w||r.h!==n.h)}moveNode(r,n){var y,$;if(!r||!n)return!1;let f;n.pack===void 0&&!this.batchMode&&(f=n.pack=!0),typeof n.x!="number"&&(n.x=r.x),typeof n.y!="number"&&(n.y=r.y),typeof n.w!="number"&&(n.w=r.w),typeof n.h!="number"&&(n.h=r.h);const u=r.w!==n.w||r.h!==n.h,i=ru.copyPos({},r,!0);if(ru.copyPos(i,n),this.nodeBoundFix(i,u),ru.copyPos(n,i),!n.forceCollide&&ru.samePos(r,n))return!1;const d=ru.copyPos({},r),l=this.collideAll(r,i,n.skip);let a=!0;if(l.length){const S=r._moving&&!n.nested;let T=S?this.directionCollideCoverage(r,n,l):l[0];if(S&&T&&($=(y=r.grid)==null?void 0:y.opts)!=null&&$.subGridDynamic&&!r.grid._isTemp){const b=ru.areaIntercept(n.rect,T._rect),p=ru.area(n.rect),s=ru.area(T._rect);b/(p<s?p:s)>.8&&(T.grid.makeSubGrid(T.el,void 0,r),T=void 0)}T?a=!this._fixCollisions(r,i,T,n):(a=!1,f&&delete n.pack)}return a&&!ru.samePos(r,i)&&(r._dirty=!0,ru.copyPos(r,i)),n.pack&&this._packNodes()._notify(),!ru.samePos(r,d)}getRow(){return this.nodes.reduce((r,n)=>Math.max(r,n.y+n.h),0)}beginUpdate(r){return r._updating||(r._updating=!0,delete r._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const r=this.nodes.find(n=>n._updating);return r&&(delete r._updating,delete r._skipDown),this}save(r=!0,n,y){var $;const f=(($=this._layouts)==null?void 0:$.length)||0;let u;f&&(y?y!==this.column&&(u=this._layouts[y]):this.column!==f-1&&(u=this._layouts[f-1]));const i=[];return this.sortNodes(),this.nodes.forEach(d=>{const l=u==null?void 0:u.find(S=>S._id===d._id),a={...d,...l||{}};ru.removeInternalForSave(a,!r),n&&n(d,a),i.push(a)}),i}layoutsNodesChange(r){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((n,y)=>{if(!n||y===this.column)return this;if(y<this.column)this._layouts[y]=void 0;else{const $=y/this.column;r.forEach(f=>{if(!f._orig)return;const u=n.find(i=>i._id===f._id);u&&(u.y>=0&&f.y!==f._orig.y&&(u.y+=f.y-f._orig.y,u.y<0&&(u.y=0)),f.x!==f._orig.x&&(u.x=Math.round(f.x*$),u.x<0&&(u.x=0)),f.w!==f._orig.w&&(u.w=Math.round(f.w*$),u.w<1&&(u.w=1)))})}}),this)}columnChanged(r,n,y="moveScale"){var $;if(!this.nodes.length||!n||r===n)return this;const f=y==="compact"||y==="list";f&&this.sortNodes(1),n<r&&this.cacheLayout(this.nodes,r),this.batchUpdate();let u=[],i=f?this.nodes:ru.sort(this.nodes,-1);if(n>r&&this._layouts){const d=this._layouts[n]||[],l=this._layouts.length-1;!d.length&&r!==l&&($=this._layouts[l])!=null&&$.length&&(r=l,this._layouts[l].forEach(a=>{const S=i.find(T=>T._id===a._id);S&&(!f&&!a.autoPosition&&(S.x=a.x??S.x,S.y=a.y??S.y),S.w=a.w??S.w,(a.x==null||a.y===void 0)&&(S.autoPosition=!0))})),d.forEach(a=>{const S=i.findIndex(T=>T._id===a._id);if(S!==-1){const T=i[S];if(f){T.w=a.w;return}(a.autoPosition||isNaN(a.x)||isNaN(a.y))&&this.findEmptyPosition(a,u),a.autoPosition||(T.x=a.x??T.x,T.y=a.y??T.y,T.w=a.w??T.w,u.push(T)),i.splice(S,1)}})}if(f)this.compact(y,!1);else{if(i.length)if(typeof y=="function")y(n,r,u,i);else{const d=f||y==="none"?1:n/r,l=y==="move"||y==="moveScale",a=y==="scale"||y==="moveScale";i.forEach(S=>{S.x=n===1?0:l?Math.round(S.x*d):Math.min(S.x,n-1),S.w=n===1||r===1?1:a?Math.round(S.w*d)||1:Math.min(S.w,n),u.push(S)}),i=[]}u=ru.sort(u,-1),this._inColumnResize=!0,this.nodes=[],u.forEach(d=>{this.addNode(d,!1),delete d._orig})}return this.nodes.forEach(d=>delete d._orig),this.batchUpdate(!1,!f),delete this._inColumnResize,this}cacheLayout(r,n,y=!1){const $=[];return r.forEach((f,u)=>{if(f._id===void 0){const i=f.id?this.nodes.find(d=>d.id===f.id):void 0;f._id=(i==null?void 0:i._id)??P4._idSeq++}$[u]={x:f.x,y:f.y,w:f.w,_id:f._id}}),this._layouts=y?[]:this._layouts||[],this._layouts[n]=$,this}cacheOneLayout(r,n){r._id=r._id??P4._idSeq++;const y={x:r.x,y:r.y,w:r.w,_id:r._id};(r.autoPosition||r.x===void 0)&&(delete y.x,delete y.y,r.autoPosition&&(y.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[n]=this._layouts[n]||[];const $=this.findCacheLayout(r,n);return $===-1?this._layouts[n].push(y):this._layouts[n][$]=y,this}findCacheLayout(r,n){var y,$;return(($=(y=this._layouts)==null?void 0:y[n])==null?void 0:$.findIndex(f=>f._id===r._id))??-1}removeNodeFromLayoutCache(r){if(this._layouts)for(let n=0;n<this._layouts.length;n++){const y=this.findCacheLayout(r,n);y!==-1&&this._layouts[n].splice(y,1)}}cleanupNode(r){for(const n in r)n[0]==="_"&&n!=="_id"&&delete r[n];return this}}P4._idSeq=0;const T3={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class Of{}const Zw=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class S3{}function vO(t,r){t.touches.length>1||(t.cancelable&&t.preventDefault(),ru.simulateMouseEvent(t.changedTouches[0],r))}function IZ(t,r){t.cancelable&&t.preventDefault(),ru.simulateMouseEvent(t,r)}function bO(t){S3.touchHandled||(S3.touchHandled=!0,vO(t,"mousedown"))}function xO(t){S3.touchHandled&&vO(t,"mousemove")}function _O(t){if(!S3.touchHandled)return;S3.pointerLeaveTimeout&&(window.clearTimeout(S3.pointerLeaveTimeout),delete S3.pointerLeaveTimeout);const r=!!Of.dragElement;vO(t,"mouseup"),r||vO(t,"click"),S3.touchHandled=!1}function wO(t){t.pointerType!=="mouse"&&t.target.releasePointerCapture(t.pointerId)}function qZ(t){Of.dragElement&&t.pointerType!=="mouse"&&IZ(t,"mouseenter")}function jZ(t){Of.dragElement&&t.pointerType!=="mouse"&&(S3.pointerLeaveTimeout=window.setTimeout(()=>{delete S3.pointerLeaveTimeout,IZ(t,"mouseleave")},10))}class TO{constructor(r,n,y){this.host=r,this.dir=n,this.option=y,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(r){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",r)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${TO.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),Zw&&(this.el.addEventListener("touchstart",bO),this.el.addEventListener("pointerdown",wO)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Zw&&(this.el.removeEventListener("touchstart",bO),this.el.removeEventListener("pointerdown",wO)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(r){this.mouseDownEvent=r,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Zw&&(this.el.addEventListener("touchmove",xO),this.el.addEventListener("touchend",_O)),r.stopPropagation(),r.preventDefault()}_mouseMove(r){const n=this.mouseDownEvent;this.moving?this._triggerEvent("move",r):Math.abs(r.x-n.x)+Math.abs(r.y-n.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",r),document.addEventListener("keydown",this._keyEvent)),r.stopPropagation()}_mouseUp(r){this.moving&&(this._triggerEvent("stop",r),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Zw&&(this.el.removeEventListener("touchmove",xO),this.el.removeEventListener("touchend",_O)),delete this.moving,delete this.mouseDownEvent,r.stopPropagation(),r.preventDefault()}_keyEvent(r){var n,y;r.key==="Escape"&&((y=(n=this.host.gridstackNode)==null?void 0:n.grid)==null||y.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(r,n){return this.option[r]&&this.option[r](n),this}}TO.prefix="ui-resizable-";class aA{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(r,n){this._eventRegister[r]=n}off(r){delete this._eventRegister[r]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(r,n){if(!this.disabled&&this._eventRegister&&this._eventRegister[r])return this._eventRegister[r](n)}}class s9 extends aA{constructor(r,n={}){super(),this.el=r,this.option=n,this.rectScale={x:1,y:1},this._ui=()=>{const y=this.el.parentElement.getBoundingClientRect(),$={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},f=this.temporalRect||$;return{position:{left:(f.left-y.left)*this.rectScale.x,top:(f.top-y.top)*this.rectScale.y},size:{width:f.width*this.rectScale.x,height:f.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(r,n){super.on(r,n)}off(r){super.off(r)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(r){const n=r.handles&&r.handles!==this.option.handles,y=r.autoHide&&r.autoHide!==this.option.autoHide;return Object.keys(r).forEach($=>this.option[$]=r[$]),n&&(this._removeHandlers(),this._setupHandlers()),y&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(r){return r?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),Of.overResizeElement===this&&delete Of.overResizeElement),this}_mouseOver(r){Of.overResizeElement||Of.dragElement||(Of.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(r){Of.overResizeElement===this&&(delete Of.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(r=>r.trim()).map(r=>new TO(this.el,r,{element:this.option.element,start:n=>this._resizeStart(n),stop:n=>this._resizeStop(n),move:n=>this._resizing(n,r)})),this}_resizeStart(r){this.sizeToContent=ru.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=ru.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=r,this._setupHelper(),this._applyChange();const n=ru.initEvent(r,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(n,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",n),this}_resizing(r,n){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(r,n),this._applyChange();const y=ru.initEvent(r,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(y,this._ui()),this.triggerEvent("resize",y),this}_resizeStop(r){const n=ru.initEvent(r,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(n),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",n),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=s9._originStyleProp.map(y=>this.el.style[y]),this.parentOriginStylePosition=this.el.parentElement.style.position;const r=this.el.parentElement,n=ru.getValuesFromTransformedElement(r);return this.rectScale={x:n.xScale,y:n.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return s9._originStyleProp.forEach((r,n)=>{this.el.style[r]=this.elOriginStyleVal[n]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(r,n){const y=this.startEvent,$={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},f=r.clientX-y.clientX,u=this.sizeToContent?0:r.clientY-y.clientY;let i,d;n.indexOf("e")>-1?$.width+=f:n.indexOf("w")>-1&&($.width-=f,$.left+=f,i=!0),n.indexOf("s")>-1?$.height+=u:n.indexOf("n")>-1&&($.height-=u,$.top+=u,d=!0);const l=this._constrainSize($.width,$.height,i,d);return Math.round($.width)!==Math.round(l.width)&&(n.indexOf("w")>-1&&($.left+=$.width-l.width),$.width=l.width),Math.round($.height)!==Math.round(l.height)&&(n.indexOf("n")>-1&&($.top+=$.height-l.height),$.height=l.height),$}_constrainSize(r,n,y,$){const f=this.option,u=(y?f.maxWidthMoveLeft:f.maxWidth)||Number.MAX_SAFE_INTEGER,i=f.minWidth/this.rectScale.x||r,d=($?f.maxHeightMoveUp:f.maxHeight)||Number.MAX_SAFE_INTEGER,l=f.minHeight/this.rectScale.y||n,a=Math.min(u,Math.max(i,r)),S=Math.min(d,Math.max(l,n));return{width:a,height:S}}_applyChange(){let r={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const n=this.el.parentElement,{left:y,top:$}=n.getBoundingClientRect();r={left:y,top:$,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(n=>{const y=this.temporalRect[n],$=n==="width"||n==="left"?this.rectScale.x:n==="height"||n==="top"?this.rectScale.y:1;this.el.style[n]=(y-r[n])*$+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(r=>r.destroy()),delete this.handlers,this}}s9._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const sHt='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class l9 extends aA{constructor(r,n={}){var y;super(),this.el=r,this.option=n,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const $=(y=n==null?void 0:n.handle)==null?void 0:y.substring(1),f=r.gridstackNode;this.dragEls=!$||r.classList.contains($)?[r]:f!=null&&f.subGrid?[r.querySelector(n.handle)||r]:Array.from(r.querySelectorAll(n.handle)),this.dragEls.length===0&&(this.dragEls=[r]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(r,n){super.on(r,n)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(r=>{r.addEventListener("mousedown",this._mouseDown),Zw&&(r.addEventListener("touchstart",bO),r.addEventListener("pointerdown",wO))}),this.el.classList.remove("ui-draggable-disabled"))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(n=>{n.removeEventListener("mousedown",this._mouseDown),Zw&&(n.removeEventListener("touchstart",bO),n.removeEventListener("pointerdown",wO))}),r||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(r){return Object.keys(r).forEach(n=>this.option[n]=r[n]),this}_mouseDown(r){if(S3.touchHandled&&r.isTrusted&&(S3.touchHandled=!1),!Of.mouseHandled)return r.button!==0||!this.dragEls.find(n=>n===r.target)&&r.target.closest(sHt)||this.option.cancel&&r.target.closest(this.option.cancel)||(this.mouseDownEvent=r,delete this.dragging,delete Of.dragElement,delete Of.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Zw&&(r.currentTarget.addEventListener("touchmove",xO),r.currentTarget.addEventListener("touchend",_O)),r.preventDefault(),document.activeElement&&document.activeElement.blur(),Of.mouseHandled=!0),!0}_callDrag(r){if(!this.dragging)return;const n=ru.initEvent(r,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(n,this.ui()),this.triggerEvent("drag",n)}_mouseMove(r){var n;const y=this.mouseDownEvent;if(this.lastDrag=r,this.dragging)if(this._dragFollow(r),Of.pauseDrag){const $=Number.isInteger(Of.pauseDrag)?Of.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(r),$)}else this._callDrag(r);else if(Math.abs(r.x-y.x)+Math.abs(r.y-y.y)>3){this.dragging=!0,Of.dragElement=this;const $=(n=this.el.gridstackNode)==null?void 0:n.grid;$?Of.dropElement=$.el.ddElement.ddDroppable:delete Of.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=ru.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(r,this.el,this.helperContainment),this._setupHelperStyle(r);const f=ru.initEvent(r,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(f,this.ui()),this.triggerEvent("dragstart",f),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(r){var n,y;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Zw&&r.currentTarget&&(r.currentTarget.removeEventListener("touchmove",xO,!0),r.currentTarget.removeEventListener("touchend",_O,!0)),this.dragging){delete this.dragging,(n=this.el.gridstackNode)==null||delete n._origRotate,document.removeEventListener("keydown",this._keyEvent),((y=Of.dropElement)==null?void 0:y.el)===this.el.parentElement&&delete Of.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const $=ru.initEvent(r,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop($),this.triggerEvent("dragstop",$),Of.dropElement&&Of.dropElement.drop(r)}delete this.helper,delete this.mouseDownEvent,delete Of.dragElement,delete Of.dropElement,delete Of.mouseHandled,r.preventDefault()}_keyEvent(r){var n,y;const $=this.el.gridstackNode,f=($==null?void 0:$.grid)||((y=(n=Of.dropElement)==null?void 0:n.el)==null?void 0:y.gridstack);if(r.key==="Escape")$&&$._origRotate&&($._orig=$._origRotate,delete $._origRotate),f==null||f.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if($&&f&&(r.key==="r"||r.key==="R")){if(!ru.canBeRotated($))return;$._origRotate=$._origRotate||{...$._orig},delete $._moving,f.setAnimation(!1).rotate($.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),$._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,$.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",ru.swap($._orig,"w","h"),delete $._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let r=this.el;return typeof this.option.helper=="function"?r=this.option.helper(this.el):this.option.helper==="clone"&&(r=ru.cloneNode(this.el)),r.parentElement||ru.appendTo(r,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=l9.originStyleProp.map(n=>this.el.style[n]),r}_setupHelperStyle(r){var n,y;this.helper.classList.add("ui-draggable-dragging"),(y=(n=this.el.gridstackNode)==null?void 0:n.grid)==null||y.el.classList.add("grid-stack-dragging");const $=this.helper.style;return $.pointerEvents="none",$.width=this.dragOffset.width+"px",$.height=this.dragOffset.height+"px",$.willChange="left, top",$.position="fixed",this._dragFollow(r),$.transition="none",setTimeout(()=>{this.helper&&($.transition=null)},0),this}_removeHelperStyle(){var r,n,y;this.helper.classList.remove("ui-draggable-dragging"),(n=(r=this.el.gridstackNode)==null?void 0:r.grid)==null||n.el.classList.remove("grid-stack-dragging");const $=(y=this.helper)==null?void 0:y.gridstackNode;if(!($!=null&&$._isAboutToRemove)&&this.dragElementOriginStyle){const f=this.helper,u=this.dragElementOriginStyle.transition||null;f.style.transition=this.dragElementOriginStyle.transition="none",l9.originStyleProp.forEach(i=>f.style[i]=this.dragElementOriginStyle[i]||null),setTimeout(()=>f.style.transition=u,50)}return delete this.dragElementOriginStyle,this}_dragFollow(r){const n={left:0,top:0},y=this.helper.style,$=this.dragOffset;y.left=(r.clientX+$.offsetLeft-n.left)*this.dragTransform.xScale+"px",y.top=(r.clientY+$.offsetTop-n.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(r,n,y){let $=0,f=0;y&&($=this.dragTransform.xOffset,f=this.dragTransform.yOffset);const u=n.getBoundingClientRect();return{left:u.left,top:u.top,offsetLeft:-r.clientX+u.left-$,offsetTop:-r.clientY+u.top-f,width:u.width*this.dragTransform.xScale,height:u.height*this.dragTransform.yScale}}ui(){const r=this.el.parentElement.getBoundingClientRect(),n=this.helper.getBoundingClientRect();return{position:{top:(n.top-r.top)*this.dragTransform.yScale,left:(n.left-r.left)*this.dragTransform.xScale}}}}l9.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class lHt extends aA{constructor(r,n={}){super(),this.el=r,this.option=n,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(r,n){super.on(r,n)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Zw&&(this.el.addEventListener("pointerenter",qZ),this.el.addEventListener("pointerleave",jZ)))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),r||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Zw&&(this.el.removeEventListener("pointerenter",qZ),this.el.removeEventListener("pointerleave",jZ)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(r){return Object.keys(r).forEach(n=>this.option[n]=r[n]),this._setupAccept(),this}_mouseEnter(r){if(!Of.dragElement||S3.touchHandled&&r.isTrusted||!this._canDrop(Of.dragElement.el))return;r.preventDefault(),r.stopPropagation(),Of.dropElement&&Of.dropElement!==this&&Of.dropElement._mouseLeave(r,!0),Of.dropElement=this;const n=ru.initEvent(r,{target:this.el,type:"dropover"});this.option.over&&this.option.over(n,this._ui(Of.dragElement)),this.triggerEvent("dropover",n),this.el.classList.add("ui-droppable-over")}_mouseLeave(r,n=!1){var y;if(!Of.dragElement||Of.dropElement!==this)return;r.preventDefault(),r.stopPropagation();const $=ru.initEvent(r,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out($,this._ui(Of.dragElement)),this.triggerEvent("dropout",$),Of.dropElement===this&&(delete Of.dropElement,!n)){let f,u=this.el.parentElement;for(;!f&&u;)f=(y=u.ddElement)==null?void 0:y.ddDroppable,u=u.parentElement;f&&f._mouseEnter(r)}}drop(r){r.preventDefault();const n=ru.initEvent(r,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(n,this._ui(Of.dragElement)),this.triggerEvent("drop",n)}_canDrop(r){return r&&(!this.accept||this.accept(r))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=r=>r.classList.contains(this.option.accept)||r.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(r){return{draggable:r.el,...r.ui()}}}class iA{static init(r){return r.ddElement||(r.ddElement=new iA(r)),r.ddElement}constructor(r){this.el=r}on(r,n){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.on(r,n):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.on(r,n):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.on(r,n),this}off(r){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.off(r):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.off(r):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.off(r),this}setupDraggable(r){return this.ddDraggable?this.ddDraggable.updateOption(r):this.ddDraggable=new l9(this.el,r),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(r){return this.ddResizable?this.ddResizable.updateOption(r):this.ddResizable=new s9(this.el,r),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(r){return this.ddDroppable?this.ddDroppable.updateOption(r):this.ddDroppable=new lHt(this.el,r),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class cHt{resizable(r,n,y,$){return this._getDDElements(r,n).forEach(f=>{if(n==="disable"||n==="enable")f.ddResizable&&f.ddResizable[n]();else if(n==="destroy")f.ddResizable&&f.cleanResizable();else if(n==="option")f.setupResizable({[y]:$});else{const u=f.el.gridstackNode.grid;let i=f.el.getAttribute("gs-resize-handles")||u.opts.resizable.handles||"e,s,se";i==="all"&&(i="n,e,s,w,se,sw,ne,nw");const d=!u.opts.alwaysShowResizeHandle;f.setupResizable({...u.opts.resizable,handles:i,autoHide:d,start:n.start,stop:n.stop,resize:n.resize})}}),this}draggable(r,n,y,$){return this._getDDElements(r,n).forEach(f=>{if(n==="disable"||n==="enable")f.ddDraggable&&f.ddDraggable[n]();else if(n==="destroy")f.ddDraggable&&f.cleanDraggable();else if(n==="option")f.setupDraggable({[y]:$});else{const u=f.el.gridstackNode.grid;f.setupDraggable({...u.opts.draggable,start:n.start,stop:n.stop,drag:n.drag})}}),this}dragIn(r,n){return this._getDDElements(r).forEach(y=>y.setupDraggable(n)),this}droppable(r,n,y,$){return typeof n.accept=="function"&&!n._accept&&(n._accept=n.accept,n.accept=f=>n._accept(f)),this._getDDElements(r,n).forEach(f=>{n==="disable"||n==="enable"?f.ddDroppable&&f.ddDroppable[n]():n==="destroy"?f.ddDroppable&&f.cleanDroppable():n==="option"?f.setupDroppable({[y]:$}):f.setupDroppable(n)}),this}isDroppable(r){var n;return!!((n=r==null?void 0:r.ddElement)!=null&&n.ddDroppable&&!r.ddElement.ddDroppable.disabled)}isDraggable(r){var n;return!!((n=r==null?void 0:r.ddElement)!=null&&n.ddDraggable&&!r.ddElement.ddDraggable.disabled)}isResizable(r){var n;return!!((n=r==null?void 0:r.ddElement)!=null&&n.ddResizable&&!r.ddElement.ddResizable.disabled)}on(r,n,y){return this._getDDElements(r).forEach($=>$.on(n,f=>{y(f,Of.dragElement?Of.dragElement.el:f.target,Of.dragElement?Of.dragElement.helper:null)})),this}off(r,n){return this._getDDElements(r).forEach(y=>y.off(n)),this}_getDDElements(r,n){const y=r.gridstack||n!=="destroy"&&n!=="disable",$=ru.getElements(r);return $.length?$.map(f=>f.ddElement||(y?iA.init(f):null)).filter(f=>f):[]}}/*!
7985
+ `+$):n.stack=$}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=LS(this.defaults,r);const{transitional:n,paramsSerializer:y,headers:$}=r;n!==void 0&&fO.assertOptions(n,{silentJSONParsing:F5.transitional(F5.boolean),forcedJSONParsing:F5.transitional(F5.boolean),clarifyTimeoutError:F5.transitional(F5.boolean)},!1),y!=null&&(eu.isFunction(y)?r.paramsSerializer={serialize:y}:fO.assertOptions(y,{encode:F5.function,serialize:F5.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),fO.assertOptions(r,{baseUrl:F5.spelling("baseURL"),withXsrfToken:F5.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let f=$&&eu.merge($.common,$[r.method]);$&&eu.forEach(["delete","get","head","post","put","patch","common"],b=>{delete $[b]}),r.headers=H_.concat(f,$);const u=[];let i=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(i=i&&b.synchronous,u.unshift(b.fulfilled,b.rejected))});const d=[];this.interceptors.response.forEach(function(b){d.push(b.fulfilled,b.rejected)});let l,a=0,S;if(!i){const b=[zZ.bind(this),void 0];for(b.unshift(...u),b.push(...d),S=b.length,l=Promise.resolve(r);a<S;)l=l.then(b[a++],b[a++]);return l}S=u.length;let T=r;for(;a<S;){const b=u[a++],p=u[a++];try{T=b(T)}catch(s){p.call(this,s);break}}try{l=zZ.call(this,T)}catch(b){return Promise.reject(b)}for(a=0,S=d.length;a<S;)l=l.then(d[a++],d[a++]);return l}getUri(t){t=LS(this.defaults,t);const r=xZ(t.baseURL,t.url,t.allowAbsoluteUrls);return dZ(r,t.params,t.paramsSerializer)}};eu.forEach(["delete","get","head","options"],function(t){CS.prototype[t]=function(r,n){return this.request(LS(n||{},{method:t,url:r,data:(n||{}).data}))}}),eu.forEach(["post","put","patch"],function(t){function r(n){return function(y,$,f){return this.request(LS(f||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:y,data:$}))}}CS.prototype[t]=r(),CS.prototype[t+"Form"]=r(!0)});let OZt=class uQ{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function($){n=$});const y=this;this.promise.then($=>{if(!y._listeners)return;let f=y._listeners.length;for(;f-- >0;)y._listeners[f]($);y._listeners=null}),this.promise.then=$=>{let f;const u=new Promise(i=>{y.subscribe(i),f=i}).then($);return u.cancel=function(){y.unsubscribe(f)},u},r(function($,f,u){y.reason||(y.reason=new Hk($,f,u),n(y.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const n=this._listeners.indexOf(r);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const r=new AbortController,n=y=>{r.abort(y)};return this.subscribe(n),r.signal.unsubscribe=()=>this.unsubscribe(n),r.signal}static source(){let r;return{token:new uQ(function(n){r=n}),cancel:r}}};function EZt(t){return function(r){return t.apply(null,r)}}function zZt(t){return eu.isObject(t)&&t.isAxiosError===!0}const tA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(tA).forEach(([t,r])=>{tA[r]=t});function PZ(t){const r=new CS(t),n=HG(CS.prototype.request,r);return eu.extend(n,CS.prototype,r,{allOwnKeys:!0}),eu.extend(n,r,null,{allOwnKeys:!0}),n.create=function(y){return PZ(LS(t,y))},n}const xv=PZ(i9);xv.Axios=CS,xv.CanceledError=Hk,xv.CancelToken=OZt,xv.isCancel=yZ,xv.VERSION=MZ,xv.toFormData=cO,xv.AxiosError=Rm,xv.Cancel=xv.CanceledError,xv.all=function(t){return Promise.all(t)},xv.spread=EZt,xv.isAxiosError=zZt,xv.mergeConfig=LS,xv.AxiosHeaders=H_,xv.formToJSON=t=>fZ(eu.isHTMLForm(t)?new FormData(t):t),xv.getAdapter=EZ.getAdapter,xv.HttpStatusCode=tA,xv.default=xv;const{Axios:$we,AxiosError:t5e,CanceledError:e5e,isCancel:r5e,CancelToken:n5e,VERSION:a5e,all:i5e,Cancel:o5e,isAxiosError:s5e,spread:l5e,toFormData:c5e,AxiosHeaders:u5e,HttpStatusCode:d5e,formToJSON:p5e,getAdapter:h5e,mergeConfig:f5e}=xv,MZt=["gameId","playerId","teamId","x","y","momentOfPlay","section","playId","timeSection"];let eA=null;function VZt(){return eA||(eA=MZt.reduce((t,r,n)=>(t[n]=r,t),{})),eA}const PZt=["playId","playerId","teamId","gameId","categoryId","relatedCategoriesIds","x1","y1","x2","y2","x3","y3","fieldSection","momentOfPlay","playingAs","matchLapse","matchResult","matchResultAtMomentOfPlay","relatedPlayId","touchOrder","timeSection"];let rA=null;function AZt(){return rA||(rA=PZt.reduce((t,r,n)=>(t[n]=r,t),{})),rA}const mO={TO_RIGHT:"toRight",TO_LEFT:"toLeft"},RZt={class:"modal-confirmation"},FZt={class:"modal-confirmation__container"},UZt={class:"modal-confirmation__title"},IZt={class:"modal-confirmation"},qZt={class:"modal-confirmation__container"},jZt={class:"modal-confirmation__title"},DZt={class:"specific-plays-titlecontainer"},WZt={class:"specific-plays-title"},BZt={key:0,class:"specific-plays-title-elegibility"},KZt={key:1},XZt={class:"specific-plays-controls"},GZt={class:"specific-plays-controls11"},ZZt={class:"radio-container"},JZt={key:0,width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},HZt={class:"radio-label"},YZt=["src"],QZt={class:"radio-container"},$Zt={key:0,width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tJt={class:"radio-label"},eJt=["src"],rJt={class:"cont-app-value-incement-second"},nJt={class:"contappvalueincementsecond-value"},aJt={key:0},iJt={class:"contappvalueincementsecond-controls-container"},oJt={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},sJt={class:"text-icon-info"},lJt={class:"cont-app-value-incement-second"},cJt={class:"contappvalueincementsecond-value"},uJt={key:0},dJt={class:"contappvalueincementsecond-controls-container"},pJt={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},hJt={class:"text-icon-info"},fJt={class:"cont-app-value-incement-second"},mJt={class:"contappvalueincementsecond-value"},yJt={key:0},gJt={class:"contappvalueincementsecond-controls-container"},vJt={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},bJt={class:"specific-plays-field__soccer-field"},xJt={class:"game-teams"},_Jt={class:"game-teams__team home"},wJt={key:0,class:"team-logo"},TJt=["src"],SJt={class:"game-teams__team away"},kJt={key:0,class:"team-logo"},LJt=["src"],CJt={class:"specific-plays-field__play-buttons__container"},NJt={key:1,class:"specific-plays-radio-container-movil"},OJt={class:"radio-container"},EJt={class:"radio-label"},zJt=["src"],MJt={class:"radio-container"},VJt={class:"radio-label"},PJt=["src"],AJt={key:0,class:"h-separator"},RJt={key:1,class:"corner-info"},FJt={class:"corner-info__team"},UJt=["src"],IJt={class:"corner-info__details"},qJt={class:"corner-info__details__player"},jJt={class:"corner-info__details__how-was"},yO=.6,DJt=5,WJt=10,BJt=600,KJt=600,XJt=5,GJt={__name:"GSCSpecificPlays",props:{widthContainer:{type:Number,default:1280},selectedCategoryId:{type:Number,default:31},teamIdForAnalysis:{type:Number,default:1},playIdForAnalysis:{type:Number,default:null},seasonIdForAnalysis:{type:Number,default:1325},tournamentSelected:{type:Object,default:()=>({})},advancedFilters:{type:Object,default:()=>({areConnectionsVisible:!1,arePathsVisible:!1,secondsBefore:-1,secondsAfter:1,secondsBeforeAndAfter:0})},filters:{type:Object,default:()=>({isMoment:!1,final:[1,2,3],moment:[1,2,3],playingAs:[1,2],sections:[1,2,3,4,5,6],games:[],players:[],cornertype:31,howWas:[120,126,327,133],zona:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],whathappened:[583,585,587,589,584,586,588,590,122,128,136,142,123,129,137,143,124,130,138,144,125,131,139,14,146,147,327,133],isWhatHappenedFull:!0,isZoneFull:!0})},isGameOnly:{type:Boolean,default:!1},game:{type:Object,default:()=>({id:62323,home_team:1,away_team:14,season:1325,game_status:4,home_acronym:"CHI",away_acronym:"SAN",logo_home:"https://golstatsimages.blob.core.windows.net/teams-80/1.png",logo_away:"https://golstatsimages.blob.core.windows.net/teams-80/14.png"})},gameIdForAnalysis:{type:Number,default:null},isAgainstMode:{type:Boolean,default:!1},areFiltersOpen:{type:Boolean,default:!1},isTacticVisible:{type:Boolean,default:!0},isSynchronization:{type:Boolean,default:!1},canPlayVideos:{type:Boolean,default:!0},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])},isFieldOnly:{type:Boolean,default:!0},isTemplateMode:{type:Boolean,default:!1},isCornerInfoVisible:{type:Boolean,default:!1},isNullCornerData:{type:Boolean,default:!1}},emits:["open-media-player","corners-filled","changelateralidad"],setup(t,{emit:r}){let n=0;const y=t,$=VZt(),f=AZt(),u=[{text:"Rematado fue gol",categoriesIds:[583,585,587,589]},{text:"Rematado no fue gol",categoriesIds:[584,586,588,590]},{text:"Rematado sin destino",categoriesIds:[122,128,136,142]},{text:y.tournamentSelected.is_female==1?"Ganado por portera rival":"Ganado por portero rival",categoriesIds:[123,129,137,143]},{text:y.tournamentSelected.is_female==1?"Ganado por jugadora rival":"Ganado por jugador rival",categoriesIds:[124,130,138,144]},{text:"Sin destino",categoriesIds:[125,131,139,145]}],i=new Map([[120,"Comba hacia afuera"],[134,"Comba hacia afuera"],[126,"Comba hacia adentro"],[140,"Comba hacia adentro"],[327,"Raz de área"],[146,"Raz de área"],[133,"En corto"],[147,"En corto"]]),d=u.reduce((tr,Fe)=>(Fe.categoriesIds.forEach(sr=>{tr.set(sr,Fe.text)}),tr),new Map),l={headers:{Authorization:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}},a=r,S=e.ref(null),T=e.ref("0"),b=e.ref(["-1","0"]),p=e.ref(new Map),s=e.ref(!y.isTacticVisible),c=e.ref(!1),o=e.ref([]),h=e.ref(!0),v=e.ref(!0),k=e.ref(!1),L=e.ref(!1),E=e.ref(new Map),P=e.computed(()=>{if(y.gameIdForAnalysis&&y.playIdForAnalysis&&o.value){const tr=o.value.find(Fe=>Fe.game_id===y.gameIdForAnalysis);if(tr){if(tr.corners.find(Fe=>Fe.play_id===y.playIdForAnalysis))return!1;if(tr.cornersAgainstTeam.find(Fe=>Fe.play_id===y.playIdForAnalysis))return!0}}return y.isAgainstMode}),V=e.computed(()=>{const tr=[];return U.value&&(h.value&&tr.push(y.teamIdForAnalysis),v.value&&tr.push(y.teamIdForAnalysis!==U.value.home_team?U.value.home_team:U.value.visiting_team)),tr}),I=e.computed(()=>y.widthContainer<=768?"cont-data768":"cont-data"),j=e.computed(()=>{const tr=y.widthContainer;return tr<=768?"cont-collectors768":tr<=900?"cont-collectors900":"cont-collectors"}),F=e.computed(()=>{const tr=y.widthContainer;return tr<=768?"cont-who-connected768":tr<=900?"cont-who-connected900":"cont-who-connected"}),D=e.computed(()=>o.value?o.value.findIndex(tr=>tr.isSelected):null),U=e.computed(()=>o.value?o.value[D.value]:null),M=e.ref(null),X=e.computed(()=>{const tr=o.value[D.value];let Fe=!1;if(tr){const sr=tr[`${P.value?"cornersAgainstTeam":"corners"}`].find(Ye=>Ye.isSelected);if(sr&&sr.playConnections){yt(sr);const Ye=sr.playConnections;let Te=[Ye.mainPlay];return Ye.relatedPlays&&Te.push(...Ye.relatedPlays),Te.sort((Re,Ve)=>Re.touchOrder-Ve.touchOrder),Te=Te.filter(Re=>{let Ve=!0;return Fe?!1:(O.value?Ve=!Re.isTeamForAnalysis&&Re.y1<=yO||Re.isTeamForAnalysis&&Re.y1>=yO:Ve=Re.isTeamForAnalysis&&Re.y1<=yO||!Re.isTeamForAnalysis&&Re.y1>=yO,Fe=!Ve,Ve)}),Te.forEach((Re,Ve)=>{Ve>0&&(Re.previousPlayConnection=Te[Ve-1]),Ve===Te.length-1&&(Re.isLastPlay=!0)}),Te}}return[]}),O=e.computed(()=>{const tr=o.value[D.value];if(tr){const Fe=tr[`${P.value?"cornersAgainstTeam":"corners"}`].find(sr=>sr.isSelected);return Fe?Fe.isAgainst:!1}return!1}),Y=e.computed(()=>{const tr=o.value[D.value];if(tr){mt(tr);const Fe=tr[`${P.value?"cornersAgainstTeam":"corners"}`].find(sr=>sr.isSelected);return Fe?Fe.fieldPositions:null}return null}),st=e.ref({});function mt(tr){st.value=tr}function yt(tr){M.value=tr}const bt=e.computed(()=>Y.value?Y.value.get(T.value):[]),xt=e.computed(()=>{if(Y.value){const tr=Number(b.value[0]),Fe=Number(b.value[1]),sr=[];if(Fe!==tr)for(let Ye=tr;Ye<Fe;Ye++){const Te=Y.value.get(Ye.toString()),Re=Y.value.get((Ye+1).toString());Te&&Re&&sr.push({playersPositions:Te,finalPlayersPositions:Re,areFirstPositions:Ye===tr,areFinalPositions:Ye===Fe-1})}else sr.push({playersPositions:Y.value.get(b.value[0]),finalPlayersPositions:Y.value.get(b.value[0]),areFirstPositions:!0,areFinalPositions:!0});return sr}return[]}),Pt=e.computed(()=>Y.value?Array.from(Y.value.keys()):[]);e.watch(()=>y.advancedFilters,tr=>{s.value=tr.areConnectionsVisible,c.value=tr.arePathsVisible;const Fe=tr.secondsBeforeAndAfter.toString(),sr=tr.secondsBefore.toString(),Ye=tr.secondsAfter.toString();Pt.value.includes(Fe)&&(T.value=Fe),Pt.value.includes(sr)&&(b.value[0]=sr),Pt.value.includes(Ye)&&(b.value[1]=Ye)},{immediate:!0,deep:!0}),e.watch(()=>P.value,()=>{y.isNullCornerData||Ne()}),e.watch(()=>y.teamIdForAnalysis,tr=>{tr&&!y.isNullCornerData&&Oe()},{immediate:!0});const qt=e.computed(()=>U.value?y.teamIdForAnalysis===U.value.home_team:!0);e.watch(()=>D.value,(tr,Fe)=>{if(tr!==Fe&&(T.value="0",b.value=["-1","0"],U.value)){U.value.corners.forEach(Ye=>{Ye.isSelected=!1}),U.value.cornersAgainstTeam.forEach(Ye=>{Ye.isSelected=!1});const sr=(P.value?U.value.cornersAgainstTeam:U.value.corners).filter(Ye=>Ye.isVisible);sr.length>0&&(sr[0].isSelected=!0)}}),e.watch(()=>y.filters,tr=>{tr&&It()},{deep:!0,immediate:!0}),e.watch(()=>y.isTacticVisible,tr=>{s.value=!tr});function _t(tr){a("changelateralidad",tr)}function It(){if(o.value)if(y.isSynchronization)o.value.forEach((tr,Fe)=>{tr.isVisible=!0,Fe===0&&(tr.isSelected=!0,tr.isExpanded=!0,tr.corners.forEach(sr=>{sr.isVisible=!0}),tr.cornersAgainstTeam.forEach(sr=>{sr.isVisible=!0}))});else{let tr=!1;o.value.forEach(Fe=>{if(Fe.isSelected=!1,P.value&&Fe.isSoccerFieldDataRivalLoaded||!P.value&&Fe.isSoccerFieldDataLoaded){const sr=P.value?Fe.cornersAgainstTeam:Fe.corners;if((!y.filters.games.length||y.filters.games.includes(Fe.game_id))&&y.filters.playingAs.includes(Fe.playingAs)&&(y.filters.isMoment||y.filters.final.includes(Fe.finalResult))){let Ye=0;for(const Te of sr){if(Te.isSelected=!1,y.playIdForAnalysis&&Te.play_id===y.playIdForAnalysis){Te.isVisible=!0,Te.isSelected=!0,Ye++;break}if(y.filters.cornertype!==Te.init_category_id){Te.isVisible=!1,Te.isSelected=!1;continue}if(!y.filters.howWas.some(Re=>Te.relatedCategoriesIds.has(Re))){Te.isVisible=!1,Te.isSelected=!1;continue}if(!P.value&&y.filters.players.length&&!y.filters.players.includes(Te.player_id)){Te.isVisible=!1,Te.isSelected=!1;continue}if(Te.playConnections){if(!y.filters.sections.includes(Te.playConnections.mainPlay.timeSection)){Te.isVisible=!1,Te.isSelected=!1;continue}if(!y.filters.moment.includes(Te.playConnections.mainPlay.matchResultAtMomentOfPlay)){Te.isVisible=!1,Te.isSelected=!1;continue}const Re=Te.playConnections.mainPlay;if(Re&&!y.filters.isZoneFull&&!y.filters.zona.includes(Re.fieldSection)){Te.isVisible=!1,Te.isSelected=!1;continue}}if(!y.filters.isWhatHappenedFull&&Te.relatedCategoriesIds&&!y.filters.whathappened.some(Re=>Te.relatedCategoriesIds.has(Re))){Te.isVisible=!1,Te.isSelected=!1;continue}Te.isVisible=!0,Ye===0&&(Te.isSelected=!0),Ye++}Fe.isVisible=Ye>0,Fe.isVisible&&!tr?(Fe.isSelected=!0,Fe.isExpanded=!0,tr=!0):Fe.isSelected=!1}else Fe.isVisible=!1,sr.forEach(Ye=>{Ye.isVisible=!1,Ye.isSelected=!1})}})}}function jt([tr,Fe]){const sr=Math.round(Number(Fe));if(sr===60){const Ye=Number(tr)+1;return`${Ye<100?Ye<10?"00":"0":""}${Ye}:00.000`}return`${tr}:${sr<10?"0":""}${sr}.000`}function Rt(tr,Fe,sr,Ye){tr&&tr.forEach(Te=>{Te.isHomeTeam=Te.teamId===U.value.home_team,Te.attackDirection=Ye.get(Te.playId).mainPlay.attackDirection,Te.player=Fe.get(Te.playerId)||sr.get(Te.playerId)})}function Wt(tr,Fe){const sr=Number(b.value[Fe])+tr;if(Pt.value.includes(sr.toString())){const Ye=[...b.value];Ye[Fe]=sr.toString(),Number(Ye[1])-Number(Ye[0])>=0&&(b.value=[...Ye])}}function re(tr){const Fe=Number(T.value)+tr;Pt.value.includes(Fe.toString())&&(T.value=Fe.toString())}function le(tr){if(!tr.teams||tr.teams.length===0)return;const Fe=tr.teams[0].team_id,sr=tr.teams[1].team_id;if(y.teamIdForAnalysis===Fe&&tr.home_atk_direction===1||y.teamIdForAnalysis===sr&&tr.visiting_atk_direction===1)for(let Ye=1;Ye<5;Ye++)p.value.set(Ye,Ye%2===0?mO.TO_LEFT:mO.TO_RIGHT);else for(let Ye=1;Ye<5;Ye++)p.value.set(Ye,Ye%2===0?mO.TO_RIGHT:mO.TO_LEFT)}function he(){L.value=!0}function de(){L.value=!1}async function Jt(){try{if(U.value){const tr={messages:[{queue:"gs3.tendency",message:{key:"postmatch",action:"season",data:{season_id:y.seasonIdForAnalysis,game_id:U.value.game_id}}}]};await xv.post("https://6xh1ym8shh.execute-api.us-west-2.amazonaws.com/prod/pushInternalData",tr,l)}}catch(tr){throw new Error(tr)}finally{de()}}function te(){k.value=!0}function ne(){k.value=!1}async function Le(){try{if(U.value){const tr=U.value[`${P.value?"cornersAgainstTeam":"corners"}`].find(Fe=>Fe.isSelected);if(tr){const Fe={play_id:tr.play_id,game_id:U.value.game_id,season_id:y.seasonIdForAnalysis,seconds:Number(T.value),moment_of_play:tr.moment_of_play};await xv.post(" https://bqsyfm7sij.execute-api.us-east-2.amazonaws.com/prod/sync",Fe,l)}}}catch(tr){throw new Error(tr)}finally{ne()}}async function Oe(tr){try{const Fe=E.value.get(y.teamIdForAnalysis);if(Fe){o.value=Fe,It();return}n=tr||y.seasonIdForAnalysis;const sr=(await xv.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${n}/games/teams/${y.teamIdForAnalysis}/corners`,l)).data,Ye={corners:0,cornersAgainst:0};o.value=sr.games?sr.games.reduce((Te,Re)=>{if(y.isGameOnly&&y.gameIdForAnalysis!==Re.game_id)return Te;const Ve={againstTeam:[],team:[]},br=Re.score[1]-Re.score[0];Re.dateMillis=new Date(Re.date_time_utc),Re.isVisible=!0,Re.playingAs=Re.home_team===y.teamIdForAnalysis?1:2,Re.finalResult=br===0?3:Re.playingAs===1?br>0?2:1:br<0?2:1,Re.corners.forEach(Tr=>{const Pr=Tr.team_id===y.teamIdForAnalysis;Tr.isAgainst=!Pr,(!y.playIdForAnalysis||y.playIdForAnalysis===Tr.play_id)&&(Pr?Ve.team.push(Tr):Ve.againstTeam.push(Tr))}),Re.corners=Ve.team,Re.cornersAgainstTeam=Ve.againstTeam;const cr=Re.home_team===y.teamIdForAnalysis?1:2;Ye.corners+=Re.corners.length,Ye.cornersAgainst+=Re.cornersAgainstTeam.length;const gr={...Re,isSelected:Te.length===0,isExpanded:!1,isTeamForAnalysisHomeTeam:Re.home_team===y.teamIdForAnalysis,canPlayVideos:y.canPlayVideos&&y.videoPrivilegesPlayingAs.has(cr)};return Te.push(gr),Te},[]):[],o.value=o.value.sort((Te,Re)=>Re.dateMillis-Te.dateMillis),Pe(),a("corners-filled",Ye),await Ne(),o.value.forEach(Te=>{Te.corners.concat(Te.cornersAgainstTeam).forEach(Re=>{if(Re.playConnections){const[Ve,br]=Re.moment_of_play.split(":"),[cr,gr]=br.split("."),Tr=Number(Ve)+45*Re.playConnections.mainPlay.matchLapse;Re.isSelected=!1,Re.orderValue=+`${Tr}${cr}${gr}`}}),Te.corners=Te.corners.sort((Re,Ve)=>Re.orderValue-Ve.orderValue),Te.cornersAgainstTeam=Te.cornersAgainstTeam.sort((Re,Ve)=>Re.orderValue-Ve.orderValue)}),It()}catch(Fe){throw new Error(Fe)}}async function Ne(){try{const tr=[];o.value.forEach(Fe=>{(P.value&&!Fe.isSoccerFieldDataRivalLoaded||!P.value&&!Fe.isSoccerFieldDataLoaded)&&tr.push(Xe(Fe))}),tr.length>0&&((await Promise.all(tr)).forEach((Fe,sr)=>{ir(o.value[sr],Fe)}),It()),Pe()}catch(tr){throw new Error(tr)}}function Pe(){E.value.get(y.teamIdForAnalysis)||E.value.set(y.teamIdForAnalysis,o.value)}function Xe(tr){return y.isSynchronization?xv.get(`https://golstats-microservices.s3.us-west-2.amazonaws.com/tendency/corners-${P.value?"received":"commited"}-${n}-${y.teamIdForAnalysis}-${tr.game_id}-large.json`):xv.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${n}/corners/trends/teams/${y.teamIdForAnalysis}/${tr.game_id}${P.value?"?isR=1":""}`,l)}function He(tr){const[Fe,sr]=tr.split(", ");let Ye="";const Te=Fe.split(" ");for(const Re of Te)if(Ye+=` ${Re}`,Re.length>3)break;return sr&&Fe?`${sr.trim().charAt(0)}.${Ye}`:""}function $e(tr){let[Fe,sr]=tr.split(", ");sr=(sr==null?void 0:sr.trim())||"";let Ye="";const Te=Fe.split(" "),Re=sr.includes(" ")?sr.split(" ")[0]:sr;for(const Ve of Te)if(Ye+=` ${Ve}`,Ve.length>3)break;return Re&&Fe?`${Re} ${Ye}`:""}async function ir(tr,Fe){try{if(tr&&Fe&&(!tr.isSoccerFieldDataLoaded||!tr.isSoccerFieldDataRivalLoaded)){const sr=new Map,Ye=new Map,Te=new Map;le(Fe.data),Fe.data.players&&Fe.data.players.forEach(cr=>{cr.shortName=He(cr.name),cr.firstNameAndFirstLastName=$e(cr.name),Ye.set(cr.player_id,cr)}),Fe.data.rival_players&&Fe.data.rival_players.forEach(cr=>{cr.shortName=He(cr.name),cr.firstNameAndFirstLastName=$e(cr.name),Te.set(cr.player_id,cr)}),S.value=Fe.data.teams.find(cr=>cr.team_id===y.teamIdForAnalysis),S.value&&(S.value.rival=Fe.data.teams.find(cr=>cr.team_id!==y.teamIdForAnalysis));const Re=Fe.data.data.reduce((cr,gr)=>{const Tr=gr.reduce((hr,Nr,Ir)=>(hr[f[Ir]]=Nr,hr.isHomeTeam=hr.teamId===tr.home_team,hr),{}),Pr=Tr.playId===Tr.relatedPlayId,qe=cr.get(Tr.relatedPlayId),Ge=Tr.momentOfPlay.split(":"),Je=jt(Ge);return Tr.player=Ye.get(Tr.playerId)||Te.get(Tr.playerId),Tr.isTeamForAnalysis=Tr.teamId===y.teamIdForAnalysis,Pr&&(Tr.attackDirection=p.value.get(Tr.matchLapse),sr.set(Tr.playId,Je)),qe?Pr?qe.mainPlay=Tr:qe.relatedPlays.length<XJt&&(qe.relatedPlays.push(Tr),qe.relatedPlays.length>1&&qe.relatedPlays.sort((hr,Nr)=>hr.touchOrder-Nr.touchOrder)):cr.set(Tr.playId,{mainPlay:Pr?Tr:null,relatedPlays:Pr?[]:[Tr]}),cr},new Map),Ve=Fe.data.field_positions.reduce((cr,gr)=>{const Tr=gr.reduce((qe,Ge,Je)=>(qe[$[Je]]=Ge,qe),{});Tr.isTeamForAnalysis=Tr.teamId===y.teamIdForAnalysis;const Pr=cr.get(Tr.playId);if(Pr){const qe=Pr.get(Tr.momentOfPlay);qe?qe.push(Tr):Pr.set(Tr.momentOfPlay,[Tr])}else cr.set(Tr.playId,new Map([[Tr.momentOfPlay,[Tr]]]));return cr},new Map),br=Array.from(sr.entries()).reduce((cr,[gr,Tr])=>{const Pr=[],qe=[];let Ge=null;const Je=Ve.get(gr);if(Je){const hr=y.isSynchronization?BJt:DJt,Nr=y.isSynchronization?KJt:WJt;Array.from(Je.keys()).sort().forEach(ln=>{(!Ge||qe.length<Nr)&&(ln===Tr?Ge=Je.get(ln):Ge?qe.length<Nr&&qe.push(Je.get(ln)):(Pr.length===hr&&Pr.shift(),Pr.push(Je.get(ln))))});const Ir=new Map;Pr.forEach((ln,Nn)=>{Rt(ln,Ye,Te,Re),Ir.set(`${Nn-Pr.length}`,ln)}),Rt(Ge,Ye,Te,Re),Ir.set("0",Ge),qe.forEach((ln,Nn)=>{Rt(ln,Ye,Te,Re),Ir.set(`${Nn+1}`,ln)}),cr.set(gr,Ir)}return cr},new Map);tr[`${P.value?"cornersAgainstTeam":"corners"}`].forEach(cr=>{const gr=cr.related_categories.split(",").reduce((Pr,qe,Ge)=>{const Je=Number(qe);return Ge===1&&(cr.howWasCorner=Je),Pr.array.push(Je),Pr.sett.add(Je),Pr},{array:[],sett:new Set});for(const Pr of gr.array){const qe=i.get(Pr),Ge=d.get(Pr);if(Ge&&(cr.whatHappenedName=Ge),qe&&(cr.howWasCornerName=qe),cr.howWasCornerName&&cr.whatHappenedName)break}cr.relatedCategoriesIds=gr.sett,cr.playConnections=Re.get(cr.play_id),cr.fieldPositions=br.get(cr.play_id),cr.player=Ye.get(cr.player_id)||Te.get(cr.player_id);let Tr=cr.moment_of_play.split(".")[0];Tr.startsWith("0")&&(Tr=Tr.slice(1)),cr.formattedMomentOfPlay=Tr,cr.momentOfPlayNumber=Number(Tr.replace(":","."))}),!P.value&&!tr.isSoccerFieldDataLoaded&&(tr.isSoccerFieldDataLoaded=!0),P.value&&!tr.isSoccerFieldDataRivalLoaded&&(tr.isSoccerFieldDataRivalLoaded=!0)}}catch(sr){throw new Error(sr)}}function pr(tr){const Fe=U.value[`${P.value?"cornersAgainstTeam":"corners"}`],sr={},Ye=Fe.reduce((Te,Re)=>(Re.isVisible&&(Te.add(Re.play_id),Re.isSelected&&(sr.playId=Re.play_id)),Te),new Set);a("open-media-player",{seasonId:n,mainSectionType:1,playListType:1,playsIds:Ye,playData:sr,categoryIds:P.value?["31_r","32_r"]:[31,32],teamId:y.teamIdForAnalysis,videosType:tr,isCarouselOnly:!0})}return(tr,Fe)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.withDirectives(e.createElementVNode("div",RZt,[e.createElementVNode("div",FZt,[e.createElementVNode("div",UZt," ¿Estás seguro que deseas sincronizar el tracking del partido "+e.toDisplayString(U.value?U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`]:"")+" vs "+e.toDisplayString(U.value?U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`]:"")+" ? ",1),e.createElementVNode("div",{class:"modal-confirmation__buttons"},[e.createElementVNode("div",{class:"modal-confirmation__buttons__button cancel",onClick:de}," No "),e.createElementVNode("div",{class:"modal-confirmation__buttons__button",onClick:Jt},"Sí")])])],512),[[e.vShow,L.value]]),e.withDirectives(e.createElementVNode("div",IZt,[e.createElementVNode("div",qZt,[e.createElementVNode("div",jZt," ¿Estás seguro que deseas sincronizar esta jugada en el segundo "+e.toDisplayString(T.value)+"? ",1),e.createElementVNode("div",{class:"modal-confirmation__buttons"},[e.createElementVNode("div",{class:"modal-confirmation__buttons__button cancel",onClick:ne}," No "),e.createElementVNode("div",{class:"modal-confirmation__buttons__button",onClick:Le},"Sí")])])],512),[[e.vShow,k.value]]),e.createElementVNode("div",{class:e.normalizeClass(t.widthContainer<=768?"gsc-specific-plays-movil":"gsc-specific-plays")},[e.withDirectives(e.createElementVNode("div",DZt,[e.createElementVNode("div",WZt,[t.widthContainer<=768?(e.openBlock(),e.createElementBlock("span",BZt,"Elige que quieres ver:")):(e.openBlock(),e.createElementBlock("span",KZt,"Jugadas Específicas"))])],512),[[e.vShow,!t.isFieldOnly]]),e.createElementVNode("div",{class:e.normalizeClass(I.value)},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(j.value)},[t.widthContainer>768?(e.openBlock(),e.createBlock(CKt,{key:0,"is-against-mode":P.value,"games-by-team":o.value,"are-filters-open":t.areFiltersOpen},null,8,["is-against-mode","games-by-team","are-filters-open"])):(e.openBlock(),e.createBlock(_Xt,{key:1,"is-against-mode":P.value,"games-by-team":o.value,"are-filters-open":t.areFiltersOpen},null,8,["is-against-mode","games-by-team","are-filters-open"]))],2),[[e.vShow,!t.isFieldOnly]]),e.createElementVNode("div",{class:e.normalizeClass(F.value)},[t.isSynchronization?(e.openBlock(),e.createElementBlock("div",{key:0,role:"button",class:"button-tracking",onClick:he}," Generar datos ")):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",XZt,[e.createElementVNode("div",GZt,[e.createVNode(e.unref(qP),{modelValue:s.value,"onUpdate:modelValue":Fe[0]||(Fe[0]=sr=>s.value=sr),label:"Mostrar conexiones",fontFamily:"Poppins-Regular",labelFontSize:t.widthContainer>400?"13px":"12px","label-color":"#FFF"},null,8,["modelValue","labelFontSize"]),t.widthContainer<=768&&t.isTacticVisible?(e.openBlock(),e.createBlock(e.unref(qP),{key:0,modelValue:c.value,"onUpdate:modelValue":Fe[1]||(Fe[1]=sr=>c.value=sr),label:"Mostrar recorrido",fontFamily:"Poppins-Regular",labelFontSize:t.widthContainer>400?"13px":"12px","label-color":"#FFF"},null,8,["modelValue","labelFontSize"])):e.createCommentVNode("",!0),t.widthContainer>768?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["specific-plays-radio-container",{"is-away-team":!qt.value}])},[U.value&&t.isTacticVisible?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("label",ZZt,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Fe[2]||(Fe[2]=sr=>h.value=sr),type:"checkbox",name:"radio",checked:"",style:{display:"none"}},null,512),[[e.vModelCheckbox,h.value]]),e.createElementVNode("span",{class:e.normalizeClass(qt.value?"outer-circle-home":"outer-circle-away")},[h.value?(e.openBlock(),e.createElementBlock("svg",JZt,[...Fe[16]||(Fe[16]=[e.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"},null,-1)])])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",HZt,[e.createTextVNode(e.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`])+" ",1),e.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_logo`]},null,8,YZt)])]),e.createElementVNode("label",QZt,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Fe[3]||(Fe[3]=sr=>v.value=sr),type:"checkbox",name:"radio",style:{display:"none"}},null,512),[[e.vModelCheckbox,v.value]]),e.createElementVNode("span",{class:e.normalizeClass(qt.value?"outer-circle-away":"outer-circle-home")},[v.value?(e.openBlock(),e.createElementBlock("svg",$Zt,[...Fe[17]||(Fe[17]=[e.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"},null,-1)])])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",tJt,[e.createTextVNode(e.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`])+" ",1),e.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_logo`]},null,8,eJt)])])],64)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["specific-plays-controls22",t.widthContainer<=375?"specific-plays-controls22small":""])},[t.widthContainer>768&&t.isTacticVisible&&!t.isSynchronization?(e.openBlock(),e.createBlock(e.unref(qP),{key:0,modelValue:c.value,"onUpdate:modelValue":Fe[4]||(Fe[4]=sr=>c.value=sr),label:"Mostrar recorrido",fontFamily:"Poppins-Regular",labelFontSize:"13px","label-color":"#FFF"},null,8,["modelValue"])):e.createCommentVNode("",!0),t.isTacticVisible?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.widthContainer<=768?"specify-control-incement-second-container-mobil":"specify-control-incement-second-container")},[e.createElementVNode("div",sJt,[t.widthContainer>990||t.widthContainer<=768&&t.widthContainer>=420?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode("Inicio: ")],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode("Inicio:")],64))]),Fe[29]||(Fe[29]=e.createElementVNode("div",{class:"icon-info"},null,-1)),e.createElementVNode("div",lJt,[e.createElementVNode("div",cJt,[Number(b.value[0])>0?(e.openBlock(),e.createElementBlock("span",uJt,"+")):e.createCommentVNode("",!0),e.createTextVNode(e.toDisplayString(b.value[0]),1)]),Fe[25]||(Fe[25]=e.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),e.createElementVNode("div",dJt,[e.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Fe[7]||(Fe[7]=sr=>Wt(1,0))},[(e.openBlock(),e.createElementBlock("svg",pJt,[...Fe[23]||(Fe[23]=[e.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),e.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Fe[8]||(Fe[8]=sr=>Wt(-1,0))},[...Fe[24]||(Fe[24]=[e.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])]),e.createElementVNode("div",hJt,[t.widthContainer>990||t.widthContainer<=768&&t.widthContainer>=420?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode("Fin: ")],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode("Fin:")],64))]),Fe[30]||(Fe[30]=e.createElementVNode("div",{class:"icon-info"},null,-1)),e.createElementVNode("div",fJt,[e.createElementVNode("div",mJt,[Number(b.value[1])>0?(e.openBlock(),e.createElementBlock("span",yJt,"+")):e.createCommentVNode("",!0),e.createTextVNode(e.toDisplayString(b.value[1]),1)]),Fe[28]||(Fe[28]=e.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),e.createElementVNode("div",gJt,[e.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Fe[9]||(Fe[9]=sr=>Wt(1,1))},[(e.openBlock(),e.createElementBlock("svg",vJt,[...Fe[26]||(Fe[26]=[e.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),e.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Fe[10]||(Fe[10]=sr=>Wt(-1,1))},[...Fe[27]||(Fe[27]=[e.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])])],2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.widthContainer<=768?"specify-control-incement-second-container-mobil":"specify-control-incement-second-container")},[Fe[21]||(Fe[21]=e.createElementVNode("div",{class:"icon-info"},null,-1)),Fe[22]||(Fe[22]=e.createElementVNode("div",{class:"text-icon-info"},"Segundos antes/después del cobro:",-1)),e.createElementVNode("div",rJt,[e.createElementVNode("div",nJt,[Number(T.value)>0?(e.openBlock(),e.createElementBlock("span",aJt,"+")):e.createCommentVNode("",!0),e.createTextVNode(e.toDisplayString(T.value),1)]),Fe[20]||(Fe[20]=e.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),e.createElementVNode("div",iJt,[e.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Fe[5]||(Fe[5]=sr=>re(1))},[(e.openBlock(),e.createElementBlock("svg",oJt,[...Fe[18]||(Fe[18]=[e.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),e.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Fe[6]||(Fe[6]=sr=>re(-1))},[...Fe[19]||(Fe[19]=[e.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])])],2))],64)):e.createCommentVNode("",!0),t.isSynchronization?(e.openBlock(),e.createElementBlock("div",{key:2,role:"button",class:"button-sync",onClick:te}," Guardar sincronización ")):e.createCommentVNode("",!0)],2)],512),[[e.vShow,!t.isFieldOnly]]),e.createElementVNode("div",{class:"specific-plays-field",style:e.normalizeStyle(t.widthContainer<=768?"height: auto":"")},[e.createElementVNode("div",bJt,[e.createVNode(rGt,{"width-container":t.widthContainer,"play-connections":X.value,"players-positions":bt.value,"players-positions-by-range":xt.value,"team-id-for-analysis":t.teamIdForAnalysis,"selected-category":t.filters.cornertype,"are-connections-visible":s.value,"are-position-paths-visible":c.value,"visible-teams-ids":V.value,"is-against-corner":O.value,onChangelateralidad:_t},null,8,["width-container","play-connections","players-positions","players-positions-by-range","team-id-for-analysis","selected-category","are-connections-visible","are-position-paths-visible","visible-teams-ids","is-against-corner"])]),e.createElementVNode("div",xJt,[e.createElementVNode("div",_Jt,[t.isTemplateMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",wJt,[e.createElementVNode("img",{src:st.value.home_team_logo,alt:""},null,8,TJt)])),Fe[31]||(Fe[31]=e.createElementVNode("div",{class:"bullet"},null,-1))]),e.createElementVNode("div",SJt,[t.isTemplateMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",kJt,[e.createElementVNode("img",{src:st.value.visiting_team_logo,alt:""},null,8,LJt)])),Fe[32]||(Fe[32]=e.createElementVNode("div",{class:"bullet"},null,-1))])]),U.value&&U.value.canPlayVideos&&!t.isFieldOnly?(e.openBlock(),e.createElementBlock("div",{key:0,class:"specific-plays-field__play-buttons",style:e.normalizeStyle(t.widthContainer<=768?"gap:5px; flex-direction: column;":"")},[Fe[36]||(Fe[36]=e.createElementVNode("div",{class:"specific-plays-field__play-buttons__text"},"Visualizar video:",-1)),e.createElementVNode("div",CJt,[U.value.video_types.includes(1)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"specific-plays-field__play-buttons__button",onClick:Fe[11]||(Fe[11]=sr=>pr(1))},[...Fe[33]||(Fe[33]=[e.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[e.createElementVNode("img",{src:IP,alt:""})],-1),e.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Toma TV",-1)])])):e.createCommentVNode("",!0),U.value.video_types.includes(3)?(e.openBlock(),e.createElementBlock("div",{key:1,class:"specific-plays-field__play-buttons__button",onClick:Fe[12]||(Fe[12]=sr=>pr(3))},[...Fe[34]||(Fe[34]=[e.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[e.createElementVNode("img",{src:IP,alt:""})],-1),e.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Táctica",-1)])])):e.createCommentVNode("",!0),U.value.video_types.includes(2)?(e.openBlock(),e.createElementBlock("div",{key:2,class:"specific-plays-field__play-buttons__button",onClick:Fe[13]||(Fe[13]=sr=>pr(2))},[...Fe[35]||(Fe[35]=[e.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[e.createElementVNode("img",{src:IP,alt:""})],-1),e.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Panorámica",-1)])])):e.createCommentVNode("",!0)])],4)):e.createCommentVNode("",!0)],4),t.widthContainer<=768?(e.openBlock(),e.createElementBlock("div",NJt,[U.value&&t.isTacticVisible?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("label",OJt,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Fe[14]||(Fe[14]=sr=>h.value=sr),type:"checkbox",name:"radio",checked:"",style:{display:"none"}},null,512),[[e.vModelCheckbox,h.value]]),e.createElementVNode("span",{class:e.normalizeClass(qt.value?"outer-circle-away":"outer-circle-home")},[...Fe[37]||(Fe[37]=[e.createElementVNode("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"})],-1)])],2),e.createElementVNode("span",EJt,[e.createTextVNode(e.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`])+" ",1),e.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_logo`]},null,8,zJt)])]),e.createElementVNode("label",MJt,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Fe[15]||(Fe[15]=sr=>v.value=sr),type:"checkbox",name:"radio",style:{display:"none"}},null,512),[[e.vModelCheckbox,v.value]]),e.createElementVNode("span",{class:e.normalizeClass(qt.value?"outer-circle-away":"outer-circle-home")},[...Fe[38]||(Fe[38]=[e.createElementVNode("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"})],-1)])],2),e.createElementVNode("span",VJt,[e.createTextVNode(e.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`])+" ",1),e.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_logo`]},null,8,PJt)])])],64)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2)],2),M.value&&t.isCornerInfoVisible?(e.openBlock(),e.createElementBlock("div",AJt)):e.createCommentVNode("",!0),M.value&&t.isCornerInfoVisible?(e.openBlock(),e.createElementBlock("div",RJt,[e.createElementVNode("div",FJt,[e.createElementVNode("img",{class:"corner-info__team__logo",src:`https://golstatsimages.blob.core.windows.net/teams-80/${M.value.team_id}.png`},null,8,UJt)]),e.createElementVNode("div",IJt,[e.createElementVNode("div",qJt,[Fe[39]||(Fe[39]=e.createElementVNode("span",null," Tiro de esquina ",-1)),Fe[40]||(Fe[40]=e.createElementVNode("span",{class:"separator"}," | ",-1)),e.createElementVNode("span",null,e.toDisplayString(M.value.player.firstNameAndFirstLastName),1)]),e.createElementVNode("div",jJt,[e.createElementVNode("span",null,e.toDisplayString(M.value.howWasCornerName),1),Fe[41]||(Fe[41]=e.createElementVNode("span",{class:"separator"}," | ",-1)),e.createElementVNode("span",null,e.toDisplayString(M.value.whatHappenedName),1)])])])):e.createCommentVNode("",!0)],2)],64))}},AZ=j6(GJt,[["__scopeId","data-v-abec1cab"]]),ZJt={class:"tooltip-options"},JJt={__name:"TooltipOptions",props:{optionsType:{type:String,default:"page"}},emits:["close-tooltip","change-sort","delete-page","edit","clone","delete"],setup(t,{emit:r}){const n=t,y=r,$=e.computed(()=>n.optionsType==="page");function f(){y("close-tooltip")}function u(i){y(i),f()}return(i,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"tooltip-overlay",onClick:f}),e.createElementVNode("div",ZJt,[e.createElementVNode("ul",null,[$.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("li",{class:"option",onClick:d[0]||(d[0]=l=>u("change-sort"))},[...d[4]||(d[4]=[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),e.createTextVNode(" Cambiar orden ",-1)])]),e.createElementVNode("li",{class:"option",onClick:d[1]||(d[1]=l=>u("delete-page"))},[...d[5]||(d[5]=[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),e.createTextVNode(" Eliminar ",-1)])])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("li",{class:"option",onClick:d[2]||(d[2]=l=>u("edit"))},[...d[6]||(d[6]=[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),e.createTextVNode(" Editar ",-1)])]),e.createElementVNode("li",{class:"option",onClick:d[3]||(d[3]=l=>u("delete"))},[...d[7]||(d[7]=[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),e.createTextVNode(" Eliminar ",-1)])])],64))])])],64))}},RZ=e2(JJt,[["__scopeId","data-v-998e2429"]]),HJt={class:"report-view"},YJt={class:"report-view__header"},QJt={key:0,class:"report-view__header__logo"},$Jt=["src"],tHt={class:"report-view__header__name"},eHt={__name:"ReportView",props:{view:{type:Object,default:()=>({title:"View Title"})},isEmpty:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},game:{type:Object,default:()=>null},isHomeTeam:{type:Boolean,default:!0},isFilterVisible:{type:Boolean,default:!1},viewId:{type:Number,default:0},isPostMatch:{type:Boolean,default:!1}},emits:["edit","delete"],setup(t,{emit:r}){const n=t,y=e.ref(!1),$=r,f=[1,2,3,4,6,8,14,13],u=e.computed(()=>!f.includes(n.viewId)),i=e.computed(()=>{if(n.game)if(n.view.coreView.id==17){const s=n.view.componentProps.teamselected==n.game.homeTeam.team_id?n.game.homeTeam:n.game.awayTeam;if(s&&s.logo)return s.logo}else if(n.view.coreView.id==15){const s=n.view.componentProps.data.team==n.game.homeTeam.team_id?n.game.homeTeam:n.game.awayTeam;if(s&&s.logo)return s.logo}else{const s=n.isHomeTeam?n.game.homeTeam:n.game.awayTeam;if(s&&s.logo)return s.logo}return""}),d=e.computed(()=>{const s=n.view.coreView;return s?s.id===9?n.view.w<4?n.view.title.replace("Mapeo de ",""):n.view.title:s.id===6?a(n.view):s.id===13?S(n.view):n.view.title:n.view.title}),l=new Map([[1,"último"],[2,"penúltimo"],[3,"antepenúltimo"]]);function a(s){return n.isPostMatch?s.title:`${s.title} ${l.get(s.componentProps.gameNumber)+" partido"||""}`}function S(s){try{if(!s)return"Tabla por Categoría";const c=s.dynamicFilters||[];if(!Array.isArray(c)||c.length<2)return"Tabla por Categoría";const o=c[1]||[],h=c[0]||2;if(o&&o.length>0){const v=[{value:[213,214,215,216],label:"Pases acertados por lapsos"},{value:[217],label:"Pases filtrados por lapsos"},{value:[218,219,220,221],label:"Pases no acertados por lapsos"},{value:[485,486,487,488],label:"Balones recuperados en disputa por lapsos"},{value:[489,490,491,492],label:"Balones recuperados sin disputa por lapsos"},{value:[496,497,498,499],label:"Balones perdidos en disputa por lapsos"},{value:[500,501,502,503],label:"Balones perdidos sin disputa por lapsos"},{value:[12,55,"35_r","54_r"],label:"Goles por lapsos"},{value:[511,512],label:h==2?"Tiros a gol totales por lapsos":"Tiros a gol recibidos totales por lapsos"},{value:[537,540,544,547],label:h==2?"Tiros a gol a destino por lapsos":"Tiros a gol recibidos a destino por lapsos"},{value:[13],label:h==2?"Centros por izquierda por lapsos":"Centros por derecha recibidos por lapsos"},{value:[25],label:h==2?"Centros por derecha por lapsos":"Centros por izquierda recibidos por lapsos"},{value:[11],label:"Balones ganados en área rival por lapsos"},{value:[607,608,12,55,"35_r","54_r"],label:"Oportunidad de gol por lapsos"},{value:["40_r"],label:"Goles recibidos por lapsos"},{value:["487_r","488_r","491_r","492_r"],label:"Balones recuperados en cancha rival por lapsos"},{value:["485_r","486_r","489_r","490_r"],label:"Balones recuperados en cancha propia por lapsos"}],k=(L,E)=>{if(L.length!==E.length)return!1;const P=[...L].sort(),V=[...E].sort();return P.every((I,j)=>I===V[j])};for(const L of v)if(k(o,L.value))return L.label}return"Tabla por Categoría"}catch(c){return console.error("Error en getTableCategoryTitle:",c),"Tabla por Categoría"}}function T(){p(),$("edit")}function b(){p(),$("delete")}function p(){y.value=!1}return(s,c)=>(e.openBlock(),e.createElementBlock("div",HJt,[e.createElementVNode("div",YJt,[y.value?(e.openBlock(),e.createBlock(RZ,{key:0,"options-type":"view",onClick:c[0]||(c[0]=e.withModifiers(o=>y.value=!1,["self"])),onMouseleave:c[1]||(c[1]=o=>y.value=!1),onCloseTooltip:p,onEdit:T,onDelete:b})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"report-view__header__team-and-name",style:e.normalizeStyle(t.isTemplateMode?{"max-width":"80%"}:{"max-width":"100%"})},[i.value&&u.value?(e.openBlock(),e.createElementBlock("div",QJt,[e.createElementVNode("img",{src:i.value,alt:""},null,8,$Jt)])):e.createCommentVNode("",!0),e.createElementVNode("div",tHt,e.toDisplayString(d.value),1)],4),e.withDirectives(e.createElementVNode("div",{role:"button",class:"report-view__header__actions",onClick:c[2]||(c[2]=o=>y.value=!0)},[...c[3]||(c[3]=[e.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.56953 6.28672C3.56953 7.19972 2.83253 7.93672 1.91953 7.93672C1.00653 7.93672 0.269531 7.19972 0.269531 6.28672C0.269531 5.37372 1.00653 4.63672 1.91953 4.63672C2.83253 4.63672 3.56953 5.37372 3.56953 6.28672ZM8.51953 4.63672C7.60653 4.63672 6.86953 5.37372 6.86953 6.28672C6.86953 7.19972 7.60653 7.93672 8.51953 7.93672C9.43253 7.93672 10.1695 7.19972 10.1695 6.28672C10.1695 5.37372 9.43253 4.63672 8.51953 4.63672ZM15.1195 4.63672C14.2065 4.63672 13.4695 5.37372 13.4695 6.28672C13.4695 7.19972 14.2065 7.93672 15.1195 7.93672C16.0325 7.93672 16.7695 7.19972 16.7695 6.28672C16.7695 5.37372 16.0325 4.63672 15.1195 4.63672Z",fill:"white"})],-1)])],512),[[e.vShow,t.isTemplateMode&&!t.isFilterVisible]])]),e.createElementVNode("div",{class:e.normalizeClass(["report-view__content",{"no-height":[15,1,3].includes(t.viewId)}])},[e.createElementVNode("div",{class:e.normalizeClass({"field-possession-component":t.viewId===8,"timeline-component":t.viewId===4,"field-data-by-zones-component":t.viewId===9,"center-flex-column":![8,4,9].includes(t.viewId)})},[e.renderSlot(s.$slots,"default",{},void 0,!0)],2)],2)]))}},rHt=e2(eHt,[["__scopeId","data-v-74ec5a92"]]);function nHt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gO={exports:{}},FZ;function aHt(){if(FZ)return gO.exports;FZ=1;function t(){}return t.prototype={on:function(r,n,y){var $=this.e||(this.e={});return($[r]||($[r]=[])).push({fn:n,ctx:y}),this},once:function(r,n,y){var $=this;function f(){$.off(r,f),n.apply(y,arguments)}return f._=n,this.on(r,f,y)},emit:function(r){var n=[].slice.call(arguments,1),y=((this.e||(this.e={}))[r]||[]).slice(),$=0,f=y.length;for($;$<f;$++)y[$].fn.apply(y[$].ctx,n);return this},off:function(r,n){var y=this.e||(this.e={}),$=y[r],f=[];if($&&n)for(var u=0,i=$.length;u<i;u++)$[u].fn!==n&&$[u].fn._!==n&&f.push($[u]);return f.length?y[r]=f:delete y[r],this}},gO.exports=t,gO.exports.TinyEmitter=t,gO.exports}var nA,UZ;function iHt(){if(UZ)return nA;UZ=1;var t=aHt();return nA=new t,nA}var oHt=iHt();const Sd=nHt(oHt);class ru{static getElements(r,n=document){if(typeof r=="string"){const y="getElementById"in n?n:void 0;if(y&&!isNaN(+r[0])){const f=y.getElementById(r);return f?[f]:[]}let $=n.querySelectorAll(r);if(!$.length&&r[0]!=="."&&r[0]!=="#"&&($=n.querySelectorAll("."+r),$.length||($=n.querySelectorAll("#"+r)),!$.length)){const f=n.querySelector(`[gs-id="${r}"]`);return f?[f]:[]}return Array.from($)}return[r]}static getElement(r,n=document){if(typeof r=="string"){const y="getElementById"in n?n:void 0;if(!r.length)return null;if(y&&r[0]==="#")return y.getElementById(r.substring(1));if(r[0]==="#"||r[0]==="."||r[0]==="[")return n.querySelector(r);if(y&&!isNaN(+r[0]))return y.getElementById(r);let $=n.querySelector(r);return y&&!$&&($=y.getElementById(r)),$||($=n.querySelector("."+r)),$}return r}static lazyLoad(r){var n,y;return r.lazyLoad||((y=(n=r.grid)==null?void 0:n.opts)==null?void 0:y.lazyLoad)&&r.lazyLoad!==!1}static createDiv(r,n){const y=document.createElement("div");return r.forEach($=>{$&&y.classList.add($)}),n==null||n.appendChild(y),y}static shouldSizeToContent(r,n=!1){return(r==null?void 0:r.grid)&&(n?r.sizeToContent===!0||r.grid.opts.sizeToContent===!0&&r.sizeToContent===void 0:!!r.sizeToContent||r.grid.opts.sizeToContent&&r.sizeToContent!==!1)}static isIntercepted(r,n){return!(r.y>=n.y+n.h||r.y+r.h<=n.y||r.x+r.w<=n.x||r.x>=n.x+n.w)}static isTouching(r,n){return ru.isIntercepted(r,{x:n.x-.5,y:n.y-.5,w:n.w+1,h:n.h+1})}static areaIntercept(r,n){const y=r.x>n.x?r.x:n.x,$=r.x+r.w<n.x+n.w?r.x+r.w:n.x+n.w;if($<=y)return 0;const f=r.y>n.y?r.y:n.y,u=r.y+r.h<n.y+n.h?r.y+r.h:n.y+n.h;return u<=f?0:($-y)*(u-f)}static area(r){return r.w*r.h}static sort(r,n=1){return r.sort((y,$)=>{const f=n*((y.y??1e4)-($.y??1e4));return f===0?n*((y.x??1e4)-($.x??1e4)):f})}static find(r,n){return n?r.find(y=>y.id===n):void 0}static toBool(r){return typeof r=="boolean"?r:typeof r=="string"?(r=r.toLowerCase(),!(r===""||r==="no"||r==="false"||r==="0")):!!r}static toNumber(r){return r===null||r.length===0?void 0:Number(r)}static parseHeight(r){let n,y="px";if(typeof r=="string")if(r==="auto"||r==="")n=0;else{const $=r.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!$)throw new Error(`Invalid height val = ${r}`);y=$[2]||"px",n=parseFloat($[1])}else n=r;return{h:n,unit:y}}static defaults(r,...n){return n.forEach(y=>{for(const $ in y){if(!y.hasOwnProperty($))return;r[$]===null||r[$]===void 0?r[$]=y[$]:typeof y[$]=="object"&&typeof r[$]=="object"&&ru.defaults(r[$],y[$])}}),r}static same(r,n){if(typeof r!="object")return r==n;if(typeof r!=typeof n||Object.keys(r).length!==Object.keys(n).length)return!1;for(const y in r)if(r[y]!==n[y])return!1;return!0}static copyPos(r,n,y=!1){return n.x!==void 0&&(r.x=n.x),n.y!==void 0&&(r.y=n.y),n.w!==void 0&&(r.w=n.w),n.h!==void 0&&(r.h=n.h),y&&(n.minW&&(r.minW=n.minW),n.minH&&(r.minH=n.minH),n.maxW&&(r.maxW=n.maxW),n.maxH&&(r.maxH=n.maxH)),r}static samePos(r,n){return r&&n&&r.x===n.x&&r.y===n.y&&(r.w||1)===(n.w||1)&&(r.h||1)===(n.h||1)}static sanitizeMinMax(r){r.minW||delete r.minW,r.minH||delete r.minH,r.maxW||delete r.maxW,r.maxH||delete r.maxH}static removeInternalAndSame(r,n){if(!(typeof r!="object"||typeof n!="object")&&!(Array.isArray(r)||Array.isArray(n)))for(let y in r){const $=r[y],f=n[y];y[0]==="_"||$===f?delete r[y]:$&&typeof $=="object"&&f!==void 0&&(ru.removeInternalAndSame($,f),Object.keys($).length||delete r[y])}}static removeInternalForSave(r,n=!0){for(let y in r)(y[0]==="_"||r[y]===null||r[y]===void 0)&&delete r[y];delete r.grid,n&&delete r.el,r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,r.locked||delete r.locked,(r.w===1||r.w===r.minW)&&delete r.w,(r.h===1||r.h===r.minH)&&delete r.h}static throttle(r,n){let y=!1;return(...$)=>{y||(y=!0,setTimeout(()=>{r(...$),y=!1},n))}}static removePositioningStyles(r){const n=r.style;n.position&&n.removeProperty("position"),n.left&&n.removeProperty("left"),n.top&&n.removeProperty("top"),n.width&&n.removeProperty("width"),n.height&&n.removeProperty("height")}static getScrollElement(r){if(!r)return document.scrollingElement||document.documentElement;const n=getComputedStyle(r);return/(auto|scroll)/.test(n.overflow+n.overflowY)?r:ru.getScrollElement(r.parentElement)}static updateScrollPosition(r,n,y){const $=ru.getScrollElement(r);if(!$)return;const f=r.getBoundingClientRect(),u=$.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight,d=f.bottom-Math.min(u.bottom,i),l=f.top-Math.max(u.top,0),a=$.scrollTop;l<0&&y<0?r.offsetHeight>u.height?$.scrollTop+=y:$.scrollTop+=Math.abs(l)>Math.abs(y)?y:l:d>0&&y>0&&(r.offsetHeight>u.height?$.scrollTop+=y:$.scrollTop+=d>y?y:d),n.top+=$.scrollTop-a}static updateScrollResize(r,n,y){const $=ru.getScrollElement(n),f=$.clientHeight,u=$===ru.getScrollElement()?0:$.getBoundingClientRect().top,i=r.clientY-u,d=i<y,l=i>f-y;d?$.scrollBy({behavior:"smooth",top:i-y}):l&&$.scrollBy({behavior:"smooth",top:y-(f-i)})}static clone(r){return r==null||typeof r!="object"?r:r instanceof Array?[...r]:{...r}}static cloneDeep(r){const n=["parentGrid","el","grid","subGrid","engine"],y=ru.clone(r);for(const $ in y)y.hasOwnProperty($)&&typeof y[$]=="object"&&$.substring(0,2)!=="__"&&!n.find(f=>f===$)&&(y[$]=ru.cloneDeep(r[$]));return y}static cloneNode(r){const n=r.cloneNode(!0);return n.removeAttribute("id"),n}static appendTo(r,n){let y;typeof n=="string"?y=ru.getElement(n):y=n,y&&y.appendChild(r)}static addElStyles(r,n){if(n instanceof Object)for(const y in n)n.hasOwnProperty(y)&&(Array.isArray(n[y])?n[y].forEach($=>{r.style[y]=$}):r.style[y]=n[y])}static initEvent(r,n){const y={type:n.type},$={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:n.target?n.target:r.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(f=>y[f]=r[f]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(f=>y[f]=r[f]),{...y,...$}}static simulateMouseEvent(r,n,y){const $=r,f=new MouseEvent(n,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:r.screenX,screenY:r.screenY,clientX:r.clientX,clientY:r.clientY,ctrlKey:$.ctrlKey??!1,altKey:$.altKey??!1,shiftKey:$.shiftKey??!1,metaKey:$.metaKey??!1,button:0,relatedTarget:r.target});(y||r.target).dispatchEvent(f)}static getValuesFromTransformedElement(r){const n=document.createElement("div");ru.addElStyles(n,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),r.appendChild(n);const y=n.getBoundingClientRect();return r.removeChild(n),n.remove(),{xScale:1/y.width,yScale:1/y.height,xOffset:y.left,yOffset:y.top}}static swap(r,n,y){if(!r)return;const $=r[n];r[n]=r[y],r[y]=$}static canBeRotated(r){var n;return!(!r||r.w===r.h||r.locked||r.noResize||(n=r.grid)!=null&&n.opts.disableResize||r.minW&&r.minW===r.maxW||r.minH&&r.minH===r.maxH)}}class P4{constructor(r={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=r.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=r.maxRow,this._float=r.float,this.nodes=r.nodes||[],this.onChange=r.onChange}batchUpdate(r=!0,n=!0){return!!this.batchMode===r?this:(this.batchMode=r,r?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,n&&this._packNodes(),this._notify()),this)}_useEntireRowArea(r,n){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!r._moving||r._skipDown||n.y<=r.y)}_fixCollisions(r,n=r,y,$={}){if(this.sortNodes(-1),y=y||this.collide(r,n),!y)return!1;if(r._moving&&!$.nested&&!this.float&&this.swap(r,y))return!0;let f=n;!this._loading&&this._useEntireRowArea(r,n)&&(f={x:0,w:this.column,y:n.y,h:n.h},y=this.collide(r,f,$.skip));let u=!1;const i={nested:!0,pack:!1};let d=0;for(;y=y||this.collide(r,f,$.skip);){if(d++>this.nodes.length*2)throw new Error("Infinite collide check");let l;if(y.locked||this._loading||r._moving&&!r._skipDown&&n.y>r.y&&!this.float&&(!this.collide(y,{...y,y:r.y},r)||!this.collide(y,{...y,y:n.y-y.h},r))){r._skipDown=r._skipDown||n.y>r.y;const a={...n,y:y.y+y.h,...i};l=this._loading&&ru.samePos(r,a)?!0:this.moveNode(r,a),(y.locked||this._loading)&&l?ru.copyPos(n,r):!y.locked&&l&&$.pack&&(this._packNodes(),n.y=y.y+y.h,ru.copyPos(r,n)),u=u||l}else l=this.moveNode(y,{...y,y:n.y+n.h,skip:r,...i});if(!l)return u;y=void 0}return u}collide(r,n=r,y){const $=r._id,f=y==null?void 0:y._id;return this.nodes.find(u=>u._id!==$&&u._id!==f&&ru.isIntercepted(u,n))}collideAll(r,n=r,y){const $=r._id,f=y==null?void 0:y._id;return this.nodes.filter(u=>u._id!==$&&u._id!==f&&ru.isIntercepted(u,n))}directionCollideCoverage(r,n,y){if(!n.rect||!r._rect)return;const $=r._rect,f={...n.rect};f.y>$.y?(f.h+=f.y-$.y,f.y=$.y):f.h+=$.y-f.y,f.x>$.x?(f.w+=f.x-$.x,f.x=$.x):f.w+=$.x-f.x;let u,i=.5;for(let d of y){if(d.locked||!d._rect)break;const l=d._rect;let a=Number.MAX_VALUE,S=Number.MAX_VALUE;$.y<l.y?a=(f.y+f.h-l.y)/l.h:$.y+$.h>l.y+l.h&&(a=(l.y+l.h-f.y)/l.h),$.x<l.x?S=(f.x+f.w-l.x)/l.w:$.x+$.w>l.x+l.w&&(S=(l.x+l.w-f.x)/l.w);const T=Math.min(S,a);T>i&&(i=T,u=d)}return n.collide=u,u}cacheRects(r,n,y,$,f,u){return this.nodes.forEach(i=>i._rect={y:i.y*n+y,x:i.x*r+u,w:i.w*r-u-$,h:i.h*n-y-f}),this}swap(r,n){if(!n||n.locked||!r||r.locked)return!1;function y(){const f=n.x,u=n.y;return n.x=r.x,n.y=r.y,r.h!=n.h?(r.x=f,r.y=n.y+n.h):r.w!=n.w?(r.x=n.x+n.w,r.y=u):(r.x=f,r.y=u),r._dirty=n._dirty=!0,!0}let $;if(r.w===n.w&&r.h===n.h&&(r.x===n.x||r.y===n.y)&&($=ru.isTouching(r,n)))return y();if($!==!1){if(r.w===n.w&&r.x===n.x&&($||($=ru.isTouching(r,n)))){if(n.y<r.y){const f=r;r=n,n=f}return y()}if($!==!1){if(r.h===n.h&&r.y===n.y&&($||($=ru.isTouching(r,n)))){if(n.x<r.x){const f=r;r=n,n=f}return y()}return!1}}}isAreaEmpty(r,n,y,$){const f={x:r||0,y:n||0,w:y||1,h:$||1};return!this.collide(f)}compact(r="compact",n=!0){if(this.nodes.length===0)return this;n&&this.sortNodes();const y=this.batchMode;y||this.batchUpdate();const $=this._inColumnResize;$||(this._inColumnResize=!0);const f=this.nodes;return this.nodes=[],f.forEach((u,i,d)=>{let l;u.locked||(u.autoPosition=!0,r==="list"&&i&&(l=d[i-1])),this.addNode(u,!1,l)}),$||delete this._inColumnResize,y||this.batchUpdate(!1),this}set float(r){this._float!==r&&(this._float=r||!1,r||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(r=1){return this.nodes=ru.sort(this.nodes,r),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(r=>{if(r._updating||r._orig===void 0||r.y===r._orig.y)return;let n=r.y;for(;n>r._orig.y;)--n,this.collide(r,{x:r.x,y:n,w:r.w,h:r.h})||(r._dirty=!0,r.y=n)}):this.nodes.forEach((r,n)=>{if(!r.locked)for(;r.y>0;){const y=n===0?0:r.y-1;if(!(n===0||!this.collide(r,{x:r.x,y,w:r.w,h:r.h})))break;r._dirty=r.y!==y,r.y=y}}),this)}prepareNode(r,n){r._id=r._id??P4._idSeq++;const y=r.id;if(y){let f=1;for(;this.nodes.find(u=>u.id===r.id&&u!==r);)r.id=y+"_"+f++}(r.x===void 0||r.y===void 0||r.x===null||r.y===null)&&(r.autoPosition=!0);const $={x:0,y:0,w:1,h:1};return ru.defaults(r,$),r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,ru.sanitizeMinMax(r),typeof r.x=="string"&&(r.x=Number(r.x)),typeof r.y=="string"&&(r.y=Number(r.y)),typeof r.w=="string"&&(r.w=Number(r.w)),typeof r.h=="string"&&(r.h=Number(r.h)),isNaN(r.x)&&(r.x=$.x,r.autoPosition=!0),isNaN(r.y)&&(r.y=$.y,r.autoPosition=!0),isNaN(r.w)&&(r.w=$.w),isNaN(r.h)&&(r.h=$.h),this.nodeBoundFix(r,n),r}nodeBoundFix(r,n){const y=r._orig||ru.copyPos({},r);if(r.maxW&&(r.w=Math.min(r.w||1,r.maxW)),r.maxH&&(r.h=Math.min(r.h||1,r.maxH)),r.minW&&(r.w=Math.max(r.w||1,r.minW)),r.minH&&(r.h=Math.max(r.h||1,r.minH)),(r.x||0)+(r.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&r._id!=null&&this.findCacheLayout(r,this.defaultColumn)===-1){const $={...r};$.autoPosition||$.x===void 0?(delete $.x,delete $.y):$.x=Math.min(this.defaultColumn-1,$.x),$.w=Math.min(this.defaultColumn,$.w||1),this.cacheOneLayout($,this.defaultColumn)}return r.w>this.column?r.w=this.column:r.w<1&&(r.w=1),this.maxRow&&r.h>this.maxRow?r.h=this.maxRow:r.h<1&&(r.h=1),r.x<0&&(r.x=0),r.y<0&&(r.y=0),r.x+r.w>this.column&&(n?r.w=this.column-r.x:r.x=this.column-r.w),this.maxRow&&r.y+r.h>this.maxRow&&(n?r.h=this.maxRow-r.y:r.y=this.maxRow-r.h),ru.samePos(r,y)||(r._dirty=!0),this}getDirtyNodes(r){return r?this.nodes.filter(n=>n._dirty&&!ru.samePos(n,n._orig)):this.nodes.filter(n=>n._dirty)}_notify(r){if(this.batchMode||!this.onChange)return this;const n=(r||[]).concat(this.getDirtyNodes());return this.onChange(n),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(r=>{delete r._dirty,delete r._lastTried}),this)}saveInitial(){return this.nodes.forEach(r=>{r._orig=ru.copyPos({},r),delete r._dirty}),this._hasLocked=this.nodes.some(r=>r.locked),this}restoreInitial(){return this.nodes.forEach(r=>{!r._orig||ru.samePos(r,r._orig)||(ru.copyPos(r,r._orig),r._dirty=!0)}),this._notify(),this}findEmptyPosition(r,n=this.nodes,y=this.column,$){const f=$?$.y*y+($.x+$.w):0;let u=!1;for(let i=f;!u;++i){const d=i%y,l=Math.floor(i/y);if(d+r.w>y)continue;const a={x:d,y:l,w:r.w,h:r.h};n.find(S=>ru.isIntercepted(a,S))||((r.x!==d||r.y!==l)&&(r._dirty=!0),r.x=d,r.y=l,delete r.autoPosition,u=!0)}return u}addNode(r,n=!1,y){const $=this.nodes.find(u=>u._id===r._id);if($)return $;this._inColumnResize?this.nodeBoundFix(r):this.prepareNode(r),delete r._temporaryRemoved,delete r._removeDOM;let f;return r.autoPosition&&this.findEmptyPosition(r,this.nodes,this.column,y)&&(delete r.autoPosition,f=!0),this.nodes.push(r),n&&this.addedNodes.push(r),f||this._fixCollisions(r),this.batchMode||this._packNodes()._notify(),r}removeNode(r,n=!0,y=!1){return this.nodes.find($=>$._id===r._id)?(y&&this.removedNodes.push(r),n&&(r._removeDOM=!0),this.nodes=this.nodes.filter($=>$._id!==r._id),r._isAboutToRemove||this._packNodes(),this._notify([r]),this):this}removeAll(r=!0,n=!0){if(delete this._layouts,!this.nodes.length)return this;r&&this.nodes.forEach($=>$._removeDOM=!0);const y=this.nodes;return this.removedNodes=n?y:[],this.nodes=[],this._notify(y)}moveNodeCheck(r,n){if(!this.changedPosConstrain(r,n))return!1;if(n.pack=!0,!this.maxRow)return this.moveNode(r,n);let y;const $=new P4({column:this.column,float:this.float,nodes:this.nodes.map(u=>u._id===r._id?(y={...u},y):{...u})});if(!y)return!1;const f=$.moveNode(y,n)&&$.getRow()<=Math.max(this.getRow(),this.maxRow);if(!f&&!n.resizing&&n.collide){const u=n.collide.el.gridstackNode;if(this.swap(r,u))return this._notify(),!0}return f?($.nodes.filter(u=>u._dirty).forEach(u=>{const i=this.nodes.find(d=>d._id===u._id);i&&(ru.copyPos(i,u),i._dirty=!0)}),this._notify(),!0):!1}willItFit(r){if(delete r._willFitPos,!this.maxRow)return!0;const n=new P4({column:this.column,float:this.float,nodes:this.nodes.map($=>({...$}))}),y={...r};return this.cleanupNode(y),delete y.el,delete y._id,delete y.content,delete y.grid,n.addNode(y),n.getRow()<=this.maxRow?(r._willFitPos=ru.copyPos({},y),!0):!1}changedPosConstrain(r,n){return n.w=n.w||r.w,n.h=n.h||r.h,r.x!==n.x||r.y!==n.y?!0:(r.maxW&&(n.w=Math.min(n.w,r.maxW)),r.maxH&&(n.h=Math.min(n.h,r.maxH)),r.minW&&(n.w=Math.max(n.w,r.minW)),r.minH&&(n.h=Math.max(n.h,r.minH)),r.w!==n.w||r.h!==n.h)}moveNode(r,n){var y,$;if(!r||!n)return!1;let f;n.pack===void 0&&!this.batchMode&&(f=n.pack=!0),typeof n.x!="number"&&(n.x=r.x),typeof n.y!="number"&&(n.y=r.y),typeof n.w!="number"&&(n.w=r.w),typeof n.h!="number"&&(n.h=r.h);const u=r.w!==n.w||r.h!==n.h,i=ru.copyPos({},r,!0);if(ru.copyPos(i,n),this.nodeBoundFix(i,u),ru.copyPos(n,i),!n.forceCollide&&ru.samePos(r,n))return!1;const d=ru.copyPos({},r),l=this.collideAll(r,i,n.skip);let a=!0;if(l.length){const S=r._moving&&!n.nested;let T=S?this.directionCollideCoverage(r,n,l):l[0];if(S&&T&&($=(y=r.grid)==null?void 0:y.opts)!=null&&$.subGridDynamic&&!r.grid._isTemp){const b=ru.areaIntercept(n.rect,T._rect),p=ru.area(n.rect),s=ru.area(T._rect);b/(p<s?p:s)>.8&&(T.grid.makeSubGrid(T.el,void 0,r),T=void 0)}T?a=!this._fixCollisions(r,i,T,n):(a=!1,f&&delete n.pack)}return a&&!ru.samePos(r,i)&&(r._dirty=!0,ru.copyPos(r,i)),n.pack&&this._packNodes()._notify(),!ru.samePos(r,d)}getRow(){return this.nodes.reduce((r,n)=>Math.max(r,n.y+n.h),0)}beginUpdate(r){return r._updating||(r._updating=!0,delete r._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const r=this.nodes.find(n=>n._updating);return r&&(delete r._updating,delete r._skipDown),this}save(r=!0,n,y){var $;const f=(($=this._layouts)==null?void 0:$.length)||0;let u;f&&(y?y!==this.column&&(u=this._layouts[y]):this.column!==f-1&&(u=this._layouts[f-1]));const i=[];return this.sortNodes(),this.nodes.forEach(d=>{const l=u==null?void 0:u.find(S=>S._id===d._id),a={...d,...l||{}};ru.removeInternalForSave(a,!r),n&&n(d,a),i.push(a)}),i}layoutsNodesChange(r){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((n,y)=>{if(!n||y===this.column)return this;if(y<this.column)this._layouts[y]=void 0;else{const $=y/this.column;r.forEach(f=>{if(!f._orig)return;const u=n.find(i=>i._id===f._id);u&&(u.y>=0&&f.y!==f._orig.y&&(u.y+=f.y-f._orig.y,u.y<0&&(u.y=0)),f.x!==f._orig.x&&(u.x=Math.round(f.x*$),u.x<0&&(u.x=0)),f.w!==f._orig.w&&(u.w=Math.round(f.w*$),u.w<1&&(u.w=1)))})}}),this)}columnChanged(r,n,y="moveScale"){var $;if(!this.nodes.length||!n||r===n)return this;const f=y==="compact"||y==="list";f&&this.sortNodes(1),n<r&&this.cacheLayout(this.nodes,r),this.batchUpdate();let u=[],i=f?this.nodes:ru.sort(this.nodes,-1);if(n>r&&this._layouts){const d=this._layouts[n]||[],l=this._layouts.length-1;!d.length&&r!==l&&($=this._layouts[l])!=null&&$.length&&(r=l,this._layouts[l].forEach(a=>{const S=i.find(T=>T._id===a._id);S&&(!f&&!a.autoPosition&&(S.x=a.x??S.x,S.y=a.y??S.y),S.w=a.w??S.w,(a.x==null||a.y===void 0)&&(S.autoPosition=!0))})),d.forEach(a=>{const S=i.findIndex(T=>T._id===a._id);if(S!==-1){const T=i[S];if(f){T.w=a.w;return}(a.autoPosition||isNaN(a.x)||isNaN(a.y))&&this.findEmptyPosition(a,u),a.autoPosition||(T.x=a.x??T.x,T.y=a.y??T.y,T.w=a.w??T.w,u.push(T)),i.splice(S,1)}})}if(f)this.compact(y,!1);else{if(i.length)if(typeof y=="function")y(n,r,u,i);else{const d=f||y==="none"?1:n/r,l=y==="move"||y==="moveScale",a=y==="scale"||y==="moveScale";i.forEach(S=>{S.x=n===1?0:l?Math.round(S.x*d):Math.min(S.x,n-1),S.w=n===1||r===1?1:a?Math.round(S.w*d)||1:Math.min(S.w,n),u.push(S)}),i=[]}u=ru.sort(u,-1),this._inColumnResize=!0,this.nodes=[],u.forEach(d=>{this.addNode(d,!1),delete d._orig})}return this.nodes.forEach(d=>delete d._orig),this.batchUpdate(!1,!f),delete this._inColumnResize,this}cacheLayout(r,n,y=!1){const $=[];return r.forEach((f,u)=>{if(f._id===void 0){const i=f.id?this.nodes.find(d=>d.id===f.id):void 0;f._id=(i==null?void 0:i._id)??P4._idSeq++}$[u]={x:f.x,y:f.y,w:f.w,_id:f._id}}),this._layouts=y?[]:this._layouts||[],this._layouts[n]=$,this}cacheOneLayout(r,n){r._id=r._id??P4._idSeq++;const y={x:r.x,y:r.y,w:r.w,_id:r._id};(r.autoPosition||r.x===void 0)&&(delete y.x,delete y.y,r.autoPosition&&(y.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[n]=this._layouts[n]||[];const $=this.findCacheLayout(r,n);return $===-1?this._layouts[n].push(y):this._layouts[n][$]=y,this}findCacheLayout(r,n){var y,$;return(($=(y=this._layouts)==null?void 0:y[n])==null?void 0:$.findIndex(f=>f._id===r._id))??-1}removeNodeFromLayoutCache(r){if(this._layouts)for(let n=0;n<this._layouts.length;n++){const y=this.findCacheLayout(r,n);y!==-1&&this._layouts[n].splice(y,1)}}cleanupNode(r){for(const n in r)n[0]==="_"&&n!=="_id"&&delete r[n];return this}}P4._idSeq=0;const T3={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class Of{}const Zw=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class S3{}function vO(t,r){t.touches.length>1||(t.cancelable&&t.preventDefault(),ru.simulateMouseEvent(t.changedTouches[0],r))}function IZ(t,r){t.cancelable&&t.preventDefault(),ru.simulateMouseEvent(t,r)}function bO(t){S3.touchHandled||(S3.touchHandled=!0,vO(t,"mousedown"))}function xO(t){S3.touchHandled&&vO(t,"mousemove")}function _O(t){if(!S3.touchHandled)return;S3.pointerLeaveTimeout&&(window.clearTimeout(S3.pointerLeaveTimeout),delete S3.pointerLeaveTimeout);const r=!!Of.dragElement;vO(t,"mouseup"),r||vO(t,"click"),S3.touchHandled=!1}function wO(t){t.pointerType!=="mouse"&&t.target.releasePointerCapture(t.pointerId)}function qZ(t){Of.dragElement&&t.pointerType!=="mouse"&&IZ(t,"mouseenter")}function jZ(t){Of.dragElement&&t.pointerType!=="mouse"&&(S3.pointerLeaveTimeout=window.setTimeout(()=>{delete S3.pointerLeaveTimeout,IZ(t,"mouseleave")},10))}class TO{constructor(r,n,y){this.host=r,this.dir=n,this.option=y,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(r){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",r)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${TO.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),Zw&&(this.el.addEventListener("touchstart",bO),this.el.addEventListener("pointerdown",wO)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Zw&&(this.el.removeEventListener("touchstart",bO),this.el.removeEventListener("pointerdown",wO)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(r){this.mouseDownEvent=r,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Zw&&(this.el.addEventListener("touchmove",xO),this.el.addEventListener("touchend",_O)),r.stopPropagation(),r.preventDefault()}_mouseMove(r){const n=this.mouseDownEvent;this.moving?this._triggerEvent("move",r):Math.abs(r.x-n.x)+Math.abs(r.y-n.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",r),document.addEventListener("keydown",this._keyEvent)),r.stopPropagation()}_mouseUp(r){this.moving&&(this._triggerEvent("stop",r),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Zw&&(this.el.removeEventListener("touchmove",xO),this.el.removeEventListener("touchend",_O)),delete this.moving,delete this.mouseDownEvent,r.stopPropagation(),r.preventDefault()}_keyEvent(r){var n,y;r.key==="Escape"&&((y=(n=this.host.gridstackNode)==null?void 0:n.grid)==null||y.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(r,n){return this.option[r]&&this.option[r](n),this}}TO.prefix="ui-resizable-";class aA{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(r,n){this._eventRegister[r]=n}off(r){delete this._eventRegister[r]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(r,n){if(!this.disabled&&this._eventRegister&&this._eventRegister[r])return this._eventRegister[r](n)}}class s9 extends aA{constructor(r,n={}){super(),this.el=r,this.option=n,this.rectScale={x:1,y:1},this._ui=()=>{const y=this.el.parentElement.getBoundingClientRect(),$={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},f=this.temporalRect||$;return{position:{left:(f.left-y.left)*this.rectScale.x,top:(f.top-y.top)*this.rectScale.y},size:{width:f.width*this.rectScale.x,height:f.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(r,n){super.on(r,n)}off(r){super.off(r)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(r){const n=r.handles&&r.handles!==this.option.handles,y=r.autoHide&&r.autoHide!==this.option.autoHide;return Object.keys(r).forEach($=>this.option[$]=r[$]),n&&(this._removeHandlers(),this._setupHandlers()),y&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(r){return r?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),Of.overResizeElement===this&&delete Of.overResizeElement),this}_mouseOver(r){Of.overResizeElement||Of.dragElement||(Of.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(r){Of.overResizeElement===this&&(delete Of.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(r=>r.trim()).map(r=>new TO(this.el,r,{element:this.option.element,start:n=>this._resizeStart(n),stop:n=>this._resizeStop(n),move:n=>this._resizing(n,r)})),this}_resizeStart(r){this.sizeToContent=ru.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=ru.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=r,this._setupHelper(),this._applyChange();const n=ru.initEvent(r,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(n,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",n),this}_resizing(r,n){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(r,n),this._applyChange();const y=ru.initEvent(r,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(y,this._ui()),this.triggerEvent("resize",y),this}_resizeStop(r){const n=ru.initEvent(r,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(n),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",n),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=s9._originStyleProp.map(y=>this.el.style[y]),this.parentOriginStylePosition=this.el.parentElement.style.position;const r=this.el.parentElement,n=ru.getValuesFromTransformedElement(r);return this.rectScale={x:n.xScale,y:n.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return s9._originStyleProp.forEach((r,n)=>{this.el.style[r]=this.elOriginStyleVal[n]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(r,n){const y=this.startEvent,$={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},f=r.clientX-y.clientX,u=this.sizeToContent?0:r.clientY-y.clientY;let i,d;n.indexOf("e")>-1?$.width+=f:n.indexOf("w")>-1&&($.width-=f,$.left+=f,i=!0),n.indexOf("s")>-1?$.height+=u:n.indexOf("n")>-1&&($.height-=u,$.top+=u,d=!0);const l=this._constrainSize($.width,$.height,i,d);return Math.round($.width)!==Math.round(l.width)&&(n.indexOf("w")>-1&&($.left+=$.width-l.width),$.width=l.width),Math.round($.height)!==Math.round(l.height)&&(n.indexOf("n")>-1&&($.top+=$.height-l.height),$.height=l.height),$}_constrainSize(r,n,y,$){const f=this.option,u=(y?f.maxWidthMoveLeft:f.maxWidth)||Number.MAX_SAFE_INTEGER,i=f.minWidth/this.rectScale.x||r,d=($?f.maxHeightMoveUp:f.maxHeight)||Number.MAX_SAFE_INTEGER,l=f.minHeight/this.rectScale.y||n,a=Math.min(u,Math.max(i,r)),S=Math.min(d,Math.max(l,n));return{width:a,height:S}}_applyChange(){let r={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const n=this.el.parentElement,{left:y,top:$}=n.getBoundingClientRect();r={left:y,top:$,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(n=>{const y=this.temporalRect[n],$=n==="width"||n==="left"?this.rectScale.x:n==="height"||n==="top"?this.rectScale.y:1;this.el.style[n]=(y-r[n])*$+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(r=>r.destroy()),delete this.handlers,this}}s9._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const sHt='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class l9 extends aA{constructor(r,n={}){var y;super(),this.el=r,this.option=n,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const $=(y=n==null?void 0:n.handle)==null?void 0:y.substring(1),f=r.gridstackNode;this.dragEls=!$||r.classList.contains($)?[r]:f!=null&&f.subGrid?[r.querySelector(n.handle)||r]:Array.from(r.querySelectorAll(n.handle)),this.dragEls.length===0&&(this.dragEls=[r]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(r,n){super.on(r,n)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(r=>{r.addEventListener("mousedown",this._mouseDown),Zw&&(r.addEventListener("touchstart",bO),r.addEventListener("pointerdown",wO))}),this.el.classList.remove("ui-draggable-disabled"))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(n=>{n.removeEventListener("mousedown",this._mouseDown),Zw&&(n.removeEventListener("touchstart",bO),n.removeEventListener("pointerdown",wO))}),r||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(r){return Object.keys(r).forEach(n=>this.option[n]=r[n]),this}_mouseDown(r){if(S3.touchHandled&&r.isTrusted&&(S3.touchHandled=!1),!Of.mouseHandled)return r.button!==0||!this.dragEls.find(n=>n===r.target)&&r.target.closest(sHt)||this.option.cancel&&r.target.closest(this.option.cancel)||(this.mouseDownEvent=r,delete this.dragging,delete Of.dragElement,delete Of.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Zw&&(r.currentTarget.addEventListener("touchmove",xO),r.currentTarget.addEventListener("touchend",_O)),r.preventDefault(),document.activeElement&&document.activeElement.blur(),Of.mouseHandled=!0),!0}_callDrag(r){if(!this.dragging)return;const n=ru.initEvent(r,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(n,this.ui()),this.triggerEvent("drag",n)}_mouseMove(r){var n;const y=this.mouseDownEvent;if(this.lastDrag=r,this.dragging)if(this._dragFollow(r),Of.pauseDrag){const $=Number.isInteger(Of.pauseDrag)?Of.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(r),$)}else this._callDrag(r);else if(Math.abs(r.x-y.x)+Math.abs(r.y-y.y)>3){this.dragging=!0,Of.dragElement=this;const $=(n=this.el.gridstackNode)==null?void 0:n.grid;$?Of.dropElement=$.el.ddElement.ddDroppable:delete Of.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=ru.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(r,this.el,this.helperContainment),this._setupHelperStyle(r);const f=ru.initEvent(r,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(f,this.ui()),this.triggerEvent("dragstart",f),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(r){var n,y;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Zw&&r.currentTarget&&(r.currentTarget.removeEventListener("touchmove",xO,!0),r.currentTarget.removeEventListener("touchend",_O,!0)),this.dragging){delete this.dragging,(n=this.el.gridstackNode)==null||delete n._origRotate,document.removeEventListener("keydown",this._keyEvent),((y=Of.dropElement)==null?void 0:y.el)===this.el.parentElement&&delete Of.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const $=ru.initEvent(r,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop($),this.triggerEvent("dragstop",$),Of.dropElement&&Of.dropElement.drop(r)}delete this.helper,delete this.mouseDownEvent,delete Of.dragElement,delete Of.dropElement,delete Of.mouseHandled,r.preventDefault()}_keyEvent(r){var n,y;const $=this.el.gridstackNode,f=($==null?void 0:$.grid)||((y=(n=Of.dropElement)==null?void 0:n.el)==null?void 0:y.gridstack);if(r.key==="Escape")$&&$._origRotate&&($._orig=$._origRotate,delete $._origRotate),f==null||f.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if($&&f&&(r.key==="r"||r.key==="R")){if(!ru.canBeRotated($))return;$._origRotate=$._origRotate||{...$._orig},delete $._moving,f.setAnimation(!1).rotate($.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),$._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,$.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",ru.swap($._orig,"w","h"),delete $._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let r=this.el;return typeof this.option.helper=="function"?r=this.option.helper(this.el):this.option.helper==="clone"&&(r=ru.cloneNode(this.el)),r.parentElement||ru.appendTo(r,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=l9.originStyleProp.map(n=>this.el.style[n]),r}_setupHelperStyle(r){var n,y;this.helper.classList.add("ui-draggable-dragging"),(y=(n=this.el.gridstackNode)==null?void 0:n.grid)==null||y.el.classList.add("grid-stack-dragging");const $=this.helper.style;return $.pointerEvents="none",$.width=this.dragOffset.width+"px",$.height=this.dragOffset.height+"px",$.willChange="left, top",$.position="fixed",this._dragFollow(r),$.transition="none",setTimeout(()=>{this.helper&&($.transition=null)},0),this}_removeHelperStyle(){var r,n,y;this.helper.classList.remove("ui-draggable-dragging"),(n=(r=this.el.gridstackNode)==null?void 0:r.grid)==null||n.el.classList.remove("grid-stack-dragging");const $=(y=this.helper)==null?void 0:y.gridstackNode;if(!($!=null&&$._isAboutToRemove)&&this.dragElementOriginStyle){const f=this.helper,u=this.dragElementOriginStyle.transition||null;f.style.transition=this.dragElementOriginStyle.transition="none",l9.originStyleProp.forEach(i=>f.style[i]=this.dragElementOriginStyle[i]||null),setTimeout(()=>f.style.transition=u,50)}return delete this.dragElementOriginStyle,this}_dragFollow(r){const n={left:0,top:0},y=this.helper.style,$=this.dragOffset;y.left=(r.clientX+$.offsetLeft-n.left)*this.dragTransform.xScale+"px",y.top=(r.clientY+$.offsetTop-n.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(r,n,y){let $=0,f=0;y&&($=this.dragTransform.xOffset,f=this.dragTransform.yOffset);const u=n.getBoundingClientRect();return{left:u.left,top:u.top,offsetLeft:-r.clientX+u.left-$,offsetTop:-r.clientY+u.top-f,width:u.width*this.dragTransform.xScale,height:u.height*this.dragTransform.yScale}}ui(){const r=this.el.parentElement.getBoundingClientRect(),n=this.helper.getBoundingClientRect();return{position:{top:(n.top-r.top)*this.dragTransform.yScale,left:(n.left-r.left)*this.dragTransform.xScale}}}}l9.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class lHt extends aA{constructor(r,n={}){super(),this.el=r,this.option=n,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(r,n){super.on(r,n)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Zw&&(this.el.addEventListener("pointerenter",qZ),this.el.addEventListener("pointerleave",jZ)))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),r||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Zw&&(this.el.removeEventListener("pointerenter",qZ),this.el.removeEventListener("pointerleave",jZ)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(r){return Object.keys(r).forEach(n=>this.option[n]=r[n]),this._setupAccept(),this}_mouseEnter(r){if(!Of.dragElement||S3.touchHandled&&r.isTrusted||!this._canDrop(Of.dragElement.el))return;r.preventDefault(),r.stopPropagation(),Of.dropElement&&Of.dropElement!==this&&Of.dropElement._mouseLeave(r,!0),Of.dropElement=this;const n=ru.initEvent(r,{target:this.el,type:"dropover"});this.option.over&&this.option.over(n,this._ui(Of.dragElement)),this.triggerEvent("dropover",n),this.el.classList.add("ui-droppable-over")}_mouseLeave(r,n=!1){var y;if(!Of.dragElement||Of.dropElement!==this)return;r.preventDefault(),r.stopPropagation();const $=ru.initEvent(r,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out($,this._ui(Of.dragElement)),this.triggerEvent("dropout",$),Of.dropElement===this&&(delete Of.dropElement,!n)){let f,u=this.el.parentElement;for(;!f&&u;)f=(y=u.ddElement)==null?void 0:y.ddDroppable,u=u.parentElement;f&&f._mouseEnter(r)}}drop(r){r.preventDefault();const n=ru.initEvent(r,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(n,this._ui(Of.dragElement)),this.triggerEvent("drop",n)}_canDrop(r){return r&&(!this.accept||this.accept(r))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=r=>r.classList.contains(this.option.accept)||r.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(r){return{draggable:r.el,...r.ui()}}}class iA{static init(r){return r.ddElement||(r.ddElement=new iA(r)),r.ddElement}constructor(r){this.el=r}on(r,n){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.on(r,n):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.on(r,n):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.on(r,n),this}off(r){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.off(r):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.off(r):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.off(r),this}setupDraggable(r){return this.ddDraggable?this.ddDraggable.updateOption(r):this.ddDraggable=new l9(this.el,r),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(r){return this.ddResizable?this.ddResizable.updateOption(r):this.ddResizable=new s9(this.el,r),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(r){return this.ddDroppable?this.ddDroppable.updateOption(r):this.ddDroppable=new lHt(this.el,r),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class cHt{resizable(r,n,y,$){return this._getDDElements(r,n).forEach(f=>{if(n==="disable"||n==="enable")f.ddResizable&&f.ddResizable[n]();else if(n==="destroy")f.ddResizable&&f.cleanResizable();else if(n==="option")f.setupResizable({[y]:$});else{const u=f.el.gridstackNode.grid;let i=f.el.getAttribute("gs-resize-handles")||u.opts.resizable.handles||"e,s,se";i==="all"&&(i="n,e,s,w,se,sw,ne,nw");const d=!u.opts.alwaysShowResizeHandle;f.setupResizable({...u.opts.resizable,handles:i,autoHide:d,start:n.start,stop:n.stop,resize:n.resize})}}),this}draggable(r,n,y,$){return this._getDDElements(r,n).forEach(f=>{if(n==="disable"||n==="enable")f.ddDraggable&&f.ddDraggable[n]();else if(n==="destroy")f.ddDraggable&&f.cleanDraggable();else if(n==="option")f.setupDraggable({[y]:$});else{const u=f.el.gridstackNode.grid;f.setupDraggable({...u.opts.draggable,start:n.start,stop:n.stop,drag:n.drag})}}),this}dragIn(r,n){return this._getDDElements(r).forEach(y=>y.setupDraggable(n)),this}droppable(r,n,y,$){return typeof n.accept=="function"&&!n._accept&&(n._accept=n.accept,n.accept=f=>n._accept(f)),this._getDDElements(r,n).forEach(f=>{n==="disable"||n==="enable"?f.ddDroppable&&f.ddDroppable[n]():n==="destroy"?f.ddDroppable&&f.cleanDroppable():n==="option"?f.setupDroppable({[y]:$}):f.setupDroppable(n)}),this}isDroppable(r){var n;return!!((n=r==null?void 0:r.ddElement)!=null&&n.ddDroppable&&!r.ddElement.ddDroppable.disabled)}isDraggable(r){var n;return!!((n=r==null?void 0:r.ddElement)!=null&&n.ddDraggable&&!r.ddElement.ddDraggable.disabled)}isResizable(r){var n;return!!((n=r==null?void 0:r.ddElement)!=null&&n.ddResizable&&!r.ddElement.ddResizable.disabled)}on(r,n,y){return this._getDDElements(r).forEach($=>$.on(n,f=>{y(f,Of.dragElement?Of.dragElement.el:f.target,Of.dragElement?Of.dragElement.helper:null)})),this}off(r,n){return this._getDDElements(r).forEach(y=>y.off(n)),this}_getDDElements(r,n){const y=r.gridstack||n!=="destroy"&&n!=="disable",$=ru.getElements(r);return $.length?$.map(f=>f.ddElement||(y?iA.init(f):null)).filter(f=>f):[]}}/*!
7986
7986
  * GridStack 12.4.2
7987
7987
  * https://gridstackjs.com/
7988
7988
  *
@@ -7995,16 +7995,16 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
7995
7995
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...n){const y=new this(r);return n.forEach($=>y.set($)),y}static accessor(r){const y=(this[sJ]=this[sJ]={accessors:{}}).accessors,$=this.prototype;function f(u){const i=f9(u);y[i]||(vie($,u),y[i]=!0)}return nu.isArray(r)?r.forEach(f):f(r),this}};Q_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),nu.reduceDescriptors(Q_.prototype,({value:t},r)=>{let n=r[0].toUpperCase()+r.slice(1);return{get:()=>t,set(y){this[n]=y}}}),nu.freezeMethods(Q_);function _A(t,r){const n=this||h9,y=r||n,$=Q_.from(y.headers);let f=y.data;return nu.forEach(t,function(i){f=i.call(n,f,$.normalize(),r?r.status:void 0)}),$.normalize(),f}function lJ(t){return!!(t&&t.__CANCEL__)}let m9=class extends Rf{constructor(r,n,y){super(r??"canceled",Rf.ERR_CANCELED,n,y),this.name="CanceledError",this.__CANCEL__=!0}};function cJ(t,r,n){const y=n.config.validateStatus;!n.status||!y||y(n.status)?t(n):r(new Rf("Request failed with status code "+n.status,[Rf.ERR_BAD_REQUEST,Rf.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function bie(t){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return r&&r[1]||""}function xie(t,r){t=t||10;const n=new Array(t),y=new Array(t);let $=0,f=0,u;return r=r!==void 0?r:1e3,function(d){const l=Date.now(),a=y[f];u||(u=l),n[$]=d,y[$]=l;let S=f,T=0;for(;S!==$;)T+=n[S++],S=S%t;if($=($+1)%t,$===f&&(f=(f+1)%t),l-u<r)return;const b=a&&l-a;return b?Math.round(T*1e3/b):void 0}}function _ie(t,r){let n=0,y=1e3/r,$,f;const u=(l,a=Date.now())=>{n=a,$=null,f&&(clearTimeout(f),f=null),t(...l)};return[(...l)=>{const a=Date.now(),S=a-n;S>=y?u(l,a):($=l,f||(f=setTimeout(()=>{f=null,u($)},y-S)))},()=>$&&u($)]}const MO=(t,r,n=3)=>{let y=0;const $=xie(50,250);return _ie(f=>{const u=f.loaded,i=f.lengthComputable?f.total:void 0,d=u-y,l=$(d),a=u<=i;y=u;const S={loaded:u,total:i,progress:i?u/i:void 0,bytes:d,rate:l||void 0,estimated:l&&i&&a?(i-u)/l:void 0,event:f,lengthComputable:i!=null,[r?"download":"upload"]:!0};t(S)},n)},uJ=(t,r)=>{const n=t!=null;return[y=>r[0]({lengthComputable:n,total:t,loaded:y}),r[1]]},dJ=t=>(...r)=>nu.asap(()=>t(...r)),wie=Wx.hasStandardBrowserEnv?((t,r)=>n=>(n=new URL(n,Wx.origin),t.protocol===n.protocol&&t.host===n.host&&(r||t.port===n.port)))(new URL(Wx.origin),Wx.navigator&&/(msie|trident)/i.test(Wx.navigator.userAgent)):()=>!0,Tie=Wx.hasStandardBrowserEnv?{write(t,r,n,y,$,f,u){if(typeof document>"u")return;const i=[`${t}=${encodeURIComponent(r)}`];nu.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),nu.isString(y)&&i.push(`path=${y}`),nu.isString($)&&i.push(`domain=${$}`),f===!0&&i.push("secure"),nu.isString(u)&&i.push(`SameSite=${u}`),document.cookie=i.join("; ")},read(t){if(typeof document>"u")return null;const r=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return r?decodeURIComponent(r[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Sie(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function kie(t,r){return r?t.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):t}function pJ(t,r,n){let y=!Sie(r);return t&&(y||n==!1)?kie(t,r):r}const hJ=t=>t instanceof Q_?{...t}:t;function OS(t,r){r=r||{};const n={};function y(l,a,S,T){return nu.isPlainObject(l)&&nu.isPlainObject(a)?nu.merge.call({caseless:T},l,a):nu.isPlainObject(a)?nu.merge({},a):nu.isArray(a)?a.slice():a}function $(l,a,S,T){if(nu.isUndefined(a)){if(!nu.isUndefined(l))return y(void 0,l,S,T)}else return y(l,a,S,T)}function f(l,a){if(!nu.isUndefined(a))return y(void 0,a)}function u(l,a){if(nu.isUndefined(a)){if(!nu.isUndefined(l))return y(void 0,l)}else return y(void 0,a)}function i(l,a,S){if(S in r)return y(l,a);if(S in t)return y(void 0,l)}const d={url:f,method:f,data:f,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:i,headers:(l,a,S)=>$(hJ(l),hJ(a),S,!0)};return nu.forEach(Object.keys({...t,...r}),function(a){if(a==="__proto__"||a==="constructor"||a==="prototype")return;const S=nu.hasOwnProp(d,a)?d[a]:$,T=S(t[a],r[a],a);nu.isUndefined(T)&&S!==i||(n[a]=T)}),n}const fJ=t=>{const r=OS({},t);let{data:n,withXSRFToken:y,xsrfHeaderName:$,xsrfCookieName:f,headers:u,auth:i}=r;if(r.headers=u=Q_.from(u),r.url=aJ(pJ(r.baseURL,r.url,r.allowAbsoluteUrls),t.params,t.paramsSerializer),i&&u.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),nu.isFormData(n)){if(Wx.hasStandardBrowserEnv||Wx.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(nu.isFunction(n.getHeaders)){const d=n.getHeaders(),l=["content-type","content-length"];Object.entries(d).forEach(([a,S])=>{l.includes(a.toLowerCase())&&u.set(a,S)})}}if(Wx.hasStandardBrowserEnv&&(y&&nu.isFunction(y)&&(y=y(r)),y||y!==!1&&wie(r.url))){const d=$&&f&&Tie.read(f);d&&u.set($,d)}return r},Lie=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,y){const $=fJ(t);let f=$.data;const u=Q_.from($.headers).normalize();let{responseType:i,onUploadProgress:d,onDownloadProgress:l}=$,a,S,T,b,p;function s(){b&&b(),p&&p(),$.cancelToken&&$.cancelToken.unsubscribe(a),$.signal&&$.signal.removeEventListener("abort",a)}let c=new XMLHttpRequest;c.open($.method.toUpperCase(),$.url,!0),c.timeout=$.timeout;function o(){if(!c)return;const v=Q_.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),L={data:!i||i==="text"||i==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:v,config:t,request:c};cJ(function(P){n(P),s()},function(P){y(P),s()},L),c=null}"onloadend"in c?c.onloadend=o:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(o)},c.onabort=function(){c&&(y(new Rf("Request aborted",Rf.ECONNABORTED,t,c)),c=null)},c.onerror=function(k){const L=k&&k.message?k.message:"Network Error",E=new Rf(L,Rf.ERR_NETWORK,t,c);E.event=k||null,y(E),c=null},c.ontimeout=function(){let k=$.timeout?"timeout of "+$.timeout+"ms exceeded":"timeout exceeded";const L=$.transitional||gA;$.timeoutErrorMessage&&(k=$.timeoutErrorMessage),y(new Rf(k,L.clarifyTimeoutError?Rf.ETIMEDOUT:Rf.ECONNABORTED,t,c)),c=null},f===void 0&&u.setContentType(null),"setRequestHeader"in c&&nu.forEach(u.toJSON(),function(k,L){c.setRequestHeader(L,k)}),nu.isUndefined($.withCredentials)||(c.withCredentials=!!$.withCredentials),i&&i!=="json"&&(c.responseType=$.responseType),l&&([T,p]=MO(l,!0),c.addEventListener("progress",T)),d&&c.upload&&([S,b]=MO(d),c.upload.addEventListener("progress",S),c.upload.addEventListener("loadend",b)),($.cancelToken||$.signal)&&(a=v=>{c&&(y(!v||v.type?new m9(null,t,c):v),c.abort(),c=null)},$.cancelToken&&$.cancelToken.subscribe(a),$.signal&&($.signal.aborted?a():$.signal.addEventListener("abort",a)));const h=bie($.url);if(h&&Wx.protocols.indexOf(h)===-1){y(new Rf("Unsupported protocol "+h+":",Rf.ERR_BAD_REQUEST,t));return}c.send(f||null)})},Cie=(t,r)=>{const{length:n}=t=t?t.filter(Boolean):[];if(r||n){let y=new AbortController,$;const f=function(l){if(!$){$=!0,i();const a=l instanceof Error?l:this.reason;y.abort(a instanceof Rf?a:new m9(a instanceof Error?a.message:a))}};let u=r&&setTimeout(()=>{u=null,f(new Rf(`timeout of ${r}ms exceeded`,Rf.ETIMEDOUT))},r);const i=()=>{t&&(u&&clearTimeout(u),u=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(f):l.removeEventListener("abort",f)}),t=null)};t.forEach(l=>l.addEventListener("abort",f));const{signal:d}=y;return d.unsubscribe=()=>nu.asap(i),d}},Nie=function*(t,r){let n=t.byteLength;if(n<r){yield t;return}let y=0,$;for(;y<n;)$=y+r,yield t.slice(y,$),y=$},Oie=async function*(t,r){for await(const n of Eie(t))yield*Nie(n,r)},Eie=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const r=t.getReader();try{for(;;){const{done:n,value:y}=await r.read();if(n)break;yield y}}finally{await r.cancel()}},mJ=(t,r,n,y)=>{const $=Oie(t,r);let f=0,u,i=d=>{u||(u=!0,y&&y(d))};return new ReadableStream({async pull(d){try{const{done:l,value:a}=await $.next();if(l){i(),d.close();return}let S=a.byteLength;if(n){let T=f+=S;n(T)}d.enqueue(new Uint8Array(a))}catch(l){throw i(l),l}},cancel(d){return i(d),$.return()}},{highWaterMark:2})},yJ=64*1024,{isFunction:VO}=nu,zie=(({Request:t,Response:r})=>({Request:t,Response:r}))(nu.global),{ReadableStream:gJ,TextEncoder:vJ}=nu.global,bJ=(t,...r)=>{try{return!!t(...r)}catch{return!1}},Mie=t=>{t=nu.merge.call({skipUndefined:!0},zie,t);const{fetch:r,Request:n,Response:y}=t,$=r?VO(r):typeof fetch=="function",f=VO(n),u=VO(y);if(!$)return!1;const i=$&&VO(gJ),d=$&&(typeof vJ=="function"?(p=>s=>p.encode(s))(new vJ):async p=>new Uint8Array(await new n(p).arrayBuffer())),l=f&&i&&bJ(()=>{let p=!1;const s=new n(Wx.origin,{body:new gJ,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!s}),a=u&&i&&bJ(()=>nu.isReadableStream(new y("").body)),S={stream:a&&(p=>p.body)};$&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!S[p]&&(S[p]=(s,c)=>{let o=s&&s[p];if(o)return o.call(s);throw new Rf(`Response type '${p}' is not supported`,Rf.ERR_NOT_SUPPORT,c)})});const T=async p=>{if(p==null)return 0;if(nu.isBlob(p))return p.size;if(nu.isSpecCompliantForm(p))return(await new n(Wx.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(nu.isArrayBufferView(p)||nu.isArrayBuffer(p))return p.byteLength;if(nu.isURLSearchParams(p)&&(p=p+""),nu.isString(p))return(await d(p)).byteLength},b=async(p,s)=>{const c=nu.toFiniteNumber(p.getContentLength());return c??T(s)};return async p=>{let{url:s,method:c,data:o,signal:h,cancelToken:v,timeout:k,onDownloadProgress:L,onUploadProgress:E,responseType:P,headers:V,withCredentials:I="same-origin",fetchOptions:j}=fJ(p),F=r||fetch;P=P?(P+"").toLowerCase():"text";let D=Cie([h,v&&v.toAbortSignal()],k),U=null;const M=D&&D.unsubscribe&&(()=>{D.unsubscribe()});let X;try{if(E&&l&&c!=="get"&&c!=="head"&&(X=await b(V,o))!==0){let bt=new n(s,{method:"POST",body:o,duplex:"half"}),xt;if(nu.isFormData(o)&&(xt=bt.headers.get("content-type"))&&V.setContentType(xt),bt.body){const[Pt,qt]=uJ(X,MO(dJ(E)));o=mJ(bt.body,yJ,Pt,qt)}}nu.isString(I)||(I=I?"include":"omit");const O=f&&"credentials"in n.prototype,Y={...j,signal:D,method:c.toUpperCase(),headers:V.normalize().toJSON(),body:o,duplex:"half",credentials:O?I:void 0};U=f&&new n(s,Y);let st=await(f?F(U,j):F(s,Y));const mt=a&&(P==="stream"||P==="response");if(a&&(L||mt&&M)){const bt={};["status","statusText","headers"].forEach(_t=>{bt[_t]=st[_t]});const xt=nu.toFiniteNumber(st.headers.get("content-length")),[Pt,qt]=L&&uJ(xt,MO(dJ(L),!0))||[];st=new y(mJ(st.body,yJ,Pt,()=>{qt&&qt(),M&&M()}),bt)}P=P||"text";let yt=await S[nu.findKey(S,P)||"text"](st,p);return!mt&&M&&M(),await new Promise((bt,xt)=>{cJ(bt,xt,{data:yt,headers:Q_.from(st.headers),status:st.status,statusText:st.statusText,config:p,request:U})})}catch(O){throw M&&M(),O&&O.name==="TypeError"&&/Load failed|fetch/i.test(O.message)?Object.assign(new Rf("Network Error",Rf.ERR_NETWORK,p,U,O&&O.response),{cause:O.cause||O}):Rf.from(O,O&&O.code,p,U,O&&O.response)}}},Vie=new Map,xJ=t=>{let r=t&&t.env||{};const{fetch:n,Request:y,Response:$}=r,f=[y,$,n];let u=f.length,i=u,d,l,a=Vie;for(;i--;)d=f[i],l=a.get(d),l===void 0&&a.set(d,l=i?new Map:Mie(r)),a=l;return l};xJ();const wA={http:eie,xhr:Lie,fetch:{get:xJ}};nu.forEach(wA,(t,r)=>{if(t){try{Object.defineProperty(t,"name",{value:r})}catch{}Object.defineProperty(t,"adapterName",{value:r})}});const _J=t=>`- ${t}`,Pie=t=>nu.isFunction(t)||t===null||t===!1;function Aie(t,r){t=nu.isArray(t)?t:[t];const{length:n}=t;let y,$;const f={};for(let u=0;u<n;u++){y=t[u];let i;if($=y,!Pie(y)&&($=wA[(i=String(y)).toLowerCase()],$===void 0))throw new Rf(`Unknown adapter '${i}'`);if($&&(nu.isFunction($)||($=$.get(r))))break;f[i||"#"+u]=$}if(!$){const u=Object.entries(f).map(([d,l])=>`adapter ${d} `+(l===!1?"is not supported by the environment":"is not available in the build"));let i=n?u.length>1?`since :
7996
7996
  `+u.map(_J).join(`
7997
7997
  `):" "+_J(u[0]):"as no adapter specified";throw new Rf("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return $}const wJ={getAdapter:Aie,adapters:wA};function TA(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new m9(null,t)}function TJ(t){return TA(t),t.headers=Q_.from(t.headers),t.data=_A.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),wJ.getAdapter(t.adapter||h9.adapter,t)(t).then(function(y){return TA(t),y.data=_A.call(t,t.transformResponse,y),y.headers=Q_.from(y.headers),y},function(y){return lJ(y)||(TA(t),y&&y.response&&(y.response.data=_A.call(t,t.transformResponse,y.response),y.response.headers=Q_.from(y.response.headers))),Promise.reject(y)})}const SJ="1.13.6",PO={};["object","boolean","number","function","string","symbol"].forEach((t,r)=>{PO[t]=function(y){return typeof y===t||"a"+(r<1?"n ":" ")+t}});const kJ={};PO.transitional=function(r,n,y){function $(f,u){return"[Axios v"+SJ+"] Transitional option '"+f+"'"+u+(y?". "+y:"")}return(f,u,i)=>{if(r===!1)throw new Rf($(u," has been removed"+(n?" in "+n:"")),Rf.ERR_DEPRECATED);return n&&!kJ[u]&&(kJ[u]=!0,console.warn($(u," has been deprecated since v"+n+" and will be removed in the near future"))),r?r(f,u,i):!0}},PO.spelling=function(r){return(n,y)=>(console.warn(`${y} is likely a misspelling of ${r}`),!0)};function Rie(t,r,n){if(typeof t!="object")throw new Rf("options must be an object",Rf.ERR_BAD_OPTION_VALUE);const y=Object.keys(t);let $=y.length;for(;$-- >0;){const f=y[$],u=r[f];if(u){const i=t[f],d=i===void 0||u(i,f,t);if(d!==!0)throw new Rf("option "+f+" must be "+d,Rf.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Rf("Unknown option "+f,Rf.ERR_BAD_OPTION)}}const AO={assertOptions:Rie,validators:PO},tw=AO.validators;let ES=class{constructor(r){this.defaults=r||{},this.interceptors={request:new iJ,response:new iJ}}async request(r,n){try{return await this._request(r,n)}catch(y){if(y instanceof Error){let $={};Error.captureStackTrace?Error.captureStackTrace($):$=new Error;const f=$.stack?$.stack.replace(/^.+\n/,""):"";try{y.stack?f&&!String(y.stack).endsWith(f.replace(/^.+\n.+\n/,""))&&(y.stack+=`
7998
- `+f):y.stack=f}catch{}}throw y}}_request(r,n){typeof r=="string"?(n=n||{},n.url=r):n=r||{},n=OS(this.defaults,n);const{transitional:y,paramsSerializer:$,headers:f}=n;y!==void 0&&AO.assertOptions(y,{silentJSONParsing:tw.transitional(tw.boolean),forcedJSONParsing:tw.transitional(tw.boolean),clarifyTimeoutError:tw.transitional(tw.boolean),legacyInterceptorReqResOrdering:tw.transitional(tw.boolean)},!1),$!=null&&(nu.isFunction($)?n.paramsSerializer={serialize:$}:AO.assertOptions($,{encode:tw.function,serialize:tw.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),AO.assertOptions(n,{baseUrl:tw.spelling("baseURL"),withXsrfToken:tw.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=f&&nu.merge(f.common,f[n.method]);f&&nu.forEach(["delete","get","head","post","put","patch","common"],p=>{delete f[p]}),n.headers=Q_.concat(u,f);const i=[];let d=!0;this.interceptors.request.forEach(function(s){if(typeof s.runWhen=="function"&&s.runWhen(n)===!1)return;d=d&&s.synchronous;const c=n.transitional||gA;c&&c.legacyInterceptorReqResOrdering?i.unshift(s.fulfilled,s.rejected):i.push(s.fulfilled,s.rejected)});const l=[];this.interceptors.response.forEach(function(s){l.push(s.fulfilled,s.rejected)});let a,S=0,T;if(!d){const p=[TJ.bind(this),void 0];for(p.unshift(...i),p.push(...l),T=p.length,a=Promise.resolve(n);S<T;)a=a.then(p[S++],p[S++]);return a}T=i.length;let b=n;for(;S<T;){const p=i[S++],s=i[S++];try{b=p(b)}catch(c){s.call(this,c);break}}try{a=TJ.call(this,b)}catch(p){return Promise.reject(p)}for(S=0,T=l.length;S<T;)a=a.then(l[S++],l[S++]);return a}getUri(r){r=OS(this.defaults,r);const n=pJ(r.baseURL,r.url,r.allowAbsoluteUrls);return aJ(n,r.params,r.paramsSerializer)}};nu.forEach(["delete","get","head","options"],function(r){ES.prototype[r]=function(n,y){return this.request(OS(y||{},{method:r,url:n,data:(y||{}).data}))}}),nu.forEach(["post","put","patch"],function(r){function n(y){return function(f,u,i){return this.request(OS(i||{},{method:r,headers:y?{"Content-Type":"multipart/form-data"}:{},url:f,data:u}))}}ES.prototype[r]=n(),ES.prototype[r+"Form"]=n(!0)});let Fie=class pQ{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(f){n=f});const y=this;this.promise.then($=>{if(!y._listeners)return;let f=y._listeners.length;for(;f-- >0;)y._listeners[f]($);y._listeners=null}),this.promise.then=$=>{let f;const u=new Promise(i=>{y.subscribe(i),f=i}).then($);return u.cancel=function(){y.unsubscribe(f)},u},r(function(f,u,i){y.reason||(y.reason=new m9(f,u,i),n(y.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const n=this._listeners.indexOf(r);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const r=new AbortController,n=y=>{r.abort(y)};return this.subscribe(n),r.signal.unsubscribe=()=>this.unsubscribe(n),r.signal}static source(){let r;return{token:new pQ(function($){r=$}),cancel:r}}};function Uie(t){return function(n){return t.apply(null,n)}}function Iie(t){return nu.isObject(t)&&t.isAxiosError===!0}const SA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(SA).forEach(([t,r])=>{SA[r]=t});function LJ(t){const r=new ES(t),n=BZ(ES.prototype.request,r);return nu.extend(n,ES.prototype,r,{allOwnKeys:!0}),nu.extend(n,r,null,{allOwnKeys:!0}),n.create=function($){return LJ(OS(t,$))},n}const M0=LJ(h9);M0.Axios=ES,M0.CanceledError=m9,M0.CancelToken=Fie,M0.isCancel=lJ,M0.VERSION=SJ,M0.toFormData=EO,M0.AxiosError=Rf,M0.Cancel=M0.CanceledError,M0.all=function(r){return Promise.all(r)},M0.spread=Uie,M0.isAxiosError=Iie,M0.mergeConfig=OS,M0.AxiosHeaders=Q_,M0.formToJSON=t=>oJ(nu.isHTMLForm(t)?new FormData(t):t),M0.getAdapter=wJ.getAdapter,M0.HttpStatusCode=SA,M0.default=M0;const{Axios:_5e,AxiosError:w5e,CanceledError:T5e,isCancel:S5e,CancelToken:k5e,VERSION:L5e,all:C5e,Cancel:N5e,isAxiosError:O5e,spread:E5e,toFormData:z5e,AxiosHeaders:M5e,HttpStatusCode:V5e,formToJSON:P5e,getAdapter:A5e,mergeConfig:R5e}=M0,ov=(t,r)=>{const n=t.__vccOpts||t;for(const[y,$]of r)n[y]=$;return n},y9=t=>(e.pushScopeId("data-v-137412ab"),t=t(),e.popScopeId(),t),qie={class:"tooltip-template-options"},jie=y9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report.svg",alt:"Generar reporte",class:"icon"},null,-1)),Die=y9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1)),Wie=y9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-edit.svg",alt:"Editar template",class:"icon"},null,-1)),Bie=y9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-duplicate.svg",alt:"Duplicar template",class:"icon"},null,-1)),Kie=y9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1)),Xie=ov({__name:"TooltipTemplateOptions",props:{canEdit:{type:Boolean,default:!0}},emits:["generar-reporte","renombrar","editar","duplicar","eliminar"],setup(t,{emit:r}){return(n,y)=>(e.openBlock(),e.createElementBlock("div",qie,[e.createElementVNode("ul",null,[e.createElementVNode("li",{class:"option",onClick:y[0]||(y[0]=$=>n.$emit("generar-reporte"))},[jie,e.createTextVNode(" Generar reporte ")]),t.canEdit?(e.openBlock(),e.createElementBlock("li",{key:0,class:"option",onClick:y[1]||(y[1]=$=>n.$emit("renombrar"))},[Die,e.createTextVNode(" Renombrar template ")])):e.createCommentVNode("",!0),t.canEdit?(e.openBlock(),e.createElementBlock("li",{key:1,class:"option",onClick:y[2]||(y[2]=$=>n.$emit("editar"))},[Wie,e.createTextVNode(" Editar template ")])):e.createCommentVNode("",!0),e.createElementVNode("li",{class:"option",onClick:y[3]||(y[3]=$=>n.$emit("duplicar"))},[Bie,e.createTextVNode(" Duplicar template ")]),t.canEdit?(e.openBlock(),e.createElementBlock("li",{key:2,class:"option",onClick:y[4]||(y[4]=$=>n.$emit("eliminar"))},[Kie,e.createTextVNode(" Eliminar template ")])):e.createCommentVNode("",!0)])]))}},[["__scopeId","data-v-137412ab"]]),RO=t=>(e.pushScopeId("data-v-8520e810"),t=t(),e.popScopeId(),t),Gie={class:"template-card postpartido",style:{position:"relative"}},Zie=[RO(()=>e.createElementVNode("span",null,null,-1)),RO(()=>e.createElementVNode("span",null,null,-1)),RO(()=>e.createElementVNode("span",null,null,-1))],Jie={key:0,class:"template-img-placeholder",style:{position:"relative"}},Hie={key:0,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-01.jpg",alt:"Template Prematch Type 1",class:"template-img"},Yie={key:1,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-01.jpg",alt:"Template Postmatch Type 1",class:"template-img"},Qie={key:2,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-02.jpg",alt:"Template Prematch Type 2",class:"template-img"},$ie={key:3,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-02.jpg",alt:"Template Postmatch Type 2",class:"template-img"},toe={key:4,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-03.jpg",alt:"Template Prematch Type 3",class:"template-img"},eoe={key:5,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-03.jpg",alt:"Template Postmatch Type 3",class:"template-img"},roe={key:6,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-04.jpg",alt:"Template Prematch Type 4",class:"template-img"},noe={key:7,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-04.jpg",alt:"Template Postmatch Type 4",class:"template-img"},aoe={key:8,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumb1.png",alt:"Template Default",class:"template-img"},ioe={class:"inner-card-postpartido"},ooe={class:"postpartido-footer"},soe={class:"postpartido-version"},loe={class:"postpartido-status"},coe=RO(()=>e.createElementVNode("span",{class:"tipo-label"},"Tipo:",-1)),uoe={class:"tipo-value"},doe=ov({__name:"TemplateItem",props:{template:{type:Object,required:!0},userId:{type:Number,required:!0}},emits:["generar-reporte","renombrar","duplicar","eliminar","edit-template"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(!1),f=e.computed(()=>n.userId===n.template.user_id);function u(){$.value=!1,y("generar-reporte")}function i(){$.value=!1;const T=n.template.name||"";y("renombrar",T)}function d(){$.value=!1,y("edit-template",n.template)}function l(){$.value=!1;const T=n.template.name||"";y("duplicar",T)}function a(){$.value=!1,y("eliminar",n.template)}function S(T){}return(T,b)=>(e.openBlock(),e.createElementBlock("div",Gie,[e.createElementVNode("div",{class:"three-dots",onClick:b[0]||(b[0]=e.withModifiers(p=>$.value=!$.value,["stop"]))},Zie),t.template.pages&&t.template.pages[0]?(e.openBlock(),e.createElementBlock("div",Jie,[t.template.template_type===1&&t.template.pages[0].type==1?(e.openBlock(),e.createElementBlock("img",Hie)):t.template.template_type===2&&t.template.pages[0].type==1?(e.openBlock(),e.createElementBlock("img",Yie)):t.template.template_type===1&&t.template.pages[0].type==2?(e.openBlock(),e.createElementBlock("img",Qie)):t.template.template_type===2&&t.template.pages[0].type==2?(e.openBlock(),e.createElementBlock("img",$ie)):t.template.template_type===1&&t.template.pages[0].type==3?(e.openBlock(),e.createElementBlock("img",toe)):t.template.template_type===2&&t.template.pages[0].type==3?(e.openBlock(),e.createElementBlock("img",eoe)):t.template.template_type===1&&t.template.pages[0].type==4?(e.openBlock(),e.createElementBlock("img",roe)):t.template.template_type===2&&t.template.pages[0].type==4?(e.openBlock(),e.createElementBlock("img",noe)):(e.openBlock(),e.createElementBlock("img",aoe))])):e.createCommentVNode("",!0),e.createElementVNode("div",ioe,[e.createElementVNode("div",ooe,[e.createElementVNode("div",soe,e.toDisplayString(t.template.name),1),e.createElementVNode("div",loe,[coe,e.createElementVNode("span",uoe," "+e.toDisplayString(t.template.template_type==1?"Prepartido":"Postpartido"),1)]),e.createElementVNode("button",{class:"postpartido-btn",onClick:b[1]||(b[1]=p=>y("generar-reporte"))},"Generar reporte")])]),$.value?(e.openBlock(),e.createBlock(Xie,{key:1,"can-edit":f.value,onClick:b[2]||(b[2]=e.withModifiers(p=>$.value=!1,["self"])),onMouseleave:b[3]||(b[3]=p=>$.value=!1),onGenerarReporte:u,onRenombrar:i,onEditar:d,onDuplicar:l,onEliminar:a,onToggleAutogen:S},null,8,["can-edit"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"tooltip-overlay",onClick:b[4]||(b[4]=p=>$.value=!1)})):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-8520e810"]]),e7=t=>(e.pushScopeId("data-v-a34cf1b5"),t=t(),e.popScopeId(),t),poe={class:"modal-overlay"},hoe={class:"modal-content"},foe=[e7(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],moe=e7(()=>e.createElementVNode("div",{class:"modal-header"},[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-editar-withe.svg",class:"icon-title",alt:"icon"}),e.createElementVNode("span",{class:"modal-title"},"Crear Template")],-1)),yoe=e7(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),goe={class:"modal-body"},voe=e7(()=>e.createElementVNode("div",{class:"modal-label"},"Define el tipo de análisis para tu template:",-1)),boe={class:"radio-group"},xoe=e7(()=>e.createElementVNode("div",{class:"modal-label"},"Agrega un nombre a tu template:",-1)),_oe=["disabled"],woe={key:0,class:"error-message"},Toe=e7(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),Soe={class:"modal-footer"},koe=["disabled"],Loe=["disabled"],Coe=["disabled"],Noe={key:0,class:"loading-spinner"},Ooe={key:1},CJ=ov({__name:"ModalCreateTemplate",props:{token:{type:String,required:!0},team:{type:Number,required:!0}},emits:["close","template-created","open-modal-new-template"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(1),f=e.ref("pre"),u=e.ref(""),i=e.ref(!1),d=e.ref(""),l=async()=>{var a;if(!(u.value.trim().length<3)){i.value=!0,d.value="";try{const S={name:u.value.trim(),team_id:n.team,template_type:f.value==="pre"?1:2},b=await M0.create({headers:{Authorization:`${n.token}`}}).post("https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates",S);y("template-created",b.data),y("open-modal-new-template",(a=b.data)==null?void 0:a.data),y("close")}catch(S){console.error("Error al guardar template:",S),S.response&&S.response.status===409&&(d.value="Ya existe un template con el mismo nombre")}finally{i.value=!1}}};return e.onMounted(()=>{document.body.style.overflow="hidden"}),e.onUnmounted(()=>{document.body.style.overflow=""}),(a,S)=>(e.openBlock(),e.createElementBlock("div",poe,[e.createElementVNode("div",hoe,[e.createElementVNode("button",{class:"close-btn",onClick:S[0]||(S[0]=T=>a.$emit("close"))},foe),moe,yoe,e.createElementVNode("div",goe,[$.value===1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[voe,e.createElementVNode("div",boe,[e.createElementVNode("label",{class:e.normalizeClass(["radio-label",{selected:f.value==="pre"}])},[e.withDirectives(e.createElementVNode("input",{type:"radio",value:"pre","onUpdate:modelValue":S[1]||(S[1]=T=>f.value=T)},null,512),[[e.vModelRadio,f.value]]),e.createTextVNode(" Prepartido ")],2),e.createElementVNode("label",{class:e.normalizeClass(["radio-label",{selected:f.value==="post"}])},[e.withDirectives(e.createElementVNode("input",{type:"radio",value:"post","onUpdate:modelValue":S[2]||(S[2]=T=>f.value=T)},null,512),[[e.vModelRadio,f.value]]),e.createTextVNode(" Postpartido ")],2)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[xoe,e.withDirectives(e.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":S[3]||(S[3]=T=>u.value=T),placeholder:"Untitled",maxlength:"40",autocomplete:"off",disabled:i.value},null,8,_oe),[[e.vModelText,u.value]]),d.value?(e.openBlock(),e.createElementBlock("div",woe,e.toDisplayString(d.value),1)):e.createCommentVNode("",!0)],64))]),Toe,e.createElementVNode("div",Soe,[e.createElementVNode("button",{class:"cancel-btn",onClick:S[4]||(S[4]=T=>a.$emit("close")),disabled:i.value},"Cancelar",8,koe),$.value===1?(e.openBlock(),e.createElementBlock("button",{key:0,class:"next-btn",disabled:!f.value,onClick:S[5]||(S[5]=T=>$.value=2)}," Siguiente ",8,Loe)):(e.openBlock(),e.createElementBlock("button",{key:1,class:"next-btn",disabled:u.value.trim().length<3||i.value,onClick:l},[i.value?(e.openBlock(),e.createElementBlock("div",Noe)):(e.openBlock(),e.createElementBlock("span",Ooe,"Guardar"))],8,Coe))])])]))}},[["__scopeId","data-v-a34cf1b5"]]),ux=t=>(e.pushScopeId("data-v-6ba594dc"),t=t(),e.popScopeId(),t),Eoe={class:"modal-overlay"},zoe={class:"modal-content"},Moe=[ux(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],Voe=ux(()=>e.createElementVNode("div",{class:"modal-header"},[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report-white.svg",class:"icon-title",alt:"icono reporte blanco"}),e.createElementVNode("span",{class:"modal-title"},"Generar reporte")],-1)),Poe=ux(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),Aoe={class:"modal-body"},Roe={key:0,class:"error-message-container"},Foe=ux(()=>e.createElementVNode("p",{class:"error-text"},[e.createTextVNode(" Este reporte ya fue generado previamente"),e.createElementVNode("br"),e.createTextVNode(" con este template para el partido seleccionado. ")],-1)),Uoe={key:1,style:{position:"relative"}},Ioe={key:0,class:"loading-autoseteo-overlay"},qoe=[ux(()=>e.createElementVNode("div",{class:"loading-autoseteo-content"},[e.createElementVNode("div",{class:"loading-spinner"})],-1))],joe={class:"modal-group"},Doe=ux(()=>e.createElementVNode("label",null,"1. Elige el torneo",-1)),Woe={key:0,class:"placeholder"},Boe=ux(()=>e.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),Koe={key:0,class:"placeholder"},Xoe={key:1},Goe=[ux(()=>e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],Zoe={key:0,class:"custom-select-dropdown"},Joe=["onMousedown"],Hoe={class:"modal-row"},Yoe={class:"modal-group"},Qoe=ux(()=>e.createElementVNode("label",null,"2. Elige la temporada",-1)),$oe={key:0,class:"placeholder"},tse=ux(()=>e.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),ese={key:0,class:"placeholder"},rse={key:1},nse=[ux(()=>e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],ase={key:0,class:"custom-select-dropdown"},ise=["onMousedown"],ose={class:"modal-group"},sse=ux(()=>e.createElementVNode("label",null,"3. Elige la jornada",-1)),lse={key:0,class:"placeholder"},cse=ux(()=>e.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),use={key:0,class:"placeholder"},dse={key:1},pse=[ux(()=>e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],hse={key:0,class:"custom-select-dropdown"},fse=["onMousedown"],mse={class:"modal-group"},yse=ux(()=>e.createElementVNode("label",null,"4. Elige el partido",-1)),gse={key:0,class:"placeholder"},vse=ux(()=>e.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),bse={key:0,class:"placeholder"},xse=["src"],_se=["src"],wse=[ux(()=>e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],Tse={key:0,class:"custom-select-dropdown"},Sse=["onMousedown"],kse=["src"],Lse=["src"],Cse={key:0,class:"header-separator"},Nse={key:1,class:"modal-footer"},Ose=["disabled"],Ese={key:0,class:"loading-spinner select-spinner"},zse=ov({__name:"ModalGenerarReporte",props:{userId:{type:String,required:!0},token:{type:String,required:!0},team:{type:Number,required:!0},templateId:{type:String,required:!0},templateType:{type:String,required:!1},template:{type:Object,required:!1},showError409OnMount:{type:Boolean,default:!1}},emits:["close","generar","switch-to-reports","open-configurar-contenido"],setup(t,{emit:r}){const n=t,y=r,$=e.ref([]),f=e.ref([]),u=e.ref([]),i=e.ref([]),d=e.ref(""),l=e.ref(""),a=e.ref(""),S=e.ref(null),T=M0.create({headers:{Authorization:n.token}}),b=e.ref(!1),p=e.ref(!1),s=e.ref(!1),c=e.ref(!1),o=e.ref(!1),h=e.ref(!1),v=e.ref(!1),k=e.ref(!1),L=e.ref([]),E=e.ref([]),P=e.ref(!1),V=e.ref(!1),I=e.ref(!1);function j(de){h.value&&(h.value=!1,o.value=!1),v.value=!1,d.value=de,P.value=!1,O()}function F(de){h.value&&(h.value=!1,o.value=!1),v.value=!1,l.value=de,V.value=!1,Y()}function D(de){h.value&&(h.value=!1,o.value=!1),v.value=!1,a.value=de,I.value=!1,mt()}const U=e.ref(null);async function M(){try{p.value=!0;const de=await M0.get("https://kefloixzy1.execute-api.us-west-2.amazonaws.com/prod/gs3/tournaments");if(de.data&&Array.isArray(de.data)){if(L.value=de.data,$.value=de.data.map(Jt=>Jt.tournament).sort((Jt,te)=>Jt.order&&te.order?Jt.order-te.order:Jt.order&&!te.order?-1:!Jt.order&&te.order?1:0),d.value="",f.value=[],l.value="",u.value=[],a.value="",i.value=[],S.value=null,U.value)setTimeout(()=>{re(U.value)},100);else if($.value.length>0){const Jt=$.value[0];d.value=Jt,X(Jt)}}}catch(de){console.error("Error al cargar torneos:",de),$.value=[{name:"Concacaf Copa Oro"},{name:"Liga MX"},{name:"MLS"}],f.value=[],u.value=[],d.value="",l.value="",a.value="",S.value=null}finally{p.value=!1}}function X(de){const Jt=L.value.find(te=>te.tournament&&te.tournament.name===de.name);Jt&&Array.isArray(Jt.seasons)?(f.value=Jt.seasons,l.value="",u.value=[],a.value="",i.value=[],S.value=null):(f.value=[],l.value="",u.value=[],a.value="",i.value=[],S.value=null)}function O(){l.value="",a.value="",S.value=null,d.value?X(d.value):(f.value=[],u.value=[],i.value=[])}function Y(){if(c.value=!0,a.value="",S.value=null,u.value=[],i.value=[],l.value&&l.value.id){const de=[l.value.id];if(l.value.related_seasons&&Array.isArray(l.value.related_seasons)){const Jt=l.value.related_seasons.map(te=>te.id).filter(Boolean);de.push(...Jt)}st(de)}else c.value=!1}async function st(de){s.value=!0;try{const Jt=Array.isArray(de)?de.join("&seasons="):de,te=await T.get(`https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?seasons=${Jt}`);if(te.data.data&&Array.isArray(te.data.data)){const ne=te.data.data.reduce((Pe,Xe)=>Xe.games&&Array.isArray(Xe.games)?Pe.concat(Xe.games):Pe,[]);E.value=ne.map(Pe=>({label:Pe.label||`${Pe.home_team_acronym||"Local"} vs ${Pe.visiting_team_acronym||"Visitante"}`,localLogo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Pe.home_team+".png"||"",visitanteLogo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Pe.visiting_team+".png"||"",...Pe}));let Le=E.value;n.templateType==="2"||n.templateType===2?Le=Le.filter(Pe=>Pe.game_status===1):(n.templateType==="1"||n.templateType===1)&&(Le=Le.filter(Pe=>Pe.game_status===4));const Oe=Le.map(Pe=>Pe.matchday_id).filter(Boolean),Ne=[...new Set(Oe)];u.value=Ne.map(Pe=>{const Xe=E.value.find(He=>He.matchday_id&&He.matchday_id===Pe);return Xe?{id:Pe,name:Xe.matchday_name.replace("Matchday","Jornada").replace("de Final","").replace("Playoffs 1","Cuartos de Final Ida").replace("Playoffs 2","Cuartos de Final Vuelta").replace("Playoffs 3","Semifinal Ida").replace("Playoffs 4","Semifinal Vuelta").replace("Playoffs 5","Final Ida").replace("Playoffs 6","Final Vuelta")}:null}).filter(Boolean).sort((Pe,Xe)=>{const He=Pe.name.startsWith("Jornada"),$e=Xe.name.startsWith("Jornada");return He&&$e?Pe.id-Xe.id:He&&!$e?-1:!He&&$e?1:0}),a.value="",i.value=[],S.value=null,c.value=!1,U.value&&h.value&&setTimeout(()=>{le(U.value)},200)}else E.value=[],u.value=[],a.value="",i.value=[],S.value=null}catch(Jt){console.error("Error al cargar partidos:",Jt),E.value=[],u.value=[],a.value="",i.value=[],S.value=null,c.value=!1}finally{s.value=!1}}function mt(){S.value=null,i.value=[],a.value&&a.value.id&&yt(a.value)}function yt(de){if(!de||!de.id){i.value=[];return}let Jt=E.value.filter(te=>te.matchday_id===de.id);n.templateType==="2"||n.templateType===2?Jt=Jt.filter(te=>te.game_status===1):(n.templateType==="1"||n.templateType===1)&&(Jt=Jt.filter(te=>te.game_status===4)),i.value=Jt}function bt(){let de=!1;if(n.template&&n.template.pages)for(const Jt of n.template.pages){if(Jt.components&&Array.isArray(Jt.components)){for(const te of Jt.components)if(te.coreView&&te.coreView.id===18){de=!0;break}}if(de)break}return de}function xt(){if(!n.template||!n.template.pages)return!1;for(const de of n.template.pages)if(de.components&&Array.isArray(de.components)&&de.components.some(te=>te.name==="Fortalezas"||te.componentName==="GSCStrengths"))return!0;return!1}async function Pt(){try{if(xt()||bt()){y("open-configurar-contenido",{liga:d.value,torneo:l.value,jornada:a.value,partido:S.value,template:n.template}),y("close");return}p.value=!0;let de="";l.value&&l.value.name&&(de=l.value.name);const Jt={template_id:n.templateId,user_id:n.template&&n.template.user_id?parseInt(n.template.user_id):parseInt(n.userId),tournament_id:d.value.id||1,tournament_name:d.value.name,season_id:S.value.season_id,season_name:de,game_id:S.value.id||S.value.game_id},te=await M0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${n.userId}/reports`,Jt,{headers:{Authorization:n.token,"Content-Type":"application/json"}});y("generar",{liga:d.value,torneo:l.value,jornada:a.value,partido:S.value,reportData:te.data}),y("switch-to-reports"),y("close")}catch(de){console.error("Error al generar el reporte:",de),de.response&&de.response.status===409?k.value=!0:alert("Error al generar el reporte. Por favor, intenta de nuevo.")}finally{p.value=!1}}function qt(){I.value=!I.value}function _t(de){h.value&&(h.value=!1,o.value=!1),v.value=!1,S.value=de,b.value=!1}function It(){document.body.style.overflow="hidden"}function jt(){document.body.style.overflow=""}e.watch(()=>n.showError409OnMount,de=>{k.value=de},{immediate:!0}),e.onMounted(()=>{n.showError409OnMount&&(k.value=!0),M(),It(),Rt(),U.value&&(o.value=!0,h.value=!0)}),e.watch(d,(de,Jt)=>{de&&U.value&&h.value&&!Jt&&!v.value&&(X(de),setTimeout(()=>{const te=Wt(U.value.season_id);te&&(v.value=!0,l.value=te,v.value=!1)},50))}),e.watch(l,(de,Jt)=>{de&&U.value&&h.value&&!Jt&&!v.value?setTimeout(()=>{const te=u.value.find(ne=>ne.id===U.value.matchday_id);te&&(v.value=!0,a.value=te,yt(te),v.value=!1)},500):de&&Jt&&h.value&&(h.value=!1,o.value=!1)}),e.watch(a,(de,Jt)=>{de&&U.value&&h.value&&!Jt&&!v.value?setTimeout(()=>{const te=i.value.find(Le=>Le.game_id===U.value.game_id||Le.id===U.value.game_id);if(yt(de),te){S.value=te,o.value=!1,h.value=!1;return}const ne=i.value.find(Le=>Le.home_team===U.value.home_team&&Le.visiting_team===U.value.visiting_team);if(ne){S.value=ne,o.value=!1,h.value=!1;return}if(E.value.length>0){const Le=E.value.find(Oe=>Oe.game_id===U.value.game_id||Oe.id===U.value.game_id);if(Le){S.value=Le,o.value=!1,h.value=!1;return}}o.value=!1,h.value=!1},1e3):de&&Jt&&h.value&&(h.value=!1,o.value=!1)}),e.onUnmounted(()=>{jt()});async function Rt(){try{const de=await T.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/teams/${n.team}/last-games`);n.templateType==="1"||n.templateType===1?(U.value=de.data.data.prematch,de.data.data.prematch&&(o.value=!0,h.value=!0,de.data.data.prematch.season_id&&await st([de.data.data.prematch.season_id]))):(n.templateType==="2"||n.templateType===2)&&(U.value=de.data.data.postmatch,de.data.data.postmatch&&(o.value=!0,h.value=!0,de.data.data.postmatch.season_id&&await st([de.data.data.postmatch.season_id])))}catch(de){console.error("Error al cargar últimos juegos:",de)}}function Wt(de){if(!de||!f.value.length)return null;const Jt=f.value.find(ne=>ne.id===de);return Jt||f.value.find(ne=>ne.related_seasons&&Array.isArray(ne.related_seasons)?ne.related_seasons.some(Le=>Le.id===de):!1)||null}function re(de){if(!(!de||!de.game_id)&&de.tournament_id&&$.value.length>0){const Jt=$.value.find(te=>te.id===de.tournament_id);Jt&&(d.value=Jt,X(Jt))}}function le(de){if(!(!de||!de.game_id)&&de.tournament_id&&$.value.length>0){const Jt=$.value.find(te=>te.id===de.tournament_id);if(Jt){d.value=Jt;const te=L.value.find(ne=>ne.tournament&&(ne.tournament.id===Jt.id||ne.tournament.name===Jt.name));if(te&&Array.isArray(te.seasons)&&(f.value=te.seasons),de.season_id&&f.value.length>0){const ne=Wt(de.season_id);if(ne&&(l.value=ne,de.matchday_id&&u.value.length>0)){const Le=u.value.find(Oe=>Oe.id===de.matchday_id);if(Le&&(a.value=Le,de.game_id&&i.value.length>0)){const Oe=i.value.find(Ne=>Ne.game_id===de.game_id||Ne.id===de.game_id);if(Oe)S.value=Oe;else{const Ne=i.value.find(Pe=>Pe.home_team===de.home_team&&Pe.visiting_team===de.visiting_team);Ne&&(S.value=Ne)}}}}}}}function he(){k.value=!1,d.value="",l.value="",a.value="",S.value=null,f.value=[],u.value=[],i.value=[],P.value=!1,V.value=!1,I.value=!1,b.value=!1,jt(),y("close")}return(de,Jt)=>(e.openBlock(),e.createElementBlock("div",Eoe,[e.createElementVNode("div",zoe,[e.createElementVNode("button",{class:"close-btn",onClick:he},Moe),Voe,Poe,e.createElementVNode("div",Aoe,[k.value?(e.openBlock(),e.createElementBlock("div",Roe,[Foe,e.createElementVNode("button",{class:"accept-btn",onClick:he},"Aceptar")])):(e.openBlock(),e.createElementBlock("div",Uoe,[o.value?(e.openBlock(),e.createElementBlock("div",Ioe,qoe)):e.createCommentVNode("",!0),e.createElementVNode("div",joe,[Doe,e.createElementVNode("div",{class:"select-wrapper custom-dropdown liga-select",tabindex:"0",onClick:Jt[0]||(Jt[0]=te=>P.value=!P.value),onBlur:Jt[1]||(Jt[1]=te=>P.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["custom-select-display",{disabled:p.value||$.value.length===0}])},[p.value?(e.openBlock(),e.createElementBlock("span",Woe,[Boe,e.createTextVNode("Cargando torneos...")])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[d.value?(e.openBlock(),e.createElementBlock("span",Xoe,e.toDisplayString(d.value.name),1)):(e.openBlock(),e.createElementBlock("span",Koe,"Selecciona el torneo"))],64)),e.createElementVNode("span",{class:e.normalizeClass(["select-chevron",{open:P.value}])},Goe,2)],2),P.value&&$.value.length>0?(e.openBlock(),e.createElementBlock("div",Zoe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,te=>(e.openBlock(),e.createElementBlock("div",{key:te.name,class:"custom-select-option",onMousedown:e.withModifiers(ne=>j(te),["prevent"])},e.toDisplayString(te.name),41,Joe))),128))])):e.createCommentVNode("",!0)],32)]),e.createElementVNode("div",Hoe,[e.createElementVNode("div",Yoe,[Qoe,e.createElementVNode("div",{class:"select-wrapper custom-dropdown torneo-select",tabindex:"0",onClick:Jt[2]||(Jt[2]=te=>V.value=!V.value),onBlur:Jt[3]||(Jt[3]=te=>V.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["custom-select-display",{disabled:!d.value||f.value.length===0||p.value}])},[p.value?(e.openBlock(),e.createElementBlock("span",$oe,[tse,e.createTextVNode("Cargando temporada...")])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.value?(e.openBlock(),e.createElementBlock("span",rse,e.toDisplayString(l.value.name),1)):(e.openBlock(),e.createElementBlock("span",ese,"Elige la temporada"))],64)),e.createElementVNode("span",{class:e.normalizeClass(["select-chevron",{open:V.value}])},nse,2)],2),V.value&&f.value.length>0&&d.value?(e.openBlock(),e.createElementBlock("div",ase,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,te=>(e.openBlock(),e.createElementBlock("div",{key:te.id,class:"custom-select-option",onMousedown:e.withModifiers(ne=>F(te),["prevent"])},e.toDisplayString(te.name),41,ise))),128))])):e.createCommentVNode("",!0)],32)]),e.createElementVNode("div",ose,[sse,e.createElementVNode("div",{class:"select-wrapper custom-dropdown jornada-select",tabindex:"0",onClick:qt,onBlur:Jt[4]||(Jt[4]=te=>I.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["custom-select-display",{disabled:!l.value||u.value.length===0||c.value}])},[c.value?(e.openBlock(),e.createElementBlock("span",lse,[cse,e.createTextVNode("Cargando jornadas...")])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.value?(e.openBlock(),e.createElementBlock("span",dse,e.toDisplayString(a.value.name),1)):(e.openBlock(),e.createElementBlock("span",use,"Elige la jornada"))],64)),e.createElementVNode("span",{class:e.normalizeClass(["select-chevron",{open:I.value}])},pse,2)],2),I.value&&u.value.length>0?(e.openBlock(),e.createElementBlock("div",hse,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,te=>(e.openBlock(),e.createElementBlock("div",{key:te.id,class:"custom-select-option",onMousedown:e.withModifiers(ne=>D(te),["prevent"])},e.toDisplayString(te.name),41,fse))),128))])):e.createCommentVNode("",!0)],32)])]),e.createElementVNode("div",mse,[yse,e.createElementVNode("div",{class:"select-wrapper partido-select",tabindex:"0",onClick:Jt[5]||(Jt[5]=te=>b.value=!b.value),onBlur:Jt[6]||(Jt[6]=te=>b.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["custom-select-display",{disabled:!a.value||s.value}])},[s.value?(e.openBlock(),e.createElementBlock("span",gse,[vse,e.createTextVNode("Cargando partidos...")])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[S.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[S.value.localLogo?(e.openBlock(),e.createElementBlock("img",{key:0,src:S.value.localLogo,class:"logo-equipo",alt:"local"},null,8,xse)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(S.value.label),1),S.value.visitanteLogo?(e.openBlock(),e.createElementBlock("img",{key:1,src:S.value.visitanteLogo,class:"logo-equipo",alt:"visitante"},null,8,_se)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("span",bse,"Selecciona el partido"))],64)),e.createElementVNode("span",{class:e.normalizeClass(["select-chevron",{open:b.value}])},wse,2)],2),b.value&&!s.value&&a.value?(e.openBlock(),e.createElementBlock("div",Tse,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,te=>(e.openBlock(),e.createElementBlock("div",{key:te.label,class:"custom-select-option",onMousedown:e.withModifiers(ne=>_t(te),["prevent"])},[e.createElementVNode("img",{src:te.localLogo,class:"logo-equipo",alt:"local"},null,8,kse),e.createElementVNode("span",null,e.toDisplayString(te.label),1),e.createElementVNode("img",{src:te.visitanteLogo,class:"logo-equipo",alt:"visitante"},null,8,Lse)],40,Sse))),128))])):e.createCommentVNode("",!0)],32)])]))]),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Cse)),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Nse,[e.createElementVNode("button",{class:"cancel-btn",onClick:he},"Cancelar"),e.createElementVNode("button",{class:"next-btn",disabled:!d.value||!l.value||!a.value||!S.value||p.value,onClick:Pt},[p.value?(e.openBlock(),e.createElementBlock("span",Ese)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(p.value?"Generando...":"Generar"),1)],8,Ose)]))])]))}},[["__scopeId","data-v-6ba594dc"]]),g9=t=>(e.pushScopeId("data-v-3f4f9ca5"),t=t(),e.popScopeId(),t),Mse={class:"modal-overlay"},Vse={class:"modal-content"},Pse=[g9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],Ase=g9(()=>e.createElementVNode("div",{class:"modal-header"},[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename-white.svg",class:"icon-title",alt:"icon"}),e.createElementVNode("span",{class:"modal-title"},"Renombrar Template")],-1)),Rse=g9(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),Fse={class:"modal-body"},Use=g9(()=>e.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),Ise=["placeholder","disabled"],qse={key:0,class:"error-message"},jse=g9(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),Dse={class:"modal-footer"},Wse=["disabled"],Bse=["disabled"],Kse={key:0},Xse={key:1},Gse=ov({__name:"ModalRenameTemplate",props:{initialName:{type:String,required:!0},templateType:{type:String,required:!0},token:{type:String,required:!0},userId:{type:String,required:!0},templateId:{type:String,required:!0}},emits:["close","rename","refresh"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(n.initialName),f=e.ref(!1),u=e.ref("");e.watch(()=>n.initialName,d=>{$.value=d,u.value=""}),e.onMounted(()=>{document.body.style.overflow="hidden"}),e.onUnmounted(()=>{document.body.style.overflow=""});async function i(){var d;if(!($.value.trim().length<3)){f.value=!0,u.value="";try{await M0.put(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${n.userId}/templates/${n.templateId}/general`,{name:$.value.trim()},{headers:{Authorization:`${n.token}`,"Content-Type":"application/json"}}),y("rename",$.value.trim()),y("refresh"),y("close")}catch(l){console.error("Error al renombrar el template:",l),((d=l.response)==null?void 0:d.status)===409?u.value="Ya existe un template con el mismo nombre":u.value="Error al renombrar el template. Inténtalo de nuevo."}finally{f.value=!1}}}return(d,l)=>(e.openBlock(),e.createElementBlock("div",Mse,[e.createElementVNode("div",Vse,[e.createElementVNode("button",{class:"close-btn",onClick:l[0]||(l[0]=a=>d.$emit("close"))},Pse),Ase,Rse,e.createElementVNode("div",Fse,[Use,e.withDirectives(e.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":l[1]||(l[1]=a=>$.value=a),placeholder:t.initialName,maxlength:"40",autocomplete:"off",disabled:f.value},null,8,Ise),[[e.vModelText,$.value]]),u.value?(e.openBlock(),e.createElementBlock("div",qse,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0)]),jse,e.createElementVNode("div",Dse,[e.createElementVNode("button",{class:"cancel-btn",onClick:l[2]||(l[2]=a=>d.$emit("close")),disabled:f.value},"Cancelar",8,Wse),e.createElementVNode("button",{class:"next-btn",disabled:$.value.trim().length<3||f.value,onClick:i},[f.value?(e.openBlock(),e.createElementBlock("span",Kse,"Guardando...")):(e.openBlock(),e.createElementBlock("span",Xse,"Guardar"))],8,Bse)])])]))}},[["__scopeId","data-v-3f4f9ca5"]]),v9=t=>(e.pushScopeId("data-v-98cd9dcd"),t=t(),e.popScopeId(),t),Zse={class:"modal-overlay"},Jse={class:"modal-content"},Hse=[v9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],Yse=v9(()=>e.createElementVNode("div",{class:"modal-header"},[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-duplicate-white.svg",class:"icon-title",alt:"icon"}),e.createElementVNode("span",{class:"modal-title"},"Duplicar template")],-1)),Qse=v9(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),$se={class:"modal-body"},tle=v9(()=>e.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),ele=["placeholder"],rle=v9(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),nle={class:"modal-footer"},ale=["disabled"],ile=ov({__name:"ModalduplicateTemplate",props:{initialName:{type:String,required:!0},token:{type:String,required:!0},templateId:{type:String,required:!0}},emits:["close","duplicate","template-duplicated"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(n.initialName+" copy"),f=e.ref(!1);e.watch(()=>n.initialName,i=>{$.value=i+" copy"}),e.onMounted(()=>{document.body.style.overflow="hidden"}),e.onUnmounted(()=>{document.body.style.overflow=""});async function u(){if($.value.trim().length>=3&&!f.value){f.value=!0;try{const i=await M0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates/${n.templateId}/duplicate`,{name:$.value.trim()},{headers:{Authorization:`${n.token}`,"Content-Type":"application/json"}});y("template-duplicated",{originalTemplateId:n.templateId,newTemplateName:$.value.trim(),responseData:i.data}),y("close")}catch(i){console.error("Error al duplicar template:",i),alert("Error al duplicar el template. Por favor, intenta de nuevo.")}finally{f.value=!1}}}return(i,d)=>(e.openBlock(),e.createElementBlock("div",Zse,[e.createElementVNode("div",Jse,[e.createElementVNode("button",{class:"close-btn",onClick:d[0]||(d[0]=l=>i.$emit("close"))},Hse),Yse,Qse,e.createElementVNode("div",$se,[tle,e.withDirectives(e.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":d[1]||(d[1]=l=>$.value=l),placeholder:t.initialName,maxlength:"40",autocomplete:"off"},null,8,ele),[[e.vModelText,$.value]])]),rle,e.createElementVNode("div",nle,[e.createElementVNode("button",{class:"cancel-btn",onClick:d[2]||(d[2]=l=>i.$emit("close"))},"Cancelar"),e.createElementVNode("button",{class:"next-btn",disabled:$.value.trim().length<3||f.value,onClick:u},e.toDisplayString(f.value?"Duplicando...":"Aceptar"),9,ale)])])]))}},[["__scopeId","data-v-98cd9dcd"]]),ole=t=>(e.pushScopeId("data-v-65422842"),t=t(),e.popScopeId(),t),sle={class:"modal-overlay"},lle={class:"modal-content"},cle=[ole(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],ule=e.createStaticVNode('<div class="modal-header" data-v-65422842><img src="https://golstatsimages.blob.core.windows.net/reports-images/icn-delete-delete.svg" class="icon-title" alt="icon" data-v-65422842><span class="modal-title" data-v-65422842>Eliminar template</span></div><div class="header-separator" data-v-65422842></div><div class="modal-body confirm-text" data-v-65422842> ¿Estás seguro que deseas eliminar<br data-v-65422842> este template? Si lo haces no habrá manera<br data-v-65422842> de recuperarlo. </div><div class="header-separator" data-v-65422842></div>',4),dle={class:"modal-footer"},ple=["disabled"],hle=ov({__name:"ModalDeleteTemplate",props:{templateId:{type:String,required:!0},userId:{type:String,required:!0},token:{type:String,required:!0}},emits:["close","delete","templateDeleted"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(!1);e.onMounted(()=>{document.body.style.overflow="hidden"}),e.onUnmounted(()=>{document.body.style.overflow=""});const f=async()=>{try{$.value=!0;const i=await M0.create({headers:{Authorization:`${n.token}`}}).delete(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${n.userId}/templates/${n.templateId}`);(i.status===200||i.status===204)&&(y("templateDeleted",n.templateId),y("close"))}catch(u){console.error("Error al eliminar template:",u),alert("Error al eliminar el template. Por favor, inténtalo de nuevo.")}finally{$.value=!1}};return(u,i)=>(e.openBlock(),e.createElementBlock("div",sle,[e.createElementVNode("div",lle,[e.createElementVNode("button",{class:"close-btn",onClick:i[0]||(i[0]=d=>u.$emit("close"))},cle),ule,e.createElementVNode("div",dle,[e.createElementVNode("button",{class:"cancel-btn",onClick:i[1]||(i[1]=d=>u.$emit("close"))},"Cancelar"),e.createElementVNode("button",{class:"delete-btn",onClick:f,disabled:$.value},e.toDisplayString($.value?"Eliminando...":"Eliminar"),9,ple)])])]))}},[["__scopeId","data-v-65422842"]]),FO=t=>(e.pushScopeId("data-v-6a25622a"),t=t(),e.popScopeId(),t),fle={class:"fortalezas-view"},mle={class:"fortalezas-header"},yle={class:"team-logo-container"},gle=["src","alt"],vle={class:"header-content"},ble={class:"fortalezas-title"},xle={class:"fortalezas-description"},_le={class:"fortalezas-container"},wle={class:"categorias-tabs segmented"},Tle=["onClick"],Sle={class:"fortalezas-list"},kle={key:0,class:"loading-state"},Lle=[FO(()=>e.createElementVNode("div",{class:"loading-spinner"},null,-1)),FO(()=>e.createElementVNode("p",{class:"loading-text"},"Cargando fortalezas...",-1))],Cle={key:1,class:"error-state"},Nle={class:"error-text"},Ole=["onClick"],Ele=["onClick"],zle=["checked","disabled","onClick"],Mle={key:0,class:"selection-number"},Vle={class:"fortaleza-badge"},Ple={class:"fortaleza-content"},Ale={class:"fortaleza-name"},Rle={class:"fortaleza-ranking"},Fle=FO(()=>e.createElementVNode("div",{class:"separator"},null,-1)),Ule={class:"category-indicator"},Ile={class:"fortalezas-footer"},qle={key:0,class:"counter-section"},jle={class:"counter-text"},Dle={key:1,class:"carousel-section"},Wle={class:"footer-badge"},Ble={class:"footer-content"},Kle={class:"footer-name"},Xle={class:"footer-ranking"},Gle=FO(()=>e.createElementVNode("div",{class:"footer-separator"},null,-1)),Zle={class:"footer-category-indicator"},Jle=["onClick"],Hle={key:2,class:"empty-message-full"},Yle={class:"empty-text"},NJ=ov({__name:"FortalezasView",props:{teamInitials:{type:String,default:"CA"},title:{type:String,default:"Fortalezas a favor de mi equipo"},modelValue:{type:Array,default:()=>[]},teamLogoUrl:{type:String,required:!1,default:null},seasonId:{type:[String,Number],required:!0},teamId:{type:[String,Number],required:!0},token:{type:String,required:!0},totalFortalezas:{type:Number,default:15},rivalTeamId:{type:[String,Number],required:!1,default:null},gameId:{type:[String,Number],required:!1,default:null},templateType:{type:[String,Number],required:!1,default:1}},emits:["update:modelValue"],setup(t,{expose:r,emit:n}){const y=t,$=n,f=e.computed(()=>y.teamLogoUrl?y.teamLogoUrl:y.teamId?`https://golstatsimages.blob.core.windows.net/teams-80/${y.teamId}.png`:"https://golstatsimages.blob.core.windows.net/teams-80/2.png"),u=e.ref([...y.modelValue]),i=e.reactive({}),d=e.ref(!1),l=e.ref(null);e.watch(()=>y.modelValue,xt=>{if(Array.isArray(xt)){const Pt=JSON.stringify([...u.value].sort()),qt=JSON.stringify([...xt].sort());Pt!==qt&&(u.value=[...xt],Object.keys(i).forEach(_t=>delete i[_t]),u.value.forEach((_t,It)=>{i[_t]=It+1}))}},{immediate:!0,deep:!0});const a=e.ref(0),S=e.ref(null),T=e.ref(null),b=e.ref(0),p=e.ref(0);function s(){const xt=S.value,Pt=T.value;b.value=xt?xt.clientWidth:0,p.value=Pt?Pt.scrollWidth:0}const c=e.computed(()=>Math.max(0,p.value-b.value)),o=e.computed(()=>a.value>0),h=e.computed(()=>a.value<c.value);function v(){const xt=Math.min(c.value,a.value+200);a.value=xt}function k(){const xt=Math.max(0,a.value-200);a.value=xt}let L=null;e.onMounted(()=>{s();const xt=()=>s();window.addEventListener("resize",xt),L=xt,j()}),e.onBeforeUnmount(()=>{L&&(window.removeEventListener("resize",L),L=null)}),e.watch(()=>u.value.slice(),async()=>{await e.nextTick(),s()},{deep:!0}),e.watch(()=>[y.seasonId,y.teamId,y.gameId,y.token,y.templateType],()=>{j()},{immediate:!1});const E=e.computed(()=>u.value.map(xt=>V.value.find(Pt=>Pt.id===xt)).filter(Boolean).sort((xt,Pt)=>i[xt.id]-i[Pt.id])),P=e.computed(()=>({transform:`translateX(-${a.value}px)`})),V=e.ref([]),I=e.ref([]);async function j(){if(!y.seasonId||!y.teamId){console.warn("seasonId y teamId son requeridos para obtener las fortalezas");return}d.value=!0,l.value=null;try{let xt;y.templateType===2?xt=`https://5c9xc3gwh2.execute-api.us-east-2.amazonaws.com/prod/strengths/seasons/${y.seasonId}/postgames/${y.gameId}/teams/${y.teamId}`:xt=`https://5c9xc3gwh2.execute-api.us-east-2.amazonaws.com/prod/strengths/seasons/${y.seasonId}/pregames/${y.gameId}/teams/${y.teamId}`;const Pt=await fetch(xt,{method:"GET",headers:{Authorization:`${y.token}`,"Content-Type":"application/json"}});if(!Pt.ok)throw new Error(`Error al obtener fortalezas: ${Pt.status} ${Pt.statusText}`);const qt=await Pt.json();I.value=qt.strengths||[],V.value=qt.strengths.map(_t=>({id:_t.categories,name:_t.name,value:_t.total,category:_t.category_type==1?"Ofensiva":_t.category_type==2?"Defensiva":"Posesion",ranking:`#${_t.league_ranking} en la liga`,color:F(_t.category_type||"General")})),M()}catch(xt){console.error("Error al cargar fortalezas:",xt),l.value=xt.message,V.value=[]}finally{d.value=!1}}function F(xt){return{1:"#4CAF50",3:"#2196F3",2:"#00BCD4",General:"#9C27B0"}[xt]||"#9C27B0"}const D=e.ref(["Todos"]),U=e.ref("Todos");function M(){const xt=[...new Set(V.value.map(Pt=>Pt.category))];D.value=["Todos",...xt]}const X=e.computed(()=>U.value==="Todos"?V.value:V.value.filter(xt=>xt.category===U.value));function O(xt){const Pt=u.value.indexOf(xt);if(Pt>-1)u.value.splice(Pt,1),delete i[xt];else{if(u.value.length>=y.totalFortalezas)return;const qt=V.value.length,_t=new Set(Object.values(i));let It=1;for(;_t.has(It)&&It<=qt;)It++;i[xt]=It,u.value.push(xt)}$("update:modelValue",u.value)}function Y(xt){U.value=xt}function st(xt){const Pt=u.value.indexOf(xt);Pt>-1&&(u.value.splice(Pt,1),delete i[xt],$("update:modelValue",u.value))}function mt(){const xt=V.value.length,Pt=new Set(u.value),qt=new Set(Object.values(i)),_t=[];for(let Rt=1;Rt<=xt;Rt++)qt.has(Rt)||_t.push(Rt);_t.sort((Rt,Wt)=>Rt-Wt);const It=X.value.map(Rt=>Rt.id).filter(Rt=>!Pt.has(Rt)),jt=y.totalFortalezas;for(const Rt of It){if(u.value.length>=jt)break;const Wt=_t.shift();if(Wt===void 0)break;i[Rt]=Wt,u.value.push(Rt)}$("update:modelValue",u.value)}function yt(){console.warn("Error loading team logo, falling back to initials")}function bt(){console.warn("Error loading league logo")}return r({fortalezasData:V,fortalezasRawData:I,selectedFortalezas:u,selectionOrderMap:i,autocompletar:mt}),(xt,Pt)=>(e.openBlock(),e.createElementBlock("div",fle,[e.createElementVNode("div",mle,[e.createElementVNode("div",yle,[e.createElementVNode("img",{src:f.value,alt:`Logo ${t.teamInitials}`,class:"team-logo",onError:yt},null,40,gle)]),e.createElementVNode("div",vle,[e.createElementVNode("h3",ble,e.toDisplayString(t.title),1),e.createElementVNode("p",xle," Este template contiene "+e.toDisplayString(t.totalFortalezas)+" visualizaciones de Fortalezas. Selecciona las deseadas. ",1)])]),e.createElementVNode("div",_le,[e.createElementVNode("div",wle,[e.createElementVNode("div",{class:"segmented-highlight",style:e.normalizeStyle({width:`calc(100% / ${D.value.length})`,left:`calc(${D.value.indexOf(U.value)} * (100% / ${D.value.length}))`})},null,4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,qt=>(e.openBlock(),e.createElementBlock("button",{key:qt,class:e.normalizeClass(["categoria-tab",{active:U.value===qt}]),onClick:_t=>Y(qt)},e.toDisplayString(qt),11,Tle))),128))]),e.createElementVNode("div",Sle,[d.value?(e.openBlock(),e.createElementBlock("div",kle,Lle)):l.value?(e.openBlock(),e.createElementBlock("div",Cle,[e.createElementVNode("p",Nle,"Error al cargar las fortalezas: "+e.toDisplayString(l.value),1),e.createElementVNode("button",{onClick:j,class:"retry-button"},"Reintentar")])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(X.value,qt=>(e.openBlock(),e.createElementBlock("div",{key:qt.id,class:e.normalizeClass(["fortaleza-item",{selected:u.value.includes(qt.id),disabled:!u.value.includes(qt.id)&&u.value.length>=t.totalFortalezas}]),onClick:_t=>O(qt.id)},[e.createElementVNode("div",{class:"fortaleza-checkbox",onClick:e.withModifiers(_t=>!u.value.includes(qt.id)&&u.value.length>=t.totalFortalezas?null:O(qt.id),["stop"])},[e.createElementVNode("input",{type:"checkbox",checked:u.value.includes(qt.id),disabled:!u.value.includes(qt.id)&&u.value.length>=t.totalFortalezas,class:"checkbox-input",onClick:e.withModifiers(_t=>!u.value.includes(qt.id)&&u.value.length>=t.totalFortalezas?null:O(qt.id),["stop"])},null,8,zle),u.value.includes(qt.id)?(e.openBlock(),e.createElementBlock("span",Mle,e.toDisplayString(i[qt.id]),1)):e.createCommentVNode("",!0)],8,Ele),e.createElementVNode("div",Vle,e.toDisplayString(qt.value),1),e.createElementVNode("div",Ple,[e.createElementVNode("div",Ale,e.toDisplayString(qt.name),1),e.createElementVNode("div",Rle,[e.createElementVNode("span",null,e.toDisplayString(qt.ranking),1),e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/golstats2-tournaments/1.png",alt:"Liga",class:"league-logo",onError:bt},null,32),Fle,e.createElementVNode("div",Ule,[e.createElementVNode("div",{class:"category-dot",style:e.normalizeStyle({backgroundColor:qt.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(qt.category),1)])])])],10,Ole))),128))])]),e.createElementVNode("div",Ile,[u.value.length>0?(e.openBlock(),e.createElementBlock("div",qle,[e.createElementVNode("div",jle,e.toDisplayString(u.value.length)+"/"+e.toDisplayString(t.totalFortalezas),1)])):e.createCommentVNode("",!0),u.value.length>0?(e.openBlock(),e.createElementBlock("div",Dle,[e.createElementVNode("div",{class:"carousel-container",ref_key:"carouselContainerRef",ref:S},[o.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"carousel-arrow left",onClick:k},"‹")):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"carousel-track",ref_key:"carouselTrackRef",ref:T,style:e.normalizeStyle(P.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,qt=>(e.openBlock(),e.createElementBlock("div",{key:qt.id,class:"footer-pill"},[e.createElementVNode("div",Wle,e.toDisplayString(qt.value),1),e.createElementVNode("div",Ble,[e.createElementVNode("div",Kle,e.toDisplayString(qt.name),1),e.createElementVNode("div",Xle,[e.createElementVNode("span",null,e.toDisplayString(qt.ranking),1),e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/golstats2-tournaments/1.png",alt:"Liga",class:"footer-league-logo",onError:bt},null,32),Gle,e.createElementVNode("div",Zle,[e.createElementVNode("div",{class:"footer-category-dot",style:e.normalizeStyle({backgroundColor:qt.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(qt.category),1)])])]),e.createElementVNode("button",{class:"pill-remove-btn",onClick:_t=>st(qt.id)},"×",8,Jle)]))),128))],4),h.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"carousel-arrow right",onClick:v},"›")):e.createCommentVNode("",!0)],512)])):(e.openBlock(),e.createElementBlock("div",Hle,[e.createElementVNode("span",Yle,e.toDisplayString(u.value.length)+" de "+e.toDisplayString(t.totalFortalezas)+" Fortalezas agregadas",1)]))])]))}},[["__scopeId","data-v-6a25622a"]]),Qle=(t,r)=>{const n=t.__vccOpts||t;for(const[y,$]of r)n[y]=$;return n},$le={key:1},tce={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ece=["fill"],rce={key:0,class:"checkbox__teams"},nce={class:"checkbox__teams__logo"},ace=["src"],ice={class:"checkbox__teams__logo"},oce=["src"],sce={__name:"GSC-Checkbox",props:{width:{type:String,default:"fit-content"},height:{type:String,default:"fit-content"},label:{type:String,default:""},labelWhiteSpace:{type:String,default:"normal"},labelColor:{type:String,default:"white"},fontFamily:{type:String,default:"sans-serif"},labelFontSize:{type:String,default:"12px"},modelValue:{type:Boolean,default:!1},justifyContent:{type:String,default:"flex-start"},alignItems:{type:String,default:"center"},boxBackgroundColor:{type:String,default:"#CBEE6B"},boxValueColor:{type:String,default:"#0d1d29"},boxValue:{type:[String,Number],default:""},boxPosition:{type:String,default:"left",validator(t){return["left","right","top","bottom"].includes(t)}},boxMarginTop:{type:String,default:"0.2em"},boxWidthAndHeight:{type:String,default:"16px"},boxBorderColor:{type:String,default:"#969da2"},boxBorderWidth:{type:String,default:"2px"},boxBorderRadius:{type:String,default:"4px"},boxValueFontSize:{type:String,default:"10px"},boxValueFontFamily:{type:String,default:"sans-serif"},avoidInteraction:{type:Boolean,default:!1},avoidToCheck:{type:Boolean,default:!1},isBoxOnly:{type:Boolean,default:!1},teamsIds:{type:Array,default:()=>null}},emits:["update:modelValue"],setup(t,{emit:r}){const n=t;e.useCssVars(l=>({"7bd9d47b":t.width,"34dc7ddc":t.height}));const y=e.ref(!1),$=e.computed(()=>{const l={color:n.boxValueColor,"font-family":n.fontFamily,height:n.boxWidthAndHeight,width:n.boxWidthAndHeight,minWidth:n.boxWidthAndHeight,"border-radius":n.boxBorderRadius,"margin-top":n.boxMarginTop};return y.value?(l["background-color"]=n.boxBackgroundColor,l.border=`solid ${n.boxBorderWidth} ${n.boxBackgroundColor}`):l.border=`solid ${n.boxBorderWidth} ${n.boxBorderColor}`,l}),f=e.computed(()=>({"font-family":n.boxValueFontFamily,"font-size":n.boxValueFontSize,color:n.boxValueColor,"line-height":1})),u=e.computed(()=>{const l={color:n.labelColor,"font-family":n.fontFamily,"font-size":n.labelFontSize,"white-space":n.labelWhiteSpace,"text-align":n.boxPosition==="top"||n.boxPosition==="bottom"?"center":n.boxPosition};return(n.boxPosition==="left"||n.boxPosition==="right")&&(l[`margin-${n.boxPosition}`]=n.isBoxOnly?"0":n.teamsIds?"8px":"10px"),l});e.watch(()=>n.modelValue,l=>{l!==y.value&&(y.value=l)},{immediate:!0});function i(){n.avoidInteraction||!y.value&&n.avoidToCheck||(y.value=!y.value,r("update:modelValue",y.value))}function d(l){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${l}.png`}return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["checkbox",`box-${t.boxPosition}`]),onClick:i},[e.createElementVNode("div",{class:"checkbox__box",style:e.normalizeStyle($.value)},[y.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.boxValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"checkbox__box__value",style:e.normalizeStyle(f.value)},e.toDisplayString(t.boxValue),5)):(e.openBlock(),e.createElementBlock("div",$le,[(e.openBlock(),e.createElementBlock("svg",tce,[e.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:t.boxValueColor},null,8,ece)]))]))],64)):e.createCommentVNode("",!0)],4),t.teamsIds&&t.teamsIds.length?(e.openBlock(),e.createElementBlock("div",rce,[e.createElementVNode("div",nce,[e.createElementVNode("img",{src:d(t.teamsIds[0]),alt:""},null,8,ace)]),e.createElementVNode("div",ice,[e.createElementVNode("img",{src:d(t.teamsIds[1]),alt:""},null,8,oce)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"checkbox__label",style:e.normalizeStyle(u.value)},e.toDisplayString(t.label),5)],2))}},lce=Qle(sce,[["__scopeId","data-v-b6f124d8"]]),OJ=new Map([["M1",{matchDayId:1,matchDayName:"Jornada 1",matchDayAbbreviation:"J1"}],["M2",{matchDayId:2,matchDayName:"Jornada 2",matchDayAbbreviation:"J2"}],["M3",{matchDayId:3,matchDayName:"Jornada 3",matchDayAbbreviation:"J3"}],["M4",{matchDayId:4,matchDayName:"Jornada 4",matchDayAbbreviation:"J4"}],["M5",{matchDayId:5,matchDayName:"Jornada 5",matchDayAbbreviation:"J5"}],["M6",{matchDayId:6,matchDayName:"Jornada 6",matchDayAbbreviation:"J6"}],["M7",{matchDayId:7,matchDayName:"Jornada 7",matchDayAbbreviation:"J7"}],["M8",{matchDayId:8,matchDayName:"Jornada 8",matchDayAbbreviation:"J8"}],["M9",{matchDayId:9,matchDayName:"Jornada 9",matchDayAbbreviation:"J9"}],["M10",{matchDayId:10,matchDayName:"Jornada 10",matchDayAbbreviation:"J10"}],["M11",{matchDayId:11,matchDayName:"Jornada 11",matchDayAbbreviation:"J11"}],["M12",{matchDayId:12,matchDayName:"Jornada 12",matchDayAbbreviation:"J12"}],["M13",{matchDayId:13,matchDayName:"Jornada 13",matchDayAbbreviation:"J13"}],["M14",{matchDayId:14,matchDayName:"Jornada 14",matchDayAbbreviation:"J14"}],["M15",{matchDayId:15,matchDayName:"Jornada 15",matchDayAbbreviation:"J15"}],["M16",{matchDayId:16,matchDayName:"Jornada 16",matchDayAbbreviation:"J16"}],["M17",{matchDayId:17,matchDayName:"Jornada 17",matchDayAbbreviation:"J17"}],["PI1",{matchDayId:181,matchDayName:"Play In 1",matchDayAbbreviation:"PI1"}],["PI2",{matchDayId:182,matchDayName:"Play In 2",matchDayAbbreviation:"PI2"}],["PO",{matchDayId:183,matchDayName:"Repechaje",matchDayAbbreviation:"R"}],["PO1",{matchDayId:18,matchDayName:"Cuartos de final ida",matchDayAbbreviation:"CFI"}],["PO2",{matchDayId:19,matchDayName:"Cuartos de final vuelta",matchDayAbbreviation:"CFV"}],["PO3",{matchDayId:20,matchDayName:"Semifinal ida",matchDayAbbreviation:"SFI"}],["PO4",{matchDayId:21,matchDayName:"Semifinal vuelta",matchDayAbbreviation:"SFV"}],["PO5",{matchDayId:22,matchDayName:"Final ida",matchDayAbbreviation:"FI"}],["PO6",{matchDayId:86,matchDayName:"Final vuelta",matchDayAbbreviation:"FV"}]]),UO={TO_RIGHT:"toRight",TO_LEFT:"toLeft"},cce=["gameId","playerId","teamId","x","y","momentOfPlay","section","playId","timeSection"];let kA=null;function uce(){return kA||(kA=cce.reduce((t,r,n)=>(t[n]=r,t),{})),kA}const dce=["playId","playerId","teamId","gameId","categoryId","relatedCategoriesIds","x1","y1","x2","y2","x3","y3","fieldSection","momentOfPlay","playingAs","matchLapse","matchResult","matchResultAtMomentOfPlay","relatedPlayId","touchOrder","timeSection"];let LA=null;function pce(){return LA||(LA=dce.reduce((t,r,n)=>(t[n]=r,t),{})),LA}const IO=t=>(e.pushScopeId("data-v-7f431c81"),t=t(),e.popScopeId(),t),hce={class:"corners-view"},fce={class:"corners-header"},mce={class:"team-logo-container"},yce=["src","alt"],gce={class:"header-content"},vce={class:"corners-title"},bce={class:"corners-description"},xce={class:"corners-container"},_ce={class:"matches-header"},wce={key:0,class:"post-match-game"},Tce={class:"post-match-game__match-day"},Sce={class:"post-match-game__game-info"},kce={class:"team-info"},Lce={class:"team-logo-post"},Cce=["src"],Nce={class:"team-name"},Oce={class:"score"},Ece={class:"team-info"},zce={class:"team-name"},Mce={class:"team-logo-post"},Vce=["src"],Pce=["onClick"],Ace={class:"team-logo-match"},Rce=["src"],Fce={class:"match-score"},Uce={class:"team-logo-match"},Ice=["src"],qce={class:"team-acronym"},jce={class:"team-match-day"},Dce={class:"team-acronym"},Wce={class:"categorias-tabs segmented"},Bce=["onClick"],Kce={class:"corners-list"},Xce=["onClick"],Gce={class:"check-col"},Zce={class:"badge-col"},Jce={class:"count-badge"},Hce={class:"content-col"},Yce={class:"title-row"},Qce={class:"time"},$ce=IO(()=>e.createElementVNode("span",{class:"title"},"Tiro de esquina",-1)),tue={class:"player"},eue={class:"meta-row"},rue=IO(()=>e.createElementVNode("span",null,"/",-1)),nue={class:"corners-footer"},aue={key:0,class:"counter-section"},iue={class:"counter-text"},oue={key:1,class:"carousel-section"},sue={class:"footer-total"},lue={class:"footer-badge"},cue={class:"team-info"},uue={class:"team-logo-corner"},due=["src"],pue={class:"team-score"},hue={class:"team-info"},fue={class:"team-logo-corner"},mue=["src"],yue={class:"team-score"},gue={class:"footer-content"},vue={class:"footer-ranking"},bue={class:"corner-time"},xue=IO(()=>e.createElementVNode("div",{class:"footer-separator"},null,-1)),_ue={class:"corner-player"},wue={class:"corner-details"},Tue=IO(()=>e.createElementVNode("span",null," / ",-1)),Sue=["onClick"],kue={key:2,class:"empty-message-full"},Lue={class:"empty-text"},CA=148,Cue=5,Nue=10,Oue=600,Eue=600,zue=5,qO=ov({__name:"TirosEsquinaView",props:{modelValue:{type:Array,default:()=>[]},userTeamId:{type:Number,default:0},rival:{type:Boolean,default:!1},teamInitials:{type:String,default:"AME"},title:{type:String,default:"Tiros de esquina en contra de mi equipo"},teamLogoUrl:{type:String,default:"https://golstatsimages.blob.core.windows.net/teams-80/2.png"},teamViews:{type:Array,default:()=>[]},configData:{type:Object,default:()=>({})},isAgainstMode:{type:Boolean,default:!1},isSynchronization:{type:Boolean,default:!1},isRival:{type:Boolean,default:!1},filters:{type:Object,default:()=>({isMoment:!1,final:[1,2,3],moment:[1,2,3],playingAs:[1,2],sections:[1,2,3,4,5,6],games:[],players:[],cornertype:31,howWas:[120,126,327,133],zona:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],whathappened:[583,585,587,589,584,586,588,590,122,128,136,142,123,129,137,143,124,130,138,144,125,131,139,14,146,147,327,133],isWhatHappenedFull:!0,isZoneFull:!0})}},emits:["update:modelValue","corners-fetched"],setup(t,{expose:r,emit:n}){const y=t,$=n,f=["Todos","Goles","Rematados","A rival"],u={goals:{categoryIds:[583,585,587,589]},shots:{categoryIds:[584,586,588,590,122,128,136,142]},toRival:{categoryIds:[123,129,137,143,124,130,138,144]}},i=e.ref("Todos"),d=e.ref([...y.modelValue]),l=e.reactive({}),a=e.ref([]);d.value.forEach((Je,hr)=>{l[Je]=hr+1});const S=e.ref(0),T=e.ref(null),b=e.ref(null),p=e.ref(0),s=e.ref(0);function c(){const Je=T.value,hr=b.value;p.value=Je?Je.clientWidth:0,s.value=hr?hr.scrollWidth:0}const o=e.computed(()=>Math.max(0,s.value-p.value)),h=e.computed(()=>S.value>0),v=e.computed(()=>S.value<o.value),k=e.computed(()=>a.value.filter(Je=>Je.isSelected)),L=e.computed(()=>k.value.length===y.teamViews.length),E=e.ref(0);e.watch(()=>k.value,Je=>{setTimeout(()=>{b.value?c():E.value=0},500),$("update:modelValue",Je)},{deep:!0});function P(){b.value&&(b.value.scrollLeft=b.value.scrollLeft+400,S.value=S.value+400)}function V(){b.value&&(b.value.scrollLeft=b.value.scrollLeft-400,S.value=S.value-400)}const I=e.computed(()=>y.configData&&y.configData.template&&y.configData.template.template_type===2?{...y.configData.partido,matchDay:OJ.get(y.configData.partido.matchday_abbreviation)}:null);e.computed(()=>y.configData&&y.configData.template&&y.configData.template.template_type===1?y.configData.partido:null);function j(){const Je=he.value,hr=Je?Je.clientWidth:0,Nr=Math.max(1,Math.floor(hr/(CA+10)));de.value=Nr}const F=e.computed(()=>{const Je=-le.value*(CA+10),hr=Le.value?Ne.value:0;return{transform:`translateX(${Je+hr}px)`}});function D(){le.value=Math.min(Jt.value,le.value+1)}function U(){le.value=Math.max(0,le.value-1)}function M(Je){Le.value=!0,Oe.value=Je.clientX,Ne.value=0}function X(Je){Le.value&&(Ne.value=Je.clientX-Oe.value)}function O(){if(!Le.value)return;const Je=CA/3;Ne.value<=-Je?D():Ne.value>=Je&&U(),Le.value=!1,Ne.value=0}const Y=e.computed(()=>{if(ir.value&&ir.value.cornersByType){const Je=ir.value.cornersByType.get(i.value)||[];return console.log("gameCorners",Je),Je}return[]});function st(Je){console.log("onClickCorner",Je),console.log("areCornersFilled",L.value),(!L.value||Je.isSelected)&&(Je.isSelected=!Je.isSelected)}function mt(Je){jt.value.forEach(hr=>{hr.isSelected=hr.game_id===Je.game_id})}function yt(){if(!L.value){let Je=k.value.length;for(const hr of a.value)if(!hr.isSelected&&(hr.isSelected=!0,Je++,Je>=y.teamViews.length))break}}function bt(Je){Je.isSelected=!1}function xt(){console.warn("Error loading team logo, falling back to initials")}let Pt=null;e.onMounted(()=>{c();const Je=()=>c();window.addEventListener("resize",Je),Pt=Je}),e.onBeforeUnmount(()=>{Pt&&(window.removeEventListener("resize",Pt),Pt=null)}),e.watch(()=>d.value.slice(),async()=>{await e.nextTick(),c()},{deep:!0});const qt=uce(),_t=pce(),It=e.ref(new Map),jt=e.ref([]);let Rt=0;const Wt=e.ref(new Map),re=e.ref(null),le=e.ref(0),he=e.ref(null),de=e.ref(1),Jt=e.computed(()=>Math.max(0,jt.value.length-de.value)),te=e.computed(()=>le.value>0),ne=e.computed(()=>le.value<Jt.value),Le=e.ref(!1),Oe=e.ref(0),Ne=e.ref(0),Pe=[{text:"Rematado fue gol",categoriesIds:[583,585,587,589]},{text:"Rematado no fue gol",categoriesIds:[584,586,588,590]},{text:"Rematado sin destino",categoriesIds:[122,128,136,142]},{text:y.configData.liga.is_female===1?"Ganado por portera rival":"Ganado por portero rival",categoriesIds:[123,129,137,143]},{text:y.configData.liga.is_female===1?"Ganado por jugadora rival":"Ganado por jugador rival",categoriesIds:[124,130,138,144]},{text:"Sin destino",categoriesIds:[125,131,139,145]}],Xe=e.computed(()=>({id:y.configData.partido.game_id,home_team:y.configData.partido.home_team,away_team:y.configData.partido.visiting_team,season:y.configData.partido.season_id,game_status:y.configData.partido.game_status,home_acronym:y.configData.partido.home_team_acronym,away_acronym:y.configData.partido.visiting_team_acronym,logo_home:y.configData.partido.localLogo,logo_away:y.configData.partido.visitanteLogo})),He=e.computed(()=>{let Je=y.isAgainstMode?"en contra":"a favor";return y.userTeamId===y.configData.partido.home_team||y.userTeamId===y.configData.partido.visiting_team?Je+=y.userTeamId===$e.value?" de mi equipo":" del rival":Je+=y.isRival?" del equipo visitante":" del equipo local",Je}),$e=e.computed(()=>y.isRival?y.configData.partido.visiting_team:y.configData.partido.home_team),ir=e.computed(()=>jt.value.find(Je=>Je.isSelected)),pr={headers:{Authorization:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}};function tr(){if(a.value=[],jt.value)if(y.isSynchronization)jt.value.forEach((Je,hr)=>{Je.isVisible=!0,hr===0&&(Je.isSelected=!0,Je.isExpanded=!0,Je.corners.forEach(Nr=>{Nr.isVisible=!0}),Je.cornersAgainstTeam.forEach(Nr=>{Nr.isVisible=!0}))});else{let Je=!1;jt.value.forEach(hr=>{let Nr=1;if(hr.matchDay||(hr.matchDay=OJ.get(hr.matchday_abbreviation)),hr.isSelected=!1,hr.cornersByType=new Map,f.forEach(Ir=>{hr.cornersByType.set(Ir,[])}),y.isAgainstMode&&hr.isSoccerFieldDataRivalLoaded||!y.isAgainstMode&&hr.isSoccerFieldDataLoaded){const Ir=y.isAgainstMode?hr.cornersAgainstTeam:hr.corners;if((!y.filters.games.length||y.filters.games.includes(hr.game_id))&&y.filters.playingAs.includes(hr.playingAs)&&(y.filters.isMoment||y.filters.final.includes(hr.finalResult))){for(const ln of Ir){if(ln.isSelected=!1,ln.isVisible=!0,!y.filters.isWhatHappenedFull&&ln.relatedCategoriesIds&&!y.filters.whathappened.some(dn=>ln.relatedCategoriesIds.has(dn))){ln.isVisible=!1,ln.isSelected=!1;continue}ln.isVisible=!0,ln.game=hr;const Nn=hr.cornersByType.get("Todos"),En=hr.cornersByType.get("Goles"),Gn=hr.cornersByType.get("Rematados"),$n=hr.cornersByType.get("A rival");a.value.push(ln),ln.mainIndex=Nr,Nr++,Nn.push(ln);const ka=u.goals.categoryIds.some(dn=>ln.relatedCategoriesIds.has(dn)),Hr=u.shots.categoryIds.some(dn=>ln.relatedCategoriesIds.has(dn)),Rr=u.toRival.categoryIds.some(dn=>ln.relatedCategoriesIds.has(dn));ka&&En.push(ln),Hr&&Gn.push(ln),Rr&&$n.push(ln)}hr.isVisible&&!Je?(hr.isSelected=!0,hr.isExpanded=!0,Je=!0):hr.isSelected=!1}else hr.isVisible=!1,Ir.forEach(ln=>{ln.isSelected=!1})}}),console.log("props.isAgainstMode",y.isAgainstMode),console.log("allGamesCorners",a.value),$("corners-fetched",a.value)}}function Fe(){It.value.get($e.value)||It.value.set($e.value,jt.value)}function sr(Je,hr,Nr,Ir){Je&&Je.forEach(ln=>{ln.isHomeTeam=ln.teamId===Xe.value.home_team,ln.attackDirection=Ir.get(ln.playId).mainPlay.attackDirection,ln.player=hr.get(ln.playerId)||Nr.get(ln.playerId)})}function Ye(Je){const[hr,Nr]=Je.split(", ");let Ir="";const ln=hr.split(" ");for(const Nn of ln)if(Ir+=` ${Nn}`,Nn.length>3)break;return Nr&&hr?`${Nr.trim().charAt(0)}.${Ir}`:""}function Te(Je){let[hr,Nr]=Je.split(", ");Nr=Nr.trim();let Ir="";const ln=hr.split(" "),Nn=Nr.includes(" ")?Nr.split(" ")[0]:Nr;for(const En of ln)if(Ir+=` ${En}`,En.length>3)break;return Nn&&hr?`${Nn} ${Ir}`:""}function Re(Je){if(!Je.teams||Je.teams.length===0)return;const hr=Je.teams[0].team_id,Nr=Je.teams[1].team_id;if($e.value===hr&&Je.home_atk_direction===1||$e.value===Nr&&Je.visiting_atk_direction===1)for(let Ir=1;Ir<5;Ir++)Wt.value.set(Ir,Ir%2===0?UO.TO_LEFT:UO.TO_RIGHT);else for(let Ir=1;Ir<5;Ir++)Wt.value.set(Ir,Ir%2===0?UO.TO_RIGHT:UO.TO_LEFT)}const Ve=new Map([[120,"Comba hacia afuera"],[134,"Comba hacia afuera"],[126,"Comba hacia adentro"],[140,"Comba hacia adentro"],[327,"Raz de área"],[146,"Raz de área"],[133,"En corto"],[147,"En corto"]]),br=Pe.reduce((Je,hr)=>(hr.categoriesIds.forEach(Nr=>{Je.set(Nr,hr.text)}),Je),new Map);function cr([Je,hr]){const Nr=Math.round(Number(hr));if(Nr===60){const Ir=Number(Je)+1;return`${Ir<100?Ir<10?"00":"0":""}${Ir}:00.000`}return`${Je}:${Nr<10?"0":""}${Nr}.000`}async function gr(Je,hr){try{if(Je&&hr&&(!Je.isSoccerFieldDataLoaded||!Je.isSoccerFieldDataRivalLoaded)){const Nr=new Map,Ir=new Map,ln=new Map;Re(hr.data),hr.data.players&&hr.data.players.forEach($n=>{$n.shortName=Ye($n.name),$n.firstNameAndFirstLastName=Te($n.name),Ir.set($n.player_id,$n)}),hr.data.rival_players&&hr.data.rival_players.forEach($n=>{$n.shortName=Ye($n.name),$n.firstNameAndFirstLastName=Te($n.name),ln.set($n.player_id,$n)}),re.value=hr.data.teams.find($n=>$n.team_id===$e.value),re.value&&(re.value.rival=hr.data.teams.find($n=>$n.team_id!==$e.value));const Nn=hr.data.data.reduce(($n,ka)=>{const Hr=ka.reduce((Un,Xr,sn)=>(Un[_t[sn]]=Xr,Un.isHomeTeam=Un.teamId===Je.home_team,Un),{}),Rr=Hr.playId===Hr.relatedPlayId,dn=$n.get(Hr.relatedPlayId),Mn=Hr.momentOfPlay.split(":"),da=cr(Mn);return Hr.player=Ir.get(Hr.playerId)||ln.get(Hr.playerId),Hr.isTeamForAnalysis=Hr.teamId===$e.value,Rr&&(Hr.attackDirection=Wt.value.get(Hr.matchLapse),Nr.set(Hr.playId,da)),dn?Rr?dn.mainPlay=Hr:dn.relatedPlays.length<zue&&(dn.relatedPlays.push(Hr),dn.relatedPlays.length>1&&dn.relatedPlays.sort((Un,Xr)=>Un.touchOrder-Xr.touchOrder)):$n.set(Hr.playId,{mainPlay:Rr?Hr:null,relatedPlays:Rr?[]:[Hr]}),$n},new Map),En=hr.data.field_positions.reduce(($n,ka)=>{const Hr=ka.reduce((dn,Mn,da)=>(dn[qt[da]]=Mn,dn),{});Hr.isTeamForAnalysis=Hr.teamId===$e.value;const Rr=$n.get(Hr.playId);if(Rr){const dn=Rr.get(Hr.momentOfPlay);dn?dn.push(Hr):Rr.set(Hr.momentOfPlay,[Hr])}else $n.set(Hr.playId,new Map([[Hr.momentOfPlay,[Hr]]]));return $n},new Map),Gn=Array.from(Nr.entries()).reduce(($n,[ka,Hr])=>{const Rr=[],dn=[];let Mn=null;const da=En.get(ka);if(da){const Un=y.isSynchronization?Oue:Cue,Xr=y.isSynchronization?Eue:Nue;Array.from(da.keys()).sort().forEach(pn=>{(!Mn||dn.length<Xr)&&(pn===Hr?Mn=da.get(pn):Mn?dn.length<Xr&&dn.push(da.get(pn)):(Rr.length===Un&&Rr.shift(),Rr.push(da.get(pn))))});const Sr=new Map;Rr.forEach((pn,Hn)=>{sr(pn,Ir,ln,Nn),Sr.set(`${Hn-Rr.length}`,pn)}),sr(Mn,Ir,ln,Nn),Sr.set("0",Mn),dn.forEach((pn,Hn)=>{sr(pn,Ir,ln,Nn),Sr.set(`${Hn+1}`,pn)}),$n.set(ka,Sr)}return $n},new Map);Je[`${y.isAgainstMode?"cornersAgainstTeam":"corners"}`].forEach($n=>{const ka=$n.related_categories.split(",").reduce((Rr,dn,Mn)=>{const da=Number(dn);return Mn===1&&($n.howWasCorner=da),Rr.array.push(da),Rr.sett.add(da),Rr},{array:[],sett:new Set});for(const Rr of ka.array){const dn=Ve.get(Rr),Mn=br.get(Rr);if(Mn&&($n.whatHappenedName=Mn),dn&&($n.howWasCornerName=dn),$n.howWasCornerName&&$n.whatHappenedName)break}$n.relatedCategoriesIds=ka.sett,$n.playConnections=Nn.get($n.play_id),$n.fieldPositions=Gn.get($n.play_id),$n.player=Ir.get($n.player_id)||ln.get($n.player_id);let Hr=$n.moment_of_play.split(".")[0];Hr.startsWith("0")&&(Hr=Hr.slice(1)),$n.formattedMomentOfPlay=Hr,$n.momentOfPlayNumber=Number(Hr.replace(":","."))}),!y.isAgainstMode&&!Je.isSoccerFieldDataLoaded&&(Je.isSoccerFieldDataLoaded=!0),y.isAgainstMode&&!Je.isSoccerFieldDataRivalLoaded&&(Je.isSoccerFieldDataRivalLoaded=!0)}}catch(Nr){throw new Error(Nr)}}function Tr(Je){return y.isSynchronization?M0.get(`https://golstats-microservices.s3.us-west-2.amazonaws.com/tendency/corners-${y.isAgainstMode?"received":"commited"}-${Rt}-${$e.value}-${Je.game_id}-large.json`):M0.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${Rt}/corners/trends/teams/${$e.value}/${Je.game_id}${y.isAgainstMode?"?isR=1":""}`,pr)}async function Pr(){try{const Je=[];jt.value.forEach(hr=>{(y.isAgainstMode&&!hr.isSoccerFieldDataRivalLoaded||!y.isAgainstMode&&!hr.isSoccerFieldDataLoaded)&&Je.push(Tr(hr))}),Je.length>0&&((await Promise.all(Je)).forEach((Nr,Ir)=>{gr(jt.value[Ir],Nr)}),tr()),Fe()}catch(Je){throw new Error(Je)}}async function qe(Je){try{const hr=It.value.get($e.value);if(hr){jt.value=hr,tr();return}Rt=Je;const Nr=await M0.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${Rt}/games/teams/${$e.value}/corners`,pr);if(!Nr.data&&!Je)return qe(y.configData.torneo.id);const Ir=Nr.data,ln={corners:0,cornersAgainst:0};jt.value=Ir.games?Ir.games.reduce((Nn,En)=>{if(I.value&&En.game_id!==Xe.value.id||En.game_status!==1)return Nn;const Gn={againstTeam:[],team:[]},$n=En.score[1]-En.score[0];En.dateMillis=new Date(En.date_time_utc),En.isVisible=!0,En.playingAs=En.home_team===$e.value?1:2,En.finalResult=$n===0?3:En.playingAs===1?$n>0?2:1:$n<0?2:1,En.corners.forEach(Hr=>{const Rr=Hr.team_id===$e.value;Hr.isAgainst=!Rr,Rr?Gn.team.push(Hr):Gn.againstTeam.push(Hr)}),En.corners=Gn.team,En.cornersAgainstTeam=Gn.againstTeam,ln.corners+=En.corners.length,ln.cornersAgainst+=En.cornersAgainstTeam.length;const ka={...En,isSelected:Nn.length===0,isExpanded:!1,isTeamForAnalysisHomeTeam:En.home_team===$e.value,canPlayVideos:!1};return Nn.push(ka),Nn},[]):[],jt.value=jt.value.sort((Nn,En)=>En.dateMillis-Nn.dateMillis),Fe(),await Pr(),jt.value.forEach(Nn=>{Nn.corners.concat(Nn.cornersAgainstTeam).forEach(En=>{if(En.playConnections){const[Gn,$n]=En.moment_of_play.split(":"),[ka,Hr]=$n.split("."),Rr=Number(Gn)+45*En.playConnections.mainPlay.matchLapse;En.isSelected=!1,En.orderValue=+`${Rr}${ka}${Hr}`}}),Nn.corners=Nn.corners.sort((En,Gn)=>En.orderValue-Gn.orderValue),Nn.cornersAgainstTeam=Nn.cornersAgainstTeam.sort((En,Gn)=>En.orderValue-Gn.orderValue)}),tr()}catch(hr){throw new Error(hr)}}e.watch(()=>y.configData,async Je=>{Je&&Je.partido&&Je.torneo&&await qe(Je.partido.season_id)},{deep:!0,immediate:!0});let Ge=null;return e.onMounted(()=>{j();const Je=()=>j();window.addEventListener("resize",Je),Ge=Je}),e.onBeforeUnmount(()=>{Ge&&(window.removeEventListener("resize",Ge),Ge=null)}),r({autocompletar:yt}),(Je,hr)=>(e.openBlock(),e.createElementBlock("div",hce,[e.createElementVNode("div",fce,[e.createElementVNode("div",mce,[e.createElementVNode("img",{src:t.teamLogoUrl,alt:`Logo ${t.teamInitials}`,class:"team-logo",onError:xt},null,40,yce)]),e.createElementVNode("div",gce,[e.createElementVNode("h3",vce," Tiros de esquina "+e.toDisplayString(He.value),1),e.createElementVNode("p",bce," Este template contiene "+e.toDisplayString(t.teamViews.length)+" visualizaciones de tiros de esquina. Selecciona los deseados. ",1)])]),e.createElementVNode("div",xce,[e.createElementVNode("div",_ce,[I.value?(e.openBlock(),e.createElementBlock("div",wce,[e.createElementVNode("div",Tce,e.toDisplayString(I.value.matchDay.matchDayName),1),e.createElementVNode("div",Sce,[e.createElementVNode("div",kce,[e.createElementVNode("div",Lce,[e.createElementVNode("img",{src:I.value.localLogo,alt:""},null,8,Cce)]),e.createElementVNode("div",Nce,e.toDisplayString(I.value.home_team_acronym),1)]),e.createElementVNode("div",Oce,e.toDisplayString(I.value.score[0])+" - "+e.toDisplayString(I.value.score[1]),1),e.createElementVNode("div",Ece,[e.createElementVNode("div",zce,e.toDisplayString(I.value.visiting_team_acronym),1),e.createElementVNode("div",Mce,[e.createElementVNode("img",{src:I.value.visitanteLogo,alt:""},null,8,Vce)])])])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:"window",ref_key:"matchesWindowRef",ref:he,onPointerdown:M,onPointerup:O,onPointercancel:O,onPointerleave:O,onPointermove:X},[te.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"carousel-arrow left",onClick:U}," ‹ ")):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["track",{animating:!Le.value}]),style:e.normalizeStyle(F.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jt.value,Nr=>{var Ir;return e.openBlock(),e.createElementBlock("div",{key:Nr.game_id,class:e.normalizeClass(["match-pill",{active:Nr.isSelected}]),onClick:ln=>mt(Nr)},[e.createElementVNode("div",Ace,[e.createElementVNode("img",{src:Nr.home_team_logo,alt:""},null,8,Rce)]),e.createElementVNode("div",Fce,e.toDisplayString(Nr.score[0])+" - "+e.toDisplayString(Nr.score[1]),1),e.createElementVNode("div",Uce,[e.createElementVNode("img",{src:Nr.visiting_team_logo,alt:""},null,8,Ice)]),e.createElementVNode("div",qce,e.toDisplayString(Nr.home_team_acronym),1),e.createElementVNode("div",jce,e.toDisplayString(Nr.matchDay?(Ir=Nr.matchDay)==null?void 0:Ir.matchDayAbbreviation:""),1),e.createElementVNode("div",Dce,e.toDisplayString(Nr.visiting_team_acronym),1)],10,Pce)}),128))],6),ne.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"carousel-arrow right",onClick:D}," › ")):e.createCommentVNode("",!0)],544))]),e.createElementVNode("div",Wce,[e.createElementVNode("div",{class:"segmented-highlight",style:e.normalizeStyle({width:`calc(100% / ${f.length})`,left:`calc(${f.indexOf(i.value)} * (100% / ${f.length}))`})},null,4),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(f,Nr=>e.createElementVNode("button",{key:Nr,class:e.normalizeClass(["categoria-tab",{active:i.value===Nr}]),onClick:Ir=>i.value=Nr},e.toDisplayString(Nr),11,Bce)),64))]),e.createElementVNode("div",Kce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,Nr=>{var Ir,ln;return e.openBlock(),e.createElementBlock("div",{key:Nr.play_id,class:e.normalizeClass(["corner-item",{selected:Nr.isSelected,disabled:Nr.disabled}]),onClick:Nn=>st(Nr)},[e.createElementVNode("div",Gce,[e.createVNode(e.unref(lce),{modelValue:Nr.isSelected,"onUpdate:modelValue":Nn=>Nr.isSelected=Nn,"avoid-interaction":!0},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("div",Zce,[e.createElementVNode("div",Jce,e.toDisplayString(Nr.mainIndex)+"/"+e.toDisplayString((ln=(Ir=ir.value)==null?void 0:Ir.corners)==null?void 0:ln.length),1)]),e.createElementVNode("div",Hce,[e.createElementVNode("div",Yce,[e.createElementVNode("span",Qce,e.toDisplayString(Nr.formattedMomentOfPlay),1),$ce,e.createElementVNode("span",tue,"| "+e.toDisplayString(Nr.player.firstNameAndFirstLastName),1)]),e.createElementVNode("div",eue,[e.createElementVNode("span",null,e.toDisplayString(Nr.howWasCornerName),1),rue,e.createElementVNode("span",null,e.toDisplayString(Nr.whatHappenedName),1)])])],10,Xce)}),128))])]),e.createElementVNode("div",nue,[d.value.length>0?(e.openBlock(),e.createElementBlock("div",aue,[e.createElementVNode("div",iue,e.toDisplayString(d.value.length)+"/10",1)])):e.createCommentVNode("",!0),k.value.length>0?(e.openBlock(),e.createElementBlock("div",oue,[e.createElementVNode("div",{class:"carousel-container",ref_key:"carouselContainerRef",ref:T},[e.createElementVNode("div",sue,e.toDisplayString(k.value.length)+" / "+e.toDisplayString(t.teamViews.length),1),e.createElementVNode("div",{ref_key:"carouselTrackRef",ref:b,class:"carousel-track"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,Nr=>{var Ir;return e.openBlock(),e.createElementBlock("div",{key:Nr.play_id,class:"footer-pill"},[e.createElementVNode("div",lue,[e.createElementVNode("div",cue,[e.createElementVNode("div",uue,[e.createElementVNode("img",{src:Nr.game.home_team_logo,alt:""},null,8,due)]),e.createElementVNode("div",pue,e.toDisplayString(Nr.game.score[0]),1)]),e.createElementVNode("div",hue,[e.createElementVNode("div",fue,[e.createElementVNode("img",{src:Nr.game.visiting_team_logo,alt:""},null,8,mue)]),e.createElementVNode("div",yue,e.toDisplayString(Nr.game.score[1]),1)])]),e.createElementVNode("div",gue,[e.createElementVNode("div",vue,[e.createElementVNode("span",bue,e.toDisplayString(Nr.game.matchDay?(Ir=Nr.game.matchDay)==null?void 0:Ir.matchDayAbbreviation:"")+" - "+e.toDisplayString(Nr.formattedMomentOfPlay),1),xue,e.createElementVNode("span",_ue,e.toDisplayString(Nr.player.firstNameAndFirstLastName),1)]),e.createElementVNode("div",wue,[e.createElementVNode("span",null,e.toDisplayString(Nr.howWasCornerName),1),Tue,e.createElementVNode("span",null,e.toDisplayString(Nr.whatHappenedName),1)])]),e.createElementVNode("button",{class:"pill-remove-btn",onClick:ln=>bt(Nr)},"×",8,Sue)])}),128))],512),h.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"carousel-arrow left",onClick:V},"‹")):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"carousel-arrow right",onClick:P},"›")):e.createCommentVNode("",!0)],512)])):(e.openBlock(),e.createElementBlock("div",kue,[e.createElementVNode("span",Lue,e.toDisplayString(d.value.length)+" de "+e.toDisplayString(t.teamViews.length)+" Tiros de esquina agregados",1)]))])]))}},[["__scopeId","data-v-7f431c81"]]),Kb=t=>(e.pushScopeId("data-v-2c61f141"),t=t(),e.popScopeId(),t),Mue={class:"modal-overlay"},Vue={class:"modal-content"},Pue={class:"modal-header"},Aue={class:"header-left"},Rue=Kb(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report-white.svg",class:"icon-title",alt:"icono reporte blanco"},null,-1)),Fue={class:"modal-title"},Uue={class:"prepartido-text"},Iue={class:"step-counter"},que=Kb(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),jue={key:0,class:"step-content"},Due={key:0,class:"content-section"},Wue=Kb(()=>e.createElementVNode("h3",{class:"section-title"},"Fortalezas",-1)),Bue=Kb(()=>e.createElementVNode("div",{class:"title-separator"},null,-1)),Kue={class:"section-description"},Xue=Kb(()=>e.createElementVNode("div",{class:"content-separator"},null,-1)),Gue={class:"radio-group"},Zue={class:"radio-option"},Jue=Kb(()=>e.createElementVNode("span",{class:"radio-custom"},null,-1)),Hue=Kb(()=>e.createElementVNode("span",{class:"radio-label"},"Automáticamente",-1)),Yue={class:"radio-option"},Que=Kb(()=>e.createElementVNode("span",{class:"radio-custom"},null,-1)),$ue=Kb(()=>e.createElementVNode("span",{class:"radio-label"},"Manualmente",-1)),tde={key:1,class:"content-section"},ede=Kb(()=>e.createElementVNode("h3",{class:"section-title"},"Tiros de esquina",-1)),rde=Kb(()=>e.createElementVNode("div",{class:"title-separator"},null,-1)),nde={class:"section-description"},ade=Kb(()=>e.createElementVNode("div",{class:"content-separator"},null,-1)),ide={class:"radio-group"},ode={class:"radio-option"},sde=Kb(()=>e.createElementVNode("span",{class:"radio-custom"},null,-1)),lde=Kb(()=>e.createElementVNode("span",{class:"radio-label"},"Automáticamente",-1)),cde={class:"radio-option"},ude=Kb(()=>e.createElementVNode("span",{class:"radio-custom"},null,-1)),dde=Kb(()=>e.createElementVNode("span",{class:"radio-label"},"Manualmente",-1)),pde={key:1,class:"step-content"},hde={key:2,class:"step-content"},fde={key:3,class:"step-content"},mde={key:4,class:"step-content"},yde={key:5,class:"step-content"},gde={key:6,class:"step-content"},vde=Kb(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),bde={class:"modal-footer"},xde=Kb(()=>e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 12L6 8L10 4",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),_de={class:"footer-actions"},wde=["disabled"],Tde=e.createStaticVNode('<div class="modal-header" data-v-2c61f141><div class="header-left" data-v-2c61f141><span class="modal-title" data-v-2c61f141>Confirmación</span></div></div><div class="header-separator" data-v-2c61f141></div><div class="modal-body" data-v-2c61f141><div class="step-content" data-v-2c61f141><h3 class="confirm-dialog-title" data-v-2c61f141>¿Estás seguro de regresar?</h3><p class="confirm-dialog-message" data-v-2c61f141>Se perderá la información seleccionada</p></div></div>',3),Sde=ov({__name:"ModalConfigurarContenido",props:{hasRival:{type:Boolean,default:!0},token:{type:String,required:!0},template:{type:Object,required:!1,default:null},team:{type:Number,required:!1,default:null},partido:{type:Object,required:!1,default:null},configData:{type:Object,default:null}},emits:["close","back","next"],setup(t,{emit:r}){const n=r,y=t;function $(){if(!y.template||!y.template.pages)return!1;for(const Jt of y.template.pages)if(Jt.components&&Array.isArray(Jt.components)&&Jt.components.some(ne=>ne.title==="Fortalezas"||ne.id===15||ne.componentName==="GSCStrengths"))return!0;return!1}function f(){if(!y.template||!y.template.pages)return{equipo:0,rival:0,total:0};let Jt=0,te=0;for(const ne of y.template.pages)if(ne.components&&Array.isArray(ne.components)){const Le=ne.components.filter(Oe=>Oe.componentName==="GSCStrengths"||Oe.id===15||Oe.name==="Fortalezas");for(const Oe of Le)Oe.dynamicFilters&&Array.isArray(Oe.dynamicFilters)&&Oe.dynamicFilters[1]&&(Oe.dynamicFilters[0]===1?Jt+=Oe.dynamicFilters[1]:Oe.dynamicFilters[0]===2?te+=Oe.dynamicFilters[1]:Oe.dynamicFilters[0]===3&&(Oe.filterMultiple.isHomeTeam?Jt+=Oe.dynamicFilters[1]:te+=Oe.dynamicFilters[1]))}return{equipo:Jt,rival:te,total:Jt+te}}const u=e.computed(()=>$()),i=e.computed(()=>f()),d=e.computed(()=>!y.template||!y.template.template_type||y.template.template_type===1?"Prepartido":"Postpartido"),l=e.computed(()=>{var ne,Le,Oe,Ne,Pe,Xe,He,$e,ir,pr,tr,Fe,sr,Ye,Te,Re,Ve,br,cr,gr,Tr,Pr;const Jt=((ne=y.partido)==null?void 0:ne.local)||((Le=y.partido)==null?void 0:Le.home_team),te=((Oe=y.partido)==null?void 0:Oe.visita)||((Ne=y.partido)==null?void 0:Ne.visiting_team);return y.team===Jt?((Xe=(Pe=y.configData)==null?void 0:Pe.partido)==null?void 0:Xe.home_team_name)||(($e=(He=y.configData)==null?void 0:He.partido)==null?void 0:$e.home_team_acronym)||((ir=y.partido)==null?void 0:ir.home_team_name)||((pr=y.partido)==null?void 0:pr.home_team_acronym)||"mi equipo":y.team===te?((Fe=(tr=y.configData)==null?void 0:tr.partido)==null?void 0:Fe.visiting_team_name)||((Ye=(sr=y.configData)==null?void 0:sr.partido)==null?void 0:Ye.visiting_team_acronym)||((Te=y.partido)==null?void 0:Te.visiting_team_name)||((Re=y.partido)==null?void 0:Re.visiting_team_acronym)||"mi equipo":((br=(Ve=y.configData)==null?void 0:Ve.partido)==null?void 0:br.home_team_name)||((gr=(cr=y.configData)==null?void 0:cr.partido)==null?void 0:gr.home_team_acronym)||((Tr=y.partido)==null?void 0:Tr.home_team_name)||((Pr=y.partido)==null?void 0:Pr.home_team_acronym)||"mi equipo"}),a=e.computed(()=>{var ne,Le,Oe,Ne,Pe,Xe,He,$e,ir,pr,tr,Fe,sr,Ye,Te,Re,Ve,br,cr,gr,Tr,Pr;const Jt=((ne=y.partido)==null?void 0:ne.local)||((Le=y.partido)==null?void 0:Le.home_team),te=((Oe=y.partido)==null?void 0:Oe.visita)||((Ne=y.partido)==null?void 0:Ne.visiting_team);return y.team===Jt?((Xe=(Pe=y.configData)==null?void 0:Pe.partido)==null?void 0:Xe.visiting_team_name)||(($e=(He=y.configData)==null?void 0:He.partido)==null?void 0:$e.visiting_team_acronym)||((ir=y.partido)==null?void 0:ir.visiting_team_name)||((pr=y.partido)==null?void 0:pr.visiting_team_acronym)||"el rival":y.team===te?((Fe=(tr=y.configData)==null?void 0:tr.partido)==null?void 0:Fe.home_team_name)||((Ye=(sr=y.configData)==null?void 0:sr.partido)==null?void 0:Ye.home_team_acronym)||((Te=y.partido)==null?void 0:Te.home_team_name)||((Re=y.partido)==null?void 0:Re.home_team_acronym)||"el rival":((br=(Ve=y.configData)==null?void 0:Ve.partido)==null?void 0:br.visiting_team_name)||((gr=(cr=y.configData)==null?void 0:cr.partido)==null?void 0:gr.visiting_team_acronym)||((Tr=y.partido)==null?void 0:Tr.visiting_team_name)||((Pr=y.partido)==null?void 0:Pr.visiting_team_acronym)||"el rival"}),S=e.computed(()=>{var ne,Le,Oe,Ne;const Jt=((ne=y.partido)==null?void 0:ne.local)||((Le=y.partido)==null?void 0:Le.home_team),te=((Oe=y.partido)==null?void 0:Oe.visita)||((Ne=y.partido)==null?void 0:Ne.visiting_team);return y.team===Jt?Jt:y.team===te?te:Jt}),T=e.computed(()=>{var ne,Le,Oe,Ne;const Jt=((ne=y.partido)==null?void 0:ne.local)||((Le=y.partido)==null?void 0:Le.home_team),te=((Oe=y.partido)==null?void 0:Oe.visita)||((Ne=y.partido)==null?void 0:Ne.visiting_team);return y.team===Jt?te:y.team===te?Jt:te}),b=e.computed({get(){var Le,Oe,Ne,Pe;const Jt=((Le=y.partido)==null?void 0:Le.local)||((Oe=y.partido)==null?void 0:Oe.home_team),te=((Ne=y.partido)==null?void 0:Ne.visita)||((Pe=y.partido)==null?void 0:Pe.visiting_team);return y.team===Jt||y.team===te,V.value},set(Jt){var Oe,Ne,Pe,Xe;const te=((Oe=y.partido)==null?void 0:Oe.local)||((Ne=y.partido)==null?void 0:Ne.home_team),ne=((Pe=y.partido)==null?void 0:Pe.visita)||((Xe=y.partido)==null?void 0:Xe.visiting_team),Le=y.team===te||y.team===ne;V.value=Jt}}),p=e.computed({get(){var Le,Oe,Ne,Pe;const Jt=((Le=y.partido)==null?void 0:Le.local)||((Oe=y.partido)==null?void 0:Oe.home_team),te=((Ne=y.partido)==null?void 0:Ne.visita)||((Pe=y.partido)==null?void 0:Pe.visiting_team);return y.team===Jt||y.team===te,I.value},set(Jt){var Oe,Ne,Pe,Xe;const te=((Oe=y.partido)==null?void 0:Oe.local)||((Ne=y.partido)==null?void 0:Ne.home_team),ne=((Pe=y.partido)==null?void 0:Pe.visita)||((Xe=y.partido)==null?void 0:Xe.visiting_team),Le=y.team===te||y.team===ne;I.value=Jt}}),s=e.computed(()=>{var ne,Le,Oe,Ne;const Jt=((ne=y.partido)==null?void 0:ne.local)||((Le=y.partido)==null?void 0:Le.home_team),te=((Oe=y.partido)==null?void 0:Oe.visita)||((Ne=y.partido)==null?void 0:Ne.visiting_team);return y.team===Jt?mt.value:y.team===te?yt.value:mt.value}),c=e.computed(()=>{var ne,Le,Oe,Ne;const Jt=((ne=y.partido)==null?void 0:ne.local)||((Le=y.partido)==null?void 0:Le.home_team),te=((Oe=y.partido)==null?void 0:Oe.visita)||((Ne=y.partido)==null?void 0:Ne.visiting_team);return y.team===Jt?yt.value:y.team===te?mt.value:yt.value}),o=e.computed(()=>{if(y.template){const Jt={homeTeamViews:[],homeTeamAgainstViews:[],awayTeamViews:[],awayTeamAgainstViews:[]};for(const te of y.template.pages)if(te.components&&Array.isArray(te.components))for(const ne of te.components)ne.coreView&&ne.coreView.id===18&&(ne.isHomeTeam?ne.componentProps&&ne.componentProps.isAgainstMode?Jt.homeTeamAgainstViews.push(ne):Jt.homeTeamViews.push(ne):ne.componentProps&&ne.componentProps.isAgainstMode?Jt.awayTeamAgainstViews.push(ne):Jt.awayTeamViews.push(ne));if(Jt.homeTeamViews.length>0||Jt.homeTeamAgainstViews.length>0||Jt.awayTeamViews.length>0||Jt.awayTeamAgainstViews.length>0)return Jt}return null}),h=e.ref(0),v=e.ref([1,2,3,4,5]),k=e.ref(!1),L=e.ref(!1),E=e.ref("manual"),P=e.ref("manual"),V=e.ref([]),I=e.ref([]),j=e.ref([]),F=e.ref([]),D=e.ref([]),U=e.ref([]),M=e.ref({cornersEquipo:[],cornersEquipoAgainst:[],cornersRival:[],cornersRivalAgainst:[]}),X=e.computed(()=>{let Jt=0;return u.value&&E.value==="manual"&&(i.value.equipo>0&&(Jt+=1),i.value.rival>0&&(Jt+=1)),o.value&&P.value==="manual"&&(o.value.homeTeamViews.length>0&&(Jt+=1),o.value.homeTeamAgainstViews.length>0&&(Jt+=1),o.value.awayTeamViews.length>0&&(Jt+=1),o.value.awayTeamAgainstViews.length>0&&(Jt+=1)),Math.max(Jt,1)}),O=e.computed(()=>{var ne,Le;if(h.value===0)return u.value||!!o.value;const te=st()[h.value];if(u.value&&te==="fortalezasEquipo"){const Oe=s.value;if(!Oe)return!1;const Ne=b.value.length,Pe=i.value.equipo,Xe=((ne=Oe.fortalezasData)==null?void 0:ne.length)||0;return Ne===Pe||Xe>0&&Xe<Pe&&Ne===Xe}if(u.value&&te==="fortalezasRival"){const Oe=c.value;if(!Oe)return!1;const Ne=p.value.length,Pe=i.value.rival,Xe=((Le=Oe.fortalezasData)==null?void 0:Le.length)||0;return Ne===Pe||Xe>0&&Xe<Pe&&Ne===Xe}if(o.value){if(te==="cornersEquipo"){if(!bt.value)return!1;const Ne=j.value.length,Pe=o.value.homeTeamViews.length,Xe=M.value.cornersEquipo.length;return Ne===Pe||Ne===Xe}if(te==="cornersEquipoAgainst"){if(!xt.value)return!1;const Ne=F.value.length,Pe=o.value.homeTeamAgainstViews.length,Xe=M.value.cornersEquipoAgainst.length;return console.log("canContinue cornersEquipoAgainst:",{selected:Ne,totalRequerido:Pe,availableCorners:Xe}),Ne===Pe||Ne===Xe}if(te==="cornersRival"){if(!Pt.value)return!1;const Ne=D.value.length,Pe=o.value.awayTeamViews.length,Xe=M.value.cornersRival.length;return Ne===Pe||Ne===Xe}if(te==="cornersRivalAgainst"){if(!qt.value)return!1;const Ne=U.value.length,Pe=o.value.awayTeamAgainstViews.length,Xe=M.value.cornersRivalAgainst.length;return Ne===Pe||Ne===Xe}}return!1});function Y(Jt,te){M.value[te]=Jt}function st(){const Jt=[];u.value&&E.value==="manual"&&(i.value.equipo>0&&Jt.push("fortalezasEquipo"),i.value.rival>0&&Jt.push("fortalezasRival")),o.value&&P.value==="manual"&&(o.value.homeTeamViews.length>0&&Jt.push("cornersEquipo"),o.value.homeTeamAgainstViews.length>0&&Jt.push("cornersEquipoAgainst"),o.value.awayTeamViews.length>0&&Jt.push("cornersRival"),o.value.awayTeamAgainstViews.length>0&&Jt.push("cornersRivalAgainst"));const te={};return Jt.forEach((ne,Le)=>{te[Le+1]=ne}),te}const mt=e.ref(null),yt=e.ref(null),bt=e.ref(null),xt=e.ref(null),Pt=e.ref(null),qt=e.ref(null);function _t(){n("close")}function It(){h.value>1?h.value--:h.value===1?V.value.length>0||I.value.length>0?L.value=!0:h.value--:n("back")}function jt(){V.value=[],I.value=[],j.value=[],D.value=[],L.value=!1,h.value--}function Rt(){L.value=!1}async function Wt(){if(h.value===0){if(!O.value)return;if(u.value&&E.value==="automatico"&&o.value&&P.value==="automatico"||!u.value&&o.value&&P.value==="automatico"||u.value&&E.value==="automatico"&&!o.value){n("next",{fortalezas:E.value,tirosEsquina:P.value,selectedFortalezasEquipo:[],selectedFortalezasRival:[],strengthsPayload:{}});return}k.value=!0,setTimeout(()=>{h.value++,k.value=!1},300)}else if(h.value<X.value)k.value=!0,setTimeout(()=>{h.value++,k.value=!1},300);else{await e.nextTick();let Jt={},te=[];u.value&&E.value==="manual"&&(Jt=re()),o.value&&P.value==="manual"&&(te=le()),n("next",{fortalezas:E.value,tirosEsquina:P.value,selectedFortalezasEquipo:V.value,selectedFortalezasRival:I.value,strengthsPayload:Jt,specificPlaysPayload:te})}}function re(){if(!y.template||!y.template.pages)return{};const Jt={};let te=mt.value,ne=yt.value;if(te){let Xe=te.fortalezasRawData;Xe&&typeof Xe=="object"&&"value"in Xe&&(Xe=Xe.value)}if(ne){let Xe=ne.fortalezasRawData;Xe&&typeof Xe=="object"&&"value"in Xe&&(Xe=Xe.value)}!te&&V.value.length>0&&console.warn("⚠️ Ref de equipo no disponible, pero hay selecciones"),!ne&&I.value.length>0&&console.warn("⚠️ Ref de rival no disponible, pero hay selecciones");const Le=he(V.value,te),Oe=he(I.value,ne);let Ne=0,Pe=0;return y.template.pages.forEach((Xe,He)=>{const $e=He+1;Xe.components&&Array.isArray(Xe.components)&&Xe.components.forEach((ir,pr)=>{var Fe,sr,Ye,Te,Re,Ve,br,cr;if(ir.componentName==="GSCStrengths"||ir.id===15||ir.name==="Fortalezas"||ir.title==="Fortalezas"){const gr=pr+1;if(ir.dynamicFilters&&Array.isArray(ir.dynamicFilters)){const Tr=ir.dynamicFilters[0],Pr=ir.dynamicFilters[1]||0;let qe=[],Ge=[],Je=y.team;Tr===1?(Ge=Le,Ge.length>Ne&&(qe=Ge.slice(Ne,Ne+Pr)),Ne+=Pr,Je=((Fe=y.partido)==null?void 0:Fe.local)||((sr=y.partido)==null?void 0:sr.home_team)||y.team):Tr===2?(Ge=Oe,Ge.length>Pe&&(qe=Ge.slice(Pe,Pe+Pr)),Pe+=Pr,Je=((Ye=y.partido)==null?void 0:Ye.visita)||((Te=y.partido)==null?void 0:Te.visiting_team)):Tr===3&&(ir.filterMultiple&&ir.filterMultiple.isHomeTeam?(Ge=Le,Ge.length>Ne&&(qe=Ge.slice(Ne,Ne+Pr)),Ne+=Pr,Je=((Re=y.partido)==null?void 0:Re.local)||((Ve=y.partido)==null?void 0:Ve.home_team)||y.team):(Ge=Oe,Ge.length>Pe&&(qe=Ge.slice(Pe,Pe+Pr)),Pe+=Pr,Je=((br=y.partido)==null?void 0:br.visita)||((cr=y.partido)==null?void 0:cr.visiting_team))),qe.length>0&&(Jt[$e]||(Jt[$e]={}),Jt[$e][gr]||(Jt[$e][gr]=[]),qe.forEach((hr,Nr)=>{Jt[$e][gr].push({team_id:Je,ranking_type:hr.ranking_type||1,precondition_id:hr.precondition_id||null,order:Nr+1,name:hr.name,category_type:hr.category_type||1,total:hr.total||0,is_relevant:hr.is_relevant||0,league_ranking:hr.league_ranking||0,categories:Array.isArray(hr.categories)?hr.categories:[hr.categories],team_contribution:hr.team_contribution||0})}))}}})}),Jt}function le(){let Jt=[];return Jt=[...j.value,...F.value,...D.value,...U.value].map(ne=>({play_id:ne.play_id,game_id:ne.game.game_id,team_id:ne.isAgainst?ne.game.home_team===ne.team_id?ne.game.visiting_team:ne.game.home_team:ne.team_id,is_against:ne.isAgainst?1:0})),Jt}function he(Jt,te){if(console.log("=== getOrderedStrengths INICIO ==="),console.log("selectedIds (orden de selección):",Jt),console.log("fortalezasViewRef existe?:",!!te),!Jt||Jt.length===0)return console.warn("No hay IDs seleccionados"),[];if(!te)return console.warn("Ref no disponible"),[];let ne=te.fortalezasRawData;if(!ne)return console.warn("fortalezasRawData no está disponible en el ref"),[];if(ne&&typeof ne=="object"&&"value"in ne&&(console.log("⚠️ fortalezasRawData es un ref, accediendo a .value"),ne=ne.value),!Array.isArray(ne))return console.warn("fortalezasRawData no es un array:",typeof ne,ne),[];if(ne.length===0)return console.warn("fortalezasRawData está vacío"),[];console.log("fortalezasRawData length:",ne.length),console.log("Primeras 2 fortalezas raw:",ne.slice(0,2));const Le=Jt.map(Oe=>{console.log(`Buscando ID: ${Oe} (tipo: ${typeof Oe})`);const Ne=ne.find(Xe=>{const He=Xe.categories===Oe||Xe.categories===Number(Oe)||String(Xe.categories)===String(Oe);return!He&&ne.indexOf(Xe)<3&&console.log(` Comparando: item.categories=${Xe.categories} (${typeof Xe.categories}) vs id=${Oe} (${typeof Oe})`),He});if(Ne)return console.log(`✓ Encontrada: ${Ne.name} (categories: ${Ne.categories})`),Ne;console.warn(`✗ No encontrada con categories = ${Oe}, intentando por id`);const Pe=ne.find(Xe=>Xe.id===Oe||Xe.id===Number(Oe)||String(Xe.id)===String(Oe));return Pe?(console.log(`✓ Encontrada por id: ${Pe.name}`),Pe):(console.error(`✗✗ No se encontró fortaleza con id/categories = ${Oe}`),null)}).filter(Boolean);return console.log(`selectedStrengths (${Le.length} de ${Jt.length} encontradas):`,Le),console.log("=== getOrderedStrengths FIN ==="),Le}function de(){const te=st()[h.value];if(te==="fortalezasEquipo"&&mt.value)return mt.value.autocompletar();if(te==="fortalezasRival"&&yt.value)return yt.value.autocompletar();if(te==="cornersEquipo"&&bt.value)return bt.value.autocompletar();if(te==="cornersEquipoAgainst"&&xt.value)return xt.value.autocompletar();if(te==="cornersRival"&&Pt.value)return Pt.value.autocompletar();if(te==="cornersRivalAgainst"&&qt.value)return qt.value.autocompletar()}return(Jt,te)=>{var ne,Le,Oe,Ne,Pe,Xe,He,$e;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Mue,[e.createElementVNode("div",Vue,[e.createElementVNode("div",Pue,[e.createElementVNode("div",Aue,[Rue,e.createElementVNode("span",Fue,[e.createTextVNode("Generar reporte  -   "),e.createElementVNode("span",Uue,e.toDisplayString(d.value),1)])]),e.createElementVNode("div",Iue," Paso "+e.toDisplayString(h.value===0?1:h.value)+" de "+e.toDisplayString(X.value),1)]),que,e.createElementVNode("div",{class:e.normalizeClass(["modal-body",{transitioning:k.value}])},[h.value===0?(e.openBlock(),e.createElementBlock("div",jue,[u.value?(e.openBlock(),e.createElementBlock("div",Due,[Wue,Bue,e.createElementVNode("p",Kue," Este template contiene "+e.toDisplayString(i.value.equipo)+" visualizaciones de Fortalezas de tu equipo y "+e.toDisplayString(i.value.rival)+" de tu rival. ¿Cómo prefieres que se agregue este contenido? ",1),Xue,e.createElementVNode("div",Gue,[e.createElementVNode("label",Zue,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"fortalezas",value:"automatico","onUpdate:modelValue":te[0]||(te[0]=ir=>E.value=ir)},null,512),[[e.vModelRadio,E.value]]),Jue,Hue]),e.createElementVNode("label",Yue,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"fortalezas",value:"manual","onUpdate:modelValue":te[1]||(te[1]=ir=>E.value=ir)},null,512),[[e.vModelRadio,E.value]]),Que,$ue])])])):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",tde,[ede,rde,e.createElementVNode("p",nde," Este template contiene "+e.toDisplayString(o.value.homeTeamViews.length)+" visualizaciones de Tiros de esquina de tu equipo y "+e.toDisplayString(o.value.awayTeamViews.length)+" visualizaciones de tu rival. ¿Cómo prefieres que se agregue este contenido? ",1),ade,e.createElementVNode("div",ide,[e.createElementVNode("label",ode,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"tiros-esquina",value:"automatico","onUpdate:modelValue":te[2]||(te[2]=ir=>P.value=ir)},null,512),[[e.vModelRadio,P.value]]),sde,lde]),e.createElementVNode("label",cde,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"tiros-esquina",value:"manual","onUpdate:modelValue":te[3]||(te[3]=ir=>P.value=ir)},null,512),[[e.vModelRadio,P.value]]),ude,dde])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),i.value.equipo>0?e.withDirectives((e.openBlock(),e.createElementBlock("div",pde,[e.createVNode(NJ,{key:"fortalezas-equipo",modelValue:b.value,"onUpdate:modelValue":te[4]||(te[4]=ir=>b.value=ir),"team-initials":"AME","season-id":(ne=y.partido)==null?void 0:ne.season_id,"team-id":S.value,"rival-team-id":T.value,"game-id":((Le=y.partido)==null?void 0:Le.game_id)||((Oe=y.partido)==null?void 0:Oe.id),token:y.token,"template-type":((Ne=y.template)==null?void 0:Ne.template_type)||1,title:`Fortalezas a favor de ${l.value}`,"total-fortalezas":i.value.equipo,ref_key:"fortalezasEquipoRef",ref:mt},null,8,["modelValue","season-id","team-id","rival-team-id","game-id","token","template-type","title","total-fortalezas"])],512)),[[e.vShow,st()[h.value]==="fortalezasEquipo"]]):e.createCommentVNode("",!0),i.value.rival>0?e.withDirectives((e.openBlock(),e.createElementBlock("div",hde,[e.createVNode(NJ,{key:"fortalezas-rival",modelValue:p.value,"onUpdate:modelValue":te[5]||(te[5]=ir=>p.value=ir),"team-initials":"RIV","season-id":(Pe=y.partido)==null?void 0:Pe.season_id,"team-id":T.value,"rival-team-id":S.value,"game-id":((Xe=y.partido)==null?void 0:Xe.game_id)||((He=y.partido)==null?void 0:He.id),token:y.token,"template-type":(($e=y.template)==null?void 0:$e.template_type)||1,title:`Fortalezas a favor de ${a.value}`,"total-fortalezas":i.value.rival,ref_key:"fortalezasRivalRef",ref:yt},null,8,["modelValue","season-id","team-id","rival-team-id","game-id","token","template-type","title","total-fortalezas"])],512)),[[e.vShow,st()[h.value]==="fortalezasRival"]]):e.createCommentVNode("",!0),o.value&&o.value.homeTeamViews.length>0?e.withDirectives((e.openBlock(),e.createElementBlock("div",fde,[e.createVNode(qO,{modelValue:j.value,"onUpdate:modelValue":te[6]||(te[6]=ir=>j.value=ir),"team-views":o.value.homeTeamViews,"is-rival":!1,"is-against-mode":!1,title:"Tiros de esquina de mi equipo","team-logo-url":t.configData.partido.localLogo,"config-data":t.configData,"user-team-id":t.team,ref_key:"cornersEquipoRef",ref:bt,onCornersFetched:te[7]||(te[7]=ir=>Y(ir,"cornersEquipo"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[e.vShow,st()[h.value]==="cornersEquipo"]]):e.createCommentVNode("",!0),o.value&&o.value.homeTeamAgainstViews.length>0?e.withDirectives((e.openBlock(),e.createElementBlock("div",mde,[e.createVNode(qO,{modelValue:F.value,"onUpdate:modelValue":te[8]||(te[8]=ir=>F.value=ir),"team-views":o.value.homeTeamAgainstViews,"is-rival":!1,"is-against-mode":!0,title:"Tiros de esquina en contra de mi equipo","team-logo-url":t.configData.partido.localLogo,"config-data":t.configData,"user-team-id":t.team,ref_key:"cornersEquipoAgainstRef",ref:xt,onCornersFetched:te[9]||(te[9]=ir=>Y(ir,"cornersEquipoAgainst"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[e.vShow,st()[h.value]==="cornersEquipoAgainst"]]):e.createCommentVNode("",!0),o.value&&o.value.awayTeamViews.length>0?e.withDirectives((e.openBlock(),e.createElementBlock("div",yde,[e.createVNode(qO,{modelValue:D.value,"onUpdate:modelValue":te[10]||(te[10]=ir=>D.value=ir),"is-rival":!0,"is-against-mode":!1,"team-views":o.value.awayTeamViews,title:"Tiros de esquina en contra del rival","team-logo-url":t.configData.partido.visitanteLogo,"config-data":t.configData,"user-team-id":t.team,ref_key:"cornersRivalRef",ref:Pt,onCornersFetched:te[11]||(te[11]=ir=>Y(ir,"cornersRival"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[e.vShow,st()[h.value]==="cornersRival"]]):e.createCommentVNode("",!0),o.value&&o.value.awayTeamAgainstViews.length>0?e.withDirectives((e.openBlock(),e.createElementBlock("div",gde,[e.createVNode(qO,{modelValue:U.value,"onUpdate:modelValue":te[12]||(te[12]=ir=>U.value=ir),"is-rival":!0,"is-against-mode":!0,"team-views":o.value.awayTeamAgainstViews,title:"Tiros de esquina en contra del rival","team-logo-url":t.configData.partido.visitanteLogo,"config-data":t.configData,"user-team-id":t.team,ref_key:"cornersRivalAgainstRef",ref:qt,onCornersFetched:te[13]||(te[13]=ir=>Y(ir,"cornersRivalAgainst"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[e.vShow,st()[h.value]==="cornersRivalAgainst"]]):e.createCommentVNode("",!0)],2),vde,e.createElementVNode("div",bde,[e.createElementVNode("button",{class:"back-btn",onClick:It},[xde,e.createTextVNode(" Regresar ")]),e.createElementVNode("div",_de,[h.value===0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"cancel-btn",onClick:_t},"Cancelar")):e.createCommentVNode("",!0),v.value.includes(h.value)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"cancel-btn",onClick:de}," Autocompletar ")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["next-btn",{disabled:!O.value}]),disabled:!O.value,onClick:Wt},e.toDisplayString(h.value===0?u.value&&o.value?E.value==="automatico"&&P.value==="automatico"?"Finalizar":"Siguiente":u.value?E.value==="automatico"?"Finalizar":"Siguiente":o.value?P.value==="automatico"?"Finalizar":"Siguiente":"Finalizar":h.value===X.value?"Finalizar":"Siguiente"),11,wde)])])])]),L.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-overlay",onClick:e.withModifiers(Rt,["self"])},[e.createElementVNode("div",{class:"modal-content confirm-dialog"},[Tde,e.createElementVNode("div",{class:"modal-footer"},[e.createElementVNode("div",{class:"footer-actions"},[e.createElementVNode("button",{class:"cancel-btn",onClick:Rt},"Cancelar"),e.createElementVNode("button",{class:"next-btn",onClick:jt},"Confirmar")])])])])):e.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-2c61f141"]]),jO=t=>(e.pushScopeId("data-v-bb310f7c"),t=t(),e.popScopeId(),t),kde={class:"templates-header"},Lde={class:"count"},Cde={key:0,class:"sort-options"},Nde=["onClick"],Ode={key:0,class:"checkmark"},Ede=[jO(()=>e.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],zde={key:0,class:"loading-state"},Mde=[jO(()=>e.createElementVNode("div",{class:"loading-spinner"},null,-1)),jO(()=>e.createElementVNode("p",null,"Cargando templates...",-1))],Vde=[jO(()=>e.createElementVNode("div",{class:"inner-card"},[e.createElementVNode("div",{class:"plus"},[e.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-add@3x.png",alt:"Agregar"})]),e.createElementVNode("div",{class:"create-text"},"Crear Template")],-1))],Pde=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(t,{expose:r,emit:n}){const y=n,$=t,f=e.ref(!1),u=e.ref(null),i=e.ref(!1),d=e.ref(!1),l=e.ref(!1),a=e.ref(!1),S=e.ref(!1),T=e.ref(!1),b=e.ref(null),p=e.ref(!1),s=e.ref(""),c=e.ref(""),o=e.ref(""),h=e.ref(""),v=e.ref(""),k=e.ref(""),L=e.ref(""),E=e.ref(""),P=e.ref(""),V=e.ref(null),I=e.ref(null),j=e.ref(null),F=e.ref(null),D=e.ref(0),U=e.ref([]),M=e.ref(!1),X=e.ref(null);e.watch([()=>$.team,()=>$.token],()=>{$.team&&$.token&&Y()},{immediate:!1});const O=[{label:"A - Z",value:"name-asc"},{label:"Más recientes",value:"date-desc"}],Y=async()=>{try{M.value=!0,X.value=null;const he=await M0.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates/teams/${$.team}`,{headers:{Authorization:`${$.token}`,"Content-Type":"application/json"}});he.data&&Array.isArray(he.data)?U.value=he.data:he.data&&he.data.templates?U.value=he.data.templates:he.data&&he.data.data?U.value=he.data.data:U.value=[]}catch(he){console.error("Error al obtener templates:",he),console.error("Error response:",he.response),X.value=he.message||"Error al cargar los templates",U.value=[]}finally{M.value=!1}},st=e.computed(()=>{if(!U.value.length)return[];let he=[...U.value];if($.searchQuery.trim()){const de=$.searchQuery.toLowerCase().trim();he=he.filter(Jt=>Jt.name.toLowerCase().includes(de))}switch(u.value){case"name-asc":return he.sort((de,Jt)=>de.name.localeCompare(Jt.name));case"date-desc":return he.sort((de,Jt)=>new Date(Jt.created_at)-new Date(de.created_at));default:return he}}),mt=e.computed(()=>{if(!D.value)return"grid-1-column";const he=340,de=20,te=D.value-40,ne=Math.floor((te+de)/(he+de)),Le=Math.max(1,ne);return Le>=4?"grid-4-columns":Le>=3?"grid-3-columns":Le>=2?"grid-2-columns":"grid-1-column"}),yt=()=>{f.value=!f.value},bt=he=>{u.value=he,f.value=!1},xt=he=>{const de=O.find(Jt=>Jt.value===he);return de?de.label:null},Pt=he=>{f.value&&I.value&&!I.value.contains(he.target)&&(f.value=!1)},qt=()=>{j.value&&(D.value=j.value.offsetWidth)};function _t(he){y("edit-template",he)}function It(){d.value=!1,p.value=!1}function jt(he){b.value=he,d.value=!1,p.value=!1,T.value=!0}function Rt(){T.value=!1,d.value=!0}async function Wt(he){var de,Jt,te,ne,Le,Oe,Ne,Pe,Xe;try{if(T.value=!1,!b.value)return;const He={template_id:b.value.template.id,user_id:b.value.template.user_id,tournament_id:b.value.liga.id||1,tournament_name:b.value.liga.name,season_id:b.value.partido.season_id,season_name:((de=b.value.torneo)==null?void 0:de.name)||"",game_id:b.value.partido.id||b.value.partido.game_id};he.tirosEsquina==="automatico"&&(He.auto_specific_plays_corners=!0);const $e=await M0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$.userId}/reports`,He,{headers:{Authorization:$.token,"Content-Type":"application/json"}}),ir=((Jt=$e.data)==null?void 0:Jt.id)||((te=$e.data)==null?void 0:te.report_id)||((Le=(ne=$e.data)==null?void 0:ne.data)==null?void 0:Le.id)||((Ne=(Oe=$e.data)==null?void 0:Oe.data)==null?void 0:Ne.report_id);if(console.log("Report ID obtenido:",ir),console.log("Strengths Payload recibido:",he==null?void 0:he.strengthsPayload),he.tirosEsquina==="manual"&&he.specificPlaysPayload){console.log("specificPlaysPayload recibido:",he.specificPlaysPayload);try{console.log("Enviando specific plays al endpoint...");const pr=await M0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$.userId}/reports/${ir}/specific-plays-corners`,{data:he.specificPlaysPayload},{headers:{Authorization:$.token,"Content-Type":"application/json"}});console.log("Specific plays guardados exitosamente:",pr.data)}catch(pr){console.error("Error al guardar los specific plays:",pr),console.error("Error response:",(Pe=pr.response)==null?void 0:Pe.data)}}if(he!=null&&he.strengthsPayload&&Object.keys(he.strengthsPayload).length>0&&ir)try{console.log("Enviando strengths al endpoint...");const pr=await M0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$.userId}/reports/${ir}/strengths`,he.strengthsPayload,{headers:{Authorization:$.token,"Content-Type":"application/json"}});console.log("Strengths guardados exitosamente:",pr.data)}catch(pr){console.error("Error al guardar las fortalezas:",pr),console.error("Error response:",(Xe=pr.response)==null?void 0:Xe.data)}else console.warn("No se enviaron strengths porque:",{hasPayload:!!(he!=null&&he.strengthsPayload),payloadKeys:he!=null&&he.strengthsPayload?Object.keys(he.strengthsPayload).length:0,hasReportId:!!ir});y("switch-to-reports"),b.value=null}catch(He){console.error("Error al generar el reporte:",He),He.response&&He.response.status===409?b.value&&(L.value=b.value.template.id,P.value=b.value.template.template_type,V.value=b.value.template,p.value=!0,await e.nextTick(),d.value=!0):alert("Error al generar el reporte. Por favor, intenta de nuevo.")}}let re=null;e.onMounted(async()=>{document.addEventListener("mousedown",Pt),await e.nextTick(),qt(),window.ResizeObserver?(re=new ResizeObserver(()=>{qt()}),j.value&&re.observe(j.value)):window.addEventListener("resize",qt),Y()});function le(he){y("open-modal-new-template",he)}return e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Pt),re?re.disconnect():window.removeEventListener("resize",qt)}),r({obtenerTemplates:Y}),(he,de)=>{var Jt,te;return e.openBlock(),e.createElementBlock("div",{class:"templates-section",ref_key:"templatesSectionRef",ref:j},[e.createElementVNode("div",kde,[e.createElementVNode("span",null,[e.createTextVNode("Templates "),e.createElementVNode("span",Lde,"("+e.toDisplayString(st.value.length)+")",1)]),e.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:I},[e.createElementVNode("button",{class:"sort-button",onClick:yt},[e.createTextVNode(e.toDisplayString(xt(u.value)||"Ordenar")+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["dropdown-arrow",{rotated:f.value}])},null,2)]),f.value?(e.openBlock(),e.createElementBlock("div",Cde,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(O,ne=>e.createElementVNode("div",{key:ne.value,class:e.normalizeClass(["sort-option",{selected:u.value===ne.value}]),onClick:Le=>bt(ne.value)},[e.createElementVNode("span",null,e.toDisplayString(ne.label),1),u.value===ne.value?(e.openBlock(),e.createElementBlock("span",Ode,Ede)):e.createCommentVNode("",!0)],10,Nde)),64))])):e.createCommentVNode("",!0)],512)]),M.value?(e.openBlock(),e.createElementBlock("div",zde,Mde)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["templates-list",mt.value]),ref_key:"templatesListRef",ref:F},[e.createElementVNode("div",{class:"template-card create",onClick:de[0]||(de[0]=ne=>i.value=!0)},Vde),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value,ne=>(e.openBlock(),e.createBlock(doe,{key:ne.id,template:ne,"user-id":t.userId,onGenerarReporte:Le=>{L.value=ne.id,P.value=ne.template_type,V.value=ne,d.value=!0},onRenombrar:Le=>{E.value=ne.id,s.value=Le,c.value=ne.template_type,l.value=!0},onDuplicar:Le=>{k.value=ne.id,o.value=Le,a.value=!0},onEliminar:Le=>{h.value=Le.name,v.value=Le.id,S.value=!0},onEditTemplate:_t},null,8,["template","user-id","onGenerarReporte","onRenombrar","onDuplicar","onEliminar"]))),128))],2)),i.value?(e.openBlock(),e.createBlock(CJ,{key:2,token:t.token,team:t.team,onClose:de[1]||(de[1]=ne=>i.value=!1),onOpenModalNewTemplate:le},null,8,["token","team"])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createBlock(zse,{key:3,"user-id":t.userId,token:t.token,team:t.team,"template-id":L.value,"template-type":P.value,template:V.value,"show-error409-on-mount":p.value,onClose:It,onSwitchToReports:de[2]||(de[2]=ne=>he.$emit("switch-to-reports")),onOpenConfigurarContenido:jt},null,8,["user-id","token","team","template-id","template-type","template","show-error409-on-mount"])):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createBlock(Sde,{key:4,"has-rival":!0,token:t.token,template:((Jt=b.value)==null?void 0:Jt.template)||null,team:t.team,partido:((te=b.value)==null?void 0:te.partido)||null,"config-data":b.value,onClose:de[3]||(de[3]=ne=>T.value=!1),onBack:Rt,onNext:Wt},null,8,["token","template","team","partido","config-data"])):e.createCommentVNode("",!0),l.value?(e.openBlock(),e.createBlock(Gse,{key:5,initialName:s.value,token:t.token,"template-id":E.value,"template-type":c.value,"user-id":t.userId,onRefresh:de[4]||(de[4]=ne=>Y()),onClose:de[5]||(de[5]=ne=>l.value=!1),onRename:de[6]||(de[6]=ne=>{l.value=!1})},null,8,["initialName","token","template-id","template-type","user-id"])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createBlock(ile,{key:6,initialName:o.value,token:t.token,"template-id":k.value,onClose:de[7]||(de[7]=ne=>a.value=!1),onTemplateDuplicated:de[8]||(de[8]=ne=>{a.value=!1,Y()})},null,8,["initialName","token","template-id"])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createBlock(hle,{key:7,"template-id":v.value,"user-id":t.userId,token:t.token,onClose:de[9]||(de[9]=ne=>S.value=!1),onTemplateDeleted:de[10]||(de[10]=ne=>{S.value=!1,Y()})},null,8,["template-id","user-id","token"])):e.createCommentVNode("",!0)],512)}}},[["__scopeId","data-v-bb310f7c"]]),NA=t=>(e.pushScopeId("data-v-d17eb1eb"),t=t(),e.popScopeId(),t),Ade={class:"tooltip-report-options"},Rde=NA(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",alt:"Renombrar reporte",class:"icon"},null,-1)),Fde=NA(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-download.svg",alt:"Descargar reporte",class:"icon"},null,-1)),Ude=NA(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-delete.svg",alt:"Eliminar reporte",class:"icon"},null,-1)),Ide=ov({__name:"TooltipReportOptions",emits:["ver-reporte","renombrar","editar","duplicar","descargar","eliminar"],setup(t,{emit:r}){return(n,y)=>(e.openBlock(),e.createElementBlock("div",Ade,[e.createElementVNode("ul",null,[e.createElementVNode("li",{class:"option",onClick:y[0]||(y[0]=$=>n.$emit("renombrar"))},[Rde,e.createTextVNode(" Renombrar reporte ")]),e.createElementVNode("li",{class:"option",onClick:y[1]||(y[1]=$=>n.$emit("descargar"))},[Fde,e.createTextVNode(" Descargar reporte ")]),e.createElementVNode("li",{class:"option",onClick:y[2]||(y[2]=$=>n.$emit("eliminar"))},[Ude,e.createTextVNode(" Eliminar reporte ")])])]))}},[["__scopeId","data-v-d17eb1eb"]]);function F4(t){if(!t)return"";const r=new Date(t);if(isNaN(r.getTime()))return"";const n=r.getDate(),y=r.toLocaleDateString("es-ES",{month:"short"}),$=r.getFullYear();return`${n} ${y}, ${$}`}const qde=t=>(e.pushScopeId("data-v-bb7e7ba7"),t=t(),e.popScopeId(),t),jde={class:"prematch-bg"},Dde={class:"background-shields"},Wde={class:"shield-left"},Bde=["src"],Kde={class:"shield-right"},Xde=["src"],Gde=qde(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),Zde={class:"subtitle"},Jde={class:"jornada"},Hde={class:"fecha"},Yde={class:"teams-row"},Qde={class:"team team-local"},$de={class:"escudo-svg"},tpe=["src"],epe={class:"team-name"},rpe={class:"team team-visitor"},npe={class:"escudo-svg"},ape=["src"],ipe={class:"team-name"},ope=ov({__name:"AnalisisPrematchType1",props:{report:{type:Object,default:()=>({})}},setup(t){function r(y){return y?y.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=t;return(y,$)=>(e.openBlock(),e.createElementBlock("div",jde,[e.createElementVNode("div",Dde,[e.createElementVNode("div",Wde,[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+n.report.game.home_team+".png",alt:"Escudo local"},null,8,Bde)]),e.createElementVNode("div",Kde,[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+n.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,Xde)])]),Gde,e.createElementVNode("div",Zde,[e.createElementVNode("span",Jde,e.toDisplayString(r(n.report.game.matchday_name)),1),e.createElementVNode("span",Hde," - "+e.toDisplayString(e.unref(F4)(n.report.game.date_time_utc)),1)]),e.createElementVNode("div",Yde,[e.createElementVNode("div",Qde,[e.createElementVNode("span",$de,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.home_team+".png"},null,8,tpe)]),e.createElementVNode("span",epe,e.toDisplayString(n.report.game.home_team_acronym),1)]),e.createElementVNode("div",rpe,[e.createElementVNode("span",npe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.visiting_team+".png"},null,8,ape)]),e.createElementVNode("span",ipe,e.toDisplayString(n.report.game.visiting_team_acronym),1)])])]))}},[["__scopeId","data-v-bb7e7ba7"]]),r7=t=>(e.pushScopeId("data-v-7dd14646"),t=t(),e.popScopeId(),t),spe={class:"prematch-bg"},lpe={class:"background-shields"},cpe={class:"shield-left"},upe=["src"],dpe={class:"shield-right"},ppe=["src"],hpe=r7(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),fpe={class:"subtitle"},mpe={class:"jornada"},ype={class:"fecha"},gpe={class:"teams-grid"},vpe={class:"row row-top"},bpe={class:"team team-local"},xpe={class:"escudo-svg"},_pe=["src"],wpe={class:"team-name"},Tpe={class:"score"},Spe={class:"score-text"},kpe={class:"team team-visitor"},Lpe={class:"team-name"},Cpe={class:"escudo-svg"},Npe=["src"],Ope={class:"row row-bottom"},Epe={class:"team-stats"},zpe=e.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),Mpe={class:"stat red"},Vpe=r7(()=>e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})],-1)),Ppe={class:"stat-number"},Ape={class:"stat yellow"},Rpe=r7(()=>e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})],-1)),Fpe={class:"stat-number"},Upe=r7(()=>e.createElementVNode("div",{class:"empty"},null,-1)),Ipe={class:"team-stats"},qpe={class:"stat-number"},jpe=r7(()=>e.createElementVNode("span",{class:"stat yellow"},[e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})])],-1)),Dpe={class:"stat-number"},Wpe=r7(()=>e.createElementVNode("span",{class:"stat red"},[e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})])],-1)),Bpe=e.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),Kpe=ov({__name:"AnalisisPostMatchType1",props:{report:{type:Object,default:()=>({})}},setup(t){function r(l){return l?l.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=t,y=e.computed(()=>{var S,T,b;const l=(b=(T=(S=n.report)==null?void 0:S.game)==null?void 0:T.minutes)==null?void 0:b.home_goals_minutes;if(!Array.isArray(l)||l.length===0)return null;const a=l.map(p=>{const s=p.match(/(\d+)'$/);return s?s[1]+"'":""}).filter(p=>p!=="");if(a.length>5){const p=a.slice(0,5).join(", "),s=a.slice(5).join(", ");return`${p}
7998
+ `+f):y.stack=f}catch{}}throw y}}_request(r,n){typeof r=="string"?(n=n||{},n.url=r):n=r||{},n=OS(this.defaults,n);const{transitional:y,paramsSerializer:$,headers:f}=n;y!==void 0&&AO.assertOptions(y,{silentJSONParsing:tw.transitional(tw.boolean),forcedJSONParsing:tw.transitional(tw.boolean),clarifyTimeoutError:tw.transitional(tw.boolean),legacyInterceptorReqResOrdering:tw.transitional(tw.boolean)},!1),$!=null&&(nu.isFunction($)?n.paramsSerializer={serialize:$}:AO.assertOptions($,{encode:tw.function,serialize:tw.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),AO.assertOptions(n,{baseUrl:tw.spelling("baseURL"),withXsrfToken:tw.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=f&&nu.merge(f.common,f[n.method]);f&&nu.forEach(["delete","get","head","post","put","patch","common"],p=>{delete f[p]}),n.headers=Q_.concat(u,f);const i=[];let d=!0;this.interceptors.request.forEach(function(s){if(typeof s.runWhen=="function"&&s.runWhen(n)===!1)return;d=d&&s.synchronous;const c=n.transitional||gA;c&&c.legacyInterceptorReqResOrdering?i.unshift(s.fulfilled,s.rejected):i.push(s.fulfilled,s.rejected)});const l=[];this.interceptors.response.forEach(function(s){l.push(s.fulfilled,s.rejected)});let a,S=0,T;if(!d){const p=[TJ.bind(this),void 0];for(p.unshift(...i),p.push(...l),T=p.length,a=Promise.resolve(n);S<T;)a=a.then(p[S++],p[S++]);return a}T=i.length;let b=n;for(;S<T;){const p=i[S++],s=i[S++];try{b=p(b)}catch(c){s.call(this,c);break}}try{a=TJ.call(this,b)}catch(p){return Promise.reject(p)}for(S=0,T=l.length;S<T;)a=a.then(l[S++],l[S++]);return a}getUri(r){r=OS(this.defaults,r);const n=pJ(r.baseURL,r.url,r.allowAbsoluteUrls);return aJ(n,r.params,r.paramsSerializer)}};nu.forEach(["delete","get","head","options"],function(r){ES.prototype[r]=function(n,y){return this.request(OS(y||{},{method:r,url:n,data:(y||{}).data}))}}),nu.forEach(["post","put","patch"],function(r){function n(y){return function(f,u,i){return this.request(OS(i||{},{method:r,headers:y?{"Content-Type":"multipart/form-data"}:{},url:f,data:u}))}}ES.prototype[r]=n(),ES.prototype[r+"Form"]=n(!0)});let Fie=class pQ{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(f){n=f});const y=this;this.promise.then($=>{if(!y._listeners)return;let f=y._listeners.length;for(;f-- >0;)y._listeners[f]($);y._listeners=null}),this.promise.then=$=>{let f;const u=new Promise(i=>{y.subscribe(i),f=i}).then($);return u.cancel=function(){y.unsubscribe(f)},u},r(function(f,u,i){y.reason||(y.reason=new m9(f,u,i),n(y.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const n=this._listeners.indexOf(r);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const r=new AbortController,n=y=>{r.abort(y)};return this.subscribe(n),r.signal.unsubscribe=()=>this.unsubscribe(n),r.signal}static source(){let r;return{token:new pQ(function($){r=$}),cancel:r}}};function Uie(t){return function(n){return t.apply(null,n)}}function Iie(t){return nu.isObject(t)&&t.isAxiosError===!0}const SA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(SA).forEach(([t,r])=>{SA[r]=t});function LJ(t){const r=new ES(t),n=BZ(ES.prototype.request,r);return nu.extend(n,ES.prototype,r,{allOwnKeys:!0}),nu.extend(n,r,null,{allOwnKeys:!0}),n.create=function($){return LJ(OS(t,$))},n}const M0=LJ(h9);M0.Axios=ES,M0.CanceledError=m9,M0.CancelToken=Fie,M0.isCancel=lJ,M0.VERSION=SJ,M0.toFormData=EO,M0.AxiosError=Rf,M0.Cancel=M0.CanceledError,M0.all=function(r){return Promise.all(r)},M0.spread=Uie,M0.isAxiosError=Iie,M0.mergeConfig=OS,M0.AxiosHeaders=Q_,M0.formToJSON=t=>oJ(nu.isHTMLForm(t)?new FormData(t):t),M0.getAdapter=wJ.getAdapter,M0.HttpStatusCode=SA,M0.default=M0;const{Axios:_5e,AxiosError:w5e,CanceledError:T5e,isCancel:S5e,CancelToken:k5e,VERSION:L5e,all:C5e,Cancel:N5e,isAxiosError:O5e,spread:E5e,toFormData:z5e,AxiosHeaders:M5e,HttpStatusCode:V5e,formToJSON:P5e,getAdapter:A5e,mergeConfig:R5e}=M0,ov=(t,r)=>{const n=t.__vccOpts||t;for(const[y,$]of r)n[y]=$;return n},y9=t=>(e.pushScopeId("data-v-127740d3"),t=t(),e.popScopeId(),t),qie={class:"tooltip-template-options"},jie=y9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report.svg",alt:"Generar reporte",class:"icon"},null,-1)),Die=y9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1)),Wie=y9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-edit.svg",alt:"Editar template",class:"icon"},null,-1)),Bie=y9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-duplicate.svg",alt:"Duplicar template",class:"icon"},null,-1)),Kie=y9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1)),Xie=ov({__name:"TooltipTemplateOptions",props:{canEdit:{type:Boolean,default:!0}},emits:["generar-reporte","renombrar","editar","duplicar","eliminar"],setup(t,{emit:r}){return(n,y)=>(e.openBlock(),e.createElementBlock("div",qie,[e.createElementVNode("ul",null,[e.createElementVNode("li",{class:"option",onClick:y[0]||(y[0]=$=>n.$emit("generar-reporte"))},[jie,e.createTextVNode(" Generar reporte ")]),t.canEdit?(e.openBlock(),e.createElementBlock("li",{key:0,class:"option",onClick:y[1]||(y[1]=$=>n.$emit("renombrar"))},[Die,e.createTextVNode(" Renombrar template ")])):e.createCommentVNode("",!0),t.canEdit?(e.openBlock(),e.createElementBlock("li",{key:1,class:"option",onClick:y[2]||(y[2]=$=>n.$emit("editar"))},[Wie,e.createTextVNode(" Editar template ")])):e.createCommentVNode("",!0),e.createElementVNode("li",{class:"option",onClick:y[3]||(y[3]=$=>n.$emit("duplicar"))},[Bie,e.createTextVNode(" Duplicar template ")]),t.canEdit?(e.openBlock(),e.createElementBlock("li",{key:2,class:"option",onClick:y[4]||(y[4]=$=>n.$emit("eliminar"))},[Kie,e.createTextVNode(" Eliminar template ")])):e.createCommentVNode("",!0)])]))}},[["__scopeId","data-v-127740d3"]]),RO=t=>(e.pushScopeId("data-v-8520e810"),t=t(),e.popScopeId(),t),Gie={class:"template-card postpartido",style:{position:"relative"}},Zie=[RO(()=>e.createElementVNode("span",null,null,-1)),RO(()=>e.createElementVNode("span",null,null,-1)),RO(()=>e.createElementVNode("span",null,null,-1))],Jie={key:0,class:"template-img-placeholder",style:{position:"relative"}},Hie={key:0,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-01.jpg",alt:"Template Prematch Type 1",class:"template-img"},Yie={key:1,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-01.jpg",alt:"Template Postmatch Type 1",class:"template-img"},Qie={key:2,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-02.jpg",alt:"Template Prematch Type 2",class:"template-img"},$ie={key:3,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-02.jpg",alt:"Template Postmatch Type 2",class:"template-img"},toe={key:4,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-03.jpg",alt:"Template Prematch Type 3",class:"template-img"},eoe={key:5,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-03.jpg",alt:"Template Postmatch Type 3",class:"template-img"},roe={key:6,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-04.jpg",alt:"Template Prematch Type 4",class:"template-img"},noe={key:7,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-04.jpg",alt:"Template Postmatch Type 4",class:"template-img"},aoe={key:8,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumb1.png",alt:"Template Default",class:"template-img"},ioe={class:"inner-card-postpartido"},ooe={class:"postpartido-footer"},soe={class:"postpartido-version"},loe={class:"postpartido-status"},coe=RO(()=>e.createElementVNode("span",{class:"tipo-label"},"Tipo:",-1)),uoe={class:"tipo-value"},doe=ov({__name:"TemplateItem",props:{template:{type:Object,required:!0},userId:{type:Number,required:!0}},emits:["generar-reporte","renombrar","duplicar","eliminar","edit-template"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(!1),f=e.computed(()=>n.userId===n.template.user_id);function u(){$.value=!1,y("generar-reporte")}function i(){$.value=!1;const T=n.template.name||"";y("renombrar",T)}function d(){$.value=!1,y("edit-template",n.template)}function l(){$.value=!1;const T=n.template.name||"";y("duplicar",T)}function a(){$.value=!1,y("eliminar",n.template)}function S(T){}return(T,b)=>(e.openBlock(),e.createElementBlock("div",Gie,[e.createElementVNode("div",{class:"three-dots",onClick:b[0]||(b[0]=e.withModifiers(p=>$.value=!$.value,["stop"]))},Zie),t.template.pages&&t.template.pages[0]?(e.openBlock(),e.createElementBlock("div",Jie,[t.template.template_type===1&&t.template.pages[0].type==1?(e.openBlock(),e.createElementBlock("img",Hie)):t.template.template_type===2&&t.template.pages[0].type==1?(e.openBlock(),e.createElementBlock("img",Yie)):t.template.template_type===1&&t.template.pages[0].type==2?(e.openBlock(),e.createElementBlock("img",Qie)):t.template.template_type===2&&t.template.pages[0].type==2?(e.openBlock(),e.createElementBlock("img",$ie)):t.template.template_type===1&&t.template.pages[0].type==3?(e.openBlock(),e.createElementBlock("img",toe)):t.template.template_type===2&&t.template.pages[0].type==3?(e.openBlock(),e.createElementBlock("img",eoe)):t.template.template_type===1&&t.template.pages[0].type==4?(e.openBlock(),e.createElementBlock("img",roe)):t.template.template_type===2&&t.template.pages[0].type==4?(e.openBlock(),e.createElementBlock("img",noe)):(e.openBlock(),e.createElementBlock("img",aoe))])):e.createCommentVNode("",!0),e.createElementVNode("div",ioe,[e.createElementVNode("div",ooe,[e.createElementVNode("div",soe,e.toDisplayString(t.template.name),1),e.createElementVNode("div",loe,[coe,e.createElementVNode("span",uoe," "+e.toDisplayString(t.template.template_type==1?"Prepartido":"Postpartido"),1)]),e.createElementVNode("button",{class:"postpartido-btn",onClick:b[1]||(b[1]=p=>y("generar-reporte"))},"Generar reporte")])]),$.value?(e.openBlock(),e.createBlock(Xie,{key:1,"can-edit":f.value,onClick:b[2]||(b[2]=e.withModifiers(p=>$.value=!1,["self"])),onMouseleave:b[3]||(b[3]=p=>$.value=!1),onGenerarReporte:u,onRenombrar:i,onEditar:d,onDuplicar:l,onEliminar:a,onToggleAutogen:S},null,8,["can-edit"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"tooltip-overlay",onClick:b[4]||(b[4]=p=>$.value=!1)})):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-8520e810"]]),e7=t=>(e.pushScopeId("data-v-a34cf1b5"),t=t(),e.popScopeId(),t),poe={class:"modal-overlay"},hoe={class:"modal-content"},foe=[e7(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],moe=e7(()=>e.createElementVNode("div",{class:"modal-header"},[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-editar-withe.svg",class:"icon-title",alt:"icon"}),e.createElementVNode("span",{class:"modal-title"},"Crear Template")],-1)),yoe=e7(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),goe={class:"modal-body"},voe=e7(()=>e.createElementVNode("div",{class:"modal-label"},"Define el tipo de análisis para tu template:",-1)),boe={class:"radio-group"},xoe=e7(()=>e.createElementVNode("div",{class:"modal-label"},"Agrega un nombre a tu template:",-1)),_oe=["disabled"],woe={key:0,class:"error-message"},Toe=e7(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),Soe={class:"modal-footer"},koe=["disabled"],Loe=["disabled"],Coe=["disabled"],Noe={key:0,class:"loading-spinner"},Ooe={key:1},CJ=ov({__name:"ModalCreateTemplate",props:{token:{type:String,required:!0},team:{type:Number,required:!0}},emits:["close","template-created","open-modal-new-template"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(1),f=e.ref("pre"),u=e.ref(""),i=e.ref(!1),d=e.ref(""),l=async()=>{var a;if(!(u.value.trim().length<3)){i.value=!0,d.value="";try{const S={name:u.value.trim(),team_id:n.team,template_type:f.value==="pre"?1:2},b=await M0.create({headers:{Authorization:`${n.token}`}}).post("https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates",S);y("template-created",b.data),y("open-modal-new-template",(a=b.data)==null?void 0:a.data),y("close")}catch(S){console.error("Error al guardar template:",S),S.response&&S.response.status===409&&(d.value="Ya existe un template con el mismo nombre")}finally{i.value=!1}}};return e.onMounted(()=>{document.body.style.overflow="hidden"}),e.onUnmounted(()=>{document.body.style.overflow=""}),(a,S)=>(e.openBlock(),e.createElementBlock("div",poe,[e.createElementVNode("div",hoe,[e.createElementVNode("button",{class:"close-btn",onClick:S[0]||(S[0]=T=>a.$emit("close"))},foe),moe,yoe,e.createElementVNode("div",goe,[$.value===1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[voe,e.createElementVNode("div",boe,[e.createElementVNode("label",{class:e.normalizeClass(["radio-label",{selected:f.value==="pre"}])},[e.withDirectives(e.createElementVNode("input",{type:"radio",value:"pre","onUpdate:modelValue":S[1]||(S[1]=T=>f.value=T)},null,512),[[e.vModelRadio,f.value]]),e.createTextVNode(" Prepartido ")],2),e.createElementVNode("label",{class:e.normalizeClass(["radio-label",{selected:f.value==="post"}])},[e.withDirectives(e.createElementVNode("input",{type:"radio",value:"post","onUpdate:modelValue":S[2]||(S[2]=T=>f.value=T)},null,512),[[e.vModelRadio,f.value]]),e.createTextVNode(" Postpartido ")],2)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[xoe,e.withDirectives(e.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":S[3]||(S[3]=T=>u.value=T),placeholder:"Untitled",maxlength:"40",autocomplete:"off",disabled:i.value},null,8,_oe),[[e.vModelText,u.value]]),d.value?(e.openBlock(),e.createElementBlock("div",woe,e.toDisplayString(d.value),1)):e.createCommentVNode("",!0)],64))]),Toe,e.createElementVNode("div",Soe,[e.createElementVNode("button",{class:"cancel-btn",onClick:S[4]||(S[4]=T=>a.$emit("close")),disabled:i.value},"Cancelar",8,koe),$.value===1?(e.openBlock(),e.createElementBlock("button",{key:0,class:"next-btn",disabled:!f.value,onClick:S[5]||(S[5]=T=>$.value=2)}," Siguiente ",8,Loe)):(e.openBlock(),e.createElementBlock("button",{key:1,class:"next-btn",disabled:u.value.trim().length<3||i.value,onClick:l},[i.value?(e.openBlock(),e.createElementBlock("div",Noe)):(e.openBlock(),e.createElementBlock("span",Ooe,"Guardar"))],8,Coe))])])]))}},[["__scopeId","data-v-a34cf1b5"]]),ux=t=>(e.pushScopeId("data-v-6ba594dc"),t=t(),e.popScopeId(),t),Eoe={class:"modal-overlay"},zoe={class:"modal-content"},Moe=[ux(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],Voe=ux(()=>e.createElementVNode("div",{class:"modal-header"},[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report-white.svg",class:"icon-title",alt:"icono reporte blanco"}),e.createElementVNode("span",{class:"modal-title"},"Generar reporte")],-1)),Poe=ux(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),Aoe={class:"modal-body"},Roe={key:0,class:"error-message-container"},Foe=ux(()=>e.createElementVNode("p",{class:"error-text"},[e.createTextVNode(" Este reporte ya fue generado previamente"),e.createElementVNode("br"),e.createTextVNode(" con este template para el partido seleccionado. ")],-1)),Uoe={key:1,style:{position:"relative"}},Ioe={key:0,class:"loading-autoseteo-overlay"},qoe=[ux(()=>e.createElementVNode("div",{class:"loading-autoseteo-content"},[e.createElementVNode("div",{class:"loading-spinner"})],-1))],joe={class:"modal-group"},Doe=ux(()=>e.createElementVNode("label",null,"1. Elige el torneo",-1)),Woe={key:0,class:"placeholder"},Boe=ux(()=>e.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),Koe={key:0,class:"placeholder"},Xoe={key:1},Goe=[ux(()=>e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],Zoe={key:0,class:"custom-select-dropdown"},Joe=["onMousedown"],Hoe={class:"modal-row"},Yoe={class:"modal-group"},Qoe=ux(()=>e.createElementVNode("label",null,"2. Elige la temporada",-1)),$oe={key:0,class:"placeholder"},tse=ux(()=>e.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),ese={key:0,class:"placeholder"},rse={key:1},nse=[ux(()=>e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],ase={key:0,class:"custom-select-dropdown"},ise=["onMousedown"],ose={class:"modal-group"},sse=ux(()=>e.createElementVNode("label",null,"3. Elige la jornada",-1)),lse={key:0,class:"placeholder"},cse=ux(()=>e.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),use={key:0,class:"placeholder"},dse={key:1},pse=[ux(()=>e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],hse={key:0,class:"custom-select-dropdown"},fse=["onMousedown"],mse={class:"modal-group"},yse=ux(()=>e.createElementVNode("label",null,"4. Elige el partido",-1)),gse={key:0,class:"placeholder"},vse=ux(()=>e.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),bse={key:0,class:"placeholder"},xse=["src"],_se=["src"],wse=[ux(()=>e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],Tse={key:0,class:"custom-select-dropdown"},Sse=["onMousedown"],kse=["src"],Lse=["src"],Cse={key:0,class:"header-separator"},Nse={key:1,class:"modal-footer"},Ose=["disabled"],Ese={key:0,class:"loading-spinner select-spinner"},zse=ov({__name:"ModalGenerarReporte",props:{userId:{type:String,required:!0},token:{type:String,required:!0},team:{type:Number,required:!0},templateId:{type:String,required:!0},templateType:{type:String,required:!1},template:{type:Object,required:!1},showError409OnMount:{type:Boolean,default:!1}},emits:["close","generar","switch-to-reports","open-configurar-contenido"],setup(t,{emit:r}){const n=t,y=r,$=e.ref([]),f=e.ref([]),u=e.ref([]),i=e.ref([]),d=e.ref(""),l=e.ref(""),a=e.ref(""),S=e.ref(null),T=M0.create({headers:{Authorization:n.token}}),b=e.ref(!1),p=e.ref(!1),s=e.ref(!1),c=e.ref(!1),o=e.ref(!1),h=e.ref(!1),v=e.ref(!1),k=e.ref(!1),L=e.ref([]),E=e.ref([]),P=e.ref(!1),V=e.ref(!1),I=e.ref(!1);function j(de){h.value&&(h.value=!1,o.value=!1),v.value=!1,d.value=de,P.value=!1,O()}function F(de){h.value&&(h.value=!1,o.value=!1),v.value=!1,l.value=de,V.value=!1,Y()}function D(de){h.value&&(h.value=!1,o.value=!1),v.value=!1,a.value=de,I.value=!1,mt()}const U=e.ref(null);async function M(){try{p.value=!0;const de=await M0.get("https://kefloixzy1.execute-api.us-west-2.amazonaws.com/prod/gs3/tournaments");if(de.data&&Array.isArray(de.data)){if(L.value=de.data,$.value=de.data.map(Jt=>Jt.tournament).sort((Jt,te)=>Jt.order&&te.order?Jt.order-te.order:Jt.order&&!te.order?-1:!Jt.order&&te.order?1:0),d.value="",f.value=[],l.value="",u.value=[],a.value="",i.value=[],S.value=null,U.value)setTimeout(()=>{re(U.value)},100);else if($.value.length>0){const Jt=$.value[0];d.value=Jt,X(Jt)}}}catch(de){console.error("Error al cargar torneos:",de),$.value=[{name:"Concacaf Copa Oro"},{name:"Liga MX"},{name:"MLS"}],f.value=[],u.value=[],d.value="",l.value="",a.value="",S.value=null}finally{p.value=!1}}function X(de){const Jt=L.value.find(te=>te.tournament&&te.tournament.name===de.name);Jt&&Array.isArray(Jt.seasons)?(f.value=Jt.seasons,l.value="",u.value=[],a.value="",i.value=[],S.value=null):(f.value=[],l.value="",u.value=[],a.value="",i.value=[],S.value=null)}function O(){l.value="",a.value="",S.value=null,d.value?X(d.value):(f.value=[],u.value=[],i.value=[])}function Y(){if(c.value=!0,a.value="",S.value=null,u.value=[],i.value=[],l.value&&l.value.id){const de=[l.value.id];if(l.value.related_seasons&&Array.isArray(l.value.related_seasons)){const Jt=l.value.related_seasons.map(te=>te.id).filter(Boolean);de.push(...Jt)}st(de)}else c.value=!1}async function st(de){s.value=!0;try{const Jt=Array.isArray(de)?de.join("&seasons="):de,te=await T.get(`https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?seasons=${Jt}`);if(te.data.data&&Array.isArray(te.data.data)){const ne=te.data.data.reduce((Pe,Xe)=>Xe.games&&Array.isArray(Xe.games)?Pe.concat(Xe.games):Pe,[]);E.value=ne.map(Pe=>({label:Pe.label||`${Pe.home_team_acronym||"Local"} vs ${Pe.visiting_team_acronym||"Visitante"}`,localLogo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Pe.home_team+".png"||"",visitanteLogo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Pe.visiting_team+".png"||"",...Pe}));let Le=E.value;n.templateType==="2"||n.templateType===2?Le=Le.filter(Pe=>Pe.game_status===1):(n.templateType==="1"||n.templateType===1)&&(Le=Le.filter(Pe=>Pe.game_status===4));const Oe=Le.map(Pe=>Pe.matchday_id).filter(Boolean),Ne=[...new Set(Oe)];u.value=Ne.map(Pe=>{const Xe=E.value.find(He=>He.matchday_id&&He.matchday_id===Pe);return Xe?{id:Pe,name:Xe.matchday_name.replace("Matchday","Jornada").replace("de Final","").replace("Playoffs 1","Cuartos de Final Ida").replace("Playoffs 2","Cuartos de Final Vuelta").replace("Playoffs 3","Semifinal Ida").replace("Playoffs 4","Semifinal Vuelta").replace("Playoffs 5","Final Ida").replace("Playoffs 6","Final Vuelta")}:null}).filter(Boolean).sort((Pe,Xe)=>{const He=Pe.name.startsWith("Jornada"),$e=Xe.name.startsWith("Jornada");return He&&$e?Pe.id-Xe.id:He&&!$e?-1:!He&&$e?1:0}),a.value="",i.value=[],S.value=null,c.value=!1,U.value&&h.value&&setTimeout(()=>{le(U.value)},200)}else E.value=[],u.value=[],a.value="",i.value=[],S.value=null}catch(Jt){console.error("Error al cargar partidos:",Jt),E.value=[],u.value=[],a.value="",i.value=[],S.value=null,c.value=!1}finally{s.value=!1}}function mt(){S.value=null,i.value=[],a.value&&a.value.id&&yt(a.value)}function yt(de){if(!de||!de.id){i.value=[];return}let Jt=E.value.filter(te=>te.matchday_id===de.id);n.templateType==="2"||n.templateType===2?Jt=Jt.filter(te=>te.game_status===1):(n.templateType==="1"||n.templateType===1)&&(Jt=Jt.filter(te=>te.game_status===4)),i.value=Jt}function bt(){let de=!1;if(n.template&&n.template.pages)for(const Jt of n.template.pages){if(Jt.components&&Array.isArray(Jt.components)){for(const te of Jt.components)if(te.coreView&&te.coreView.id===18){de=!0;break}}if(de)break}return de}function xt(){if(!n.template||!n.template.pages)return!1;for(const de of n.template.pages)if(de.components&&Array.isArray(de.components)&&de.components.some(te=>te.name==="Fortalezas"||te.componentName==="GSCStrengths"))return!0;return!1}async function Pt(){try{if(xt()||bt()){y("open-configurar-contenido",{liga:d.value,torneo:l.value,jornada:a.value,partido:S.value,template:n.template}),y("close");return}p.value=!0;let de="";l.value&&l.value.name&&(de=l.value.name);const Jt={template_id:n.templateId,user_id:n.template&&n.template.user_id?parseInt(n.template.user_id):parseInt(n.userId),tournament_id:d.value.id||1,tournament_name:d.value.name,season_id:S.value.season_id,season_name:de,game_id:S.value.id||S.value.game_id},te=await M0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${n.userId}/reports`,Jt,{headers:{Authorization:n.token,"Content-Type":"application/json"}});y("generar",{liga:d.value,torneo:l.value,jornada:a.value,partido:S.value,reportData:te.data}),y("switch-to-reports"),y("close")}catch(de){console.error("Error al generar el reporte:",de),de.response&&de.response.status===409?k.value=!0:alert("Error al generar el reporte. Por favor, intenta de nuevo.")}finally{p.value=!1}}function qt(){I.value=!I.value}function _t(de){h.value&&(h.value=!1,o.value=!1),v.value=!1,S.value=de,b.value=!1}function It(){document.body.style.overflow="hidden"}function jt(){document.body.style.overflow=""}e.watch(()=>n.showError409OnMount,de=>{k.value=de},{immediate:!0}),e.onMounted(()=>{n.showError409OnMount&&(k.value=!0),M(),It(),Rt(),U.value&&(o.value=!0,h.value=!0)}),e.watch(d,(de,Jt)=>{de&&U.value&&h.value&&!Jt&&!v.value&&(X(de),setTimeout(()=>{const te=Wt(U.value.season_id);te&&(v.value=!0,l.value=te,v.value=!1)},50))}),e.watch(l,(de,Jt)=>{de&&U.value&&h.value&&!Jt&&!v.value?setTimeout(()=>{const te=u.value.find(ne=>ne.id===U.value.matchday_id);te&&(v.value=!0,a.value=te,yt(te),v.value=!1)},500):de&&Jt&&h.value&&(h.value=!1,o.value=!1)}),e.watch(a,(de,Jt)=>{de&&U.value&&h.value&&!Jt&&!v.value?setTimeout(()=>{const te=i.value.find(Le=>Le.game_id===U.value.game_id||Le.id===U.value.game_id);if(yt(de),te){S.value=te,o.value=!1,h.value=!1;return}const ne=i.value.find(Le=>Le.home_team===U.value.home_team&&Le.visiting_team===U.value.visiting_team);if(ne){S.value=ne,o.value=!1,h.value=!1;return}if(E.value.length>0){const Le=E.value.find(Oe=>Oe.game_id===U.value.game_id||Oe.id===U.value.game_id);if(Le){S.value=Le,o.value=!1,h.value=!1;return}}o.value=!1,h.value=!1},1e3):de&&Jt&&h.value&&(h.value=!1,o.value=!1)}),e.onUnmounted(()=>{jt()});async function Rt(){try{const de=await T.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/teams/${n.team}/last-games`);n.templateType==="1"||n.templateType===1?(U.value=de.data.data.prematch,de.data.data.prematch&&(o.value=!0,h.value=!0,de.data.data.prematch.season_id&&await st([de.data.data.prematch.season_id]))):(n.templateType==="2"||n.templateType===2)&&(U.value=de.data.data.postmatch,de.data.data.postmatch&&(o.value=!0,h.value=!0,de.data.data.postmatch.season_id&&await st([de.data.data.postmatch.season_id])))}catch(de){console.error("Error al cargar últimos juegos:",de)}}function Wt(de){if(!de||!f.value.length)return null;const Jt=f.value.find(ne=>ne.id===de);return Jt||f.value.find(ne=>ne.related_seasons&&Array.isArray(ne.related_seasons)?ne.related_seasons.some(Le=>Le.id===de):!1)||null}function re(de){if(!(!de||!de.game_id)&&de.tournament_id&&$.value.length>0){const Jt=$.value.find(te=>te.id===de.tournament_id);Jt&&(d.value=Jt,X(Jt))}}function le(de){if(!(!de||!de.game_id)&&de.tournament_id&&$.value.length>0){const Jt=$.value.find(te=>te.id===de.tournament_id);if(Jt){d.value=Jt;const te=L.value.find(ne=>ne.tournament&&(ne.tournament.id===Jt.id||ne.tournament.name===Jt.name));if(te&&Array.isArray(te.seasons)&&(f.value=te.seasons),de.season_id&&f.value.length>0){const ne=Wt(de.season_id);if(ne&&(l.value=ne,de.matchday_id&&u.value.length>0)){const Le=u.value.find(Oe=>Oe.id===de.matchday_id);if(Le&&(a.value=Le,de.game_id&&i.value.length>0)){const Oe=i.value.find(Ne=>Ne.game_id===de.game_id||Ne.id===de.game_id);if(Oe)S.value=Oe;else{const Ne=i.value.find(Pe=>Pe.home_team===de.home_team&&Pe.visiting_team===de.visiting_team);Ne&&(S.value=Ne)}}}}}}}function he(){k.value=!1,d.value="",l.value="",a.value="",S.value=null,f.value=[],u.value=[],i.value=[],P.value=!1,V.value=!1,I.value=!1,b.value=!1,jt(),y("close")}return(de,Jt)=>(e.openBlock(),e.createElementBlock("div",Eoe,[e.createElementVNode("div",zoe,[e.createElementVNode("button",{class:"close-btn",onClick:he},Moe),Voe,Poe,e.createElementVNode("div",Aoe,[k.value?(e.openBlock(),e.createElementBlock("div",Roe,[Foe,e.createElementVNode("button",{class:"accept-btn",onClick:he},"Aceptar")])):(e.openBlock(),e.createElementBlock("div",Uoe,[o.value?(e.openBlock(),e.createElementBlock("div",Ioe,qoe)):e.createCommentVNode("",!0),e.createElementVNode("div",joe,[Doe,e.createElementVNode("div",{class:"select-wrapper custom-dropdown liga-select",tabindex:"0",onClick:Jt[0]||(Jt[0]=te=>P.value=!P.value),onBlur:Jt[1]||(Jt[1]=te=>P.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["custom-select-display",{disabled:p.value||$.value.length===0}])},[p.value?(e.openBlock(),e.createElementBlock("span",Woe,[Boe,e.createTextVNode("Cargando torneos...")])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[d.value?(e.openBlock(),e.createElementBlock("span",Xoe,e.toDisplayString(d.value.name),1)):(e.openBlock(),e.createElementBlock("span",Koe,"Selecciona el torneo"))],64)),e.createElementVNode("span",{class:e.normalizeClass(["select-chevron",{open:P.value}])},Goe,2)],2),P.value&&$.value.length>0?(e.openBlock(),e.createElementBlock("div",Zoe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,te=>(e.openBlock(),e.createElementBlock("div",{key:te.name,class:"custom-select-option",onMousedown:e.withModifiers(ne=>j(te),["prevent"])},e.toDisplayString(te.name),41,Joe))),128))])):e.createCommentVNode("",!0)],32)]),e.createElementVNode("div",Hoe,[e.createElementVNode("div",Yoe,[Qoe,e.createElementVNode("div",{class:"select-wrapper custom-dropdown torneo-select",tabindex:"0",onClick:Jt[2]||(Jt[2]=te=>V.value=!V.value),onBlur:Jt[3]||(Jt[3]=te=>V.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["custom-select-display",{disabled:!d.value||f.value.length===0||p.value}])},[p.value?(e.openBlock(),e.createElementBlock("span",$oe,[tse,e.createTextVNode("Cargando temporada...")])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.value?(e.openBlock(),e.createElementBlock("span",rse,e.toDisplayString(l.value.name),1)):(e.openBlock(),e.createElementBlock("span",ese,"Elige la temporada"))],64)),e.createElementVNode("span",{class:e.normalizeClass(["select-chevron",{open:V.value}])},nse,2)],2),V.value&&f.value.length>0&&d.value?(e.openBlock(),e.createElementBlock("div",ase,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,te=>(e.openBlock(),e.createElementBlock("div",{key:te.id,class:"custom-select-option",onMousedown:e.withModifiers(ne=>F(te),["prevent"])},e.toDisplayString(te.name),41,ise))),128))])):e.createCommentVNode("",!0)],32)]),e.createElementVNode("div",ose,[sse,e.createElementVNode("div",{class:"select-wrapper custom-dropdown jornada-select",tabindex:"0",onClick:qt,onBlur:Jt[4]||(Jt[4]=te=>I.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["custom-select-display",{disabled:!l.value||u.value.length===0||c.value}])},[c.value?(e.openBlock(),e.createElementBlock("span",lse,[cse,e.createTextVNode("Cargando jornadas...")])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.value?(e.openBlock(),e.createElementBlock("span",dse,e.toDisplayString(a.value.name),1)):(e.openBlock(),e.createElementBlock("span",use,"Elige la jornada"))],64)),e.createElementVNode("span",{class:e.normalizeClass(["select-chevron",{open:I.value}])},pse,2)],2),I.value&&u.value.length>0?(e.openBlock(),e.createElementBlock("div",hse,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,te=>(e.openBlock(),e.createElementBlock("div",{key:te.id,class:"custom-select-option",onMousedown:e.withModifiers(ne=>D(te),["prevent"])},e.toDisplayString(te.name),41,fse))),128))])):e.createCommentVNode("",!0)],32)])]),e.createElementVNode("div",mse,[yse,e.createElementVNode("div",{class:"select-wrapper partido-select",tabindex:"0",onClick:Jt[5]||(Jt[5]=te=>b.value=!b.value),onBlur:Jt[6]||(Jt[6]=te=>b.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["custom-select-display",{disabled:!a.value||s.value}])},[s.value?(e.openBlock(),e.createElementBlock("span",gse,[vse,e.createTextVNode("Cargando partidos...")])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[S.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[S.value.localLogo?(e.openBlock(),e.createElementBlock("img",{key:0,src:S.value.localLogo,class:"logo-equipo",alt:"local"},null,8,xse)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(S.value.label),1),S.value.visitanteLogo?(e.openBlock(),e.createElementBlock("img",{key:1,src:S.value.visitanteLogo,class:"logo-equipo",alt:"visitante"},null,8,_se)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("span",bse,"Selecciona el partido"))],64)),e.createElementVNode("span",{class:e.normalizeClass(["select-chevron",{open:b.value}])},wse,2)],2),b.value&&!s.value&&a.value?(e.openBlock(),e.createElementBlock("div",Tse,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,te=>(e.openBlock(),e.createElementBlock("div",{key:te.label,class:"custom-select-option",onMousedown:e.withModifiers(ne=>_t(te),["prevent"])},[e.createElementVNode("img",{src:te.localLogo,class:"logo-equipo",alt:"local"},null,8,kse),e.createElementVNode("span",null,e.toDisplayString(te.label),1),e.createElementVNode("img",{src:te.visitanteLogo,class:"logo-equipo",alt:"visitante"},null,8,Lse)],40,Sse))),128))])):e.createCommentVNode("",!0)],32)])]))]),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Cse)),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Nse,[e.createElementVNode("button",{class:"cancel-btn",onClick:he},"Cancelar"),e.createElementVNode("button",{class:"next-btn",disabled:!d.value||!l.value||!a.value||!S.value||p.value,onClick:Pt},[p.value?(e.openBlock(),e.createElementBlock("span",Ese)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(p.value?"Generando...":"Generar"),1)],8,Ose)]))])]))}},[["__scopeId","data-v-6ba594dc"]]),g9=t=>(e.pushScopeId("data-v-3f4f9ca5"),t=t(),e.popScopeId(),t),Mse={class:"modal-overlay"},Vse={class:"modal-content"},Pse=[g9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],Ase=g9(()=>e.createElementVNode("div",{class:"modal-header"},[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename-white.svg",class:"icon-title",alt:"icon"}),e.createElementVNode("span",{class:"modal-title"},"Renombrar Template")],-1)),Rse=g9(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),Fse={class:"modal-body"},Use=g9(()=>e.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),Ise=["placeholder","disabled"],qse={key:0,class:"error-message"},jse=g9(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),Dse={class:"modal-footer"},Wse=["disabled"],Bse=["disabled"],Kse={key:0},Xse={key:1},Gse=ov({__name:"ModalRenameTemplate",props:{initialName:{type:String,required:!0},templateType:{type:String,required:!0},token:{type:String,required:!0},userId:{type:String,required:!0},templateId:{type:String,required:!0}},emits:["close","rename","refresh"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(n.initialName),f=e.ref(!1),u=e.ref("");e.watch(()=>n.initialName,d=>{$.value=d,u.value=""}),e.onMounted(()=>{document.body.style.overflow="hidden"}),e.onUnmounted(()=>{document.body.style.overflow=""});async function i(){var d;if(!($.value.trim().length<3)){f.value=!0,u.value="";try{await M0.put(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${n.userId}/templates/${n.templateId}/general`,{name:$.value.trim()},{headers:{Authorization:`${n.token}`,"Content-Type":"application/json"}}),y("rename",$.value.trim()),y("refresh"),y("close")}catch(l){console.error("Error al renombrar el template:",l),((d=l.response)==null?void 0:d.status)===409?u.value="Ya existe un template con el mismo nombre":u.value="Error al renombrar el template. Inténtalo de nuevo."}finally{f.value=!1}}}return(d,l)=>(e.openBlock(),e.createElementBlock("div",Mse,[e.createElementVNode("div",Vse,[e.createElementVNode("button",{class:"close-btn",onClick:l[0]||(l[0]=a=>d.$emit("close"))},Pse),Ase,Rse,e.createElementVNode("div",Fse,[Use,e.withDirectives(e.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":l[1]||(l[1]=a=>$.value=a),placeholder:t.initialName,maxlength:"40",autocomplete:"off",disabled:f.value},null,8,Ise),[[e.vModelText,$.value]]),u.value?(e.openBlock(),e.createElementBlock("div",qse,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0)]),jse,e.createElementVNode("div",Dse,[e.createElementVNode("button",{class:"cancel-btn",onClick:l[2]||(l[2]=a=>d.$emit("close")),disabled:f.value},"Cancelar",8,Wse),e.createElementVNode("button",{class:"next-btn",disabled:$.value.trim().length<3||f.value,onClick:i},[f.value?(e.openBlock(),e.createElementBlock("span",Kse,"Guardando...")):(e.openBlock(),e.createElementBlock("span",Xse,"Guardar"))],8,Bse)])])]))}},[["__scopeId","data-v-3f4f9ca5"]]),v9=t=>(e.pushScopeId("data-v-abfffcd1"),t=t(),e.popScopeId(),t),Zse={class:"modal-overlay"},Jse={class:"modal-content"},Hse=[v9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],Yse=v9(()=>e.createElementVNode("div",{class:"modal-header"},[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-duplicate-white.svg",class:"icon-title",alt:"icon"}),e.createElementVNode("span",{class:"modal-title"},"Duplicar template")],-1)),Qse=v9(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),$se={class:"modal-body"},tle=v9(()=>e.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),ele=["placeholder"],rle=v9(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),nle={class:"modal-footer"},ale=["disabled"],ile=ov({__name:"ModalduplicateTemplate",props:{initialName:{type:String,required:!0},token:{type:String,required:!0},templateId:{type:String,required:!0}},emits:["close","duplicate","template-duplicated"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(n.initialName+" copy"),f=e.ref(!1);e.watch(()=>n.initialName,i=>{$.value=i+" copy"}),e.onMounted(()=>{document.body.style.overflow="hidden"}),e.onUnmounted(()=>{document.body.style.overflow=""});async function u(){if($.value.trim().length>=3&&!f.value){f.value=!0;try{const i=await M0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates/${n.templateId}/duplicate`,{name:$.value.trim()},{headers:{Authorization:`${n.token}`,"Content-Type":"application/json"}});y("template-duplicated",{originalTemplateId:n.templateId,newTemplateName:$.value.trim(),responseData:i.data}),y("close")}catch(i){console.error("Error al duplicar template:",i),alert("Error al duplicar el template. Por favor, intenta de nuevo.")}finally{f.value=!1}}}return(i,d)=>(e.openBlock(),e.createElementBlock("div",Zse,[e.createElementVNode("div",Jse,[e.createElementVNode("button",{class:"close-btn",onClick:d[0]||(d[0]=l=>i.$emit("close"))},Hse),Yse,Qse,e.createElementVNode("div",$se,[tle,e.withDirectives(e.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":d[1]||(d[1]=l=>$.value=l),placeholder:t.initialName,maxlength:"40",autocomplete:"off"},null,8,ele),[[e.vModelText,$.value]])]),rle,e.createElementVNode("div",nle,[e.createElementVNode("button",{class:"cancel-btn",onClick:d[2]||(d[2]=l=>i.$emit("close"))},"Cancelar"),e.createElementVNode("button",{class:"next-btn",disabled:$.value.trim().length<3||f.value,onClick:u},e.toDisplayString(f.value?"Duplicando...":"Aceptar"),9,ale)])])]))}},[["__scopeId","data-v-abfffcd1"]]),ole=t=>(e.pushScopeId("data-v-93a27145"),t=t(),e.popScopeId(),t),sle={class:"modal-overlay"},lle={class:"modal-content"},cle=[ole(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],ule=e.createStaticVNode('<div class="modal-header" data-v-93a27145><img src="https://golstatsimages.blob.core.windows.net/reports-images/icn-delete-delete.svg" class="icon-title" alt="icon" data-v-93a27145><span class="modal-title" data-v-93a27145>Eliminar template</span></div><div class="header-separator" data-v-93a27145></div><div class="modal-body confirm-text" data-v-93a27145> ¿Estás seguro que deseas eliminar<br data-v-93a27145> este template? Si lo haces no habrá manera<br data-v-93a27145> de recuperarlo. </div><div class="header-separator" data-v-93a27145></div>',4),dle={class:"modal-footer"},ple=["disabled"],hle=ov({__name:"ModalDeleteTemplate",props:{templateId:{type:String,required:!0},userId:{type:String,required:!0},token:{type:String,required:!0}},emits:["close","delete","templateDeleted"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(!1);e.onMounted(()=>{document.body.style.overflow="hidden"}),e.onUnmounted(()=>{document.body.style.overflow=""});const f=async()=>{try{$.value=!0;const i=await M0.create({headers:{Authorization:`${n.token}`}}).delete(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${n.userId}/templates/${n.templateId}`);(i.status===200||i.status===204)&&(y("templateDeleted",n.templateId),y("close"))}catch(u){console.error("Error al eliminar template:",u),alert("Error al eliminar el template. Por favor, inténtalo de nuevo.")}finally{$.value=!1}};return(u,i)=>(e.openBlock(),e.createElementBlock("div",sle,[e.createElementVNode("div",lle,[e.createElementVNode("button",{class:"close-btn",onClick:i[0]||(i[0]=d=>u.$emit("close"))},cle),ule,e.createElementVNode("div",dle,[e.createElementVNode("button",{class:"cancel-btn",onClick:i[1]||(i[1]=d=>u.$emit("close"))},"Cancelar"),e.createElementVNode("button",{class:"delete-btn",onClick:f,disabled:$.value},e.toDisplayString($.value?"Eliminando...":"Eliminar"),9,ple)])])]))}},[["__scopeId","data-v-93a27145"]]),FO=t=>(e.pushScopeId("data-v-6a25622a"),t=t(),e.popScopeId(),t),fle={class:"fortalezas-view"},mle={class:"fortalezas-header"},yle={class:"team-logo-container"},gle=["src","alt"],vle={class:"header-content"},ble={class:"fortalezas-title"},xle={class:"fortalezas-description"},_le={class:"fortalezas-container"},wle={class:"categorias-tabs segmented"},Tle=["onClick"],Sle={class:"fortalezas-list"},kle={key:0,class:"loading-state"},Lle=[FO(()=>e.createElementVNode("div",{class:"loading-spinner"},null,-1)),FO(()=>e.createElementVNode("p",{class:"loading-text"},"Cargando fortalezas...",-1))],Cle={key:1,class:"error-state"},Nle={class:"error-text"},Ole=["onClick"],Ele=["onClick"],zle=["checked","disabled","onClick"],Mle={key:0,class:"selection-number"},Vle={class:"fortaleza-badge"},Ple={class:"fortaleza-content"},Ale={class:"fortaleza-name"},Rle={class:"fortaleza-ranking"},Fle=FO(()=>e.createElementVNode("div",{class:"separator"},null,-1)),Ule={class:"category-indicator"},Ile={class:"fortalezas-footer"},qle={key:0,class:"counter-section"},jle={class:"counter-text"},Dle={key:1,class:"carousel-section"},Wle={class:"footer-badge"},Ble={class:"footer-content"},Kle={class:"footer-name"},Xle={class:"footer-ranking"},Gle=FO(()=>e.createElementVNode("div",{class:"footer-separator"},null,-1)),Zle={class:"footer-category-indicator"},Jle=["onClick"],Hle={key:2,class:"empty-message-full"},Yle={class:"empty-text"},NJ=ov({__name:"FortalezasView",props:{teamInitials:{type:String,default:"CA"},title:{type:String,default:"Fortalezas a favor de mi equipo"},modelValue:{type:Array,default:()=>[]},teamLogoUrl:{type:String,required:!1,default:null},seasonId:{type:[String,Number],required:!0},teamId:{type:[String,Number],required:!0},token:{type:String,required:!0},totalFortalezas:{type:Number,default:15},rivalTeamId:{type:[String,Number],required:!1,default:null},gameId:{type:[String,Number],required:!1,default:null},templateType:{type:[String,Number],required:!1,default:1}},emits:["update:modelValue"],setup(t,{expose:r,emit:n}){const y=t,$=n,f=e.computed(()=>y.teamLogoUrl?y.teamLogoUrl:y.teamId?`https://golstatsimages.blob.core.windows.net/teams-80/${y.teamId}.png`:"https://golstatsimages.blob.core.windows.net/teams-80/2.png"),u=e.ref([...y.modelValue]),i=e.reactive({}),d=e.ref(!1),l=e.ref(null);e.watch(()=>y.modelValue,xt=>{if(Array.isArray(xt)){const Pt=JSON.stringify([...u.value].sort()),qt=JSON.stringify([...xt].sort());Pt!==qt&&(u.value=[...xt],Object.keys(i).forEach(_t=>delete i[_t]),u.value.forEach((_t,It)=>{i[_t]=It+1}))}},{immediate:!0,deep:!0});const a=e.ref(0),S=e.ref(null),T=e.ref(null),b=e.ref(0),p=e.ref(0);function s(){const xt=S.value,Pt=T.value;b.value=xt?xt.clientWidth:0,p.value=Pt?Pt.scrollWidth:0}const c=e.computed(()=>Math.max(0,p.value-b.value)),o=e.computed(()=>a.value>0),h=e.computed(()=>a.value<c.value);function v(){const xt=Math.min(c.value,a.value+200);a.value=xt}function k(){const xt=Math.max(0,a.value-200);a.value=xt}let L=null;e.onMounted(()=>{s();const xt=()=>s();window.addEventListener("resize",xt),L=xt,j()}),e.onBeforeUnmount(()=>{L&&(window.removeEventListener("resize",L),L=null)}),e.watch(()=>u.value.slice(),async()=>{await e.nextTick(),s()},{deep:!0}),e.watch(()=>[y.seasonId,y.teamId,y.gameId,y.token,y.templateType],()=>{j()},{immediate:!1});const E=e.computed(()=>u.value.map(xt=>V.value.find(Pt=>Pt.id===xt)).filter(Boolean).sort((xt,Pt)=>i[xt.id]-i[Pt.id])),P=e.computed(()=>({transform:`translateX(-${a.value}px)`})),V=e.ref([]),I=e.ref([]);async function j(){if(!y.seasonId||!y.teamId){console.warn("seasonId y teamId son requeridos para obtener las fortalezas");return}d.value=!0,l.value=null;try{let xt;y.templateType===2?xt=`https://5c9xc3gwh2.execute-api.us-east-2.amazonaws.com/prod/strengths/seasons/${y.seasonId}/postgames/${y.gameId}/teams/${y.teamId}`:xt=`https://5c9xc3gwh2.execute-api.us-east-2.amazonaws.com/prod/strengths/seasons/${y.seasonId}/pregames/${y.gameId}/teams/${y.teamId}`;const Pt=await fetch(xt,{method:"GET",headers:{Authorization:`${y.token}`,"Content-Type":"application/json"}});if(!Pt.ok)throw new Error(`Error al obtener fortalezas: ${Pt.status} ${Pt.statusText}`);const qt=await Pt.json();I.value=qt.strengths||[],V.value=qt.strengths.map(_t=>({id:_t.categories,name:_t.name,value:_t.total,category:_t.category_type==1?"Ofensiva":_t.category_type==2?"Defensiva":"Posesion",ranking:`#${_t.league_ranking} en la liga`,color:F(_t.category_type||"General")})),M()}catch(xt){console.error("Error al cargar fortalezas:",xt),l.value=xt.message,V.value=[]}finally{d.value=!1}}function F(xt){return{1:"#4CAF50",3:"#2196F3",2:"#00BCD4",General:"#9C27B0"}[xt]||"#9C27B0"}const D=e.ref(["Todos"]),U=e.ref("Todos");function M(){const xt=[...new Set(V.value.map(Pt=>Pt.category))];D.value=["Todos",...xt]}const X=e.computed(()=>U.value==="Todos"?V.value:V.value.filter(xt=>xt.category===U.value));function O(xt){const Pt=u.value.indexOf(xt);if(Pt>-1)u.value.splice(Pt,1),delete i[xt];else{if(u.value.length>=y.totalFortalezas)return;const qt=V.value.length,_t=new Set(Object.values(i));let It=1;for(;_t.has(It)&&It<=qt;)It++;i[xt]=It,u.value.push(xt)}$("update:modelValue",u.value)}function Y(xt){U.value=xt}function st(xt){const Pt=u.value.indexOf(xt);Pt>-1&&(u.value.splice(Pt,1),delete i[xt],$("update:modelValue",u.value))}function mt(){const xt=V.value.length,Pt=new Set(u.value),qt=new Set(Object.values(i)),_t=[];for(let Rt=1;Rt<=xt;Rt++)qt.has(Rt)||_t.push(Rt);_t.sort((Rt,Wt)=>Rt-Wt);const It=X.value.map(Rt=>Rt.id).filter(Rt=>!Pt.has(Rt)),jt=y.totalFortalezas;for(const Rt of It){if(u.value.length>=jt)break;const Wt=_t.shift();if(Wt===void 0)break;i[Rt]=Wt,u.value.push(Rt)}$("update:modelValue",u.value)}function yt(){console.warn("Error loading team logo, falling back to initials")}function bt(){console.warn("Error loading league logo")}return r({fortalezasData:V,fortalezasRawData:I,selectedFortalezas:u,selectionOrderMap:i,autocompletar:mt}),(xt,Pt)=>(e.openBlock(),e.createElementBlock("div",fle,[e.createElementVNode("div",mle,[e.createElementVNode("div",yle,[e.createElementVNode("img",{src:f.value,alt:`Logo ${t.teamInitials}`,class:"team-logo",onError:yt},null,40,gle)]),e.createElementVNode("div",vle,[e.createElementVNode("h3",ble,e.toDisplayString(t.title),1),e.createElementVNode("p",xle," Este template contiene "+e.toDisplayString(t.totalFortalezas)+" visualizaciones de Fortalezas. Selecciona las deseadas. ",1)])]),e.createElementVNode("div",_le,[e.createElementVNode("div",wle,[e.createElementVNode("div",{class:"segmented-highlight",style:e.normalizeStyle({width:`calc(100% / ${D.value.length})`,left:`calc(${D.value.indexOf(U.value)} * (100% / ${D.value.length}))`})},null,4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,qt=>(e.openBlock(),e.createElementBlock("button",{key:qt,class:e.normalizeClass(["categoria-tab",{active:U.value===qt}]),onClick:_t=>Y(qt)},e.toDisplayString(qt),11,Tle))),128))]),e.createElementVNode("div",Sle,[d.value?(e.openBlock(),e.createElementBlock("div",kle,Lle)):l.value?(e.openBlock(),e.createElementBlock("div",Cle,[e.createElementVNode("p",Nle,"Error al cargar las fortalezas: "+e.toDisplayString(l.value),1),e.createElementVNode("button",{onClick:j,class:"retry-button"},"Reintentar")])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(X.value,qt=>(e.openBlock(),e.createElementBlock("div",{key:qt.id,class:e.normalizeClass(["fortaleza-item",{selected:u.value.includes(qt.id),disabled:!u.value.includes(qt.id)&&u.value.length>=t.totalFortalezas}]),onClick:_t=>O(qt.id)},[e.createElementVNode("div",{class:"fortaleza-checkbox",onClick:e.withModifiers(_t=>!u.value.includes(qt.id)&&u.value.length>=t.totalFortalezas?null:O(qt.id),["stop"])},[e.createElementVNode("input",{type:"checkbox",checked:u.value.includes(qt.id),disabled:!u.value.includes(qt.id)&&u.value.length>=t.totalFortalezas,class:"checkbox-input",onClick:e.withModifiers(_t=>!u.value.includes(qt.id)&&u.value.length>=t.totalFortalezas?null:O(qt.id),["stop"])},null,8,zle),u.value.includes(qt.id)?(e.openBlock(),e.createElementBlock("span",Mle,e.toDisplayString(i[qt.id]),1)):e.createCommentVNode("",!0)],8,Ele),e.createElementVNode("div",Vle,e.toDisplayString(qt.value),1),e.createElementVNode("div",Ple,[e.createElementVNode("div",Ale,e.toDisplayString(qt.name),1),e.createElementVNode("div",Rle,[e.createElementVNode("span",null,e.toDisplayString(qt.ranking),1),e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/golstats2-tournaments/1.png",alt:"Liga",class:"league-logo",onError:bt},null,32),Fle,e.createElementVNode("div",Ule,[e.createElementVNode("div",{class:"category-dot",style:e.normalizeStyle({backgroundColor:qt.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(qt.category),1)])])])],10,Ole))),128))])]),e.createElementVNode("div",Ile,[u.value.length>0?(e.openBlock(),e.createElementBlock("div",qle,[e.createElementVNode("div",jle,e.toDisplayString(u.value.length)+"/"+e.toDisplayString(t.totalFortalezas),1)])):e.createCommentVNode("",!0),u.value.length>0?(e.openBlock(),e.createElementBlock("div",Dle,[e.createElementVNode("div",{class:"carousel-container",ref_key:"carouselContainerRef",ref:S},[o.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"carousel-arrow left",onClick:k},"‹")):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"carousel-track",ref_key:"carouselTrackRef",ref:T,style:e.normalizeStyle(P.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,qt=>(e.openBlock(),e.createElementBlock("div",{key:qt.id,class:"footer-pill"},[e.createElementVNode("div",Wle,e.toDisplayString(qt.value),1),e.createElementVNode("div",Ble,[e.createElementVNode("div",Kle,e.toDisplayString(qt.name),1),e.createElementVNode("div",Xle,[e.createElementVNode("span",null,e.toDisplayString(qt.ranking),1),e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/golstats2-tournaments/1.png",alt:"Liga",class:"footer-league-logo",onError:bt},null,32),Gle,e.createElementVNode("div",Zle,[e.createElementVNode("div",{class:"footer-category-dot",style:e.normalizeStyle({backgroundColor:qt.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(qt.category),1)])])]),e.createElementVNode("button",{class:"pill-remove-btn",onClick:_t=>st(qt.id)},"×",8,Jle)]))),128))],4),h.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"carousel-arrow right",onClick:v},"›")):e.createCommentVNode("",!0)],512)])):(e.openBlock(),e.createElementBlock("div",Hle,[e.createElementVNode("span",Yle,e.toDisplayString(u.value.length)+" de "+e.toDisplayString(t.totalFortalezas)+" Fortalezas agregadas",1)]))])]))}},[["__scopeId","data-v-6a25622a"]]),Qle=(t,r)=>{const n=t.__vccOpts||t;for(const[y,$]of r)n[y]=$;return n},$le={key:1},tce={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ece=["fill"],rce={key:0,class:"checkbox__teams"},nce={class:"checkbox__teams__logo"},ace=["src"],ice={class:"checkbox__teams__logo"},oce=["src"],sce={__name:"GSC-Checkbox",props:{width:{type:String,default:"fit-content"},height:{type:String,default:"fit-content"},label:{type:String,default:""},labelWhiteSpace:{type:String,default:"normal"},labelColor:{type:String,default:"white"},fontFamily:{type:String,default:"sans-serif"},labelFontSize:{type:String,default:"12px"},modelValue:{type:Boolean,default:!1},justifyContent:{type:String,default:"flex-start"},alignItems:{type:String,default:"center"},boxBackgroundColor:{type:String,default:"#CBEE6B"},boxValueColor:{type:String,default:"#0d1d29"},boxValue:{type:[String,Number],default:""},boxPosition:{type:String,default:"left",validator(t){return["left","right","top","bottom"].includes(t)}},boxMarginTop:{type:String,default:"0.2em"},boxWidthAndHeight:{type:String,default:"16px"},boxBorderColor:{type:String,default:"#969da2"},boxBorderWidth:{type:String,default:"2px"},boxBorderRadius:{type:String,default:"4px"},boxValueFontSize:{type:String,default:"10px"},boxValueFontFamily:{type:String,default:"sans-serif"},avoidInteraction:{type:Boolean,default:!1},avoidToCheck:{type:Boolean,default:!1},isBoxOnly:{type:Boolean,default:!1},teamsIds:{type:Array,default:()=>null}},emits:["update:modelValue"],setup(t,{emit:r}){const n=t;e.useCssVars(l=>({"7bd9d47b":t.width,"34dc7ddc":t.height}));const y=e.ref(!1),$=e.computed(()=>{const l={color:n.boxValueColor,"font-family":n.fontFamily,height:n.boxWidthAndHeight,width:n.boxWidthAndHeight,minWidth:n.boxWidthAndHeight,"border-radius":n.boxBorderRadius,"margin-top":n.boxMarginTop};return y.value?(l["background-color"]=n.boxBackgroundColor,l.border=`solid ${n.boxBorderWidth} ${n.boxBackgroundColor}`):l.border=`solid ${n.boxBorderWidth} ${n.boxBorderColor}`,l}),f=e.computed(()=>({"font-family":n.boxValueFontFamily,"font-size":n.boxValueFontSize,color:n.boxValueColor,"line-height":1})),u=e.computed(()=>{const l={color:n.labelColor,"font-family":n.fontFamily,"font-size":n.labelFontSize,"white-space":n.labelWhiteSpace,"text-align":n.boxPosition==="top"||n.boxPosition==="bottom"?"center":n.boxPosition};return(n.boxPosition==="left"||n.boxPosition==="right")&&(l[`margin-${n.boxPosition}`]=n.isBoxOnly?"0":n.teamsIds?"8px":"10px"),l});e.watch(()=>n.modelValue,l=>{l!==y.value&&(y.value=l)},{immediate:!0});function i(){n.avoidInteraction||!y.value&&n.avoidToCheck||(y.value=!y.value,r("update:modelValue",y.value))}function d(l){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${l}.png`}return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["checkbox",`box-${t.boxPosition}`]),onClick:i},[e.createElementVNode("div",{class:"checkbox__box",style:e.normalizeStyle($.value)},[y.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.boxValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"checkbox__box__value",style:e.normalizeStyle(f.value)},e.toDisplayString(t.boxValue),5)):(e.openBlock(),e.createElementBlock("div",$le,[(e.openBlock(),e.createElementBlock("svg",tce,[e.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:t.boxValueColor},null,8,ece)]))]))],64)):e.createCommentVNode("",!0)],4),t.teamsIds&&t.teamsIds.length?(e.openBlock(),e.createElementBlock("div",rce,[e.createElementVNode("div",nce,[e.createElementVNode("img",{src:d(t.teamsIds[0]),alt:""},null,8,ace)]),e.createElementVNode("div",ice,[e.createElementVNode("img",{src:d(t.teamsIds[1]),alt:""},null,8,oce)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"checkbox__label",style:e.normalizeStyle(u.value)},e.toDisplayString(t.label),5)],2))}},lce=Qle(sce,[["__scopeId","data-v-b6f124d8"]]),OJ=new Map([["M1",{matchDayId:1,matchDayName:"Jornada 1",matchDayAbbreviation:"J1"}],["M2",{matchDayId:2,matchDayName:"Jornada 2",matchDayAbbreviation:"J2"}],["M3",{matchDayId:3,matchDayName:"Jornada 3",matchDayAbbreviation:"J3"}],["M4",{matchDayId:4,matchDayName:"Jornada 4",matchDayAbbreviation:"J4"}],["M5",{matchDayId:5,matchDayName:"Jornada 5",matchDayAbbreviation:"J5"}],["M6",{matchDayId:6,matchDayName:"Jornada 6",matchDayAbbreviation:"J6"}],["M7",{matchDayId:7,matchDayName:"Jornada 7",matchDayAbbreviation:"J7"}],["M8",{matchDayId:8,matchDayName:"Jornada 8",matchDayAbbreviation:"J8"}],["M9",{matchDayId:9,matchDayName:"Jornada 9",matchDayAbbreviation:"J9"}],["M10",{matchDayId:10,matchDayName:"Jornada 10",matchDayAbbreviation:"J10"}],["M11",{matchDayId:11,matchDayName:"Jornada 11",matchDayAbbreviation:"J11"}],["M12",{matchDayId:12,matchDayName:"Jornada 12",matchDayAbbreviation:"J12"}],["M13",{matchDayId:13,matchDayName:"Jornada 13",matchDayAbbreviation:"J13"}],["M14",{matchDayId:14,matchDayName:"Jornada 14",matchDayAbbreviation:"J14"}],["M15",{matchDayId:15,matchDayName:"Jornada 15",matchDayAbbreviation:"J15"}],["M16",{matchDayId:16,matchDayName:"Jornada 16",matchDayAbbreviation:"J16"}],["M17",{matchDayId:17,matchDayName:"Jornada 17",matchDayAbbreviation:"J17"}],["PI1",{matchDayId:181,matchDayName:"Play In 1",matchDayAbbreviation:"PI1"}],["PI2",{matchDayId:182,matchDayName:"Play In 2",matchDayAbbreviation:"PI2"}],["PO",{matchDayId:183,matchDayName:"Repechaje",matchDayAbbreviation:"R"}],["PO1",{matchDayId:18,matchDayName:"Cuartos de final ida",matchDayAbbreviation:"CFI"}],["PO2",{matchDayId:19,matchDayName:"Cuartos de final vuelta",matchDayAbbreviation:"CFV"}],["PO3",{matchDayId:20,matchDayName:"Semifinal ida",matchDayAbbreviation:"SFI"}],["PO4",{matchDayId:21,matchDayName:"Semifinal vuelta",matchDayAbbreviation:"SFV"}],["PO5",{matchDayId:22,matchDayName:"Final ida",matchDayAbbreviation:"FI"}],["PO6",{matchDayId:86,matchDayName:"Final vuelta",matchDayAbbreviation:"FV"}]]),UO={TO_RIGHT:"toRight",TO_LEFT:"toLeft"},cce=["gameId","playerId","teamId","x","y","momentOfPlay","section","playId","timeSection"];let kA=null;function uce(){return kA||(kA=cce.reduce((t,r,n)=>(t[n]=r,t),{})),kA}const dce=["playId","playerId","teamId","gameId","categoryId","relatedCategoriesIds","x1","y1","x2","y2","x3","y3","fieldSection","momentOfPlay","playingAs","matchLapse","matchResult","matchResultAtMomentOfPlay","relatedPlayId","touchOrder","timeSection"];let LA=null;function pce(){return LA||(LA=dce.reduce((t,r,n)=>(t[n]=r,t),{})),LA}const IO=t=>(e.pushScopeId("data-v-7f431c81"),t=t(),e.popScopeId(),t),hce={class:"corners-view"},fce={class:"corners-header"},mce={class:"team-logo-container"},yce=["src","alt"],gce={class:"header-content"},vce={class:"corners-title"},bce={class:"corners-description"},xce={class:"corners-container"},_ce={class:"matches-header"},wce={key:0,class:"post-match-game"},Tce={class:"post-match-game__match-day"},Sce={class:"post-match-game__game-info"},kce={class:"team-info"},Lce={class:"team-logo-post"},Cce=["src"],Nce={class:"team-name"},Oce={class:"score"},Ece={class:"team-info"},zce={class:"team-name"},Mce={class:"team-logo-post"},Vce=["src"],Pce=["onClick"],Ace={class:"team-logo-match"},Rce=["src"],Fce={class:"match-score"},Uce={class:"team-logo-match"},Ice=["src"],qce={class:"team-acronym"},jce={class:"team-match-day"},Dce={class:"team-acronym"},Wce={class:"categorias-tabs segmented"},Bce=["onClick"],Kce={class:"corners-list"},Xce=["onClick"],Gce={class:"check-col"},Zce={class:"badge-col"},Jce={class:"count-badge"},Hce={class:"content-col"},Yce={class:"title-row"},Qce={class:"time"},$ce=IO(()=>e.createElementVNode("span",{class:"title"},"Tiro de esquina",-1)),tue={class:"player"},eue={class:"meta-row"},rue=IO(()=>e.createElementVNode("span",null,"/",-1)),nue={class:"corners-footer"},aue={key:0,class:"counter-section"},iue={class:"counter-text"},oue={key:1,class:"carousel-section"},sue={class:"footer-total"},lue={class:"footer-badge"},cue={class:"team-info"},uue={class:"team-logo-corner"},due=["src"],pue={class:"team-score"},hue={class:"team-info"},fue={class:"team-logo-corner"},mue=["src"],yue={class:"team-score"},gue={class:"footer-content"},vue={class:"footer-ranking"},bue={class:"corner-time"},xue=IO(()=>e.createElementVNode("div",{class:"footer-separator"},null,-1)),_ue={class:"corner-player"},wue={class:"corner-details"},Tue=IO(()=>e.createElementVNode("span",null," / ",-1)),Sue=["onClick"],kue={key:2,class:"empty-message-full"},Lue={class:"empty-text"},CA=148,Cue=5,Nue=10,Oue=600,Eue=600,zue=5,qO=ov({__name:"TirosEsquinaView",props:{modelValue:{type:Array,default:()=>[]},userTeamId:{type:Number,default:0},rival:{type:Boolean,default:!1},teamInitials:{type:String,default:"AME"},title:{type:String,default:"Tiros de esquina en contra de mi equipo"},teamLogoUrl:{type:String,default:"https://golstatsimages.blob.core.windows.net/teams-80/2.png"},teamViews:{type:Array,default:()=>[]},configData:{type:Object,default:()=>({})},isAgainstMode:{type:Boolean,default:!1},isSynchronization:{type:Boolean,default:!1},isRival:{type:Boolean,default:!1},filters:{type:Object,default:()=>({isMoment:!1,final:[1,2,3],moment:[1,2,3],playingAs:[1,2],sections:[1,2,3,4,5,6],games:[],players:[],cornertype:31,howWas:[120,126,327,133],zona:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],whathappened:[583,585,587,589,584,586,588,590,122,128,136,142,123,129,137,143,124,130,138,144,125,131,139,14,146,147,327,133],isWhatHappenedFull:!0,isZoneFull:!0})}},emits:["update:modelValue","corners-fetched"],setup(t,{expose:r,emit:n}){const y=t,$=n,f=["Todos","Goles","Rematados","A rival"],u={goals:{categoryIds:[583,585,587,589]},shots:{categoryIds:[584,586,588,590,122,128,136,142]},toRival:{categoryIds:[123,129,137,143,124,130,138,144]}},i=e.ref("Todos"),d=e.ref([...y.modelValue]),l=e.reactive({}),a=e.ref([]);d.value.forEach((Je,hr)=>{l[Je]=hr+1});const S=e.ref(0),T=e.ref(null),b=e.ref(null),p=e.ref(0),s=e.ref(0);function c(){const Je=T.value,hr=b.value;p.value=Je?Je.clientWidth:0,s.value=hr?hr.scrollWidth:0}const o=e.computed(()=>Math.max(0,s.value-p.value)),h=e.computed(()=>S.value>0),v=e.computed(()=>S.value<o.value),k=e.computed(()=>a.value.filter(Je=>Je.isSelected)),L=e.computed(()=>k.value.length===y.teamViews.length),E=e.ref(0);e.watch(()=>k.value,Je=>{setTimeout(()=>{b.value?c():E.value=0},500),$("update:modelValue",Je)},{deep:!0});function P(){b.value&&(b.value.scrollLeft=b.value.scrollLeft+400,S.value=S.value+400)}function V(){b.value&&(b.value.scrollLeft=b.value.scrollLeft-400,S.value=S.value-400)}const I=e.computed(()=>y.configData&&y.configData.template&&y.configData.template.template_type===2?{...y.configData.partido,matchDay:OJ.get(y.configData.partido.matchday_abbreviation)}:null);e.computed(()=>y.configData&&y.configData.template&&y.configData.template.template_type===1?y.configData.partido:null);function j(){const Je=he.value,hr=Je?Je.clientWidth:0,Nr=Math.max(1,Math.floor(hr/(CA+10)));de.value=Nr}const F=e.computed(()=>{const Je=-le.value*(CA+10),hr=Le.value?Ne.value:0;return{transform:`translateX(${Je+hr}px)`}});function D(){le.value=Math.min(Jt.value,le.value+1)}function U(){le.value=Math.max(0,le.value-1)}function M(Je){Le.value=!0,Oe.value=Je.clientX,Ne.value=0}function X(Je){Le.value&&(Ne.value=Je.clientX-Oe.value)}function O(){if(!Le.value)return;const Je=CA/3;Ne.value<=-Je?D():Ne.value>=Je&&U(),Le.value=!1,Ne.value=0}const Y=e.computed(()=>{if(ir.value&&ir.value.cornersByType){const Je=ir.value.cornersByType.get(i.value)||[];return console.log("gameCorners",Je),Je}return[]});function st(Je){console.log("onClickCorner",Je),console.log("areCornersFilled",L.value),(!L.value||Je.isSelected)&&(Je.isSelected=!Je.isSelected)}function mt(Je){jt.value.forEach(hr=>{hr.isSelected=hr.game_id===Je.game_id})}function yt(){if(!L.value){let Je=k.value.length;for(const hr of a.value)if(!hr.isSelected&&(hr.isSelected=!0,Je++,Je>=y.teamViews.length))break}}function bt(Je){Je.isSelected=!1}function xt(){console.warn("Error loading team logo, falling back to initials")}let Pt=null;e.onMounted(()=>{c();const Je=()=>c();window.addEventListener("resize",Je),Pt=Je}),e.onBeforeUnmount(()=>{Pt&&(window.removeEventListener("resize",Pt),Pt=null)}),e.watch(()=>d.value.slice(),async()=>{await e.nextTick(),c()},{deep:!0});const qt=uce(),_t=pce(),It=e.ref(new Map),jt=e.ref([]);let Rt=0;const Wt=e.ref(new Map),re=e.ref(null),le=e.ref(0),he=e.ref(null),de=e.ref(1),Jt=e.computed(()=>Math.max(0,jt.value.length-de.value)),te=e.computed(()=>le.value>0),ne=e.computed(()=>le.value<Jt.value),Le=e.ref(!1),Oe=e.ref(0),Ne=e.ref(0),Pe=[{text:"Rematado fue gol",categoriesIds:[583,585,587,589]},{text:"Rematado no fue gol",categoriesIds:[584,586,588,590]},{text:"Rematado sin destino",categoriesIds:[122,128,136,142]},{text:y.configData.liga.is_female===1?"Ganado por portera rival":"Ganado por portero rival",categoriesIds:[123,129,137,143]},{text:y.configData.liga.is_female===1?"Ganado por jugadora rival":"Ganado por jugador rival",categoriesIds:[124,130,138,144]},{text:"Sin destino",categoriesIds:[125,131,139,145]}],Xe=e.computed(()=>({id:y.configData.partido.game_id,home_team:y.configData.partido.home_team,away_team:y.configData.partido.visiting_team,season:y.configData.partido.season_id,game_status:y.configData.partido.game_status,home_acronym:y.configData.partido.home_team_acronym,away_acronym:y.configData.partido.visiting_team_acronym,logo_home:y.configData.partido.localLogo,logo_away:y.configData.partido.visitanteLogo})),He=e.computed(()=>{let Je=y.isAgainstMode?"en contra":"a favor";return y.userTeamId===y.configData.partido.home_team||y.userTeamId===y.configData.partido.visiting_team?Je+=y.userTeamId===$e.value?" de mi equipo":" del rival":Je+=y.isRival?" del equipo visitante":" del equipo local",Je}),$e=e.computed(()=>y.isRival?y.configData.partido.visiting_team:y.configData.partido.home_team),ir=e.computed(()=>jt.value.find(Je=>Je.isSelected)),pr={headers:{Authorization:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}};function tr(){if(a.value=[],jt.value)if(y.isSynchronization)jt.value.forEach((Je,hr)=>{Je.isVisible=!0,hr===0&&(Je.isSelected=!0,Je.isExpanded=!0,Je.corners.forEach(Nr=>{Nr.isVisible=!0}),Je.cornersAgainstTeam.forEach(Nr=>{Nr.isVisible=!0}))});else{let Je=!1;jt.value.forEach(hr=>{let Nr=1;if(hr.matchDay||(hr.matchDay=OJ.get(hr.matchday_abbreviation)),hr.isSelected=!1,hr.cornersByType=new Map,f.forEach(Ir=>{hr.cornersByType.set(Ir,[])}),y.isAgainstMode&&hr.isSoccerFieldDataRivalLoaded||!y.isAgainstMode&&hr.isSoccerFieldDataLoaded){const Ir=y.isAgainstMode?hr.cornersAgainstTeam:hr.corners;if((!y.filters.games.length||y.filters.games.includes(hr.game_id))&&y.filters.playingAs.includes(hr.playingAs)&&(y.filters.isMoment||y.filters.final.includes(hr.finalResult))){for(const ln of Ir){if(ln.isSelected=!1,ln.isVisible=!0,!y.filters.isWhatHappenedFull&&ln.relatedCategoriesIds&&!y.filters.whathappened.some(dn=>ln.relatedCategoriesIds.has(dn))){ln.isVisible=!1,ln.isSelected=!1;continue}ln.isVisible=!0,ln.game=hr;const Nn=hr.cornersByType.get("Todos"),En=hr.cornersByType.get("Goles"),Gn=hr.cornersByType.get("Rematados"),$n=hr.cornersByType.get("A rival");a.value.push(ln),ln.mainIndex=Nr,Nr++,Nn.push(ln);const ka=u.goals.categoryIds.some(dn=>ln.relatedCategoriesIds.has(dn)),Hr=u.shots.categoryIds.some(dn=>ln.relatedCategoriesIds.has(dn)),Rr=u.toRival.categoryIds.some(dn=>ln.relatedCategoriesIds.has(dn));ka&&En.push(ln),Hr&&Gn.push(ln),Rr&&$n.push(ln)}hr.isVisible&&!Je?(hr.isSelected=!0,hr.isExpanded=!0,Je=!0):hr.isSelected=!1}else hr.isVisible=!1,Ir.forEach(ln=>{ln.isSelected=!1})}}),console.log("props.isAgainstMode",y.isAgainstMode),console.log("allGamesCorners",a.value),$("corners-fetched",a.value)}}function Fe(){It.value.get($e.value)||It.value.set($e.value,jt.value)}function sr(Je,hr,Nr,Ir){Je&&Je.forEach(ln=>{ln.isHomeTeam=ln.teamId===Xe.value.home_team,ln.attackDirection=Ir.get(ln.playId).mainPlay.attackDirection,ln.player=hr.get(ln.playerId)||Nr.get(ln.playerId)})}function Ye(Je){const[hr,Nr]=Je.split(", ");let Ir="";const ln=hr.split(" ");for(const Nn of ln)if(Ir+=` ${Nn}`,Nn.length>3)break;return Nr&&hr?`${Nr.trim().charAt(0)}.${Ir}`:""}function Te(Je){let[hr,Nr]=Je.split(", ");Nr=Nr.trim();let Ir="";const ln=hr.split(" "),Nn=Nr.includes(" ")?Nr.split(" ")[0]:Nr;for(const En of ln)if(Ir+=` ${En}`,En.length>3)break;return Nn&&hr?`${Nn} ${Ir}`:""}function Re(Je){if(!Je.teams||Je.teams.length===0)return;const hr=Je.teams[0].team_id,Nr=Je.teams[1].team_id;if($e.value===hr&&Je.home_atk_direction===1||$e.value===Nr&&Je.visiting_atk_direction===1)for(let Ir=1;Ir<5;Ir++)Wt.value.set(Ir,Ir%2===0?UO.TO_LEFT:UO.TO_RIGHT);else for(let Ir=1;Ir<5;Ir++)Wt.value.set(Ir,Ir%2===0?UO.TO_RIGHT:UO.TO_LEFT)}const Ve=new Map([[120,"Comba hacia afuera"],[134,"Comba hacia afuera"],[126,"Comba hacia adentro"],[140,"Comba hacia adentro"],[327,"Raz de área"],[146,"Raz de área"],[133,"En corto"],[147,"En corto"]]),br=Pe.reduce((Je,hr)=>(hr.categoriesIds.forEach(Nr=>{Je.set(Nr,hr.text)}),Je),new Map);function cr([Je,hr]){const Nr=Math.round(Number(hr));if(Nr===60){const Ir=Number(Je)+1;return`${Ir<100?Ir<10?"00":"0":""}${Ir}:00.000`}return`${Je}:${Nr<10?"0":""}${Nr}.000`}async function gr(Je,hr){try{if(Je&&hr&&(!Je.isSoccerFieldDataLoaded||!Je.isSoccerFieldDataRivalLoaded)){const Nr=new Map,Ir=new Map,ln=new Map;Re(hr.data),hr.data.players&&hr.data.players.forEach($n=>{$n.shortName=Ye($n.name),$n.firstNameAndFirstLastName=Te($n.name),Ir.set($n.player_id,$n)}),hr.data.rival_players&&hr.data.rival_players.forEach($n=>{$n.shortName=Ye($n.name),$n.firstNameAndFirstLastName=Te($n.name),ln.set($n.player_id,$n)}),re.value=hr.data.teams.find($n=>$n.team_id===$e.value),re.value&&(re.value.rival=hr.data.teams.find($n=>$n.team_id!==$e.value));const Nn=hr.data.data.reduce(($n,ka)=>{const Hr=ka.reduce((Un,Xr,sn)=>(Un[_t[sn]]=Xr,Un.isHomeTeam=Un.teamId===Je.home_team,Un),{}),Rr=Hr.playId===Hr.relatedPlayId,dn=$n.get(Hr.relatedPlayId),Mn=Hr.momentOfPlay.split(":"),da=cr(Mn);return Hr.player=Ir.get(Hr.playerId)||ln.get(Hr.playerId),Hr.isTeamForAnalysis=Hr.teamId===$e.value,Rr&&(Hr.attackDirection=Wt.value.get(Hr.matchLapse),Nr.set(Hr.playId,da)),dn?Rr?dn.mainPlay=Hr:dn.relatedPlays.length<zue&&(dn.relatedPlays.push(Hr),dn.relatedPlays.length>1&&dn.relatedPlays.sort((Un,Xr)=>Un.touchOrder-Xr.touchOrder)):$n.set(Hr.playId,{mainPlay:Rr?Hr:null,relatedPlays:Rr?[]:[Hr]}),$n},new Map),En=hr.data.field_positions.reduce(($n,ka)=>{const Hr=ka.reduce((dn,Mn,da)=>(dn[qt[da]]=Mn,dn),{});Hr.isTeamForAnalysis=Hr.teamId===$e.value;const Rr=$n.get(Hr.playId);if(Rr){const dn=Rr.get(Hr.momentOfPlay);dn?dn.push(Hr):Rr.set(Hr.momentOfPlay,[Hr])}else $n.set(Hr.playId,new Map([[Hr.momentOfPlay,[Hr]]]));return $n},new Map),Gn=Array.from(Nr.entries()).reduce(($n,[ka,Hr])=>{const Rr=[],dn=[];let Mn=null;const da=En.get(ka);if(da){const Un=y.isSynchronization?Oue:Cue,Xr=y.isSynchronization?Eue:Nue;Array.from(da.keys()).sort().forEach(pn=>{(!Mn||dn.length<Xr)&&(pn===Hr?Mn=da.get(pn):Mn?dn.length<Xr&&dn.push(da.get(pn)):(Rr.length===Un&&Rr.shift(),Rr.push(da.get(pn))))});const Sr=new Map;Rr.forEach((pn,Hn)=>{sr(pn,Ir,ln,Nn),Sr.set(`${Hn-Rr.length}`,pn)}),sr(Mn,Ir,ln,Nn),Sr.set("0",Mn),dn.forEach((pn,Hn)=>{sr(pn,Ir,ln,Nn),Sr.set(`${Hn+1}`,pn)}),$n.set(ka,Sr)}return $n},new Map);Je[`${y.isAgainstMode?"cornersAgainstTeam":"corners"}`].forEach($n=>{const ka=$n.related_categories.split(",").reduce((Rr,dn,Mn)=>{const da=Number(dn);return Mn===1&&($n.howWasCorner=da),Rr.array.push(da),Rr.sett.add(da),Rr},{array:[],sett:new Set});for(const Rr of ka.array){const dn=Ve.get(Rr),Mn=br.get(Rr);if(Mn&&($n.whatHappenedName=Mn),dn&&($n.howWasCornerName=dn),$n.howWasCornerName&&$n.whatHappenedName)break}$n.relatedCategoriesIds=ka.sett,$n.playConnections=Nn.get($n.play_id),$n.fieldPositions=Gn.get($n.play_id),$n.player=Ir.get($n.player_id)||ln.get($n.player_id);let Hr=$n.moment_of_play.split(".")[0];Hr.startsWith("0")&&(Hr=Hr.slice(1)),$n.formattedMomentOfPlay=Hr,$n.momentOfPlayNumber=Number(Hr.replace(":","."))}),!y.isAgainstMode&&!Je.isSoccerFieldDataLoaded&&(Je.isSoccerFieldDataLoaded=!0),y.isAgainstMode&&!Je.isSoccerFieldDataRivalLoaded&&(Je.isSoccerFieldDataRivalLoaded=!0)}}catch(Nr){throw new Error(Nr)}}function Tr(Je){return y.isSynchronization?M0.get(`https://golstats-microservices.s3.us-west-2.amazonaws.com/tendency/corners-${y.isAgainstMode?"received":"commited"}-${Rt}-${$e.value}-${Je.game_id}-large.json`):M0.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${Rt}/corners/trends/teams/${$e.value}/${Je.game_id}${y.isAgainstMode?"?isR=1":""}`,pr)}async function Pr(){try{const Je=[];jt.value.forEach(hr=>{(y.isAgainstMode&&!hr.isSoccerFieldDataRivalLoaded||!y.isAgainstMode&&!hr.isSoccerFieldDataLoaded)&&Je.push(Tr(hr))}),Je.length>0&&((await Promise.all(Je)).forEach((Nr,Ir)=>{gr(jt.value[Ir],Nr)}),tr()),Fe()}catch(Je){throw new Error(Je)}}async function qe(Je){try{const hr=It.value.get($e.value);if(hr){jt.value=hr,tr();return}Rt=Je;const Nr=await M0.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${Rt}/games/teams/${$e.value}/corners`,pr);if(!Nr.data&&!Je)return qe(y.configData.torneo.id);const Ir=Nr.data,ln={corners:0,cornersAgainst:0};jt.value=Ir.games?Ir.games.reduce((Nn,En)=>{if(I.value&&En.game_id!==Xe.value.id||En.game_status!==1)return Nn;const Gn={againstTeam:[],team:[]},$n=En.score[1]-En.score[0];En.dateMillis=new Date(En.date_time_utc),En.isVisible=!0,En.playingAs=En.home_team===$e.value?1:2,En.finalResult=$n===0?3:En.playingAs===1?$n>0?2:1:$n<0?2:1,En.corners.forEach(Hr=>{const Rr=Hr.team_id===$e.value;Hr.isAgainst=!Rr,Rr?Gn.team.push(Hr):Gn.againstTeam.push(Hr)}),En.corners=Gn.team,En.cornersAgainstTeam=Gn.againstTeam,ln.corners+=En.corners.length,ln.cornersAgainst+=En.cornersAgainstTeam.length;const ka={...En,isSelected:Nn.length===0,isExpanded:!1,isTeamForAnalysisHomeTeam:En.home_team===$e.value,canPlayVideos:!1};return Nn.push(ka),Nn},[]):[],jt.value=jt.value.sort((Nn,En)=>En.dateMillis-Nn.dateMillis),Fe(),await Pr(),jt.value.forEach(Nn=>{Nn.corners.concat(Nn.cornersAgainstTeam).forEach(En=>{if(En.playConnections){const[Gn,$n]=En.moment_of_play.split(":"),[ka,Hr]=$n.split("."),Rr=Number(Gn)+45*En.playConnections.mainPlay.matchLapse;En.isSelected=!1,En.orderValue=+`${Rr}${ka}${Hr}`}}),Nn.corners=Nn.corners.sort((En,Gn)=>En.orderValue-Gn.orderValue),Nn.cornersAgainstTeam=Nn.cornersAgainstTeam.sort((En,Gn)=>En.orderValue-Gn.orderValue)}),tr()}catch(hr){throw new Error(hr)}}e.watch(()=>y.configData,async Je=>{Je&&Je.partido&&Je.torneo&&await qe(Je.partido.season_id)},{deep:!0,immediate:!0});let Ge=null;return e.onMounted(()=>{j();const Je=()=>j();window.addEventListener("resize",Je),Ge=Je}),e.onBeforeUnmount(()=>{Ge&&(window.removeEventListener("resize",Ge),Ge=null)}),r({autocompletar:yt}),(Je,hr)=>(e.openBlock(),e.createElementBlock("div",hce,[e.createElementVNode("div",fce,[e.createElementVNode("div",mce,[e.createElementVNode("img",{src:t.teamLogoUrl,alt:`Logo ${t.teamInitials}`,class:"team-logo",onError:xt},null,40,yce)]),e.createElementVNode("div",gce,[e.createElementVNode("h3",vce," Tiros de esquina "+e.toDisplayString(He.value),1),e.createElementVNode("p",bce," Este template contiene "+e.toDisplayString(t.teamViews.length)+" visualizaciones de tiros de esquina. Selecciona los deseados. ",1)])]),e.createElementVNode("div",xce,[e.createElementVNode("div",_ce,[I.value?(e.openBlock(),e.createElementBlock("div",wce,[e.createElementVNode("div",Tce,e.toDisplayString(I.value.matchDay.matchDayName),1),e.createElementVNode("div",Sce,[e.createElementVNode("div",kce,[e.createElementVNode("div",Lce,[e.createElementVNode("img",{src:I.value.localLogo,alt:""},null,8,Cce)]),e.createElementVNode("div",Nce,e.toDisplayString(I.value.home_team_acronym),1)]),e.createElementVNode("div",Oce,e.toDisplayString(I.value.score[0])+" - "+e.toDisplayString(I.value.score[1]),1),e.createElementVNode("div",Ece,[e.createElementVNode("div",zce,e.toDisplayString(I.value.visiting_team_acronym),1),e.createElementVNode("div",Mce,[e.createElementVNode("img",{src:I.value.visitanteLogo,alt:""},null,8,Vce)])])])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:"window",ref_key:"matchesWindowRef",ref:he,onPointerdown:M,onPointerup:O,onPointercancel:O,onPointerleave:O,onPointermove:X},[te.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"carousel-arrow left",onClick:U}," ‹ ")):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["track",{animating:!Le.value}]),style:e.normalizeStyle(F.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jt.value,Nr=>{var Ir;return e.openBlock(),e.createElementBlock("div",{key:Nr.game_id,class:e.normalizeClass(["match-pill",{active:Nr.isSelected}]),onClick:ln=>mt(Nr)},[e.createElementVNode("div",Ace,[e.createElementVNode("img",{src:Nr.home_team_logo,alt:""},null,8,Rce)]),e.createElementVNode("div",Fce,e.toDisplayString(Nr.score[0])+" - "+e.toDisplayString(Nr.score[1]),1),e.createElementVNode("div",Uce,[e.createElementVNode("img",{src:Nr.visiting_team_logo,alt:""},null,8,Ice)]),e.createElementVNode("div",qce,e.toDisplayString(Nr.home_team_acronym),1),e.createElementVNode("div",jce,e.toDisplayString(Nr.matchDay?(Ir=Nr.matchDay)==null?void 0:Ir.matchDayAbbreviation:""),1),e.createElementVNode("div",Dce,e.toDisplayString(Nr.visiting_team_acronym),1)],10,Pce)}),128))],6),ne.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"carousel-arrow right",onClick:D}," › ")):e.createCommentVNode("",!0)],544))]),e.createElementVNode("div",Wce,[e.createElementVNode("div",{class:"segmented-highlight",style:e.normalizeStyle({width:`calc(100% / ${f.length})`,left:`calc(${f.indexOf(i.value)} * (100% / ${f.length}))`})},null,4),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(f,Nr=>e.createElementVNode("button",{key:Nr,class:e.normalizeClass(["categoria-tab",{active:i.value===Nr}]),onClick:Ir=>i.value=Nr},e.toDisplayString(Nr),11,Bce)),64))]),e.createElementVNode("div",Kce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,Nr=>{var Ir,ln;return e.openBlock(),e.createElementBlock("div",{key:Nr.play_id,class:e.normalizeClass(["corner-item",{selected:Nr.isSelected,disabled:Nr.disabled}]),onClick:Nn=>st(Nr)},[e.createElementVNode("div",Gce,[e.createVNode(e.unref(lce),{modelValue:Nr.isSelected,"onUpdate:modelValue":Nn=>Nr.isSelected=Nn,"avoid-interaction":!0},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("div",Zce,[e.createElementVNode("div",Jce,e.toDisplayString(Nr.mainIndex)+"/"+e.toDisplayString((ln=(Ir=ir.value)==null?void 0:Ir.corners)==null?void 0:ln.length),1)]),e.createElementVNode("div",Hce,[e.createElementVNode("div",Yce,[e.createElementVNode("span",Qce,e.toDisplayString(Nr.formattedMomentOfPlay),1),$ce,e.createElementVNode("span",tue,"| "+e.toDisplayString(Nr.player.firstNameAndFirstLastName),1)]),e.createElementVNode("div",eue,[e.createElementVNode("span",null,e.toDisplayString(Nr.howWasCornerName),1),rue,e.createElementVNode("span",null,e.toDisplayString(Nr.whatHappenedName),1)])])],10,Xce)}),128))])]),e.createElementVNode("div",nue,[d.value.length>0?(e.openBlock(),e.createElementBlock("div",aue,[e.createElementVNode("div",iue,e.toDisplayString(d.value.length)+"/10",1)])):e.createCommentVNode("",!0),k.value.length>0?(e.openBlock(),e.createElementBlock("div",oue,[e.createElementVNode("div",{class:"carousel-container",ref_key:"carouselContainerRef",ref:T},[e.createElementVNode("div",sue,e.toDisplayString(k.value.length)+" / "+e.toDisplayString(t.teamViews.length),1),e.createElementVNode("div",{ref_key:"carouselTrackRef",ref:b,class:"carousel-track"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,Nr=>{var Ir;return e.openBlock(),e.createElementBlock("div",{key:Nr.play_id,class:"footer-pill"},[e.createElementVNode("div",lue,[e.createElementVNode("div",cue,[e.createElementVNode("div",uue,[e.createElementVNode("img",{src:Nr.game.home_team_logo,alt:""},null,8,due)]),e.createElementVNode("div",pue,e.toDisplayString(Nr.game.score[0]),1)]),e.createElementVNode("div",hue,[e.createElementVNode("div",fue,[e.createElementVNode("img",{src:Nr.game.visiting_team_logo,alt:""},null,8,mue)]),e.createElementVNode("div",yue,e.toDisplayString(Nr.game.score[1]),1)])]),e.createElementVNode("div",gue,[e.createElementVNode("div",vue,[e.createElementVNode("span",bue,e.toDisplayString(Nr.game.matchDay?(Ir=Nr.game.matchDay)==null?void 0:Ir.matchDayAbbreviation:"")+" - "+e.toDisplayString(Nr.formattedMomentOfPlay),1),xue,e.createElementVNode("span",_ue,e.toDisplayString(Nr.player.firstNameAndFirstLastName),1)]),e.createElementVNode("div",wue,[e.createElementVNode("span",null,e.toDisplayString(Nr.howWasCornerName),1),Tue,e.createElementVNode("span",null,e.toDisplayString(Nr.whatHappenedName),1)])]),e.createElementVNode("button",{class:"pill-remove-btn",onClick:ln=>bt(Nr)},"×",8,Sue)])}),128))],512),h.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"carousel-arrow left",onClick:V},"‹")):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"carousel-arrow right",onClick:P},"›")):e.createCommentVNode("",!0)],512)])):(e.openBlock(),e.createElementBlock("div",kue,[e.createElementVNode("span",Lue,e.toDisplayString(d.value.length)+" de "+e.toDisplayString(t.teamViews.length)+" Tiros de esquina agregados",1)]))])]))}},[["__scopeId","data-v-7f431c81"]]),Kb=t=>(e.pushScopeId("data-v-2c61f141"),t=t(),e.popScopeId(),t),Mue={class:"modal-overlay"},Vue={class:"modal-content"},Pue={class:"modal-header"},Aue={class:"header-left"},Rue=Kb(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report-white.svg",class:"icon-title",alt:"icono reporte blanco"},null,-1)),Fue={class:"modal-title"},Uue={class:"prepartido-text"},Iue={class:"step-counter"},que=Kb(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),jue={key:0,class:"step-content"},Due={key:0,class:"content-section"},Wue=Kb(()=>e.createElementVNode("h3",{class:"section-title"},"Fortalezas",-1)),Bue=Kb(()=>e.createElementVNode("div",{class:"title-separator"},null,-1)),Kue={class:"section-description"},Xue=Kb(()=>e.createElementVNode("div",{class:"content-separator"},null,-1)),Gue={class:"radio-group"},Zue={class:"radio-option"},Jue=Kb(()=>e.createElementVNode("span",{class:"radio-custom"},null,-1)),Hue=Kb(()=>e.createElementVNode("span",{class:"radio-label"},"Automáticamente",-1)),Yue={class:"radio-option"},Que=Kb(()=>e.createElementVNode("span",{class:"radio-custom"},null,-1)),$ue=Kb(()=>e.createElementVNode("span",{class:"radio-label"},"Manualmente",-1)),tde={key:1,class:"content-section"},ede=Kb(()=>e.createElementVNode("h3",{class:"section-title"},"Tiros de esquina",-1)),rde=Kb(()=>e.createElementVNode("div",{class:"title-separator"},null,-1)),nde={class:"section-description"},ade=Kb(()=>e.createElementVNode("div",{class:"content-separator"},null,-1)),ide={class:"radio-group"},ode={class:"radio-option"},sde=Kb(()=>e.createElementVNode("span",{class:"radio-custom"},null,-1)),lde=Kb(()=>e.createElementVNode("span",{class:"radio-label"},"Automáticamente",-1)),cde={class:"radio-option"},ude=Kb(()=>e.createElementVNode("span",{class:"radio-custom"},null,-1)),dde=Kb(()=>e.createElementVNode("span",{class:"radio-label"},"Manualmente",-1)),pde={key:1,class:"step-content"},hde={key:2,class:"step-content"},fde={key:3,class:"step-content"},mde={key:4,class:"step-content"},yde={key:5,class:"step-content"},gde={key:6,class:"step-content"},vde=Kb(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),bde={class:"modal-footer"},xde=Kb(()=>e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 12L6 8L10 4",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),_de={class:"footer-actions"},wde=["disabled"],Tde=e.createStaticVNode('<div class="modal-header" data-v-2c61f141><div class="header-left" data-v-2c61f141><span class="modal-title" data-v-2c61f141>Confirmación</span></div></div><div class="header-separator" data-v-2c61f141></div><div class="modal-body" data-v-2c61f141><div class="step-content" data-v-2c61f141><h3 class="confirm-dialog-title" data-v-2c61f141>¿Estás seguro de regresar?</h3><p class="confirm-dialog-message" data-v-2c61f141>Se perderá la información seleccionada</p></div></div>',3),Sde=ov({__name:"ModalConfigurarContenido",props:{hasRival:{type:Boolean,default:!0},token:{type:String,required:!0},template:{type:Object,required:!1,default:null},team:{type:Number,required:!1,default:null},partido:{type:Object,required:!1,default:null},configData:{type:Object,default:null}},emits:["close","back","next"],setup(t,{emit:r}){const n=r,y=t;function $(){if(!y.template||!y.template.pages)return!1;for(const Jt of y.template.pages)if(Jt.components&&Array.isArray(Jt.components)&&Jt.components.some(ne=>ne.title==="Fortalezas"||ne.id===15||ne.componentName==="GSCStrengths"))return!0;return!1}function f(){if(!y.template||!y.template.pages)return{equipo:0,rival:0,total:0};let Jt=0,te=0;for(const ne of y.template.pages)if(ne.components&&Array.isArray(ne.components)){const Le=ne.components.filter(Oe=>Oe.componentName==="GSCStrengths"||Oe.id===15||Oe.name==="Fortalezas");for(const Oe of Le)Oe.dynamicFilters&&Array.isArray(Oe.dynamicFilters)&&Oe.dynamicFilters[1]&&(Oe.dynamicFilters[0]===1?Jt+=Oe.dynamicFilters[1]:Oe.dynamicFilters[0]===2?te+=Oe.dynamicFilters[1]:Oe.dynamicFilters[0]===3&&(Oe.filterMultiple.isHomeTeam?Jt+=Oe.dynamicFilters[1]:te+=Oe.dynamicFilters[1]))}return{equipo:Jt,rival:te,total:Jt+te}}const u=e.computed(()=>$()),i=e.computed(()=>f()),d=e.computed(()=>!y.template||!y.template.template_type||y.template.template_type===1?"Prepartido":"Postpartido"),l=e.computed(()=>{var ne,Le,Oe,Ne,Pe,Xe,He,$e,ir,pr,tr,Fe,sr,Ye,Te,Re,Ve,br,cr,gr,Tr,Pr;const Jt=((ne=y.partido)==null?void 0:ne.local)||((Le=y.partido)==null?void 0:Le.home_team),te=((Oe=y.partido)==null?void 0:Oe.visita)||((Ne=y.partido)==null?void 0:Ne.visiting_team);return y.team===Jt?((Xe=(Pe=y.configData)==null?void 0:Pe.partido)==null?void 0:Xe.home_team_name)||(($e=(He=y.configData)==null?void 0:He.partido)==null?void 0:$e.home_team_acronym)||((ir=y.partido)==null?void 0:ir.home_team_name)||((pr=y.partido)==null?void 0:pr.home_team_acronym)||"mi equipo":y.team===te?((Fe=(tr=y.configData)==null?void 0:tr.partido)==null?void 0:Fe.visiting_team_name)||((Ye=(sr=y.configData)==null?void 0:sr.partido)==null?void 0:Ye.visiting_team_acronym)||((Te=y.partido)==null?void 0:Te.visiting_team_name)||((Re=y.partido)==null?void 0:Re.visiting_team_acronym)||"mi equipo":((br=(Ve=y.configData)==null?void 0:Ve.partido)==null?void 0:br.home_team_name)||((gr=(cr=y.configData)==null?void 0:cr.partido)==null?void 0:gr.home_team_acronym)||((Tr=y.partido)==null?void 0:Tr.home_team_name)||((Pr=y.partido)==null?void 0:Pr.home_team_acronym)||"mi equipo"}),a=e.computed(()=>{var ne,Le,Oe,Ne,Pe,Xe,He,$e,ir,pr,tr,Fe,sr,Ye,Te,Re,Ve,br,cr,gr,Tr,Pr;const Jt=((ne=y.partido)==null?void 0:ne.local)||((Le=y.partido)==null?void 0:Le.home_team),te=((Oe=y.partido)==null?void 0:Oe.visita)||((Ne=y.partido)==null?void 0:Ne.visiting_team);return y.team===Jt?((Xe=(Pe=y.configData)==null?void 0:Pe.partido)==null?void 0:Xe.visiting_team_name)||(($e=(He=y.configData)==null?void 0:He.partido)==null?void 0:$e.visiting_team_acronym)||((ir=y.partido)==null?void 0:ir.visiting_team_name)||((pr=y.partido)==null?void 0:pr.visiting_team_acronym)||"el rival":y.team===te?((Fe=(tr=y.configData)==null?void 0:tr.partido)==null?void 0:Fe.home_team_name)||((Ye=(sr=y.configData)==null?void 0:sr.partido)==null?void 0:Ye.home_team_acronym)||((Te=y.partido)==null?void 0:Te.home_team_name)||((Re=y.partido)==null?void 0:Re.home_team_acronym)||"el rival":((br=(Ve=y.configData)==null?void 0:Ve.partido)==null?void 0:br.visiting_team_name)||((gr=(cr=y.configData)==null?void 0:cr.partido)==null?void 0:gr.visiting_team_acronym)||((Tr=y.partido)==null?void 0:Tr.visiting_team_name)||((Pr=y.partido)==null?void 0:Pr.visiting_team_acronym)||"el rival"}),S=e.computed(()=>{var ne,Le,Oe,Ne;const Jt=((ne=y.partido)==null?void 0:ne.local)||((Le=y.partido)==null?void 0:Le.home_team),te=((Oe=y.partido)==null?void 0:Oe.visita)||((Ne=y.partido)==null?void 0:Ne.visiting_team);return y.team===Jt?Jt:y.team===te?te:Jt}),T=e.computed(()=>{var ne,Le,Oe,Ne;const Jt=((ne=y.partido)==null?void 0:ne.local)||((Le=y.partido)==null?void 0:Le.home_team),te=((Oe=y.partido)==null?void 0:Oe.visita)||((Ne=y.partido)==null?void 0:Ne.visiting_team);return y.team===Jt?te:y.team===te?Jt:te}),b=e.computed({get(){var Le,Oe,Ne,Pe;const Jt=((Le=y.partido)==null?void 0:Le.local)||((Oe=y.partido)==null?void 0:Oe.home_team),te=((Ne=y.partido)==null?void 0:Ne.visita)||((Pe=y.partido)==null?void 0:Pe.visiting_team);return y.team===Jt||y.team===te,V.value},set(Jt){var Oe,Ne,Pe,Xe;const te=((Oe=y.partido)==null?void 0:Oe.local)||((Ne=y.partido)==null?void 0:Ne.home_team),ne=((Pe=y.partido)==null?void 0:Pe.visita)||((Xe=y.partido)==null?void 0:Xe.visiting_team),Le=y.team===te||y.team===ne;V.value=Jt}}),p=e.computed({get(){var Le,Oe,Ne,Pe;const Jt=((Le=y.partido)==null?void 0:Le.local)||((Oe=y.partido)==null?void 0:Oe.home_team),te=((Ne=y.partido)==null?void 0:Ne.visita)||((Pe=y.partido)==null?void 0:Pe.visiting_team);return y.team===Jt||y.team===te,I.value},set(Jt){var Oe,Ne,Pe,Xe;const te=((Oe=y.partido)==null?void 0:Oe.local)||((Ne=y.partido)==null?void 0:Ne.home_team),ne=((Pe=y.partido)==null?void 0:Pe.visita)||((Xe=y.partido)==null?void 0:Xe.visiting_team),Le=y.team===te||y.team===ne;I.value=Jt}}),s=e.computed(()=>{var ne,Le,Oe,Ne;const Jt=((ne=y.partido)==null?void 0:ne.local)||((Le=y.partido)==null?void 0:Le.home_team),te=((Oe=y.partido)==null?void 0:Oe.visita)||((Ne=y.partido)==null?void 0:Ne.visiting_team);return y.team===Jt?mt.value:y.team===te?yt.value:mt.value}),c=e.computed(()=>{var ne,Le,Oe,Ne;const Jt=((ne=y.partido)==null?void 0:ne.local)||((Le=y.partido)==null?void 0:Le.home_team),te=((Oe=y.partido)==null?void 0:Oe.visita)||((Ne=y.partido)==null?void 0:Ne.visiting_team);return y.team===Jt?yt.value:y.team===te?mt.value:yt.value}),o=e.computed(()=>{if(y.template){const Jt={homeTeamViews:[],homeTeamAgainstViews:[],awayTeamViews:[],awayTeamAgainstViews:[]};for(const te of y.template.pages)if(te.components&&Array.isArray(te.components))for(const ne of te.components)ne.coreView&&ne.coreView.id===18&&(ne.isHomeTeam?ne.componentProps&&ne.componentProps.isAgainstMode?Jt.homeTeamAgainstViews.push(ne):Jt.homeTeamViews.push(ne):ne.componentProps&&ne.componentProps.isAgainstMode?Jt.awayTeamAgainstViews.push(ne):Jt.awayTeamViews.push(ne));if(Jt.homeTeamViews.length>0||Jt.homeTeamAgainstViews.length>0||Jt.awayTeamViews.length>0||Jt.awayTeamAgainstViews.length>0)return Jt}return null}),h=e.ref(0),v=e.ref([1,2,3,4,5]),k=e.ref(!1),L=e.ref(!1),E=e.ref("manual"),P=e.ref("manual"),V=e.ref([]),I=e.ref([]),j=e.ref([]),F=e.ref([]),D=e.ref([]),U=e.ref([]),M=e.ref({cornersEquipo:[],cornersEquipoAgainst:[],cornersRival:[],cornersRivalAgainst:[]}),X=e.computed(()=>{let Jt=0;return u.value&&E.value==="manual"&&(i.value.equipo>0&&(Jt+=1),i.value.rival>0&&(Jt+=1)),o.value&&P.value==="manual"&&(o.value.homeTeamViews.length>0&&(Jt+=1),o.value.homeTeamAgainstViews.length>0&&(Jt+=1),o.value.awayTeamViews.length>0&&(Jt+=1),o.value.awayTeamAgainstViews.length>0&&(Jt+=1)),Math.max(Jt,1)}),O=e.computed(()=>{var ne,Le;if(h.value===0)return u.value||!!o.value;const te=st()[h.value];if(u.value&&te==="fortalezasEquipo"){const Oe=s.value;if(!Oe)return!1;const Ne=b.value.length,Pe=i.value.equipo,Xe=((ne=Oe.fortalezasData)==null?void 0:ne.length)||0;return Ne===Pe||Xe>0&&Xe<Pe&&Ne===Xe}if(u.value&&te==="fortalezasRival"){const Oe=c.value;if(!Oe)return!1;const Ne=p.value.length,Pe=i.value.rival,Xe=((Le=Oe.fortalezasData)==null?void 0:Le.length)||0;return Ne===Pe||Xe>0&&Xe<Pe&&Ne===Xe}if(o.value){if(te==="cornersEquipo"){if(!bt.value)return!1;const Ne=j.value.length,Pe=o.value.homeTeamViews.length,Xe=M.value.cornersEquipo.length;return Ne===Pe||Ne===Xe}if(te==="cornersEquipoAgainst"){if(!xt.value)return!1;const Ne=F.value.length,Pe=o.value.homeTeamAgainstViews.length,Xe=M.value.cornersEquipoAgainst.length;return console.log("canContinue cornersEquipoAgainst:",{selected:Ne,totalRequerido:Pe,availableCorners:Xe}),Ne===Pe||Ne===Xe}if(te==="cornersRival"){if(!Pt.value)return!1;const Ne=D.value.length,Pe=o.value.awayTeamViews.length,Xe=M.value.cornersRival.length;return Ne===Pe||Ne===Xe}if(te==="cornersRivalAgainst"){if(!qt.value)return!1;const Ne=U.value.length,Pe=o.value.awayTeamAgainstViews.length,Xe=M.value.cornersRivalAgainst.length;return Ne===Pe||Ne===Xe}}return!1});function Y(Jt,te){M.value[te]=Jt}function st(){const Jt=[];u.value&&E.value==="manual"&&(i.value.equipo>0&&Jt.push("fortalezasEquipo"),i.value.rival>0&&Jt.push("fortalezasRival")),o.value&&P.value==="manual"&&(o.value.homeTeamViews.length>0&&Jt.push("cornersEquipo"),o.value.homeTeamAgainstViews.length>0&&Jt.push("cornersEquipoAgainst"),o.value.awayTeamViews.length>0&&Jt.push("cornersRival"),o.value.awayTeamAgainstViews.length>0&&Jt.push("cornersRivalAgainst"));const te={};return Jt.forEach((ne,Le)=>{te[Le+1]=ne}),te}const mt=e.ref(null),yt=e.ref(null),bt=e.ref(null),xt=e.ref(null),Pt=e.ref(null),qt=e.ref(null);function _t(){n("close")}function It(){h.value>1?h.value--:h.value===1?V.value.length>0||I.value.length>0?L.value=!0:h.value--:n("back")}function jt(){V.value=[],I.value=[],j.value=[],D.value=[],L.value=!1,h.value--}function Rt(){L.value=!1}async function Wt(){if(h.value===0){if(!O.value)return;if(u.value&&E.value==="automatico"&&o.value&&P.value==="automatico"||!u.value&&o.value&&P.value==="automatico"||u.value&&E.value==="automatico"&&!o.value){n("next",{fortalezas:E.value,tirosEsquina:P.value,selectedFortalezasEquipo:[],selectedFortalezasRival:[],strengthsPayload:{}});return}k.value=!0,setTimeout(()=>{h.value++,k.value=!1},300)}else if(h.value<X.value)k.value=!0,setTimeout(()=>{h.value++,k.value=!1},300);else{await e.nextTick();let Jt={},te=[];u.value&&E.value==="manual"&&(Jt=re()),o.value&&P.value==="manual"&&(te=le()),n("next",{fortalezas:E.value,tirosEsquina:P.value,selectedFortalezasEquipo:V.value,selectedFortalezasRival:I.value,strengthsPayload:Jt,specificPlaysPayload:te})}}function re(){if(!y.template||!y.template.pages)return{};const Jt={};let te=mt.value,ne=yt.value;if(te){let Xe=te.fortalezasRawData;Xe&&typeof Xe=="object"&&"value"in Xe&&(Xe=Xe.value)}if(ne){let Xe=ne.fortalezasRawData;Xe&&typeof Xe=="object"&&"value"in Xe&&(Xe=Xe.value)}!te&&V.value.length>0&&console.warn("⚠️ Ref de equipo no disponible, pero hay selecciones"),!ne&&I.value.length>0&&console.warn("⚠️ Ref de rival no disponible, pero hay selecciones");const Le=he(V.value,te),Oe=he(I.value,ne);let Ne=0,Pe=0;return y.template.pages.forEach((Xe,He)=>{const $e=He+1;Xe.components&&Array.isArray(Xe.components)&&Xe.components.forEach((ir,pr)=>{var Fe,sr,Ye,Te,Re,Ve,br,cr;if(ir.componentName==="GSCStrengths"||ir.id===15||ir.name==="Fortalezas"||ir.title==="Fortalezas"){const gr=pr+1;if(ir.dynamicFilters&&Array.isArray(ir.dynamicFilters)){const Tr=ir.dynamicFilters[0],Pr=ir.dynamicFilters[1]||0;let qe=[],Ge=[],Je=y.team;Tr===1?(Ge=Le,Ge.length>Ne&&(qe=Ge.slice(Ne,Ne+Pr)),Ne+=Pr,Je=((Fe=y.partido)==null?void 0:Fe.local)||((sr=y.partido)==null?void 0:sr.home_team)||y.team):Tr===2?(Ge=Oe,Ge.length>Pe&&(qe=Ge.slice(Pe,Pe+Pr)),Pe+=Pr,Je=((Ye=y.partido)==null?void 0:Ye.visita)||((Te=y.partido)==null?void 0:Te.visiting_team)):Tr===3&&(ir.filterMultiple&&ir.filterMultiple.isHomeTeam?(Ge=Le,Ge.length>Ne&&(qe=Ge.slice(Ne,Ne+Pr)),Ne+=Pr,Je=((Re=y.partido)==null?void 0:Re.local)||((Ve=y.partido)==null?void 0:Ve.home_team)||y.team):(Ge=Oe,Ge.length>Pe&&(qe=Ge.slice(Pe,Pe+Pr)),Pe+=Pr,Je=((br=y.partido)==null?void 0:br.visita)||((cr=y.partido)==null?void 0:cr.visiting_team))),qe.length>0&&(Jt[$e]||(Jt[$e]={}),Jt[$e][gr]||(Jt[$e][gr]=[]),qe.forEach((hr,Nr)=>{Jt[$e][gr].push({team_id:Je,ranking_type:hr.ranking_type||1,precondition_id:hr.precondition_id||null,order:Nr+1,name:hr.name,category_type:hr.category_type||1,total:hr.total||0,is_relevant:hr.is_relevant||0,league_ranking:hr.league_ranking||0,categories:Array.isArray(hr.categories)?hr.categories:[hr.categories],team_contribution:hr.team_contribution||0})}))}}})}),Jt}function le(){let Jt=[];return Jt=[...j.value,...F.value,...D.value,...U.value].map(ne=>({play_id:ne.play_id,game_id:ne.game.game_id,team_id:ne.isAgainst?ne.game.home_team===ne.team_id?ne.game.visiting_team:ne.game.home_team:ne.team_id,is_against:ne.isAgainst?1:0})),Jt}function he(Jt,te){if(console.log("=== getOrderedStrengths INICIO ==="),console.log("selectedIds (orden de selección):",Jt),console.log("fortalezasViewRef existe?:",!!te),!Jt||Jt.length===0)return console.warn("No hay IDs seleccionados"),[];if(!te)return console.warn("Ref no disponible"),[];let ne=te.fortalezasRawData;if(!ne)return console.warn("fortalezasRawData no está disponible en el ref"),[];if(ne&&typeof ne=="object"&&"value"in ne&&(console.log("⚠️ fortalezasRawData es un ref, accediendo a .value"),ne=ne.value),!Array.isArray(ne))return console.warn("fortalezasRawData no es un array:",typeof ne,ne),[];if(ne.length===0)return console.warn("fortalezasRawData está vacío"),[];console.log("fortalezasRawData length:",ne.length),console.log("Primeras 2 fortalezas raw:",ne.slice(0,2));const Le=Jt.map(Oe=>{console.log(`Buscando ID: ${Oe} (tipo: ${typeof Oe})`);const Ne=ne.find(Xe=>{const He=Xe.categories===Oe||Xe.categories===Number(Oe)||String(Xe.categories)===String(Oe);return!He&&ne.indexOf(Xe)<3&&console.log(` Comparando: item.categories=${Xe.categories} (${typeof Xe.categories}) vs id=${Oe} (${typeof Oe})`),He});if(Ne)return console.log(`✓ Encontrada: ${Ne.name} (categories: ${Ne.categories})`),Ne;console.warn(`✗ No encontrada con categories = ${Oe}, intentando por id`);const Pe=ne.find(Xe=>Xe.id===Oe||Xe.id===Number(Oe)||String(Xe.id)===String(Oe));return Pe?(console.log(`✓ Encontrada por id: ${Pe.name}`),Pe):(console.error(`✗✗ No se encontró fortaleza con id/categories = ${Oe}`),null)}).filter(Boolean);return console.log(`selectedStrengths (${Le.length} de ${Jt.length} encontradas):`,Le),console.log("=== getOrderedStrengths FIN ==="),Le}function de(){const te=st()[h.value];if(te==="fortalezasEquipo"&&mt.value)return mt.value.autocompletar();if(te==="fortalezasRival"&&yt.value)return yt.value.autocompletar();if(te==="cornersEquipo"&&bt.value)return bt.value.autocompletar();if(te==="cornersEquipoAgainst"&&xt.value)return xt.value.autocompletar();if(te==="cornersRival"&&Pt.value)return Pt.value.autocompletar();if(te==="cornersRivalAgainst"&&qt.value)return qt.value.autocompletar()}return(Jt,te)=>{var ne,Le,Oe,Ne,Pe,Xe,He,$e;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Mue,[e.createElementVNode("div",Vue,[e.createElementVNode("div",Pue,[e.createElementVNode("div",Aue,[Rue,e.createElementVNode("span",Fue,[e.createTextVNode("Generar reporte  -   "),e.createElementVNode("span",Uue,e.toDisplayString(d.value),1)])]),e.createElementVNode("div",Iue," Paso "+e.toDisplayString(h.value===0?1:h.value)+" de "+e.toDisplayString(X.value),1)]),que,e.createElementVNode("div",{class:e.normalizeClass(["modal-body",{transitioning:k.value}])},[h.value===0?(e.openBlock(),e.createElementBlock("div",jue,[u.value?(e.openBlock(),e.createElementBlock("div",Due,[Wue,Bue,e.createElementVNode("p",Kue," Este template contiene "+e.toDisplayString(i.value.equipo)+" visualizaciones de Fortalezas de tu equipo y "+e.toDisplayString(i.value.rival)+" de tu rival. ¿Cómo prefieres que se agregue este contenido? ",1),Xue,e.createElementVNode("div",Gue,[e.createElementVNode("label",Zue,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"fortalezas",value:"automatico","onUpdate:modelValue":te[0]||(te[0]=ir=>E.value=ir)},null,512),[[e.vModelRadio,E.value]]),Jue,Hue]),e.createElementVNode("label",Yue,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"fortalezas",value:"manual","onUpdate:modelValue":te[1]||(te[1]=ir=>E.value=ir)},null,512),[[e.vModelRadio,E.value]]),Que,$ue])])])):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",tde,[ede,rde,e.createElementVNode("p",nde," Este template contiene "+e.toDisplayString(o.value.homeTeamViews.length)+" visualizaciones de Tiros de esquina de tu equipo y "+e.toDisplayString(o.value.awayTeamViews.length)+" visualizaciones de tu rival. ¿Cómo prefieres que se agregue este contenido? ",1),ade,e.createElementVNode("div",ide,[e.createElementVNode("label",ode,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"tiros-esquina",value:"automatico","onUpdate:modelValue":te[2]||(te[2]=ir=>P.value=ir)},null,512),[[e.vModelRadio,P.value]]),sde,lde]),e.createElementVNode("label",cde,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"tiros-esquina",value:"manual","onUpdate:modelValue":te[3]||(te[3]=ir=>P.value=ir)},null,512),[[e.vModelRadio,P.value]]),ude,dde])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),i.value.equipo>0?e.withDirectives((e.openBlock(),e.createElementBlock("div",pde,[e.createVNode(NJ,{key:"fortalezas-equipo",modelValue:b.value,"onUpdate:modelValue":te[4]||(te[4]=ir=>b.value=ir),"team-initials":"AME","season-id":(ne=y.partido)==null?void 0:ne.season_id,"team-id":S.value,"rival-team-id":T.value,"game-id":((Le=y.partido)==null?void 0:Le.game_id)||((Oe=y.partido)==null?void 0:Oe.id),token:y.token,"template-type":((Ne=y.template)==null?void 0:Ne.template_type)||1,title:`Fortalezas a favor de ${l.value}`,"total-fortalezas":i.value.equipo,ref_key:"fortalezasEquipoRef",ref:mt},null,8,["modelValue","season-id","team-id","rival-team-id","game-id","token","template-type","title","total-fortalezas"])],512)),[[e.vShow,st()[h.value]==="fortalezasEquipo"]]):e.createCommentVNode("",!0),i.value.rival>0?e.withDirectives((e.openBlock(),e.createElementBlock("div",hde,[e.createVNode(NJ,{key:"fortalezas-rival",modelValue:p.value,"onUpdate:modelValue":te[5]||(te[5]=ir=>p.value=ir),"team-initials":"RIV","season-id":(Pe=y.partido)==null?void 0:Pe.season_id,"team-id":T.value,"rival-team-id":S.value,"game-id":((Xe=y.partido)==null?void 0:Xe.game_id)||((He=y.partido)==null?void 0:He.id),token:y.token,"template-type":(($e=y.template)==null?void 0:$e.template_type)||1,title:`Fortalezas a favor de ${a.value}`,"total-fortalezas":i.value.rival,ref_key:"fortalezasRivalRef",ref:yt},null,8,["modelValue","season-id","team-id","rival-team-id","game-id","token","template-type","title","total-fortalezas"])],512)),[[e.vShow,st()[h.value]==="fortalezasRival"]]):e.createCommentVNode("",!0),o.value&&o.value.homeTeamViews.length>0?e.withDirectives((e.openBlock(),e.createElementBlock("div",fde,[e.createVNode(qO,{modelValue:j.value,"onUpdate:modelValue":te[6]||(te[6]=ir=>j.value=ir),"team-views":o.value.homeTeamViews,"is-rival":!1,"is-against-mode":!1,title:"Tiros de esquina de mi equipo","team-logo-url":t.configData.partido.localLogo,"config-data":t.configData,"user-team-id":t.team,ref_key:"cornersEquipoRef",ref:bt,onCornersFetched:te[7]||(te[7]=ir=>Y(ir,"cornersEquipo"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[e.vShow,st()[h.value]==="cornersEquipo"]]):e.createCommentVNode("",!0),o.value&&o.value.homeTeamAgainstViews.length>0?e.withDirectives((e.openBlock(),e.createElementBlock("div",mde,[e.createVNode(qO,{modelValue:F.value,"onUpdate:modelValue":te[8]||(te[8]=ir=>F.value=ir),"team-views":o.value.homeTeamAgainstViews,"is-rival":!1,"is-against-mode":!0,title:"Tiros de esquina en contra de mi equipo","team-logo-url":t.configData.partido.localLogo,"config-data":t.configData,"user-team-id":t.team,ref_key:"cornersEquipoAgainstRef",ref:xt,onCornersFetched:te[9]||(te[9]=ir=>Y(ir,"cornersEquipoAgainst"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[e.vShow,st()[h.value]==="cornersEquipoAgainst"]]):e.createCommentVNode("",!0),o.value&&o.value.awayTeamViews.length>0?e.withDirectives((e.openBlock(),e.createElementBlock("div",yde,[e.createVNode(qO,{modelValue:D.value,"onUpdate:modelValue":te[10]||(te[10]=ir=>D.value=ir),"is-rival":!0,"is-against-mode":!1,"team-views":o.value.awayTeamViews,title:"Tiros de esquina en contra del rival","team-logo-url":t.configData.partido.visitanteLogo,"config-data":t.configData,"user-team-id":t.team,ref_key:"cornersRivalRef",ref:Pt,onCornersFetched:te[11]||(te[11]=ir=>Y(ir,"cornersRival"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[e.vShow,st()[h.value]==="cornersRival"]]):e.createCommentVNode("",!0),o.value&&o.value.awayTeamAgainstViews.length>0?e.withDirectives((e.openBlock(),e.createElementBlock("div",gde,[e.createVNode(qO,{modelValue:U.value,"onUpdate:modelValue":te[12]||(te[12]=ir=>U.value=ir),"is-rival":!0,"is-against-mode":!0,"team-views":o.value.awayTeamAgainstViews,title:"Tiros de esquina en contra del rival","team-logo-url":t.configData.partido.visitanteLogo,"config-data":t.configData,"user-team-id":t.team,ref_key:"cornersRivalAgainstRef",ref:qt,onCornersFetched:te[13]||(te[13]=ir=>Y(ir,"cornersRivalAgainst"))},null,8,["modelValue","team-views","team-logo-url","config-data","user-team-id"])],512)),[[e.vShow,st()[h.value]==="cornersRivalAgainst"]]):e.createCommentVNode("",!0)],2),vde,e.createElementVNode("div",bde,[e.createElementVNode("button",{class:"back-btn",onClick:It},[xde,e.createTextVNode(" Regresar ")]),e.createElementVNode("div",_de,[h.value===0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"cancel-btn",onClick:_t},"Cancelar")):e.createCommentVNode("",!0),v.value.includes(h.value)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"cancel-btn",onClick:de}," Autocompletar ")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["next-btn",{disabled:!O.value}]),disabled:!O.value,onClick:Wt},e.toDisplayString(h.value===0?u.value&&o.value?E.value==="automatico"&&P.value==="automatico"?"Finalizar":"Siguiente":u.value?E.value==="automatico"?"Finalizar":"Siguiente":o.value?P.value==="automatico"?"Finalizar":"Siguiente":"Finalizar":h.value===X.value?"Finalizar":"Siguiente"),11,wde)])])])]),L.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-overlay",onClick:e.withModifiers(Rt,["self"])},[e.createElementVNode("div",{class:"modal-content confirm-dialog"},[Tde,e.createElementVNode("div",{class:"modal-footer"},[e.createElementVNode("div",{class:"footer-actions"},[e.createElementVNode("button",{class:"cancel-btn",onClick:Rt},"Cancelar"),e.createElementVNode("button",{class:"next-btn",onClick:jt},"Confirmar")])])])])):e.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-2c61f141"]]),jO=t=>(e.pushScopeId("data-v-bb310f7c"),t=t(),e.popScopeId(),t),kde={class:"templates-header"},Lde={class:"count"},Cde={key:0,class:"sort-options"},Nde=["onClick"],Ode={key:0,class:"checkmark"},Ede=[jO(()=>e.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],zde={key:0,class:"loading-state"},Mde=[jO(()=>e.createElementVNode("div",{class:"loading-spinner"},null,-1)),jO(()=>e.createElementVNode("p",null,"Cargando templates...",-1))],Vde=[jO(()=>e.createElementVNode("div",{class:"inner-card"},[e.createElementVNode("div",{class:"plus"},[e.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-add@3x.png",alt:"Agregar"})]),e.createElementVNode("div",{class:"create-text"},"Crear Template")],-1))],Pde=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(t,{expose:r,emit:n}){const y=n,$=t,f=e.ref(!1),u=e.ref(null),i=e.ref(!1),d=e.ref(!1),l=e.ref(!1),a=e.ref(!1),S=e.ref(!1),T=e.ref(!1),b=e.ref(null),p=e.ref(!1),s=e.ref(""),c=e.ref(""),o=e.ref(""),h=e.ref(""),v=e.ref(""),k=e.ref(""),L=e.ref(""),E=e.ref(""),P=e.ref(""),V=e.ref(null),I=e.ref(null),j=e.ref(null),F=e.ref(null),D=e.ref(0),U=e.ref([]),M=e.ref(!1),X=e.ref(null);e.watch([()=>$.team,()=>$.token],()=>{$.team&&$.token&&Y()},{immediate:!1});const O=[{label:"A - Z",value:"name-asc"},{label:"Más recientes",value:"date-desc"}],Y=async()=>{try{M.value=!0,X.value=null;const he=await M0.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates/teams/${$.team}`,{headers:{Authorization:`${$.token}`,"Content-Type":"application/json"}});he.data&&Array.isArray(he.data)?U.value=he.data:he.data&&he.data.templates?U.value=he.data.templates:he.data&&he.data.data?U.value=he.data.data:U.value=[]}catch(he){console.error("Error al obtener templates:",he),console.error("Error response:",he.response),X.value=he.message||"Error al cargar los templates",U.value=[]}finally{M.value=!1}},st=e.computed(()=>{if(!U.value.length)return[];let he=[...U.value];if($.searchQuery.trim()){const de=$.searchQuery.toLowerCase().trim();he=he.filter(Jt=>Jt.name.toLowerCase().includes(de))}switch(u.value){case"name-asc":return he.sort((de,Jt)=>de.name.localeCompare(Jt.name));case"date-desc":return he.sort((de,Jt)=>new Date(Jt.created_at)-new Date(de.created_at));default:return he}}),mt=e.computed(()=>{if(!D.value)return"grid-1-column";const he=340,de=20,te=D.value-40,ne=Math.floor((te+de)/(he+de)),Le=Math.max(1,ne);return Le>=4?"grid-4-columns":Le>=3?"grid-3-columns":Le>=2?"grid-2-columns":"grid-1-column"}),yt=()=>{f.value=!f.value},bt=he=>{u.value=he,f.value=!1},xt=he=>{const de=O.find(Jt=>Jt.value===he);return de?de.label:null},Pt=he=>{f.value&&I.value&&!I.value.contains(he.target)&&(f.value=!1)},qt=()=>{j.value&&(D.value=j.value.offsetWidth)};function _t(he){y("edit-template",he)}function It(){d.value=!1,p.value=!1}function jt(he){b.value=he,d.value=!1,p.value=!1,T.value=!0}function Rt(){T.value=!1,d.value=!0}async function Wt(he){var de,Jt,te,ne,Le,Oe,Ne,Pe,Xe;try{if(T.value=!1,!b.value)return;const He={template_id:b.value.template.id,user_id:b.value.template.user_id,tournament_id:b.value.liga.id||1,tournament_name:b.value.liga.name,season_id:b.value.partido.season_id,season_name:((de=b.value.torneo)==null?void 0:de.name)||"",game_id:b.value.partido.id||b.value.partido.game_id};he.tirosEsquina==="automatico"&&(He.auto_specific_plays_corners=!0);const $e=await M0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$.userId}/reports`,He,{headers:{Authorization:$.token,"Content-Type":"application/json"}}),ir=((Jt=$e.data)==null?void 0:Jt.id)||((te=$e.data)==null?void 0:te.report_id)||((Le=(ne=$e.data)==null?void 0:ne.data)==null?void 0:Le.id)||((Ne=(Oe=$e.data)==null?void 0:Oe.data)==null?void 0:Ne.report_id);if(console.log("Report ID obtenido:",ir),console.log("Strengths Payload recibido:",he==null?void 0:he.strengthsPayload),he.tirosEsquina==="manual"&&he.specificPlaysPayload){console.log("specificPlaysPayload recibido:",he.specificPlaysPayload);try{console.log("Enviando specific plays al endpoint...");const pr=await M0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$.userId}/reports/${ir}/specific-plays-corners`,{data:he.specificPlaysPayload},{headers:{Authorization:$.token,"Content-Type":"application/json"}});console.log("Specific plays guardados exitosamente:",pr.data)}catch(pr){console.error("Error al guardar los specific plays:",pr),console.error("Error response:",(Pe=pr.response)==null?void 0:Pe.data)}}if(he!=null&&he.strengthsPayload&&Object.keys(he.strengthsPayload).length>0&&ir)try{console.log("Enviando strengths al endpoint...");const pr=await M0.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$.userId}/reports/${ir}/strengths`,he.strengthsPayload,{headers:{Authorization:$.token,"Content-Type":"application/json"}});console.log("Strengths guardados exitosamente:",pr.data)}catch(pr){console.error("Error al guardar las fortalezas:",pr),console.error("Error response:",(Xe=pr.response)==null?void 0:Xe.data)}else console.warn("No se enviaron strengths porque:",{hasPayload:!!(he!=null&&he.strengthsPayload),payloadKeys:he!=null&&he.strengthsPayload?Object.keys(he.strengthsPayload).length:0,hasReportId:!!ir});y("switch-to-reports"),b.value=null}catch(He){console.error("Error al generar el reporte:",He),He.response&&He.response.status===409?b.value&&(L.value=b.value.template.id,P.value=b.value.template.template_type,V.value=b.value.template,p.value=!0,await e.nextTick(),d.value=!0):alert("Error al generar el reporte. Por favor, intenta de nuevo.")}}let re=null;e.onMounted(async()=>{document.addEventListener("mousedown",Pt),await e.nextTick(),qt(),window.ResizeObserver?(re=new ResizeObserver(()=>{qt()}),j.value&&re.observe(j.value)):window.addEventListener("resize",qt),Y()});function le(he){y("open-modal-new-template",he)}return e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Pt),re?re.disconnect():window.removeEventListener("resize",qt)}),r({obtenerTemplates:Y}),(he,de)=>{var Jt,te;return e.openBlock(),e.createElementBlock("div",{class:"templates-section",ref_key:"templatesSectionRef",ref:j},[e.createElementVNode("div",kde,[e.createElementVNode("span",null,[e.createTextVNode("Templates "),e.createElementVNode("span",Lde,"("+e.toDisplayString(st.value.length)+")",1)]),e.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:I},[e.createElementVNode("button",{class:"sort-button",onClick:yt},[e.createTextVNode(e.toDisplayString(xt(u.value)||"Ordenar")+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["dropdown-arrow",{rotated:f.value}])},null,2)]),f.value?(e.openBlock(),e.createElementBlock("div",Cde,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(O,ne=>e.createElementVNode("div",{key:ne.value,class:e.normalizeClass(["sort-option",{selected:u.value===ne.value}]),onClick:Le=>bt(ne.value)},[e.createElementVNode("span",null,e.toDisplayString(ne.label),1),u.value===ne.value?(e.openBlock(),e.createElementBlock("span",Ode,Ede)):e.createCommentVNode("",!0)],10,Nde)),64))])):e.createCommentVNode("",!0)],512)]),M.value?(e.openBlock(),e.createElementBlock("div",zde,Mde)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["templates-list",mt.value]),ref_key:"templatesListRef",ref:F},[e.createElementVNode("div",{class:"template-card create",onClick:de[0]||(de[0]=ne=>i.value=!0)},Vde),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value,ne=>(e.openBlock(),e.createBlock(doe,{key:ne.id,template:ne,"user-id":t.userId,onGenerarReporte:Le=>{L.value=ne.id,P.value=ne.template_type,V.value=ne,d.value=!0},onRenombrar:Le=>{E.value=ne.id,s.value=Le,c.value=ne.template_type,l.value=!0},onDuplicar:Le=>{k.value=ne.id,o.value=Le,a.value=!0},onEliminar:Le=>{h.value=Le.name,v.value=Le.id,S.value=!0},onEditTemplate:_t},null,8,["template","user-id","onGenerarReporte","onRenombrar","onDuplicar","onEliminar"]))),128))],2)),i.value?(e.openBlock(),e.createBlock(CJ,{key:2,token:t.token,team:t.team,onClose:de[1]||(de[1]=ne=>i.value=!1),onOpenModalNewTemplate:le},null,8,["token","team"])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createBlock(zse,{key:3,"user-id":t.userId,token:t.token,team:t.team,"template-id":L.value,"template-type":P.value,template:V.value,"show-error409-on-mount":p.value,onClose:It,onSwitchToReports:de[2]||(de[2]=ne=>he.$emit("switch-to-reports")),onOpenConfigurarContenido:jt},null,8,["user-id","token","team","template-id","template-type","template","show-error409-on-mount"])):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createBlock(Sde,{key:4,"has-rival":!0,token:t.token,template:((Jt=b.value)==null?void 0:Jt.template)||null,team:t.team,partido:((te=b.value)==null?void 0:te.partido)||null,"config-data":b.value,onClose:de[3]||(de[3]=ne=>T.value=!1),onBack:Rt,onNext:Wt},null,8,["token","template","team","partido","config-data"])):e.createCommentVNode("",!0),l.value?(e.openBlock(),e.createBlock(Gse,{key:5,initialName:s.value,token:t.token,"template-id":E.value,"template-type":c.value,"user-id":t.userId,onRefresh:de[4]||(de[4]=ne=>Y()),onClose:de[5]||(de[5]=ne=>l.value=!1),onRename:de[6]||(de[6]=ne=>{l.value=!1})},null,8,["initialName","token","template-id","template-type","user-id"])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createBlock(ile,{key:6,initialName:o.value,token:t.token,"template-id":k.value,onClose:de[7]||(de[7]=ne=>a.value=!1),onTemplateDuplicated:de[8]||(de[8]=ne=>{a.value=!1,Y()})},null,8,["initialName","token","template-id"])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createBlock(hle,{key:7,"template-id":v.value,"user-id":t.userId,token:t.token,onClose:de[9]||(de[9]=ne=>S.value=!1),onTemplateDeleted:de[10]||(de[10]=ne=>{S.value=!1,Y()})},null,8,["template-id","user-id","token"])):e.createCommentVNode("",!0)],512)}}},[["__scopeId","data-v-bb310f7c"]]),NA=t=>(e.pushScopeId("data-v-246ad2d7"),t=t(),e.popScopeId(),t),Ade={class:"tooltip-report-options"},Rde=NA(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",alt:"Renombrar reporte",class:"icon"},null,-1)),Fde=NA(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-download.svg",alt:"Descargar reporte",class:"icon"},null,-1)),Ude=NA(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-delete.svg",alt:"Eliminar reporte",class:"icon"},null,-1)),Ide=ov({__name:"TooltipReportOptions",emits:["ver-reporte","renombrar","editar","duplicar","descargar","eliminar"],setup(t,{emit:r}){return(n,y)=>(e.openBlock(),e.createElementBlock("div",Ade,[e.createElementVNode("ul",null,[e.createElementVNode("li",{class:"option",onClick:y[0]||(y[0]=$=>n.$emit("renombrar"))},[Rde,e.createTextVNode(" Renombrar reporte ")]),e.createElementVNode("li",{class:"option",onClick:y[1]||(y[1]=$=>n.$emit("descargar"))},[Fde,e.createTextVNode(" Descargar reporte ")]),e.createElementVNode("li",{class:"option",onClick:y[2]||(y[2]=$=>n.$emit("eliminar"))},[Ude,e.createTextVNode(" Eliminar reporte ")])])]))}},[["__scopeId","data-v-246ad2d7"]]);function F4(t){if(!t)return"";const r=new Date(t);if(isNaN(r.getTime()))return"";const n=r.getDate(),y=r.toLocaleDateString("es-ES",{month:"short"}),$=r.getFullYear();return`${n} ${y}, ${$}`}const qde=t=>(e.pushScopeId("data-v-bb7e7ba7"),t=t(),e.popScopeId(),t),jde={class:"prematch-bg"},Dde={class:"background-shields"},Wde={class:"shield-left"},Bde=["src"],Kde={class:"shield-right"},Xde=["src"],Gde=qde(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),Zde={class:"subtitle"},Jde={class:"jornada"},Hde={class:"fecha"},Yde={class:"teams-row"},Qde={class:"team team-local"},$de={class:"escudo-svg"},tpe=["src"],epe={class:"team-name"},rpe={class:"team team-visitor"},npe={class:"escudo-svg"},ape=["src"],ipe={class:"team-name"},ope=ov({__name:"AnalisisPrematchType1",props:{report:{type:Object,default:()=>({})}},setup(t){function r(y){return y?y.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=t;return(y,$)=>(e.openBlock(),e.createElementBlock("div",jde,[e.createElementVNode("div",Dde,[e.createElementVNode("div",Wde,[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+n.report.game.home_team+".png",alt:"Escudo local"},null,8,Bde)]),e.createElementVNode("div",Kde,[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+n.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,Xde)])]),Gde,e.createElementVNode("div",Zde,[e.createElementVNode("span",Jde,e.toDisplayString(r(n.report.game.matchday_name)),1),e.createElementVNode("span",Hde," - "+e.toDisplayString(e.unref(F4)(n.report.game.date_time_utc)),1)]),e.createElementVNode("div",Yde,[e.createElementVNode("div",Qde,[e.createElementVNode("span",$de,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.home_team+".png"},null,8,tpe)]),e.createElementVNode("span",epe,e.toDisplayString(n.report.game.home_team_acronym),1)]),e.createElementVNode("div",rpe,[e.createElementVNode("span",npe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.visiting_team+".png"},null,8,ape)]),e.createElementVNode("span",ipe,e.toDisplayString(n.report.game.visiting_team_acronym),1)])])]))}},[["__scopeId","data-v-bb7e7ba7"]]),r7=t=>(e.pushScopeId("data-v-78d552f2"),t=t(),e.popScopeId(),t),spe={class:"prematch-bg"},lpe={class:"background-shields"},cpe={class:"shield-left"},upe=["src"],dpe={class:"shield-right"},ppe=["src"],hpe=r7(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),fpe={class:"subtitle"},mpe={class:"jornada"},ype={class:"fecha"},gpe={class:"teams-grid"},vpe={class:"row row-top"},bpe={class:"team team-local"},xpe={class:"escudo-svg"},_pe=["src"],wpe={class:"team-name"},Tpe={class:"score"},Spe={class:"score-text"},kpe={class:"team team-visitor"},Lpe={class:"team-name"},Cpe={class:"escudo-svg"},Npe=["src"],Ope={class:"row row-bottom"},Epe={class:"team-stats"},zpe=e.createStaticVNode('<span class="stat ball" data-v-78d552f2><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-78d552f2><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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path></svg></span>',1),Mpe={class:"stat red"},Vpe=r7(()=>e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})],-1)),Ppe={class:"stat-number"},Ape={class:"stat yellow"},Rpe=r7(()=>e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})],-1)),Fpe={class:"stat-number"},Upe=r7(()=>e.createElementVNode("div",{class:"empty"},null,-1)),Ipe={class:"team-stats"},qpe={class:"stat-number"},jpe=r7(()=>e.createElementVNode("span",{class:"stat yellow"},[e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})])],-1)),Dpe={class:"stat-number"},Wpe=r7(()=>e.createElementVNode("span",{class:"stat red"},[e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})])],-1)),Bpe=e.createStaticVNode('<span class="stat ball" data-v-78d552f2><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-78d552f2><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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path></svg></span>',1),Kpe=ov({__name:"AnalisisPostMatchType1",props:{report:{type:Object,default:()=>({})}},setup(t){function r(l){return l?l.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=t,y=e.computed(()=>{var S,T,b;const l=(b=(T=(S=n.report)==null?void 0:S.game)==null?void 0:T.minutes)==null?void 0:b.home_goals_minutes;if(!Array.isArray(l)||l.length===0)return null;const a=l.map(p=>{const s=p.match(/(\d+)'$/);return s?s[1]+"'":""}).filter(p=>p!=="");if(a.length>5){const p=a.slice(0,5).join(", "),s=a.slice(5).join(", ");return`${p}
7999
7999
  ${s}`}return a.join(", ")}),$=e.computed(()=>{var S,T,b;const l=(b=(T=(S=n.report)==null?void 0:S.game)==null?void 0:T.minutes)==null?void 0:b.visiting_goals_minutes;if(!Array.isArray(l)||l.length===0)return null;const a=l.map(p=>{const s=p.match(/(\d+)'$/);return s?s[1]+"'":""}).filter(p=>p!=="");if(a.length>5){const p=a.slice(0,5).join(", "),s=a.slice(5).join(", ");return`${p}
8000
8000
  ${s}`}return a.join(", ")}),f=e.computed(()=>{var a,S,T;const l=(T=(S=(a=n.report)==null?void 0:a.game)==null?void 0:S.minutes)==null?void 0:T.home_red_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null}),u=e.computed(()=>{var a,S,T;const l=(T=(S=(a=n.report)==null?void 0:a.game)==null?void 0:S.minutes)==null?void 0:T.home_yellow_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null}),i=e.computed(()=>{var a,S,T;const l=(T=(S=(a=n.report)==null?void 0:a.game)==null?void 0:S.minutes)==null?void 0:T.away_yellow_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null}),d=e.computed(()=>{var a,S,T;const l=(T=(S=(a=n.report)==null?void 0:a.game)==null?void 0:S.minutes)==null?void 0:T.away_red_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null});return(l,a)=>(e.openBlock(),e.createElementBlock("div",spe,[e.createElementVNode("div",lpe,[e.createElementVNode("div",cpe,[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+t.report.game.home_team+".png",alt:"Escudo local"},null,8,upe)]),e.createElementVNode("div",dpe,[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+t.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,ppe)])]),hpe,e.createElementVNode("div",fpe,[e.createElementVNode("span",mpe,e.toDisplayString(r(t.report.game.matchday_name)),1),e.createElementVNode("span",ype," - "+e.toDisplayString(e.unref(F4)(t.report.game.date_time_utc)),1)]),e.createElementVNode("div",gpe,[e.createElementVNode("div",vpe,[e.createElementVNode("div",bpe,[e.createElementVNode("span",xpe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+t.report.game.home_team+".png"},null,8,_pe)]),e.createElementVNode("span",wpe,e.toDisplayString(t.report.game.home_team_acronym),1)]),e.createElementVNode("div",Tpe,[e.createElementVNode("span",Spe,e.toDisplayString(t.report.game.score[0])+":"+e.toDisplayString(t.report.game.score[1]),1)]),e.createElementVNode("div",kpe,[e.createElementVNode("span",Lpe,e.toDisplayString(t.report.game.visiting_team_acronym),1),e.createElementVNode("span",Cpe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+t.report.game.visiting_team+".png"},null,8,Npe)])])]),e.createElementVNode("div",Ope,[e.createElementVNode("div",Epe,[zpe,y.value!==null?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["stat time",{"two-lines":y.value&&y.value.includes(`
8001
8001
  `)}])},e.toDisplayString(y.value),3)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["separator",{"two-lines":y.value&&y.value.includes(`
8002
8002
  `)}])},null,2),e.createElementVNode("span",Mpe,[Vpe,e.createElementVNode("span",Ppe,e.toDisplayString(f.value||0),1)]),e.createElementVNode("span",Ape,[Rpe,e.createElementVNode("span",Fpe,e.toDisplayString(u.value||0),1)])]),Upe,e.createElementVNode("div",Ipe,[e.createElementVNode("span",qpe,e.toDisplayString(i.value||0),1),jpe,e.createElementVNode("span",Dpe,e.toDisplayString(d.value||0),1),Wpe,e.createElementVNode("div",{class:e.normalizeClass(["separator",{"two-lines":$.value&&$.value.includes(`
8003
8003
  `)}])},null,2),$.value!==null?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["stat time",{"two-lines":$.value&&$.value.includes(`
8004
- `)}])},e.toDisplayString($.value),3)):e.createCommentVNode("",!0),Bpe])])])]))}},[["__scopeId","data-v-7dd14646"]]),Xpe=t=>(e.pushScopeId("data-v-ef17e1af"),t=t(),e.popScopeId(),t),Gpe={class:"prematch-bg"},Zpe={class:"background-shields"},Jpe={class:"shield-left"},Hpe=["src"],Ype={class:"shield-right"},Qpe=["src"],$pe=Xpe(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),the={class:"subtitle"},ehe={class:"jornada"},rhe={class:"fecha"},nhe={class:"teams-row"},ahe={class:"team team-local"},ihe={class:"escudo-svg"},ohe=["src"],she={class:"team-name"},lhe={class:"team team-visitor"},che={class:"escudo-svg"},uhe=["src"],dhe={class:"team-name"},phe=ov({__name:"AnalisisPrematchType2",props:{report:{type:Object,default:()=>({})}},setup(t){function r(y){return y?y.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=t;return(y,$)=>(e.openBlock(),e.createElementBlock("div",Gpe,[e.createElementVNode("div",Zpe,[e.createElementVNode("div",Jpe,[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+n.report.game.home_team+".png",alt:"Escudo local"},null,8,Hpe)]),e.createElementVNode("div",Ype,[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+n.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,Qpe)])]),$pe,e.createElementVNode("div",the,[e.createElementVNode("span",ehe,e.toDisplayString(r(n.report.game.matchday_name)),1),e.createElementVNode("span",rhe," - "+e.toDisplayString(e.unref(F4)(n.report.game.date_time_utc)),1)]),e.createElementVNode("div",nhe,[e.createElementVNode("div",ahe,[e.createElementVNode("span",ihe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.home_team+".png"},null,8,ohe)]),e.createElementVNode("span",she,e.toDisplayString(n.report.game.home_team_acronym),1)]),e.createElementVNode("div",lhe,[e.createElementVNode("span",che,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.visiting_team+".png"},null,8,uhe)]),e.createElementVNode("span",dhe,e.toDisplayString(n.report.game.visiting_team_acronym),1)])])]))}},[["__scopeId","data-v-ef17e1af"]]),n7=t=>(e.pushScopeId("data-v-63a8a7f8"),t=t(),e.popScopeId(),t),hhe={class:"prematch-bg"},fhe={class:"background-shields"},mhe={class:"shield-left"},yhe=["src"],ghe={class:"shield-right"},vhe=["src"],bhe=n7(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),xhe={class:"subtitle"},_he={class:"jornada"},whe={class:"fecha"},The={class:"teams-grid"},She={class:"row row-top"},khe={class:"team team-local"},Lhe={class:"escudo-svg"},Che=["src"],Nhe={class:"team-name"},Ohe={class:"score"},Ehe={class:"score-text"},zhe={class:"team team-visitor"},Mhe={class:"team-name"},Vhe={class:"escudo-svg"},Phe=["src"],Ahe={class:"row row-bottom"},Rhe={class:"team-stats"},Fhe=e.createStaticVNode('<span class="stat ball" data-v-63a8a7f8><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-63a8a7f8><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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path></svg></span>',1),Uhe={class:"stat red"},Ihe=n7(()=>e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})],-1)),qhe={class:"stat-number"},jhe={class:"stat yellow"},Dhe=n7(()=>e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})],-1)),Whe={class:"stat-number"},Bhe=n7(()=>e.createElementVNode("div",{class:"empty"},null,-1)),Khe={class:"team-stats"},Xhe={class:"stat-number"},Ghe=n7(()=>e.createElementVNode("span",{class:"stat yellow"},[e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})])],-1)),Zhe={class:"stat-number"},Jhe=n7(()=>e.createElementVNode("span",{class:"stat red"},[e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})])],-1)),Hhe=e.createStaticVNode('<span class="stat ball" data-v-63a8a7f8><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-63a8a7f8><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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path></svg></span>',1),Yhe=ov({__name:"AnalisisPostMatchType2",props:{report:{type:Object,default:()=>({})}},setup(t){function r(l){return l?l.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=t,y=e.computed(()=>{var S,T,b;const l=(b=(T=(S=n.report)==null?void 0:S.game)==null?void 0:T.minutes)==null?void 0:b.home_goals_minutes;if(!Array.isArray(l)||l.length===0)return null;const a=l.map(p=>{const s=p.match(/(\d+)'$/);return s?s[1]+"'":""}).filter(p=>p!=="");if(a.length>5){const p=a.slice(0,5).join(", "),s=a.slice(5).join(", ");return`${p}
8004
+ `)}])},e.toDisplayString($.value),3)):e.createCommentVNode("",!0),Bpe])])])]))}},[["__scopeId","data-v-78d552f2"]]),Xpe=t=>(e.pushScopeId("data-v-ef17e1af"),t=t(),e.popScopeId(),t),Gpe={class:"prematch-bg"},Zpe={class:"background-shields"},Jpe={class:"shield-left"},Hpe=["src"],Ype={class:"shield-right"},Qpe=["src"],$pe=Xpe(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),the={class:"subtitle"},ehe={class:"jornada"},rhe={class:"fecha"},nhe={class:"teams-row"},ahe={class:"team team-local"},ihe={class:"escudo-svg"},ohe=["src"],she={class:"team-name"},lhe={class:"team team-visitor"},che={class:"escudo-svg"},uhe=["src"],dhe={class:"team-name"},phe=ov({__name:"AnalisisPrematchType2",props:{report:{type:Object,default:()=>({})}},setup(t){function r(y){return y?y.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=t;return(y,$)=>(e.openBlock(),e.createElementBlock("div",Gpe,[e.createElementVNode("div",Zpe,[e.createElementVNode("div",Jpe,[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+n.report.game.home_team+".png",alt:"Escudo local"},null,8,Hpe)]),e.createElementVNode("div",Ype,[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+n.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,Qpe)])]),$pe,e.createElementVNode("div",the,[e.createElementVNode("span",ehe,e.toDisplayString(r(n.report.game.matchday_name)),1),e.createElementVNode("span",rhe," - "+e.toDisplayString(e.unref(F4)(n.report.game.date_time_utc)),1)]),e.createElementVNode("div",nhe,[e.createElementVNode("div",ahe,[e.createElementVNode("span",ihe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.home_team+".png"},null,8,ohe)]),e.createElementVNode("span",she,e.toDisplayString(n.report.game.home_team_acronym),1)]),e.createElementVNode("div",lhe,[e.createElementVNode("span",che,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.visiting_team+".png"},null,8,uhe)]),e.createElementVNode("span",dhe,e.toDisplayString(n.report.game.visiting_team_acronym),1)])])]))}},[["__scopeId","data-v-ef17e1af"]]),n7=t=>(e.pushScopeId("data-v-2a752817"),t=t(),e.popScopeId(),t),hhe={class:"prematch-bg"},fhe={class:"background-shields"},mhe={class:"shield-left"},yhe=["src"],ghe={class:"shield-right"},vhe=["src"],bhe=n7(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),xhe={class:"subtitle"},_he={class:"jornada"},whe={class:"fecha"},The={class:"teams-grid"},She={class:"row row-top"},khe={class:"team team-local"},Lhe={class:"escudo-svg"},Che=["src"],Nhe={class:"team-name"},Ohe={class:"score"},Ehe={class:"score-text"},zhe={class:"team team-visitor"},Mhe={class:"team-name"},Vhe={class:"escudo-svg"},Phe=["src"],Ahe={class:"row row-bottom"},Rhe={class:"team-stats"},Fhe=e.createStaticVNode('<span class="stat ball" data-v-2a752817><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-2a752817><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-2a752817></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-2a752817></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-2a752817></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-2a752817></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-2a752817></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-2a752817></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-2a752817></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path></svg></span>',1),Uhe={class:"stat red"},Ihe=n7(()=>e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})],-1)),qhe={class:"stat-number"},jhe={class:"stat yellow"},Dhe=n7(()=>e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})],-1)),Whe={class:"stat-number"},Bhe=n7(()=>e.createElementVNode("div",{class:"empty"},null,-1)),Khe={class:"team-stats"},Xhe={class:"stat-number"},Ghe=n7(()=>e.createElementVNode("span",{class:"stat yellow"},[e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})])],-1)),Zhe={class:"stat-number"},Jhe=n7(()=>e.createElementVNode("span",{class:"stat red"},[e.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})])],-1)),Hhe=e.createStaticVNode('<span class="stat ball" data-v-2a752817><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-2a752817><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-2a752817></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-2a752817></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-2a752817></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-2a752817></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-2a752817></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-2a752817></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-2a752817></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path></svg></span>',1),Yhe=ov({__name:"AnalisisPostMatchType2",props:{report:{type:Object,default:()=>({})}},setup(t){function r(l){return l?l.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=t,y=e.computed(()=>{var S,T,b;const l=(b=(T=(S=n.report)==null?void 0:S.game)==null?void 0:T.minutes)==null?void 0:b.home_goals_minutes;if(!Array.isArray(l)||l.length===0)return null;const a=l.map(p=>{const s=p.match(/(\d+)'$/);return s?s[1]+"'":""}).filter(p=>p!=="");if(a.length>5){const p=a.slice(0,5).join(", "),s=a.slice(5).join(", ");return`${p}
8005
8005
  ${s}`}return a.join(", ")}),$=e.computed(()=>{var S,T,b;const l=(b=(T=(S=n.report)==null?void 0:S.game)==null?void 0:T.minutes)==null?void 0:b.visiting_goals_minutes;if(!Array.isArray(l)||l.length===0)return null;const a=l.map(p=>{const s=p.match(/(\d+)'$/);return s?s[1]+"'":""}).filter(p=>p!=="");if(a.length>5){const p=a.slice(0,5).join(", "),s=a.slice(5).join(", ");return`${p}
8006
8006
  ${s}`}return a.join(", ")}),f=e.computed(()=>{var a,S,T;const l=(T=(S=(a=n.report)==null?void 0:a.game)==null?void 0:S.minutes)==null?void 0:T.home_red_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null}),u=e.computed(()=>{var a,S,T;const l=(T=(S=(a=n.report)==null?void 0:a.game)==null?void 0:S.minutes)==null?void 0:T.home_yellow_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null}),i=e.computed(()=>{var a,S,T;const l=(T=(S=(a=n.report)==null?void 0:a.game)==null?void 0:S.minutes)==null?void 0:T.away_yellow_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null}),d=e.computed(()=>{var a,S,T;const l=(T=(S=(a=n.report)==null?void 0:a.game)==null?void 0:S.minutes)==null?void 0:T.away_red_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null});return(l,a)=>(e.openBlock(),e.createElementBlock("div",hhe,[e.createElementVNode("div",fhe,[e.createElementVNode("div",mhe,[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+t.report.game.home_team+".png",alt:"Escudo local"},null,8,yhe)]),e.createElementVNode("div",ghe,[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+t.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,vhe)])]),bhe,e.createElementVNode("div",xhe,[e.createElementVNode("span",_he,"Jornada "+e.toDisplayString(r(t.report.game.matchday_name)),1),e.createElementVNode("span",whe," - "+e.toDisplayString(e.unref(F4)(t.report.game.date_time_utc)),1)]),e.createElementVNode("div",The,[e.createElementVNode("div",She,[e.createElementVNode("div",khe,[e.createElementVNode("span",Lhe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+t.report.game.home_team+".png"},null,8,Che)]),e.createElementVNode("span",Nhe,e.toDisplayString(t.report.game.home_team_acronym),1)]),e.createElementVNode("div",Ohe,[e.createElementVNode("span",Ehe,e.toDisplayString(t.report.game.score[0])+":"+e.toDisplayString(t.report.game.score[1]),1)]),e.createElementVNode("div",zhe,[e.createElementVNode("span",Mhe,e.toDisplayString(t.report.game.visiting_team_acronym),1),e.createElementVNode("span",Vhe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+t.report.game.visiting_team+".png"},null,8,Phe)])])]),e.createElementVNode("div",Ahe,[e.createElementVNode("div",Rhe,[Fhe,y.value!==null?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["stat time",{"two-lines":y.value&&y.value.includes(`
8007
8007
  `)}])},e.toDisplayString(y.value),3)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["separator",{"two-lines":y.value&&y.value.includes(`
8008
8008
  `)}])},null,2),e.createElementVNode("span",Uhe,[Ihe,e.createElementVNode("span",qhe,e.toDisplayString(f.value||0),1)]),e.createElementVNode("span",jhe,[Dhe,e.createElementVNode("span",Whe,e.toDisplayString(u.value||0),1)])]),Bhe,e.createElementVNode("div",Khe,[e.createElementVNode("span",Xhe,e.toDisplayString(i.value||0),1),Ghe,e.createElementVNode("span",Zhe,e.toDisplayString(d.value||0),1),Jhe,e.createElementVNode("div",{class:e.normalizeClass(["separator",{"two-lines":$.value&&$.value.includes(`
8009
8009
  `)}])},null,2),$.value!==null?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["stat time",{"two-lines":$.value&&$.value.includes(`
8010
- `)}])},e.toDisplayString($.value),3)):e.createCommentVNode("",!0),Hhe])])])]))}},[["__scopeId","data-v-63a8a7f8"]]),EJ=t=>(e.pushScopeId("data-v-b31afbdf"),t=t(),e.popScopeId(),t),Qhe={class:"prematch-bg"},$he=EJ(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),tfe={class:"subtitle"},efe={class:"jornada"},rfe={class:"fecha"},nfe={class:"teams-row"},afe={class:"team team-local"},ife={class:"escudo-svg"},ofe=["src"],sfe=EJ(()=>e.createElementVNode("div",{class:"divider-line"},[e.createElementVNode("div",{class:"dotted-line"})],-1)),lfe={class:"team team-visitor"},cfe={class:"escudo-svg"},ufe=["src"],dfe=ov({__name:"AnalisisPrematchType3",props:{report:{type:Object,default:()=>({})}},setup(t){function r(y){return y?y.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=t;return(y,$)=>(e.openBlock(),e.createElementBlock("div",Qhe,[$he,e.createElementVNode("div",tfe,[e.createElementVNode("span",efe,e.toDisplayString(r(n.report.game.matchday_name)),1),e.createElementVNode("span",rfe," - "+e.toDisplayString(e.unref(F4)(n.report.game.date_time_utc)),1)]),e.createElementVNode("div",nfe,[e.createElementVNode("div",afe,[e.createElementVNode("span",ife,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.home_team+".png"},null,8,ofe)])]),sfe,e.createElementVNode("div",lfe,[e.createElementVNode("span",cfe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.visiting_team+".png"},null,8,ufe)])])])]))}},[["__scopeId","data-v-b31afbdf"]]),a7=t=>(e.pushScopeId("data-v-893ebf20"),t=t(),e.popScopeId(),t),pfe={class:"prematch-bg"},hfe=a7(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),ffe={class:"subtitle"},mfe={class:"jornada"},yfe={class:"fecha"},gfe={class:"teams-row"},vfe={class:"team team-local"},bfe={class:"team-header"},xfe={class:"escudo-svg"},_fe=["src"],wfe={class:"score"},Tfe={class:"players-list"},Sfe={class:"player-name"},kfe=a7(()=>e.createElementVNode("span",{class:"player-icon"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("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"}),e.createElementVNode("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"})])],-1)),Lfe={key:0,class:"more-events-indicator"},Cfe=[a7(()=>e.createElementVNode("span",{class:"more-events-text"},"...",-1))],Nfe=a7(()=>e.createElementVNode("div",{class:"divider-line"},[e.createElementVNode("div",{class:"dotted-line"})],-1)),Ofe={class:"team team-visitor"},Efe={class:"team-header"},zfe={class:"score"},Mfe={class:"escudo-svg"},Vfe=["src"],Pfe={class:"players-list"},Afe=a7(()=>e.createElementVNode("span",{class:"player-icon"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("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"}),e.createElementVNode("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"})])],-1)),Rfe={class:"player-name"},Ffe={key:0},Ufe={key:0,class:"more-events-indicator"},Ife=[a7(()=>e.createElementVNode("span",{class:"more-events-text"},"...",-1))],qfe=ov({__name:"AnalisisPostMatchType3",props:{report:{type:Object,default:()=>({})}},setup(t){function r(d){return d?d.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=t,y=e.computed(()=>{var d,l,a;return(((a=(l=(d=n.report)==null?void 0:d.game)==null?void 0:l.report_minutes)==null?void 0:a.home_goals_minutes)||[]).slice(0,5)}),$=e.computed(()=>{var d,l,a;return(((a=(l=(d=n.report)==null?void 0:d.game)==null?void 0:l.report_minutes)==null?void 0:a.visiting_goals_minutes)||[]).slice(0,5)});function f(d){const l=Array.from(d.matchAll(/\d+\s*\+*\s*\d*'/g)).map(T=>T[0]).join(", "),a=d.match(/^(.*?)\s*\d+'/),S=a?" "+a[1].trim():"";return{minutos:l,nombre:S}}const u=e.computed(()=>{var l,a,S,T;return(((T=(S=(a=(l=n.report)==null?void 0:l.game)==null?void 0:a.report_minutes)==null?void 0:S.home_goals_minutes)==null?void 0:T.length)||0)>5}),i=e.computed(()=>{var l,a,S,T;return(((T=(S=(a=(l=n.report)==null?void 0:l.game)==null?void 0:a.report_minutes)==null?void 0:S.visiting_goals_minutes)==null?void 0:T.length)||0)>5});return(d,l)=>(e.openBlock(),e.createElementBlock("div",pfe,[hfe,e.createElementVNode("div",ffe,[e.createElementVNode("span",mfe,"Jornada "+e.toDisplayString(r(t.report.game.matchday_name)),1),e.createElementVNode("span",yfe," - "+e.toDisplayString(e.unref(F4)(t.report.game.date_time_utc)),1)]),e.createElementVNode("div",gfe,[e.createElementVNode("div",vfe,[e.createElementVNode("div",bfe,[e.createElementVNode("span",xfe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+t.report.game.home_team+".png"},null,8,_fe)]),e.createElementVNode("div",wfe,e.toDisplayString(t.report.game.score[0]),1)]),e.createElementVNode("div",Tfe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,S)=>(e.openBlock(),e.createElementBlock("div",{key:`home-event-${S}`,class:"player-item"},[e.createElementVNode("span",Sfe,e.toDisplayString(a)+" ",1),kfe]))),128)),u.value?(e.openBlock(),e.createElementBlock("div",Lfe,Cfe)):e.createCommentVNode("",!0)])]),Nfe,e.createElementVNode("div",Ofe,[e.createElementVNode("div",Efe,[e.createElementVNode("div",zfe,e.toDisplayString(t.report.game.score[1]),1),e.createElementVNode("span",Mfe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+t.report.game.visiting_team+".png"},null,8,Vfe)])]),e.createElementVNode("div",Pfe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(a,S)=>(e.openBlock(),e.createElementBlock("div",{key:`visiting-event-${S}`,class:"player-item"},[Afe,e.createElementVNode("span",Rfe,[e.createTextVNode(e.toDisplayString(f(a).minutos)+" ",1),f(a).nombre?(e.openBlock(),e.createElementBlock("span",Ffe,e.toDisplayString(f(a).nombre),1)):e.createCommentVNode("",!0)])]))),128)),i.value?(e.openBlock(),e.createElementBlock("div",Ufe,Ife)):e.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-893ebf20"]]),zJ=t=>(e.pushScopeId("data-v-ef3bf0e5"),t=t(),e.popScopeId(),t),jfe={class:"prematch-bg"},Dfe=zJ(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),Wfe={class:"subtitle"},Bfe={class:"jornada"},Kfe={class:"fecha"},Xfe={class:"teams-row"},Gfe={class:"team team-local"},Zfe={class:"escudo-svg"},Jfe=["src"],Hfe=zJ(()=>e.createElementVNode("div",{class:"divider-line"},[e.createElementVNode("div",{class:"dotted-line"})],-1)),Yfe={class:"team team-visitor"},Qfe={class:"escudo-svg"},$fe=["src"],tme=ov({__name:"AnalisisPrematchType4",props:{report:{type:Object,default:()=>({})}},setup(t){function r(y){return y?y.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=t;return(y,$)=>(e.openBlock(),e.createElementBlock("div",jfe,[Dfe,e.createElementVNode("div",Wfe,[e.createElementVNode("span",Bfe,e.toDisplayString(r(n.report.game.matchday_name)),1),e.createElementVNode("span",Kfe," - "+e.toDisplayString(e.unref(F4)(n.report.game.date_time_utc)),1)]),e.createElementVNode("div",Xfe,[e.createElementVNode("div",Gfe,[e.createElementVNode("span",Zfe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.home_team+".png"},null,8,Jfe)])]),Hfe,e.createElementVNode("div",Yfe,[e.createElementVNode("span",Qfe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.visiting_team+".png"},null,8,$fe)])])])]))}},[["__scopeId","data-v-ef3bf0e5"]]),i7=t=>(e.pushScopeId("data-v-9c7a5ed5"),t=t(),e.popScopeId(),t),eme={class:"prematch-bg"},rme=i7(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),nme={class:"subtitle"},ame={class:"jornada"},ime={class:"fecha"},ome={class:"teams-row"},sme={class:"team team-local"},lme={class:"team-header"},cme={class:"escudo-svg"},ume=["src"],dme={class:"score"},pme={class:"players-list"},hme={class:"player-name"},fme=i7(()=>e.createElementVNode("span",{class:"player-icon"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("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"}),e.createElementVNode("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"})])],-1)),mme={key:0,class:"more-events-indicator"},yme=[i7(()=>e.createElementVNode("span",{class:"more-events-text"},"...",-1))],gme=i7(()=>e.createElementVNode("div",{class:"divider-line"},[e.createElementVNode("div",{class:"dotted-line"})],-1)),vme={class:"team team-visitor"},bme={class:"team-header"},xme={class:"score"},_me={class:"escudo-svg"},wme=["src"],Tme={class:"players-list"},Sme=i7(()=>e.createElementVNode("span",{class:"player-icon"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("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"}),e.createElementVNode("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"})])],-1)),kme={class:"player-name"},Lme={key:0},Cme={key:0,class:"more-events-indicator"},Nme=[i7(()=>e.createElementVNode("span",{class:"more-events-text"},"...",-1))],Ome=ov({__name:"AnalisisPostMatchType4",props:{report:{type:Object,default:()=>({})}},setup(t){function r(d){return d?d.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=t,y=e.computed(()=>{var d,l,a;return(((a=(l=(d=n.report)==null?void 0:d.game)==null?void 0:l.report_minutes)==null?void 0:a.home_goals_minutes)||[]).slice(0,5)}),$=e.computed(()=>{var d,l,a;return(((a=(l=(d=n.report)==null?void 0:d.game)==null?void 0:l.report_minutes)==null?void 0:a.visiting_goals_minutes)||[]).slice(0,5)});function f(d){const l=Array.from(d.matchAll(/\d+\s*\+*\s*\d*'/g)).map(T=>T[0]).join(", "),a=d.match(/^(.*?)\s*\d+'/),S=a?a[1].trim():"";return{minutos:l,nombre:S}}const u=e.computed(()=>{var l,a,S,T;return(((T=(S=(a=(l=n.report)==null?void 0:l.game)==null?void 0:a.report_minutes)==null?void 0:S.home_goals_minutes)==null?void 0:T.length)||0)>5}),i=e.computed(()=>{var l,a,S,T;return(((T=(S=(a=(l=n.report)==null?void 0:l.game)==null?void 0:a.report_minutes)==null?void 0:S.visiting_goals_minutes)==null?void 0:T.length)||0)>5});return(d,l)=>(e.openBlock(),e.createElementBlock("div",eme,[rme,e.createElementVNode("div",nme,[e.createElementVNode("span",ame,"Jornada "+e.toDisplayString(r(t.report.game.matchday_name)),1),e.createElementVNode("span",ime," - "+e.toDisplayString(e.unref(F4)(t.report.game.date_time_utc)),1)]),e.createElementVNode("div",ome,[e.createElementVNode("div",sme,[e.createElementVNode("div",lme,[e.createElementVNode("span",cme,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+t.report.game.home_team+".png"},null,8,ume)]),e.createElementVNode("div",dme,e.toDisplayString(t.report.game.score[0]),1)]),e.createElementVNode("div",pme,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,S)=>(e.openBlock(),e.createElementBlock("div",{key:`home-event-${S}`,class:"player-item"},[e.createElementVNode("span",hme,e.toDisplayString(a)+" ",1),fme]))),128)),u.value?(e.openBlock(),e.createElementBlock("div",mme,yme)):e.createCommentVNode("",!0)])]),gme,e.createElementVNode("div",vme,[e.createElementVNode("div",bme,[e.createElementVNode("div",xme,e.toDisplayString(t.report.game.score[1]),1),e.createElementVNode("span",_me,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+t.report.game.visiting_team+".png"},null,8,wme)])]),e.createElementVNode("div",Tme,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(a,S)=>(e.openBlock(),e.createElementBlock("div",{key:`visiting-event-${S}`,class:"player-item"},[Sme,e.createElementVNode("span",kme,[e.createTextVNode(e.toDisplayString(f(a).minutos)+" ",1),f(a).nombre?(e.openBlock(),e.createElementBlock("span",Lme," "+e.toDisplayString(f(a).nombre),1)):e.createCommentVNode("",!0)])]))),128)),i.value?(e.openBlock(),e.createElementBlock("div",Cme,Nme)):e.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-9c7a5ed5"]]),OA=t=>(e.pushScopeId("data-v-34e6ad47"),t=t(),e.popScopeId(),t),Eme={class:"report-card",style:{position:"relative"}},zme=[OA(()=>e.createElementVNode("span",null,null,-1)),OA(()=>e.createElementVNode("span",null,null,-1)),OA(()=>e.createElementVNode("span",null,null,-1))],Mme={class:"report-img-placeholder",style:{position:"relative"}},Vme={class:"inner-card-report"},Pme={class:"report-footer"},Ame={class:"report-title"},Rme={class:"report-template"},Fme={class:"template-name"},Ume={class:"report-league"},Ime={class:"report-tournament"},qme=ov({__name:"ReportItem",props:{type:{type:Number,default:1},localTeam:{type:String,default:"América"},report:{type:Object,default:()=>{}},visitorTeam:{type:String,default:"Chivas"},localScore:{type:Number,default:2},visitorScore:{type:Number,default:1},league:{type:String,default:"Liga MX"},date:{type:String,default:"15 Nov 2024"}},emits:["ver-reporte","renombrar","eliminar","edit-template","open-report","download-report"],setup(t,{emit:r}){const n=r,y=t,$=e.ref(!1);function f(){$.value=!1,n("open-report",y.report)}function u(){$.value=!1,n("renombrar",y.report.report_name||"Reporte",y.report.id)}function i(){$.value=!1,n("edit-template",y.report)}function d(){$.value=!1}function l(){$.value=!1,n("eliminar",y.report)}function a(){n("download-report",y.report),$.value=!1}function S(b){return b?b.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"):""}function T(){n("open-report",y.report)}return(b,p)=>(e.openBlock(),e.createElementBlock("div",Eme,[e.createElementVNode("div",{class:"three-dots",onClick:p[0]||(p[0]=e.withModifiers(s=>$.value=!$.value,["stop"]))},zme),e.createElementVNode("div",Mme,[t.report.template_type===1&&t.report.pages[0].type==1?(e.openBlock(),e.createBlock(ope,{key:0,"local-team":t.localTeam,"visitor-team":t.visitorTeam,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","league","date","report"])):t.report.template_type===2&&t.report.pages[0].type==1?(e.openBlock(),e.createBlock(Kpe,{key:1,"local-team":t.localTeam,"visitor-team":t.visitorTeam,"local-score":t.localScore,"visitor-score":t.visitorScore,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):e.createCommentVNode("",!0),t.report.template_type===1&&t.report.pages[0].type==2?(e.openBlock(),e.createBlock(phe,{key:2,"local-team":t.localTeam,"visitor-team":t.visitorTeam,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","league","date","report"])):t.report.template_type===2&&t.report.pages[0].type==2?(e.openBlock(),e.createBlock(Yhe,{key:3,"local-team":t.localTeam,"visitor-team":t.visitorTeam,"local-score":t.localScore,"visitor-score":t.visitorScore,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):e.createCommentVNode("",!0),t.report.template_type===1&&t.report.pages[0].type==3?(e.openBlock(),e.createBlock(dfe,{key:4,"local-team":t.localTeam,"visitor-team":t.visitorTeam,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","league","date","report"])):t.report.template_type===2&&t.report.pages[0].type==3?(e.openBlock(),e.createBlock(qfe,{key:5,"local-team":t.localTeam,"visitor-team":t.visitorTeam,"local-score":t.localScore,"visitor-score":t.visitorScore,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):t.report.template_type===1&&t.report.pages[0].type==4?(e.openBlock(),e.createBlock(tme,{key:6,"local-team":t.localTeam,"visitor-team":t.visitorTeam,"local-score":t.localScore,"visitor-score":t.visitorScore,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):t.report.template_type===2&&t.report.pages[0].type==4?(e.openBlock(),e.createBlock(Ome,{key:7,"local-team":t.localTeam,"visitor-team":t.visitorTeam,"local-score":t.localScore,"visitor-score":t.visitorScore,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"report-img-overlay"},[e.createElementVNode("button",{class:"report-img-button",onClick:T},"Ver reporte")])]),e.createElementVNode("div",Vme,[e.createElementVNode("div",Pme,[e.createElementVNode("div",Ame,e.toDisplayString(t.report.report_name),1),e.createElementVNode("div",Rme,[e.createTextVNode(" Template: "),e.createElementVNode("span",Fme,e.toDisplayString(t.report.name),1)]),e.createElementVNode("div",Ume,e.toDisplayString(t.report.season_name)+" - "+e.toDisplayString(S(t.report.game.matchday_name))+"  |  "+e.toDisplayString(e.unref(F4)(t.report.game.date_time_utc)),1),e.createElementVNode("div",Ime,e.toDisplayString(t.report.tournament_name),1)])]),$.value?(e.openBlock(),e.createBlock(Ide,{key:0,onClick:p[1]||(p[1]=e.withModifiers(s=>$.value=!1,["self"])),onMouseleave:p[2]||(p[2]=s=>$.value=!1),onVerReporte:f,onRenombrar:u,onEditar:i,onDuplicar:d,onEliminar:l,onDescargar:a})):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"tooltip-overlay",onClick:p[3]||(p[3]=s=>$.value=!1)})):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-34e6ad47"]]),b9=t=>(e.pushScopeId("data-v-a6ea9581"),t=t(),e.popScopeId(),t),jme={class:"modal-overlay"},Dme={class:"modal-content"},Wme=[b9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],Bme=b9(()=>e.createElementVNode("div",{class:"modal-header"},[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename-white.svg",class:"icon-title",alt:"icon"}),e.createElementVNode("span",{class:"modal-title"},"Renombrar Reporte")],-1)),Kme=b9(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),Xme={class:"modal-body"},Gme=b9(()=>e.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),Zme=["placeholder","disabled"],Jme={key:0,class:"error-message"},Hme=b9(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),Yme={class:"modal-footer"},Qme=["disabled"],$me=["disabled"],t0e={key:0},e0e={key:1},r0e=ov({__name:"ModalRenameReporte",props:{initialName:{type:String,required:!0},templateType:{type:String,required:!0},token:{type:String,required:!0},userId:{type:[String,Number],required:!0},reportId:{type:[String,Number],required:!0}},emits:["close","rename","refresh"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(n.initialName),f=e.ref(!1),u=e.ref("");e.watch(()=>n.initialName,d=>{$.value=d,u.value=""});async function i(){var d;if(!($.value.trim().length<3)){f.value=!0,u.value="";try{await M0.create({headers:{Authorization:`${n.token}`}}).put(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${n.userId}/reports/${n.reportId}/rename`,{name:$.value.trim()}),y("rename",$.value.trim()),y("refresh"),y("close")}catch(l){console.error("Error al renombrar el reporte:",l),((d=l.response)==null?void 0:d.status)===409?u.value="Ya existe un reporte con el mismo nombre":u.value="Error al renombrar el reporte. Inténtalo de nuevo."}finally{f.value=!1}}}return e.onMounted(()=>{document.body.style.overflow="hidden"}),e.onUnmounted(()=>{document.body.style.overflow=""}),(d,l)=>(e.openBlock(),e.createElementBlock("div",jme,[e.createElementVNode("div",Dme,[e.createElementVNode("button",{class:"close-btn",onClick:l[0]||(l[0]=a=>d.$emit("close"))},Wme),Bme,Kme,e.createElementVNode("div",Xme,[Gme,e.withDirectives(e.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":l[1]||(l[1]=a=>$.value=a),placeholder:t.initialName,maxlength:"40",autocomplete:"off",disabled:f.value},null,8,Zme),[[e.vModelText,$.value]]),u.value?(e.openBlock(),e.createElementBlock("div",Jme,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0)]),Hme,e.createElementVNode("div",Yme,[e.createElementVNode("button",{class:"cancel-btn",onClick:l[2]||(l[2]=a=>d.$emit("close")),disabled:f.value},"Cancelar",8,Qme),e.createElementVNode("button",{class:"next-btn",disabled:$.value.trim().length<3||f.value,onClick:i},[f.value?(e.openBlock(),e.createElementBlock("span",t0e,"Guardando...")):(e.openBlock(),e.createElementBlock("span",e0e,"Guardar"))],8,$me)])])]))}},[["__scopeId","data-v-a6ea9581"]]),n0e=t=>(e.pushScopeId("data-v-2bd7ac3a"),t=t(),e.popScopeId(),t),a0e={class:"modal-overlay"},i0e={class:"modal-content"},o0e=[n0e(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],s0e=e.createStaticVNode('<div class="modal-header" data-v-2bd7ac3a><img src="https://golstatsimages.blob.core.windows.net/reports-images/icn-delete-delete.svg" class="icon-title" alt="icon" data-v-2bd7ac3a><span class="modal-title" data-v-2bd7ac3a>Eliminar reporte</span></div><div class="header-separator" data-v-2bd7ac3a></div><div class="modal-body confirm-text" data-v-2bd7ac3a> ¿Estás seguro que deseas eliminar<br data-v-2bd7ac3a> este reporte? Si lo haces no habrá manera<br data-v-2bd7ac3a> de recuperarlo. </div><div class="header-separator" data-v-2bd7ac3a></div>',4),l0e={class:"modal-footer"},c0e=["disabled"],u0e=["disabled"],d0e=ov({__name:"ModalDeleteReport",props:{reportId:{type:String,required:!0},userId:{type:String,required:!0},token:{type:String,required:!0}},emits:["close","delete","reportDeleted"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(!1),f=async()=>{try{$.value=!0;const i=await M0.create({headers:{Authorization:`${n.token}`}}).delete(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${n.userId}/reports/${n.reportId}`);y("reportDeleted",n.reportId),y("close")}catch(u){console.error("Error al eliminar el reporte:",u),alert("Error al eliminar el reporte. Por favor, intenta de nuevo.")}finally{$.value=!1}};return e.onMounted(()=>{document.body.style.overflow="hidden"}),e.onUnmounted(()=>{document.body.style.overflow=""}),(u,i)=>(e.openBlock(),e.createElementBlock("div",a0e,[e.createElementVNode("div",i0e,[e.createElementVNode("button",{class:"close-btn",onClick:i[0]||(i[0]=d=>u.$emit("close"))},o0e),s0e,e.createElementVNode("div",l0e,[e.createElementVNode("button",{class:"cancel-btn",onClick:i[1]||(i[1]=d=>u.$emit("close")),disabled:$.value},"Cancelar",8,c0e),e.createElementVNode("button",{class:"delete-btn",onClick:f,disabled:$.value},e.toDisplayString($.value?"Eliminando...":"Eliminar"),9,u0e)])])]))}},[["__scopeId","data-v-2bd7ac3a"]]),EA=t=>(e.pushScopeId("data-v-ef279597"),t=t(),e.popScopeId(),t),p0e={class:"reports-header"},h0e={class:"count"},f0e={key:0,class:"sort-options"},m0e=["onClick"],y0e={key:0,class:"checkmark"},g0e=[EA(()=>e.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],v0e={key:0,class:"loading-state"},b0e=[EA(()=>e.createElementVNode("div",{class:"loading-spinner"},null,-1)),EA(()=>e.createElementVNode("p",null,"Cargando reportes...",-1))],x0e={key:1,class:"error-state"},_0e={key:3,class:"empty-reports"},w0e={key:4,class:"empty-reports"},T0e=ov({__name:"ReportsSection",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0},searchQuery:{type:String,default:""}},emits:["open-report"],setup(t,{emit:r}){const n=t,y=r,$=e.ref([]),f=e.ref(!1),u=e.ref(null),i=e.computed(()=>{let mt=$.value;if(n.searchQuery.trim()){const yt=n.searchQuery.toLowerCase().trim();mt=$.value.filter(bt=>{var It,jt,Rt,Wt,re,le,he;return!!((((It=bt.report_name)==null?void 0:It.toLowerCase())||"").includes(yt)||(((jt=bt.name)==null?void 0:jt.toLowerCase())||"").includes(yt)||bt.created_at&&new Date(bt.created_at).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(yt)||(Rt=bt.game)!=null&&Rt.date_time_utc&&new Date(bt.game.date_time_utc).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(yt)||(((re=(Wt=bt.game)==null?void 0:Wt.season_name)==null?void 0:re.toLowerCase())||"").includes(yt)||(((le=bt.tournament_name)==null?void 0:le.toLowerCase())||"").includes(yt)||(he=bt.game)!=null&&he.matchday&&bt.game.matchday.toString().includes(yt))})}return l.value&&(mt=[...mt].sort((yt,bt)=>{var xt,Pt;if(l.value==="A - Z"){const qt=(yt.report_name||"").toLowerCase(),_t=(bt.report_name||"").toLowerCase();return qt.localeCompare(_t,"es",{sensitivity:"base"})}else if(l.value==="Más recientes"){const qt=new Date(yt.created_at||0);return new Date(bt.created_at||0)-qt}else if(l.value==="Torneo"){const qt=(yt.tournament_name||"").toLowerCase(),_t=(bt.tournament_name||"").toLowerCase();if(qt!==_t)return qt.localeCompare(_t,"es",{sensitivity:"base"});const It=yt.season_id||0;return(bt.season_id||0)-It}else if(l.value==="Jornada"){const qt=((xt=yt.game)==null?void 0:xt.matchday_id)||0,_t=((Pt=bt.game)==null?void 0:Pt.matchday_id)||0;return qt-_t}return 0})),mt}),d=e.ref(!1),l=e.ref("Más recientes"),a=e.ref(!1),S=e.ref(""),T=e.ref(""),b=e.ref(""),p=e.ref(!1),s=e.ref(""),c=e.ref(""),o=e.ref(null),h=e.ref(null),v=e.ref(null),k=e.ref(0),L=[{label:"A - Z",value:"A - Z"},{label:"Más recientes",value:"Más recientes"},{label:"Torneo",value:"Torneo"},{label:"Jornada",value:"Jornada"}],E=async()=>{f.value=!0,u.value=null;try{const mt=await M0.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${n.userId}/reports`,{headers:{Authorization:`${n.token}`,"Content-Type":"application/json"}});mt.data&&Array.isArray(mt.data)?$.value=mt.data:mt.data&&mt.data.reports?$.value=mt.data.reports:mt.data&&mt.data.data?$.value=mt.data.data:$.value=[]}catch(mt){console.error("Error cargando reportes:",mt),console.error("Error response:",mt.response),u.value=mt.message||"Error al cargar los reportes",$.value=[]}finally{f.value=!1}},P=e.computed(()=>{if(!k.value)return"grid-1-column";const mt=340,yt=20,xt=k.value-40,Pt=Math.floor((xt+yt)/(mt+yt)),qt=Math.max(1,Pt);return qt>=4?"grid-4-columns":qt>=3?"grid-3-columns":qt>=2?"grid-2-columns":"grid-1-column"}),V=()=>{d.value=!d.value},I=mt=>{l.value=mt,d.value=!1};function j(mt){y("open-report",mt)}const F=(mt,yt)=>{S.value=mt,T.value=yt;const bt=$.value.find(xt=>xt.id===yt);b.value=bt?bt.template_type:"",a.value=!0},D=mt=>{a.value=!1;const yt=$.value.findIndex(bt=>bt.id===T.value);yt!==-1&&($.value[yt].report_name=mt)},U=mt=>{s.value=mt.report_name||"Reporte",c.value=mt.id,p.value=!0},M=mt=>{p.value=!1,$.value=$.value.filter(yt=>yt.id!==mt)};function X(mt){y("download-report",mt)}const O=mt=>{d.value&&o.value&&!o.value.contains(mt.target)&&(d.value=!1)},Y=()=>{h.value&&(k.value=h.value.offsetWidth)};let st=null;return e.onMounted(async()=>{document.addEventListener("mousedown",O),await E(),await e.nextTick(),Y(),window.ResizeObserver?(st=new ResizeObserver(()=>{Y()}),h.value&&st.observe(h.value)):window.addEventListener("resize",Y)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",O),st?st.disconnect():window.removeEventListener("resize",Y)}),(mt,yt)=>(e.openBlock(),e.createElementBlock("div",{class:"reports-section",ref_key:"reportsSectionRef",ref:h},[e.createElementVNode("div",p0e,[e.createElementVNode("span",null,[e.createTextVNode("Reportes "),e.createElementVNode("span",h0e,"("+e.toDisplayString(i.value.length)+")",1)]),e.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:o},[e.createElementVNode("button",{class:"sort-button",onClick:V},[e.createTextVNode(e.toDisplayString(l.value||"Ordenar")+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["dropdown-arrow",{rotated:d.value}])},null,2)]),d.value?(e.openBlock(),e.createElementBlock("div",f0e,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(L,bt=>e.createElementVNode("div",{key:bt.value,class:e.normalizeClass(["sort-option",{selected:l.value===bt.value}]),onClick:xt=>l.value!==bt.value&&I(bt.value)},[e.createElementVNode("span",null,e.toDisplayString(bt.label),1),l.value===bt.value?(e.openBlock(),e.createElementBlock("span",y0e,g0e)):e.createCommentVNode("",!0)],10,m0e)),64))])):e.createCommentVNode("",!0)],512)]),f.value?(e.openBlock(),e.createElementBlock("div",v0e,b0e)):u.value?(e.openBlock(),e.createElementBlock("div",x0e,[e.createElementVNode("p",null,"Error al cargar reportes: "+e.toDisplayString(u.value),1),e.createElementVNode("button",{onClick:E,class:"retry-button"},"Reintentar")])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["reports-grid",P.value]),ref_key:"reportsGridRef",ref:v},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,bt=>(e.openBlock(),e.createBlock(qme,{key:bt.id,report:bt,onOpenReport:j,onRenombrar:F,onEliminar:U,onDownloadReport:X},null,8,["report"]))),128))],2)),!f.value&&!u.value&&$.value.length===0?(e.openBlock(),e.createElementBlock("div",_0e," No tienes reportes aún. ")):e.createCommentVNode("",!0),!f.value&&!u.value&&$.value.length>0&&i.value.length===0?(e.openBlock(),e.createElementBlock("div",w0e," No se encontraron reportes que coincidan con tu búsqueda. ")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createBlock(r0e,{key:5,initialName:S.value,templateType:b.value,token:t.token,userId:t.userId,reportId:T.value,onClose:yt[0]||(yt[0]=bt=>a.value=!1),onRename:D,onRefresh:E},null,8,["initialName","templateType","token","userId","reportId"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(d0e,{key:6,"report-id":c.value,"user-id":t.userId,token:t.token,onClose:yt[1]||(yt[1]=bt=>p.value=!1),onReportDeleted:M},null,8,["report-id","user-id","token"])):e.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-ef279597"]]),S0e={class:"modal-overlay"},k0e={class:"modal-content"},L0e=e.createStaticVNode('<div class="modal-icon" data-v-30303ebd><svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-30303ebd><rect x="8" y="10" width="32" height="20" rx="2" stroke="#C0CBE0" stroke-width="2" data-v-30303ebd></rect><rect x="16" y="34" width="16" height="2" rx="1" fill="#C0CBE0" data-v-30303ebd></rect></svg></div><div class="modal-text" data-v-30303ebd> Esta sección solo está disponible para<br data-v-30303ebd> escritorio. Utiliza tu computadora <br data-v-30303ebd>para ingresar. </div>',2),C0e=ov({__name:"ModalSoloEscritorio",setup(t){return(r,n)=>(e.openBlock(),e.createElementBlock("div",S0e,[e.createElementVNode("div",k0e,[L0e,e.createElementVNode("button",{class:"modal-btn",onClick:n[0]||(n[0]=y=>r.$emit("toHome"))},"OK")])]))}},[["__scopeId","data-v-30303ebd"]]),o7=t=>(e.pushScopeId("data-v-9ffb4e12"),t=t(),e.popScopeId(),t),N0e=o7(()=>e.createElementVNode("h1",{class:"title"},"Mis reportes",-1)),O0e={class:"top-bar"},E0e={class:"tabs-container"},z0e={class:"tabs"},M0e={key:0,class:"actions"},V0e={class:"search-container"},P0e=o7(()=>e.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),A0e=[o7(()=>e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],R0e=o7(()=>e.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-agregar@3x.png",alt:"Agregar",class:"create-icon"},null,-1)),F0e={key:1,class:"actions"},U0e={class:"search-container"},I0e=o7(()=>e.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),q0e=[o7(()=>e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],j0e=ov({__name:"gsc-reports",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0}},emits:["toHome","download-report"],setup(t,{emit:r}){const n=t,{userId:y,team:$,token:f}=n,u=e.ref("templates"),i=e.ref(!1),d=e.ref(null),l=e.ref(!1),a=e.ref(""),S=e.ref(""),T=e.ref(null),b=e.ref(null),p=e.ref(0),s=r;function c(){if(d.value){const I=d.value.offsetWidth;i.value=I<1028}}e.watch(i,I=>{I?document.body.style.overflow="hidden":document.body.style.overflow=""}),e.onBeforeUnmount(()=>{document.body.style.overflow=""}),e.onMounted(()=>{c(),window.addEventListener("resize",c)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",c)});function o(I){h(I)}function h(I){T.value.show({template:I,isTemplateMode:!0})}const v=()=>{a.value=""},k=()=>{S.value=""};function L(I){T.value&&T.value.show({template:I,isTemplateMode:!1})}function E(I){s("download-report",I)}function P(){s("toHome")}function V(){b.value&&b.value.obtenerTemplates(),p.value+=1}return(I,j)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(hae),{ref_key:"reportTemplateMaker",ref:T,token:e.unref(f),"user-team-id":e.unref($),onClose:V},null,8,["token","user-team-id"]),e.createElementVNode("div",{ref_key:"containerRef",ref:d,class:"reports-container"},[i.value?(e.openBlock(),e.createBlock(C0e,{key:0,onToHome:P})):e.createCommentVNode("",!0),N0e,e.createElementVNode("div",O0e,[e.createElementVNode("div",E0e,[e.createElementVNode("div",z0e,[e.createElementVNode("div",{class:e.normalizeClass(["tab tab-templates",{active:u.value==="templates"}]),onClick:j[0]||(j[0]=F=>u.value="templates")}," Templates ",2),e.createElementVNode("div",{class:e.normalizeClass(["tab tab-reports",{active:u.value==="reports"}]),onClick:j[1]||(j[1]=F=>u.value="reports")}," Tus reportes ",2)])]),u.value==="templates"?(e.openBlock(),e.createElementBlock("div",M0e,[e.createElementVNode("div",V0e,[P0e,e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":j[2]||(j[2]=F=>a.value=F),class:"search",type:"text",placeholder:"Buscar template"},null,512),[[e.vModelText,a.value]]),a.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:v,class:"clear-search-btn",type:"button"},A0e)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"create-template-btn",onClick:j[3]||(j[3]=F=>l.value=!0)},[R0e,e.createTextVNode(" Crear template ")])])):e.createCommentVNode("",!0),u.value==="reports"?(e.openBlock(),e.createElementBlock("div",F0e,[e.createElementVNode("div",U0e,[I0e,e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":j[4]||(j[4]=F=>S.value=F),class:"search search-reports",type:"text",placeholder:"Buscar reporte"},null,512),[[e.vModelText,S.value]]),S.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:k,class:"clear-search-btn",type:"button"},q0e)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),u.value==="templates"?(e.openBlock(),e.createBlock(Pde,{ref_key:"templatesSectionRef",ref:b,userId:e.unref(y),token:e.unref(f),team:e.unref($),searchQuery:a.value,key:p.value,onSwitchToReports:j[5]||(j[5]=F=>u.value="reports"),onOpenModalNewTemplate:o,onEditTemplate:h},null,8,["userId","token","team","searchQuery"])):(e.openBlock(),e.createBlock(T0e,{key:2,userId:e.unref(y),token:e.unref(f),team:e.unref($),searchQuery:S.value,onOpenReport:L,onDownloadReport:E},null,8,["userId","token","team","searchQuery"])),l.value?(e.openBlock(),e.createBlock(CJ,{key:3,token:e.unref(f),team:e.unref($),onOpenModalNewTemplate:o,onClose:j[6]||(j[6]=F=>l.value=!1)},null,8,["token","team"])):e.createCommentVNode("",!0)],512)],64))}},[["__scopeId","data-v-9ffb4e12"]]),D0e={class:"subcategory-group"},W0e={__name:"SubcategoryGroup",props:{subcategoryGroup:{type:Array,default:()=>[]}},setup(t){return(r,n)=>(e.openBlock(),e.createElementBlock("div",D0e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.subcategoryGroup,y=>(e.openBlock(),e.createBlock(e.unref(dM),{key:y.id,modelValue:y.isSelected,"onUpdate:modelValue":$=>y.isSelected=$,label:y.name},null,8,["modelValue","onUpdate:modelValue","label"]))),128))]))}},B0e=A_(W0e,[["__scopeId","data-v-ae6f3d72"]]),K0e={class:"filter-subcategories"},X0e=Object.freeze(Object.defineProperty({__proto__:null,default:A_({__name:"FilterSubcategories",props:{subcategoryGroups:{type:Array,default:()=>[]}},setup(t){return(r,n)=>(e.openBlock(),e.createElementBlock("div",K0e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.subcategoryGroups,y=>(e.openBlock(),e.createElementBlock("div",{key:y.id,class:"filter-subcategories__group"},[e.createVNode(B0e,{subcategoryGroup:y},null,8,["subcategoryGroup"])]))),128))]))}},[["__scopeId","data-v-5edaefc2"]])},Symbol.toStringTag,{value:"Module"})),DO=t=>(e.pushScopeId("data-v-80d9c265"),t=t(),e.popScopeId(),t),G0e={class:"details__header"},Z0e=DO(()=>e.createElementVNode("div",{class:"details__header__title"},"Jugando como",-1)),J0e={class:"details__header__checkbox"},H0e={class:"details__body"},Y0e={class:"details__body__playing-as"},Q0e=["onClick"],$0e={class:"details__header"},tye=DO(()=>e.createElementVNode("div",{class:"details__header__title"},"En: (Elige el lapso de tiempo)",-1)),eye={class:"details__header__checkbox"},rye={class:"details__body"},nye=DO(()=>e.createElementVNode("div",{class:"details__body__title"},"1er tiempo",-1)),aye={class:"details__body__game-section"},iye=["onClick"],oye={class:"details__body"},sye=DO(()=>e.createElementVNode("div",{class:"details__body__title"},"2do tiempo",-1)),lye={class:"details__body__game-section"},cye=["onClick"],uye=Object.freeze(Object.defineProperty({__proto__:null,default:A_({__name:"FilterConditions",props:{playingAs:{type:Array,default:()=>[{name:"Local",isSelected:!0},{name:"Visitante",isSelected:!0}]},gameSections:{type:Array,default:()=>[{text:"0-15",value:1,isSelected:!0},{text:"16-30",value:2,isSelected:!0},{text:"31-45",value:3,isSelected:!0},{text:"46-60",value:4,isSelected:!0},{text:"61-75",value:5,isSelected:!0},{text:"76-90",value:6,isSelected:!0}]},buttonsBackgroundColor:{type:String,default:"rgba(255, 255, 255, 0)"},buttonsBackgroundColorActive:{type:String,default:"rgba(203, 238, 107, 0.05)"},buttonsTextColor:{type:String,default:"rgba(255, 255, 255, 0.8)"},buttonsTextColorActive:{type:String,default:"rgba(255, 255, 255, 1)"},buttonsBorderColor:{type:String,default:"#8ea2ab"},buttonsBorderColorActive:{type:String,default:"#cbee6b"},buttonsBorderWidth:{type:String,default:"0.8px"},buttonsBorderWidthActive:{type:String,default:"1px"},buttonsBorderRadius:{type:String,default:"4px"}},setup(t){const r=t;e.useCssVars(a=>({"49cba245":t.buttonsBackgroundColor,"52f02da6":t.buttonsTextColor,"7d3f686a":t.buttonsBorderWidth,"7c286a07":t.buttonsBorderColor,"24a6f4aa":t.buttonsBackgroundColorActive,cd8d7768:t.buttonsTextColorActive,"35fa5c10":t.buttonsBorderWidthActive,"0cde1826":t.buttonsBorderColorActive}));const n=e.computed(()=>r.playingAs.every(a=>a.isSelected)),y=e.computed(()=>r.gameSections.every(a=>a.isSelected)),$=e.computed(()=>r.gameSections.reduce((a,S)=>(S.value<=3?a.firstHalf.push(S):a.secondHalf.push(S),a),{firstHalf:[],secondHalf:[]})),f=e.computed(()=>({"--border-radius-first-button":`${r.buttonsBorderRadius} 0 0 ${r.buttonsBorderRadius}`,"--border-radius-last-button":`0 ${r.buttonsBorderRadius} ${r.buttonsBorderRadius} 0`}));function u(a){a?r.playingAs.forEach(S=>{S.isSelected=!0}):r.playingAs.forEach((S,T)=>{S.isSelected=T===0})}function i(a){r.playingAs.filter(S=>S.isSelected).length===1&&a.isSelected||(a.isSelected=!a.isSelected)}function d(a){r.gameSections.filter(S=>S.isSelected).length===1&&a.isSelected||(a.isSelected=!a.isSelected)}function l(a){a?r.gameSections.forEach(S=>{S.isSelected=!0}):r.gameSections.forEach((S,T)=>{S.isSelected=T===0})}return(a,S)=>(e.openBlock(),e.createElementBlock("div",{class:"details",style:e.normalizeStyle(f.value)},[e.createElementVNode("div",G0e,[Z0e,e.createElementVNode("div",J0e,[e.createVNode(e.unref(dM),{label:"Todos","model-value":n.value,"onUpdate:modelValue":u},null,8,["model-value"])])]),e.createElementVNode("div",H0e,[e.createElementVNode("div",Y0e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.playingAs,(T,b)=>(e.openBlock(),e.createElementBlock("div",{key:`pa${b}`,class:e.normalizeClass(["details__body__button",{active:T.isSelected}]),onClick:p=>i(T)},e.toDisplayString(T.name),11,Q0e))),128))])]),e.createElementVNode("div",$0e,[tye,e.createElementVNode("div",eye,[e.createVNode(e.unref(dM),{label:"Todos","model-value":y.value,"onUpdate:modelValue":l},null,8,["model-value"])])]),e.createElementVNode("div",rye,[nye,e.createElementVNode("div",aye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value.firstHalf,(T,b)=>(e.openBlock(),e.createElementBlock("div",{key:`pa${b}`,class:e.normalizeClass(["details__body__button",{active:T.isSelected}]),onClick:p=>d(T)},e.toDisplayString(T.text),11,iye))),128))])]),e.createElementVNode("div",oye,[sye,e.createElementVNode("div",lye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value.secondHalf,(T,b)=>(e.openBlock(),e.createElementBlock("div",{key:`pa${b}`,class:e.normalizeClass(["details__body__button",{active:T.isSelected}]),onClick:p=>d(T)},e.toDisplayString(T.text),11,cye))),128))])])],4))}},[["__scopeId","data-v-80d9c265"]])},Symbol.toStringTag,{value:"Module"})),dye={class:"filter-field"},pye=Object.freeze(Object.defineProperty({__proto__:null,default:A_({__name:"FilterField",setup(t){const r=e.ref(Array.from({length:16},(y,$)=>$+1));function n(){}return(y,$)=>(e.openBlock(),e.createElementBlock("div",dye,[e.createVNode(e.unref(Ugt),{width:"100%","background-color":"#2E3B46",value:r.value,"onUpdate:modelValue":n},null,8,["value"])]))}},[["__scopeId","data-v-8103c3e1"]])},Symbol.toStringTag,{value:"Module"}));BT.GSCReports=j0e,Object.defineProperty(BT,Symbol.toStringTag,{value:"Module"})}));
8010
+ `)}])},e.toDisplayString($.value),3)):e.createCommentVNode("",!0),Hhe])])])]))}},[["__scopeId","data-v-2a752817"]]),EJ=t=>(e.pushScopeId("data-v-23601285"),t=t(),e.popScopeId(),t),Qhe={class:"prematch-bg"},$he=EJ(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),tfe={class:"subtitle"},efe={class:"jornada"},rfe={class:"fecha"},nfe={class:"teams-row"},afe={class:"team team-local"},ife={class:"escudo-svg"},ofe=["src"],sfe=EJ(()=>e.createElementVNode("div",{class:"divider-line"},[e.createElementVNode("div",{class:"dotted-line"})],-1)),lfe={class:"team team-visitor"},cfe={class:"escudo-svg"},ufe=["src"],dfe=ov({__name:"AnalisisPrematchType3",props:{report:{type:Object,default:()=>({})}},setup(t){function r(y){return y?y.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=t;return(y,$)=>(e.openBlock(),e.createElementBlock("div",Qhe,[$he,e.createElementVNode("div",tfe,[e.createElementVNode("span",efe,e.toDisplayString(r(n.report.game.matchday_name)),1),e.createElementVNode("span",rfe," - "+e.toDisplayString(e.unref(F4)(n.report.game.date_time_utc)),1)]),e.createElementVNode("div",nfe,[e.createElementVNode("div",afe,[e.createElementVNode("span",ife,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.home_team+".png"},null,8,ofe)])]),sfe,e.createElementVNode("div",lfe,[e.createElementVNode("span",cfe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.visiting_team+".png"},null,8,ufe)])])])]))}},[["__scopeId","data-v-23601285"]]),a7=t=>(e.pushScopeId("data-v-893ebf20"),t=t(),e.popScopeId(),t),pfe={class:"prematch-bg"},hfe=a7(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),ffe={class:"subtitle"},mfe={class:"jornada"},yfe={class:"fecha"},gfe={class:"teams-row"},vfe={class:"team team-local"},bfe={class:"team-header"},xfe={class:"escudo-svg"},_fe=["src"],wfe={class:"score"},Tfe={class:"players-list"},Sfe={class:"player-name"},kfe=a7(()=>e.createElementVNode("span",{class:"player-icon"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("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"}),e.createElementVNode("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"})])],-1)),Lfe={key:0,class:"more-events-indicator"},Cfe=[a7(()=>e.createElementVNode("span",{class:"more-events-text"},"...",-1))],Nfe=a7(()=>e.createElementVNode("div",{class:"divider-line"},[e.createElementVNode("div",{class:"dotted-line"})],-1)),Ofe={class:"team team-visitor"},Efe={class:"team-header"},zfe={class:"score"},Mfe={class:"escudo-svg"},Vfe=["src"],Pfe={class:"players-list"},Afe=a7(()=>e.createElementVNode("span",{class:"player-icon"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("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"}),e.createElementVNode("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"})])],-1)),Rfe={class:"player-name"},Ffe={key:0},Ufe={key:0,class:"more-events-indicator"},Ife=[a7(()=>e.createElementVNode("span",{class:"more-events-text"},"...",-1))],qfe=ov({__name:"AnalisisPostMatchType3",props:{report:{type:Object,default:()=>({})}},setup(t){function r(d){return d?d.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=t,y=e.computed(()=>{var d,l,a;return(((a=(l=(d=n.report)==null?void 0:d.game)==null?void 0:l.report_minutes)==null?void 0:a.home_goals_minutes)||[]).slice(0,5)}),$=e.computed(()=>{var d,l,a;return(((a=(l=(d=n.report)==null?void 0:d.game)==null?void 0:l.report_minutes)==null?void 0:a.visiting_goals_minutes)||[]).slice(0,5)});function f(d){const l=Array.from(d.matchAll(/\d+\s*\+*\s*\d*'/g)).map(T=>T[0]).join(", "),a=d.match(/^(.*?)\s*\d+'/),S=a?" "+a[1].trim():"";return{minutos:l,nombre:S}}const u=e.computed(()=>{var l,a,S,T;return(((T=(S=(a=(l=n.report)==null?void 0:l.game)==null?void 0:a.report_minutes)==null?void 0:S.home_goals_minutes)==null?void 0:T.length)||0)>5}),i=e.computed(()=>{var l,a,S,T;return(((T=(S=(a=(l=n.report)==null?void 0:l.game)==null?void 0:a.report_minutes)==null?void 0:S.visiting_goals_minutes)==null?void 0:T.length)||0)>5});return(d,l)=>(e.openBlock(),e.createElementBlock("div",pfe,[hfe,e.createElementVNode("div",ffe,[e.createElementVNode("span",mfe,"Jornada "+e.toDisplayString(r(t.report.game.matchday_name)),1),e.createElementVNode("span",yfe," - "+e.toDisplayString(e.unref(F4)(t.report.game.date_time_utc)),1)]),e.createElementVNode("div",gfe,[e.createElementVNode("div",vfe,[e.createElementVNode("div",bfe,[e.createElementVNode("span",xfe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+t.report.game.home_team+".png"},null,8,_fe)]),e.createElementVNode("div",wfe,e.toDisplayString(t.report.game.score[0]),1)]),e.createElementVNode("div",Tfe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,S)=>(e.openBlock(),e.createElementBlock("div",{key:`home-event-${S}`,class:"player-item"},[e.createElementVNode("span",Sfe,e.toDisplayString(a)+" ",1),kfe]))),128)),u.value?(e.openBlock(),e.createElementBlock("div",Lfe,Cfe)):e.createCommentVNode("",!0)])]),Nfe,e.createElementVNode("div",Ofe,[e.createElementVNode("div",Efe,[e.createElementVNode("div",zfe,e.toDisplayString(t.report.game.score[1]),1),e.createElementVNode("span",Mfe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+t.report.game.visiting_team+".png"},null,8,Vfe)])]),e.createElementVNode("div",Pfe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(a,S)=>(e.openBlock(),e.createElementBlock("div",{key:`visiting-event-${S}`,class:"player-item"},[Afe,e.createElementVNode("span",Rfe,[e.createTextVNode(e.toDisplayString(f(a).minutos)+" ",1),f(a).nombre?(e.openBlock(),e.createElementBlock("span",Ffe,e.toDisplayString(f(a).nombre),1)):e.createCommentVNode("",!0)])]))),128)),i.value?(e.openBlock(),e.createElementBlock("div",Ufe,Ife)):e.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-893ebf20"]]),zJ=t=>(e.pushScopeId("data-v-347d4c02"),t=t(),e.popScopeId(),t),jfe={class:"prematch-bg"},Dfe=zJ(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),Wfe={class:"subtitle"},Bfe={class:"jornada"},Kfe={class:"fecha"},Xfe={class:"teams-row"},Gfe={class:"team team-local"},Zfe={class:"escudo-svg"},Jfe=["src"],Hfe=zJ(()=>e.createElementVNode("div",{class:"divider-line"},[e.createElementVNode("div",{class:"dotted-line"})],-1)),Yfe={class:"team team-visitor"},Qfe={class:"escudo-svg"},$fe=["src"],tme=ov({__name:"AnalisisPrematchType4",props:{report:{type:Object,default:()=>({})}},setup(t){function r(y){return y?y.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=t;return(y,$)=>(e.openBlock(),e.createElementBlock("div",jfe,[Dfe,e.createElementVNode("div",Wfe,[e.createElementVNode("span",Bfe,e.toDisplayString(r(n.report.game.matchday_name)),1),e.createElementVNode("span",Kfe," - "+e.toDisplayString(e.unref(F4)(n.report.game.date_time_utc)),1)]),e.createElementVNode("div",Xfe,[e.createElementVNode("div",Gfe,[e.createElementVNode("span",Zfe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.home_team+".png"},null,8,Jfe)])]),Hfe,e.createElementVNode("div",Yfe,[e.createElementVNode("span",Qfe,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+n.report.game.visiting_team+".png"},null,8,$fe)])])])]))}},[["__scopeId","data-v-347d4c02"]]),i7=t=>(e.pushScopeId("data-v-9c7a5ed5"),t=t(),e.popScopeId(),t),eme={class:"prematch-bg"},rme=i7(()=>e.createElementVNode("div",{class:"title"},[e.createTextVNode("Análisis "),e.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),nme={class:"subtitle"},ame={class:"jornada"},ime={class:"fecha"},ome={class:"teams-row"},sme={class:"team team-local"},lme={class:"team-header"},cme={class:"escudo-svg"},ume=["src"],dme={class:"score"},pme={class:"players-list"},hme={class:"player-name"},fme=i7(()=>e.createElementVNode("span",{class:"player-icon"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("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"}),e.createElementVNode("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"})])],-1)),mme={key:0,class:"more-events-indicator"},yme=[i7(()=>e.createElementVNode("span",{class:"more-events-text"},"...",-1))],gme=i7(()=>e.createElementVNode("div",{class:"divider-line"},[e.createElementVNode("div",{class:"dotted-line"})],-1)),vme={class:"team team-visitor"},bme={class:"team-header"},xme={class:"score"},_me={class:"escudo-svg"},wme=["src"],Tme={class:"players-list"},Sme=i7(()=>e.createElementVNode("span",{class:"player-icon"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("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"}),e.createElementVNode("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"})])],-1)),kme={class:"player-name"},Lme={key:0},Cme={key:0,class:"more-events-indicator"},Nme=[i7(()=>e.createElementVNode("span",{class:"more-events-text"},"...",-1))],Ome=ov({__name:"AnalisisPostMatchType4",props:{report:{type:Object,default:()=>({})}},setup(t){function r(d){return d?d.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=t,y=e.computed(()=>{var d,l,a;return(((a=(l=(d=n.report)==null?void 0:d.game)==null?void 0:l.report_minutes)==null?void 0:a.home_goals_minutes)||[]).slice(0,5)}),$=e.computed(()=>{var d,l,a;return(((a=(l=(d=n.report)==null?void 0:d.game)==null?void 0:l.report_minutes)==null?void 0:a.visiting_goals_minutes)||[]).slice(0,5)});function f(d){const l=Array.from(d.matchAll(/\d+\s*\+*\s*\d*'/g)).map(T=>T[0]).join(", "),a=d.match(/^(.*?)\s*\d+'/),S=a?a[1].trim():"";return{minutos:l,nombre:S}}const u=e.computed(()=>{var l,a,S,T;return(((T=(S=(a=(l=n.report)==null?void 0:l.game)==null?void 0:a.report_minutes)==null?void 0:S.home_goals_minutes)==null?void 0:T.length)||0)>5}),i=e.computed(()=>{var l,a,S,T;return(((T=(S=(a=(l=n.report)==null?void 0:l.game)==null?void 0:a.report_minutes)==null?void 0:S.visiting_goals_minutes)==null?void 0:T.length)||0)>5});return(d,l)=>(e.openBlock(),e.createElementBlock("div",eme,[rme,e.createElementVNode("div",nme,[e.createElementVNode("span",ame,"Jornada "+e.toDisplayString(r(t.report.game.matchday_name)),1),e.createElementVNode("span",ime," - "+e.toDisplayString(e.unref(F4)(t.report.game.date_time_utc)),1)]),e.createElementVNode("div",ome,[e.createElementVNode("div",sme,[e.createElementVNode("div",lme,[e.createElementVNode("span",cme,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+t.report.game.home_team+".png"},null,8,ume)]),e.createElementVNode("div",dme,e.toDisplayString(t.report.game.score[0]),1)]),e.createElementVNode("div",pme,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,S)=>(e.openBlock(),e.createElementBlock("div",{key:`home-event-${S}`,class:"player-item"},[e.createElementVNode("span",hme,e.toDisplayString(a)+" ",1),fme]))),128)),u.value?(e.openBlock(),e.createElementBlock("div",mme,yme)):e.createCommentVNode("",!0)])]),gme,e.createElementVNode("div",vme,[e.createElementVNode("div",bme,[e.createElementVNode("div",xme,e.toDisplayString(t.report.game.score[1]),1),e.createElementVNode("span",_me,[e.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+t.report.game.visiting_team+".png"},null,8,wme)])]),e.createElementVNode("div",Tme,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(a,S)=>(e.openBlock(),e.createElementBlock("div",{key:`visiting-event-${S}`,class:"player-item"},[Sme,e.createElementVNode("span",kme,[e.createTextVNode(e.toDisplayString(f(a).minutos)+" ",1),f(a).nombre?(e.openBlock(),e.createElementBlock("span",Lme," "+e.toDisplayString(f(a).nombre),1)):e.createCommentVNode("",!0)])]))),128)),i.value?(e.openBlock(),e.createElementBlock("div",Cme,Nme)):e.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-9c7a5ed5"]]),OA=t=>(e.pushScopeId("data-v-34e6ad47"),t=t(),e.popScopeId(),t),Eme={class:"report-card",style:{position:"relative"}},zme=[OA(()=>e.createElementVNode("span",null,null,-1)),OA(()=>e.createElementVNode("span",null,null,-1)),OA(()=>e.createElementVNode("span",null,null,-1))],Mme={class:"report-img-placeholder",style:{position:"relative"}},Vme={class:"inner-card-report"},Pme={class:"report-footer"},Ame={class:"report-title"},Rme={class:"report-template"},Fme={class:"template-name"},Ume={class:"report-league"},Ime={class:"report-tournament"},qme=ov({__name:"ReportItem",props:{type:{type:Number,default:1},localTeam:{type:String,default:"América"},report:{type:Object,default:()=>{}},visitorTeam:{type:String,default:"Chivas"},localScore:{type:Number,default:2},visitorScore:{type:Number,default:1},league:{type:String,default:"Liga MX"},date:{type:String,default:"15 Nov 2024"}},emits:["ver-reporte","renombrar","eliminar","edit-template","open-report","download-report"],setup(t,{emit:r}){const n=r,y=t,$=e.ref(!1);function f(){$.value=!1,n("open-report",y.report)}function u(){$.value=!1,n("renombrar",y.report.report_name||"Reporte",y.report.id)}function i(){$.value=!1,n("edit-template",y.report)}function d(){$.value=!1}function l(){$.value=!1,n("eliminar",y.report)}function a(){n("download-report",y.report),$.value=!1}function S(b){return b?b.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"):""}function T(){n("open-report",y.report)}return(b,p)=>(e.openBlock(),e.createElementBlock("div",Eme,[e.createElementVNode("div",{class:"three-dots",onClick:p[0]||(p[0]=e.withModifiers(s=>$.value=!$.value,["stop"]))},zme),e.createElementVNode("div",Mme,[t.report.template_type===1&&t.report.pages[0].type==1?(e.openBlock(),e.createBlock(ope,{key:0,"local-team":t.localTeam,"visitor-team":t.visitorTeam,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","league","date","report"])):t.report.template_type===2&&t.report.pages[0].type==1?(e.openBlock(),e.createBlock(Kpe,{key:1,"local-team":t.localTeam,"visitor-team":t.visitorTeam,"local-score":t.localScore,"visitor-score":t.visitorScore,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):e.createCommentVNode("",!0),t.report.template_type===1&&t.report.pages[0].type==2?(e.openBlock(),e.createBlock(phe,{key:2,"local-team":t.localTeam,"visitor-team":t.visitorTeam,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","league","date","report"])):t.report.template_type===2&&t.report.pages[0].type==2?(e.openBlock(),e.createBlock(Yhe,{key:3,"local-team":t.localTeam,"visitor-team":t.visitorTeam,"local-score":t.localScore,"visitor-score":t.visitorScore,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):e.createCommentVNode("",!0),t.report.template_type===1&&t.report.pages[0].type==3?(e.openBlock(),e.createBlock(dfe,{key:4,"local-team":t.localTeam,"visitor-team":t.visitorTeam,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","league","date","report"])):t.report.template_type===2&&t.report.pages[0].type==3?(e.openBlock(),e.createBlock(qfe,{key:5,"local-team":t.localTeam,"visitor-team":t.visitorTeam,"local-score":t.localScore,"visitor-score":t.visitorScore,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):t.report.template_type===1&&t.report.pages[0].type==4?(e.openBlock(),e.createBlock(tme,{key:6,"local-team":t.localTeam,"visitor-team":t.visitorTeam,"local-score":t.localScore,"visitor-score":t.visitorScore,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):t.report.template_type===2&&t.report.pages[0].type==4?(e.openBlock(),e.createBlock(Ome,{key:7,"local-team":t.localTeam,"visitor-team":t.visitorTeam,"local-score":t.localScore,"visitor-score":t.visitorScore,league:t.league,date:t.date,report:t.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"report-img-overlay"},[e.createElementVNode("button",{class:"report-img-button",onClick:T},"Ver reporte")])]),e.createElementVNode("div",Vme,[e.createElementVNode("div",Pme,[e.createElementVNode("div",Ame,e.toDisplayString(t.report.report_name),1),e.createElementVNode("div",Rme,[e.createTextVNode(" Template: "),e.createElementVNode("span",Fme,e.toDisplayString(t.report.name),1)]),e.createElementVNode("div",Ume,e.toDisplayString(t.report.season_name)+" - "+e.toDisplayString(S(t.report.game.matchday_name))+"  |  "+e.toDisplayString(e.unref(F4)(t.report.game.date_time_utc)),1),e.createElementVNode("div",Ime,e.toDisplayString(t.report.tournament_name),1)])]),$.value?(e.openBlock(),e.createBlock(Ide,{key:0,onClick:p[1]||(p[1]=e.withModifiers(s=>$.value=!1,["self"])),onMouseleave:p[2]||(p[2]=s=>$.value=!1),onVerReporte:f,onRenombrar:u,onEditar:i,onDuplicar:d,onEliminar:l,onDescargar:a})):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"tooltip-overlay",onClick:p[3]||(p[3]=s=>$.value=!1)})):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-34e6ad47"]]),b9=t=>(e.pushScopeId("data-v-a6ea9581"),t=t(),e.popScopeId(),t),jme={class:"modal-overlay"},Dme={class:"modal-content"},Wme=[b9(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],Bme=b9(()=>e.createElementVNode("div",{class:"modal-header"},[e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename-white.svg",class:"icon-title",alt:"icon"}),e.createElementVNode("span",{class:"modal-title"},"Renombrar Reporte")],-1)),Kme=b9(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),Xme={class:"modal-body"},Gme=b9(()=>e.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),Zme=["placeholder","disabled"],Jme={key:0,class:"error-message"},Hme=b9(()=>e.createElementVNode("div",{class:"header-separator"},null,-1)),Yme={class:"modal-footer"},Qme=["disabled"],$me=["disabled"],t0e={key:0},e0e={key:1},r0e=ov({__name:"ModalRenameReporte",props:{initialName:{type:String,required:!0},templateType:{type:String,required:!0},token:{type:String,required:!0},userId:{type:[String,Number],required:!0},reportId:{type:[String,Number],required:!0}},emits:["close","rename","refresh"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(n.initialName),f=e.ref(!1),u=e.ref("");e.watch(()=>n.initialName,d=>{$.value=d,u.value=""});async function i(){var d;if(!($.value.trim().length<3)){f.value=!0,u.value="";try{await M0.create({headers:{Authorization:`${n.token}`}}).put(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${n.userId}/reports/${n.reportId}/rename`,{name:$.value.trim()}),y("rename",$.value.trim()),y("refresh"),y("close")}catch(l){console.error("Error al renombrar el reporte:",l),((d=l.response)==null?void 0:d.status)===409?u.value="Ya existe un reporte con el mismo nombre":u.value="Error al renombrar el reporte. Inténtalo de nuevo."}finally{f.value=!1}}}return e.onMounted(()=>{document.body.style.overflow="hidden"}),e.onUnmounted(()=>{document.body.style.overflow=""}),(d,l)=>(e.openBlock(),e.createElementBlock("div",jme,[e.createElementVNode("div",Dme,[e.createElementVNode("button",{class:"close-btn",onClick:l[0]||(l[0]=a=>d.$emit("close"))},Wme),Bme,Kme,e.createElementVNode("div",Xme,[Gme,e.withDirectives(e.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":l[1]||(l[1]=a=>$.value=a),placeholder:t.initialName,maxlength:"40",autocomplete:"off",disabled:f.value},null,8,Zme),[[e.vModelText,$.value]]),u.value?(e.openBlock(),e.createElementBlock("div",Jme,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0)]),Hme,e.createElementVNode("div",Yme,[e.createElementVNode("button",{class:"cancel-btn",onClick:l[2]||(l[2]=a=>d.$emit("close")),disabled:f.value},"Cancelar",8,Qme),e.createElementVNode("button",{class:"next-btn",disabled:$.value.trim().length<3||f.value,onClick:i},[f.value?(e.openBlock(),e.createElementBlock("span",t0e,"Guardando...")):(e.openBlock(),e.createElementBlock("span",e0e,"Guardar"))],8,$me)])])]))}},[["__scopeId","data-v-a6ea9581"]]),n0e=t=>(e.pushScopeId("data-v-2bd7ac3a"),t=t(),e.popScopeId(),t),a0e={class:"modal-overlay"},i0e={class:"modal-content"},o0e=[n0e(()=>e.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],s0e=e.createStaticVNode('<div class="modal-header" data-v-2bd7ac3a><img src="https://golstatsimages.blob.core.windows.net/reports-images/icn-delete-delete.svg" class="icon-title" alt="icon" data-v-2bd7ac3a><span class="modal-title" data-v-2bd7ac3a>Eliminar reporte</span></div><div class="header-separator" data-v-2bd7ac3a></div><div class="modal-body confirm-text" data-v-2bd7ac3a> ¿Estás seguro que deseas eliminar<br data-v-2bd7ac3a> este reporte? Si lo haces no habrá manera<br data-v-2bd7ac3a> de recuperarlo. </div><div class="header-separator" data-v-2bd7ac3a></div>',4),l0e={class:"modal-footer"},c0e=["disabled"],u0e=["disabled"],d0e=ov({__name:"ModalDeleteReport",props:{reportId:{type:String,required:!0},userId:{type:String,required:!0},token:{type:String,required:!0}},emits:["close","delete","reportDeleted"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(!1),f=async()=>{try{$.value=!0;const i=await M0.create({headers:{Authorization:`${n.token}`}}).delete(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${n.userId}/reports/${n.reportId}`);y("reportDeleted",n.reportId),y("close")}catch(u){console.error("Error al eliminar el reporte:",u),alert("Error al eliminar el reporte. Por favor, intenta de nuevo.")}finally{$.value=!1}};return e.onMounted(()=>{document.body.style.overflow="hidden"}),e.onUnmounted(()=>{document.body.style.overflow=""}),(u,i)=>(e.openBlock(),e.createElementBlock("div",a0e,[e.createElementVNode("div",i0e,[e.createElementVNode("button",{class:"close-btn",onClick:i[0]||(i[0]=d=>u.$emit("close"))},o0e),s0e,e.createElementVNode("div",l0e,[e.createElementVNode("button",{class:"cancel-btn",onClick:i[1]||(i[1]=d=>u.$emit("close")),disabled:$.value},"Cancelar",8,c0e),e.createElementVNode("button",{class:"delete-btn",onClick:f,disabled:$.value},e.toDisplayString($.value?"Eliminando...":"Eliminar"),9,u0e)])])]))}},[["__scopeId","data-v-2bd7ac3a"]]),EA=t=>(e.pushScopeId("data-v-ef279597"),t=t(),e.popScopeId(),t),p0e={class:"reports-header"},h0e={class:"count"},f0e={key:0,class:"sort-options"},m0e=["onClick"],y0e={key:0,class:"checkmark"},g0e=[EA(()=>e.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],v0e={key:0,class:"loading-state"},b0e=[EA(()=>e.createElementVNode("div",{class:"loading-spinner"},null,-1)),EA(()=>e.createElementVNode("p",null,"Cargando reportes...",-1))],x0e={key:1,class:"error-state"},_0e={key:3,class:"empty-reports"},w0e={key:4,class:"empty-reports"},T0e=ov({__name:"ReportsSection",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0},searchQuery:{type:String,default:""}},emits:["open-report"],setup(t,{emit:r}){const n=t,y=r,$=e.ref([]),f=e.ref(!1),u=e.ref(null),i=e.computed(()=>{let mt=$.value;if(n.searchQuery.trim()){const yt=n.searchQuery.toLowerCase().trim();mt=$.value.filter(bt=>{var It,jt,Rt,Wt,re,le,he;return!!((((It=bt.report_name)==null?void 0:It.toLowerCase())||"").includes(yt)||(((jt=bt.name)==null?void 0:jt.toLowerCase())||"").includes(yt)||bt.created_at&&new Date(bt.created_at).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(yt)||(Rt=bt.game)!=null&&Rt.date_time_utc&&new Date(bt.game.date_time_utc).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(yt)||(((re=(Wt=bt.game)==null?void 0:Wt.season_name)==null?void 0:re.toLowerCase())||"").includes(yt)||(((le=bt.tournament_name)==null?void 0:le.toLowerCase())||"").includes(yt)||(he=bt.game)!=null&&he.matchday&&bt.game.matchday.toString().includes(yt))})}return l.value&&(mt=[...mt].sort((yt,bt)=>{var xt,Pt;if(l.value==="A - Z"){const qt=(yt.report_name||"").toLowerCase(),_t=(bt.report_name||"").toLowerCase();return qt.localeCompare(_t,"es",{sensitivity:"base"})}else if(l.value==="Más recientes"){const qt=new Date(yt.created_at||0);return new Date(bt.created_at||0)-qt}else if(l.value==="Torneo"){const qt=(yt.tournament_name||"").toLowerCase(),_t=(bt.tournament_name||"").toLowerCase();if(qt!==_t)return qt.localeCompare(_t,"es",{sensitivity:"base"});const It=yt.season_id||0;return(bt.season_id||0)-It}else if(l.value==="Jornada"){const qt=((xt=yt.game)==null?void 0:xt.matchday_id)||0,_t=((Pt=bt.game)==null?void 0:Pt.matchday_id)||0;return qt-_t}return 0})),mt}),d=e.ref(!1),l=e.ref("Más recientes"),a=e.ref(!1),S=e.ref(""),T=e.ref(""),b=e.ref(""),p=e.ref(!1),s=e.ref(""),c=e.ref(""),o=e.ref(null),h=e.ref(null),v=e.ref(null),k=e.ref(0),L=[{label:"A - Z",value:"A - Z"},{label:"Más recientes",value:"Más recientes"},{label:"Torneo",value:"Torneo"},{label:"Jornada",value:"Jornada"}],E=async()=>{f.value=!0,u.value=null;try{const mt=await M0.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${n.userId}/reports`,{headers:{Authorization:`${n.token}`,"Content-Type":"application/json"}});mt.data&&Array.isArray(mt.data)?$.value=mt.data:mt.data&&mt.data.reports?$.value=mt.data.reports:mt.data&&mt.data.data?$.value=mt.data.data:$.value=[]}catch(mt){console.error("Error cargando reportes:",mt),console.error("Error response:",mt.response),u.value=mt.message||"Error al cargar los reportes",$.value=[]}finally{f.value=!1}},P=e.computed(()=>{if(!k.value)return"grid-1-column";const mt=340,yt=20,xt=k.value-40,Pt=Math.floor((xt+yt)/(mt+yt)),qt=Math.max(1,Pt);return qt>=4?"grid-4-columns":qt>=3?"grid-3-columns":qt>=2?"grid-2-columns":"grid-1-column"}),V=()=>{d.value=!d.value},I=mt=>{l.value=mt,d.value=!1};function j(mt){y("open-report",mt)}const F=(mt,yt)=>{S.value=mt,T.value=yt;const bt=$.value.find(xt=>xt.id===yt);b.value=bt?bt.template_type:"",a.value=!0},D=mt=>{a.value=!1;const yt=$.value.findIndex(bt=>bt.id===T.value);yt!==-1&&($.value[yt].report_name=mt)},U=mt=>{s.value=mt.report_name||"Reporte",c.value=mt.id,p.value=!0},M=mt=>{p.value=!1,$.value=$.value.filter(yt=>yt.id!==mt)};function X(mt){y("download-report",mt)}const O=mt=>{d.value&&o.value&&!o.value.contains(mt.target)&&(d.value=!1)},Y=()=>{h.value&&(k.value=h.value.offsetWidth)};let st=null;return e.onMounted(async()=>{document.addEventListener("mousedown",O),await E(),await e.nextTick(),Y(),window.ResizeObserver?(st=new ResizeObserver(()=>{Y()}),h.value&&st.observe(h.value)):window.addEventListener("resize",Y)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",O),st?st.disconnect():window.removeEventListener("resize",Y)}),(mt,yt)=>(e.openBlock(),e.createElementBlock("div",{class:"reports-section",ref_key:"reportsSectionRef",ref:h},[e.createElementVNode("div",p0e,[e.createElementVNode("span",null,[e.createTextVNode("Reportes "),e.createElementVNode("span",h0e,"("+e.toDisplayString(i.value.length)+")",1)]),e.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:o},[e.createElementVNode("button",{class:"sort-button",onClick:V},[e.createTextVNode(e.toDisplayString(l.value||"Ordenar")+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["dropdown-arrow",{rotated:d.value}])},null,2)]),d.value?(e.openBlock(),e.createElementBlock("div",f0e,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(L,bt=>e.createElementVNode("div",{key:bt.value,class:e.normalizeClass(["sort-option",{selected:l.value===bt.value}]),onClick:xt=>l.value!==bt.value&&I(bt.value)},[e.createElementVNode("span",null,e.toDisplayString(bt.label),1),l.value===bt.value?(e.openBlock(),e.createElementBlock("span",y0e,g0e)):e.createCommentVNode("",!0)],10,m0e)),64))])):e.createCommentVNode("",!0)],512)]),f.value?(e.openBlock(),e.createElementBlock("div",v0e,b0e)):u.value?(e.openBlock(),e.createElementBlock("div",x0e,[e.createElementVNode("p",null,"Error al cargar reportes: "+e.toDisplayString(u.value),1),e.createElementVNode("button",{onClick:E,class:"retry-button"},"Reintentar")])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["reports-grid",P.value]),ref_key:"reportsGridRef",ref:v},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,bt=>(e.openBlock(),e.createBlock(qme,{key:bt.id,report:bt,onOpenReport:j,onRenombrar:F,onEliminar:U,onDownloadReport:X},null,8,["report"]))),128))],2)),!f.value&&!u.value&&$.value.length===0?(e.openBlock(),e.createElementBlock("div",_0e," No tienes reportes aún. ")):e.createCommentVNode("",!0),!f.value&&!u.value&&$.value.length>0&&i.value.length===0?(e.openBlock(),e.createElementBlock("div",w0e," No se encontraron reportes que coincidan con tu búsqueda. ")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createBlock(r0e,{key:5,initialName:S.value,templateType:b.value,token:t.token,userId:t.userId,reportId:T.value,onClose:yt[0]||(yt[0]=bt=>a.value=!1),onRename:D,onRefresh:E},null,8,["initialName","templateType","token","userId","reportId"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(d0e,{key:6,"report-id":c.value,"user-id":t.userId,token:t.token,onClose:yt[1]||(yt[1]=bt=>p.value=!1),onReportDeleted:M},null,8,["report-id","user-id","token"])):e.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-ef279597"]]),S0e={class:"modal-overlay"},k0e={class:"modal-content"},L0e=e.createStaticVNode('<div class="modal-icon" data-v-76d7f6ed><svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-76d7f6ed><rect x="8" y="10" width="32" height="20" rx="2" stroke="#C0CBE0" stroke-width="2" data-v-76d7f6ed></rect><rect x="16" y="34" width="16" height="2" rx="1" fill="#C0CBE0" data-v-76d7f6ed></rect></svg></div><div class="modal-text" data-v-76d7f6ed> Esta sección solo está disponible para<br data-v-76d7f6ed> escritorio. Utiliza tu computadora <br data-v-76d7f6ed>para ingresar. </div>',2),C0e=ov({__name:"ModalSoloEscritorio",setup(t){return(r,n)=>(e.openBlock(),e.createElementBlock("div",S0e,[e.createElementVNode("div",k0e,[L0e,e.createElementVNode("button",{class:"modal-btn",onClick:n[0]||(n[0]=y=>r.$emit("toHome"))},"OK")])]))}},[["__scopeId","data-v-76d7f6ed"]]),o7=t=>(e.pushScopeId("data-v-9ffb4e12"),t=t(),e.popScopeId(),t),N0e=o7(()=>e.createElementVNode("h1",{class:"title"},"Mis reportes",-1)),O0e={class:"top-bar"},E0e={class:"tabs-container"},z0e={class:"tabs"},M0e={key:0,class:"actions"},V0e={class:"search-container"},P0e=o7(()=>e.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),A0e=[o7(()=>e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],R0e=o7(()=>e.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-agregar@3x.png",alt:"Agregar",class:"create-icon"},null,-1)),F0e={key:1,class:"actions"},U0e={class:"search-container"},I0e=o7(()=>e.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),q0e=[o7(()=>e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],j0e=ov({__name:"gsc-reports",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0}},emits:["toHome","download-report"],setup(t,{emit:r}){const n=t,{userId:y,team:$,token:f}=n,u=e.ref("templates"),i=e.ref(!1),d=e.ref(null),l=e.ref(!1),a=e.ref(""),S=e.ref(""),T=e.ref(null),b=e.ref(null),p=e.ref(0),s=r;function c(){if(d.value){const I=d.value.offsetWidth;i.value=I<1028}}e.watch(i,I=>{I?document.body.style.overflow="hidden":document.body.style.overflow=""}),e.onBeforeUnmount(()=>{document.body.style.overflow=""}),e.onMounted(()=>{c(),window.addEventListener("resize",c)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",c)});function o(I){h(I)}function h(I){T.value.show({template:I,isTemplateMode:!0})}const v=()=>{a.value=""},k=()=>{S.value=""};function L(I){T.value&&T.value.show({template:I,isTemplateMode:!1})}function E(I){s("download-report",I)}function P(){s("toHome")}function V(){b.value&&b.value.obtenerTemplates(),p.value+=1}return(I,j)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(hae),{ref_key:"reportTemplateMaker",ref:T,token:e.unref(f),"user-team-id":e.unref($),onClose:V},null,8,["token","user-team-id"]),e.createElementVNode("div",{ref_key:"containerRef",ref:d,class:"reports-container"},[i.value?(e.openBlock(),e.createBlock(C0e,{key:0,onToHome:P})):e.createCommentVNode("",!0),N0e,e.createElementVNode("div",O0e,[e.createElementVNode("div",E0e,[e.createElementVNode("div",z0e,[e.createElementVNode("div",{class:e.normalizeClass(["tab tab-templates",{active:u.value==="templates"}]),onClick:j[0]||(j[0]=F=>u.value="templates")}," Templates ",2),e.createElementVNode("div",{class:e.normalizeClass(["tab tab-reports",{active:u.value==="reports"}]),onClick:j[1]||(j[1]=F=>u.value="reports")}," Tus reportes ",2)])]),u.value==="templates"?(e.openBlock(),e.createElementBlock("div",M0e,[e.createElementVNode("div",V0e,[P0e,e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":j[2]||(j[2]=F=>a.value=F),class:"search",type:"text",placeholder:"Buscar template"},null,512),[[e.vModelText,a.value]]),a.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:v,class:"clear-search-btn",type:"button"},A0e)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"create-template-btn",onClick:j[3]||(j[3]=F=>l.value=!0)},[R0e,e.createTextVNode(" Crear template ")])])):e.createCommentVNode("",!0),u.value==="reports"?(e.openBlock(),e.createElementBlock("div",F0e,[e.createElementVNode("div",U0e,[I0e,e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":j[4]||(j[4]=F=>S.value=F),class:"search search-reports",type:"text",placeholder:"Buscar reporte"},null,512),[[e.vModelText,S.value]]),S.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:k,class:"clear-search-btn",type:"button"},q0e)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),u.value==="templates"?(e.openBlock(),e.createBlock(Pde,{ref_key:"templatesSectionRef",ref:b,userId:e.unref(y),token:e.unref(f),team:e.unref($),searchQuery:a.value,key:p.value,onSwitchToReports:j[5]||(j[5]=F=>u.value="reports"),onOpenModalNewTemplate:o,onEditTemplate:h},null,8,["userId","token","team","searchQuery"])):(e.openBlock(),e.createBlock(T0e,{key:2,userId:e.unref(y),token:e.unref(f),team:e.unref($),searchQuery:S.value,onOpenReport:L,onDownloadReport:E},null,8,["userId","token","team","searchQuery"])),l.value?(e.openBlock(),e.createBlock(CJ,{key:3,token:e.unref(f),team:e.unref($),onOpenModalNewTemplate:o,onClose:j[6]||(j[6]=F=>l.value=!1)},null,8,["token","team"])):e.createCommentVNode("",!0)],512)],64))}},[["__scopeId","data-v-9ffb4e12"]]),D0e={class:"subcategory-group"},W0e={__name:"SubcategoryGroup",props:{subcategoryGroup:{type:Array,default:()=>[]}},setup(t){return(r,n)=>(e.openBlock(),e.createElementBlock("div",D0e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.subcategoryGroup,y=>(e.openBlock(),e.createBlock(e.unref(dM),{key:y.id,modelValue:y.isSelected,"onUpdate:modelValue":$=>y.isSelected=$,label:y.name},null,8,["modelValue","onUpdate:modelValue","label"]))),128))]))}},B0e=A_(W0e,[["__scopeId","data-v-ae6f3d72"]]),K0e={class:"filter-subcategories"},X0e=Object.freeze(Object.defineProperty({__proto__:null,default:A_({__name:"FilterSubcategories",props:{subcategoryGroups:{type:Array,default:()=>[]}},setup(t){return(r,n)=>(e.openBlock(),e.createElementBlock("div",K0e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.subcategoryGroups,y=>(e.openBlock(),e.createElementBlock("div",{key:y.id,class:"filter-subcategories__group"},[e.createVNode(B0e,{subcategoryGroup:y},null,8,["subcategoryGroup"])]))),128))]))}},[["__scopeId","data-v-5edaefc2"]])},Symbol.toStringTag,{value:"Module"})),DO=t=>(e.pushScopeId("data-v-80d9c265"),t=t(),e.popScopeId(),t),G0e={class:"details__header"},Z0e=DO(()=>e.createElementVNode("div",{class:"details__header__title"},"Jugando como",-1)),J0e={class:"details__header__checkbox"},H0e={class:"details__body"},Y0e={class:"details__body__playing-as"},Q0e=["onClick"],$0e={class:"details__header"},tye=DO(()=>e.createElementVNode("div",{class:"details__header__title"},"En: (Elige el lapso de tiempo)",-1)),eye={class:"details__header__checkbox"},rye={class:"details__body"},nye=DO(()=>e.createElementVNode("div",{class:"details__body__title"},"1er tiempo",-1)),aye={class:"details__body__game-section"},iye=["onClick"],oye={class:"details__body"},sye=DO(()=>e.createElementVNode("div",{class:"details__body__title"},"2do tiempo",-1)),lye={class:"details__body__game-section"},cye=["onClick"],uye=Object.freeze(Object.defineProperty({__proto__:null,default:A_({__name:"FilterConditions",props:{playingAs:{type:Array,default:()=>[{name:"Local",isSelected:!0},{name:"Visitante",isSelected:!0}]},gameSections:{type:Array,default:()=>[{text:"0-15",value:1,isSelected:!0},{text:"16-30",value:2,isSelected:!0},{text:"31-45",value:3,isSelected:!0},{text:"46-60",value:4,isSelected:!0},{text:"61-75",value:5,isSelected:!0},{text:"76-90",value:6,isSelected:!0}]},buttonsBackgroundColor:{type:String,default:"rgba(255, 255, 255, 0)"},buttonsBackgroundColorActive:{type:String,default:"rgba(203, 238, 107, 0.05)"},buttonsTextColor:{type:String,default:"rgba(255, 255, 255, 0.8)"},buttonsTextColorActive:{type:String,default:"rgba(255, 255, 255, 1)"},buttonsBorderColor:{type:String,default:"#8ea2ab"},buttonsBorderColorActive:{type:String,default:"#cbee6b"},buttonsBorderWidth:{type:String,default:"0.8px"},buttonsBorderWidthActive:{type:String,default:"1px"},buttonsBorderRadius:{type:String,default:"4px"}},setup(t){const r=t;e.useCssVars(a=>({"49cba245":t.buttonsBackgroundColor,"52f02da6":t.buttonsTextColor,"7d3f686a":t.buttonsBorderWidth,"7c286a07":t.buttonsBorderColor,"24a6f4aa":t.buttonsBackgroundColorActive,cd8d7768:t.buttonsTextColorActive,"35fa5c10":t.buttonsBorderWidthActive,"0cde1826":t.buttonsBorderColorActive}));const n=e.computed(()=>r.playingAs.every(a=>a.isSelected)),y=e.computed(()=>r.gameSections.every(a=>a.isSelected)),$=e.computed(()=>r.gameSections.reduce((a,S)=>(S.value<=3?a.firstHalf.push(S):a.secondHalf.push(S),a),{firstHalf:[],secondHalf:[]})),f=e.computed(()=>({"--border-radius-first-button":`${r.buttonsBorderRadius} 0 0 ${r.buttonsBorderRadius}`,"--border-radius-last-button":`0 ${r.buttonsBorderRadius} ${r.buttonsBorderRadius} 0`}));function u(a){a?r.playingAs.forEach(S=>{S.isSelected=!0}):r.playingAs.forEach((S,T)=>{S.isSelected=T===0})}function i(a){r.playingAs.filter(S=>S.isSelected).length===1&&a.isSelected||(a.isSelected=!a.isSelected)}function d(a){r.gameSections.filter(S=>S.isSelected).length===1&&a.isSelected||(a.isSelected=!a.isSelected)}function l(a){a?r.gameSections.forEach(S=>{S.isSelected=!0}):r.gameSections.forEach((S,T)=>{S.isSelected=T===0})}return(a,S)=>(e.openBlock(),e.createElementBlock("div",{class:"details",style:e.normalizeStyle(f.value)},[e.createElementVNode("div",G0e,[Z0e,e.createElementVNode("div",J0e,[e.createVNode(e.unref(dM),{label:"Todos","model-value":n.value,"onUpdate:modelValue":u},null,8,["model-value"])])]),e.createElementVNode("div",H0e,[e.createElementVNode("div",Y0e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.playingAs,(T,b)=>(e.openBlock(),e.createElementBlock("div",{key:`pa${b}`,class:e.normalizeClass(["details__body__button",{active:T.isSelected}]),onClick:p=>i(T)},e.toDisplayString(T.name),11,Q0e))),128))])]),e.createElementVNode("div",$0e,[tye,e.createElementVNode("div",eye,[e.createVNode(e.unref(dM),{label:"Todos","model-value":y.value,"onUpdate:modelValue":l},null,8,["model-value"])])]),e.createElementVNode("div",rye,[nye,e.createElementVNode("div",aye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value.firstHalf,(T,b)=>(e.openBlock(),e.createElementBlock("div",{key:`pa${b}`,class:e.normalizeClass(["details__body__button",{active:T.isSelected}]),onClick:p=>d(T)},e.toDisplayString(T.text),11,iye))),128))])]),e.createElementVNode("div",oye,[sye,e.createElementVNode("div",lye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value.secondHalf,(T,b)=>(e.openBlock(),e.createElementBlock("div",{key:`pa${b}`,class:e.normalizeClass(["details__body__button",{active:T.isSelected}]),onClick:p=>d(T)},e.toDisplayString(T.text),11,cye))),128))])])],4))}},[["__scopeId","data-v-80d9c265"]])},Symbol.toStringTag,{value:"Module"})),dye={class:"filter-field"},pye=Object.freeze(Object.defineProperty({__proto__:null,default:A_({__name:"FilterField",setup(t){const r=e.ref(Array.from({length:16},(y,$)=>$+1));function n(){}return(y,$)=>(e.openBlock(),e.createElementBlock("div",dye,[e.createVNode(e.unref(Ugt),{width:"100%","background-color":"#2E3B46",value:r.value,"onUpdate:modelValue":n},null,8,["value"])]))}},[["__scopeId","data-v-8103c3e1"]])},Symbol.toStringTag,{value:"Module"}));BT.GSCReports=j0e,Object.defineProperty(BT,Symbol.toStringTag,{value:"Module"})}));