@golstats/gsc-reports 1.0.69 → 1.0.70

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.
@@ -4083,7 +4083,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
4083
4083
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(i){return i instanceof this?i:new this(i)}static concat(i,...y){const B=new this(i);return y.forEach(Z=>B.set(Z)),B}static accessor(i){const B=(this[tT]=this[tT]={accessors:{}}).accessors,Z=this.prototype;function C(b){const t=um(b);B[t]||(Ode(Z,b),B[t]=!0)}return Hn.isArray(i)?i.forEach(C):C(i),this}};mu.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Hn.reduceDescriptors(mu.prototype,({value:r},i)=>{let y=i[0].toUpperCase()+i.slice(1);return{get:()=>r,set(B){this[y]=B}}}),Hn.freezeMethods(mu);function $2(r,i){const y=this||cm,B=i||y,Z=mu.from(B.headers);let C=B.data;return Hn.forEach(r,function(t){C=t.call(y,C,Z.normalize(),i?i.status:void 0)}),Z.normalize(),C}function rT(r){return!!(r&&r.__CANCEL__)}function Wp(r,i,y){vi.call(this,r??"canceled",vi.ERR_CANCELED,i,y),this.name="CanceledError"}Hn.inherits(Wp,vi,{__CANCEL__:!0});function nT(r,i,y){const B=y.config.validateStatus;!y.status||!B||B(y.status)?r(y):i(new vi("Request failed with status code "+y.status,[vi.ERR_BAD_REQUEST,vi.ERR_BAD_RESPONSE][Math.floor(y.status/100)-4],y.config,y.request,y))}function Lde(r){const i=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return i&&i[1]||""}function Rde(r,i){r=r||10;const y=new Array(r),B=new Array(r);let Z=0,C=0,b;return i=i!==void 0?i:1e3,function(g){const u=Date.now(),e=B[C];b||(b=u),y[Z]=g,B[Z]=u;let w=C,v=0;for(;w!==Z;)v+=y[w++],w=w%r;if(Z=(Z+1)%r,Z===C&&(C=(C+1)%r),u-b<i)return;const x=e&&u-e;return x?Math.round(v*1e3/x):void 0}}function zde(r,i){let y=0,B=1e3/i,Z,C;const b=(u,e=Date.now())=>{y=e,Z=null,C&&(clearTimeout(C),C=null),r(...u)};return[(...u)=>{const e=Date.now(),w=e-y;w>=B?b(u,e):(Z=u,C||(C=setTimeout(()=>{C=null,b(Z)},B-w)))},()=>Z&&b(Z)]}const hg=(r,i,y=3)=>{let B=0;const Z=Rde(50,250);return zde(C=>{const b=C.loaded,t=C.lengthComputable?C.total:void 0,g=b-B,u=Z(g),e=b<=t;B=b;const w={loaded:b,total:t,progress:t?b/t:void 0,bytes:g,rate:u||void 0,estimated:u&&t&&e?(t-b)/u:void 0,event:C,lengthComputable:t!=null,[i?"download":"upload"]:!0};r(w)},y)},aT=(r,i)=>{const y=r!=null;return[B=>i[0]({lengthComputable:y,total:r,loaded:B}),i[1]]},iT=r=>(...i)=>Hn.asap(()=>r(...i)),Dde=Ic.hasStandardBrowserEnv?((r,i)=>y=>(y=new URL(y,Ic.origin),r.protocol===y.protocol&&r.host===y.host&&(i||r.port===y.port)))(new URL(Ic.origin),Ic.navigator&&/(msie|trident)/i.test(Ic.navigator.userAgent)):()=>!0,Bde=Ic.hasStandardBrowserEnv?{write(r,i,y,B,Z,C){const b=[r+"="+encodeURIComponent(i)];Hn.isNumber(y)&&b.push("expires="+new Date(y).toGMTString()),Hn.isString(B)&&b.push("path="+B),Hn.isString(Z)&&b.push("domain="+Z),C===!0&&b.push("secure"),document.cookie=b.join("; ")},read(r){const i=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Vde(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function jde(r,i){return i?r.replace(/\/?\/$/,"")+"/"+i.replace(/^\/+/,""):r}function oT(r,i,y){let B=!Vde(i);return r&&(B||y==!1)?jde(r,i):i}const sT=r=>r instanceof mu?{...r}:r;function Qh(r,i){i=i||{};const y={};function B(u,e,w,v){return Hn.isPlainObject(u)&&Hn.isPlainObject(e)?Hn.merge.call({caseless:v},u,e):Hn.isPlainObject(e)?Hn.merge({},e):Hn.isArray(e)?e.slice():e}function Z(u,e,w,v){if(Hn.isUndefined(e)){if(!Hn.isUndefined(u))return B(void 0,u,w,v)}else return B(u,e,w,v)}function C(u,e){if(!Hn.isUndefined(e))return B(void 0,e)}function b(u,e){if(Hn.isUndefined(e)){if(!Hn.isUndefined(u))return B(void 0,u)}else return B(void 0,e)}function t(u,e,w){if(w in i)return B(u,e);if(w in r)return B(void 0,u)}const g={url:C,method:C,data:C,baseURL:b,transformRequest:b,transformResponse:b,paramsSerializer:b,timeout:b,timeoutMessage:b,withCredentials:b,withXSRFToken:b,adapter:b,responseType:b,xsrfCookieName:b,xsrfHeaderName:b,onUploadProgress:b,onDownloadProgress:b,decompress:b,maxContentLength:b,maxBodyLength:b,beforeRedirect:b,transport:b,httpAgent:b,httpsAgent:b,cancelToken:b,socketPath:b,responseEncoding:b,validateStatus:t,headers:(u,e,w)=>Z(sT(u),sT(e),w,!0)};return Hn.forEach(Object.keys({...r,...i}),function(e){const w=g[e]||Z,v=w(r[e],i[e],e);Hn.isUndefined(v)&&w!==t||(y[e]=v)}),y}const lT=r=>{const i=Qh({},r);let{data:y,withXSRFToken:B,xsrfHeaderName:Z,xsrfCookieName:C,headers:b,auth:t}=i;i.headers=b=mu.from(b),i.url=Y6(oT(i.baseURL,i.url,i.allowAbsoluteUrls),r.params,r.paramsSerializer),t&&b.set("Authorization","Basic "+btoa((t.username||"")+":"+(t.password?unescape(encodeURIComponent(t.password)):"")));let g;if(Hn.isFormData(y)){if(Ic.hasStandardBrowserEnv||Ic.hasStandardBrowserWebWorkerEnv)b.setContentType(void 0);else if((g=b.getContentType())!==!1){const[u,...e]=g?g.split(";").map(w=>w.trim()).filter(Boolean):[];b.setContentType([u||"multipart/form-data",...e].join("; "))}}if(Ic.hasStandardBrowserEnv&&(B&&Hn.isFunction(B)&&(B=B(i)),B||B!==!1&&Dde(i.url))){const u=Z&&C&&Bde.read(C);u&&b.set(Z,u)}return i},Fde=typeof XMLHttpRequest<"u"&&function(r){return new Promise(function(y,B){const Z=lT(r);let C=Z.data;const b=mu.from(Z.headers).normalize();let{responseType:t,onUploadProgress:g,onDownloadProgress:u}=Z,e,w,v,x,h;function n(){x&&x(),h&&h(),Z.cancelToken&&Z.cancelToken.unsubscribe(e),Z.signal&&Z.signal.removeEventListener("abort",e)}let a=new XMLHttpRequest;a.open(Z.method.toUpperCase(),Z.url,!0),a.timeout=Z.timeout;function d(){if(!a)return;const c=mu.from("getAllResponseHeaders"in a&&a.getAllResponseHeaders()),m={data:!t||t==="text"||t==="json"?a.responseText:a.response,status:a.status,statusText:a.statusText,headers:c,config:r,request:a};nT(function(E){y(E),n()},function(E){B(E),n()},m),a=null}"onloadend"in a?a.onloadend=d:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(d)},a.onabort=function(){a&&(B(new vi("Request aborted",vi.ECONNABORTED,r,a)),a=null)},a.onerror=function(){B(new vi("Network Error",vi.ERR_NETWORK,r,a)),a=null},a.ontimeout=function(){let f=Z.timeout?"timeout of "+Z.timeout+"ms exceeded":"timeout exceeded";const m=Z.transitional||$6;Z.timeoutErrorMessage&&(f=Z.timeoutErrorMessage),B(new vi(f,m.clarifyTimeoutError?vi.ETIMEDOUT:vi.ECONNABORTED,r,a)),a=null},C===void 0&&b.setContentType(null),"setRequestHeader"in a&&Hn.forEach(b.toJSON(),function(f,m){a.setRequestHeader(m,f)}),Hn.isUndefined(Z.withCredentials)||(a.withCredentials=!!Z.withCredentials),t&&t!=="json"&&(a.responseType=Z.responseType),u&&([v,h]=hg(u,!0),a.addEventListener("progress",v)),g&&a.upload&&([w,x]=hg(g),a.upload.addEventListener("progress",w),a.upload.addEventListener("loadend",x)),(Z.cancelToken||Z.signal)&&(e=c=>{a&&(B(!c||c.type?new Wp(null,r,a):c),a.abort(),a=null)},Z.cancelToken&&Z.cancelToken.subscribe(e),Z.signal&&(Z.signal.aborted?e():Z.signal.addEventListener("abort",e)));const s=Lde(Z.url);if(s&&Ic.protocols.indexOf(s)===-1){B(new vi("Unsupported protocol "+s+":",vi.ERR_BAD_REQUEST,r));return}a.send(C||null)})},Ude=(r,i)=>{const{length:y}=r=r?r.filter(Boolean):[];if(i||y){let B=new AbortController,Z;const C=function(u){if(!Z){Z=!0,t();const e=u instanceof Error?u:this.reason;B.abort(e instanceof vi?e:new Wp(e instanceof Error?e.message:e))}};let b=i&&setTimeout(()=>{b=null,C(new vi(`timeout ${i} of ms exceeded`,vi.ETIMEDOUT))},i);const t=()=>{r&&(b&&clearTimeout(b),b=null,r.forEach(u=>{u.unsubscribe?u.unsubscribe(C):u.removeEventListener("abort",C)}),r=null)};r.forEach(u=>u.addEventListener("abort",C));const{signal:g}=B;return g.unsubscribe=()=>Hn.asap(t),g}},qde=function*(r,i){let y=r.byteLength;if(y<i){yield r;return}let B=0,Z;for(;B<y;)Z=B+i,yield r.slice(B,Z),B=Z},Wde=async function*(r,i){for await(const y of Gde(r))yield*qde(y,i)},Gde=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const i=r.getReader();try{for(;;){const{done:y,value:B}=await i.read();if(y)break;yield B}}finally{await i.cancel()}},cT=(r,i,y,B)=>{const Z=Wde(r,i);let C=0,b,t=g=>{b||(b=!0,B&&B(g))};return new ReadableStream({async pull(g){try{const{done:u,value:e}=await Z.next();if(u){t(),g.close();return}let w=e.byteLength;if(y){let v=C+=w;y(v)}g.enqueue(new Uint8Array(e))}catch(u){throw t(u),u}},cancel(g){return t(g),Z.return()}},{highWaterMark:2})},pg=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",uT=pg&&typeof ReadableStream=="function",Hde=pg&&(typeof TextEncoder=="function"?(r=>i=>r.encode(i))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),dT=(r,...i)=>{try{return!!r(...i)}catch{return!1}},Xde=uT&&dT(()=>{let r=!1;const i=new Request(Ic.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!i}),hT=64*1024,ex=uT&&dT(()=>Hn.isReadableStream(new Response("").body)),fg={stream:ex&&(r=>r.body)};pg&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(i=>{!fg[i]&&(fg[i]=Hn.isFunction(r[i])?y=>y[i]():(y,B)=>{throw new vi(`Response type '${i}' is not supported`,vi.ERR_NOT_SUPPORT,B)})})})(new Response);const Jde=async r=>{if(r==null)return 0;if(Hn.isBlob(r))return r.size;if(Hn.isSpecCompliantForm(r))return(await new Request(Ic.origin,{method:"POST",body:r}).arrayBuffer()).byteLength;if(Hn.isArrayBufferView(r)||Hn.isArrayBuffer(r))return r.byteLength;if(Hn.isURLSearchParams(r)&&(r=r+""),Hn.isString(r))return(await Hde(r)).byteLength},Zde=async(r,i)=>{const y=Hn.toFiniteNumber(r.getContentLength());return y??Jde(i)},tx={http:yde,xhr:Fde,fetch:pg&&(async r=>{let{url:i,method:y,data:B,signal:Z,cancelToken:C,timeout:b,onDownloadProgress:t,onUploadProgress:g,responseType:u,headers:e,withCredentials:w="same-origin",fetchOptions:v}=lT(r);u=u?(u+"").toLowerCase():"text";let x=Ude([Z,C&&C.toAbortSignal()],b),h;const n=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let a;try{if(g&&Xde&&y!=="get"&&y!=="head"&&(a=await Zde(e,B))!==0){let m=new Request(i,{method:"POST",body:B,duplex:"half"}),k;if(Hn.isFormData(B)&&(k=m.headers.get("content-type"))&&e.setContentType(k),m.body){const[E,S]=aT(a,hg(iT(g)));B=cT(m.body,hT,E,S)}}Hn.isString(w)||(w=w?"include":"omit");const d="credentials"in Request.prototype;h=new Request(i,{...v,signal:x,method:y.toUpperCase(),headers:e.normalize().toJSON(),body:B,duplex:"half",credentials:d?w:void 0});let s=await fetch(h,v);const c=ex&&(u==="stream"||u==="response");if(ex&&(t||c&&n)){const m={};["status","statusText","headers"].forEach(P=>{m[P]=s[P]});const k=Hn.toFiniteNumber(s.headers.get("content-length")),[E,S]=t&&aT(k,hg(iT(t),!0))||[];s=new Response(cT(s.body,hT,E,()=>{S&&S(),n&&n()}),m)}u=u||"text";let f=await fg[Hn.findKey(fg,u)||"text"](s,r);return!c&&n&&n(),await new Promise((m,k)=>{nT(m,k,{data:f,headers:mu.from(s.headers),status:s.status,statusText:s.statusText,config:r,request:h})})}catch(d){throw n&&n(),d&&d.name==="TypeError"&&/Load failed|fetch/i.test(d.message)?Object.assign(new vi("Network Error",vi.ERR_NETWORK,r,h),{cause:d.cause||d}):vi.from(d,d&&d.code,r,h)}})};Hn.forEach(tx,(r,i)=>{if(r){try{Object.defineProperty(r,"name",{value:i})}catch{}Object.defineProperty(r,"adapterName",{value:i})}});const pT=r=>`- ${r}`,Kde=r=>Hn.isFunction(r)||r===null||r===!1,fT={getAdapter:r=>{r=Hn.isArray(r)?r:[r];const{length:i}=r;let y,B;const Z={};for(let C=0;C<i;C++){y=r[C];let b;if(B=y,!Kde(y)&&(B=tx[(b=String(y)).toLowerCase()],B===void 0))throw new vi(`Unknown adapter '${b}'`);if(B)break;Z[b||"#"+C]=B}if(!B){const C=Object.entries(Z).map(([t,g])=>`adapter ${t} `+(g===!1?"is not supported by the environment":"is not available in the build"));let b=i?C.length>1?`since :
4084
4084
  `+C.map(pT).join(`
4085
4085
  `):" "+pT(C[0]):"as no adapter specified";throw new vi("There is no suitable adapter to dispatch the request "+b,"ERR_NOT_SUPPORT")}return B},adapters:tx};function rx(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Wp(null,r)}function mT(r){return rx(r),r.headers=mu.from(r.headers),r.data=$2.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),fT.getAdapter(r.adapter||cm.adapter)(r).then(function(B){return rx(r),B.data=$2.call(r,r.transformResponse,B),B.headers=mu.from(B.headers),B},function(B){return rT(B)||(rx(r),B&&B.response&&(B.response.data=$2.call(r,r.transformResponse,B.response),B.response.headers=mu.from(B.response.headers))),Promise.reject(B)})}const yT="1.11.0",mg={};["object","boolean","number","function","string","symbol"].forEach((r,i)=>{mg[r]=function(B){return typeof B===r||"a"+(i<1?"n ":" ")+r}});const gT={};mg.transitional=function(i,y,B){function Z(C,b){return"[Axios v"+yT+"] Transitional option '"+C+"'"+b+(B?". "+B:"")}return(C,b,t)=>{if(i===!1)throw new vi(Z(b," has been removed"+(y?" in "+y:"")),vi.ERR_DEPRECATED);return y&&!gT[b]&&(gT[b]=!0,console.warn(Z(b," has been deprecated since v"+y+" and will be removed in the near future"))),i?i(C,b,t):!0}},mg.spelling=function(i){return(y,B)=>(console.warn(`${B} is likely a misspelling of ${i}`),!0)};function Yde(r,i,y){if(typeof r!="object")throw new vi("options must be an object",vi.ERR_BAD_OPTION_VALUE);const B=Object.keys(r);let Z=B.length;for(;Z-- >0;){const C=B[Z],b=i[C];if(b){const t=r[C],g=t===void 0||b(t,C,r);if(g!==!0)throw new vi("option "+C+" must be "+g,vi.ERR_BAD_OPTION_VALUE);continue}if(y!==!0)throw new vi("Unknown option "+C,vi.ERR_BAD_OPTION)}}const yg={assertOptions:Yde,validators:mg},wd=yg.validators;let $h=class{constructor(i){this.defaults=i||{},this.interceptors={request:new Q6,response:new Q6}}async request(i,y){try{return await this._request(i,y)}catch(B){if(B instanceof Error){let Z={};Error.captureStackTrace?Error.captureStackTrace(Z):Z=new Error;const C=Z.stack?Z.stack.replace(/^.+\n/,""):"";try{B.stack?C&&!String(B.stack).endsWith(C.replace(/^.+\n.+\n/,""))&&(B.stack+=`
4086
- `+C):B.stack=C}catch{}}throw B}}_request(i,y){typeof i=="string"?(y=y||{},y.url=i):y=i||{},y=Qh(this.defaults,y);const{transitional:B,paramsSerializer:Z,headers:C}=y;B!==void 0&&yg.assertOptions(B,{silentJSONParsing:wd.transitional(wd.boolean),forcedJSONParsing:wd.transitional(wd.boolean),clarifyTimeoutError:wd.transitional(wd.boolean)},!1),Z!=null&&(Hn.isFunction(Z)?y.paramsSerializer={serialize:Z}:yg.assertOptions(Z,{encode:wd.function,serialize:wd.function},!0)),y.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?y.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:y.allowAbsoluteUrls=!0),yg.assertOptions(y,{baseUrl:wd.spelling("baseURL"),withXsrfToken:wd.spelling("withXSRFToken")},!0),y.method=(y.method||this.defaults.method||"get").toLowerCase();let b=C&&Hn.merge(C.common,C[y.method]);C&&Hn.forEach(["delete","get","head","post","put","patch","common"],h=>{delete C[h]}),y.headers=mu.concat(b,C);const t=[];let g=!0;this.interceptors.request.forEach(function(n){typeof n.runWhen=="function"&&n.runWhen(y)===!1||(g=g&&n.synchronous,t.unshift(n.fulfilled,n.rejected))});const u=[];this.interceptors.response.forEach(function(n){u.push(n.fulfilled,n.rejected)});let e,w=0,v;if(!g){const h=[mT.bind(this),void 0];for(h.unshift(...t),h.push(...u),v=h.length,e=Promise.resolve(y);w<v;)e=e.then(h[w++],h[w++]);return e}v=t.length;let x=y;for(w=0;w<v;){const h=t[w++],n=t[w++];try{x=h(x)}catch(a){n.call(this,a);break}}try{e=mT.call(this,x)}catch(h){return Promise.reject(h)}for(w=0,v=u.length;w<v;)e=e.then(u[w++],u[w++]);return e}getUri(i){i=Qh(this.defaults,i);const y=oT(i.baseURL,i.url,i.allowAbsoluteUrls);return Y6(y,i.params,i.paramsSerializer)}};Hn.forEach(["delete","get","head","options"],function(i){$h.prototype[i]=function(y,B){return this.request(Qh(B||{},{method:i,url:y,data:(B||{}).data}))}}),Hn.forEach(["post","put","patch"],function(i){function y(B){return function(C,b,t){return this.request(Qh(t||{},{method:i,headers:B?{"Content-Type":"multipart/form-data"}:{},url:C,data:b}))}}$h.prototype[i]=y(),$h.prototype[i+"Form"]=y(!0)});let Qde=class WT{constructor(i){if(typeof i!="function")throw new TypeError("executor must be a function.");let y;this.promise=new Promise(function(C){y=C});const B=this;this.promise.then(Z=>{if(!B._listeners)return;let C=B._listeners.length;for(;C-- >0;)B._listeners[C](Z);B._listeners=null}),this.promise.then=Z=>{let C;const b=new Promise(t=>{B.subscribe(t),C=t}).then(Z);return b.cancel=function(){B.unsubscribe(C)},b},i(function(C,b,t){B.reason||(B.reason=new Wp(C,b,t),y(B.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(i){if(this.reason){i(this.reason);return}this._listeners?this._listeners.push(i):this._listeners=[i]}unsubscribe(i){if(!this._listeners)return;const y=this._listeners.indexOf(i);y!==-1&&this._listeners.splice(y,1)}toAbortSignal(){const i=new AbortController,y=B=>{i.abort(B)};return this.subscribe(y),i.signal.unsubscribe=()=>this.unsubscribe(y),i.signal}static source(){let i;return{token:new WT(function(Z){i=Z}),cancel:i}}};function $de(r){return function(y){return r.apply(null,y)}}function ehe(r){return Hn.isObject(r)&&r.isAxiosError===!0}const nx={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};Object.entries(nx).forEach(([r,i])=>{nx[i]=r});function vT(r){const i=new $h(r),y=z6($h.prototype.request,i);return Hn.extend(y,$h.prototype,i,{allOwnKeys:!0}),Hn.extend(y,i,null,{allOwnKeys:!0}),y.create=function(Z){return vT(Qh(r,Z))},y}const to=vT(cm);to.Axios=$h,to.CanceledError=Wp,to.CancelToken=Qde,to.isCancel=rT,to.VERSION=yT,to.toFormData=ug,to.AxiosError=vi,to.Cancel=to.CanceledError,to.all=function(i){return Promise.all(i)},to.spread=$de,to.isAxiosError=ehe,to.mergeConfig=Qh,to.AxiosHeaders=mu,to.formToJSON=r=>eT(Hn.isHTMLForm(r)?new FormData(r):r),to.getAdapter=fT.getAdapter,to.HttpStatusCode=nx,to.default=to;const{Axios:Ive,AxiosError:Nve,CanceledError:Ove,isCancel:Lve,CancelToken:Rve,VERSION:zve,all:Dve,Cancel:Bve,isAxiosError:Vve,spread:jve,toFormData:Fve,AxiosHeaders:Uve,HttpStatusCode:qve,formToJSON:Wve,getAdapter:Gve,mergeConfig:Hve}=to,ws=(r,i)=>{const y=r.__vccOpts||r;for(const[B,Z]of i)y[B]=Z;return y},the={class:"tooltip-template-options"},rhe=ws({__name:"TooltipTemplateOptions",props:{canEdit:{type:Boolean,default:!0}},emits:["generar-reporte","renombrar","editar","duplicar","eliminar"],setup(r,{emit:i}){return(y,B)=>(p.openBlock(),p.createElementBlock("div",the,[p.createElementVNode("ul",null,[p.createElementVNode("li",{class:"option",onClick:B[0]||(B[0]=Z=>y.$emit("generar-reporte"))},[...B[5]||(B[5]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report.svg",alt:"Generar reporte",class:"icon"},null,-1),p.createTextVNode(" Generar reporte ",-1)])]),r.canEdit?(p.openBlock(),p.createElementBlock("li",{key:0,class:"option",onClick:B[1]||(B[1]=Z=>y.$emit("renombrar"))},[...B[6]||(B[6]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),p.createTextVNode(" Renombrar template ",-1)])])):p.createCommentVNode("",!0),r.canEdit?(p.openBlock(),p.createElementBlock("li",{key:1,class:"option",onClick:B[2]||(B[2]=Z=>y.$emit("editar"))},[...B[7]||(B[7]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-edit.svg",alt:"Editar template",class:"icon"},null,-1),p.createTextVNode(" Editar template ",-1)])])):p.createCommentVNode("",!0),p.createElementVNode("li",{class:"option",onClick:B[3]||(B[3]=Z=>y.$emit("duplicar"))},[...B[8]||(B[8]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-duplicate.svg",alt:"Duplicar template",class:"icon"},null,-1),p.createTextVNode(" Duplicar template ",-1)])]),r.canEdit?(p.openBlock(),p.createElementBlock("li",{key:2,class:"option",onClick:B[4]||(B[4]=Z=>y.$emit("eliminar"))},[...B[9]||(B[9]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),p.createTextVNode(" Eliminar template ",-1)])])):p.createCommentVNode("",!0)])]))}},[["__scopeId","data-v-127740d3"]]),nhe={class:"template-card postpartido",style:{position:"relative"}},ahe={key:0,class:"template-img-placeholder",style:{position:"relative"}},ihe={key:0,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-01.jpg",alt:"Template Prematch Type 1",class:"template-img"},ohe={key:1,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-01.jpg",alt:"Template Postmatch Type 1",class:"template-img"},she={key:2,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-02.jpg",alt:"Template Prematch Type 2",class:"template-img"},lhe={key:3,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-02.jpg",alt:"Template Postmatch Type 2",class:"template-img"},che={key:4,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-03.jpg",alt:"Template Prematch Type 3",class:"template-img"},uhe={key:5,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-03.jpg",alt:"Template Postmatch Type 3",class:"template-img"},dhe={key:6,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-04.jpg",alt:"Template Prematch Type 4",class:"template-img"},hhe={key:7,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-04.jpg",alt:"Template Postmatch Type 4",class:"template-img"},phe={key:8,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumb1.png",alt:"Template Default",class:"template-img"},fhe={class:"inner-card-postpartido"},mhe={class:"postpartido-footer"},yhe={class:"postpartido-version"},ghe={class:"postpartido-status"},vhe={class:"tipo-value"},xhe=ws({__name:"TemplateItem",props:{template:{type:Object,required:!0},userId:{type:Number,required:!0}},emits:["generar-reporte","renombrar","duplicar","eliminar","edit-template"],setup(r,{emit:i}){const y=r,B=i,Z=p.ref(!1),C=p.computed(()=>y.userId===y.template.user_id);function b(){Z.value=!1,B("generar-reporte")}function t(){Z.value=!1;const v=y.template.name||"";B("renombrar",v)}function g(){Z.value=!1,B("edit-template",y.template)}function u(){Z.value=!1;const v=y.template.name||"";B("duplicar",v)}function e(){Z.value=!1,B("eliminar",y.template)}function w(v){}return(v,x)=>(p.openBlock(),p.createElementBlock("div",nhe,[p.createElementVNode("div",{class:"three-dots",onClick:x[0]||(x[0]=p.withModifiers(h=>Z.value=!Z.value,["stop"]))},[...x[5]||(x[5]=[p.createElementVNode("span",null,null,-1),p.createElementVNode("span",null,null,-1),p.createElementVNode("span",null,null,-1)])]),r.template.pages&&r.template.pages[0]?(p.openBlock(),p.createElementBlock("div",ahe,[r.template.template_type===1&&r.template.pages[0].type==1?(p.openBlock(),p.createElementBlock("img",ihe)):r.template.template_type===2&&r.template.pages[0].type==1?(p.openBlock(),p.createElementBlock("img",ohe)):r.template.template_type===1&&r.template.pages[0].type==2?(p.openBlock(),p.createElementBlock("img",she)):r.template.template_type===2&&r.template.pages[0].type==2?(p.openBlock(),p.createElementBlock("img",lhe)):r.template.template_type===1&&r.template.pages[0].type==3?(p.openBlock(),p.createElementBlock("img",che)):r.template.template_type===2&&r.template.pages[0].type==3?(p.openBlock(),p.createElementBlock("img",uhe)):r.template.template_type===1&&r.template.pages[0].type==4?(p.openBlock(),p.createElementBlock("img",dhe)):r.template.template_type===2&&r.template.pages[0].type==4?(p.openBlock(),p.createElementBlock("img",hhe)):(p.openBlock(),p.createElementBlock("img",phe))])):p.createCommentVNode("",!0),p.createElementVNode("div",fhe,[p.createElementVNode("div",mhe,[p.createElementVNode("div",yhe,p.toDisplayString(r.template.name),1),p.createElementVNode("div",ghe,[x[6]||(x[6]=p.createElementVNode("span",{class:"tipo-label"},"Tipo:",-1)),p.createElementVNode("span",vhe," "+p.toDisplayString(r.template.template_type==1?"Prepartido":"Postpartido"),1)]),p.createElementVNode("button",{class:"postpartido-btn",onClick:x[1]||(x[1]=h=>B("generar-reporte"))},"Generar reporte")])]),Z.value?(p.openBlock(),p.createBlock(rhe,{key:1,"can-edit":C.value,onClick:x[2]||(x[2]=p.withModifiers(h=>Z.value=!1,["self"])),onMouseleave:x[3]||(x[3]=h=>Z.value=!1),onGenerarReporte:b,onRenombrar:t,onEditar:g,onDuplicar:u,onEliminar:e,onToggleAutogen:w},null,8,["can-edit"])):p.createCommentVNode("",!0),Z.value?(p.openBlock(),p.createElementBlock("div",{key:2,class:"tooltip-overlay",onClick:x[4]||(x[4]=h=>Z.value=!1)})):p.createCommentVNode("",!0)]))}},[["__scopeId","data-v-8520e810"]]),bhe={class:"modal-overlay"},_he={class:"modal-content"},whe={class:"modal-body"},The={class:"radio-group"},khe=["disabled"],She={key:0,class:"error-message"},Ehe={class:"modal-footer"},Ahe=["disabled"],Che=["disabled"],Mhe=["disabled"],Phe={key:0,class:"loading-spinner"},Ihe={key:1},xT=ws({__name:"ModalCreateTemplate",props:{token:{type:String,required:!0},team:{type:Number,required:!0}},emits:["close","template-created","open-modal-new-template"],setup(r,{emit:i}){const y=r,B=i,Z=p.ref(1),C=p.ref("pre"),b=p.ref(""),t=p.ref(!1),g=p.ref(""),u=async()=>{var e;if(!(b.value.trim().length<3)){t.value=!0,g.value="";try{const w={name:b.value.trim(),team_id:y.team,template_type:C.value==="pre"?1:2};console.log("toke mostrado es: ",y.token);const x=await to.create({headers:{Authorization:`${y.token}`}}).post("https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates",w);console.log("response.data",x.data),B("template-created",x.data),B("open-modal-new-template",(e=x.data)==null?void 0:e.data),B("close")}catch(w){console.error("Error al guardar template:",w),w.response&&w.response.status===409&&(g.value="Ya existe un template con el mismo nombre")}finally{t.value=!1}}};return p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""}),(e,w)=>(p.openBlock(),p.createElementBlock("div",bhe,[p.createElementVNode("div",_he,[p.createElementVNode("button",{class:"close-btn",onClick:w[0]||(w[0]=v=>e.$emit("close"))},[...w[6]||(w[6]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),w[11]||(w[11]=p.createElementVNode("div",{class:"modal-header"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-editar-withe.svg",class:"icon-title",alt:"icon"}),p.createElementVNode("span",{class:"modal-title"},"Crear Template")],-1)),w[12]||(w[12]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",whe,[Z.value===1?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[w[9]||(w[9]=p.createElementVNode("div",{class:"modal-label"},"Define el tipo de análisis para tu template:",-1)),p.createElementVNode("div",The,[p.createElementVNode("label",{class:p.normalizeClass(["radio-label",{selected:C.value==="pre"}])},[p.withDirectives(p.createElementVNode("input",{type:"radio",value:"pre","onUpdate:modelValue":w[1]||(w[1]=v=>C.value=v)},null,512),[[p.vModelRadio,C.value]]),w[7]||(w[7]=p.createTextVNode(" Prepartido ",-1))],2),p.createElementVNode("label",{class:p.normalizeClass(["radio-label",{selected:C.value==="post"}])},[p.withDirectives(p.createElementVNode("input",{type:"radio",value:"post","onUpdate:modelValue":w[2]||(w[2]=v=>C.value=v)},null,512),[[p.vModelRadio,C.value]]),w[8]||(w[8]=p.createTextVNode(" Postpartido ",-1))],2)])],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[w[10]||(w[10]=p.createElementVNode("div",{class:"modal-label"},"Agrega un nombre a tu template:",-1)),p.withDirectives(p.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":w[3]||(w[3]=v=>b.value=v),placeholder:"Untitled",maxlength:"40",autocomplete:"off",disabled:t.value},null,8,khe),[[p.vModelText,b.value]]),g.value?(p.openBlock(),p.createElementBlock("div",She,p.toDisplayString(g.value),1)):p.createCommentVNode("",!0)],64))]),w[13]||(w[13]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",Ehe,[p.createElementVNode("button",{class:"cancel-btn",onClick:w[4]||(w[4]=v=>e.$emit("close")),disabled:t.value},"Cancelar",8,Ahe),Z.value===1?(p.openBlock(),p.createElementBlock("button",{key:0,class:"next-btn",disabled:!C.value,onClick:w[5]||(w[5]=v=>Z.value=2)}," Siguiente ",8,Che)):(p.openBlock(),p.createElementBlock("button",{key:1,class:"next-btn",disabled:b.value.trim().length<3||t.value,onClick:u},[t.value?(p.openBlock(),p.createElementBlock("div",Phe)):(p.openBlock(),p.createElementBlock("span",Ihe,"Guardar"))],8,Mhe))])])]))}},[["__scopeId","data-v-7e85c356"]]),Nhe={class:"modal-overlay"},Ohe={class:"modal-content"},Lhe={class:"modal-body"},Rhe={key:0,class:"error-message-container"},zhe={key:1,style:{position:"relative"}},Dhe={key:0,class:"loading-autoseteo-overlay"},Bhe={class:"modal-group"},Vhe={key:0,class:"placeholder"},jhe={key:0,class:"placeholder"},Fhe={key:1},Uhe={key:0,class:"custom-select-dropdown"},qhe=["onMousedown"],Whe={class:"modal-row"},Ghe={class:"modal-group"},Hhe={key:0,class:"placeholder"},Xhe={key:0,class:"placeholder"},Jhe={key:1},Zhe={key:0,class:"custom-select-dropdown"},Khe=["onMousedown"],Yhe={class:"modal-group"},Qhe={key:0,class:"placeholder"},$he={key:0,class:"placeholder"},epe={key:1},tpe={key:0,class:"custom-select-dropdown"},rpe=["onMousedown"],npe={class:"modal-group"},ape={key:0,class:"placeholder"},ipe={key:0,class:"placeholder"},ope=["src"],spe=["src"],lpe={key:0,class:"custom-select-dropdown"},cpe=["onMousedown"],upe=["src"],dpe=["src"],hpe={key:0,class:"header-separator"},ppe={key:1,class:"modal-footer"},fpe=["disabled"],mpe={key:0,class:"loading-spinner select-spinner"},ype=ws({__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}},emits:["close","generar","switch-to-reports"],setup(r,{emit:i}){const y=r,B=i,Z=p.ref([]),C=p.ref([]),b=p.ref([]),t=p.ref([]),g=p.ref(""),u=p.ref(""),e=p.ref(""),w=p.ref(null),v=to.create({headers:{Authorization:y.token}}),x=p.ref(!1),h=p.ref(!1),n=p.ref(!1),a=p.ref(!1),d=p.ref(!1),s=p.ref(!1),c=p.ref(!1),f=p.ref(!1),m=p.ref([]),k=p.ref([]),E=p.ref(!1),S=p.ref(!1),P=p.ref(!1);function I(ie){s.value&&(s.value=!1,d.value=!1),c.value=!1,g.value=ie,E.value=!1,_()}function A(ie){s.value&&(s.value=!1,d.value=!1),c.value=!1,u.value=ie,S.value=!1,L()}function N(ie){s.value&&(s.value=!1,d.value=!1),c.value=!1,e.value=ie,P.value=!1,V()}const M=p.ref(null);async function T(){try{h.value=!0;const ie=await to.get("https://kefloixzy1.execute-api.us-west-2.amazonaws.com/prod/gs3/tournaments");if(ie.data&&Array.isArray(ie.data)){if(m.value=ie.data,Z.value=ie.data.map(oe=>oe.tournament).sort((oe,he)=>oe.order&&he.order?oe.order-he.order:oe.order&&!he.order?-1:!oe.order&&he.order?1:0),g.value="",C.value=[],u.value="",b.value=[],e.value="",t.value=[],w.value=null,M.value)setTimeout(()=>{ee(M.value)},100);else if(Z.value.length>0){const oe=Z.value[0];g.value=oe,O(oe)}}}catch(ie){console.error("Error al cargar torneos:",ie),Z.value=[{name:"Concacaf Copa Oro"},{name:"Liga MX"},{name:"MLS"}],C.value=[],b.value=[],g.value="",u.value="",e.value="",w.value=null}finally{h.value=!1}}function O(ie){const oe=m.value.find(he=>he.tournament&&he.tournament.name===ie.name);oe&&Array.isArray(oe.seasons)?(C.value=oe.seasons,u.value="",b.value=[],e.value="",t.value=[],w.value=null):(C.value=[],u.value="",b.value=[],e.value="",t.value=[],w.value=null)}function _(){u.value="",e.value="",w.value=null,g.value?O(g.value):(C.value=[],b.value=[],t.value=[])}function L(){if(a.value=!0,e.value="",w.value=null,b.value=[],t.value=[],u.value&&u.value.id){const ie=[u.value.id];if(u.value.related_seasons&&Array.isArray(u.value.related_seasons)){const oe=u.value.related_seasons.map(he=>he.id).filter(Boolean);ie.push(...oe)}z(ie)}else a.value=!1}async function z(ie){n.value=!0;try{const oe=Array.isArray(ie)?ie.join("&seasons="):ie,he=await v.get(`https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?seasons=${oe}`);if(he.data.data&&Array.isArray(he.data.data)){const fe=he.data.data.reduce((ye,_e)=>_e.games&&Array.isArray(_e.games)?ye.concat(_e.games):ye,[]);k.value=fe.map(ye=>({label:ye.label||`${ye.home_team_acronym||"Local"} vs ${ye.visiting_team_acronym||"Visitante"}`,localLogo:"https://golstatsimages.blob.core.windows.net/teams-80/"+ye.home_team+".png"||"",visitanteLogo:"https://golstatsimages.blob.core.windows.net/teams-80/"+ye.visiting_team+".png"||"",...ye}));let se=k.value;y.templateType==="2"||y.templateType===2?se=se.filter(ye=>ye.game_status===1):(y.templateType==="1"||y.templateType===1)&&(se=se.filter(ye=>ye.game_status===4));const ue=se.map(ye=>ye.matchday_id).filter(Boolean),de=[...new Set(ue)];b.value=de.map(ye=>{const _e=k.value.find(xe=>xe.matchday_id&&xe.matchday_id===ye);return _e?{id:ye,name:_e.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((ye,_e)=>{const xe=ye.name.startsWith("Jornada"),Se=_e.name.startsWith("Jornada");return xe&&Se?ye.id-_e.id:xe&&!Se?-1:!xe&&Se?1:0}),e.value="",t.value=[],w.value=null,a.value=!1,M.value&&s.value&&setTimeout(()=>{K(M.value)},200)}else k.value=[],b.value=[],e.value="",t.value=[],w.value=null}catch(oe){console.error("Error al cargar partidos:",oe),k.value=[],b.value=[],e.value="",t.value=[],w.value=null,a.value=!1}finally{n.value=!1}}function V(){w.value=null,t.value=[],e.value&&e.value.id&&U(e.value)}function U(ie){if(!ie||!ie.id){t.value=[];return}let oe=k.value.filter(he=>he.matchday_id===ie.id);y.templateType==="2"||y.templateType===2?oe=oe.filter(he=>he.game_status===1):(y.templateType==="1"||y.templateType===1)&&(oe=oe.filter(he=>he.game_status===4)),t.value=oe}async function q(){try{h.value=!0;let ie="";u.value&&u.value.name&&(ie=u.value.name);const oe={template_id:y.templateId,user_id:y.template&&y.template.user_id?parseInt(y.template.user_id):parseInt(y.userId),tournament_id:g.value.id||1,tournament_name:g.value.name,season_id:w.value.season_id,season_name:ie,game_id:w.value.id||w.value.game_id},he=await to.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${y.userId}/reports`,oe,{headers:{Authorization:y.token,"Content-Type":"application/json"}});B("generar",{liga:g.value,torneo:u.value,jornada:e.value,partido:w.value,reportData:he.data}),B("switch-to-reports"),B("close")}catch(ie){console.error("Error al generar el reporte:",ie),ie.response&&ie.response.status===409?f.value=!0:alert("Error al generar el reporte. Por favor, intenta de nuevo.")}finally{h.value=!1}}function W(){P.value=!P.value}function Y(ie){s.value&&(s.value=!1,d.value=!1),c.value=!1,w.value=ie,x.value=!1}function ne(){document.body.style.overflow="hidden"}function X(){document.body.style.overflow=""}p.onMounted(()=>{T(),ne(),re(),M.value&&(d.value=!0,s.value=!0)}),p.watch(g,(ie,oe)=>{if(ie&&M.value&&s.value&&!oe&&!c.value){const he=C.value.find(fe=>fe.id===M.value.season_id);he&&(c.value=!0,u.value=he,c.value=!1)}}),p.watch(u,(ie,oe)=>{ie&&M.value&&s.value&&!oe&&!c.value?setTimeout(()=>{const he=b.value.find(fe=>fe.id===M.value.matchday_id);he&&(c.value=!0,e.value=he,U(he),c.value=!1)},500):ie&&oe&&s.value&&(s.value=!1,d.value=!1)}),p.watch(e,(ie,oe)=>{ie&&M.value&&s.value&&!oe&&!c.value?setTimeout(()=>{const he=t.value.find(se=>se.game_id===M.value.game_id||se.id===M.value.game_id);if(U(ie),he){w.value=he,d.value=!1,s.value=!1;return}const fe=t.value.find(se=>se.home_team===M.value.home_team&&se.visiting_team===M.value.visiting_team);if(fe){w.value=fe,d.value=!1,s.value=!1;return}if(k.value.length>0){const se=k.value.find(ue=>ue.game_id===M.value.game_id||ue.id===M.value.game_id);if(se){w.value=se,d.value=!1,s.value=!1;return}}d.value=!1,s.value=!1},1e3):ie&&oe&&s.value&&(s.value=!1,d.value=!1)}),p.onUnmounted(()=>{X()});async function re(){try{const ie=await v.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/teams/${y.team}/last-games`);y.templateType==="1"||y.templateType===1?(M.value=ie.data.data.prematch,ie.data.data.prematch&&(d.value=!0,s.value=!0,ie.data.data.prematch.season_id&&await z([ie.data.data.prematch.season_id]))):(y.templateType==="2"||y.templateType===2)&&(M.value=ie.data.data.postmatch,ie.data.data.postmatch&&(d.value=!0,s.value=!0,ie.data.data.postmatch.season_id&&await z([ie.data.data.postmatch.season_id])))}catch(ie){console.error("Error al cargar últimos juegos:",ie)}}function ee(ie){if(!(!ie||!ie.game_id)&&ie.tournament_id&&Z.value.length>0){const oe=Z.value.find(he=>he.id===ie.tournament_id);oe&&(g.value=oe,O(oe))}}function K(ie){if(!(!ie||!ie.game_id)&&ie.tournament_id&&Z.value.length>0){const oe=Z.value.find(he=>he.id===ie.tournament_id);if(oe&&(g.value=oe,ie.season_id&&C.value.length>0)){const he=C.value.find(fe=>fe.id===ie.season_id);if(he&&(u.value=he,ie.matchday_id&&b.value.length>0)){const fe=b.value.find(se=>se.id===ie.matchday_id);if(fe&&(e.value=fe,ie.game_id&&t.value.length>0)){const se=t.value.find(ue=>ue.game_id===ie.game_id||ue.id===ie.game_id);if(se)w.value=se;else{const ue=t.value.find(de=>de.home_team===ie.home_team&&de.visiting_team===ie.visiting_team);ue&&(w.value=ue)}}}}}}function te(){f.value=!1,g.value="",u.value="",e.value="",w.value=null,C.value=[],b.value=[],t.value=[],E.value=!1,S.value=!1,P.value=!1,x.value=!1,X(),B("close")}return(ie,oe)=>(p.openBlock(),p.createElementBlock("div",Nhe,[p.createElementVNode("div",Ohe,[p.createElementVNode("button",{class:"close-btn",onClick:te},[...oe[7]||(oe[7]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),oe[22]||(oe[22]=p.createElementVNode("div",{class:"modal-header"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report-white.svg",class:"icon-title",alt:"icono reporte blanco"}),p.createElementVNode("span",{class:"modal-title"},"Generar reporte")],-1)),oe[23]||(oe[23]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",Lhe,[f.value?(p.openBlock(),p.createElementBlock("div",Rhe,[oe[8]||(oe[8]=p.createElementVNode("p",{class:"error-text"},[p.createTextVNode(" Este reporte ya fue generado previamente"),p.createElementVNode("br"),p.createTextVNode(" con este template para el partido seleccionado. ")],-1)),p.createElementVNode("button",{class:"accept-btn",onClick:te},"Aceptar")])):(p.openBlock(),p.createElementBlock("div",zhe,[d.value?(p.openBlock(),p.createElementBlock("div",Dhe,[...oe[9]||(oe[9]=[p.createElementVNode("div",{class:"loading-autoseteo-content"},[p.createElementVNode("div",{class:"loading-spinner"})],-1)])])):p.createCommentVNode("",!0),p.createElementVNode("div",Bhe,[oe[12]||(oe[12]=p.createElementVNode("label",null,"1. Elige el torneo",-1)),p.createElementVNode("div",{class:"select-wrapper custom-dropdown liga-select",tabindex:"0",onClick:oe[0]||(oe[0]=he=>E.value=!E.value),onBlur:oe[1]||(oe[1]=he=>E.value=!1)},[p.createElementVNode("div",{class:p.normalizeClass(["custom-select-display",{disabled:h.value||Z.value.length===0}])},[h.value?(p.openBlock(),p.createElementBlock("span",Vhe,[...oe[10]||(oe[10]=[p.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1),p.createTextVNode("Cargando torneos...",-1)])])):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[g.value?(p.openBlock(),p.createElementBlock("span",Fhe,p.toDisplayString(g.value.name),1)):(p.openBlock(),p.createElementBlock("span",jhe,"Selecciona el torneo"))],64)),p.createElementVNode("span",{class:p.normalizeClass(["select-chevron",{open:E.value}])},[...oe[11]||(oe[11]=[p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)],2),E.value&&Z.value.length>0?(p.openBlock(),p.createElementBlock("div",Uhe,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(Z.value,he=>(p.openBlock(),p.createElementBlock("div",{key:he.name,class:"custom-select-option",onMousedown:p.withModifiers(fe=>I(he),["prevent"])},p.toDisplayString(he.name),41,qhe))),128))])):p.createCommentVNode("",!0)],32)]),p.createElementVNode("div",Whe,[p.createElementVNode("div",Ghe,[oe[15]||(oe[15]=p.createElementVNode("label",null,"2. Elige la temporada",-1)),p.createElementVNode("div",{class:"select-wrapper custom-dropdown torneo-select",tabindex:"0",onClick:oe[2]||(oe[2]=he=>S.value=!S.value),onBlur:oe[3]||(oe[3]=he=>S.value=!1)},[p.createElementVNode("div",{class:p.normalizeClass(["custom-select-display",{disabled:!g.value||C.value.length===0||h.value}])},[h.value?(p.openBlock(),p.createElementBlock("span",Hhe,[...oe[13]||(oe[13]=[p.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1),p.createTextVNode("Cargando temporada...",-1)])])):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[u.value?(p.openBlock(),p.createElementBlock("span",Jhe,p.toDisplayString(u.value.name),1)):(p.openBlock(),p.createElementBlock("span",Xhe,"Elige la temporada"))],64)),p.createElementVNode("span",{class:p.normalizeClass(["select-chevron",{open:S.value}])},[...oe[14]||(oe[14]=[p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)],2),S.value&&C.value.length>0&&g.value?(p.openBlock(),p.createElementBlock("div",Zhe,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(C.value,he=>(p.openBlock(),p.createElementBlock("div",{key:he.id,class:"custom-select-option",onMousedown:p.withModifiers(fe=>A(he),["prevent"])},p.toDisplayString(he.name),41,Khe))),128))])):p.createCommentVNode("",!0)],32)]),p.createElementVNode("div",Yhe,[oe[18]||(oe[18]=p.createElementVNode("label",null,"3. Elige la jornada",-1)),p.createElementVNode("div",{class:"select-wrapper custom-dropdown jornada-select",tabindex:"0",onClick:W,onBlur:oe[4]||(oe[4]=he=>P.value=!1)},[p.createElementVNode("div",{class:p.normalizeClass(["custom-select-display",{disabled:!u.value||b.value.length===0||a.value}])},[a.value?(p.openBlock(),p.createElementBlock("span",Qhe,[...oe[16]||(oe[16]=[p.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1),p.createTextVNode("Cargando jornadas...",-1)])])):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[e.value?(p.openBlock(),p.createElementBlock("span",epe,p.toDisplayString(e.value.name),1)):(p.openBlock(),p.createElementBlock("span",$he,"Elige la jornada"))],64)),p.createElementVNode("span",{class:p.normalizeClass(["select-chevron",{open:P.value}])},[...oe[17]||(oe[17]=[p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)],2),P.value&&b.value.length>0?(p.openBlock(),p.createElementBlock("div",tpe,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(b.value,he=>(p.openBlock(),p.createElementBlock("div",{key:he.id,class:"custom-select-option",onMousedown:p.withModifiers(fe=>N(he),["prevent"])},p.toDisplayString(he.name),41,rpe))),128))])):p.createCommentVNode("",!0)],32)])]),p.createElementVNode("div",npe,[oe[21]||(oe[21]=p.createElementVNode("label",null,"4. Elige el partido",-1)),p.createElementVNode("div",{class:"select-wrapper partido-select",tabindex:"0",onClick:oe[5]||(oe[5]=he=>x.value=!x.value),onBlur:oe[6]||(oe[6]=he=>x.value=!1)},[p.createElementVNode("div",{class:p.normalizeClass(["custom-select-display",{disabled:!e.value||n.value}])},[n.value?(p.openBlock(),p.createElementBlock("span",ape,[...oe[19]||(oe[19]=[p.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1),p.createTextVNode("Cargando partidos...",-1)])])):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[w.value?(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[w.value.localLogo?(p.openBlock(),p.createElementBlock("img",{key:0,src:w.value.localLogo,class:"logo-equipo",alt:"local"},null,8,ope)):p.createCommentVNode("",!0),p.createElementVNode("span",null,p.toDisplayString(w.value.label),1),w.value.visitanteLogo?(p.openBlock(),p.createElementBlock("img",{key:1,src:w.value.visitanteLogo,class:"logo-equipo",alt:"visitante"},null,8,spe)):p.createCommentVNode("",!0)],64)):(p.openBlock(),p.createElementBlock("span",ipe,"Selecciona el partido"))],64)),p.createElementVNode("span",{class:p.normalizeClass(["select-chevron",{open:x.value}])},[...oe[20]||(oe[20]=[p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)],2),x.value&&!n.value&&e.value?(p.openBlock(),p.createElementBlock("div",lpe,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.value,he=>(p.openBlock(),p.createElementBlock("div",{key:he.label,class:"custom-select-option",onMousedown:p.withModifiers(fe=>Y(he),["prevent"])},[p.createElementVNode("img",{src:he.localLogo,class:"logo-equipo",alt:"local"},null,8,upe),p.createElementVNode("span",null,p.toDisplayString(he.label),1),p.createElementVNode("img",{src:he.visitanteLogo,class:"logo-equipo",alt:"visitante"},null,8,dpe)],40,cpe))),128))])):p.createCommentVNode("",!0)],32)])]))]),f.value?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",hpe)),f.value?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",ppe,[p.createElementVNode("button",{class:"cancel-btn",onClick:te},"Cancelar"),p.createElementVNode("button",{class:"next-btn",disabled:!g.value||!u.value||!e.value||!w.value||h.value,onClick:q},[h.value?(p.openBlock(),p.createElementBlock("span",mpe)):p.createCommentVNode("",!0),p.createTextVNode(" "+p.toDisplayString(h.value?"Generando...":"Generar"),1)],8,fpe)]))])]))}},[["__scopeId","data-v-c7404733"]]),gpe={class:"modal-overlay"},vpe={class:"modal-content"},xpe={class:"modal-body"},bpe=["placeholder","disabled"],_pe={key:0,class:"error-message"},wpe={class:"modal-footer"},Tpe=["disabled"],kpe=["disabled"],Spe={key:0},Epe={key:1},Ape=ws({__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(r,{emit:i}){const y=r,B=i,Z=p.ref(y.initialName),C=p.ref(!1),b=p.ref("");p.watch(()=>y.initialName,g=>{Z.value=g,b.value=""}),p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""});async function t(){var g;if(!(Z.value.trim().length<3)){C.value=!0,b.value="";try{await to.put(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${y.userId}/templates/${y.templateId}/general`,{name:Z.value.trim()},{headers:{Authorization:`${y.token}`,"Content-Type":"application/json"}}),B("rename",Z.value.trim()),B("refresh"),B("close")}catch(u){console.error("Error al renombrar el template:",u),((g=u.response)==null?void 0:g.status)===409?b.value="Ya existe un template con el mismo nombre":b.value="Error al renombrar el template. Inténtalo de nuevo."}finally{C.value=!1}}}return(g,u)=>(p.openBlock(),p.createElementBlock("div",gpe,[p.createElementVNode("div",vpe,[p.createElementVNode("button",{class:"close-btn",onClick:u[0]||(u[0]=e=>g.$emit("close"))},[...u[3]||(u[3]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),u[5]||(u[5]=p.createElementVNode("div",{class:"modal-header"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename-white.svg",class:"icon-title",alt:"icon"}),p.createElementVNode("span",{class:"modal-title"},"Renombrar Template")],-1)),u[6]||(u[6]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",xpe,[u[4]||(u[4]=p.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),p.withDirectives(p.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":u[1]||(u[1]=e=>Z.value=e),placeholder:r.initialName,maxlength:"40",autocomplete:"off",disabled:C.value},null,8,bpe),[[p.vModelText,Z.value]]),b.value?(p.openBlock(),p.createElementBlock("div",_pe,p.toDisplayString(b.value),1)):p.createCommentVNode("",!0)]),u[7]||(u[7]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",wpe,[p.createElementVNode("button",{class:"cancel-btn",onClick:u[2]||(u[2]=e=>g.$emit("close")),disabled:C.value},"Cancelar",8,Tpe),p.createElementVNode("button",{class:"next-btn",disabled:Z.value.trim().length<3||C.value,onClick:t},[C.value?(p.openBlock(),p.createElementBlock("span",Spe,"Guardando...")):(p.openBlock(),p.createElementBlock("span",Epe,"Guardar"))],8,kpe)])])]))}},[["__scopeId","data-v-3f4f9ca5"]]),Cpe={class:"modal-overlay"},Mpe={class:"modal-content"},Ppe={class:"modal-body"},Ipe=["placeholder"],Npe={class:"modal-footer"},Ope=["disabled"],Lpe=ws({__name:"ModalduplicateTemplate",props:{initialName:{type:String,required:!0},token:{type:String,required:!0},templateId:{type:String,required:!0}},emits:["close","duplicate","template-duplicated"],setup(r,{emit:i}){const y=r,B=i,Z=p.ref(y.initialName+" copy"),C=p.ref(!1);p.watch(()=>y.initialName,t=>{Z.value=t+" copy"}),p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""});async function b(){if(Z.value.trim().length>=3&&!C.value){C.value=!0;try{const t=await to.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates/${y.templateId}/duplicate`,{name:Z.value.trim()},{headers:{Authorization:`${y.token}`,"Content-Type":"application/json"}});B("template-duplicated",{originalTemplateId:y.templateId,newTemplateName:Z.value.trim(),responseData:t.data}),B("close")}catch(t){console.error("Error al duplicar template:",t),alert("Error al duplicar el template. Por favor, intenta de nuevo.")}finally{C.value=!1}}}return(t,g)=>(p.openBlock(),p.createElementBlock("div",Cpe,[p.createElementVNode("div",Mpe,[p.createElementVNode("button",{class:"close-btn",onClick:g[0]||(g[0]=u=>t.$emit("close"))},[...g[3]||(g[3]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),g[5]||(g[5]=p.createElementVNode("div",{class:"modal-header"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-duplicate-white.svg",class:"icon-title",alt:"icon"}),p.createElementVNode("span",{class:"modal-title"},"Duplicar template")],-1)),g[6]||(g[6]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",Ppe,[g[4]||(g[4]=p.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),p.withDirectives(p.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":g[1]||(g[1]=u=>Z.value=u),placeholder:r.initialName,maxlength:"40",autocomplete:"off"},null,8,Ipe),[[p.vModelText,Z.value]])]),g[7]||(g[7]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",Npe,[p.createElementVNode("button",{class:"cancel-btn",onClick:g[2]||(g[2]=u=>t.$emit("close"))},"Cancelar"),p.createElementVNode("button",{class:"next-btn",disabled:Z.value.trim().length<3||C.value,onClick:b},p.toDisplayString(C.value?"Duplicando...":"Aceptar"),9,Ope)])])]))}},[["__scopeId","data-v-abfffcd1"]]),Rpe={class:"modal-overlay"},zpe={class:"modal-content"},Dpe={class:"modal-footer"},Bpe=["disabled"],Vpe=ws({__name:"ModalDeleteTemplate",props:{templateId:{type:String,required:!0},userId:{type:String,required:!0},token:{type:String,required:!0}},emits:["close","delete","templateDeleted"],setup(r,{emit:i}){const y=r,B=i,Z=p.ref(!1);p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""});const C=async()=>{try{Z.value=!0;const t=await to.create({headers:{Authorization:`${y.token}`}}).delete(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${y.userId}/templates/${y.templateId}`);(t.status===200||t.status===204)&&(B("templateDeleted",y.templateId),B("close"))}catch(b){console.error("Error al eliminar template:",b),alert("Error al eliminar el template. Por favor, inténtalo de nuevo.")}finally{Z.value=!1}};return(b,t)=>(p.openBlock(),p.createElementBlock("div",Rpe,[p.createElementVNode("div",zpe,[p.createElementVNode("button",{class:"close-btn",onClick:t[0]||(t[0]=g=>b.$emit("close"))},[...t[2]||(t[2]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),t[3]||(t[3]=p.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)),p.createElementVNode("div",Dpe,[p.createElementVNode("button",{class:"cancel-btn",onClick:t[1]||(t[1]=g=>b.$emit("close"))},"Cancelar"),p.createElementVNode("button",{class:"delete-btn",onClick:C,disabled:Z.value},p.toDisplayString(Z.value?"Eliminando...":"Eliminar"),9,Bpe)])])]))}},[["__scopeId","data-v-93a27145"]]),jpe={class:"templates-header"},Fpe={class:"count"},Upe={key:0,class:"sort-options"},qpe=["onClick"],Wpe={key:0,class:"checkmark"},Gpe={key:0,class:"loading-state"},Hpe=ws({__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(r,{expose:i,emit:y}){const B=y,Z=r,C=p.ref(!1),b=p.ref(null),t=p.ref(!1),g=p.ref(!1),u=p.ref(!1),e=p.ref(!1),w=p.ref(!1),v=p.ref(""),x=p.ref(""),h=p.ref(""),n=p.ref(""),a=p.ref(""),d=p.ref(""),s=p.ref(""),c=p.ref(""),f=p.ref(""),m=p.ref(null),k=p.ref(null),E=p.ref(null),S=p.ref(null),P=p.ref(0),I=p.ref([]),A=p.ref(!1),N=p.ref(null);p.watch([()=>Z.team,()=>Z.token],()=>{Z.team&&Z.token&&T()},{immediate:!1});const M=[{label:"A - Z",value:"name-asc"},{label:"Más recientes",value:"date-desc"}],T=async()=>{try{A.value=!0,N.value=null;const X=await to.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates/teams/${Z.team}`,{headers:{Authorization:`${Z.token}`,"Content-Type":"application/json"}});X.data&&Array.isArray(X.data)?I.value=X.data:X.data&&X.data.templates?I.value=X.data.templates:X.data&&X.data.data?I.value=X.data.data:I.value=[]}catch(X){console.error("Error al obtener templates:",X),console.error("Error response:",X.response),N.value=X.message||"Error al cargar los templates",I.value=[]}finally{A.value=!1}},O=p.computed(()=>{if(!I.value.length)return[];let X=[...I.value];if(Z.searchQuery.trim()){const re=Z.searchQuery.toLowerCase().trim();X=X.filter(ee=>ee.name.toLowerCase().includes(re))}switch(b.value){case"name-asc":return X.sort((re,ee)=>re.name.localeCompare(ee.name));case"date-desc":return X.sort((re,ee)=>new Date(ee.created_at)-new Date(re.created_at));default:return X}}),_=p.computed(()=>{if(!P.value)return"grid-1-column";const X=340,re=20,K=P.value-40,te=Math.floor((K+re)/(X+re)),ie=Math.max(1,te);return ie>=4?"grid-4-columns":ie>=3?"grid-3-columns":ie>=2?"grid-2-columns":"grid-1-column"}),L=()=>{C.value=!C.value},z=X=>{b.value=X,C.value=!1},V=X=>{const re=M.find(ee=>ee.value===X);return re?re.label:null},U=X=>{C.value&&k.value&&!k.value.contains(X.target)&&(C.value=!1)},q=()=>{E.value&&(P.value=E.value.offsetWidth)};function W(X){B("edit-template",X)}let Y=null;p.onMounted(async()=>{document.addEventListener("mousedown",U),await p.nextTick(),q(),window.ResizeObserver?(Y=new ResizeObserver(()=>{q()}),E.value&&Y.observe(E.value)):window.addEventListener("resize",q),T()});function ne(X){B("open-modal-new-template",X)}return p.onBeforeUnmount(()=>{document.removeEventListener("mousedown",U),Y?Y.disconnect():window.removeEventListener("resize",q)}),i({obtenerTemplates:T}),(X,re)=>(p.openBlock(),p.createElementBlock("div",{class:"templates-section",ref_key:"templatesSectionRef",ref:E},[p.createElementVNode("div",jpe,[p.createElementVNode("span",null,[re[11]||(re[11]=p.createTextVNode("Templates ",-1)),p.createElementVNode("span",Fpe,"("+p.toDisplayString(O.value.length)+")",1)]),p.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:k},[p.createElementVNode("button",{class:"sort-button",onClick:L},[p.createTextVNode(p.toDisplayString(V(b.value)||"Ordenar")+" ",1),p.createElementVNode("span",{class:p.normalizeClass(["dropdown-arrow",{rotated:C.value}])},null,2)]),C.value?(p.openBlock(),p.createElementBlock("div",Upe,[(p.openBlock(),p.createElementBlock(p.Fragment,null,p.renderList(M,ee=>p.createElementVNode("div",{key:ee.value,class:p.normalizeClass(["sort-option",{selected:b.value===ee.value}]),onClick:K=>z(ee.value)},[p.createElementVNode("span",null,p.toDisplayString(ee.label),1),b.value===ee.value?(p.openBlock(),p.createElementBlock("span",Wpe,[...re[12]||(re[12]=[p.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)],10,qpe)),64))])):p.createCommentVNode("",!0)],512)]),A.value?(p.openBlock(),p.createElementBlock("div",Gpe,[...re[13]||(re[13]=[p.createElementVNode("div",{class:"loading-spinner"},null,-1),p.createElementVNode("p",null,"Cargando templates...",-1)])])):(p.openBlock(),p.createElementBlock("div",{key:1,class:p.normalizeClass(["templates-list",_.value]),ref_key:"templatesListRef",ref:S},[p.createElementVNode("div",{class:"template-card create",onClick:re[0]||(re[0]=ee=>t.value=!0)},[...re[14]||(re[14]=[p.createElementVNode("div",{class:"inner-card"},[p.createElementVNode("div",{class:"plus"},[p.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-add@3x.png",alt:"Agregar"})]),p.createElementVNode("div",{class:"create-text"},"Crear Template")],-1)])]),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(O.value,ee=>(p.openBlock(),p.createBlock(xhe,{key:ee.id,template:ee,"user-id":r.userId,onGenerarReporte:K=>{s.value=ee.id,f.value=ee.template_type,m.value=ee,g.value=!0},onRenombrar:K=>{c.value=ee.id,v.value=K,x.value=ee.template_type,u.value=!0},onDuplicar:K=>{d.value=ee.id,h.value=K,e.value=!0},onEliminar:K=>{n.value=K.name,a.value=K.id,w.value=!0},onEditTemplate:W},null,8,["template","user-id","onGenerarReporte","onRenombrar","onDuplicar","onEliminar"]))),128))],2)),t.value?(p.openBlock(),p.createBlock(xT,{key:2,token:r.token,team:r.team,onClose:re[1]||(re[1]=ee=>t.value=!1),onOpenModalNewTemplate:ne},null,8,["token","team"])):p.createCommentVNode("",!0),g.value?(p.openBlock(),p.createBlock(ype,{key:3,"user-id":r.userId,token:r.token,team:r.team,"template-id":s.value,"template-type":f.value,template:m.value,onClose:re[2]||(re[2]=ee=>g.value=!1),onSwitchToReports:re[3]||(re[3]=ee=>X.$emit("switch-to-reports"))},null,8,["user-id","token","team","template-id","template-type","template"])):p.createCommentVNode("",!0),u.value?(p.openBlock(),p.createBlock(Ape,{key:4,initialName:v.value,token:r.token,"template-id":c.value,"template-type":x.value,"user-id":r.userId,onRefresh:re[4]||(re[4]=ee=>T()),onClose:re[5]||(re[5]=ee=>u.value=!1),onRename:re[6]||(re[6]=ee=>{u.value=!1})},null,8,["initialName","token","template-id","template-type","user-id"])):p.createCommentVNode("",!0),e.value?(p.openBlock(),p.createBlock(Lpe,{key:5,initialName:h.value,token:r.token,"template-id":d.value,onClose:re[7]||(re[7]=ee=>e.value=!1),onTemplateDuplicated:re[8]||(re[8]=ee=>{e.value=!1,T()})},null,8,["initialName","token","template-id"])):p.createCommentVNode("",!0),w.value?(p.openBlock(),p.createBlock(Vpe,{key:6,"template-id":a.value,"user-id":r.userId,token:r.token,onClose:re[9]||(re[9]=ee=>w.value=!1),onTemplateDeleted:re[10]||(re[10]=ee=>{w.value=!1,T()})},null,8,["template-id","user-id","token"])):p.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-d06b13af"]]),Xpe={class:"tooltip-report-options"},Jpe=ws({__name:"TooltipReportOptions",emits:["ver-reporte","renombrar","editar","duplicar","descargar","eliminar"],setup(r,{emit:i}){return(y,B)=>(p.openBlock(),p.createElementBlock("div",Xpe,[p.createElementVNode("ul",null,[p.createElementVNode("li",{class:"option",onClick:B[0]||(B[0]=Z=>y.$emit("renombrar"))},[...B[3]||(B[3]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",alt:"Renombrar reporte",class:"icon"},null,-1),p.createTextVNode(" Renombrar reporte ",-1)])]),p.createElementVNode("li",{class:"option",onClick:B[1]||(B[1]=Z=>y.$emit("descargar"))},[...B[4]||(B[4]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-download.svg",alt:"Descargar reporte",class:"icon"},null,-1),p.createTextVNode(" Descargar reporte ",-1)])]),p.createElementVNode("li",{class:"option",onClick:B[2]||(B[2]=Z=>y.$emit("eliminar"))},[...B[5]||(B[5]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-delete.svg",alt:"Eliminar reporte",class:"icon"},null,-1),p.createTextVNode(" Eliminar reporte ",-1)])])])]))}},[["__scopeId","data-v-246ad2d7"]]);function Fd(r){if(!r)return"";const i=new Date(r);if(isNaN(i.getTime()))return"";const y=i.getDate(),B=i.toLocaleDateString("es-ES",{month:"short"}),Z=i.getFullYear();return`${y} ${B}, ${Z}`}const Zpe={class:"prematch-bg"},Kpe={class:"background-shields"},Ype={class:"shield-left"},Qpe=["src"],$pe={class:"shield-right"},efe=["src"],tfe={class:"subtitle"},rfe={class:"jornada"},nfe={class:"fecha"},afe={class:"teams-row"},ife={class:"team team-local"},ofe={class:"escudo-svg"},sfe=["src"],lfe={class:"team-name"},cfe={class:"team team-visitor"},ufe={class:"escudo-svg"},dfe=["src"],hfe={class:"team-name"},pfe=ws({__name:"AnalisisPrematchType1",props:{report:{type:Object,default:()=>({})}},setup(r){function i(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"):""}const y=r;return(B,Z)=>(p.openBlock(),p.createElementBlock("div",Zpe,[p.createElementVNode("div",Kpe,[p.createElementVNode("div",Ype,[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+y.report.game.home_team+".png",alt:"Escudo local"},null,8,Qpe)]),p.createElementVNode("div",$pe,[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+y.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,efe)])]),Z[0]||(Z[0]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),p.createElementVNode("div",tfe,[p.createElementVNode("span",rfe,p.toDisplayString(i(y.report.game.matchday_name)),1),p.createElementVNode("span",nfe," - "+p.toDisplayString(p.unref(Fd)(y.report.game.date_time_utc)),1)]),p.createElementVNode("div",afe,[p.createElementVNode("div",ife,[p.createElementVNode("span",ofe,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+y.report.game.home_team+".png"},null,8,sfe)]),p.createElementVNode("span",lfe,p.toDisplayString(y.report.game.home_team_acronym),1)]),p.createElementVNode("div",cfe,[p.createElementVNode("span",ufe,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+y.report.game.visiting_team+".png"},null,8,dfe)]),p.createElementVNode("span",hfe,p.toDisplayString(y.report.game.visiting_team_acronym),1)])])]))}},[["__scopeId","data-v-bb7e7ba7"]]),ffe={class:"prematch-bg"},mfe={class:"background-shields"},yfe={class:"shield-left"},gfe=["src"],vfe={class:"shield-right"},xfe=["src"],bfe={class:"subtitle"},_fe={class:"jornada"},wfe={class:"fecha"},Tfe={class:"teams-grid"},kfe={class:"row row-top"},Sfe={class:"team team-local"},Efe={class:"escudo-svg"},Afe=["src"],Cfe={class:"team-name"},Mfe={class:"score"},Pfe={class:"score-text"},Ife={class:"team team-visitor"},Nfe={class:"team-name"},Ofe={class:"escudo-svg"},Lfe=["src"],Rfe={class:"row row-bottom"},zfe={class:"team-stats"},Dfe={class:"stat red"},Bfe={class:"stat-number"},Vfe={class:"stat yellow"},jfe={class:"stat-number"},Ffe={class:"team-stats"},Ufe={class:"stat-number"},qfe={class:"stat-number"},Wfe=ws({__name:"AnalisisPostMatchType1",props:{report:{type:Object,default:()=>({})}},setup(r){function i(u){return u?u.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 y=r,B=p.computed(()=>{var w,v,x;const u=(x=(v=(w=y.report)==null?void 0:w.game)==null?void 0:v.minutes)==null?void 0:x.home_goals_minutes;if(!Array.isArray(u)||u.length===0)return null;const e=u.map(h=>{const n=h.match(/(\d+)'$/);return n?n[1]+"'":""}).filter(h=>h!=="");if(e.length>5){const h=e.slice(0,5).join(", "),n=e.slice(5).join(", ");return`${h}
4086
+ `+C):B.stack=C}catch{}}throw B}}_request(i,y){typeof i=="string"?(y=y||{},y.url=i):y=i||{},y=Qh(this.defaults,y);const{transitional:B,paramsSerializer:Z,headers:C}=y;B!==void 0&&yg.assertOptions(B,{silentJSONParsing:wd.transitional(wd.boolean),forcedJSONParsing:wd.transitional(wd.boolean),clarifyTimeoutError:wd.transitional(wd.boolean)},!1),Z!=null&&(Hn.isFunction(Z)?y.paramsSerializer={serialize:Z}:yg.assertOptions(Z,{encode:wd.function,serialize:wd.function},!0)),y.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?y.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:y.allowAbsoluteUrls=!0),yg.assertOptions(y,{baseUrl:wd.spelling("baseURL"),withXsrfToken:wd.spelling("withXSRFToken")},!0),y.method=(y.method||this.defaults.method||"get").toLowerCase();let b=C&&Hn.merge(C.common,C[y.method]);C&&Hn.forEach(["delete","get","head","post","put","patch","common"],h=>{delete C[h]}),y.headers=mu.concat(b,C);const t=[];let g=!0;this.interceptors.request.forEach(function(n){typeof n.runWhen=="function"&&n.runWhen(y)===!1||(g=g&&n.synchronous,t.unshift(n.fulfilled,n.rejected))});const u=[];this.interceptors.response.forEach(function(n){u.push(n.fulfilled,n.rejected)});let e,w=0,v;if(!g){const h=[mT.bind(this),void 0];for(h.unshift(...t),h.push(...u),v=h.length,e=Promise.resolve(y);w<v;)e=e.then(h[w++],h[w++]);return e}v=t.length;let x=y;for(w=0;w<v;){const h=t[w++],n=t[w++];try{x=h(x)}catch(a){n.call(this,a);break}}try{e=mT.call(this,x)}catch(h){return Promise.reject(h)}for(w=0,v=u.length;w<v;)e=e.then(u[w++],u[w++]);return e}getUri(i){i=Qh(this.defaults,i);const y=oT(i.baseURL,i.url,i.allowAbsoluteUrls);return Y6(y,i.params,i.paramsSerializer)}};Hn.forEach(["delete","get","head","options"],function(i){$h.prototype[i]=function(y,B){return this.request(Qh(B||{},{method:i,url:y,data:(B||{}).data}))}}),Hn.forEach(["post","put","patch"],function(i){function y(B){return function(C,b,t){return this.request(Qh(t||{},{method:i,headers:B?{"Content-Type":"multipart/form-data"}:{},url:C,data:b}))}}$h.prototype[i]=y(),$h.prototype[i+"Form"]=y(!0)});let Qde=class WT{constructor(i){if(typeof i!="function")throw new TypeError("executor must be a function.");let y;this.promise=new Promise(function(C){y=C});const B=this;this.promise.then(Z=>{if(!B._listeners)return;let C=B._listeners.length;for(;C-- >0;)B._listeners[C](Z);B._listeners=null}),this.promise.then=Z=>{let C;const b=new Promise(t=>{B.subscribe(t),C=t}).then(Z);return b.cancel=function(){B.unsubscribe(C)},b},i(function(C,b,t){B.reason||(B.reason=new Wp(C,b,t),y(B.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(i){if(this.reason){i(this.reason);return}this._listeners?this._listeners.push(i):this._listeners=[i]}unsubscribe(i){if(!this._listeners)return;const y=this._listeners.indexOf(i);y!==-1&&this._listeners.splice(y,1)}toAbortSignal(){const i=new AbortController,y=B=>{i.abort(B)};return this.subscribe(y),i.signal.unsubscribe=()=>this.unsubscribe(y),i.signal}static source(){let i;return{token:new WT(function(Z){i=Z}),cancel:i}}};function $de(r){return function(y){return r.apply(null,y)}}function ehe(r){return Hn.isObject(r)&&r.isAxiosError===!0}const nx={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};Object.entries(nx).forEach(([r,i])=>{nx[i]=r});function vT(r){const i=new $h(r),y=z6($h.prototype.request,i);return Hn.extend(y,$h.prototype,i,{allOwnKeys:!0}),Hn.extend(y,i,null,{allOwnKeys:!0}),y.create=function(Z){return vT(Qh(r,Z))},y}const to=vT(cm);to.Axios=$h,to.CanceledError=Wp,to.CancelToken=Qde,to.isCancel=rT,to.VERSION=yT,to.toFormData=ug,to.AxiosError=vi,to.Cancel=to.CanceledError,to.all=function(i){return Promise.all(i)},to.spread=$de,to.isAxiosError=ehe,to.mergeConfig=Qh,to.AxiosHeaders=mu,to.formToJSON=r=>eT(Hn.isHTMLForm(r)?new FormData(r):r),to.getAdapter=fT.getAdapter,to.HttpStatusCode=nx,to.default=to;const{Axios:Ive,AxiosError:Nve,CanceledError:Ove,isCancel:Lve,CancelToken:Rve,VERSION:zve,all:Dve,Cancel:Bve,isAxiosError:Vve,spread:jve,toFormData:Fve,AxiosHeaders:Uve,HttpStatusCode:qve,formToJSON:Wve,getAdapter:Gve,mergeConfig:Hve}=to,ws=(r,i)=>{const y=r.__vccOpts||r;for(const[B,Z]of i)y[B]=Z;return y},the={class:"tooltip-template-options"},rhe=ws({__name:"TooltipTemplateOptions",props:{canEdit:{type:Boolean,default:!0}},emits:["generar-reporte","renombrar","editar","duplicar","eliminar"],setup(r,{emit:i}){return(y,B)=>(p.openBlock(),p.createElementBlock("div",the,[p.createElementVNode("ul",null,[p.createElementVNode("li",{class:"option",onClick:B[0]||(B[0]=Z=>y.$emit("generar-reporte"))},[...B[5]||(B[5]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report.svg",alt:"Generar reporte",class:"icon"},null,-1),p.createTextVNode(" Generar reporte ",-1)])]),r.canEdit?(p.openBlock(),p.createElementBlock("li",{key:0,class:"option",onClick:B[1]||(B[1]=Z=>y.$emit("renombrar"))},[...B[6]||(B[6]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),p.createTextVNode(" Renombrar template ",-1)])])):p.createCommentVNode("",!0),r.canEdit?(p.openBlock(),p.createElementBlock("li",{key:1,class:"option",onClick:B[2]||(B[2]=Z=>y.$emit("editar"))},[...B[7]||(B[7]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-edit.svg",alt:"Editar template",class:"icon"},null,-1),p.createTextVNode(" Editar template ",-1)])])):p.createCommentVNode("",!0),p.createElementVNode("li",{class:"option",onClick:B[3]||(B[3]=Z=>y.$emit("duplicar"))},[...B[8]||(B[8]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-duplicate.svg",alt:"Duplicar template",class:"icon"},null,-1),p.createTextVNode(" Duplicar template ",-1)])]),r.canEdit?(p.openBlock(),p.createElementBlock("li",{key:2,class:"option",onClick:B[4]||(B[4]=Z=>y.$emit("eliminar"))},[...B[9]||(B[9]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),p.createTextVNode(" Eliminar template ",-1)])])):p.createCommentVNode("",!0)])]))}},[["__scopeId","data-v-127740d3"]]),nhe={class:"template-card postpartido",style:{position:"relative"}},ahe={key:0,class:"template-img-placeholder",style:{position:"relative"}},ihe={key:0,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-01.jpg",alt:"Template Prematch Type 1",class:"template-img"},ohe={key:1,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-01.jpg",alt:"Template Postmatch Type 1",class:"template-img"},she={key:2,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-02.jpg",alt:"Template Prematch Type 2",class:"template-img"},lhe={key:3,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-02.jpg",alt:"Template Postmatch Type 2",class:"template-img"},che={key:4,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-03.jpg",alt:"Template Prematch Type 3",class:"template-img"},uhe={key:5,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-03.jpg",alt:"Template Postmatch Type 3",class:"template-img"},dhe={key:6,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-04.jpg",alt:"Template Prematch Type 4",class:"template-img"},hhe={key:7,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-04.jpg",alt:"Template Postmatch Type 4",class:"template-img"},phe={key:8,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumb1.png",alt:"Template Default",class:"template-img"},fhe={class:"inner-card-postpartido"},mhe={class:"postpartido-footer"},yhe={class:"postpartido-version"},ghe={class:"postpartido-status"},vhe={class:"tipo-value"},xhe=ws({__name:"TemplateItem",props:{template:{type:Object,required:!0},userId:{type:Number,required:!0}},emits:["generar-reporte","renombrar","duplicar","eliminar","edit-template"],setup(r,{emit:i}){const y=r,B=i,Z=p.ref(!1),C=p.computed(()=>y.userId===y.template.user_id);function b(){Z.value=!1,B("generar-reporte")}function t(){Z.value=!1;const v=y.template.name||"";B("renombrar",v)}function g(){Z.value=!1,B("edit-template",y.template)}function u(){Z.value=!1;const v=y.template.name||"";B("duplicar",v)}function e(){Z.value=!1,B("eliminar",y.template)}function w(v){}return(v,x)=>(p.openBlock(),p.createElementBlock("div",nhe,[p.createElementVNode("div",{class:"three-dots",onClick:x[0]||(x[0]=p.withModifiers(h=>Z.value=!Z.value,["stop"]))},[...x[5]||(x[5]=[p.createElementVNode("span",null,null,-1),p.createElementVNode("span",null,null,-1),p.createElementVNode("span",null,null,-1)])]),r.template.pages&&r.template.pages[0]?(p.openBlock(),p.createElementBlock("div",ahe,[r.template.template_type===1&&r.template.pages[0].type==1?(p.openBlock(),p.createElementBlock("img",ihe)):r.template.template_type===2&&r.template.pages[0].type==1?(p.openBlock(),p.createElementBlock("img",ohe)):r.template.template_type===1&&r.template.pages[0].type==2?(p.openBlock(),p.createElementBlock("img",she)):r.template.template_type===2&&r.template.pages[0].type==2?(p.openBlock(),p.createElementBlock("img",lhe)):r.template.template_type===1&&r.template.pages[0].type==3?(p.openBlock(),p.createElementBlock("img",che)):r.template.template_type===2&&r.template.pages[0].type==3?(p.openBlock(),p.createElementBlock("img",uhe)):r.template.template_type===1&&r.template.pages[0].type==4?(p.openBlock(),p.createElementBlock("img",dhe)):r.template.template_type===2&&r.template.pages[0].type==4?(p.openBlock(),p.createElementBlock("img",hhe)):(p.openBlock(),p.createElementBlock("img",phe))])):p.createCommentVNode("",!0),p.createElementVNode("div",fhe,[p.createElementVNode("div",mhe,[p.createElementVNode("div",yhe,p.toDisplayString(r.template.name),1),p.createElementVNode("div",ghe,[x[6]||(x[6]=p.createElementVNode("span",{class:"tipo-label"},"Tipo:",-1)),p.createElementVNode("span",vhe," "+p.toDisplayString(r.template.template_type==1?"Prepartido":"Postpartido"),1)]),p.createElementVNode("button",{class:"postpartido-btn",onClick:x[1]||(x[1]=h=>B("generar-reporte"))},"Generar reporte")])]),Z.value?(p.openBlock(),p.createBlock(rhe,{key:1,"can-edit":C.value,onClick:x[2]||(x[2]=p.withModifiers(h=>Z.value=!1,["self"])),onMouseleave:x[3]||(x[3]=h=>Z.value=!1),onGenerarReporte:b,onRenombrar:t,onEditar:g,onDuplicar:u,onEliminar:e,onToggleAutogen:w},null,8,["can-edit"])):p.createCommentVNode("",!0),Z.value?(p.openBlock(),p.createElementBlock("div",{key:2,class:"tooltip-overlay",onClick:x[4]||(x[4]=h=>Z.value=!1)})):p.createCommentVNode("",!0)]))}},[["__scopeId","data-v-8520e810"]]),bhe={class:"modal-overlay"},_he={class:"modal-content"},whe={class:"modal-body"},The={class:"radio-group"},khe=["disabled"],She={key:0,class:"error-message"},Ehe={class:"modal-footer"},Ahe=["disabled"],Che=["disabled"],Mhe=["disabled"],Phe={key:0,class:"loading-spinner"},Ihe={key:1},xT=ws({__name:"ModalCreateTemplate",props:{token:{type:String,required:!0},team:{type:Number,required:!0}},emits:["close","template-created","open-modal-new-template"],setup(r,{emit:i}){const y=r,B=i,Z=p.ref(1),C=p.ref("pre"),b=p.ref(""),t=p.ref(!1),g=p.ref(""),u=async()=>{var e;if(!(b.value.trim().length<3)){t.value=!0,g.value="";try{const w={name:b.value.trim(),team_id:y.team,template_type:C.value==="pre"?1:2},x=await to.create({headers:{Authorization:`${y.token}`}}).post("https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates",w);B("template-created",x.data),B("open-modal-new-template",(e=x.data)==null?void 0:e.data),B("close")}catch(w){console.error("Error al guardar template:",w),w.response&&w.response.status===409&&(g.value="Ya existe un template con el mismo nombre")}finally{t.value=!1}}};return p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""}),(e,w)=>(p.openBlock(),p.createElementBlock("div",bhe,[p.createElementVNode("div",_he,[p.createElementVNode("button",{class:"close-btn",onClick:w[0]||(w[0]=v=>e.$emit("close"))},[...w[6]||(w[6]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),w[11]||(w[11]=p.createElementVNode("div",{class:"modal-header"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-editar-withe.svg",class:"icon-title",alt:"icon"}),p.createElementVNode("span",{class:"modal-title"},"Crear Template")],-1)),w[12]||(w[12]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",whe,[Z.value===1?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[w[9]||(w[9]=p.createElementVNode("div",{class:"modal-label"},"Define el tipo de análisis para tu template:",-1)),p.createElementVNode("div",The,[p.createElementVNode("label",{class:p.normalizeClass(["radio-label",{selected:C.value==="pre"}])},[p.withDirectives(p.createElementVNode("input",{type:"radio",value:"pre","onUpdate:modelValue":w[1]||(w[1]=v=>C.value=v)},null,512),[[p.vModelRadio,C.value]]),w[7]||(w[7]=p.createTextVNode(" Prepartido ",-1))],2),p.createElementVNode("label",{class:p.normalizeClass(["radio-label",{selected:C.value==="post"}])},[p.withDirectives(p.createElementVNode("input",{type:"radio",value:"post","onUpdate:modelValue":w[2]||(w[2]=v=>C.value=v)},null,512),[[p.vModelRadio,C.value]]),w[8]||(w[8]=p.createTextVNode(" Postpartido ",-1))],2)])],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[w[10]||(w[10]=p.createElementVNode("div",{class:"modal-label"},"Agrega un nombre a tu template:",-1)),p.withDirectives(p.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":w[3]||(w[3]=v=>b.value=v),placeholder:"Untitled",maxlength:"40",autocomplete:"off",disabled:t.value},null,8,khe),[[p.vModelText,b.value]]),g.value?(p.openBlock(),p.createElementBlock("div",She,p.toDisplayString(g.value),1)):p.createCommentVNode("",!0)],64))]),w[13]||(w[13]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",Ehe,[p.createElementVNode("button",{class:"cancel-btn",onClick:w[4]||(w[4]=v=>e.$emit("close")),disabled:t.value},"Cancelar",8,Ahe),Z.value===1?(p.openBlock(),p.createElementBlock("button",{key:0,class:"next-btn",disabled:!C.value,onClick:w[5]||(w[5]=v=>Z.value=2)}," Siguiente ",8,Che)):(p.openBlock(),p.createElementBlock("button",{key:1,class:"next-btn",disabled:b.value.trim().length<3||t.value,onClick:u},[t.value?(p.openBlock(),p.createElementBlock("div",Phe)):(p.openBlock(),p.createElementBlock("span",Ihe,"Guardar"))],8,Mhe))])])]))}},[["__scopeId","data-v-a34cf1b5"]]),Nhe={class:"modal-overlay"},Ohe={class:"modal-content"},Lhe={class:"modal-body"},Rhe={key:0,class:"error-message-container"},zhe={key:1,style:{position:"relative"}},Dhe={key:0,class:"loading-autoseteo-overlay"},Bhe={class:"modal-group"},Vhe={key:0,class:"placeholder"},jhe={key:0,class:"placeholder"},Fhe={key:1},Uhe={key:0,class:"custom-select-dropdown"},qhe=["onMousedown"],Whe={class:"modal-row"},Ghe={class:"modal-group"},Hhe={key:0,class:"placeholder"},Xhe={key:0,class:"placeholder"},Jhe={key:1},Zhe={key:0,class:"custom-select-dropdown"},Khe=["onMousedown"],Yhe={class:"modal-group"},Qhe={key:0,class:"placeholder"},$he={key:0,class:"placeholder"},epe={key:1},tpe={key:0,class:"custom-select-dropdown"},rpe=["onMousedown"],npe={class:"modal-group"},ape={key:0,class:"placeholder"},ipe={key:0,class:"placeholder"},ope=["src"],spe=["src"],lpe={key:0,class:"custom-select-dropdown"},cpe=["onMousedown"],upe=["src"],dpe=["src"],hpe={key:0,class:"header-separator"},ppe={key:1,class:"modal-footer"},fpe=["disabled"],mpe={key:0,class:"loading-spinner select-spinner"},ype=ws({__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}},emits:["close","generar","switch-to-reports"],setup(r,{emit:i}){const y=r,B=i,Z=p.ref([]),C=p.ref([]),b=p.ref([]),t=p.ref([]),g=p.ref(""),u=p.ref(""),e=p.ref(""),w=p.ref(null),v=to.create({headers:{Authorization:y.token}}),x=p.ref(!1),h=p.ref(!1),n=p.ref(!1),a=p.ref(!1),d=p.ref(!1),s=p.ref(!1),c=p.ref(!1),f=p.ref(!1),m=p.ref([]),k=p.ref([]),E=p.ref(!1),S=p.ref(!1),P=p.ref(!1);function I(ie){s.value&&(s.value=!1,d.value=!1),c.value=!1,g.value=ie,E.value=!1,_()}function A(ie){s.value&&(s.value=!1,d.value=!1),c.value=!1,u.value=ie,S.value=!1,L()}function N(ie){s.value&&(s.value=!1,d.value=!1),c.value=!1,e.value=ie,P.value=!1,V()}const M=p.ref(null);async function T(){try{h.value=!0;const ie=await to.get("https://kefloixzy1.execute-api.us-west-2.amazonaws.com/prod/gs3/tournaments");if(ie.data&&Array.isArray(ie.data)){if(m.value=ie.data,Z.value=ie.data.map(oe=>oe.tournament).sort((oe,he)=>oe.order&&he.order?oe.order-he.order:oe.order&&!he.order?-1:!oe.order&&he.order?1:0),g.value="",C.value=[],u.value="",b.value=[],e.value="",t.value=[],w.value=null,M.value)setTimeout(()=>{ee(M.value)},100);else if(Z.value.length>0){const oe=Z.value[0];g.value=oe,O(oe)}}}catch(ie){console.error("Error al cargar torneos:",ie),Z.value=[{name:"Concacaf Copa Oro"},{name:"Liga MX"},{name:"MLS"}],C.value=[],b.value=[],g.value="",u.value="",e.value="",w.value=null}finally{h.value=!1}}function O(ie){const oe=m.value.find(he=>he.tournament&&he.tournament.name===ie.name);oe&&Array.isArray(oe.seasons)?(C.value=oe.seasons,u.value="",b.value=[],e.value="",t.value=[],w.value=null):(C.value=[],u.value="",b.value=[],e.value="",t.value=[],w.value=null)}function _(){u.value="",e.value="",w.value=null,g.value?O(g.value):(C.value=[],b.value=[],t.value=[])}function L(){if(a.value=!0,e.value="",w.value=null,b.value=[],t.value=[],u.value&&u.value.id){const ie=[u.value.id];if(u.value.related_seasons&&Array.isArray(u.value.related_seasons)){const oe=u.value.related_seasons.map(he=>he.id).filter(Boolean);ie.push(...oe)}z(ie)}else a.value=!1}async function z(ie){n.value=!0;try{const oe=Array.isArray(ie)?ie.join("&seasons="):ie,he=await v.get(`https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?seasons=${oe}`);if(he.data.data&&Array.isArray(he.data.data)){const fe=he.data.data.reduce((ye,_e)=>_e.games&&Array.isArray(_e.games)?ye.concat(_e.games):ye,[]);k.value=fe.map(ye=>({label:ye.label||`${ye.home_team_acronym||"Local"} vs ${ye.visiting_team_acronym||"Visitante"}`,localLogo:"https://golstatsimages.blob.core.windows.net/teams-80/"+ye.home_team+".png"||"",visitanteLogo:"https://golstatsimages.blob.core.windows.net/teams-80/"+ye.visiting_team+".png"||"",...ye}));let se=k.value;y.templateType==="2"||y.templateType===2?se=se.filter(ye=>ye.game_status===1):(y.templateType==="1"||y.templateType===1)&&(se=se.filter(ye=>ye.game_status===4));const ue=se.map(ye=>ye.matchday_id).filter(Boolean),de=[...new Set(ue)];b.value=de.map(ye=>{const _e=k.value.find(xe=>xe.matchday_id&&xe.matchday_id===ye);return _e?{id:ye,name:_e.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((ye,_e)=>{const xe=ye.name.startsWith("Jornada"),Se=_e.name.startsWith("Jornada");return xe&&Se?ye.id-_e.id:xe&&!Se?-1:!xe&&Se?1:0}),e.value="",t.value=[],w.value=null,a.value=!1,M.value&&s.value&&setTimeout(()=>{K(M.value)},200)}else k.value=[],b.value=[],e.value="",t.value=[],w.value=null}catch(oe){console.error("Error al cargar partidos:",oe),k.value=[],b.value=[],e.value="",t.value=[],w.value=null,a.value=!1}finally{n.value=!1}}function V(){w.value=null,t.value=[],e.value&&e.value.id&&U(e.value)}function U(ie){if(!ie||!ie.id){t.value=[];return}let oe=k.value.filter(he=>he.matchday_id===ie.id);y.templateType==="2"||y.templateType===2?oe=oe.filter(he=>he.game_status===1):(y.templateType==="1"||y.templateType===1)&&(oe=oe.filter(he=>he.game_status===4)),t.value=oe}async function q(){try{h.value=!0;let ie="";u.value&&u.value.name&&(ie=u.value.name);const oe={template_id:y.templateId,user_id:y.template&&y.template.user_id?parseInt(y.template.user_id):parseInt(y.userId),tournament_id:g.value.id||1,tournament_name:g.value.name,season_id:w.value.season_id,season_name:ie,game_id:w.value.id||w.value.game_id},he=await to.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${y.userId}/reports`,oe,{headers:{Authorization:y.token,"Content-Type":"application/json"}});B("generar",{liga:g.value,torneo:u.value,jornada:e.value,partido:w.value,reportData:he.data}),B("switch-to-reports"),B("close")}catch(ie){console.error("Error al generar el reporte:",ie),ie.response&&ie.response.status===409?f.value=!0:alert("Error al generar el reporte. Por favor, intenta de nuevo.")}finally{h.value=!1}}function W(){P.value=!P.value}function Y(ie){s.value&&(s.value=!1,d.value=!1),c.value=!1,w.value=ie,x.value=!1}function ne(){document.body.style.overflow="hidden"}function X(){document.body.style.overflow=""}p.onMounted(()=>{T(),ne(),re(),M.value&&(d.value=!0,s.value=!0)}),p.watch(g,(ie,oe)=>{if(ie&&M.value&&s.value&&!oe&&!c.value){const he=C.value.find(fe=>fe.id===M.value.season_id);he&&(c.value=!0,u.value=he,c.value=!1)}}),p.watch(u,(ie,oe)=>{ie&&M.value&&s.value&&!oe&&!c.value?setTimeout(()=>{const he=b.value.find(fe=>fe.id===M.value.matchday_id);he&&(c.value=!0,e.value=he,U(he),c.value=!1)},500):ie&&oe&&s.value&&(s.value=!1,d.value=!1)}),p.watch(e,(ie,oe)=>{ie&&M.value&&s.value&&!oe&&!c.value?setTimeout(()=>{const he=t.value.find(se=>se.game_id===M.value.game_id||se.id===M.value.game_id);if(U(ie),he){w.value=he,d.value=!1,s.value=!1;return}const fe=t.value.find(se=>se.home_team===M.value.home_team&&se.visiting_team===M.value.visiting_team);if(fe){w.value=fe,d.value=!1,s.value=!1;return}if(k.value.length>0){const se=k.value.find(ue=>ue.game_id===M.value.game_id||ue.id===M.value.game_id);if(se){w.value=se,d.value=!1,s.value=!1;return}}d.value=!1,s.value=!1},1e3):ie&&oe&&s.value&&(s.value=!1,d.value=!1)}),p.onUnmounted(()=>{X()});async function re(){try{const ie=await v.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/teams/${y.team}/last-games`);y.templateType==="1"||y.templateType===1?(M.value=ie.data.data.prematch,ie.data.data.prematch&&(d.value=!0,s.value=!0,ie.data.data.prematch.season_id&&await z([ie.data.data.prematch.season_id]))):(y.templateType==="2"||y.templateType===2)&&(M.value=ie.data.data.postmatch,ie.data.data.postmatch&&(d.value=!0,s.value=!0,ie.data.data.postmatch.season_id&&await z([ie.data.data.postmatch.season_id])))}catch(ie){console.error("Error al cargar últimos juegos:",ie)}}function ee(ie){if(!(!ie||!ie.game_id)&&ie.tournament_id&&Z.value.length>0){const oe=Z.value.find(he=>he.id===ie.tournament_id);oe&&(g.value=oe,O(oe))}}function K(ie){if(!(!ie||!ie.game_id)&&ie.tournament_id&&Z.value.length>0){const oe=Z.value.find(he=>he.id===ie.tournament_id);if(oe&&(g.value=oe,ie.season_id&&C.value.length>0)){const he=C.value.find(fe=>fe.id===ie.season_id);if(he&&(u.value=he,ie.matchday_id&&b.value.length>0)){const fe=b.value.find(se=>se.id===ie.matchday_id);if(fe&&(e.value=fe,ie.game_id&&t.value.length>0)){const se=t.value.find(ue=>ue.game_id===ie.game_id||ue.id===ie.game_id);if(se)w.value=se;else{const ue=t.value.find(de=>de.home_team===ie.home_team&&de.visiting_team===ie.visiting_team);ue&&(w.value=ue)}}}}}}function te(){f.value=!1,g.value="",u.value="",e.value="",w.value=null,C.value=[],b.value=[],t.value=[],E.value=!1,S.value=!1,P.value=!1,x.value=!1,X(),B("close")}return(ie,oe)=>(p.openBlock(),p.createElementBlock("div",Nhe,[p.createElementVNode("div",Ohe,[p.createElementVNode("button",{class:"close-btn",onClick:te},[...oe[7]||(oe[7]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),oe[22]||(oe[22]=p.createElementVNode("div",{class:"modal-header"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report-white.svg",class:"icon-title",alt:"icono reporte blanco"}),p.createElementVNode("span",{class:"modal-title"},"Generar reporte")],-1)),oe[23]||(oe[23]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",Lhe,[f.value?(p.openBlock(),p.createElementBlock("div",Rhe,[oe[8]||(oe[8]=p.createElementVNode("p",{class:"error-text"},[p.createTextVNode(" Este reporte ya fue generado previamente"),p.createElementVNode("br"),p.createTextVNode(" con este template para el partido seleccionado. ")],-1)),p.createElementVNode("button",{class:"accept-btn",onClick:te},"Aceptar")])):(p.openBlock(),p.createElementBlock("div",zhe,[d.value?(p.openBlock(),p.createElementBlock("div",Dhe,[...oe[9]||(oe[9]=[p.createElementVNode("div",{class:"loading-autoseteo-content"},[p.createElementVNode("div",{class:"loading-spinner"})],-1)])])):p.createCommentVNode("",!0),p.createElementVNode("div",Bhe,[oe[12]||(oe[12]=p.createElementVNode("label",null,"1. Elige el torneo",-1)),p.createElementVNode("div",{class:"select-wrapper custom-dropdown liga-select",tabindex:"0",onClick:oe[0]||(oe[0]=he=>E.value=!E.value),onBlur:oe[1]||(oe[1]=he=>E.value=!1)},[p.createElementVNode("div",{class:p.normalizeClass(["custom-select-display",{disabled:h.value||Z.value.length===0}])},[h.value?(p.openBlock(),p.createElementBlock("span",Vhe,[...oe[10]||(oe[10]=[p.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1),p.createTextVNode("Cargando torneos...",-1)])])):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[g.value?(p.openBlock(),p.createElementBlock("span",Fhe,p.toDisplayString(g.value.name),1)):(p.openBlock(),p.createElementBlock("span",jhe,"Selecciona el torneo"))],64)),p.createElementVNode("span",{class:p.normalizeClass(["select-chevron",{open:E.value}])},[...oe[11]||(oe[11]=[p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)],2),E.value&&Z.value.length>0?(p.openBlock(),p.createElementBlock("div",Uhe,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(Z.value,he=>(p.openBlock(),p.createElementBlock("div",{key:he.name,class:"custom-select-option",onMousedown:p.withModifiers(fe=>I(he),["prevent"])},p.toDisplayString(he.name),41,qhe))),128))])):p.createCommentVNode("",!0)],32)]),p.createElementVNode("div",Whe,[p.createElementVNode("div",Ghe,[oe[15]||(oe[15]=p.createElementVNode("label",null,"2. Elige la temporada",-1)),p.createElementVNode("div",{class:"select-wrapper custom-dropdown torneo-select",tabindex:"0",onClick:oe[2]||(oe[2]=he=>S.value=!S.value),onBlur:oe[3]||(oe[3]=he=>S.value=!1)},[p.createElementVNode("div",{class:p.normalizeClass(["custom-select-display",{disabled:!g.value||C.value.length===0||h.value}])},[h.value?(p.openBlock(),p.createElementBlock("span",Hhe,[...oe[13]||(oe[13]=[p.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1),p.createTextVNode("Cargando temporada...",-1)])])):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[u.value?(p.openBlock(),p.createElementBlock("span",Jhe,p.toDisplayString(u.value.name),1)):(p.openBlock(),p.createElementBlock("span",Xhe,"Elige la temporada"))],64)),p.createElementVNode("span",{class:p.normalizeClass(["select-chevron",{open:S.value}])},[...oe[14]||(oe[14]=[p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)],2),S.value&&C.value.length>0&&g.value?(p.openBlock(),p.createElementBlock("div",Zhe,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(C.value,he=>(p.openBlock(),p.createElementBlock("div",{key:he.id,class:"custom-select-option",onMousedown:p.withModifiers(fe=>A(he),["prevent"])},p.toDisplayString(he.name),41,Khe))),128))])):p.createCommentVNode("",!0)],32)]),p.createElementVNode("div",Yhe,[oe[18]||(oe[18]=p.createElementVNode("label",null,"3. Elige la jornada",-1)),p.createElementVNode("div",{class:"select-wrapper custom-dropdown jornada-select",tabindex:"0",onClick:W,onBlur:oe[4]||(oe[4]=he=>P.value=!1)},[p.createElementVNode("div",{class:p.normalizeClass(["custom-select-display",{disabled:!u.value||b.value.length===0||a.value}])},[a.value?(p.openBlock(),p.createElementBlock("span",Qhe,[...oe[16]||(oe[16]=[p.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1),p.createTextVNode("Cargando jornadas...",-1)])])):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[e.value?(p.openBlock(),p.createElementBlock("span",epe,p.toDisplayString(e.value.name),1)):(p.openBlock(),p.createElementBlock("span",$he,"Elige la jornada"))],64)),p.createElementVNode("span",{class:p.normalizeClass(["select-chevron",{open:P.value}])},[...oe[17]||(oe[17]=[p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)],2),P.value&&b.value.length>0?(p.openBlock(),p.createElementBlock("div",tpe,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(b.value,he=>(p.openBlock(),p.createElementBlock("div",{key:he.id,class:"custom-select-option",onMousedown:p.withModifiers(fe=>N(he),["prevent"])},p.toDisplayString(he.name),41,rpe))),128))])):p.createCommentVNode("",!0)],32)])]),p.createElementVNode("div",npe,[oe[21]||(oe[21]=p.createElementVNode("label",null,"4. Elige el partido",-1)),p.createElementVNode("div",{class:"select-wrapper partido-select",tabindex:"0",onClick:oe[5]||(oe[5]=he=>x.value=!x.value),onBlur:oe[6]||(oe[6]=he=>x.value=!1)},[p.createElementVNode("div",{class:p.normalizeClass(["custom-select-display",{disabled:!e.value||n.value}])},[n.value?(p.openBlock(),p.createElementBlock("span",ape,[...oe[19]||(oe[19]=[p.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1),p.createTextVNode("Cargando partidos...",-1)])])):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[w.value?(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[w.value.localLogo?(p.openBlock(),p.createElementBlock("img",{key:0,src:w.value.localLogo,class:"logo-equipo",alt:"local"},null,8,ope)):p.createCommentVNode("",!0),p.createElementVNode("span",null,p.toDisplayString(w.value.label),1),w.value.visitanteLogo?(p.openBlock(),p.createElementBlock("img",{key:1,src:w.value.visitanteLogo,class:"logo-equipo",alt:"visitante"},null,8,spe)):p.createCommentVNode("",!0)],64)):(p.openBlock(),p.createElementBlock("span",ipe,"Selecciona el partido"))],64)),p.createElementVNode("span",{class:p.normalizeClass(["select-chevron",{open:x.value}])},[...oe[20]||(oe[20]=[p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)],2),x.value&&!n.value&&e.value?(p.openBlock(),p.createElementBlock("div",lpe,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.value,he=>(p.openBlock(),p.createElementBlock("div",{key:he.label,class:"custom-select-option",onMousedown:p.withModifiers(fe=>Y(he),["prevent"])},[p.createElementVNode("img",{src:he.localLogo,class:"logo-equipo",alt:"local"},null,8,upe),p.createElementVNode("span",null,p.toDisplayString(he.label),1),p.createElementVNode("img",{src:he.visitanteLogo,class:"logo-equipo",alt:"visitante"},null,8,dpe)],40,cpe))),128))])):p.createCommentVNode("",!0)],32)])]))]),f.value?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",hpe)),f.value?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",ppe,[p.createElementVNode("button",{class:"cancel-btn",onClick:te},"Cancelar"),p.createElementVNode("button",{class:"next-btn",disabled:!g.value||!u.value||!e.value||!w.value||h.value,onClick:q},[h.value?(p.openBlock(),p.createElementBlock("span",mpe)):p.createCommentVNode("",!0),p.createTextVNode(" "+p.toDisplayString(h.value?"Generando...":"Generar"),1)],8,fpe)]))])]))}},[["__scopeId","data-v-c7404733"]]),gpe={class:"modal-overlay"},vpe={class:"modal-content"},xpe={class:"modal-body"},bpe=["placeholder","disabled"],_pe={key:0,class:"error-message"},wpe={class:"modal-footer"},Tpe=["disabled"],kpe=["disabled"],Spe={key:0},Epe={key:1},Ape=ws({__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(r,{emit:i}){const y=r,B=i,Z=p.ref(y.initialName),C=p.ref(!1),b=p.ref("");p.watch(()=>y.initialName,g=>{Z.value=g,b.value=""}),p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""});async function t(){var g;if(!(Z.value.trim().length<3)){C.value=!0,b.value="";try{await to.put(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${y.userId}/templates/${y.templateId}/general`,{name:Z.value.trim()},{headers:{Authorization:`${y.token}`,"Content-Type":"application/json"}}),B("rename",Z.value.trim()),B("refresh"),B("close")}catch(u){console.error("Error al renombrar el template:",u),((g=u.response)==null?void 0:g.status)===409?b.value="Ya existe un template con el mismo nombre":b.value="Error al renombrar el template. Inténtalo de nuevo."}finally{C.value=!1}}}return(g,u)=>(p.openBlock(),p.createElementBlock("div",gpe,[p.createElementVNode("div",vpe,[p.createElementVNode("button",{class:"close-btn",onClick:u[0]||(u[0]=e=>g.$emit("close"))},[...u[3]||(u[3]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),u[5]||(u[5]=p.createElementVNode("div",{class:"modal-header"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename-white.svg",class:"icon-title",alt:"icon"}),p.createElementVNode("span",{class:"modal-title"},"Renombrar Template")],-1)),u[6]||(u[6]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",xpe,[u[4]||(u[4]=p.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),p.withDirectives(p.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":u[1]||(u[1]=e=>Z.value=e),placeholder:r.initialName,maxlength:"40",autocomplete:"off",disabled:C.value},null,8,bpe),[[p.vModelText,Z.value]]),b.value?(p.openBlock(),p.createElementBlock("div",_pe,p.toDisplayString(b.value),1)):p.createCommentVNode("",!0)]),u[7]||(u[7]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",wpe,[p.createElementVNode("button",{class:"cancel-btn",onClick:u[2]||(u[2]=e=>g.$emit("close")),disabled:C.value},"Cancelar",8,Tpe),p.createElementVNode("button",{class:"next-btn",disabled:Z.value.trim().length<3||C.value,onClick:t},[C.value?(p.openBlock(),p.createElementBlock("span",Spe,"Guardando...")):(p.openBlock(),p.createElementBlock("span",Epe,"Guardar"))],8,kpe)])])]))}},[["__scopeId","data-v-3f4f9ca5"]]),Cpe={class:"modal-overlay"},Mpe={class:"modal-content"},Ppe={class:"modal-body"},Ipe=["placeholder"],Npe={class:"modal-footer"},Ope=["disabled"],Lpe=ws({__name:"ModalduplicateTemplate",props:{initialName:{type:String,required:!0},token:{type:String,required:!0},templateId:{type:String,required:!0}},emits:["close","duplicate","template-duplicated"],setup(r,{emit:i}){const y=r,B=i,Z=p.ref(y.initialName+" copy"),C=p.ref(!1);p.watch(()=>y.initialName,t=>{Z.value=t+" copy"}),p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""});async function b(){if(Z.value.trim().length>=3&&!C.value){C.value=!0;try{const t=await to.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates/${y.templateId}/duplicate`,{name:Z.value.trim()},{headers:{Authorization:`${y.token}`,"Content-Type":"application/json"}});B("template-duplicated",{originalTemplateId:y.templateId,newTemplateName:Z.value.trim(),responseData:t.data}),B("close")}catch(t){console.error("Error al duplicar template:",t),alert("Error al duplicar el template. Por favor, intenta de nuevo.")}finally{C.value=!1}}}return(t,g)=>(p.openBlock(),p.createElementBlock("div",Cpe,[p.createElementVNode("div",Mpe,[p.createElementVNode("button",{class:"close-btn",onClick:g[0]||(g[0]=u=>t.$emit("close"))},[...g[3]||(g[3]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),g[5]||(g[5]=p.createElementVNode("div",{class:"modal-header"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-duplicate-white.svg",class:"icon-title",alt:"icon"}),p.createElementVNode("span",{class:"modal-title"},"Duplicar template")],-1)),g[6]||(g[6]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",Ppe,[g[4]||(g[4]=p.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),p.withDirectives(p.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":g[1]||(g[1]=u=>Z.value=u),placeholder:r.initialName,maxlength:"40",autocomplete:"off"},null,8,Ipe),[[p.vModelText,Z.value]])]),g[7]||(g[7]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",Npe,[p.createElementVNode("button",{class:"cancel-btn",onClick:g[2]||(g[2]=u=>t.$emit("close"))},"Cancelar"),p.createElementVNode("button",{class:"next-btn",disabled:Z.value.trim().length<3||C.value,onClick:b},p.toDisplayString(C.value?"Duplicando...":"Aceptar"),9,Ope)])])]))}},[["__scopeId","data-v-abfffcd1"]]),Rpe={class:"modal-overlay"},zpe={class:"modal-content"},Dpe={class:"modal-footer"},Bpe=["disabled"],Vpe=ws({__name:"ModalDeleteTemplate",props:{templateId:{type:String,required:!0},userId:{type:String,required:!0},token:{type:String,required:!0}},emits:["close","delete","templateDeleted"],setup(r,{emit:i}){const y=r,B=i,Z=p.ref(!1);p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""});const C=async()=>{try{Z.value=!0;const t=await to.create({headers:{Authorization:`${y.token}`}}).delete(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${y.userId}/templates/${y.templateId}`);(t.status===200||t.status===204)&&(B("templateDeleted",y.templateId),B("close"))}catch(b){console.error("Error al eliminar template:",b),alert("Error al eliminar el template. Por favor, inténtalo de nuevo.")}finally{Z.value=!1}};return(b,t)=>(p.openBlock(),p.createElementBlock("div",Rpe,[p.createElementVNode("div",zpe,[p.createElementVNode("button",{class:"close-btn",onClick:t[0]||(t[0]=g=>b.$emit("close"))},[...t[2]||(t[2]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),t[3]||(t[3]=p.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)),p.createElementVNode("div",Dpe,[p.createElementVNode("button",{class:"cancel-btn",onClick:t[1]||(t[1]=g=>b.$emit("close"))},"Cancelar"),p.createElementVNode("button",{class:"delete-btn",onClick:C,disabled:Z.value},p.toDisplayString(Z.value?"Eliminando...":"Eliminar"),9,Bpe)])])]))}},[["__scopeId","data-v-93a27145"]]),jpe={class:"templates-header"},Fpe={class:"count"},Upe={key:0,class:"sort-options"},qpe=["onClick"],Wpe={key:0,class:"checkmark"},Gpe={key:0,class:"loading-state"},Hpe=ws({__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(r,{expose:i,emit:y}){const B=y,Z=r,C=p.ref(!1),b=p.ref(null),t=p.ref(!1),g=p.ref(!1),u=p.ref(!1),e=p.ref(!1),w=p.ref(!1),v=p.ref(""),x=p.ref(""),h=p.ref(""),n=p.ref(""),a=p.ref(""),d=p.ref(""),s=p.ref(""),c=p.ref(""),f=p.ref(""),m=p.ref(null),k=p.ref(null),E=p.ref(null),S=p.ref(null),P=p.ref(0),I=p.ref([]),A=p.ref(!1),N=p.ref(null);p.watch([()=>Z.team,()=>Z.token],()=>{Z.team&&Z.token&&T()},{immediate:!1});const M=[{label:"A - Z",value:"name-asc"},{label:"Más recientes",value:"date-desc"}],T=async()=>{try{A.value=!0,N.value=null;const X=await to.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates/teams/${Z.team}`,{headers:{Authorization:`${Z.token}`,"Content-Type":"application/json"}});X.data&&Array.isArray(X.data)?I.value=X.data:X.data&&X.data.templates?I.value=X.data.templates:X.data&&X.data.data?I.value=X.data.data:I.value=[]}catch(X){console.error("Error al obtener templates:",X),console.error("Error response:",X.response),N.value=X.message||"Error al cargar los templates",I.value=[]}finally{A.value=!1}},O=p.computed(()=>{if(!I.value.length)return[];let X=[...I.value];if(Z.searchQuery.trim()){const re=Z.searchQuery.toLowerCase().trim();X=X.filter(ee=>ee.name.toLowerCase().includes(re))}switch(b.value){case"name-asc":return X.sort((re,ee)=>re.name.localeCompare(ee.name));case"date-desc":return X.sort((re,ee)=>new Date(ee.created_at)-new Date(re.created_at));default:return X}}),_=p.computed(()=>{if(!P.value)return"grid-1-column";const X=340,re=20,K=P.value-40,te=Math.floor((K+re)/(X+re)),ie=Math.max(1,te);return ie>=4?"grid-4-columns":ie>=3?"grid-3-columns":ie>=2?"grid-2-columns":"grid-1-column"}),L=()=>{C.value=!C.value},z=X=>{b.value=X,C.value=!1},V=X=>{const re=M.find(ee=>ee.value===X);return re?re.label:null},U=X=>{C.value&&k.value&&!k.value.contains(X.target)&&(C.value=!1)},q=()=>{E.value&&(P.value=E.value.offsetWidth)};function W(X){B("edit-template",X)}let Y=null;p.onMounted(async()=>{document.addEventListener("mousedown",U),await p.nextTick(),q(),window.ResizeObserver?(Y=new ResizeObserver(()=>{q()}),E.value&&Y.observe(E.value)):window.addEventListener("resize",q),T()});function ne(X){B("open-modal-new-template",X)}return p.onBeforeUnmount(()=>{document.removeEventListener("mousedown",U),Y?Y.disconnect():window.removeEventListener("resize",q)}),i({obtenerTemplates:T}),(X,re)=>(p.openBlock(),p.createElementBlock("div",{class:"templates-section",ref_key:"templatesSectionRef",ref:E},[p.createElementVNode("div",jpe,[p.createElementVNode("span",null,[re[11]||(re[11]=p.createTextVNode("Templates ",-1)),p.createElementVNode("span",Fpe,"("+p.toDisplayString(O.value.length)+")",1)]),p.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:k},[p.createElementVNode("button",{class:"sort-button",onClick:L},[p.createTextVNode(p.toDisplayString(V(b.value)||"Ordenar")+" ",1),p.createElementVNode("span",{class:p.normalizeClass(["dropdown-arrow",{rotated:C.value}])},null,2)]),C.value?(p.openBlock(),p.createElementBlock("div",Upe,[(p.openBlock(),p.createElementBlock(p.Fragment,null,p.renderList(M,ee=>p.createElementVNode("div",{key:ee.value,class:p.normalizeClass(["sort-option",{selected:b.value===ee.value}]),onClick:K=>z(ee.value)},[p.createElementVNode("span",null,p.toDisplayString(ee.label),1),b.value===ee.value?(p.openBlock(),p.createElementBlock("span",Wpe,[...re[12]||(re[12]=[p.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)],10,qpe)),64))])):p.createCommentVNode("",!0)],512)]),A.value?(p.openBlock(),p.createElementBlock("div",Gpe,[...re[13]||(re[13]=[p.createElementVNode("div",{class:"loading-spinner"},null,-1),p.createElementVNode("p",null,"Cargando templates...",-1)])])):(p.openBlock(),p.createElementBlock("div",{key:1,class:p.normalizeClass(["templates-list",_.value]),ref_key:"templatesListRef",ref:S},[p.createElementVNode("div",{class:"template-card create",onClick:re[0]||(re[0]=ee=>t.value=!0)},[...re[14]||(re[14]=[p.createElementVNode("div",{class:"inner-card"},[p.createElementVNode("div",{class:"plus"},[p.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-add@3x.png",alt:"Agregar"})]),p.createElementVNode("div",{class:"create-text"},"Crear Template")],-1)])]),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(O.value,ee=>(p.openBlock(),p.createBlock(xhe,{key:ee.id,template:ee,"user-id":r.userId,onGenerarReporte:K=>{s.value=ee.id,f.value=ee.template_type,m.value=ee,g.value=!0},onRenombrar:K=>{c.value=ee.id,v.value=K,x.value=ee.template_type,u.value=!0},onDuplicar:K=>{d.value=ee.id,h.value=K,e.value=!0},onEliminar:K=>{n.value=K.name,a.value=K.id,w.value=!0},onEditTemplate:W},null,8,["template","user-id","onGenerarReporte","onRenombrar","onDuplicar","onEliminar"]))),128))],2)),t.value?(p.openBlock(),p.createBlock(xT,{key:2,token:r.token,team:r.team,onClose:re[1]||(re[1]=ee=>t.value=!1),onOpenModalNewTemplate:ne},null,8,["token","team"])):p.createCommentVNode("",!0),g.value?(p.openBlock(),p.createBlock(ype,{key:3,"user-id":r.userId,token:r.token,team:r.team,"template-id":s.value,"template-type":f.value,template:m.value,onClose:re[2]||(re[2]=ee=>g.value=!1),onSwitchToReports:re[3]||(re[3]=ee=>X.$emit("switch-to-reports"))},null,8,["user-id","token","team","template-id","template-type","template"])):p.createCommentVNode("",!0),u.value?(p.openBlock(),p.createBlock(Ape,{key:4,initialName:v.value,token:r.token,"template-id":c.value,"template-type":x.value,"user-id":r.userId,onRefresh:re[4]||(re[4]=ee=>T()),onClose:re[5]||(re[5]=ee=>u.value=!1),onRename:re[6]||(re[6]=ee=>{u.value=!1})},null,8,["initialName","token","template-id","template-type","user-id"])):p.createCommentVNode("",!0),e.value?(p.openBlock(),p.createBlock(Lpe,{key:5,initialName:h.value,token:r.token,"template-id":d.value,onClose:re[7]||(re[7]=ee=>e.value=!1),onTemplateDuplicated:re[8]||(re[8]=ee=>{e.value=!1,T()})},null,8,["initialName","token","template-id"])):p.createCommentVNode("",!0),w.value?(p.openBlock(),p.createBlock(Vpe,{key:6,"template-id":a.value,"user-id":r.userId,token:r.token,onClose:re[9]||(re[9]=ee=>w.value=!1),onTemplateDeleted:re[10]||(re[10]=ee=>{w.value=!1,T()})},null,8,["template-id","user-id","token"])):p.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-d06b13af"]]),Xpe={class:"tooltip-report-options"},Jpe=ws({__name:"TooltipReportOptions",emits:["ver-reporte","renombrar","editar","duplicar","descargar","eliminar"],setup(r,{emit:i}){return(y,B)=>(p.openBlock(),p.createElementBlock("div",Xpe,[p.createElementVNode("ul",null,[p.createElementVNode("li",{class:"option",onClick:B[0]||(B[0]=Z=>y.$emit("renombrar"))},[...B[3]||(B[3]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",alt:"Renombrar reporte",class:"icon"},null,-1),p.createTextVNode(" Renombrar reporte ",-1)])]),p.createElementVNode("li",{class:"option",onClick:B[1]||(B[1]=Z=>y.$emit("descargar"))},[...B[4]||(B[4]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-download.svg",alt:"Descargar reporte",class:"icon"},null,-1),p.createTextVNode(" Descargar reporte ",-1)])]),p.createElementVNode("li",{class:"option",onClick:B[2]||(B[2]=Z=>y.$emit("eliminar"))},[...B[5]||(B[5]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-delete.svg",alt:"Eliminar reporte",class:"icon"},null,-1),p.createTextVNode(" Eliminar reporte ",-1)])])])]))}},[["__scopeId","data-v-246ad2d7"]]);function Fd(r){if(!r)return"";const i=new Date(r);if(isNaN(i.getTime()))return"";const y=i.getDate(),B=i.toLocaleDateString("es-ES",{month:"short"}),Z=i.getFullYear();return`${y} ${B}, ${Z}`}const Zpe={class:"prematch-bg"},Kpe={class:"background-shields"},Ype={class:"shield-left"},Qpe=["src"],$pe={class:"shield-right"},efe=["src"],tfe={class:"subtitle"},rfe={class:"jornada"},nfe={class:"fecha"},afe={class:"teams-row"},ife={class:"team team-local"},ofe={class:"escudo-svg"},sfe=["src"],lfe={class:"team-name"},cfe={class:"team team-visitor"},ufe={class:"escudo-svg"},dfe=["src"],hfe={class:"team-name"},pfe=ws({__name:"AnalisisPrematchType1",props:{report:{type:Object,default:()=>({})}},setup(r){function i(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"):""}const y=r;return(B,Z)=>(p.openBlock(),p.createElementBlock("div",Zpe,[p.createElementVNode("div",Kpe,[p.createElementVNode("div",Ype,[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+y.report.game.home_team+".png",alt:"Escudo local"},null,8,Qpe)]),p.createElementVNode("div",$pe,[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+y.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,efe)])]),Z[0]||(Z[0]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),p.createElementVNode("div",tfe,[p.createElementVNode("span",rfe,p.toDisplayString(i(y.report.game.matchday_name)),1),p.createElementVNode("span",nfe," - "+p.toDisplayString(p.unref(Fd)(y.report.game.date_time_utc)),1)]),p.createElementVNode("div",afe,[p.createElementVNode("div",ife,[p.createElementVNode("span",ofe,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+y.report.game.home_team+".png"},null,8,sfe)]),p.createElementVNode("span",lfe,p.toDisplayString(y.report.game.home_team_acronym),1)]),p.createElementVNode("div",cfe,[p.createElementVNode("span",ufe,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+y.report.game.visiting_team+".png"},null,8,dfe)]),p.createElementVNode("span",hfe,p.toDisplayString(y.report.game.visiting_team_acronym),1)])])]))}},[["__scopeId","data-v-bb7e7ba7"]]),ffe={class:"prematch-bg"},mfe={class:"background-shields"},yfe={class:"shield-left"},gfe=["src"],vfe={class:"shield-right"},xfe=["src"],bfe={class:"subtitle"},_fe={class:"jornada"},wfe={class:"fecha"},Tfe={class:"teams-grid"},kfe={class:"row row-top"},Sfe={class:"team team-local"},Efe={class:"escudo-svg"},Afe=["src"],Cfe={class:"team-name"},Mfe={class:"score"},Pfe={class:"score-text"},Ife={class:"team team-visitor"},Nfe={class:"team-name"},Ofe={class:"escudo-svg"},Lfe=["src"],Rfe={class:"row row-bottom"},zfe={class:"team-stats"},Dfe={class:"stat red"},Bfe={class:"stat-number"},Vfe={class:"stat yellow"},jfe={class:"stat-number"},Ffe={class:"team-stats"},Ufe={class:"stat-number"},qfe={class:"stat-number"},Wfe=ws({__name:"AnalisisPostMatchType1",props:{report:{type:Object,default:()=>({})}},setup(r){function i(u){return u?u.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 y=r,B=p.computed(()=>{var w,v,x;const u=(x=(v=(w=y.report)==null?void 0:w.game)==null?void 0:v.minutes)==null?void 0:x.home_goals_minutes;if(!Array.isArray(u)||u.length===0)return null;const e=u.map(h=>{const n=h.match(/(\d+)'$/);return n?n[1]+"'":""}).filter(h=>h!=="");if(e.length>5){const h=e.slice(0,5).join(", "),n=e.slice(5).join(", ");return`${h}
4087
4087
  ${n}`}return e.join(", ")}),Z=p.computed(()=>{var w,v,x;const u=(x=(v=(w=y.report)==null?void 0:w.game)==null?void 0:v.minutes)==null?void 0:x.visiting_goals_minutes;if(!Array.isArray(u)||u.length===0)return null;const e=u.map(h=>{const n=h.match(/(\d+)'$/);return n?n[1]+"'":""}).filter(h=>h!=="");if(e.length>5){const h=e.slice(0,5).join(", "),n=e.slice(5).join(", ");return`${h}
4088
4088
  ${n}`}return e.join(", ")}),C=p.computed(()=>{var e,w,v;const u=(v=(w=(e=y.report)==null?void 0:e.game)==null?void 0:w.minutes)==null?void 0:v.home_red_cards_minutes;return Array.isArray(u)&&u.length>0?u.length:null}),b=p.computed(()=>{var e,w,v;const u=(v=(w=(e=y.report)==null?void 0:e.game)==null?void 0:w.minutes)==null?void 0:v.home_yellow_cards_minutes;return Array.isArray(u)&&u.length>0?u.length:null}),t=p.computed(()=>{var e,w,v;const u=(v=(w=(e=y.report)==null?void 0:e.game)==null?void 0:w.minutes)==null?void 0:v.away_yellow_cards_minutes;return Array.isArray(u)&&u.length>0?u.length:null}),g=p.computed(()=>{var e,w,v;const u=(v=(w=(e=y.report)==null?void 0:e.game)==null?void 0:w.minutes)==null?void 0:v.away_red_cards_minutes;return Array.isArray(u)&&u.length>0?u.length:null});return(u,e)=>(p.openBlock(),p.createElementBlock("div",ffe,[p.createElementVNode("div",mfe,[p.createElementVNode("div",yfe,[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+r.report.game.home_team+".png",alt:"Escudo local"},null,8,gfe)]),p.createElementVNode("div",vfe,[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+r.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,xfe)])]),e[7]||(e[7]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),p.createElementVNode("div",bfe,[p.createElementVNode("span",_fe,p.toDisplayString(i(r.report.game.matchday_name)),1),p.createElementVNode("span",wfe," - "+p.toDisplayString(p.unref(Fd)(r.report.game.date_time_utc)),1)]),p.createElementVNode("div",Tfe,[p.createElementVNode("div",kfe,[p.createElementVNode("div",Sfe,[p.createElementVNode("span",Efe,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.home_team+".png"},null,8,Afe)]),p.createElementVNode("span",Cfe,p.toDisplayString(r.report.game.home_team_acronym),1)]),p.createElementVNode("div",Mfe,[p.createElementVNode("span",Pfe,p.toDisplayString(r.report.game.score[0])+":"+p.toDisplayString(r.report.game.score[1]),1)]),p.createElementVNode("div",Ife,[p.createElementVNode("span",Nfe,p.toDisplayString(r.report.game.visiting_team_acronym),1),p.createElementVNode("span",Ofe,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.visiting_team+".png"},null,8,Lfe)])])]),p.createElementVNode("div",Rfe,[p.createElementVNode("div",zfe,[e[2]||(e[2]=p.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)),B.value!==null?(p.openBlock(),p.createElementBlock("span",{key:0,class:p.normalizeClass(["stat time",{"two-lines":B.value&&B.value.includes(`
4089
4089
  `)}])},p.toDisplayString(B.value),3)):p.createCommentVNode("",!0),p.createElementVNode("div",{class:p.normalizeClass(["separator",{"two-lines":B.value&&B.value.includes(`
@@ -4095,4 +4095,4 @@ ${n}`}return e.join(", ")}),C=p.computed(()=>{var e,w,v;const u=(v=(w=(e=y.repor
4095
4095
  `)}])},p.toDisplayString(B.value),3)):p.createCommentVNode("",!0),p.createElementVNode("div",{class:p.normalizeClass(["separator",{"two-lines":B.value&&B.value.includes(`
4096
4096
  `)}])},null,2),p.createElementVNode("span",Ome,[e[0]||(e[0]=p.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})],-1)),p.createElementVNode("span",Lme,p.toDisplayString(C.value||0),1)]),p.createElementVNode("span",Rme,[e[1]||(e[1]=p.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})],-1)),p.createElementVNode("span",zme,p.toDisplayString(b.value||0),1)])]),e[6]||(e[6]=p.createElementVNode("div",{class:"empty"},null,-1)),p.createElementVNode("div",Dme,[p.createElementVNode("span",Bme,p.toDisplayString(t.value||0),1),e[3]||(e[3]=p.createElementVNode("span",{class:"stat yellow"},[p.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})])],-1)),p.createElementVNode("span",Vme,p.toDisplayString(g.value||0),1),e[4]||(e[4]=p.createElementVNode("span",{class:"stat red"},[p.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})])],-1)),p.createElementVNode("div",{class:p.normalizeClass(["separator",{"two-lines":Z.value&&Z.value.includes(`
4097
4097
  `)}])},null,2),Z.value!==null?(p.openBlock(),p.createElementBlock("span",{key:0,class:p.normalizeClass(["stat time",{"two-lines":Z.value&&Z.value.includes(`
4098
- `)}])},p.toDisplayString(Z.value),3)):p.createCommentVNode("",!0),e[5]||(e[5]=p.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))])])])]))}},[["__scopeId","data-v-2a752817"]]),Fme={class:"prematch-bg"},Ume={class:"subtitle"},qme={class:"jornada"},Wme={class:"fecha"},Gme={class:"teams-row"},Hme={class:"team team-local"},Xme={class:"escudo-svg"},Jme=["src"],Zme={class:"team team-visitor"},Kme={class:"escudo-svg"},Yme=["src"],Qme=ws({__name:"AnalisisPrematchType3",props:{report:{type:Object,default:()=>({})}},setup(r){function i(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"):""}const y=r;return(B,Z)=>(p.openBlock(),p.createElementBlock("div",Fme,[Z[1]||(Z[1]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),p.createElementVNode("div",Ume,[p.createElementVNode("span",qme,p.toDisplayString(i(y.report.game.matchday_name)),1),p.createElementVNode("span",Wme," - "+p.toDisplayString(p.unref(Fd)(y.report.game.date_time_utc)),1)]),p.createElementVNode("div",Gme,[p.createElementVNode("div",Hme,[p.createElementVNode("span",Xme,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+y.report.game.home_team+".png"},null,8,Jme)])]),Z[0]||(Z[0]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",Zme,[p.createElementVNode("span",Kme,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+y.report.game.visiting_team+".png"},null,8,Yme)])])])]))}},[["__scopeId","data-v-23601285"]]),$me={class:"prematch-bg"},e0e={class:"subtitle"},t0e={class:"jornada"},r0e={class:"fecha"},n0e={class:"teams-row"},a0e={class:"team team-local"},i0e={class:"team-header"},o0e={class:"escudo-svg"},s0e=["src"],l0e={class:"score"},c0e={class:"players-list"},u0e={class:"player-name"},d0e={key:0,class:"more-events-indicator"},h0e={class:"team team-visitor"},p0e={class:"team-header"},f0e={class:"score"},m0e={class:"escudo-svg"},y0e=["src"],g0e={class:"players-list"},v0e={class:"player-name"},x0e={key:0},b0e={key:0,class:"more-events-indicator"},_0e=ws({__name:"AnalisisPostMatchType3",props:{report:{type:Object,default:()=>({})}},setup(r){function i(g){return g?g.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 y=r,B=p.computed(()=>{var g,u,e;return(((e=(u=(g=y.report)==null?void 0:g.game)==null?void 0:u.report_minutes)==null?void 0:e.home_goals_minutes)||[]).slice(0,5)}),Z=p.computed(()=>{var g,u,e;return(((e=(u=(g=y.report)==null?void 0:g.game)==null?void 0:u.report_minutes)==null?void 0:e.visiting_goals_minutes)||[]).slice(0,5)});function C(g){const u=Array.from(g.matchAll(/\d+\s*\+*\s*\d*'/g)).map(v=>v[0]).join(", "),e=g.match(/^(.*?)\s*\d+'/),w=e?" "+e[1].trim():"";return{minutos:u,nombre:w}}const b=p.computed(()=>{var u,e,w,v;return(((v=(w=(e=(u=y.report)==null?void 0:u.game)==null?void 0:e.report_minutes)==null?void 0:w.home_goals_minutes)==null?void 0:v.length)||0)>5}),t=p.computed(()=>{var u,e,w,v;return(((v=(w=(e=(u=y.report)==null?void 0:u.game)==null?void 0:e.report_minutes)==null?void 0:w.visiting_goals_minutes)==null?void 0:v.length)||0)>5});return(g,u)=>(p.openBlock(),p.createElementBlock("div",$me,[u[5]||(u[5]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),p.createElementVNode("div",e0e,[p.createElementVNode("span",t0e,"Jornada "+p.toDisplayString(i(r.report.game.matchday_name)),1),p.createElementVNode("span",r0e," - "+p.toDisplayString(p.unref(Fd)(r.report.game.date_time_utc)),1)]),p.createElementVNode("div",n0e,[p.createElementVNode("div",a0e,[p.createElementVNode("div",i0e,[p.createElementVNode("span",o0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.home_team+".png"},null,8,s0e)]),p.createElementVNode("div",l0e,p.toDisplayString(r.report.game.score[0]),1)]),p.createElementVNode("div",c0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(B.value,(e,w)=>(p.openBlock(),p.createElementBlock("div",{key:`home-event-${w}`,class:"player-item"},[p.createElementVNode("span",u0e,p.toDisplayString(e)+" ",1),u[0]||(u[0]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.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"}),p.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))]))),128)),b.value?(p.openBlock(),p.createElementBlock("div",d0e,[...u[1]||(u[1]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])]),u[4]||(u[4]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",h0e,[p.createElementVNode("div",p0e,[p.createElementVNode("div",f0e,p.toDisplayString(r.report.game.score[1]),1),p.createElementVNode("span",m0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.visiting_team+".png"},null,8,y0e)])]),p.createElementVNode("div",g0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(Z.value,(e,w)=>(p.openBlock(),p.createElementBlock("div",{key:`visiting-event-${w}`,class:"player-item"},[u[2]||(u[2]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.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"}),p.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)),p.createElementVNode("span",v0e,[p.createTextVNode(p.toDisplayString(C(e).minutos)+" ",1),C(e).nombre?(p.openBlock(),p.createElementBlock("span",x0e,p.toDisplayString(C(e).nombre),1)):p.createCommentVNode("",!0)])]))),128)),t.value?(p.openBlock(),p.createElementBlock("div",b0e,[...u[3]||(u[3]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-893ebf20"]]),w0e={class:"prematch-bg"},T0e={class:"subtitle"},k0e={class:"jornada"},S0e={class:"fecha"},E0e={class:"teams-row"},A0e={class:"team team-local"},C0e={class:"escudo-svg"},M0e=["src"],P0e={class:"team team-visitor"},I0e={class:"escudo-svg"},N0e=["src"],O0e=ws({__name:"AnalisisPrematchType4",props:{report:{type:Object,default:()=>({})}},setup(r){function i(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"):""}const y=r;return(B,Z)=>(p.openBlock(),p.createElementBlock("div",w0e,[Z[1]||(Z[1]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),p.createElementVNode("div",T0e,[p.createElementVNode("span",k0e,p.toDisplayString(i(y.report.game.matchday_name)),1),p.createElementVNode("span",S0e," - "+p.toDisplayString(p.unref(Fd)(y.report.game.date_time_utc)),1)]),p.createElementVNode("div",E0e,[p.createElementVNode("div",A0e,[p.createElementVNode("span",C0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+y.report.game.home_team+".png"},null,8,M0e)])]),Z[0]||(Z[0]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",P0e,[p.createElementVNode("span",I0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+y.report.game.visiting_team+".png"},null,8,N0e)])])])]))}},[["__scopeId","data-v-347d4c02"]]),L0e={class:"prematch-bg"},R0e={class:"subtitle"},z0e={class:"jornada"},D0e={class:"fecha"},B0e={class:"teams-row"},V0e={class:"team team-local"},j0e={class:"team-header"},F0e={class:"escudo-svg"},U0e=["src"],q0e={class:"score"},W0e={class:"players-list"},G0e={class:"player-name"},H0e={key:0,class:"more-events-indicator"},X0e={class:"team team-visitor"},J0e={class:"team-header"},Z0e={class:"score"},K0e={class:"escudo-svg"},Y0e=["src"],Q0e={class:"players-list"},$0e={class:"player-name"},eye={key:0},tye={key:0,class:"more-events-indicator"},rye=ws({__name:"AnalisisPostMatchType4",props:{report:{type:Object,default:()=>({})}},setup(r){function i(g){return g?g.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 y=r,B=p.computed(()=>{var g,u,e;return(((e=(u=(g=y.report)==null?void 0:g.game)==null?void 0:u.report_minutes)==null?void 0:e.home_goals_minutes)||[]).slice(0,5)}),Z=p.computed(()=>{var g,u,e;return(((e=(u=(g=y.report)==null?void 0:g.game)==null?void 0:u.report_minutes)==null?void 0:e.visiting_goals_minutes)||[]).slice(0,5)});function C(g){const u=Array.from(g.matchAll(/\d+\s*\+*\s*\d*'/g)).map(v=>v[0]).join(", "),e=g.match(/^(.*?)\s*\d+'/),w=e?e[1].trim():"";return{minutos:u,nombre:w}}const b=p.computed(()=>{var u,e,w,v;return(((v=(w=(e=(u=y.report)==null?void 0:u.game)==null?void 0:e.report_minutes)==null?void 0:w.home_goals_minutes)==null?void 0:v.length)||0)>5}),t=p.computed(()=>{var u,e,w,v;return(((v=(w=(e=(u=y.report)==null?void 0:u.game)==null?void 0:e.report_minutes)==null?void 0:w.visiting_goals_minutes)==null?void 0:v.length)||0)>5});return(g,u)=>(p.openBlock(),p.createElementBlock("div",L0e,[u[5]||(u[5]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),p.createElementVNode("div",R0e,[p.createElementVNode("span",z0e,"Jornada "+p.toDisplayString(i(r.report.game.matchday_name)),1),p.createElementVNode("span",D0e," - "+p.toDisplayString(p.unref(Fd)(r.report.game.date_time_utc)),1)]),p.createElementVNode("div",B0e,[p.createElementVNode("div",V0e,[p.createElementVNode("div",j0e,[p.createElementVNode("span",F0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.home_team+".png"},null,8,U0e)]),p.createElementVNode("div",q0e,p.toDisplayString(r.report.game.score[0]),1)]),p.createElementVNode("div",W0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(B.value,(e,w)=>(p.openBlock(),p.createElementBlock("div",{key:`home-event-${w}`,class:"player-item"},[p.createElementVNode("span",G0e,p.toDisplayString(e)+" ",1),u[0]||(u[0]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.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"}),p.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))]))),128)),b.value?(p.openBlock(),p.createElementBlock("div",H0e,[...u[1]||(u[1]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])]),u[4]||(u[4]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",X0e,[p.createElementVNode("div",J0e,[p.createElementVNode("div",Z0e,p.toDisplayString(r.report.game.score[1]),1),p.createElementVNode("span",K0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.visiting_team+".png"},null,8,Y0e)])]),p.createElementVNode("div",Q0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(Z.value,(e,w)=>(p.openBlock(),p.createElementBlock("div",{key:`visiting-event-${w}`,class:"player-item"},[u[2]||(u[2]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.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"}),p.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)),p.createElementVNode("span",$0e,[p.createTextVNode(p.toDisplayString(C(e).minutos)+" ",1),C(e).nombre?(p.openBlock(),p.createElementBlock("span",eye," "+p.toDisplayString(C(e).nombre),1)):p.createCommentVNode("",!0)])]))),128)),t.value?(p.openBlock(),p.createElementBlock("div",tye,[...u[3]||(u[3]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-9c7a5ed5"]]),nye={class:"report-card",style:{position:"relative"}},aye={class:"report-img-placeholder",style:{position:"relative"}},iye={class:"inner-card-report"},oye={class:"report-footer"},sye={class:"report-title"},lye={class:"report-template"},cye={class:"template-name"},uye={class:"report-league"},dye={class:"report-tournament"},hye=ws({__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(r,{emit:i}){const y=i,B=r,Z=p.ref(!1);function C(){Z.value=!1,y("open-report",B.report)}function b(){Z.value=!1,y("renombrar",B.report.report_name||"Reporte",B.report.id)}function t(){Z.value=!1,y("edit-template",B.report)}function g(){Z.value=!1}function u(){Z.value=!1,y("eliminar",B.report)}function e(){y("download-report",B.report),Z.value=!1}function w(x){return x?x.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 v(){y("open-report",B.report)}return(x,h)=>(p.openBlock(),p.createElementBlock("div",nye,[p.createElementVNode("div",{class:"three-dots",onClick:h[0]||(h[0]=p.withModifiers(n=>Z.value=!Z.value,["stop"]))},[...h[4]||(h[4]=[p.createElementVNode("span",null,null,-1),p.createElementVNode("span",null,null,-1),p.createElementVNode("span",null,null,-1)])]),p.createElementVNode("div",aye,[r.report.template_type===1&&r.report.pages[0].type==1?(p.openBlock(),p.createBlock(pfe,{key:0,"local-team":r.localTeam,"visitor-team":r.visitorTeam,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==1?(p.openBlock(),p.createBlock(Wfe,{key:1,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):p.createCommentVNode("",!0),r.report.template_type===1&&r.report.pages[0].type==2?(p.openBlock(),p.createBlock(cme,{key:2,"local-team":r.localTeam,"visitor-team":r.visitorTeam,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==2?(p.openBlock(),p.createBlock(jme,{key:3,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):p.createCommentVNode("",!0),r.report.template_type===1&&r.report.pages[0].type==3?(p.openBlock(),p.createBlock(Qme,{key:4,"local-team":r.localTeam,"visitor-team":r.visitorTeam,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==3?(p.openBlock(),p.createBlock(_0e,{key:5,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):r.report.template_type===1&&r.report.pages[0].type==4?(p.openBlock(),p.createBlock(O0e,{key:6,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==4?(p.openBlock(),p.createBlock(rye,{key:7,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):p.createCommentVNode("",!0),p.createElementVNode("div",{class:"report-img-overlay"},[p.createElementVNode("button",{class:"report-img-button",onClick:v},"Ver reporte")])]),p.createElementVNode("div",iye,[p.createElementVNode("div",oye,[p.createElementVNode("div",sye,p.toDisplayString(r.report.report_name),1),p.createElementVNode("div",lye,[h[5]||(h[5]=p.createTextVNode(" Template: ",-1)),p.createElementVNode("span",cye,p.toDisplayString(r.report.name),1)]),p.createElementVNode("div",uye,p.toDisplayString(r.report.season_name)+" - "+p.toDisplayString(w(r.report.game.matchday_name))+"  |  "+p.toDisplayString(p.unref(Fd)(r.report.game.date_time_utc)),1),p.createElementVNode("div",dye,p.toDisplayString(r.report.tournament_name),1)])]),Z.value?(p.openBlock(),p.createBlock(Jpe,{key:0,onClick:h[1]||(h[1]=p.withModifiers(n=>Z.value=!1,["self"])),onMouseleave:h[2]||(h[2]=n=>Z.value=!1),onVerReporte:C,onRenombrar:b,onEditar:t,onDuplicar:g,onEliminar:u,onDescargar:e})):p.createCommentVNode("",!0),Z.value?(p.openBlock(),p.createElementBlock("div",{key:1,class:"tooltip-overlay",onClick:h[3]||(h[3]=n=>Z.value=!1)})):p.createCommentVNode("",!0)]))}},[["__scopeId","data-v-34e6ad47"]]),pye={class:"modal-overlay"},fye={class:"modal-content"},mye={class:"modal-body"},yye=["placeholder","disabled"],gye={key:0,class:"error-message"},vye={class:"modal-footer"},xye=["disabled"],bye=["disabled"],_ye={key:0},wye={key:1},Tye=ws({__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(r,{emit:i}){const y=r,B=i,Z=p.ref(y.initialName),C=p.ref(!1),b=p.ref("");p.watch(()=>y.initialName,g=>{Z.value=g,b.value=""});async function t(){var g;if(console.log("acceptRename"),!(Z.value.trim().length<3)){console.log("acceptRename 22"),C.value=!0,b.value="";try{await to.create({headers:{Authorization:`${y.token}`}}).put(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${y.userId}/reports/${y.reportId}/rename`,{name:Z.value.trim()}),B("rename",Z.value.trim()),B("refresh"),B("close")}catch(u){console.error("Error al renombrar el reporte:",u),((g=u.response)==null?void 0:g.status)===409?b.value="Ya existe un reporte con el mismo nombre":b.value="Error al renombrar el reporte. Inténtalo de nuevo."}finally{C.value=!1}}}return p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""}),(g,u)=>(p.openBlock(),p.createElementBlock("div",pye,[p.createElementVNode("div",fye,[p.createElementVNode("button",{class:"close-btn",onClick:u[0]||(u[0]=e=>g.$emit("close"))},[...u[3]||(u[3]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),u[5]||(u[5]=p.createElementVNode("div",{class:"modal-header"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename-white.svg",class:"icon-title",alt:"icon"}),p.createElementVNode("span",{class:"modal-title"},"Renombrar Reporte")],-1)),u[6]||(u[6]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",mye,[u[4]||(u[4]=p.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),p.withDirectives(p.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":u[1]||(u[1]=e=>Z.value=e),placeholder:r.initialName,maxlength:"40",autocomplete:"off",disabled:C.value},null,8,yye),[[p.vModelText,Z.value]]),b.value?(p.openBlock(),p.createElementBlock("div",gye,p.toDisplayString(b.value),1)):p.createCommentVNode("",!0)]),u[7]||(u[7]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",vye,[p.createElementVNode("button",{class:"cancel-btn",onClick:u[2]||(u[2]=e=>g.$emit("close")),disabled:C.value},"Cancelar",8,xye),p.createElementVNode("button",{class:"next-btn",disabled:Z.value.trim().length<3||C.value,onClick:t},[C.value?(p.openBlock(),p.createElementBlock("span",_ye,"Guardando...")):(p.openBlock(),p.createElementBlock("span",wye,"Guardar"))],8,bye)])])]))}},[["__scopeId","data-v-3a66dd5f"]]),kye={class:"modal-overlay"},Sye={class:"modal-content"},Eye={class:"modal-footer"},Aye=["disabled"],Cye=["disabled"],Mye=ws({__name:"ModalDeleteReport",props:{reportId:{type:String,required:!0},userId:{type:String,required:!0},token:{type:String,required:!0}},emits:["close","delete","reportDeleted"],setup(r,{emit:i}){const y=r,B=i,Z=p.ref(!1),C=async()=>{try{Z.value=!0;const t=await to.create({headers:{Authorization:`${y.token}`}}).delete(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${y.userId}/reports/${y.reportId}`);B("reportDeleted",y.reportId),B("close")}catch(b){console.error("Error al eliminar el reporte:",b),alert("Error al eliminar el reporte. Por favor, intenta de nuevo.")}finally{Z.value=!1}};return p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""}),(b,t)=>(p.openBlock(),p.createElementBlock("div",kye,[p.createElementVNode("div",Sye,[p.createElementVNode("button",{class:"close-btn",onClick:t[0]||(t[0]=g=>b.$emit("close"))},[...t[2]||(t[2]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),t[3]||(t[3]=p.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)),p.createElementVNode("div",Eye,[p.createElementVNode("button",{class:"cancel-btn",onClick:t[1]||(t[1]=g=>b.$emit("close")),disabled:Z.value},"Cancelar",8,Aye),p.createElementVNode("button",{class:"delete-btn",onClick:C,disabled:Z.value},p.toDisplayString(Z.value?"Eliminando...":"Eliminar"),9,Cye)])])]))}},[["__scopeId","data-v-2bd7ac3a"]]),Pye={class:"reports-header"},Iye={class:"count"},Nye={key:0,class:"sort-options"},Oye=["onClick"],Lye={key:0,class:"checkmark"},Rye={key:0,class:"loading-state"},zye={key:1,class:"error-state"},Dye={key:3,class:"empty-reports"},Bye={key:4,class:"empty-reports"},Vye=ws({__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(r,{emit:i}){const y=r,B=i,Z=p.ref([]),C=p.ref(!1),b=p.ref(null),t=p.computed(()=>{let V=Z.value;if(y.searchQuery.trim()){const U=y.searchQuery.toLowerCase().trim();V=Z.value.filter(q=>{var re,ee,K,te,ie,oe,he;return!!((((re=q.report_name)==null?void 0:re.toLowerCase())||"").includes(U)||(((ee=q.name)==null?void 0:ee.toLowerCase())||"").includes(U)||q.created_at&&new Date(q.created_at).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(U)||(K=q.game)!=null&&K.date_time_utc&&new Date(q.game.date_time_utc).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(U)||(((ie=(te=q.game)==null?void 0:te.season_name)==null?void 0:ie.toLowerCase())||"").includes(U)||(((oe=q.tournament_name)==null?void 0:oe.toLowerCase())||"").includes(U)||(he=q.game)!=null&&he.matchday&&q.game.matchday.toString().includes(U))})}return u.value&&(V=[...V].sort((U,q)=>{var W,Y;if(u.value==="A - Z"){const ne=(U.report_name||"").toLowerCase(),X=(q.report_name||"").toLowerCase();return ne.localeCompare(X,"es",{sensitivity:"base"})}else if(u.value==="Más recientes"){const ne=new Date(U.created_at||0);return new Date(q.created_at||0)-ne}else if(u.value==="Torneo"){const ne=(U.tournament_name||"").toLowerCase(),X=(q.tournament_name||"").toLowerCase();if(ne!==X)return ne.localeCompare(X,"es",{sensitivity:"base"});const re=U.season_id||0;return(q.season_id||0)-re}else if(u.value==="Jornada"){const ne=((W=U.game)==null?void 0:W.matchday_id)||0,X=((Y=q.game)==null?void 0:Y.matchday_id)||0;return ne-X}return 0})),V}),g=p.ref(!1),u=p.ref("Más recientes"),e=p.ref(!1),w=p.ref(""),v=p.ref(""),x=p.ref(""),h=p.ref(!1),n=p.ref(""),a=p.ref(""),d=p.ref(null),s=p.ref(null),c=p.ref(null),f=p.ref(0),m=[{label:"A - Z",value:"A - Z"},{label:"Más recientes",value:"Más recientes"},{label:"Torneo",value:"Torneo"},{label:"Jornada",value:"Jornada"}],k=async()=>{C.value=!0,b.value=null;try{const V=await to.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${y.userId}/reports`,{headers:{Authorization:`${y.token}`,"Content-Type":"application/json"}});V.data&&Array.isArray(V.data)?Z.value=V.data:V.data&&V.data.reports?Z.value=V.data.reports:V.data&&V.data.data?Z.value=V.data.data:Z.value=[]}catch(V){console.error("Error cargando reportes:",V),console.error("Error response:",V.response),b.value=V.message||"Error al cargar los reportes",Z.value=[]}finally{C.value=!1}},E=p.computed(()=>{if(!f.value)return"grid-1-column";const V=340,U=20,W=f.value-40,Y=Math.floor((W+U)/(V+U)),ne=Math.max(1,Y);return ne>=4?"grid-4-columns":ne>=3?"grid-3-columns":ne>=2?"grid-2-columns":"grid-1-column"}),S=()=>{g.value=!g.value},P=V=>{u.value=V,g.value=!1};function I(V){B("open-report",V)}const A=(V,U)=>{w.value=V,v.value=U;const q=Z.value.find(W=>W.id===U);x.value=q?q.template_type:"",e.value=!0},N=V=>{e.value=!1;const U=Z.value.findIndex(q=>q.id===v.value);U!==-1&&(Z.value[U].report_name=V)},M=V=>{n.value=V.report_name||"Reporte",a.value=V.id,h.value=!0},T=V=>{h.value=!1,Z.value=Z.value.filter(U=>U.id!==V)};function O(V){B("download-report",V)}const _=V=>{g.value&&d.value&&!d.value.contains(V.target)&&(g.value=!1)},L=()=>{s.value&&(f.value=s.value.offsetWidth)};let z=null;return p.onMounted(async()=>{document.addEventListener("mousedown",_),await k(),await p.nextTick(),L(),window.ResizeObserver?(z=new ResizeObserver(()=>{L()}),s.value&&z.observe(s.value)):window.addEventListener("resize",L)}),p.onBeforeUnmount(()=>{document.removeEventListener("mousedown",_),z?z.disconnect():window.removeEventListener("resize",L)}),(V,U)=>(p.openBlock(),p.createElementBlock("div",{class:"reports-section",ref_key:"reportsSectionRef",ref:s},[p.createElementVNode("div",Pye,[p.createElementVNode("span",null,[U[2]||(U[2]=p.createTextVNode("Reportes ",-1)),p.createElementVNode("span",Iye,"("+p.toDisplayString(t.value.length)+")",1)]),p.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:d},[p.createElementVNode("button",{class:"sort-button",onClick:S},[p.createTextVNode(p.toDisplayString(u.value||"Ordenar")+" ",1),p.createElementVNode("span",{class:p.normalizeClass(["dropdown-arrow",{rotated:g.value}])},null,2)]),g.value?(p.openBlock(),p.createElementBlock("div",Nye,[(p.openBlock(),p.createElementBlock(p.Fragment,null,p.renderList(m,q=>p.createElementVNode("div",{key:q.value,class:p.normalizeClass(["sort-option",{selected:u.value===q.value}]),onClick:W=>u.value!==q.value&&P(q.value)},[p.createElementVNode("span",null,p.toDisplayString(q.label),1),u.value===q.value?(p.openBlock(),p.createElementBlock("span",Lye,[...U[3]||(U[3]=[p.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)],10,Oye)),64))])):p.createCommentVNode("",!0)],512)]),C.value?(p.openBlock(),p.createElementBlock("div",Rye,[...U[4]||(U[4]=[p.createElementVNode("div",{class:"loading-spinner"},null,-1),p.createElementVNode("p",null,"Cargando reportes...",-1)])])):b.value?(p.openBlock(),p.createElementBlock("div",zye,[p.createElementVNode("p",null,"Error al cargar reportes: "+p.toDisplayString(b.value),1),p.createElementVNode("button",{onClick:k,class:"retry-button"},"Reintentar")])):(p.openBlock(),p.createElementBlock("div",{key:2,class:p.normalizeClass(["reports-grid",E.value]),ref_key:"reportsGridRef",ref:c},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.value,q=>(p.openBlock(),p.createBlock(hye,{key:q.id,report:q,onOpenReport:I,onRenombrar:A,onEliminar:M,onDownloadReport:O},null,8,["report"]))),128))],2)),!C.value&&!b.value&&Z.value.length===0?(p.openBlock(),p.createElementBlock("div",Dye," No tienes reportes aún. ")):p.createCommentVNode("",!0),!C.value&&!b.value&&Z.value.length>0&&t.value.length===0?(p.openBlock(),p.createElementBlock("div",Bye," No se encontraron reportes que coincidan con tu búsqueda. ")):p.createCommentVNode("",!0),e.value?(p.openBlock(),p.createBlock(Tye,{key:5,initialName:w.value,templateType:x.value,token:r.token,userId:r.userId,reportId:v.value,onClose:U[0]||(U[0]=q=>e.value=!1),onRename:N,onRefresh:k},null,8,["initialName","templateType","token","userId","reportId"])):p.createCommentVNode("",!0),h.value?(p.openBlock(),p.createBlock(Mye,{key:6,"report-id":a.value,"user-id":r.userId,token:r.token,onClose:U[1]||(U[1]=q=>h.value=!1),onReportDeleted:T},null,8,["report-id","user-id","token"])):p.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-d40008f8"]]),jye={class:"modal-overlay"},Fye={class:"modal-content"},Uye=ws({__name:"ModalSoloEscritorio",setup(r){return(i,y)=>(p.openBlock(),p.createElementBlock("div",jye,[p.createElementVNode("div",Fye,[y[1]||(y[1]=p.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)),p.createElementVNode("button",{class:"modal-btn",onClick:y[0]||(y[0]=B=>i.$emit("toHome"))},"OK")])]))}},[["__scopeId","data-v-76d7f6ed"]]),qye={class:"top-bar"},Wye={class:"tabs-container"},Gye={class:"tabs"},Hye={key:0,class:"actions"},Xye={class:"search-container"},Jye={key:1,class:"actions"},Zye={class:"search-container"},Kye=ws({__name:"gsc-reports",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0}},emits:["toHome","download-report"],setup(r,{emit:i}){const y=r,{userId:B,team:Z,token:C}=y,b=p.ref("templates"),t=p.ref(!1),g=p.ref(null),u=p.ref(!1),e=p.ref(""),w=p.ref(""),v=p.ref(null),x=p.ref(null),h=p.ref(0),n=i;function a(){if(g.value){const P=g.value.offsetWidth;t.value=P<1028}}p.watch(t,P=>{P?document.body.style.overflow="hidden":document.body.style.overflow=""}),p.onBeforeUnmount(()=>{document.body.style.overflow=""}),p.onMounted(()=>{a(),window.addEventListener("resize",a)}),p.onBeforeUnmount(()=>{window.removeEventListener("resize",a)});function d(P){s(P)}function s(P){v.value.show({template:P,isTemplateMode:!0})}const c=()=>{e.value=""},f=()=>{w.value=""};function m(P){v.value&&v.value.show({template:P,isTemplateMode:!1})}function k(P){n("download-report",P)}function E(){n("toHome")}function S(){x.value&&x.value.obtenerTemplates(),h.value+=1}return(P,I)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(p.unref(Iue),{ref_key:"reportTemplateMaker",ref:v,token:p.unref(C),"user-team-id":p.unref(Z),onClose:S},null,8,["token","user-team-id"]),p.createElementVNode("div",{ref_key:"containerRef",ref:g,class:"reports-container"},[t.value?(p.openBlock(),p.createBlock(Uye,{key:0,onToHome:E})):p.createCommentVNode("",!0),I[12]||(I[12]=p.createElementVNode("h1",{class:"title"},"Mis reportes",-1)),p.createElementVNode("div",qye,[p.createElementVNode("div",Wye,[p.createElementVNode("div",Gye,[p.createElementVNode("div",{class:p.normalizeClass(["tab tab-templates",{active:b.value==="templates"}]),onClick:I[0]||(I[0]=A=>b.value="templates")}," Templates ",2),p.createElementVNode("div",{class:p.normalizeClass(["tab tab-reports",{active:b.value==="reports"}]),onClick:I[1]||(I[1]=A=>b.value="reports")}," Tus reportes ",2)])]),b.value==="templates"?(p.openBlock(),p.createElementBlock("div",Hye,[p.createElementVNode("div",Xye,[I[8]||(I[8]=p.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":I[2]||(I[2]=A=>e.value=A),class:"search",type:"text",placeholder:"Buscar template"},null,512),[[p.vModelText,e.value]]),e.value?(p.openBlock(),p.createElementBlock("button",{key:0,onClick:c,class:"clear-search-btn",type:"button"},[...I[7]||(I[7]=[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)]),p.createElementVNode("button",{class:"create-template-btn",onClick:I[3]||(I[3]=A=>u.value=!0)},[...I[9]||(I[9]=[p.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-agregar@3x.png",alt:"Agregar",class:"create-icon"},null,-1),p.createTextVNode(" Crear template ",-1)])])])):p.createCommentVNode("",!0),b.value==="reports"?(p.openBlock(),p.createElementBlock("div",Jye,[p.createElementVNode("div",Zye,[I[11]||(I[11]=p.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":I[4]||(I[4]=A=>w.value=A),class:"search search-reports",type:"text",placeholder:"Buscar reporte"},null,512),[[p.vModelText,w.value]]),w.value?(p.openBlock(),p.createElementBlock("button",{key:0,onClick:f,class:"clear-search-btn",type:"button"},[...I[10]||(I[10]=[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)])])):p.createCommentVNode("",!0)]),b.value==="templates"?(p.openBlock(),p.createBlock(Hpe,{ref_key:"templatesSectionRef",ref:x,userId:p.unref(B),token:p.unref(C),team:p.unref(Z),searchQuery:e.value,key:h.value,onSwitchToReports:I[5]||(I[5]=A=>b.value="reports"),onOpenModalNewTemplate:d,onEditTemplate:s},null,8,["userId","token","team","searchQuery"])):(p.openBlock(),p.createBlock(Vye,{key:2,userId:p.unref(B),token:p.unref(C),team:p.unref(Z),searchQuery:w.value,onOpenReport:m,onDownloadReport:k},null,8,["userId","token","team","searchQuery"])),u.value?(p.openBlock(),p.createBlock(xT,{key:3,token:p.unref(C),team:p.unref(Z),onOpenModalNewTemplate:d,onClose:I[6]||(I[6]=A=>u.value=!1)},null,8,["token","team"])):p.createCommentVNode("",!0)],512)],64))}},[["__scopeId","data-v-9ffb4e12"]]),Yye={class:"subcategory-group"},Qye={__name:"SubcategoryGroup",props:{subcategoryGroup:{type:Array,default:()=>[]}},setup(r){return(i,y)=>(p.openBlock(),p.createElementBlock("div",Yye,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(r.subcategoryGroup,B=>(p.openBlock(),p.createBlock(p.unref(K1),{key:B.id,modelValue:B.isSelected,"onUpdate:modelValue":Z=>B.isSelected=Z,label:B.name},null,8,["modelValue","onUpdate:modelValue","label"]))),128))]))}},$ye=nu(Qye,[["__scopeId","data-v-ae6f3d72"]]),ege={class:"filter-subcategories"},tge=Object.freeze(Object.defineProperty({__proto__:null,default:nu({__name:"FilterSubcategories",props:{subcategoryGroups:{type:Array,default:()=>[]}},setup(r){return(i,y)=>(p.openBlock(),p.createElementBlock("div",ege,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(r.subcategoryGroups,B=>(p.openBlock(),p.createElementBlock("div",{key:B.id,class:"filter-subcategories__group"},[p.createVNode($ye,{subcategoryGroup:B},null,8,["subcategoryGroup"])]))),128))]))}},[["__scopeId","data-v-5edaefc2"]])},Symbol.toStringTag,{value:"Module"})),gg=r=>(p.pushScopeId("data-v-80d9c265"),r=r(),p.popScopeId(),r),rge={class:"details__header"},nge=gg(()=>p.createElementVNode("div",{class:"details__header__title"},"Jugando como",-1)),age={class:"details__header__checkbox"},ige={class:"details__body"},oge={class:"details__body__playing-as"},sge=["onClick"],lge={class:"details__header"},cge=gg(()=>p.createElementVNode("div",{class:"details__header__title"},"En: (Elige el lapso de tiempo)",-1)),uge={class:"details__header__checkbox"},dge={class:"details__body"},hge=gg(()=>p.createElementVNode("div",{class:"details__body__title"},"1er tiempo",-1)),pge={class:"details__body__game-section"},fge=["onClick"],mge={class:"details__body"},yge=gg(()=>p.createElementVNode("div",{class:"details__body__title"},"2do tiempo",-1)),gge={class:"details__body__game-section"},vge=["onClick"],xge=Object.freeze(Object.defineProperty({__proto__:null,default:nu({__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(r){const i=r;p.useCssVars(e=>({"49cba245":r.buttonsBackgroundColor,"52f02da6":r.buttonsTextColor,"7d3f686a":r.buttonsBorderWidth,"7c286a07":r.buttonsBorderColor,"24a6f4aa":r.buttonsBackgroundColorActive,cd8d7768:r.buttonsTextColorActive,"35fa5c10":r.buttonsBorderWidthActive,"0cde1826":r.buttonsBorderColorActive}));const y=p.computed(()=>i.playingAs.every(e=>e.isSelected)),B=p.computed(()=>i.gameSections.every(e=>e.isSelected)),Z=p.computed(()=>i.gameSections.reduce((e,w)=>(w.value<=3?e.firstHalf.push(w):e.secondHalf.push(w),e),{firstHalf:[],secondHalf:[]})),C=p.computed(()=>({"--border-radius-first-button":`${i.buttonsBorderRadius} 0 0 ${i.buttonsBorderRadius}`,"--border-radius-last-button":`0 ${i.buttonsBorderRadius} ${i.buttonsBorderRadius} 0`}));function b(e){e?i.playingAs.forEach(w=>{w.isSelected=!0}):i.playingAs.forEach((w,v)=>{w.isSelected=v===0})}function t(e){i.playingAs.filter(w=>w.isSelected).length===1&&e.isSelected||(e.isSelected=!e.isSelected)}function g(e){i.gameSections.filter(w=>w.isSelected).length===1&&e.isSelected||(e.isSelected=!e.isSelected)}function u(e){e?i.gameSections.forEach(w=>{w.isSelected=!0}):i.gameSections.forEach((w,v)=>{w.isSelected=v===0})}return(e,w)=>(p.openBlock(),p.createElementBlock("div",{class:"details",style:p.normalizeStyle(C.value)},[p.createElementVNode("div",rge,[nge,p.createElementVNode("div",age,[p.createVNode(p.unref(K1),{label:"Todos","model-value":y.value,"onUpdate:modelValue":b},null,8,["model-value"])])]),p.createElementVNode("div",ige,[p.createElementVNode("div",oge,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(i.playingAs,(v,x)=>(p.openBlock(),p.createElementBlock("div",{key:`pa${x}`,class:p.normalizeClass(["details__body__button",{active:v.isSelected}]),onClick:h=>t(v)},p.toDisplayString(v.name),11,sge))),128))])]),p.createElementVNode("div",lge,[cge,p.createElementVNode("div",uge,[p.createVNode(p.unref(K1),{label:"Todos","model-value":B.value,"onUpdate:modelValue":u},null,8,["model-value"])])]),p.createElementVNode("div",dge,[hge,p.createElementVNode("div",pge,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(Z.value.firstHalf,(v,x)=>(p.openBlock(),p.createElementBlock("div",{key:`pa${x}`,class:p.normalizeClass(["details__body__button",{active:v.isSelected}]),onClick:h=>g(v)},p.toDisplayString(v.text),11,fge))),128))])]),p.createElementVNode("div",mge,[yge,p.createElementVNode("div",gge,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(Z.value.secondHalf,(v,x)=>(p.openBlock(),p.createElementBlock("div",{key:`pa${x}`,class:p.normalizeClass(["details__body__button",{active:v.isSelected}]),onClick:h=>g(v)},p.toDisplayString(v.text),11,vge))),128))])])],4))}},[["__scopeId","data-v-80d9c265"]])},Symbol.toStringTag,{value:"Module"})),bge={class:"filter-field"},_ge=Object.freeze(Object.defineProperty({__proto__:null,default:nu({__name:"FilterField",setup(r){const i=p.ref(Array.from({length:16},(B,Z)=>Z+1));function y(){}return(B,Z)=>(p.openBlock(),p.createElementBlock("div",bge,[p.createVNode(p.unref(jO),{width:"100%","background-color":"#2E3B46",value:i.value,"onUpdate:modelValue":y},null,8,["value"])]))}},[["__scopeId","data-v-8103c3e1"]])},Symbol.toStringTag,{value:"Module"}));Ah.GSCReports=Kye,Object.defineProperty(Ah,Symbol.toStringTag,{value:"Module"})}));
4098
+ `)}])},p.toDisplayString(Z.value),3)):p.createCommentVNode("",!0),e[5]||(e[5]=p.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))])])])]))}},[["__scopeId","data-v-2a752817"]]),Fme={class:"prematch-bg"},Ume={class:"subtitle"},qme={class:"jornada"},Wme={class:"fecha"},Gme={class:"teams-row"},Hme={class:"team team-local"},Xme={class:"escudo-svg"},Jme=["src"],Zme={class:"team team-visitor"},Kme={class:"escudo-svg"},Yme=["src"],Qme=ws({__name:"AnalisisPrematchType3",props:{report:{type:Object,default:()=>({})}},setup(r){function i(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"):""}const y=r;return(B,Z)=>(p.openBlock(),p.createElementBlock("div",Fme,[Z[1]||(Z[1]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),p.createElementVNode("div",Ume,[p.createElementVNode("span",qme,p.toDisplayString(i(y.report.game.matchday_name)),1),p.createElementVNode("span",Wme," - "+p.toDisplayString(p.unref(Fd)(y.report.game.date_time_utc)),1)]),p.createElementVNode("div",Gme,[p.createElementVNode("div",Hme,[p.createElementVNode("span",Xme,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+y.report.game.home_team+".png"},null,8,Jme)])]),Z[0]||(Z[0]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",Zme,[p.createElementVNode("span",Kme,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+y.report.game.visiting_team+".png"},null,8,Yme)])])])]))}},[["__scopeId","data-v-23601285"]]),$me={class:"prematch-bg"},e0e={class:"subtitle"},t0e={class:"jornada"},r0e={class:"fecha"},n0e={class:"teams-row"},a0e={class:"team team-local"},i0e={class:"team-header"},o0e={class:"escudo-svg"},s0e=["src"],l0e={class:"score"},c0e={class:"players-list"},u0e={class:"player-name"},d0e={key:0,class:"more-events-indicator"},h0e={class:"team team-visitor"},p0e={class:"team-header"},f0e={class:"score"},m0e={class:"escudo-svg"},y0e=["src"],g0e={class:"players-list"},v0e={class:"player-name"},x0e={key:0},b0e={key:0,class:"more-events-indicator"},_0e=ws({__name:"AnalisisPostMatchType3",props:{report:{type:Object,default:()=>({})}},setup(r){function i(g){return g?g.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 y=r,B=p.computed(()=>{var g,u,e;return(((e=(u=(g=y.report)==null?void 0:g.game)==null?void 0:u.report_minutes)==null?void 0:e.home_goals_minutes)||[]).slice(0,5)}),Z=p.computed(()=>{var g,u,e;return(((e=(u=(g=y.report)==null?void 0:g.game)==null?void 0:u.report_minutes)==null?void 0:e.visiting_goals_minutes)||[]).slice(0,5)});function C(g){const u=Array.from(g.matchAll(/\d+\s*\+*\s*\d*'/g)).map(v=>v[0]).join(", "),e=g.match(/^(.*?)\s*\d+'/),w=e?" "+e[1].trim():"";return{minutos:u,nombre:w}}const b=p.computed(()=>{var u,e,w,v;return(((v=(w=(e=(u=y.report)==null?void 0:u.game)==null?void 0:e.report_minutes)==null?void 0:w.home_goals_minutes)==null?void 0:v.length)||0)>5}),t=p.computed(()=>{var u,e,w,v;return(((v=(w=(e=(u=y.report)==null?void 0:u.game)==null?void 0:e.report_minutes)==null?void 0:w.visiting_goals_minutes)==null?void 0:v.length)||0)>5});return(g,u)=>(p.openBlock(),p.createElementBlock("div",$me,[u[5]||(u[5]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),p.createElementVNode("div",e0e,[p.createElementVNode("span",t0e,"Jornada "+p.toDisplayString(i(r.report.game.matchday_name)),1),p.createElementVNode("span",r0e," - "+p.toDisplayString(p.unref(Fd)(r.report.game.date_time_utc)),1)]),p.createElementVNode("div",n0e,[p.createElementVNode("div",a0e,[p.createElementVNode("div",i0e,[p.createElementVNode("span",o0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.home_team+".png"},null,8,s0e)]),p.createElementVNode("div",l0e,p.toDisplayString(r.report.game.score[0]),1)]),p.createElementVNode("div",c0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(B.value,(e,w)=>(p.openBlock(),p.createElementBlock("div",{key:`home-event-${w}`,class:"player-item"},[p.createElementVNode("span",u0e,p.toDisplayString(e)+" ",1),u[0]||(u[0]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.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"}),p.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))]))),128)),b.value?(p.openBlock(),p.createElementBlock("div",d0e,[...u[1]||(u[1]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])]),u[4]||(u[4]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",h0e,[p.createElementVNode("div",p0e,[p.createElementVNode("div",f0e,p.toDisplayString(r.report.game.score[1]),1),p.createElementVNode("span",m0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.visiting_team+".png"},null,8,y0e)])]),p.createElementVNode("div",g0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(Z.value,(e,w)=>(p.openBlock(),p.createElementBlock("div",{key:`visiting-event-${w}`,class:"player-item"},[u[2]||(u[2]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.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"}),p.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)),p.createElementVNode("span",v0e,[p.createTextVNode(p.toDisplayString(C(e).minutos)+" ",1),C(e).nombre?(p.openBlock(),p.createElementBlock("span",x0e,p.toDisplayString(C(e).nombre),1)):p.createCommentVNode("",!0)])]))),128)),t.value?(p.openBlock(),p.createElementBlock("div",b0e,[...u[3]||(u[3]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-893ebf20"]]),w0e={class:"prematch-bg"},T0e={class:"subtitle"},k0e={class:"jornada"},S0e={class:"fecha"},E0e={class:"teams-row"},A0e={class:"team team-local"},C0e={class:"escudo-svg"},M0e=["src"],P0e={class:"team team-visitor"},I0e={class:"escudo-svg"},N0e=["src"],O0e=ws({__name:"AnalisisPrematchType4",props:{report:{type:Object,default:()=>({})}},setup(r){function i(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"):""}const y=r;return(B,Z)=>(p.openBlock(),p.createElementBlock("div",w0e,[Z[1]||(Z[1]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),p.createElementVNode("div",T0e,[p.createElementVNode("span",k0e,p.toDisplayString(i(y.report.game.matchday_name)),1),p.createElementVNode("span",S0e," - "+p.toDisplayString(p.unref(Fd)(y.report.game.date_time_utc)),1)]),p.createElementVNode("div",E0e,[p.createElementVNode("div",A0e,[p.createElementVNode("span",C0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+y.report.game.home_team+".png"},null,8,M0e)])]),Z[0]||(Z[0]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",P0e,[p.createElementVNode("span",I0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+y.report.game.visiting_team+".png"},null,8,N0e)])])])]))}},[["__scopeId","data-v-347d4c02"]]),L0e={class:"prematch-bg"},R0e={class:"subtitle"},z0e={class:"jornada"},D0e={class:"fecha"},B0e={class:"teams-row"},V0e={class:"team team-local"},j0e={class:"team-header"},F0e={class:"escudo-svg"},U0e=["src"],q0e={class:"score"},W0e={class:"players-list"},G0e={class:"player-name"},H0e={key:0,class:"more-events-indicator"},X0e={class:"team team-visitor"},J0e={class:"team-header"},Z0e={class:"score"},K0e={class:"escudo-svg"},Y0e=["src"],Q0e={class:"players-list"},$0e={class:"player-name"},eye={key:0},tye={key:0,class:"more-events-indicator"},rye=ws({__name:"AnalisisPostMatchType4",props:{report:{type:Object,default:()=>({})}},setup(r){function i(g){return g?g.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 y=r,B=p.computed(()=>{var g,u,e;return(((e=(u=(g=y.report)==null?void 0:g.game)==null?void 0:u.report_minutes)==null?void 0:e.home_goals_minutes)||[]).slice(0,5)}),Z=p.computed(()=>{var g,u,e;return(((e=(u=(g=y.report)==null?void 0:g.game)==null?void 0:u.report_minutes)==null?void 0:e.visiting_goals_minutes)||[]).slice(0,5)});function C(g){const u=Array.from(g.matchAll(/\d+\s*\+*\s*\d*'/g)).map(v=>v[0]).join(", "),e=g.match(/^(.*?)\s*\d+'/),w=e?e[1].trim():"";return{minutos:u,nombre:w}}const b=p.computed(()=>{var u,e,w,v;return(((v=(w=(e=(u=y.report)==null?void 0:u.game)==null?void 0:e.report_minutes)==null?void 0:w.home_goals_minutes)==null?void 0:v.length)||0)>5}),t=p.computed(()=>{var u,e,w,v;return(((v=(w=(e=(u=y.report)==null?void 0:u.game)==null?void 0:e.report_minutes)==null?void 0:w.visiting_goals_minutes)==null?void 0:v.length)||0)>5});return(g,u)=>(p.openBlock(),p.createElementBlock("div",L0e,[u[5]||(u[5]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),p.createElementVNode("div",R0e,[p.createElementVNode("span",z0e,"Jornada "+p.toDisplayString(i(r.report.game.matchday_name)),1),p.createElementVNode("span",D0e," - "+p.toDisplayString(p.unref(Fd)(r.report.game.date_time_utc)),1)]),p.createElementVNode("div",B0e,[p.createElementVNode("div",V0e,[p.createElementVNode("div",j0e,[p.createElementVNode("span",F0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.home_team+".png"},null,8,U0e)]),p.createElementVNode("div",q0e,p.toDisplayString(r.report.game.score[0]),1)]),p.createElementVNode("div",W0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(B.value,(e,w)=>(p.openBlock(),p.createElementBlock("div",{key:`home-event-${w}`,class:"player-item"},[p.createElementVNode("span",G0e,p.toDisplayString(e)+" ",1),u[0]||(u[0]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.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"}),p.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))]))),128)),b.value?(p.openBlock(),p.createElementBlock("div",H0e,[...u[1]||(u[1]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])]),u[4]||(u[4]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",X0e,[p.createElementVNode("div",J0e,[p.createElementVNode("div",Z0e,p.toDisplayString(r.report.game.score[1]),1),p.createElementVNode("span",K0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.visiting_team+".png"},null,8,Y0e)])]),p.createElementVNode("div",Q0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(Z.value,(e,w)=>(p.openBlock(),p.createElementBlock("div",{key:`visiting-event-${w}`,class:"player-item"},[u[2]||(u[2]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.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"}),p.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)),p.createElementVNode("span",$0e,[p.createTextVNode(p.toDisplayString(C(e).minutos)+" ",1),C(e).nombre?(p.openBlock(),p.createElementBlock("span",eye," "+p.toDisplayString(C(e).nombre),1)):p.createCommentVNode("",!0)])]))),128)),t.value?(p.openBlock(),p.createElementBlock("div",tye,[...u[3]||(u[3]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-9c7a5ed5"]]),nye={class:"report-card",style:{position:"relative"}},aye={class:"report-img-placeholder",style:{position:"relative"}},iye={class:"inner-card-report"},oye={class:"report-footer"},sye={class:"report-title"},lye={class:"report-template"},cye={class:"template-name"},uye={class:"report-league"},dye={class:"report-tournament"},hye=ws({__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(r,{emit:i}){const y=i,B=r,Z=p.ref(!1);function C(){Z.value=!1,y("open-report",B.report)}function b(){Z.value=!1,y("renombrar",B.report.report_name||"Reporte",B.report.id)}function t(){Z.value=!1,y("edit-template",B.report)}function g(){Z.value=!1}function u(){Z.value=!1,y("eliminar",B.report)}function e(){y("download-report",B.report),Z.value=!1}function w(x){return x?x.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 v(){y("open-report",B.report)}return(x,h)=>(p.openBlock(),p.createElementBlock("div",nye,[p.createElementVNode("div",{class:"three-dots",onClick:h[0]||(h[0]=p.withModifiers(n=>Z.value=!Z.value,["stop"]))},[...h[4]||(h[4]=[p.createElementVNode("span",null,null,-1),p.createElementVNode("span",null,null,-1),p.createElementVNode("span",null,null,-1)])]),p.createElementVNode("div",aye,[r.report.template_type===1&&r.report.pages[0].type==1?(p.openBlock(),p.createBlock(pfe,{key:0,"local-team":r.localTeam,"visitor-team":r.visitorTeam,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==1?(p.openBlock(),p.createBlock(Wfe,{key:1,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):p.createCommentVNode("",!0),r.report.template_type===1&&r.report.pages[0].type==2?(p.openBlock(),p.createBlock(cme,{key:2,"local-team":r.localTeam,"visitor-team":r.visitorTeam,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==2?(p.openBlock(),p.createBlock(jme,{key:3,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):p.createCommentVNode("",!0),r.report.template_type===1&&r.report.pages[0].type==3?(p.openBlock(),p.createBlock(Qme,{key:4,"local-team":r.localTeam,"visitor-team":r.visitorTeam,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==3?(p.openBlock(),p.createBlock(_0e,{key:5,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):r.report.template_type===1&&r.report.pages[0].type==4?(p.openBlock(),p.createBlock(O0e,{key:6,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==4?(p.openBlock(),p.createBlock(rye,{key:7,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):p.createCommentVNode("",!0),p.createElementVNode("div",{class:"report-img-overlay"},[p.createElementVNode("button",{class:"report-img-button",onClick:v},"Ver reporte")])]),p.createElementVNode("div",iye,[p.createElementVNode("div",oye,[p.createElementVNode("div",sye,p.toDisplayString(r.report.report_name),1),p.createElementVNode("div",lye,[h[5]||(h[5]=p.createTextVNode(" Template: ",-1)),p.createElementVNode("span",cye,p.toDisplayString(r.report.name),1)]),p.createElementVNode("div",uye,p.toDisplayString(r.report.season_name)+" - "+p.toDisplayString(w(r.report.game.matchday_name))+"  |  "+p.toDisplayString(p.unref(Fd)(r.report.game.date_time_utc)),1),p.createElementVNode("div",dye,p.toDisplayString(r.report.tournament_name),1)])]),Z.value?(p.openBlock(),p.createBlock(Jpe,{key:0,onClick:h[1]||(h[1]=p.withModifiers(n=>Z.value=!1,["self"])),onMouseleave:h[2]||(h[2]=n=>Z.value=!1),onVerReporte:C,onRenombrar:b,onEditar:t,onDuplicar:g,onEliminar:u,onDescargar:e})):p.createCommentVNode("",!0),Z.value?(p.openBlock(),p.createElementBlock("div",{key:1,class:"tooltip-overlay",onClick:h[3]||(h[3]=n=>Z.value=!1)})):p.createCommentVNode("",!0)]))}},[["__scopeId","data-v-34e6ad47"]]),pye={class:"modal-overlay"},fye={class:"modal-content"},mye={class:"modal-body"},yye=["placeholder","disabled"],gye={key:0,class:"error-message"},vye={class:"modal-footer"},xye=["disabled"],bye=["disabled"],_ye={key:0},wye={key:1},Tye=ws({__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(r,{emit:i}){const y=r,B=i,Z=p.ref(y.initialName),C=p.ref(!1),b=p.ref("");p.watch(()=>y.initialName,g=>{Z.value=g,b.value=""});async function t(){var g;if(!(Z.value.trim().length<3)){C.value=!0,b.value="";try{await to.create({headers:{Authorization:`${y.token}`}}).put(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${y.userId}/reports/${y.reportId}/rename`,{name:Z.value.trim()}),B("rename",Z.value.trim()),B("refresh"),B("close")}catch(u){console.error("Error al renombrar el reporte:",u),((g=u.response)==null?void 0:g.status)===409?b.value="Ya existe un reporte con el mismo nombre":b.value="Error al renombrar el reporte. Inténtalo de nuevo."}finally{C.value=!1}}}return p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""}),(g,u)=>(p.openBlock(),p.createElementBlock("div",pye,[p.createElementVNode("div",fye,[p.createElementVNode("button",{class:"close-btn",onClick:u[0]||(u[0]=e=>g.$emit("close"))},[...u[3]||(u[3]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),u[5]||(u[5]=p.createElementVNode("div",{class:"modal-header"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename-white.svg",class:"icon-title",alt:"icon"}),p.createElementVNode("span",{class:"modal-title"},"Renombrar Reporte")],-1)),u[6]||(u[6]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",mye,[u[4]||(u[4]=p.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),p.withDirectives(p.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":u[1]||(u[1]=e=>Z.value=e),placeholder:r.initialName,maxlength:"40",autocomplete:"off",disabled:C.value},null,8,yye),[[p.vModelText,Z.value]]),b.value?(p.openBlock(),p.createElementBlock("div",gye,p.toDisplayString(b.value),1)):p.createCommentVNode("",!0)]),u[7]||(u[7]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",vye,[p.createElementVNode("button",{class:"cancel-btn",onClick:u[2]||(u[2]=e=>g.$emit("close")),disabled:C.value},"Cancelar",8,xye),p.createElementVNode("button",{class:"next-btn",disabled:Z.value.trim().length<3||C.value,onClick:t},[C.value?(p.openBlock(),p.createElementBlock("span",_ye,"Guardando...")):(p.openBlock(),p.createElementBlock("span",wye,"Guardar"))],8,bye)])])]))}},[["__scopeId","data-v-a6ea9581"]]),kye={class:"modal-overlay"},Sye={class:"modal-content"},Eye={class:"modal-footer"},Aye=["disabled"],Cye=["disabled"],Mye=ws({__name:"ModalDeleteReport",props:{reportId:{type:String,required:!0},userId:{type:String,required:!0},token:{type:String,required:!0}},emits:["close","delete","reportDeleted"],setup(r,{emit:i}){const y=r,B=i,Z=p.ref(!1),C=async()=>{try{Z.value=!0;const t=await to.create({headers:{Authorization:`${y.token}`}}).delete(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${y.userId}/reports/${y.reportId}`);B("reportDeleted",y.reportId),B("close")}catch(b){console.error("Error al eliminar el reporte:",b),alert("Error al eliminar el reporte. Por favor, intenta de nuevo.")}finally{Z.value=!1}};return p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""}),(b,t)=>(p.openBlock(),p.createElementBlock("div",kye,[p.createElementVNode("div",Sye,[p.createElementVNode("button",{class:"close-btn",onClick:t[0]||(t[0]=g=>b.$emit("close"))},[...t[2]||(t[2]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),t[3]||(t[3]=p.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)),p.createElementVNode("div",Eye,[p.createElementVNode("button",{class:"cancel-btn",onClick:t[1]||(t[1]=g=>b.$emit("close")),disabled:Z.value},"Cancelar",8,Aye),p.createElementVNode("button",{class:"delete-btn",onClick:C,disabled:Z.value},p.toDisplayString(Z.value?"Eliminando...":"Eliminar"),9,Cye)])])]))}},[["__scopeId","data-v-2bd7ac3a"]]),Pye={class:"reports-header"},Iye={class:"count"},Nye={key:0,class:"sort-options"},Oye=["onClick"],Lye={key:0,class:"checkmark"},Rye={key:0,class:"loading-state"},zye={key:1,class:"error-state"},Dye={key:3,class:"empty-reports"},Bye={key:4,class:"empty-reports"},Vye=ws({__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(r,{emit:i}){const y=r,B=i,Z=p.ref([]),C=p.ref(!1),b=p.ref(null),t=p.computed(()=>{let V=Z.value;if(y.searchQuery.trim()){const U=y.searchQuery.toLowerCase().trim();V=Z.value.filter(q=>{var re,ee,K,te,ie,oe,he;return!!((((re=q.report_name)==null?void 0:re.toLowerCase())||"").includes(U)||(((ee=q.name)==null?void 0:ee.toLowerCase())||"").includes(U)||q.created_at&&new Date(q.created_at).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(U)||(K=q.game)!=null&&K.date_time_utc&&new Date(q.game.date_time_utc).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(U)||(((ie=(te=q.game)==null?void 0:te.season_name)==null?void 0:ie.toLowerCase())||"").includes(U)||(((oe=q.tournament_name)==null?void 0:oe.toLowerCase())||"").includes(U)||(he=q.game)!=null&&he.matchday&&q.game.matchday.toString().includes(U))})}return u.value&&(V=[...V].sort((U,q)=>{var W,Y;if(u.value==="A - Z"){const ne=(U.report_name||"").toLowerCase(),X=(q.report_name||"").toLowerCase();return ne.localeCompare(X,"es",{sensitivity:"base"})}else if(u.value==="Más recientes"){const ne=new Date(U.created_at||0);return new Date(q.created_at||0)-ne}else if(u.value==="Torneo"){const ne=(U.tournament_name||"").toLowerCase(),X=(q.tournament_name||"").toLowerCase();if(ne!==X)return ne.localeCompare(X,"es",{sensitivity:"base"});const re=U.season_id||0;return(q.season_id||0)-re}else if(u.value==="Jornada"){const ne=((W=U.game)==null?void 0:W.matchday_id)||0,X=((Y=q.game)==null?void 0:Y.matchday_id)||0;return ne-X}return 0})),V}),g=p.ref(!1),u=p.ref("Más recientes"),e=p.ref(!1),w=p.ref(""),v=p.ref(""),x=p.ref(""),h=p.ref(!1),n=p.ref(""),a=p.ref(""),d=p.ref(null),s=p.ref(null),c=p.ref(null),f=p.ref(0),m=[{label:"A - Z",value:"A - Z"},{label:"Más recientes",value:"Más recientes"},{label:"Torneo",value:"Torneo"},{label:"Jornada",value:"Jornada"}],k=async()=>{C.value=!0,b.value=null;try{const V=await to.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${y.userId}/reports`,{headers:{Authorization:`${y.token}`,"Content-Type":"application/json"}});V.data&&Array.isArray(V.data)?Z.value=V.data:V.data&&V.data.reports?Z.value=V.data.reports:V.data&&V.data.data?Z.value=V.data.data:Z.value=[]}catch(V){console.error("Error cargando reportes:",V),console.error("Error response:",V.response),b.value=V.message||"Error al cargar los reportes",Z.value=[]}finally{C.value=!1}},E=p.computed(()=>{if(!f.value)return"grid-1-column";const V=340,U=20,W=f.value-40,Y=Math.floor((W+U)/(V+U)),ne=Math.max(1,Y);return ne>=4?"grid-4-columns":ne>=3?"grid-3-columns":ne>=2?"grid-2-columns":"grid-1-column"}),S=()=>{g.value=!g.value},P=V=>{u.value=V,g.value=!1};function I(V){B("open-report",V)}const A=(V,U)=>{w.value=V,v.value=U;const q=Z.value.find(W=>W.id===U);x.value=q?q.template_type:"",e.value=!0},N=V=>{e.value=!1;const U=Z.value.findIndex(q=>q.id===v.value);U!==-1&&(Z.value[U].report_name=V)},M=V=>{n.value=V.report_name||"Reporte",a.value=V.id,h.value=!0},T=V=>{h.value=!1,Z.value=Z.value.filter(U=>U.id!==V)};function O(V){B("download-report",V)}const _=V=>{g.value&&d.value&&!d.value.contains(V.target)&&(g.value=!1)},L=()=>{s.value&&(f.value=s.value.offsetWidth)};let z=null;return p.onMounted(async()=>{document.addEventListener("mousedown",_),await k(),await p.nextTick(),L(),window.ResizeObserver?(z=new ResizeObserver(()=>{L()}),s.value&&z.observe(s.value)):window.addEventListener("resize",L)}),p.onBeforeUnmount(()=>{document.removeEventListener("mousedown",_),z?z.disconnect():window.removeEventListener("resize",L)}),(V,U)=>(p.openBlock(),p.createElementBlock("div",{class:"reports-section",ref_key:"reportsSectionRef",ref:s},[p.createElementVNode("div",Pye,[p.createElementVNode("span",null,[U[2]||(U[2]=p.createTextVNode("Reportes ",-1)),p.createElementVNode("span",Iye,"("+p.toDisplayString(t.value.length)+")",1)]),p.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:d},[p.createElementVNode("button",{class:"sort-button",onClick:S},[p.createTextVNode(p.toDisplayString(u.value||"Ordenar")+" ",1),p.createElementVNode("span",{class:p.normalizeClass(["dropdown-arrow",{rotated:g.value}])},null,2)]),g.value?(p.openBlock(),p.createElementBlock("div",Nye,[(p.openBlock(),p.createElementBlock(p.Fragment,null,p.renderList(m,q=>p.createElementVNode("div",{key:q.value,class:p.normalizeClass(["sort-option",{selected:u.value===q.value}]),onClick:W=>u.value!==q.value&&P(q.value)},[p.createElementVNode("span",null,p.toDisplayString(q.label),1),u.value===q.value?(p.openBlock(),p.createElementBlock("span",Lye,[...U[3]||(U[3]=[p.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)],10,Oye)),64))])):p.createCommentVNode("",!0)],512)]),C.value?(p.openBlock(),p.createElementBlock("div",Rye,[...U[4]||(U[4]=[p.createElementVNode("div",{class:"loading-spinner"},null,-1),p.createElementVNode("p",null,"Cargando reportes...",-1)])])):b.value?(p.openBlock(),p.createElementBlock("div",zye,[p.createElementVNode("p",null,"Error al cargar reportes: "+p.toDisplayString(b.value),1),p.createElementVNode("button",{onClick:k,class:"retry-button"},"Reintentar")])):(p.openBlock(),p.createElementBlock("div",{key:2,class:p.normalizeClass(["reports-grid",E.value]),ref_key:"reportsGridRef",ref:c},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.value,q=>(p.openBlock(),p.createBlock(hye,{key:q.id,report:q,onOpenReport:I,onRenombrar:A,onEliminar:M,onDownloadReport:O},null,8,["report"]))),128))],2)),!C.value&&!b.value&&Z.value.length===0?(p.openBlock(),p.createElementBlock("div",Dye," No tienes reportes aún. ")):p.createCommentVNode("",!0),!C.value&&!b.value&&Z.value.length>0&&t.value.length===0?(p.openBlock(),p.createElementBlock("div",Bye," No se encontraron reportes que coincidan con tu búsqueda. ")):p.createCommentVNode("",!0),e.value?(p.openBlock(),p.createBlock(Tye,{key:5,initialName:w.value,templateType:x.value,token:r.token,userId:r.userId,reportId:v.value,onClose:U[0]||(U[0]=q=>e.value=!1),onRename:N,onRefresh:k},null,8,["initialName","templateType","token","userId","reportId"])):p.createCommentVNode("",!0),h.value?(p.openBlock(),p.createBlock(Mye,{key:6,"report-id":a.value,"user-id":r.userId,token:r.token,onClose:U[1]||(U[1]=q=>h.value=!1),onReportDeleted:T},null,8,["report-id","user-id","token"])):p.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-d40008f8"]]),jye={class:"modal-overlay"},Fye={class:"modal-content"},Uye=ws({__name:"ModalSoloEscritorio",setup(r){return(i,y)=>(p.openBlock(),p.createElementBlock("div",jye,[p.createElementVNode("div",Fye,[y[1]||(y[1]=p.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)),p.createElementVNode("button",{class:"modal-btn",onClick:y[0]||(y[0]=B=>i.$emit("toHome"))},"OK")])]))}},[["__scopeId","data-v-76d7f6ed"]]),qye={class:"top-bar"},Wye={class:"tabs-container"},Gye={class:"tabs"},Hye={key:0,class:"actions"},Xye={class:"search-container"},Jye={key:1,class:"actions"},Zye={class:"search-container"},Kye=ws({__name:"gsc-reports",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0}},emits:["toHome","download-report"],setup(r,{emit:i}){const y=r,{userId:B,team:Z,token:C}=y,b=p.ref("templates"),t=p.ref(!1),g=p.ref(null),u=p.ref(!1),e=p.ref(""),w=p.ref(""),v=p.ref(null),x=p.ref(null),h=p.ref(0),n=i;function a(){if(g.value){const P=g.value.offsetWidth;t.value=P<1028}}p.watch(t,P=>{P?document.body.style.overflow="hidden":document.body.style.overflow=""}),p.onBeforeUnmount(()=>{document.body.style.overflow=""}),p.onMounted(()=>{a(),window.addEventListener("resize",a)}),p.onBeforeUnmount(()=>{window.removeEventListener("resize",a)});function d(P){s(P)}function s(P){v.value.show({template:P,isTemplateMode:!0})}const c=()=>{e.value=""},f=()=>{w.value=""};function m(P){v.value&&v.value.show({template:P,isTemplateMode:!1})}function k(P){n("download-report",P)}function E(){n("toHome")}function S(){x.value&&x.value.obtenerTemplates(),h.value+=1}return(P,I)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(p.unref(Iue),{ref_key:"reportTemplateMaker",ref:v,token:p.unref(C),"user-team-id":p.unref(Z),onClose:S},null,8,["token","user-team-id"]),p.createElementVNode("div",{ref_key:"containerRef",ref:g,class:"reports-container"},[t.value?(p.openBlock(),p.createBlock(Uye,{key:0,onToHome:E})):p.createCommentVNode("",!0),I[12]||(I[12]=p.createElementVNode("h1",{class:"title"},"Mis reportes",-1)),p.createElementVNode("div",qye,[p.createElementVNode("div",Wye,[p.createElementVNode("div",Gye,[p.createElementVNode("div",{class:p.normalizeClass(["tab tab-templates",{active:b.value==="templates"}]),onClick:I[0]||(I[0]=A=>b.value="templates")}," Templates ",2),p.createElementVNode("div",{class:p.normalizeClass(["tab tab-reports",{active:b.value==="reports"}]),onClick:I[1]||(I[1]=A=>b.value="reports")}," Tus reportes ",2)])]),b.value==="templates"?(p.openBlock(),p.createElementBlock("div",Hye,[p.createElementVNode("div",Xye,[I[8]||(I[8]=p.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":I[2]||(I[2]=A=>e.value=A),class:"search",type:"text",placeholder:"Buscar template"},null,512),[[p.vModelText,e.value]]),e.value?(p.openBlock(),p.createElementBlock("button",{key:0,onClick:c,class:"clear-search-btn",type:"button"},[...I[7]||(I[7]=[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)]),p.createElementVNode("button",{class:"create-template-btn",onClick:I[3]||(I[3]=A=>u.value=!0)},[...I[9]||(I[9]=[p.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-agregar@3x.png",alt:"Agregar",class:"create-icon"},null,-1),p.createTextVNode(" Crear template ",-1)])])])):p.createCommentVNode("",!0),b.value==="reports"?(p.openBlock(),p.createElementBlock("div",Jye,[p.createElementVNode("div",Zye,[I[11]||(I[11]=p.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":I[4]||(I[4]=A=>w.value=A),class:"search search-reports",type:"text",placeholder:"Buscar reporte"},null,512),[[p.vModelText,w.value]]),w.value?(p.openBlock(),p.createElementBlock("button",{key:0,onClick:f,class:"clear-search-btn",type:"button"},[...I[10]||(I[10]=[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)])])):p.createCommentVNode("",!0)]),b.value==="templates"?(p.openBlock(),p.createBlock(Hpe,{ref_key:"templatesSectionRef",ref:x,userId:p.unref(B),token:p.unref(C),team:p.unref(Z),searchQuery:e.value,key:h.value,onSwitchToReports:I[5]||(I[5]=A=>b.value="reports"),onOpenModalNewTemplate:d,onEditTemplate:s},null,8,["userId","token","team","searchQuery"])):(p.openBlock(),p.createBlock(Vye,{key:2,userId:p.unref(B),token:p.unref(C),team:p.unref(Z),searchQuery:w.value,onOpenReport:m,onDownloadReport:k},null,8,["userId","token","team","searchQuery"])),u.value?(p.openBlock(),p.createBlock(xT,{key:3,token:p.unref(C),team:p.unref(Z),onOpenModalNewTemplate:d,onClose:I[6]||(I[6]=A=>u.value=!1)},null,8,["token","team"])):p.createCommentVNode("",!0)],512)],64))}},[["__scopeId","data-v-9ffb4e12"]]),Yye={class:"subcategory-group"},Qye={__name:"SubcategoryGroup",props:{subcategoryGroup:{type:Array,default:()=>[]}},setup(r){return(i,y)=>(p.openBlock(),p.createElementBlock("div",Yye,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(r.subcategoryGroup,B=>(p.openBlock(),p.createBlock(p.unref(K1),{key:B.id,modelValue:B.isSelected,"onUpdate:modelValue":Z=>B.isSelected=Z,label:B.name},null,8,["modelValue","onUpdate:modelValue","label"]))),128))]))}},$ye=nu(Qye,[["__scopeId","data-v-ae6f3d72"]]),ege={class:"filter-subcategories"},tge=Object.freeze(Object.defineProperty({__proto__:null,default:nu({__name:"FilterSubcategories",props:{subcategoryGroups:{type:Array,default:()=>[]}},setup(r){return(i,y)=>(p.openBlock(),p.createElementBlock("div",ege,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(r.subcategoryGroups,B=>(p.openBlock(),p.createElementBlock("div",{key:B.id,class:"filter-subcategories__group"},[p.createVNode($ye,{subcategoryGroup:B},null,8,["subcategoryGroup"])]))),128))]))}},[["__scopeId","data-v-5edaefc2"]])},Symbol.toStringTag,{value:"Module"})),gg=r=>(p.pushScopeId("data-v-80d9c265"),r=r(),p.popScopeId(),r),rge={class:"details__header"},nge=gg(()=>p.createElementVNode("div",{class:"details__header__title"},"Jugando como",-1)),age={class:"details__header__checkbox"},ige={class:"details__body"},oge={class:"details__body__playing-as"},sge=["onClick"],lge={class:"details__header"},cge=gg(()=>p.createElementVNode("div",{class:"details__header__title"},"En: (Elige el lapso de tiempo)",-1)),uge={class:"details__header__checkbox"},dge={class:"details__body"},hge=gg(()=>p.createElementVNode("div",{class:"details__body__title"},"1er tiempo",-1)),pge={class:"details__body__game-section"},fge=["onClick"],mge={class:"details__body"},yge=gg(()=>p.createElementVNode("div",{class:"details__body__title"},"2do tiempo",-1)),gge={class:"details__body__game-section"},vge=["onClick"],xge=Object.freeze(Object.defineProperty({__proto__:null,default:nu({__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(r){const i=r;p.useCssVars(e=>({"49cba245":r.buttonsBackgroundColor,"52f02da6":r.buttonsTextColor,"7d3f686a":r.buttonsBorderWidth,"7c286a07":r.buttonsBorderColor,"24a6f4aa":r.buttonsBackgroundColorActive,cd8d7768:r.buttonsTextColorActive,"35fa5c10":r.buttonsBorderWidthActive,"0cde1826":r.buttonsBorderColorActive}));const y=p.computed(()=>i.playingAs.every(e=>e.isSelected)),B=p.computed(()=>i.gameSections.every(e=>e.isSelected)),Z=p.computed(()=>i.gameSections.reduce((e,w)=>(w.value<=3?e.firstHalf.push(w):e.secondHalf.push(w),e),{firstHalf:[],secondHalf:[]})),C=p.computed(()=>({"--border-radius-first-button":`${i.buttonsBorderRadius} 0 0 ${i.buttonsBorderRadius}`,"--border-radius-last-button":`0 ${i.buttonsBorderRadius} ${i.buttonsBorderRadius} 0`}));function b(e){e?i.playingAs.forEach(w=>{w.isSelected=!0}):i.playingAs.forEach((w,v)=>{w.isSelected=v===0})}function t(e){i.playingAs.filter(w=>w.isSelected).length===1&&e.isSelected||(e.isSelected=!e.isSelected)}function g(e){i.gameSections.filter(w=>w.isSelected).length===1&&e.isSelected||(e.isSelected=!e.isSelected)}function u(e){e?i.gameSections.forEach(w=>{w.isSelected=!0}):i.gameSections.forEach((w,v)=>{w.isSelected=v===0})}return(e,w)=>(p.openBlock(),p.createElementBlock("div",{class:"details",style:p.normalizeStyle(C.value)},[p.createElementVNode("div",rge,[nge,p.createElementVNode("div",age,[p.createVNode(p.unref(K1),{label:"Todos","model-value":y.value,"onUpdate:modelValue":b},null,8,["model-value"])])]),p.createElementVNode("div",ige,[p.createElementVNode("div",oge,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(i.playingAs,(v,x)=>(p.openBlock(),p.createElementBlock("div",{key:`pa${x}`,class:p.normalizeClass(["details__body__button",{active:v.isSelected}]),onClick:h=>t(v)},p.toDisplayString(v.name),11,sge))),128))])]),p.createElementVNode("div",lge,[cge,p.createElementVNode("div",uge,[p.createVNode(p.unref(K1),{label:"Todos","model-value":B.value,"onUpdate:modelValue":u},null,8,["model-value"])])]),p.createElementVNode("div",dge,[hge,p.createElementVNode("div",pge,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(Z.value.firstHalf,(v,x)=>(p.openBlock(),p.createElementBlock("div",{key:`pa${x}`,class:p.normalizeClass(["details__body__button",{active:v.isSelected}]),onClick:h=>g(v)},p.toDisplayString(v.text),11,fge))),128))])]),p.createElementVNode("div",mge,[yge,p.createElementVNode("div",gge,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(Z.value.secondHalf,(v,x)=>(p.openBlock(),p.createElementBlock("div",{key:`pa${x}`,class:p.normalizeClass(["details__body__button",{active:v.isSelected}]),onClick:h=>g(v)},p.toDisplayString(v.text),11,vge))),128))])])],4))}},[["__scopeId","data-v-80d9c265"]])},Symbol.toStringTag,{value:"Module"})),bge={class:"filter-field"},_ge=Object.freeze(Object.defineProperty({__proto__:null,default:nu({__name:"FilterField",setup(r){const i=p.ref(Array.from({length:16},(B,Z)=>Z+1));function y(){}return(B,Z)=>(p.openBlock(),p.createElementBlock("div",bge,[p.createVNode(p.unref(jO),{width:"100%","background-color":"#2E3B46",value:i.value,"onUpdate:modelValue":y},null,8,["value"])]))}},[["__scopeId","data-v-8103c3e1"]])},Symbol.toStringTag,{value:"Module"}));Ah.GSCReports=Kye,Object.defineProperty(Ah,Symbol.toStringTag,{value:"Module"})}));