@golstats/gsc-landing 1.0.164 → 1.0.165
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gsc-landing.js +7 -7
- package/dist/gsc-landing.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/gsc-landing.umd.cjs
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const a=new this(e);return t.forEach(i=>a.set(i)),a}static accessor(e){const t=(this[lm]=this[lm]={accessors:{}}).accessors,a=this.prototype;function i(o){const r=ba(o);t[r]||(mR(a,o),t[r]=!0)}return P.isArray(e)?e.forEach(i):i(e),this}}vn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),P.reduceDescriptors(vn.prototype,({value:s},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>s,set(a){this[t]=a}}}),P.freezeMethods(vn);const Nt=vn;function Ar(s,e){const t=this||xr,a=e||t,i=Nt.from(a.headers);let o=a.data;return P.forEach(s,function(r){o=r.call(t,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function cm(s){return!!(s&&s.__CANCEL__)}function Fs(s,e,t){_e.call(this,s??"canceled",_e.ERR_CANCELED,e,t),this.name="CanceledError"}P.inherits(Fs,_e,{__CANCEL__:!0});function dm(s,e,t){const a=t.config.validateStatus;!t.status||!a||a(t.status)?s(t):e(new _e("Request failed with status code "+t.status,[_e.ERR_BAD_REQUEST,_e.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function fR(s){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return e&&e[1]||""}function pR(s,e){s=s||10;const t=new Array(s),a=new Array(s);let i=0,o=0,r;return e=e!==void 0?e:1e3,function(l){const d=Date.now(),c=a[o];r||(r=d),t[i]=l,a[i]=d;let h=o,u=0;for(;h!==i;)u+=t[h++],h=h%s;if(i=(i+1)%s,i===o&&(o=(o+1)%s),d-r<e)return;const f=c&&d-c;return f?Math.round(u*1e3/f):void 0}}function gR(s,e){let t=0,a=1e3/e,i,o;const r=(l,d=Date.now())=>{t=d,i=null,o&&(clearTimeout(o),o=null),s.apply(null,l)};return[(...l)=>{const d=Date.now(),c=d-t;c>=a?r(l,d):(i=l,o||(o=setTimeout(()=>{o=null,r(i)},a-c)))},()=>i&&r(i)]}const An=(s,e,t=3)=>{let a=0;const i=pR(50,250);return gR(o=>{const r=o.loaded,l=o.lengthComputable?o.total:void 0,d=r-a,c=i(d),h=r<=l;a=r;const u={loaded:r,total:l,progress:l?r/l:void 0,bytes:d,rate:c||void 0,estimated:c&&l&&h?(l-r)/c:void 0,event:o,lengthComputable:l!=null,[e?"download":"upload"]:!0};s(u)},t)},hm=(s,e)=>{const t=s!=null;return[a=>e[0]({lengthComputable:t,total:s,loaded:a}),e[1]]},um=s=>(...e)=>P.asap(()=>s(...e)),yR=gt.hasStandardBrowserEnv?function(){const s=gt.navigator&&/(msie|trident)/i.test(gt.navigator.userAgent),e=document.createElement("a");let t;function a(i){let o=i;return s&&(e.setAttribute("href",o),o=e.href),e.setAttribute("href",o),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return t=a(window.location.href),function(i){const o=P.isString(i)?a(i):i;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}(),bR=gt.hasStandardBrowserEnv?{write(s,e,t,a,i,o){const r=[s+"="+encodeURIComponent(e)];P.isNumber(t)&&r.push("expires="+new Date(t).toGMTString()),P.isString(a)&&r.push("path="+a),P.isString(i)&&r.push("domain="+i),o===!0&&r.push("secure"),document.cookie=r.join("; ")},read(s){const e=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(s){this.write(s,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function SR(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function wR(s,e){return e?s.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):s}function mm(s,e){return s&&!SR(e)?wR(s,e):e}const fm=s=>s instanceof Nt?{...s}:s;function ws(s,e){e=e||{};const t={};function a(c,h,u){return P.isPlainObject(c)&&P.isPlainObject(h)?P.merge.call({caseless:u},c,h):P.isPlainObject(h)?P.merge({},h):P.isArray(h)?h.slice():h}function i(c,h,u){if(P.isUndefined(h)){if(!P.isUndefined(c))return a(void 0,c,u)}else return a(c,h,u)}function o(c,h){if(!P.isUndefined(h))return a(void 0,h)}function r(c,h){if(P.isUndefined(h)){if(!P.isUndefined(c))return a(void 0,c)}else return a(void 0,h)}function l(c,h,u){if(u in e)return a(c,h);if(u in s)return a(void 0,c)}const d={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:l,headers:(c,h)=>i(fm(c),fm(h),!0)};return P.forEach(Object.keys(Object.assign({},s,e)),function(c){const h=d[c]||i,u=h(s[c],e[c],c);P.isUndefined(u)&&h!==l||(t[c]=u)}),t}const pm=s=>{const e=ws({},s);let{data:t,withXSRFToken:a,xsrfHeaderName:i,xsrfCookieName:o,headers:r,auth:l}=e;e.headers=r=Nt.from(r),e.url=nm(mm(e.baseURL,e.url),s.params,s.paramsSerializer),l&&r.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let d;if(P.isFormData(t)){if(gt.hasStandardBrowserEnv||gt.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if((d=r.getContentType())!==!1){const[c,...h]=d?d.split(";").map(u=>u.trim()).filter(Boolean):[];r.setContentType([c||"multipart/form-data",...h].join("; "))}}if(gt.hasStandardBrowserEnv&&(a&&P.isFunction(a)&&(a=a(e)),a||a!==!1&&yR(e.url))){const c=i&&o&&bR.read(o);c&&r.set(i,c)}return e},_R=typeof XMLHttpRequest<"u",kR=_R&&function(s){return new Promise(function(e,t){const a=pm(s);let i=a.data;const o=Nt.from(a.headers).normalize();let{responseType:r,onUploadProgress:l,onDownloadProgress:d}=a,c,h,u,f,p;function m(){f&&f(),p&&p(),a.cancelToken&&a.cancelToken.unsubscribe(c),a.signal&&a.signal.removeEventListener("abort",c)}let g=new XMLHttpRequest;g.open(a.method.toUpperCase(),a.url,!0),g.timeout=a.timeout;function y(){if(!g)return;const S=Nt.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),_={data:!r||r==="text"||r==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:S,config:s,request:g};dm(function(C){e(C),m()},function(C){t(C),m()},_),g=null}"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(y)},g.onabort=function(){g&&(t(new _e("Request aborted",_e.ECONNABORTED,s,g)),g=null)},g.onerror=function(){t(new _e("Network Error",_e.ERR_NETWORK,s,g)),g=null},g.ontimeout=function(){let S=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const _=a.transitional||om;a.timeoutErrorMessage&&(S=a.timeoutErrorMessage),t(new _e(S,_.clarifyTimeoutError?_e.ETIMEDOUT:_e.ECONNABORTED,s,g)),g=null},i===void 0&&o.setContentType(null),"setRequestHeader"in g&&P.forEach(o.toJSON(),function(S,_){g.setRequestHeader(_,S)}),P.isUndefined(a.withCredentials)||(g.withCredentials=!!a.withCredentials),r&&r!=="json"&&(g.responseType=a.responseType),d&&([u,p]=An(d,!0),g.addEventListener("progress",u)),l&&g.upload&&([h,f]=An(l),g.upload.addEventListener("progress",h),g.upload.addEventListener("loadend",f)),(a.cancelToken||a.signal)&&(c=S=>{g&&(t(!S||S.type?new Fs(null,s,g):S),g.abort(),g=null)},a.cancelToken&&a.cancelToken.subscribe(c),a.signal&&(a.signal.aborted?c():a.signal.addEventListener("abort",c)));const b=fR(a.url);if(b&>.protocols.indexOf(b)===-1){t(new _e("Unsupported protocol "+b+":",_e.ERR_BAD_REQUEST,s));return}g.send(i||null)})},ER=(s,e)=>{let t=new AbortController,a;const i=function(d){if(!a){a=!0,r();const c=d instanceof Error?d:this.reason;t.abort(c instanceof _e?c:new Fs(c instanceof Error?c.message:c))}};let o=e&&setTimeout(()=>{i(new _e(`timeout ${e} of ms exceeded`,_e.ETIMEDOUT))},e);const r=()=>{s&&(o&&clearTimeout(o),o=null,s.forEach(d=>{d&&(d.removeEventListener?d.removeEventListener("abort",i):d.unsubscribe(i))}),s=null)};s.forEach(d=>d&&d.addEventListener&&d.addEventListener("abort",i));const{signal:l}=t;return l.unsubscribe=r,[l,()=>{o&&clearTimeout(o),o=null}]},TR=ER,CR=function*(s,e){let t=s.byteLength;if(t<e){yield s;return}let a=0,i;for(;a<t;)i=a+e,yield s.slice(a,i),a=i},xR=async function*(s,e,t){for await(const a of s)yield*CR(ArrayBuffer.isView(a)?a:await t(String(a)),e)},gm=(s,e,t,a,i)=>{const o=xR(s,e,i);let r=0,l,d=c=>{l||(l=!0,a&&a(c))};return new ReadableStream({async pull(c){try{const{done:h,value:u}=await o.next();if(h){d(),c.close();return}let f=u.byteLength;if(t){let p=r+=f;t(p)}c.enqueue(new Uint8Array(u))}catch(h){throw d(h),h}},cancel(c){return d(c),o.return()}},{highWaterMark:2})},Ln=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ym=Ln&&typeof ReadableStream=="function",Lr=Ln&&(typeof TextEncoder=="function"?(s=>e=>s.encode(e))(new TextEncoder):async s=>new Uint8Array(await new Response(s).arrayBuffer())),bm=(s,...e)=>{try{return!!s(...e)}catch{return!1}},vR=ym&&bm(()=>{let s=!1;const e=new Request(gt.origin,{body:new ReadableStream,method:"POST",get duplex(){return s=!0,"half"}}).headers.has("Content-Type");return s&&!e}),Sm=64*1024,Ir=ym&&bm(()=>P.isReadableStream(new Response("").body)),In={stream:Ir&&(s=>s.body)};Ln&&(s=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!In[e]&&(In[e]=P.isFunction(s[e])?t=>t[e]():(t,a)=>{throw new _e(`Response type '${e}' is not supported`,_e.ERR_NOT_SUPPORT,a)})})})(new Response);const AR=async s=>{if(s==null)return 0;if(P.isBlob(s))return s.size;if(P.isSpecCompliantForm(s))return(await new Request(s).arrayBuffer()).byteLength;if(P.isArrayBufferView(s)||P.isArrayBuffer(s))return s.byteLength;if(P.isURLSearchParams(s)&&(s=s+""),P.isString(s))return(await Lr(s)).byteLength},LR=async(s,e)=>P.toFiniteNumber(s.getContentLength())??AR(e),IR=Ln&&(async s=>{let{url:e,method:t,data:a,signal:i,cancelToken:o,timeout:r,onDownloadProgress:l,onUploadProgress:d,responseType:c,headers:h,withCredentials:u="same-origin",fetchOptions:f}=pm(s);c=c?(c+"").toLowerCase():"text";let[p,m]=i||o||r?TR([i,o],r):[],g,y;const b=()=>{!g&&setTimeout(()=>{p&&p.unsubscribe()}),g=!0};let S;try{if(d&&vR&&t!=="get"&&t!=="head"&&(S=await LR(h,a))!==0){let T=new Request(e,{method:"POST",body:a,duplex:"half"}),B;if(P.isFormData(a)&&(B=T.headers.get("content-type"))&&h.setContentType(B),T.body){const[L,R]=hm(S,An(um(d)));a=gm(T.body,Sm,L,R,Lr)}}P.isString(u)||(u=u?"include":"omit");const _="credentials"in Request.prototype;y=new Request(e,{...f,signal:p,method:t.toUpperCase(),headers:h.normalize().toJSON(),body:a,duplex:"half",credentials:_?u:void 0});let C=await fetch(y);const E=Ir&&(c==="stream"||c==="response");if(Ir&&(l||E)){const T={};["status","statusText","headers"].forEach($=>{T[$]=C[$]});const B=P.toFiniteNumber(C.headers.get("content-length")),[L,R]=l&&hm(B,An(um(l),!0))||[];C=new Response(gm(C.body,Sm,L,()=>{R&&R(),E&&b()},Lr),T)}c=c||"text";let v=await In[P.findKey(In,c)||"text"](C,s);return!E&&b(),m&&m(),await new Promise((T,B)=>{dm(T,B,{data:v,headers:Nt.from(C.headers),status:C.status,statusText:C.statusText,config:s,request:y})})}catch(_){throw b(),_&&_.name==="TypeError"&&/fetch/i.test(_.message)?Object.assign(new _e("Network Error",_e.ERR_NETWORK,s,y),{cause:_.cause||_}):_e.from(_,_&&_.code,s,y)}}),Rr={http:HI,xhr:kR,fetch:IR};P.forEach(Rr,(s,e)=>{if(s){try{Object.defineProperty(s,"name",{value:e})}catch{}Object.defineProperty(s,"adapterName",{value:e})}});const wm=s=>`- ${s}`,RR=s=>P.isFunction(s)||s===null||s===!1,_m={getAdapter:s=>{s=P.isArray(s)?s:[s];const{length:e}=s;let t,a;const i={};for(let o=0;o<e;o++){t=s[o];let r;if(a=t,!RR(t)&&(a=Rr[(r=String(t)).toLowerCase()],a===void 0))throw new _e(`Unknown adapter '${r}'`);if(a)break;i[r||"#"+o]=a}if(!a){const o=Object.entries(i).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build"));let r=e?o.length>1?`since :
|
|
40
40
|
`+o.map(wm).join(`
|
|
41
41
|
`):" "+wm(o[0]):"as no adapter specified";throw new _e("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return a},adapters:Rr};function Br(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new Fs(null,s)}function km(s){return Br(s),s.headers=Nt.from(s.headers),s.data=Ar.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),_m.getAdapter(s.adapter||xr.adapter)(s).then(function(e){return Br(s),e.data=Ar.call(s,s.transformResponse,e),e.headers=Nt.from(e.headers),e},function(e){return cm(e)||(Br(s),e&&e.response&&(e.response.data=Ar.call(s,s.transformResponse,e.response),e.response.headers=Nt.from(e.response.headers))),Promise.reject(e)})}const Em="1.7.5",Nr={};["object","boolean","number","function","string","symbol"].forEach((s,e)=>{Nr[s]=function(t){return typeof t===s||"a"+(e<1?"n ":" ")+s}});const Tm={};Nr.transitional=function(s,e,t){function a(i,o){return"[Axios v"+Em+"] Transitional option '"+i+"'"+o+(t?". "+t:"")}return(i,o,r)=>{if(s===!1)throw new _e(a(o," has been removed"+(e?" in "+e:"")),_e.ERR_DEPRECATED);return e&&!Tm[o]&&(Tm[o]=!0,console.warn(a(o," has been deprecated since v"+e+" and will be removed in the near future"))),s?s(i,o,r):!0}};function BR(s,e,t){if(typeof s!="object")throw new _e("options must be an object",_e.ERR_BAD_OPTION_VALUE);const a=Object.keys(s);let i=a.length;for(;i-- >0;){const o=a[i],r=e[o];if(r){const l=s[o],d=l===void 0||r(l,o,s);if(d!==!0)throw new _e("option "+o+" must be "+d,_e.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new _e("Unknown option "+o,_e.ERR_BAD_OPTION)}}const Dr={assertOptions:BR,validators:Nr},os=Dr.validators;class Rn{constructor(e){this.defaults=e,this.interceptors={request:new im,response:new im}}async request(e,t){try{return await this._request(e,t)}catch(a){if(a instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{a.stack?o&&!String(a.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(a.stack+=`
|
|
42
|
-
`+o):a.stack=o}catch{}}throw a}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=ws(this.defaults,t);const{transitional:a,paramsSerializer:i,headers:o}=t;a!==void 0&&Dr.assertOptions(a,{silentJSONParsing:os.transitional(os.boolean),forcedJSONParsing:os.transitional(os.boolean),clarifyTimeoutError:os.transitional(os.boolean)},!1),i!=null&&(P.isFunction(i)?t.paramsSerializer={serialize:i}:Dr.assertOptions(i,{encode:os.function,serialize:os.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let r=o&&P.merge(o.common,o[t.method]);o&&P.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),t.headers=Nt.concat(r,o);const l=[];let d=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(t)===!1||(d=d&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let h,u=0,f;if(!d){const m=[km.bind(this),void 0];for(m.unshift.apply(m,l),m.push.apply(m,c),f=m.length,h=Promise.resolve(t);u<f;)h=h.then(m[u++],m[u++]);return h}f=l.length;let p=t;for(u=0;u<f;){const m=l[u++],g=l[u++];try{p=m(p)}catch(y){g.call(this,y);break}}try{h=km.call(this,p)}catch(m){return Promise.reject(m)}for(u=0,f=c.length;u<f;)h=h.then(c[u++],c[u++]);return h}getUri(e){e=ws(this.defaults,e);const t=mm(e.baseURL,e.url);return nm(t,e.params,e.paramsSerializer)}}P.forEach(["delete","get","head","options"],function(s){Rn.prototype[s]=function(e,t){return this.request(ws(t||{},{method:s,url:e,data:(t||{}).data}))}}),P.forEach(["post","put","patch"],function(s){function e(t){return function(a,i,o){return this.request(ws(o||{},{method:s,headers:t?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}Rn.prototype[s]=e(),Rn.prototype[s+"Form"]=e(!0)});const Bn=Rn;class Pr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});const a=this;this.promise.then(i=>{if(!a._listeners)return;let o=a._listeners.length;for(;o-- >0;)a._listeners[o](i);a._listeners=null}),this.promise.then=i=>{let o;const r=new Promise(l=>{a.subscribe(l),o=l}).then(i);return r.cancel=function(){a.unsubscribe(o)},r},e(function(i,o,r){a.reason||(a.reason=new Fs(i,o,r),t(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new Pr(function(t){e=t}),cancel:e}}}const NR=Pr;function DR(s){return function(e){return s.apply(null,e)}}function PR(s){return P.isObject(s)&&s.isAxiosError===!0}const Or={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(Or).forEach(([s,e])=>{Or[e]=s});const OR=Or;function Cm(s){const e=new Bn(s),t=zu(Bn.prototype.request,e);return P.extend(t,Bn.prototype,e,{allOwnKeys:!0}),P.extend(t,e,null,{allOwnKeys:!0}),t.create=function(a){return Cm(ws(s,a))},t}const ze=Cm(xr);ze.Axios=Bn,ze.CanceledError=Fs,ze.CancelToken=NR,ze.isCancel=cm,ze.VERSION=Em,ze.toFormData=Cn,ze.AxiosError=_e,ze.Cancel=ze.CanceledError,ze.all=function(s){return Promise.all(s)},ze.spread=DR,ze.isAxiosError=PR,ze.mergeConfig=ws,ze.AxiosHeaders=Nt,ze.formToJSON=s=>rm(P.isHTMLForm(s)?new FormData(s):s),ze.getAdapter=_m.getAdapter,ze.HttpStatusCode=OR,ze.default=ze;const xm=ze,FR=(s,e)=>{const t=s.__vccOpts||s;for(const[a,i]of e)t[a]=i;return t},Fr={name:"ScrollableContainer",props:{backgroundColor:{type:String,default:"#0D1D29"},pxScroll:{type:Number,default:100},arrows:{type:Boolean,default:!0},arrowsHideOnNoScroll:{type:Boolean,default:!1},arrowsScrollHide:{type:Boolean,default:!1},arrowsColor:{type:String,default:"#CBEE6B"},arrowsHeight:{type:Number,default:15},arrowsWidth:{type:Number,default:15},arrowsPadding:{type:Number,default:5},arrowsMargin:{type:Number,default:10},arrowsRadius:{type:String,default:"0%"},arrowsBorder:{type:String,default:"none"},arrowsBackground:{type:String,default:"#0D1D29"},arrowsContainerBgL:{type:String,default:"#0D1D29"},arrowsContainerBgR:{type:String,default:"#0D1D29"},scrollColor:{type:String,default:"#c3e569"},arrowsPosition:{type:String,default:"relative"},height:{type:String,default:"100%"}},data(){return{showLeftArrow:!1,showRightArrow:!0,intervalid1:""}},mounted(){this.getScroll(),this.arrowsHideOnNoScroll&&window.addEventListener("resize",this.resizeSlider),this.arrowsHideOnNoScroll&&this.listenerLoad()},beforeUnmount(){this.arrowsHideOnNoScroll&&window.removeEventListener("resize",this.resizeSlider),this.arrowsHideOnNoScroll&&clearInterval(this.intervalid1)},computed:{getViewBox(){return`-2 0 ${this.arrowsWidth} ${this.arrowsHeight}`},hideShowLeftArrow(){let s="";return this.arrowsPosition=="absolute"?s="leftAbsolute":s="leftRelative",this.arrowsScrollHide?this.showLeftArrow?s+=" showArrowSlide":s+=" hideArrowSlide":s+=" showArrowSlide",s},hideShowRightArrow(){let s="";return this.arrowsPosition=="absolute"?s="rightAbsolute":s="rightRelative",this.arrowsScrollHide?this.showRightArrow?s+=" showArrowSlide":s+=" hideArrowSlide":s+=" showArrowSlide",s}},methods:{scrollLeft(){this.$refs.content.scrollLeft-=this.pxScroll},scrollRight(){this.$refs.content.scrollLeft+=this.pxScroll},getScroll(){let s=0;this.arrowsPosition=="relative"?s=this.$refs.content.scrollWidth-this.$el.clientWidth+this.arrowsMargin*2+this.arrowsWidth*4:s=this.$refs.content.scrollWidth-this.$el.clientWidth,this.$refs.content.scrollLeft==0?this.showLeftArrow=!1:this.showLeftArrow=!0,s>0&&(this.$refs.content.scrollLeft==s?this.showRightArrow=!1:this.showRightArrow=!0),this.arrowsHideOnNoScroll&&this.$refs.content.clientWidth===this.$refs.content.scrollWidth&&(this.showRightArrow=!1)},resizeSlider(){this.getScroll();let s;clearTimeout(s),s=setTimeout(this.getScroll,1e3)},listenerLoad(){this.intervalid1=setInterval((function(){var s=this.$el.clientWidth,e=this.$refs.content.scrollWidth;e>0&&s>0&&(e>s?(this.showRightArrow=!0,clearInterval(this.intervalid1)):clearInterval(this.intervalid1))}).bind(this),3e3)}}},vm=()=>{n.useCssVars(s=>({"26acffa8":s.backgroundColor,"3d95bef4":s.height,"86ba1cc0":s.arrowsPosition,"140b6ada":s.arrowsPadding+"px","7df46be5":s.arrowsBackground,"33f99798":s.arrowsHeight*2+"px","1c8a858d":s.arrowsWidth*2+"px","4a7876c9":s.arrowsRadius,"2ff67e63":s.arrowsBorder,"59c5dd08":s.arrowsMargin+"px","6658215d":s.arrowsContainerBgL,66582163:s.arrowsContainerBgR,e5900a2e:s.scrollColor}))},Am=Fr.setup;Fr.setup=Am?(s,e)=>(vm(),Am(s,e)):vm;const MR={ref:"gscScrollableContainer",class:"scrollable-container"},$R={class:"scrollable-arrows"},VR=["width","height","viewBox"],UR=["stroke"],zR={class:"scrollable-wrapper"},GR={class:"scrollable-arrows"},jR=["width","height","viewBox"],HR=["stroke"];function WR(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",MR,[t.arrows?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["arrows-container",o.hideShowLeftArrow]),onClick:e[0]||(e[0]=(...r)=>o.scrollLeft&&o.scrollLeft(...r))},[n.createElementVNode("div",$R,[(n.openBlock(),n.createElementBlock("svg",{width:t.arrowsWidth,height:t.arrowsHeight,viewBox:o.getViewBox,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:t.arrowsColor},null,8,UR)],8,VR))])],2)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"scrollable-content scrollable-content-slider",ref:"content",onScroll:e[1]||(e[1]=(...r)=>o.getScroll&&o.getScroll(...r))},[n.createElementVNode("div",zR,[n.renderSlot(s.$slots,"default",{},void 0,!0)])],544),t.arrows?(n.openBlock(),n.createElementBlock("div",{key:1,id:"arrows-container-right",class:n.normalizeClass(["arrows-container",o.hideShowRightArrow]),onClick:e[2]||(e[2]=(...r)=>o.scrollRight&&o.scrollRight(...r))},[n.createElementVNode("div",GR,[(n.openBlock(),n.createElementBlock("svg",{width:t.arrowsWidth,height:t.arrowsHeight,viewBox:o.getViewBox,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M0.634765 1.21195L5.89853 6.47571C6.52018 7.09735 6.52018 8.11459 5.89853 8.73623L0.634766 14",stroke:t.arrowsColor},null,8,HR)],8,jR))])],2)):n.createCommentVNode("",!0)],512)}const KR=FR(Fr,[["render",WR],["__scopeId","data-v-7d0811ac"]]),rs=(s,e)=>{const t=s.__vccOpts||s;for(const[a,i]of e)t[a]=i;return t};let Lm=null;const Mr={components:{},props:{titleCategory:{type:String,default:"RESUMEN"},dateGame:{type:String,default:""},showVideos:{type:Boolean,default:!0},colorBackgroundHome:{type:String,default:"#000000"},colorBackgroundAway:{type:String,default:"#FFFFFF"},logoHome:{type:String,default:""},matchday:{type:String,default:""},seasonName:{type:String,default:""},logoAway:{type:String,default:""},score:{type:String,default:""},background:{type:String,default:""}},data(){return{gamesContainerGHWidth:0}},computed:{date(){const s=this.gamesContainerGHWidth;return s<=400?"date400":s<=540?"date540":s<=650?"date650":"date"},seasoncontainer(){const s=this.gamesContainerGHWidth;return s<=400?"season-container400":s<=540?"season-container540":s<=650?"season-container650":"season-container"},matchcontainer(){const s=this.gamesContainerGHWidth;return s<=400?"match-container400":s<=540?"match-container540":s<=650?"match-container650":"match-container"},containerinfogame(){const s=this.gamesContainerGHWidth;return s<=400?"container-info-game400":s<=540?"container-info-game540":s<=650?"container-info-game650":"container-info-game"},playbutton(){const s=this.gamesContainerGHWidth;return s<=400?"play-button400":s<=540?"play-button540":s<=650?"play-button650":"play-button"},baselogo(){const s=this.gamesContainerGHWidth;return s<=400?"base-logo400":s<=540?"base-logo540":s<=650?"base-logo650":"base-logo"},baselogoright(){const s=this.gamesContainerGHWidth;return s<=400?"base-logo-right400":s<=540?"base-logo-right540":s<=650?"base-logo-right650":"base-logo-right"},thumbnailhighlights(){const s=this.gamesContainerGHWidth;return s<=400?"thumbnail-highlights400":s<=540?"thumbnail-highlights540":s<=650?"thumbnail-highlights650":"thumbnail-highlights"},teamlogo(){const s=this.gamesContainerGHWidth;return s<=400?"team-logo400":s<=540?"team-logo540":s<=650?"team-logo650":"team-logo"},logoright(){const s=this.gamesContainerGHWidth;return s<=400?"logo-right400":s<=540?"logo-right540":s<=650?"logo-right650":"logo-right"},secondline(){const s=this.gamesContainerGHWidth;return s<=400?"second-line400":s<=540?"second-line540":s<=650?"second-line650":"second-line"},titlename(){const s=this.gamesContainerGHWidth;return s<=400?"title-name400":s<=540?"title-name540":s<=650?"title-name650":"title-name"}},methods:{onclickPlayVideos(){this.$emit("onclickPlayVideos")},setUpResizeObserver(){if(window.ResizeObserver)Lm=new ResizeObserver(()=>{this.gamesContainerGHWidth=this.$refs.gamesContainerGH?this.$refs.gamesContainerGH.clientWidth:0,this.movil=this.gamesContainerGHWidth<740}),Lm.observe(this.$refs.gamesContainerGH);else throw new Error("Resize observer not supported!")}},mounted(){setTimeout(()=>{this.setUpResizeObserver()},100)}},Im=()=>{n.useCssVars(s=>({a281566c:s.colorBackgroundHome+"45","692c47db":s.colorBackgroundAway+"45","229d672a":s.colorBackgroundHome,"229a5539":s.colorBackgroundAway}))},Rm=Mr.setup;Mr.setup=Rm?(s,e)=>(Im(),Rm(s,e)):Im;const Nn=s=>(n.pushScopeId("data-v-dd4b2ba3"),s=s(),n.popScopeId(),s),qR=Nn(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[n.createElementVNode("path",{d:"M6.6041 22.8554C6.42105 22.7512 6.26805 22.5956 6.1616 22.4053C6.05515 22.215 5.99927 21.9973 6.00001 21.7755V2.22137C6.00026 2.00039 6.0565 1.78362 6.16274 1.59409C6.26899 1.40456 6.42127 1.24936 6.6034 1.14499C6.78553 1.04062 6.9907 0.990981 7.1971 1.00135C7.4035 1.01171 7.60342 1.0817 7.77561 1.20386L21.4907 10.9821C21.6473 11.0935 21.7758 11.2446 21.8646 11.4219C21.9535 11.5992 22 11.7973 22 11.9985C22 12.1996 21.9535 12.3977 21.8646 12.575C21.7758 12.7523 21.6473 12.9034 21.4907 13.0148L7.77561 22.7954C7.60369 22.9178 7.40392 22.988 7.19761 22.9986C6.9913 23.0092 6.78617 22.9597 6.6041 22.8554ZM7.14347 21.7779L20.8585 11.9996L7.14347 21.7779Z",fill:"#CBEE6B"})],-1)),YR=[qR],JR=Nn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/paper-texture.png",alt:"",class:"paper-texture position-image"},null,-1)),XR=["src"],ZR=Nn(()=>n.createElementVNode("div",{class:"gradient-back position-image"},null,-1)),QR=Nn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/halftone-texture.png",alt:"",class:"halftone-texture position-image"},null,-1)),e4=["src"],t4=["src"],s4={class:"text-container"};function a4(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",{ref:"gamesContainerGH",class:n.normalizeClass(o.thumbnailhighlights)},[t.showVideos?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(o.playbutton),onClick:e[0]||(e[0]=(...r)=>o.onclickPlayVideos&&o.onclickPlayVideos(...r))},YR,2)):n.createCommentVNode("",!0),t.dateGame!=""?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(o.date)},n.toDisplayString(t.dateGame),3)):n.createCommentVNode("",!0),t.matchday!=""&&t.seasonName!=""?(n.openBlock(),n.createElementBlock("div",{key:2,class:n.normalizeClass(o.containerinfogame)},[t.matchday!=""?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(o.matchcontainer)},n.toDisplayString(t.matchday),3)):n.createCommentVNode("",!0),t.seasonName!=""?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(o.seasoncontainer)},n.toDisplayString(t.seasonName),3)):n.createCommentVNode("",!0)],2)):n.createCommentVNode("",!0),JR,n.createElementVNode("img",{src:t.background,alt:"",class:"bkg-blackwhite position-image"},null,8,XR),n.createElementVNode("div",{class:n.normalizeClass([o.baselogo,"position-image"])},null,2),n.createElementVNode("div",{class:n.normalizeClass(o.baselogoright)},null,2),ZR,QR,n.createElementVNode("img",{src:t.logoHome,alt:"",class:n.normalizeClass(o.teamlogo)},null,10,e4),n.createElementVNode("img",{src:t.logoAway,alt:"",class:n.normalizeClass(o.logoright)},null,10,t4),n.createElementVNode("div",s4,[n.createElementVNode("span",{class:n.normalizeClass(o.secondline)},n.toDisplayString(t.score),3),n.createElementVNode("div",{class:n.normalizeClass(o.titlename)},n.toDisplayString(t.titleCategory),3)])],2)}const n4=rs(Mr,[["render",a4],["__scopeId","data-v-dd4b2ba3"]]);let Bm=null;const $r={components:{},props:{colorBackgroundHome:{type:String,default:"#000000"},colorBackgroundAway:{type:String,default:"#FFFFFF"},nameCategory:{type:String,default:""},photoProfile:{type:String,default:""},logoHome:{type:String,default:""},logoAway:{type:String,default:""},scoreHome:{type:[String,Number],default:""},scoreAway:{type:[String,Number],default:""},background:{type:String,default:""},typeImg:{type:Number,default:0},nameHomeTeam:{type:String,default:""},nameAwayTeam:{type:String,default:""},namePlayer:{type:String,default:""}},data(){return{gamesContainerCWidth:0}},computed:{playbutton(){const s=this.gamesContainerCWidth;return s<=400?"play-button400":s<=540?"play-button540":s<=650?"play-button650":"play-button"},teamlogo(){const s=this.gamesContainerCWidth;return s<=400?"team-logo400":s<=540?"team-logo540":s<=650?"team-logo650":"team-logo"},firstline(){const s=this.gamesContainerCWidth;return s<=400?"first-line400":s<=540?"first-line540":s<=650?"first-line650":"first-line"},secondline(){const s=this.gamesContainerCWidth;return s<=400?"second-line400":s<=540?"second-line540":s<=650?"second-line650":"second-line"},playerimage(){const s=this.gamesContainerCWidth;return s<=400?"player-image400":s<=540?"player-image540":s<=650?"player-image650":"player-image"},thumbnailhighlights(){const s=this.gamesContainerCWidth;return s<=400?"thumbnail-highlights400":s<=540?"thumbnail-highlights540":s<=650?"thumbnail-highlights650":"thumbnail-highlights"}},methods:{onclickPlayVideos(){this.$emit("onclickPlayVideos")},setUpResizeObserver(){if(window.ResizeObserver)Bm=new ResizeObserver(()=>{this.gamesContainerCWidth=this.$refs.gamesContainerC?this.$refs.gamesContainerC.clientWidth:0,this.movil=this.gamesContainerCWidth<740}),Bm.observe(this.$refs.gamesContainerC);else throw new Error("Resize observer not supported!")}},mounted(){setTimeout(()=>{this.setUpResizeObserver()},100)}},Nm=()=>{n.useCssVars(s=>({"9cae8720":s.colorBackgroundHome,"58cca122":s.colorBackgroundHome+"36"}))},Dm=$r.setup;$r.setup=Dm?(s,e)=>(Nm(),Dm(s,e)):Nm;const Sa=s=>(n.pushScopeId("data-v-ef4021c1"),s=s(),n.popScopeId(),s),i4=Sa(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[n.createElementVNode("path",{d:"M6.6041 22.8554C6.42105 22.7512 6.26805 22.5956 6.1616 22.4053C6.05515 22.215 5.99927 21.9973 6.00001 21.7755V2.22137C6.00026 2.00039 6.0565 1.78362 6.16274 1.59409C6.26899 1.40456 6.42127 1.24936 6.6034 1.14499C6.78553 1.04062 6.9907 0.990981 7.1971 1.00135C7.4035 1.01171 7.60342 1.0817 7.77561 1.20386L21.4907 10.9821C21.6473 11.0935 21.7758 11.2446 21.8646 11.4219C21.9535 11.5992 22 11.7973 22 11.9985C22 12.1996 21.9535 12.3977 21.8646 12.575C21.7758 12.7523 21.6473 12.9034 21.4907 13.0148L7.77561 22.7954C7.60369 22.9178 7.40392 22.988 7.19761 22.9986C6.9913 23.0092 6.78617 22.9597 6.6041 22.8554ZM7.14347 21.7779L20.8585 11.9996L7.14347 21.7779Z",fill:"#CBEE6B"})],-1)),o4=[i4],r4=Sa(()=>n.createElementVNode("div",{class:"gradient-back position-image"},null,-1)),l4=["src"],c4=Sa(()=>n.createElementVNode("div",{class:"base-logo"},null,-1)),d4=["src"],h4=Sa(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/halftone-texture.png",alt:"",class:"halftone-texture position-image"},null,-1)),u4={class:"text-container"},m4={class:"player-image position-image"},f4=["src"],p4=["src"],g4=["src"],y4=Sa(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/paper-texture.png",alt:"",class:"paper-texture position-image"},null,-1));function b4(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",{ref:"gamesContainerC",class:n.normalizeClass(o.thumbnailhighlights)},[n.createElementVNode("div",{class:n.normalizeClass(o.playbutton),onClick:e[0]||(e[0]=(...r)=>o.onclickPlayVideos&&o.onclickPlayVideos(...r))},o4,2),r4,n.createElementVNode("img",{src:t.background,alt:"",class:"bkg-blackwhite position-image"},null,8,l4),c4,n.createElementVNode("img",{src:t.logoHome,alt:"",class:n.normalizeClass(o.teamlogo)},null,10,d4),h4,n.createElementVNode("div",u4,[n.createElementVNode("span",{class:n.normalizeClass(o.firstline)},n.toDisplayString(t.namePlayer),3),n.createElementVNode("span",{class:n.normalizeClass(o.secondline),style:n.normalizeStyle(t.nameCategory=="Balones recuperados en disputa "?"font-size: 25px":"")},n.toDisplayString(t.nameCategory),7)]),n.createElementVNode("div",m4,[t.typeImg==0?(n.openBlock(),n.createElementBlock("img",{key:0,src:t.photoProfile,class:n.normalizeClass(o.playerimage)},null,10,f4)):n.createCommentVNode("",!0),t.typeImg==1?(n.openBlock(),n.createElementBlock("img",{key:1,src:t.photoProfile,alt:""},null,8,p4)):n.createCommentVNode("",!0),t.typeImg==2?(n.openBlock(),n.createElementBlock("img",{key:2,src:t.photoProfile,class:"img-number"},null,8,g4)):n.createCommentVNode("",!0)]),y4],2)}const S4=rs($r,[["render",b4],["__scopeId","data-v-ef4021c1"]]);let Pm=null;const Vr={components:{},props:{colorBackgroundHome:{type:String,default:"#000000"},showVideos:{type:Boolean,default:!0},colorBackgroundAway:{type:String,default:"#FFFFFF"},logoHome:{type:String,default:""},logoAway:{type:String,default:""},score:{type:String,default:""},background:{type:String,default:""},nameTeam:{type:String,default:""},nameCategory:{type:String,default:""}},data(){return{gamesContainerCTWidth:0}},computed:{playbutton(){const s=this.gamesContainerCTWidth;return s<=400?"play-button400":s<=540?"play-button540":s<=650?"play-button650":"play-button"},thumbnailhighlights(){const s=this.gamesContainerCTWidth;return s<=400?"thumbnail-highlights400":s<=540?"thumbnail-highlights540":s<=650?"thumbnail-highlights650":"thumbnail-highlights"},secondline(){const s=this.gamesContainerCTWidth;return s<=400?"second-line400":s<=540?"second-line540":s<=650?"second-line650":"second-line"},firstline(){const s=this.gamesContainerCTWidth;return s<=400?"first-line400":s<=540?"first-line540":s<=650?"first-line650":"first-line"},teamlogo(){const s=this.gamesContainerCTWidth;return s<=400?"team-logo400":s<=540?"team-logo540":s<=650?"team-logo650":"team-logo"}},methods:{onclickPlayVideos(){this.$emit("onclickPlayVideos")},setUpResizeObserver(){if(window.ResizeObserver)Pm=new ResizeObserver(()=>{this.gamesContainerCTWidth=this.$refs.gamesContainerCT?this.$refs.gamesContainerCT.clientWidth:0,this.gamesContainerCTWidth<740?this.movil=!0:this.movil=!1}),Pm.observe(this.$refs.gamesContainerCT);else throw new Error("Resize observer not supported!")}},mounted(){setTimeout(()=>{this.setUpResizeObserver()},100)}},Om=()=>{n.useCssVars(s=>({"3ce1ca00":s.colorBackgroundHome,"916c7edc":s.colorBackgroundHome+"36"}))},Fm=Vr.setup;Vr.setup=Fm?(s,e)=>(Om(),Fm(s,e)):Om;const Dn=s=>(n.pushScopeId("data-v-191985e2"),s=s(),n.popScopeId(),s),w4=Dn(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[n.createElementVNode("path",{d:"M6.6041 22.8554C6.42105 22.7512 6.26805 22.5956 6.1616 22.4053C6.05515 22.215 5.99927 21.9973 6.00001 21.7755V2.22137C6.00026 2.00039 6.0565 1.78362 6.16274 1.59409C6.26899 1.40456 6.42127 1.24936 6.6034 1.14499C6.78553 1.04062 6.9907 0.990981 7.1971 1.00135C7.4035 1.01171 7.60342 1.0817 7.77561 1.20386L21.4907 10.9821C21.6473 11.0935 21.7758 11.2446 21.8646 11.4219C21.9535 11.5992 22 11.7973 22 11.9985C22 12.1996 21.9535 12.3977 21.8646 12.575C21.7758 12.7523 21.6473 12.9034 21.4907 13.0148L7.77561 22.7954C7.60369 22.9178 7.40392 22.988 7.19761 22.9986C6.9913 23.0092 6.78617 22.9597 6.6041 22.8554ZM7.14347 21.7779L20.8585 11.9996L7.14347 21.7779Z",fill:"#CBEE6B"})],-1)),_4=[w4],k4=Dn(()=>n.createElementVNode("div",{class:"gradient-back position-image"},null,-1)),E4=["src"],T4={width:"275",height:"125",viewBox:"0 0 275 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"base-logo"},C4=["fill"],x4=["id"],v4=["stop-color"],A4=["stop-color"],L4=["src"],I4=Dn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/halftone-texture.png",alt:"",class:"halftone-texture position-image"},null,-1)),R4={class:"text-container"},B4=Dn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/paper-texture.png",alt:"",class:"paper-texture position-image"},null,-1));function N4(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",{ref:"gamesContainerCT",class:n.normalizeClass(o.thumbnailhighlights)},[t.showVideos?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(o.playbutton),onClick:e[0]||(e[0]=(...r)=>o.onclickPlayVideos&&o.onclickPlayVideos(...r))},_4,2)):n.createCommentVNode("",!0),k4,n.createElementVNode("img",{src:t.background,alt:"",class:"bkg-blackwhite position-image"},null,8,E4),(n.openBlock(),n.createElementBlock("svg",T4,[n.createElementVNode("path",{d:"M274.641 124.094L0 0.675049V124.094H274.641Z",fill:"url(#paint0_linear_7_"+t.nameTeam.replaceAll(" ","")+")"},null,8,C4),n.createElementVNode("defs",null,[n.createElementVNode("linearGradient",{id:"paint0_linear_7_"+t.nameTeam.replaceAll(" ",""),x1:"58.6578",y1:"15.5938",x2:"58.6578",y2:"124.094",gradientUnits:"userSpaceOnUse"},[n.createElementVNode("stop",{"stop-color":t.colorBackgroundHome},null,8,v4),n.createElementVNode("stop",{offset:"1","stop-color":t.colorBackgroundHome},null,8,A4)],8,x4)])])),n.createElementVNode("img",{class:n.normalizeClass(o.teamlogo),src:t.logoHome,alt:""},null,10,L4),I4,n.createElementVNode("div",R4,[n.createElementVNode("span",{class:n.normalizeClass(o.firstline)},[t.nameTeam!="Local"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(n.toDisplayString(t.nameTeam),1)],64)):n.createCommentVNode("",!0)],2),n.createElementVNode("div",{class:n.normalizeClass(o.secondline)},n.toDisplayString(t.nameCategory),3)]),B4],2)}const D4=rs(Vr,[["render",N4],["__scopeId","data-v-191985e2"]]);let Mm=null;const Ur={components:{},props:{colorBackgroundHome:{type:String,default:"#000000"},colorBackgroundAway:{type:String,default:"#FFFFFF"},logoHome:{type:String,default:""},logoAway:{type:String,default:""},score:{type:String,default:""},background:{type:String,default:""},nameTeam:{type:String,default:""},nameCategory:{type:String,default:""}},data(){return{gamesContainerTAWidth:0}},computed:{playbutton(){const s=this.gamesContainerTAWidth;return s<=400?"play-button400":s<=540?"play-button540":s<=650?"play-button650":"play-button"},thumbnailhighlights(){const s=this.gamesContainerTAWidth;return s<=400?"thumbnail-highlights400":s<=540?"thumbnail-highlights540":s<=650?"thumbnail-highlights650":"thumbnail-highlights"},secondline(){const s=this.gamesContainerTAWidth;return s<=400?"second-line400":s<=540?"second-line540":s<=650?"second-line650":"second-line"},firstline(){const s=this.gamesContainerTAWidth;return s<=400?"first-line400":s<=540?"first-line540":s<=650?"first-line650":"first-line"},teamlogo(){const s=this.gamesContainerTAWidth;return s<=400?"team-logo400":s<=540?"team-logo540":s<=650?"team-logo650":"team-logo"}},methods:{onclickPlayVideos(){this.$emit("onclickPlayVideos")},setUpResizeObserver(){if(window.ResizeObserver)Mm=new ResizeObserver(()=>{this.gamesContainerTAWidth=this.$refs.gamesContainerTA?this.$refs.gamesContainerTA.clientWidth:0,this.movil=this.gamesContainerTAWidth<740}),Mm.observe(this.$refs.gamesContainerTA);else throw new Error("Resize observer not supported!")}},mounted(){setTimeout(()=>{this.setUpResizeObserver()},100)}},$m=()=>{n.useCssVars(s=>({"1e0230d2":s.colorBackgroundHome,"1ae427ca":s.colorBackgroundHome+"36"}))},Vm=Ur.setup;Ur.setup=Vm?(s,e)=>($m(),Vm(s,e)):$m;const Pn=s=>(n.pushScopeId("data-v-61a93c22"),s=s(),n.popScopeId(),s),P4=Pn(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[n.createElementVNode("path",{d:"M6.6041 22.8554C6.42105 22.7512 6.26805 22.5956 6.1616 22.4053C6.05515 22.215 5.99927 21.9973 6.00001 21.7755V2.22137C6.00026 2.00039 6.0565 1.78362 6.16274 1.59409C6.26899 1.40456 6.42127 1.24936 6.6034 1.14499C6.78553 1.04062 6.9907 0.990981 7.1971 1.00135C7.4035 1.01171 7.60342 1.0817 7.77561 1.20386L21.4907 10.9821C21.6473 11.0935 21.7758 11.2446 21.8646 11.4219C21.9535 11.5992 22 11.7973 22 11.9985C22 12.1996 21.9535 12.3977 21.8646 12.575C21.7758 12.7523 21.6473 12.9034 21.4907 13.0148L7.77561 22.7954C7.60369 22.9178 7.40392 22.988 7.19761 22.9986C6.9913 23.0092 6.78617 22.9597 6.6041 22.8554ZM7.14347 21.7779L20.8585 11.9996L7.14347 21.7779Z",fill:"#CBEE6B"})],-1)),O4=[P4],F4=Pn(()=>n.createElementVNode("div",{class:"gradient-back position-image"},null,-1)),M4=["src"],$4={width:"275",height:"125",viewBox:"0 0 275 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"base-logo-away"},V4=["fill"],U4=["id"],z4=["stop-color"],G4=["stop-color"],j4=["src"],H4=Pn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/halftone-texture.png",alt:"",class:"halftone-texture position-image"},null,-1)),W4={class:"text-container"},K4=Pn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/paper-texture.png",alt:"",class:"paper-texture position-image"},null,-1));function q4(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",{ref:"gamesContainerTA",class:n.normalizeClass(o.thumbnailhighlights)},[n.createElementVNode("div",{class:n.normalizeClass(o.playbutton),onClick:e[0]||(e[0]=(...r)=>o.onclickPlayVideos&&o.onclickPlayVideos(...r))},O4,2),F4,n.createElementVNode("img",{src:t.background,alt:"",class:"bkg-blackwhite position-image"},null,8,M4),(n.openBlock(),n.createElementBlock("svg",$4,[n.createElementVNode("path",{d:"M274.641 124.094L0 0.675049V124.094H274.641Z",fill:"url(#paint0_linear_7_"+t.nameTeam.replaceAll(" ","")+")"},null,8,V4),n.createElementVNode("defs",null,[n.createElementVNode("linearGradient",{id:"paint0_linear_7_"+t.nameTeam.replaceAll(" ",""),x1:"58.6578",y1:"15.5938",x2:"58.6578",y2:"124.094",gradientUnits:"userSpaceOnUse"},[n.createElementVNode("stop",{"stop-color":t.colorBackgroundAway},null,8,z4),n.createElementVNode("stop",{offset:"1","stop-color":t.colorBackgroundAway},null,8,G4)],8,U4)])])),n.createElementVNode("img",{class:n.normalizeClass(o.teamlogo),src:t.logoHome,alt:""},null,10,j4),H4,n.createElementVNode("div",W4,[n.createElementVNode("span",{class:n.normalizeClass(o.firstline)},[t.nameTeam!="Away"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(n.toDisplayString(t.nameTeam),1)],64)):n.createCommentVNode("",!0)],2),n.createElementVNode("div",{class:n.normalizeClass(o.secondline)},n.toDisplayString(t.nameCategory),3)]),K4],2)}const Y4=rs(Ur,[["render",q4],["__scopeId","data-v-61a93c22"]]);let Um=null;const zr={components:{},props:{colorBackgroundHome:{type:String,default:"#000000"},colorBackgroundAway:{type:String,default:"#FFFFFF"},logoHome:{type:String,default:""},logoAway:{type:String,default:""},score:{type:String,default:""},background:{type:String,default:""},nameTeam:{type:String,default:""},nameCategory:{type:String,default:""}},data(){return{gamesContainerTALWidth:0}},computed:{playbutton(){const s=this.gamesContainerTALWidth;return s<=400?"play-button400":s<=540?"play-button540":s<=650?"play-button650":"play-button"},thumbnailhighlights(){const s=this.gamesContainerTALWidth;return s<=400?"thumbnail-highlights400":s<=540?"thumbnail-highlights540":s<=650?"thumbnail-highlights650":"thumbnail-highlights"},secondline(){const s=this.gamesContainerTALWidth;return s<=400?"second-line400":s<=540?"second-line540":s<=650?"second-line650":"second-line"},firstline(){const s=this.gamesContainerTALWidth;return s<=400?"first-line400":s<=540?"first-line540":s<=650?"first-line650":"first-line"},teamlogo(){const s=this.gamesContainerTALWidth;return s<=400?"team-logo400":s<=540?"team-logo540":s<=650?"team-logo650":"team-logo"}},methods:{onclickPlayVideos(){this.$emit("onclickPlayVideos")},setUpResizeObserver(){if(window.ResizeObserver)Um=new ResizeObserver(()=>{this.gamesContainerTALWidth=this.$refs.gamesContainerTAL?this.$refs.gamesContainerTAL.clientWidth:0,this.movil=this.gamesContainerTALWidth<740}),Um.observe(this.$refs.gamesContainerTAL);else throw new Error("Resize observer not supported!")}},mounted(){setTimeout(()=>{this.setUpResizeObserver()},100)}},zm=()=>{n.useCssVars(s=>({"41af18a7":s.colorBackgroundHome,"1387690b":s.colorBackgroundHome+"36"}))},Gm=zr.setup;zr.setup=Gm?(s,e)=>(zm(),Gm(s,e)):zm;const On=s=>(n.pushScopeId("data-v-19ce95f3"),s=s(),n.popScopeId(),s),J4=On(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[n.createElementVNode("path",{d:"M6.6041 22.8554C6.42105 22.7512 6.26805 22.5956 6.1616 22.4053C6.05515 22.215 5.99927 21.9973 6.00001 21.7755V2.22137C6.00026 2.00039 6.0565 1.78362 6.16274 1.59409C6.26899 1.40456 6.42127 1.24936 6.6034 1.14499C6.78553 1.04062 6.9907 0.990981 7.1971 1.00135C7.4035 1.01171 7.60342 1.0817 7.77561 1.20386L21.4907 10.9821C21.6473 11.0935 21.7758 11.2446 21.8646 11.4219C21.9535 11.5992 22 11.7973 22 11.9985C22 12.1996 21.9535 12.3977 21.8646 12.575C21.7758 12.7523 21.6473 12.9034 21.4907 13.0148L7.77561 22.7954C7.60369 22.9178 7.40392 22.988 7.19761 22.9986C6.9913 23.0092 6.78617 22.9597 6.6041 22.8554ZM7.14347 21.7779L20.8585 11.9996L7.14347 21.7779Z",fill:"#CBEE6B"})],-1)),X4=[J4],Z4=On(()=>n.createElementVNode("div",{class:"gradient-back position-image"},null,-1)),Q4=["src"],e3={width:"275",height:"125",viewBox:"0 0 275 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"base-logo-away-live"},t3=["fill"],s3=["id"],a3=["stop-color"],n3=["stop-color"],i3=["src"],o3=On(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/halftone-texture.png",alt:"",class:"halftone-texture position-image"},null,-1)),r3={class:"text-container"},l3=On(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/paper-texture.png",alt:"",class:"paper-texture position-image"},null,-1));function c3(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",{ref:"gamesContainerTAL",class:n.normalizeClass(o.thumbnailhighlights)},[n.createElementVNode("div",{class:n.normalizeClass(o.playbutton),onClick:e[0]||(e[0]=(...r)=>o.onclickPlayVideos&&o.onclickPlayVideos(...r))},X4,2),Z4,n.createElementVNode("img",{src:t.background,alt:"",class:"bkg-blackwhite position-image"},null,8,Q4),(n.openBlock(),n.createElementBlock("svg",e3,[n.createElementVNode("path",{d:"M274.641 124.094L0 0.675049V124.094H274.641Z",fill:"url(#paint0_linear_10_"+t.nameTeam.replaceAll(" ","")+")"},null,8,t3),n.createElementVNode("defs",null,[n.createElementVNode("linearGradient",{id:"paint0_linear_10_"+t.nameTeam.replaceAll(" ",""),x1:"58.6578",y1:"15.5938",x2:"58.6578",y2:"124.094",gradientUnits:"userSpaceOnUse"},[n.createElementVNode("stop",{"stop-color":t.colorBackgroundAway},null,8,a3),n.createElementVNode("stop",{offset:"1","stop-color":t.colorBackgroundAway},null,8,n3)],8,s3)])])),n.createElementVNode("img",{class:n.normalizeClass(o.teamlogo),src:t.logoHome,alt:""},null,10,i3),o3,n.createElementVNode("div",r3,[n.createElementVNode("span",{class:n.normalizeClass(o.firstline)},[t.nameTeam!="Away"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(n.toDisplayString(t.nameTeam),1)],64)):n.createCommentVNode("",!0)],2),n.createElementVNode("div",{class:n.normalizeClass(o.secondline)},n.toDisplayString(t.nameCategory),3)]),l3],2)}const d3=rs(zr,[["render",c3],["__scopeId","data-v-19ce95f3"]]);let jm=null;const Gr={components:{},props:{colorFontHome:{type:String,default:"#000000"},colorFontAway:{type:String,default:"#000000"},type:{type:Number,default:0},showVideos:{type:Boolean,default:!0},playStatus:{type:Number,default:2},matchday:{type:String,default:""},seasonName:{type:String,default:""},colorBackgroundHome:{type:String,default:"#000000"},colorBackgroundAway:{type:String,default:"#FFFFFF"},nameCategory:{type:String,default:""},showimg:{type:Boolean,default:!0},photoProfile:{type:String,default:""},logoHome:{type:String,default:""},logoAway:{type:String,default:""},date:{type:String,default:""},scoreHome:{type:[String,Number],default:""},scoreAway:{type:[String,Number],default:""},background:{type:String,default:""},typeImg:{type:Number,default:0},nameHomeTeam:{type:String,default:""},nameAwayTeam:{type:String,default:""},namePlayer:{type:String,default:""}},data(){return{gamesContainerGPWidth:0}},computed:{seasoncontainer(){const s=this.gamesContainerGPWidth;return s<=400?"season-container400":s<=540?"season-container540":s<=650?"season-container650":"season-container"},matchcontainer(){const s=this.gamesContainerGPWidth;return s<=400?"match-container400":s<=540?"match-container540":s<=650?"match-container650":"match-container"},seasonnameContainer(){const s=this.gamesContainerGPWidth;return s<=400?"seasonname400":s<=540?"seasonname540":s<=650?"seasonname650":"seasonname"},matchboxContainer(){const s=this.gamesContainerGPWidth;return s<=400?"matchbox400":s<=540?"matchbox540":s<=650?"matchbox650":"matchbox"},containerinfogame(){const s=this.gamesContainerGPWidth;return s<=400?"container-info-game400":s<=540?"container-info-game540":s<=650?"container-info-game650":"container-info-game"},playbutton(){const s=this.gamesContainerGPWidth;return s<=400?"play-button400":s<=540?"play-button540":s<=650?"play-button650":"play-button"},points(){const s=this.gamesContainerGPWidth;return s<=400?"points400":s<=540?"points540":s<=650?"points650":"points"},teamname(){const s=this.gamesContainerGPWidth;return s<=400?"team-name400":s<=540?"team-name540":s<=650?"team-name650":"team-name"},teamscore(){const s=this.gamesContainerGPWidth;return s<=400?"team-score400":s<=540?"team-score540":s<=650?"team-score650":"team-score"},teamlogo(){const s=this.gamesContainerGPWidth;return s<=400?"team-logo400":s<=540?"team-logo540":s<=650?"team-logo650":"team-logo"},hometeam(){const s=this.gamesContainerGPWidth;return s<=400?"home-team400":s<=540?"home-team540":s<=650?"home-team650":"home-team"},awayteam(){const s=this.gamesContainerGPWidth;return s<=400?"away-team400":s<=540?"away-team540":s<=650?"away-team650":"away-team"},texttitle(){const s=this.gamesContainerGPWidth;return s<=400?"text-title400":s<=540?"text-title540":s<=650?"text-title650":"text-title"},texttitle2(){const s=this.gamesContainerGPWidth;return s<=400?"text-title2400":s<=540?"text-title2540":s<=650?"text-title2650":"text-title2"},playerimage(){const s=this.gamesContainerGPWidth;return s<=400?"player-image400":s<=540?"player-image540":s<=650?"player-image650":"player-image"},thumbnailhighlights(){const s=this.gamesContainerGPWidth;return s<=400?"thumbnail-highlights400":s<=540?"thumbnail-highlights540":s<=650?"thumbnail-highlights650":"thumbnail-highlights"}},methods:{onclickPlayVideos(){this.$emit("onclickPlayVideos")},setUpResizeObserver(){if(window.ResizeObserver)jm=new ResizeObserver(()=>{this.gamesContainerGPWidth=this.$refs.gamesContainerGP?this.$refs.gamesContainerGP.clientWidth:0,this.gamesContainerGPWidth<740?this.movil=!0:this.movil=!1}),jm.observe(this.$refs.gamesContainerGP);else throw new Error("Resize observer not supported!")}},mounted(){setTimeout(()=>{this.setUpResizeObserver()},100)}},Hm=()=>{n.useCssVars(s=>({"14532c00":s.colorBackgroundHome,"14594fe2":s.colorBackgroundAway,"672ee12c":s.colorBackgroundAway+"62","11fb9192":s.colorBackgroundHome+"36"}))},Wm=Gr.setup;Gr.setup=Wm?(s,e)=>(Hm(),Wm(s,e)):Hm;const Fn=s=>(n.pushScopeId("data-v-77384f47"),s=s(),n.popScopeId(),s),h3=["width","src"],u3=Fn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/paper-texture.png",alt:"",class:"paper-texture position-image"},null,-1)),m3=Fn(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[n.createElementVNode("path",{d:"M6.6041 22.8554C6.42105 22.7512 6.26805 22.5956 6.1616 22.4053C6.05515 22.215 5.99927 21.9973 6.00001 21.7755V2.22137C6.00026 2.00039 6.0565 1.78362 6.16274 1.59409C6.26899 1.40456 6.42127 1.24936 6.6034 1.14499C6.78553 1.04062 6.9907 0.990981 7.1971 1.00135C7.4035 1.01171 7.60342 1.0817 7.77561 1.20386L21.4907 10.9821C21.6473 11.0935 21.7758 11.2446 21.8646 11.4219C21.9535 11.5992 22 11.7973 22 11.9985C22 12.1996 21.9535 12.3977 21.8646 12.575C21.7758 12.7523 21.6473 12.9034 21.4907 13.0148L7.77561 22.7954C7.60369 22.9178 7.40392 22.988 7.19761 22.9986C6.9913 23.0092 6.78617 22.9597 6.6041 22.8554ZM7.14347 21.7779L20.8585 11.9996L7.14347 21.7779Z",fill:"#CBEE6B"})],-1)),f3=[m3],p3={class:"player-container"},g3=["src"],y3=["src"],b3=["src"],S3={class:"container-score"},w3=["src"],_3=["src"],k3=["src"],E3=Fn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/halftone-texture.png",alt:"",class:"halftone-texture position-image"},null,-1)),T3=Fn(()=>n.createElementVNode("div",{class:"gradient-color"},null,-1));function C3(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",{ref:"gamesContainerGP",class:n.normalizeClass(o.thumbnailhighlights)},[t.playStatus!=2?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass((t.playStatus==1,"icon-thumb"))},[n.createElementVNode("img",{width:t.playStatus==1?60:40,src:t.playStatus==1?"http://golstatsimages.blob.core.windows.net/images-library/icn-live@2x.png":"http://golstatsimages.blob.core.windows.net/images-library/icn-info@2x.png"},null,8,h3)],2)):n.createCommentVNode("",!0),u3,t.showVideos?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(o.playbutton),onClick:e[0]||(e[0]=(...r)=>o.onclickPlayVideos&&o.onclickPlayVideos(...r))},f3,2)):n.createCommentVNode("",!0),n.createElementVNode("div",p3,[n.createElementVNode("div",{class:n.normalizeClass(o.containerinfogame)},[n.createElementVNode("div",{class:n.normalizeClass(o.matchcontainer)},[t.matchday?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(o.matchboxContainer)},n.toDisplayString(t.matchday),3)):n.createCommentVNode("",!0),t.seasonName?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(o.seasonnameContainer)},n.toDisplayString(t.seasonName),3)):n.createCommentVNode("",!0)],2),t.date?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(o.seasoncontainer)},n.toDisplayString(t.date),3)):n.createCommentVNode("",!0)],2),t.type==0?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass(o.texttitle)},n.toDisplayString(t.nameCategory),3)):(n.openBlock(),n.createElementBlock("span",{key:1,class:n.normalizeClass(o.texttitle2)},n.toDisplayString(t.nameCategory),3)),t.showimg?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[t.typeImg==0?(n.openBlock(),n.createElementBlock("img",{key:0,src:t.photoProfile,class:n.normalizeClass(o.playerimage)},null,10,g3)):n.createCommentVNode("",!0),t.typeImg==1?(n.openBlock(),n.createElementBlock("img",{key:1,src:t.photoProfile,alt:""},null,8,y3)):n.createCommentVNode("",!0),t.typeImg==2?(n.openBlock(),n.createElementBlock("img",{key:2,src:t.photoProfile,class:"img-number"},null,8,b3)):n.createCommentVNode("",!0)],64)):n.createCommentVNode("",!0),n.createElementVNode("div",S3,[n.createElementVNode("div",{class:n.normalizeClass(o.hometeam)},[n.createElementVNode("span",{class:n.normalizeClass(o.teamname),style:n.normalizeStyle({color:t.colorFontAway})},n.toDisplayString(t.nameHomeTeam),7),n.createElementVNode("img",{src:t.logoHome,alt:"",class:n.normalizeClass(o.teamlogo)},null,10,w3),n.createElementVNode("span",{class:n.normalizeClass(o.teamscore)},n.toDisplayString(t.scoreHome),3)],2),n.createElementVNode("span",{class:n.normalizeClass(o.points)},":",2),n.createElementVNode("div",{class:n.normalizeClass(o.awayteam)},[n.createElementVNode("span",{class:n.normalizeClass(o.teamscore)},n.toDisplayString(t.scoreAway),3),n.createElementVNode("img",{src:t.logoAway,alt:"",class:n.normalizeClass(o.teamlogo)},null,10,_3),n.createElementVNode("span",{class:n.normalizeClass(o.teamname),style:n.normalizeStyle({color:t.colorFontAway})},n.toDisplayString(t.nameAwayTeam),7)],2)])]),n.createElementVNode("img",{src:t.background,alt:"",class:"bkg-blackwhite position-image"},null,8,k3),E3,T3],2)}const x3=rs(Gr,[["render",C3],["__scopeId","data-v-77384f47"]]);let Km=null;const jr={components:{},props:{colorFont:{type:String,default:"#000000"},showVideos:{type:Boolean,default:!0},colorBackgroundHome:{type:String,default:"#000000"},colorBackgroundAway:{type:String,default:"#FFFFFF"},nameCategory:{type:String,default:""},photoProfile:{type:String,default:""},logoHome:{type:String,default:""},logoAway:{type:String,default:""},scoreHome:{type:[String,Number],default:""},scoreAway:{type:[String,Number],default:""},background:{type:String,default:""},typeImg:{type:Number,default:0},nameHomeTeam:{type:String,default:""},nameAwayTeam:{type:String,default:""},namePlayer:{type:String,default:""}},data(){return{gamesContainerSPWidth:0}},computed:{playbutton(){const s=this.gamesContainerSPWidth;return s<=400?"play-button400":s<=540?"play-button540":s<=650?"play-button650":"play-button"},firstline(){const s=this.gamesContainerSPWidth;return s<=400?"first-line400":s<=540?"first-line540":s<=650?"first-line650":"first-line"},secondline(){const s=this.gamesContainerSPWidth;return s<=400?"second-line400":s<=540?"second-line540":s<=650?"second-line650":"second-line"},playername(){const s=this.gamesContainerSPWidth;return s<=400?"player-name400":s<=540?"player-name540":s<=650?"player-name650":"player-name"},playerimage(){const s=this.gamesContainerSPWidth;return s<=400?"player-image400":s<=540?"player-image540":s<=650?"player-image650":"player-image"},thumbnailhighlights(){const s=this.gamesContainerSPWidth;return s<=400?"thumbnail-highlights400":s<=540?"thumbnail-highlights540":s<=650?"thumbnail-highlights650":"thumbnail-highlights"}},methods:{onclickPlayVideos(){this.$emit("onclickPlayVideos")},setUpResizeObserver(){if(window.ResizeObserver)Km=new ResizeObserver(()=>{this.gamesContainerSPWidth=this.$refs.gamesContainerSP?this.$refs.gamesContainerSP.clientWidth:0,this.movil=this.gamesContainerSPWidth<740}),Km.observe(this.$refs.gamesContainerSP);else throw new Error("Resize observer not supported!")}},mounted(){setTimeout(()=>{this.setUpResizeObserver()},100)}},qm=()=>{n.useCssVars(s=>({"17845cea":s.colorBackgroundHome+"30","3e8f3cad":s.colorBackgroundHome}))},Ym=jr.setup;jr.setup=Ym?(s,e)=>(qm(),Ym(s,e)):qm;const Mn=s=>(n.pushScopeId("data-v-df5486d2"),s=s(),n.popScopeId(),s),v3=Mn(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[n.createElementVNode("path",{d:"M6.6041 22.8554C6.42105 22.7512 6.26805 22.5956 6.1616 22.4053C6.05515 22.215 5.99927 21.9973 6.00001 21.7755V2.22137C6.00026 2.00039 6.0565 1.78362 6.16274 1.59409C6.26899 1.40456 6.42127 1.24936 6.6034 1.14499C6.78553 1.04062 6.9907 0.990981 7.1971 1.00135C7.4035 1.01171 7.60342 1.0817 7.77561 1.20386L21.4907 10.9821C21.6473 11.0935 21.7758 11.2446 21.8646 11.4219C21.9535 11.5992 22 11.7973 22 11.9985C22 12.1996 21.9535 12.3977 21.8646 12.575C21.7758 12.7523 21.6473 12.9034 21.4907 13.0148L7.77561 22.7954C7.60369 22.9178 7.40392 22.988 7.19761 22.9986C6.9913 23.0092 6.78617 22.9597 6.6041 22.8554ZM7.14347 21.7779L20.8585 11.9996L7.14347 21.7779Z",fill:"#CBEE6B"})],-1)),A3=[v3],L3={class:"player-image position-image"},I3=["src"],R3=["src"],B3=["src"],N3=["src"],D3=Mn(()=>n.createElementVNode("div",{class:"gradient-back position-image"},null,-1)),P3=["src"],O3=Mn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/paper-texture.png",alt:"",class:"paper-texture position-image"},null,-1)),F3={class:"text-container"},M3=Mn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/halftone-texture.png",alt:"",class:"halftone-texture position-image"},null,-1)),$3={class:"base-logo",width:"91",height:"216",viewBox:"0 0 91 216",fill:"none",xmlns:"http://www.w3.org/2000/svg"},V3=["fill"];function U3(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",{ref:"gamesContainerSP",class:n.normalizeClass(o.thumbnailhighlights)},[t.showVideos?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(o.playbutton),onClick:e[0]||(e[0]=(...r)=>o.onclickPlayVideos&&o.onclickPlayVideos(...r))},A3,2)):n.createCommentVNode("",!0),n.createElementVNode("div",L3,[t.typeImg==0?(n.openBlock(),n.createElementBlock("img",{key:0,src:t.photoProfile,class:n.normalizeClass(o.playerimage)},null,10,I3)):n.createCommentVNode("",!0),t.typeImg==1?(n.openBlock(),n.createElementBlock("img",{key:1,src:t.photoProfile,alt:""},null,8,R3)):n.createCommentVNode("",!0),t.typeImg==2?(n.openBlock(),n.createElementBlock("img",{key:2,src:t.photoProfile,class:"img-number"},null,8,B3)):n.createCommentVNode("",!0)]),n.createElementVNode("img",{src:t.logoHome,alt:"",class:"team-logo"},null,8,N3),D3,n.createElementVNode("img",{src:t.background,alt:"",class:"bkg-blackwhite position-image"},null,8,P3),O3,n.createElementVNode("div",F3,[n.createElementVNode("span",{class:n.normalizeClass(o.firstline)},"MEJORES JUGADAS",2),n.createElementVNode("span",{class:n.normalizeClass(o.secondline)},n.toDisplayString(t.nameCategory),3),n.createElementVNode("div",{class:n.normalizeClass(o.playername),style:n.normalizeStyle({color:t.colorFont})},n.toDisplayString(t.namePlayer),7)]),M3,(n.openBlock(),n.createElementBlock("svg",$3,[n.createElementVNode("path",{d:"M91.5 216L0 -0.5H91.5V216Z",fill:t.colorBackgroundHome},null,8,V3)]))],2)}const z3=rs(jr,[["render",U3],["__scopeId","data-v-df5486d2"]]);function G3(s){const e=n.ref({width:0,height:0});function t(){const a=s.value.getBoundingClientRect();e.value.width=a.width,e.value.height=a.height}return n.onMounted(()=>{t(),window.addEventListener("resize",t)}),n.onUnmounted(()=>{window.removeEventListener("resize",t)}),{elementSize:e}}const j3="_ptg_1shb4_2",H3="_ptgtitle_1shb4_7",W3="_ptgtitle450_1shb4_23",K3="_pgtcontainercard_1shb4_39",q3="_pgtcontainercard350_1shb4_44",Y3={ptg:j3,ptgtitle:H3,ptgtitle450:W3,pgtcontainercard:K3,pgtcontainercard350:q3},Hr={components:{GSCSlider:KR,GSCThumbnailCategory:S4,GSCThumbnailCategoryTeam:D4,GSCThumbnailCategoryTeamAway:Y4,GSCThumbnailHighlightGamePlayer:x3,GSCThumbnailCategoryTeamAwayLive:d3,GSCThumbnailSummaryPlayer:z3,GSCThumbnailHighlightGameHistoric:n4},setup(){const s=n.ref("ptgDiv"),{elementSize:e}=G3(s);return{ptgDiv:s,elementSize:e}},props:{isWidget:{type:Boolean,default:!1},teamWidget:{type:Number,default:0},receiveData:{type:Boolean,default:!1},information:{type:Array,default:()=>[]},title:{type:String,default:"100% de sus participaciones en cada partido:"},type:{type:Number,default:0},showVideos:{type:Boolean,default:!0},viewType:{type:Number,default:2},local:{type:Boolean,default:!0},data:{type:Object,default:()=>{}},backgroundColor:{type:String,default:"#0D1D29"},backgroundFooter:{type:String,default:"#192733"},matchdayView:{type:Number,default:1},pxScroll:{type:Number,default:100},arrows:{type:Boolean,default:!0},arrowsScrollHide:{type:Boolean,default:!1},arrowsHideOnNoScroll:{type:Boolean,default:!1},arrowsColor:{type:String,default:"#CBEE6B"},arrowsHeight:{type:Number,default:15},arrowsWidth:{type:Number,default:15},arrowsPadding:{type:Number,default:5},arrowsMargin:{type:Number,default:10},arrowsRadius:{type:String,default:"0%"},arrowsBorder:{type:String,default:"none"},arrowsBackground:{type:String,default:"#0D1D29"},arrowsContainerBgL:{type:String,default:"#0D1D29"},arrowsContainerBgR:{type:String,default:"#0D1D29"},scrollColor:{type:String,default:"#c3e569"},arrowsPosition:{type:String,default:"relative"},height:{type:String,default:"100%"},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])},playVideosPrivileges:{type:Object,default:null},awaitForSpecificsPlaysBySeason:{type:Boolean,default:!1},awaitForBestPlaysBySeasonAndTeam:{type:Boolean,default:!1},awaitForBestPlaysBySeasonAndGame:{type:Boolean,default:!1},awaitForTeamsInfo:{type:Boolean,default:!1},specificsPlaysBySeasonResponse:{type:Object,default:null},bestPlaysBySeasonAndTeamResponse:{type:Object,default:null},bestPlaysBySeasonAndGameResponse:{type:Object,default:null},teamsInfoResponse:{type:Object,default:null}},data(){return{token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE",printData:[],teamsInfo:[],playerPhoto:!0,homeTeam:0,flagGames:[],lastseason:0,arrayMatchdays:[],awayTeam:0,goalCategories:[12,55,"35_r","54_r"],resumeCategories:[607,608,12,55,54,35,14,52,15,53,466,477],lastType:0,lastUrl:"",teamsInfoLastUrl:""}},watch:{data:{immediate:!0,handler(s){this.type!==14&&(this.receiveData||this.getTeamsInfo(s)),this.getStats(s)}},teamsInfoResponse(s){s&&(this.receiveData||this.getTeamsInfo(this.data))},bestPlaysBySeasonAndTeamResponse(s){s&&this.getStats(this.data)},bestPlaysBySeasonAndGameResponse(s){s&&this.getStats(this.data)},specificsPlaysBySeasonResponse(s){s&&this.getStats(this.data)}},computed:{ptgtitleClass(){return this.elementSize.width<=450?this.$style.ptgtitle450:this.$style.ptgtitle},pgtcontainercardClass(){return this.elementSize.width<=350?this.$style.pgtcontainercard350:this.$style.pgtcontainercard}},methods:{getBestPlaysUrl({season:s,player:e,team:t,game:a,category:i}){let o="https://wlduw4woy3.execute-api.us-east-2.amazonaws.com/prod/best-plays/seasons/";return s&&(o+=`${s}`),e&&(o+=`/players/${e}`),t&&(o+=`/teams/${t}`),a&&(o+=`/games/${a}`),i&&(o+=`/categories/${i}`),this.videoPrivilegesPlayingAs.has(1)&&!this.videoPrivilegesPlayingAs.has(2)?o+="?isLocal=1":this.videoPrivilegesPlayingAs.has(2)&&!this.videoPrivilegesPlayingAs.has(1)&&(o+="?isVisitor=1"),this.isWidget&&this.teamWidget!=0&&[3,4,5].includes(this.type)&&(o+=`?t=${this.teamWidget}`),o},getIsSameScenario(s,e){const t=this.lastType===s&&this.lastUrl===e;return t||(this.lastType=s,this.lastUrl=e),t},onclickPlayVideos(s){let e=[],t=s.data.game_id?[s.data.game_id]:null;s.type==2?s.data.position_id==1?s.data.category==0?e=s.isAllPlays?[14,52,15,53,300,301,308,309,310,311,304,305,306,307,260,261,312,265,266,267,268,313,314,43,324,323,478,479,480,481,474,475,476,477,40,26,325,16,51,462,463,151,154,156,591,592,159,162,163,429,165,593,594,168,171,172,430,174,595,596,177,180,181,431,467,358,361,363,366,369,370,469,372,376,378,379,470,381,385,387,388,471,607,608,262,263]:[42,55,324,323,608,39,774,802,52,53,40,54]:e=s.data.category:s.data.category==0?e=s.isAllPlays?[56,57,59,60,326,213,214,215,216,583,584,122,123,124,125,585,586,128,129,130,131,133,327,587,588,136,137,138,139,589,590,142,143,144,145,146,147,485,486,487,488,489,490,491,492,10,27,597,598,538,539,599,600,541,542,601,602,545,546,603,604,548,549,561,562,100,563,564,103,104,105,106,107,108,565,566,111,567,568,114,115,116,117,118,119,4,88,5,34,402,459,460,461,233,403,456,457,458,236,404,453,454,455,240,405,450,451,452,243,408,447,448,449,283,409,444,445,446,285,410,441,442,443,290,411,438,439,440,292,412,435,436,437,297,414,415,416,417,244,418,419,420,421,401,581,582,331,506,530,579,580,334,507,531,577,578,344,508,532,575,576,424,509,533,573,574,341,529,534,571,572,340,528,535,569,570,427,527,536,348,349,350,465,352,353,354,466,14,52,15,53,218,219,220,221,496,497,498,499,500,501,502,503,217,504,505,521,522,543,33,209,208,517,206,207,26,325,16,51,463,151,154,156,591,592,159,162,163,429,165,593,594,168,171,172,430,174,595,596,177,180,181,431,467,358,361,363,366,369,370,469,372,376,378,379,470,381,385,387,388,471,607,608,210,212]:[12,35,10,27,607,61,519,98,101,109,112,121,122,127,128,135,136,141,142,161,170,179,702,730,466,217,211,232,235,239,242,282,284,289,291,296,485,486,487,488,14,15,257]:e=s.data.category:s.type==3?s.data.category==0?e=[607,608,12,55,54,35,14,52,15,53,466,477,40,257,39]:e=s.data.category:s.data.category!=0?e=s.data.category:e=[607,608,12,55,54,35,14,52,15,53,466,477],this.data.isPrematch===1&&(t=null);const a=[1,2,3];let i={type:s.data.has_mxm?1:0,seasonId:s.data.season_id,mainSectionType:1,playListType:s.type,categoryIds:s.categories&&s.categories.length?s.categories:e,gameIds:t,playerIds:s.data.player_id?[s.data.player_id]:[],goalkeeperIds:s.data.position_id==1?s.data.player_id?[s.data.player_id]:[]:[],teamId:s.data.team_id?s.data.team_id:0,matchResult:s.data.matchResult?[s.matchResult]:a,playData:{},advancedFilter:{playListTitle:""}};s.data.category!==0&&(i.advancedFilter.mainCategoryId=s.data.category),this.$emit("openmedia",i)},onClickVideos(s){this.$emit("onClickVideos",s)},onClickCard(s){this.$emit("onClickCard",s)},async getTeamsInfo(s){if(this.awaitForTeamsInfo&&!this.teamsInfoResponse)return;const e="https://d2oco6mqmc.execute-api.us-west-2.amazonaws.com/prod/teamsBySeason/"+s.season;if(e===this.teamsInfoLastUrl)return;this.teamsInfoLastUrl=e;const t=xm.create({headers:{Authorization:`${this.token}`}}),a=this.awaitForTeamsInfo?this.teamsInfoResponse:await t.get(e);for(let i=0;i<a.data.teams.length;i++)this.teamsInfo[a.data.teams[i].team_id]=a.data.teams[i]},async getStats(s){if(!this.receiveData){const i=xm.create({headers:{Authorization:`${this.token}`}});var e=[],t={},a={};if(this.type===0){if(a=await i.get("https://uof4tt5l46.execute-api.us-west-2.amazonaws.com/prod/v3/playerInfo/"+s.season+"/"+s.player),this.videoPrivilegesPlayingAs)if(a.data.seasons[s.season]){const o=a.data.team_id;a.data.seasons[s.season].games_played=a.data.seasons[s.season].games_played.filter(r=>(r.playingAs=r.home_team===o?1:2,this.videoPrivilegesPlayingAs.has(r.playingAs)))}else{const o=a.data.team_id;a.data.national_seasons[s.season].games_played=a.data.national_seasons[s.season].games_played.filter(r=>(r.playingAs=r.home_team===o?1:2,this.videoPrivilegesPlayingAs.has(r.playingAs)))}if(a.data.seasons[s.season])for(let o=0;o<a.data.seasons[s.season].games_played.length;o++)t={player_id:s.player,color:a.data.info_thumbnails.colors.background_color,colorfont:a.data.info_thumbnails.colors.font_color,photo_profile:a.data.info_thumbnails.images.player_in_action[0]?"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.info_thumbnails.images.player_in_action[0]:"https://az755631.vo.msecnd.net/players-profile/"+s.player+".png",team_logo:"https://az755631.vo.msecnd.net/teams-150/"+a.data.seasons[s.season].games_played[o].home_team+".png",player_name:a.data.seasons[s.season].games_played[o].home_team_acronym+" "+a.data.seasons[s.season].games_played[o].home_team_score+" : "+a.data.seasons[s.season].games_played[o].visiting_team_score+" "+a.data.seasons[s.season].games_played[o].visiting_team_acronym,team_id_b:a.data.seasons[s.season].games_played[o].home_team,season_id:a.data.seasons[s.season].games_played[o].season_id,name:"",date:this.obtenerNombreCompletoFecha(a.data.seasons[s.season].games_played[o].date),category:0,team_id:a.data.team_id,game_id:a.data.seasons[s.season].games_played[o].game_id,has_mxm:a.data.seasons[s.season].games_played[o].has_mxm,position_id:a.data.position_id,scorehome:a.data.seasons[s.season].games_played[o].home_team_score,scoreaway:a.data.seasons[s.season].games_played[o].visiting_team_score,hometeamacronym:a.data.seasons[s.season].games_played[o].home_team_acronym,visitingteamacronym:a.data.seasons[s.season].games_played[o].visiting_team_acronym,seasonname:a.data.seasons[s.season].name,seasonname2:a.data.seasons[s.season].name.replace("Clausura","CL ").replace("Apertura","AP "),match:a.data.seasons[s.season].games_played[o].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),score:a.data.seasons[s.season].games_played[o].home_team_score+" : "+a.data.seasons[s.season].games_played[o].visiting_team_score,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.info_thumbnails.images.background_player_in_action[0],backgroundhome:a.data.seasons[s.season].games_played[o].info_thumbnails.home_colors.background_color,backgroundaway:a.data.seasons[s.season].games_played[o].info_thumbnails.away_colors.background_color,colorfont_home:a.data.seasons[s.season].games_played[o].info_thumbnails.home_colors.font_color,colorfont_away:a.data.seasons[s.season].games_played[o].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.seasons[s.season].games_played[o].home_team+".png",logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.seasons[s.season].games_played[o].visiting_team+".png",total:a.data.seasons[s.season].games_played[o].matchday_abbreviation.replace("M","Jor "),background_card:"https://az755631.vo.msecnd.net/golstats2-teams/"+a.data.seasons[s.season].games_played[o].home_team+"_"+a.data.seasons[s.season].games_played[o].season_id+"_r1.jpg"},e.push(t);else for(let o=0;o<a.data.national_seasons[s.season].games_played.length;o++)t={player_id:s.player,color:a.data.info_thumbnails.colors.background_color,colorfont:a.data.info_thumbnails.colors.font_color,photo_profile:a.data.info_thumbnails.images.player_in_action[0]?"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.info_thumbnails.images.player_in_action[0]:"https://az755631.vo.msecnd.net/players-profile/"+s.player+".png",team_logo:"https://az755631.vo.msecnd.net/teams-150/"+a.data.national_seasons[s.season].games_played[o].home_team+".png",player_name:a.data.national_seasons[s.season].games_played[o].home_team_acronym+" "+a.data.national_seasons[s.season].games_played[o].home_team_score+" : "+a.data.national_seasons[s.season].games_played[o].visiting_team_score+" "+a.data.national_seasons[s.season].games_played[o].visiting_team_acronym,team_id_b:a.data.national_seasons[s.season].games_played[o].home_team,season_id:a.data.national_seasons[s.season].games_played[o].season_id,name:"",date:this.obtenerNombreCompletoFecha(a.data.national_seasons[s.season].games_played[o].date),category:0,team_id:a.data.team_id,game_id:a.data.national_seasons[s.season].games_played[o].game_id,position_id:a.data.position_id,scorehome:a.data.national_seasons[s.season].games_played[o].home_team_score,scoreaway:a.data.national_seasons[s.season].games_played[o].visiting_team_score,hometeamacronym:a.data.national_seasons[s.season].games_played[o].home_team_acronym,visitingteamacronym:a.data.national_seasons[s.season].games_played[o].visiting_team_acronym,seasonname:a.data.national_seasons[s.season].name,seasonname2:a.data.national_seasons[s.season].name.replace("Clausura","CL ").replace("Apertura","AP "),match:a.data.national_seasons[s.season].games_played[o].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),score:a.data.national_seasons[s.season].games_played[o].home_team_score+" : "+a.data.national_seasons[s.season].games_played[o].visiting_team_score,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.info_thumbnails.images.background_player_in_action[0],backgroundhome:a.data.national_seasons[s.season].games_played[o].info_thumbnails.home_colors.background_color,backgroundaway:a.data.national_seasons[s.season].games_played[o].info_thumbnails.away_colors.background_color,colorfont_home:a.data.national_seasons[s.season].games_played[o].info_thumbnails.home_colors.font_color,colorfont_away:a.data.national_seasons[s.season].games_played[o].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.national_seasons[s.season].games_played[o].home_team+".png",logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.national_seasons[s.season].games_played[o].visiting_team+".png",total:a.data.national_seasons[s.season].games_played[o].matchday_abbreviation.replace("M","Jor "),background_card:"https://az755631.vo.msecnd.net/golstats2-teams/"+a.data.national_seasons[s.season].games_played[o].home_team+"_"+a.data.national_seasons[s.season].games_played[o].season_id+"_r1.jpg"},e.push(t)}if(this.type===1){if(this.awaitForBestPlaysBySeasonAndTeam&&!this.bestPlaysBySeasonAndTeamResponse)return;const o=this.getBestPlaysUrl({season:s.season,team:s.team});if(this.getIsSameScenario(1,o))return;a=this.awaitForBestPlaysBySeasonAndTeam?this.bestPlaysBySeasonAndTeamResponse:await i.get(o);for(let r=0;r<a.data.categories.length;r++){this.playerPhoto=!1;const l=Math.floor(Math.random()*a.data.categories[r].info_thumbnails.images.background_default_categories.length),d=Math.floor(Math.random()*a.data.categories[r].info_thumbnails.images.background_default_teams.length);t={player_action:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.categories[r].info_thumbnails.images.background_default_categories[l],background_action:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.categories[r].info_thumbnails.images.background_default_teams[d],color:a.data.categories[r].info_thumbnails.colors.background_color,team_logo:"https://az755631.vo.msecnd.net/teams-80/"+a.data.categories[r].info_thumbnails.team_logo,player_name:a.data.categories[r].category_name,team_name:this.teamsInfo[a.data.team_id].colloquial_name,team_id:a.data.team_id,colorfont:a.data.categories[r].info_thumbnails.colors.font_color,team_id_b:a.data.team_id,category:a.data.categories[r].categories,season_id:a.data.season_id,total:a.data.categories[r].total,background_card:"https://az755631.vo.msecnd.net/golstats2-teams/"+a.data.team_id+"_"+a.data.season_id+"_r1.jpg"},e.push(t)}}if(this.type===2){const o=this.getBestPlaysUrl({season:s.season,game:s.game});if(this.getIsSameScenario(2,o))return;a=await i.get(o);for(let r=0;r<a.data.categories.length;r++){this.playerPhoto=!1;const l=Math.floor(Math.random()*a.data.categories[r].info_thumbnails.images.player_in_action.length),d=Math.floor(Math.random()*a.data.categories[r].info_thumbnails.images.background_default_categories.length);t={player_action:a.data.categories[r].info_thumbnails.images.player_in_action[l]?"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.categories[r].info_thumbnails.images.player_in_action[l]:"https://az755631.vo.msecnd.net/players-profile/"+s.player+".png",background_action:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.categories[r].info_thumbnails.images.background_default_categories[d],color:a.data.categories[r].info_thumbnails.colors.background_color,team_logo:"https://az755631.vo.msecnd.net/teams-80/"+a.data.categories[r].info_thumbnails.team_logo,player_name:a.data.categories[r].category_name,season_id:s.season,colorfont:a.data.categories[r].info_thumbnails.colors.font_color,player_id:s.player,team_id:a.data.categories[r].info_thumbnails.colors.team_id,category:a.data.categories[r].categories,total:a.data.categories[r].total,background_card:"https://az755631.vo.msecnd.net/players-profile/"+s.player+".png"},e.push(t)}}if(this.type===3){if(this.playerPhoto=!1,this.awaitForBestPlaysBySeasonAndGame&&!this.bestPlaysBySeasonAndGameResponse)return;const o=this.getBestPlaysUrl({season:s.season,game:s.game});if(this.getIsSameScenario(3,o))return;a=this.awaitForBestPlaysBySeasonAndGame?this.bestPlaysBySeasonAndGameResponse:await i.get(o),this.playVideosPrivileges&&(this.playVideosPrivileges.canPrivilegesTeamPlayVideos?a.data.games[0].players=a.data.games[0].players.filter(r=>r.team_id==this.playVideosPrivileges.seasonAndPrivileges.teamId):a.data.games[0].players=[]);for(let r=0;r<a.data.games[0].players.length;r++){const l=Math.floor(Math.random()*a.data.games[0].players[r].info_thumbnails.images.background_player_in_action.length),d=Math.floor(Math.random()*a.data.games[0].players[r].info_thumbnails.images.player_in_action.length);t={colorbackgroundhome:a.data.games[0].players[r].info_thumbnails.colors.background_color,colorbackgroundaway:"",nameplayer:a.data.games[0].players[r].player_name,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.games[0].players[r].info_thumbnails.images.background_player_in_action[l],namecategory:"RESUMEN",namehometeam:"",nameawayteam:"",category:0,colorfont:a.data.games[0].players[r].info_thumbnails.colors.font_color,team_id:a.data.games[0].players[r].team_id,player_id:a.data.games[0].players[r].player_id,game_id:a.data.games[0].game_id,has_mxm:a.data.games[0].has_mxm,season_id:a.data.season_id,logohome:a.data.games[0].players[r].team_logo,photoprofile:a.data.games[0].players[r].info_thumbnails.images.player_in_action[d]?"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.games[0].players[r].info_thumbnails.images.player_in_action[d]:"https://az755631.vo.msecnd.net/players-profile/"+a.data.games[0].players[r].player_id+".png",logoaway:"",scoreaway:"",scorehome:""},e.push(t)}}if(this.type===4){if(this.awaitForSpecificsPlaysBySeason&&!this.specificsPlaysBySeasonResponse)return;this.playerPhoto=!1;const o="https://wlduw4woy3.execute-api.us-east-2.amazonaws.com/prod/specifics-plays/seasons/"+s.season+"/games/"+s.game;if(this.getIsSameScenario(4,o))return;a=this.awaitForSpecificsPlaysBySeason?this.specificsPlaysBySeasonResponse:await i.get(o);for(let r=0;r<a.data.home_team.categories.length;r++){const l=Math.floor(Math.random()*a.data.home_team.categories[r].info_thumbnails.images.background_default_teams.length);t={game_id:a.data.game_id,has_mxm:a.data.has_mxm,season_id:a.data.season_id,team_id:a.data.home_team.team_id,category:a.data.home_team.categories[r].categories.concat(a.data.home_team.categories[r].rival_categories),background_action:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.home_team.categories[r].info_thumbnails.images.background_default_categories[l],player_action:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.home_team.categories[r].info_thumbnails.images.background_default_categories[l],team_logo:"https://az755631.vo.msecnd.net/teams-150/"+a.data.home_team.team_id+".png",color:a.data.home_team.categories[r].info_thumbnails.colors.background_color,colorfont:a.data.home_team.categories[r].info_thumbnails.colors.font_color,player_name:a.data.home_team.categories[r].category_name,total:a.data.home_team.categories[r].total,team_name:"Local",background_card:"https://az755631.vo.msecnd.net/golstats2-teams/"+a.data.home_team.team_id+"_"+a.data.season_id+"_r1.jpg"},e.push(t)}}if(this.type===5){if(this.awaitForSpecificsPlaysBySeason&&!this.specificsPlaysBySeasonResponse)return;this.playerPhoto=!1;const o="https://wlduw4woy3.execute-api.us-east-2.amazonaws.com/prod/specifics-plays/seasons/"+s.season+"/games/"+s.game;if(this.getIsSameScenario(5,o))return;a=this.awaitForSpecificsPlaysBySeason?this.specificsPlaysBySeasonResponse:await i.get(o);for(let r=0;r<a.data.visiting_team.categories.length;r++){const l=Math.floor(Math.random()*a.data.visiting_team.categories[r].info_thumbnails.images.background_default_categories.length);t={game_id:a.data.game_id,has_mxm:a.data.has_mxm,season_id:a.data.season_id,team_id:a.data.visiting_team.team_id,category:a.data.visiting_team.categories[r].categories.concat(a.data.visiting_team.categories[r].rival_categories),background_action:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.visiting_team.categories[r].info_thumbnails.images.background_default_categories[l],player_action:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.visiting_team.categories[r].info_thumbnails.images.background_default_categories[l],team_logo:"https://az755631.vo.msecnd.net/teams-150/"+a.data.visiting_team.team_id+".png",team_name:"Away",color:a.data.visiting_team.categories[r].info_thumbnails.colors.background_color,colorfont:a.data.visiting_team.categories[r].info_thumbnails.colors.font_color,player_name:a.data.visiting_team.categories[r].category_name,total:a.data.visiting_team.categories[r].total,background_card:"https://az755631.vo.msecnd.net/golstats2-teams/"+a.data.visiting_team.team_id+"_"+a.data.season_id+"_r1.jpg"},e.push(t)}}if(this.type===6){const o=this.getBestPlaysUrl({season:s.season,team:s.team,category:s.category});if(this.getIsSameScenario(6,o))return;a=await i.get(o);for(let r=0;r<a.data.best_plays.length;r++)t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,has_mxm:a.data.best_plays[r].has_mxm,season_id:a.data.season_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:"",seasonname:"",score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)}if(this.type===7){const o=this.getBestPlaysUrl({season:s.season,team:s.team,category:s.category});if(this.getIsSameScenario(7,o))return;a=await i.get(o);for(let r=0;r<a.data.best_plays.length;r++)t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,has_mxm:a.data.best_plays[r].has_mxm,season_id:a.data.season_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:"",seasonname:"",score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)}if(this.type===8){const o=this.getBestPlaysUrl({season:s.season,player:s.player,category:s.category});if(this.getIsSameScenario(8,o))return;a=await i.get(o);for(let r=0;r<a.data.best_plays.length;r++)t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,has_mxm:a.data.best_plays[r].has_mxm,season_id:a.data.season_id,player_id:a.data.player_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:"",scorehome:a.data.best_plays[r].score[0],scoreaway:a.data.best_plays[r].score[1],photo_profile:"https://az755631.vo.msecnd.net/players-profile/"+a.data.best_plays[r].info_thumbnails.player_logo,hometeamacronym:a.data.best_plays[r].home_team_acronym,visitingteamacronym:a.data.best_plays[r].away_team_acronym,seasonname:"",score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)}if(this.type===9){const o=this.getBestPlaysUrl({season:s.season,player:s.player,category:s.category});if(this.getIsSameScenario(9,o))return;a=await i.get(o);for(let r=0;r<a.data.best_plays.length;r++)t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,player_id:a.data.player_id,game_id:a.data.best_plays[r].game_id,has_mxm:a.data.best_plays[r].has_mxm,season_id:a.data.season_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:"",scorehome:a.data.best_plays[r].score[0],scoreaway:a.data.best_plays[r].score[1],seasonname:"",photo_profile:"https://az755631.vo.msecnd.net/players-profile/"+a.data.best_plays[r].info_thumbnails.player_logo,score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)}if(this.type===10){const o="https://ws8d8ye2ii.execute-api.us-west-2.amazonaws.com/prod/v4/seasonsByTeam/"+s.team;if(this.getIsSameScenario(10,o))return;const r=await i.get(o);for(let l=0;l<r.data.seasons[s.season].games.length;l++){const d=Math.floor(Math.random()*r.data.seasons[s.season].games[l].info_thumbnails.images.background_default_games.length);t={photo_profile:"https://az755631.vo.msecnd.net/teams-150/"+r.data.seasons[s.season].games[l].visiting_team+".png",team_logo:"https://az755631.vo.msecnd.net/teams-150/"+r.data.seasons[s.season].games[l].home_team+".png",player_name:r.data.seasons[s.season].games[l].home_team_acronym+" "+r.data.seasons[s.season].games[l].home_team_score+" : "+r.data.seasons[s.season].games[l].visiting_team_score+" "+r.data.seasons[s.season].games[l].visiting_team_acronym,team_id:r.data.seasons[s.season].games[l].game_id,team_id_b:r.data.seasons[s.season].games[l].home_team,season_id:r.data.seasons[s.season].games[l].season_id,name:"",category:0,game_id:r.data.seasons[s.season].games[l].game_id,has_mxm:r.data.seasons[s.season].games[l].has_mxm,seasonname:r.data.seasons[s.season].name,match:r.data.seasons[s.season].games[l].matchday_name.replace("Matchday","Jor"),score:r.data.seasons[s.season].games[l].home_team_score+" : "+r.data.seasons[s.season].games[l].visiting_team_score,background:"https://golstatsimages.blob.core.windows.net/images-library/"+r.data.seasons[s.season].games[l].info_thumbnails.images.background_default_games[d],backgroundhome:r.data.seasons[s.season].games[l].info_thumbnails.home_colors.background_color,backgroundaway:r.data.seasons[s.season].games[l].info_thumbnails.away_colors.background_color,colorfont_home:r.data.best_plays[l].info_thumbnails.home_colors.font_color,colorfont_away:r.data.best_plays[l].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+r.data.seasons[s.season].games[l].home_team+".png",logoaway:"https://az755631.vo.msecnd.net/teams-150/"+r.data.seasons[s.season].games[l].visiting_team+".png",total:r.data.seasons[s.season].games[l].matchday_abbreviation.replace("M","Jor "),background_card:"https://az755631.vo.msecnd.net/golstats2-teams/"+r.data.seasons[s.season].games[l].home_team+"_"+r.data.seasons[s.season].games[l].season_id+"_r1.jpg"},e.push(t)}}if(this.type===11){const o="https://uof4tt5l46.execute-api.us-west-2.amazonaws.com/prod/v3/playerInfo/"+s.season+"/"+s.player;if(this.getIsSameScenario(11,o))return;const r=await i.get(o);for(let l=0;l<r.data.seasons[s.season].games_played.length;l++)t={has_mxm:r.data.seasons[s.season].games_played[l].has_mxm,category:0,player_id:s.player,team_id:r.data.team_id,game_id:r.data.seasons[s.season].games_played[l].game_id,position_id:r.data.position_id,color:r.data.info_thumbnails.colors.background_color,photo_profile:"https://golstatsimages.blob.core.windows.net/images-library/"+r.data.info_thumbnails.images.player_in_action[0],team_logo:"https://az755631.vo.msecnd.net/teams-150/"+r.data.seasons[s.season].games_played[l].home_team+".png",player_name:r.data.seasons[s.season].games_played[l].home_team_acronym+" "+r.data.seasons[s.season].games_played[l].home_team_score+" : "+r.data.seasons[s.season].games_played[l].visiting_team_score+" "+r.data.seasons[s.season].games_played[l].visiting_team_acronym,team_id_b:r.data.seasons[s.season].games_played[l].home_team,season_id:r.data.seasons[s.season].games_played[l].season_id,name:r.data.seasons[s.season].games_played[l].player_name,seasonname:r.data.seasons[s.season].name,match:r.data.seasons[s.season].games_played[l].matchday_name.replace("Matchday","Jor"),scorehome:r.data.seasons[s.season].games_played[l].home_team_score,scoreaway:r.data.seasons[s.season].games_played[l].visiting_team_score,hometeamacronym:r.data.seasons[s.season].games_played[l].home_team_acronym,visitingteamacronym:r.data.seasons[s.season].games_played[l].visiting_team_acronym,background:"https://golstatsimages.blob.core.windows.net/images-library/"+r.data.info_thumbnails.images.background_player_in_action[0],backgroundhome:r.data.seasons[s.season].games_played[l].info_thumbnails.home_colors.background_color,backgroundaway:r.data.seasons[s.season].games_played[l].info_thumbnails.away_colors.background_color,colorfont_home:r.data.seasons[s.season].games_played[l].info_thumbnails.home_colors.font_color,colorfont_away:r.data.seasons[s.season].games_played[l].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+r.data.seasons[s.season].games_played[l].home_team+".png",logoaway:"https://az755631.vo.msecnd.net/teams-150/"+r.data.seasons[s.season].games_played[l].visiting_team+".png",total:r.data.seasons[s.season].games_played[l].matchday_abbreviation.replace("M","Jor "),background_card:"https://az755631.vo.msecnd.net/golstats2-teams/"+r.data.seasons[s.season].games_played[l].home_team+"_"+r.data.seasons[s.season].games_played[l].season_id+"_r1.jpg"},e.push(t)}if(this.type===12){const o=this.getBestPlaysUrl({season:s.season,category:s.category});if(this.getIsSameScenario(12,o))return;const r=await i.get(o);for(let l=0;l<r.data.length;l++)for(let d=0;d<r.data[l].best_plays.length;d++)t={has_mxm:r.data[l].best_plays[d].has_mxm,category:r.data[l].best_plays[d].categories,game_id:r.data[l].best_plays[d].game_id,season_id:r.data[l].season_id,backgroundhome:r.data[l].best_plays[d].info_thumbnails.home_colors.background_color,backgroundaway:r.data[l].best_plays[d].info_thumbnails.away_colors.background_color,colorfont_home:r.data[l].best_plays[d].info_thumbnails.home_colors.font_color,colorfont_away:r.data[l].best_plays[d].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+r.data[l].best_plays[d].info_thumbnails.images.background_default_categories[0],match:"",scorehome:r.data[l].best_plays[d].score[0],scoreaway:r.data[l].best_plays[d].score[1],seasonname:"",photo_profile:"https://az755631.vo.msecnd.net/players-profile/"+r.data[l].best_plays[d].info_thumbnails.player_logo,score:r.data[l].best_plays[d].score[0]+" : "+r.data[l].best_plays[d].score[1]},e.push(t)}if(this.type===13){const o=this.getBestPlaysUrl({season:s.season,category:s.category});if(this.getIsSameScenario(13,o))return;const r=await i.get(o);for(let l=0;l<r.data.length;l++)for(let d=0;d<r.data[l].best_plays.length;d++)t={has_mxm:r.data[l].best_plays[d].has_mxm,category:r.data[l].best_plays[d].categories,game_id:r.data[l].best_plays[d].game_id,season_id:r.data[l].season_id,backgroundhome:r.data[l].best_plays[d].info_thumbnails.home_colors.background_color,backgroundaway:r.data[l].best_plays[d].info_thumbnails.away_colors.background_color,colorfont_home:r.data[l].best_plays[d].info_thumbnails.home_colors.font_color,colorfont_away:r.data[l].best_plays[d].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+r.data[l].best_plays[d].info_thumbnails.images.background_default_categories[0],match:"",scorehome:r.data[l].best_plays[d].score[0],scoreaway:r.data[l].best_plays[d].score[1],seasonname:"",photo_profile:"https://az755631.vo.msecnd.net/players-profile/"+r.data[l].best_plays[d].info_thumbnails.player_logo,score:r.data[l].best_plays[d].score[0]+" : "+r.data[l].best_plays[d].score[1]},e.push(t)}if(this.type===14&&(e=[],s.season)){if(this.lastseason!==s.season){const o=this.getBestPlaysUrl({season:s.season,category:s.category});if(this.getIsSameScenario(14,o))return;const r=await i.get(o);this.flagGames=[],this.arrayMatchdays=[];for(let l=0;l<r.data.length;l++)for(let d=0;d<r.data[l].best_plays.length;d++)r.data[l].best_plays[d].score[0]==0&&r.data[l].best_plays[d].score[1]==0||(t={has_mxm:r.data[l].best_plays[d].has_mxm,category:r.data[l].best_plays[d].categories,game_id:r.data[l].best_plays[d].game_id,plays_status:r.data[l].best_plays[d].plays_status,season_id:r.data[l].season_id,backgroundhome:r.data[l].best_plays[d].info_thumbnails.home_colors.background_color,backgroundaway:r.data[l].best_plays[d].info_thumbnails.away_colors.background_color,colorfont_home:r.data[l].best_plays[d].info_thumbnails.home_colors.font_color,date_time:new Date(r.data[l].best_plays[d].date_time_utc).valueOf(),colorfont_away:r.data[l].best_plays[d].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+r.data[l].best_plays[d].info_thumbnails.images.background_default_categories[0],match:"",scorehome:r.data[l].best_plays[d].score[0],scoreaway:r.data[l].best_plays[d].score[1],seasonname:"",photo_profile:"https://az755631.vo.msecnd.net/players-profile/"+r.data[l].best_plays[d].info_thumbnails.player_logo,score:r.data[l].best_plays[d].score[0]+" : "+r.data[l].best_plays[d].score[1],matchday_id:r.data[l].best_plays[d].matchday_id},this.arrayMatchdays[r.data[l].best_plays[d].matchday_id]?this.flagGames.includes(t.game_id)||(this.arrayMatchdays[r.data[l].best_plays[d].matchday_id].push(t),this.flagGames.push(t.game_id)):(this.arrayMatchdays[r.data[l].best_plays[d].matchday_id]=[],this.flagGames.includes(t.game_id)||(this.arrayMatchdays[r.data[l].best_plays[d].matchday_id].push(t),this.flagGames.push(t.game_id))));e=this.arrayMatchdays[this.matchdayView]?this.arrayMatchdays[this.matchdayView].sort((l,d)=>d.date_time-l.date_time):[]}else e=this.arrayMatchdays[this.matchdayView]?this.arrayMatchdays[this.matchdayView].sort((o,r)=>r.date_time-o.date_time):[];this.lastseason=s.season}if(this.type===15&&(e=[],s.season)){if(this.lastseason!==s.season){const o=this.getBestPlaysUrl({season:s.season,category:s.category});if(this.getIsSameScenario(15,o))return;const r=await i.get(o);this.flagGames=[],this.arrayMatchdays=[];for(let l=0;l<r.data.length;l++)for(let d=0;d<r.data[l].best_plays.length;d++)r.data[l].best_plays[d].score[0]==0&&r.data[l].best_plays[d].score[1]==0||r.data[l].best_plays[d].home_team!=s.team&&r.data[l].best_plays[d].visiting_team!=s.team||(t={has_mxm:r.data[l].best_plays[d].has_mxm,category:r.data[l].best_plays[d].categories,game_id:r.data[l].best_plays[d].game_id,plays_status:r.data[l].best_plays[d].plays_status,season_id:r.data[l].season_id,backgroundhome:r.data[l].best_plays[d].info_thumbnails.home_colors.background_color,backgroundaway:r.data[l].best_plays[d].info_thumbnails.away_colors.background_color,colorfont_home:r.data[l].best_plays[d].info_thumbnails.home_colors.font_color,date_time:new Date(r.data[l].best_plays[d].date_time_utc).valueOf(),colorfont_away:r.data[l].best_plays[d].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+r.data[l].best_plays[d].info_thumbnails.images.background_default_categories[0],match:"",scorehome:r.data[l].best_plays[d].score[0],scoreaway:r.data[l].best_plays[d].score[1],seasonname:"",photo_profile:"https://az755631.vo.msecnd.net/players-profile/"+r.data[l].best_plays[d].info_thumbnails.player_logo,score:r.data[l].best_plays[d].score[0]+" : "+r.data[l].best_plays[d].score[1],matchday_id:r.data[l].best_plays[d].matchday_id},this.arrayMatchdays[r.data[l].best_plays[d].matchday_id]?this.flagGames.includes(t.game_id)||(this.arrayMatchdays[r.data[l].best_plays[d].matchday_id].push(t),this.flagGames.push(t.game_id)):(this.arrayMatchdays[r.data[l].best_plays[d].matchday_id]=[],this.flagGames.includes(t.game_id)||(this.arrayMatchdays[r.data[l].best_plays[d].matchday_id].push(t),this.flagGames.push(t.game_id))));e=this.arrayMatchdays[this.matchdayView]?this.arrayMatchdays[this.matchdayView].sort((l,d)=>d.date_time-l.date_time):[]}else e=this.arrayMatchdays[this.matchdayView]?this.arrayMatchdays[this.matchdayView].sort((o,r)=>r.date_time-o.date_time):[];this.lastseason=s.season}if(this.type===16){const o=this.getBestPlaysUrl({season:s.season,team:s.team,category:s.category});if(this.getIsSameScenario(16,o))return;a=await i.get(o);for(let r=0;r<a.data.best_plays.length;r++)this.viewType==2&&a.data.best_plays[r].home_team==s.team&&(t={has_mxm:a.data.best_plays[r].has_mxm,category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,season_id:a.data.season_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:a.data.best_plays[r].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),seasonname:a.data.best_plays[r].season_name.replace("Clausura","CL ").replace("Apertura","AP "),score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)),this.viewType==1&&(t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,season_id:a.data.season_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:a.data.best_plays[r].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),seasonname:a.data.best_plays[r].season_name.replace("Clausura","CL ").replace("Apertura","AP "),score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)),this.viewType==3&&a.data.best_plays[r].visiting_team==s.team&&(t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,season_id:a.data.season_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:a.data.best_plays[r].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),seasonname:a.data.best_plays[r].season_name.replace("Clausura","CL ").replace("Apertura","AP "),score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t))}if(this.type===17){const o=this.getBestPlaysUrl({season:s.season,team:s.team,category:s.category});if(this.getIsSameScenario(17,o))return;a=await i.get(o);for(let r=0;r<a.data.best_plays.length;r++)this.viewType==2&&a.data.best_plays[r].home_team==s.team&&(t={has_mxm:a.data.best_plays[r].has_mxm,category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,season_id:a.data.season_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,scorehome:a.data.best_plays[r].score[0],scoreaway:a.data.best_plays[r].score[1],backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:a.data.best_plays[r].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),seasonname:a.data.best_plays[r].season_name.replace("Clausura","CL ").replace("Apertura","AP "),score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)),this.viewType==1&&(t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,season_id:a.data.season_id,scorehome:a.data.best_plays[r].score[0],scoreaway:a.data.best_plays[r].score[1],backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:a.data.best_plays[r].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),seasonname:a.data.best_plays[r].season_name.replace("Clausura","CL ").replace("Apertura","AP "),score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)),this.viewType==3&&a.data.best_plays[r].visiting_team==s.team&&(t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,season_id:a.data.season_id,scorehome:a.data.best_plays[r].score[0],scoreaway:a.data.best_plays[r].score[1],backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:a.data.best_plays[r].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),seasonname:a.data.best_plays[r].season_name.replace("Clausura","CL ").replace("Apertura","AP "),score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t))}this.printData=e}},obtenerNombreCompletoFecha(s){if(s){const e=new Date(s),t=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"][e.getUTCDay()],a=e.getUTCDate(),i=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"][e.getUTCMonth()];return`${t} ${a} de ${i}`}else return""}},async created(){}},Jm=()=>{n.useCssVars(s=>({"4f699db7":s.backgroundColor}))},Xm=Hr.setup;Hr.setup=Xm?(s,e)=>(Jm(),Xm(s,e)):Jm;function J3(s,e,t,a,i,o){const r=n.resolveComponent("GSCThumbnailSummaryPlayer"),l=n.resolveComponent("GSCThumbnailCategoryTeam"),d=n.resolveComponent("GSCThumbnailCategoryTeamAwayLive"),c=n.resolveComponent("GSCSlider"),h=n.resolveComponent("GSCThumbnailCategory"),u=n.resolveComponent("GSCThumbnailCategoryTeamAway"),f=n.resolveComponent("GSCThumbnailHighlightGamePlayer"),p=n.resolveComponent("GSCThumbnailHighlightGameHistoric");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(s.$style.ptg),ref:"ptgDiv"},[n.createElementVNode("div",{class:n.normalizeClass(o.ptgtitleClass)},n.toDisplayString(t.title),3),t.receiveData?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[t.information.length>0?(n.openBlock(),n.createBlock(c,{key:0,backgroundColor:t.backgroundColor,pxScroll:t.pxScroll,arrows:t.arrows,arrowsScrollHide:t.arrowsScrollHide,arrowsHideOnNoScroll:t.arrowsHideOnNoScroll,arrowsColor:t.arrowsColor,arrowsHeight:t.arrowsWidth,arrowsWidth:t.arrowsWidth,arrowsPadding:t.arrowsPadding,arrowsMargin:t.arrowsMargin,arrowsRadius:t.arrowsRadius,arrowsBorder:t.arrowsBorder,arrowsBackground:t.arrowsBackground,arrowsContainerBgL:t.arrowsContainerBgL,arrowsContainerBgR:t.arrowsContainerBgR,scrollColor:t.scrollColor,arrowsPosition:t.arrowsPosition,height:t.height},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.information,(m,g)=>(n.openBlock(),n.createElementBlock("div",{key:g,class:n.normalizeClass(o.pgtcontainercardClass),style:n.normalizeStyle(g==0?"margin-left: 0px !important; color: white;":"")},[t.type==3e3?(n.openBlock(),n.createBlock(r,{key:0,type:"player","color-background-home":m.colorbackgroundhome,"color-background-away":m.colorbackgroundaway,"name-player":m.nameplayer,"type-img":0,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:2}),background:m.background,"name-home-team":m.namehometeam,"name-away-team":m.nameawayteam,"name-category":"RESUMEN","logo-away":m.logoaway,"logo-home":m.logohome,"color-font":m.colorfont,"score-home":m.scorehome,"photo-profile":m.photoprofile,"score-away":m.logoaway,"type-style":"summary"},null,8,["color-background-home","color-background-away","name-player","onOnclickPlayVideos","background","name-home-team","name-away-team","logo-away","logo-home","color-font","score-home","photo-profile","score-away"])):n.createCommentVNode("",!0),t.type==4e3?(n.openBlock(),n.createBlock(l,{key:1,type:"team","show-videos":t.showVideos,"name-team":m.team_name!=null?m.team_name:"","type-style":"category","color-background-home":m.color,"logo-home":m.team_logo,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:3}),background:m.player_action,"name-category":m.player_name},null,8,["show-videos","name-team","color-background-home","logo-home","onOnclickPlayVideos","background","name-category"])):n.createCommentVNode("",!0),t.type==5e3?(n.openBlock(),n.createBlock(d,{key:2,type:"team","name-team":m.team_name!=null?m.team_name:"","type-style":"category","color-background-away":m.color,"logo-home":m.team_logo,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:3}),background:m.player_action,"name-category":m.player_name},null,8,["name-team","color-background-away","logo-home","onOnclickPlayVideos","background","name-category"])):n.createCommentVNode("",!0)],6))),128))]),_:1},8,["backgroundColor","pxScroll","arrows","arrowsScrollHide","arrowsHideOnNoScroll","arrowsColor","arrowsHeight","arrowsWidth","arrowsPadding","arrowsMargin","arrowsRadius","arrowsBorder","arrowsBackground","arrowsContainerBgL","arrowsContainerBgR","scrollColor","arrowsPosition","height"])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[i.printData.length>0?(n.openBlock(),n.createBlock(c,{key:0,backgroundColor:t.backgroundColor,pxScroll:t.pxScroll,arrows:t.arrows,arrowsScrollHide:t.arrowsScrollHide,arrowsHideOnNoScroll:t.arrowsHideOnNoScroll,arrowsColor:t.arrowsColor,arrowsHeight:t.arrowsWidth,arrowsWidth:t.arrowsWidth,arrowsPadding:t.arrowsPadding,arrowsMargin:t.arrowsMargin,arrowsRadius:t.arrowsRadius,arrowsBorder:t.arrowsBorder,arrowsBackground:t.arrowsBackground,arrowsContainerBgL:t.arrowsContainerBgL,arrowsContainerBgR:t.arrowsContainerBgR,scrollColor:t.scrollColor,arrowsPosition:t.arrowsPosition,height:t.height},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.printData,(m,g)=>(n.openBlock(),n.createElementBlock("div",{key:g,class:n.normalizeClass(o.pgtcontainercardClass),style:n.normalizeStyle(g==0?"margin-left: 0px !important; color: white;":"")},[t.type==2?(n.openBlock(),n.createBlock(h,{key:0,"color-background-home":m.color,"name-player":t.data.player_name,"type-img":"0",background:m.background_action,"name-category":m.player_name,"logo-home":m.team_logo,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:2}),"photo-profile":m.player_action},null,8,["color-background-home","name-player","background","name-category","logo-home","onOnclickPlayVideos","photo-profile"])):t.type==1?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[m.total>0?(n.openBlock(),n.createBlock(l,{key:0,type:"team","show-videos":t.showVideos,"name-team":m.team_name!=null?m.team_name:"","type-style":"category","color-background-home":m.color,"logo-home":m.team_logo,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:3}),background:m.player_action,"name-category":m.player_name},null,8,["show-videos","name-team","color-background-home","logo-home","onOnclickPlayVideos","background","name-category"])):n.createCommentVNode("",!0)],64)):t.type==4?(n.openBlock(),n.createBlock(l,{key:2,type:"team","show-videos":t.showVideos,"name-team":m.team_name!=null?m.team_name:"","type-style":"category","color-background-home":m.color,"logo-home":m.team_logo,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:3}),background:m.player_action,"name-category":m.player_name},null,8,["show-videos","name-team","color-background-home","logo-home","onOnclickPlayVideos","background","name-category"])):t.type==5?(n.openBlock(),n.createBlock(u,{key:3,type:"team","name-team":m.team_name!=null?m.team_name:"","type-style":"category","color-background-away":m.color,"logo-home":m.team_logo,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:3}),background:m.player_action,"name-category":m.player_name},null,8,["name-team","color-background-away","logo-home","onOnclickPlayVideos","background","name-category"])):t.type==0?(n.openBlock(),n.createBlock(f,{key:4,items:m,type:2,"name-category":"TODAS SUS JUGADAS","color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"color-font-home":m.colorfont_home,"color-font-away":m.colorfont_away,"logo-home":m.logohome,"logo-away":m.logoaway,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:2,isAllPlays:!0}),background:m.background,date:m.date,"name-home-team":m.hometeamacronym,"name-away-team":m.visitingteamacronym,matchday:m.match,"score-home":m.scorehome,"photo-profile":m.photo_profile,"score-away":m.scoreaway,"season-name":m.seasonname2},null,8,["items","color-background-home","color-background-away","color-font-home","color-font-away","logo-home","logo-away","onOnclickPlayVideos","background","date","name-home-team","name-away-team","matchday","score-home","photo-profile","score-away","season-name"])):t.type==6?(n.openBlock(),n.createBlock(p,{key:5,items:m,"color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,background:m.background,"title-category":"GOLES","show-videos":t.showVideos,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:3,categories:i.goalCategories}),matchday:m.match,"season-name":m.seasonname,score:m.score},null,8,["items","color-background-home","color-background-away","logo-home","logo-away","background","show-videos","onOnclickPlayVideos","matchday","season-name","score"])):t.type==7||t.type==16?(n.openBlock(),n.createBlock(p,{key:6,items:m,"color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,background:m.background,"show-videos":t.showVideos,"title-category":"RESUMEN",onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:3,categories:i.resumeCategories}),matchday:m.match,"season-name":m.seasonname,score:m.score},null,8,["items","color-background-home","color-background-away","logo-home","logo-away","background","show-videos","onOnclickPlayVideos","matchday","season-name","score"])):t.type==8?(n.openBlock(),n.createBlock(f,{key:7,items:m,type:2,"name-category":"RESUMEN","color-font-home":m.colorfont_home,"color-font-away":m.colorfont_away,"color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:2}),background:m.background,"name-home-team":m.hometeamacronym,"name-away-team":m.visitingteamacronym,matchday:m.match,"score-home":m.scorehome,"photo-profile":m.photo_profile,"score-away":m.scoreaway,"season-name":m.seasonname},null,8,["items","color-font-home","color-font-away","color-background-home","color-background-away","logo-home","logo-away","onOnclickPlayVideos","background","name-home-team","name-away-team","matchday","score-home","photo-profile","score-away","season-name"])):t.type==9?(n.openBlock(),n.createBlock(f,{key:8,items:m,type:2,"name-category":"RESUMEN","color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:2}),"logo-away":m.logoaway,background:m.background,"name-home-team":m.hometeamacronym,"name-away-team":m.visitingteamacronym,matchday:m.match,"score-home":m.scorehome,"photo-profile":m.photo_profile,"score-away":m.scoreaway,"season-name":m.seasonname},null,8,["items","color-background-home","color-background-away","logo-home","onOnclickPlayVideos","logo-away","background","name-home-team","name-away-team","matchday","score-home","photo-profile","score-away","season-name"])):t.type==10?(n.openBlock(),n.createBlock(p,{key:9,items:m,"color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:1}),background:m.background,"title-category":"RESUMEN",matchday:m.match,"season-name":m.seasonname,score:m.score},null,8,["items","color-background-home","color-background-away","logo-home","logo-away","onOnclickPlayVideos","background","matchday","season-name","score"])):t.type==11?(n.openBlock(),n.createBlock(f,{key:10,items:m,type:2,"name-category":"RESUMEN","color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,background:m.background,"name-home-team":m.hometeamacronym,"name-away-team":m.visitingteamacronym,matchday:m.match,"color-font-home":m.colorfont_home,"color-font-away":m.colorfont_away,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:2}),"score-home":m.scorehome,"photo-profile":m.photo_profile,"score-away":m.scoreaway,"season-name":m.seasonname},null,8,["items","color-background-home","color-background-away","logo-home","logo-away","background","name-home-team","name-away-team","matchday","color-font-home","color-font-away","onOnclickPlayVideos","score-home","photo-profile","score-away","season-name"])):t.type==12?(n.openBlock(),n.createBlock(f,{key:11,items:m,type:2,"name-category":"RESUMEN","color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,"color-font-home":m.colorfont_home,"color-font-away":m.colorfont_away,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:1}),background:m.background,"name-home-team":m.hometeamacronym,"name-away-team":m.visitingteamacronym,matchday:m.match,"score-home":m.scorehome,"photo-profile":m.photo_profile,"score-away":m.scoreaway,"season-name":m.seasonname},null,8,["items","color-background-home","color-background-away","logo-home","logo-away","color-font-home","color-font-away","onOnclickPlayVideos","background","name-home-team","name-away-team","matchday","score-home","photo-profile","score-away","season-name"])):t.type==13?(n.openBlock(),n.createBlock(f,{key:12,items:m,type:2,"name-category":"GOLES","color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:1,categories:i.goalCategories}),background:m.background,"name-home-team":m.hometeamacronym,"name-away-team":m.visitingteamacronym,matchday:m.match,"score-home":m.scorehome,"photo-profile":m.photo_profile,"score-away":m.scoreaway,"season-name":m.seasonname},null,8,["items","color-background-home","color-background-away","logo-home","logo-away","onOnclickPlayVideos","background","name-home-team","name-away-team","matchday","score-home","photo-profile","score-away","season-name"])):t.type==14||t.type==15||t.type==17?(n.openBlock(),n.createBlock(f,{key:13,items:m,type:2,"show-videos":t.showVideos,"play-status":m.plays_status?m.plays_status:0,"name-category":"GOLES","color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:1,categories:i.goalCategories}),background:m.background,"name-home-team":m.hometeamacronym,"name-away-team":m.visitingteamacronym,matchday:m.match,"score-home":m.scorehome,showimg:!1,"photo-profile":m.photo_profile,"score-away":m.scoreaway,"season-name":m.seasonname},null,8,["items","show-videos","play-status","color-background-home","color-background-away","logo-home","logo-away","onOnclickPlayVideos","background","name-home-team","name-away-team","matchday","score-home","photo-profile","score-away","season-name"])):(n.openBlock(),n.createBlock(r,{key:14,type:"player","color-background-home":m.colorbackgroundhome,"color-background-away":m.colorbackgroundaway,"name-player":m.nameplayer,"type-img":0,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:2}),background:m.background,"name-home-team":m.namehometeam,"name-away-team":m.nameawayteam,"name-category":"RESUMEN","logo-away":m.logoaway,"logo-home":m.logohome,"color-font":m.colorfont,"score-home":m.scorehome,"photo-profile":m.photoprofile,"score-away":m.logoaway,"type-style":"summary"},null,8,["color-background-home","color-background-away","name-player","onOnclickPlayVideos","background","name-home-team","name-away-team","logo-away","logo-home","color-font","score-home","photo-profile","score-away"]))],6))),128))]),_:1},8,["backgroundColor","pxScroll","arrows","arrowsScrollHide","arrowsHideOnNoScroll","arrowsColor","arrowsHeight","arrowsWidth","arrowsPadding","arrowsMargin","arrowsRadius","arrowsBorder","arrowsBackground","arrowsContainerBgL","arrowsContainerBgR","scrollColor","arrowsPosition","height"])):n.createCommentVNode("",!0)],64))],2)}const X3={name:"DiscoverVideos",components:{GscSwitchComponent:go,GSCPlayerTeamGame:rs(Hr,[["render",J3],["__cssModules",{$style:Y3}],["__scopeId","data-v-762f089f"]]),MatchDayPicker:Gh},props:{componentWidth:{type:Number,default:768},myTournament:{type:Number,default:1},videoType:{type:Number,default:1},isplayer:{type:Boolean,default:!1},team:{type:Number,default:0},player:{type:Number,default:0},user:{type:Object,default:()=>{}},nextRivalTeam:{type:Object,default:()=>{}},tournamentSelected:{type:Object,default:()=>({id:0})},defaultMatchDayKey:{type:String,default:""},isLeagueSelected:{type:Boolean,default:!1},isFull:{type:Boolean,default:!1},tournamentScheduleKeys:{type:Array,default:()=>[]},seasonSelected:{type:Object,default:()=>{}},defaultMediaPlayerSeason:{type:Number,default:0}},watch:{seasonSelected:{immediate:!0,deep:!1,async handler(){this.getDataGoals()}},tournamentSelected:{immediate:!0,deep:!1,async handler(s){this.myTournament!==s.id?this.currentTabMoreVideos="Goles":this.currentTabMoreVideos="Goles"}},closestRound(s){this.selectedRoundKeyIndex=this.tournamentScheduleKeys.findIndex(e=>e===s),this.selectedRound=s},activeDropGoals:{handler(s){s&&(this.matchDayPickerKey+=1)},immediate:!0}},data(){return{token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE",url:"https://wlduw4woy3.execute-api.us-east-2.amazonaws.com/prod/best-plays/seasons/",showVideos:!0,currentTabMoreVideos:"Resumen",currentMobileTab:"Descubre videos",mobileClass:!1,activeDropGoals:!1,matchdayActive:{},resumeCategory:1000001,goalsCategory:1255e3,resumeType:1,goalsType:2,matchDayPickerKey:0}},mounted(){this.mobileClass=window.innerWidth<768,window.addEventListener("resize",this.handleResize)},methods:{async getDataGoals(){try{this.seasonSelected&&this.seasonSelected.id&&(await ve.create({headers:{Authorization:`${this.token}`}}).get(this.url+this.seasonSelected.id+"/categories/"+this.goalsCategory),this.showVideos=!0)}catch{this.showVideos=!1}},onChangeMatchDay(s){this.matchdayActive=s,this.$emit("change-match-day",s)},handleResize(){this.mobileClass=window.innerWidth<768},onOpenMedia(s,e){e&&(s.type=0),this.$emit("openmedia",s)},onClickOpenMedia(){let t=1,a=[],i=[],o=0,r=this.defaultMediaPlayerSeason||this.user.season,l=[],d=[12,55,"35_r","54_r"],c=[12,35,10,27,607,61,519,98,101,109,112,121,122,127,128,135,136,141,142,161,170,179,702,730,466,217,211,232,235,239,242,282,284,289,291,296,485,486,487,488,14,15,257],h=[55,324,323,608,39,774,802,52,53,40,54];!this.user.is_generic&&this.tournamentSelected.id===this.user.tournament?(r=this.seasonSelected.id,this.user.is_goalkeeper?(a=[this.user.player],l=h,t=2):this.user.is_player?(i=[this.user.player],l=c,t=2):(o=this.user.team,l=d,t=3)):(l=d,t=1);const u={type:0,seasonId:r,tournaments:[],isFeaturedPlayers:!1,mainSectionType:1,playListType:t,gameIds:null,playerIds:i,goalkeeperIds:a,categoryIds:l,teamId:o,matchResult:[1,2,3],categorySingleName:"",avoidCategorySingleName:!1,currentPlayIndex:0,playData:null,lastClashedGameId:null,tournamentsLastClashes:null,advancedFilter:{playListTitle:""},objectPlaySync:null};this.$emit("openmedia",u)}}},Z3={key:0,class:"discover-videos",ref:"discoverVideosRef"},Q3={class:"title-and-button"},e6={class:"calendar-container"};function t6(s,e,t,a,i,o){const r=n.resolveComponent("GscSwitchComponent"),l=n.resolveComponent("MatchDayPicker"),d=n.resolveComponent("GSCPlayerTeamGame");return i.showVideos?(n.openBlock(),n.createElementBlock("div",Z3,[n.createElementVNode("div",Q3,[n.createElementVNode("div",{class:n.normalizeClass(t.componentWidth>900?"menu-container":"menu-container-movil")},[n.createElementVNode("div",{class:n.normalizeClass(t.componentWidth>768?"title-value":t.componentWidth>600?"title-value-tablet":t.componentWidth>400?"title-value-mobile":"title-value-mobilesm")}," Videos ",2)],2),!t.user.is_generic&&t.myTournament===t.tournamentSelected.id?(n.openBlock(),n.createBlock(r,{key:0,buttons:["Goles","Resumen","Proximo rival"],onInput:e[0]||(e[0]=c=>i.currentTabMoreVideos=c),background:"trasparent",height:"24px",width:t.componentWidth>768?"140px":t.componentWidth>600?"120px":t.componentWidth>400?"100px":"81px","font-size":t.componentWidth>768?"14px":t.componentWidth>600||t.componentWidth>400?"12px":"9.1px","font-family":"Poppins-Light",backgroundOptionActive:"transparent",borderWidth:"2px",type:2,arrow:!1,selectedOption:i.currentTabMoreVideos,onOpenmedia:o.onOpenMedia},null,8,["width","font-size","selectedOption","onOpenmedia"])):n.createCommentVNode("",!0)]),i.currentTabMoreVideos=="Goles"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",e6,[n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(l,{height:"48px","margin-top":"5px","disable-matchdays":!0,"match-days":t.tournamentScheduleKeys,"is-landing-mode":!1,"items-to-show":t.componentWidth>600?17:t.componentWidth>400?13:9,"items-to-scroll":t.componentWidth>600?8:t.componentWidth>400?12:9,"default-match-day-key":t.defaultMatchDayKey,key:i.matchDayPickerKey,onChangeMatchDay:o.onChangeMatchDay},null,8,["match-days","items-to-show","items-to-scroll","default-match-day-key","onChangeMatchDay"]))]),n.createVNode(d,{style:{"margin-top":"-30px"},type:14,data:{season:t.seasonSelected.id,category:i.goalsCategory},width:"100%","matchday-view":Object.keys(i.matchdayActive).length>0?i.matchdayActive.matchDayId:1,backgroundColor:"transparent",title:"",onOpenmedia:o.onOpenMedia},null,8,["data","matchday-view","onOpenmedia"])],64)):n.createCommentVNode("",!0),i.currentTabMoreVideos=="Resumen"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[t.isplayer?(n.openBlock(),n.createBlock(d,{key:1,type:8,title:"",style:{"margin-top":"-30px"},backgroundColor:"transparent",data:{season:t.seasonSelected.id,player:t.player,category:1000001},width:"100%",onOpenmedia:e[3]||(e[3]=c=>o.onOpenMedia(c,!0))},null,8,["data"])):(n.openBlock(),n.createBlock(d,{key:0,type:7,title:"",style:{"margin-top":"-30px"},backgroundColor:"transparent",data:{season:t.seasonSelected.id,team:t.team,category:i.resumeCategory},width:"100%",onOpenmedia:e[2]||(e[2]=c=>o.onOpenMedia(c,!0))},null,8,["data"]))],64)):n.createCommentVNode("",!0),i.currentTabMoreVideos=="Proximo rival"?(n.openBlock(),n.createBlock(d,{key:2,type:7,style:{"margin-top":"-30px"},title:"",backgroundColor:"transparent",data:{season:t.seasonSelected.id,team:t.nextRivalTeam.id,category:i.resumeCategory},width:"100%",onOpenmedia:e[4]||(e[4]=c=>o.onOpenMedia(c,!0))},null,8,["data"])):n.createCommentVNode("",!0)],512)):n.createCommentVNode("",!0)}const s6=qe(X3,[["render",t6],["__scopeId","data-v-b485c3f6"]]),a6=["playId","league","season","gameId","playerName","refereeName","stadiumName","finalScore","scoreAtMomentOfPlay","gameDate","homeTeamName","homeTeamLogo","awayTeamName","awayTeamLogo","categoryId","categoryName","startTime","endTime","minuteOfPlay","momentOfPlay","videoUrl"];let Wr=null;function n6(){return Wr||(Wr=a6.reduce((s,e,t)=>(s[e]=t,s),{})),Wr}function i6(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Zm={exports:{}};(function(s,e){(function(t){var a=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,o=/(?:\/|^)\.(?=\/)/g,r=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,l={buildAbsoluteURL:function(d,c,h){if(h=h||{},d=d.trim(),c=c.trim(),!c){if(!h.alwaysNormalize)return d;var u=l.parseURL(d);if(!u)throw new Error("Error trying to parse base URL.");return u.path=l.normalizePath(u.path),l.buildURLFromParts(u)}var f=l.parseURL(c);if(!f)throw new Error("Error trying to parse relative URL.");if(f.scheme)return h.alwaysNormalize?(f.path=l.normalizePath(f.path),l.buildURLFromParts(f)):c;var p=l.parseURL(d);if(!p)throw new Error("Error trying to parse base URL.");if(!p.netLoc&&p.path&&p.path[0]!=="/"){var m=i.exec(p.path);p.netLoc=m[1],p.path=m[2]}p.netLoc&&!p.path&&(p.path="/");var g={scheme:p.scheme,netLoc:f.netLoc,path:null,params:f.params,query:f.query,fragment:f.fragment};if(!f.netLoc&&(g.netLoc=p.netLoc,f.path[0]!=="/"))if(!f.path)g.path=p.path,f.params||(g.params=p.params,f.query||(g.query=p.query));else{var y=p.path,b=y.substring(0,y.lastIndexOf("/")+1)+f.path;g.path=l.normalizePath(b)}return g.path===null&&(g.path=h.alwaysNormalize?l.normalizePath(f.path):f.path),l.buildURLFromParts(g)},parseURL:function(d){var c=a.exec(d);return c?{scheme:c[1]||"",netLoc:c[2]||"",path:c[3]||"",params:c[4]||"",query:c[5]||"",fragment:c[6]||""}:null},normalizePath:function(d){for(d=d.split("").reverse().join("").replace(o,"");d.length!==(d=d.replace(r,"")).length;);return d.split("").reverse().join("")},buildURLFromParts:function(d){return d.scheme+d.netLoc+d.path+d.params+d.query+d.fragment}};s.exports=l})()})(Zm);var Kr=Zm.exports;function Qm(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(s);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable})),t.push.apply(t,a)}return t}function Xe(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qm(Object(t),!0).forEach(function(a){l6(s,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):Qm(Object(t)).forEach(function(a){Object.defineProperty(s,a,Object.getOwnPropertyDescriptor(t,a))})}return s}function o6(s,e){if(typeof s!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var a=t.call(s,e||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function r6(s){var e=o6(s,"string");return typeof e=="symbol"?e:String(e)}function l6(s,e,t){return e=r6(e),e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function Ge(){return Ge=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(s[a]=t[a])}return s},Ge.apply(this,arguments)}const ne=Number.isFinite||function(s){return typeof s=="number"&&isFinite(s)},c6=Number.isSafeInteger||function(s){return typeof s=="number"&&Math.abs(s)<=d6},d6=Number.MAX_SAFE_INTEGER||9007199254740991;let w=function(s){return s.MEDIA_ATTACHING="hlsMediaAttaching",s.MEDIA_ATTACHED="hlsMediaAttached",s.MEDIA_DETACHING="hlsMediaDetaching",s.MEDIA_DETACHED="hlsMediaDetached",s.BUFFER_RESET="hlsBufferReset",s.BUFFER_CODECS="hlsBufferCodecs",s.BUFFER_CREATED="hlsBufferCreated",s.BUFFER_APPENDING="hlsBufferAppending",s.BUFFER_APPENDED="hlsBufferAppended",s.BUFFER_EOS="hlsBufferEos",s.BUFFER_FLUSHING="hlsBufferFlushing",s.BUFFER_FLUSHED="hlsBufferFlushed",s.MANIFEST_LOADING="hlsManifestLoading",s.MANIFEST_LOADED="hlsManifestLoaded",s.MANIFEST_PARSED="hlsManifestParsed",s.LEVEL_SWITCHING="hlsLevelSwitching",s.LEVEL_SWITCHED="hlsLevelSwitched",s.LEVEL_LOADING="hlsLevelLoading",s.LEVEL_LOADED="hlsLevelLoaded",s.LEVEL_UPDATED="hlsLevelUpdated",s.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",s.LEVELS_UPDATED="hlsLevelsUpdated",s.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",s.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",s.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",s.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",s.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",s.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",s.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",s.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",s.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",s.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",s.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",s.CUES_PARSED="hlsCuesParsed",s.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",s.INIT_PTS_FOUND="hlsInitPtsFound",s.FRAG_LOADING="hlsFragLoading",s.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",s.FRAG_LOADED="hlsFragLoaded",s.FRAG_DECRYPTED="hlsFragDecrypted",s.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",s.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",s.FRAG_PARSING_METADATA="hlsFragParsingMetadata",s.FRAG_PARSED="hlsFragParsed",s.FRAG_BUFFERED="hlsFragBuffered",s.FRAG_CHANGED="hlsFragChanged",s.FPS_DROP="hlsFpsDrop",s.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",s.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",s.ERROR="hlsError",s.DESTROYING="hlsDestroying",s.KEY_LOADING="hlsKeyLoading",s.KEY_LOADED="hlsKeyLoaded",s.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",s.BACK_BUFFER_REACHED="hlsBackBufferReached",s.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",s}({}),fe=function(s){return s.NETWORK_ERROR="networkError",s.MEDIA_ERROR="mediaError",s.KEY_SYSTEM_ERROR="keySystemError",s.MUX_ERROR="muxError",s.OTHER_ERROR="otherError",s}({}),N=function(s){return s.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",s.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",s.KEY_SYSTEM_NO_SESSION="keySystemNoSession",s.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",s.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",s.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",s.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",s.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",s.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",s.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",s.MANIFEST_LOAD_ERROR="manifestLoadError",s.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",s.MANIFEST_PARSING_ERROR="manifestParsingError",s.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",s.LEVEL_EMPTY_ERROR="levelEmptyError",s.LEVEL_LOAD_ERROR="levelLoadError",s.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",s.LEVEL_PARSING_ERROR="levelParsingError",s.LEVEL_SWITCH_ERROR="levelSwitchError",s.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",s.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",s.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",s.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",s.FRAG_LOAD_ERROR="fragLoadError",s.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",s.FRAG_DECRYPT_ERROR="fragDecryptError",s.FRAG_PARSING_ERROR="fragParsingError",s.FRAG_GAP="fragGap",s.REMUX_ALLOC_ERROR="remuxAllocError",s.KEY_LOAD_ERROR="keyLoadError",s.KEY_LOAD_TIMEOUT="keyLoadTimeOut",s.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",s.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",s.BUFFER_APPEND_ERROR="bufferAppendError",s.BUFFER_APPENDING_ERROR="bufferAppendingError",s.BUFFER_STALLED_ERROR="bufferStalledError",s.BUFFER_FULL_ERROR="bufferFullError",s.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",s.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",s.INTERNAL_EXCEPTION="internalException",s.INTERNAL_ABORTED="aborted",s.UNKNOWN="unknown",s}({});const _s=function(){},qr={trace:_s,debug:_s,log:_s,warn:_s,info:_s,error:_s};let wa=qr;function h6(s){const e=self.console[s];return e?e.bind(self.console,`[${s}] >`):_s}function u6(s,...e){e.forEach(function(t){wa[t]=s[t]?s[t].bind(s):h6(t)})}function m6(s,e){if(typeof console=="object"&&s===!0||typeof s=="object"){u6(s,"debug","log","info","warn","error");try{wa.log(`Debug logs enabled for "${e}" in hls.js version 1.5.15`)}catch{wa=qr}}else wa=qr}const A=wa,f6=/^(\d+)x(\d+)$/,ef=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Oe{constructor(e){typeof e=="string"&&(e=Oe.parseAttrList(e)),Ge(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const a=new Uint8Array(t.length/2);for(let i=0;i<t.length/2;i++)a[i]=parseInt(t.slice(i*2,i*2+2),16);return a}else return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const a=this[e];return a?parseFloat(a):t}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=f6.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const a={},i='"';for(ef.lastIndex=0;(t=ef.exec(e))!==null;){let o=t[2];o.indexOf(i)===0&&o.lastIndexOf(i)===o.length-1&&(o=o.slice(1,-1));const r=t[1].trim();a[r]=o}return a}}function p6(s){return s!=="ID"&&s!=="CLASS"&&s!=="START-DATE"&&s!=="DURATION"&&s!=="END-DATE"&&s!=="END-ON-NEXT"}function g6(s){return s==="SCTE35-OUT"||s==="SCTE35-IN"}class tf{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const a=t.attr;for(const i in a)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==a[i]){A.warn(`DATERANGE tag attribute: "${i}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=i;break}e=Ge(new Oe({}),a,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const a=new Date(this.attr["END-DATE"]);ne(a.getTime())&&(this._endDate=a)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(ne(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&ne(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class $n{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var Re={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class sf{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[Re.AUDIO]:null,[Re.VIDEO]:null,[Re.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const a=e.split("@",2);let i;a.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(a[1]),this._byteRange=[i,parseInt(a[0])+i]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Kr.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class Yr extends sf{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new $n,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const a=Object.keys(this.levelkeys);if(a.length===1)return this._decryptdata=this.levelkeys[a[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!ne(this.programDateTime))return null;const e=ne(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),a=t.length;if(a>1||a===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,a,i,o,r=!1){const{elementaryStreams:l}=this,d=l[e];if(!d){l[e]={startPTS:t,endPTS:a,startDTS:i,endDTS:o,partial:r};return}d.startPTS=Math.min(d.startPTS,t),d.endPTS=Math.max(d.endPTS,a),d.startDTS=Math.min(d.startDTS,i),d.endDTS=Math.max(d.endDTS,o)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[Re.AUDIO]=null,e[Re.VIDEO]=null,e[Re.AUDIOVIDEO]=null}}class y6 extends sf{constructor(e,t,a,i,o){super(a),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new $n,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const r=e.enumeratedString("BYTERANGE");r&&this.setByteRange(r,o),o&&(this.fragOffset=o.fragOffset+o.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const b6=10;class S6{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,a=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!a||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?ne(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||b6}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function Jr(s){return Uint8Array.from(atob(s),e=>e.charCodeAt(0))}function w6(s){const e=Xr(s).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function _6(s){const e=function(a,i,o){const r=a[i];a[i]=a[o],a[o]=r};e(s,0,3),e(s,1,2),e(s,4,5),e(s,6,7)}function k6(s){const e=s.split(":");let t=null;if(e[0]==="data"&&e.length===2){const a=e[1].split(";"),i=a[a.length-1].split(",");if(i.length===2){const o=i[0]==="base64",r=i[1];o?(a.splice(-1,1),t=Jr(r)):t=w6(r)}}return t}function Xr(s){return Uint8Array.from(unescape(encodeURIComponent(s)),e=>e.charCodeAt(0))}const Ms=typeof self<"u"?self:void 0;var Ne={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},ut={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function af(s){switch(s){case ut.FAIRPLAY:return Ne.FAIRPLAY;case ut.PLAYREADY:return Ne.PLAYREADY;case ut.WIDEVINE:return Ne.WIDEVINE;case ut.CLEARKEY:return Ne.CLEARKEY}}var _a={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",FAIRPLAY:"94ce86fb07ff4f43adb893d2fa968ca2",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function nf(s){if(s===_a.WIDEVINE)return Ne.WIDEVINE;if(s===_a.PLAYREADY)return Ne.PLAYREADY;if(s===_a.CENC||s===_a.CLEARKEY)return Ne.CLEARKEY}function of(s){switch(s){case Ne.FAIRPLAY:return ut.FAIRPLAY;case Ne.PLAYREADY:return ut.PLAYREADY;case Ne.WIDEVINE:return ut.WIDEVINE;case Ne.CLEARKEY:return ut.CLEARKEY}}function Zr(s){const{drmSystems:e,widevineLicenseUrl:t}=s,a=e?[Ne.FAIRPLAY,Ne.WIDEVINE,Ne.PLAYREADY,Ne.CLEARKEY].filter(i=>!!e[i]):[];return!a[Ne.WIDEVINE]&&t&&a.push(Ne.WIDEVINE),a}const rf=function(s){return Ms!=null&&(s=Ms.navigator)!=null&&s.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function E6(s,e,t,a){let i;switch(s){case Ne.FAIRPLAY:i=["cenc","sinf"];break;case Ne.WIDEVINE:case Ne.PLAYREADY:i=["cenc"];break;case Ne.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${s}`)}return T6(i,e,t,a)}function T6(s,e,t,a){return[{initDataTypes:s,persistentState:a.persistentState||"optional",distinctiveIdentifier:a.distinctiveIdentifier||"optional",sessionTypes:a.sessionTypes||[a.sessionType||"temporary"],audioCapabilities:e.map(o=>({contentType:`audio/mp4; codecs="${o}"`,robustness:a.audioRobustness||"",encryptionScheme:a.audioEncryptionScheme||null})),videoCapabilities:t.map(o=>({contentType:`video/mp4; codecs="${o}"`,robustness:a.videoRobustness||"",encryptionScheme:a.videoEncryptionScheme||null}))}]}function ks(s,e,t){return Uint8Array.prototype.slice?s.slice(e,t):new Uint8Array(Array.prototype.slice.call(s,e,t))}const Qr=(s,e)=>e+10<=s.length&&s[e]===73&&s[e+1]===68&&s[e+2]===51&&s[e+3]<255&&s[e+4]<255&&s[e+6]<128&&s[e+7]<128&&s[e+8]<128&&s[e+9]<128,lf=(s,e)=>e+10<=s.length&&s[e]===51&&s[e+1]===68&&s[e+2]===73&&s[e+3]<255&&s[e+4]<255&&s[e+6]<128&&s[e+7]<128&&s[e+8]<128&&s[e+9]<128,ka=(s,e)=>{const t=e;let a=0;for(;Qr(s,e);){a+=10;const i=Vn(s,e+6);a+=i,lf(s,e+10)&&(a+=10),e+=a}if(a>0)return s.subarray(t,t+a)},Vn=(s,e)=>{let t=0;return t=(s[e]&127)<<21,t|=(s[e+1]&127)<<14,t|=(s[e+2]&127)<<7,t|=s[e+3]&127,t},C6=(s,e)=>Qr(s,e)&&Vn(s,e+6)+10<=s.length-e,el=s=>{const e=df(s);for(let t=0;t<e.length;t++){const a=e[t];if(cf(a))return R6(a)}},cf=s=>s&&s.key==="PRIV"&&s.info==="com.apple.streaming.transportStreamTimestamp",x6=s=>{const e=String.fromCharCode(s[0],s[1],s[2],s[3]),t=Vn(s,4),a=10;return{type:e,size:t,data:s.subarray(a,a+t)}},df=s=>{let e=0;const t=[];for(;Qr(s,e);){const a=Vn(s,e+6);e+=10;const i=e+a;for(;e+8<i;){const o=x6(s.subarray(e)),r=v6(o);r&&t.push(r),e+=o.size+10}lf(s,e)&&(e+=10)}return t},v6=s=>s.type==="PRIV"?A6(s):s.type[0]==="W"?I6(s):L6(s),A6=s=>{if(s.size<2)return;const e=Ut(s.data,!0),t=new Uint8Array(s.data.subarray(e.length+1));return{key:s.type,info:e,data:t.buffer}},L6=s=>{if(s.size<2)return;if(s.type==="TXXX"){let t=1;const a=Ut(s.data.subarray(t),!0);t+=a.length+1;const i=Ut(s.data.subarray(t));return{key:s.type,info:a,data:i}}const e=Ut(s.data.subarray(1));return{key:s.type,data:e}},I6=s=>{if(s.type==="WXXX"){if(s.size<2)return;let t=1;const a=Ut(s.data.subarray(t),!0);t+=a.length+1;const i=Ut(s.data.subarray(t));return{key:s.type,info:a,data:i}}const e=Ut(s.data);return{key:s.type,data:e}},R6=s=>{if(s.data.byteLength===8){const e=new Uint8Array(s.data),t=e[3]&1;let a=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return a/=45,t&&(a+=4772185884e-2),Math.round(a)}},Ut=(s,e=!1)=>{const t=B6();if(t){const c=t.decode(s);if(e){const h=c.indexOf("\0");return h!==-1?c.substring(0,h):c}return c.replace(/\0/g,"")}const a=s.length;let i,o,r,l="",d=0;for(;d<a;){if(i=s[d++],i===0&&e)return l;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:l+=String.fromCharCode(i);break;case 12:case 13:o=s[d++],l+=String.fromCharCode((i&31)<<6|o&63);break;case 14:o=s[d++],r=s[d++],l+=String.fromCharCode((i&15)<<12|(o&63)<<6|(r&63)<<0);break}}return l};let tl;function B6(){if(!navigator.userAgent.includes("PlayStation 4"))return!tl&&typeof self.TextDecoder<"u"&&(tl=new self.TextDecoder("utf-8")),tl}const zt={hexDump:function(s){let e="";for(let t=0;t<s.length;t++){let a=s[t].toString(16);a.length<2&&(a="0"+a),e+=a}return e}},Un=Math.pow(2,32)-1,N6=[].push,hf={video:1,audio:2,id3:3,text:4};function Ke(s){return String.fromCharCode.apply(null,s)}function uf(s,e){const t=s[e]<<8|s[e+1];return t<0?65536+t:t}function re(s,e){const t=ff(s,e);return t<0?4294967296+t:t}function mf(s,e){let t=re(s,e);return t*=Math.pow(2,32),t+=re(s,e+4),t}function ff(s,e){return s[e]<<24|s[e+1]<<16|s[e+2]<<8|s[e+3]}function sl(s,e,t){s[e]=t>>24,s[e+1]=t>>16&255,s[e+2]=t>>8&255,s[e+3]=t&255}function D6(s){const e=s.byteLength;for(let t=0;t<e;){const a=re(s,t);if(a>8&&s[t+4]===109&&s[t+5]===111&&s[t+6]===111&&s[t+7]===102)return!0;t=a>1?t+a:e}return!1}function ye(s,e){const t=[];if(!e.length)return t;const a=s.byteLength;for(let i=0;i<a;){const o=re(s,i),r=Ke(s.subarray(i+4,i+8)),l=o>1?i+o:a;if(r===e[0])if(e.length===1)t.push(s.subarray(i+8,l));else{const d=ye(s.subarray(i+8,l),e.slice(1));d.length&&N6.apply(t,d)}i=l}return t}function P6(s){const e=[],t=s[0];let a=8;const i=re(s,a);a+=4;let o=0,r=0;t===0?(o=re(s,a),r=re(s,a+4),a+=8):(o=mf(s,a),r=mf(s,a+8),a+=16),a+=2;let l=s.length+r;const d=uf(s,a);a+=2;for(let c=0;c<d;c++){let h=a;const u=re(s,h);h+=4;const f=u&2147483647;if((u&2147483648)>>>31===1)return A.warn("SIDX has hierarchical references (not supported)"),null;const m=re(s,h);h+=4,e.push({referenceSize:f,subsegmentDuration:m,info:{duration:m/i,start:l,end:l+f-1}}),l+=f,h+=4,a=h}return{earliestPresentationTime:o,timescale:i,version:t,referencesCount:d,references:e}}function pf(s){const e=[],t=ye(s,["moov","trak"]);for(let i=0;i<t.length;i++){const o=t[i],r=ye(o,["tkhd"])[0];if(r){let l=r[0];const d=re(r,l===0?12:20),c=ye(o,["mdia","mdhd"])[0];if(c){l=c[0];const h=re(c,l===0?12:20),u=ye(o,["mdia","hdlr"])[0];if(u){const f=Ke(u.subarray(8,12)),p={soun:Re.AUDIO,vide:Re.VIDEO}[f];if(p){const m=ye(o,["mdia","minf","stbl","stsd"])[0],g=O6(m);e[d]={timescale:h,type:p},e[p]=Xe({timescale:h,id:d},g)}}}}}return ye(s,["moov","mvex","trex"]).forEach(i=>{const o=re(i,4),r=e[o];r&&(r.default={duration:re(i,12),flags:re(i,20)})}),e}function O6(s){const e=s.subarray(8),t=e.subarray(86),a=Ke(e.subarray(4,8));let i=a;const o=a==="enca"||a==="encv";if(o){const l=ye(e,[a])[0].subarray(a==="enca"?28:78);ye(l,["sinf"]).forEach(c=>{const h=ye(c,["schm"])[0];if(h){const u=Ke(h.subarray(4,8));if(u==="cbcs"||u==="cenc"){const f=ye(c,["frma"])[0];f&&(i=Ke(f))}}})}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const r=ye(t,["avcC"])[0];i+="."+zn(r[1])+zn(r[2])+zn(r[3]);break}case"mp4a":{const r=ye(e,[a])[0],l=ye(r.subarray(28),["esds"])[0];if(l&&l.length>12){let d=4;if(l[d++]!==3)break;d=al(l,d),d+=2;const c=l[d++];if(c&128&&(d+=2),c&64&&(d+=l[d++]),l[d++]!==4)break;d=al(l,d);const h=l[d++];if(h===64)i+="."+zn(h);else break;if(d+=12,l[d++]!==5)break;d=al(l,d);const u=l[d++];let f=(u&248)>>3;f===31&&(f+=1+((u&7)<<3)+((l[d]&224)>>5)),i+="."+f}break}case"hvc1":case"hev1":{const r=ye(t,["hvcC"])[0],l=r[1],d=["","A","B","C"][l>>6],c=l&31,h=re(r,2),u=(l&32)>>5?"H":"L",f=r[12],p=r.subarray(6,12);i+="."+d+c,i+="."+h.toString(16).toUpperCase(),i+="."+u+f;let m="";for(let g=p.length;g--;){const y=p[g];(y||m)&&(m="."+y.toString(16).toUpperCase()+m)}i+=m;break}case"dvh1":case"dvhe":{const r=ye(t,["dvcC"])[0],l=r[2]>>1&127,d=r[2]<<5&32|r[3]>>3&31;i+="."+Gt(l)+"."+Gt(d);break}case"vp09":{const r=ye(t,["vpcC"])[0],l=r[4],d=r[5],c=r[6]>>4&15;i+="."+Gt(l)+"."+Gt(d)+"."+Gt(c);break}case"av01":{const r=ye(t,["av1C"])[0],l=r[1]>>>5,d=r[1]&31,c=r[2]>>>7?"H":"M",h=(r[2]&64)>>6,u=(r[2]&32)>>5,f=l===2&&h?u?12:10:h?10:8,p=(r[2]&16)>>4,m=(r[2]&8)>>3,g=(r[2]&4)>>2,y=r[2]&3;i+="."+l+"."+Gt(d)+c+"."+Gt(f)+"."+p+"."+m+g+y+"."+Gt(1)+"."+Gt(1)+"."+Gt(1)+"."+0;break}}return{codec:i,encrypted:o}}function al(s,e){const t=e+5;for(;s[e++]&128&&e<t;);return e}function zn(s){return("0"+s.toString(16).toUpperCase()).slice(-2)}function Gt(s){return(s<10?"0":"")+s}function F6(s,e){if(!s||!e)return s;const t=e.keyId;return t&&e.isCommonEncryption&&ye(s,["moov","trak"]).forEach(i=>{const r=ye(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let l=ye(r,["enca"]);const d=l.length>0;d||(l=ye(r,["encv"])),l.forEach(c=>{const h=d?c.subarray(28):c.subarray(78);ye(h,["sinf"]).forEach(f=>{const p=gf(f);if(p){const m=p.subarray(8,24);m.some(g=>g!==0)||(A.log(`[eme] Patching keyId in 'enc${d?"a":"v"}>sinf>>tenc' box: ${zt.hexDump(m)} -> ${zt.hexDump(t)}`),p.set(t,8))}})})}),s}function gf(s){const e=ye(s,["schm"])[0];if(e){const t=Ke(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return ye(s,["schi","tenc"])[0]}return null}function M6(s,e){return ye(e,["moof","traf"]).reduce((t,a)=>{const i=ye(a,["tfdt"])[0],o=i[0],r=ye(a,["tfhd"]).reduce((l,d)=>{const c=re(d,4),h=s[c];if(h){let u=re(i,4);if(o===1){if(u===Un)return A.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),l;u*=Un+1,u+=re(i,8)}const f=h.timescale||9e4,p=u/f;if(ne(p)&&(l===null||p<l))return p}return l},null);return r!==null&&ne(r)&&(t===null||r<t)?r:t},null)}function $6(s,e){let t=0,a=0,i=0;const o=ye(s,["moof","traf"]);for(let r=0;r<o.length;r++){const l=o[r],d=ye(l,["tfhd"])[0],c=re(d,4),h=e[c];if(!h)continue;const u=h.default,f=re(d,0)|(u==null?void 0:u.flags);let p=u==null?void 0:u.duration;f&8&&(f&2?p=re(d,12):p=re(d,8));const m=h.timescale||9e4,g=ye(l,["trun"]);for(let y=0;y<g.length;y++){if(t=V6(g[y]),!t&&p){const b=re(g[y],4);t=p*b}h.type===Re.VIDEO?a+=t/m:h.type===Re.AUDIO&&(i+=t/m)}}if(a===0&&i===0){let r=1/0,l=0,d=0;const c=ye(s,["sidx"]);for(let h=0;h<c.length;h++){const u=P6(c[h]);if(u!=null&&u.references){r=Math.min(r,u.earliestPresentationTime/u.timescale);const f=u.references.reduce((p,m)=>p+m.info.duration||0,0);l=Math.max(l,f+u.earliestPresentationTime/u.timescale),d=l-r}}if(d&&ne(d))return d}return a||i}function V6(s){const e=re(s,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let a=0;const i=re(s,4);for(let o=0;o<i;o++){if(e&256){const r=re(s,t);a+=r,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return a}function U6(s,e,t){ye(e,["moof","traf"]).forEach(a=>{ye(a,["tfhd"]).forEach(i=>{const o=re(i,4),r=s[o];if(!r)return;const l=r.timescale||9e4;ye(a,["tfdt"]).forEach(d=>{const c=d[0],h=t*l;if(h){let u=re(d,4);if(c===0)u-=h,u=Math.max(u,0),sl(d,4,u);else{u*=Math.pow(2,32),u+=re(d,8),u-=h,u=Math.max(u,0);const f=Math.floor(u/(Un+1)),p=Math.floor(u%(Un+1));sl(d,4,f),sl(d,8,p)}}})})})}function z6(s){const e={valid:null,remainder:null},t=ye(s,["moof"]);if(t.length<2)return e.remainder=s,e;const a=t[t.length-1];return e.valid=ks(s,0,a.byteOffset-8),e.remainder=ks(s,a.byteOffset-8),e}function St(s,e){const t=new Uint8Array(s.length+e.length);return t.set(s),t.set(e,s.length),t}function yf(s,e){const t=[],a=e.samples,i=e.timescale,o=e.id;let r=!1;return ye(a,["moof"]).map(d=>{const c=d.byteOffset-8;ye(d,["traf"]).map(u=>{const f=ye(u,["tfdt"]).map(p=>{const m=p[0];let g=re(p,4);return m===1&&(g*=Math.pow(2,32),g+=re(p,8)),g/i})[0];return f!==void 0&&(s=f),ye(u,["tfhd"]).map(p=>{const m=re(p,4),g=re(p,0)&16777215,y=(g&1)!==0,b=(g&2)!==0,S=(g&8)!==0;let _=0;const C=(g&16)!==0;let E=0;const v=(g&32)!==0;let T=8;m===o&&(y&&(T+=8),b&&(T+=4),S&&(_=re(p,T),T+=4),C&&(E=re(p,T),T+=4),v&&(T+=4),e.type==="video"&&(r=G6(e.codec)),ye(u,["trun"]).map(B=>{const L=B[0],R=re(B,0)&16777215,$=(R&1)!==0;let K=0;const z=(R&4)!==0,ae=(R&256)!==0;let oe=0;const ie=(R&512)!==0;let ce=0;const de=(R&1024)!==0,Q=(R&2048)!==0;let q=0;const he=re(B,4);let J=8;$&&(K=re(B,J),J+=4),z&&(J+=4);let Z=K+c;for(let ue=0;ue<he;ue++){if(ae?(oe=re(B,J),J+=4):oe=_,ie?(ce=re(B,J),J+=4):ce=E,de&&(J+=4),Q&&(L===0?q=re(B,J):q=ff(B,J),J+=4),e.type===Re.VIDEO){let ge=0;for(;ge<ce;){const Ce=re(a,Z);if(Z+=4,j6(r,a[Z])){const se=a.subarray(Z,Z+Ce);bf(se,r?2:1,s+q/i,t)}Z+=Ce,ge+=Ce+4}}s+=oe/i}}))})})}),t}function G6(s){if(!s)return!1;const e=s.indexOf("."),t=e<0?s:s.substring(0,e);return t==="hvc1"||t==="hev1"||t==="dvh1"||t==="dvhe"}function j6(s,e){if(s){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function bf(s,e,t,a){const i=Sf(s);let o=0;o+=e;let r=0,l=0,d=0;for(;o<i.length;){r=0;do{if(o>=i.length)break;d=i[o++],r+=d}while(d===255);l=0;do{if(o>=i.length)break;d=i[o++],l+=d}while(d===255);const c=i.length-o;let h=o;if(l<c)o+=l;else if(l>c){A.error(`Malformed SEI payload. ${l} is too small, only ${c} bytes left to parse.`);break}if(r===4){if(i[h++]===181){const f=uf(i,h);if(h+=2,f===49){const p=re(i,h);if(h+=4,p===1195456820){const m=i[h++];if(m===3){const g=i[h++],y=31&g,b=64&g,S=b?2+y*3:0,_=new Uint8Array(S);if(b){_[0]=g;for(let C=1;C<S;C++)_[C]=i[h++]}a.push({type:m,payloadType:r,pts:t,bytes:_})}}}}}else if(r===5&&l>16){const u=[];for(let m=0;m<16;m++){const g=i[h++].toString(16);u.push(g.length==1?"0"+g:g),(m===3||m===5||m===7||m===9)&&u.push("-")}const f=l-16,p=new Uint8Array(f);for(let m=0;m<f;m++)p[m]=i[h++];a.push({payloadType:r,pts:t,uuid:u.join(""),userData:Ut(p),userDataBytes:p})}}}function Sf(s){const e=s.byteLength,t=[];let a=1;for(;a<e-2;)s[a]===0&&s[a+1]===0&&s[a+2]===3?(t.push(a+2),a+=2):a++;if(t.length===0)return s;const i=e-t.length,o=new Uint8Array(i);let r=0;for(a=0;a<i;r++,a++)r===t[0]&&(r++,t.shift()),o[a]=s[r];return o}function H6(s){const e=s[0];let t="",a="",i=0,o=0,r=0,l=0,d=0,c=0;if(e===0){for(;Ke(s.subarray(c,c+1))!=="\0";)t+=Ke(s.subarray(c,c+1)),c+=1;for(t+=Ke(s.subarray(c,c+1)),c+=1;Ke(s.subarray(c,c+1))!=="\0";)a+=Ke(s.subarray(c,c+1)),c+=1;a+=Ke(s.subarray(c,c+1)),c+=1,i=re(s,12),o=re(s,16),l=re(s,20),d=re(s,24),c=28}else if(e===1){c+=4,i=re(s,c),c+=4;const u=re(s,c);c+=4;const f=re(s,c);for(c+=4,r=2**32*u+f,c6(r)||(r=Number.MAX_SAFE_INTEGER,A.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=re(s,c),c+=4,d=re(s,c),c+=4;Ke(s.subarray(c,c+1))!=="\0";)t+=Ke(s.subarray(c,c+1)),c+=1;for(t+=Ke(s.subarray(c,c+1)),c+=1;Ke(s.subarray(c,c+1))!=="\0";)a+=Ke(s.subarray(c,c+1)),c+=1;a+=Ke(s.subarray(c,c+1)),c+=1}const h=s.subarray(c,s.byteLength);return{schemeIdUri:t,value:a,timeScale:i,presentationTime:r,presentationTimeDelta:o,eventDuration:l,id:d,payload:h}}function W6(s,...e){const t=e.length;let a=8,i=t;for(;i--;)a+=e[i].byteLength;const o=new Uint8Array(a);for(o[0]=a>>24&255,o[1]=a>>16&255,o[2]=a>>8&255,o[3]=a&255,o.set(s,4),i=0,a=8;i<t;i++)o.set(e[i],a),a+=e[i].byteLength;return o}function K6(s,e,t){if(s.byteLength!==16)throw new RangeError("Invalid system id");let a,i;a=0,i=new Uint8Array;let o;a>0?(o=new Uint8Array(4),e.length>0&&new DataView(o.buffer).setUint32(0,e.length,!1)):o=new Uint8Array;const r=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(r.buffer).setUint32(0,t.byteLength,!1),W6([112,115,115,104],new Uint8Array([a,0,0,0]),s,o,i,r,t||new Uint8Array)}function q6(s){const e=[];if(s instanceof ArrayBuffer){const t=s.byteLength;let a=0;for(;a+32<t;){const i=new DataView(s,a),o=Y6(i);e.push(o),a+=o.size}}return e}function Y6(s){const e=s.getUint32(0),t=s.byteOffset,a=s.byteLength;if(a<e)return{offset:t,size:a};if(s.getUint32(4)!==1886614376)return{offset:t,size:e};const o=s.getUint32(8)>>>24;if(o!==0&&o!==1)return{offset:t,size:e};const r=s.buffer,l=zt.hexDump(new Uint8Array(r,t+12,16)),d=s.getUint32(28);let c=null,h=null;if(o===0){if(e-32<d||d<22)return{offset:t,size:e};h=new Uint8Array(r,t+32,d)}else if(o===1){if(!d||a<t+32+d*16+16)return{offset:t,size:e};c=[];for(let u=0;u<d;u++)c.push(new Uint8Array(r,t+32+u*16,16))}return{version:o,systemId:l,kids:c,data:h,offset:t,size:e}}let Gn={};class Ea{static clearKeyUriToKeyIdMap(){Gn={}}constructor(e,t,a,i=[1],o=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=a,this.keyFormatVersions=i,this.iv=o,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&e!=="AES-128"}isSupported(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case ut.FAIRPLAY:case ut.WIDEVINE:case ut.PLAYREADY:case ut.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof e!="number"&&(this.method==="AES-128"&&!this.iv&&A.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const a=J6(e);return new Ea(this.method,this.uri,"identity",this.keyFormatVersions,a)}const t=k6(this.uri);if(t)switch(this.keyFormat){case ut.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case ut.PLAYREADY:{const a=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=K6(a,null,t);const i=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),o=String.fromCharCode.apply(null,Array.from(i)),r=o.substring(o.indexOf("<"),o.length),c=new DOMParser().parseFromString(r,"text/xml").getElementsByTagName("KID")[0];if(c){const h=c.childNodes[0]?c.childNodes[0].nodeValue:c.getAttribute("VALUE");if(h){const u=Jr(h).subarray(0,16);_6(u),this.keyId=u}}break}default:{let a=t.subarray(0,16);if(a.length!==16){const i=new Uint8Array(16);i.set(a,16-a.length),a=i}this.keyId=a;break}}if(!this.keyId||this.keyId.byteLength!==16){let a=Gn[this.uri];if(!a){const i=Object.keys(Gn).length%Number.MAX_SAFE_INTEGER;a=new Uint8Array(16),new DataView(a.buffer,12,4).setUint32(0,i),Gn[this.uri]=a}this.keyId=a}return this}}function J6(s){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=s>>8*(15-t)&255;return e}const wf=/\{\$([a-zA-Z0-9-_]+)\}/g;function _f(s){return wf.test(s)}function mt(s,e,t){if(s.variableList!==null||s.hasVariableRefs)for(let a=t.length;a--;){const i=t[a],o=e[i];o&&(e[i]=nl(s,o))}}function nl(s,e){if(s.variableList!==null||s.hasVariableRefs){const t=s.variableList;return e.replace(wf,a=>{const i=a.substring(2,a.length-1),o=t==null?void 0:t[i];return o===void 0?(s.playlistParsingError||(s.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),a):o})}return e}function kf(s,e,t){let a=s.variableList;a||(s.variableList=a={});let i,o;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const r=new self.URL(t).searchParams;if(r.has(i))o=r.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(r){s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${r.message}`))}}else i=e.NAME,o=e.VALUE;i in a?s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):a[i]=o||""}function X6(s,e,t){const a=e.IMPORT;if(t&&a in t){let i=s.variableList;i||(s.variableList=i={}),i[a]=t[a]}else s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${a}"`))}function Es(s=!0){return typeof self>"u"?void 0:(s||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Z6(s){return typeof self<"u"&&s===self.ManagedMediaSource}const jn={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Q6(s,e){const t=jn[e];return!!t&&!!t[s.slice(0,4)]}function il(s,e,t=!0){return!s.split(",").some(a=>!Ef(a,e,t))}function Ef(s,e,t=!0){var a;const i=Es(t);return(a=i==null?void 0:i.isTypeSupported(Ta(s,e)))!=null?a:!1}function Ta(s,e){return`${e}/mp4;codecs="${s}"`}function Tf(s){if(s){const e=s.substring(0,4);return jn.video[e]}return 2}function Hn(s){return s.split(",").reduce((e,t)=>{const a=jn.video[t];return a?(a*2+e)/(e?3:2):(jn.audio[t]+e)/(e?2:1)},0)}const ol={};function eB(s,e=!0){if(ol[s])return ol[s];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[s];for(let a=0;a<t.length;a++)if(Ef(t[a],"audio",e))return ol[s]=t[a],t[a];return s}const tB=/flac|opus/i;function Wn(s,e=!0){return s.replace(tB,t=>eB(t.toLowerCase(),e))}function Cf(s,e){return s&&s!=="mp4a"?s:e&&e.split(",")[0]}function sB(s){const e=s.split(",");for(let t=0;t<e.length;t++){const a=e[t].split(".");if(a.length>2){let i=a.shift()+".";i+=parseInt(a.shift()).toString(16),i+=("000"+parseInt(a.shift()).toString(16)).slice(-4),e[t]=i}}return e.join(",")}const xf=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,vf=/#EXT-X-MEDIA:(.*)/g,aB=/^#EXT(?:INF|-X-TARGETDURATION):/m,Af=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),nB=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class jt{static findGroup(e,t){for(let a=0;a<e.length;a++){const i=e[a];if(i.id===t)return i}}static resolve(e,t){return Kr.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return aB.test(e)}static parseMasterPlaylist(e,t){const a=_f(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:a},o=[];xf.lastIndex=0;let r;for(;(r=xf.exec(e))!=null;)if(r[1]){var l;const c=new Oe(r[1]);mt(i,c,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const h=nl(i,r[2]),u={attrs:c,bitrate:c.decimalInteger("BANDWIDTH")||c.decimalInteger("AVERAGE-BANDWIDTH"),name:c.NAME,url:jt.resolve(h,t)},f=c.decimalResolution("RESOLUTION");f&&(u.width=f.width,u.height=f.height),iB(c.CODECS,u),(l=u.unknownCodecs)!=null&&l.length||o.push(u),i.levels.push(u)}else if(r[3]){const c=r[3],h=r[4];switch(c){case"SESSION-DATA":{const u=new Oe(h);mt(i,u,["DATA-ID","LANGUAGE","VALUE","URI"]);const f=u["DATA-ID"];f&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[f]=u);break}case"SESSION-KEY":{const u=Lf(h,t,i);u.encrypted&&u.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(u)):A.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${h}"`);break}case"DEFINE":{{const u=new Oe(h);mt(i,u,["NAME","VALUE","QUERYPARAM"]),kf(i,u,t)}break}case"CONTENT-STEERING":{const u=new Oe(h);mt(i,u,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:jt.resolve(u["SERVER-URI"],t),pathwayId:u["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=If(h);break}}}const d=o.length>0&&o.length<i.levels.length;return i.levels=d?o:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,a){let i;const o={},r=a.levels,l={AUDIO:r.map(c=>({id:c.attrs.AUDIO,audioCodec:c.audioCodec})),SUBTITLES:r.map(c=>({id:c.attrs.SUBTITLES,textCodec:c.textCodec})),"CLOSED-CAPTIONS":[]};let d=0;for(vf.lastIndex=0;(i=vf.exec(e))!==null;){const c=new Oe(i[1]),h=c.TYPE;if(h){const u=l[h],f=o[h]||[];o[h]=f,mt(a,c,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const p=c.LANGUAGE,m=c["ASSOC-LANGUAGE"],g=c.CHANNELS,y=c.CHARACTERISTICS,b=c["INSTREAM-ID"],S={attrs:c,bitrate:0,id:d++,groupId:c["GROUP-ID"]||"",name:c.NAME||p||"",type:h,default:c.bool("DEFAULT"),autoselect:c.bool("AUTOSELECT"),forced:c.bool("FORCED"),lang:p,url:c.URI?jt.resolve(c.URI,t):""};if(m&&(S.assocLang=m),g&&(S.channels=g),y&&(S.characteristics=y),b&&(S.instreamId=b),u!=null&&u.length){const _=jt.findGroup(u,S.groupId)||u[0];Rf(S,_,"audioCodec"),Rf(S,_,"textCodec")}f.push(S)}}return o}static parseLevelPlaylist(e,t,a,i,o,r){const l=new S6(t),d=l.fragments;let c=null,h=0,u=0,f=0,p=0,m=null,g=new Yr(i,t),y,b,S,_=-1,C=!1,E=null;for(Af.lastIndex=0,l.m3u8=e,l.hasVariableRefs=_f(e);(y=Af.exec(e))!==null;){C&&(C=!1,g=new Yr(i,t),g.start=f,g.sn=h,g.cc=p,g.level=a,c&&(g.initSegment=c,g.rawProgramDateTime=c.rawProgramDateTime,c.rawProgramDateTime=null,E&&(g.setByteRange(E),E=null)));const L=y[1];if(L){g.duration=parseFloat(L);const R=(" "+y[2]).slice(1);g.title=R||null,g.tagList.push(R?["INF",L,R]:["INF",L])}else if(y[3]){if(ne(g.duration)){g.start=f,S&&Df(g,S,l),g.sn=h,g.level=a,g.cc=p,d.push(g);const R=(" "+y[3]).slice(1);g.relurl=nl(l,R),Bf(g,m),m=g,f+=g.duration,h++,u=0,C=!0}}else if(y[4]){const R=(" "+y[4]).slice(1);m?g.setByteRange(R,m):g.setByteRange(R)}else if(y[5])g.rawProgramDateTime=(" "+y[5]).slice(1),g.tagList.push(["PROGRAM-DATE-TIME",g.rawProgramDateTime]),_===-1&&(_=d.length);else{if(y=y[0].match(nB),!y){A.warn("No matches on slow regex match for level playlist!");continue}for(b=1;b<y.length&&!(typeof y[b]<"u");b++);const R=(" "+y[b]).slice(1),$=(" "+y[b+1]).slice(1),K=y[b+2]?(" "+y[b+2]).slice(1):"";switch(R){case"PLAYLIST-TYPE":l.type=$.toUpperCase();break;case"MEDIA-SEQUENCE":h=l.startSN=parseInt($);break;case"SKIP":{const z=new Oe($);mt(l,z,["RECENTLY-REMOVED-DATERANGES"]);const ae=z.decimalInteger("SKIPPED-SEGMENTS");if(ne(ae)){l.skippedSegments=ae;for(let ie=ae;ie--;)d.unshift(null);h+=ae}const oe=z.enumeratedString("RECENTLY-REMOVED-DATERANGES");oe&&(l.recentlyRemovedDateranges=oe.split(" "));break}case"TARGETDURATION":l.targetduration=Math.max(parseInt($),1);break;case"VERSION":l.version=parseInt($);break;case"INDEPENDENT-SEGMENTS":case"EXTM3U":break;case"ENDLIST":l.live=!1;break;case"#":($||K)&&g.tagList.push(K?[$,K]:[$]);break;case"DISCONTINUITY":p++,g.tagList.push(["DIS"]);break;case"GAP":g.gap=!0,g.tagList.push([R]);break;case"BITRATE":g.tagList.push([R,$]);break;case"DATERANGE":{const z=new Oe($);mt(l,z,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),mt(l,z,z.clientAttrs);const ae=new tf(z,l.dateRanges[z.ID]);ae.isValid||l.skippedSegments?l.dateRanges[ae.id]=ae:A.warn(`Ignoring invalid DATERANGE tag: "${$}"`),g.tagList.push(["EXT-X-DATERANGE",$]);break}case"DEFINE":{{const z=new Oe($);mt(l,z,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in z?X6(l,z,r):kf(l,z,t)}break}case"DISCONTINUITY-SEQUENCE":p=parseInt($);break;case"KEY":{const z=Lf($,t,l);if(z.isSupported()){if(z.method==="NONE"){S=void 0;break}S||(S={}),S[z.keyFormat]&&(S=Ge({},S)),S[z.keyFormat]=z}else A.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${$}"`);break}case"START":l.startTimeOffset=If($);break;case"MAP":{const z=new Oe($);if(mt(l,z,["BYTERANGE","URI"]),g.duration){const ae=new Yr(i,t);Nf(ae,z,a,S),c=ae,g.initSegment=c,c.rawProgramDateTime&&!g.rawProgramDateTime&&(g.rawProgramDateTime=c.rawProgramDateTime)}else{const ae=g.byteRangeEndOffset;if(ae){const oe=g.byteRangeStartOffset;E=`${ae-oe}@${oe}`}else E=null;Nf(g,z,a,S),c=g,C=!0}break}case"SERVER-CONTROL":{const z=new Oe($);l.canBlockReload=z.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=z.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&z.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=z.optionalFloat("PART-HOLD-BACK",0),l.holdBack=z.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const z=new Oe($);l.partTarget=z.decimalFloatingPoint("PART-TARGET");break}case"PART":{let z=l.partList;z||(z=l.partList=[]);const ae=u>0?z[z.length-1]:void 0,oe=u++,ie=new Oe($);mt(l,ie,["BYTERANGE","URI"]);const ce=new y6(ie,g,t,oe,ae);z.push(ce),g.duration+=ce.duration;break}case"PRELOAD-HINT":{const z=new Oe($);mt(l,z,["URI"]),l.preloadHint=z;break}case"RENDITION-REPORT":{const z=new Oe($);mt(l,z,["URI"]),l.renditionReports=l.renditionReports||[],l.renditionReports.push(z);break}default:A.warn(`line parsed but not handled: ${y}`);break}}}m&&!m.relurl?(d.pop(),f-=m.duration,l.partList&&(l.fragmentHint=m)):l.partList&&(Bf(g,m),g.cc=p,l.fragmentHint=g,S&&Df(g,S,l));const v=d.length,T=d[0],B=d[v-1];if(f+=l.skippedSegments*l.targetduration,f>0&&v&&B){l.averagetargetduration=f/v;const L=B.sn;l.endSN=L!=="initSegment"?L:0,l.live||(B.endList=!0),T&&(l.startCC=T.cc)}else l.endSN=0,l.startCC=0;return l.fragmentHint&&(f+=l.fragmentHint.duration),l.totalduration=f,l.endCC=p,_>0&&oB(d,_),l}}function Lf(s,e,t){var a,i;const o=new Oe(s);mt(t,o,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const r=(a=o.METHOD)!=null?a:"",l=o.URI,d=o.hexadecimalInteger("IV"),c=o.KEYFORMATVERSIONS,h=(i=o.KEYFORMAT)!=null?i:"identity";l&&o.IV&&!d&&A.error(`Invalid IV: ${o.IV}`);const u=l?jt.resolve(l,e):"",f=(c||"1").split("/").map(Number).filter(Number.isFinite);return new Ea(r,u,h,f,d)}function If(s){const t=new Oe(s).decimalFloatingPoint("TIME-OFFSET");return ne(t)?t:null}function iB(s,e){let t=(s||"").split(/[ ,]+/).filter(a=>a);["video","audio","text"].forEach(a=>{const i=t.filter(o=>Q6(o,a));i.length&&(e[`${a}Codec`]=i.join(","),t=t.filter(o=>i.indexOf(o)===-1))}),e.unknownCodecs=t}function Rf(s,e,t){const a=e[t];a&&(s[t]=a)}function oB(s,e){let t=s[e];for(let a=e;a--;){const i=s[a];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function Bf(s,e){s.rawProgramDateTime?s.programDateTime=Date.parse(s.rawProgramDateTime):e!=null&&e.programDateTime&&(s.programDateTime=e.endProgramDateTime),ne(s.programDateTime)||(s.programDateTime=null,s.rawProgramDateTime=null)}function Nf(s,e,t,a){s.relurl=e.URI,e.BYTERANGE&&s.setByteRange(e.BYTERANGE),s.level=t,s.sn="initSegment",a&&(s.levelkeys=a),s.initSegment=null}function Df(s,e,t){s.levelkeys=e;const{encryptedFragments:a}=t;(!a.length||a[a.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&a.push(s)}var xe={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},le={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Pf(s){const{type:e}=s;switch(e){case xe.AUDIO_TRACK:return le.AUDIO;case xe.SUBTITLE_TRACK:return le.SUBTITLE;default:return le.MAIN}}function rl(s,e){let t=s.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class rB{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.LEVEL_LOADING,this.onLevelLoading,this),e.on(w.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(w.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.LEVEL_LOADING,this.onLevelLoading,this),e.off(w.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(w.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,a=t.pLoader,i=t.loader,o=a||i,r=new o(t);return this.loaders[e.type]=r,r}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:a}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:xe.MANIFEST,url:a,deliveryDirectives:null})}onLevelLoading(e,t){const{id:a,level:i,pathwayId:o,url:r,deliveryDirectives:l}=t;this.load({id:a,level:i,pathwayId:o,responseType:"text",type:xe.LEVEL,url:r,deliveryDirectives:l})}onAudioTrackLoading(e,t){const{id:a,groupId:i,url:o,deliveryDirectives:r}=t;this.load({id:a,groupId:i,level:null,responseType:"text",type:xe.AUDIO_TRACK,url:o,deliveryDirectives:r})}onSubtitleTrackLoading(e,t){const{id:a,groupId:i,url:o,deliveryDirectives:r}=t;this.load({id:a,groupId:i,level:null,responseType:"text",type:xe.SUBTITLE_TRACK,url:o,deliveryDirectives:r})}load(e){var t;const a=this.hls.config;let i=this.getInternalLoader(e);if(i){const c=i.context;if(c&&c.url===e.url&&c.level===e.level){A.trace("[playlist-loader]: playlist request ongoing");return}A.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let o;if(e.type===xe.MANIFEST?o=a.manifestLoadPolicy.default:o=Ge({},a.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),ne((t=e.deliveryDirectives)==null?void 0:t.part)){let c;if(e.type===xe.LEVEL&&e.level!==null?c=this.hls.levels[e.level].details:e.type===xe.AUDIO_TRACK&&e.id!==null?c=this.hls.audioTracks[e.id].details:e.type===xe.SUBTITLE_TRACK&&e.id!==null&&(c=this.hls.subtitleTracks[e.id].details),c){const h=c.partTarget,u=c.targetduration;if(h&&u){const f=Math.max(h*3,u*.8)*1e3;o=Ge({},o,{maxTimeToFirstByteMs:Math.min(f,o.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(f,o.maxTimeToFirstByteMs)})}}}const r=o.errorRetry||o.timeoutRetry||{},l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:r.maxNumRetry||0,retryDelay:r.retryDelayMs||0,maxRetryDelay:r.maxRetryDelayMs||0},d={onSuccess:(c,h,u,f)=>{const p=this.getInternalLoader(u);this.resetInternalLoader(u.type);const m=c.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(c,u,new Error("no EXTM3U delimiter"),f||null,h);return}h.parsing.start=performance.now(),jt.isMediaPlaylist(m)?this.handleTrackOrLevelPlaylist(c,h,u,f||null,p):this.handleMasterPlaylist(c,h,u,f)},onError:(c,h,u,f)=>{this.handleNetworkError(h,u,!1,c,f)},onTimeout:(c,h,u)=>{this.handleNetworkError(h,u,!0,void 0,c)}};i.load(e,l,d)}handleMasterPlaylist(e,t,a,i){const o=this.hls,r=e.data,l=rl(e,a),d=jt.parseMasterPlaylist(r,l);if(d.playlistParsingError){this.handleManifestParsingError(e,a,d.playlistParsingError,i,t);return}const{contentSteering:c,levels:h,sessionData:u,sessionKeys:f,startTimeOffset:p,variableList:m}=d;this.variableList=m;const{AUDIO:g=[],SUBTITLES:y,"CLOSED-CAPTIONS":b}=jt.parseMasterPlaylistMedia(r,l,d);g.length&&!g.some(_=>!_.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(A.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Oe({}),bitrate:0,url:""})),o.trigger(w.MANIFEST_LOADED,{levels:h,audioTracks:g,subtitles:y,captions:b,contentSteering:c,url:l,stats:t,networkDetails:i,sessionData:u,sessionKeys:f,startTimeOffset:p,variableList:m})}handleTrackOrLevelPlaylist(e,t,a,i,o){const r=this.hls,{id:l,level:d,type:c}=a,h=rl(e,a),u=0,f=ne(d)?d:ne(l)?l:0,p=Pf(a),m=jt.parseLevelPlaylist(e.data,h,f,p,u,this.variableList);if(c===xe.MANIFEST){const g={attrs:new Oe({}),bitrate:0,details:m,name:"",url:h};r.trigger(w.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:h,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),a.levelDetails=m,this.handlePlaylistLoaded(m,e,t,a,i,o)}handleManifestParsingError(e,t,a,i,o){this.hls.trigger(w.ERROR,{type:fe.NETWORK_ERROR,details:N.MANIFEST_PARSING_ERROR,fatal:t.type===xe.MANIFEST,url:e.url,err:a,error:a,reason:a.message,response:e,context:t,networkDetails:i,stats:o})}handleNetworkError(e,t,a=!1,i,o){let r=`A network ${a?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===xe.LEVEL?r+=`: ${e.level} id: ${e.id}`:(e.type===xe.AUDIO_TRACK||e.type===xe.SUBTITLE_TRACK)&&(r+=` id: ${e.id} group-id: "${e.groupId}"`);const l=new Error(r);A.warn(`[playlist-loader]: ${r}`);let d=N.UNKNOWN,c=!1;const h=this.getInternalLoader(e);switch(e.type){case xe.MANIFEST:d=a?N.MANIFEST_LOAD_TIMEOUT:N.MANIFEST_LOAD_ERROR,c=!0;break;case xe.LEVEL:d=a?N.LEVEL_LOAD_TIMEOUT:N.LEVEL_LOAD_ERROR,c=!1;break;case xe.AUDIO_TRACK:d=a?N.AUDIO_TRACK_LOAD_TIMEOUT:N.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case xe.SUBTITLE_TRACK:d=a?N.SUBTITLE_TRACK_LOAD_TIMEOUT:N.SUBTITLE_LOAD_ERROR,c=!1;break}h&&this.resetInternalLoader(e.type);const u={type:fe.NETWORK_ERROR,details:d,fatal:c,url:e.url,loader:h,context:e,error:l,networkDetails:t,stats:o};if(i){const f=(t==null?void 0:t.url)||e.url;u.response=Xe({url:f,data:void 0},i)}this.hls.trigger(w.ERROR,u)}handlePlaylistLoaded(e,t,a,i,o,r){const l=this.hls,{type:d,level:c,id:h,groupId:u,deliveryDirectives:f}=i,p=rl(t,i),m=Pf(i),g=typeof i.level=="number"&&m===le.MAIN?c:void 0;if(!e.fragments.length){const b=new Error("No Segments found in Playlist");l.trigger(w.ERROR,{type:fe.NETWORK_ERROR,details:N.LEVEL_EMPTY_ERROR,fatal:!1,url:p,error:b,reason:b.message,response:t,context:i,level:g,parent:m,networkDetails:o,stats:a});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const y=e.playlistParsingError;if(y){l.trigger(w.ERROR,{type:fe.NETWORK_ERROR,details:N.LEVEL_PARSING_ERROR,fatal:!1,url:p,error:y,reason:y.message,response:t,context:i,level:g,parent:m,networkDetails:o,stats:a});return}switch(e.live&&r&&(r.getCacheAge&&(e.ageHeader=r.getCacheAge()||0),(!r.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),d){case xe.MANIFEST:case xe.LEVEL:l.trigger(w.LEVEL_LOADED,{details:e,level:g||0,id:h||0,stats:a,networkDetails:o,deliveryDirectives:f});break;case xe.AUDIO_TRACK:l.trigger(w.AUDIO_TRACK_LOADED,{details:e,id:h||0,groupId:u||"",stats:a,networkDetails:o,deliveryDirectives:f});break;case xe.SUBTITLE_TRACK:l.trigger(w.SUBTITLE_TRACK_LOADED,{details:e,id:h||0,groupId:u||"",stats:a,networkDetails:o,deliveryDirectives:f});break}}}function Of(s,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=s,e.dispatchEvent(t)}function Ff(s,e){const t=s.mode;if(t==="disabled"&&(s.mode="hidden"),s.cues&&!s.cues.getCueById(e.id))try{if(s.addCue(e),!s.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(a){A.debug(`[texttrack-utils]: ${a}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,s.addCue(i)}catch(i){A.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(s.mode=t)}function $s(s){const e=s.mode;if(e==="disabled"&&(s.mode="hidden"),s.cues)for(let t=s.cues.length;t--;)s.removeCue(s.cues[t]);e==="disabled"&&(s.mode=e)}function ll(s,e,t,a){const i=s.mode;if(i==="disabled"&&(s.mode="hidden"),s.cues&&s.cues.length>0){const o=cB(s.cues,e,t);for(let r=0;r<o.length;r++)(!a||a(o[r]))&&s.removeCue(o[r])}i==="disabled"&&(s.mode=i)}function lB(s,e){if(e<s[0].startTime)return 0;const t=s.length-1;if(e>s[t].endTime)return-1;let a=0,i=t;for(;a<=i;){const o=Math.floor((i+a)/2);if(e<s[o].startTime)i=o-1;else if(e>s[o].startTime&&a<t)a=o+1;else return o}return s[a].startTime-e<e-s[i].startTime?a:i}function cB(s,e,t){const a=[],i=lB(s,e);if(i>-1)for(let o=i,r=s.length;o<r;o++){const l=s[o];if(l.startTime>=e&&l.endTime<=t)a.push(l);else if(l.startTime>t)return a}return a}function Kn(s){const e=[];for(let t=0;t<s.length;t++){const a=s[t];(a.kind==="subtitles"||a.kind==="captions")&&a.label&&e.push(s[t])}return e}var Dt={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const dB=.25;function cl(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function Mf(s,e,t,a,i){let o=new s(e,t,"");try{o.value=a,i&&(o.type=i)}catch{o=new s(e,t,JSON.stringify(i?Xe({type:i},a):a))}return o}const qn=(()=>{const s=cl();try{s&&new s(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function dl(s,e){return s.getTime()/1e3-e}function hB(s){return Uint8Array.from(s.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class uB{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(w.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(w.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(w.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(w.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&($s(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const a=e[t];if(a.kind==="metadata"&&a.label==="id3")return Of(a,this.media),a}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:a,enableID3MetadataCues:i}}}=this;if(!a&&!i)return;const{samples:o}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const r=cl();if(r)for(let l=0;l<o.length;l++){const d=o[l].type;if(d===Dt.emsg&&!a||!i)continue;const c=df(o[l].data);if(c){const h=o[l].pts;let u=h+o[l].duration;u>qn&&(u=qn),u-h<=0&&(u=h+dB);for(let p=0;p<c.length;p++){const m=c[p];if(!cf(m)){this.updateId3CueEnds(h,d);const g=Mf(r,h,u,m,d);g&&this.id3Track.addCue(g)}}}}}updateId3CueEnds(e,t){var a;const i=(a=this.id3Track)==null?void 0:a.cues;if(i)for(let o=i.length;o--;){const r=i[o];r.type===t&&r.startTime<e&&r.endTime===qn&&(r.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:a,type:i}){const{id3Track:o,hls:r}=this;if(!r)return;const{config:{enableEmsgMetadataCues:l,enableID3MetadataCues:d}}=r;if(o&&(l||d)){let c;i==="audio"?c=h=>h.type===Dt.audioId3&&d:i==="video"?c=h=>h.type===Dt.emsg&&l:c=h=>h.type===Dt.audioId3&&d||h.type===Dt.emsg&&l,ll(o,t,a,c)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:a,id3Track:i}=this,{dateRanges:o}=t,r=Object.keys(o);if(i){const h=Object.keys(a).filter(u=>!r.includes(u));for(let u=h.length;u--;){const f=h[u];Object.keys(a[f].cues).forEach(p=>{i.removeCue(a[f].cues[p])}),delete a[f]}}const l=t.fragments[t.fragments.length-1];if(r.length===0||!ne(l==null?void 0:l.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const d=l.programDateTime/1e3-l.start,c=cl();for(let h=0;h<r.length;h++){const u=r[h],f=o[u],p=dl(f.startDate,d),m=a[u],g=(m==null?void 0:m.cues)||{};let y=(m==null?void 0:m.durationKnown)||!1,b=qn;const S=f.endDate;if(S)b=dl(S,d),y=!0;else if(f.endOnNext&&!y){const C=r.reduce((E,v)=>{if(v!==f.id){const T=o[v];if(T.class===f.class&&T.startDate>f.startDate&&(!E||f.startDate<E.startDate))return T}return E},null);C&&(b=dl(C.startDate,d),y=!0)}const _=Object.keys(f.attr);for(let C=0;C<_.length;C++){const E=_[C];if(!p6(E))continue;const v=g[E];if(v)y&&!m.durationKnown&&(v.endTime=b);else if(c){let T=f.attr[E];g6(E)&&(T=hB(T));const B=Mf(c,p,b,{key:E,data:T},Dt.dateRange);B&&(B.id=u,this.id3Track.addCue(B),g[E]=B)}}a[u]={cues:g,dateRange:f,durationKnown:y}}}}class mB{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=()=>this.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:a,targetduration:i}=e,{liveSyncDuration:o,liveSyncDurationCount:r,lowLatencyMode:l}=this.config,d=this.hls.userConfig;let c=l&&a||t;(d.liveSyncDuration||d.liveSyncDurationCount||c===0)&&(c=o!==void 0?o:r*i);const h=i;return c+Math.min(this.stallCount*1,h)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,a=this.levelDetails;if(e===null||t===null||a===null)return null;const i=a.edge,o=e-t-this.edgeStalled,r=i-a.totalduration,l=i-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(r,o),l)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const a=e.buffered.length;return(a?e.buffered.end(a-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(w.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(w.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(w.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(w.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(w.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(w.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var a;t.details===N.BUFFER_STALLED_ERROR&&(this.stallCount++,(a=this.levelDetails)!=null&&a.live&&A.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const a=this.computeLatency();if(a===null)return;this._latency=a;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:o}=this.config;if(!i||o===1||!t.live)return;const r=this.targetLatency;if(r===null)return;const l=a-r,d=Math.min(this.maxLatency,r+t.targetduration);if(l<d&&l>.05&&this.forwardBufferLength>1){const h=Math.min(2,Math.max(1,o)),u=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;e.playbackRate=Math.min(h,Math.max(1,u))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const hl=["NONE","TYPE-0","TYPE-1",null];function fB(s){return hl.indexOf(s)>-1}const Yn=["SDR","PQ","HLG"];function pB(s){return!!s&&Yn.indexOf(s)>-1}var Jn={No:"",Yes:"YES",v2:"v2"};function $f(s){const{canSkipUntil:e,canSkipDateRanges:t,age:a}=s,i=a<e/2;return e&&i?t?Jn.v2:Jn.Yes:Jn.No}class Vf{constructor(e,t,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=a}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class Vs{constructor(e){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(t=>!!t).map(t=>t.substring(0,4)).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return Uf(this._audioGroups,e)}hasSubtitleGroup(e){return Uf(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let a=this._audioGroups;a||(a=this._audioGroups=[]),a.indexOf(t)===-1&&a.push(t)}else if(e==="text"){let a=this._subtitleGroups;a||(a=this._subtitleGroups=[]),a.indexOf(t)===-1&&a.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function Uf(s,e){return!e||!s?!1:s.indexOf(e)!==-1}function ul(s,e){const t=e.startPTS;if(ne(t)){let a=0,i;e.sn>s.sn?(a=t-s.start,i=s):(a=s.start-t,i=e),i.duration!==a&&(i.duration=a)}else e.sn>s.sn?s.cc===e.cc&&s.minEndPTS?e.start=s.start+(s.minEndPTS-s.start):e.start=s.start+s.duration:e.start=Math.max(s.start-e.duration,0)}function zf(s,e,t,a,i,o){a-t<=0&&(A.warn("Fragment should have a positive duration",e),a=t+e.duration,o=i+e.duration);let l=t,d=a;const c=e.startPTS,h=e.endPTS;if(ne(c)){const y=Math.abs(c-t);ne(e.deltaPTS)?e.deltaPTS=Math.max(y,e.deltaPTS):e.deltaPTS=y,l=Math.max(t,c),t=Math.min(t,c),i=Math.min(i,e.startDTS),d=Math.min(a,h),a=Math.max(a,h),o=Math.max(o,e.endDTS)}const u=t-e.start;e.start!==0&&(e.start=t),e.duration=a-e.start,e.startPTS=t,e.maxStartPTS=l,e.startDTS=i,e.endPTS=a,e.minEndPTS=d,e.endDTS=o;const f=e.sn;if(!s||f<s.startSN||f>s.endSN)return 0;let p;const m=f-s.startSN,g=s.fragments;for(g[m]=e,p=m;p>0;p--)ul(g[p],g[p-1]);for(p=m;p<g.length-1;p++)ul(g[p],g[p+1]);return s.fragmentHint&&ul(g[g.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,u}function gB(s,e){let t=null;const a=s.fragments;for(let d=a.length-1;d>=0;d--){const c=a[d].initSegment;if(c){t=c;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;let i=0,o;if(SB(s,e,(d,c)=>{d.relurl&&(i=d.cc-c.cc),ne(d.startPTS)&&ne(d.endPTS)&&(c.start=c.startPTS=d.startPTS,c.startDTS=d.startDTS,c.maxStartPTS=d.maxStartPTS,c.endPTS=d.endPTS,c.endDTS=d.endDTS,c.minEndPTS=d.minEndPTS,c.duration=d.endPTS-d.startPTS,c.duration&&(o=c),e.PTSKnown=e.alignedSliding=!0),c.elementaryStreams=d.elementaryStreams,c.loader=d.loader,c.stats=d.stats,d.initSegment&&(c.initSegment=d.initSegment,t=d.initSegment)}),t&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(c=>{var h;c&&(!c.initSegment||c.initSegment.relurl===((h=t)==null?void 0:h.relurl))&&(c.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(d=>!d),e.deltaUpdateFailed){A.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let d=e.skippedSegments;d--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=yB(s.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const r=e.fragments;if(i){A.warn("discontinuity sliding from playlist, take drift into account");for(let d=0;d<r.length;d++)r[d].cc+=i}e.skippedSegments&&(e.startCC=e.fragments[0].cc),bB(s.partList,e.partList,(d,c)=>{c.elementaryStreams=d.elementaryStreams,c.stats=d.stats}),o?zf(e,o,o.startPTS,o.endPTS,o.startDTS,o.endDTS):Gf(s,e),r.length&&(e.totalduration=e.edge-r[0].start),e.driftStartTime=s.driftStartTime,e.driftStart=s.driftStart;const l=e.advancedDateTime;if(e.advanced&&l){const d=e.edge;e.driftStart||(e.driftStartTime=l,e.driftStart=d),e.driftEndTime=l,e.driftEnd=d}else e.driftEndTime=s.driftEndTime,e.driftEnd=s.driftEnd,e.advancedDateTime=s.advancedDateTime}function yB(s,e,t){const a=Ge({},s);return t&&t.forEach(i=>{delete a[i]}),Object.keys(e).forEach(i=>{const o=new tf(e[i].attr,a[i]);o.isValid?a[i]=o:A.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[i].attr)}"`)}),a}function bB(s,e,t){if(s&&e){let a=0;for(let i=0,o=s.length;i<=o;i++){const r=s[i],l=e[i+a];r&&l&&r.index===l.index&&r.fragment.sn===l.fragment.sn?t(r,l):a--}}}function SB(s,e,t){const a=e.skippedSegments,i=Math.max(s.startSN,e.startSN)-e.startSN,o=(s.fragmentHint?1:0)+(a?e.endSN:Math.min(s.endSN,e.endSN))-e.startSN,r=e.startSN-s.startSN,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,d=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;for(let c=i;c<=o;c++){const h=d[r+c];let u=l[c];a&&!u&&c<a&&(u=e.fragments[c]=h),h&&u&&t(h,u)}}function Gf(s,e){const t=e.startSN+e.skippedSegments-s.startSN,a=s.fragments;t<0||t>=a.length||ml(e,a[t].start)}function ml(s,e){if(e){const t=s.fragments;for(let a=s.skippedSegments;a<t.length;a++)t[a].start+=e;s.fragmentHint&&(s.fragmentHint.start+=e)}}function wB(s,e=1/0){let t=1e3*s.targetduration;if(s.updated){const a=s.fragments;if(a.length&&t*4>e){const o=a[a.length-1].duration*1e3;o<t&&(t=o)}}else t/=2;return Math.round(t)}function _B(s,e,t){if(!(s!=null&&s.details))return null;const a=s.details;let i=a.fragments[e-a.startSN];return i||(i=a.fragmentHint,i&&i.sn===e)?i:e<a.startSN&&t&&t.sn===e?t:null}function jf(s,e,t){var a;return s!=null&&s.details?Hf((a=s.details)==null?void 0:a.partList,e,t):null}function Hf(s,e,t){if(s)for(let a=s.length;a--;){const i=s[a];if(i.index===t&&i.fragment.sn===e)return i}return null}function Wf(s){s.forEach((e,t)=>{const{details:a}=e;a!=null&&a.fragments&&a.fragments.forEach(i=>{i.level=t})})}function Xn(s){switch(s.details){case N.FRAG_LOAD_TIMEOUT:case N.KEY_LOAD_TIMEOUT:case N.LEVEL_LOAD_TIMEOUT:case N.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Kf(s,e){const t=Xn(e);return s.default[`${t?"timeout":"error"}Retry`]}function fl(s,e){const t=s.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*s.retryDelayMs,s.maxRetryDelayMs)}function qf(s){return Xe(Xe({},s),{errorRetry:null,timeoutRetry:null})}function Zn(s,e,t,a){if(!s)return!1;const i=a==null?void 0:a.code,o=e<s.maxNumRetry&&(kB(i)||!!t);return s.shouldRetry?s.shouldRetry(s,e,t,a,o):o}function kB(s){return s===0&&navigator.onLine===!1||!!s&&(s<400||s>499)}const Yf={search:function(s,e){let t=0,a=s.length-1,i=null,o=null;for(;t<=a;){i=(t+a)/2|0,o=s[i];const r=e(o);if(r>0)t=i+1;else if(r<0)a=i-1;else return o}return null}};function EB(s,e,t){if(e===null||!Array.isArray(s)||!s.length||!ne(e))return null;const a=s[0].programDateTime;if(e<(a||0))return null;const i=s[s.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let o=0;o<s.length;++o){const r=s[o];if(CB(e,t,r))return r}return null}function Qn(s,e,t=0,a=0,i=.005){let o=null;if(s){o=e[s.sn-e[0].sn+1]||null;const l=s.endDTS-t;l>0&&l<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(o=e[0]);if(o&&((!s||s.level===o.level)&&pl(t,a,o)===0||TB(o,s,Math.min(i,a))))return o;const r=Yf.search(e,pl.bind(null,t,a));return r&&(r!==s||!o)?r:o}function TB(s,e,t){if(e&&e.start===0&&e.level<s.level&&(e.endPTS||0)>0){const a=e.tagList.reduce((i,o)=>(o[0]==="INF"&&(i+=parseFloat(o[1])),i),t);return s.start<=a}return!1}function pl(s=0,e=0,t){if(t.start<=s&&t.start+t.duration>s)return 0;const a=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-a<=s?1:t.start-a>s&&t.start?-1:0}function CB(s,e,t){const a=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-a>s}function xB(s,e){return Yf.search(s,t=>t.cc<e?1:t.cc>e?-1:0)}var nt={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Pt={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class vB{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=A.log.bind(A,"[info]:"),this.warn=A.warn.bind(A,"[warning]:"),this.error=A.error.bind(A,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(w.ERROR,this.onError,this),e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(w.ERROR,this.onError,this),e.off(w.ERROR,this.onErrorOut,this),e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===le.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var a,i;if(t.fatal)return;const o=this.hls,r=t.context;switch(t.details){case N.FRAG_LOAD_ERROR:case N.FRAG_LOAD_TIMEOUT:case N.KEY_LOAD_ERROR:case N.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case N.FRAG_PARSING_ERROR:if((a=t.frag)!=null&&a.gap){t.errorAction={action:nt.DoNothing,flags:Pt.None};return}case N.FRAG_GAP:case N.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=nt.SendAlternateToPenaltyBox;return}case N.LEVEL_EMPTY_ERROR:case N.LEVEL_PARSING_ERROR:{var l,d;const c=t.parent===le.MAIN?t.level:o.loadLevel;t.details===N.LEVEL_EMPTY_ERROR&&((l=t.context)!=null&&(d=l.levelDetails)!=null&&d.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c))}return;case N.LEVEL_LOAD_ERROR:case N.LEVEL_LOAD_TIMEOUT:typeof(r==null?void 0:r.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level));return;case N.AUDIO_TRACK_LOAD_ERROR:case N.AUDIO_TRACK_LOAD_TIMEOUT:case N.SUBTITLE_LOAD_ERROR:case N.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const c=o.levels[o.loadLevel];if(c&&(r.type===xe.AUDIO_TRACK&&c.hasAudioGroup(r.groupId)||r.type===xe.SUBTITLE_TRACK&&c.hasSubtitleGroup(r.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,o.loadLevel),t.errorAction.action=nt.SendAlternateToPenaltyBox,t.errorAction.flags=Pt.MoveAllAlternatesMatchingHost;return}}return;case N.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const c=o.levels[o.loadLevel],h=c==null?void 0:c.attrs["HDCP-LEVEL"];h?t.errorAction={action:nt.SendAlternateToPenaltyBox,flags:Pt.MoveAllAlternatesMatchingHDCP,hdcpLevel:h}:this.keySystemError(t)}return;case N.BUFFER_ADD_CODEC_ERROR:case N.REMUX_ALLOC_ERROR:case N.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(i=t.level)!=null?i:o.loadLevel);return;case N.INTERNAL_EXCEPTION:case N.BUFFER_APPENDING_ERROR:case N.BUFFER_FULL_ERROR:case N.LEVEL_SWITCH_ERROR:case N.BUFFER_STALLED_ERROR:case N.BUFFER_SEEK_OVER_HOLE:case N.BUFFER_NUDGE_ON_STALL:t.errorAction={action:nt.DoNothing,flags:Pt.None};return}t.type===fe.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const a=this.hls,i=Kf(a.config.playlistLoadPolicy,e),o=this.playlistError++;if(Zn(i,o,Xn(e),e.response))return{action:nt.RetryRequest,flags:Pt.None,retryConfig:i,retryCount:o};const l=this.getLevelSwitchAction(e,t);return i&&(l.retryConfig=i,l.retryCount=o),l}getFragRetryOrSwitchAction(e){const t=this.hls,a=this.getVariantLevelIndex(e.frag),i=t.levels[a],{fragLoadPolicy:o,keyLoadPolicy:r}=t.config,l=Kf(e.details.startsWith("key")?r:o,e),d=t.levels.reduce((h,u)=>h+u.fragmentError,0);if(i&&(e.details!==N.FRAG_GAP&&i.fragmentError++,Zn(l,d,Xn(e),e.response)))return{action:nt.RetryRequest,flags:Pt.None,retryConfig:l,retryCount:d};const c=this.getLevelSwitchAction(e,a);return l&&(c.retryConfig=l,c.retryCount=d),c}getLevelSwitchAction(e,t){const a=this.hls;t==null&&(t=a.loadLevel);const i=this.hls.levels[t];if(i){var o,r;const c=e.details;i.loadError++,c===N.BUFFER_APPEND_ERROR&&i.fragmentError++;let h=-1;const{levels:u,loadLevel:f,minAutoLevel:p,maxAutoLevel:m}=a;a.autoLevelEnabled||(a.loadLevel=-1);const g=(o=e.frag)==null?void 0:o.type,b=(g===le.AUDIO&&c===N.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(c===N.BUFFER_ADD_CODEC_ERROR||c===N.BUFFER_APPEND_ERROR))&&u.some(({audioCodec:v})=>i.audioCodec!==v),_=e.sourceBufferName==="video"&&(c===N.BUFFER_ADD_CODEC_ERROR||c===N.BUFFER_APPEND_ERROR)&&u.some(({codecSet:v,audioCodec:T})=>i.codecSet!==v&&i.audioCodec===T),{type:C,groupId:E}=(r=e.context)!=null?r:{};for(let v=u.length;v--;){const T=(v+f)%u.length;if(T!==f&&T>=p&&T<=m&&u[T].loadError===0){var l,d;const B=u[T];if(c===N.FRAG_GAP&&g===le.MAIN&&e.frag){const L=u[T].details;if(L){const R=Qn(e.frag,L.fragments,e.frag.start);if(R!=null&&R.gap)continue}}else{if(C===xe.AUDIO_TRACK&&B.hasAudioGroup(E)||C===xe.SUBTITLE_TRACK&&B.hasSubtitleGroup(E))continue;if(g===le.AUDIO&&(l=i.audioGroups)!=null&&l.some(L=>B.hasAudioGroup(L))||g===le.SUBTITLE&&(d=i.subtitleGroups)!=null&&d.some(L=>B.hasSubtitleGroup(L))||b&&i.audioCodec===B.audioCodec||!b&&i.audioCodec!==B.audioCodec||_&&i.codecSet===B.codecSet)continue}h=T;break}}if(h>-1&&a.loadLevel!==h)return e.levelRetry=!0,this.playlistError=0,{action:nt.SendAlternateToPenaltyBox,flags:Pt.None,nextAutoLevel:h}}return{action:nt.SendAlternateToPenaltyBox,flags:Pt.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var a;switch((a=t.errorAction)==null?void 0:a.action){case nt.DoNothing:break;case nt.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==N.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,a=e.errorAction;if(!a)return;const{flags:i,hdcpLevel:o,nextAutoLevel:r}=a;switch(i){case Pt.None:this.switchLevel(e,r);break;case Pt.MoveAllAlternatesMatchingHDCP:o&&(t.maxHdcpLevel=hl[hl.indexOf(o)-1],a.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}a.resolved||this.switchLevel(e,r)}switchLevel(e,t){t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}class gl{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=A.log.bind(A,`${t}:`),this.warn=A.warn.bind(A,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,a){const i=t==null?void 0:t.renditionReports;if(i){let o=-1;for(let r=0;r<i.length;r++){const l=i[r];let d;try{d=new self.URL(l.URI,t.url).href}catch(c){A.warn(`Could not construct new URL for Rendition Report: ${c}`),d=l.URI||""}if(d===e){o=r;break}else d===e.substring(0,d.length)&&(o=r)}if(o!==-1){const r=i[o],l=parseInt(r["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let d=parseInt(r["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const h=Math.min(t.age-t.partTarget,t.targetduration);d>=0&&h>t.partTarget&&(d+=1)}const c=a&&$f(a);return new Vf(l,d>=0?d:void 0,c)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,a){const{details:i,stats:o}=t,r=self.performance.now(),l=o.loading.first?Math.max(0,r-o.loading.first):0;if(i.advancedDateTime=Date.now()-l,i.live||a!=null&&a.live){if(i.reloaded(a),a&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),a&&i.fragments.length>0&&gB(a,i),!this.canLoad||!i.live)return;let d,c,h;if(i.canBlockReload&&i.endSN&&i.advanced){const y=this.hls.config.lowLatencyMode,b=i.lastPartSn,S=i.endSN,_=i.lastPartIndex,C=_!==-1,E=b===S,v=y?0:_;C?(c=E?S+1:b,h=E?v:_+1):c=S+1;const T=i.age,B=T+i.ageHeader;let L=Math.min(B-i.partTarget,i.targetduration*1.5);if(L>0){if(a&&L>a.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${a.tuneInGoal} to: ${L} with playlist age: ${i.age}`),L=0;else{const R=Math.floor(L/i.targetduration);if(c+=R,h!==void 0){const $=Math.round(L%i.targetduration/i.partTarget);h+=$}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${T.toFixed(2)}s goal: ${L} skip sn ${R} to part ${h}`)}i.tuneInGoal=L}if(d=this.getDeliveryDirectives(i,t.deliveryDirectives,c,h),y||!E){this.loadPlaylist(d);return}}else(i.canBlockReload||i.canSkipUntil)&&(d=this.getDeliveryDirectives(i,t.deliveryDirectives,c,h));const u=this.hls.mainForwardBufferInfo,f=u?u.end-u.len:0,p=(i.edge-f)*1e3,m=wB(i,p);i.updated&&r>this.requestScheduled+m&&(this.requestScheduled=o.loading.start),c!==void 0&&i.canBlockReload?this.requestScheduled=o.loading.first+m-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+m<r?this.requestScheduled=r:this.requestScheduled-r<=0&&(this.requestScheduled+=m);let g=this.requestScheduled-r;g=Math.max(0,g),this.log(`reload live playlist ${e} in ${Math.round(g)} ms`),this.timer=self.setTimeout(()=>this.loadPlaylist(d),g)}else this.clearTimer()}getDeliveryDirectives(e,t,a,i){let o=$f(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(a=t.msn,i=t.part,o=Jn.No),new Vf(a,i,o)}checkRetry(e){const t=e.details,a=Xn(e),i=e.errorAction,{action:o,retryCount:r=0,retryConfig:l}=i||{},d=!!i&&!!l&&(o===nt.RetryRequest||!i.resolved&&o===nt.SendAlternateToPenaltyBox);if(d){var c;if(this.requestScheduled=-1,r>=l.maxNumRetry)return!1;if(a&&(c=e.context)!=null&&c.deliveryDirectives)this.warn(`Retrying playlist loading ${r+1}/${l.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const h=fl(l,r);this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn(`Retrying playlist loading ${r+1}/${l.maxNumRetry} after "${t}" in ${h}ms`)}e.levelRetry=!0,i.resolved=!0}return d}}class Us{constructor(e,t=0,a=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=a}sample(e,t){const a=Math.pow(this.alpha_,e);this.estimate_=t*(1-a)+a*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class AB{constructor(e,t,a,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=a,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Us(e),this.fast_=new Us(t),this.defaultTTFB_=i,this.ttfb_=new Us(e)}update(e,t){const{slow_:a,fast_:i,ttfb_:o}=this;a.halfLife!==e&&(this.slow_=new Us(e,a.getEstimate(),a.getTotalWeight())),i.halfLife!==t&&(this.fast_=new Us(t,i.getEstimate(),i.getTotalWeight())),o.halfLife!==e&&(this.ttfb_=new Us(e,o.getEstimate(),o.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const a=8*t,i=e/1e3,o=a/i;this.fast_.sample(i,o),this.slow_.sample(i,o)}sampleTTFB(e){const t=e/1e3,a=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(a,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const Jf={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},Xf={};function LB(s,e,t,a,i,o){const r=s.audioCodec?s.audioGroups:null,l=o==null?void 0:o.audioCodec,d=o==null?void 0:o.channels,c=d?parseInt(d):l?1/0:2;let h=null;if(r!=null&&r.length)try{r.length===1&&r[0]?h=e.groups[r[0]].channels:h=r.reduce((u,f)=>{if(f){const p=e.groups[f];if(!p)throw new Error(`Audio track group ${f} not found`);Object.keys(p.channels).forEach(m=>{u[m]=(u[m]||0)+p.channels[m]})}return u},{2:0})}catch{return!0}return s.videoCodec!==void 0&&(s.width>1920&&s.height>1088||s.height>1920&&s.width>1088||s.frameRate>Math.max(a,30)||s.videoRange!=="SDR"&&s.videoRange!==t||s.bitrate>Math.max(i,8e6))||!!h&&ne(c)&&Object.keys(h).some(u=>parseInt(u)>c)}function IB(s,e,t){const a=s.videoCodec,i=s.audioCodec;if(!a||!i||!t)return Promise.resolve(Jf);const o={width:s.width,height:s.height,bitrate:Math.ceil(Math.max(s.bitrate*.9,s.averageBitrate)),framerate:s.frameRate||30},r=s.videoRange;r!=="SDR"&&(o.transferFunction=r.toLowerCase());const l=a.split(",").map(d=>({type:"media-source",video:Xe(Xe({},o),{},{contentType:Ta(d,"video")})}));return i&&s.audioGroups&&s.audioGroups.forEach(d=>{var c;d&&((c=e.groups[d])==null||c.tracks.forEach(h=>{if(h.groupId===d){const u=h.channels||"",f=parseFloat(u);ne(f)&&f>2&&l.push.apply(l,i.split(",").map(p=>({type:"media-source",audio:{contentType:Ta(p,"audio"),channels:""+f}})))}}))}),Promise.all(l.map(d=>{const c=RB(d);return Xf[c]||(Xf[c]=t.decodingInfo(d))})).then(d=>({supported:!d.some(c=>!c.supported),configurations:l,decodingInfoResults:d})).catch(d=>({supported:!1,configurations:l,decodingInfoResults:[],error:d}))}function RB(s){const{audio:e,video:t}=s,a=t||e;if(a){const i=a.contentType.split('"')[1];if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}function BB(){if(typeof matchMedia=="function"){const s=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(s.media!==e.media)return s.matches===!0}return!1}function NB(s,e){let t=!1,a=[];return s&&(t=s!=="SDR",a=[s]),e&&(a=e.allowedVideoRanges||Yn.slice(0),t=e.preferHDR!==void 0?e.preferHDR:BB(),t?a=a.filter(i=>i!=="SDR"):a=["SDR"]),{preferHDR:t,allowedVideoRanges:a}}function DB(s,e,t,a,i){const o=Object.keys(s),r=a==null?void 0:a.channels,l=a==null?void 0:a.audioCodec,d=r&&parseInt(r)===2;let c=!0,h=!1,u=1/0,f=1/0,p=1/0,m=0,g=[];const{preferHDR:y,allowedVideoRanges:b}=NB(e,i);for(let E=o.length;E--;){const v=s[o[E]];c=v.channels[2]>0,u=Math.min(u,v.minHeight),f=Math.min(f,v.minFramerate),p=Math.min(p,v.minBitrate);const T=b.filter(B=>v.videoRanges[B]>0);T.length>0&&(h=!0,g=T)}u=ne(u)?u:0,f=ne(f)?f:0;const S=Math.max(1080,u),_=Math.max(30,f);return p=ne(p)?p:t,t=Math.max(p,t),h||(e=void 0,g=[]),{codecSet:o.reduce((E,v)=>{const T=s[v];if(v===E)return E;if(T.minBitrate>t)return Xt(v,`min bitrate of ${T.minBitrate} > current estimate of ${t}`),E;if(!T.hasDefaultAudio)return Xt(v,"no renditions with default or auto-select sound found"),E;if(l&&v.indexOf(l.substring(0,4))%5!==0)return Xt(v,`audio codec preference "${l}" not found`),E;if(r&&!d){if(!T.channels[r])return Xt(v,`no renditions with ${r} channel sound found (channels options: ${Object.keys(T.channels)})`),E}else if((!l||d)&&c&&T.channels[2]===0)return Xt(v,"no renditions with stereo sound found"),E;return T.minHeight>S?(Xt(v,`min resolution of ${T.minHeight} > maximum of ${S}`),E):T.minFramerate>_?(Xt(v,`min framerate of ${T.minFramerate} > maximum of ${_}`),E):g.some(B=>T.videoRanges[B]>0)?T.maxScore<m?(Xt(v,`max score of ${T.maxScore} < selected max of ${m}`),E):E&&(Hn(v)>=Hn(E)||T.fragmentError>s[E].fragmentError)?E:(m=T.maxScore,v):(Xt(v,`no variants with VIDEO-RANGE of ${JSON.stringify(g)} found`),E)},void 0),videoRanges:g,preferHDR:y,minFramerate:f,minBitrate:p}}function Xt(s,e){A.log(`[abr] start candidates with "${s}" ignored because ${e}`)}function PB(s){return s.reduce((e,t)=>{let a=e.groups[t.groupId];a||(a=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),a.tracks.push(t);const i=t.channels||"2";return a.channels[i]=(a.channels[i]||0)+1,a.hasDefault=a.hasDefault||t.default,a.hasAutoSelect=a.hasAutoSelect||t.autoselect,a.hasDefault&&(e.hasDefaultAudio=!0),a.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function OB(s,e,t,a){return s.slice(t,a+1).reduce((i,o)=>{if(!o.codecSet)return i;const r=o.audioGroups;let l=i[o.codecSet];l||(i[o.codecSet]=l={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!r,fragmentError:0}),l.minBitrate=Math.min(l.minBitrate,o.bitrate);const d=Math.min(o.height,o.width);return l.minHeight=Math.min(l.minHeight,d),l.minFramerate=Math.min(l.minFramerate,o.frameRate),l.maxScore=Math.max(l.maxScore,o.score),l.fragmentError+=o.fragmentError,l.videoRanges[o.videoRange]=(l.videoRanges[o.videoRange]||0)+1,r&&r.forEach(c=>{if(!c)return;const h=e.groups[c];h&&(l.hasDefaultAudio=l.hasDefaultAudio||e.hasDefaultAudio?h.hasDefault:h.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(h.channels).forEach(u=>{l.channels[u]=(l.channels[u]||0)+h.channels[u]}))}),i},{})}function Ht(s,e,t){if("attrs"in s){const a=e.indexOf(s);if(a!==-1)return a}for(let a=0;a<e.length;a++){const i=e[a];if(zs(s,i,t))return a}return-1}function zs(s,e,t){const{groupId:a,name:i,lang:o,assocLang:r,characteristics:l,default:d}=s,c=s.forced;return(a===void 0||e.groupId===a)&&(i===void 0||e.name===i)&&(o===void 0||e.lang===o)&&(o===void 0||e.assocLang===r)&&(d===void 0||e.default===d)&&(c===void 0||e.forced===c)&&(l===void 0||FB(l,e.characteristics))&&(t===void 0||t(s,e))}function FB(s,e=""){const t=s.split(","),a=e.split(",");return t.length===a.length&&!t.some(i=>a.indexOf(i)===-1)}function Gs(s,e){const{audioCodec:t,channels:a}=s;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(a===void 0||a===(e.channels||"2"))}function MB(s,e,t,a,i){const o=e[a],l=e.reduce((f,p,m)=>{const g=p.uri;return(f[g]||(f[g]=[])).push(m),f},{})[o.uri];l.length>1&&(a=Math.max.apply(Math,l));const d=o.videoRange,c=o.frameRate,h=o.codecSet.substring(0,4),u=Zf(e,a,f=>{if(f.videoRange!==d||f.frameRate!==c||f.codecSet.substring(0,4)!==h)return!1;const p=f.audioGroups,m=t.filter(g=>!p||p.indexOf(g.groupId)!==-1);return Ht(s,m,i)>-1});return u>-1?u:Zf(e,a,f=>{const p=f.audioGroups,m=t.filter(g=>!p||p.indexOf(g.groupId)!==-1);return Ht(s,m,i)>-1})}function Zf(s,e,t){for(let a=e;a;a--)if(t(s[a]))return a;for(let a=e+1;a<s.length;a++)if(t(s[a]))return a;return-1}class $B{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this._abandonRulesCheck=()=>{const{fragCurrent:t,partCurrent:a,hls:i}=this,{autoLevelEnabled:o,media:r}=i;if(!t||!r)return;const l=performance.now(),d=a?a.stats:t.stats,c=a?a.duration:t.duration,h=l-d.loading.start,u=i.minAutoLevel;if(d.aborted||d.loaded&&d.loaded===d.total||t.level<=u){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o||r.paused||!r.playbackRate||!r.readyState)return;const f=i.mainForwardBufferInfo;if(f===null)return;const p=this.bwEstimator.getEstimateTTFB(),m=Math.abs(r.playbackRate);if(h<=Math.max(p,1e3*(c/(m*2))))return;const g=f.len/m,y=d.loading.first?d.loading.first-d.loading.start:-1,b=d.loaded&&y>-1,S=this.getBwEstimate(),_=i.levels,C=_[t.level],E=d.total||Math.max(d.loaded,Math.round(c*C.averageBitrate/8));let v=b?h-y:h;v<1&&b&&(v=Math.min(h,d.loaded*8/S));const T=b?d.loaded*1e3/v:0,B=T?(E-d.loaded)/T:E*8/S+p/1e3;if(B<=g)return;const L=T?T*8:S;let R=Number.POSITIVE_INFINITY,$;for($=t.level-1;$>u;$--){const z=_[$].maxBitrate;if(R=this.getTimeToLoadFrag(p/1e3,L,c*z,!_[$].details),R<g)break}if(R>=B||R>c*10)return;i.nextLoadLevel=i.nextAutoLevel=$,b?this.bwEstimator.sample(h-Math.min(p,y),d.loaded):this.bwEstimator.sampleTTFB(h);const K=_[$].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>K&&this.resetEstimator(K),this.clearTimer(),A.warn(`[abr] Fragment ${t.sn}${a?" part "+a.index:""} of level ${t.level} is loading too slowly;
|
|
42
|
+
`+o):a.stack=o}catch{}}throw a}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=ws(this.defaults,t);const{transitional:a,paramsSerializer:i,headers:o}=t;a!==void 0&&Dr.assertOptions(a,{silentJSONParsing:os.transitional(os.boolean),forcedJSONParsing:os.transitional(os.boolean),clarifyTimeoutError:os.transitional(os.boolean)},!1),i!=null&&(P.isFunction(i)?t.paramsSerializer={serialize:i}:Dr.assertOptions(i,{encode:os.function,serialize:os.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let r=o&&P.merge(o.common,o[t.method]);o&&P.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),t.headers=Nt.concat(r,o);const l=[];let d=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(t)===!1||(d=d&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let h,u=0,f;if(!d){const m=[km.bind(this),void 0];for(m.unshift.apply(m,l),m.push.apply(m,c),f=m.length,h=Promise.resolve(t);u<f;)h=h.then(m[u++],m[u++]);return h}f=l.length;let p=t;for(u=0;u<f;){const m=l[u++],g=l[u++];try{p=m(p)}catch(y){g.call(this,y);break}}try{h=km.call(this,p)}catch(m){return Promise.reject(m)}for(u=0,f=c.length;u<f;)h=h.then(c[u++],c[u++]);return h}getUri(e){e=ws(this.defaults,e);const t=mm(e.baseURL,e.url);return nm(t,e.params,e.paramsSerializer)}}P.forEach(["delete","get","head","options"],function(s){Rn.prototype[s]=function(e,t){return this.request(ws(t||{},{method:s,url:e,data:(t||{}).data}))}}),P.forEach(["post","put","patch"],function(s){function e(t){return function(a,i,o){return this.request(ws(o||{},{method:s,headers:t?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}Rn.prototype[s]=e(),Rn.prototype[s+"Form"]=e(!0)});const Bn=Rn;class Pr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});const a=this;this.promise.then(i=>{if(!a._listeners)return;let o=a._listeners.length;for(;o-- >0;)a._listeners[o](i);a._listeners=null}),this.promise.then=i=>{let o;const r=new Promise(l=>{a.subscribe(l),o=l}).then(i);return r.cancel=function(){a.unsubscribe(o)},r},e(function(i,o,r){a.reason||(a.reason=new Fs(i,o,r),t(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new Pr(function(t){e=t}),cancel:e}}}const NR=Pr;function DR(s){return function(e){return s.apply(null,e)}}function PR(s){return P.isObject(s)&&s.isAxiosError===!0}const Or={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(Or).forEach(([s,e])=>{Or[e]=s});const OR=Or;function Cm(s){const e=new Bn(s),t=zu(Bn.prototype.request,e);return P.extend(t,Bn.prototype,e,{allOwnKeys:!0}),P.extend(t,e,null,{allOwnKeys:!0}),t.create=function(a){return Cm(ws(s,a))},t}const ze=Cm(xr);ze.Axios=Bn,ze.CanceledError=Fs,ze.CancelToken=NR,ze.isCancel=cm,ze.VERSION=Em,ze.toFormData=Cn,ze.AxiosError=_e,ze.Cancel=ze.CanceledError,ze.all=function(s){return Promise.all(s)},ze.spread=DR,ze.isAxiosError=PR,ze.mergeConfig=ws,ze.AxiosHeaders=Nt,ze.formToJSON=s=>rm(P.isHTMLForm(s)?new FormData(s):s),ze.getAdapter=_m.getAdapter,ze.HttpStatusCode=OR,ze.default=ze;const xm=ze,FR=(s,e)=>{const t=s.__vccOpts||s;for(const[a,i]of e)t[a]=i;return t},Fr={name:"ScrollableContainer",props:{backgroundColor:{type:String,default:"#0D1D29"},pxScroll:{type:Number,default:100},arrows:{type:Boolean,default:!0},arrowsHideOnNoScroll:{type:Boolean,default:!1},arrowsScrollHide:{type:Boolean,default:!1},arrowsColor:{type:String,default:"#CBEE6B"},arrowsHeight:{type:Number,default:15},arrowsWidth:{type:Number,default:15},arrowsPadding:{type:Number,default:5},arrowsMargin:{type:Number,default:10},arrowsRadius:{type:String,default:"0%"},arrowsBorder:{type:String,default:"none"},arrowsBackground:{type:String,default:"#0D1D29"},arrowsContainerBgL:{type:String,default:"#0D1D29"},arrowsContainerBgR:{type:String,default:"#0D1D29"},scrollColor:{type:String,default:"#c3e569"},arrowsPosition:{type:String,default:"relative"},height:{type:String,default:"100%"}},data(){return{showLeftArrow:!1,showRightArrow:!0,intervalid1:""}},mounted(){this.getScroll(),this.arrowsHideOnNoScroll&&window.addEventListener("resize",this.resizeSlider),this.arrowsHideOnNoScroll&&this.listenerLoad()},beforeUnmount(){this.arrowsHideOnNoScroll&&window.removeEventListener("resize",this.resizeSlider),this.arrowsHideOnNoScroll&&clearInterval(this.intervalid1)},computed:{getViewBox(){return`-2 0 ${this.arrowsWidth} ${this.arrowsHeight}`},hideShowLeftArrow(){let s="";return this.arrowsPosition=="absolute"?s="leftAbsolute":s="leftRelative",this.arrowsScrollHide?this.showLeftArrow?s+=" showArrowSlide":s+=" hideArrowSlide":s+=" showArrowSlide",s},hideShowRightArrow(){let s="";return this.arrowsPosition=="absolute"?s="rightAbsolute":s="rightRelative",this.arrowsScrollHide?this.showRightArrow?s+=" showArrowSlide":s+=" hideArrowSlide":s+=" showArrowSlide",s}},methods:{scrollLeft(){this.$refs.content.scrollLeft-=this.pxScroll},scrollRight(){this.$refs.content.scrollLeft+=this.pxScroll},getScroll(){let s=0;this.arrowsPosition=="relative"?s=this.$refs.content.scrollWidth-this.$el.clientWidth+this.arrowsMargin*2+this.arrowsWidth*4:s=this.$refs.content.scrollWidth-this.$el.clientWidth,this.$refs.content.scrollLeft==0?this.showLeftArrow=!1:this.showLeftArrow=!0,s>0&&(this.$refs.content.scrollLeft==s?this.showRightArrow=!1:this.showRightArrow=!0),this.arrowsHideOnNoScroll&&this.$refs.content.clientWidth===this.$refs.content.scrollWidth&&(this.showRightArrow=!1)},resizeSlider(){this.getScroll();let s;clearTimeout(s),s=setTimeout(this.getScroll,1e3)},listenerLoad(){this.intervalid1=setInterval((function(){var s=this.$el.clientWidth,e=this.$refs.content.scrollWidth;e>0&&s>0&&(e>s?(this.showRightArrow=!0,clearInterval(this.intervalid1)):clearInterval(this.intervalid1))}).bind(this),3e3)}}},vm=()=>{n.useCssVars(s=>({"26acffa8":s.backgroundColor,"3d95bef4":s.height,"86ba1cc0":s.arrowsPosition,"140b6ada":s.arrowsPadding+"px","7df46be5":s.arrowsBackground,"33f99798":s.arrowsHeight*2+"px","1c8a858d":s.arrowsWidth*2+"px","4a7876c9":s.arrowsRadius,"2ff67e63":s.arrowsBorder,"59c5dd08":s.arrowsMargin+"px","6658215d":s.arrowsContainerBgL,66582163:s.arrowsContainerBgR,e5900a2e:s.scrollColor}))},Am=Fr.setup;Fr.setup=Am?(s,e)=>(vm(),Am(s,e)):vm;const MR={ref:"gscScrollableContainer",class:"scrollable-container"},$R={class:"scrollable-arrows"},VR=["width","height","viewBox"],UR=["stroke"],zR={class:"scrollable-wrapper"},GR={class:"scrollable-arrows"},jR=["width","height","viewBox"],HR=["stroke"];function WR(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",MR,[t.arrows?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["arrows-container",o.hideShowLeftArrow]),onClick:e[0]||(e[0]=(...r)=>o.scrollLeft&&o.scrollLeft(...r))},[n.createElementVNode("div",$R,[(n.openBlock(),n.createElementBlock("svg",{width:t.arrowsWidth,height:t.arrowsHeight,viewBox:o.getViewBox,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:t.arrowsColor},null,8,UR)],8,VR))])],2)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"scrollable-content scrollable-content-slider",ref:"content",onScroll:e[1]||(e[1]=(...r)=>o.getScroll&&o.getScroll(...r))},[n.createElementVNode("div",zR,[n.renderSlot(s.$slots,"default",{},void 0,!0)])],544),t.arrows?(n.openBlock(),n.createElementBlock("div",{key:1,id:"arrows-container-right",class:n.normalizeClass(["arrows-container",o.hideShowRightArrow]),onClick:e[2]||(e[2]=(...r)=>o.scrollRight&&o.scrollRight(...r))},[n.createElementVNode("div",GR,[(n.openBlock(),n.createElementBlock("svg",{width:t.arrowsWidth,height:t.arrowsHeight,viewBox:o.getViewBox,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M0.634765 1.21195L5.89853 6.47571C6.52018 7.09735 6.52018 8.11459 5.89853 8.73623L0.634766 14",stroke:t.arrowsColor},null,8,HR)],8,jR))])],2)):n.createCommentVNode("",!0)],512)}const KR=FR(Fr,[["render",WR],["__scopeId","data-v-7d0811ac"]]),rs=(s,e)=>{const t=s.__vccOpts||s;for(const[a,i]of e)t[a]=i;return t};let Lm=null;const Mr={components:{},props:{titleCategory:{type:String,default:"RESUMEN"},dateGame:{type:String,default:""},showVideos:{type:Boolean,default:!0},colorBackgroundHome:{type:String,default:"#000000"},colorBackgroundAway:{type:String,default:"#FFFFFF"},logoHome:{type:String,default:""},matchday:{type:String,default:""},seasonName:{type:String,default:""},logoAway:{type:String,default:""},score:{type:String,default:""},background:{type:String,default:""}},data(){return{gamesContainerGHWidth:0}},computed:{date(){const s=this.gamesContainerGHWidth;return s<=400?"date400":s<=540?"date540":s<=650?"date650":"date"},seasoncontainer(){const s=this.gamesContainerGHWidth;return s<=400?"season-container400":s<=540?"season-container540":s<=650?"season-container650":"season-container"},matchcontainer(){const s=this.gamesContainerGHWidth;return s<=400?"match-container400":s<=540?"match-container540":s<=650?"match-container650":"match-container"},containerinfogame(){const s=this.gamesContainerGHWidth;return s<=400?"container-info-game400":s<=540?"container-info-game540":s<=650?"container-info-game650":"container-info-game"},playbutton(){const s=this.gamesContainerGHWidth;return s<=400?"play-button400":s<=540?"play-button540":s<=650?"play-button650":"play-button"},baselogo(){const s=this.gamesContainerGHWidth;return s<=400?"base-logo400":s<=540?"base-logo540":s<=650?"base-logo650":"base-logo"},baselogoright(){const s=this.gamesContainerGHWidth;return s<=400?"base-logo-right400":s<=540?"base-logo-right540":s<=650?"base-logo-right650":"base-logo-right"},thumbnailhighlights(){const s=this.gamesContainerGHWidth;return s<=400?"thumbnail-highlights400":s<=540?"thumbnail-highlights540":s<=650?"thumbnail-highlights650":"thumbnail-highlights"},teamlogo(){const s=this.gamesContainerGHWidth;return s<=400?"team-logo400":s<=540?"team-logo540":s<=650?"team-logo650":"team-logo"},logoright(){const s=this.gamesContainerGHWidth;return s<=400?"logo-right400":s<=540?"logo-right540":s<=650?"logo-right650":"logo-right"},secondline(){const s=this.gamesContainerGHWidth;return s<=400?"second-line400":s<=540?"second-line540":s<=650?"second-line650":"second-line"},titlename(){const s=this.gamesContainerGHWidth;return s<=400?"title-name400":s<=540?"title-name540":s<=650?"title-name650":"title-name"}},methods:{onclickPlayVideos(){this.$emit("onclickPlayVideos")},setUpResizeObserver(){if(window.ResizeObserver)Lm=new ResizeObserver(()=>{this.gamesContainerGHWidth=this.$refs.gamesContainerGH?this.$refs.gamesContainerGH.clientWidth:0,this.movil=this.gamesContainerGHWidth<740}),Lm.observe(this.$refs.gamesContainerGH);else throw new Error("Resize observer not supported!")}},mounted(){setTimeout(()=>{this.setUpResizeObserver()},100)}},Im=()=>{n.useCssVars(s=>({a281566c:s.colorBackgroundHome+"45","692c47db":s.colorBackgroundAway+"45","229d672a":s.colorBackgroundHome,"229a5539":s.colorBackgroundAway}))},Rm=Mr.setup;Mr.setup=Rm?(s,e)=>(Im(),Rm(s,e)):Im;const Nn=s=>(n.pushScopeId("data-v-dd4b2ba3"),s=s(),n.popScopeId(),s),qR=Nn(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[n.createElementVNode("path",{d:"M6.6041 22.8554C6.42105 22.7512 6.26805 22.5956 6.1616 22.4053C6.05515 22.215 5.99927 21.9973 6.00001 21.7755V2.22137C6.00026 2.00039 6.0565 1.78362 6.16274 1.59409C6.26899 1.40456 6.42127 1.24936 6.6034 1.14499C6.78553 1.04062 6.9907 0.990981 7.1971 1.00135C7.4035 1.01171 7.60342 1.0817 7.77561 1.20386L21.4907 10.9821C21.6473 11.0935 21.7758 11.2446 21.8646 11.4219C21.9535 11.5992 22 11.7973 22 11.9985C22 12.1996 21.9535 12.3977 21.8646 12.575C21.7758 12.7523 21.6473 12.9034 21.4907 13.0148L7.77561 22.7954C7.60369 22.9178 7.40392 22.988 7.19761 22.9986C6.9913 23.0092 6.78617 22.9597 6.6041 22.8554ZM7.14347 21.7779L20.8585 11.9996L7.14347 21.7779Z",fill:"#CBEE6B"})],-1)),YR=[qR],JR=Nn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/paper-texture.png",alt:"",class:"paper-texture position-image"},null,-1)),XR=["src"],ZR=Nn(()=>n.createElementVNode("div",{class:"gradient-back position-image"},null,-1)),QR=Nn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/halftone-texture.png",alt:"",class:"halftone-texture position-image"},null,-1)),e4=["src"],t4=["src"],s4={class:"text-container"};function a4(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",{ref:"gamesContainerGH",class:n.normalizeClass(o.thumbnailhighlights)},[t.showVideos?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(o.playbutton),onClick:e[0]||(e[0]=(...r)=>o.onclickPlayVideos&&o.onclickPlayVideos(...r))},YR,2)):n.createCommentVNode("",!0),t.dateGame!=""?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(o.date)},n.toDisplayString(t.dateGame),3)):n.createCommentVNode("",!0),t.matchday!=""&&t.seasonName!=""?(n.openBlock(),n.createElementBlock("div",{key:2,class:n.normalizeClass(o.containerinfogame)},[t.matchday!=""?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(o.matchcontainer)},n.toDisplayString(t.matchday),3)):n.createCommentVNode("",!0),t.seasonName!=""?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(o.seasoncontainer)},n.toDisplayString(t.seasonName),3)):n.createCommentVNode("",!0)],2)):n.createCommentVNode("",!0),JR,n.createElementVNode("img",{src:t.background,alt:"",class:"bkg-blackwhite position-image"},null,8,XR),n.createElementVNode("div",{class:n.normalizeClass([o.baselogo,"position-image"])},null,2),n.createElementVNode("div",{class:n.normalizeClass(o.baselogoright)},null,2),ZR,QR,n.createElementVNode("img",{src:t.logoHome,alt:"",class:n.normalizeClass(o.teamlogo)},null,10,e4),n.createElementVNode("img",{src:t.logoAway,alt:"",class:n.normalizeClass(o.logoright)},null,10,t4),n.createElementVNode("div",s4,[n.createElementVNode("span",{class:n.normalizeClass(o.secondline)},n.toDisplayString(t.score),3),n.createElementVNode("div",{class:n.normalizeClass(o.titlename)},n.toDisplayString(t.titleCategory),3)])],2)}const n4=rs(Mr,[["render",a4],["__scopeId","data-v-dd4b2ba3"]]);let Bm=null;const $r={components:{},props:{colorBackgroundHome:{type:String,default:"#000000"},colorBackgroundAway:{type:String,default:"#FFFFFF"},nameCategory:{type:String,default:""},photoProfile:{type:String,default:""},logoHome:{type:String,default:""},logoAway:{type:String,default:""},scoreHome:{type:[String,Number],default:""},scoreAway:{type:[String,Number],default:""},background:{type:String,default:""},typeImg:{type:Number,default:0},nameHomeTeam:{type:String,default:""},nameAwayTeam:{type:String,default:""},namePlayer:{type:String,default:""}},data(){return{gamesContainerCWidth:0}},computed:{playbutton(){const s=this.gamesContainerCWidth;return s<=400?"play-button400":s<=540?"play-button540":s<=650?"play-button650":"play-button"},teamlogo(){const s=this.gamesContainerCWidth;return s<=400?"team-logo400":s<=540?"team-logo540":s<=650?"team-logo650":"team-logo"},firstline(){const s=this.gamesContainerCWidth;return s<=400?"first-line400":s<=540?"first-line540":s<=650?"first-line650":"first-line"},secondline(){const s=this.gamesContainerCWidth;return s<=400?"second-line400":s<=540?"second-line540":s<=650?"second-line650":"second-line"},playerimage(){const s=this.gamesContainerCWidth;return s<=400?"player-image400":s<=540?"player-image540":s<=650?"player-image650":"player-image"},thumbnailhighlights(){const s=this.gamesContainerCWidth;return s<=400?"thumbnail-highlights400":s<=540?"thumbnail-highlights540":s<=650?"thumbnail-highlights650":"thumbnail-highlights"}},methods:{onclickPlayVideos(){this.$emit("onclickPlayVideos")},setUpResizeObserver(){if(window.ResizeObserver)Bm=new ResizeObserver(()=>{this.gamesContainerCWidth=this.$refs.gamesContainerC?this.$refs.gamesContainerC.clientWidth:0,this.movil=this.gamesContainerCWidth<740}),Bm.observe(this.$refs.gamesContainerC);else throw new Error("Resize observer not supported!")}},mounted(){setTimeout(()=>{this.setUpResizeObserver()},100)}},Nm=()=>{n.useCssVars(s=>({"9cae8720":s.colorBackgroundHome,"58cca122":s.colorBackgroundHome+"36"}))},Dm=$r.setup;$r.setup=Dm?(s,e)=>(Nm(),Dm(s,e)):Nm;const Sa=s=>(n.pushScopeId("data-v-ef4021c1"),s=s(),n.popScopeId(),s),i4=Sa(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[n.createElementVNode("path",{d:"M6.6041 22.8554C6.42105 22.7512 6.26805 22.5956 6.1616 22.4053C6.05515 22.215 5.99927 21.9973 6.00001 21.7755V2.22137C6.00026 2.00039 6.0565 1.78362 6.16274 1.59409C6.26899 1.40456 6.42127 1.24936 6.6034 1.14499C6.78553 1.04062 6.9907 0.990981 7.1971 1.00135C7.4035 1.01171 7.60342 1.0817 7.77561 1.20386L21.4907 10.9821C21.6473 11.0935 21.7758 11.2446 21.8646 11.4219C21.9535 11.5992 22 11.7973 22 11.9985C22 12.1996 21.9535 12.3977 21.8646 12.575C21.7758 12.7523 21.6473 12.9034 21.4907 13.0148L7.77561 22.7954C7.60369 22.9178 7.40392 22.988 7.19761 22.9986C6.9913 23.0092 6.78617 22.9597 6.6041 22.8554ZM7.14347 21.7779L20.8585 11.9996L7.14347 21.7779Z",fill:"#CBEE6B"})],-1)),o4=[i4],r4=Sa(()=>n.createElementVNode("div",{class:"gradient-back position-image"},null,-1)),l4=["src"],c4=Sa(()=>n.createElementVNode("div",{class:"base-logo"},null,-1)),d4=["src"],h4=Sa(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/halftone-texture.png",alt:"",class:"halftone-texture position-image"},null,-1)),u4={class:"text-container"},m4={class:"player-image position-image"},f4=["src"],p4=["src"],g4=["src"],y4=Sa(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/paper-texture.png",alt:"",class:"paper-texture position-image"},null,-1));function b4(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",{ref:"gamesContainerC",class:n.normalizeClass(o.thumbnailhighlights)},[n.createElementVNode("div",{class:n.normalizeClass(o.playbutton),onClick:e[0]||(e[0]=(...r)=>o.onclickPlayVideos&&o.onclickPlayVideos(...r))},o4,2),r4,n.createElementVNode("img",{src:t.background,alt:"",class:"bkg-blackwhite position-image"},null,8,l4),c4,n.createElementVNode("img",{src:t.logoHome,alt:"",class:n.normalizeClass(o.teamlogo)},null,10,d4),h4,n.createElementVNode("div",u4,[n.createElementVNode("span",{class:n.normalizeClass(o.firstline)},n.toDisplayString(t.namePlayer),3),n.createElementVNode("span",{class:n.normalizeClass(o.secondline),style:n.normalizeStyle(t.nameCategory=="Balones recuperados en disputa "?"font-size: 25px":"")},n.toDisplayString(t.nameCategory),7)]),n.createElementVNode("div",m4,[t.typeImg==0?(n.openBlock(),n.createElementBlock("img",{key:0,src:t.photoProfile,class:n.normalizeClass(o.playerimage)},null,10,f4)):n.createCommentVNode("",!0),t.typeImg==1?(n.openBlock(),n.createElementBlock("img",{key:1,src:t.photoProfile,alt:""},null,8,p4)):n.createCommentVNode("",!0),t.typeImg==2?(n.openBlock(),n.createElementBlock("img",{key:2,src:t.photoProfile,class:"img-number"},null,8,g4)):n.createCommentVNode("",!0)]),y4],2)}const S4=rs($r,[["render",b4],["__scopeId","data-v-ef4021c1"]]);let Pm=null;const Vr={components:{},props:{colorBackgroundHome:{type:String,default:"#000000"},showVideos:{type:Boolean,default:!0},colorBackgroundAway:{type:String,default:"#FFFFFF"},logoHome:{type:String,default:""},logoAway:{type:String,default:""},score:{type:String,default:""},background:{type:String,default:""},nameTeam:{type:String,default:""},nameCategory:{type:String,default:""}},data(){return{gamesContainerCTWidth:0}},computed:{playbutton(){const s=this.gamesContainerCTWidth;return s<=400?"play-button400":s<=540?"play-button540":s<=650?"play-button650":"play-button"},thumbnailhighlights(){const s=this.gamesContainerCTWidth;return s<=400?"thumbnail-highlights400":s<=540?"thumbnail-highlights540":s<=650?"thumbnail-highlights650":"thumbnail-highlights"},secondline(){const s=this.gamesContainerCTWidth;return s<=400?"second-line400":s<=540?"second-line540":s<=650?"second-line650":"second-line"},firstline(){const s=this.gamesContainerCTWidth;return s<=400?"first-line400":s<=540?"first-line540":s<=650?"first-line650":"first-line"},teamlogo(){const s=this.gamesContainerCTWidth;return s<=400?"team-logo400":s<=540?"team-logo540":s<=650?"team-logo650":"team-logo"}},methods:{onclickPlayVideos(){this.$emit("onclickPlayVideos")},setUpResizeObserver(){if(window.ResizeObserver)Pm=new ResizeObserver(()=>{this.gamesContainerCTWidth=this.$refs.gamesContainerCT?this.$refs.gamesContainerCT.clientWidth:0,this.gamesContainerCTWidth<740?this.movil=!0:this.movil=!1}),Pm.observe(this.$refs.gamesContainerCT);else throw new Error("Resize observer not supported!")}},mounted(){setTimeout(()=>{this.setUpResizeObserver()},100)}},Om=()=>{n.useCssVars(s=>({"3ce1ca00":s.colorBackgroundHome,"916c7edc":s.colorBackgroundHome+"36"}))},Fm=Vr.setup;Vr.setup=Fm?(s,e)=>(Om(),Fm(s,e)):Om;const Dn=s=>(n.pushScopeId("data-v-191985e2"),s=s(),n.popScopeId(),s),w4=Dn(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[n.createElementVNode("path",{d:"M6.6041 22.8554C6.42105 22.7512 6.26805 22.5956 6.1616 22.4053C6.05515 22.215 5.99927 21.9973 6.00001 21.7755V2.22137C6.00026 2.00039 6.0565 1.78362 6.16274 1.59409C6.26899 1.40456 6.42127 1.24936 6.6034 1.14499C6.78553 1.04062 6.9907 0.990981 7.1971 1.00135C7.4035 1.01171 7.60342 1.0817 7.77561 1.20386L21.4907 10.9821C21.6473 11.0935 21.7758 11.2446 21.8646 11.4219C21.9535 11.5992 22 11.7973 22 11.9985C22 12.1996 21.9535 12.3977 21.8646 12.575C21.7758 12.7523 21.6473 12.9034 21.4907 13.0148L7.77561 22.7954C7.60369 22.9178 7.40392 22.988 7.19761 22.9986C6.9913 23.0092 6.78617 22.9597 6.6041 22.8554ZM7.14347 21.7779L20.8585 11.9996L7.14347 21.7779Z",fill:"#CBEE6B"})],-1)),_4=[w4],k4=Dn(()=>n.createElementVNode("div",{class:"gradient-back position-image"},null,-1)),E4=["src"],T4={width:"275",height:"125",viewBox:"0 0 275 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"base-logo"},C4=["fill"],x4=["id"],v4=["stop-color"],A4=["stop-color"],L4=["src"],I4=Dn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/halftone-texture.png",alt:"",class:"halftone-texture position-image"},null,-1)),R4={class:"text-container"},B4=Dn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/paper-texture.png",alt:"",class:"paper-texture position-image"},null,-1));function N4(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",{ref:"gamesContainerCT",class:n.normalizeClass(o.thumbnailhighlights)},[t.showVideos?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(o.playbutton),onClick:e[0]||(e[0]=(...r)=>o.onclickPlayVideos&&o.onclickPlayVideos(...r))},_4,2)):n.createCommentVNode("",!0),k4,n.createElementVNode("img",{src:t.background,alt:"",class:"bkg-blackwhite position-image"},null,8,E4),(n.openBlock(),n.createElementBlock("svg",T4,[n.createElementVNode("path",{d:"M274.641 124.094L0 0.675049V124.094H274.641Z",fill:"url(#paint0_linear_7_"+t.nameTeam.replaceAll(" ","")+")"},null,8,C4),n.createElementVNode("defs",null,[n.createElementVNode("linearGradient",{id:"paint0_linear_7_"+t.nameTeam.replaceAll(" ",""),x1:"58.6578",y1:"15.5938",x2:"58.6578",y2:"124.094",gradientUnits:"userSpaceOnUse"},[n.createElementVNode("stop",{"stop-color":t.colorBackgroundHome},null,8,v4),n.createElementVNode("stop",{offset:"1","stop-color":t.colorBackgroundHome},null,8,A4)],8,x4)])])),n.createElementVNode("img",{class:n.normalizeClass(o.teamlogo),src:t.logoHome,alt:""},null,10,L4),I4,n.createElementVNode("div",R4,[n.createElementVNode("span",{class:n.normalizeClass(o.firstline)},[t.nameTeam!="Local"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(n.toDisplayString(t.nameTeam),1)],64)):n.createCommentVNode("",!0)],2),n.createElementVNode("div",{class:n.normalizeClass(o.secondline)},n.toDisplayString(t.nameCategory),3)]),B4],2)}const D4=rs(Vr,[["render",N4],["__scopeId","data-v-191985e2"]]);let Mm=null;const Ur={components:{},props:{colorBackgroundHome:{type:String,default:"#000000"},colorBackgroundAway:{type:String,default:"#FFFFFF"},logoHome:{type:String,default:""},logoAway:{type:String,default:""},score:{type:String,default:""},background:{type:String,default:""},nameTeam:{type:String,default:""},nameCategory:{type:String,default:""}},data(){return{gamesContainerTAWidth:0}},computed:{playbutton(){const s=this.gamesContainerTAWidth;return s<=400?"play-button400":s<=540?"play-button540":s<=650?"play-button650":"play-button"},thumbnailhighlights(){const s=this.gamesContainerTAWidth;return s<=400?"thumbnail-highlights400":s<=540?"thumbnail-highlights540":s<=650?"thumbnail-highlights650":"thumbnail-highlights"},secondline(){const s=this.gamesContainerTAWidth;return s<=400?"second-line400":s<=540?"second-line540":s<=650?"second-line650":"second-line"},firstline(){const s=this.gamesContainerTAWidth;return s<=400?"first-line400":s<=540?"first-line540":s<=650?"first-line650":"first-line"},teamlogo(){const s=this.gamesContainerTAWidth;return s<=400?"team-logo400":s<=540?"team-logo540":s<=650?"team-logo650":"team-logo"}},methods:{onclickPlayVideos(){this.$emit("onclickPlayVideos")},setUpResizeObserver(){if(window.ResizeObserver)Mm=new ResizeObserver(()=>{this.gamesContainerTAWidth=this.$refs.gamesContainerTA?this.$refs.gamesContainerTA.clientWidth:0,this.movil=this.gamesContainerTAWidth<740}),Mm.observe(this.$refs.gamesContainerTA);else throw new Error("Resize observer not supported!")}},mounted(){setTimeout(()=>{this.setUpResizeObserver()},100)}},$m=()=>{n.useCssVars(s=>({"1e0230d2":s.colorBackgroundHome,"1ae427ca":s.colorBackgroundHome+"36"}))},Vm=Ur.setup;Ur.setup=Vm?(s,e)=>($m(),Vm(s,e)):$m;const Pn=s=>(n.pushScopeId("data-v-61a93c22"),s=s(),n.popScopeId(),s),P4=Pn(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[n.createElementVNode("path",{d:"M6.6041 22.8554C6.42105 22.7512 6.26805 22.5956 6.1616 22.4053C6.05515 22.215 5.99927 21.9973 6.00001 21.7755V2.22137C6.00026 2.00039 6.0565 1.78362 6.16274 1.59409C6.26899 1.40456 6.42127 1.24936 6.6034 1.14499C6.78553 1.04062 6.9907 0.990981 7.1971 1.00135C7.4035 1.01171 7.60342 1.0817 7.77561 1.20386L21.4907 10.9821C21.6473 11.0935 21.7758 11.2446 21.8646 11.4219C21.9535 11.5992 22 11.7973 22 11.9985C22 12.1996 21.9535 12.3977 21.8646 12.575C21.7758 12.7523 21.6473 12.9034 21.4907 13.0148L7.77561 22.7954C7.60369 22.9178 7.40392 22.988 7.19761 22.9986C6.9913 23.0092 6.78617 22.9597 6.6041 22.8554ZM7.14347 21.7779L20.8585 11.9996L7.14347 21.7779Z",fill:"#CBEE6B"})],-1)),O4=[P4],F4=Pn(()=>n.createElementVNode("div",{class:"gradient-back position-image"},null,-1)),M4=["src"],$4={width:"275",height:"125",viewBox:"0 0 275 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"base-logo-away"},V4=["fill"],U4=["id"],z4=["stop-color"],G4=["stop-color"],j4=["src"],H4=Pn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/halftone-texture.png",alt:"",class:"halftone-texture position-image"},null,-1)),W4={class:"text-container"},K4=Pn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/paper-texture.png",alt:"",class:"paper-texture position-image"},null,-1));function q4(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",{ref:"gamesContainerTA",class:n.normalizeClass(o.thumbnailhighlights)},[n.createElementVNode("div",{class:n.normalizeClass(o.playbutton),onClick:e[0]||(e[0]=(...r)=>o.onclickPlayVideos&&o.onclickPlayVideos(...r))},O4,2),F4,n.createElementVNode("img",{src:t.background,alt:"",class:"bkg-blackwhite position-image"},null,8,M4),(n.openBlock(),n.createElementBlock("svg",$4,[n.createElementVNode("path",{d:"M274.641 124.094L0 0.675049V124.094H274.641Z",fill:"url(#paint0_linear_7_"+t.nameTeam.replaceAll(" ","")+")"},null,8,V4),n.createElementVNode("defs",null,[n.createElementVNode("linearGradient",{id:"paint0_linear_7_"+t.nameTeam.replaceAll(" ",""),x1:"58.6578",y1:"15.5938",x2:"58.6578",y2:"124.094",gradientUnits:"userSpaceOnUse"},[n.createElementVNode("stop",{"stop-color":t.colorBackgroundAway},null,8,z4),n.createElementVNode("stop",{offset:"1","stop-color":t.colorBackgroundAway},null,8,G4)],8,U4)])])),n.createElementVNode("img",{class:n.normalizeClass(o.teamlogo),src:t.logoHome,alt:""},null,10,j4),H4,n.createElementVNode("div",W4,[n.createElementVNode("span",{class:n.normalizeClass(o.firstline)},[t.nameTeam!="Away"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(n.toDisplayString(t.nameTeam),1)],64)):n.createCommentVNode("",!0)],2),n.createElementVNode("div",{class:n.normalizeClass(o.secondline)},n.toDisplayString(t.nameCategory),3)]),K4],2)}const Y4=rs(Ur,[["render",q4],["__scopeId","data-v-61a93c22"]]);let Um=null;const zr={components:{},props:{colorBackgroundHome:{type:String,default:"#000000"},colorBackgroundAway:{type:String,default:"#FFFFFF"},logoHome:{type:String,default:""},logoAway:{type:String,default:""},score:{type:String,default:""},background:{type:String,default:""},nameTeam:{type:String,default:""},nameCategory:{type:String,default:""}},data(){return{gamesContainerTALWidth:0}},computed:{playbutton(){const s=this.gamesContainerTALWidth;return s<=400?"play-button400":s<=540?"play-button540":s<=650?"play-button650":"play-button"},thumbnailhighlights(){const s=this.gamesContainerTALWidth;return s<=400?"thumbnail-highlights400":s<=540?"thumbnail-highlights540":s<=650?"thumbnail-highlights650":"thumbnail-highlights"},secondline(){const s=this.gamesContainerTALWidth;return s<=400?"second-line400":s<=540?"second-line540":s<=650?"second-line650":"second-line"},firstline(){const s=this.gamesContainerTALWidth;return s<=400?"first-line400":s<=540?"first-line540":s<=650?"first-line650":"first-line"},teamlogo(){const s=this.gamesContainerTALWidth;return s<=400?"team-logo400":s<=540?"team-logo540":s<=650?"team-logo650":"team-logo"}},methods:{onclickPlayVideos(){this.$emit("onclickPlayVideos")},setUpResizeObserver(){if(window.ResizeObserver)Um=new ResizeObserver(()=>{this.gamesContainerTALWidth=this.$refs.gamesContainerTAL?this.$refs.gamesContainerTAL.clientWidth:0,this.movil=this.gamesContainerTALWidth<740}),Um.observe(this.$refs.gamesContainerTAL);else throw new Error("Resize observer not supported!")}},mounted(){setTimeout(()=>{this.setUpResizeObserver()},100)}},zm=()=>{n.useCssVars(s=>({"41af18a7":s.colorBackgroundHome,"1387690b":s.colorBackgroundHome+"36"}))},Gm=zr.setup;zr.setup=Gm?(s,e)=>(zm(),Gm(s,e)):zm;const On=s=>(n.pushScopeId("data-v-19ce95f3"),s=s(),n.popScopeId(),s),J4=On(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[n.createElementVNode("path",{d:"M6.6041 22.8554C6.42105 22.7512 6.26805 22.5956 6.1616 22.4053C6.05515 22.215 5.99927 21.9973 6.00001 21.7755V2.22137C6.00026 2.00039 6.0565 1.78362 6.16274 1.59409C6.26899 1.40456 6.42127 1.24936 6.6034 1.14499C6.78553 1.04062 6.9907 0.990981 7.1971 1.00135C7.4035 1.01171 7.60342 1.0817 7.77561 1.20386L21.4907 10.9821C21.6473 11.0935 21.7758 11.2446 21.8646 11.4219C21.9535 11.5992 22 11.7973 22 11.9985C22 12.1996 21.9535 12.3977 21.8646 12.575C21.7758 12.7523 21.6473 12.9034 21.4907 13.0148L7.77561 22.7954C7.60369 22.9178 7.40392 22.988 7.19761 22.9986C6.9913 23.0092 6.78617 22.9597 6.6041 22.8554ZM7.14347 21.7779L20.8585 11.9996L7.14347 21.7779Z",fill:"#CBEE6B"})],-1)),X4=[J4],Z4=On(()=>n.createElementVNode("div",{class:"gradient-back position-image"},null,-1)),Q4=["src"],e3={width:"275",height:"125",viewBox:"0 0 275 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"base-logo-away-live"},t3=["fill"],s3=["id"],a3=["stop-color"],n3=["stop-color"],i3=["src"],o3=On(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/halftone-texture.png",alt:"",class:"halftone-texture position-image"},null,-1)),r3={class:"text-container"},l3=On(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/paper-texture.png",alt:"",class:"paper-texture position-image"},null,-1));function c3(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",{ref:"gamesContainerTAL",class:n.normalizeClass(o.thumbnailhighlights)},[n.createElementVNode("div",{class:n.normalizeClass(o.playbutton),onClick:e[0]||(e[0]=(...r)=>o.onclickPlayVideos&&o.onclickPlayVideos(...r))},X4,2),Z4,n.createElementVNode("img",{src:t.background,alt:"",class:"bkg-blackwhite position-image"},null,8,Q4),(n.openBlock(),n.createElementBlock("svg",e3,[n.createElementVNode("path",{d:"M274.641 124.094L0 0.675049V124.094H274.641Z",fill:"url(#paint0_linear_10_"+t.nameTeam.replaceAll(" ","")+")"},null,8,t3),n.createElementVNode("defs",null,[n.createElementVNode("linearGradient",{id:"paint0_linear_10_"+t.nameTeam.replaceAll(" ",""),x1:"58.6578",y1:"15.5938",x2:"58.6578",y2:"124.094",gradientUnits:"userSpaceOnUse"},[n.createElementVNode("stop",{"stop-color":t.colorBackgroundAway},null,8,a3),n.createElementVNode("stop",{offset:"1","stop-color":t.colorBackgroundAway},null,8,n3)],8,s3)])])),n.createElementVNode("img",{class:n.normalizeClass(o.teamlogo),src:t.logoHome,alt:""},null,10,i3),o3,n.createElementVNode("div",r3,[n.createElementVNode("span",{class:n.normalizeClass(o.firstline)},[t.nameTeam!="Away"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(n.toDisplayString(t.nameTeam),1)],64)):n.createCommentVNode("",!0)],2),n.createElementVNode("div",{class:n.normalizeClass(o.secondline)},n.toDisplayString(t.nameCategory),3)]),l3],2)}const d3=rs(zr,[["render",c3],["__scopeId","data-v-19ce95f3"]]);let jm=null;const Gr={components:{},props:{colorFontHome:{type:String,default:"#000000"},colorFontAway:{type:String,default:"#000000"},type:{type:Number,default:0},showVideos:{type:Boolean,default:!0},playStatus:{type:Number,default:2},matchday:{type:String,default:""},seasonName:{type:String,default:""},colorBackgroundHome:{type:String,default:"#000000"},colorBackgroundAway:{type:String,default:"#FFFFFF"},nameCategory:{type:String,default:""},showimg:{type:Boolean,default:!0},photoProfile:{type:String,default:""},logoHome:{type:String,default:""},logoAway:{type:String,default:""},date:{type:String,default:""},scoreHome:{type:[String,Number],default:""},scoreAway:{type:[String,Number],default:""},background:{type:String,default:""},typeImg:{type:Number,default:0},nameHomeTeam:{type:String,default:""},nameAwayTeam:{type:String,default:""},namePlayer:{type:String,default:""}},data(){return{gamesContainerGPWidth:0}},computed:{seasoncontainer(){const s=this.gamesContainerGPWidth;return s<=400?"season-container400":s<=540?"season-container540":s<=650?"season-container650":"season-container"},matchcontainer(){const s=this.gamesContainerGPWidth;return s<=400?"match-container400":s<=540?"match-container540":s<=650?"match-container650":"match-container"},seasonnameContainer(){const s=this.gamesContainerGPWidth;return s<=400?"seasonname400":s<=540?"seasonname540":s<=650?"seasonname650":"seasonname"},matchboxContainer(){const s=this.gamesContainerGPWidth;return s<=400?"matchbox400":s<=540?"matchbox540":s<=650?"matchbox650":"matchbox"},containerinfogame(){const s=this.gamesContainerGPWidth;return s<=400?"container-info-game400":s<=540?"container-info-game540":s<=650?"container-info-game650":"container-info-game"},playbutton(){const s=this.gamesContainerGPWidth;return s<=400?"play-button400":s<=540?"play-button540":s<=650?"play-button650":"play-button"},points(){const s=this.gamesContainerGPWidth;return s<=400?"points400":s<=540?"points540":s<=650?"points650":"points"},teamname(){const s=this.gamesContainerGPWidth;return s<=400?"team-name400":s<=540?"team-name540":s<=650?"team-name650":"team-name"},teamscore(){const s=this.gamesContainerGPWidth;return s<=400?"team-score400":s<=540?"team-score540":s<=650?"team-score650":"team-score"},teamlogo(){const s=this.gamesContainerGPWidth;return s<=400?"team-logo400":s<=540?"team-logo540":s<=650?"team-logo650":"team-logo"},hometeam(){const s=this.gamesContainerGPWidth;return s<=400?"home-team400":s<=540?"home-team540":s<=650?"home-team650":"home-team"},awayteam(){const s=this.gamesContainerGPWidth;return s<=400?"away-team400":s<=540?"away-team540":s<=650?"away-team650":"away-team"},texttitle(){const s=this.gamesContainerGPWidth;return s<=400?"text-title400":s<=540?"text-title540":s<=650?"text-title650":"text-title"},texttitle2(){const s=this.gamesContainerGPWidth;return s<=400?"text-title2400":s<=540?"text-title2540":s<=650?"text-title2650":"text-title2"},playerimage(){const s=this.gamesContainerGPWidth;return s<=400?"player-image400":s<=540?"player-image540":s<=650?"player-image650":"player-image"},thumbnailhighlights(){const s=this.gamesContainerGPWidth;return s<=400?"thumbnail-highlights400":s<=540?"thumbnail-highlights540":s<=650?"thumbnail-highlights650":"thumbnail-highlights"}},methods:{onclickPlayVideos(){this.$emit("onclickPlayVideos")},setUpResizeObserver(){if(window.ResizeObserver)jm=new ResizeObserver(()=>{this.gamesContainerGPWidth=this.$refs.gamesContainerGP?this.$refs.gamesContainerGP.clientWidth:0,this.gamesContainerGPWidth<740?this.movil=!0:this.movil=!1}),jm.observe(this.$refs.gamesContainerGP);else throw new Error("Resize observer not supported!")}},mounted(){setTimeout(()=>{this.setUpResizeObserver()},100)}},Hm=()=>{n.useCssVars(s=>({"14532c00":s.colorBackgroundHome,"14594fe2":s.colorBackgroundAway,"672ee12c":s.colorBackgroundAway+"62","11fb9192":s.colorBackgroundHome+"36"}))},Wm=Gr.setup;Gr.setup=Wm?(s,e)=>(Hm(),Wm(s,e)):Hm;const Fn=s=>(n.pushScopeId("data-v-77384f47"),s=s(),n.popScopeId(),s),h3=["width","src"],u3=Fn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/paper-texture.png",alt:"",class:"paper-texture position-image"},null,-1)),m3=Fn(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[n.createElementVNode("path",{d:"M6.6041 22.8554C6.42105 22.7512 6.26805 22.5956 6.1616 22.4053C6.05515 22.215 5.99927 21.9973 6.00001 21.7755V2.22137C6.00026 2.00039 6.0565 1.78362 6.16274 1.59409C6.26899 1.40456 6.42127 1.24936 6.6034 1.14499C6.78553 1.04062 6.9907 0.990981 7.1971 1.00135C7.4035 1.01171 7.60342 1.0817 7.77561 1.20386L21.4907 10.9821C21.6473 11.0935 21.7758 11.2446 21.8646 11.4219C21.9535 11.5992 22 11.7973 22 11.9985C22 12.1996 21.9535 12.3977 21.8646 12.575C21.7758 12.7523 21.6473 12.9034 21.4907 13.0148L7.77561 22.7954C7.60369 22.9178 7.40392 22.988 7.19761 22.9986C6.9913 23.0092 6.78617 22.9597 6.6041 22.8554ZM7.14347 21.7779L20.8585 11.9996L7.14347 21.7779Z",fill:"#CBEE6B"})],-1)),f3=[m3],p3={class:"player-container"},g3=["src"],y3=["src"],b3=["src"],S3={class:"container-score"},w3=["src"],_3=["src"],k3=["src"],E3=Fn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/halftone-texture.png",alt:"",class:"halftone-texture position-image"},null,-1)),T3=Fn(()=>n.createElementVNode("div",{class:"gradient-color"},null,-1));function C3(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",{ref:"gamesContainerGP",class:n.normalizeClass(o.thumbnailhighlights)},[t.playStatus!=2?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass((t.playStatus==1,"icon-thumb"))},[n.createElementVNode("img",{width:t.playStatus==1?60:40,src:t.playStatus==1?"http://golstatsimages.blob.core.windows.net/images-library/icn-live@2x.png":"http://golstatsimages.blob.core.windows.net/images-library/icn-info@2x.png"},null,8,h3)],2)):n.createCommentVNode("",!0),u3,t.showVideos?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(o.playbutton),onClick:e[0]||(e[0]=(...r)=>o.onclickPlayVideos&&o.onclickPlayVideos(...r))},f3,2)):n.createCommentVNode("",!0),n.createElementVNode("div",p3,[n.createElementVNode("div",{class:n.normalizeClass(o.containerinfogame)},[n.createElementVNode("div",{class:n.normalizeClass(o.matchcontainer)},[t.matchday?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(o.matchboxContainer)},n.toDisplayString(t.matchday),3)):n.createCommentVNode("",!0),t.seasonName?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(o.seasonnameContainer)},n.toDisplayString(t.seasonName),3)):n.createCommentVNode("",!0)],2),t.date?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(o.seasoncontainer)},n.toDisplayString(t.date),3)):n.createCommentVNode("",!0)],2),t.type==0?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass(o.texttitle)},n.toDisplayString(t.nameCategory),3)):(n.openBlock(),n.createElementBlock("span",{key:1,class:n.normalizeClass(o.texttitle2)},n.toDisplayString(t.nameCategory),3)),t.showimg?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[t.typeImg==0?(n.openBlock(),n.createElementBlock("img",{key:0,src:t.photoProfile,class:n.normalizeClass(o.playerimage)},null,10,g3)):n.createCommentVNode("",!0),t.typeImg==1?(n.openBlock(),n.createElementBlock("img",{key:1,src:t.photoProfile,alt:""},null,8,y3)):n.createCommentVNode("",!0),t.typeImg==2?(n.openBlock(),n.createElementBlock("img",{key:2,src:t.photoProfile,class:"img-number"},null,8,b3)):n.createCommentVNode("",!0)],64)):n.createCommentVNode("",!0),n.createElementVNode("div",S3,[n.createElementVNode("div",{class:n.normalizeClass(o.hometeam)},[n.createElementVNode("span",{class:n.normalizeClass(o.teamname),style:n.normalizeStyle({color:t.colorFontAway})},n.toDisplayString(t.nameHomeTeam),7),n.createElementVNode("img",{src:t.logoHome,alt:"",class:n.normalizeClass(o.teamlogo)},null,10,w3),n.createElementVNode("span",{class:n.normalizeClass(o.teamscore)},n.toDisplayString(t.scoreHome),3)],2),n.createElementVNode("span",{class:n.normalizeClass(o.points)},":",2),n.createElementVNode("div",{class:n.normalizeClass(o.awayteam)},[n.createElementVNode("span",{class:n.normalizeClass(o.teamscore)},n.toDisplayString(t.scoreAway),3),n.createElementVNode("img",{src:t.logoAway,alt:"",class:n.normalizeClass(o.teamlogo)},null,10,_3),n.createElementVNode("span",{class:n.normalizeClass(o.teamname),style:n.normalizeStyle({color:t.colorFontAway})},n.toDisplayString(t.nameAwayTeam),7)],2)])]),n.createElementVNode("img",{src:t.background,alt:"",class:"bkg-blackwhite position-image"},null,8,k3),E3,T3],2)}const x3=rs(Gr,[["render",C3],["__scopeId","data-v-77384f47"]]);let Km=null;const jr={components:{},props:{colorFont:{type:String,default:"#000000"},showVideos:{type:Boolean,default:!0},colorBackgroundHome:{type:String,default:"#000000"},colorBackgroundAway:{type:String,default:"#FFFFFF"},nameCategory:{type:String,default:""},photoProfile:{type:String,default:""},logoHome:{type:String,default:""},logoAway:{type:String,default:""},scoreHome:{type:[String,Number],default:""},scoreAway:{type:[String,Number],default:""},background:{type:String,default:""},typeImg:{type:Number,default:0},nameHomeTeam:{type:String,default:""},nameAwayTeam:{type:String,default:""},namePlayer:{type:String,default:""}},data(){return{gamesContainerSPWidth:0}},computed:{playbutton(){const s=this.gamesContainerSPWidth;return s<=400?"play-button400":s<=540?"play-button540":s<=650?"play-button650":"play-button"},firstline(){const s=this.gamesContainerSPWidth;return s<=400?"first-line400":s<=540?"first-line540":s<=650?"first-line650":"first-line"},secondline(){const s=this.gamesContainerSPWidth;return s<=400?"second-line400":s<=540?"second-line540":s<=650?"second-line650":"second-line"},playername(){const s=this.gamesContainerSPWidth;return s<=400?"player-name400":s<=540?"player-name540":s<=650?"player-name650":"player-name"},playerimage(){const s=this.gamesContainerSPWidth;return s<=400?"player-image400":s<=540?"player-image540":s<=650?"player-image650":"player-image"},thumbnailhighlights(){const s=this.gamesContainerSPWidth;return s<=400?"thumbnail-highlights400":s<=540?"thumbnail-highlights540":s<=650?"thumbnail-highlights650":"thumbnail-highlights"}},methods:{onclickPlayVideos(){this.$emit("onclickPlayVideos")},setUpResizeObserver(){if(window.ResizeObserver)Km=new ResizeObserver(()=>{this.gamesContainerSPWidth=this.$refs.gamesContainerSP?this.$refs.gamesContainerSP.clientWidth:0,this.movil=this.gamesContainerSPWidth<740}),Km.observe(this.$refs.gamesContainerSP);else throw new Error("Resize observer not supported!")}},mounted(){setTimeout(()=>{this.setUpResizeObserver()},100)}},qm=()=>{n.useCssVars(s=>({"17845cea":s.colorBackgroundHome+"30","3e8f3cad":s.colorBackgroundHome}))},Ym=jr.setup;jr.setup=Ym?(s,e)=>(qm(),Ym(s,e)):qm;const Mn=s=>(n.pushScopeId("data-v-df5486d2"),s=s(),n.popScopeId(),s),v3=Mn(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[n.createElementVNode("path",{d:"M6.6041 22.8554C6.42105 22.7512 6.26805 22.5956 6.1616 22.4053C6.05515 22.215 5.99927 21.9973 6.00001 21.7755V2.22137C6.00026 2.00039 6.0565 1.78362 6.16274 1.59409C6.26899 1.40456 6.42127 1.24936 6.6034 1.14499C6.78553 1.04062 6.9907 0.990981 7.1971 1.00135C7.4035 1.01171 7.60342 1.0817 7.77561 1.20386L21.4907 10.9821C21.6473 11.0935 21.7758 11.2446 21.8646 11.4219C21.9535 11.5992 22 11.7973 22 11.9985C22 12.1996 21.9535 12.3977 21.8646 12.575C21.7758 12.7523 21.6473 12.9034 21.4907 13.0148L7.77561 22.7954C7.60369 22.9178 7.40392 22.988 7.19761 22.9986C6.9913 23.0092 6.78617 22.9597 6.6041 22.8554ZM7.14347 21.7779L20.8585 11.9996L7.14347 21.7779Z",fill:"#CBEE6B"})],-1)),A3=[v3],L3={class:"player-image position-image"},I3=["src"],R3=["src"],B3=["src"],N3=["src"],D3=Mn(()=>n.createElementVNode("div",{class:"gradient-back position-image"},null,-1)),P3=["src"],O3=Mn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/paper-texture.png",alt:"",class:"paper-texture position-image"},null,-1)),F3={class:"text-container"},M3=Mn(()=>n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/halftone-texture.png",alt:"",class:"halftone-texture position-image"},null,-1)),$3={class:"base-logo",width:"91",height:"216",viewBox:"0 0 91 216",fill:"none",xmlns:"http://www.w3.org/2000/svg"},V3=["fill"];function U3(s,e,t,a,i,o){return n.openBlock(),n.createElementBlock("div",{ref:"gamesContainerSP",class:n.normalizeClass(o.thumbnailhighlights)},[t.showVideos?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(o.playbutton),onClick:e[0]||(e[0]=(...r)=>o.onclickPlayVideos&&o.onclickPlayVideos(...r))},A3,2)):n.createCommentVNode("",!0),n.createElementVNode("div",L3,[t.typeImg==0?(n.openBlock(),n.createElementBlock("img",{key:0,src:t.photoProfile,class:n.normalizeClass(o.playerimage)},null,10,I3)):n.createCommentVNode("",!0),t.typeImg==1?(n.openBlock(),n.createElementBlock("img",{key:1,src:t.photoProfile,alt:""},null,8,R3)):n.createCommentVNode("",!0),t.typeImg==2?(n.openBlock(),n.createElementBlock("img",{key:2,src:t.photoProfile,class:"img-number"},null,8,B3)):n.createCommentVNode("",!0)]),n.createElementVNode("img",{src:t.logoHome,alt:"",class:"team-logo"},null,8,N3),D3,n.createElementVNode("img",{src:t.background,alt:"",class:"bkg-blackwhite position-image"},null,8,P3),O3,n.createElementVNode("div",F3,[n.createElementVNode("span",{class:n.normalizeClass(o.firstline)},"MEJORES JUGADAS",2),n.createElementVNode("span",{class:n.normalizeClass(o.secondline)},n.toDisplayString(t.nameCategory),3),n.createElementVNode("div",{class:n.normalizeClass(o.playername),style:n.normalizeStyle({color:t.colorFont})},n.toDisplayString(t.namePlayer),7)]),M3,(n.openBlock(),n.createElementBlock("svg",$3,[n.createElementVNode("path",{d:"M91.5 216L0 -0.5H91.5V216Z",fill:t.colorBackgroundHome},null,8,V3)]))],2)}const z3=rs(jr,[["render",U3],["__scopeId","data-v-df5486d2"]]);function G3(s){const e=n.ref({width:0,height:0});function t(){const a=s.value.getBoundingClientRect();e.value.width=a.width,e.value.height=a.height}return n.onMounted(()=>{t(),window.addEventListener("resize",t)}),n.onUnmounted(()=>{window.removeEventListener("resize",t)}),{elementSize:e}}const j3="_ptg_1shb4_2",H3="_ptgtitle_1shb4_7",W3="_ptgtitle450_1shb4_23",K3="_pgtcontainercard_1shb4_39",q3="_pgtcontainercard350_1shb4_44",Y3={ptg:j3,ptgtitle:H3,ptgtitle450:W3,pgtcontainercard:K3,pgtcontainercard350:q3},Hr={components:{GSCSlider:KR,GSCThumbnailCategory:S4,GSCThumbnailCategoryTeam:D4,GSCThumbnailCategoryTeamAway:Y4,GSCThumbnailHighlightGamePlayer:x3,GSCThumbnailCategoryTeamAwayLive:d3,GSCThumbnailSummaryPlayer:z3,GSCThumbnailHighlightGameHistoric:n4},setup(){const s=n.ref("ptgDiv"),{elementSize:e}=G3(s);return{ptgDiv:s,elementSize:e}},props:{isWidget:{type:Boolean,default:!1},teamWidget:{type:Number,default:0},receiveData:{type:Boolean,default:!1},information:{type:Array,default:()=>[]},title:{type:String,default:"100% de sus participaciones en cada partido:"},type:{type:Number,default:0},showVideos:{type:Boolean,default:!0},viewType:{type:Number,default:2},local:{type:Boolean,default:!0},data:{type:Object,default:()=>{}},backgroundColor:{type:String,default:"#0D1D29"},backgroundFooter:{type:String,default:"#192733"},matchdayView:{type:Number,default:1},pxScroll:{type:Number,default:100},arrows:{type:Boolean,default:!0},arrowsScrollHide:{type:Boolean,default:!1},arrowsHideOnNoScroll:{type:Boolean,default:!1},arrowsColor:{type:String,default:"#CBEE6B"},arrowsHeight:{type:Number,default:15},arrowsWidth:{type:Number,default:15},arrowsPadding:{type:Number,default:5},arrowsMargin:{type:Number,default:10},arrowsRadius:{type:String,default:"0%"},arrowsBorder:{type:String,default:"none"},arrowsBackground:{type:String,default:"#0D1D29"},arrowsContainerBgL:{type:String,default:"#0D1D29"},arrowsContainerBgR:{type:String,default:"#0D1D29"},scrollColor:{type:String,default:"#c3e569"},arrowsPosition:{type:String,default:"relative"},height:{type:String,default:"100%"},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])},playVideosPrivileges:{type:Object,default:null},awaitForSpecificsPlaysBySeason:{type:Boolean,default:!1},awaitForBestPlaysBySeasonAndTeam:{type:Boolean,default:!1},awaitForBestPlaysBySeasonAndGame:{type:Boolean,default:!1},awaitForTeamsInfo:{type:Boolean,default:!1},specificsPlaysBySeasonResponse:{type:Object,default:null},bestPlaysBySeasonAndTeamResponse:{type:Object,default:null},bestPlaysBySeasonAndGameResponse:{type:Object,default:null},teamsInfoResponse:{type:Object,default:null}},data(){return{token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE",printData:[],teamsInfo:[],playerPhoto:!0,homeTeam:0,flagGames:[],lastseason:0,arrayMatchdays:[],awayTeam:0,goalCategories:[12,55,"35_r","54_r"],resumeCategories:[607,608,12,55,54,35,14,52,15,53,466,477],lastType:0,lastUrl:"",teamsInfoLastUrl:""}},watch:{data:{immediate:!0,handler(s){this.type!==14&&(this.receiveData||this.getTeamsInfo(s)),this.getStats(s)}},teamsInfoResponse(s){s&&(this.receiveData||this.getTeamsInfo(this.data))},bestPlaysBySeasonAndTeamResponse(s){s&&this.getStats(this.data)},bestPlaysBySeasonAndGameResponse(s){s&&this.getStats(this.data)},specificsPlaysBySeasonResponse(s){s&&this.getStats(this.data)}},computed:{ptgtitleClass(){return this.elementSize.width<=450?this.$style.ptgtitle450:this.$style.ptgtitle},pgtcontainercardClass(){return this.elementSize.width<=350?this.$style.pgtcontainercard350:this.$style.pgtcontainercard}},methods:{getBestPlaysUrl({season:s,player:e,team:t,game:a,category:i}){let o="https://wlduw4woy3.execute-api.us-east-2.amazonaws.com/prod/best-plays/seasons/";return s&&(o+=`${s}`),e&&(o+=`/players/${e}`),t&&(o+=`/teams/${t}`),a&&(o+=`/games/${a}`),i&&(o+=`/categories/${i}`),this.videoPrivilegesPlayingAs.has(1)&&!this.videoPrivilegesPlayingAs.has(2)?o+="?isLocal=1":this.videoPrivilegesPlayingAs.has(2)&&!this.videoPrivilegesPlayingAs.has(1)&&(o+="?isVisitor=1"),this.isWidget&&this.teamWidget!=0&&[3,4,5].includes(this.type)&&(o+=`?t=${this.teamWidget}`),o},getIsSameScenario(s,e){const t=this.lastType===s&&this.lastUrl===e;return t||(this.lastType=s,this.lastUrl=e),t},onclickPlayVideos(s){let e=[],t=s.data.game_id?[s.data.game_id]:null;s.type==2?s.data.position_id==1?s.data.category==0?e=s.isAllPlays?[14,52,15,53,300,301,308,309,310,311,304,305,306,307,260,261,312,265,266,267,268,313,314,43,324,323,478,479,480,481,474,475,476,477,40,26,325,16,51,462,463,151,154,156,591,592,159,162,163,429,165,593,594,168,171,172,430,174,595,596,177,180,181,431,467,358,361,363,366,369,370,469,372,376,378,379,470,381,385,387,388,471,607,608,262,263]:[42,55,324,323,608,39,774,802,52,53,40,54]:e=s.data.category:s.data.category==0?e=s.isAllPlays?[56,57,59,60,326,213,214,215,216,583,584,122,123,124,125,585,586,128,129,130,131,133,327,587,588,136,137,138,139,589,590,142,143,144,145,146,147,485,486,487,488,489,490,491,492,10,27,597,598,538,539,599,600,541,542,601,602,545,546,603,604,548,549,561,562,100,563,564,103,104,105,106,107,108,565,566,111,567,568,114,115,116,117,118,119,4,88,5,34,402,459,460,461,233,403,456,457,458,236,404,453,454,455,240,405,450,451,452,243,408,447,448,449,283,409,444,445,446,285,410,441,442,443,290,411,438,439,440,292,412,435,436,437,297,414,415,416,417,244,418,419,420,421,401,581,582,331,506,530,579,580,334,507,531,577,578,344,508,532,575,576,424,509,533,573,574,341,529,534,571,572,340,528,535,569,570,427,527,536,348,349,350,465,352,353,354,466,14,52,15,53,218,219,220,221,496,497,498,499,500,501,502,503,217,504,505,521,522,543,33,209,208,517,206,207,26,325,16,51,463,151,154,156,591,592,159,162,163,429,165,593,594,168,171,172,430,174,595,596,177,180,181,431,467,358,361,363,366,369,370,469,372,376,378,379,470,381,385,387,388,471,607,608,210,212]:[12,35,10,27,607,61,519,98,101,109,112,121,122,127,128,135,136,141,142,161,170,179,702,730,466,217,211,232,235,239,242,282,284,289,291,296,485,486,487,488,14,15,257]:e=s.data.category:s.type==3?s.data.category==0?e=[607,608,12,55,54,35,14,52,15,53,466,477,40,257,39]:e=s.data.category:s.data.category!=0?e=s.data.category:e=[607,608,12,55,54,35,14,52,15,53,466,477],this.data.isPrematch===1&&(t=null);const a=[1,2,3];let i={type:s.data.has_mxm?1:0,seasonId:s.data.season_id,mainSectionType:1,playListType:s.type,categoryIds:s.categories&&s.categories.length?s.categories:e,gameIds:t,playerIds:s.data.player_id?[s.data.player_id]:[],goalkeeperIds:s.data.position_id==1?s.data.player_id?[s.data.player_id]:[]:[],teamId:s.data.team_id?s.data.team_id:0,matchResult:s.data.matchResult?[s.matchResult]:a,playData:{},advancedFilter:{playListTitle:""}};s.data.category!==0&&(i.advancedFilter.mainCategoryId=s.data.category),this.$emit("openmedia",i)},onClickVideos(s){this.$emit("onClickVideos",s)},onClickCard(s){this.$emit("onClickCard",s)},async getTeamsInfo(s){if(this.awaitForTeamsInfo&&!this.teamsInfoResponse)return;const e="https://d2oco6mqmc.execute-api.us-west-2.amazonaws.com/prod/teamsBySeason/"+s.season;if(e===this.teamsInfoLastUrl)return;this.teamsInfoLastUrl=e;const t=xm.create({headers:{Authorization:`${this.token}`}}),a=this.awaitForTeamsInfo?this.teamsInfoResponse:await t.get(e);for(let i=0;i<a.data.teams.length;i++)this.teamsInfo[a.data.teams[i].team_id]=a.data.teams[i]},async getStats(s){if(!this.receiveData){const i=xm.create({headers:{Authorization:`${this.token}`}});var e=[],t={},a={};if(this.type===0){if(a=await i.get("https://uof4tt5l46.execute-api.us-west-2.amazonaws.com/prod/v3/playerInfo/"+s.season+"/"+s.player),this.videoPrivilegesPlayingAs)if(a.data.seasons[s.season]){const o=a.data.team_id;a.data.seasons[s.season].games_played=a.data.seasons[s.season].games_played.filter(r=>(r.playingAs=r.home_team===o?1:2,this.videoPrivilegesPlayingAs.has(r.playingAs)))}else{const o=a.data.team_id;a.data.national_seasons[s.season].games_played=a.data.national_seasons[s.season].games_played.filter(r=>(r.playingAs=r.home_team===o?1:2,this.videoPrivilegesPlayingAs.has(r.playingAs)))}if(a.data.seasons[s.season])for(let o=0;o<a.data.seasons[s.season].games_played.length;o++)t={player_id:s.player,color:a.data.info_thumbnails.colors.background_color,colorfont:a.data.info_thumbnails.colors.font_color,photo_profile:a.data.info_thumbnails.images.player_in_action[0]?"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.info_thumbnails.images.player_in_action[0]:"https://az755631.vo.msecnd.net/players-profile/"+s.player+".png",team_logo:"https://az755631.vo.msecnd.net/teams-150/"+a.data.seasons[s.season].games_played[o].home_team+".png",player_name:a.data.seasons[s.season].games_played[o].home_team_acronym+" "+a.data.seasons[s.season].games_played[o].home_team_score+" : "+a.data.seasons[s.season].games_played[o].visiting_team_score+" "+a.data.seasons[s.season].games_played[o].visiting_team_acronym,team_id_b:a.data.seasons[s.season].games_played[o].home_team,season_id:a.data.seasons[s.season].games_played[o].season_id,name:"",date:this.obtenerNombreCompletoFecha(a.data.seasons[s.season].games_played[o].date),category:0,team_id:a.data.team_id,game_id:a.data.seasons[s.season].games_played[o].game_id,has_mxm:a.data.seasons[s.season].games_played[o].has_mxm,position_id:a.data.position_id,scorehome:a.data.seasons[s.season].games_played[o].home_team_score,scoreaway:a.data.seasons[s.season].games_played[o].visiting_team_score,hometeamacronym:a.data.seasons[s.season].games_played[o].home_team_acronym,visitingteamacronym:a.data.seasons[s.season].games_played[o].visiting_team_acronym,seasonname:a.data.seasons[s.season].name,seasonname2:a.data.seasons[s.season].name.replace("Clausura","CL ").replace("Apertura","AP "),match:a.data.seasons[s.season].games_played[o].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),score:a.data.seasons[s.season].games_played[o].home_team_score+" : "+a.data.seasons[s.season].games_played[o].visiting_team_score,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.info_thumbnails.images.background_player_in_action[0],backgroundhome:a.data.seasons[s.season].games_played[o].info_thumbnails.home_colors.background_color,backgroundaway:a.data.seasons[s.season].games_played[o].info_thumbnails.away_colors.background_color,colorfont_home:a.data.seasons[s.season].games_played[o].info_thumbnails.home_colors.font_color,colorfont_away:a.data.seasons[s.season].games_played[o].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.seasons[s.season].games_played[o].home_team+".png",logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.seasons[s.season].games_played[o].visiting_team+".png",total:a.data.seasons[s.season].games_played[o].matchday_abbreviation.replace("M","Jor "),background_card:"https://az755631.vo.msecnd.net/golstats2-teams/"+a.data.seasons[s.season].games_played[o].home_team+"_"+a.data.seasons[s.season].games_played[o].season_id+"_r1.jpg"},e.push(t);else for(let o=0;o<a.data.national_seasons[s.season].games_played.length;o++)t={player_id:s.player,color:a.data.info_thumbnails.colors.background_color,colorfont:a.data.info_thumbnails.colors.font_color,photo_profile:a.data.info_thumbnails.images.player_in_action[0]?"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.info_thumbnails.images.player_in_action[0]:"https://az755631.vo.msecnd.net/players-profile/"+s.player+".png",team_logo:"https://az755631.vo.msecnd.net/teams-150/"+a.data.national_seasons[s.season].games_played[o].home_team+".png",player_name:a.data.national_seasons[s.season].games_played[o].home_team_acronym+" "+a.data.national_seasons[s.season].games_played[o].home_team_score+" : "+a.data.national_seasons[s.season].games_played[o].visiting_team_score+" "+a.data.national_seasons[s.season].games_played[o].visiting_team_acronym,team_id_b:a.data.national_seasons[s.season].games_played[o].home_team,season_id:a.data.national_seasons[s.season].games_played[o].season_id,name:"",date:this.obtenerNombreCompletoFecha(a.data.national_seasons[s.season].games_played[o].date),category:0,team_id:a.data.team_id,game_id:a.data.national_seasons[s.season].games_played[o].game_id,position_id:a.data.position_id,scorehome:a.data.national_seasons[s.season].games_played[o].home_team_score,scoreaway:a.data.national_seasons[s.season].games_played[o].visiting_team_score,hometeamacronym:a.data.national_seasons[s.season].games_played[o].home_team_acronym,visitingteamacronym:a.data.national_seasons[s.season].games_played[o].visiting_team_acronym,seasonname:a.data.national_seasons[s.season].name,seasonname2:a.data.national_seasons[s.season].name.replace("Clausura","CL ").replace("Apertura","AP "),match:a.data.national_seasons[s.season].games_played[o].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),score:a.data.national_seasons[s.season].games_played[o].home_team_score+" : "+a.data.national_seasons[s.season].games_played[o].visiting_team_score,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.info_thumbnails.images.background_player_in_action[0],backgroundhome:a.data.national_seasons[s.season].games_played[o].info_thumbnails.home_colors.background_color,backgroundaway:a.data.national_seasons[s.season].games_played[o].info_thumbnails.away_colors.background_color,colorfont_home:a.data.national_seasons[s.season].games_played[o].info_thumbnails.home_colors.font_color,colorfont_away:a.data.national_seasons[s.season].games_played[o].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.national_seasons[s.season].games_played[o].home_team+".png",logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.national_seasons[s.season].games_played[o].visiting_team+".png",total:a.data.national_seasons[s.season].games_played[o].matchday_abbreviation.replace("M","Jor "),background_card:"https://az755631.vo.msecnd.net/golstats2-teams/"+a.data.national_seasons[s.season].games_played[o].home_team+"_"+a.data.national_seasons[s.season].games_played[o].season_id+"_r1.jpg"},e.push(t)}if(this.type===1){if(this.awaitForBestPlaysBySeasonAndTeam&&!this.bestPlaysBySeasonAndTeamResponse)return;const o=this.getBestPlaysUrl({season:s.season,team:s.team});if(this.getIsSameScenario(1,o))return;a=this.awaitForBestPlaysBySeasonAndTeam?this.bestPlaysBySeasonAndTeamResponse:await i.get(o);for(let r=0;r<a.data.categories.length;r++){this.playerPhoto=!1;const l=Math.floor(Math.random()*a.data.categories[r].info_thumbnails.images.background_default_categories.length),d=Math.floor(Math.random()*a.data.categories[r].info_thumbnails.images.background_default_teams.length);t={player_action:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.categories[r].info_thumbnails.images.background_default_categories[l],background_action:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.categories[r].info_thumbnails.images.background_default_teams[d],color:a.data.categories[r].info_thumbnails.colors.background_color,team_logo:"https://az755631.vo.msecnd.net/teams-80/"+a.data.categories[r].info_thumbnails.team_logo,player_name:a.data.categories[r].category_name,team_name:this.teamsInfo[a.data.team_id].colloquial_name,team_id:a.data.team_id,colorfont:a.data.categories[r].info_thumbnails.colors.font_color,team_id_b:a.data.team_id,category:a.data.categories[r].categories,season_id:a.data.season_id,total:a.data.categories[r].total,background_card:"https://az755631.vo.msecnd.net/golstats2-teams/"+a.data.team_id+"_"+a.data.season_id+"_r1.jpg"},e.push(t)}}if(this.type===2){const o=this.getBestPlaysUrl({season:s.season,game:s.game});if(this.getIsSameScenario(2,o))return;a=await i.get(o);for(let r=0;r<a.data.categories.length;r++){this.playerPhoto=!1;const l=Math.floor(Math.random()*a.data.categories[r].info_thumbnails.images.player_in_action.length),d=Math.floor(Math.random()*a.data.categories[r].info_thumbnails.images.background_default_categories.length);t={player_action:a.data.categories[r].info_thumbnails.images.player_in_action[l]?"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.categories[r].info_thumbnails.images.player_in_action[l]:"https://az755631.vo.msecnd.net/players-profile/"+s.player+".png",background_action:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.categories[r].info_thumbnails.images.background_default_categories[d],color:a.data.categories[r].info_thumbnails.colors.background_color,team_logo:"https://az755631.vo.msecnd.net/teams-80/"+a.data.categories[r].info_thumbnails.team_logo,player_name:a.data.categories[r].category_name,season_id:s.season,colorfont:a.data.categories[r].info_thumbnails.colors.font_color,player_id:s.player,team_id:a.data.categories[r].info_thumbnails.colors.team_id,category:a.data.categories[r].categories,total:a.data.categories[r].total,background_card:"https://az755631.vo.msecnd.net/players-profile/"+s.player+".png"},e.push(t)}}if(this.type===3){if(this.playerPhoto=!1,this.awaitForBestPlaysBySeasonAndGame&&!this.bestPlaysBySeasonAndGameResponse)return;const o=this.getBestPlaysUrl({season:s.season,game:s.game});if(this.getIsSameScenario(3,o))return;a=this.awaitForBestPlaysBySeasonAndGame?this.bestPlaysBySeasonAndGameResponse:await i.get(o),this.playVideosPrivileges&&(this.playVideosPrivileges.canPrivilegesTeamPlayVideos?a.data.games[0].players=a.data.games[0].players.filter(r=>r.team_id==this.playVideosPrivileges.seasonAndPrivileges.teamId):a.data.games[0].players=[]);for(let r=0;r<a.data.games[0].players.length;r++){const l=Math.floor(Math.random()*a.data.games[0].players[r].info_thumbnails.images.background_player_in_action.length),d=Math.floor(Math.random()*a.data.games[0].players[r].info_thumbnails.images.player_in_action.length);t={colorbackgroundhome:a.data.games[0].players[r].info_thumbnails.colors.background_color,colorbackgroundaway:"",nameplayer:a.data.games[0].players[r].player_name,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.games[0].players[r].info_thumbnails.images.background_player_in_action[l],namecategory:"RESUMEN",namehometeam:"",nameawayteam:"",category:0,colorfont:a.data.games[0].players[r].info_thumbnails.colors.font_color,team_id:a.data.games[0].players[r].team_id,player_id:a.data.games[0].players[r].player_id,game_id:a.data.games[0].game_id,has_mxm:a.data.games[0].has_mxm,season_id:a.data.season_id,logohome:a.data.games[0].players[r].team_logo,photoprofile:a.data.games[0].players[r].info_thumbnails.images.player_in_action[d]?"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.games[0].players[r].info_thumbnails.images.player_in_action[d]:"https://az755631.vo.msecnd.net/players-profile/"+a.data.games[0].players[r].player_id+".png",logoaway:"",scoreaway:"",scorehome:""},e.push(t)}}if(this.type===4){if(this.awaitForSpecificsPlaysBySeason&&!this.specificsPlaysBySeasonResponse)return;this.playerPhoto=!1;const o="https://wlduw4woy3.execute-api.us-east-2.amazonaws.com/prod/specifics-plays/seasons/"+s.season+"/games/"+s.game;if(this.getIsSameScenario(4,o))return;a=this.awaitForSpecificsPlaysBySeason?this.specificsPlaysBySeasonResponse:await i.get(o);for(let r=0;r<a.data.home_team.categories.length;r++){const l=Math.floor(Math.random()*a.data.home_team.categories[r].info_thumbnails.images.background_default_teams.length);t={game_id:a.data.game_id,has_mxm:a.data.has_mxm,season_id:a.data.season_id,team_id:a.data.home_team.team_id,category:a.data.home_team.categories[r].categories.concat(a.data.home_team.categories[r].rival_categories),background_action:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.home_team.categories[r].info_thumbnails.images.background_default_categories[l],player_action:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.home_team.categories[r].info_thumbnails.images.background_default_categories[l],team_logo:"https://az755631.vo.msecnd.net/teams-150/"+a.data.home_team.team_id+".png",color:a.data.home_team.categories[r].info_thumbnails.colors.background_color,colorfont:a.data.home_team.categories[r].info_thumbnails.colors.font_color,player_name:a.data.home_team.categories[r].category_name,total:a.data.home_team.categories[r].total,team_name:"Local",background_card:"https://az755631.vo.msecnd.net/golstats2-teams/"+a.data.home_team.team_id+"_"+a.data.season_id+"_r1.jpg"},e.push(t)}}if(this.type===5){if(this.awaitForSpecificsPlaysBySeason&&!this.specificsPlaysBySeasonResponse)return;this.playerPhoto=!1;const o="https://wlduw4woy3.execute-api.us-east-2.amazonaws.com/prod/specifics-plays/seasons/"+s.season+"/games/"+s.game;if(this.getIsSameScenario(5,o))return;a=this.awaitForSpecificsPlaysBySeason?this.specificsPlaysBySeasonResponse:await i.get(o);for(let r=0;r<a.data.visiting_team.categories.length;r++){const l=Math.floor(Math.random()*a.data.visiting_team.categories[r].info_thumbnails.images.background_default_categories.length);t={game_id:a.data.game_id,has_mxm:a.data.has_mxm,season_id:a.data.season_id,team_id:a.data.visiting_team.team_id,category:a.data.visiting_team.categories[r].categories.concat(a.data.visiting_team.categories[r].rival_categories),background_action:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.visiting_team.categories[r].info_thumbnails.images.background_default_categories[l],player_action:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.visiting_team.categories[r].info_thumbnails.images.background_default_categories[l],team_logo:"https://az755631.vo.msecnd.net/teams-150/"+a.data.visiting_team.team_id+".png",team_name:"Away",color:a.data.visiting_team.categories[r].info_thumbnails.colors.background_color,colorfont:a.data.visiting_team.categories[r].info_thumbnails.colors.font_color,player_name:a.data.visiting_team.categories[r].category_name,total:a.data.visiting_team.categories[r].total,background_card:"https://az755631.vo.msecnd.net/golstats2-teams/"+a.data.visiting_team.team_id+"_"+a.data.season_id+"_r1.jpg"},e.push(t)}}if(this.type===6){const o=this.getBestPlaysUrl({season:s.season,team:s.team,category:s.category});if(this.getIsSameScenario(6,o))return;a=await i.get(o);for(let r=0;r<a.data.best_plays.length;r++)t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,has_mxm:a.data.best_plays[r].has_mxm,season_id:a.data.season_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:"",seasonname:"",score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)}if(this.type===7){const o=this.getBestPlaysUrl({season:s.season,team:s.team,category:s.category});if(this.getIsSameScenario(7,o))return;a=await i.get(o);for(let r=0;r<a.data.best_plays.length;r++)t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,has_mxm:a.data.best_plays[r].has_mxm,season_id:a.data.season_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:"",seasonname:"",score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)}if(this.type===8){const o=this.getBestPlaysUrl({season:s.season,player:s.player,category:s.category});if(this.getIsSameScenario(8,o))return;a=await i.get(o);for(let r=0;r<a.data.best_plays.length;r++)t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,has_mxm:a.data.best_plays[r].has_mxm,season_id:a.data.season_id,player_id:a.data.player_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:"",scorehome:a.data.best_plays[r].score[0],scoreaway:a.data.best_plays[r].score[1],photo_profile:"https://az755631.vo.msecnd.net/players-profile/"+a.data.best_plays[r].info_thumbnails.player_logo,hometeamacronym:a.data.best_plays[r].home_team_acronym,visitingteamacronym:a.data.best_plays[r].away_team_acronym,seasonname:"",score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)}if(this.type===9){const o=this.getBestPlaysUrl({season:s.season,player:s.player,category:s.category});if(this.getIsSameScenario(9,o))return;a=await i.get(o);for(let r=0;r<a.data.best_plays.length;r++)t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,player_id:a.data.player_id,game_id:a.data.best_plays[r].game_id,has_mxm:a.data.best_plays[r].has_mxm,season_id:a.data.season_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:"",scorehome:a.data.best_plays[r].score[0],scoreaway:a.data.best_plays[r].score[1],seasonname:"",photo_profile:"https://az755631.vo.msecnd.net/players-profile/"+a.data.best_plays[r].info_thumbnails.player_logo,score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)}if(this.type===10){const o="https://ws8d8ye2ii.execute-api.us-west-2.amazonaws.com/prod/v4/seasonsByTeam/"+s.team;if(this.getIsSameScenario(10,o))return;const r=await i.get(o);for(let l=0;l<r.data.seasons[s.season].games.length;l++){const d=Math.floor(Math.random()*r.data.seasons[s.season].games[l].info_thumbnails.images.background_default_games.length);t={photo_profile:"https://az755631.vo.msecnd.net/teams-150/"+r.data.seasons[s.season].games[l].visiting_team+".png",team_logo:"https://az755631.vo.msecnd.net/teams-150/"+r.data.seasons[s.season].games[l].home_team+".png",player_name:r.data.seasons[s.season].games[l].home_team_acronym+" "+r.data.seasons[s.season].games[l].home_team_score+" : "+r.data.seasons[s.season].games[l].visiting_team_score+" "+r.data.seasons[s.season].games[l].visiting_team_acronym,team_id:r.data.seasons[s.season].games[l].game_id,team_id_b:r.data.seasons[s.season].games[l].home_team,season_id:r.data.seasons[s.season].games[l].season_id,name:"",category:0,game_id:r.data.seasons[s.season].games[l].game_id,has_mxm:r.data.seasons[s.season].games[l].has_mxm,seasonname:r.data.seasons[s.season].name,match:r.data.seasons[s.season].games[l].matchday_name.replace("Matchday","Jor"),score:r.data.seasons[s.season].games[l].home_team_score+" : "+r.data.seasons[s.season].games[l].visiting_team_score,background:"https://golstatsimages.blob.core.windows.net/images-library/"+r.data.seasons[s.season].games[l].info_thumbnails.images.background_default_games[d],backgroundhome:r.data.seasons[s.season].games[l].info_thumbnails.home_colors.background_color,backgroundaway:r.data.seasons[s.season].games[l].info_thumbnails.away_colors.background_color,colorfont_home:r.data.best_plays[l].info_thumbnails.home_colors.font_color,colorfont_away:r.data.best_plays[l].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+r.data.seasons[s.season].games[l].home_team+".png",logoaway:"https://az755631.vo.msecnd.net/teams-150/"+r.data.seasons[s.season].games[l].visiting_team+".png",total:r.data.seasons[s.season].games[l].matchday_abbreviation.replace("M","Jor "),background_card:"https://az755631.vo.msecnd.net/golstats2-teams/"+r.data.seasons[s.season].games[l].home_team+"_"+r.data.seasons[s.season].games[l].season_id+"_r1.jpg"},e.push(t)}}if(this.type===11){const o="https://uof4tt5l46.execute-api.us-west-2.amazonaws.com/prod/v3/playerInfo/"+s.season+"/"+s.player;if(this.getIsSameScenario(11,o))return;const r=await i.get(o);for(let l=0;l<r.data.seasons[s.season].games_played.length;l++)t={has_mxm:r.data.seasons[s.season].games_played[l].has_mxm,category:0,player_id:s.player,team_id:r.data.team_id,game_id:r.data.seasons[s.season].games_played[l].game_id,position_id:r.data.position_id,color:r.data.info_thumbnails.colors.background_color,photo_profile:"https://golstatsimages.blob.core.windows.net/images-library/"+r.data.info_thumbnails.images.player_in_action[0],team_logo:"https://az755631.vo.msecnd.net/teams-150/"+r.data.seasons[s.season].games_played[l].home_team+".png",player_name:r.data.seasons[s.season].games_played[l].home_team_acronym+" "+r.data.seasons[s.season].games_played[l].home_team_score+" : "+r.data.seasons[s.season].games_played[l].visiting_team_score+" "+r.data.seasons[s.season].games_played[l].visiting_team_acronym,team_id_b:r.data.seasons[s.season].games_played[l].home_team,season_id:r.data.seasons[s.season].games_played[l].season_id,name:r.data.seasons[s.season].games_played[l].player_name,seasonname:r.data.seasons[s.season].name,match:r.data.seasons[s.season].games_played[l].matchday_name.replace("Matchday","Jor"),scorehome:r.data.seasons[s.season].games_played[l].home_team_score,scoreaway:r.data.seasons[s.season].games_played[l].visiting_team_score,hometeamacronym:r.data.seasons[s.season].games_played[l].home_team_acronym,visitingteamacronym:r.data.seasons[s.season].games_played[l].visiting_team_acronym,background:"https://golstatsimages.blob.core.windows.net/images-library/"+r.data.info_thumbnails.images.background_player_in_action[0],backgroundhome:r.data.seasons[s.season].games_played[l].info_thumbnails.home_colors.background_color,backgroundaway:r.data.seasons[s.season].games_played[l].info_thumbnails.away_colors.background_color,colorfont_home:r.data.seasons[s.season].games_played[l].info_thumbnails.home_colors.font_color,colorfont_away:r.data.seasons[s.season].games_played[l].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+r.data.seasons[s.season].games_played[l].home_team+".png",logoaway:"https://az755631.vo.msecnd.net/teams-150/"+r.data.seasons[s.season].games_played[l].visiting_team+".png",total:r.data.seasons[s.season].games_played[l].matchday_abbreviation.replace("M","Jor "),background_card:"https://az755631.vo.msecnd.net/golstats2-teams/"+r.data.seasons[s.season].games_played[l].home_team+"_"+r.data.seasons[s.season].games_played[l].season_id+"_r1.jpg"},e.push(t)}if(this.type===12){const o=this.getBestPlaysUrl({season:s.season,category:s.category});if(this.getIsSameScenario(12,o))return;const r=await i.get(o);for(let l=0;l<r.data.length;l++)for(let d=0;d<r.data[l].best_plays.length;d++)t={has_mxm:r.data[l].best_plays[d].has_mxm,category:r.data[l].best_plays[d].categories,game_id:r.data[l].best_plays[d].game_id,season_id:r.data[l].season_id,backgroundhome:r.data[l].best_plays[d].info_thumbnails.home_colors.background_color,backgroundaway:r.data[l].best_plays[d].info_thumbnails.away_colors.background_color,colorfont_home:r.data[l].best_plays[d].info_thumbnails.home_colors.font_color,colorfont_away:r.data[l].best_plays[d].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+r.data[l].best_plays[d].info_thumbnails.images.background_default_categories[0],match:"",scorehome:r.data[l].best_plays[d].score[0],scoreaway:r.data[l].best_plays[d].score[1],seasonname:"",photo_profile:"https://az755631.vo.msecnd.net/players-profile/"+r.data[l].best_plays[d].info_thumbnails.player_logo,score:r.data[l].best_plays[d].score[0]+" : "+r.data[l].best_plays[d].score[1]},e.push(t)}if(this.type===13){const o=this.getBestPlaysUrl({season:s.season,category:s.category});if(this.getIsSameScenario(13,o))return;const r=await i.get(o);for(let l=0;l<r.data.length;l++)for(let d=0;d<r.data[l].best_plays.length;d++)t={has_mxm:r.data[l].best_plays[d].has_mxm,category:r.data[l].best_plays[d].categories,game_id:r.data[l].best_plays[d].game_id,season_id:r.data[l].season_id,backgroundhome:r.data[l].best_plays[d].info_thumbnails.home_colors.background_color,backgroundaway:r.data[l].best_plays[d].info_thumbnails.away_colors.background_color,colorfont_home:r.data[l].best_plays[d].info_thumbnails.home_colors.font_color,colorfont_away:r.data[l].best_plays[d].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+r.data[l].best_plays[d].info_thumbnails.images.background_default_categories[0],match:"",scorehome:r.data[l].best_plays[d].score[0],scoreaway:r.data[l].best_plays[d].score[1],seasonname:"",photo_profile:"https://az755631.vo.msecnd.net/players-profile/"+r.data[l].best_plays[d].info_thumbnails.player_logo,score:r.data[l].best_plays[d].score[0]+" : "+r.data[l].best_plays[d].score[1]},e.push(t)}if(this.type===14&&(e=[],s.season)){if(this.lastseason!==s.season){const o=this.getBestPlaysUrl({season:s.season,category:s.category});if(this.getIsSameScenario(14,o))return;const r=await i.get(o);this.flagGames=[],this.arrayMatchdays=[];for(let l=0;l<r.data.length;l++)for(let d=0;d<r.data[l].best_plays.length;d++)r.data[l].best_plays[d].score[0]==0&&r.data[l].best_plays[d].score[1]==0||(t={has_mxm:r.data[l].best_plays[d].has_mxm,category:r.data[l].best_plays[d].categories,game_id:r.data[l].best_plays[d].game_id,plays_status:r.data[l].best_plays[d].plays_status,season_id:r.data[l].season_id,backgroundhome:r.data[l].best_plays[d].info_thumbnails.home_colors.background_color,backgroundaway:r.data[l].best_plays[d].info_thumbnails.away_colors.background_color,colorfont_home:r.data[l].best_plays[d].info_thumbnails.home_colors.font_color,date_time:new Date(r.data[l].best_plays[d].date_time_utc).valueOf(),colorfont_away:r.data[l].best_plays[d].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+r.data[l].best_plays[d].info_thumbnails.images.background_default_categories[0],match:"",scorehome:r.data[l].best_plays[d].score[0],scoreaway:r.data[l].best_plays[d].score[1],seasonname:"",photo_profile:"https://az755631.vo.msecnd.net/players-profile/"+r.data[l].best_plays[d].info_thumbnails.player_logo,score:r.data[l].best_plays[d].score[0]+" : "+r.data[l].best_plays[d].score[1],matchday_id:r.data[l].best_plays[d].matchday_id},this.arrayMatchdays[r.data[l].best_plays[d].matchday_id]?this.flagGames.includes(t.game_id)||(this.arrayMatchdays[r.data[l].best_plays[d].matchday_id].push(t),this.flagGames.push(t.game_id)):(this.arrayMatchdays[r.data[l].best_plays[d].matchday_id]=[],this.flagGames.includes(t.game_id)||(this.arrayMatchdays[r.data[l].best_plays[d].matchday_id].push(t),this.flagGames.push(t.game_id))));e=this.arrayMatchdays[this.matchdayView]?this.arrayMatchdays[this.matchdayView].sort((l,d)=>d.date_time-l.date_time):[]}else e=this.arrayMatchdays[this.matchdayView]?this.arrayMatchdays[this.matchdayView].sort((o,r)=>r.date_time-o.date_time):[];this.lastseason=s.season}if(this.type===15&&(e=[],s.season)){if(this.lastseason!==s.season){const o=this.getBestPlaysUrl({season:s.season,category:s.category});if(this.getIsSameScenario(15,o))return;const r=await i.get(o);this.flagGames=[],this.arrayMatchdays=[];for(let l=0;l<r.data.length;l++)for(let d=0;d<r.data[l].best_plays.length;d++)r.data[l].best_plays[d].score[0]==0&&r.data[l].best_plays[d].score[1]==0||r.data[l].best_plays[d].home_team!=s.team&&r.data[l].best_plays[d].visiting_team!=s.team||(t={has_mxm:r.data[l].best_plays[d].has_mxm,category:r.data[l].best_plays[d].categories,game_id:r.data[l].best_plays[d].game_id,plays_status:r.data[l].best_plays[d].plays_status,season_id:r.data[l].season_id,backgroundhome:r.data[l].best_plays[d].info_thumbnails.home_colors.background_color,backgroundaway:r.data[l].best_plays[d].info_thumbnails.away_colors.background_color,colorfont_home:r.data[l].best_plays[d].info_thumbnails.home_colors.font_color,date_time:new Date(r.data[l].best_plays[d].date_time_utc).valueOf(),colorfont_away:r.data[l].best_plays[d].info_thumbnails.away_colors.font_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+r.data[l].best_plays[d].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+r.data[l].best_plays[d].info_thumbnails.images.background_default_categories[0],match:"",scorehome:r.data[l].best_plays[d].score[0],scoreaway:r.data[l].best_plays[d].score[1],seasonname:"",photo_profile:"https://az755631.vo.msecnd.net/players-profile/"+r.data[l].best_plays[d].info_thumbnails.player_logo,score:r.data[l].best_plays[d].score[0]+" : "+r.data[l].best_plays[d].score[1],matchday_id:r.data[l].best_plays[d].matchday_id},this.arrayMatchdays[r.data[l].best_plays[d].matchday_id]?this.flagGames.includes(t.game_id)||(this.arrayMatchdays[r.data[l].best_plays[d].matchday_id].push(t),this.flagGames.push(t.game_id)):(this.arrayMatchdays[r.data[l].best_plays[d].matchday_id]=[],this.flagGames.includes(t.game_id)||(this.arrayMatchdays[r.data[l].best_plays[d].matchday_id].push(t),this.flagGames.push(t.game_id))));e=this.arrayMatchdays[this.matchdayView]?this.arrayMatchdays[this.matchdayView].sort((l,d)=>d.date_time-l.date_time):[]}else e=this.arrayMatchdays[this.matchdayView]?this.arrayMatchdays[this.matchdayView].sort((o,r)=>r.date_time-o.date_time):[];this.lastseason=s.season}if(this.type===16){const o=this.getBestPlaysUrl({season:s.season,team:s.team,category:s.category});if(this.getIsSameScenario(16,o))return;a=await i.get(o);for(let r=0;r<a.data.best_plays.length;r++)this.viewType==2&&a.data.best_plays[r].home_team==s.team&&(t={has_mxm:a.data.best_plays[r].has_mxm,category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,season_id:a.data.season_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:a.data.best_plays[r].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),seasonname:a.data.best_plays[r].season_name.replace("Clausura","CL ").replace("Apertura","AP "),score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)),this.viewType==1&&(t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,season_id:a.data.season_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:a.data.best_plays[r].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),seasonname:a.data.best_plays[r].season_name.replace("Clausura","CL ").replace("Apertura","AP "),score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)),this.viewType==3&&a.data.best_plays[r].visiting_team==s.team&&(t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,season_id:a.data.season_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:a.data.best_plays[r].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),seasonname:a.data.best_plays[r].season_name.replace("Clausura","CL ").replace("Apertura","AP "),score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t))}if(this.type===17){const o=this.getBestPlaysUrl({season:s.season,team:s.team,category:s.category});if(this.getIsSameScenario(17,o))return;a=await i.get(o);for(let r=0;r<a.data.best_plays.length;r++)this.viewType==2&&a.data.best_plays[r].home_team==s.team&&(t={has_mxm:a.data.best_plays[r].has_mxm,category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,season_id:a.data.season_id,backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,scorehome:a.data.best_plays[r].score[0],scoreaway:a.data.best_plays[r].score[1],backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:a.data.best_plays[r].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),seasonname:a.data.best_plays[r].season_name.replace("Clausura","CL ").replace("Apertura","AP "),score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)),this.viewType==1&&(t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,season_id:a.data.season_id,scorehome:a.data.best_plays[r].score[0],scoreaway:a.data.best_plays[r].score[1],backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:a.data.best_plays[r].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),seasonname:a.data.best_plays[r].season_name.replace("Clausura","CL ").replace("Apertura","AP "),score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t)),this.viewType==3&&a.data.best_plays[r].visiting_team==s.team&&(t={category:a.data.best_plays[r].categories,team_id:a.data.team_id,game_id:a.data.best_plays[r].game_id,season_id:a.data.season_id,scorehome:a.data.best_plays[r].score[0],scoreaway:a.data.best_plays[r].score[1],backgroundhome:a.data.best_plays[r].info_thumbnails.home_colors.background_color,colorfont_home:a.data.best_plays[r].info_thumbnails.home_colors.font_color,colorfont_away:a.data.best_plays[r].info_thumbnails.away_colors.font_color,backgroundaway:a.data.best_plays[r].info_thumbnails.away_colors.background_color,logohome:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.home_team_logo,logoaway:"https://az755631.vo.msecnd.net/teams-150/"+a.data.best_plays[r].info_thumbnails.away_team_logo,background:"https://golstatsimages.blob.core.windows.net/images-library/"+a.data.best_plays[r].info_thumbnails.images.background_default_categories[0],match:a.data.best_plays[r].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"),seasonname:a.data.best_plays[r].season_name.replace("Clausura","CL ").replace("Apertura","AP "),score:a.data.best_plays[r].score[0]+" : "+a.data.best_plays[r].score[1]},e.push(t))}this.printData=e}},obtenerNombreCompletoFecha(s){if(s){const e=new Date(s),t=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"][e.getUTCDay()],a=e.getUTCDate(),i=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"][e.getUTCMonth()];return`${t} ${a} de ${i}`}else return""}},async created(){}},Jm=()=>{n.useCssVars(s=>({"4f699db7":s.backgroundColor}))},Xm=Hr.setup;Hr.setup=Xm?(s,e)=>(Jm(),Xm(s,e)):Jm;function J3(s,e,t,a,i,o){const r=n.resolveComponent("GSCThumbnailSummaryPlayer"),l=n.resolveComponent("GSCThumbnailCategoryTeam"),d=n.resolveComponent("GSCThumbnailCategoryTeamAwayLive"),c=n.resolveComponent("GSCSlider"),h=n.resolveComponent("GSCThumbnailCategory"),u=n.resolveComponent("GSCThumbnailCategoryTeamAway"),f=n.resolveComponent("GSCThumbnailHighlightGamePlayer"),p=n.resolveComponent("GSCThumbnailHighlightGameHistoric");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(s.$style.ptg),ref:"ptgDiv"},[n.createElementVNode("div",{class:n.normalizeClass(o.ptgtitleClass)},n.toDisplayString(t.title),3),t.receiveData?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[t.information.length>0?(n.openBlock(),n.createBlock(c,{key:0,backgroundColor:t.backgroundColor,pxScroll:t.pxScroll,arrows:t.arrows,arrowsScrollHide:t.arrowsScrollHide,arrowsHideOnNoScroll:t.arrowsHideOnNoScroll,arrowsColor:t.arrowsColor,arrowsHeight:t.arrowsWidth,arrowsWidth:t.arrowsWidth,arrowsPadding:t.arrowsPadding,arrowsMargin:t.arrowsMargin,arrowsRadius:t.arrowsRadius,arrowsBorder:t.arrowsBorder,arrowsBackground:t.arrowsBackground,arrowsContainerBgL:t.arrowsContainerBgL,arrowsContainerBgR:t.arrowsContainerBgR,scrollColor:t.scrollColor,arrowsPosition:t.arrowsPosition,height:t.height},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.information,(m,g)=>(n.openBlock(),n.createElementBlock("div",{key:g,class:n.normalizeClass(o.pgtcontainercardClass),style:n.normalizeStyle(g==0?"margin-left: 0px !important; color: white;":"")},[t.type==3e3?(n.openBlock(),n.createBlock(r,{key:0,type:"player","color-background-home":m.colorbackgroundhome,"color-background-away":m.colorbackgroundaway,"name-player":m.nameplayer,"type-img":0,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:2}),background:m.background,"name-home-team":m.namehometeam,"name-away-team":m.nameawayteam,"name-category":"RESUMEN","logo-away":m.logoaway,"logo-home":m.logohome,"color-font":m.colorfont,"score-home":m.scorehome,"photo-profile":m.photoprofile,"score-away":m.logoaway,"type-style":"summary"},null,8,["color-background-home","color-background-away","name-player","onOnclickPlayVideos","background","name-home-team","name-away-team","logo-away","logo-home","color-font","score-home","photo-profile","score-away"])):n.createCommentVNode("",!0),t.type==4e3?(n.openBlock(),n.createBlock(l,{key:1,type:"team","show-videos":t.showVideos,"name-team":m.team_name!=null?m.team_name:"","type-style":"category","color-background-home":m.color,"logo-home":m.team_logo,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:3}),background:m.player_action,"name-category":m.player_name},null,8,["show-videos","name-team","color-background-home","logo-home","onOnclickPlayVideos","background","name-category"])):n.createCommentVNode("",!0),t.type==5e3?(n.openBlock(),n.createBlock(d,{key:2,type:"team","name-team":m.team_name!=null?m.team_name:"","type-style":"category","color-background-away":m.color,"logo-home":m.team_logo,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:3}),background:m.player_action,"name-category":m.player_name},null,8,["name-team","color-background-away","logo-home","onOnclickPlayVideos","background","name-category"])):n.createCommentVNode("",!0)],6))),128))]),_:1},8,["backgroundColor","pxScroll","arrows","arrowsScrollHide","arrowsHideOnNoScroll","arrowsColor","arrowsHeight","arrowsWidth","arrowsPadding","arrowsMargin","arrowsRadius","arrowsBorder","arrowsBackground","arrowsContainerBgL","arrowsContainerBgR","scrollColor","arrowsPosition","height"])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[i.printData.length>0?(n.openBlock(),n.createBlock(c,{key:0,backgroundColor:t.backgroundColor,pxScroll:t.pxScroll,arrows:t.arrows,arrowsScrollHide:t.arrowsScrollHide,arrowsHideOnNoScroll:t.arrowsHideOnNoScroll,arrowsColor:t.arrowsColor,arrowsHeight:t.arrowsWidth,arrowsWidth:t.arrowsWidth,arrowsPadding:t.arrowsPadding,arrowsMargin:t.arrowsMargin,arrowsRadius:t.arrowsRadius,arrowsBorder:t.arrowsBorder,arrowsBackground:t.arrowsBackground,arrowsContainerBgL:t.arrowsContainerBgL,arrowsContainerBgR:t.arrowsContainerBgR,scrollColor:t.scrollColor,arrowsPosition:t.arrowsPosition,height:t.height},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.printData,(m,g)=>(n.openBlock(),n.createElementBlock("div",{key:g,class:n.normalizeClass(o.pgtcontainercardClass),style:n.normalizeStyle(g==0?"margin-left: 0px !important; color: white;":"")},[t.type==2?(n.openBlock(),n.createBlock(h,{key:0,"color-background-home":m.color,"name-player":t.data.player_name,"type-img":"0",background:m.background_action,"name-category":m.player_name,"logo-home":m.team_logo,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:2}),"photo-profile":m.player_action},null,8,["color-background-home","name-player","background","name-category","logo-home","onOnclickPlayVideos","photo-profile"])):t.type==1?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[m.total>0?(n.openBlock(),n.createBlock(l,{key:0,type:"team","show-videos":t.showVideos,"name-team":m.team_name!=null?m.team_name:"","type-style":"category","color-background-home":m.color,"logo-home":m.team_logo,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:3}),background:m.player_action,"name-category":m.player_name},null,8,["show-videos","name-team","color-background-home","logo-home","onOnclickPlayVideos","background","name-category"])):n.createCommentVNode("",!0)],64)):t.type==4?(n.openBlock(),n.createBlock(l,{key:2,type:"team","show-videos":t.showVideos,"name-team":m.team_name!=null?m.team_name:"","type-style":"category","color-background-home":m.color,"logo-home":m.team_logo,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:3}),background:m.player_action,"name-category":m.player_name},null,8,["show-videos","name-team","color-background-home","logo-home","onOnclickPlayVideos","background","name-category"])):t.type==5?(n.openBlock(),n.createBlock(u,{key:3,type:"team","name-team":m.team_name!=null?m.team_name:"","type-style":"category","color-background-away":m.color,"logo-home":m.team_logo,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:3}),background:m.player_action,"name-category":m.player_name},null,8,["name-team","color-background-away","logo-home","onOnclickPlayVideos","background","name-category"])):t.type==0?(n.openBlock(),n.createBlock(f,{key:4,items:m,type:2,"name-category":"TODAS SUS JUGADAS","color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"color-font-home":m.colorfont_home,"color-font-away":m.colorfont_away,"logo-home":m.logohome,"logo-away":m.logoaway,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:2,isAllPlays:!0}),background:m.background,date:m.date,"name-home-team":m.hometeamacronym,"name-away-team":m.visitingteamacronym,matchday:m.match,"score-home":m.scorehome,"photo-profile":m.photo_profile,"score-away":m.scoreaway,"season-name":m.seasonname2},null,8,["items","color-background-home","color-background-away","color-font-home","color-font-away","logo-home","logo-away","onOnclickPlayVideos","background","date","name-home-team","name-away-team","matchday","score-home","photo-profile","score-away","season-name"])):t.type==6?(n.openBlock(),n.createBlock(p,{key:5,items:m,"color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,background:m.background,"title-category":"GOLES","show-videos":t.showVideos,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:3,categories:i.goalCategories}),matchday:m.match,"season-name":m.seasonname,score:m.score},null,8,["items","color-background-home","color-background-away","logo-home","logo-away","background","show-videos","onOnclickPlayVideos","matchday","season-name","score"])):t.type==7||t.type==16?(n.openBlock(),n.createBlock(p,{key:6,items:m,"color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,background:m.background,"show-videos":t.showVideos,"title-category":"RESUMEN",onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:3,categories:i.resumeCategories}),matchday:m.match,"season-name":m.seasonname,score:m.score},null,8,["items","color-background-home","color-background-away","logo-home","logo-away","background","show-videos","onOnclickPlayVideos","matchday","season-name","score"])):t.type==8?(n.openBlock(),n.createBlock(f,{key:7,items:m,type:2,"name-category":"RESUMEN","color-font-home":m.colorfont_home,"color-font-away":m.colorfont_away,"color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:2}),background:m.background,"name-home-team":m.hometeamacronym,"name-away-team":m.visitingteamacronym,matchday:m.match,"score-home":m.scorehome,"photo-profile":m.photo_profile,"score-away":m.scoreaway,"season-name":m.seasonname},null,8,["items","color-font-home","color-font-away","color-background-home","color-background-away","logo-home","logo-away","onOnclickPlayVideos","background","name-home-team","name-away-team","matchday","score-home","photo-profile","score-away","season-name"])):t.type==9?(n.openBlock(),n.createBlock(f,{key:8,items:m,type:2,"name-category":"RESUMEN","color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:2}),"logo-away":m.logoaway,background:m.background,"name-home-team":m.hometeamacronym,"name-away-team":m.visitingteamacronym,matchday:m.match,"score-home":m.scorehome,"photo-profile":m.photo_profile,"score-away":m.scoreaway,"season-name":m.seasonname},null,8,["items","color-background-home","color-background-away","logo-home","onOnclickPlayVideos","logo-away","background","name-home-team","name-away-team","matchday","score-home","photo-profile","score-away","season-name"])):t.type==10?(n.openBlock(),n.createBlock(p,{key:9,items:m,"color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:1}),background:m.background,"title-category":"RESUMEN",matchday:m.match,"season-name":m.seasonname,score:m.score},null,8,["items","color-background-home","color-background-away","logo-home","logo-away","onOnclickPlayVideos","background","matchday","season-name","score"])):t.type==11?(n.openBlock(),n.createBlock(f,{key:10,items:m,type:2,"name-category":"RESUMEN","color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,background:m.background,"name-home-team":m.hometeamacronym,"name-away-team":m.visitingteamacronym,matchday:m.match,"color-font-home":m.colorfont_home,"color-font-away":m.colorfont_away,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:2}),"score-home":m.scorehome,"photo-profile":m.photo_profile,"score-away":m.scoreaway,"season-name":m.seasonname},null,8,["items","color-background-home","color-background-away","logo-home","logo-away","background","name-home-team","name-away-team","matchday","color-font-home","color-font-away","onOnclickPlayVideos","score-home","photo-profile","score-away","season-name"])):t.type==12?(n.openBlock(),n.createBlock(f,{key:11,items:m,type:2,"name-category":"RESUMEN","color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,"color-font-home":m.colorfont_home,"color-font-away":m.colorfont_away,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:1}),background:m.background,"name-home-team":m.hometeamacronym,"name-away-team":m.visitingteamacronym,matchday:m.match,"score-home":m.scorehome,"photo-profile":m.photo_profile,"score-away":m.scoreaway,"season-name":m.seasonname},null,8,["items","color-background-home","color-background-away","logo-home","logo-away","color-font-home","color-font-away","onOnclickPlayVideos","background","name-home-team","name-away-team","matchday","score-home","photo-profile","score-away","season-name"])):t.type==13?(n.openBlock(),n.createBlock(f,{key:12,items:m,type:2,"name-category":"GOLES","color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:1,categories:i.goalCategories}),background:m.background,"name-home-team":m.hometeamacronym,"name-away-team":m.visitingteamacronym,matchday:m.match,"score-home":m.scorehome,"photo-profile":m.photo_profile,"score-away":m.scoreaway,"season-name":m.seasonname},null,8,["items","color-background-home","color-background-away","logo-home","logo-away","onOnclickPlayVideos","background","name-home-team","name-away-team","matchday","score-home","photo-profile","score-away","season-name"])):t.type==14||t.type==15||t.type==17?(n.openBlock(),n.createBlock(f,{key:13,items:m,type:2,"show-videos":t.showVideos,"play-status":m.plays_status?m.plays_status:0,"name-category":"GOLES","color-background-home":m.backgroundhome,"color-background-away":m.backgroundaway,"logo-home":m.logohome,"logo-away":m.logoaway,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:1,categories:i.goalCategories}),background:m.background,"name-home-team":m.hometeamacronym,"name-away-team":m.visitingteamacronym,matchday:m.match,"score-home":m.scorehome,showimg:!1,"photo-profile":m.photo_profile,"score-away":m.scoreaway,"season-name":m.seasonname},null,8,["items","show-videos","play-status","color-background-home","color-background-away","logo-home","logo-away","onOnclickPlayVideos","background","name-home-team","name-away-team","matchday","score-home","photo-profile","score-away","season-name"])):(n.openBlock(),n.createBlock(r,{key:14,type:"player","color-background-home":m.colorbackgroundhome,"color-background-away":m.colorbackgroundaway,"name-player":m.nameplayer,"type-img":0,onOnclickPlayVideos:y=>o.onclickPlayVideos({data:m,type:2}),background:m.background,"name-home-team":m.namehometeam,"name-away-team":m.nameawayteam,"name-category":"RESUMEN","logo-away":m.logoaway,"logo-home":m.logohome,"color-font":m.colorfont,"score-home":m.scorehome,"photo-profile":m.photoprofile,"score-away":m.logoaway,"type-style":"summary"},null,8,["color-background-home","color-background-away","name-player","onOnclickPlayVideos","background","name-home-team","name-away-team","logo-away","logo-home","color-font","score-home","photo-profile","score-away"]))],6))),128))]),_:1},8,["backgroundColor","pxScroll","arrows","arrowsScrollHide","arrowsHideOnNoScroll","arrowsColor","arrowsHeight","arrowsWidth","arrowsPadding","arrowsMargin","arrowsRadius","arrowsBorder","arrowsBackground","arrowsContainerBgL","arrowsContainerBgR","scrollColor","arrowsPosition","height"])):n.createCommentVNode("",!0)],64))],2)}const X3={name:"DiscoverVideos",components:{GscSwitchComponent:go,GSCPlayerTeamGame:rs(Hr,[["render",J3],["__cssModules",{$style:Y3}],["__scopeId","data-v-762f089f"]]),MatchDayPicker:Gh},props:{componentWidth:{type:Number,default:768},myTournament:{type:Number,default:1},videoType:{type:Number,default:1},isplayer:{type:Boolean,default:!1},team:{type:Number,default:0},player:{type:Number,default:0},user:{type:Object,default:()=>{}},nextRivalTeam:{type:Object,default:()=>{}},tournamentSelected:{type:Object,default:()=>({id:0})},defaultMatchDayKey:{type:String,default:""},isLeagueSelected:{type:Boolean,default:!1},isFull:{type:Boolean,default:!1},tournamentScheduleKeys:{type:Array,default:()=>[]},seasonSelected:{type:Object,default:()=>{}},defaultMediaPlayerSeason:{type:Number,default:0}},watch:{seasonSelected:{immediate:!0,deep:!1,async handler(){this.getDataGoals()}},tournamentSelected:{immediate:!0,deep:!1,async handler(s){this.myTournament!==s.id?this.currentTabMoreVideos="Goles":this.currentTabMoreVideos="Goles"}},closestRound(s){this.selectedRoundKeyIndex=this.tournamentScheduleKeys.findIndex(e=>e===s),this.selectedRound=s},activeDropGoals:{handler(s){s&&(this.matchDayPickerKey+=1)},immediate:!0}},data(){return{token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE",url:"https://wlduw4woy3.execute-api.us-east-2.amazonaws.com/prod/best-plays/seasons/",showVideos:!0,currentTabMoreVideos:"Resumen",currentMobileTab:"Descubre videos",mobileClass:!1,activeDropGoals:!1,matchdayActive:{},resumeCategory:1000001,goalsCategory:1255e3,resumeType:1,goalsType:2,matchDayPickerKey:0}},mounted(){this.mobileClass=window.innerWidth<768,window.addEventListener("resize",this.handleResize)},methods:{async getDataGoals(){try{this.seasonSelected&&this.seasonSelected.id&&(await ve.create({headers:{Authorization:`${this.token}`}}).get(this.url+this.seasonSelected.id+"/categories/"+this.goalsCategory),this.showVideos=!0)}catch{this.showVideos=!1}},onChangeMatchDay(s){this.matchdayActive=s,this.$emit("change-match-day",s)},handleResize(){this.mobileClass=window.innerWidth<768},onOpenMedia(s,e){e&&(s.type=0),this.$emit("openmedia",s)},onClickOpenMedia(){let t=1,a=[],i=[],o=0,r=this.defaultMediaPlayerSeason||this.user.season,l=[],d=[12,55,"35_r","54_r"],c=[12,35,10,27,607,61,519,98,101,109,112,121,122,127,128,135,136,141,142,161,170,179,702,730,466,217,211,232,235,239,242,282,284,289,291,296,485,486,487,488,14,15,257],h=[55,324,323,608,39,774,802,52,53,40,54];!this.user.is_generic&&this.tournamentSelected.id===this.user.tournament?(r=this.seasonSelected.id,this.user.is_goalkeeper?(a=[this.user.player],l=h,t=2):this.user.is_player?(i=[this.user.player],l=c,t=2):(o=this.user.team,l=d,t=3)):(l=d,t=1);const u={type:0,seasonId:r,tournaments:[],isFeaturedPlayers:!1,mainSectionType:1,playListType:t,gameIds:null,playerIds:i,goalkeeperIds:a,categoryIds:l,teamId:o,matchResult:[1,2,3],categorySingleName:"",avoidCategorySingleName:!1,currentPlayIndex:0,playData:null,lastClashedGameId:null,tournamentsLastClashes:null,advancedFilter:{playListTitle:""},objectPlaySync:null};this.$emit("openmedia",u)}}},Z3={key:0,class:"discover-videos",ref:"discoverVideosRef"},Q3={class:"title-and-button"},e6={class:"calendar-container"};function t6(s,e,t,a,i,o){const r=n.resolveComponent("GscSwitchComponent"),l=n.resolveComponent("MatchDayPicker"),d=n.resolveComponent("GSCPlayerTeamGame");return i.showVideos?(n.openBlock(),n.createElementBlock("div",Z3,[n.createElementVNode("div",Q3,[n.createElementVNode("div",{class:n.normalizeClass(t.componentWidth>900?"menu-container":"menu-container-movil")},[n.createElementVNode("div",{class:n.normalizeClass(t.componentWidth>768?"title-value":t.componentWidth>600?"title-value-tablet":t.componentWidth>400?"title-value-mobile":"title-value-mobilesm")}," Videos ",2)],2),!t.user.is_generic&&t.myTournament===t.tournamentSelected.id?(n.openBlock(),n.createBlock(r,{key:0,buttons:["Goles","Resumen","Proximo rival"],onInput:e[0]||(e[0]=c=>i.currentTabMoreVideos=c),background:"trasparent",height:"24px",width:t.componentWidth>768?"140px":t.componentWidth>600?"120px":t.componentWidth>400?"100px":"81px","font-size":t.componentWidth>768?"14px":t.componentWidth>600||t.componentWidth>400?"12px":"9.1px","font-family":"Poppins-Light",backgroundOptionActive:"transparent",borderWidth:"2px",type:2,arrow:!1,selectedOption:i.currentTabMoreVideos,onOpenmedia:o.onOpenMedia},null,8,["width","font-size","selectedOption","onOpenmedia"])):n.createCommentVNode("",!0)]),i.currentTabMoreVideos=="Goles"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",e6,[n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(l,{height:"48px","margin-top":"5px","disable-matchdays":!0,"match-days":t.tournamentScheduleKeys,"is-landing-mode":!1,"items-to-show":t.componentWidth>600?17:t.componentWidth>400?13:9,"items-to-scroll":t.componentWidth>600?8:t.componentWidth>400?12:9,"default-match-day-key":t.defaultMatchDayKey,key:i.matchDayPickerKey,onChangeMatchDay:o.onChangeMatchDay},null,8,["match-days","items-to-show","items-to-scroll","default-match-day-key","onChangeMatchDay"]))]),n.createVNode(d,{style:{"margin-top":"-30px"},type:14,data:{season:t.seasonSelected.id,category:i.goalsCategory},width:"100%","matchday-view":Object.keys(i.matchdayActive).length>0?i.matchdayActive.matchDayId:1,backgroundColor:"transparent",title:"",onOpenmedia:o.onOpenMedia},null,8,["data","matchday-view","onOpenmedia"])],64)):n.createCommentVNode("",!0),i.currentTabMoreVideos=="Resumen"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[t.isplayer?(n.openBlock(),n.createBlock(d,{key:1,type:8,title:"",style:{"margin-top":"-30px"},backgroundColor:"transparent",data:{season:t.seasonSelected.id,player:t.player,category:1000001},width:"100%",onOpenmedia:e[3]||(e[3]=c=>o.onOpenMedia(c,!0))},null,8,["data"])):(n.openBlock(),n.createBlock(d,{key:0,type:7,title:"",style:{"margin-top":"-30px"},backgroundColor:"transparent",data:{season:t.seasonSelected.id,team:t.team,category:i.resumeCategory},width:"100%",onOpenmedia:e[2]||(e[2]=c=>o.onOpenMedia(c,!0))},null,8,["data"]))],64)):n.createCommentVNode("",!0),i.currentTabMoreVideos=="Proximo rival"?(n.openBlock(),n.createBlock(d,{key:2,type:7,style:{"margin-top":"-30px"},title:"",backgroundColor:"transparent",data:{season:t.seasonSelected.id,team:t.nextRivalTeam.id,category:i.resumeCategory},width:"100%",onOpenmedia:e[4]||(e[4]=c=>o.onOpenMedia(c,!0))},null,8,["data"])):n.createCommentVNode("",!0)],512)):n.createCommentVNode("",!0)}const s6=qe(X3,[["render",t6],["__scopeId","data-v-b485c3f6"]]),a6=["playId","league","season","gameId","playerName","refereeName","stadiumName","finalScore","scoreAtMomentOfPlay","gameDate","homeTeamName","homeTeamLogo","awayTeamName","awayTeamLogo","categoryId","categoryName","startTime","endTime","minuteOfPlay","momentOfPlay","videoUrl"];let Wr=null;function n6(){return Wr||(Wr=a6.reduce((s,e,t)=>(s[e]=t,s),{})),Wr}function i6(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Zm={exports:{}};(function(s,e){(function(t){var a=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,o=/(?:\/|^)\.(?=\/)/g,r=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,l={buildAbsoluteURL:function(d,c,h){if(h=h||{},d=d.trim(),c=c.trim(),!c){if(!h.alwaysNormalize)return d;var u=l.parseURL(d);if(!u)throw new Error("Error trying to parse base URL.");return u.path=l.normalizePath(u.path),l.buildURLFromParts(u)}var f=l.parseURL(c);if(!f)throw new Error("Error trying to parse relative URL.");if(f.scheme)return h.alwaysNormalize?(f.path=l.normalizePath(f.path),l.buildURLFromParts(f)):c;var p=l.parseURL(d);if(!p)throw new Error("Error trying to parse base URL.");if(!p.netLoc&&p.path&&p.path[0]!=="/"){var m=i.exec(p.path);p.netLoc=m[1],p.path=m[2]}p.netLoc&&!p.path&&(p.path="/");var g={scheme:p.scheme,netLoc:f.netLoc,path:null,params:f.params,query:f.query,fragment:f.fragment};if(!f.netLoc&&(g.netLoc=p.netLoc,f.path[0]!=="/"))if(!f.path)g.path=p.path,f.params||(g.params=p.params,f.query||(g.query=p.query));else{var y=p.path,b=y.substring(0,y.lastIndexOf("/")+1)+f.path;g.path=l.normalizePath(b)}return g.path===null&&(g.path=h.alwaysNormalize?l.normalizePath(f.path):f.path),l.buildURLFromParts(g)},parseURL:function(d){var c=a.exec(d);return c?{scheme:c[1]||"",netLoc:c[2]||"",path:c[3]||"",params:c[4]||"",query:c[5]||"",fragment:c[6]||""}:null},normalizePath:function(d){for(d=d.split("").reverse().join("").replace(o,"");d.length!==(d=d.replace(r,"")).length;);return d.split("").reverse().join("")},buildURLFromParts:function(d){return d.scheme+d.netLoc+d.path+d.params+d.query+d.fragment}};s.exports=l})()})(Zm);var Kr=Zm.exports;function Qm(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(s);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable})),t.push.apply(t,a)}return t}function Xe(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qm(Object(t),!0).forEach(function(a){l6(s,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):Qm(Object(t)).forEach(function(a){Object.defineProperty(s,a,Object.getOwnPropertyDescriptor(t,a))})}return s}function o6(s,e){if(typeof s!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var a=t.call(s,e||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function r6(s){var e=o6(s,"string");return typeof e=="symbol"?e:String(e)}function l6(s,e,t){return e=r6(e),e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function Ge(){return Ge=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(s[a]=t[a])}return s},Ge.apply(this,arguments)}const ne=Number.isFinite||function(s){return typeof s=="number"&&isFinite(s)},c6=Number.isSafeInteger||function(s){return typeof s=="number"&&Math.abs(s)<=d6},d6=Number.MAX_SAFE_INTEGER||9007199254740991;let w=function(s){return s.MEDIA_ATTACHING="hlsMediaAttaching",s.MEDIA_ATTACHED="hlsMediaAttached",s.MEDIA_DETACHING="hlsMediaDetaching",s.MEDIA_DETACHED="hlsMediaDetached",s.BUFFER_RESET="hlsBufferReset",s.BUFFER_CODECS="hlsBufferCodecs",s.BUFFER_CREATED="hlsBufferCreated",s.BUFFER_APPENDING="hlsBufferAppending",s.BUFFER_APPENDED="hlsBufferAppended",s.BUFFER_EOS="hlsBufferEos",s.BUFFER_FLUSHING="hlsBufferFlushing",s.BUFFER_FLUSHED="hlsBufferFlushed",s.MANIFEST_LOADING="hlsManifestLoading",s.MANIFEST_LOADED="hlsManifestLoaded",s.MANIFEST_PARSED="hlsManifestParsed",s.LEVEL_SWITCHING="hlsLevelSwitching",s.LEVEL_SWITCHED="hlsLevelSwitched",s.LEVEL_LOADING="hlsLevelLoading",s.LEVEL_LOADED="hlsLevelLoaded",s.LEVEL_UPDATED="hlsLevelUpdated",s.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",s.LEVELS_UPDATED="hlsLevelsUpdated",s.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",s.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",s.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",s.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",s.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",s.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",s.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",s.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",s.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",s.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",s.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",s.CUES_PARSED="hlsCuesParsed",s.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",s.INIT_PTS_FOUND="hlsInitPtsFound",s.FRAG_LOADING="hlsFragLoading",s.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",s.FRAG_LOADED="hlsFragLoaded",s.FRAG_DECRYPTED="hlsFragDecrypted",s.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",s.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",s.FRAG_PARSING_METADATA="hlsFragParsingMetadata",s.FRAG_PARSED="hlsFragParsed",s.FRAG_BUFFERED="hlsFragBuffered",s.FRAG_CHANGED="hlsFragChanged",s.FPS_DROP="hlsFpsDrop",s.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",s.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",s.ERROR="hlsError",s.DESTROYING="hlsDestroying",s.KEY_LOADING="hlsKeyLoading",s.KEY_LOADED="hlsKeyLoaded",s.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",s.BACK_BUFFER_REACHED="hlsBackBufferReached",s.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",s}({}),fe=function(s){return s.NETWORK_ERROR="networkError",s.MEDIA_ERROR="mediaError",s.KEY_SYSTEM_ERROR="keySystemError",s.MUX_ERROR="muxError",s.OTHER_ERROR="otherError",s}({}),N=function(s){return s.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",s.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",s.KEY_SYSTEM_NO_SESSION="keySystemNoSession",s.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",s.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",s.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",s.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",s.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",s.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",s.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",s.MANIFEST_LOAD_ERROR="manifestLoadError",s.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",s.MANIFEST_PARSING_ERROR="manifestParsingError",s.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",s.LEVEL_EMPTY_ERROR="levelEmptyError",s.LEVEL_LOAD_ERROR="levelLoadError",s.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",s.LEVEL_PARSING_ERROR="levelParsingError",s.LEVEL_SWITCH_ERROR="levelSwitchError",s.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",s.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",s.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",s.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",s.FRAG_LOAD_ERROR="fragLoadError",s.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",s.FRAG_DECRYPT_ERROR="fragDecryptError",s.FRAG_PARSING_ERROR="fragParsingError",s.FRAG_GAP="fragGap",s.REMUX_ALLOC_ERROR="remuxAllocError",s.KEY_LOAD_ERROR="keyLoadError",s.KEY_LOAD_TIMEOUT="keyLoadTimeOut",s.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",s.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",s.BUFFER_APPEND_ERROR="bufferAppendError",s.BUFFER_APPENDING_ERROR="bufferAppendingError",s.BUFFER_STALLED_ERROR="bufferStalledError",s.BUFFER_FULL_ERROR="bufferFullError",s.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",s.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",s.INTERNAL_EXCEPTION="internalException",s.INTERNAL_ABORTED="aborted",s.UNKNOWN="unknown",s}({});const _s=function(){},qr={trace:_s,debug:_s,log:_s,warn:_s,info:_s,error:_s};let wa=qr;function h6(s){const e=self.console[s];return e?e.bind(self.console,`[${s}] >`):_s}function u6(s,...e){e.forEach(function(t){wa[t]=s[t]?s[t].bind(s):h6(t)})}function m6(s,e){if(typeof console=="object"&&s===!0||typeof s=="object"){u6(s,"debug","log","info","warn","error");try{wa.log(`Debug logs enabled for "${e}" in hls.js version 1.5.16`)}catch{wa=qr}}else wa=qr}const A=wa,f6=/^(\d+)x(\d+)$/,ef=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Oe{constructor(e){typeof e=="string"&&(e=Oe.parseAttrList(e)),Ge(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const a=new Uint8Array(t.length/2);for(let i=0;i<t.length/2;i++)a[i]=parseInt(t.slice(i*2,i*2+2),16);return a}else return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const a=this[e];return a?parseFloat(a):t}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=f6.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const a={},i='"';for(ef.lastIndex=0;(t=ef.exec(e))!==null;){let o=t[2];o.indexOf(i)===0&&o.lastIndexOf(i)===o.length-1&&(o=o.slice(1,-1));const r=t[1].trim();a[r]=o}return a}}function p6(s){return s!=="ID"&&s!=="CLASS"&&s!=="START-DATE"&&s!=="DURATION"&&s!=="END-DATE"&&s!=="END-ON-NEXT"}function g6(s){return s==="SCTE35-OUT"||s==="SCTE35-IN"}class tf{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const a=t.attr;for(const i in a)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==a[i]){A.warn(`DATERANGE tag attribute: "${i}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=i;break}e=Ge(new Oe({}),a,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const a=new Date(this.attr["END-DATE"]);ne(a.getTime())&&(this._endDate=a)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(ne(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&ne(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class $n{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var Re={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class sf{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[Re.AUDIO]:null,[Re.VIDEO]:null,[Re.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const a=e.split("@",2);let i;a.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(a[1]),this._byteRange=[i,parseInt(a[0])+i]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Kr.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class Yr extends sf{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new $n,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const a=Object.keys(this.levelkeys);if(a.length===1)return this._decryptdata=this.levelkeys[a[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!ne(this.programDateTime))return null;const e=ne(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),a=t.length;if(a>1||a===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,a,i,o,r=!1){const{elementaryStreams:l}=this,d=l[e];if(!d){l[e]={startPTS:t,endPTS:a,startDTS:i,endDTS:o,partial:r};return}d.startPTS=Math.min(d.startPTS,t),d.endPTS=Math.max(d.endPTS,a),d.startDTS=Math.min(d.startDTS,i),d.endDTS=Math.max(d.endDTS,o)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[Re.AUDIO]=null,e[Re.VIDEO]=null,e[Re.AUDIOVIDEO]=null}}class y6 extends sf{constructor(e,t,a,i,o){super(a),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new $n,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const r=e.enumeratedString("BYTERANGE");r&&this.setByteRange(r,o),o&&(this.fragOffset=o.fragOffset+o.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const b6=10;class S6{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,a=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!a||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?ne(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||b6}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function Jr(s){return Uint8Array.from(atob(s),e=>e.charCodeAt(0))}function w6(s){const e=Xr(s).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function _6(s){const e=function(a,i,o){const r=a[i];a[i]=a[o],a[o]=r};e(s,0,3),e(s,1,2),e(s,4,5),e(s,6,7)}function k6(s){const e=s.split(":");let t=null;if(e[0]==="data"&&e.length===2){const a=e[1].split(";"),i=a[a.length-1].split(",");if(i.length===2){const o=i[0]==="base64",r=i[1];o?(a.splice(-1,1),t=Jr(r)):t=w6(r)}}return t}function Xr(s){return Uint8Array.from(unescape(encodeURIComponent(s)),e=>e.charCodeAt(0))}const Ms=typeof self<"u"?self:void 0;var Ne={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},ut={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function af(s){switch(s){case ut.FAIRPLAY:return Ne.FAIRPLAY;case ut.PLAYREADY:return Ne.PLAYREADY;case ut.WIDEVINE:return Ne.WIDEVINE;case ut.CLEARKEY:return Ne.CLEARKEY}}var _a={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",FAIRPLAY:"94ce86fb07ff4f43adb893d2fa968ca2",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function nf(s){if(s===_a.WIDEVINE)return Ne.WIDEVINE;if(s===_a.PLAYREADY)return Ne.PLAYREADY;if(s===_a.CENC||s===_a.CLEARKEY)return Ne.CLEARKEY}function of(s){switch(s){case Ne.FAIRPLAY:return ut.FAIRPLAY;case Ne.PLAYREADY:return ut.PLAYREADY;case Ne.WIDEVINE:return ut.WIDEVINE;case Ne.CLEARKEY:return ut.CLEARKEY}}function Zr(s){const{drmSystems:e,widevineLicenseUrl:t}=s,a=e?[Ne.FAIRPLAY,Ne.WIDEVINE,Ne.PLAYREADY,Ne.CLEARKEY].filter(i=>!!e[i]):[];return!a[Ne.WIDEVINE]&&t&&a.push(Ne.WIDEVINE),a}const rf=function(s){return Ms!=null&&(s=Ms.navigator)!=null&&s.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function E6(s,e,t,a){let i;switch(s){case Ne.FAIRPLAY:i=["cenc","sinf"];break;case Ne.WIDEVINE:case Ne.PLAYREADY:i=["cenc"];break;case Ne.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${s}`)}return T6(i,e,t,a)}function T6(s,e,t,a){return[{initDataTypes:s,persistentState:a.persistentState||"optional",distinctiveIdentifier:a.distinctiveIdentifier||"optional",sessionTypes:a.sessionTypes||[a.sessionType||"temporary"],audioCapabilities:e.map(o=>({contentType:`audio/mp4; codecs="${o}"`,robustness:a.audioRobustness||"",encryptionScheme:a.audioEncryptionScheme||null})),videoCapabilities:t.map(o=>({contentType:`video/mp4; codecs="${o}"`,robustness:a.videoRobustness||"",encryptionScheme:a.videoEncryptionScheme||null}))}]}function ks(s,e,t){return Uint8Array.prototype.slice?s.slice(e,t):new Uint8Array(Array.prototype.slice.call(s,e,t))}const Qr=(s,e)=>e+10<=s.length&&s[e]===73&&s[e+1]===68&&s[e+2]===51&&s[e+3]<255&&s[e+4]<255&&s[e+6]<128&&s[e+7]<128&&s[e+8]<128&&s[e+9]<128,lf=(s,e)=>e+10<=s.length&&s[e]===51&&s[e+1]===68&&s[e+2]===73&&s[e+3]<255&&s[e+4]<255&&s[e+6]<128&&s[e+7]<128&&s[e+8]<128&&s[e+9]<128,ka=(s,e)=>{const t=e;let a=0;for(;Qr(s,e);){a+=10;const i=Vn(s,e+6);a+=i,lf(s,e+10)&&(a+=10),e+=a}if(a>0)return s.subarray(t,t+a)},Vn=(s,e)=>{let t=0;return t=(s[e]&127)<<21,t|=(s[e+1]&127)<<14,t|=(s[e+2]&127)<<7,t|=s[e+3]&127,t},C6=(s,e)=>Qr(s,e)&&Vn(s,e+6)+10<=s.length-e,el=s=>{const e=df(s);for(let t=0;t<e.length;t++){const a=e[t];if(cf(a))return R6(a)}},cf=s=>s&&s.key==="PRIV"&&s.info==="com.apple.streaming.transportStreamTimestamp",x6=s=>{const e=String.fromCharCode(s[0],s[1],s[2],s[3]),t=Vn(s,4),a=10;return{type:e,size:t,data:s.subarray(a,a+t)}},df=s=>{let e=0;const t=[];for(;Qr(s,e);){const a=Vn(s,e+6);e+=10;const i=e+a;for(;e+8<i;){const o=x6(s.subarray(e)),r=v6(o);r&&t.push(r),e+=o.size+10}lf(s,e)&&(e+=10)}return t},v6=s=>s.type==="PRIV"?A6(s):s.type[0]==="W"?I6(s):L6(s),A6=s=>{if(s.size<2)return;const e=Ut(s.data,!0),t=new Uint8Array(s.data.subarray(e.length+1));return{key:s.type,info:e,data:t.buffer}},L6=s=>{if(s.size<2)return;if(s.type==="TXXX"){let t=1;const a=Ut(s.data.subarray(t),!0);t+=a.length+1;const i=Ut(s.data.subarray(t));return{key:s.type,info:a,data:i}}const e=Ut(s.data.subarray(1));return{key:s.type,data:e}},I6=s=>{if(s.type==="WXXX"){if(s.size<2)return;let t=1;const a=Ut(s.data.subarray(t),!0);t+=a.length+1;const i=Ut(s.data.subarray(t));return{key:s.type,info:a,data:i}}const e=Ut(s.data);return{key:s.type,data:e}},R6=s=>{if(s.data.byteLength===8){const e=new Uint8Array(s.data),t=e[3]&1;let a=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return a/=45,t&&(a+=4772185884e-2),Math.round(a)}},Ut=(s,e=!1)=>{const t=B6();if(t){const c=t.decode(s);if(e){const h=c.indexOf("\0");return h!==-1?c.substring(0,h):c}return c.replace(/\0/g,"")}const a=s.length;let i,o,r,l="",d=0;for(;d<a;){if(i=s[d++],i===0&&e)return l;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:l+=String.fromCharCode(i);break;case 12:case 13:o=s[d++],l+=String.fromCharCode((i&31)<<6|o&63);break;case 14:o=s[d++],r=s[d++],l+=String.fromCharCode((i&15)<<12|(o&63)<<6|(r&63)<<0);break}}return l};let tl;function B6(){if(!navigator.userAgent.includes("PlayStation 4"))return!tl&&typeof self.TextDecoder<"u"&&(tl=new self.TextDecoder("utf-8")),tl}const zt={hexDump:function(s){let e="";for(let t=0;t<s.length;t++){let a=s[t].toString(16);a.length<2&&(a="0"+a),e+=a}return e}},Un=Math.pow(2,32)-1,N6=[].push,hf={video:1,audio:2,id3:3,text:4};function Ke(s){return String.fromCharCode.apply(null,s)}function uf(s,e){const t=s[e]<<8|s[e+1];return t<0?65536+t:t}function re(s,e){const t=ff(s,e);return t<0?4294967296+t:t}function mf(s,e){let t=re(s,e);return t*=Math.pow(2,32),t+=re(s,e+4),t}function ff(s,e){return s[e]<<24|s[e+1]<<16|s[e+2]<<8|s[e+3]}function sl(s,e,t){s[e]=t>>24,s[e+1]=t>>16&255,s[e+2]=t>>8&255,s[e+3]=t&255}function D6(s){const e=s.byteLength;for(let t=0;t<e;){const a=re(s,t);if(a>8&&s[t+4]===109&&s[t+5]===111&&s[t+6]===111&&s[t+7]===102)return!0;t=a>1?t+a:e}return!1}function ye(s,e){const t=[];if(!e.length)return t;const a=s.byteLength;for(let i=0;i<a;){const o=re(s,i),r=Ke(s.subarray(i+4,i+8)),l=o>1?i+o:a;if(r===e[0])if(e.length===1)t.push(s.subarray(i+8,l));else{const d=ye(s.subarray(i+8,l),e.slice(1));d.length&&N6.apply(t,d)}i=l}return t}function P6(s){const e=[],t=s[0];let a=8;const i=re(s,a);a+=4;let o=0,r=0;t===0?(o=re(s,a),r=re(s,a+4),a+=8):(o=mf(s,a),r=mf(s,a+8),a+=16),a+=2;let l=s.length+r;const d=uf(s,a);a+=2;for(let c=0;c<d;c++){let h=a;const u=re(s,h);h+=4;const f=u&2147483647;if((u&2147483648)>>>31===1)return A.warn("SIDX has hierarchical references (not supported)"),null;const m=re(s,h);h+=4,e.push({referenceSize:f,subsegmentDuration:m,info:{duration:m/i,start:l,end:l+f-1}}),l+=f,h+=4,a=h}return{earliestPresentationTime:o,timescale:i,version:t,referencesCount:d,references:e}}function pf(s){const e=[],t=ye(s,["moov","trak"]);for(let i=0;i<t.length;i++){const o=t[i],r=ye(o,["tkhd"])[0];if(r){let l=r[0];const d=re(r,l===0?12:20),c=ye(o,["mdia","mdhd"])[0];if(c){l=c[0];const h=re(c,l===0?12:20),u=ye(o,["mdia","hdlr"])[0];if(u){const f=Ke(u.subarray(8,12)),p={soun:Re.AUDIO,vide:Re.VIDEO}[f];if(p){const m=ye(o,["mdia","minf","stbl","stsd"])[0],g=O6(m);e[d]={timescale:h,type:p},e[p]=Xe({timescale:h,id:d},g)}}}}}return ye(s,["moov","mvex","trex"]).forEach(i=>{const o=re(i,4),r=e[o];r&&(r.default={duration:re(i,12),flags:re(i,20)})}),e}function O6(s){const e=s.subarray(8),t=e.subarray(86),a=Ke(e.subarray(4,8));let i=a;const o=a==="enca"||a==="encv";if(o){const l=ye(e,[a])[0].subarray(a==="enca"?28:78);ye(l,["sinf"]).forEach(c=>{const h=ye(c,["schm"])[0];if(h){const u=Ke(h.subarray(4,8));if(u==="cbcs"||u==="cenc"){const f=ye(c,["frma"])[0];f&&(i=Ke(f))}}})}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const r=ye(t,["avcC"])[0];i+="."+zn(r[1])+zn(r[2])+zn(r[3]);break}case"mp4a":{const r=ye(e,[a])[0],l=ye(r.subarray(28),["esds"])[0];if(l&&l.length>12){let d=4;if(l[d++]!==3)break;d=al(l,d),d+=2;const c=l[d++];if(c&128&&(d+=2),c&64&&(d+=l[d++]),l[d++]!==4)break;d=al(l,d);const h=l[d++];if(h===64)i+="."+zn(h);else break;if(d+=12,l[d++]!==5)break;d=al(l,d);const u=l[d++];let f=(u&248)>>3;f===31&&(f+=1+((u&7)<<3)+((l[d]&224)>>5)),i+="."+f}break}case"hvc1":case"hev1":{const r=ye(t,["hvcC"])[0],l=r[1],d=["","A","B","C"][l>>6],c=l&31,h=re(r,2),u=(l&32)>>5?"H":"L",f=r[12],p=r.subarray(6,12);i+="."+d+c,i+="."+h.toString(16).toUpperCase(),i+="."+u+f;let m="";for(let g=p.length;g--;){const y=p[g];(y||m)&&(m="."+y.toString(16).toUpperCase()+m)}i+=m;break}case"dvh1":case"dvhe":{const r=ye(t,["dvcC"])[0],l=r[2]>>1&127,d=r[2]<<5&32|r[3]>>3&31;i+="."+Gt(l)+"."+Gt(d);break}case"vp09":{const r=ye(t,["vpcC"])[0],l=r[4],d=r[5],c=r[6]>>4&15;i+="."+Gt(l)+"."+Gt(d)+"."+Gt(c);break}case"av01":{const r=ye(t,["av1C"])[0],l=r[1]>>>5,d=r[1]&31,c=r[2]>>>7?"H":"M",h=(r[2]&64)>>6,u=(r[2]&32)>>5,f=l===2&&h?u?12:10:h?10:8,p=(r[2]&16)>>4,m=(r[2]&8)>>3,g=(r[2]&4)>>2,y=r[2]&3;i+="."+l+"."+Gt(d)+c+"."+Gt(f)+"."+p+"."+m+g+y+"."+Gt(1)+"."+Gt(1)+"."+Gt(1)+"."+0;break}}return{codec:i,encrypted:o}}function al(s,e){const t=e+5;for(;s[e++]&128&&e<t;);return e}function zn(s){return("0"+s.toString(16).toUpperCase()).slice(-2)}function Gt(s){return(s<10?"0":"")+s}function F6(s,e){if(!s||!e)return s;const t=e.keyId;return t&&e.isCommonEncryption&&ye(s,["moov","trak"]).forEach(i=>{const r=ye(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let l=ye(r,["enca"]);const d=l.length>0;d||(l=ye(r,["encv"])),l.forEach(c=>{const h=d?c.subarray(28):c.subarray(78);ye(h,["sinf"]).forEach(f=>{const p=gf(f);if(p){const m=p.subarray(8,24);m.some(g=>g!==0)||(A.log(`[eme] Patching keyId in 'enc${d?"a":"v"}>sinf>>tenc' box: ${zt.hexDump(m)} -> ${zt.hexDump(t)}`),p.set(t,8))}})})}),s}function gf(s){const e=ye(s,["schm"])[0];if(e){const t=Ke(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return ye(s,["schi","tenc"])[0]}return null}function M6(s,e){return ye(e,["moof","traf"]).reduce((t,a)=>{const i=ye(a,["tfdt"])[0],o=i[0],r=ye(a,["tfhd"]).reduce((l,d)=>{const c=re(d,4),h=s[c];if(h){let u=re(i,4);if(o===1){if(u===Un)return A.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),l;u*=Un+1,u+=re(i,8)}const f=h.timescale||9e4,p=u/f;if(ne(p)&&(l===null||p<l))return p}return l},null);return r!==null&&ne(r)&&(t===null||r<t)?r:t},null)}function $6(s,e){let t=0,a=0,i=0;const o=ye(s,["moof","traf"]);for(let r=0;r<o.length;r++){const l=o[r],d=ye(l,["tfhd"])[0],c=re(d,4),h=e[c];if(!h)continue;const u=h.default,f=re(d,0)|(u==null?void 0:u.flags);let p=u==null?void 0:u.duration;f&8&&(f&2?p=re(d,12):p=re(d,8));const m=h.timescale||9e4,g=ye(l,["trun"]);for(let y=0;y<g.length;y++){if(t=V6(g[y]),!t&&p){const b=re(g[y],4);t=p*b}h.type===Re.VIDEO?a+=t/m:h.type===Re.AUDIO&&(i+=t/m)}}if(a===0&&i===0){let r=1/0,l=0,d=0;const c=ye(s,["sidx"]);for(let h=0;h<c.length;h++){const u=P6(c[h]);if(u!=null&&u.references){r=Math.min(r,u.earliestPresentationTime/u.timescale);const f=u.references.reduce((p,m)=>p+m.info.duration||0,0);l=Math.max(l,f+u.earliestPresentationTime/u.timescale),d=l-r}}if(d&&ne(d))return d}return a||i}function V6(s){const e=re(s,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let a=0;const i=re(s,4);for(let o=0;o<i;o++){if(e&256){const r=re(s,t);a+=r,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return a}function U6(s,e,t){ye(e,["moof","traf"]).forEach(a=>{ye(a,["tfhd"]).forEach(i=>{const o=re(i,4),r=s[o];if(!r)return;const l=r.timescale||9e4;ye(a,["tfdt"]).forEach(d=>{const c=d[0],h=t*l;if(h){let u=re(d,4);if(c===0)u-=h,u=Math.max(u,0),sl(d,4,u);else{u*=Math.pow(2,32),u+=re(d,8),u-=h,u=Math.max(u,0);const f=Math.floor(u/(Un+1)),p=Math.floor(u%(Un+1));sl(d,4,f),sl(d,8,p)}}})})})}function z6(s){const e={valid:null,remainder:null},t=ye(s,["moof"]);if(t.length<2)return e.remainder=s,e;const a=t[t.length-1];return e.valid=ks(s,0,a.byteOffset-8),e.remainder=ks(s,a.byteOffset-8),e}function St(s,e){const t=new Uint8Array(s.length+e.length);return t.set(s),t.set(e,s.length),t}function yf(s,e){const t=[],a=e.samples,i=e.timescale,o=e.id;let r=!1;return ye(a,["moof"]).map(d=>{const c=d.byteOffset-8;ye(d,["traf"]).map(u=>{const f=ye(u,["tfdt"]).map(p=>{const m=p[0];let g=re(p,4);return m===1&&(g*=Math.pow(2,32),g+=re(p,8)),g/i})[0];return f!==void 0&&(s=f),ye(u,["tfhd"]).map(p=>{const m=re(p,4),g=re(p,0)&16777215,y=(g&1)!==0,b=(g&2)!==0,S=(g&8)!==0;let _=0;const C=(g&16)!==0;let E=0;const v=(g&32)!==0;let T=8;m===o&&(y&&(T+=8),b&&(T+=4),S&&(_=re(p,T),T+=4),C&&(E=re(p,T),T+=4),v&&(T+=4),e.type==="video"&&(r=G6(e.codec)),ye(u,["trun"]).map(B=>{const L=B[0],R=re(B,0)&16777215,$=(R&1)!==0;let K=0;const z=(R&4)!==0,ae=(R&256)!==0;let oe=0;const ie=(R&512)!==0;let ce=0;const de=(R&1024)!==0,Q=(R&2048)!==0;let q=0;const he=re(B,4);let J=8;$&&(K=re(B,J),J+=4),z&&(J+=4);let Z=K+c;for(let ue=0;ue<he;ue++){if(ae?(oe=re(B,J),J+=4):oe=_,ie?(ce=re(B,J),J+=4):ce=E,de&&(J+=4),Q&&(L===0?q=re(B,J):q=ff(B,J),J+=4),e.type===Re.VIDEO){let ge=0;for(;ge<ce;){const Ce=re(a,Z);if(Z+=4,j6(r,a[Z])){const se=a.subarray(Z,Z+Ce);bf(se,r?2:1,s+q/i,t)}Z+=Ce,ge+=Ce+4}}s+=oe/i}}))})})}),t}function G6(s){if(!s)return!1;const e=s.indexOf("."),t=e<0?s:s.substring(0,e);return t==="hvc1"||t==="hev1"||t==="dvh1"||t==="dvhe"}function j6(s,e){if(s){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function bf(s,e,t,a){const i=Sf(s);let o=0;o+=e;let r=0,l=0,d=0;for(;o<i.length;){r=0;do{if(o>=i.length)break;d=i[o++],r+=d}while(d===255);l=0;do{if(o>=i.length)break;d=i[o++],l+=d}while(d===255);const c=i.length-o;let h=o;if(l<c)o+=l;else if(l>c){A.error(`Malformed SEI payload. ${l} is too small, only ${c} bytes left to parse.`);break}if(r===4){if(i[h++]===181){const f=uf(i,h);if(h+=2,f===49){const p=re(i,h);if(h+=4,p===1195456820){const m=i[h++];if(m===3){const g=i[h++],y=31&g,b=64&g,S=b?2+y*3:0,_=new Uint8Array(S);if(b){_[0]=g;for(let C=1;C<S;C++)_[C]=i[h++]}a.push({type:m,payloadType:r,pts:t,bytes:_})}}}}}else if(r===5&&l>16){const u=[];for(let m=0;m<16;m++){const g=i[h++].toString(16);u.push(g.length==1?"0"+g:g),(m===3||m===5||m===7||m===9)&&u.push("-")}const f=l-16,p=new Uint8Array(f);for(let m=0;m<f;m++)p[m]=i[h++];a.push({payloadType:r,pts:t,uuid:u.join(""),userData:Ut(p),userDataBytes:p})}}}function Sf(s){const e=s.byteLength,t=[];let a=1;for(;a<e-2;)s[a]===0&&s[a+1]===0&&s[a+2]===3?(t.push(a+2),a+=2):a++;if(t.length===0)return s;const i=e-t.length,o=new Uint8Array(i);let r=0;for(a=0;a<i;r++,a++)r===t[0]&&(r++,t.shift()),o[a]=s[r];return o}function H6(s){const e=s[0];let t="",a="",i=0,o=0,r=0,l=0,d=0,c=0;if(e===0){for(;Ke(s.subarray(c,c+1))!=="\0";)t+=Ke(s.subarray(c,c+1)),c+=1;for(t+=Ke(s.subarray(c,c+1)),c+=1;Ke(s.subarray(c,c+1))!=="\0";)a+=Ke(s.subarray(c,c+1)),c+=1;a+=Ke(s.subarray(c,c+1)),c+=1,i=re(s,12),o=re(s,16),l=re(s,20),d=re(s,24),c=28}else if(e===1){c+=4,i=re(s,c),c+=4;const u=re(s,c);c+=4;const f=re(s,c);for(c+=4,r=2**32*u+f,c6(r)||(r=Number.MAX_SAFE_INTEGER,A.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=re(s,c),c+=4,d=re(s,c),c+=4;Ke(s.subarray(c,c+1))!=="\0";)t+=Ke(s.subarray(c,c+1)),c+=1;for(t+=Ke(s.subarray(c,c+1)),c+=1;Ke(s.subarray(c,c+1))!=="\0";)a+=Ke(s.subarray(c,c+1)),c+=1;a+=Ke(s.subarray(c,c+1)),c+=1}const h=s.subarray(c,s.byteLength);return{schemeIdUri:t,value:a,timeScale:i,presentationTime:r,presentationTimeDelta:o,eventDuration:l,id:d,payload:h}}function W6(s,...e){const t=e.length;let a=8,i=t;for(;i--;)a+=e[i].byteLength;const o=new Uint8Array(a);for(o[0]=a>>24&255,o[1]=a>>16&255,o[2]=a>>8&255,o[3]=a&255,o.set(s,4),i=0,a=8;i<t;i++)o.set(e[i],a),a+=e[i].byteLength;return o}function K6(s,e,t){if(s.byteLength!==16)throw new RangeError("Invalid system id");let a,i;a=0,i=new Uint8Array;let o;a>0?(o=new Uint8Array(4),e.length>0&&new DataView(o.buffer).setUint32(0,e.length,!1)):o=new Uint8Array;const r=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(r.buffer).setUint32(0,t.byteLength,!1),W6([112,115,115,104],new Uint8Array([a,0,0,0]),s,o,i,r,t||new Uint8Array)}function q6(s){const e=[];if(s instanceof ArrayBuffer){const t=s.byteLength;let a=0;for(;a+32<t;){const i=new DataView(s,a),o=Y6(i);e.push(o),a+=o.size}}return e}function Y6(s){const e=s.getUint32(0),t=s.byteOffset,a=s.byteLength;if(a<e)return{offset:t,size:a};if(s.getUint32(4)!==1886614376)return{offset:t,size:e};const o=s.getUint32(8)>>>24;if(o!==0&&o!==1)return{offset:t,size:e};const r=s.buffer,l=zt.hexDump(new Uint8Array(r,t+12,16)),d=s.getUint32(28);let c=null,h=null;if(o===0){if(e-32<d||d<22)return{offset:t,size:e};h=new Uint8Array(r,t+32,d)}else if(o===1){if(!d||a<t+32+d*16+16)return{offset:t,size:e};c=[];for(let u=0;u<d;u++)c.push(new Uint8Array(r,t+32+u*16,16))}return{version:o,systemId:l,kids:c,data:h,offset:t,size:e}}let Gn={};class Ea{static clearKeyUriToKeyIdMap(){Gn={}}constructor(e,t,a,i=[1],o=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=a,this.keyFormatVersions=i,this.iv=o,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&e!=="AES-128"}isSupported(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case ut.FAIRPLAY:case ut.WIDEVINE:case ut.PLAYREADY:case ut.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof e!="number"&&(this.method==="AES-128"&&!this.iv&&A.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const a=J6(e);return new Ea(this.method,this.uri,"identity",this.keyFormatVersions,a)}const t=k6(this.uri);if(t)switch(this.keyFormat){case ut.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case ut.PLAYREADY:{const a=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=K6(a,null,t);const i=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),o=String.fromCharCode.apply(null,Array.from(i)),r=o.substring(o.indexOf("<"),o.length),c=new DOMParser().parseFromString(r,"text/xml").getElementsByTagName("KID")[0];if(c){const h=c.childNodes[0]?c.childNodes[0].nodeValue:c.getAttribute("VALUE");if(h){const u=Jr(h).subarray(0,16);_6(u),this.keyId=u}}break}default:{let a=t.subarray(0,16);if(a.length!==16){const i=new Uint8Array(16);i.set(a,16-a.length),a=i}this.keyId=a;break}}if(!this.keyId||this.keyId.byteLength!==16){let a=Gn[this.uri];if(!a){const i=Object.keys(Gn).length%Number.MAX_SAFE_INTEGER;a=new Uint8Array(16),new DataView(a.buffer,12,4).setUint32(0,i),Gn[this.uri]=a}this.keyId=a}return this}}function J6(s){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=s>>8*(15-t)&255;return e}const wf=/\{\$([a-zA-Z0-9-_]+)\}/g;function _f(s){return wf.test(s)}function mt(s,e,t){if(s.variableList!==null||s.hasVariableRefs)for(let a=t.length;a--;){const i=t[a],o=e[i];o&&(e[i]=nl(s,o))}}function nl(s,e){if(s.variableList!==null||s.hasVariableRefs){const t=s.variableList;return e.replace(wf,a=>{const i=a.substring(2,a.length-1),o=t==null?void 0:t[i];return o===void 0?(s.playlistParsingError||(s.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),a):o})}return e}function kf(s,e,t){let a=s.variableList;a||(s.variableList=a={});let i,o;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const r=new self.URL(t).searchParams;if(r.has(i))o=r.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(r){s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${r.message}`))}}else i=e.NAME,o=e.VALUE;i in a?s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):a[i]=o||""}function X6(s,e,t){const a=e.IMPORT;if(t&&a in t){let i=s.variableList;i||(s.variableList=i={}),i[a]=t[a]}else s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${a}"`))}function Es(s=!0){return typeof self>"u"?void 0:(s||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Z6(s){return typeof self<"u"&&s===self.ManagedMediaSource}const jn={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Q6(s,e){const t=jn[e];return!!t&&!!t[s.slice(0,4)]}function il(s,e,t=!0){return!s.split(",").some(a=>!Ef(a,e,t))}function Ef(s,e,t=!0){var a;const i=Es(t);return(a=i==null?void 0:i.isTypeSupported(Ta(s,e)))!=null?a:!1}function Ta(s,e){return`${e}/mp4;codecs="${s}"`}function Tf(s){if(s){const e=s.substring(0,4);return jn.video[e]}return 2}function Hn(s){return s.split(",").reduce((e,t)=>{const a=jn.video[t];return a?(a*2+e)/(e?3:2):(jn.audio[t]+e)/(e?2:1)},0)}const ol={};function eB(s,e=!0){if(ol[s])return ol[s];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[s];for(let a=0;a<t.length;a++)if(Ef(t[a],"audio",e))return ol[s]=t[a],t[a];return s}const tB=/flac|opus/i;function Wn(s,e=!0){return s.replace(tB,t=>eB(t.toLowerCase(),e))}function Cf(s,e){return s&&s!=="mp4a"?s:e&&e.split(",")[0]}function sB(s){const e=s.split(",");for(let t=0;t<e.length;t++){const a=e[t].split(".");if(a.length>2){let i=a.shift()+".";i+=parseInt(a.shift()).toString(16),i+=("000"+parseInt(a.shift()).toString(16)).slice(-4),e[t]=i}}return e.join(",")}const xf=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,vf=/#EXT-X-MEDIA:(.*)/g,aB=/^#EXT(?:INF|-X-TARGETDURATION):/m,Af=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),nB=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class jt{static findGroup(e,t){for(let a=0;a<e.length;a++){const i=e[a];if(i.id===t)return i}}static resolve(e,t){return Kr.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return aB.test(e)}static parseMasterPlaylist(e,t){const a=_f(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:a},o=[];xf.lastIndex=0;let r;for(;(r=xf.exec(e))!=null;)if(r[1]){var l;const c=new Oe(r[1]);mt(i,c,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const h=nl(i,r[2]),u={attrs:c,bitrate:c.decimalInteger("BANDWIDTH")||c.decimalInteger("AVERAGE-BANDWIDTH"),name:c.NAME,url:jt.resolve(h,t)},f=c.decimalResolution("RESOLUTION");f&&(u.width=f.width,u.height=f.height),iB(c.CODECS,u),(l=u.unknownCodecs)!=null&&l.length||o.push(u),i.levels.push(u)}else if(r[3]){const c=r[3],h=r[4];switch(c){case"SESSION-DATA":{const u=new Oe(h);mt(i,u,["DATA-ID","LANGUAGE","VALUE","URI"]);const f=u["DATA-ID"];f&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[f]=u);break}case"SESSION-KEY":{const u=Lf(h,t,i);u.encrypted&&u.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(u)):A.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${h}"`);break}case"DEFINE":{{const u=new Oe(h);mt(i,u,["NAME","VALUE","QUERYPARAM"]),kf(i,u,t)}break}case"CONTENT-STEERING":{const u=new Oe(h);mt(i,u,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:jt.resolve(u["SERVER-URI"],t),pathwayId:u["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=If(h);break}}}const d=o.length>0&&o.length<i.levels.length;return i.levels=d?o:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,a){let i;const o={},r=a.levels,l={AUDIO:r.map(c=>({id:c.attrs.AUDIO,audioCodec:c.audioCodec})),SUBTITLES:r.map(c=>({id:c.attrs.SUBTITLES,textCodec:c.textCodec})),"CLOSED-CAPTIONS":[]};let d=0;for(vf.lastIndex=0;(i=vf.exec(e))!==null;){const c=new Oe(i[1]),h=c.TYPE;if(h){const u=l[h],f=o[h]||[];o[h]=f,mt(a,c,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const p=c.LANGUAGE,m=c["ASSOC-LANGUAGE"],g=c.CHANNELS,y=c.CHARACTERISTICS,b=c["INSTREAM-ID"],S={attrs:c,bitrate:0,id:d++,groupId:c["GROUP-ID"]||"",name:c.NAME||p||"",type:h,default:c.bool("DEFAULT"),autoselect:c.bool("AUTOSELECT"),forced:c.bool("FORCED"),lang:p,url:c.URI?jt.resolve(c.URI,t):""};if(m&&(S.assocLang=m),g&&(S.channels=g),y&&(S.characteristics=y),b&&(S.instreamId=b),u!=null&&u.length){const _=jt.findGroup(u,S.groupId)||u[0];Rf(S,_,"audioCodec"),Rf(S,_,"textCodec")}f.push(S)}}return o}static parseLevelPlaylist(e,t,a,i,o,r){const l=new S6(t),d=l.fragments;let c=null,h=0,u=0,f=0,p=0,m=null,g=new Yr(i,t),y,b,S,_=-1,C=!1,E=null;for(Af.lastIndex=0,l.m3u8=e,l.hasVariableRefs=_f(e);(y=Af.exec(e))!==null;){C&&(C=!1,g=new Yr(i,t),g.start=f,g.sn=h,g.cc=p,g.level=a,c&&(g.initSegment=c,g.rawProgramDateTime=c.rawProgramDateTime,c.rawProgramDateTime=null,E&&(g.setByteRange(E),E=null)));const L=y[1];if(L){g.duration=parseFloat(L);const R=(" "+y[2]).slice(1);g.title=R||null,g.tagList.push(R?["INF",L,R]:["INF",L])}else if(y[3]){if(ne(g.duration)){g.start=f,S&&Df(g,S,l),g.sn=h,g.level=a,g.cc=p,d.push(g);const R=(" "+y[3]).slice(1);g.relurl=nl(l,R),Bf(g,m),m=g,f+=g.duration,h++,u=0,C=!0}}else if(y[4]){const R=(" "+y[4]).slice(1);m?g.setByteRange(R,m):g.setByteRange(R)}else if(y[5])g.rawProgramDateTime=(" "+y[5]).slice(1),g.tagList.push(["PROGRAM-DATE-TIME",g.rawProgramDateTime]),_===-1&&(_=d.length);else{if(y=y[0].match(nB),!y){A.warn("No matches on slow regex match for level playlist!");continue}for(b=1;b<y.length&&!(typeof y[b]<"u");b++);const R=(" "+y[b]).slice(1),$=(" "+y[b+1]).slice(1),K=y[b+2]?(" "+y[b+2]).slice(1):"";switch(R){case"PLAYLIST-TYPE":l.type=$.toUpperCase();break;case"MEDIA-SEQUENCE":h=l.startSN=parseInt($);break;case"SKIP":{const z=new Oe($);mt(l,z,["RECENTLY-REMOVED-DATERANGES"]);const ae=z.decimalInteger("SKIPPED-SEGMENTS");if(ne(ae)){l.skippedSegments=ae;for(let ie=ae;ie--;)d.unshift(null);h+=ae}const oe=z.enumeratedString("RECENTLY-REMOVED-DATERANGES");oe&&(l.recentlyRemovedDateranges=oe.split(" "));break}case"TARGETDURATION":l.targetduration=Math.max(parseInt($),1);break;case"VERSION":l.version=parseInt($);break;case"INDEPENDENT-SEGMENTS":case"EXTM3U":break;case"ENDLIST":l.live=!1;break;case"#":($||K)&&g.tagList.push(K?[$,K]:[$]);break;case"DISCONTINUITY":p++,g.tagList.push(["DIS"]);break;case"GAP":g.gap=!0,g.tagList.push([R]);break;case"BITRATE":g.tagList.push([R,$]);break;case"DATERANGE":{const z=new Oe($);mt(l,z,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),mt(l,z,z.clientAttrs);const ae=new tf(z,l.dateRanges[z.ID]);ae.isValid||l.skippedSegments?l.dateRanges[ae.id]=ae:A.warn(`Ignoring invalid DATERANGE tag: "${$}"`),g.tagList.push(["EXT-X-DATERANGE",$]);break}case"DEFINE":{{const z=new Oe($);mt(l,z,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in z?X6(l,z,r):kf(l,z,t)}break}case"DISCONTINUITY-SEQUENCE":p=parseInt($);break;case"KEY":{const z=Lf($,t,l);if(z.isSupported()){if(z.method==="NONE"){S=void 0;break}S||(S={}),S[z.keyFormat]&&(S=Ge({},S)),S[z.keyFormat]=z}else A.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${$}"`);break}case"START":l.startTimeOffset=If($);break;case"MAP":{const z=new Oe($);if(mt(l,z,["BYTERANGE","URI"]),g.duration){const ae=new Yr(i,t);Nf(ae,z,a,S),c=ae,g.initSegment=c,c.rawProgramDateTime&&!g.rawProgramDateTime&&(g.rawProgramDateTime=c.rawProgramDateTime)}else{const ae=g.byteRangeEndOffset;if(ae){const oe=g.byteRangeStartOffset;E=`${ae-oe}@${oe}`}else E=null;Nf(g,z,a,S),c=g,C=!0}break}case"SERVER-CONTROL":{const z=new Oe($);l.canBlockReload=z.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=z.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&z.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=z.optionalFloat("PART-HOLD-BACK",0),l.holdBack=z.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const z=new Oe($);l.partTarget=z.decimalFloatingPoint("PART-TARGET");break}case"PART":{let z=l.partList;z||(z=l.partList=[]);const ae=u>0?z[z.length-1]:void 0,oe=u++,ie=new Oe($);mt(l,ie,["BYTERANGE","URI"]);const ce=new y6(ie,g,t,oe,ae);z.push(ce),g.duration+=ce.duration;break}case"PRELOAD-HINT":{const z=new Oe($);mt(l,z,["URI"]),l.preloadHint=z;break}case"RENDITION-REPORT":{const z=new Oe($);mt(l,z,["URI"]),l.renditionReports=l.renditionReports||[],l.renditionReports.push(z);break}default:A.warn(`line parsed but not handled: ${y}`);break}}}m&&!m.relurl?(d.pop(),f-=m.duration,l.partList&&(l.fragmentHint=m)):l.partList&&(Bf(g,m),g.cc=p,l.fragmentHint=g,S&&Df(g,S,l));const v=d.length,T=d[0],B=d[v-1];if(f+=l.skippedSegments*l.targetduration,f>0&&v&&B){l.averagetargetduration=f/v;const L=B.sn;l.endSN=L!=="initSegment"?L:0,l.live||(B.endList=!0),T&&(l.startCC=T.cc)}else l.endSN=0,l.startCC=0;return l.fragmentHint&&(f+=l.fragmentHint.duration),l.totalduration=f,l.endCC=p,_>0&&oB(d,_),l}}function Lf(s,e,t){var a,i;const o=new Oe(s);mt(t,o,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const r=(a=o.METHOD)!=null?a:"",l=o.URI,d=o.hexadecimalInteger("IV"),c=o.KEYFORMATVERSIONS,h=(i=o.KEYFORMAT)!=null?i:"identity";l&&o.IV&&!d&&A.error(`Invalid IV: ${o.IV}`);const u=l?jt.resolve(l,e):"",f=(c||"1").split("/").map(Number).filter(Number.isFinite);return new Ea(r,u,h,f,d)}function If(s){const t=new Oe(s).decimalFloatingPoint("TIME-OFFSET");return ne(t)?t:null}function iB(s,e){let t=(s||"").split(/[ ,]+/).filter(a=>a);["video","audio","text"].forEach(a=>{const i=t.filter(o=>Q6(o,a));i.length&&(e[`${a}Codec`]=i.join(","),t=t.filter(o=>i.indexOf(o)===-1))}),e.unknownCodecs=t}function Rf(s,e,t){const a=e[t];a&&(s[t]=a)}function oB(s,e){let t=s[e];for(let a=e;a--;){const i=s[a];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function Bf(s,e){s.rawProgramDateTime?s.programDateTime=Date.parse(s.rawProgramDateTime):e!=null&&e.programDateTime&&(s.programDateTime=e.endProgramDateTime),ne(s.programDateTime)||(s.programDateTime=null,s.rawProgramDateTime=null)}function Nf(s,e,t,a){s.relurl=e.URI,e.BYTERANGE&&s.setByteRange(e.BYTERANGE),s.level=t,s.sn="initSegment",a&&(s.levelkeys=a),s.initSegment=null}function Df(s,e,t){s.levelkeys=e;const{encryptedFragments:a}=t;(!a.length||a[a.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&a.push(s)}var xe={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},le={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Pf(s){const{type:e}=s;switch(e){case xe.AUDIO_TRACK:return le.AUDIO;case xe.SUBTITLE_TRACK:return le.SUBTITLE;default:return le.MAIN}}function rl(s,e){let t=s.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class rB{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.LEVEL_LOADING,this.onLevelLoading,this),e.on(w.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(w.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.LEVEL_LOADING,this.onLevelLoading,this),e.off(w.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(w.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,a=t.pLoader,i=t.loader,o=a||i,r=new o(t);return this.loaders[e.type]=r,r}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:a}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:xe.MANIFEST,url:a,deliveryDirectives:null})}onLevelLoading(e,t){const{id:a,level:i,pathwayId:o,url:r,deliveryDirectives:l}=t;this.load({id:a,level:i,pathwayId:o,responseType:"text",type:xe.LEVEL,url:r,deliveryDirectives:l})}onAudioTrackLoading(e,t){const{id:a,groupId:i,url:o,deliveryDirectives:r}=t;this.load({id:a,groupId:i,level:null,responseType:"text",type:xe.AUDIO_TRACK,url:o,deliveryDirectives:r})}onSubtitleTrackLoading(e,t){const{id:a,groupId:i,url:o,deliveryDirectives:r}=t;this.load({id:a,groupId:i,level:null,responseType:"text",type:xe.SUBTITLE_TRACK,url:o,deliveryDirectives:r})}load(e){var t;const a=this.hls.config;let i=this.getInternalLoader(e);if(i){const c=i.context;if(c&&c.url===e.url&&c.level===e.level){A.trace("[playlist-loader]: playlist request ongoing");return}A.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let o;if(e.type===xe.MANIFEST?o=a.manifestLoadPolicy.default:o=Ge({},a.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),ne((t=e.deliveryDirectives)==null?void 0:t.part)){let c;if(e.type===xe.LEVEL&&e.level!==null?c=this.hls.levels[e.level].details:e.type===xe.AUDIO_TRACK&&e.id!==null?c=this.hls.audioTracks[e.id].details:e.type===xe.SUBTITLE_TRACK&&e.id!==null&&(c=this.hls.subtitleTracks[e.id].details),c){const h=c.partTarget,u=c.targetduration;if(h&&u){const f=Math.max(h*3,u*.8)*1e3;o=Ge({},o,{maxTimeToFirstByteMs:Math.min(f,o.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(f,o.maxTimeToFirstByteMs)})}}}const r=o.errorRetry||o.timeoutRetry||{},l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:r.maxNumRetry||0,retryDelay:r.retryDelayMs||0,maxRetryDelay:r.maxRetryDelayMs||0},d={onSuccess:(c,h,u,f)=>{const p=this.getInternalLoader(u);this.resetInternalLoader(u.type);const m=c.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(c,u,new Error("no EXTM3U delimiter"),f||null,h);return}h.parsing.start=performance.now(),jt.isMediaPlaylist(m)?this.handleTrackOrLevelPlaylist(c,h,u,f||null,p):this.handleMasterPlaylist(c,h,u,f)},onError:(c,h,u,f)=>{this.handleNetworkError(h,u,!1,c,f)},onTimeout:(c,h,u)=>{this.handleNetworkError(h,u,!0,void 0,c)}};i.load(e,l,d)}handleMasterPlaylist(e,t,a,i){const o=this.hls,r=e.data,l=rl(e,a),d=jt.parseMasterPlaylist(r,l);if(d.playlistParsingError){this.handleManifestParsingError(e,a,d.playlistParsingError,i,t);return}const{contentSteering:c,levels:h,sessionData:u,sessionKeys:f,startTimeOffset:p,variableList:m}=d;this.variableList=m;const{AUDIO:g=[],SUBTITLES:y,"CLOSED-CAPTIONS":b}=jt.parseMasterPlaylistMedia(r,l,d);g.length&&!g.some(_=>!_.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(A.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Oe({}),bitrate:0,url:""})),o.trigger(w.MANIFEST_LOADED,{levels:h,audioTracks:g,subtitles:y,captions:b,contentSteering:c,url:l,stats:t,networkDetails:i,sessionData:u,sessionKeys:f,startTimeOffset:p,variableList:m})}handleTrackOrLevelPlaylist(e,t,a,i,o){const r=this.hls,{id:l,level:d,type:c}=a,h=rl(e,a),u=0,f=ne(d)?d:ne(l)?l:0,p=Pf(a),m=jt.parseLevelPlaylist(e.data,h,f,p,u,this.variableList);if(c===xe.MANIFEST){const g={attrs:new Oe({}),bitrate:0,details:m,name:"",url:h};r.trigger(w.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:h,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),a.levelDetails=m,this.handlePlaylistLoaded(m,e,t,a,i,o)}handleManifestParsingError(e,t,a,i,o){this.hls.trigger(w.ERROR,{type:fe.NETWORK_ERROR,details:N.MANIFEST_PARSING_ERROR,fatal:t.type===xe.MANIFEST,url:e.url,err:a,error:a,reason:a.message,response:e,context:t,networkDetails:i,stats:o})}handleNetworkError(e,t,a=!1,i,o){let r=`A network ${a?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===xe.LEVEL?r+=`: ${e.level} id: ${e.id}`:(e.type===xe.AUDIO_TRACK||e.type===xe.SUBTITLE_TRACK)&&(r+=` id: ${e.id} group-id: "${e.groupId}"`);const l=new Error(r);A.warn(`[playlist-loader]: ${r}`);let d=N.UNKNOWN,c=!1;const h=this.getInternalLoader(e);switch(e.type){case xe.MANIFEST:d=a?N.MANIFEST_LOAD_TIMEOUT:N.MANIFEST_LOAD_ERROR,c=!0;break;case xe.LEVEL:d=a?N.LEVEL_LOAD_TIMEOUT:N.LEVEL_LOAD_ERROR,c=!1;break;case xe.AUDIO_TRACK:d=a?N.AUDIO_TRACK_LOAD_TIMEOUT:N.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case xe.SUBTITLE_TRACK:d=a?N.SUBTITLE_TRACK_LOAD_TIMEOUT:N.SUBTITLE_LOAD_ERROR,c=!1;break}h&&this.resetInternalLoader(e.type);const u={type:fe.NETWORK_ERROR,details:d,fatal:c,url:e.url,loader:h,context:e,error:l,networkDetails:t,stats:o};if(i){const f=(t==null?void 0:t.url)||e.url;u.response=Xe({url:f,data:void 0},i)}this.hls.trigger(w.ERROR,u)}handlePlaylistLoaded(e,t,a,i,o,r){const l=this.hls,{type:d,level:c,id:h,groupId:u,deliveryDirectives:f}=i,p=rl(t,i),m=Pf(i),g=typeof i.level=="number"&&m===le.MAIN?c:void 0;if(!e.fragments.length){const b=new Error("No Segments found in Playlist");l.trigger(w.ERROR,{type:fe.NETWORK_ERROR,details:N.LEVEL_EMPTY_ERROR,fatal:!1,url:p,error:b,reason:b.message,response:t,context:i,level:g,parent:m,networkDetails:o,stats:a});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const y=e.playlistParsingError;if(y){l.trigger(w.ERROR,{type:fe.NETWORK_ERROR,details:N.LEVEL_PARSING_ERROR,fatal:!1,url:p,error:y,reason:y.message,response:t,context:i,level:g,parent:m,networkDetails:o,stats:a});return}switch(e.live&&r&&(r.getCacheAge&&(e.ageHeader=r.getCacheAge()||0),(!r.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),d){case xe.MANIFEST:case xe.LEVEL:l.trigger(w.LEVEL_LOADED,{details:e,level:g||0,id:h||0,stats:a,networkDetails:o,deliveryDirectives:f});break;case xe.AUDIO_TRACK:l.trigger(w.AUDIO_TRACK_LOADED,{details:e,id:h||0,groupId:u||"",stats:a,networkDetails:o,deliveryDirectives:f});break;case xe.SUBTITLE_TRACK:l.trigger(w.SUBTITLE_TRACK_LOADED,{details:e,id:h||0,groupId:u||"",stats:a,networkDetails:o,deliveryDirectives:f});break}}}function Of(s,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=s,e.dispatchEvent(t)}function Ff(s,e){const t=s.mode;if(t==="disabled"&&(s.mode="hidden"),s.cues&&!s.cues.getCueById(e.id))try{if(s.addCue(e),!s.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(a){A.debug(`[texttrack-utils]: ${a}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,s.addCue(i)}catch(i){A.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(s.mode=t)}function $s(s){const e=s.mode;if(e==="disabled"&&(s.mode="hidden"),s.cues)for(let t=s.cues.length;t--;)s.removeCue(s.cues[t]);e==="disabled"&&(s.mode=e)}function ll(s,e,t,a){const i=s.mode;if(i==="disabled"&&(s.mode="hidden"),s.cues&&s.cues.length>0){const o=cB(s.cues,e,t);for(let r=0;r<o.length;r++)(!a||a(o[r]))&&s.removeCue(o[r])}i==="disabled"&&(s.mode=i)}function lB(s,e){if(e<s[0].startTime)return 0;const t=s.length-1;if(e>s[t].endTime)return-1;let a=0,i=t;for(;a<=i;){const o=Math.floor((i+a)/2);if(e<s[o].startTime)i=o-1;else if(e>s[o].startTime&&a<t)a=o+1;else return o}return s[a].startTime-e<e-s[i].startTime?a:i}function cB(s,e,t){const a=[],i=lB(s,e);if(i>-1)for(let o=i,r=s.length;o<r;o++){const l=s[o];if(l.startTime>=e&&l.endTime<=t)a.push(l);else if(l.startTime>t)return a}return a}function Kn(s){const e=[];for(let t=0;t<s.length;t++){const a=s[t];(a.kind==="subtitles"||a.kind==="captions")&&a.label&&e.push(s[t])}return e}var Dt={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const dB=.25;function cl(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function Mf(s,e,t,a,i){let o=new s(e,t,"");try{o.value=a,i&&(o.type=i)}catch{o=new s(e,t,JSON.stringify(i?Xe({type:i},a):a))}return o}const qn=(()=>{const s=cl();try{s&&new s(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function dl(s,e){return s.getTime()/1e3-e}function hB(s){return Uint8Array.from(s.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class uB{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(w.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(w.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(w.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(w.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&($s(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const a=e[t];if(a.kind==="metadata"&&a.label==="id3")return Of(a,this.media),a}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:a,enableID3MetadataCues:i}}}=this;if(!a&&!i)return;const{samples:o}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const r=cl();if(r)for(let l=0;l<o.length;l++){const d=o[l].type;if(d===Dt.emsg&&!a||!i)continue;const c=df(o[l].data);if(c){const h=o[l].pts;let u=h+o[l].duration;u>qn&&(u=qn),u-h<=0&&(u=h+dB);for(let p=0;p<c.length;p++){const m=c[p];if(!cf(m)){this.updateId3CueEnds(h,d);const g=Mf(r,h,u,m,d);g&&this.id3Track.addCue(g)}}}}}updateId3CueEnds(e,t){var a;const i=(a=this.id3Track)==null?void 0:a.cues;if(i)for(let o=i.length;o--;){const r=i[o];r.type===t&&r.startTime<e&&r.endTime===qn&&(r.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:a,type:i}){const{id3Track:o,hls:r}=this;if(!r)return;const{config:{enableEmsgMetadataCues:l,enableID3MetadataCues:d}}=r;if(o&&(l||d)){let c;i==="audio"?c=h=>h.type===Dt.audioId3&&d:i==="video"?c=h=>h.type===Dt.emsg&&l:c=h=>h.type===Dt.audioId3&&d||h.type===Dt.emsg&&l,ll(o,t,a,c)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:a,id3Track:i}=this,{dateRanges:o}=t,r=Object.keys(o);if(i){const h=Object.keys(a).filter(u=>!r.includes(u));for(let u=h.length;u--;){const f=h[u];Object.keys(a[f].cues).forEach(p=>{i.removeCue(a[f].cues[p])}),delete a[f]}}const l=t.fragments[t.fragments.length-1];if(r.length===0||!ne(l==null?void 0:l.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const d=l.programDateTime/1e3-l.start,c=cl();for(let h=0;h<r.length;h++){const u=r[h],f=o[u],p=dl(f.startDate,d),m=a[u],g=(m==null?void 0:m.cues)||{};let y=(m==null?void 0:m.durationKnown)||!1,b=qn;const S=f.endDate;if(S)b=dl(S,d),y=!0;else if(f.endOnNext&&!y){const C=r.reduce((E,v)=>{if(v!==f.id){const T=o[v];if(T.class===f.class&&T.startDate>f.startDate&&(!E||f.startDate<E.startDate))return T}return E},null);C&&(b=dl(C.startDate,d),y=!0)}const _=Object.keys(f.attr);for(let C=0;C<_.length;C++){const E=_[C];if(!p6(E))continue;const v=g[E];if(v)y&&!m.durationKnown&&(v.endTime=b);else if(c){let T=f.attr[E];g6(E)&&(T=hB(T));const B=Mf(c,p,b,{key:E,data:T},Dt.dateRange);B&&(B.id=u,this.id3Track.addCue(B),g[E]=B)}}a[u]={cues:g,dateRange:f,durationKnown:y}}}}class mB{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=()=>this.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:a,targetduration:i}=e,{liveSyncDuration:o,liveSyncDurationCount:r,lowLatencyMode:l}=this.config,d=this.hls.userConfig;let c=l&&a||t;(d.liveSyncDuration||d.liveSyncDurationCount||c===0)&&(c=o!==void 0?o:r*i);const h=i;return c+Math.min(this.stallCount*1,h)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,a=this.levelDetails;if(e===null||t===null||a===null)return null;const i=a.edge,o=e-t-this.edgeStalled,r=i-a.totalduration,l=i-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(r,o),l)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const a=e.buffered.length;return(a?e.buffered.end(a-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(w.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(w.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(w.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(w.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(w.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(w.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var a;t.details===N.BUFFER_STALLED_ERROR&&(this.stallCount++,(a=this.levelDetails)!=null&&a.live&&A.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const a=this.computeLatency();if(a===null)return;this._latency=a;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:o}=this.config;if(!i||o===1||!t.live)return;const r=this.targetLatency;if(r===null)return;const l=a-r,d=Math.min(this.maxLatency,r+t.targetduration);if(l<d&&l>.05&&this.forwardBufferLength>1){const h=Math.min(2,Math.max(1,o)),u=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;e.playbackRate=Math.min(h,Math.max(1,u))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const hl=["NONE","TYPE-0","TYPE-1",null];function fB(s){return hl.indexOf(s)>-1}const Yn=["SDR","PQ","HLG"];function pB(s){return!!s&&Yn.indexOf(s)>-1}var Jn={No:"",Yes:"YES",v2:"v2"};function $f(s){const{canSkipUntil:e,canSkipDateRanges:t,age:a}=s,i=a<e/2;return e&&i?t?Jn.v2:Jn.Yes:Jn.No}class Vf{constructor(e,t,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=a}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class Vs{constructor(e){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(t=>!!t).map(t=>t.substring(0,4)).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return Uf(this._audioGroups,e)}hasSubtitleGroup(e){return Uf(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let a=this._audioGroups;a||(a=this._audioGroups=[]),a.indexOf(t)===-1&&a.push(t)}else if(e==="text"){let a=this._subtitleGroups;a||(a=this._subtitleGroups=[]),a.indexOf(t)===-1&&a.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function Uf(s,e){return!e||!s?!1:s.indexOf(e)!==-1}function ul(s,e){const t=e.startPTS;if(ne(t)){let a=0,i;e.sn>s.sn?(a=t-s.start,i=s):(a=s.start-t,i=e),i.duration!==a&&(i.duration=a)}else e.sn>s.sn?s.cc===e.cc&&s.minEndPTS?e.start=s.start+(s.minEndPTS-s.start):e.start=s.start+s.duration:e.start=Math.max(s.start-e.duration,0)}function zf(s,e,t,a,i,o){a-t<=0&&(A.warn("Fragment should have a positive duration",e),a=t+e.duration,o=i+e.duration);let l=t,d=a;const c=e.startPTS,h=e.endPTS;if(ne(c)){const y=Math.abs(c-t);ne(e.deltaPTS)?e.deltaPTS=Math.max(y,e.deltaPTS):e.deltaPTS=y,l=Math.max(t,c),t=Math.min(t,c),i=Math.min(i,e.startDTS),d=Math.min(a,h),a=Math.max(a,h),o=Math.max(o,e.endDTS)}const u=t-e.start;e.start!==0&&(e.start=t),e.duration=a-e.start,e.startPTS=t,e.maxStartPTS=l,e.startDTS=i,e.endPTS=a,e.minEndPTS=d,e.endDTS=o;const f=e.sn;if(!s||f<s.startSN||f>s.endSN)return 0;let p;const m=f-s.startSN,g=s.fragments;for(g[m]=e,p=m;p>0;p--)ul(g[p],g[p-1]);for(p=m;p<g.length-1;p++)ul(g[p],g[p+1]);return s.fragmentHint&&ul(g[g.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,u}function gB(s,e){let t=null;const a=s.fragments;for(let d=a.length-1;d>=0;d--){const c=a[d].initSegment;if(c){t=c;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;let i=0,o;if(SB(s,e,(d,c)=>{d.relurl&&(i=d.cc-c.cc),ne(d.startPTS)&&ne(d.endPTS)&&(c.start=c.startPTS=d.startPTS,c.startDTS=d.startDTS,c.maxStartPTS=d.maxStartPTS,c.endPTS=d.endPTS,c.endDTS=d.endDTS,c.minEndPTS=d.minEndPTS,c.duration=d.endPTS-d.startPTS,c.duration&&(o=c),e.PTSKnown=e.alignedSliding=!0),c.elementaryStreams=d.elementaryStreams,c.loader=d.loader,c.stats=d.stats,d.initSegment&&(c.initSegment=d.initSegment,t=d.initSegment)}),t&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(c=>{var h;c&&(!c.initSegment||c.initSegment.relurl===((h=t)==null?void 0:h.relurl))&&(c.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(d=>!d),e.deltaUpdateFailed){A.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let d=e.skippedSegments;d--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=yB(s.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const r=e.fragments;if(i){A.warn("discontinuity sliding from playlist, take drift into account");for(let d=0;d<r.length;d++)r[d].cc+=i}e.skippedSegments&&(e.startCC=e.fragments[0].cc),bB(s.partList,e.partList,(d,c)=>{c.elementaryStreams=d.elementaryStreams,c.stats=d.stats}),o?zf(e,o,o.startPTS,o.endPTS,o.startDTS,o.endDTS):Gf(s,e),r.length&&(e.totalduration=e.edge-r[0].start),e.driftStartTime=s.driftStartTime,e.driftStart=s.driftStart;const l=e.advancedDateTime;if(e.advanced&&l){const d=e.edge;e.driftStart||(e.driftStartTime=l,e.driftStart=d),e.driftEndTime=l,e.driftEnd=d}else e.driftEndTime=s.driftEndTime,e.driftEnd=s.driftEnd,e.advancedDateTime=s.advancedDateTime}function yB(s,e,t){const a=Ge({},s);return t&&t.forEach(i=>{delete a[i]}),Object.keys(e).forEach(i=>{const o=new tf(e[i].attr,a[i]);o.isValid?a[i]=o:A.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[i].attr)}"`)}),a}function bB(s,e,t){if(s&&e){let a=0;for(let i=0,o=s.length;i<=o;i++){const r=s[i],l=e[i+a];r&&l&&r.index===l.index&&r.fragment.sn===l.fragment.sn?t(r,l):a--}}}function SB(s,e,t){const a=e.skippedSegments,i=Math.max(s.startSN,e.startSN)-e.startSN,o=(s.fragmentHint?1:0)+(a?e.endSN:Math.min(s.endSN,e.endSN))-e.startSN,r=e.startSN-s.startSN,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,d=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;for(let c=i;c<=o;c++){const h=d[r+c];let u=l[c];a&&!u&&c<a&&(u=e.fragments[c]=h),h&&u&&t(h,u)}}function Gf(s,e){const t=e.startSN+e.skippedSegments-s.startSN,a=s.fragments;t<0||t>=a.length||ml(e,a[t].start)}function ml(s,e){if(e){const t=s.fragments;for(let a=s.skippedSegments;a<t.length;a++)t[a].start+=e;s.fragmentHint&&(s.fragmentHint.start+=e)}}function wB(s,e=1/0){let t=1e3*s.targetduration;if(s.updated){const a=s.fragments;if(a.length&&t*4>e){const o=a[a.length-1].duration*1e3;o<t&&(t=o)}}else t/=2;return Math.round(t)}function _B(s,e,t){if(!(s!=null&&s.details))return null;const a=s.details;let i=a.fragments[e-a.startSN];return i||(i=a.fragmentHint,i&&i.sn===e)?i:e<a.startSN&&t&&t.sn===e?t:null}function jf(s,e,t){var a;return s!=null&&s.details?Hf((a=s.details)==null?void 0:a.partList,e,t):null}function Hf(s,e,t){if(s)for(let a=s.length;a--;){const i=s[a];if(i.index===t&&i.fragment.sn===e)return i}return null}function Wf(s){s.forEach((e,t)=>{const{details:a}=e;a!=null&&a.fragments&&a.fragments.forEach(i=>{i.level=t})})}function Xn(s){switch(s.details){case N.FRAG_LOAD_TIMEOUT:case N.KEY_LOAD_TIMEOUT:case N.LEVEL_LOAD_TIMEOUT:case N.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Kf(s,e){const t=Xn(e);return s.default[`${t?"timeout":"error"}Retry`]}function fl(s,e){const t=s.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*s.retryDelayMs,s.maxRetryDelayMs)}function qf(s){return Xe(Xe({},s),{errorRetry:null,timeoutRetry:null})}function Zn(s,e,t,a){if(!s)return!1;const i=a==null?void 0:a.code,o=e<s.maxNumRetry&&(kB(i)||!!t);return s.shouldRetry?s.shouldRetry(s,e,t,a,o):o}function kB(s){return s===0&&navigator.onLine===!1||!!s&&(s<400||s>499)}const Yf={search:function(s,e){let t=0,a=s.length-1,i=null,o=null;for(;t<=a;){i=(t+a)/2|0,o=s[i];const r=e(o);if(r>0)t=i+1;else if(r<0)a=i-1;else return o}return null}};function EB(s,e,t){if(e===null||!Array.isArray(s)||!s.length||!ne(e))return null;const a=s[0].programDateTime;if(e<(a||0))return null;const i=s[s.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let o=0;o<s.length;++o){const r=s[o];if(CB(e,t,r))return r}return null}function Qn(s,e,t=0,a=0,i=.005){let o=null;if(s){o=e[s.sn-e[0].sn+1]||null;const l=s.endDTS-t;l>0&&l<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(o=e[0]);if(o&&((!s||s.level===o.level)&&pl(t,a,o)===0||TB(o,s,Math.min(i,a))))return o;const r=Yf.search(e,pl.bind(null,t,a));return r&&(r!==s||!o)?r:o}function TB(s,e,t){if(e&&e.start===0&&e.level<s.level&&(e.endPTS||0)>0){const a=e.tagList.reduce((i,o)=>(o[0]==="INF"&&(i+=parseFloat(o[1])),i),t);return s.start<=a}return!1}function pl(s=0,e=0,t){if(t.start<=s&&t.start+t.duration>s)return 0;const a=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-a<=s?1:t.start-a>s&&t.start?-1:0}function CB(s,e,t){const a=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-a>s}function xB(s,e){return Yf.search(s,t=>t.cc<e?1:t.cc>e?-1:0)}var nt={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Pt={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class vB{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=A.log.bind(A,"[info]:"),this.warn=A.warn.bind(A,"[warning]:"),this.error=A.error.bind(A,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(w.ERROR,this.onError,this),e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(w.ERROR,this.onError,this),e.off(w.ERROR,this.onErrorOut,this),e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===le.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var a,i;if(t.fatal)return;const o=this.hls,r=t.context;switch(t.details){case N.FRAG_LOAD_ERROR:case N.FRAG_LOAD_TIMEOUT:case N.KEY_LOAD_ERROR:case N.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case N.FRAG_PARSING_ERROR:if((a=t.frag)!=null&&a.gap){t.errorAction={action:nt.DoNothing,flags:Pt.None};return}case N.FRAG_GAP:case N.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=nt.SendAlternateToPenaltyBox;return}case N.LEVEL_EMPTY_ERROR:case N.LEVEL_PARSING_ERROR:{var l,d;const c=t.parent===le.MAIN?t.level:o.loadLevel;t.details===N.LEVEL_EMPTY_ERROR&&((l=t.context)!=null&&(d=l.levelDetails)!=null&&d.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c))}return;case N.LEVEL_LOAD_ERROR:case N.LEVEL_LOAD_TIMEOUT:typeof(r==null?void 0:r.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level));return;case N.AUDIO_TRACK_LOAD_ERROR:case N.AUDIO_TRACK_LOAD_TIMEOUT:case N.SUBTITLE_LOAD_ERROR:case N.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const c=o.levels[o.loadLevel];if(c&&(r.type===xe.AUDIO_TRACK&&c.hasAudioGroup(r.groupId)||r.type===xe.SUBTITLE_TRACK&&c.hasSubtitleGroup(r.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,o.loadLevel),t.errorAction.action=nt.SendAlternateToPenaltyBox,t.errorAction.flags=Pt.MoveAllAlternatesMatchingHost;return}}return;case N.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const c=o.levels[o.loadLevel],h=c==null?void 0:c.attrs["HDCP-LEVEL"];h?t.errorAction={action:nt.SendAlternateToPenaltyBox,flags:Pt.MoveAllAlternatesMatchingHDCP,hdcpLevel:h}:this.keySystemError(t)}return;case N.BUFFER_ADD_CODEC_ERROR:case N.REMUX_ALLOC_ERROR:case N.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(i=t.level)!=null?i:o.loadLevel);return;case N.INTERNAL_EXCEPTION:case N.BUFFER_APPENDING_ERROR:case N.BUFFER_FULL_ERROR:case N.LEVEL_SWITCH_ERROR:case N.BUFFER_STALLED_ERROR:case N.BUFFER_SEEK_OVER_HOLE:case N.BUFFER_NUDGE_ON_STALL:t.errorAction={action:nt.DoNothing,flags:Pt.None};return}t.type===fe.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const a=this.hls,i=Kf(a.config.playlistLoadPolicy,e),o=this.playlistError++;if(Zn(i,o,Xn(e),e.response))return{action:nt.RetryRequest,flags:Pt.None,retryConfig:i,retryCount:o};const l=this.getLevelSwitchAction(e,t);return i&&(l.retryConfig=i,l.retryCount=o),l}getFragRetryOrSwitchAction(e){const t=this.hls,a=this.getVariantLevelIndex(e.frag),i=t.levels[a],{fragLoadPolicy:o,keyLoadPolicy:r}=t.config,l=Kf(e.details.startsWith("key")?r:o,e),d=t.levels.reduce((h,u)=>h+u.fragmentError,0);if(i&&(e.details!==N.FRAG_GAP&&i.fragmentError++,Zn(l,d,Xn(e),e.response)))return{action:nt.RetryRequest,flags:Pt.None,retryConfig:l,retryCount:d};const c=this.getLevelSwitchAction(e,a);return l&&(c.retryConfig=l,c.retryCount=d),c}getLevelSwitchAction(e,t){const a=this.hls;t==null&&(t=a.loadLevel);const i=this.hls.levels[t];if(i){var o,r;const c=e.details;i.loadError++,c===N.BUFFER_APPEND_ERROR&&i.fragmentError++;let h=-1;const{levels:u,loadLevel:f,minAutoLevel:p,maxAutoLevel:m}=a;a.autoLevelEnabled||(a.loadLevel=-1);const g=(o=e.frag)==null?void 0:o.type,b=(g===le.AUDIO&&c===N.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(c===N.BUFFER_ADD_CODEC_ERROR||c===N.BUFFER_APPEND_ERROR))&&u.some(({audioCodec:v})=>i.audioCodec!==v),_=e.sourceBufferName==="video"&&(c===N.BUFFER_ADD_CODEC_ERROR||c===N.BUFFER_APPEND_ERROR)&&u.some(({codecSet:v,audioCodec:T})=>i.codecSet!==v&&i.audioCodec===T),{type:C,groupId:E}=(r=e.context)!=null?r:{};for(let v=u.length;v--;){const T=(v+f)%u.length;if(T!==f&&T>=p&&T<=m&&u[T].loadError===0){var l,d;const B=u[T];if(c===N.FRAG_GAP&&g===le.MAIN&&e.frag){const L=u[T].details;if(L){const R=Qn(e.frag,L.fragments,e.frag.start);if(R!=null&&R.gap)continue}}else{if(C===xe.AUDIO_TRACK&&B.hasAudioGroup(E)||C===xe.SUBTITLE_TRACK&&B.hasSubtitleGroup(E))continue;if(g===le.AUDIO&&(l=i.audioGroups)!=null&&l.some(L=>B.hasAudioGroup(L))||g===le.SUBTITLE&&(d=i.subtitleGroups)!=null&&d.some(L=>B.hasSubtitleGroup(L))||b&&i.audioCodec===B.audioCodec||!b&&i.audioCodec!==B.audioCodec||_&&i.codecSet===B.codecSet)continue}h=T;break}}if(h>-1&&a.loadLevel!==h)return e.levelRetry=!0,this.playlistError=0,{action:nt.SendAlternateToPenaltyBox,flags:Pt.None,nextAutoLevel:h}}return{action:nt.SendAlternateToPenaltyBox,flags:Pt.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var a;switch((a=t.errorAction)==null?void 0:a.action){case nt.DoNothing:break;case nt.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==N.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,a=e.errorAction;if(!a)return;const{flags:i,hdcpLevel:o,nextAutoLevel:r}=a;switch(i){case Pt.None:this.switchLevel(e,r);break;case Pt.MoveAllAlternatesMatchingHDCP:o&&(t.maxHdcpLevel=hl[hl.indexOf(o)-1],a.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}a.resolved||this.switchLevel(e,r)}switchLevel(e,t){t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}class gl{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=A.log.bind(A,`${t}:`),this.warn=A.warn.bind(A,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,a){const i=t==null?void 0:t.renditionReports;if(i){let o=-1;for(let r=0;r<i.length;r++){const l=i[r];let d;try{d=new self.URL(l.URI,t.url).href}catch(c){A.warn(`Could not construct new URL for Rendition Report: ${c}`),d=l.URI||""}if(d===e){o=r;break}else d===e.substring(0,d.length)&&(o=r)}if(o!==-1){const r=i[o],l=parseInt(r["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let d=parseInt(r["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const h=Math.min(t.age-t.partTarget,t.targetduration);d>=0&&h>t.partTarget&&(d+=1)}const c=a&&$f(a);return new Vf(l,d>=0?d:void 0,c)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,a){const{details:i,stats:o}=t,r=self.performance.now(),l=o.loading.first?Math.max(0,r-o.loading.first):0;if(i.advancedDateTime=Date.now()-l,i.live||a!=null&&a.live){if(i.reloaded(a),a&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),a&&i.fragments.length>0&&gB(a,i),!this.canLoad||!i.live)return;let d,c,h;if(i.canBlockReload&&i.endSN&&i.advanced){const y=this.hls.config.lowLatencyMode,b=i.lastPartSn,S=i.endSN,_=i.lastPartIndex,C=_!==-1,E=b===S,v=y?0:_;C?(c=E?S+1:b,h=E?v:_+1):c=S+1;const T=i.age,B=T+i.ageHeader;let L=Math.min(B-i.partTarget,i.targetduration*1.5);if(L>0){if(a&&L>a.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${a.tuneInGoal} to: ${L} with playlist age: ${i.age}`),L=0;else{const R=Math.floor(L/i.targetduration);if(c+=R,h!==void 0){const $=Math.round(L%i.targetduration/i.partTarget);h+=$}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${T.toFixed(2)}s goal: ${L} skip sn ${R} to part ${h}`)}i.tuneInGoal=L}if(d=this.getDeliveryDirectives(i,t.deliveryDirectives,c,h),y||!E){this.loadPlaylist(d);return}}else(i.canBlockReload||i.canSkipUntil)&&(d=this.getDeliveryDirectives(i,t.deliveryDirectives,c,h));const u=this.hls.mainForwardBufferInfo,f=u?u.end-u.len:0,p=(i.edge-f)*1e3,m=wB(i,p);i.updated&&r>this.requestScheduled+m&&(this.requestScheduled=o.loading.start),c!==void 0&&i.canBlockReload?this.requestScheduled=o.loading.first+m-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+m<r?this.requestScheduled=r:this.requestScheduled-r<=0&&(this.requestScheduled+=m);let g=this.requestScheduled-r;g=Math.max(0,g),this.log(`reload live playlist ${e} in ${Math.round(g)} ms`),this.timer=self.setTimeout(()=>this.loadPlaylist(d),g)}else this.clearTimer()}getDeliveryDirectives(e,t,a,i){let o=$f(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(a=t.msn,i=t.part,o=Jn.No),new Vf(a,i,o)}checkRetry(e){const t=e.details,a=Xn(e),i=e.errorAction,{action:o,retryCount:r=0,retryConfig:l}=i||{},d=!!i&&!!l&&(o===nt.RetryRequest||!i.resolved&&o===nt.SendAlternateToPenaltyBox);if(d){var c;if(this.requestScheduled=-1,r>=l.maxNumRetry)return!1;if(a&&(c=e.context)!=null&&c.deliveryDirectives)this.warn(`Retrying playlist loading ${r+1}/${l.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const h=fl(l,r);this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn(`Retrying playlist loading ${r+1}/${l.maxNumRetry} after "${t}" in ${h}ms`)}e.levelRetry=!0,i.resolved=!0}return d}}class Us{constructor(e,t=0,a=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=a}sample(e,t){const a=Math.pow(this.alpha_,e);this.estimate_=t*(1-a)+a*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class AB{constructor(e,t,a,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=a,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Us(e),this.fast_=new Us(t),this.defaultTTFB_=i,this.ttfb_=new Us(e)}update(e,t){const{slow_:a,fast_:i,ttfb_:o}=this;a.halfLife!==e&&(this.slow_=new Us(e,a.getEstimate(),a.getTotalWeight())),i.halfLife!==t&&(this.fast_=new Us(t,i.getEstimate(),i.getTotalWeight())),o.halfLife!==e&&(this.ttfb_=new Us(e,o.getEstimate(),o.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const a=8*t,i=e/1e3,o=a/i;this.fast_.sample(i,o),this.slow_.sample(i,o)}sampleTTFB(e){const t=e/1e3,a=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(a,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const Jf={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},Xf={};function LB(s,e,t,a,i,o){const r=s.audioCodec?s.audioGroups:null,l=o==null?void 0:o.audioCodec,d=o==null?void 0:o.channels,c=d?parseInt(d):l?1/0:2;let h=null;if(r!=null&&r.length)try{r.length===1&&r[0]?h=e.groups[r[0]].channels:h=r.reduce((u,f)=>{if(f){const p=e.groups[f];if(!p)throw new Error(`Audio track group ${f} not found`);Object.keys(p.channels).forEach(m=>{u[m]=(u[m]||0)+p.channels[m]})}return u},{2:0})}catch{return!0}return s.videoCodec!==void 0&&(s.width>1920&&s.height>1088||s.height>1920&&s.width>1088||s.frameRate>Math.max(a,30)||s.videoRange!=="SDR"&&s.videoRange!==t||s.bitrate>Math.max(i,8e6))||!!h&&ne(c)&&Object.keys(h).some(u=>parseInt(u)>c)}function IB(s,e,t){const a=s.videoCodec,i=s.audioCodec;if(!a||!i||!t)return Promise.resolve(Jf);const o={width:s.width,height:s.height,bitrate:Math.ceil(Math.max(s.bitrate*.9,s.averageBitrate)),framerate:s.frameRate||30},r=s.videoRange;r!=="SDR"&&(o.transferFunction=r.toLowerCase());const l=a.split(",").map(d=>({type:"media-source",video:Xe(Xe({},o),{},{contentType:Ta(d,"video")})}));return i&&s.audioGroups&&s.audioGroups.forEach(d=>{var c;d&&((c=e.groups[d])==null||c.tracks.forEach(h=>{if(h.groupId===d){const u=h.channels||"",f=parseFloat(u);ne(f)&&f>2&&l.push.apply(l,i.split(",").map(p=>({type:"media-source",audio:{contentType:Ta(p,"audio"),channels:""+f}})))}}))}),Promise.all(l.map(d=>{const c=RB(d);return Xf[c]||(Xf[c]=t.decodingInfo(d))})).then(d=>({supported:!d.some(c=>!c.supported),configurations:l,decodingInfoResults:d})).catch(d=>({supported:!1,configurations:l,decodingInfoResults:[],error:d}))}function RB(s){const{audio:e,video:t}=s,a=t||e;if(a){const i=a.contentType.split('"')[1];if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}function BB(){if(typeof matchMedia=="function"){const s=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(s.media!==e.media)return s.matches===!0}return!1}function NB(s,e){let t=!1,a=[];return s&&(t=s!=="SDR",a=[s]),e&&(a=e.allowedVideoRanges||Yn.slice(0),t=e.preferHDR!==void 0?e.preferHDR:BB(),t?a=a.filter(i=>i!=="SDR"):a=["SDR"]),{preferHDR:t,allowedVideoRanges:a}}function DB(s,e,t,a,i){const o=Object.keys(s),r=a==null?void 0:a.channels,l=a==null?void 0:a.audioCodec,d=r&&parseInt(r)===2;let c=!0,h=!1,u=1/0,f=1/0,p=1/0,m=0,g=[];const{preferHDR:y,allowedVideoRanges:b}=NB(e,i);for(let E=o.length;E--;){const v=s[o[E]];c=v.channels[2]>0,u=Math.min(u,v.minHeight),f=Math.min(f,v.minFramerate),p=Math.min(p,v.minBitrate);const T=b.filter(B=>v.videoRanges[B]>0);T.length>0&&(h=!0,g=T)}u=ne(u)?u:0,f=ne(f)?f:0;const S=Math.max(1080,u),_=Math.max(30,f);return p=ne(p)?p:t,t=Math.max(p,t),h||(e=void 0,g=[]),{codecSet:o.reduce((E,v)=>{const T=s[v];if(v===E)return E;if(T.minBitrate>t)return Xt(v,`min bitrate of ${T.minBitrate} > current estimate of ${t}`),E;if(!T.hasDefaultAudio)return Xt(v,"no renditions with default or auto-select sound found"),E;if(l&&v.indexOf(l.substring(0,4))%5!==0)return Xt(v,`audio codec preference "${l}" not found`),E;if(r&&!d){if(!T.channels[r])return Xt(v,`no renditions with ${r} channel sound found (channels options: ${Object.keys(T.channels)})`),E}else if((!l||d)&&c&&T.channels[2]===0)return Xt(v,"no renditions with stereo sound found"),E;return T.minHeight>S?(Xt(v,`min resolution of ${T.minHeight} > maximum of ${S}`),E):T.minFramerate>_?(Xt(v,`min framerate of ${T.minFramerate} > maximum of ${_}`),E):g.some(B=>T.videoRanges[B]>0)?T.maxScore<m?(Xt(v,`max score of ${T.maxScore} < selected max of ${m}`),E):E&&(Hn(v)>=Hn(E)||T.fragmentError>s[E].fragmentError)?E:(m=T.maxScore,v):(Xt(v,`no variants with VIDEO-RANGE of ${JSON.stringify(g)} found`),E)},void 0),videoRanges:g,preferHDR:y,minFramerate:f,minBitrate:p}}function Xt(s,e){A.log(`[abr] start candidates with "${s}" ignored because ${e}`)}function PB(s){return s.reduce((e,t)=>{let a=e.groups[t.groupId];a||(a=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),a.tracks.push(t);const i=t.channels||"2";return a.channels[i]=(a.channels[i]||0)+1,a.hasDefault=a.hasDefault||t.default,a.hasAutoSelect=a.hasAutoSelect||t.autoselect,a.hasDefault&&(e.hasDefaultAudio=!0),a.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function OB(s,e,t,a){return s.slice(t,a+1).reduce((i,o)=>{if(!o.codecSet)return i;const r=o.audioGroups;let l=i[o.codecSet];l||(i[o.codecSet]=l={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!r,fragmentError:0}),l.minBitrate=Math.min(l.minBitrate,o.bitrate);const d=Math.min(o.height,o.width);return l.minHeight=Math.min(l.minHeight,d),l.minFramerate=Math.min(l.minFramerate,o.frameRate),l.maxScore=Math.max(l.maxScore,o.score),l.fragmentError+=o.fragmentError,l.videoRanges[o.videoRange]=(l.videoRanges[o.videoRange]||0)+1,r&&r.forEach(c=>{if(!c)return;const h=e.groups[c];h&&(l.hasDefaultAudio=l.hasDefaultAudio||e.hasDefaultAudio?h.hasDefault:h.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(h.channels).forEach(u=>{l.channels[u]=(l.channels[u]||0)+h.channels[u]}))}),i},{})}function Ht(s,e,t){if("attrs"in s){const a=e.indexOf(s);if(a!==-1)return a}for(let a=0;a<e.length;a++){const i=e[a];if(zs(s,i,t))return a}return-1}function zs(s,e,t){const{groupId:a,name:i,lang:o,assocLang:r,characteristics:l,default:d}=s,c=s.forced;return(a===void 0||e.groupId===a)&&(i===void 0||e.name===i)&&(o===void 0||e.lang===o)&&(o===void 0||e.assocLang===r)&&(d===void 0||e.default===d)&&(c===void 0||e.forced===c)&&(l===void 0||FB(l,e.characteristics))&&(t===void 0||t(s,e))}function FB(s,e=""){const t=s.split(","),a=e.split(",");return t.length===a.length&&!t.some(i=>a.indexOf(i)===-1)}function Gs(s,e){const{audioCodec:t,channels:a}=s;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(a===void 0||a===(e.channels||"2"))}function MB(s,e,t,a,i){const o=e[a],l=e.reduce((f,p,m)=>{const g=p.uri;return(f[g]||(f[g]=[])).push(m),f},{})[o.uri];l.length>1&&(a=Math.max.apply(Math,l));const d=o.videoRange,c=o.frameRate,h=o.codecSet.substring(0,4),u=Zf(e,a,f=>{if(f.videoRange!==d||f.frameRate!==c||f.codecSet.substring(0,4)!==h)return!1;const p=f.audioGroups,m=t.filter(g=>!p||p.indexOf(g.groupId)!==-1);return Ht(s,m,i)>-1});return u>-1?u:Zf(e,a,f=>{const p=f.audioGroups,m=t.filter(g=>!p||p.indexOf(g.groupId)!==-1);return Ht(s,m,i)>-1})}function Zf(s,e,t){for(let a=e;a;a--)if(t(s[a]))return a;for(let a=e+1;a<s.length;a++)if(t(s[a]))return a;return-1}class $B{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this._abandonRulesCheck=()=>{const{fragCurrent:t,partCurrent:a,hls:i}=this,{autoLevelEnabled:o,media:r}=i;if(!t||!r)return;const l=performance.now(),d=a?a.stats:t.stats,c=a?a.duration:t.duration,h=l-d.loading.start,u=i.minAutoLevel;if(d.aborted||d.loaded&&d.loaded===d.total||t.level<=u){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o||r.paused||!r.playbackRate||!r.readyState)return;const f=i.mainForwardBufferInfo;if(f===null)return;const p=this.bwEstimator.getEstimateTTFB(),m=Math.abs(r.playbackRate);if(h<=Math.max(p,1e3*(c/(m*2))))return;const g=f.len/m,y=d.loading.first?d.loading.first-d.loading.start:-1,b=d.loaded&&y>-1,S=this.getBwEstimate(),_=i.levels,C=_[t.level],E=d.total||Math.max(d.loaded,Math.round(c*C.averageBitrate/8));let v=b?h-y:h;v<1&&b&&(v=Math.min(h,d.loaded*8/S));const T=b?d.loaded*1e3/v:0,B=T?(E-d.loaded)/T:E*8/S+p/1e3;if(B<=g)return;const L=T?T*8:S;let R=Number.POSITIVE_INFINITY,$;for($=t.level-1;$>u;$--){const z=_[$].maxBitrate;if(R=this.getTimeToLoadFrag(p/1e3,L,c*z,!_[$].details),R<g)break}if(R>=B||R>c*10)return;i.nextLoadLevel=i.nextAutoLevel=$,b?this.bwEstimator.sample(h-Math.min(p,y),d.loaded):this.bwEstimator.sampleTTFB(h);const K=_[$].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>K&&this.resetEstimator(K),this.clearTimer(),A.warn(`[abr] Fragment ${t.sn}${a?" part "+a.index:""} of level ${t.level} is loading too slowly;
|
|
43
43
|
Time to underbuffer: ${g.toFixed(3)} s
|
|
44
44
|
Estimated load time for current fragment: ${B.toFixed(3)} s
|
|
45
45
|
Estimated load time for down switch fragment: ${R.toFixed(3)} s
|
|
@@ -64,4 +64,4 @@
|
|
|
64
64
|
`),c=[],h=e?xN(e.baseTime,e.timescale):0;let u="00:00.000",f=0,p=0,m,g=!0;l.oncue=function(y){const b=t[a];let S=t.ccOffset;const _=(f-h)/9e4;if(b!=null&&b.new&&(p!==void 0?S=t.ccOffset=b.start:lD(t,a,_)),_){if(!e){m=new Error("Missing initPTS for VTT MPEGTS");return}S=_-t.presentationOffset}const C=y.endTime-y.startTime,E=wt((y.startTime+S-p)*9e4,i*9e4)/9e4;y.startTime=Math.max(E,0),y.endTime=Math.max(E+C,0);const v=y.text.trim();y.text=decodeURIComponent(encodeURIComponent(v)),y.id||(y.id=Pl(y.startTime,y.endTime,v)),y.endTime>0&&c.push(y)},l.onparsingerror=function(y){m=y},l.onflush=function(){if(m){r(m);return}o(c)},d.forEach(y=>{if(g)if(Nl(y,"X-TIMESTAMP-MAP=")){g=!1,y.slice(16).split(",").forEach(b=>{Nl(b,"LOCAL:")?u=b.slice(6):Nl(b,"MPEGTS:")&&(f=parseInt(b.slice(7)))});try{p=rD(u)/1e3}catch(b){m=b}return}else y===""&&(g=!1);l.parse(y+`
|
|
65
65
|
`)}),l.flush()}const Ol="stpp.ttml.im1t",$p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Vp=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,dD={left:"start",center:"center",right:"end",start:"start",end:"end"};function Up(s,e,t,a){const i=ye(new Uint8Array(s),["mdat"]);if(i.length===0){a(new Error("Could not parse IMSC1 mdat"));return}const o=i.map(l=>Ut(l)),r=CN(e.baseTime,1,e.timescale);try{o.forEach(l=>t(hD(l,r)))}catch(l){a(l)}}function hD(s,e){const i=new DOMParser().parseFromString(s,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const o={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},r=Object.keys(o).reduce((u,f)=>(u[f]=i.getAttribute(`ttp:${f}`)||o[f],u),{}),l=i.getAttribute("xml:space")!=="preserve",d=zp(Fl(i,"styling","style")),c=zp(Fl(i,"layout","region")),h=Fl(i,"body","[begin]");return[].map.call(h,u=>{const f=Gp(u,l);if(!f||!u.hasAttribute("begin"))return null;const p=$l(u.getAttribute("begin"),r),m=$l(u.getAttribute("dur"),r);let g=$l(u.getAttribute("end"),r);if(p===null)throw jp(u);if(g===null){if(m===null)throw jp(u);g=p+m}const y=new Rl(p-e,g-e,f);y.id=Pl(y.startTime,y.endTime,y.text);const b=c[u.getAttribute("region")],S=d[u.getAttribute("style")],_=uD(b,S,d),{textAlign:C}=_;if(C){const E=dD[C];E&&(y.lineAlign=E),y.align=C}return Ge(y,_),y}).filter(u=>u!==null)}function Fl(s,e,t){const a=s.getElementsByTagName(e)[0];return a?[].slice.call(a.querySelectorAll(t)):[]}function zp(s){return s.reduce((e,t)=>{const a=t.getAttribute("xml:id");return a&&(e[a]=t),e},{})}function Gp(s,e){return[].slice.call(s.childNodes).reduce((t,a,i)=>{var o;return a.nodeName==="br"&&i?t+`
|
|
66
66
|
`:(o=a.childNodes)!=null&&o.length?Gp(a,e):e?t+a.textContent.trim().replace(/\s+/g," "):t+a.textContent},"")}function uD(s,e,t){const a="http://www.w3.org/ns/ttml#styling";let i=null;const o=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],r=s!=null&&s.hasAttribute("style")?s.getAttribute("style"):null;return r&&t.hasOwnProperty(r)&&(i=t[r]),o.reduce((l,d)=>{const c=Ml(e,a,d)||Ml(s,a,d)||Ml(i,a,d);return c&&(l[d]=c),l},{})}function Ml(s,e,t){return s&&s.hasAttributeNS(e,t)?s.getAttributeNS(e,t):null}function jp(s){return new Error(`Could not parse ttml timestamp ${s}`)}function $l(s,e){if(!s)return null;let t=Op(s);return t===null&&($p.test(s)?t=mD(s,e):Vp.test(s)&&(t=fD(s,e))),t}function mD(s,e){const t=$p.exec(s),a=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+a/e.frameRate}function fD(s,e){const t=Vp.exec(s),a=Number(t[1]);switch(t[2]){case"h":return a*3600;case"m":return a*60;case"ms":return a*1e3;case"f":return a/e.frameRate;case"t":return a/e.tickRate}return a}class pD{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Kp(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(w.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(w.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(w.FRAG_LOADING,this.onFragLoading,this),e.on(w.FRAG_LOADED,this.onFragLoaded,this),e.on(w.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(w.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(w.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(w.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(w.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(w.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(w.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(w.FRAG_LOADING,this.onFragLoading,this),e.off(w.FRAG_LOADED,this.onFragLoaded,this),e.off(w.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(w.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(w.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(w.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(w.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new hi(this,"textTrack1"),t=new hi(this,"textTrack2"),a=new hi(this,"textTrack3"),i=new hi(this,"textTrack4");this.cea608Parser1=new Pp(1,e,t),this.cea608Parser2=new Pp(3,a,i)}}addCues(e,t,a,i,o){let r=!1;for(let l=o.length;l--;){const d=o[l],c=gD(d[0],d[1],t,a);if(c>=0&&(d[0]=Math.min(d[0],t),d[1]=Math.max(d[1],a),r=!0,c/(a-t)>.5))return}if(r||o.push([t,a]),this.config.renderTextTracksNatively){const l=this.captionsTracks[e];this.Cues.newCue(l,t,a,i)}else{const l=this.Cues.newCue(null,t,a,i);this.hls.trigger(w.CUES_PARSED,{type:"captions",cues:l,track:e})}}onInitPtsFound(e,{frag:t,id:a,initPTS:i,timescale:o}){const{unparsedVttFrags:r}=this;a==="main"&&(this.initPTS[t.cc]={baseTime:i,timescale:o}),r.length&&(this.unparsedVttFrags=[],r.forEach(l=>{this.onFragLoaded(w.FRAG_LOADED,l)}))}getExistingTrack(e,t){const{media:a}=this;if(a)for(let i=0;i<a.textTracks.length;i++){const o=a.textTracks[i];if(Wp(o,{name:e,lang:t,attrs:{}}))return o}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:a,media:i}=this,{label:o,languageCode:r}=t[e],l=this.getExistingTrack(o,r);if(l)a[e]=l,$s(a[e]),Of(a[e],i);else{const d=this.createTextTrack("captions",o,r);d&&(d[e]=!0,a[e]=d)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const a=t.label,i={_id:e,label:a,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(w.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(e,t,a){const i=this.media;if(i)return i.addTextTrack(e,t,a)}onMediaAttaching(e,t){this.media=t.media,this._cleanTracks()}onMediaDetaching(){const{captionsTracks:e}=this;Object.keys(e).forEach(t=>{$s(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Kp(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let a=0;a<t.length;a++)$s(t[a])}onSubtitleTracksUpdated(e,t){const a=t.subtitleTracks||[],i=a.some(o=>o.textCodec===Ol);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(vp(this.tracks,a)){this.tracks=a;return}if(this.textTracks=[],this.tracks=a,this.config.renderTextTracksNatively){const r=this.media,l=r?Kn(r.textTracks):null;if(this.tracks.forEach((d,c)=>{let h;if(l){let u=null;for(let f=0;f<l.length;f++)if(l[f]&&Wp(l[f],d)){u=l[f],l[f]=null;break}u&&(h=u)}if(h)$s(h);else{const u=Hp(d);h=this.createTextTrack(u,d.name,d.lang),h&&(h.mode="disabled")}h&&this.textTracks.push(h)}),l!=null&&l.length){const d=l.filter(c=>c!==null).map(c=>c.label);d.length&&A.warn(`Media element contains unused subtitle tracks: ${d.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const r=this.tracks.map(l=>({label:l.name,kind:l.type.toLowerCase(),default:l.default,subtitleTrack:l}));this.hls.trigger(w.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:r})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(a=>{const i=/(?:CC|SERVICE)([1-4])/.exec(a.instreamId);if(!i)return;const o=`textTrack${i[1]}`,r=this.captionsProperties[o];r&&(r.label=a.name,a.lang&&(r.languageCode=a.lang),r.media=a)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===le.MAIN){var a,i;const{cea608Parser1:o,cea608Parser2:r,lastSn:l}=this,{cc:d,sn:c}=t.frag,h=(a=(i=t.part)==null?void 0:i.index)!=null?a:-1;o&&r&&(c!==l+1||c===l&&h!==this.lastPartIndex+1||d!==this.lastCc)&&(o.reset(),r.reset()),this.lastCc=d,this.lastSn=c,this.lastPartIndex=h}}onFragLoaded(e,t){const{frag:a,payload:i}=t;if(a.type===le.SUBTITLE)if(i.byteLength){const o=a.decryptdata,r="stats"in t;if(o==null||!o.encrypted||r){const l=this.tracks[a.level],d=this.vttCCs;d[a.cc]||(d[a.cc]={start:a.start,prevCC:this.prevCC,new:!0},this.prevCC=a.cc),l&&l.textCodec===Ol?this._parseIMSC1(a,i):this._parseVTTs(t)}}else this.hls.trigger(w.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const a=this.hls;Up(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),a.trigger(w.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{A.log(`Failed to parse IMSC1: ${i}`),a.trigger(w.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:a,payload:i}=e,{initPTS:o,unparsedVttFrags:r}=this,l=o.length-1;if(!o[a.cc]&&l===-1){r.push(e);return}const d=this.hls,c=(t=a.initSegment)!=null&&t.data?St(a.initSegment.data,new Uint8Array(i)):i;cD(c,this.initPTS[a.cc],this.vttCCs,a.cc,a.start,h=>{this._appendCues(h,a.level),d.trigger(w.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},h=>{const u=h.message==="Missing initPTS for VTT MPEGTS";u?r.push(e):this._fallbackToIMSC1(a,i),A.log(`Failed to parse VTT cue: ${h}`),!(u&&l>a.cc)&&d.trigger(w.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:h})})}_fallbackToIMSC1(e,t){const a=this.tracks[e.level];a.textCodec||Up(t,this.initPTS[e.cc],()=>{a.textCodec=Ol,this._parseIMSC1(e,t)},()=>{a.textCodec="wvtt"})}_appendCues(e,t){const a=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(o=>Ff(i,o))}else{const i=this.tracks[t];if(!i)return;const o=i.default?"default":"subtitles"+t;a.trigger(w.CUES_PARSED,{type:"subtitles",cues:e,track:o})}}onFragDecrypted(e,t){const{frag:a}=t;a.type===le.SUBTITLE&&this.onFragLoaded(w.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:a,cea608Parser2:i}=this;if(!this.enabled||!a||!i)return;const{frag:o,samples:r}=t;if(!(o.type===le.MAIN&&this.closedCaptionsForLevel(o)==="NONE"))for(let l=0;l<r.length;l++){const d=r[l].bytes;if(d){const c=this.extractCea608Data(d);a.addData(r[l].pts,c[0]),i.addData(r[l].pts,c[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:a,endOffsetSubtitles:i,type:o}){const{media:r}=this;if(!(!r||r.currentTime<a)){if(!o||o==="video"){const{captionsTracks:l}=this;Object.keys(l).forEach(d=>ll(l[d],t,a))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:l}=this;Object.keys(l).forEach(d=>ll(l[d],t,i))}}}extractCea608Data(e){const t=[[],[]],a=e[0]&31;let i=2;for(let o=0;o<a;o++){const r=e[i++],l=127&e[i++],d=127&e[i++];if(l===0&&d===0)continue;if((4&r)!==0){const h=3&r;(h===0||h===1)&&(t[h].push(l),t[h].push(d))}}return t}}function Hp(s){return s.characteristics&&/transcribes-spoken-dialog/gi.test(s.characteristics)&&/describes-music-and-sound/gi.test(s.characteristics)?"captions":"subtitles"}function Wp(s,e){return!!s&&s.kind===Hp(e)&&Ll(e,s)}function gD(s,e,t,a){return Math.min(e,a)-Math.max(s,t)}function Kp(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}class Vl{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(w.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(w.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(w.MANIFEST_PARSED,this.onManifestParsed,this),e.on(w.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(w.BUFFER_CODECS,this.onBufferCodecs,this),e.on(w.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(w.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(w.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(w.MANIFEST_PARSED,this.onManifestParsed,this),e.off(w.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(w.BUFFER_CODECS,this.onBufferCodecs,this),e.off(w.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const a=this.hls.levels[t.droppedLevel];this.isLevelAllowed(a)&&this.restrictedLevels.push({bitrate:a.bitrate,height:a.height,width:a.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const a=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,a.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&ne(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,a=this.getMaxLevel(e.length-1);a!==this.autoLevelCapping&&A.log(`Setting autoLevelCapping to ${a}: ${e[a].height}p@${e[a].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=a,t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const a=t.filter((i,o)=>this.isLevelAllowed(i)&&o<=e);return this.clientRect=null,Vl.getMaxLevelByMediaSize(a,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const a=e.getBoundingClientRect();t.width=a.width,t.height=a.height,!t.width&&!t.height&&(t.width=a.right-a.left||e.width||0,t.height=a.bottom-a.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return e}isLevelAllowed(e){return!this.restrictedLevels.some(a=>e.bitrate===a.bitrate&&e.width===a.width&&e.height===a.height)}static getMaxLevelByMediaSize(e,t,a){if(!(e!=null&&e.length))return-1;const i=(l,d)=>d?l.width!==d.width||l.height!==d.height:!0;let o=e.length-1;const r=Math.max(t,a);for(let l=0;l<e.length;l+=1){const d=e[l];if((d.width>=r||d.height>=r)&&i(d,e[l+1])){o=l;break}}return o}}class yD{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(w.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(w.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const a=this.hls.config;if(a.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),a.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,a){const i=performance.now();if(t){if(this.lastTime){const o=i-this.lastTime,r=a-this.lastDroppedFrames,l=t-this.lastDecodedFrames,d=1e3*r/o,c=this.hls;if(c.trigger(w.FPS_DROP,{currentDropped:r,currentDecoded:l,totalDroppedFrames:a}),d>0&&r>c.config.fpsDroppedMonitoringThreshold*l){let h=c.currentLevel;A.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(c.autoLevelCapping===-1||c.autoLevelCapping>=h)&&(h=h-1,c.trigger(w.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:c.currentLevel}),c.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=a,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const mi="[eme]";class qs{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=qs.CDMCleanupPromise?[qs.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=A.debug.bind(A,mi),this.log=A.log.bind(A,mi),this.warn=A.warn.bind(A,mi),this.error=A.error.bind(A,mi),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(w.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(w.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(w.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(w.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(w.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(w.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:a}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===Ne.WIDEVINE&&a)return a;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,a=t[e];if(a)return a.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,a=(r,l,d)=>!!r&&d.indexOf(r)===l,i=t.map(r=>r.audioCodec).filter(a),o=t.map(r=>r.videoCodec).filter(a);return i.length+o.length===0&&o.push("avc1.42e01e"),new Promise((r,l)=>{const d=c=>{const h=c.shift();this.getMediaKeysPromise(h,i,o).then(u=>r({keySystem:h,mediaKeys:u})).catch(u=>{c.length?d(c):u instanceof _t?l(u):l(new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_NO_ACCESS,error:u,fatal:!0},u.message))})};d(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:a}=this.config;if(typeof a!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${a}`;return rf===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return a(e,t)}getMediaKeysPromise(e,t,a){const i=E6(e,t,a,this.config.drmSystemOptions),o=this.keySystemAccessPromises[e];let r=o==null?void 0:o.keySystemAccess;if(!r){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(i)}`),r=this.requestMediaKeySystemAccess(e,i);const l=this.keySystemAccessPromises[e]={keySystemAccess:r};return r.catch(d=>{this.log(`Failed to obtain access to key-system "${e}": ${d}`)}),r.then(d=>{this.log(`Access for key-system "${d.keySystem}" obtained`);const c=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),l.mediaKeys=d.createMediaKeys().then(h=>(this.log(`Media-keys created for "${e}"`),c.then(u=>u?this.setMediaKeysServerCertificate(h,e,u):h))),l.mediaKeys.catch(h=>{this.error(`Failed to create media-keys for "${e}"}: ${h}`)}),l.mediaKeys})}return r.then(()=>o.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:a}){this.log(`Creating key-system session "${t}" keyId: ${zt.hexDump(e.keyId||[])}`);const i=a.createSession(),o={decryptdata:e,keySystem:t,mediaKeys:a,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(o),o}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const a=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),o="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(a,o,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return zt.hexDump(e.keyId)}updateKeySession(e,t){var a;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${zt.hexDump(((a=e.decryptdata)==null?void 0:a.keyId)||[])}
|
|
67
|
-
} (data length: ${t&&t.byteLength})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,a)=>{const i=Zr(this.config),o=e.map(af).filter(r=>!!r&&i.indexOf(r)!==-1);return this.getKeySystemSelectionPromise(o).then(({keySystem:r})=>{const l=of(r);l?t(l):a(new Error(`Unable to find format for key-system "${r}"`))}).catch(a)})}loadKey(e){const t=e.keyInfo.decryptdata,a=this.getKeyIdString(t),i=`(keyId: ${a} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let o=this.keyIdToKeySessionPromise[a];return o||(o=this.keyIdToKeySessionPromise[a]=this.getKeySystemForKeyPromise(t).then(({keySystem:r,mediaKeys:l})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(r,l).then(()=>{this.throwIfDestroyed();const d=this.createMediaKeySessionContext({keySystem:r,mediaKeys:l,decryptdata:t});return this.generateRequestWithPreferredKeySession(d,"cenc",t.pssh,"playlist-key")}))),o.catch(r=>this.handleError(r))),o}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof _t?this.hls.trigger(w.ERROR,e.data):this.hls.trigger(w.ERROR,{type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),a=this.keyIdToKeySessionPromise[t];if(!a){const i=af(e.keyFormat),o=i?[i]:Zr(this.config);return this.attemptKeySystemAccess(o)}return a}getKeySystemSelectionPromise(e){if(e.length||(e=Zr(this.config)),e.length===0)throw new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:a}=e,i=`"${e.type}" event: init data type: "${t}"`;if(this.debug(i),a===null)return;let o,r;if(t==="sinf"&&this.config.drmSystems[Ne.FAIRPLAY]){const u=Ke(new Uint8Array(a));try{const f=Jr(JSON.parse(u).sinf),p=gf(new Uint8Array(f));if(!p)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");o=p.subarray(8,24),r=Ne.FAIRPLAY}catch(f){this.warn(`${i} Failed to parse sinf: ${f}`);return}}else{const u=q6(a),f=u.filter(p=>p.systemId===_a.WIDEVINE)[0];if(!f){u.length===0||u.some(p=>!p.systemId)?this.warn(`${i} contains incomplete or invalid pssh data`):this.log(`ignoring ${i} for ${u.map(p=>nf(p.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(r=nf(f.systemId),f.version===0&&f.data){const p=f.data.length-22;o=f.data.subarray(p,p+16)}}if(!r||!o)return;const l=zt.hexDump(o),{keyIdToKeySessionPromise:d,mediaKeySessions:c}=this;let h=d[l];for(let u=0;u<c.length;u++){const f=c[u],p=f.decryptdata;if(!p.keyId)continue;const m=zt.hexDump(p.keyId);if(l===m||p.uri.replace(/-/g,"").indexOf(l)!==-1){if(h=d[m],p.pssh)break;delete d[m],p.pssh=new Uint8Array(a),p.keyId=o,h=d[l]=h.then(()=>this.generateRequestWithPreferredKeySession(f,t,a,"encrypted-event-key-match"));break}}h||(h=d[l]=this.getKeySystemSelectionPromise([r]).then(({keySystem:u,mediaKeys:f})=>{var p;this.throwIfDestroyed();const m=new Ea("ISO-23001-7",l,(p=of(u))!=null?p:"");return m.pssh=new Uint8Array(a),m.keyId=o,this.attemptSetMediaKeys(u,f).then(()=>{this.throwIfDestroyed();const g=this.createMediaKeySessionContext({decryptdata:m,keySystem:u,mediaKeys:f});return this.generateRequestWithPreferredKeySession(g,t,a,"encrypted-event-no-match")})})),h.catch(u=>this.handleError(u))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const a=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(a).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),a.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(o=>a.indexOf(o)===-1)})}generateRequestWithPreferredKeySession(e,t,a,i){var o,r;const l=(o=this.config.drmSystems)==null||(r=o[e.keySystem])==null?void 0:r.generateRequest;if(l)try{const m=l.call(this.hls,t,a,e);if(!m)throw new Error("Invalid response from configured generateRequest filter");t=m.initDataType,a=e.decryptdata.pssh=m.initData?new Uint8Array(m.initData):null}catch(m){var d;if(this.warn(m.message),(d=this.hls)!=null&&d.config.debug)throw m}if(a===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const c=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${c} (init data type: ${t} length: ${a?a.byteLength:null})`);const h=new Al,u=e._onmessage=m=>{const g=e.mediaKeysSession;if(!g){h.emit("error",new Error("invalid state"));return}const{messageType:y,message:b}=m;this.log(`"${y}" message event for session "${g.sessionId}" message size: ${b.byteLength}`),y==="license-request"||y==="license-renewal"?this.renewLicense(e,b).catch(S=>{this.handleError(S),h.emit("error",S)}):y==="license-release"?e.keySystem===Ne.FAIRPLAY&&(this.updateKeySession(e,Xr("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${y}"`)},f=e._onkeystatuseschange=m=>{if(!e.mediaKeysSession){h.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const y=e.keyStatus;h.emit("keyStatus",y),y==="expired"&&(this.warn(`${e.keySystem} expired for key ${c}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",u),e.mediaKeysSession.addEventListener("keystatuseschange",f);const p=new Promise((m,g)=>{h.on("error",g),h.on("keyStatus",y=>{y.startsWith("usable")?m():y==="output-restricted"?g(new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):y==="internal-error"?g(new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${y}"`)):y==="expired"?g(new Error("key expired while generating request")):this.warn(`unhandled key status change "${y}"`)})});return e.mediaKeysSession.generateRequest(t,a).then(()=>{var m;this.log(`Request generated for key-session "${(m=e.mediaKeysSession)==null?void 0:m.sessionId}" keyId: ${c}`)}).catch(m=>{throw new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_NO_SESSION,error:m,fatal:!1},`Error generating key-session request: ${m}`)}).then(()=>p).catch(m=>{throw h.removeAllListeners(),this.removeSession(e),m}).then(()=>(h.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,a)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${zt.hexDump("buffer"in a?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a))} session keyId: ${zt.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,a=t.loader,i=new a(t),o=this.getServerCertificateUrl(e);return o?(this.log(`Fetching server certificate for "${e}"`),new Promise((r,l)=>{const d={responseType:"arraybuffer",url:o},c=t.certLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(f,p,m,g)=>{r(f.data)},onError:(f,p,m,g)=>{l(new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:m,response:Xe({url:d.url,data:void 0},f)},`"${e}" certificate request failed (${o}). Status: ${f.code} (${f.text})`))},onTimeout:(f,p,m)=>{l(new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:m,response:{url:d.url,data:void 0}},`"${e}" certificate request timed out (${o})`))},onAbort:(f,p,m)=>{l(new Error("aborted"))}};i.load(d,h,u)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,a){return new Promise((i,o)=>{e.setServerCertificate(a).then(r=>{this.log(`setServerCertificate ${r?"success":"not supported by CDM"} (${a==null?void 0:a.byteLength}) on "${t}"`),i(e)}).catch(r=>{o(new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:r,fatal:!0},r.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(a=>this.updateKeySession(e,new Uint8Array(a)).catch(i=>{throw new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const a=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!a.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(a,"application/xml"),o=i.querySelectorAll("HttpHeader");if(o.length>0){let h;for(let u=0,f=o.length;u<f;u++){var r,l;h=o[u];const p=(r=h.querySelector("name"))==null?void 0:r.textContent,m=(l=h.querySelector("value"))==null?void 0:l.textContent;p&&m&&e.setRequestHeader(p,m)}}const d=i.querySelector("Challenge"),c=d==null?void 0:d.textContent;if(!c)throw new Error("Cannot find <Challenge> in key message");return Xr(atob(c))}setupLicenseXHR(e,t,a,i){const o=this.config.licenseXhrSetup;return o?Promise.resolve().then(()=>{if(!a.decryptdata)throw new Error("Key removed");return o.call(this.hls,e,t,a,i)}).catch(r=>{if(!a.decryptdata)throw r;return e.open("POST",t,!0),o.call(this.hls,e,t,a,i)}).then(r=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:r||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const a=this.config.keyLoadPolicy.default;return new Promise((i,o)=>{const r=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${r}`);const l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return o(new Error("invalid state"));if(l.readyState===4)if(l.status===200){this._requestLicenseFailureCount=0;let d=l.response;this.log(`License received ${d instanceof ArrayBuffer?d.byteLength:d}`);const c=this.config.licenseResponseCallback;if(c)try{d=c.call(this.hls,l,r,e)}catch(h){this.error(h)}i(d)}else{const d=a.errorRetry,c=d?d.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>c||l.status>=400&&l.status<500)o(new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:l,response:{url:r,data:void 0,code:l.status,text:l.statusText}},`License Request XHR failed (${r}). Status: ${l.status} (${l.statusText})`));else{const h=c-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${h} attempts left`),this.requestLicense(e,t).then(i,o)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,r,e,t).then(({xhr:d,licenseChallenge:c})=>{e.keySystem==Ne.PLAYREADY&&(c=this.unpackPlayReadyKeyMessage(d,c)),d.send(c)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const a=t.media;this.media=a,a.addEventListener("encrypted",this.onMediaEncrypted),a.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Ea.clearKeyUriToKeyIdMap();const a=t.length;qs.CDMCleanupPromise=Promise.all(t.map(i=>this.removeSession(i)).concat(e==null?void 0:e.setMediaKeys(null).catch(i=>{this.log(`Could not clear media keys: ${i}`)}))).then(()=>{a&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(i=>{this.log(`Could not close sessions and clear media keys: ${i}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const a=t.reduce((i,o)=>(i.indexOf(o.keyFormat)===-1&&i.push(o.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${a.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(a)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:a}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),a&&a.readyState!==XMLHttpRequest.DONE&&a.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),t.remove().catch(o=>{this.log(`Could not remove session: ${o}`)}).then(()=>t.close()).catch(o=>{this.log(`Could not close session: ${o}`)})}}}qs.CDMCleanupPromise=void 0;class _t extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var lt;(function(s){s.MANIFEST="m",s.AUDIO="a",s.VIDEO="v",s.MUXED="av",s.INIT="i",s.CAPTION="c",s.TIMED_TEXT="tt",s.KEY="k",s.OTHER="o"})(lt||(lt={}));var Ul;(function(s){s.DASH="d",s.HLS="h",s.SMOOTH="s",s.OTHER="o"})(Ul||(Ul={}));var Cs;(function(s){s.OBJECT="CMCD-Object",s.REQUEST="CMCD-Request",s.SESSION="CMCD-Session",s.STATUS="CMCD-Status"})(Cs||(Cs={}));const bD={[Cs.OBJECT]:["br","d","ot","tb"],[Cs.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[Cs.SESSION]:["cid","pr","sf","sid","st","v"],[Cs.STATUS]:["bs","rtp"]};class Ys{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(a=>a instanceof Ys?a:new Ys(a))),this.value=e,this.params=t}}class qp{constructor(e){this.description=void 0,this.description=e}}const SD="Dict";function wD(s){return Array.isArray(s)?JSON.stringify(s):s instanceof Map?"Map{}":s instanceof Set?"Set{}":typeof s=="object"?JSON.stringify(s):String(s)}function _D(s,e,t,a){return new Error(`failed to ${s} "${wD(e)}" as ${t}`,{cause:a})}const Yp="Bare Item",kD="Boolean",ED="Byte Sequence",TD="Decimal",CD="Integer";function xD(s){return s<-999999999999999||999999999999999<s}const vD=/[\x00-\x1f\x7f]+/,AD="Token",LD="Key";function Kt(s,e,t){return _D("serialize",s,e,t)}function ID(s){if(typeof s!="boolean")throw Kt(s,kD);return s?"?1":"?0"}function RD(s){return btoa(String.fromCharCode(...s))}function BD(s){if(ArrayBuffer.isView(s)===!1)throw Kt(s,ED);return`:${RD(s)}:`}function Jp(s){if(xD(s))throw Kt(s,CD);return s.toString()}function ND(s){return`@${Jp(s.getTime()/1e3)}`}function Xp(s,e){if(s<0)return-Xp(-s,e);const t=Math.pow(10,e);if(Math.abs(s*t%1-.5)<Number.EPSILON){const i=Math.floor(s*t);return(i%2===0?i:i+1)/t}else return Math.round(s*t)/t}function DD(s){const e=Xp(s,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Kt(s,TD);const t=e.toString();return t.includes(".")?t:`${t}.0`}const PD="String";function OD(s){if(vD.test(s))throw Kt(s,PD);return`"${s.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function FD(s){return s.description||s.toString().slice(7,-1)}function Zp(s){const e=FD(s);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Kt(e,AD);return e}function zl(s){switch(typeof s){case"number":if(!ne(s))throw Kt(s,Yp);return Number.isInteger(s)?Jp(s):DD(s);case"string":return OD(s);case"symbol":return Zp(s);case"boolean":return ID(s);case"object":if(s instanceof Date)return ND(s);if(s instanceof Uint8Array)return BD(s);if(s instanceof qp)return Zp(s);default:throw Kt(s,Yp)}}function Gl(s){if(/^[a-z*][a-z0-9\-_.*]*$/.test(s)===!1)throw Kt(s,LD);return s}function jl(s){return s==null?"":Object.entries(s).map(([e,t])=>t===!0?`;${Gl(e)}`:`;${Gl(e)}=${zl(t)}`).join("")}function Qp(s){return s instanceof Ys?`${zl(s.value)}${jl(s.params)}`:zl(s)}function MD(s){return`(${s.value.map(Qp).join(" ")})${jl(s.params)}`}function $D(s,e={whitespace:!0}){if(typeof s!="object")throw Kt(s,SD);const t=s instanceof Map?s.entries():Object.entries(s),a=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,o])=>{o instanceof Ys||(o=new Ys(o));let r=Gl(i);return o.value===!0?r+=jl(o.params):(r+="=",Array.isArray(o.value)?r+=MD(o):r+=Qp(o)),r}).join(`,${a}`)}function VD(s,e){return $D(s,e)}const UD=s=>s==="ot"||s==="sf"||s==="st",zD=s=>typeof s=="number"?ne(s):s!=null&&s!==""&&s!==!1;function GD(s,e){const t=new URL(s),a=new URL(e);if(t.origin!==a.origin)return s;const i=t.pathname.split("/").slice(1),o=a.pathname.split("/").slice(1,-1);for(;i[0]===o[0];)i.shift(),o.shift();for(;o.length;)o.shift(),i.unshift("..");return i.join("/")}function jD(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const o=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?o:o&3|8).toString(16)})}}}const fi=s=>Math.round(s),HD=(s,e)=>(e!=null&&e.baseUrl&&(s=GD(s,e.baseUrl)),encodeURIComponent(s)),pi=s=>fi(s/100)*100,WD={br:fi,d:fi,bl:pi,dl:pi,mtp:pi,nor:HD,rtp:pi,tb:fi};function KD(s,e){const t={};if(s==null||typeof s!="object")return t;const a=Object.keys(s).sort(),i=Ge({},WD,e==null?void 0:e.formatters),o=e==null?void 0:e.filter;return a.forEach(r=>{if(o!=null&&o(r))return;let l=s[r];const d=i[r];d&&(l=d(l,e)),!(r==="v"&&l===1)&&(r=="pr"&&l===1||zD(l)&&(UD(r)&&typeof l=="string"&&(l=new qp(l)),t[r]=l))}),t}function eg(s,e={}){return s?VD(KD(s,e),Ge({whitespace:!1},e)):""}function qD(s,e={}){if(!s)return{};const t=Object.entries(s),a=Object.entries(bD).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=t.reduce((o,r)=>{var l,d;const[c,h]=r,u=((l=a.find(f=>f[1].includes(c)))==null?void 0:l[0])||Cs.REQUEST;return(d=o[u])!=null||(o[u]={}),o[u][c]=h,o},{});return Object.entries(i).reduce((o,[r,l])=>(o[r]=eg(l,e),o),{})}function YD(s,e,t){return Ge(s,qD(e,t))}const JD="CMCD";function XD(s,e={}){if(!s)return"";const t=eg(s,e);return`${JD}=${encodeURIComponent(t)}`}const tg=/CMCD=[^&#]+/;function ZD(s,e,t){const a=XD(e,t);if(!a)return s;if(tg.test(s))return s.replace(tg,a);const i=s.includes("?")?"&":"?";return`${s}${i}${a}`}class QD{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:lt.MANIFEST,su:!this.initialized})}catch(o){A.warn("Could not generate manifest CMCD data.",o)}},this.applyFragmentData=i=>{try{const o=i.frag,r=this.hls.levels[o.level],l=this.getObjectType(o),d={d:o.duration*1e3,ot:l};(l===lt.VIDEO||l===lt.AUDIO||l==lt.MUXED)&&(d.br=r.bitrate/1e3,d.tb=this.getTopBandwidth(l)/1e3,d.bl=this.getBufferLength(l)),this.apply(i,d)}catch(o){A.warn("Could not generate segment CMCD data.",o)}},this.hls=e;const t=this.config=e.config,{cmcd:a}=t;a!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=a.sessionId||jD(),this.cid=a.contentId,this.useHeaders=a.useHeaders===!0,this.includeKeys=a.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(w.MEDIA_DETACHED,this.onMediaDetached,this),e.on(w.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(w.MEDIA_DETACHED,this.onMediaDetached,this),e.off(w.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var a,i;this.audioBuffer=(a=t.tracks.audio)==null?void 0:a.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:Ul.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){Ge(t,this.createData());const a=t.ot===lt.INIT||t.ot===lt.VIDEO||t.ot===lt.MUXED;this.starved&&a&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((o,r)=>(i.includes(r)&&(o[r]=t[r]),o),{})),this.useHeaders?(e.headers||(e.headers={}),YD(e.headers,t)):e.url=ZD(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return lt.TIMED_TEXT;if(e.sn==="initSegment")return lt.INIT;if(t==="audio")return lt.AUDIO;if(t==="main")return this.hls.audioTracks.length?lt.VIDEO:lt.MUXED}getTopBandwidth(e){let t=0,a;const i=this.hls;if(e===lt.AUDIO)a=i.audioTracks;else{const o=i.maxAutoLevel,r=o>-1?o+1:i.levels.length;a=i.levels.slice(0,r)}for(const o of a)o.bitrate>t&&(t=o.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,a=e===lt.AUDIO?this.audioBuffer:this.videoBuffer;return!a||!t?NaN:De.bufferInfo(a,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,a=e||this.config.loader;return class{constructor(o){this.loader=void 0,this.loader=new a(o)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(o,r,l){t(o),this.loader.load(o,r,l)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,a=e||this.config.loader;return class{constructor(o){this.loader=void 0,this.loader=new a(o)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(o,r,l){t(o),this.loader.load(o,r,l)}}}}const eP=3e5;class tP{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=A.log.bind(A,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(w.MANIFEST_PARSED,this.onManifestParsed,this),e.on(w.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(w.MANIFEST_PARSED,this.onManifestParsed,this),e.off(w.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(a=>a!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:a}=t;a!==null&&(this.pathwayId=a.pathwayId,this.uri=a.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:a}=t;if((a==null?void 0:a.action)===nt.SendAlternateToPenaltyBox&&a.flags===Pt.MoveAllAlternatesMatchingHost){const i=this.levels;let o=this.pathwayPriority,r=this.pathwayId;if(t.context){const{groupId:l,pathwayId:d,type:c}=t.context;l&&i?r=this.getPathwayForGroupId(l,c,r):d&&(r=d)}r in this.penalizedPathways||(this.penalizedPathways[r]=performance.now()),!o&&i&&(o=i.reduce((l,d)=>(l.indexOf(d.pathwayId)===-1&&l.push(d.pathwayId),l),[])),o&&o.length>1&&(this.updatePathwayPriority(o),a.resolved=this.pathwayId!==r),a.resolved||A.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${r} levels: ${i&&i.length} priorities: ${JSON.stringify(o)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const a=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${a}"`),t=this.getLevelsForPathway(a),this.pathwayId=a}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let t;const a=this.penalizedPathways,i=performance.now();Object.keys(a).forEach(o=>{i-a[o]>eP&&delete a[o]});for(let o=0;o<e.length;o++){const r=e[o];if(r in a)continue;if(r===this.pathwayId)return;const l=this.hls.nextLoadLevel,d=this.hls.levels[l];if(t=this.getLevelsForPathway(r),t.length>0){this.log(`Setting Pathway to "${r}"`),this.pathwayId=r,Wf(t),this.hls.trigger(w.LEVELS_UPDATED,{levels:t});const c=this.hls.levels[l];d&&c&&this.levels&&(c.attrs["STABLE-VARIANT-ID"]!==d.attrs["STABLE-VARIANT-ID"]&&c.bitrate!==d.bitrate&&this.log(`Unstable Pathways change from bitrate ${d.bitrate} to ${c.bitrate}`),this.hls.nextLoadLevel=l);break}}}getPathwayForGroupId(e,t,a){const i=this.getLevelsForPathway(a).concat(this.levels||[]);for(let o=0;o<i.length;o++)if(t===xe.AUDIO_TRACK&&i[o].hasAudioGroup(e)||t===xe.SUBTITLE_TRACK&&i[o].hasSubtitleGroup(e))return i[o].pathwayId;return a}clonePathways(e){const t=this.levels;if(!t)return;const a={},i={};e.forEach(o=>{const{ID:r,"BASE-ID":l,"URI-REPLACEMENT":d}=o;if(t.some(h=>h.pathwayId===r))return;const c=this.getLevelsForPathway(l).map(h=>{const u=new Oe(h.attrs);u["PATHWAY-ID"]=r;const f=u.AUDIO&&`${u.AUDIO}_clone_${r}`,p=u.SUBTITLES&&`${u.SUBTITLES}_clone_${r}`;f&&(a[u.AUDIO]=f,u.AUDIO=f),p&&(i[u.SUBTITLES]=p,u.SUBTITLES=p);const m=ag(h.uri,u["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",d),g=new Vs({attrs:u,audioCodec:h.audioCodec,bitrate:h.bitrate,height:h.height,name:h.name,url:m,videoCodec:h.videoCodec,width:h.width});if(h.audioGroups)for(let y=1;y<h.audioGroups.length;y++)g.addGroupId("audio",`${h.audioGroups[y]}_clone_${r}`);if(h.subtitleGroups)for(let y=1;y<h.subtitleGroups.length;y++)g.addGroupId("text",`${h.subtitleGroups[y]}_clone_${r}`);return g});t.push(...c),sg(this.audioTracks,a,d,r),sg(this.subtitleTracks,i,d,r)})}loadSteeringManifest(e){const t=this.hls.config,a=t.loader;this.loader&&this.loader.destroy(),this.loader=new a(t);let i;try{i=new self.URL(e)}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const h=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+h)}const o={responseType:"json",url:i.href},r=t.steeringManifestLoadPolicy.default,l=r.errorRetry||r.timeoutRetry||{},d={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},c={onSuccess:(h,u,f,p)=>{this.log(`Loaded steering manifest: "${i}"`);const m=h.data;if(m.VERSION!==1){this.log(`Steering VERSION ${m.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=m.TTL;const{"RELOAD-URI":g,"PATHWAY-CLONES":y,"PATHWAY-PRIORITY":b}=m;if(g)try{this.uri=new self.URL(g,i).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${g}`);return}this.scheduleRefresh(this.uri||f.url),y&&this.clonePathways(y);const S={steeringManifest:m,url:i.toString()};this.hls.trigger(w.STEERING_MANIFEST_LOADED,S),b&&this.updatePathwayPriority(b)},onError:(h,u,f,p)=>{if(this.log(`Error loading steering manifest: ${h.code} ${h.text} (${u.url})`),this.stopLoad(),h.code===410){this.enabled=!1,this.log(`Steering manifest ${u.url} no longer available`);return}let m=this.timeToLoad*1e3;if(h.code===429){const g=this.loader;if(typeof(g==null?void 0:g.getResponseHeader)=="function"){const y=g.getResponseHeader("Retry-After");y&&(m=parseFloat(y)*1e3)}this.log(`Steering manifest ${u.url} rate limited`);return}this.scheduleRefresh(this.uri||u.url,m)},onTimeout:(h,u,f)=>{this.log(`Timeout loading steering manifest (${u.url})`),this.scheduleRefresh(this.uri||u.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(o,d,c)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var a;const i=(a=this.hls)==null?void 0:a.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function sg(s,e,t,a){s&&Object.keys(e).forEach(i=>{const o=s.filter(r=>r.groupId===i).map(r=>{const l=Ge({},r);return l.details=void 0,l.attrs=new Oe(l.attrs),l.url=l.attrs.URI=ag(r.url,r.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),l.groupId=l.attrs["GROUP-ID"]=e[i],l.attrs["PATHWAY-ID"]=a,l});s.push(...o)})}function ag(s,e,t,a){const{HOST:i,PARAMS:o,[t]:r}=a;let l;e&&(l=r==null?void 0:r[e],l&&(s=l));const d=new self.URL(s);return i&&!l&&(d.host=i),o&&Object.keys(o).sort().forEach(c=>{c&&d.searchParams.set(c,o[c])}),d.href}const sP=/^age:\s*[\d.]+\s*$/im;class ng{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new $n,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,a){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=a,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const a=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const o=this.xhrSetup;o?Promise.resolve().then(()=>{if(!(this.loader!==a||this.stats.aborted))return o(a,t.url)}).catch(r=>{if(!(this.loader!==a||this.stats.aborted))return a.open("GET",t.url,!0),o(a,t.url)}).then(()=>{this.loader!==a||this.stats.aborted||this.openAndSendXhr(a,t,e)}).catch(r=>{this.callbacks.onError({code:a.status,text:r.message},t,a,i)}):this.openAndSendXhr(a,t,e)}openAndSendXhr(e,t,a){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:o,maxLoadTimeMs:r}=a.loadPolicy;if(i)for(const l in i)e.setRequestHeader(l,i[l]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),a.timeout=o&&ne(o)?o:r,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:a}=this;if(!e||!t)return;const i=t.readyState,o=this.config;if(!a.aborted&&i>=2&&(a.loading.first===0&&(a.loading.first=Math.max(self.performance.now(),a.loading.start),o.timeout!==o.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),o.timeout=o.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.loadPolicy.maxLoadTimeMs-(a.loading.first-a.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const r=t.status,l=t.responseType!=="text";if(r>=200&&r<300&&(l&&t.response||t.responseText!==null)){a.loading.end=Math.max(self.performance.now(),a.loading.first);const d=l?t.response:t.responseText,c=t.responseType==="arraybuffer"?d.byteLength:d.length;if(a.loaded=a.total=c,a.bwEstimate=a.total*8e3/(a.loading.end-a.loading.first),!this.callbacks)return;const h=this.callbacks.onProgress;if(h&&h(a,e,d,t),!this.callbacks)return;const u={url:t.responseURL,data:d,code:r};this.callbacks.onSuccess(u,a,e,t)}else{const d=o.loadPolicy.errorRetry,c=a.retry,h={url:e.url,data:void 0,code:r};Zn(d,c,!1,h)?this.retry(d):(A.error(`${r} while loading ${e.url}`),this.callbacks.onError({code:r,text:t.statusText},e,t,a))}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Zn(e,t,!0))this.retry(e);else{var a;A.warn(`timeout while loading ${(a=this.context)==null?void 0:a.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:a}=this;this.retryDelay=fl(e,a.retry),a.retry++,A.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${a.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&sP.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function aP(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const nP=/(\d+)-(\d+)\/(\d+)/;class ig{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||lP,this.controller=new self.AbortController,this.stats=new $n}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,a){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const o=iP(e,this.controller.signal),r=a.onProgress,l=e.responseType==="arraybuffer",d=l?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:h}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=a,this.request=this.fetchSetup(e,o),self.clearTimeout(this.requestTimeout),t.timeout=c&&ne(c)?c:h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),a.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(u=>{this.response=this.loader=u;const f=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),a.onTimeout(i,e,this.response)},h-(f-i.loading.start)),!u.ok){const{status:p,statusText:m}=u;throw new cP(m||"fetch, bad network response",p,u)}return i.loading.first=f,i.total=rP(u.headers)||i.total,r&&ne(t.highWaterMark)?this.loadProgressively(u,i,e,t.highWaterMark,r):l?u.arrayBuffer():e.responseType==="json"?u.json():u.text()}).then(u=>{const f=this.response;if(!f)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const p=u[d];p&&(i.loaded=i.total=p);const m={url:f.url,data:u,code:f.status};r&&!ne(t.highWaterMark)&&r(i,e,u,f),a.onSuccess(m,i,e,f)}).catch(u=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const f=u&&u.code||0,p=u?u.message:null;a.onError({code:f,text:p},e,u?u.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,a,i=0,o){const r=new np,l=e.body.getReader(),d=()=>l.read().then(c=>{if(c.done)return r.dataLength&&o(t,a,r.flush(),e),Promise.resolve(new ArrayBuffer(0));const h=c.value,u=h.length;return t.loaded+=u,u<i||r.dataLength?(r.push(h),r.dataLength>=i&&o(t,a,r.flush(),e)):o(t,a,h,e),d()}).catch(()=>Promise.reject());return d()}}function iP(s,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(Ge({},s.headers))};return s.rangeEnd&&t.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),t}function oP(s){const e=nP.exec(s);if(e)return parseInt(e[2])-parseInt(e[1])+1}function rP(s){const e=s.get("Content-Range");if(e){const a=oP(e);if(ne(a))return a}const t=s.get("Content-Length");if(t)return parseInt(t)}function lP(s,e){return new self.Request(s.url,e)}class cP extends Error{constructor(e,t,a){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=a}}const dP=/\s/,hP={newCue(s,e,t,a){const i=[];let o,r,l,d,c;const h=self.VTTCue||self.TextTrackCue;for(let f=0;f<a.rows.length;f++)if(o=a.rows[f],l=!0,d=0,c="",!o.isEmpty()){var u;for(let g=0;g<o.chars.length;g++)dP.test(o.chars[g].uchar)&&l?d++:(c+=o.chars[g].uchar,l=!1);o.cueStartTime=e,e===t&&(t+=1e-4),d>=16?d--:d++;const p=Mp(c.trim()),m=Pl(e,t,p);s!=null&&(u=s.cues)!=null&&u.getCueById(m)||(r=new h(e,t,p),r.id=m,r.line=f+1,r.align="left",r.position=10+Math.min(80,Math.floor(d*8/32)*10),i.push(r))}return s&&i.length&&(i.sort((f,p)=>f.line==="auto"||p.line==="auto"?0:f.line>8&&p.line>8?p.line-f.line:f.line-p.line),i.forEach(f=>Ff(s,f))),i}},uP={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},og=Xe(Xe({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:ng,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:$B,bufferController:GN,capLevelController:Vl,errorController:vB,fpsController:yD,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:rf,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:uP},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},mP()),{},{subtitleStreamController:$N,subtitleTrackController:UN,timelineController:pD,audioStreamController:FN,audioTrackController:MN,emeController:qs,cmcdController:QD,contentSteeringController:tP});function mP(){return{cueHandler:hP,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function fP(s,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const t=Hl(s),a=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return a.forEach(o=>{const r=`${o==="level"?"playlist":o}LoadPolicy`,l=e[r]===void 0,d=[];i.forEach(c=>{const h=`${o}Loading${c}`,u=e[h];if(u!==void 0&&l){d.push(h);const f=t[r].default;switch(e[r]={default:f},c){case"TimeOut":f.maxLoadTimeMs=u,f.maxTimeToFirstByteMs=u;break;case"MaxRetry":f.errorRetry.maxNumRetry=u,f.timeoutRetry.maxNumRetry=u;break;case"RetryDelay":f.errorRetry.retryDelayMs=u,f.timeoutRetry.retryDelayMs=u;break;case"MaxRetryTimeout":f.errorRetry.maxRetryDelayMs=u,f.timeoutRetry.maxRetryDelayMs=u;break}}}),d.length&&A.warn(`hls.js config: "${d.join('", "')}" setting(s) are deprecated, use "${r}": ${JSON.stringify(e[r])}`)}),Xe(Xe({},t),e)}function Hl(s){return s&&typeof s=="object"?Array.isArray(s)?s.map(Hl):Object.keys(s).reduce((e,t)=>(e[t]=Hl(s[t]),e),{}):s}function pP(s){const e=s.loader;e!==ig&&e!==ng?(A.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1):aP()&&(s.loader=ig,s.progressive=!0,s.enableSoftwareAES=!0,A.log("[config]: Progressive streaming enabled, using FetchLoader"))}let Wl;class gP extends gl{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(w.LEVEL_LOADED,this.onLevelLoaded,this),e.on(w.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(w.FRAG_BUFFERED,this.onFragBuffered,this),e.on(w.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(w.LEVEL_LOADED,this.onLevelLoaded,this),e.off(w.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(w.FRAG_BUFFERED,this.onFragBuffered,this),e.off(w.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const a=this.hls.config.preferManagedMediaSource,i=[],o={},r={};let l=!1,d=!1,c=!1;t.levels.forEach(h=>{var u,f;const p=h.attrs;let{audioCodec:m,videoCodec:g}=h;((u=m)==null?void 0:u.indexOf("mp4a.40.34"))!==-1&&(Wl||(Wl=/chrome|firefox/i.test(navigator.userAgent)),Wl&&(h.audioCodec=m=void 0)),m&&(h.audioCodec=m=Wn(m,a)),((f=g)==null?void 0:f.indexOf("avc1"))===0&&(g=h.videoCodec=sB(g));const{width:y,height:b,unknownCodecs:S}=h;if(l||(l=!!(y&&b)),d||(d=!!g),c||(c=!!m),S!=null&&S.length||m&&!il(m,"audio",a)||g&&!il(g,"video",a))return;const{CODECS:_,"FRAME-RATE":C,"HDCP-LEVEL":E,"PATHWAY-ID":v,RESOLUTION:T,"VIDEO-RANGE":B}=p,R=`${`${v||"."}-`}${h.bitrate}-${T}-${C}-${_}-${B}-${E}`;if(o[R])if(o[R].uri!==h.url&&!h.attrs["PATHWAY-ID"]){const $=r[R]+=1;h.attrs["PATHWAY-ID"]=new Array($+1).join(".");const K=new Vs(h);o[R]=K,i.push(K)}else o[R].addGroupId("audio",p.AUDIO),o[R].addGroupId("text",p.SUBTITLES);else{const $=new Vs(h);o[R]=$,r[R]=1,i.push($)}}),this.filterAndSortMediaOptions(i,t,l,d,c)}filterAndSortMediaOptions(e,t,a,i,o){let r=[],l=[],d=e;if((a||i)&&o&&(d=d.filter(({videoCodec:m,videoRange:g,width:y,height:b})=>(!!m||!!(y&&b))&&pB(g))),d.length===0){Promise.resolve().then(()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const m=new Error("no level with compatible codecs found in manifest");this.hls.trigger(w.ERROR,{type:fe.MEDIA_ERROR,details:N.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:m,reason:m.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:m}=this.hls.config;r=t.audioTracks.filter(g=>!g.audioCodec||il(g.audioCodec,"audio",m)),rg(r)}t.subtitles&&(l=t.subtitles,rg(l));const c=d.slice(0);d.sort((m,g)=>{if(m.attrs["HDCP-LEVEL"]!==g.attrs["HDCP-LEVEL"])return(m.attrs["HDCP-LEVEL"]||"")>(g.attrs["HDCP-LEVEL"]||"")?1:-1;if(a&&m.height!==g.height)return m.height-g.height;if(m.frameRate!==g.frameRate)return m.frameRate-g.frameRate;if(m.videoRange!==g.videoRange)return Yn.indexOf(m.videoRange)-Yn.indexOf(g.videoRange);if(m.videoCodec!==g.videoCodec){const y=Tf(m.videoCodec),b=Tf(g.videoCodec);if(y!==b)return b-y}if(m.uri===g.uri&&m.codecSet!==g.codecSet){const y=Hn(m.codecSet),b=Hn(g.codecSet);if(y!==b)return b-y}return m.averageBitrate!==g.averageBitrate?m.averageBitrate-g.averageBitrate:0});let h=c[0];if(this.steering&&(d=this.steering.filterParsedLevels(d),d.length!==c.length)){for(let m=0;m<c.length;m++)if(c[m].pathwayId===d[0].pathwayId){h=c[m];break}}this._levels=d;for(let m=0;m<d.length;m++)if(d[m]===h){var u;this._firstLevel=m;const g=h.bitrate,y=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${d.length} level(s) found, first bitrate: ${g}`),((u=this.hls.userConfig)==null?void 0:u.abrEwmaDefaultEstimate)===void 0){const b=Math.min(g,this.hls.config.abrEwmaDefaultEstimateMax);b>y&&y===og.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=b)}break}const f=o&&!i,p={levels:d,audioTracks:r,subtitleTracks:l,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:o,video:i,altAudio:!f&&r.some(m=>!!m.url)};this.hls.trigger(w.MANIFEST_PARSED,p),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const h=new Error("invalid level idx"),u=e<0;if(this.hls.trigger(w.ERROR,{type:fe.OTHER_ERROR,details:N.LEVEL_SWITCH_ERROR,level:e,fatal:u,error:h,reason:h.message}),u)return;e=Math.min(e,t.length-1)}const a=this.currentLevelIndex,i=this.currentLevel,o=i?i.attrs["PATHWAY-ID"]:void 0,r=t[e],l=r.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=r,a===e&&r.details&&i&&o===l)return;this.log(`Switching to level ${e} (${r.height?r.height+"p ":""}${r.videoRange?r.videoRange+" ":""}${r.codecSet?r.codecSet+" ":""}@${r.bitrate})${l?" with Pathway "+l:""} from level ${a}${o?" with Pathway "+o:""}`);const d={level:e,attrs:r.attrs,details:r.details,bitrate:r.bitrate,averageBitrate:r.averageBitrate,maxBitrate:r.maxBitrate,realBitrate:r.realBitrate,width:r.width,height:r.height,codecSet:r.codecSet,audioCodec:r.audioCodec,videoCodec:r.videoCodec,audioGroups:r.audioGroups,subtitleGroups:r.subtitleGroups,loaded:r.loaded,loadError:r.loadError,fragmentError:r.fragmentError,name:r.name,id:r.id,uri:r.uri,url:r.url,urlId:0,audioGroupIds:r.audioGroupIds,textGroupIds:r.textGroupIds};this.hls.trigger(w.LEVEL_SWITCHING,d);const c=r.details;if(!c||c.live){const h=this.switchParams(r.uri,i==null?void 0:i.details,c);this.loadPlaylist(h)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){t.fatal||!t.context||t.context.type===xe.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===le.MAIN){const a=t.elementaryStreams;if(!Object.keys(a).some(o=>!!a[o]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var a;const{level:i,details:o}=t,r=this._levels[i];if(!r){var l;this.warn(`Invalid level index ${i}`),(l=t.deliveryDirectives)!=null&&l.skip&&(o.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(r.fragmentError===0&&(r.loadError=0),this.playlistLoaded(i,t,r.details)):(a=t.deliveryDirectives)!=null&&a.skip&&(o.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,a=this.currentLevel;if(a&&this.shouldLoadPlaylist(a)){let i=a.uri;if(e)try{i=e.addDirectives(i)}catch(r){this.warn(`Could not construct new URL with HLS Delivery Directives: ${r}`)}const o=a.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${o?" Pathway "+o:""} ${i}`),this.clearTimer(),this.hls.trigger(w.LEVEL_LOADING,{url:i,level:t,pathwayId:a.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;const a=this._levels.filter((i,o)=>o!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(r=>r.level=-1)),!1));Wf(a),this._levels=a,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(w.LEVELS_UPDATED,{levels:a})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:a}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(w.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:a}))}}function rg(s){const e={};s.forEach(t=>{const a=t.groupId||"";t.id=e[a]=e[a]||0,e[a]++})}class yP{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const a in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[a].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=N.KEY_LOAD_ERROR,a,i,o){return new Zt({type:fe.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:o,error:a,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:a,cc:i}=e;for(let o=0;o<t.length;o++){const r=t[o];if(i<=r.cc&&(a==="initSegment"||r.sn==="initSegment"||a<r.sn)){this.emeController.selectKeySystemFormat(r).then(l=>{r.setKeyFormat(l)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var a,i;t&&e.setKeyFormat(t);const o=e.decryptdata;if(!o){const c=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,N.KEY_LOAD_ERROR,c))}const r=o.uri;if(!r)return Promise.reject(this.createKeyLoadError(e,N.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${r}"`)));let l=this.keyUriToKeyInfo[r];if((a=l)!=null&&a.decryptdata.key)return o.key=l.decryptdata.key,Promise.resolve({frag:e,keyInfo:l});if((i=l)!=null&&i.keyLoadPromise){var d;switch((d=l.mediaKeySessionContext)==null?void 0:d.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return l.keyLoadPromise.then(c=>(o.key=c.keyInfo.decryptdata.key,{frag:e,keyInfo:l}))}}switch(l=this.keyUriToKeyInfo[r]={decryptdata:o,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},o.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return o.keyFormat==="identity"?this.loadKeyHTTP(l,e):this.loadKeyEME(l,e);case"AES-128":return this.loadKeyHTTP(l,e);default:return Promise.reject(this.createKeyLoadError(e,N.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${o.method}"`)))}}loadKeyEME(e,t){const a={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(a);if(i)return(e.keyLoadPromise=i.then(o=>(e.mediaKeySessionContext=o,a))).catch(o=>{throw e.keyLoadPromise=null,o})}return Promise.resolve(a)}loadKeyHTTP(e,t){const a=this.config,i=a.loader,o=new i(a);return t.keyLoader=e.loader=o,e.keyLoadPromise=new Promise((r,l)=>{const d={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},c=a.keyLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(f,p,m,g)=>{const{frag:y,keyInfo:b,url:S}=m;if(!y.decryptdata||b!==this.keyUriToKeyInfo[S])return l(this.createKeyLoadError(y,N.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),g));b.decryptdata.key=y.decryptdata.key=new Uint8Array(f.data),y.keyLoader=null,b.loader=null,r({frag:y,keyInfo:b})},onError:(f,p,m,g)=>{this.resetLoader(p),l(this.createKeyLoadError(t,N.KEY_LOAD_ERROR,new Error(`HTTP Error ${f.code} loading key ${f.text}`),m,Xe({url:d.url,data:void 0},f)))},onTimeout:(f,p,m)=>{this.resetLoader(p),l(this.createKeyLoadError(t,N.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),m))},onAbort:(f,p,m)=>{this.resetLoader(p),l(this.createKeyLoadError(t,N.INTERNAL_ABORTED,new Error("key loading aborted"),m))}};o.load(d,h,u)})}resetLoader(e){const{frag:t,keyInfo:a,url:i}=e,o=a.loader;t.keyLoader===o&&(t.keyLoader=null,a.loader=null),delete this.keyUriToKeyInfo[i],o&&o.destroy()}}function lg(){return self.SourceBuffer||self.WebKitSourceBuffer}function cg(){if(!Es())return!1;const e=lg();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function bP(){if(!cg())return!1;const s=Es();return typeof(s==null?void 0:s.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>s.isTypeSupported(Ta(e,"video")))||["mp4a.40.2","fLaC"].some(e=>s.isTypeSupported(Ta(e,"audio"))))}function SP(){var s;const e=lg();return typeof(e==null||(s=e.prototype)==null?void 0:s.changeType)=="function"}const wP=250,gi=2,_P=.1,kP=.05;class EP{constructor(e,t,a,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=a,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:a,media:i,stalled:o}=this;if(i===null)return;const{currentTime:r,seeking:l}=i,d=this.seeking&&!l,c=!this.seeking&&l;if(this.seeking=l,r!==e){if(this.moved=!0,l||(this.nudgeRetry=0),o!==null){if(this.stallReported){const y=self.performance.now()-o;A.warn(`playback not stuck anymore @${r}, after ${Math.round(y)}ms`),this.stallReported=!1}this.stalled=null}return}if(c||d){this.stalled=null;return}if(i.paused&&!l||i.ended||i.playbackRate===0||!De.getBuffered(i).length){this.nudgeRetry=0;return}const h=De.bufferInfo(i,r,0),u=h.nextStart||0;if(l){const y=h.len>gi,b=!u||t&&t.start<=r||u-r>gi&&!this.fragmentTracker.getPartialFragment(r);if(y||b)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var f;if(!(h.len>0)&&!u)return;const b=Math.max(u,h.start||0)-r,S=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,C=(S==null||(f=S.details)==null?void 0:f.live)?S.details.targetduration*2:gi,E=this.fragmentTracker.getPartialFragment(r);if(b>0&&(b<=C||E)){i.paused||this._trySkipBufferHole(E);return}}const p=self.performance.now();if(o===null){this.stalled=p;return}const m=p-o;if(!l&&m>=wP&&(this._reportStall(h),!this.media))return;const g=De.bufferInfo(i,r,a.maxBufferHole);this._tryFixBufferStall(g,m)}_tryFixBufferStall(e,t){const{config:a,fragmentTracker:i,media:o}=this;if(o===null)return;const r=o.currentTime,l=i.getPartialFragment(r);l&&(this._trySkipBufferHole(l)||!this.media)||(e.len>a.maxBufferHole||e.nextStart&&e.nextStart-r<a.maxBufferHole)&&t>a.highBufferWatchdogPeriod*1e3&&(A.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:a,stallReported:i}=this;if(!i&&a){this.stallReported=!0;const o=new Error(`Playback stalling at @${a.currentTime} due to low buffer (${JSON.stringify(e)})`);A.warn(o.message),t.trigger(w.ERROR,{type:fe.MEDIA_ERROR,details:N.BUFFER_STALLED_ERROR,fatal:!1,error:o,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:a,media:i}=this;if(i===null)return 0;const o=i.currentTime,r=De.bufferInfo(i,o,0),l=o<r.start?r.start:r.nextStart;if(l){const d=r.len<=t.maxBufferHole,c=r.len>0&&r.len<1&&i.readyState<3,h=l-o;if(h>0&&(d||c)){if(h>t.maxBufferHole){const{fragmentTracker:f}=this;let p=!1;if(o===0){const m=f.getAppendedFrag(0,le.MAIN);m&&l<m.end&&(p=!0)}if(!p){const m=e||f.getAppendedFrag(o,le.MAIN);if(m){let g=!1,y=m.end;for(;y<l;){const b=f.getPartialFragment(y);if(b)y+=b.duration;else{g=!0;break}}if(g)return 0}}}const u=Math.max(l+kP,o+_P);if(A.warn(`skipping hole, adjusting currentTime from ${o} to ${u}`),this.moved=!0,this.stalled=null,i.currentTime=u,e&&!e.gap){const f=new Error(`fragment loaded with buffer holes, seeking from ${o} to ${u}`);a.trigger(w.ERROR,{type:fe.MEDIA_ERROR,details:N.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:f,reason:f.message,frag:e})}return u}}return 0}_tryNudgeBuffer(){const{config:e,hls:t,media:a,nudgeRetry:i}=this;if(a===null)return;const o=a.currentTime;if(this.nudgeRetry++,i<e.nudgeMaxRetry){const r=o+(i+1)*e.nudgeOffset,l=new Error(`Nudging 'currentTime' from ${o} to ${r}`);A.warn(l.message),a.currentTime=r,t.trigger(w.ERROR,{type:fe.MEDIA_ERROR,details:N.BUFFER_NUDGE_ON_STALL,error:l,fatal:!1})}else{const r=new Error(`Playhead still not moving while enough data buffered @${o} after ${e.nudgeMaxRetry} nudges`);A.error(r.message),t.trigger(w.ERROR,{type:fe.MEDIA_ERROR,details:N.BUFFER_STALLED_ERROR,error:r,fatal:!0})}}}const TP=100;class CP extends Sl{constructor(e,t,a){super(e,t,a,"[stream-controller]",le.MAIN),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.MANIFEST_PARSED,this.onManifestParsed,this),e.on(w.LEVEL_LOADING,this.onLevelLoading,this),e.on(w.LEVEL_LOADED,this.onLevelLoaded,this),e.on(w.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(w.ERROR,this.onError,this),e.on(w.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(w.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(w.BUFFER_CREATED,this.onBufferCreated,this),e.on(w.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(w.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(w.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.MANIFEST_PARSED,this.onManifestParsed,this),e.off(w.LEVEL_LOADED,this.onLevelLoaded,this),e.off(w.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(w.ERROR,this.onError,this),e.off(w.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(w.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(w.BUFFER_CREATED,this.onBufferCreated,this),e.off(w.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(w.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(w.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying()}startLoad(e){if(this.levels){const{lastCurrentTime:t,hls:a}=this;if(this.stopLoad(),this.setInterval(TP),this.level=-1,!this.startFragRequested){let i=a.startLevel;i===-1&&(a.config.testBandwidth&&this.levels.length>1?(i=0,this.bitrateTest=!0):i=a.firstAutoLevel),a.nextLoadLevel=i,this.level=a.loadLevel,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=V.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=V.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case V.WAITING_LEVEL:{const{levels:t,level:a}=this,i=t==null?void 0:t[a],o=i==null?void 0:i.details;if(o&&(!o.live||this.levelLastLoaded===i)){if(this.waitForCdnTuneIn(o))break;this.state=V.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=V.IDLE;break}break}case V.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),a=this.retryDate;if(!a||t>=a||(e=this.media)!=null&&e.seeking){const{levels:i,level:o}=this,r=i==null?void 0:i[o];this.resetStartWhenNotLoaded(r||null),this.state=V.IDLE}}break}this.state===V.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:a,media:i}=this;if(t===null||!i&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const o=e.nextLoadLevel;if(!(a!=null&&a[o]))return;const r=a[o],l=this.getMainFwdBufferInfo();if(l===null)return;const d=this.getLevelDetails();if(d&&this._streamEnded(l,d)){const g={};this.altAudio&&(g.type="video"),this.hls.trigger(w.BUFFER_EOS,g),this.state=V.ENDED;return}e.loadLevel!==o&&e.manualLevel===-1&&this.log(`Adapting to level ${o} from level ${this.level}`),this.level=e.nextLoadLevel=o;const c=r.details;if(!c||this.state===V.WAITING_LEVEL||c.live&&this.levelLastLoaded!==r){this.level=o,this.state=V.WAITING_LEVEL;return}const h=l.len,u=this.getMaxBufferLength(r.maxBitrate);if(h>=u)return;this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);const f=this.backtrackFragment?this.backtrackFragment.start:l.end;let p=this.getNextFragment(f,c);if(this.couldBacktrack&&!this.fragPrevious&&p&&p.sn!=="initSegment"&&this.fragmentTracker.getState(p)!==Ze.OK){var m;const y=((m=this.backtrackFragment)!=null?m:p).sn-c.startSN,b=c.fragments[y-1];b&&p.cc===b.cc&&(p=b,this.fragmentTracker.removeFragment(b))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(p&&this.isLoopLoading(p,f)){if(!p.gap){const y=this.audioOnly&&!this.altAudio?Re.AUDIO:Re.VIDEO,b=(y===Re.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;b&&this.afterBufferFlushed(b,y,le.MAIN)}p=this.getNextFragmentLoopLoading(p,c,l,le.MAIN,u)}p&&(p.initSegment&&!p.initSegment.data&&!this.bitrateTest&&(p=p.initSegment),this.loadFragment(p,r,f))}loadFragment(e,t,a){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===Ze.NOT_LOADED||i===Ze.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,a)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,le.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let a;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const o=this.getLevelDetails();if(o!=null&&o.live){const l=this.getMainFwdBufferInfo();if(!l||l.len<o.targetduration*2)return}if(!t.paused&&e){const l=this.hls.nextLoadLevel,d=e[l],c=this.fragLastKbps;c&&this.fragCurrent?a=this.fragCurrent.duration*d.maxBitrate/(1e3*c)+1:a=0}else a=0;const r=this.getBufferedFrag(t.currentTime+a);if(r){const l=this.followingBufferedFrag(r);if(l){this.abortCurrentFrag();const d=l.maxStartPTS?l.maxStartPTS:l.start,c=l.duration,h=Math.max(r.end,d+Math.min(Math.max(c-this.config.maxFragLookUpTolerance,c*(this.couldBacktrack?.5:.125)),c*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(h,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case V.KEY_LOADING:case V.FRAG_LOADING:case V.FRAG_LOADING_WAITING_RETRY:case V.PARSING:case V.PARSED:this.state=V.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const a=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new EP(this.config,a,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;ne(t)&&this.log(`Media seeked to ${t.toFixed(3)}`);const a=this.getMainFwdBufferInfo();if(a===null||a.len===0){this.warn(`Main forward buffer length on "seeked" event ${a?a.len:"empty"})`);return}this.tick()}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(w.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=this.fragLastKbps=0,this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null,this.altAudio=this.audioOnly=this.startFragRequested=!1}onManifestParsed(e,t){let a=!1,i=!1;t.levels.forEach(o=>{const r=o.audioCodec;r&&(a=a||r.indexOf("mp4a.40.2")!==-1,i=i||r.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=a&&i&&!SP(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:a}=this;if(!a||this.state!==V.IDLE)return;const i=a[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(i.details))&&(this.state=V.WAITING_LEVEL)}onLevelLoaded(e,t){var a;const{levels:i}=this,o=t.level,r=t.details,l=r.totalduration;if(!i){this.warn(`Levels were reset while loading level ${o}`);return}this.log(`Level ${o} loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""}, cc [${r.startCC}, ${r.endCC}] duration:${l}`);const d=i[o],c=this.fragCurrent;c&&(this.state===V.FRAG_LOADING||this.state===V.FRAG_LOADING_WAITING_RETRY)&&c.level!==t.level&&c.loader&&this.abortCurrentFrag();let h=0;if(r.live||(a=d.details)!=null&&a.live){var u;if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;h=this.alignPlaylists(r,d.details,(u=this.levelLastLoaded)==null?void 0:u.details)}if(d.details=r,this.levelLastLoaded=d,this.hls.trigger(w.LEVEL_UPDATED,{details:r,level:o}),this.state===V.WAITING_LEVEL){if(this.waitForCdnTuneIn(r))return;this.state=V.IDLE}this.startFragRequested?r.live&&this.synchronizeToLiveEdge(r):this.setStartPosition(r,h),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:a,part:i,payload:o}=e,{levels:r}=this;if(!r){this.warn(`Levels were reset while fragment load was in progress. Fragment ${a.sn} of level ${a.level} will not be buffered`);return}const l=r[a.level],d=l.details;if(!d){this.warn(`Dropping fragment ${a.sn} of level ${a.level} after level details were reset`),this.fragmentTracker.removeFragment(a);return}const c=l.videoCodec,h=d.PTSKnown||!d.live,u=(t=a.initSegment)==null?void 0:t.data,f=this._getAudioCodec(l),p=this.transmuxer=this.transmuxer||new xp(this.hls,le.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),m=i?i.index:-1,g=m!==-1,y=new yl(a.level,a.sn,a.stats.chunkCount,o.byteLength,m,g),b=this.initPTS[a.cc];p.push(o,u,f,c,a,i,d.totalduration,h,y,b)}onAudioTrackSwitching(e,t){const a=this.altAudio;if(!!!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const r=this.fragCurrent;r&&(this.log("Switching to main audio track, cancel main fragment load"),r.abortRequests(),this.fragmentTracker.removeFragment(r)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const o=this.hls;a&&(o.trigger(w.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),o.trigger(w.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const a=t.id,i=!!this.hls.audioTracks[a].url;if(i){const o=this.videoBuffer;o&&this.mediaBuffer!==o&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=o)}this.altAudio=i,this.tick()}onBufferCreated(e,t){const a=t.tracks;let i,o,r=!1;for(const l in a){const d=a[l];if(d.id==="main"){if(o=l,i=d,l==="video"){const c=a[l];c&&(this.videoBuffer=c.buffer)}}else r=!0}r&&i?(this.log(`Alternate track found, use ${o}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:a,part:i}=t;if(a&&a.type!==le.MAIN)return;if(this.fragContextChanged(a)){this.warn(`Fragment ${a.sn}${i?" p: "+i.index:""} of level ${a.level} finished buffering, but was aborted. state: ${this.state}`),this.state===V.PARSED&&(this.state=V.IDLE);return}const o=i?i.stats:a.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),a.sn!=="initSegment"&&(this.fragPrevious=a),this.fragBufferedComplete(a,i)}onError(e,t){var a;if(t.fatal){this.state=V.ERROR;return}switch(t.details){case N.FRAG_GAP:case N.FRAG_PARSING_ERROR:case N.FRAG_DECRYPT_ERROR:case N.FRAG_LOAD_ERROR:case N.FRAG_LOAD_TIMEOUT:case N.KEY_LOAD_ERROR:case N.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(le.MAIN,t);break;case N.LEVEL_LOAD_ERROR:case N.LEVEL_LOAD_TIMEOUT:case N.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===V.WAITING_LEVEL&&((a=t.context)==null?void 0:a.type)===xe.LEVEL&&(this.state=V.IDLE);break;case N.BUFFER_APPEND_ERROR:case N.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===N.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case N.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!De.getBuffered(e).length){const a=this.state!==V.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,a)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=V.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==Re.AUDIO||this.audioOnly&&!this.altAudio){const a=(t===Re.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(a,t,le.MAIN),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let a=this.startPosition;if(a>=0&&t<a){if(e.seeking){this.log(`could not seek to ${a}, already seeking at ${t}`);return}const i=De.getBuffered(e),r=(i.length?i.start(0):0)-a;r>0&&(r<this.config.maxBufferHole||r<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${r} to match buffer start`),a+=r,this.startPosition=a),this.log(`seek to target start position ${a} from current time ${t}`),e.currentTime=a}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(a=>{const{hls:i}=this;if(!a||this.fragContextChanged(e))return;t.fragmentError=0,this.state=V.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const o=e.stats;o.parsing.start=o.parsing.end=o.buffering.start=o.buffering.end=self.performance.now(),i.trigger(w.FRAG_LOADED,a),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const a="main",{hls:i}=this,{remuxResult:o,chunkMeta:r}=e,l=this.getCurrentContext(r);if(!l){this.resetWhenMissingContext(r);return}const{frag:d,part:c,level:h}=l,{video:u,text:f,id3:p,initSegment:m}=o,{details:g}=h,y=this.altAudio?void 0:o.audio;if(this.fragContextChanged(d)){this.fragmentTracker.removeFragment(d);return}if(this.state=V.PARSING,m){if(m!=null&&m.tracks){const _=d.initSegment||d;this._bufferInitSegment(h,m.tracks,_,r),i.trigger(w.FRAG_PARSING_INIT_SEGMENT,{frag:_,id:a,tracks:m.tracks})}const b=m.initPTS,S=m.timescale;ne(b)&&(this.initPTS[d.cc]={baseTime:b,timescale:S},i.trigger(w.INIT_PTS_FOUND,{frag:d,id:a,initPTS:b,timescale:S}))}if(u&&g&&d.sn!=="initSegment"){const b=g.fragments[d.sn-1-g.startSN],S=d.sn===g.startSN,_=!b||d.cc>b.cc;if(o.independent!==!1){const{startPTS:C,endPTS:E,startDTS:v,endDTS:T}=u;if(c)c.elementaryStreams[u.type]={startPTS:C,endPTS:E,startDTS:v,endDTS:T};else if(u.firstKeyFrame&&u.independent&&r.id===1&&!_&&(this.couldBacktrack=!0),u.dropped&&u.independent){const B=this.getMainFwdBufferInfo(),L=(B?B.end:this.getLoadPosition())+this.config.maxBufferHole,R=u.firstKeyFramePTS?u.firstKeyFramePTS:C;if(!S&&L<R-this.config.maxBufferHole&&!_){this.backtrack(d);return}else _&&(d.gap=!0);d.setElementaryStreamInfo(u.type,d.start,E,d.start,T,!0)}else S&&C>gi&&(d.gap=!0);d.setElementaryStreamInfo(u.type,C,E,v,T),this.backtrackFragment&&(this.backtrackFragment=d),this.bufferFragmentData(u,d,c,r,S||_)}else if(S||_)d.gap=!0;else{this.backtrack(d);return}}if(y){const{startPTS:b,endPTS:S,startDTS:_,endDTS:C}=y;c&&(c.elementaryStreams[Re.AUDIO]={startPTS:b,endPTS:S,startDTS:_,endDTS:C}),d.setElementaryStreamInfo(Re.AUDIO,b,S,_,C),this.bufferFragmentData(y,d,c,r)}if(g&&p!=null&&(t=p.samples)!=null&&t.length){const b={id:a,frag:d,details:g,samples:p.samples};i.trigger(w.FRAG_PARSING_METADATA,b)}if(g&&f){const b={id:a,frag:d,details:g,samples:f.samples};i.trigger(w.FRAG_PARSING_USERDATA,b)}}_bufferInitSegment(e,t,a,i){if(this.state!==V.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:o,video:r,audiovideo:l}=t;if(o){let d=e.audioCodec;const c=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){d&&(d.indexOf("mp4a.40.5")!==-1?d="mp4a.40.2":d="mp4a.40.5");const h=o.metadata;h&&"channelCount"in h&&(h.channelCount||1)!==1&&c.indexOf("firefox")===-1&&(d="mp4a.40.5")}d&&d.indexOf("mp4a.40.5")!==-1&&c.indexOf("android")!==-1&&o.container!=="audio/mpeg"&&(d="mp4a.40.2",this.log(`Android: force audio codec to ${d}`)),e.audioCodec&&e.audioCodec!==d&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${d}"`),o.levelCodec=d,o.id="main",this.log(`Init audio buffer, container:${o.container}, codecs[selected/level/parsed]=[${d||""}/${e.audioCodec||""}/${o.codec}]`)}r&&(r.levelCodec=e.videoCodec,r.id="main",this.log(`Init video buffer, container:${r.container}, codecs[level/parsed]=[${e.videoCodec||""}/${r.codec}]`)),l&&this.log(`Init audiovideo buffer, container:${l.container}, codecs[level/parsed]=[${e.codecs}/${l.codec}]`),this.hls.trigger(w.BUFFER_CODECS,t),Object.keys(t).forEach(d=>{const h=t[d].initSegment;h!=null&&h.byteLength&&this.hls.trigger(w.BUFFER_APPENDING,{type:d,data:h,frag:a,part:null,chunkMeta:i,parent:a.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,le.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=V.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const a=e.currentTime;if(De.isBuffered(e,a)?t=this.getAppendedFrag(a):De.isBuffered(e,a+.1)&&(t=this.getAppendedFrag(a+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,o=t.level;(!i||t.sn!==i.sn||i.level!==o)&&(this.fragPlaying=t,this.hls.trigger(w.FRAG_CHANGED,{frag:t}),(!i||i.level!==o)&&this.hls.trigger(w.LEVEL_SWITCHED,{level:o}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,a=this.currentFrag;if(a&&ne(t)&&ne(a.programDateTime)){const i=a.programDateTime+(t-a.start)*1e3;return new Date(i)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class ds{static get version(){return"1.5.15"}static isMSESupported(){return cg()}static isSupported(){return bP()}static getMediaSource(){return Es()}static get Events(){return w}static get ErrorTypes(){return fe}static get ErrorDetails(){return N}static get DefaultConfig(){return ds.defaultConfig?ds.defaultConfig:og}static set DefaultConfig(e){ds.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Al,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,m6(e.debug||!1,"Hls instance");const t=this.config=fP(ds.DefaultConfig,e);this.userConfig=e,t.progressive&&pP(t);const{abrController:a,bufferController:i,capLevelController:o,errorController:r,fpsController:l}=t,d=new r(this),c=this.abrController=new a(this),h=this.bufferController=new i(this),u=this.capLevelController=new o(this),f=new l(this),p=new rB(this),m=new uB(this),g=t.contentSteeringController,y=g?new g(this):null,b=this.levelController=new gP(this,y),S=new UB(this),_=new yP(this.config),C=this.streamController=new CP(this,S,_);u.setStreamController(C),f.setStreamController(C);const E=[p,b,C];y&&E.splice(1,0,y),this.networkControllers=E;const v=[c,h,u,f,m,S];this.audioTrackController=this.createController(t.audioTrackController,E);const T=t.audioStreamController;T&&E.push(new T(this,S,_)),this.subtitleTrackController=this.createController(t.subtitleTrackController,E);const B=t.subtitleStreamController;B&&E.push(new B(this,S,_)),this.createController(t.timelineController,v),_.emeController=this.emeController=this.createController(t.emeController,v),this.cmcdController=this.createController(t.cmcdController,v),this.latencyController=this.createController(mB,v),this.coreComponents=v,E.push(d);const L=d.onErrorOut;typeof L=="function"&&this.on(w.ERROR,L,d)}createController(e,t){if(e){const a=new e(this);return t&&t.push(a),a}return null}on(e,t,a=this){this._emitter.on(e,t,a)}once(e,t,a=this){this._emitter.once(e,t,a)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,a=this,i){this._emitter.off(e,t,a,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,a){return this._emitter.emit(e,t,a)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(a){if(A.error("An internal error happened while handling event "+e+'. Error message: "'+a.message+'". Here is a stacktrace:',a),!this.triggeringException){this.triggeringException=!0;const i=e===w.ERROR;this.trigger(w.ERROR,{type:fe.OTHER_ERROR,details:N.INTERNAL_EXCEPTION,fatal:i,event:e,error:a}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){A.log("destroy"),this.trigger(w.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){A.log("attachMedia"),this._media=e,this.trigger(w.MEDIA_ATTACHING,{media:e})}detachMedia(){A.log("detachMedia"),this.trigger(w.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,a=this.url,i=this.url=Kr.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,A.log(`loadSource:${i}`),t&&a&&(a!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(w.MANIFEST_LOADING,{url:e})}startLoad(e=-1){A.log(`startLoad(${e})`),this.started=!0,this.networkControllers.forEach(t=>{t.startLoad(e)})}stopLoad(){A.log("stopLoad"),this.started=!1,this.networkControllers.forEach(e=>{e.stopLoad()})}resumeBuffering(){this.started&&this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.startLoad(-1)})}pauseBuffering(){this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.stopLoad()})}swapAudioCodec(){A.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){A.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){A.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){A.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){A.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){A.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){A.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(A.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){fB(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const a=e.length;for(let i=0;i<a;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:a}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,a)for(let o=i;o--;){const r=e[o].attrs["HDCP-LEVEL"];if(r&&r<=a)return o}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var t;return(t=this.audioTrackController)==null?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return(t=this.subtitleTrackController)==null||t.setSubtitleOption(e),null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}ds.defaultConfig=void 0;const xP=[(s=>(n.pushScopeId("data-v-d3c9a398"),s=s(),n.popScopeId(),s))(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[n.createElementVNode("path",{d:"M5 15L15 5",stroke:"white","stroke-width":"1.7","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M15 15L5 5",stroke:"white","stroke-width":"1.7","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],vP={class:"stories__content"},AP={class:"story-container-game"},LP={class:"story-circle"},IP={class:"story-result"},RP={class:"stories__content__stories-bar"},BP={class:"stories__content__video"},NP={class:"stories__content__video__info__date"},DP={class:"stories__content__video__info__data"},PP=qe({__name:"GameStories",props:{stories:{type:Array,default:()=>[]},startStoryIndex:{type:Number,default:0},isFirstGameStories:{type:Boolean,default:!1},isLastGameStories:{type:Boolean,default:!1}},emits:["close","last-story-index","swipe","video-play","video-next-back"],setup(s,{emit:e}){const t=s;n.useCssVars(se=>({"559904cd":y.value,"57a9d8d4":b.value,"57d750a1":v.value}));const a=Ho(),o=[{ids:[607,608],name:"Oportunidad de Gol"},{ids:[12,55],name:"Gol"},{ids:[54,35],name:"Autogol"},{ids:[14,52],name:"Tarjeta Amarilla"},{ids:[15,53],name:"Tarjeta Roja"},{ids:[466,477],name:"Penal Recibido"}].reduce((se,Ee)=>(Ee.ids.forEach(Te=>{se.set(Te,Ee.name)}),se),new Map),r=n.ref(null),l=n.ref(null),d=n.ref([]),c=n.ref(0),h=n.ref(null),u=n.ref(0),f=n.ref(0),p=n.ref(0),m=n.ref(!1),g=n.ref(0),y=n.ref("auto"),b=n.ref("100%"),S=n.ref(null),_=n.ref(0),C=n.ref(null),E=n.ref(null),v=n.computed(()=>Z()?"7vw":"16px"),T=n.computed(()=>d.value[c.value]),B=n.computed(()=>({"--icon-play":`url(${a}/icnplay1.svg)`}));function L(){l.value.muted=!1,l.value.play()}const R=n.computed(()=>!T.value.isHls&&["ios"].includes(Wo()));n.watch(()=>T.value,se=>{se&&K()}),n.watch(()=>t.stories,se=>{if(se.length){c.value=0,p.value=0;const Ee=se.map(Te=>({...Te,progress:0,isHls:Te.url.includes(".m3u8"),date:`${Te.date.getDate()}, ${Qh[Te.date.getMonth()]} ${Te.date.getFullYear()}`,data:`${o.get(Te.categoryId)} ${Mx(Te.player.player_name)}`})).sort((Te,Fe)=>Te.startTime-Fe.startTime);t.startStoryIndex>0&&t.startStoryIndex<Ee.length-1&&(Ee.forEach((Te,Fe)=>{Fe<=t.startStoryIndex&&(Te.progress=100)}),c.value=t.startStoryIndex+1,p.value=c.value),d.value=[...Ee]}},{immediate:!0}),n.watch(()=>r.value,se=>{se&&$()},{flush:"post"}),n.watch(()=>h.value,se=>{se&&(Fx()?(se.addEventListener("touchstart",he),se.addEventListener("touchend",J)):(se.addEventListener("mousedown",he),se.addEventListener("mouseup",J)))},{flush:"post"});function $(){l.value=new Ps("#video-plyr",{controls:[],autoplay:!0,playsinline:!0}),l.value.on("loadeddata",ae(l.value)),l.value.on("timeupdate",oe()),K(T.value),l.value.isDestroyed=!1}function K(){T.value.isHls?z(T.value):l.value&&(l.value.source={type:"video",sources:[{src:T.value.url,type:"video/mp4"}]})}function z(se){if(r.value)if(ds.isSupported()){r.value.src=null;let Ee=new ds;Ee.loadSource(se.url),Ee.attachMedia(r.value)}else l.value.source={type:"video",sources:[{src:se.url,type:"video/mp4"}]}}function ae(){const se=document.querySelector(".plyr__video-wrapper");return se&&(_.value=se.getBoundingClientRect()),()=>{l.value.duration>0&&(l.value.currentTime=T.value.startTime||0,l.value.muted=!1,l.value.play(),e("video-play",T.value))}}function oe(){return Ce(),()=>{T.value.currentTime=l.value.currentTime,T.value.progress=(l.value.currentTime-T.value.startTime)/T.value.duration*100,(l.value.currentTime-T.value.startTime)/T.value.duration*100===0?Z()&&(m.value=!0):Z()&&(m.value=!1),(l.value.currentTime-T.value.startTime)/T.value.duration*100<0?E.value&&!Z()&&(E.value.style="display: none",b.value="100%"):E.value&&!Z()&&(E.value.style="display: block",b.value="auto"),l.value.currentTime>=T.value.endTime&&(l.value.pause(),ie())}}function ie(se=1){const Ee=c.value+se;Ee<0?t.isFirstGameStories?l.value&&(l.value.currentTime=T.value.startTime):de("right",T.value):Ee===d.value.length?t.isLastGameStories?q():de("left",T.value):(c.value=Ee,se===1&&(p.value=c.value))}function ce(){u.value>f.value?de("left",T.value):u.value<f.value?de("right",T.value):Q()}function de(se,Ee){e("last-story-index",p.value),e("swipe",{direction:se,currentPlay:Ee})}function Q(){const se=window.innerWidth/2,Ee=u.value<se,Te=T.value.progress;T.value.progress=Ee?0:100,l.value.pause(),e("video-next-back",{eventName:Ee?"stories_video_anterior":"stories_video_siguiente",currentPlay:{...T.value,progress:Te}}),ie(Ee?-1:1)}function q(){l.value.pause(),l.value.muted=!0,e("last-story-index",p.value),e("close",T.value)}function he(se){u.value=se.changedTouches?se.changedTouches[0].clientX:se.clientX}function J(se){f.value=se.changedTouches?se.changedTouches[0].clientX:se.clientX,ce()}function Z(){return/iPhone|iPad/i.test(navigator.userAgent)}function ue(){window.scrollTo(0,100)}function ge(){if(window.scrollTo(0,100),Wo()=="android"){const se=document.querySelector("#stories");se.requestFullscreen(se)}}function Ce(){if(window.ResizeObserver)S.value=new window.ResizeObserver(()=>{C.value&&_.value.height>0&&(C.value.getBoundingClientRect().height>610?y.value="auto":y.value="100dvh",C.value.getBoundingClientRect().height>610?b.value="100%":b.value="auto")}),S.value.observe(C.value);else throw new Error("Resize observer not supported!")}return n.onMounted(()=>{g.value=document.documentElement.scrollTop||document.body.scrollTop,window.scrollTo(0,100),Z()?(window.addEventListener("resize",ue),ue()):(window.addEventListener("orientationchange",ge),ge()),setTimeout(()=>{Ce()},500)}),n.onBeforeUnmount(()=>{window.scrollTo(0,g.value),Z()?window.removeEventListener("resize",ue):(Wo()=="android"&&document.exitFullscreen(),window.removeEventListener("orientationchange",ge)),S.value&&(S.value.disconnect(),S.value=null)}),(se,Ee)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["stories",Z()?"stories-safe-areas-iphone":""]),id:"stories",ref_key:"eStories",ref:C,style:n.normalizeStyle(B.value)},[n.createElementVNode("div",{class:n.normalizeClass(["stories__close",Z()?"stories-safe-areas-iphone":""]),onClick:q},xP,2),n.createElementVNode("div",vP,[n.createElementVNode("div",AP,[n.createElementVNode("div",LP,[n.createElementVNode("div",{class:"circle-item-home",style:n.normalizeStyle(`background-image: url(${T.value.thumbnail.logoHomeTeam})`)},null,4),n.createElementVNode("div",{class:"circle-item-away",style:n.normalizeStyle(`background-image: url(${T.value.thumbnail.logoAwayTeam})`)},null,4)]),n.createElementVNode("div",IP,n.toDisplayString(T.value.header.label),1)]),n.createElementVNode("div",{ref_key:"overlay",ref:h,class:"stories__content__overlay"},null,512),n.createElementVNode("div",RP,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,(Te,Fe)=>(n.openBlock(),n.createElementBlock("div",{key:Fe,class:"stories__content__stories-bar__item"},[n.createElementVNode("div",{class:"stories__content__stories-bar__item__progress",style:n.normalizeStyle({width:`${Te.progress}%`})},null,4)]))),128))]),n.createElementVNode("div",BP,[n.createElementVNode("div",{class:"stories__content__video__info",ref_key:"videoInfo",ref:E},[n.createElementVNode("div",NP,n.toDisplayString(T.value.date),1),n.createElementVNode("div",DP,n.toDisplayString(T.value.data),1)],512),n.createElementVNode("video",{ref_key:"player",ref:r,id:"video-plyr",controls:"",preload:"auto","data-setup":"{}",playsinline:""},null,512)])]),R.value?(n.openBlock(),n.createElementBlock("button",{key:0,id:"btn_play_ios",style:n.normalizeStyle(m.value?"display:block":"display:none"),onClick:L},null,4)):n.createCommentVNode("",!0)],6))}},[["__scopeId","data-v-d3c9a398"]]),OP={playlist_id:"GPI_default2022-12-08T02:51:56.334+00:00-PI-0",last_played_index:0,group_id:"1",total_plays:55,playlist_type:"1",group_playlist_id:"GPI_default2022-12-08T02:51:56.334+00:00",user_id:"goltesting",created_at:"2023-03-30T15:42:36.402+00:00",playlist:[[136731235,"Liga MX","Apertura 2022",69929,"Aldrete Rodriguez, Adrian","Quintero Huitron, Daniel","Estadio Olímpico Universitario, Ciudad de México.","1 - 0","1 - 0","2022-07-17T05:00:00.000Z","Universidad Nacional","https://az755631.vo.msecnd.net/teams-80/11.png","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png",12,"Goals",1259,1278,20,1266,"https://golstatsbets.blob.core.windows.net/video-player/69929_1.mp4"],[139820484,"Liga MX","Apertura 2022",70042,"Davila Zavala, Victor","Mejia, Oscar ","Estadio Nuevo Monumental, Rafaela.","3 - 1","1 - 0","2022-09-18T05:00:00.000Z","Leon","https://az755631.vo.msecnd.net/teams-80/173.png","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png",12,"Goals",1501,1524,24,1512,"https://golstatsbets.blob.core.windows.net/video-player/70042_1.mp4"],[139566427,"Liga MX","Apertura 2022",69989,"Zaldivar Caviedes, Angel","Guerrero Ramirez, Fernando","Estadio Akron, Zapopan.","1 - 4","1 - 0","2022-09-13T05:00:00.000Z","Guadalajara","https://az755631.vo.msecnd.net/teams-80/1.png","Tigres de la UANL","https://az755631.vo.msecnd.net/teams-80/16.png",12,"Goals",6569,6588,108,6576,"https://golstatsbets.blob.core.windows.net/video-player/69989_1.mp4"],[139441913,"Liga MX","Apertura 2022",70031,"Vega Rojas, Alexis","Quintero Huitron, Daniel","Estadio Akron, Zapopan.","1 - 0","1 - 0","2022-09-10T05:00:00.000Z","Guadalajara","https://az755631.vo.msecnd.net/teams-80/1.png","Puebla FC","https://az755631.vo.msecnd.net/teams-80/10.png",12,"Goals",6207,6237,103,6225,"https://golstatsbets.blob.core.windows.net/video-player/70031_1.mp4"],[139566063,"Liga MX","Apertura 2022",69989,"Guzman Palomeque, Nahuel","Guerrero Ramirez, Fernando","Estadio Akron, Zapopan.","1 - 4","0 - 0","2022-09-13T05:00:00.000Z","Guadalajara","https://az755631.vo.msecnd.net/teams-80/1.png","Tigres de la UANL","https://az755631.vo.msecnd.net/teams-80/16.png",39,"Saves",2554,2573,41,2561,"https://golstatsbets.blob.core.windows.net/video-player/69989_1.mp4"],[138276096,"Liga MX","Apertura 2022",69983,"Cortizo de la Piedra, Jordi","Guerrero Ramirez, Fernando","Estadio Cuauhtemoc, Puebla.","2 - 2","1 - 0","2022-08-16T05:00:00.000Z","Puebla FC","https://az755631.vo.msecnd.net/teams-80/10.png","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png",12,"Goals",5020,5046,83,5034,"https://golstatsbets.blob.core.windows.net/video-player/69983_1.mp4"],[139285589,"Liga MX","Apertura 2022",70021,"Cortizo de la Piedra, Jordi","Escobedo, Adonai","Estadio Cuauhtemoc, Puebla.","2 - 2","1 - 0","2022-09-07T05:00:00.000Z","Puebla FC","https://az755631.vo.msecnd.net/teams-80/10.png","Pachuca","https://az755631.vo.msecnd.net/teams-80/9.png",12,"Goals",1123,1152,18,1140,"https://golstatsbets.blob.core.windows.net/video-player/70021_1.mp4"],[139294964,"Liga MX","Apertura 2022",70022,"Cordova Reyes, Francisco","Ortiz Nava, Marco Antonio","Estadio Universitario, San Nicolás de los Garza.","3 - 1","1 - 0","2022-09-07T05:00:00.000Z","Tigres de la UANL","https://az755631.vo.msecnd.net/teams-80/16.png","Toluca","https://az755631.vo.msecnd.net/teams-80/18.png",12,"Goals",2564,2583,41,2571,"https://golstatsbets.blob.core.windows.net/video-player/70022_1.mp4"],[137782451,"Liga MX","Apertura 2022",69968,"Orrantia Trevino, Carlos","Macias Romo, Oscar","Estadio TSM Corona, Torreón.","4 - 0","1 - 0","2022-08-06T05:00:00.000Z","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png",12,"Goals",4662,4693,77,4681,"https://golstatsbets.blob.core.windows.net/video-player/69968_1.mp4"],[136551560,"Liga MX","Apertura 2022",69924,"Sanchez Guerrero, Richard","Escobedo, Adonai","Estadio Azteca, Ciudad de México.","1 - 0","1 - 0","2022-07-13T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","Toluca","https://az755631.vo.msecnd.net/teams-80/18.png",12,"Goals",7032,7064,116,7052,"https://golstatsbets.blob.core.windows.net/video-player/69924_1.mp4"],[136391881,"Liga MX","Apertura 2022",69914,"Hurtado Herrera, Aviles","Ramos Palazuelos, Cesar","Estadio Hidalgo, Pachuca.","2 - 0","1 - 0","2022-07-04T05:00:00.000Z","Pachuca","https://az755631.vo.msecnd.net/teams-80/9.png","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png",12,"Goals",4903,4937,81,4925,"https://golstatsbets.blob.core.windows.net/video-player/69914_1.mp4"],[138158049,"Liga MX","Apertura 2022",69979,"Volpi, Tiago Luis","Hernandez Gomez, Fernando","Estadio Azteca, Ciudad de México.","2 - 3","0 - 1","2022-08-14T05:00:00.000Z","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png","Toluca","https://az755631.vo.msecnd.net/teams-80/18.png",39,"Saves",7207,7226,119,7214,"https://golstatsbets.blob.core.windows.net/video-player/69979_1.mp4"],[138124884,"Liga MX","Apertura 2022",69978,"Vargas Gil, Camilo","Ortiz Nava, Marco Antonio","Default","1 - 1","0 - 0","2022-08-13T05:00:00.000Z","Guadalajara","https://az755631.vo.msecnd.net/teams-80/1.png","Atlas","https://az755631.vo.msecnd.net/teams-80/4.png",39,"Saves",6080,6099,100,6087,"https://golstatsbets.blob.core.windows.net/video-player/69978_1.mp4"],[139635463,"Liga MX","Apertura 2022",69950,"Fidalgo Fernandez, Alvaro","Hernandez Gomez, Fernando","Estadio Azteca, Ciudad de México.","3 - 3","0 - 2","2022-09-14T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png",10,"Assists",7096,7123,118,7111,"https://golstatsbets.blob.core.windows.net/video-player/69950_1.mp4"],[139769221,"Liga MX","Apertura 2022",70039,"Ochoa Magana, Guillermo","Escobedo, Adonai","Estadio Azteca, Ciudad de México.","2 - 1","0 - 0","2022-09-17T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","Guadalajara","https://az755631.vo.msecnd.net/teams-80/1.png",39,"Saves",4567,4586,76,4574,"https://golstatsbets.blob.core.windows.net/video-player/70039_1.mp4"],[139405626,"Liga MX","Apertura 2022",70028,"Acevedo Lopez, Carlos","Santander, Luis Enrique","Estadio La Corregidora, Querétaro.","3 - 3","0 - 2","2022-09-10T05:00:00.000Z","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png",55,"Goals",7452,7471,124,7459,"https://golstatsbets.blob.core.windows.net/video-player/70028_1.mp4"],[139410464,"Liga MX","Apertura 2022",70030,"Gonzalez Vela Alvizu, Julio","Hernandez Gomez, Fernando","Estadio Nemesio Diez, Toluca.","2 - 2","0 - 1","2022-09-10T05:00:00.000Z","Toluca","https://az755631.vo.msecnd.net/teams-80/18.png","Universidad Nacional","https://az755631.vo.msecnd.net/teams-80/11.png",55,"Goals",7467,7486,124,7474,"https://golstatsbets.blob.core.windows.net/video-player/70030_1.mp4"],[139902797,"Liga MX","Apertura 2022",70038,"Quinones Quinones, Julian","Ortiz Nava, Marco Antonio","Estadio BBVA Bancomer, Guadalupe","2 - 0","0 - 0","2022-09-17T05:00:00.000Z","Rayados de Monterrey","https://az755631.vo.msecnd.net/teams-80/7.png","Atlas","https://az755631.vo.msecnd.net/teams-80/4.png",702,"Con enfrentamiento",2334,2353,38,2341,"https://golstatsbets.blob.core.windows.net/video-player/70038_1.mp4"],[139771860,"Liga MX","Apertura 2022",70038,"Andrada, Esteban ","Ortiz Nava, Marco Antonio","Estadio BBVA Bancomer, Guadalupe","2 - 0","0 - 0","2022-09-17T05:00:00.000Z","Rayados de Monterrey","https://az755631.vo.msecnd.net/teams-80/7.png","Atlas","https://az755631.vo.msecnd.net/teams-80/4.png",39,"Saves",6859,6878,113,6866,"https://golstatsbets.blob.core.windows.net/video-player/70038_1.mp4"],[136392028,"Liga MX","Apertura 2022",69914,"Hurtado Herrera, Aviles","Ramos Palazuelos, Cesar","Estadio Hidalgo, Pachuca.","2 - 0","0 - 0","2022-07-04T05:00:00.000Z","Pachuca","https://az755631.vo.msecnd.net/teams-80/9.png","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png",607,"Oportunidad de gol",335,374,5,342,"https://golstatsbets.blob.core.windows.net/video-player/69914_1.mp4"],[136467302,"Liga MX","Apertura 2022",69909,"Jurado Roca, Sebastian","Mejia, Oscar ","Estadio Universitario, San Nicolás de los Garza.","2 - 3","0 - 0","2022-07-02T05:00:00.000Z","Tigres de la UANL","https://az755631.vo.msecnd.net/teams-80/16.png","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png",39,"Saves",879,898,14,886,"https://golstatsbets.blob.core.windows.net/video-player/69909_1.mp4"],[138402354,"Liga MX","Apertura 2022",69990,"Beltran Cruz, Fernando","Mejia, Oscar ","Estadio Victoria, Aguascalientes.","0 - 4","0 - 1","2022-08-19T05:00:00.000Z","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png","Guadalajara","https://az755631.vo.msecnd.net/teams-80/1.png",12,"Goals",4517,4551,75,4539,"https://golstatsbets.blob.core.windows.net/video-player/69990_1.mp4"],[138157481,"Liga MX","Apertura 2022",69979,"Meneses Villarroel, Jean","Hernandez Gomez, Fernando","Estadio Azteca, Ciudad de México.","2 - 3","0 - 1","2022-08-14T05:00:00.000Z","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png","Toluca","https://az755631.vo.msecnd.net/teams-80/18.png",12,"Goals",1900,1925,31,1913,"https://golstatsbets.blob.core.windows.net/video-player/69979_1.mp4"],[140106188,"Liga MX","Apertura 2022",69964,"Cortizo de la Piedra, Jordi","Escobedo, Adonai","Estadio Cuauhtemoc, Puebla.","2 - 1","1 - 0","2022-09-23T05:00:00.000Z","Puebla FC","https://az755631.vo.msecnd.net/teams-80/10.png","Universidad Nacional","https://az755631.vo.msecnd.net/teams-80/11.png",12,"Goals",461,484,7,472,"https://golstatsbets.blob.core.windows.net/video-player/69964_1.mp4"],[139839994,"Liga MX","Apertura 2022",70043,"Garcia Carpizo, Brian","Montano Robles, Diego","Estadio Caliente, Tijuana.","1 - 1","0 - 1","2022-09-18T05:00:00.000Z","Club Tijuana","https://az755631.vo.msecnd.net/teams-80/17.png","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png",12,"Goals",2112,2133,34,2121,"https://golstatsbets.blob.core.windows.net/video-player/70043_1.mp4"],[139403868,"Liga MX","Apertura 2022",70028,"Suarez, Leonardo Gabriel","Santander, Luis Enrique","Estadio La Corregidora, Querétaro.","3 - 3","0 - 1","2022-09-10T05:00:00.000Z","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png",12,"Goals",4296,4315,71,4303,"https://golstatsbets.blob.core.windows.net/video-player/70028_1.mp4"],[139371616,"Liga MX","Apertura 2022",70027,"Gallardo Vasconcelos, Jesus","Montano Robles, Diego","Estadio Olimpico Benito Juarez, Ciudad Juarez.","0 - 1","0 - 1","2022-09-09T05:00:00.000Z","FC Juarez","https://az755631.vo.msecnd.net/teams-80/3014.png","Rayados de Monterrey","https://az755631.vo.msecnd.net/teams-80/7.png",12,"Goals",5724,5750,94,5738,"https://golstatsbets.blob.core.windows.net/video-player/70027_1.mp4"],[139294028,"Liga MX","Apertura 2022",70022,"Thauvin, Florian","Ortiz Nava, Marco Antonio","Estadio Universitario, San Nicolás de los Garza.","3 - 1","2 - 0","2022-09-07T05:00:00.000Z","Tigres de la UANL","https://az755631.vo.msecnd.net/teams-80/16.png","Toluca","https://az755631.vo.msecnd.net/teams-80/18.png",12,"Goals",6011,6030,99,6018,"https://golstatsbets.blob.core.windows.net/video-player/70022_1.mp4"],[137023432,"Liga MX","Apertura 2022",69939,"Gignac, Andre Pierre","Ortiz Nava, Marco Antonio","Estadio Universitario, San Nicolás de los Garza.","2 - 0","1 - 0","2022-07-23T05:00:00.000Z","Tigres de la UANL","https://az755631.vo.msecnd.net/teams-80/16.png","Atlas","https://az755631.vo.msecnd.net/teams-80/4.png",12,"Goals",2829,2854,47,2842,"https://golstatsbets.blob.core.windows.net/video-player/69939_1.mp4"],[139303531,"Liga MX","Apertura 2022",70023,"Alves da Silva, Daniel","Ramos Palazuelos, Cesar","Estadio Olímpico Universitario, Ciudad de México.","4 - 1","0 - 0","2022-09-07T05:00:00.000Z","Universidad Nacional","https://az755631.vo.msecnd.net/teams-80/11.png","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png",702,"Con enfrentamiento",262,293,3,278,"https://golstatsbets.blob.core.windows.net/video-player/70023_1.mp4"],[139303334,"Liga MX","Apertura 2022",70023,"Alves da Silva, Daniel","Ramos Palazuelos, Cesar","Estadio Olímpico Universitario, Ciudad de México.","4 - 1","0 - 0","2022-09-07T05:00:00.000Z","Universidad Nacional","https://az755631.vo.msecnd.net/teams-80/11.png","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png",10,"Assists",5256,5283,87,5271,"https://golstatsbets.blob.core.windows.net/video-player/70023_1.mp4"],[139633795,"Liga MX","Apertura 2022",69950,"Valdes Contreras, Diego","Hernandez Gomez, Fernando","Estadio Azteca, Ciudad de México.","3 - 3","0 - 1","2022-09-14T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png",607,"Oportunidad de gol",675,701,10,689,"https://golstatsbets.blob.core.windows.net/video-player/69950_1.mp4"],[139242728,"Liga MX","Apertura 2022",70020,"Valdes Contreras, Diego","Caceres Hernandez, Victor Alfonso","Estadio Azteca, Ciudad de México.","3 - 0","0 - 0","2022-09-06T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","CA San Luis","https://az755631.vo.msecnd.net/teams-80/13.png",10,"Assists",2841,2861,46,2849,"https://golstatsbets.blob.core.windows.net/video-player/70020_1.mp4"],[138747150,"Liga MX","Apertura 2022",7e4,"Valdes Contreras, Diego","Miranda Galindo, Erick Yair","Default","1 - 3","0 - 1","2022-08-26T05:00:00.000Z","Mazatlan FC","https://az755631.vo.msecnd.net/teams-80/8.png","America","https://az755631.vo.msecnd.net/teams-80/2.png",12,"Goals",2425,2448,39,2436,"https://golstatsbets.blob.core.windows.net/video-player/70000_1.mp4"],[138462163,"Liga MX","Apertura 2022",69995,"Valdes Contreras, Diego","Santander, Luis Enrique","Estadio Azteca, Ciudad de México.","7 - 0","1 - 0","2022-08-20T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png",12,"Goals",3424,3443,56,3431,"https://golstatsbets.blob.core.windows.net/video-player/69995_1.mp4"],[138832474,"Liga MX","Apertura 2022",70005,"Sambueza, Rubens Oscar","Guerrero Ramirez, Fernando","Estadio TSM Corona, Torreón.","4 - 1","1 - 1","2022-08-28T05:00:00.000Z","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png","CA San Luis","https://az755631.vo.msecnd.net/teams-80/13.png",12,"Goals",6830,6859,113,6847,"https://golstatsbets.blob.core.windows.net/video-player/70005_1.mp4"],[137178428,"Liga MX","Apertura 2022",69942,"Ibarra Mina, Alex Renato","Montano Robles, Diego","Estadio Jalisco, Guadalajara.","1 - 2","0 - 1","2022-07-26T05:00:00.000Z","Atlas","https://az755631.vo.msecnd.net/teams-80/4.png","Club Tijuana","https://az755631.vo.msecnd.net/teams-80/17.png",12,"Goals",2786,2811,45,2799,"https://golstatsbets.blob.core.windows.net/video-player/69942_1.mp4"],[138339473,"Liga MX","Apertura 2022",69985,"Canelo, Pedro Alexis","Referee 1","Azteca","1 - 2","0 - 0","2022-08-17T05:00:00.000Z","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png","Club Tijuana","https://az755631.vo.msecnd.net/teams-80/17.png",10,"Assists",5133,5159,85,5147,"https://golstatsbets.blob.core.windows.net/video-player/69985_1.mp4"],[136701989,"Liga MX","Apertura 2022",69927,"Gimenez, Santiago Tomas","Macias Romo, Oscar","Estadio Jalisco, Guadalajara.","3 - 2","0 - 1","2022-07-16T05:00:00.000Z","Atlas","https://az755631.vo.msecnd.net/teams-80/4.png","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png",12,"Goals",1374,1397,22,1385,"https://golstatsbets.blob.core.windows.net/video-player/69927_1.mp4"],[139678329,"Liga MX","Apertura 2022",70049,"Antuna Romero, Carlos","Ortiz Nava, Marco Antonio","Estadio Azteca, Ciudad de México.","2 - 1","0 - 0","2022-09-15T05:00:00.000Z","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png","Leon","https://az755631.vo.msecnd.net/teams-80/173.png",10,"Assists",6728,6752,111,6740,"https://golstatsbets.blob.core.windows.net/video-player/70049_1.mp4"],[139054131,"Liga MX","Apertura 2022",70010,"Davila Zavala, Victor","Ortiz Nava, Marco Antonio","Estadio Victoria, Aguascalientes.","3 - 2","1 - 1","2022-09-02T05:00:00.000Z","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png","Leon","https://az755631.vo.msecnd.net/teams-80/173.png",12,"Goals",6636,6661,110,6649,"https://golstatsbets.blob.core.windows.net/video-player/70010_1.mp4"],[137503273,"Liga MX","Apertura 2022",69962,"Davila Zavala, Victor","Macias Romo, Oscar","Estadio Nou Camp, Le&ocuate;n.","3 - 2","1 - 0","2022-07-31T05:00:00.000Z","Leon","https://az755631.vo.msecnd.net/teams-80/173.png","America","https://az755631.vo.msecnd.net/teams-80/2.png",12,"Goals",1940,1965,31,1953,"https://golstatsbets.blob.core.windows.net/video-player/69962_1.mp4"],[139308851,"Liga MX","Apertura 2022",70025,"Benedetti Roa, Nicolas","Hernandez Gomez, Fernando","Default","1 - 0","1 - 0","2022-09-07T05:00:00.000Z","Mazatlan FC","https://az755631.vo.msecnd.net/teams-80/8.png","Atlas","https://az755631.vo.msecnd.net/teams-80/4.png",12,"Goals",1867,1891,31,1879,"https://golstatsbets.blob.core.windows.net/video-player/70025_1.mp4"],[138116335,"Liga MX","Apertura 2022",69976,"Benedetti Roa, Nicolas","Galvan Basulto, Eduardo","Estadio Nou Camp, Le&ocuate;n.","0 - 3","0 - 1","2022-08-13T05:00:00.000Z","Leon","https://az755631.vo.msecnd.net/teams-80/173.png","Mazatlan FC","https://az755631.vo.msecnd.net/teams-80/8.png",12,"Goals",591,629,9,617,"https://golstatsbets.blob.core.windows.net/video-player/69976_1.mp4"],[136791022,"Liga MX","Apertura 2022",69932,"Benedetti Roa, Nicolas","Camacho Peregrina, Jorge","Estadio Hidalgo, Pachuca.","1 - 1","0 - 1","2022-07-18T05:00:00.000Z","Pachuca","https://az755631.vo.msecnd.net/teams-80/9.png","Mazatlan FC","https://az755631.vo.msecnd.net/teams-80/8.png",12,"Goals",4284,4315,71,4303,"https://golstatsbets.blob.core.windows.net/video-player/69932_1.mp4"],[139414938,"Liga MX","Apertura 2022",70026,"Batista Ochoa, Facundo","Guerrero Ramirez, Fernando","Estadio Victoria, Aguascalientes.","1 - 2","1 - 0","2022-09-10T05:00:00.000Z","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png","America","https://az755631.vo.msecnd.net/teams-80/2.png",12,"Goals",461,490,7,478,"https://golstatsbets.blob.core.windows.net/video-player/70026_1.mp4"],[139051051,"Liga MX","Apertura 2022",70010,"Batista Ochoa, Facundo","Ortiz Nava, Marco Antonio","Estadio Victoria, Aguascalientes.","3 - 2","1 - 0","2022-09-02T05:00:00.000Z","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png","Leon","https://az755631.vo.msecnd.net/teams-80/173.png",12,"Goals",2731,2750,45,2738,"https://golstatsbets.blob.core.windows.net/video-player/70010_1.mp4"],[137828273,"Liga MX","Apertura 2022",69970,"Batista Ochoa, Facundo","Galvan Basulto, Eduardo","Estadio Alfonso Lastras Ramírez, San Luis Potosí.","1 - 2","0 - 1","2022-08-07T05:00:00.000Z","CA San Luis","https://az755631.vo.msecnd.net/teams-80/13.png","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png",12,"Goals",849,870,13,858,"https://golstatsbets.blob.core.windows.net/video-player/69970_1.mp4"],[139025773,"Liga MX","Apertura 2022",70009,"Nahuelpan Osten, Ariel","Lopez Penuelas, Ismael","Estadio La Corregidora, Querétaro.","1 - 1","1 - 0","2022-09-01T05:00:00.000Z","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png","Puebla FC","https://az755631.vo.msecnd.net/teams-80/10.png",12,"Goals",1454,1481,24,1472,"https://golstatsbets.blob.core.windows.net/video-player/70009_1.mp4"],[138063913,"Liga MX","Apertura 2022",69973,"Gonzalez Gonzalez, Arturo","Pacheco Larios, Guillermo","Estadio Victoria, Aguascalientes.","1 - 2","0 - 1","2022-08-12T05:00:00.000Z","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png","Rayados de Monterrey","https://az755631.vo.msecnd.net/teams-80/7.png",12,"Goals",6119,6138,101,6126,"https://golstatsbets.blob.core.windows.net/video-player/69973_1.mp4"],[137780455,"Liga MX","Apertura 2022",69966,"Gonzalez Gonzalez, Arturo","Ortiz Nava, Marco Antonio","Estadio BBVA Bancomer, Guadalupe","5 - 1","1 - 0","2022-08-06T05:00:00.000Z","Rayados de Monterrey","https://az755631.vo.msecnd.net/teams-80/7.png","Leon","https://az755631.vo.msecnd.net/teams-80/173.png",12,"Goals",2292,2321,38,2309,"https://golstatsbets.blob.core.windows.net/video-player/69966_1.mp4"],[140090831,"Liga MX","Apertura 2022",69950,"Suarez, Leonardo Gabriel","Hernandez Gomez, Fernando","Estadio Azteca, Ciudad de México.","3 - 3","0 - 1","2022-09-14T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png",12,"Goals",585,612,9,600,"https://golstatsbets.blob.core.windows.net/video-player/69950_1.mp4"],[140090832,"Liga MX","Apertura 2022",69950,"Suarez, Leonardo Gabriel","Hernandez Gomez, Fernando","Estadio Azteca, Ciudad de México.","3 - 3","0 - 2","2022-09-14T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png",12,"Goals",1175,1197,18,1182,"https://golstatsbets.blob.core.windows.net/video-player/69950_1.mp4"],[139227464,"Liga MX","Apertura 2022",70018,"Suarez, Leonardo Gabriel","Quintero Huitron, Daniel","Estadio TSM Corona, Torreón.","3 - 1","1 - 0","2022-09-06T05:00:00.000Z","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png",12,"Goals",7011,7034,116,7022,"https://golstatsbets.blob.core.windows.net/video-player/70018_1.mp4"],[138830649,"Liga MX","Apertura 2022",70005,"Suarez, Leonardo Gabriel","Guerrero Ramirez, Fernando","Estadio TSM Corona, Torreón.","4 - 1","1 - 0","2022-08-28T05:00:00.000Z","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png","CA San Luis","https://az755631.vo.msecnd.net/teams-80/13.png",12,"Goals",4297,4380,71,4304,"https://golstatsbets.blob.core.windows.net/video-player/70005_1.mp4"]]},FP=new Map([[1,45],[2,90],[3,105],[4,120]]),MP=[{id:12,name:"Gol"},{id:55,name:"Gol"},{id:39,name:"Atajada"},{id:10,name:"Asistencia"},{id:702,name:"1vs1 exitoso ofensivo"},{id:607,name:"Oportunidad de gol"}].reduce((s,e)=>(s.set(e.id,e.name),s),new Map);let xa=null,yi=null,bi="";const Ft=n6(),$P={components:{GSCSeasonSelect:iI,GSCTournamentSelect:OL,GSCGames:yv,GSCSlider:ea,GSCGridTeamsMatches:uy,GSCPlayersLanding:ly,GSCTops:gA,GSCTableCalendar:AC,DiscoverVideos:s6,CarouselFullScreen:lL,Stories:PP},setup(){const s=n.ref("landingref"),{elementSize:e}=H0(s);return{landingref:s,elementSize:e}},props:{currentSeasonId:{type:Number,default:0},isFemale:{type:Boolean,default:!1},showStories:{type:Boolean,default:!0},season:{type:Number,default:1772},isplayer:{type:Boolean,default:!1},user:{type:Object,default:()=>{}},privileges:{type:Object,default:()=>{}},team:{type:Number,default:0},player:{type:Number,default:0},gamesPerMatchDay:{type:Number,default:0,validator(s){return!Number.isNaN(s)&&s>=0}},token:{type:String,default:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"},tournamentsApiUrl:{type:String,default:""},defaultMediaPlayerSeason:{type:Number,default:0},checkLiveGamesIntervalMinutes:{type:Number,default:2}},data(){return{isPreviousDataLoaded:!1,imagesUrl:Ho(),roundAbbreviationByGameId:new Map,isCarouselFullScreenVisible:!1,isPlaySeeker:!1,keyupdate:0,carouselPlayerQueue:[],gameEventsUrl:"https://al2nv2dmkc.execute-api.us-west-2.amazonaws.com/prod/mxm/",defaultGameId:0,lastSeasonsIds:[],arrayGamesAdd:[],gamesPages:new Map,show_stories:!0,selectedRoundKeyIndex:0,currentStoriesLastIndex:0,selectedRoundKeyIndexVideo:0,selectedRound:"0",selectedRoundVideos:"0",isLeagueSelected:!1,fullTournamentScheduleFull:[],fullTournamentScheduleFullGoals:[],defaultMatchDayKey:null,isCupTournament:!1,retries:3,userTeamGames:[],userTeamGamesForVideos:[],isCupLegacyTournament:!1,tournamentScheduleKeys:[],tournamentScheduleKeysGoals:[],currentTournamentGames:null,currentTournamentTeams:null,gamesUrl:"https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason/",gamesUrl2:"https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?",seasonSelected:{},seasonSelectedDropDowns:{},seasonsSelected:[],gamesAllStories:[],fullTournamentSchedule:{},tournamentSelected:{id:0},tournamentType:0,tournamentSelectedDropDowns:{seasons:[]},playersLength:0,nextRivalId:0,updateTableCalendar:0,loadDiscover:!1,hasNextRival:!1,resumeType:1,goalsType:2,is_public:!1,seasonsGamesMap:new Map,gamesOfTheDayPreMatchIds:new Set,seasonsForLiveGames:[],allLiveGames:[],storiesItems:[],currentStories:[],currentStoryIndex:null,isStoriesVisible:!1,seasonPlayersMap:new Map,currentTournaments:[]}},computed:{teamSelected(){return this.user.is_generic||this.tournamentSelected.id!==this.user.tournament?0:this.user.team},isGenericLike(){return this.user.is_generic||this.tournamentSelected.id!==this.user.tournament},isPlaySeekerAvailable(){return[34230,34178,34201].includes(this.user.id)},games(){if(!this.isGenericLike&&!this.isLeagueSelected)return this.fullTournamentSchedule;{const s=this.gamesPages.get(this.selectedRound);return s&&s[0]?s[0].sort((e,t)=>{let a=e.dateTimeMillis,i=t.dateTimeMillis;return e.is_live&&(a-=1e9),t.is_live&&(i-=1e9),a-i}):[]}},latestRound(){return this.userTeamGames&&this.userTeamGames.length&&this.fullTournamentScheduleFullGoals&&this.fullTournamentScheduleFullGoals.length?this.getUserTeamClosestRound(this.fullTournamentScheduleFullGoals):this.getNormalClosestRound(this.fullTournamentScheduleFullGoals)},closestRound(){return this.userTeamGames&&this.userTeamGames.length?this.getUserTeamClosestRound(this.fullTournamentScheduleFull):this.getNormalClosestRound(this.fullTournamentScheduleFull)},closestRoundVideos(){return this.userTeamGames&&this.userTeamGames.length?this.getUserTeamClosestRound(this.fullTournamentScheduleFullGoals,!0):this.getNormalClosestRound(this.fullTournamentScheduleFullGoals,!0)},containerGridCalendarTable(){return this.elementSize.width<=1e3?"container-grid-calendar-table-mobile":"container-grid-calendar-table"},containerbackground(){return this.elementSize.width<=680?"container-background-movil":"container-background"},containerdata(){return this.elementSize.width<=680?"container-data-movil":"container-data"}},watch:{games:{immediate:!0,deep:!0,async handler(s){if(s&&s.length>0){if(!this.seasonsSelected.length)return;for(let t=0;t<s.length;t++){const a=this.gamesAllStories.findIndex(i=>i.game_id===s[t].game_id);a!==-1&&(this.gamesAllStories[a].is_live=s[t].is_live,this.gamesAllStories[a].game_status=s[t].game_status)}const e=s.filter(t=>t.is_live);for(let t=0;t<e.length;t++){const a=this.gamesAllStories.findIndex(i=>i.game_id===e[t].game_id);if(a!==-1)this.gamesAllStories[a].score=e[t].score;else{this.gamesAllStories.push(e[t]),this.gamesAllStories=this.ordenarYFiltrarPartidos(this.gamesAllStories);let i=[];for(let o=0;o<this.gamesAllStories.length;o++)this.arrayGamesAdd.findIndex(r=>r.game_id===this.gamesAllStories[o].game_id)===-1?i.push({game_id:this.gamesAllStories[o].game_id,last_index:0,status:1}):i.push({game_id:this.arrayGamesAdd[this.arrayGamesAdd.findIndex(r=>r.game_id===this.gamesAllStories[o].game_id)].game_id,last_index:this.arrayGamesAdd[this.arrayGamesAdd.findIndex(r=>r.game_id===this.gamesAllStories[o].game_id)].last_index,status:this.arrayGamesAdd[this.arrayGamesAdd.findIndex(r=>r.game_id===this.gamesAllStories[o].game_id)].status});this.arrayGamesAdd=i,await ve.post(bi,{stories:this.arrayGamesAdd},{headers:{Authorization:`${this.token}`,"Content-Type":"application/json"}});for(let o=0;o<this.arrayGamesAdd.length;o++)this.gamesAllStories.findIndex(r=>r.game_id===this.arrayGamesAdd[o].game_id)!==-1&&(this.gamesAllStories[this.gamesAllStories.findIndex(r=>r.game_id===this.arrayGamesAdd[o].game_id)].index=this.arrayGamesAdd[o].last_index,this.gamesAllStories[this.gamesAllStories.findIndex(r=>r.game_id===this.arrayGamesAdd[o].game_id)].status_storie=this.arrayGamesAdd[o].status)}}}}},"allLiveGames.length":{handler(s){s.length===0&&this.resetGamesLiveInterval()}},privileges:{immediate:!0,deep:!0,async handler(s){this.is_public=s!==null}},team:{immediate:!0,deep:!0,async handler(s){s&&this.seasonsSelected.length&&setTimeout(()=>{this.fetchGames(s,this.seasonsSelected)},1e3)}},closestRound(s){this.selectedRoundKeyIndex=this.tournamentScheduleKeys.findIndex(e=>e===s),this.selectedRound=s},latestRound(s){this.selectedRoundKeyIndexVideo=this.tournamentScheduleKeysGoals.findIndex(e=>e===s),this.selectedRoundVideos=s},isCarouselFullScreenVisible:{handler(s){document.getElementsByTagName("html")[0].style.overflow=s?"hidden":"auto"},immediate:!0}},methods:{getOnlyGamesWithGoals(s){return Object.entries(s).reduce((e,[t,a])=>{const i=a.reduce((o,r)=>{const l=r.games.filter(d=>(d.is_live||d.game_status!==4)&&d.score[0]+d.score[1]>0);return l.length&&o.push({...r,games:l}),o},[]);return i.length&&(e[t]=i),e},{})},async onClickPlaySeeker(){try{const e=await(await fetch("https://rhev2kbe0a.execute-api.us-east-2.amazonaws.com/qa/demo/playseeker")).json();this.formatPlaySeekerPlays(e.data||OP)}catch(s){console.error(s)}},formatPlaySeekerPlays(s){let e=[];s&&s.playlist&&s.playlist.length&&(e=s.playlist.reduce((a,i,o)=>{const l={...Object.entries(Ft).reduce((f,[p,m])=>(f[p]=i[m],f),{}),isPlaySeeker:!0,startSeconds:i[Ft.startTime],endSeconds:i[Ft.endTime],totalSeconds:Math.floor(i[Ft.endTime]-i[Ft.startTime]),payloadData:{play_id:i[Ft.playId],total_plays:s.total_plays,play_number:o+1,group_playlist_id:s.group_playlist_id,playlist_id:s.playlist_id,group_id:s.group_id,moment_of_play:i[Ft.momentOfPlay],play_type:i[Ft.categoryId],viewer_second_start:Math.floor(i[Ft.startTime]),intended_second_start:Math.floor(i[Ft.startTime]),intended_second_end:Math.floor(i[Ft.endTime]),latitude_of_user:null,longitude_of_user:null}},[d,c]=l.playerName.split(","),h=d.split(" ");let u="";for(const f of h)if(u+=` ${f}`,f.length>3)break;if(l.playerShortName=c&&d?`${c.trim().charAt(0)}.${u}`:"",!l.mainCategoryName){const[f,p]=l.finalScore.split(" - ");l.arrayScore=[Number(f),Number(p)]}return l.categoryName=MP.get(l.categoryId),a.push(l),a},[]));let t=[];t=e,this.carouselPlayerQueue=t,this.isPlaySeeker=!0,this.isCarouselFullScreenVisible=!0},formatUsername(s){const e=s.split(",");let t="",a="";return e[1]?(a=e[1].trim().split(" "),a[0]?t=a[0]:t=e[1]):e[0]&&(a=e[0].trim().split(" "),a[0]?t=a[0]:t=e[0]),t.trim()},async fetchGameEvents(s){try{return(await ve.get(`${this.gameEventsUrl}${s}`,{headers:{Authorization:`${this.token}`}})).data}catch(e){throw new Error(e)}},async fetchLiveGames(){try{if(this.seasonsForLiveGames.length===0)return[];const s=this.seasonsForLiveGames.reduce((a,i)=>`${a}seasons=${i}&`,""),e=ve.create({headers:{Authorization:`${this.token}`}}),{data:t}=await e.get(`https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason/lives?${s}`);return t}catch(s){throw new Error(s)}},async onClickOpenCarouselVideos(s){try{this.isPlaySeeker=!1;const t=(await this.fetchGameEvents(s)).plays;this.carouselPlayerQueue=t.filter(a=>a.event_type_id===1&&a.video_link!=="-"),this.isCarouselFullScreenVisible=!0}catch(e){throw new Error(e)}},onChangeMatchDayGames(s){this.selectedRound!==s.key&&(this.selectedRound=s.key)},onClickStory({item:s,index:e}){this.openStory(e),this.onClickStories(s)},onClickLive(){const s=this.allLiveGames[0];if(s){const e=this.seasonsGamesMap.get(s.game_id);e&&(this.selectedRound=e.roundAbbreviationV2)}},onClickCloseCarousel(){this.carouselPlayerQueue=[],this.isPlaySeeker=!1,this.isCarouselFullScreenVisible=!1},onChangeIsLeagueSelected(s){this.isLeagueSelected=s},onAction(s){this.$emit("action",s)},onOpenMedia(s){s.type===1&&s.gameIds&&s.gameIds.length>0?this.onClickOpenCarouselVideos(s.gameIds[0]):this.$emit("openmedia",s)},onOpenProfile(s){this.$emit("onOpenProfile",s)},onClickMatch(s){this.$emit("openGame",s)},onClickCalendar(){const s={type:this.isGenericLike||this.isLeagueSelected?0:1,team:this.team,season:this.seasonSelected.id};this.$emit("onClickMyCalendar",s)},moreTops(){const s={team:this.team,season:this.seasonSelected.id};this.$emit("openTops",s)},clickProfileBtn(s){this.$emit("openProfile",s)},viewAll(){const s={team:this.team,season:this.seasonSelected.id};this.$emit("openAllPlayers",s)},getTotalPlayers(s){this.playersLength=s},clickCard(s){const e={data:s,isPlayer:this.isplayer};this.$emit("clickOnMainCards",e)},async fetchGames(s,e){const t=e.map(i=>`seasons=${i.id}`).join("&"),a=ve.create({headers:{Authorization:`${this.token}`}});this.fullTournamentSchedule=await a.get(this.gamesUrl+s+"?"+t),this.fullTournamentSchedule.data&&this.fullTournamentSchedule.data.prematch&&(this.fullTournamentSchedule.data.prematch.roundAbbreviationV2=this.roundAbbreviationByGameId.get(this.fullTournamentSchedule.data.prematch.game_id)),this.fullTournamentSchedule.data&&this.fullTournamentSchedule.data.postmatch&&(this.fullTournamentSchedule.data.postmatch.roundAbbreviationV2=this.roundAbbreviationByGameId.get(this.fullTournamentSchedule.data.postmatch.game_id)),this.nextRivalId=Object.keys(this.fullTournamentSchedule).length>0?this.user.team==this.fullTournamentSchedule.data.prematch.home_team?this.fullTournamentSchedule.data.prematch.visiting_team:this.fullTournamentSchedule.data.prematch.home_team:0,this.loadDiscover=!0},generateSeasons(s){const e=[{id:s.id,type:s.type}];return s.related_seasons&&s.related_seasons.length&&e.push(...s.related_seasons.map(t=>({id:t.id,type:t.type}))),e},async onInputTournament(s){this.tournamentSelected=s,this.tournamentType=s.tournament_type,this.tournamentSelected.id&&this.tournamentSelected.id!==s.id&&(this.updateTableCalendar+=1),this.tournamentSelectedDropDowns.id!==s.id&&(this.tournamentSelectedDropDowns=s)},getSeasonDependentPromises({season:s,seasons:e}){const t={headers:{Authorization:`${this.token}`}},a=[ve.get(`https://ts7thxzaik.execute-api.us-west-2.amazonaws.com/prod/players/seasons/${s.id}`,t)];a.push(this.fetchSeasonsGamesAndTeams(e.map(o=>o.id),3)),a.push(this.fetchStoriesPlays(s));const i=`https://ssh88fgvll.execute-api.us-east-2.amazonaws.com/prod/users/${this.user.id}/seasons/${s.id}/stories`;return i!==bi&&(bi=i,a.push(ve.get(bi,t))),a},async onInputSeason(s){try{if(this.seasonSelected.id!==s.id){this.isPreviousDataLoaded=!1,this.seasonSelected=s,this.seasonsSelected=this.generateSeasons(s);const e=this.getSeasonDependentPromises({season:s,seasons:this.seasonsSelected,retries:3,createdUrl:""}),[t,a,i,o]=await Promise.all(e);this.seasonPlayersMap=new Map,t.data&&t.data.players&&t.data.players.forEach(r=>{this.seasonPlayersMap.set(r.player_id,r)}),o&&o.data?this.arrayGamesAdd=o.data.stories.stories:this.arrayGamesAdd=[],this.resetGamesLiveInterval(),this.seasonSelected=s,this.show_stories=!!s.show_stories,this.seasonsForLiveGames=[s.id,...s.related_seasons.map(r=>r.id)],this.$emit("change-season-id",s.id),this.fillStoriesData(i,a.seasonsAndGames),await this.createFullTournamentScheme({seasons:this.seasonsSelected,seasonsAndGames:a.seasonsAndGames,seasonsAndTeams:a.seasonsAndTeams,applySeasonsValidation:!1}),this.team&&await this.fetchGames(this.team,this.seasonsSelected),this.keyupdate+=1}}catch(e){throw new Error(e)}},ordenarYFiltrarPartidos(s){const e=s.filter(t=>t.game_status===1||t.is_live==1||t.game_status==0);return e.sort((t,a)=>new Date(a.date_time_utc)-new Date(t.date_time_utc)),e.slice(0,18)},async fetchSeasonsGamesAndTeams(s,e,t=""){let a=t;try{const i=ve.create({headers:{Authorization:`${this.token}`}});a||(a=this.gamesUrl2,s.forEach((l,d)=>{a+=`${d===0?"":"&"}seasons=${l}`}));const{data:{data:o,teams:r}}=await i.get(a);return{seasonsAndGames:o,seasonsAndTeams:r}}catch(i){if(e>0)return this.fetchSeasonsGamesAndTeams(s,e-1,a);throw new Error(i)}},async fetchStoriesPlays(s){try{return await ve.create({headers:{Authorization:`${this.token}`}}).get("https://cpj4073446.execute-api.us-east-2.amazonaws.com/prod/videos/plays/seasons/"+s.id+"?categories=607&categories=608&categories=12&categories=55&categories=54&categories=35&categories=15&categories=53&type=1")}catch(e){throw new Error(e)}},fillStoriesData(s,e){let t=s.data?s.data.plays:[];this.gamesAllStories=[];for(let i=0;i<e.length;i++)this.gamesAllStories=this.gamesAllStories.concat(e[i].games);this.gamesAllStories=this.ordenarYFiltrarPartidos(this.gamesAllStories);let a=[];for(let i=0;i<this.gamesAllStories.length;i++)this.arrayGamesAdd.findIndex(o=>o.game_id===this.gamesAllStories[i].game_id)===-1?a.push({game_id:this.gamesAllStories[i].game_id,last_index:0,status:1}):a.push({game_id:this.arrayGamesAdd[this.arrayGamesAdd.findIndex(o=>o.game_id===this.gamesAllStories[i].game_id)].game_id,last_index:this.arrayGamesAdd[this.arrayGamesAdd.findIndex(o=>o.game_id===this.gamesAllStories[i].game_id)].last_index,status:this.arrayGamesAdd[this.arrayGamesAdd.findIndex(o=>o.game_id===this.gamesAllStories[i].game_id)].status});this.arrayGamesAdd=a;for(let i=0;i<this.arrayGamesAdd.length;i++)this.gamesAllStories.findIndex(o=>o.game_id===this.arrayGamesAdd[i].game_id)!==-1&&(this.gamesAllStories[this.gamesAllStories.findIndex(o=>o.game_id===this.arrayGamesAdd[i].game_id)].index=this.arrayGamesAdd[i].last_index,this.gamesAllStories[this.gamesAllStories.findIndex(o=>o.game_id===this.arrayGamesAdd[i].game_id)].status_storie=this.arrayGamesAdd[i].status);this.storiesItems=this.getStoriesStructureVideos(t),setTimeout(()=>{this.sendStoriesData()},1e3)},sendStoriesData(){ve.post(`https://ssh88fgvll.execute-api.us-east-2.amazonaws.com/prod/users/${this.user.id}/seasons/${this.seasonsSelected[0].id}/stories`,{stories:this.arrayGamesAdd},{headers:{Authorization:`${this.token}`,"Content-Type":"application/json"}})},getTimeSeconds(s){const[e,t]=s.split(":"),[a,i]=t.split(".");return parseInt(e)*60+parseInt(a)+parseInt(i)/1e3},getPlayTime(s,e){let t="",a=0;switch(s[7]){case 1:t=s[11];break;case 2:t=s[13],a=45;break;case 3:t=s[15],a=90;break;case 4:t=s[17],a=105;break;case 5:t=s[19],a=120;break}return(!t||t==="0")&&(t="00:00"),this.getTimeToSeconds(t)+(this.getTimeToSeconds(s[e])-a*60)},abrirNuevaVentana(){window.open("https://goltipster.com/view-all#golTipster","_blank")},getTimeToSeconds(s){const t=s.indexOf(".")>-1?s.substring(0,s.indexOf(".")):s,[a,i,o]=t.split(":").reverse();return(o?Number(o)*60*60:0)+Number(i)*60+Number(a)},getStoriesStructureVideos(s){let e=[];for(let t=0;t<this.gamesAllStories.length;t++){let a=s.filter(r=>r[3]===this.gamesAllStories[t].game_id).map(r=>({playId:r[29],gameId:r[3],player:this.seasonPlayersMap.get(r[1]),categoryId:r[0],date:new Date(r[4]),url:r[35]==2?"https://daijvvc13prpy.cloudfront.net/golstats-videos/"+this.gamesAllStories[t].game_id+"_1/"+this.gamesAllStories[t].game_id+"_1.m3u8":"https://golstatsbets.blob.core.windows.net/video-player/"+this.gamesAllStories[t].game_id+"_1.mp4",type:"video",thumbnail:{logoHomeTeam:"https://az755631.vo.msecnd.net/teams-80/"+this.gamesAllStories[t].home_team+".png",logoAwayTeam:"https://az755631.vo.msecnd.net/teams-80/"+this.gamesAllStories[t].visiting_team+".png"},header:{label:this.gamesAllStories[t].home_team_acronym+" "+this.gamesAllStories[t].score[0]+":"+this.gamesAllStories[t].score[1]+" "+this.gamesAllStories[t].visiting_team_acronym+" "+this.gamesAllStories[t].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV")},startTime:this.getPlayTime(r,9),endTime:this.getPlayTime(r,10),duration:Math.floor(this.getTimeSeconds(r[10])-this.getTimeSeconds(r[9]))}));const i={},o=a.filter(r=>i[r.playId]?!1:(i[r.playId]=!0,!0));e.push({game_id:this.gamesAllStories[t].game_id,stories:o})}return e},areSeasonsDifferent(s){for(const e of s)if(!this.lastSeasonsIds.includes(e.season_id))return!0;return!1},async createFullTournamentScheme({seasons:s,seasonsAndGames:e,seasonsAndTeams:t,applySeasonsValidation:a}){try{this.seasonsGamesMap=new Map,this.userTeamGames=[],this.userTeamGamesForVideos=[],this.gamesOfTheDayPreMatchIds.clear();let i=0;if(a&&this.areSeasonsDifferent(e))return;e.forEach(l=>{const d=s.find(c=>c.id===l.season_id);d&&(l.type=d.type,l.games.forEach(c=>{c.season_id=l.season_id}),d.type===0&&(i=l.season_id))});const o={seasonsGames:e},r=t.find(l=>l.season_id===i);if(r){const l=r.teams,d=[...o.seasonsGames],c=o&&o.seasonsGames?o.seasonsGames.map(u=>{const f=u.games.reduce((p,m)=>{const g={...m},y=new Date,[b,S,_]=g.date.split("-"),[C,E,v]=g.schedule.split(":"),T=new Date(Number(b),Number(S)-1,Number(_),Number(C),Number(E),Number(v));return g.dateTimeMillis=T.valueOf(),g.home_team=l.find(B=>B.team_id===m.home_team),g.visiting_team=l.find(B=>B.team_id===m.visiting_team),g.game_status===4&&y.getFullYear()===T.getFullYear()&&y.getMonth()===T.getMonth()&&y.getDate()===T.getDate()&&this.gamesOfTheDayPreMatchIds.add(g.game_id),this.seasonsGamesMap.set(g.game_id,g),p[m.matchday_abbreviation]?p[m.matchday_abbreviation][m.game_status===3?"canceled":m.date]?p[m.matchday_abbreviation][m.game_status===3?"canceled":m.date].push(g):p[m.matchday_abbreviation][m.game_status===3?"canceled":m.date]=[g]:p[m.matchday_abbreviation]={[m.game_status===3?"canceled":m.date]:[g]},this.gsData&&this.gsData.teamId&&g.game_status===4&&(g.home_team.team_id===this.gsData.teamId||g.visiting_team.team_id===this.gsData.teamId)&&(this.userTeamGames.push(g),g.score&&g.score[0]+g.score[1]>0&&this.userTeamGamesForVideos.push(g)),p},{});this.userTeamGames.sort((p,m)=>p.dateTimeMillis-m.dateTimeMillis);for(let[p,m]of Object.entries(f))f[p]=Object.entries(m).map(([g,y])=>({date:g,games:y.sort((b,S)=>b.dateTimeMillis-S.dateTimeMillis)})),f[p].sort((g,y)=>g.date<y.date?-1:g.date>y.date?1:0);return{type:u.type,weight:u.type===0?0:u.type===2?1:2,schedule:f}}):[],h=o&&o.seasonsGames?d.map(u=>{const f=u.games.reduce((p,m)=>{const g={...m};return g.dateTimeMillis=new Date(g.date_time_utc).valueOf(),g.home_team=l.find(y=>y.team_id===m.home_team),g.visiting_team=l.find(y=>y.team_id===m.visiting_team),p[m.matchday_abbreviation]?p[m.matchday_abbreviation][m.game_status===3?"canceled":m.date]?(g.game_status!=4||g.is_live==1)&&(g.score[0]!=0||g.score[1]!=0)&&p[m.matchday_abbreviation][m.game_status===3?"canceled":m.date].push(g):(g.game_status!=4||g.is_live==1)&&(g.score[0]!=0||g.score[1]!=0)&&(p[m.matchday_abbreviation][m.game_status===3?"canceled":m.date]=[g]):(g.game_status!=4||g.is_live==1)&&(g.score[0]!=0||g.score[1]!=0)&&(p[m.matchday_abbreviation]={[m.game_status===3?"canceled":m.date]:[g]}),p},{});this.userTeamGames.sort((p,m)=>p.dateTimeMillis-m.dateTimeMillis);for(let[p,m]of Object.entries(f))f[p]=Object.entries(m).map(([g,y])=>({date:g,games:y.sort((b,S)=>b.dateTimeMillis-S.dateTimeMillis)})),f[p].sort((g,y)=>g.date<y.date?-1:g.date>y.date?1:0);return{type:u.type,weight:u.type===0?0:u.type===2?1:2,schedule:f}}):[];c.sort((u,f)=>u.weight-f.weight),this.fullTournamentScheduleFull=c.reduce((u,f)=>{for(const[p,m]of Object.entries(f.schedule))if(f.type===0)if([1,2].includes(this.tournamentType)){const g=Fu.get(this.tournamentType);if(g){const y=g.get(p);y&&(u[y.matchDayAbbreviation]=m)}}else if(this.isCup){const g=p.replace("M",""),y=`Jornada ${g}`;this.isCupLegacy?u[Ou[g]||y]=m:u[Pu[p]||y]=m}else u[Number(p.replace("M","")).toString()]=m;else f.type===2?["PI1","PI2"].includes(p)?u[p]=m:u[`R${Number(p.replace("PO",""))}`]=m:f.type===1&&(u[Du[p]]=m);return u},{}),this.fullTournamentScheduleFullGoals=h.reduce((u,f)=>{for(const[p,m]of Object.entries(f.schedule))if(f.type===0)if([1,2].includes(this.tournamentType)){const g=Fu.get(this.tournamentType);if(g){const y=g.get(p);y&&(u[y.matchDayAbbreviation]=m)}}else if(this.isCup){const g=p.replace("M",""),y=`Jornada ${g}`;this.isCupLegacy?u[Ou[g]||y]=m:u[Pu[p]||y]=[]}else u[Number(p.replace("M","")).toString()]=m;else f.type===2?["PI1","PI2"].includes(p)?u[p]=m:u[`R${Number(p.replace("PO",""))}`]=m:f.type===1&&(u[Du[p]]=m);return u},{}),this.roundAbbreviationByGameId=new Map,this.tournamentScheduleKeys=Array.from(Object.entries(this.fullTournamentScheduleFull).reduce((u,[f,p])=>{const m=Number(f);let g="";Number.isNaN(m)?g=f:g=m<10?`0${m}`:f;let y=!1,b=null;const S=p.reduce((C,E)=>(!b&&E&&E.games&&E.games.length&&(b=E.games[0].matchday_id),E.games.forEach(v=>{this.roundAbbreviationByGameId.set(v.game_id,f),v.roundAbbreviation=Number.isNaN(m)?m:`J ${m}`,v.roundAbbreviationV2=f}),C=C.concat(E.games),C),[]);for(let C=0;C<S.length;C++)(S[C].game_status!=4||S[C].is_live)&&(S[C].score[0]!=0||S[C].score[1]!=0)&&(y=!0);u.set(f,{key:f,value:m,valueText:g,avaible:y,matchDayId:b});const _=this.getPages(S);return this.gamesPages.set(f,_),u},new Map).values()),this.tournamentScheduleKeysGoals=Array.from(Object.entries(this.fullTournamentScheduleFullGoals).reduce((u,[f,p])=>{const m=Number(f);let g="";Number.isNaN(m)?g=f:g=m<10?`0${m}`:f;let y=!1;const b=p.reduce((S,_)=>(_.games.forEach(C=>{C.roundAbbreviation=Number.isNaN(m)?m:`J ${m}`}),S=S.concat(_.games),S),[]);for(let S=0;S<b.length;S++)(b[S].game_status!=4||b[S].is_live&&(b[S].score[0]!=0||b[S].score[1]!=0))&&(y=!0);return u.set(f,{key:f,value:m,valueText:g,avaible:y}),u},new Map).values())}setTimeout(()=>{this.isPreviousDataLoaded=!0,this.checkLiveGames(),this.gamesOfTheDayPreMatchIds.size&&this.createGameOfTheDayTimeouts()},500)}catch(i){throw new Error(i)}finally{this.loadingFlag=!1}},createGameOfTheDayTimeouts(){this.gamesOfTheDayPreMatchIds.size&&this.gamesOfTheDayPreMatchIds.forEach(s=>{const e=this.seasonsGamesMap.get(s);if(e){const t=new Date().valueOf();if(60*1e3*30+e.dateTimeMillis-t>0){const i=e.dateTimeMillis-t-3e5;setTimeout(()=>{this.createCheckLiveGamesInterval()},i>0?i:0)}}})},resetCheckGamesLiveInterval(){clearInterval(yi),yi=null},createCheckLiveGamesInterval(){this.resetCheckGamesLiveInterval(),yi||(yi=setInterval(()=>{this.checkLiveGames()},this.checkLiveGamesIntervalMinutes*60*1e3))},async checkLiveGames(){try{const s=await this.fetchLiveGames(),e=new Set;if(this.allLiveGames=s.data.reduce((t,a)=>(a.games.forEach(i=>{e.add(i.game_id),t.push(i)}),t),[]),this.allLiveGames.length){xa||await this.fillGameEvents();const t=[];this.gamesOfTheDayPreMatchIds.forEach(a=>{const i=this.seasonsGamesMap.get(a);i&&new Date().valueOf()>i.dateTimeMillis&&t.push(a)}),t.length&&t.every(i=>this.seasonsGamesMap.get(i).isLiveTracked)&&this.resetCheckGamesLiveInterval()}}catch(s){throw new Error(s)}},createGamesEventsInterval(){this.resetGamesLiveInterval(),xa=setInterval(()=>{this.fillGameEvents()},6e4)},resetGamesLiveInterval(){clearInterval(xa),xa=null},removeGameIfFinished(s,e,t=!1){for(const a of e)if(a.category_id===0&&a.game_status_id===13)if(t)this.fetchGames(this.team,this.seasonsSelected);else{const i=this.seasonsGamesMap.get(a.game_id);this.allLiveGames=this.allLiveGames.filter(o=>o.game_id!==s.game_id),i.is_live=0,i.game_status=0}},async fillGameEvents(){try{const s=[];let e=null;for(const a of this.allLiveGames){a.isLiveTracked=!0,this.gamesOfTheDayPreMatchIds.size&&this.gamesOfTheDayPreMatchIds.delete(a.game_id);const i=this.seasonsGamesMap.get(a.game_id);i&&(i.is_live=1,i.game_status=4),e=this.fullTournamentSchedule&&this.fullTournamentSchedule.data&&this.fullTournamentSchedule.data.prematch?this.fullTournamentSchedule.data.prematch:null,e&&e.game_id===a.game_id&&(e.is_live=1,e.game_status=4),s.push(this.fetchGameEvents(a.game_id))}const t=await Promise.all(s);for(const a of t){const i=this.seasonsGamesMap.get(a.game_id);if(i){const o=FP.get(a.recent_lapse);i.currentTimeLive=o&&o<a.minute?`${o}' + ${a.minute-o}'`:`${a.minute}'`;const r=[Number(a.score[i.home_team.team_id.toString()])+Number(a.score[`own_${i.visiting_team.team_id.toString()}`]),Number(a.score[i.visiting_team.team_id.toString()])+Number(a.score[`own_${i.home_team.team_id.toString()}`])],l=r[0],d=r[1];i.score=[Number.isNaN(l)?0:l,Number.isNaN(d)?0:d],this.removeGameIfFinished(i,a.plays),e&&e.game_id===i.game_id&&(e.currentTimeLive=i.currentTimeLive,e.score=i.score,this.removeGameIfFinished(e,a.plays,!0))}}xa||this.createGamesEventsInterval()}catch(s){throw new Error(s)}},getPages(s){const e=[];if(this.gamesPerMatchDay>0){let t=[];s.forEach((a,i)=>{t.push(a),(i+1)%this.gamesPerMatchDay===0&&(e.push([...t]),t=[])}),t.length&&e.push([...t])}else e.push(s);return e},getNormalClosestRound(s,e=!1){const a=e?this.getOnlyGamesWithGoals(s):s,i=Object.entries(Object.entries(a).reduce((l,[d,c])=>(l[d]=[],c.forEach(h=>{h.games.forEach(u=>{const f=new Date(u.date_time_utc).getTime()+66e5;l[d].push(f)})}),l),{}));if(!i.length)return"1";const o=new Date().getTime(),r=i.reduce((l,[d,c])=>{let h=null;return c.forEach(u=>{const f=e?o-u:u-o;f>=0&&(h===null||f<h)&&(h=f)}),h&&(l.shortestTime===null||h<l.shortestTime)&&(l.round=d,l.shortestTime=h),l},{round:"",shortestTime:null});return r.shortestTime!==null?r.round:i[i.length-1][0]},getUserTeamClosestRound(s,e=!1){let t=1;const a=e?this.userTeamGamesForVideos:this.userTeamGames;if(a.length){const i=a[0];for(const[o,r]of Object.entries(s))for(const l of r)if(l.games.find(c=>c.game_id===i.game_id))return o}return t},async changeIndexStory(s){if(this.arrayGamesAdd.length>0){let e=-1,t=-1,a=-1;this.arrayGamesAdd.findIndex(i=>i.game_id===this.currentStories[0].gameId)!=-1&&(e=this.arrayGamesAdd.findIndex(i=>i.game_id===this.currentStories[0].gameId)),this.gamesAllStories.findIndex(i=>i.game_id===this.currentStories[0].gameId)!=-1&&(t=this.gamesAllStories.findIndex(i=>i.game_id===this.currentStories[0].gameId)),this.storiesItems.findIndex(i=>i.game_id===this.currentStories[0].gameId)!=-1&&(a=this.storiesItems.findIndex(i=>i.game_id===this.currentStories[0].gameId)),e!=-1&&(this.gamesAllStories[t].is_live===1?this.storiesItems[a].stories.length-1==s&&this.storiesItems[a].stories.length>1?this.arrayGamesAdd[e].last_index=s-1:this.arrayGamesAdd[e].last_index=s:this.arrayGamesAdd[e].last_index=s),a!=-1&&this.arrayGamesAdd[e].status>0&&(this.arrayGamesAdd[e].status=s>=this.storiesItems[a].stories.length-1?0:1)}else{this.arrayGamesAdd=[];for(let e=0;e<this.storiesItems.length;e++)this.arrayGamesAdd.push({game_id:this.storiesItems[e].game_id,last_index:this.currentStories[0].gameId==this.storiesItems[e].game_id?s:0,status:this.currentStories[0].gameId==this.storiesItems[e].game_id&&s>=this.storiesItems[e].stories.length-1?0:1})}await ve.post(`https://ssh88fgvll.execute-api.us-east-2.amazonaws.com/prod/users/${this.user.id}/seasons/${this.seasonsSelected[0].id}/stories`,{stories:this.arrayGamesAdd},{headers:{Authorization:`${this.token}`,"Content-Type":"application/json"}});for(let e=0;e<this.arrayGamesAdd.length;e++)this.gamesAllStories.findIndex(t=>t.game_id===this.arrayGamesAdd[e].game_id)!=-1&&(this.gamesAllStories[this.gamesAllStories.findIndex(t=>t.game_id===this.arrayGamesAdd[e].game_id)].index=this.arrayGamesAdd[e].last_index,this.gamesAllStories[this.gamesAllStories.findIndex(t=>t.game_id===this.arrayGamesAdd[e].game_id)].status_storie=this.arrayGamesAdd[e].status)},async getLiveGamePlays(s){var a=(await ve.create({headers:{Authorization:`${this.token}`}}).get("https://cpj4073446.execute-api.us-east-2.amazonaws.com/prod/live/videos/plays/seasons/"+this.gamesAllStories[s].season_id+"/games/"+this.gamesAllStories[s].game_id)).data.plays.filter(l=>l[0]===607||l[0]===608||l[0]===12||l[0]===55||l[0]===54||l[0]===35||l[0]===15||l[0]===53);let i=a.map(l=>({playId:l[29],gameId:l[3],player:this.seasonPlayersMap.get(l[1]),categoryId:l[0],date:new Date(l[4]),url:"https://falconvideolive.blob.core.windows.net/video-hls-live/"+this.gamesAllStories[s].game_id+"/"+this.gamesAllStories[s].game_id+".m3u8",type:"video",thumbnail:{logoHomeTeam:"https://az755631.vo.msecnd.net/teams-80/"+this.gamesAllStories[s].home_team+".png",logoAwayTeam:"https://az755631.vo.msecnd.net/teams-80/"+this.gamesAllStories[s].visiting_team+".png"},header:{label:this.gamesAllStories[s].home_team_acronym+" "+this.gamesAllStories[s].score[0]+":"+this.gamesAllStories[s].score[1]+" "+this.gamesAllStories[s].visiting_team_acronym+" "+this.gamesAllStories[s].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV")},startTime:this.getPlayTime(l,9),endTime:this.getPlayTime(l,10),duration:Math.floor(this.getTimeSeconds(l[10])-this.getTimeSeconds(l[9]))}));const o={},r=i.filter(l=>o[l.playId]?!1:(o[l.playId]=!0,!0));this.storiesItems[s]={game_id:this.gamesAllStories[s].game_id,stories:r}},async openStory(s){const e={headers:{Authorization:`${this.token}`}},[t]=await Promise.all([ve.get(`https://ts7thxzaik.execute-api.us-west-2.amazonaws.com/prod/players/games/${this.gamesAllStories[s].game_id}`,e)]);t.data&&t.data.players.forEach(a=>{this.seasonPlayersMap.set(a.player_id,{dob:a.dob,first_name:a.first_name,jersey:a.jersey,last_name:a.last_name,name:a.name,player_name:a.name,nationality:a.nationality,nationality_id:a.nationality_id,nationality_photo:a.nationality_photo,photo:a.photo,player_id:a.player_id,position_id:a.position_id,short_name:a.short_name,team_id:a.team_id})}),this.gamesAllStories[s].is_live==1||this.gamesAllStories[s].game_status==0?(await this.getLiveGamePlays(s),setTimeout(()=>{this.currentStoryIndex=s,this.currentStories=this.storiesItems[s].stories,this.currentStoriesLastIndex=this.gamesAllStories[s].index},100)):(this.currentStoryIndex=s,this.currentStories=this.storiesItems[s].stories,this.currentStoriesLastIndex=this.gamesAllStories[s].index),setTimeout(()=>{this.isStoriesVisible=!0},150)},onCloseStories(s){this.currentStoriesLastIndex=0,this.isStoriesVisible=!1,this.$emit("event-posthog-stories",{event:"stories_cerrar",properties:{play_id:s?s.playId:null,game_id:s?s.gameId:null,category_id:s?s.categoryId:null,start_time:s?s.startTime:null,end_time:s?parseInt(s.currentTime):null,percentage_viewed:s?parseInt(s.progress):null}})},closeStories(){this.currentStoriesLastIndex=0,this.currentStoryIndex=null,this.currentStories=[]},onSwipeStories({direction:s,currentPlay:e}){s==="right"?(this.$emit("event-posthog-stories",{event:"stories_video_siguiente_partido",properties:{play_id:e?e.playId:null,game_id:e?e.gameId:null,category_id:e?e.categoryId:null,start_time:e?e.startTime:null,end_time:e?parseInt(e.currentTime):null,percentage_viewed:e?parseInt(e.progress):null}}),this.currentStoryIndex>0&&this.openStory(this.currentStoryIndex-1)):(this.$emit("event-posthog-stories",{event:"stories_video_anterior_partido",properties:{play_id:e?e.playId:null,game_id:e?e.gameId:null,category_id:e?e.categoryId:null,start_time:e?e.startTime:null,end_time:e?parseInt(e.currentTime):null,percentage_viewed:e?parseInt(e.progress):null}}),this.currentStoryIndex<this.storiesItems.length-1&&this.openStory(this.currentStoryIndex+1))},onClickNextBackVideo({eventName:s,currentPlay:e}){this.$emit("event-posthog-stories",{event:s,properties:{play_id:e?e.playId:null,game_id:e?e.gameId:null,category_id:e?e.categoryId:null,start_time:e?e.startTime:null,end_time:e?parseInt(e.currentTime):null,percentage_viewed:e?parseInt(e.progress):null}})},onChangeTournaments(s){this.currentTournaments=s},onClickStories(s){this.$emit("event-posthog-stories",{event:"stories_ver_play",properties:{game_id:s.game_id}})},onVideoPlay(s){this.$emit("event-posthog-stories",{event:"stories_play",properties:{play_id:s.playId,game_id:s.gameId,category_id:s.categoryId,start_time:s.startTime,end_time:s.endTime,percentage_viewed:0}})}},async created(){},beforeUnmount(){this.resetGamesLiveInterval()}},Si=s=>(n.pushScopeId("data-v-4d47d079"),s=s(),n.popScopeId(),s),VP={class:"gsclanding",ref:"landingref"},UP={key:2,class:"play-seeker-image"},zP={class:"play-seeker-image__info"},GP=Si(()=>n.createElementVNode("div",{class:"play-seeker-image__info__ai"},"Inteligencia Artificial",-1)),jP={class:"play-seeker-image__info__legends-and-button"},HP=Si(()=>n.createElementVNode("div",{class:"play-seeker-image__info__legends-and-button__legends"},"LEYENDAS PARA TI",-1)),WP={class:"play-icon"},KP=["src"],qP=Si(()=>n.createElementVNode("div",{class:"text"},"Explora videos",-1)),YP={class:"play-seeker-image__players"},JP=["src"],XP={key:3,class:"container-selectors-mobile"},ZP={class:"container-selectors-mobile-tournament"},QP={class:"container-selectors-mobile-season"},eO={key:0,class:"home-item-movil"},tO=Si(()=>n.createElementVNode("div",{class:"home-movil"},"Inicio",-1)),sO={class:"name-user-movil"},aO={key:1,class:"home-item"},nO={key:2,class:"bar-settings"},iO={class:"name-user"},oO={class:"container-selectors"},rO={class:"selector-tournament"},lO={class:"selector-seasons"},cO={key:3,class:"stories-circle-wrapper"},dO=["onClick"],hO={class:"story-result"},uO={key:0,class:"font-bold"},mO={key:1,class:"font-bold"},fO={class:"story-match"},pO={key:4,class:"container-games"},gO={key:6,class:"container-players"},yO={class:"container-tops"};function bO(s,e,t,a,i,o){const r=n.resolveComponent("Stories"),l=n.resolveComponent("CarouselFullScreen"),d=n.resolveComponent("GSCTournamentSelect"),c=n.resolveComponent("GSCSeasonSelect"),h=n.resolveComponent("GSCSlider"),u=n.resolveComponent("GSCGames");n.resolveComponent("DiscoverVideos");const f=n.resolveComponent("GSCGridTeamsMatches"),p=n.resolveComponent("GSCTableCalendar"),m=n.resolveComponent("GSCPlayersLanding"),g=n.resolveComponent("GSCTops");return n.openBlock(),n.createElementBlock("div",VP,[i.isStoriesVisible&&t.showStories?(n.openBlock(),n.createBlock(r,{key:0,stories:i.currentStories,"start-story-index":i.currentStoriesLastIndex,"is-first-game-stories":i.currentStoryIndex===0,"is-last-game-stories":i.currentStoryIndex===i.storiesItems.length-1,onLastStoryIndex:o.changeIndexStory,onClose:o.onCloseStories,onSwipe:o.onSwipeStories,onVideoNextBack:o.onClickNextBackVideo,onVideoPlay:o.onVideoPlay},null,8,["stories","start-story-index","is-first-game-stories","is-last-game-stories","onLastStoryIndex","onClose","onSwipe","onVideoNextBack","onVideoPlay"])):n.createCommentVNode("",!0),i.isCarouselFullScreenVisible?(n.openBlock(),n.createBlock(l,{key:1,"player-queue":i.carouselPlayerQueue,"is-play-seeker":i.isPlaySeeker,"playlist-index":0,onClose:o.onClickCloseCarousel},null,8,["player-queue","is-play-seeker","onClose"])):n.createCommentVNode("",!0),o.isPlaySeekerAvailable?(n.openBlock(),n.createElementBlock("div",UP,[n.createElementVNode("div",zP,[GP,n.createElementVNode("div",jP,[HP,n.createElementVNode("div",{role:"button",class:"play-seeker-image__info__legends-and-button__button",onClick:e[0]||(e[0]=(...y)=>o.onClickPlaySeeker&&o.onClickPlaySeeker(...y))},[n.createElementVNode("div",WP,[n.createElementVNode("img",{src:`${i.imagesUrl}icn-play.svg`,alt:""},null,8,KP)]),qP])])]),n.createElementVNode("div",YP,[n.createElementVNode("img",{src:`${i.imagesUrl}players@2x.png`,alt:""},null,8,JP)])])):n.createCommentVNode("",!0),a.elementSize.width<=680&&a.elementSize.width>0?(n.openBlock(),n.createElementBlock("div",XP,[n.createElementVNode("div",ZP,[n.createVNode(d,{"current-season-id":t.currentSeasonId,width:"100%","api-url":t.tournamentsApiUrl,onInput:o.onInputTournament,onChangeTournaments:o.onChangeTournaments},null,8,["current-season-id","api-url","onInput","onChangeTournaments"])]),n.createElementVNode("div",QP,[n.createVNode(c,{"current-season-id":t.currentSeasonId,width:"100%",seasons:i.tournamentSelectedDropDowns.seasons,onInput:o.onInputSeason},null,8,["current-season-id","seasons","onInput"])])])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(o.containerbackground)},[n.createElementVNode("div",{class:n.normalizeClass(o.containerdata)},[a.elementSize.width<=680?(n.openBlock(),n.createElementBlock("div",eO,[tO,n.createElementVNode("div",sO,[t.isFemale?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode("Bienvenida")],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode("Bienvenido ")],64)),i.is_public?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createTextVNode("a GolStats ")],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createTextVNode(n.toDisplayString(o.formatUsername(t.user.name)),1)],64))])])):n.createCommentVNode("",!0),a.elementSize.width>680?(n.openBlock(),n.createElementBlock("div",aO,"Inicio")):n.createCommentVNode("",!0),a.elementSize.width>680?(n.openBlock(),n.createElementBlock("div",nO,[n.createElementVNode("div",iO,[t.isFemale?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode("Bienvenida")],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode("Bienvenido ")],64)),i.is_public?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createTextVNode("a GolStats ")],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createTextVNode(n.toDisplayString(o.formatUsername(t.user.name)),1)],64))]),n.createElementVNode("div",oO,[n.createElementVNode("div",rO,[n.createVNode(d,{"current-season-id":t.currentSeasonId,"api-url":t.tournamentsApiUrl,onInput:o.onInputTournament,onChangeTournaments:o.onChangeTournaments},null,8,["current-season-id","api-url","onInput","onChangeTournaments"])]),n.createElementVNode("div",lO,[n.createVNode(c,{"current-season-id":t.currentSeasonId,seasons:i.tournamentSelectedDropDowns.seasons,onInput:o.onInputSeason},null,8,["current-season-id","seasons","onInput"])])])])):n.createCommentVNode("",!0),i.gamesAllStories.length>0&&!i.is_public&&i.show_stories&&t.showStories?(n.openBlock(),n.createElementBlock("div",cO,[(n.openBlock(),n.createBlock(h,{key:i.keyupdate,height:"130px",pxScroll:86,scrollColor:"none",arrowsPosition:"absolute","background-color":"none",arrowsScrollHide:!0,arrowsHideOnNoScroll:!0,arrowsBackground:"rgba(255,255,255,.16)",arrowsContainerBgL:"linear-gradient(270deg, rgba(13,29,42,0.1) 0%, rgba(13,29,42,1) 70%)",arrowsContainerBgR:"linear-gradient(90deg, rgba(13,29,42,0.1) 0%, rgba(13,29,42,1) 70%)",arrowsMargin:0,arrowsRadius:"50%",arrowsBorder:"#ddd"},{default:n.withCtx(()=>[n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.gamesAllStories,(y,b)=>(n.openBlock(),n.createElementBlock("div",{key:b,class:"story-container-game",onClick:S=>o.onClickStory({item:y,index:b})},[n.createElementVNode("div",{class:"story-circle",style:n.normalizeStyle(y.is_live==1?(y.status_storie==1,"border: 2px solid #cbee6b !important;"):y.status_storie==1?"border: 2px solid #2248a2 !important;":"border: 2px solid #41485B !important;")},[n.createElementVNode("div",{class:"circle-item-home",style:n.normalizeStyle("background-image: url(https://az755631.vo.msecnd.net/teams-80/"+y.home_team+".png)")},null,4),n.createElementVNode("div",{class:"circle-item-away",style:n.normalizeStyle("background-image: url(https://az755631.vo.msecnd.net/teams-80/"+y.visiting_team+".png)")},null,4)],4),n.createElementVNode("div",hO,[n.createTextVNode(n.toDisplayString(y.home_team_acronym)+" ",1),y.score.length>0?(n.openBlock(),n.createElementBlock("span",uO,n.toDisplayString(isNaN(y.score[0])?0:y.score[0]),1)):n.createCommentVNode("",!0),n.createTextVNode(":"),y.score.length>0?(n.openBlock(),n.createElementBlock("span",mO,n.toDisplayString(isNaN(y.score[1])?0:y.score[1]),1)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(y.visiting_team_acronym),1)]),n.createElementVNode("div",fO,n.toDisplayString(y.matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV")),1)],8,dO))),128))]),_:1}))])):n.createCommentVNode("",!0),Object.keys(i.tournamentSelected).length>0?(n.openBlock(),n.createElementBlock("div",pO,[n.createVNode(u,{"component-width":a.elementSize.width,isplayer:t.isplayer,"is-full":o.isGenericLike,data:o.games,"tournament-schedule-keys":i.tournamentScheduleKeys,"default-match-day-key":i.selectedRound,user:t.user,"current-tournament":i.tournamentSelected,"is-live-button-visible":!!i.allLiveGames.length,onClickCalendar:o.onClickCalendar,onClickMatch:o.onClickMatch,onChangeMatchDay:o.onChangeMatchDayGames,onChangeIsLeagueSelected:o.onChangeIsLeagueSelected,onClickLive:o.onClickLive},null,8,["component-width","isplayer","is-full","data","tournament-schedule-keys","default-match-day-key","user","current-tournament","is-live-button-visible","onClickCalendar","onClickMatch","onChangeMatchDay","onChangeIsLeagueSelected","onClickLive"])])):n.createCommentVNode("",!0),n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(o.containerGridCalendarTable)},[n.createElementVNode("div",{class:"container-grid",style:n.normalizeStyle(a.elementSize.width<748?"width: 100%":"")},[n.createVNode(f,{isPlayer:t.isplayer&&!o.isGenericLike,"player-id":t.user.player,"team-id":t.user.team,"tournament-selected":i.tournamentSelected,"is-public":i.is_public,"season-selected":i.seasonSelected.id,"next-rival-id":Object.keys(i.fullTournamentSchedule).length>0?t.user.team==i.fullTournamentSchedule.data.prematch.home_team?i.fullTournamentSchedule.data.prematch.visiting_team:i.fullTournamentSchedule.data.prematch.home_team:0,"team-img":"https://az755631.vo.msecnd.net/teams-150/"+t.user.team+".png","player-img":"https://az755631.vo.msecnd.net/players-profile/"+t.user.player+".png","rival-img":Object.keys(i.fullTournamentSchedule).length>0?t.user.team==i.fullTournamentSchedule.data.prematch.home_team?"https://az755631.vo.msecnd.net/teams-150/"+i.fullTournamentSchedule.data.prematch.visiting_team+".png":"https://az755631.vo.msecnd.net/teams-150/"+i.fullTournamentSchedule.data.prematch.home_team+".png":"","has-team":!o.isGenericLike,"component-width":a.elementSize.width,onAction:o.clickCard},null,8,["isPlayer","player-id","team-id","tournament-selected","is-public","season-selected","next-rival-id","team-img","player-img","rival-img","has-team","component-width","onAction"])],4),n.createElementVNode("div",{class:"container-calendar-table",style:n.normalizeStyle(a.elementSize.width<1e3?"width: 100%; margin-top: 30px;":"")},[i.isPreviousDataLoaded?(n.openBlock(),n.createBlock(p,{season:i.seasonSelected,seasons:i.seasonsSelected,"tournament-type":i.tournamentType,tournament:i.tournamentSelected.id,privileges:t.privileges,"is-public":i.is_public,key:i.updateTableCalendar,"team-id":o.teamSelected,componentWidth:a.elementSize&&a.elementSize.width?a.elementSize.width:0,tournaments:i.currentTournaments,onAction:o.onAction,onOnOpenProfile:o.onOpenProfile,onOpenmedia:o.onOpenMedia},null,8,["season","seasons","tournament-type","tournament","privileges","is-public","team-id","componentWidth","tournaments","onAction","onOnOpenProfile","onOpenmedia"])):n.createCommentVNode("",!0)],4)],2),o.isGenericLike?n.createCommentVNode("",!0):n.withDirectives((n.openBlock(),n.createElementBlock("div",gO,[i.isPreviousDataLoaded?(n.openBlock(),n.createBlock(m,{key:0,"tournament-selected":i.tournamentSelected,onClickProfileBtn:o.clickProfileBtn,onViewAll:o.viewAll,onTotalPlayers:o.getTotalPlayers,"team-id":t.user.team,"season-id":i.seasonSelected.id,"is-player":!!t.user.player},null,8,["tournament-selected","onClickProfileBtn","onViewAll","onTotalPlayers","team-id","season-id","is-player"])):n.createCommentVNode("",!0)],512)),[[n.vShow,i.playersLength>0]]),n.createElementVNode("div",yO,[i.isPreviousDataLoaded?(n.openBlock(),n.createBlock(g,{key:0,"tournament-selected":i.tournamentSelected,onMore:o.moreTops,"show-switch":!o.isGenericLike,season:i.seasonSelected.id,"show-more":!i.is_public,"team-id":t.user.team,"active-videos":i.is_public?t.privileges.vr_privileges:!0,onOpenmedia:o.onOpenMedia},null,8,["tournament-selected","onMore","show-switch","season","show-more","team-id","active-videos","onOpenmedia"])):n.createCommentVNode("",!0)]),i.is_public?(n.openBlock(),n.createElementBlock("div",{key:7,class:"b2c-image",onClick:e[1]||(e[1]=(...y)=>o.abrirNuevaVentana&&o.abrirNuevaVentana(...y))})):n.createCommentVNode("",!0)],2)],2)],512)}const SO=qe($P,[["render",bO],["__scopeId","data-v-4d47d079"]]);hs.GSCLanding=SO,Object.defineProperty(hs,Symbol.toStringTag,{value:"Module"})});
|
|
67
|
+
} (data length: ${t&&t.byteLength})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,a)=>{const i=Zr(this.config),o=e.map(af).filter(r=>!!r&&i.indexOf(r)!==-1);return this.getKeySystemSelectionPromise(o).then(({keySystem:r})=>{const l=of(r);l?t(l):a(new Error(`Unable to find format for key-system "${r}"`))}).catch(a)})}loadKey(e){const t=e.keyInfo.decryptdata,a=this.getKeyIdString(t),i=`(keyId: ${a} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let o=this.keyIdToKeySessionPromise[a];return o||(o=this.keyIdToKeySessionPromise[a]=this.getKeySystemForKeyPromise(t).then(({keySystem:r,mediaKeys:l})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(r,l).then(()=>{this.throwIfDestroyed();const d=this.createMediaKeySessionContext({keySystem:r,mediaKeys:l,decryptdata:t});return this.generateRequestWithPreferredKeySession(d,"cenc",t.pssh,"playlist-key")}))),o.catch(r=>this.handleError(r))),o}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof _t?this.hls.trigger(w.ERROR,e.data):this.hls.trigger(w.ERROR,{type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),a=this.keyIdToKeySessionPromise[t];if(!a){const i=af(e.keyFormat),o=i?[i]:Zr(this.config);return this.attemptKeySystemAccess(o)}return a}getKeySystemSelectionPromise(e){if(e.length||(e=Zr(this.config)),e.length===0)throw new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:a}=e,i=`"${e.type}" event: init data type: "${t}"`;if(this.debug(i),a===null)return;let o,r;if(t==="sinf"&&this.config.drmSystems[Ne.FAIRPLAY]){const u=Ke(new Uint8Array(a));try{const f=Jr(JSON.parse(u).sinf),p=gf(new Uint8Array(f));if(!p)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");o=p.subarray(8,24),r=Ne.FAIRPLAY}catch(f){this.warn(`${i} Failed to parse sinf: ${f}`);return}}else{const u=q6(a),f=u.filter(p=>p.systemId===_a.WIDEVINE)[0];if(!f){u.length===0||u.some(p=>!p.systemId)?this.warn(`${i} contains incomplete or invalid pssh data`):this.log(`ignoring ${i} for ${u.map(p=>nf(p.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(r=nf(f.systemId),f.version===0&&f.data){const p=f.data.length-22;o=f.data.subarray(p,p+16)}}if(!r||!o)return;const l=zt.hexDump(o),{keyIdToKeySessionPromise:d,mediaKeySessions:c}=this;let h=d[l];for(let u=0;u<c.length;u++){const f=c[u],p=f.decryptdata;if(!p.keyId)continue;const m=zt.hexDump(p.keyId);if(l===m||p.uri.replace(/-/g,"").indexOf(l)!==-1){if(h=d[m],p.pssh)break;delete d[m],p.pssh=new Uint8Array(a),p.keyId=o,h=d[l]=h.then(()=>this.generateRequestWithPreferredKeySession(f,t,a,"encrypted-event-key-match"));break}}h||(h=d[l]=this.getKeySystemSelectionPromise([r]).then(({keySystem:u,mediaKeys:f})=>{var p;this.throwIfDestroyed();const m=new Ea("ISO-23001-7",l,(p=of(u))!=null?p:"");return m.pssh=new Uint8Array(a),m.keyId=o,this.attemptSetMediaKeys(u,f).then(()=>{this.throwIfDestroyed();const g=this.createMediaKeySessionContext({decryptdata:m,keySystem:u,mediaKeys:f});return this.generateRequestWithPreferredKeySession(g,t,a,"encrypted-event-no-match")})})),h.catch(u=>this.handleError(u))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const a=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(a).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),a.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(o=>a.indexOf(o)===-1)})}generateRequestWithPreferredKeySession(e,t,a,i){var o,r;const l=(o=this.config.drmSystems)==null||(r=o[e.keySystem])==null?void 0:r.generateRequest;if(l)try{const m=l.call(this.hls,t,a,e);if(!m)throw new Error("Invalid response from configured generateRequest filter");t=m.initDataType,a=e.decryptdata.pssh=m.initData?new Uint8Array(m.initData):null}catch(m){var d;if(this.warn(m.message),(d=this.hls)!=null&&d.config.debug)throw m}if(a===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const c=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${c} (init data type: ${t} length: ${a?a.byteLength:null})`);const h=new Al,u=e._onmessage=m=>{const g=e.mediaKeysSession;if(!g){h.emit("error",new Error("invalid state"));return}const{messageType:y,message:b}=m;this.log(`"${y}" message event for session "${g.sessionId}" message size: ${b.byteLength}`),y==="license-request"||y==="license-renewal"?this.renewLicense(e,b).catch(S=>{this.handleError(S),h.emit("error",S)}):y==="license-release"?e.keySystem===Ne.FAIRPLAY&&(this.updateKeySession(e,Xr("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${y}"`)},f=e._onkeystatuseschange=m=>{if(!e.mediaKeysSession){h.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const y=e.keyStatus;h.emit("keyStatus",y),y==="expired"&&(this.warn(`${e.keySystem} expired for key ${c}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",u),e.mediaKeysSession.addEventListener("keystatuseschange",f);const p=new Promise((m,g)=>{h.on("error",g),h.on("keyStatus",y=>{y.startsWith("usable")?m():y==="output-restricted"?g(new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):y==="internal-error"?g(new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${y}"`)):y==="expired"?g(new Error("key expired while generating request")):this.warn(`unhandled key status change "${y}"`)})});return e.mediaKeysSession.generateRequest(t,a).then(()=>{var m;this.log(`Request generated for key-session "${(m=e.mediaKeysSession)==null?void 0:m.sessionId}" keyId: ${c}`)}).catch(m=>{throw new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_NO_SESSION,error:m,fatal:!1},`Error generating key-session request: ${m}`)}).then(()=>p).catch(m=>{throw h.removeAllListeners(),this.removeSession(e),m}).then(()=>(h.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,a)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${zt.hexDump("buffer"in a?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a))} session keyId: ${zt.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,a=t.loader,i=new a(t),o=this.getServerCertificateUrl(e);return o?(this.log(`Fetching server certificate for "${e}"`),new Promise((r,l)=>{const d={responseType:"arraybuffer",url:o},c=t.certLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(f,p,m,g)=>{r(f.data)},onError:(f,p,m,g)=>{l(new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:m,response:Xe({url:d.url,data:void 0},f)},`"${e}" certificate request failed (${o}). Status: ${f.code} (${f.text})`))},onTimeout:(f,p,m)=>{l(new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:m,response:{url:d.url,data:void 0}},`"${e}" certificate request timed out (${o})`))},onAbort:(f,p,m)=>{l(new Error("aborted"))}};i.load(d,h,u)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,a){return new Promise((i,o)=>{e.setServerCertificate(a).then(r=>{this.log(`setServerCertificate ${r?"success":"not supported by CDM"} (${a==null?void 0:a.byteLength}) on "${t}"`),i(e)}).catch(r=>{o(new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:r,fatal:!0},r.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(a=>this.updateKeySession(e,new Uint8Array(a)).catch(i=>{throw new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const a=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!a.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(a,"application/xml"),o=i.querySelectorAll("HttpHeader");if(o.length>0){let h;for(let u=0,f=o.length;u<f;u++){var r,l;h=o[u];const p=(r=h.querySelector("name"))==null?void 0:r.textContent,m=(l=h.querySelector("value"))==null?void 0:l.textContent;p&&m&&e.setRequestHeader(p,m)}}const d=i.querySelector("Challenge"),c=d==null?void 0:d.textContent;if(!c)throw new Error("Cannot find <Challenge> in key message");return Xr(atob(c))}setupLicenseXHR(e,t,a,i){const o=this.config.licenseXhrSetup;return o?Promise.resolve().then(()=>{if(!a.decryptdata)throw new Error("Key removed");return o.call(this.hls,e,t,a,i)}).catch(r=>{if(!a.decryptdata)throw r;return e.open("POST",t,!0),o.call(this.hls,e,t,a,i)}).then(r=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:r||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const a=this.config.keyLoadPolicy.default;return new Promise((i,o)=>{const r=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${r}`);const l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return o(new Error("invalid state"));if(l.readyState===4)if(l.status===200){this._requestLicenseFailureCount=0;let d=l.response;this.log(`License received ${d instanceof ArrayBuffer?d.byteLength:d}`);const c=this.config.licenseResponseCallback;if(c)try{d=c.call(this.hls,l,r,e)}catch(h){this.error(h)}i(d)}else{const d=a.errorRetry,c=d?d.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>c||l.status>=400&&l.status<500)o(new _t({type:fe.KEY_SYSTEM_ERROR,details:N.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:l,response:{url:r,data:void 0,code:l.status,text:l.statusText}},`License Request XHR failed (${r}). Status: ${l.status} (${l.statusText})`));else{const h=c-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${h} attempts left`),this.requestLicense(e,t).then(i,o)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,r,e,t).then(({xhr:d,licenseChallenge:c})=>{e.keySystem==Ne.PLAYREADY&&(c=this.unpackPlayReadyKeyMessage(d,c)),d.send(c)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const a=t.media;this.media=a,a.addEventListener("encrypted",this.onMediaEncrypted),a.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Ea.clearKeyUriToKeyIdMap();const a=t.length;qs.CDMCleanupPromise=Promise.all(t.map(i=>this.removeSession(i)).concat(e==null?void 0:e.setMediaKeys(null).catch(i=>{this.log(`Could not clear media keys: ${i}`)}))).then(()=>{a&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(i=>{this.log(`Could not close sessions and clear media keys: ${i}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const a=t.reduce((i,o)=>(i.indexOf(o.keyFormat)===-1&&i.push(o.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${a.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(a)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:a}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),a&&a.readyState!==XMLHttpRequest.DONE&&a.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),t.remove().catch(o=>{this.log(`Could not remove session: ${o}`)}).then(()=>t.close()).catch(o=>{this.log(`Could not close session: ${o}`)})}}}qs.CDMCleanupPromise=void 0;class _t extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var lt;(function(s){s.MANIFEST="m",s.AUDIO="a",s.VIDEO="v",s.MUXED="av",s.INIT="i",s.CAPTION="c",s.TIMED_TEXT="tt",s.KEY="k",s.OTHER="o"})(lt||(lt={}));var Ul;(function(s){s.DASH="d",s.HLS="h",s.SMOOTH="s",s.OTHER="o"})(Ul||(Ul={}));var Cs;(function(s){s.OBJECT="CMCD-Object",s.REQUEST="CMCD-Request",s.SESSION="CMCD-Session",s.STATUS="CMCD-Status"})(Cs||(Cs={}));const bD={[Cs.OBJECT]:["br","d","ot","tb"],[Cs.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[Cs.SESSION]:["cid","pr","sf","sid","st","v"],[Cs.STATUS]:["bs","rtp"]};class Ys{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(a=>a instanceof Ys?a:new Ys(a))),this.value=e,this.params=t}}class qp{constructor(e){this.description=void 0,this.description=e}}const SD="Dict";function wD(s){return Array.isArray(s)?JSON.stringify(s):s instanceof Map?"Map{}":s instanceof Set?"Set{}":typeof s=="object"?JSON.stringify(s):String(s)}function _D(s,e,t,a){return new Error(`failed to ${s} "${wD(e)}" as ${t}`,{cause:a})}const Yp="Bare Item",kD="Boolean",ED="Byte Sequence",TD="Decimal",CD="Integer";function xD(s){return s<-999999999999999||999999999999999<s}const vD=/[\x00-\x1f\x7f]+/,AD="Token",LD="Key";function Kt(s,e,t){return _D("serialize",s,e,t)}function ID(s){if(typeof s!="boolean")throw Kt(s,kD);return s?"?1":"?0"}function RD(s){return btoa(String.fromCharCode(...s))}function BD(s){if(ArrayBuffer.isView(s)===!1)throw Kt(s,ED);return`:${RD(s)}:`}function Jp(s){if(xD(s))throw Kt(s,CD);return s.toString()}function ND(s){return`@${Jp(s.getTime()/1e3)}`}function Xp(s,e){if(s<0)return-Xp(-s,e);const t=Math.pow(10,e);if(Math.abs(s*t%1-.5)<Number.EPSILON){const i=Math.floor(s*t);return(i%2===0?i:i+1)/t}else return Math.round(s*t)/t}function DD(s){const e=Xp(s,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Kt(s,TD);const t=e.toString();return t.includes(".")?t:`${t}.0`}const PD="String";function OD(s){if(vD.test(s))throw Kt(s,PD);return`"${s.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function FD(s){return s.description||s.toString().slice(7,-1)}function Zp(s){const e=FD(s);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Kt(e,AD);return e}function zl(s){switch(typeof s){case"number":if(!ne(s))throw Kt(s,Yp);return Number.isInteger(s)?Jp(s):DD(s);case"string":return OD(s);case"symbol":return Zp(s);case"boolean":return ID(s);case"object":if(s instanceof Date)return ND(s);if(s instanceof Uint8Array)return BD(s);if(s instanceof qp)return Zp(s);default:throw Kt(s,Yp)}}function Gl(s){if(/^[a-z*][a-z0-9\-_.*]*$/.test(s)===!1)throw Kt(s,LD);return s}function jl(s){return s==null?"":Object.entries(s).map(([e,t])=>t===!0?`;${Gl(e)}`:`;${Gl(e)}=${zl(t)}`).join("")}function Qp(s){return s instanceof Ys?`${zl(s.value)}${jl(s.params)}`:zl(s)}function MD(s){return`(${s.value.map(Qp).join(" ")})${jl(s.params)}`}function $D(s,e={whitespace:!0}){if(typeof s!="object")throw Kt(s,SD);const t=s instanceof Map?s.entries():Object.entries(s),a=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,o])=>{o instanceof Ys||(o=new Ys(o));let r=Gl(i);return o.value===!0?r+=jl(o.params):(r+="=",Array.isArray(o.value)?r+=MD(o):r+=Qp(o)),r}).join(`,${a}`)}function VD(s,e){return $D(s,e)}const UD=s=>s==="ot"||s==="sf"||s==="st",zD=s=>typeof s=="number"?ne(s):s!=null&&s!==""&&s!==!1;function GD(s,e){const t=new URL(s),a=new URL(e);if(t.origin!==a.origin)return s;const i=t.pathname.split("/").slice(1),o=a.pathname.split("/").slice(1,-1);for(;i[0]===o[0];)i.shift(),o.shift();for(;o.length;)o.shift(),i.unshift("..");return i.join("/")}function jD(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const o=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?o:o&3|8).toString(16)})}}}const fi=s=>Math.round(s),HD=(s,e)=>(e!=null&&e.baseUrl&&(s=GD(s,e.baseUrl)),encodeURIComponent(s)),pi=s=>fi(s/100)*100,WD={br:fi,d:fi,bl:pi,dl:pi,mtp:pi,nor:HD,rtp:pi,tb:fi};function KD(s,e){const t={};if(s==null||typeof s!="object")return t;const a=Object.keys(s).sort(),i=Ge({},WD,e==null?void 0:e.formatters),o=e==null?void 0:e.filter;return a.forEach(r=>{if(o!=null&&o(r))return;let l=s[r];const d=i[r];d&&(l=d(l,e)),!(r==="v"&&l===1)&&(r=="pr"&&l===1||zD(l)&&(UD(r)&&typeof l=="string"&&(l=new qp(l)),t[r]=l))}),t}function eg(s,e={}){return s?VD(KD(s,e),Ge({whitespace:!1},e)):""}function qD(s,e={}){if(!s)return{};const t=Object.entries(s),a=Object.entries(bD).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=t.reduce((o,r)=>{var l,d;const[c,h]=r,u=((l=a.find(f=>f[1].includes(c)))==null?void 0:l[0])||Cs.REQUEST;return(d=o[u])!=null||(o[u]={}),o[u][c]=h,o},{});return Object.entries(i).reduce((o,[r,l])=>(o[r]=eg(l,e),o),{})}function YD(s,e,t){return Ge(s,qD(e,t))}const JD="CMCD";function XD(s,e={}){if(!s)return"";const t=eg(s,e);return`${JD}=${encodeURIComponent(t)}`}const tg=/CMCD=[^&#]+/;function ZD(s,e,t){const a=XD(e,t);if(!a)return s;if(tg.test(s))return s.replace(tg,a);const i=s.includes("?")?"&":"?";return`${s}${i}${a}`}class QD{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:lt.MANIFEST,su:!this.initialized})}catch(o){A.warn("Could not generate manifest CMCD data.",o)}},this.applyFragmentData=i=>{try{const o=i.frag,r=this.hls.levels[o.level],l=this.getObjectType(o),d={d:o.duration*1e3,ot:l};(l===lt.VIDEO||l===lt.AUDIO||l==lt.MUXED)&&(d.br=r.bitrate/1e3,d.tb=this.getTopBandwidth(l)/1e3,d.bl=this.getBufferLength(l)),this.apply(i,d)}catch(o){A.warn("Could not generate segment CMCD data.",o)}},this.hls=e;const t=this.config=e.config,{cmcd:a}=t;a!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=a.sessionId||jD(),this.cid=a.contentId,this.useHeaders=a.useHeaders===!0,this.includeKeys=a.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(w.MEDIA_DETACHED,this.onMediaDetached,this),e.on(w.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(w.MEDIA_DETACHED,this.onMediaDetached,this),e.off(w.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var a,i;this.audioBuffer=(a=t.tracks.audio)==null?void 0:a.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:Ul.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){Ge(t,this.createData());const a=t.ot===lt.INIT||t.ot===lt.VIDEO||t.ot===lt.MUXED;this.starved&&a&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((o,r)=>(i.includes(r)&&(o[r]=t[r]),o),{})),this.useHeaders?(e.headers||(e.headers={}),YD(e.headers,t)):e.url=ZD(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return lt.TIMED_TEXT;if(e.sn==="initSegment")return lt.INIT;if(t==="audio")return lt.AUDIO;if(t==="main")return this.hls.audioTracks.length?lt.VIDEO:lt.MUXED}getTopBandwidth(e){let t=0,a;const i=this.hls;if(e===lt.AUDIO)a=i.audioTracks;else{const o=i.maxAutoLevel,r=o>-1?o+1:i.levels.length;a=i.levels.slice(0,r)}for(const o of a)o.bitrate>t&&(t=o.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,a=e===lt.AUDIO?this.audioBuffer:this.videoBuffer;return!a||!t?NaN:De.bufferInfo(a,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,a=e||this.config.loader;return class{constructor(o){this.loader=void 0,this.loader=new a(o)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(o,r,l){t(o),this.loader.load(o,r,l)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,a=e||this.config.loader;return class{constructor(o){this.loader=void 0,this.loader=new a(o)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(o,r,l){t(o),this.loader.load(o,r,l)}}}}const eP=3e5;class tP{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=A.log.bind(A,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(w.MANIFEST_PARSED,this.onManifestParsed,this),e.on(w.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(w.MANIFEST_PARSED,this.onManifestParsed,this),e.off(w.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(a=>a!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:a}=t;a!==null&&(this.pathwayId=a.pathwayId,this.uri=a.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:a}=t;if((a==null?void 0:a.action)===nt.SendAlternateToPenaltyBox&&a.flags===Pt.MoveAllAlternatesMatchingHost){const i=this.levels;let o=this.pathwayPriority,r=this.pathwayId;if(t.context){const{groupId:l,pathwayId:d,type:c}=t.context;l&&i?r=this.getPathwayForGroupId(l,c,r):d&&(r=d)}r in this.penalizedPathways||(this.penalizedPathways[r]=performance.now()),!o&&i&&(o=i.reduce((l,d)=>(l.indexOf(d.pathwayId)===-1&&l.push(d.pathwayId),l),[])),o&&o.length>1&&(this.updatePathwayPriority(o),a.resolved=this.pathwayId!==r),a.resolved||A.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${r} levels: ${i&&i.length} priorities: ${JSON.stringify(o)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const a=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${a}"`),t=this.getLevelsForPathway(a),this.pathwayId=a}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let t;const a=this.penalizedPathways,i=performance.now();Object.keys(a).forEach(o=>{i-a[o]>eP&&delete a[o]});for(let o=0;o<e.length;o++){const r=e[o];if(r in a)continue;if(r===this.pathwayId)return;const l=this.hls.nextLoadLevel,d=this.hls.levels[l];if(t=this.getLevelsForPathway(r),t.length>0){this.log(`Setting Pathway to "${r}"`),this.pathwayId=r,Wf(t),this.hls.trigger(w.LEVELS_UPDATED,{levels:t});const c=this.hls.levels[l];d&&c&&this.levels&&(c.attrs["STABLE-VARIANT-ID"]!==d.attrs["STABLE-VARIANT-ID"]&&c.bitrate!==d.bitrate&&this.log(`Unstable Pathways change from bitrate ${d.bitrate} to ${c.bitrate}`),this.hls.nextLoadLevel=l);break}}}getPathwayForGroupId(e,t,a){const i=this.getLevelsForPathway(a).concat(this.levels||[]);for(let o=0;o<i.length;o++)if(t===xe.AUDIO_TRACK&&i[o].hasAudioGroup(e)||t===xe.SUBTITLE_TRACK&&i[o].hasSubtitleGroup(e))return i[o].pathwayId;return a}clonePathways(e){const t=this.levels;if(!t)return;const a={},i={};e.forEach(o=>{const{ID:r,"BASE-ID":l,"URI-REPLACEMENT":d}=o;if(t.some(h=>h.pathwayId===r))return;const c=this.getLevelsForPathway(l).map(h=>{const u=new Oe(h.attrs);u["PATHWAY-ID"]=r;const f=u.AUDIO&&`${u.AUDIO}_clone_${r}`,p=u.SUBTITLES&&`${u.SUBTITLES}_clone_${r}`;f&&(a[u.AUDIO]=f,u.AUDIO=f),p&&(i[u.SUBTITLES]=p,u.SUBTITLES=p);const m=ag(h.uri,u["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",d),g=new Vs({attrs:u,audioCodec:h.audioCodec,bitrate:h.bitrate,height:h.height,name:h.name,url:m,videoCodec:h.videoCodec,width:h.width});if(h.audioGroups)for(let y=1;y<h.audioGroups.length;y++)g.addGroupId("audio",`${h.audioGroups[y]}_clone_${r}`);if(h.subtitleGroups)for(let y=1;y<h.subtitleGroups.length;y++)g.addGroupId("text",`${h.subtitleGroups[y]}_clone_${r}`);return g});t.push(...c),sg(this.audioTracks,a,d,r),sg(this.subtitleTracks,i,d,r)})}loadSteeringManifest(e){const t=this.hls.config,a=t.loader;this.loader&&this.loader.destroy(),this.loader=new a(t);let i;try{i=new self.URL(e)}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const h=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+h)}const o={responseType:"json",url:i.href},r=t.steeringManifestLoadPolicy.default,l=r.errorRetry||r.timeoutRetry||{},d={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},c={onSuccess:(h,u,f,p)=>{this.log(`Loaded steering manifest: "${i}"`);const m=h.data;if(m.VERSION!==1){this.log(`Steering VERSION ${m.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=m.TTL;const{"RELOAD-URI":g,"PATHWAY-CLONES":y,"PATHWAY-PRIORITY":b}=m;if(g)try{this.uri=new self.URL(g,i).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${g}`);return}this.scheduleRefresh(this.uri||f.url),y&&this.clonePathways(y);const S={steeringManifest:m,url:i.toString()};this.hls.trigger(w.STEERING_MANIFEST_LOADED,S),b&&this.updatePathwayPriority(b)},onError:(h,u,f,p)=>{if(this.log(`Error loading steering manifest: ${h.code} ${h.text} (${u.url})`),this.stopLoad(),h.code===410){this.enabled=!1,this.log(`Steering manifest ${u.url} no longer available`);return}let m=this.timeToLoad*1e3;if(h.code===429){const g=this.loader;if(typeof(g==null?void 0:g.getResponseHeader)=="function"){const y=g.getResponseHeader("Retry-After");y&&(m=parseFloat(y)*1e3)}this.log(`Steering manifest ${u.url} rate limited`);return}this.scheduleRefresh(this.uri||u.url,m)},onTimeout:(h,u,f)=>{this.log(`Timeout loading steering manifest (${u.url})`),this.scheduleRefresh(this.uri||u.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(o,d,c)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var a;const i=(a=this.hls)==null?void 0:a.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function sg(s,e,t,a){s&&Object.keys(e).forEach(i=>{const o=s.filter(r=>r.groupId===i).map(r=>{const l=Ge({},r);return l.details=void 0,l.attrs=new Oe(l.attrs),l.url=l.attrs.URI=ag(r.url,r.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),l.groupId=l.attrs["GROUP-ID"]=e[i],l.attrs["PATHWAY-ID"]=a,l});s.push(...o)})}function ag(s,e,t,a){const{HOST:i,PARAMS:o,[t]:r}=a;let l;e&&(l=r==null?void 0:r[e],l&&(s=l));const d=new self.URL(s);return i&&!l&&(d.host=i),o&&Object.keys(o).sort().forEach(c=>{c&&d.searchParams.set(c,o[c])}),d.href}const sP=/^age:\s*[\d.]+\s*$/im;class ng{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new $n,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,a){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=a,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const a=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const o=this.xhrSetup;o?Promise.resolve().then(()=>{if(!(this.loader!==a||this.stats.aborted))return o(a,t.url)}).catch(r=>{if(!(this.loader!==a||this.stats.aborted))return a.open("GET",t.url,!0),o(a,t.url)}).then(()=>{this.loader!==a||this.stats.aborted||this.openAndSendXhr(a,t,e)}).catch(r=>{this.callbacks.onError({code:a.status,text:r.message},t,a,i)}):this.openAndSendXhr(a,t,e)}openAndSendXhr(e,t,a){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:o,maxLoadTimeMs:r}=a.loadPolicy;if(i)for(const l in i)e.setRequestHeader(l,i[l]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),a.timeout=o&&ne(o)?o:r,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:a}=this;if(!e||!t)return;const i=t.readyState,o=this.config;if(!a.aborted&&i>=2&&(a.loading.first===0&&(a.loading.first=Math.max(self.performance.now(),a.loading.start),o.timeout!==o.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),o.timeout=o.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.loadPolicy.maxLoadTimeMs-(a.loading.first-a.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const r=t.status,l=t.responseType!=="text";if(r>=200&&r<300&&(l&&t.response||t.responseText!==null)){a.loading.end=Math.max(self.performance.now(),a.loading.first);const d=l?t.response:t.responseText,c=t.responseType==="arraybuffer"?d.byteLength:d.length;if(a.loaded=a.total=c,a.bwEstimate=a.total*8e3/(a.loading.end-a.loading.first),!this.callbacks)return;const h=this.callbacks.onProgress;if(h&&h(a,e,d,t),!this.callbacks)return;const u={url:t.responseURL,data:d,code:r};this.callbacks.onSuccess(u,a,e,t)}else{const d=o.loadPolicy.errorRetry,c=a.retry,h={url:e.url,data:void 0,code:r};Zn(d,c,!1,h)?this.retry(d):(A.error(`${r} while loading ${e.url}`),this.callbacks.onError({code:r,text:t.statusText},e,t,a))}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Zn(e,t,!0))this.retry(e);else{var a;A.warn(`timeout while loading ${(a=this.context)==null?void 0:a.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:a}=this;this.retryDelay=fl(e,a.retry),a.retry++,A.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${a.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&sP.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function aP(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const nP=/(\d+)-(\d+)\/(\d+)/;class ig{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||lP,this.controller=new self.AbortController,this.stats=new $n}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,a){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const o=iP(e,this.controller.signal),r=a.onProgress,l=e.responseType==="arraybuffer",d=l?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:h}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=a,this.request=this.fetchSetup(e,o),self.clearTimeout(this.requestTimeout),t.timeout=c&&ne(c)?c:h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),a.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(u=>{this.response=this.loader=u;const f=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),a.onTimeout(i,e,this.response)},h-(f-i.loading.start)),!u.ok){const{status:p,statusText:m}=u;throw new cP(m||"fetch, bad network response",p,u)}return i.loading.first=f,i.total=rP(u.headers)||i.total,r&&ne(t.highWaterMark)?this.loadProgressively(u,i,e,t.highWaterMark,r):l?u.arrayBuffer():e.responseType==="json"?u.json():u.text()}).then(u=>{const f=this.response;if(!f)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const p=u[d];p&&(i.loaded=i.total=p);const m={url:f.url,data:u,code:f.status};r&&!ne(t.highWaterMark)&&r(i,e,u,f),a.onSuccess(m,i,e,f)}).catch(u=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const f=u&&u.code||0,p=u?u.message:null;a.onError({code:f,text:p},e,u?u.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,a,i=0,o){const r=new np,l=e.body.getReader(),d=()=>l.read().then(c=>{if(c.done)return r.dataLength&&o(t,a,r.flush(),e),Promise.resolve(new ArrayBuffer(0));const h=c.value,u=h.length;return t.loaded+=u,u<i||r.dataLength?(r.push(h),r.dataLength>=i&&o(t,a,r.flush(),e)):o(t,a,h,e),d()}).catch(()=>Promise.reject());return d()}}function iP(s,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(Ge({},s.headers))};return s.rangeEnd&&t.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),t}function oP(s){const e=nP.exec(s);if(e)return parseInt(e[2])-parseInt(e[1])+1}function rP(s){const e=s.get("Content-Range");if(e){const a=oP(e);if(ne(a))return a}const t=s.get("Content-Length");if(t)return parseInt(t)}function lP(s,e){return new self.Request(s.url,e)}class cP extends Error{constructor(e,t,a){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=a}}const dP=/\s/,hP={newCue(s,e,t,a){const i=[];let o,r,l,d,c;const h=self.VTTCue||self.TextTrackCue;for(let f=0;f<a.rows.length;f++)if(o=a.rows[f],l=!0,d=0,c="",!o.isEmpty()){var u;for(let g=0;g<o.chars.length;g++)dP.test(o.chars[g].uchar)&&l?d++:(c+=o.chars[g].uchar,l=!1);o.cueStartTime=e,e===t&&(t+=1e-4),d>=16?d--:d++;const p=Mp(c.trim()),m=Pl(e,t,p);s!=null&&(u=s.cues)!=null&&u.getCueById(m)||(r=new h(e,t,p),r.id=m,r.line=f+1,r.align="left",r.position=10+Math.min(80,Math.floor(d*8/32)*10),i.push(r))}return s&&i.length&&(i.sort((f,p)=>f.line==="auto"||p.line==="auto"?0:f.line>8&&p.line>8?p.line-f.line:f.line-p.line),i.forEach(f=>Ff(s,f))),i}},uP={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},og=Xe(Xe({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:ng,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:$B,bufferController:GN,capLevelController:Vl,errorController:vB,fpsController:yD,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:rf,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:uP},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},mP()),{},{subtitleStreamController:$N,subtitleTrackController:UN,timelineController:pD,audioStreamController:FN,audioTrackController:MN,emeController:qs,cmcdController:QD,contentSteeringController:tP});function mP(){return{cueHandler:hP,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function fP(s,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const t=Hl(s),a=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return a.forEach(o=>{const r=`${o==="level"?"playlist":o}LoadPolicy`,l=e[r]===void 0,d=[];i.forEach(c=>{const h=`${o}Loading${c}`,u=e[h];if(u!==void 0&&l){d.push(h);const f=t[r].default;switch(e[r]={default:f},c){case"TimeOut":f.maxLoadTimeMs=u,f.maxTimeToFirstByteMs=u;break;case"MaxRetry":f.errorRetry.maxNumRetry=u,f.timeoutRetry.maxNumRetry=u;break;case"RetryDelay":f.errorRetry.retryDelayMs=u,f.timeoutRetry.retryDelayMs=u;break;case"MaxRetryTimeout":f.errorRetry.maxRetryDelayMs=u,f.timeoutRetry.maxRetryDelayMs=u;break}}}),d.length&&A.warn(`hls.js config: "${d.join('", "')}" setting(s) are deprecated, use "${r}": ${JSON.stringify(e[r])}`)}),Xe(Xe({},t),e)}function Hl(s){return s&&typeof s=="object"?Array.isArray(s)?s.map(Hl):Object.keys(s).reduce((e,t)=>(e[t]=Hl(s[t]),e),{}):s}function pP(s){const e=s.loader;e!==ig&&e!==ng?(A.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1):aP()&&(s.loader=ig,s.progressive=!0,s.enableSoftwareAES=!0,A.log("[config]: Progressive streaming enabled, using FetchLoader"))}let Wl;class gP extends gl{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(w.LEVEL_LOADED,this.onLevelLoaded,this),e.on(w.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(w.FRAG_BUFFERED,this.onFragBuffered,this),e.on(w.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(w.LEVEL_LOADED,this.onLevelLoaded,this),e.off(w.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(w.FRAG_BUFFERED,this.onFragBuffered,this),e.off(w.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const a=this.hls.config.preferManagedMediaSource,i=[],o={},r={};let l=!1,d=!1,c=!1;t.levels.forEach(h=>{var u,f;const p=h.attrs;let{audioCodec:m,videoCodec:g}=h;((u=m)==null?void 0:u.indexOf("mp4a.40.34"))!==-1&&(Wl||(Wl=/chrome|firefox/i.test(navigator.userAgent)),Wl&&(h.audioCodec=m=void 0)),m&&(h.audioCodec=m=Wn(m,a)),((f=g)==null?void 0:f.indexOf("avc1"))===0&&(g=h.videoCodec=sB(g));const{width:y,height:b,unknownCodecs:S}=h;if(l||(l=!!(y&&b)),d||(d=!!g),c||(c=!!m),S!=null&&S.length||m&&!il(m,"audio",a)||g&&!il(g,"video",a))return;const{CODECS:_,"FRAME-RATE":C,"HDCP-LEVEL":E,"PATHWAY-ID":v,RESOLUTION:T,"VIDEO-RANGE":B}=p,R=`${`${v||"."}-`}${h.bitrate}-${T}-${C}-${_}-${B}-${E}`;if(o[R])if(o[R].uri!==h.url&&!h.attrs["PATHWAY-ID"]){const $=r[R]+=1;h.attrs["PATHWAY-ID"]=new Array($+1).join(".");const K=new Vs(h);o[R]=K,i.push(K)}else o[R].addGroupId("audio",p.AUDIO),o[R].addGroupId("text",p.SUBTITLES);else{const $=new Vs(h);o[R]=$,r[R]=1,i.push($)}}),this.filterAndSortMediaOptions(i,t,l,d,c)}filterAndSortMediaOptions(e,t,a,i,o){let r=[],l=[],d=e;if((a||i)&&o&&(d=d.filter(({videoCodec:m,videoRange:g,width:y,height:b})=>(!!m||!!(y&&b))&&pB(g))),d.length===0){Promise.resolve().then(()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const m=new Error("no level with compatible codecs found in manifest");this.hls.trigger(w.ERROR,{type:fe.MEDIA_ERROR,details:N.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:m,reason:m.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:m}=this.hls.config;r=t.audioTracks.filter(g=>!g.audioCodec||il(g.audioCodec,"audio",m)),rg(r)}t.subtitles&&(l=t.subtitles,rg(l));const c=d.slice(0);d.sort((m,g)=>{if(m.attrs["HDCP-LEVEL"]!==g.attrs["HDCP-LEVEL"])return(m.attrs["HDCP-LEVEL"]||"")>(g.attrs["HDCP-LEVEL"]||"")?1:-1;if(a&&m.height!==g.height)return m.height-g.height;if(m.frameRate!==g.frameRate)return m.frameRate-g.frameRate;if(m.videoRange!==g.videoRange)return Yn.indexOf(m.videoRange)-Yn.indexOf(g.videoRange);if(m.videoCodec!==g.videoCodec){const y=Tf(m.videoCodec),b=Tf(g.videoCodec);if(y!==b)return b-y}if(m.uri===g.uri&&m.codecSet!==g.codecSet){const y=Hn(m.codecSet),b=Hn(g.codecSet);if(y!==b)return b-y}return m.averageBitrate!==g.averageBitrate?m.averageBitrate-g.averageBitrate:0});let h=c[0];if(this.steering&&(d=this.steering.filterParsedLevels(d),d.length!==c.length)){for(let m=0;m<c.length;m++)if(c[m].pathwayId===d[0].pathwayId){h=c[m];break}}this._levels=d;for(let m=0;m<d.length;m++)if(d[m]===h){var u;this._firstLevel=m;const g=h.bitrate,y=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${d.length} level(s) found, first bitrate: ${g}`),((u=this.hls.userConfig)==null?void 0:u.abrEwmaDefaultEstimate)===void 0){const b=Math.min(g,this.hls.config.abrEwmaDefaultEstimateMax);b>y&&y===og.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=b)}break}const f=o&&!i,p={levels:d,audioTracks:r,subtitleTracks:l,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:o,video:i,altAudio:!f&&r.some(m=>!!m.url)};this.hls.trigger(w.MANIFEST_PARSED,p),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const h=new Error("invalid level idx"),u=e<0;if(this.hls.trigger(w.ERROR,{type:fe.OTHER_ERROR,details:N.LEVEL_SWITCH_ERROR,level:e,fatal:u,error:h,reason:h.message}),u)return;e=Math.min(e,t.length-1)}const a=this.currentLevelIndex,i=this.currentLevel,o=i?i.attrs["PATHWAY-ID"]:void 0,r=t[e],l=r.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=r,a===e&&r.details&&i&&o===l)return;this.log(`Switching to level ${e} (${r.height?r.height+"p ":""}${r.videoRange?r.videoRange+" ":""}${r.codecSet?r.codecSet+" ":""}@${r.bitrate})${l?" with Pathway "+l:""} from level ${a}${o?" with Pathway "+o:""}`);const d={level:e,attrs:r.attrs,details:r.details,bitrate:r.bitrate,averageBitrate:r.averageBitrate,maxBitrate:r.maxBitrate,realBitrate:r.realBitrate,width:r.width,height:r.height,codecSet:r.codecSet,audioCodec:r.audioCodec,videoCodec:r.videoCodec,audioGroups:r.audioGroups,subtitleGroups:r.subtitleGroups,loaded:r.loaded,loadError:r.loadError,fragmentError:r.fragmentError,name:r.name,id:r.id,uri:r.uri,url:r.url,urlId:0,audioGroupIds:r.audioGroupIds,textGroupIds:r.textGroupIds};this.hls.trigger(w.LEVEL_SWITCHING,d);const c=r.details;if(!c||c.live){const h=this.switchParams(r.uri,i==null?void 0:i.details,c);this.loadPlaylist(h)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){t.fatal||!t.context||t.context.type===xe.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===le.MAIN){const a=t.elementaryStreams;if(!Object.keys(a).some(o=>!!a[o]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var a;const{level:i,details:o}=t,r=this._levels[i];if(!r){var l;this.warn(`Invalid level index ${i}`),(l=t.deliveryDirectives)!=null&&l.skip&&(o.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(r.fragmentError===0&&(r.loadError=0),this.playlistLoaded(i,t,r.details)):(a=t.deliveryDirectives)!=null&&a.skip&&(o.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,a=this.currentLevel;if(a&&this.shouldLoadPlaylist(a)){let i=a.uri;if(e)try{i=e.addDirectives(i)}catch(r){this.warn(`Could not construct new URL with HLS Delivery Directives: ${r}`)}const o=a.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${o?" Pathway "+o:""} ${i}`),this.clearTimer(),this.hls.trigger(w.LEVEL_LOADING,{url:i,level:t,pathwayId:a.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;const a=this._levels.filter((i,o)=>o!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(r=>r.level=-1)),!1));Wf(a),this._levels=a,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(w.LEVELS_UPDATED,{levels:a})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:a}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(w.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:a}))}}function rg(s){const e={};s.forEach(t=>{const a=t.groupId||"";t.id=e[a]=e[a]||0,e[a]++})}class yP{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const a in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[a].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=N.KEY_LOAD_ERROR,a,i,o){return new Zt({type:fe.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:o,error:a,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:a,cc:i}=e;for(let o=0;o<t.length;o++){const r=t[o];if(i<=r.cc&&(a==="initSegment"||r.sn==="initSegment"||a<r.sn)){this.emeController.selectKeySystemFormat(r).then(l=>{r.setKeyFormat(l)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var a,i;t&&e.setKeyFormat(t);const o=e.decryptdata;if(!o){const c=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,N.KEY_LOAD_ERROR,c))}const r=o.uri;if(!r)return Promise.reject(this.createKeyLoadError(e,N.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${r}"`)));let l=this.keyUriToKeyInfo[r];if((a=l)!=null&&a.decryptdata.key)return o.key=l.decryptdata.key,Promise.resolve({frag:e,keyInfo:l});if((i=l)!=null&&i.keyLoadPromise){var d;switch((d=l.mediaKeySessionContext)==null?void 0:d.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return l.keyLoadPromise.then(c=>(o.key=c.keyInfo.decryptdata.key,{frag:e,keyInfo:l}))}}switch(l=this.keyUriToKeyInfo[r]={decryptdata:o,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},o.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return o.keyFormat==="identity"?this.loadKeyHTTP(l,e):this.loadKeyEME(l,e);case"AES-128":return this.loadKeyHTTP(l,e);default:return Promise.reject(this.createKeyLoadError(e,N.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${o.method}"`)))}}loadKeyEME(e,t){const a={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(a);if(i)return(e.keyLoadPromise=i.then(o=>(e.mediaKeySessionContext=o,a))).catch(o=>{throw e.keyLoadPromise=null,o})}return Promise.resolve(a)}loadKeyHTTP(e,t){const a=this.config,i=a.loader,o=new i(a);return t.keyLoader=e.loader=o,e.keyLoadPromise=new Promise((r,l)=>{const d={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},c=a.keyLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(f,p,m,g)=>{const{frag:y,keyInfo:b,url:S}=m;if(!y.decryptdata||b!==this.keyUriToKeyInfo[S])return l(this.createKeyLoadError(y,N.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),g));b.decryptdata.key=y.decryptdata.key=new Uint8Array(f.data),y.keyLoader=null,b.loader=null,r({frag:y,keyInfo:b})},onError:(f,p,m,g)=>{this.resetLoader(p),l(this.createKeyLoadError(t,N.KEY_LOAD_ERROR,new Error(`HTTP Error ${f.code} loading key ${f.text}`),m,Xe({url:d.url,data:void 0},f)))},onTimeout:(f,p,m)=>{this.resetLoader(p),l(this.createKeyLoadError(t,N.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),m))},onAbort:(f,p,m)=>{this.resetLoader(p),l(this.createKeyLoadError(t,N.INTERNAL_ABORTED,new Error("key loading aborted"),m))}};o.load(d,h,u)})}resetLoader(e){const{frag:t,keyInfo:a,url:i}=e,o=a.loader;t.keyLoader===o&&(t.keyLoader=null,a.loader=null),delete this.keyUriToKeyInfo[i],o&&o.destroy()}}function lg(){return self.SourceBuffer||self.WebKitSourceBuffer}function cg(){if(!Es())return!1;const e=lg();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function bP(){if(!cg())return!1;const s=Es();return typeof(s==null?void 0:s.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>s.isTypeSupported(Ta(e,"video")))||["mp4a.40.2","fLaC"].some(e=>s.isTypeSupported(Ta(e,"audio"))))}function SP(){var s;const e=lg();return typeof(e==null||(s=e.prototype)==null?void 0:s.changeType)=="function"}const wP=250,gi=2,_P=.1,kP=.05;class EP{constructor(e,t,a,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=a,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:a,media:i,stalled:o}=this;if(i===null)return;const{currentTime:r,seeking:l}=i,d=this.seeking&&!l,c=!this.seeking&&l;if(this.seeking=l,r!==e){if(this.moved=!0,l||(this.nudgeRetry=0),o!==null){if(this.stallReported){const y=self.performance.now()-o;A.warn(`playback not stuck anymore @${r}, after ${Math.round(y)}ms`),this.stallReported=!1}this.stalled=null}return}if(c||d){this.stalled=null;return}if(i.paused&&!l||i.ended||i.playbackRate===0||!De.getBuffered(i).length){this.nudgeRetry=0;return}const h=De.bufferInfo(i,r,0),u=h.nextStart||0;if(l){const y=h.len>gi,b=!u||t&&t.start<=r||u-r>gi&&!this.fragmentTracker.getPartialFragment(r);if(y||b)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var f;if(!(h.len>0)&&!u)return;const b=Math.max(u,h.start||0)-r,S=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,C=(S==null||(f=S.details)==null?void 0:f.live)?S.details.targetduration*2:gi,E=this.fragmentTracker.getPartialFragment(r);if(b>0&&(b<=C||E)){i.paused||this._trySkipBufferHole(E);return}}const p=self.performance.now();if(o===null){this.stalled=p;return}const m=p-o;if(!l&&m>=wP&&(this._reportStall(h),!this.media))return;const g=De.bufferInfo(i,r,a.maxBufferHole);this._tryFixBufferStall(g,m)}_tryFixBufferStall(e,t){const{config:a,fragmentTracker:i,media:o}=this;if(o===null)return;const r=o.currentTime,l=i.getPartialFragment(r);l&&(this._trySkipBufferHole(l)||!this.media)||(e.len>a.maxBufferHole||e.nextStart&&e.nextStart-r<a.maxBufferHole)&&t>a.highBufferWatchdogPeriod*1e3&&(A.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:a,stallReported:i}=this;if(!i&&a){this.stallReported=!0;const o=new Error(`Playback stalling at @${a.currentTime} due to low buffer (${JSON.stringify(e)})`);A.warn(o.message),t.trigger(w.ERROR,{type:fe.MEDIA_ERROR,details:N.BUFFER_STALLED_ERROR,fatal:!1,error:o,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:a,media:i}=this;if(i===null)return 0;const o=i.currentTime,r=De.bufferInfo(i,o,0),l=o<r.start?r.start:r.nextStart;if(l){const d=r.len<=t.maxBufferHole,c=r.len>0&&r.len<1&&i.readyState<3,h=l-o;if(h>0&&(d||c)){if(h>t.maxBufferHole){const{fragmentTracker:f}=this;let p=!1;if(o===0){const m=f.getAppendedFrag(0,le.MAIN);m&&l<m.end&&(p=!0)}if(!p){const m=e||f.getAppendedFrag(o,le.MAIN);if(m){let g=!1,y=m.end;for(;y<l;){const b=f.getPartialFragment(y);if(b)y+=b.duration;else{g=!0;break}}if(g)return 0}}}const u=Math.max(l+kP,o+_P);if(A.warn(`skipping hole, adjusting currentTime from ${o} to ${u}`),this.moved=!0,this.stalled=null,i.currentTime=u,e&&!e.gap){const f=new Error(`fragment loaded with buffer holes, seeking from ${o} to ${u}`);a.trigger(w.ERROR,{type:fe.MEDIA_ERROR,details:N.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:f,reason:f.message,frag:e})}return u}}return 0}_tryNudgeBuffer(){const{config:e,hls:t,media:a,nudgeRetry:i}=this;if(a===null)return;const o=a.currentTime;if(this.nudgeRetry++,i<e.nudgeMaxRetry){const r=o+(i+1)*e.nudgeOffset,l=new Error(`Nudging 'currentTime' from ${o} to ${r}`);A.warn(l.message),a.currentTime=r,t.trigger(w.ERROR,{type:fe.MEDIA_ERROR,details:N.BUFFER_NUDGE_ON_STALL,error:l,fatal:!1})}else{const r=new Error(`Playhead still not moving while enough data buffered @${o} after ${e.nudgeMaxRetry} nudges`);A.error(r.message),t.trigger(w.ERROR,{type:fe.MEDIA_ERROR,details:N.BUFFER_STALLED_ERROR,error:r,fatal:!0})}}}const TP=100;class CP extends Sl{constructor(e,t,a){super(e,t,a,"[stream-controller]",le.MAIN),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.MANIFEST_PARSED,this.onManifestParsed,this),e.on(w.LEVEL_LOADING,this.onLevelLoading,this),e.on(w.LEVEL_LOADED,this.onLevelLoaded,this),e.on(w.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(w.ERROR,this.onError,this),e.on(w.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(w.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(w.BUFFER_CREATED,this.onBufferCreated,this),e.on(w.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(w.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(w.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.MANIFEST_PARSED,this.onManifestParsed,this),e.off(w.LEVEL_LOADED,this.onLevelLoaded,this),e.off(w.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(w.ERROR,this.onError,this),e.off(w.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(w.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(w.BUFFER_CREATED,this.onBufferCreated,this),e.off(w.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(w.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(w.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying()}startLoad(e){if(this.levels){const{lastCurrentTime:t,hls:a}=this;if(this.stopLoad(),this.setInterval(TP),this.level=-1,!this.startFragRequested){let i=a.startLevel;i===-1&&(a.config.testBandwidth&&this.levels.length>1?(i=0,this.bitrateTest=!0):i=a.firstAutoLevel),a.nextLoadLevel=i,this.level=a.loadLevel,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=V.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=V.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case V.WAITING_LEVEL:{const{levels:t,level:a}=this,i=t==null?void 0:t[a],o=i==null?void 0:i.details;if(o&&(!o.live||this.levelLastLoaded===i)){if(this.waitForCdnTuneIn(o))break;this.state=V.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=V.IDLE;break}break}case V.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),a=this.retryDate;if(!a||t>=a||(e=this.media)!=null&&e.seeking){const{levels:i,level:o}=this,r=i==null?void 0:i[o];this.resetStartWhenNotLoaded(r||null),this.state=V.IDLE}}break}this.state===V.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:a,media:i}=this;if(t===null||!i&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const o=e.nextLoadLevel;if(!(a!=null&&a[o]))return;const r=a[o],l=this.getMainFwdBufferInfo();if(l===null)return;const d=this.getLevelDetails();if(d&&this._streamEnded(l,d)){const g={};this.altAudio&&(g.type="video"),this.hls.trigger(w.BUFFER_EOS,g),this.state=V.ENDED;return}e.loadLevel!==o&&e.manualLevel===-1&&this.log(`Adapting to level ${o} from level ${this.level}`),this.level=e.nextLoadLevel=o;const c=r.details;if(!c||this.state===V.WAITING_LEVEL||c.live&&this.levelLastLoaded!==r){this.level=o,this.state=V.WAITING_LEVEL;return}const h=l.len,u=this.getMaxBufferLength(r.maxBitrate);if(h>=u)return;this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);const f=this.backtrackFragment?this.backtrackFragment.start:l.end;let p=this.getNextFragment(f,c);if(this.couldBacktrack&&!this.fragPrevious&&p&&p.sn!=="initSegment"&&this.fragmentTracker.getState(p)!==Ze.OK){var m;const y=((m=this.backtrackFragment)!=null?m:p).sn-c.startSN,b=c.fragments[y-1];b&&p.cc===b.cc&&(p=b,this.fragmentTracker.removeFragment(b))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(p&&this.isLoopLoading(p,f)){if(!p.gap){const y=this.audioOnly&&!this.altAudio?Re.AUDIO:Re.VIDEO,b=(y===Re.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;b&&this.afterBufferFlushed(b,y,le.MAIN)}p=this.getNextFragmentLoopLoading(p,c,l,le.MAIN,u)}p&&(p.initSegment&&!p.initSegment.data&&!this.bitrateTest&&(p=p.initSegment),this.loadFragment(p,r,f))}loadFragment(e,t,a){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===Ze.NOT_LOADED||i===Ze.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,a)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,le.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let a;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const o=this.getLevelDetails();if(o!=null&&o.live){const l=this.getMainFwdBufferInfo();if(!l||l.len<o.targetduration*2)return}if(!t.paused&&e){const l=this.hls.nextLoadLevel,d=e[l],c=this.fragLastKbps;c&&this.fragCurrent?a=this.fragCurrent.duration*d.maxBitrate/(1e3*c)+1:a=0}else a=0;const r=this.getBufferedFrag(t.currentTime+a);if(r){const l=this.followingBufferedFrag(r);if(l){this.abortCurrentFrag();const d=l.maxStartPTS?l.maxStartPTS:l.start,c=l.duration,h=Math.max(r.end,d+Math.min(Math.max(c-this.config.maxFragLookUpTolerance,c*(this.couldBacktrack?.5:.125)),c*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(h,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case V.KEY_LOADING:case V.FRAG_LOADING:case V.FRAG_LOADING_WAITING_RETRY:case V.PARSING:case V.PARSED:this.state=V.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const a=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new EP(this.config,a,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;ne(t)&&this.log(`Media seeked to ${t.toFixed(3)}`);const a=this.getMainFwdBufferInfo();if(a===null||a.len===0){this.warn(`Main forward buffer length on "seeked" event ${a?a.len:"empty"})`);return}this.tick()}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(w.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=this.fragLastKbps=0,this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null,this.altAudio=this.audioOnly=this.startFragRequested=!1}onManifestParsed(e,t){let a=!1,i=!1;t.levels.forEach(o=>{const r=o.audioCodec;r&&(a=a||r.indexOf("mp4a.40.2")!==-1,i=i||r.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=a&&i&&!SP(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:a}=this;if(!a||this.state!==V.IDLE)return;const i=a[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(i.details))&&(this.state=V.WAITING_LEVEL)}onLevelLoaded(e,t){var a;const{levels:i}=this,o=t.level,r=t.details,l=r.totalduration;if(!i){this.warn(`Levels were reset while loading level ${o}`);return}this.log(`Level ${o} loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""}, cc [${r.startCC}, ${r.endCC}] duration:${l}`);const d=i[o],c=this.fragCurrent;c&&(this.state===V.FRAG_LOADING||this.state===V.FRAG_LOADING_WAITING_RETRY)&&c.level!==t.level&&c.loader&&this.abortCurrentFrag();let h=0;if(r.live||(a=d.details)!=null&&a.live){var u;if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;h=this.alignPlaylists(r,d.details,(u=this.levelLastLoaded)==null?void 0:u.details)}if(d.details=r,this.levelLastLoaded=d,this.hls.trigger(w.LEVEL_UPDATED,{details:r,level:o}),this.state===V.WAITING_LEVEL){if(this.waitForCdnTuneIn(r))return;this.state=V.IDLE}this.startFragRequested?r.live&&this.synchronizeToLiveEdge(r):this.setStartPosition(r,h),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:a,part:i,payload:o}=e,{levels:r}=this;if(!r){this.warn(`Levels were reset while fragment load was in progress. Fragment ${a.sn} of level ${a.level} will not be buffered`);return}const l=r[a.level],d=l.details;if(!d){this.warn(`Dropping fragment ${a.sn} of level ${a.level} after level details were reset`),this.fragmentTracker.removeFragment(a);return}const c=l.videoCodec,h=d.PTSKnown||!d.live,u=(t=a.initSegment)==null?void 0:t.data,f=this._getAudioCodec(l),p=this.transmuxer=this.transmuxer||new xp(this.hls,le.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),m=i?i.index:-1,g=m!==-1,y=new yl(a.level,a.sn,a.stats.chunkCount,o.byteLength,m,g),b=this.initPTS[a.cc];p.push(o,u,f,c,a,i,d.totalduration,h,y,b)}onAudioTrackSwitching(e,t){const a=this.altAudio;if(!!!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const r=this.fragCurrent;r&&(this.log("Switching to main audio track, cancel main fragment load"),r.abortRequests(),this.fragmentTracker.removeFragment(r)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const o=this.hls;a&&(o.trigger(w.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),o.trigger(w.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const a=t.id,i=!!this.hls.audioTracks[a].url;if(i){const o=this.videoBuffer;o&&this.mediaBuffer!==o&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=o)}this.altAudio=i,this.tick()}onBufferCreated(e,t){const a=t.tracks;let i,o,r=!1;for(const l in a){const d=a[l];if(d.id==="main"){if(o=l,i=d,l==="video"){const c=a[l];c&&(this.videoBuffer=c.buffer)}}else r=!0}r&&i?(this.log(`Alternate track found, use ${o}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:a,part:i}=t;if(a&&a.type!==le.MAIN)return;if(this.fragContextChanged(a)){this.warn(`Fragment ${a.sn}${i?" p: "+i.index:""} of level ${a.level} finished buffering, but was aborted. state: ${this.state}`),this.state===V.PARSED&&(this.state=V.IDLE);return}const o=i?i.stats:a.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),a.sn!=="initSegment"&&(this.fragPrevious=a),this.fragBufferedComplete(a,i)}onError(e,t){var a;if(t.fatal){this.state=V.ERROR;return}switch(t.details){case N.FRAG_GAP:case N.FRAG_PARSING_ERROR:case N.FRAG_DECRYPT_ERROR:case N.FRAG_LOAD_ERROR:case N.FRAG_LOAD_TIMEOUT:case N.KEY_LOAD_ERROR:case N.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(le.MAIN,t);break;case N.LEVEL_LOAD_ERROR:case N.LEVEL_LOAD_TIMEOUT:case N.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===V.WAITING_LEVEL&&((a=t.context)==null?void 0:a.type)===xe.LEVEL&&(this.state=V.IDLE);break;case N.BUFFER_APPEND_ERROR:case N.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===N.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case N.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!De.getBuffered(e).length){const a=this.state!==V.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,a)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=V.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==Re.AUDIO||this.audioOnly&&!this.altAudio){const a=(t===Re.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(a,t,le.MAIN),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let a=this.startPosition;if(a>=0&&t<a){if(e.seeking){this.log(`could not seek to ${a}, already seeking at ${t}`);return}const i=De.getBuffered(e),r=(i.length?i.start(0):0)-a;r>0&&(r<this.config.maxBufferHole||r<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${r} to match buffer start`),a+=r,this.startPosition=a),this.log(`seek to target start position ${a} from current time ${t}`),e.currentTime=a}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(a=>{const{hls:i}=this;if(!a||this.fragContextChanged(e))return;t.fragmentError=0,this.state=V.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const o=e.stats;o.parsing.start=o.parsing.end=o.buffering.start=o.buffering.end=self.performance.now(),i.trigger(w.FRAG_LOADED,a),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const a="main",{hls:i}=this,{remuxResult:o,chunkMeta:r}=e,l=this.getCurrentContext(r);if(!l){this.resetWhenMissingContext(r);return}const{frag:d,part:c,level:h}=l,{video:u,text:f,id3:p,initSegment:m}=o,{details:g}=h,y=this.altAudio?void 0:o.audio;if(this.fragContextChanged(d)){this.fragmentTracker.removeFragment(d);return}if(this.state=V.PARSING,m){if(m!=null&&m.tracks){const _=d.initSegment||d;this._bufferInitSegment(h,m.tracks,_,r),i.trigger(w.FRAG_PARSING_INIT_SEGMENT,{frag:_,id:a,tracks:m.tracks})}const b=m.initPTS,S=m.timescale;ne(b)&&(this.initPTS[d.cc]={baseTime:b,timescale:S},i.trigger(w.INIT_PTS_FOUND,{frag:d,id:a,initPTS:b,timescale:S}))}if(u&&g&&d.sn!=="initSegment"){const b=g.fragments[d.sn-1-g.startSN],S=d.sn===g.startSN,_=!b||d.cc>b.cc;if(o.independent!==!1){const{startPTS:C,endPTS:E,startDTS:v,endDTS:T}=u;if(c)c.elementaryStreams[u.type]={startPTS:C,endPTS:E,startDTS:v,endDTS:T};else if(u.firstKeyFrame&&u.independent&&r.id===1&&!_&&(this.couldBacktrack=!0),u.dropped&&u.independent){const B=this.getMainFwdBufferInfo(),L=(B?B.end:this.getLoadPosition())+this.config.maxBufferHole,R=u.firstKeyFramePTS?u.firstKeyFramePTS:C;if(!S&&L<R-this.config.maxBufferHole&&!_){this.backtrack(d);return}else _&&(d.gap=!0);d.setElementaryStreamInfo(u.type,d.start,E,d.start,T,!0)}else S&&C>gi&&(d.gap=!0);d.setElementaryStreamInfo(u.type,C,E,v,T),this.backtrackFragment&&(this.backtrackFragment=d),this.bufferFragmentData(u,d,c,r,S||_)}else if(S||_)d.gap=!0;else{this.backtrack(d);return}}if(y){const{startPTS:b,endPTS:S,startDTS:_,endDTS:C}=y;c&&(c.elementaryStreams[Re.AUDIO]={startPTS:b,endPTS:S,startDTS:_,endDTS:C}),d.setElementaryStreamInfo(Re.AUDIO,b,S,_,C),this.bufferFragmentData(y,d,c,r)}if(g&&p!=null&&(t=p.samples)!=null&&t.length){const b={id:a,frag:d,details:g,samples:p.samples};i.trigger(w.FRAG_PARSING_METADATA,b)}if(g&&f){const b={id:a,frag:d,details:g,samples:f.samples};i.trigger(w.FRAG_PARSING_USERDATA,b)}}_bufferInitSegment(e,t,a,i){if(this.state!==V.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:o,video:r,audiovideo:l}=t;if(o){let d=e.audioCodec;const c=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){d&&(d.indexOf("mp4a.40.5")!==-1?d="mp4a.40.2":d="mp4a.40.5");const h=o.metadata;h&&"channelCount"in h&&(h.channelCount||1)!==1&&c.indexOf("firefox")===-1&&(d="mp4a.40.5")}d&&d.indexOf("mp4a.40.5")!==-1&&c.indexOf("android")!==-1&&o.container!=="audio/mpeg"&&(d="mp4a.40.2",this.log(`Android: force audio codec to ${d}`)),e.audioCodec&&e.audioCodec!==d&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${d}"`),o.levelCodec=d,o.id="main",this.log(`Init audio buffer, container:${o.container}, codecs[selected/level/parsed]=[${d||""}/${e.audioCodec||""}/${o.codec}]`)}r&&(r.levelCodec=e.videoCodec,r.id="main",this.log(`Init video buffer, container:${r.container}, codecs[level/parsed]=[${e.videoCodec||""}/${r.codec}]`)),l&&this.log(`Init audiovideo buffer, container:${l.container}, codecs[level/parsed]=[${e.codecs}/${l.codec}]`),this.hls.trigger(w.BUFFER_CODECS,t),Object.keys(t).forEach(d=>{const h=t[d].initSegment;h!=null&&h.byteLength&&this.hls.trigger(w.BUFFER_APPENDING,{type:d,data:h,frag:a,part:null,chunkMeta:i,parent:a.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,le.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=V.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const a=e.currentTime;if(De.isBuffered(e,a)?t=this.getAppendedFrag(a):De.isBuffered(e,a+.1)&&(t=this.getAppendedFrag(a+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,o=t.level;(!i||t.sn!==i.sn||i.level!==o)&&(this.fragPlaying=t,this.hls.trigger(w.FRAG_CHANGED,{frag:t}),(!i||i.level!==o)&&this.hls.trigger(w.LEVEL_SWITCHED,{level:o}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,a=this.currentFrag;if(a&&ne(t)&&ne(a.programDateTime)){const i=a.programDateTime+(t-a.start)*1e3;return new Date(i)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class ds{static get version(){return"1.5.16"}static isMSESupported(){return cg()}static isSupported(){return bP()}static getMediaSource(){return Es()}static get Events(){return w}static get ErrorTypes(){return fe}static get ErrorDetails(){return N}static get DefaultConfig(){return ds.defaultConfig?ds.defaultConfig:og}static set DefaultConfig(e){ds.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Al,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,m6(e.debug||!1,"Hls instance");const t=this.config=fP(ds.DefaultConfig,e);this.userConfig=e,t.progressive&&pP(t);const{abrController:a,bufferController:i,capLevelController:o,errorController:r,fpsController:l}=t,d=new r(this),c=this.abrController=new a(this),h=this.bufferController=new i(this),u=this.capLevelController=new o(this),f=new l(this),p=new rB(this),m=new uB(this),g=t.contentSteeringController,y=g?new g(this):null,b=this.levelController=new gP(this,y),S=new UB(this),_=new yP(this.config),C=this.streamController=new CP(this,S,_);u.setStreamController(C),f.setStreamController(C);const E=[p,b,C];y&&E.splice(1,0,y),this.networkControllers=E;const v=[c,h,u,f,m,S];this.audioTrackController=this.createController(t.audioTrackController,E);const T=t.audioStreamController;T&&E.push(new T(this,S,_)),this.subtitleTrackController=this.createController(t.subtitleTrackController,E);const B=t.subtitleStreamController;B&&E.push(new B(this,S,_)),this.createController(t.timelineController,v),_.emeController=this.emeController=this.createController(t.emeController,v),this.cmcdController=this.createController(t.cmcdController,v),this.latencyController=this.createController(mB,v),this.coreComponents=v,E.push(d);const L=d.onErrorOut;typeof L=="function"&&this.on(w.ERROR,L,d)}createController(e,t){if(e){const a=new e(this);return t&&t.push(a),a}return null}on(e,t,a=this){this._emitter.on(e,t,a)}once(e,t,a=this){this._emitter.once(e,t,a)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,a=this,i){this._emitter.off(e,t,a,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,a){return this._emitter.emit(e,t,a)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(a){if(A.error("An internal error happened while handling event "+e+'. Error message: "'+a.message+'". Here is a stacktrace:',a),!this.triggeringException){this.triggeringException=!0;const i=e===w.ERROR;this.trigger(w.ERROR,{type:fe.OTHER_ERROR,details:N.INTERNAL_EXCEPTION,fatal:i,event:e,error:a}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){A.log("destroy"),this.trigger(w.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){A.log("attachMedia"),this._media=e,this.trigger(w.MEDIA_ATTACHING,{media:e})}detachMedia(){A.log("detachMedia"),this.trigger(w.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,a=this.url,i=this.url=Kr.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,A.log(`loadSource:${i}`),t&&a&&(a!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(w.MANIFEST_LOADING,{url:e})}startLoad(e=-1){A.log(`startLoad(${e})`),this.started=!0,this.networkControllers.forEach(t=>{t.startLoad(e)})}stopLoad(){A.log("stopLoad"),this.started=!1,this.networkControllers.forEach(e=>{e.stopLoad()})}resumeBuffering(){this.started&&this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.startLoad(-1)})}pauseBuffering(){this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.stopLoad()})}swapAudioCodec(){A.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){A.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){A.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){A.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){A.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){A.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){A.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(A.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){fB(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const a=e.length;for(let i=0;i<a;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:a}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,a)for(let o=i;o--;){const r=e[o].attrs["HDCP-LEVEL"];if(r&&r<=a)return o}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var t;return(t=this.audioTrackController)==null?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return(t=this.subtitleTrackController)==null||t.setSubtitleOption(e),null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}ds.defaultConfig=void 0;const xP=[(s=>(n.pushScopeId("data-v-d3c9a398"),s=s(),n.popScopeId(),s))(()=>n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[n.createElementVNode("path",{d:"M5 15L15 5",stroke:"white","stroke-width":"1.7","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M15 15L5 5",stroke:"white","stroke-width":"1.7","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],vP={class:"stories__content"},AP={class:"story-container-game"},LP={class:"story-circle"},IP={class:"story-result"},RP={class:"stories__content__stories-bar"},BP={class:"stories__content__video"},NP={class:"stories__content__video__info__date"},DP={class:"stories__content__video__info__data"},PP=qe({__name:"GameStories",props:{stories:{type:Array,default:()=>[]},startStoryIndex:{type:Number,default:0},isFirstGameStories:{type:Boolean,default:!1},isLastGameStories:{type:Boolean,default:!1}},emits:["close","last-story-index","swipe","video-play","video-next-back"],setup(s,{emit:e}){const t=s;n.useCssVars(se=>({"559904cd":y.value,"57a9d8d4":b.value,"57d750a1":v.value}));const a=Ho(),o=[{ids:[607,608],name:"Oportunidad de Gol"},{ids:[12,55],name:"Gol"},{ids:[54,35],name:"Autogol"},{ids:[14,52],name:"Tarjeta Amarilla"},{ids:[15,53],name:"Tarjeta Roja"},{ids:[466,477],name:"Penal Recibido"}].reduce((se,Ee)=>(Ee.ids.forEach(Te=>{se.set(Te,Ee.name)}),se),new Map),r=n.ref(null),l=n.ref(null),d=n.ref([]),c=n.ref(0),h=n.ref(null),u=n.ref(0),f=n.ref(0),p=n.ref(0),m=n.ref(!1),g=n.ref(0),y=n.ref("auto"),b=n.ref("100%"),S=n.ref(null),_=n.ref(0),C=n.ref(null),E=n.ref(null),v=n.computed(()=>Z()?"7vw":"16px"),T=n.computed(()=>d.value[c.value]),B=n.computed(()=>({"--icon-play":`url(${a}/icnplay1.svg)`}));function L(){l.value.muted=!1,l.value.play()}const R=n.computed(()=>!T.value.isHls&&["ios"].includes(Wo()));n.watch(()=>T.value,se=>{se&&K()}),n.watch(()=>t.stories,se=>{if(se.length){c.value=0,p.value=0;const Ee=se.map(Te=>({...Te,progress:0,isHls:Te.url.includes(".m3u8"),date:`${Te.date.getDate()}, ${Qh[Te.date.getMonth()]} ${Te.date.getFullYear()}`,data:`${o.get(Te.categoryId)} ${Mx(Te.player.player_name)}`})).sort((Te,Fe)=>Te.startTime-Fe.startTime);t.startStoryIndex>0&&t.startStoryIndex<Ee.length-1&&(Ee.forEach((Te,Fe)=>{Fe<=t.startStoryIndex&&(Te.progress=100)}),c.value=t.startStoryIndex+1,p.value=c.value),d.value=[...Ee]}},{immediate:!0}),n.watch(()=>r.value,se=>{se&&$()},{flush:"post"}),n.watch(()=>h.value,se=>{se&&(Fx()?(se.addEventListener("touchstart",he),se.addEventListener("touchend",J)):(se.addEventListener("mousedown",he),se.addEventListener("mouseup",J)))},{flush:"post"});function $(){l.value=new Ps("#video-plyr",{controls:[],autoplay:!0,playsinline:!0}),l.value.on("loadeddata",ae(l.value)),l.value.on("timeupdate",oe()),K(T.value),l.value.isDestroyed=!1}function K(){T.value.isHls?z(T.value):l.value&&(l.value.source={type:"video",sources:[{src:T.value.url,type:"video/mp4"}]})}function z(se){if(r.value)if(ds.isSupported()){r.value.src=null;let Ee=new ds;Ee.loadSource(se.url),Ee.attachMedia(r.value)}else l.value.source={type:"video",sources:[{src:se.url,type:"video/mp4"}]}}function ae(){const se=document.querySelector(".plyr__video-wrapper");return se&&(_.value=se.getBoundingClientRect()),()=>{l.value.duration>0&&(l.value.currentTime=T.value.startTime||0,l.value.muted=!1,l.value.play(),e("video-play",T.value))}}function oe(){return Ce(),()=>{T.value.currentTime=l.value.currentTime,T.value.progress=(l.value.currentTime-T.value.startTime)/T.value.duration*100,(l.value.currentTime-T.value.startTime)/T.value.duration*100===0?Z()&&(m.value=!0):Z()&&(m.value=!1),(l.value.currentTime-T.value.startTime)/T.value.duration*100<0?E.value&&!Z()&&(E.value.style="display: none",b.value="100%"):E.value&&!Z()&&(E.value.style="display: block",b.value="auto"),l.value.currentTime>=T.value.endTime&&(l.value.pause(),ie())}}function ie(se=1){const Ee=c.value+se;Ee<0?t.isFirstGameStories?l.value&&(l.value.currentTime=T.value.startTime):de("right",T.value):Ee===d.value.length?t.isLastGameStories?q():de("left",T.value):(c.value=Ee,se===1&&(p.value=c.value))}function ce(){u.value>f.value?de("left",T.value):u.value<f.value?de("right",T.value):Q()}function de(se,Ee){e("last-story-index",p.value),e("swipe",{direction:se,currentPlay:Ee})}function Q(){const se=window.innerWidth/2,Ee=u.value<se,Te=T.value.progress;T.value.progress=Ee?0:100,l.value.pause(),e("video-next-back",{eventName:Ee?"stories_video_anterior":"stories_video_siguiente",currentPlay:{...T.value,progress:Te}}),ie(Ee?-1:1)}function q(){l.value.pause(),l.value.muted=!0,e("last-story-index",p.value),e("close",T.value)}function he(se){u.value=se.changedTouches?se.changedTouches[0].clientX:se.clientX}function J(se){f.value=se.changedTouches?se.changedTouches[0].clientX:se.clientX,ce()}function Z(){return/iPhone|iPad/i.test(navigator.userAgent)}function ue(){window.scrollTo(0,100)}function ge(){if(window.scrollTo(0,100),Wo()=="android"){const se=document.querySelector("#stories");se.requestFullscreen(se)}}function Ce(){if(window.ResizeObserver)S.value=new window.ResizeObserver(()=>{C.value&&_.value.height>0&&(C.value.getBoundingClientRect().height>610?y.value="auto":y.value="100dvh",C.value.getBoundingClientRect().height>610?b.value="100%":b.value="auto")}),S.value.observe(C.value);else throw new Error("Resize observer not supported!")}return n.onMounted(()=>{g.value=document.documentElement.scrollTop||document.body.scrollTop,window.scrollTo(0,100),Z()?(window.addEventListener("resize",ue),ue()):(window.addEventListener("orientationchange",ge),ge()),setTimeout(()=>{Ce()},500)}),n.onBeforeUnmount(()=>{window.scrollTo(0,g.value),Z()?window.removeEventListener("resize",ue):(Wo()=="android"&&document.exitFullscreen(),window.removeEventListener("orientationchange",ge)),S.value&&(S.value.disconnect(),S.value=null)}),(se,Ee)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["stories",Z()?"stories-safe-areas-iphone":""]),id:"stories",ref_key:"eStories",ref:C,style:n.normalizeStyle(B.value)},[n.createElementVNode("div",{class:n.normalizeClass(["stories__close",Z()?"stories-safe-areas-iphone":""]),onClick:q},xP,2),n.createElementVNode("div",vP,[n.createElementVNode("div",AP,[n.createElementVNode("div",LP,[n.createElementVNode("div",{class:"circle-item-home",style:n.normalizeStyle(`background-image: url(${T.value.thumbnail.logoHomeTeam})`)},null,4),n.createElementVNode("div",{class:"circle-item-away",style:n.normalizeStyle(`background-image: url(${T.value.thumbnail.logoAwayTeam})`)},null,4)]),n.createElementVNode("div",IP,n.toDisplayString(T.value.header.label),1)]),n.createElementVNode("div",{ref_key:"overlay",ref:h,class:"stories__content__overlay"},null,512),n.createElementVNode("div",RP,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,(Te,Fe)=>(n.openBlock(),n.createElementBlock("div",{key:Fe,class:"stories__content__stories-bar__item"},[n.createElementVNode("div",{class:"stories__content__stories-bar__item__progress",style:n.normalizeStyle({width:`${Te.progress}%`})},null,4)]))),128))]),n.createElementVNode("div",BP,[n.createElementVNode("div",{class:"stories__content__video__info",ref_key:"videoInfo",ref:E},[n.createElementVNode("div",NP,n.toDisplayString(T.value.date),1),n.createElementVNode("div",DP,n.toDisplayString(T.value.data),1)],512),n.createElementVNode("video",{ref_key:"player",ref:r,id:"video-plyr",controls:"",preload:"auto","data-setup":"{}",playsinline:""},null,512)])]),R.value?(n.openBlock(),n.createElementBlock("button",{key:0,id:"btn_play_ios",style:n.normalizeStyle(m.value?"display:block":"display:none"),onClick:L},null,4)):n.createCommentVNode("",!0)],6))}},[["__scopeId","data-v-d3c9a398"]]),OP={playlist_id:"GPI_default2022-12-08T02:51:56.334+00:00-PI-0",last_played_index:0,group_id:"1",total_plays:55,playlist_type:"1",group_playlist_id:"GPI_default2022-12-08T02:51:56.334+00:00",user_id:"goltesting",created_at:"2023-03-30T15:42:36.402+00:00",playlist:[[136731235,"Liga MX","Apertura 2022",69929,"Aldrete Rodriguez, Adrian","Quintero Huitron, Daniel","Estadio Olímpico Universitario, Ciudad de México.","1 - 0","1 - 0","2022-07-17T05:00:00.000Z","Universidad Nacional","https://az755631.vo.msecnd.net/teams-80/11.png","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png",12,"Goals",1259,1278,20,1266,"https://golstatsbets.blob.core.windows.net/video-player/69929_1.mp4"],[139820484,"Liga MX","Apertura 2022",70042,"Davila Zavala, Victor","Mejia, Oscar ","Estadio Nuevo Monumental, Rafaela.","3 - 1","1 - 0","2022-09-18T05:00:00.000Z","Leon","https://az755631.vo.msecnd.net/teams-80/173.png","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png",12,"Goals",1501,1524,24,1512,"https://golstatsbets.blob.core.windows.net/video-player/70042_1.mp4"],[139566427,"Liga MX","Apertura 2022",69989,"Zaldivar Caviedes, Angel","Guerrero Ramirez, Fernando","Estadio Akron, Zapopan.","1 - 4","1 - 0","2022-09-13T05:00:00.000Z","Guadalajara","https://az755631.vo.msecnd.net/teams-80/1.png","Tigres de la UANL","https://az755631.vo.msecnd.net/teams-80/16.png",12,"Goals",6569,6588,108,6576,"https://golstatsbets.blob.core.windows.net/video-player/69989_1.mp4"],[139441913,"Liga MX","Apertura 2022",70031,"Vega Rojas, Alexis","Quintero Huitron, Daniel","Estadio Akron, Zapopan.","1 - 0","1 - 0","2022-09-10T05:00:00.000Z","Guadalajara","https://az755631.vo.msecnd.net/teams-80/1.png","Puebla FC","https://az755631.vo.msecnd.net/teams-80/10.png",12,"Goals",6207,6237,103,6225,"https://golstatsbets.blob.core.windows.net/video-player/70031_1.mp4"],[139566063,"Liga MX","Apertura 2022",69989,"Guzman Palomeque, Nahuel","Guerrero Ramirez, Fernando","Estadio Akron, Zapopan.","1 - 4","0 - 0","2022-09-13T05:00:00.000Z","Guadalajara","https://az755631.vo.msecnd.net/teams-80/1.png","Tigres de la UANL","https://az755631.vo.msecnd.net/teams-80/16.png",39,"Saves",2554,2573,41,2561,"https://golstatsbets.blob.core.windows.net/video-player/69989_1.mp4"],[138276096,"Liga MX","Apertura 2022",69983,"Cortizo de la Piedra, Jordi","Guerrero Ramirez, Fernando","Estadio Cuauhtemoc, Puebla.","2 - 2","1 - 0","2022-08-16T05:00:00.000Z","Puebla FC","https://az755631.vo.msecnd.net/teams-80/10.png","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png",12,"Goals",5020,5046,83,5034,"https://golstatsbets.blob.core.windows.net/video-player/69983_1.mp4"],[139285589,"Liga MX","Apertura 2022",70021,"Cortizo de la Piedra, Jordi","Escobedo, Adonai","Estadio Cuauhtemoc, Puebla.","2 - 2","1 - 0","2022-09-07T05:00:00.000Z","Puebla FC","https://az755631.vo.msecnd.net/teams-80/10.png","Pachuca","https://az755631.vo.msecnd.net/teams-80/9.png",12,"Goals",1123,1152,18,1140,"https://golstatsbets.blob.core.windows.net/video-player/70021_1.mp4"],[139294964,"Liga MX","Apertura 2022",70022,"Cordova Reyes, Francisco","Ortiz Nava, Marco Antonio","Estadio Universitario, San Nicolás de los Garza.","3 - 1","1 - 0","2022-09-07T05:00:00.000Z","Tigres de la UANL","https://az755631.vo.msecnd.net/teams-80/16.png","Toluca","https://az755631.vo.msecnd.net/teams-80/18.png",12,"Goals",2564,2583,41,2571,"https://golstatsbets.blob.core.windows.net/video-player/70022_1.mp4"],[137782451,"Liga MX","Apertura 2022",69968,"Orrantia Trevino, Carlos","Macias Romo, Oscar","Estadio TSM Corona, Torreón.","4 - 0","1 - 0","2022-08-06T05:00:00.000Z","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png",12,"Goals",4662,4693,77,4681,"https://golstatsbets.blob.core.windows.net/video-player/69968_1.mp4"],[136551560,"Liga MX","Apertura 2022",69924,"Sanchez Guerrero, Richard","Escobedo, Adonai","Estadio Azteca, Ciudad de México.","1 - 0","1 - 0","2022-07-13T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","Toluca","https://az755631.vo.msecnd.net/teams-80/18.png",12,"Goals",7032,7064,116,7052,"https://golstatsbets.blob.core.windows.net/video-player/69924_1.mp4"],[136391881,"Liga MX","Apertura 2022",69914,"Hurtado Herrera, Aviles","Ramos Palazuelos, Cesar","Estadio Hidalgo, Pachuca.","2 - 0","1 - 0","2022-07-04T05:00:00.000Z","Pachuca","https://az755631.vo.msecnd.net/teams-80/9.png","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png",12,"Goals",4903,4937,81,4925,"https://golstatsbets.blob.core.windows.net/video-player/69914_1.mp4"],[138158049,"Liga MX","Apertura 2022",69979,"Volpi, Tiago Luis","Hernandez Gomez, Fernando","Estadio Azteca, Ciudad de México.","2 - 3","0 - 1","2022-08-14T05:00:00.000Z","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png","Toluca","https://az755631.vo.msecnd.net/teams-80/18.png",39,"Saves",7207,7226,119,7214,"https://golstatsbets.blob.core.windows.net/video-player/69979_1.mp4"],[138124884,"Liga MX","Apertura 2022",69978,"Vargas Gil, Camilo","Ortiz Nava, Marco Antonio","Default","1 - 1","0 - 0","2022-08-13T05:00:00.000Z","Guadalajara","https://az755631.vo.msecnd.net/teams-80/1.png","Atlas","https://az755631.vo.msecnd.net/teams-80/4.png",39,"Saves",6080,6099,100,6087,"https://golstatsbets.blob.core.windows.net/video-player/69978_1.mp4"],[139635463,"Liga MX","Apertura 2022",69950,"Fidalgo Fernandez, Alvaro","Hernandez Gomez, Fernando","Estadio Azteca, Ciudad de México.","3 - 3","0 - 2","2022-09-14T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png",10,"Assists",7096,7123,118,7111,"https://golstatsbets.blob.core.windows.net/video-player/69950_1.mp4"],[139769221,"Liga MX","Apertura 2022",70039,"Ochoa Magana, Guillermo","Escobedo, Adonai","Estadio Azteca, Ciudad de México.","2 - 1","0 - 0","2022-09-17T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","Guadalajara","https://az755631.vo.msecnd.net/teams-80/1.png",39,"Saves",4567,4586,76,4574,"https://golstatsbets.blob.core.windows.net/video-player/70039_1.mp4"],[139405626,"Liga MX","Apertura 2022",70028,"Acevedo Lopez, Carlos","Santander, Luis Enrique","Estadio La Corregidora, Querétaro.","3 - 3","0 - 2","2022-09-10T05:00:00.000Z","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png",55,"Goals",7452,7471,124,7459,"https://golstatsbets.blob.core.windows.net/video-player/70028_1.mp4"],[139410464,"Liga MX","Apertura 2022",70030,"Gonzalez Vela Alvizu, Julio","Hernandez Gomez, Fernando","Estadio Nemesio Diez, Toluca.","2 - 2","0 - 1","2022-09-10T05:00:00.000Z","Toluca","https://az755631.vo.msecnd.net/teams-80/18.png","Universidad Nacional","https://az755631.vo.msecnd.net/teams-80/11.png",55,"Goals",7467,7486,124,7474,"https://golstatsbets.blob.core.windows.net/video-player/70030_1.mp4"],[139902797,"Liga MX","Apertura 2022",70038,"Quinones Quinones, Julian","Ortiz Nava, Marco Antonio","Estadio BBVA Bancomer, Guadalupe","2 - 0","0 - 0","2022-09-17T05:00:00.000Z","Rayados de Monterrey","https://az755631.vo.msecnd.net/teams-80/7.png","Atlas","https://az755631.vo.msecnd.net/teams-80/4.png",702,"Con enfrentamiento",2334,2353,38,2341,"https://golstatsbets.blob.core.windows.net/video-player/70038_1.mp4"],[139771860,"Liga MX","Apertura 2022",70038,"Andrada, Esteban ","Ortiz Nava, Marco Antonio","Estadio BBVA Bancomer, Guadalupe","2 - 0","0 - 0","2022-09-17T05:00:00.000Z","Rayados de Monterrey","https://az755631.vo.msecnd.net/teams-80/7.png","Atlas","https://az755631.vo.msecnd.net/teams-80/4.png",39,"Saves",6859,6878,113,6866,"https://golstatsbets.blob.core.windows.net/video-player/70038_1.mp4"],[136392028,"Liga MX","Apertura 2022",69914,"Hurtado Herrera, Aviles","Ramos Palazuelos, Cesar","Estadio Hidalgo, Pachuca.","2 - 0","0 - 0","2022-07-04T05:00:00.000Z","Pachuca","https://az755631.vo.msecnd.net/teams-80/9.png","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png",607,"Oportunidad de gol",335,374,5,342,"https://golstatsbets.blob.core.windows.net/video-player/69914_1.mp4"],[136467302,"Liga MX","Apertura 2022",69909,"Jurado Roca, Sebastian","Mejia, Oscar ","Estadio Universitario, San Nicolás de los Garza.","2 - 3","0 - 0","2022-07-02T05:00:00.000Z","Tigres de la UANL","https://az755631.vo.msecnd.net/teams-80/16.png","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png",39,"Saves",879,898,14,886,"https://golstatsbets.blob.core.windows.net/video-player/69909_1.mp4"],[138402354,"Liga MX","Apertura 2022",69990,"Beltran Cruz, Fernando","Mejia, Oscar ","Estadio Victoria, Aguascalientes.","0 - 4","0 - 1","2022-08-19T05:00:00.000Z","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png","Guadalajara","https://az755631.vo.msecnd.net/teams-80/1.png",12,"Goals",4517,4551,75,4539,"https://golstatsbets.blob.core.windows.net/video-player/69990_1.mp4"],[138157481,"Liga MX","Apertura 2022",69979,"Meneses Villarroel, Jean","Hernandez Gomez, Fernando","Estadio Azteca, Ciudad de México.","2 - 3","0 - 1","2022-08-14T05:00:00.000Z","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png","Toluca","https://az755631.vo.msecnd.net/teams-80/18.png",12,"Goals",1900,1925,31,1913,"https://golstatsbets.blob.core.windows.net/video-player/69979_1.mp4"],[140106188,"Liga MX","Apertura 2022",69964,"Cortizo de la Piedra, Jordi","Escobedo, Adonai","Estadio Cuauhtemoc, Puebla.","2 - 1","1 - 0","2022-09-23T05:00:00.000Z","Puebla FC","https://az755631.vo.msecnd.net/teams-80/10.png","Universidad Nacional","https://az755631.vo.msecnd.net/teams-80/11.png",12,"Goals",461,484,7,472,"https://golstatsbets.blob.core.windows.net/video-player/69964_1.mp4"],[139839994,"Liga MX","Apertura 2022",70043,"Garcia Carpizo, Brian","Montano Robles, Diego","Estadio Caliente, Tijuana.","1 - 1","0 - 1","2022-09-18T05:00:00.000Z","Club Tijuana","https://az755631.vo.msecnd.net/teams-80/17.png","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png",12,"Goals",2112,2133,34,2121,"https://golstatsbets.blob.core.windows.net/video-player/70043_1.mp4"],[139403868,"Liga MX","Apertura 2022",70028,"Suarez, Leonardo Gabriel","Santander, Luis Enrique","Estadio La Corregidora, Querétaro.","3 - 3","0 - 1","2022-09-10T05:00:00.000Z","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png",12,"Goals",4296,4315,71,4303,"https://golstatsbets.blob.core.windows.net/video-player/70028_1.mp4"],[139371616,"Liga MX","Apertura 2022",70027,"Gallardo Vasconcelos, Jesus","Montano Robles, Diego","Estadio Olimpico Benito Juarez, Ciudad Juarez.","0 - 1","0 - 1","2022-09-09T05:00:00.000Z","FC Juarez","https://az755631.vo.msecnd.net/teams-80/3014.png","Rayados de Monterrey","https://az755631.vo.msecnd.net/teams-80/7.png",12,"Goals",5724,5750,94,5738,"https://golstatsbets.blob.core.windows.net/video-player/70027_1.mp4"],[139294028,"Liga MX","Apertura 2022",70022,"Thauvin, Florian","Ortiz Nava, Marco Antonio","Estadio Universitario, San Nicolás de los Garza.","3 - 1","2 - 0","2022-09-07T05:00:00.000Z","Tigres de la UANL","https://az755631.vo.msecnd.net/teams-80/16.png","Toluca","https://az755631.vo.msecnd.net/teams-80/18.png",12,"Goals",6011,6030,99,6018,"https://golstatsbets.blob.core.windows.net/video-player/70022_1.mp4"],[137023432,"Liga MX","Apertura 2022",69939,"Gignac, Andre Pierre","Ortiz Nava, Marco Antonio","Estadio Universitario, San Nicolás de los Garza.","2 - 0","1 - 0","2022-07-23T05:00:00.000Z","Tigres de la UANL","https://az755631.vo.msecnd.net/teams-80/16.png","Atlas","https://az755631.vo.msecnd.net/teams-80/4.png",12,"Goals",2829,2854,47,2842,"https://golstatsbets.blob.core.windows.net/video-player/69939_1.mp4"],[139303531,"Liga MX","Apertura 2022",70023,"Alves da Silva, Daniel","Ramos Palazuelos, Cesar","Estadio Olímpico Universitario, Ciudad de México.","4 - 1","0 - 0","2022-09-07T05:00:00.000Z","Universidad Nacional","https://az755631.vo.msecnd.net/teams-80/11.png","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png",702,"Con enfrentamiento",262,293,3,278,"https://golstatsbets.blob.core.windows.net/video-player/70023_1.mp4"],[139303334,"Liga MX","Apertura 2022",70023,"Alves da Silva, Daniel","Ramos Palazuelos, Cesar","Estadio Olímpico Universitario, Ciudad de México.","4 - 1","0 - 0","2022-09-07T05:00:00.000Z","Universidad Nacional","https://az755631.vo.msecnd.net/teams-80/11.png","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png",10,"Assists",5256,5283,87,5271,"https://golstatsbets.blob.core.windows.net/video-player/70023_1.mp4"],[139633795,"Liga MX","Apertura 2022",69950,"Valdes Contreras, Diego","Hernandez Gomez, Fernando","Estadio Azteca, Ciudad de México.","3 - 3","0 - 1","2022-09-14T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png",607,"Oportunidad de gol",675,701,10,689,"https://golstatsbets.blob.core.windows.net/video-player/69950_1.mp4"],[139242728,"Liga MX","Apertura 2022",70020,"Valdes Contreras, Diego","Caceres Hernandez, Victor Alfonso","Estadio Azteca, Ciudad de México.","3 - 0","0 - 0","2022-09-06T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","CA San Luis","https://az755631.vo.msecnd.net/teams-80/13.png",10,"Assists",2841,2861,46,2849,"https://golstatsbets.blob.core.windows.net/video-player/70020_1.mp4"],[138747150,"Liga MX","Apertura 2022",7e4,"Valdes Contreras, Diego","Miranda Galindo, Erick Yair","Default","1 - 3","0 - 1","2022-08-26T05:00:00.000Z","Mazatlan FC","https://az755631.vo.msecnd.net/teams-80/8.png","America","https://az755631.vo.msecnd.net/teams-80/2.png",12,"Goals",2425,2448,39,2436,"https://golstatsbets.blob.core.windows.net/video-player/70000_1.mp4"],[138462163,"Liga MX","Apertura 2022",69995,"Valdes Contreras, Diego","Santander, Luis Enrique","Estadio Azteca, Ciudad de México.","7 - 0","1 - 0","2022-08-20T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png",12,"Goals",3424,3443,56,3431,"https://golstatsbets.blob.core.windows.net/video-player/69995_1.mp4"],[138832474,"Liga MX","Apertura 2022",70005,"Sambueza, Rubens Oscar","Guerrero Ramirez, Fernando","Estadio TSM Corona, Torreón.","4 - 1","1 - 1","2022-08-28T05:00:00.000Z","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png","CA San Luis","https://az755631.vo.msecnd.net/teams-80/13.png",12,"Goals",6830,6859,113,6847,"https://golstatsbets.blob.core.windows.net/video-player/70005_1.mp4"],[137178428,"Liga MX","Apertura 2022",69942,"Ibarra Mina, Alex Renato","Montano Robles, Diego","Estadio Jalisco, Guadalajara.","1 - 2","0 - 1","2022-07-26T05:00:00.000Z","Atlas","https://az755631.vo.msecnd.net/teams-80/4.png","Club Tijuana","https://az755631.vo.msecnd.net/teams-80/17.png",12,"Goals",2786,2811,45,2799,"https://golstatsbets.blob.core.windows.net/video-player/69942_1.mp4"],[138339473,"Liga MX","Apertura 2022",69985,"Canelo, Pedro Alexis","Referee 1","Azteca","1 - 2","0 - 0","2022-08-17T05:00:00.000Z","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png","Club Tijuana","https://az755631.vo.msecnd.net/teams-80/17.png",10,"Assists",5133,5159,85,5147,"https://golstatsbets.blob.core.windows.net/video-player/69985_1.mp4"],[136701989,"Liga MX","Apertura 2022",69927,"Gimenez, Santiago Tomas","Macias Romo, Oscar","Estadio Jalisco, Guadalajara.","3 - 2","0 - 1","2022-07-16T05:00:00.000Z","Atlas","https://az755631.vo.msecnd.net/teams-80/4.png","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png",12,"Goals",1374,1397,22,1385,"https://golstatsbets.blob.core.windows.net/video-player/69927_1.mp4"],[139678329,"Liga MX","Apertura 2022",70049,"Antuna Romero, Carlos","Ortiz Nava, Marco Antonio","Estadio Azteca, Ciudad de México.","2 - 1","0 - 0","2022-09-15T05:00:00.000Z","Cruz Azul","https://az755631.vo.msecnd.net/teams-80/5.png","Leon","https://az755631.vo.msecnd.net/teams-80/173.png",10,"Assists",6728,6752,111,6740,"https://golstatsbets.blob.core.windows.net/video-player/70049_1.mp4"],[139054131,"Liga MX","Apertura 2022",70010,"Davila Zavala, Victor","Ortiz Nava, Marco Antonio","Estadio Victoria, Aguascalientes.","3 - 2","1 - 1","2022-09-02T05:00:00.000Z","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png","Leon","https://az755631.vo.msecnd.net/teams-80/173.png",12,"Goals",6636,6661,110,6649,"https://golstatsbets.blob.core.windows.net/video-player/70010_1.mp4"],[137503273,"Liga MX","Apertura 2022",69962,"Davila Zavala, Victor","Macias Romo, Oscar","Estadio Nou Camp, Le&ocuate;n.","3 - 2","1 - 0","2022-07-31T05:00:00.000Z","Leon","https://az755631.vo.msecnd.net/teams-80/173.png","America","https://az755631.vo.msecnd.net/teams-80/2.png",12,"Goals",1940,1965,31,1953,"https://golstatsbets.blob.core.windows.net/video-player/69962_1.mp4"],[139308851,"Liga MX","Apertura 2022",70025,"Benedetti Roa, Nicolas","Hernandez Gomez, Fernando","Default","1 - 0","1 - 0","2022-09-07T05:00:00.000Z","Mazatlan FC","https://az755631.vo.msecnd.net/teams-80/8.png","Atlas","https://az755631.vo.msecnd.net/teams-80/4.png",12,"Goals",1867,1891,31,1879,"https://golstatsbets.blob.core.windows.net/video-player/70025_1.mp4"],[138116335,"Liga MX","Apertura 2022",69976,"Benedetti Roa, Nicolas","Galvan Basulto, Eduardo","Estadio Nou Camp, Le&ocuate;n.","0 - 3","0 - 1","2022-08-13T05:00:00.000Z","Leon","https://az755631.vo.msecnd.net/teams-80/173.png","Mazatlan FC","https://az755631.vo.msecnd.net/teams-80/8.png",12,"Goals",591,629,9,617,"https://golstatsbets.blob.core.windows.net/video-player/69976_1.mp4"],[136791022,"Liga MX","Apertura 2022",69932,"Benedetti Roa, Nicolas","Camacho Peregrina, Jorge","Estadio Hidalgo, Pachuca.","1 - 1","0 - 1","2022-07-18T05:00:00.000Z","Pachuca","https://az755631.vo.msecnd.net/teams-80/9.png","Mazatlan FC","https://az755631.vo.msecnd.net/teams-80/8.png",12,"Goals",4284,4315,71,4303,"https://golstatsbets.blob.core.windows.net/video-player/69932_1.mp4"],[139414938,"Liga MX","Apertura 2022",70026,"Batista Ochoa, Facundo","Guerrero Ramirez, Fernando","Estadio Victoria, Aguascalientes.","1 - 2","1 - 0","2022-09-10T05:00:00.000Z","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png","America","https://az755631.vo.msecnd.net/teams-80/2.png",12,"Goals",461,490,7,478,"https://golstatsbets.blob.core.windows.net/video-player/70026_1.mp4"],[139051051,"Liga MX","Apertura 2022",70010,"Batista Ochoa, Facundo","Ortiz Nava, Marco Antonio","Estadio Victoria, Aguascalientes.","3 - 2","1 - 0","2022-09-02T05:00:00.000Z","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png","Leon","https://az755631.vo.msecnd.net/teams-80/173.png",12,"Goals",2731,2750,45,2738,"https://golstatsbets.blob.core.windows.net/video-player/70010_1.mp4"],[137828273,"Liga MX","Apertura 2022",69970,"Batista Ochoa, Facundo","Galvan Basulto, Eduardo","Estadio Alfonso Lastras Ramírez, San Luis Potosí.","1 - 2","0 - 1","2022-08-07T05:00:00.000Z","CA San Luis","https://az755631.vo.msecnd.net/teams-80/13.png","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png",12,"Goals",849,870,13,858,"https://golstatsbets.blob.core.windows.net/video-player/69970_1.mp4"],[139025773,"Liga MX","Apertura 2022",70009,"Nahuelpan Osten, Ariel","Lopez Penuelas, Ismael","Estadio La Corregidora, Querétaro.","1 - 1","1 - 0","2022-09-01T05:00:00.000Z","Queretaro","https://az755631.vo.msecnd.net/teams-80/12.png","Puebla FC","https://az755631.vo.msecnd.net/teams-80/10.png",12,"Goals",1454,1481,24,1472,"https://golstatsbets.blob.core.windows.net/video-player/70009_1.mp4"],[138063913,"Liga MX","Apertura 2022",69973,"Gonzalez Gonzalez, Arturo","Pacheco Larios, Guillermo","Estadio Victoria, Aguascalientes.","1 - 2","0 - 1","2022-08-12T05:00:00.000Z","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png","Rayados de Monterrey","https://az755631.vo.msecnd.net/teams-80/7.png",12,"Goals",6119,6138,101,6126,"https://golstatsbets.blob.core.windows.net/video-player/69973_1.mp4"],[137780455,"Liga MX","Apertura 2022",69966,"Gonzalez Gonzalez, Arturo","Ortiz Nava, Marco Antonio","Estadio BBVA Bancomer, Guadalupe","5 - 1","1 - 0","2022-08-06T05:00:00.000Z","Rayados de Monterrey","https://az755631.vo.msecnd.net/teams-80/7.png","Leon","https://az755631.vo.msecnd.net/teams-80/173.png",12,"Goals",2292,2321,38,2309,"https://golstatsbets.blob.core.windows.net/video-player/69966_1.mp4"],[140090831,"Liga MX","Apertura 2022",69950,"Suarez, Leonardo Gabriel","Hernandez Gomez, Fernando","Estadio Azteca, Ciudad de México.","3 - 3","0 - 1","2022-09-14T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png",12,"Goals",585,612,9,600,"https://golstatsbets.blob.core.windows.net/video-player/69950_1.mp4"],[140090832,"Liga MX","Apertura 2022",69950,"Suarez, Leonardo Gabriel","Hernandez Gomez, Fernando","Estadio Azteca, Ciudad de México.","3 - 3","0 - 2","2022-09-14T05:00:00.000Z","America","https://az755631.vo.msecnd.net/teams-80/2.png","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png",12,"Goals",1175,1197,18,1182,"https://golstatsbets.blob.core.windows.net/video-player/69950_1.mp4"],[139227464,"Liga MX","Apertura 2022",70018,"Suarez, Leonardo Gabriel","Quintero Huitron, Daniel","Estadio TSM Corona, Torreón.","3 - 1","1 - 0","2022-09-06T05:00:00.000Z","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png","Necaxa","https://az755631.vo.msecnd.net/teams-80/205.png",12,"Goals",7011,7034,116,7022,"https://golstatsbets.blob.core.windows.net/video-player/70018_1.mp4"],[138830649,"Liga MX","Apertura 2022",70005,"Suarez, Leonardo Gabriel","Guerrero Ramirez, Fernando","Estadio TSM Corona, Torreón.","4 - 1","1 - 0","2022-08-28T05:00:00.000Z","Santos Laguna","https://az755631.vo.msecnd.net/teams-80/14.png","CA San Luis","https://az755631.vo.msecnd.net/teams-80/13.png",12,"Goals",4297,4380,71,4304,"https://golstatsbets.blob.core.windows.net/video-player/70005_1.mp4"]]},FP=new Map([[1,45],[2,90],[3,105],[4,120]]),MP=[{id:12,name:"Gol"},{id:55,name:"Gol"},{id:39,name:"Atajada"},{id:10,name:"Asistencia"},{id:702,name:"1vs1 exitoso ofensivo"},{id:607,name:"Oportunidad de gol"}].reduce((s,e)=>(s.set(e.id,e.name),s),new Map);let xa=null,yi=null,bi="";const Ft=n6(),$P={components:{GSCSeasonSelect:iI,GSCTournamentSelect:OL,GSCGames:yv,GSCSlider:ea,GSCGridTeamsMatches:uy,GSCPlayersLanding:ly,GSCTops:gA,GSCTableCalendar:AC,DiscoverVideos:s6,CarouselFullScreen:lL,Stories:PP},setup(){const s=n.ref("landingref"),{elementSize:e}=H0(s);return{landingref:s,elementSize:e}},props:{currentSeasonId:{type:Number,default:0},isFemale:{type:Boolean,default:!1},showStories:{type:Boolean,default:!0},season:{type:Number,default:1772},isplayer:{type:Boolean,default:!1},user:{type:Object,default:()=>{}},privileges:{type:Object,default:()=>{}},team:{type:Number,default:0},player:{type:Number,default:0},gamesPerMatchDay:{type:Number,default:0,validator(s){return!Number.isNaN(s)&&s>=0}},token:{type:String,default:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"},tournamentsApiUrl:{type:String,default:""},defaultMediaPlayerSeason:{type:Number,default:0},checkLiveGamesIntervalMinutes:{type:Number,default:2}},data(){return{isPreviousDataLoaded:!1,imagesUrl:Ho(),roundAbbreviationByGameId:new Map,isCarouselFullScreenVisible:!1,isPlaySeeker:!1,keyupdate:0,carouselPlayerQueue:[],gameEventsUrl:"https://al2nv2dmkc.execute-api.us-west-2.amazonaws.com/prod/mxm/",defaultGameId:0,lastSeasonsIds:[],arrayGamesAdd:[],gamesPages:new Map,show_stories:!0,selectedRoundKeyIndex:0,currentStoriesLastIndex:0,selectedRoundKeyIndexVideo:0,selectedRound:"0",selectedRoundVideos:"0",isLeagueSelected:!1,fullTournamentScheduleFull:[],fullTournamentScheduleFullGoals:[],defaultMatchDayKey:null,isCupTournament:!1,retries:3,userTeamGames:[],userTeamGamesForVideos:[],isCupLegacyTournament:!1,tournamentScheduleKeys:[],tournamentScheduleKeysGoals:[],currentTournamentGames:null,currentTournamentTeams:null,gamesUrl:"https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason/",gamesUrl2:"https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?",seasonSelected:{},seasonSelectedDropDowns:{},seasonsSelected:[],gamesAllStories:[],fullTournamentSchedule:{},tournamentSelected:{id:0},tournamentType:0,tournamentSelectedDropDowns:{seasons:[]},playersLength:0,nextRivalId:0,updateTableCalendar:0,loadDiscover:!1,hasNextRival:!1,resumeType:1,goalsType:2,is_public:!1,seasonsGamesMap:new Map,gamesOfTheDayPreMatchIds:new Set,seasonsForLiveGames:[],allLiveGames:[],storiesItems:[],currentStories:[],currentStoryIndex:null,isStoriesVisible:!1,seasonPlayersMap:new Map,currentTournaments:[]}},computed:{teamSelected(){return this.user.is_generic||this.tournamentSelected.id!==this.user.tournament?0:this.user.team},isGenericLike(){return this.user.is_generic||this.tournamentSelected.id!==this.user.tournament},isPlaySeekerAvailable(){return[34230,34178,34201].includes(this.user.id)},games(){if(!this.isGenericLike&&!this.isLeagueSelected)return this.fullTournamentSchedule;{const s=this.gamesPages.get(this.selectedRound);return s&&s[0]?s[0].sort((e,t)=>{let a=e.dateTimeMillis,i=t.dateTimeMillis;return e.is_live&&(a-=1e9),t.is_live&&(i-=1e9),a-i}):[]}},latestRound(){return this.userTeamGames&&this.userTeamGames.length&&this.fullTournamentScheduleFullGoals&&this.fullTournamentScheduleFullGoals.length?this.getUserTeamClosestRound(this.fullTournamentScheduleFullGoals):this.getNormalClosestRound(this.fullTournamentScheduleFullGoals)},closestRound(){return this.userTeamGames&&this.userTeamGames.length?this.getUserTeamClosestRound(this.fullTournamentScheduleFull):this.getNormalClosestRound(this.fullTournamentScheduleFull)},closestRoundVideos(){return this.userTeamGames&&this.userTeamGames.length?this.getUserTeamClosestRound(this.fullTournamentScheduleFullGoals,!0):this.getNormalClosestRound(this.fullTournamentScheduleFullGoals,!0)},containerGridCalendarTable(){return this.elementSize.width<=1e3?"container-grid-calendar-table-mobile":"container-grid-calendar-table"},containerbackground(){return this.elementSize.width<=680?"container-background-movil":"container-background"},containerdata(){return this.elementSize.width<=680?"container-data-movil":"container-data"}},watch:{games:{immediate:!0,deep:!0,async handler(s){if(s&&s.length>0){if(!this.seasonsSelected.length)return;for(let t=0;t<s.length;t++){const a=this.gamesAllStories.findIndex(i=>i.game_id===s[t].game_id);a!==-1&&(this.gamesAllStories[a].is_live=s[t].is_live,this.gamesAllStories[a].game_status=s[t].game_status)}const e=s.filter(t=>t.is_live);for(let t=0;t<e.length;t++){const a=this.gamesAllStories.findIndex(i=>i.game_id===e[t].game_id);if(a!==-1)this.gamesAllStories[a].score=e[t].score;else{this.gamesAllStories.push(e[t]),this.gamesAllStories=this.ordenarYFiltrarPartidos(this.gamesAllStories);let i=[];for(let o=0;o<this.gamesAllStories.length;o++)this.arrayGamesAdd.findIndex(r=>r.game_id===this.gamesAllStories[o].game_id)===-1?i.push({game_id:this.gamesAllStories[o].game_id,last_index:0,status:1}):i.push({game_id:this.arrayGamesAdd[this.arrayGamesAdd.findIndex(r=>r.game_id===this.gamesAllStories[o].game_id)].game_id,last_index:this.arrayGamesAdd[this.arrayGamesAdd.findIndex(r=>r.game_id===this.gamesAllStories[o].game_id)].last_index,status:this.arrayGamesAdd[this.arrayGamesAdd.findIndex(r=>r.game_id===this.gamesAllStories[o].game_id)].status});this.arrayGamesAdd=i,await ve.post(bi,{stories:this.arrayGamesAdd},{headers:{Authorization:`${this.token}`,"Content-Type":"application/json"}});for(let o=0;o<this.arrayGamesAdd.length;o++)this.gamesAllStories.findIndex(r=>r.game_id===this.arrayGamesAdd[o].game_id)!==-1&&(this.gamesAllStories[this.gamesAllStories.findIndex(r=>r.game_id===this.arrayGamesAdd[o].game_id)].index=this.arrayGamesAdd[o].last_index,this.gamesAllStories[this.gamesAllStories.findIndex(r=>r.game_id===this.arrayGamesAdd[o].game_id)].status_storie=this.arrayGamesAdd[o].status)}}}}},"allLiveGames.length":{handler(s){s.length===0&&this.resetGamesLiveInterval()}},privileges:{immediate:!0,deep:!0,async handler(s){this.is_public=s!==null}},team:{immediate:!0,deep:!0,async handler(s){s&&this.seasonsSelected.length&&setTimeout(()=>{this.fetchGames(s,this.seasonsSelected)},1e3)}},closestRound(s){this.selectedRoundKeyIndex=this.tournamentScheduleKeys.findIndex(e=>e===s),this.selectedRound=s},latestRound(s){this.selectedRoundKeyIndexVideo=this.tournamentScheduleKeysGoals.findIndex(e=>e===s),this.selectedRoundVideos=s},isCarouselFullScreenVisible:{handler(s){document.getElementsByTagName("html")[0].style.overflow=s?"hidden":"auto"},immediate:!0}},methods:{getOnlyGamesWithGoals(s){return Object.entries(s).reduce((e,[t,a])=>{const i=a.reduce((o,r)=>{const l=r.games.filter(d=>(d.is_live||d.game_status!==4)&&d.score[0]+d.score[1]>0);return l.length&&o.push({...r,games:l}),o},[]);return i.length&&(e[t]=i),e},{})},async onClickPlaySeeker(){try{const e=await(await fetch("https://rhev2kbe0a.execute-api.us-east-2.amazonaws.com/qa/demo/playseeker")).json();this.formatPlaySeekerPlays(e.data||OP)}catch(s){console.error(s)}},formatPlaySeekerPlays(s){let e=[];s&&s.playlist&&s.playlist.length&&(e=s.playlist.reduce((a,i,o)=>{const l={...Object.entries(Ft).reduce((f,[p,m])=>(f[p]=i[m],f),{}),isPlaySeeker:!0,startSeconds:i[Ft.startTime],endSeconds:i[Ft.endTime],totalSeconds:Math.floor(i[Ft.endTime]-i[Ft.startTime]),payloadData:{play_id:i[Ft.playId],total_plays:s.total_plays,play_number:o+1,group_playlist_id:s.group_playlist_id,playlist_id:s.playlist_id,group_id:s.group_id,moment_of_play:i[Ft.momentOfPlay],play_type:i[Ft.categoryId],viewer_second_start:Math.floor(i[Ft.startTime]),intended_second_start:Math.floor(i[Ft.startTime]),intended_second_end:Math.floor(i[Ft.endTime]),latitude_of_user:null,longitude_of_user:null}},[d,c]=l.playerName.split(","),h=d.split(" ");let u="";for(const f of h)if(u+=` ${f}`,f.length>3)break;if(l.playerShortName=c&&d?`${c.trim().charAt(0)}.${u}`:"",!l.mainCategoryName){const[f,p]=l.finalScore.split(" - ");l.arrayScore=[Number(f),Number(p)]}return l.categoryName=MP.get(l.categoryId),a.push(l),a},[]));let t=[];t=e,this.carouselPlayerQueue=t,this.isPlaySeeker=!0,this.isCarouselFullScreenVisible=!0},formatUsername(s){const e=s.split(",");let t="",a="";return e[1]?(a=e[1].trim().split(" "),a[0]?t=a[0]:t=e[1]):e[0]&&(a=e[0].trim().split(" "),a[0]?t=a[0]:t=e[0]),t.trim()},async fetchGameEvents(s){try{return(await ve.get(`${this.gameEventsUrl}${s}`,{headers:{Authorization:`${this.token}`}})).data}catch(e){throw new Error(e)}},async fetchLiveGames(){try{if(this.seasonsForLiveGames.length===0)return[];const s=this.seasonsForLiveGames.reduce((a,i)=>`${a}seasons=${i}&`,""),e=ve.create({headers:{Authorization:`${this.token}`}}),{data:t}=await e.get(`https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason/lives?${s}`);return t}catch(s){throw new Error(s)}},async onClickOpenCarouselVideos(s){try{this.isPlaySeeker=!1;const t=(await this.fetchGameEvents(s)).plays;this.carouselPlayerQueue=t.filter(a=>a.event_type_id===1&&a.video_link!=="-"),this.isCarouselFullScreenVisible=!0}catch(e){throw new Error(e)}},onChangeMatchDayGames(s){this.selectedRound!==s.key&&(this.selectedRound=s.key)},onClickStory({item:s,index:e}){this.openStory(e),this.onClickStories(s)},onClickLive(){const s=this.allLiveGames[0];if(s){const e=this.seasonsGamesMap.get(s.game_id);e&&(this.selectedRound=e.roundAbbreviationV2)}},onClickCloseCarousel(){this.carouselPlayerQueue=[],this.isPlaySeeker=!1,this.isCarouselFullScreenVisible=!1},onChangeIsLeagueSelected(s){this.isLeagueSelected=s},onAction(s){this.$emit("action",s)},onOpenMedia(s){s.type===1&&s.gameIds&&s.gameIds.length>0?this.onClickOpenCarouselVideos(s.gameIds[0]):this.$emit("openmedia",s)},onOpenProfile(s){this.$emit("onOpenProfile",s)},onClickMatch(s){this.$emit("openGame",s)},onClickCalendar(){const s={type:this.isGenericLike||this.isLeagueSelected?0:1,team:this.team,season:this.seasonSelected.id};this.$emit("onClickMyCalendar",s)},moreTops(){const s={team:this.team,season:this.seasonSelected.id};this.$emit("openTops",s)},clickProfileBtn(s){this.$emit("openProfile",s)},viewAll(){const s={team:this.team,season:this.seasonSelected.id};this.$emit("openAllPlayers",s)},getTotalPlayers(s){this.playersLength=s},clickCard(s){const e={data:s,isPlayer:this.isplayer};this.$emit("clickOnMainCards",e)},async fetchGames(s,e){const t=e.map(i=>`seasons=${i.id}`).join("&"),a=ve.create({headers:{Authorization:`${this.token}`}});this.fullTournamentSchedule=await a.get(this.gamesUrl+s+"?"+t),this.fullTournamentSchedule.data&&this.fullTournamentSchedule.data.prematch&&(this.fullTournamentSchedule.data.prematch.roundAbbreviationV2=this.roundAbbreviationByGameId.get(this.fullTournamentSchedule.data.prematch.game_id)),this.fullTournamentSchedule.data&&this.fullTournamentSchedule.data.postmatch&&(this.fullTournamentSchedule.data.postmatch.roundAbbreviationV2=this.roundAbbreviationByGameId.get(this.fullTournamentSchedule.data.postmatch.game_id)),this.nextRivalId=Object.keys(this.fullTournamentSchedule).length>0?this.user.team==this.fullTournamentSchedule.data.prematch.home_team?this.fullTournamentSchedule.data.prematch.visiting_team:this.fullTournamentSchedule.data.prematch.home_team:0,this.loadDiscover=!0},generateSeasons(s){const e=[{id:s.id,type:s.type}];return s.related_seasons&&s.related_seasons.length&&e.push(...s.related_seasons.map(t=>({id:t.id,type:t.type}))),e},async onInputTournament(s){this.tournamentSelected=s,this.tournamentType=s.tournament_type,this.tournamentSelected.id&&this.tournamentSelected.id!==s.id&&(this.updateTableCalendar+=1),this.tournamentSelectedDropDowns.id!==s.id&&(this.tournamentSelectedDropDowns=s)},getSeasonDependentPromises({season:s,seasons:e}){const t={headers:{Authorization:`${this.token}`}},a=[ve.get(`https://ts7thxzaik.execute-api.us-west-2.amazonaws.com/prod/players/seasons/${s.id}`,t)];a.push(this.fetchSeasonsGamesAndTeams(e.map(o=>o.id),3)),a.push(this.fetchStoriesPlays(s));const i=`https://ssh88fgvll.execute-api.us-east-2.amazonaws.com/prod/users/${this.user.id}/seasons/${s.id}/stories`;return i!==bi&&(bi=i,a.push(ve.get(bi,t))),a},async onInputSeason(s){try{if(this.seasonSelected.id!==s.id){this.isPreviousDataLoaded=!1,this.seasonSelected=s,this.seasonsSelected=this.generateSeasons(s);const e=this.getSeasonDependentPromises({season:s,seasons:this.seasonsSelected,retries:3,createdUrl:""}),[t,a,i,o]=await Promise.all(e);this.seasonPlayersMap=new Map,t.data&&t.data.players&&t.data.players.forEach(r=>{this.seasonPlayersMap.set(r.player_id,r)}),o&&o.data?this.arrayGamesAdd=o.data.stories.stories:this.arrayGamesAdd=[],this.resetGamesLiveInterval(),this.seasonSelected=s,this.show_stories=!!s.show_stories,this.seasonsForLiveGames=[s.id,...s.related_seasons.map(r=>r.id)],this.$emit("change-season-id",s.id),this.fillStoriesData(i,a.seasonsAndGames),await this.createFullTournamentScheme({seasons:this.seasonsSelected,seasonsAndGames:a.seasonsAndGames,seasonsAndTeams:a.seasonsAndTeams,applySeasonsValidation:!1}),this.team&&await this.fetchGames(this.team,this.seasonsSelected),this.keyupdate+=1}}catch(e){throw new Error(e)}},ordenarYFiltrarPartidos(s){const e=s.filter(t=>t.game_status===1||t.is_live==1||t.game_status==0);return e.sort((t,a)=>new Date(a.date_time_utc)-new Date(t.date_time_utc)),e.slice(0,18)},async fetchSeasonsGamesAndTeams(s,e,t=""){let a=t;try{const i=ve.create({headers:{Authorization:`${this.token}`}});a||(a=this.gamesUrl2,s.forEach((l,d)=>{a+=`${d===0?"":"&"}seasons=${l}`}));const{data:{data:o,teams:r}}=await i.get(a);return{seasonsAndGames:o,seasonsAndTeams:r}}catch(i){if(e>0)return this.fetchSeasonsGamesAndTeams(s,e-1,a);throw new Error(i)}},async fetchStoriesPlays(s){try{return await ve.create({headers:{Authorization:`${this.token}`}}).get("https://cpj4073446.execute-api.us-east-2.amazonaws.com/prod/videos/plays/seasons/"+s.id+"?categories=607&categories=608&categories=12&categories=55&categories=54&categories=35&categories=15&categories=53&type=1")}catch(e){throw new Error(e)}},fillStoriesData(s,e){let t=s.data?s.data.plays:[];this.gamesAllStories=[];for(let i=0;i<e.length;i++)this.gamesAllStories=this.gamesAllStories.concat(e[i].games);this.gamesAllStories=this.ordenarYFiltrarPartidos(this.gamesAllStories);let a=[];for(let i=0;i<this.gamesAllStories.length;i++)this.arrayGamesAdd.findIndex(o=>o.game_id===this.gamesAllStories[i].game_id)===-1?a.push({game_id:this.gamesAllStories[i].game_id,last_index:0,status:1}):a.push({game_id:this.arrayGamesAdd[this.arrayGamesAdd.findIndex(o=>o.game_id===this.gamesAllStories[i].game_id)].game_id,last_index:this.arrayGamesAdd[this.arrayGamesAdd.findIndex(o=>o.game_id===this.gamesAllStories[i].game_id)].last_index,status:this.arrayGamesAdd[this.arrayGamesAdd.findIndex(o=>o.game_id===this.gamesAllStories[i].game_id)].status});this.arrayGamesAdd=a;for(let i=0;i<this.arrayGamesAdd.length;i++)this.gamesAllStories.findIndex(o=>o.game_id===this.arrayGamesAdd[i].game_id)!==-1&&(this.gamesAllStories[this.gamesAllStories.findIndex(o=>o.game_id===this.arrayGamesAdd[i].game_id)].index=this.arrayGamesAdd[i].last_index,this.gamesAllStories[this.gamesAllStories.findIndex(o=>o.game_id===this.arrayGamesAdd[i].game_id)].status_storie=this.arrayGamesAdd[i].status);this.storiesItems=this.getStoriesStructureVideos(t),setTimeout(()=>{this.sendStoriesData()},1e3)},sendStoriesData(){ve.post(`https://ssh88fgvll.execute-api.us-east-2.amazonaws.com/prod/users/${this.user.id}/seasons/${this.seasonsSelected[0].id}/stories`,{stories:this.arrayGamesAdd},{headers:{Authorization:`${this.token}`,"Content-Type":"application/json"}})},getTimeSeconds(s){const[e,t]=s.split(":"),[a,i]=t.split(".");return parseInt(e)*60+parseInt(a)+parseInt(i)/1e3},getPlayTime(s,e){let t="",a=0;switch(s[7]){case 1:t=s[11];break;case 2:t=s[13],a=45;break;case 3:t=s[15],a=90;break;case 4:t=s[17],a=105;break;case 5:t=s[19],a=120;break}return(!t||t==="0")&&(t="00:00"),this.getTimeToSeconds(t)+(this.getTimeToSeconds(s[e])-a*60)},abrirNuevaVentana(){window.open("https://goltipster.com/view-all#golTipster","_blank")},getTimeToSeconds(s){const t=s.indexOf(".")>-1?s.substring(0,s.indexOf(".")):s,[a,i,o]=t.split(":").reverse();return(o?Number(o)*60*60:0)+Number(i)*60+Number(a)},getStoriesStructureVideos(s){let e=[];for(let t=0;t<this.gamesAllStories.length;t++){let a=s.filter(r=>r[3]===this.gamesAllStories[t].game_id).map(r=>({playId:r[29],gameId:r[3],player:this.seasonPlayersMap.get(r[1]),categoryId:r[0],date:new Date(r[4]),url:r[35]==2?"https://daijvvc13prpy.cloudfront.net/golstats-videos/"+this.gamesAllStories[t].game_id+"_1/"+this.gamesAllStories[t].game_id+"_1.m3u8":"https://golstatsbets.blob.core.windows.net/video-player/"+this.gamesAllStories[t].game_id+"_1.mp4",type:"video",thumbnail:{logoHomeTeam:"https://az755631.vo.msecnd.net/teams-80/"+this.gamesAllStories[t].home_team+".png",logoAwayTeam:"https://az755631.vo.msecnd.net/teams-80/"+this.gamesAllStories[t].visiting_team+".png"},header:{label:this.gamesAllStories[t].home_team_acronym+" "+this.gamesAllStories[t].score[0]+":"+this.gamesAllStories[t].score[1]+" "+this.gamesAllStories[t].visiting_team_acronym+" "+this.gamesAllStories[t].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV")},startTime:this.getPlayTime(r,9),endTime:this.getPlayTime(r,10),duration:Math.floor(this.getTimeSeconds(r[10])-this.getTimeSeconds(r[9]))}));const i={},o=a.filter(r=>i[r.playId]?!1:(i[r.playId]=!0,!0));e.push({game_id:this.gamesAllStories[t].game_id,stories:o})}return e},areSeasonsDifferent(s){for(const e of s)if(!this.lastSeasonsIds.includes(e.season_id))return!0;return!1},async createFullTournamentScheme({seasons:s,seasonsAndGames:e,seasonsAndTeams:t,applySeasonsValidation:a}){try{this.seasonsGamesMap=new Map,this.userTeamGames=[],this.userTeamGamesForVideos=[],this.gamesOfTheDayPreMatchIds.clear();let i=0;if(a&&this.areSeasonsDifferent(e))return;e.forEach(l=>{const d=s.find(c=>c.id===l.season_id);d&&(l.type=d.type,l.games.forEach(c=>{c.season_id=l.season_id}),d.type===0&&(i=l.season_id))});const o={seasonsGames:e},r=t.find(l=>l.season_id===i);if(r){const l=r.teams,d=[...o.seasonsGames],c=o&&o.seasonsGames?o.seasonsGames.map(u=>{const f=u.games.reduce((p,m)=>{const g={...m},y=new Date,[b,S,_]=g.date.split("-"),[C,E,v]=g.schedule.split(":"),T=new Date(Number(b),Number(S)-1,Number(_),Number(C),Number(E),Number(v));return g.dateTimeMillis=T.valueOf(),g.home_team=l.find(B=>B.team_id===m.home_team),g.visiting_team=l.find(B=>B.team_id===m.visiting_team),g.game_status===4&&y.getFullYear()===T.getFullYear()&&y.getMonth()===T.getMonth()&&y.getDate()===T.getDate()&&this.gamesOfTheDayPreMatchIds.add(g.game_id),this.seasonsGamesMap.set(g.game_id,g),p[m.matchday_abbreviation]?p[m.matchday_abbreviation][m.game_status===3?"canceled":m.date]?p[m.matchday_abbreviation][m.game_status===3?"canceled":m.date].push(g):p[m.matchday_abbreviation][m.game_status===3?"canceled":m.date]=[g]:p[m.matchday_abbreviation]={[m.game_status===3?"canceled":m.date]:[g]},this.gsData&&this.gsData.teamId&&g.game_status===4&&(g.home_team.team_id===this.gsData.teamId||g.visiting_team.team_id===this.gsData.teamId)&&(this.userTeamGames.push(g),g.score&&g.score[0]+g.score[1]>0&&this.userTeamGamesForVideos.push(g)),p},{});this.userTeamGames.sort((p,m)=>p.dateTimeMillis-m.dateTimeMillis);for(let[p,m]of Object.entries(f))f[p]=Object.entries(m).map(([g,y])=>({date:g,games:y.sort((b,S)=>b.dateTimeMillis-S.dateTimeMillis)})),f[p].sort((g,y)=>g.date<y.date?-1:g.date>y.date?1:0);return{type:u.type,weight:u.type===0?0:u.type===2?1:2,schedule:f}}):[],h=o&&o.seasonsGames?d.map(u=>{const f=u.games.reduce((p,m)=>{const g={...m};return g.dateTimeMillis=new Date(g.date_time_utc).valueOf(),g.home_team=l.find(y=>y.team_id===m.home_team),g.visiting_team=l.find(y=>y.team_id===m.visiting_team),p[m.matchday_abbreviation]?p[m.matchday_abbreviation][m.game_status===3?"canceled":m.date]?(g.game_status!=4||g.is_live==1)&&(g.score[0]!=0||g.score[1]!=0)&&p[m.matchday_abbreviation][m.game_status===3?"canceled":m.date].push(g):(g.game_status!=4||g.is_live==1)&&(g.score[0]!=0||g.score[1]!=0)&&(p[m.matchday_abbreviation][m.game_status===3?"canceled":m.date]=[g]):(g.game_status!=4||g.is_live==1)&&(g.score[0]!=0||g.score[1]!=0)&&(p[m.matchday_abbreviation]={[m.game_status===3?"canceled":m.date]:[g]}),p},{});this.userTeamGames.sort((p,m)=>p.dateTimeMillis-m.dateTimeMillis);for(let[p,m]of Object.entries(f))f[p]=Object.entries(m).map(([g,y])=>({date:g,games:y.sort((b,S)=>b.dateTimeMillis-S.dateTimeMillis)})),f[p].sort((g,y)=>g.date<y.date?-1:g.date>y.date?1:0);return{type:u.type,weight:u.type===0?0:u.type===2?1:2,schedule:f}}):[];c.sort((u,f)=>u.weight-f.weight),this.fullTournamentScheduleFull=c.reduce((u,f)=>{for(const[p,m]of Object.entries(f.schedule))if(f.type===0)if([1,2].includes(this.tournamentType)){const g=Fu.get(this.tournamentType);if(g){const y=g.get(p);y&&(u[y.matchDayAbbreviation]=m)}}else if(this.isCup){const g=p.replace("M",""),y=`Jornada ${g}`;this.isCupLegacy?u[Ou[g]||y]=m:u[Pu[p]||y]=m}else u[Number(p.replace("M","")).toString()]=m;else f.type===2?["PI1","PI2"].includes(p)?u[p]=m:u[`R${Number(p.replace("PO",""))}`]=m:f.type===1&&(u[Du[p]]=m);return u},{}),this.fullTournamentScheduleFullGoals=h.reduce((u,f)=>{for(const[p,m]of Object.entries(f.schedule))if(f.type===0)if([1,2].includes(this.tournamentType)){const g=Fu.get(this.tournamentType);if(g){const y=g.get(p);y&&(u[y.matchDayAbbreviation]=m)}}else if(this.isCup){const g=p.replace("M",""),y=`Jornada ${g}`;this.isCupLegacy?u[Ou[g]||y]=m:u[Pu[p]||y]=[]}else u[Number(p.replace("M","")).toString()]=m;else f.type===2?["PI1","PI2"].includes(p)?u[p]=m:u[`R${Number(p.replace("PO",""))}`]=m:f.type===1&&(u[Du[p]]=m);return u},{}),this.roundAbbreviationByGameId=new Map,this.tournamentScheduleKeys=Array.from(Object.entries(this.fullTournamentScheduleFull).reduce((u,[f,p])=>{const m=Number(f);let g="";Number.isNaN(m)?g=f:g=m<10?`0${m}`:f;let y=!1,b=null;const S=p.reduce((C,E)=>(!b&&E&&E.games&&E.games.length&&(b=E.games[0].matchday_id),E.games.forEach(v=>{this.roundAbbreviationByGameId.set(v.game_id,f),v.roundAbbreviation=Number.isNaN(m)?m:`J ${m}`,v.roundAbbreviationV2=f}),C=C.concat(E.games),C),[]);for(let C=0;C<S.length;C++)(S[C].game_status!=4||S[C].is_live)&&(S[C].score[0]!=0||S[C].score[1]!=0)&&(y=!0);u.set(f,{key:f,value:m,valueText:g,avaible:y,matchDayId:b});const _=this.getPages(S);return this.gamesPages.set(f,_),u},new Map).values()),this.tournamentScheduleKeysGoals=Array.from(Object.entries(this.fullTournamentScheduleFullGoals).reduce((u,[f,p])=>{const m=Number(f);let g="";Number.isNaN(m)?g=f:g=m<10?`0${m}`:f;let y=!1;const b=p.reduce((S,_)=>(_.games.forEach(C=>{C.roundAbbreviation=Number.isNaN(m)?m:`J ${m}`}),S=S.concat(_.games),S),[]);for(let S=0;S<b.length;S++)(b[S].game_status!=4||b[S].is_live&&(b[S].score[0]!=0||b[S].score[1]!=0))&&(y=!0);return u.set(f,{key:f,value:m,valueText:g,avaible:y}),u},new Map).values())}setTimeout(()=>{this.isPreviousDataLoaded=!0,this.checkLiveGames(),this.gamesOfTheDayPreMatchIds.size&&this.createGameOfTheDayTimeouts()},500)}catch(i){throw new Error(i)}finally{this.loadingFlag=!1}},createGameOfTheDayTimeouts(){this.gamesOfTheDayPreMatchIds.size&&this.gamesOfTheDayPreMatchIds.forEach(s=>{const e=this.seasonsGamesMap.get(s);if(e){const t=new Date().valueOf();if(60*1e3*30+e.dateTimeMillis-t>0){const i=e.dateTimeMillis-t-3e5;setTimeout(()=>{this.createCheckLiveGamesInterval()},i>0?i:0)}}})},resetCheckGamesLiveInterval(){clearInterval(yi),yi=null},createCheckLiveGamesInterval(){this.resetCheckGamesLiveInterval(),yi||(yi=setInterval(()=>{this.checkLiveGames()},this.checkLiveGamesIntervalMinutes*60*1e3))},async checkLiveGames(){try{const s=await this.fetchLiveGames(),e=new Set;if(this.allLiveGames=s.data.reduce((t,a)=>(a.games.forEach(i=>{e.add(i.game_id),t.push(i)}),t),[]),this.allLiveGames.length){xa||await this.fillGameEvents();const t=[];this.gamesOfTheDayPreMatchIds.forEach(a=>{const i=this.seasonsGamesMap.get(a);i&&new Date().valueOf()>i.dateTimeMillis&&t.push(a)}),t.length&&t.every(i=>this.seasonsGamesMap.get(i).isLiveTracked)&&this.resetCheckGamesLiveInterval()}}catch(s){throw new Error(s)}},createGamesEventsInterval(){this.resetGamesLiveInterval(),xa=setInterval(()=>{this.fillGameEvents()},6e4)},resetGamesLiveInterval(){clearInterval(xa),xa=null},removeGameIfFinished(s,e,t=!1){for(const a of e)if(a.category_id===0&&a.game_status_id===13)if(t)this.fetchGames(this.team,this.seasonsSelected);else{const i=this.seasonsGamesMap.get(a.game_id);this.allLiveGames=this.allLiveGames.filter(o=>o.game_id!==s.game_id),i.is_live=0,i.game_status=0}},async fillGameEvents(){try{const s=[];let e=null;for(const a of this.allLiveGames){a.isLiveTracked=!0,this.gamesOfTheDayPreMatchIds.size&&this.gamesOfTheDayPreMatchIds.delete(a.game_id);const i=this.seasonsGamesMap.get(a.game_id);i&&(i.is_live=1,i.game_status=4),e=this.fullTournamentSchedule&&this.fullTournamentSchedule.data&&this.fullTournamentSchedule.data.prematch?this.fullTournamentSchedule.data.prematch:null,e&&e.game_id===a.game_id&&(e.is_live=1,e.game_status=4),s.push(this.fetchGameEvents(a.game_id))}const t=await Promise.all(s);for(const a of t){const i=this.seasonsGamesMap.get(a.game_id);if(i){const o=FP.get(a.recent_lapse);i.currentTimeLive=o&&o<a.minute?`${o}' + ${a.minute-o}'`:`${a.minute}'`;const r=[Number(a.score[i.home_team.team_id.toString()])+Number(a.score[`own_${i.visiting_team.team_id.toString()}`]),Number(a.score[i.visiting_team.team_id.toString()])+Number(a.score[`own_${i.home_team.team_id.toString()}`])],l=r[0],d=r[1];i.score=[Number.isNaN(l)?0:l,Number.isNaN(d)?0:d],this.removeGameIfFinished(i,a.plays),e&&e.game_id===i.game_id&&(e.currentTimeLive=i.currentTimeLive,e.score=i.score,this.removeGameIfFinished(e,a.plays,!0))}}xa||this.createGamesEventsInterval()}catch(s){throw new Error(s)}},getPages(s){const e=[];if(this.gamesPerMatchDay>0){let t=[];s.forEach((a,i)=>{t.push(a),(i+1)%this.gamesPerMatchDay===0&&(e.push([...t]),t=[])}),t.length&&e.push([...t])}else e.push(s);return e},getNormalClosestRound(s,e=!1){const a=e?this.getOnlyGamesWithGoals(s):s,i=Object.entries(Object.entries(a).reduce((l,[d,c])=>(l[d]=[],c.forEach(h=>{h.games.forEach(u=>{const f=new Date(u.date_time_utc).getTime()+66e5;l[d].push(f)})}),l),{}));if(!i.length)return"1";const o=new Date().getTime(),r=i.reduce((l,[d,c])=>{let h=null;return c.forEach(u=>{const f=e?o-u:u-o;f>=0&&(h===null||f<h)&&(h=f)}),h&&(l.shortestTime===null||h<l.shortestTime)&&(l.round=d,l.shortestTime=h),l},{round:"",shortestTime:null});return r.shortestTime!==null?r.round:i[i.length-1][0]},getUserTeamClosestRound(s,e=!1){let t=1;const a=e?this.userTeamGamesForVideos:this.userTeamGames;if(a.length){const i=a[0];for(const[o,r]of Object.entries(s))for(const l of r)if(l.games.find(c=>c.game_id===i.game_id))return o}return t},async changeIndexStory(s){if(this.arrayGamesAdd.length>0){let e=-1,t=-1,a=-1;this.arrayGamesAdd.findIndex(i=>i.game_id===this.currentStories[0].gameId)!=-1&&(e=this.arrayGamesAdd.findIndex(i=>i.game_id===this.currentStories[0].gameId)),this.gamesAllStories.findIndex(i=>i.game_id===this.currentStories[0].gameId)!=-1&&(t=this.gamesAllStories.findIndex(i=>i.game_id===this.currentStories[0].gameId)),this.storiesItems.findIndex(i=>i.game_id===this.currentStories[0].gameId)!=-1&&(a=this.storiesItems.findIndex(i=>i.game_id===this.currentStories[0].gameId)),e!=-1&&(this.gamesAllStories[t].is_live===1?this.storiesItems[a].stories.length-1==s&&this.storiesItems[a].stories.length>1?this.arrayGamesAdd[e].last_index=s-1:this.arrayGamesAdd[e].last_index=s:this.arrayGamesAdd[e].last_index=s),a!=-1&&this.arrayGamesAdd[e].status>0&&(this.arrayGamesAdd[e].status=s>=this.storiesItems[a].stories.length-1?0:1)}else{this.arrayGamesAdd=[];for(let e=0;e<this.storiesItems.length;e++)this.arrayGamesAdd.push({game_id:this.storiesItems[e].game_id,last_index:this.currentStories[0].gameId==this.storiesItems[e].game_id?s:0,status:this.currentStories[0].gameId==this.storiesItems[e].game_id&&s>=this.storiesItems[e].stories.length-1?0:1})}await ve.post(`https://ssh88fgvll.execute-api.us-east-2.amazonaws.com/prod/users/${this.user.id}/seasons/${this.seasonsSelected[0].id}/stories`,{stories:this.arrayGamesAdd},{headers:{Authorization:`${this.token}`,"Content-Type":"application/json"}});for(let e=0;e<this.arrayGamesAdd.length;e++)this.gamesAllStories.findIndex(t=>t.game_id===this.arrayGamesAdd[e].game_id)!=-1&&(this.gamesAllStories[this.gamesAllStories.findIndex(t=>t.game_id===this.arrayGamesAdd[e].game_id)].index=this.arrayGamesAdd[e].last_index,this.gamesAllStories[this.gamesAllStories.findIndex(t=>t.game_id===this.arrayGamesAdd[e].game_id)].status_storie=this.arrayGamesAdd[e].status)},async getLiveGamePlays(s){var a=(await ve.create({headers:{Authorization:`${this.token}`}}).get("https://cpj4073446.execute-api.us-east-2.amazonaws.com/prod/live/videos/plays/seasons/"+this.gamesAllStories[s].season_id+"/games/"+this.gamesAllStories[s].game_id)).data.plays.filter(l=>l[0]===607||l[0]===608||l[0]===12||l[0]===55||l[0]===54||l[0]===35||l[0]===15||l[0]===53);let i=a.map(l=>({playId:l[29],gameId:l[3],player:this.seasonPlayersMap.get(l[1]),categoryId:l[0],date:new Date(l[4]),url:"https://falconvideolive.blob.core.windows.net/video-hls-live/"+this.gamesAllStories[s].game_id+"/"+this.gamesAllStories[s].game_id+".m3u8",type:"video",thumbnail:{logoHomeTeam:"https://az755631.vo.msecnd.net/teams-80/"+this.gamesAllStories[s].home_team+".png",logoAwayTeam:"https://az755631.vo.msecnd.net/teams-80/"+this.gamesAllStories[s].visiting_team+".png"},header:{label:this.gamesAllStories[s].home_team_acronym+" "+this.gamesAllStories[s].score[0]+":"+this.gamesAllStories[s].score[1]+" "+this.gamesAllStories[s].visiting_team_acronym+" "+this.gamesAllStories[s].matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV")},startTime:this.getPlayTime(l,9),endTime:this.getPlayTime(l,10),duration:Math.floor(this.getTimeSeconds(l[10])-this.getTimeSeconds(l[9]))}));const o={},r=i.filter(l=>o[l.playId]?!1:(o[l.playId]=!0,!0));this.storiesItems[s]={game_id:this.gamesAllStories[s].game_id,stories:r}},async openStory(s){const e={headers:{Authorization:`${this.token}`}},[t]=await Promise.all([ve.get(`https://ts7thxzaik.execute-api.us-west-2.amazonaws.com/prod/players/games/${this.gamesAllStories[s].game_id}`,e)]);t.data&&t.data.players.forEach(a=>{this.seasonPlayersMap.set(a.player_id,{dob:a.dob,first_name:a.first_name,jersey:a.jersey,last_name:a.last_name,name:a.name,player_name:a.name,nationality:a.nationality,nationality_id:a.nationality_id,nationality_photo:a.nationality_photo,photo:a.photo,player_id:a.player_id,position_id:a.position_id,short_name:a.short_name,team_id:a.team_id})}),this.gamesAllStories[s].is_live==1||this.gamesAllStories[s].game_status==0?(await this.getLiveGamePlays(s),setTimeout(()=>{this.currentStoryIndex=s,this.currentStories=this.storiesItems[s].stories,this.currentStoriesLastIndex=this.gamesAllStories[s].index},100)):(this.currentStoryIndex=s,this.currentStories=this.storiesItems[s].stories,this.currentStoriesLastIndex=this.gamesAllStories[s].index),setTimeout(()=>{this.isStoriesVisible=!0},150)},onCloseStories(s){this.currentStoriesLastIndex=0,this.isStoriesVisible=!1,this.$emit("event-posthog-stories",{event:"stories_cerrar",properties:{play_id:s?s.playId:null,game_id:s?s.gameId:null,category_id:s?s.categoryId:null,start_time:s?s.startTime:null,end_time:s?parseInt(s.currentTime):null,percentage_viewed:s?parseInt(s.progress):null}})},closeStories(){this.currentStoriesLastIndex=0,this.currentStoryIndex=null,this.currentStories=[]},onSwipeStories({direction:s,currentPlay:e}){s==="right"?(this.$emit("event-posthog-stories",{event:"stories_video_siguiente_partido",properties:{play_id:e?e.playId:null,game_id:e?e.gameId:null,category_id:e?e.categoryId:null,start_time:e?e.startTime:null,end_time:e?parseInt(e.currentTime):null,percentage_viewed:e?parseInt(e.progress):null}}),this.currentStoryIndex>0&&this.openStory(this.currentStoryIndex-1)):(this.$emit("event-posthog-stories",{event:"stories_video_anterior_partido",properties:{play_id:e?e.playId:null,game_id:e?e.gameId:null,category_id:e?e.categoryId:null,start_time:e?e.startTime:null,end_time:e?parseInt(e.currentTime):null,percentage_viewed:e?parseInt(e.progress):null}}),this.currentStoryIndex<this.storiesItems.length-1&&this.openStory(this.currentStoryIndex+1))},onClickNextBackVideo({eventName:s,currentPlay:e}){this.$emit("event-posthog-stories",{event:s,properties:{play_id:e?e.playId:null,game_id:e?e.gameId:null,category_id:e?e.categoryId:null,start_time:e?e.startTime:null,end_time:e?parseInt(e.currentTime):null,percentage_viewed:e?parseInt(e.progress):null}})},onChangeTournaments(s){this.currentTournaments=s},onClickStories(s){this.$emit("event-posthog-stories",{event:"stories_ver_play",properties:{game_id:s.game_id}})},onVideoPlay(s){this.$emit("event-posthog-stories",{event:"stories_play",properties:{play_id:s.playId,game_id:s.gameId,category_id:s.categoryId,start_time:s.startTime,end_time:s.endTime,percentage_viewed:0}})}},async created(){},beforeUnmount(){this.resetGamesLiveInterval()}},Si=s=>(n.pushScopeId("data-v-08d0a29b"),s=s(),n.popScopeId(),s),VP={class:"gsclanding",ref:"landingref"},UP={key:2,class:"play-seeker-image"},zP={class:"play-seeker-image__info"},GP=Si(()=>n.createElementVNode("div",{class:"play-seeker-image__info__ai"},"Inteligencia Artificial",-1)),jP={class:"play-seeker-image__info__legends-and-button"},HP=Si(()=>n.createElementVNode("div",{class:"play-seeker-image__info__legends-and-button__legends"},"LEYENDAS PARA TI",-1)),WP={class:"play-icon"},KP=["src"],qP=Si(()=>n.createElementVNode("div",{class:"text"},"Explora videos",-1)),YP={class:"play-seeker-image__players"},JP=["src"],XP={key:3,class:"container-selectors-mobile"},ZP={class:"container-selectors-mobile-tournament"},QP={class:"container-selectors-mobile-season"},eO={key:0,class:"home-item-movil"},tO=Si(()=>n.createElementVNode("div",{class:"home-movil"},"Inicio",-1)),sO={class:"name-user-movil"},aO={key:1,class:"home-item"},nO={key:2,class:"bar-settings"},iO={class:"name-user"},oO={class:"container-selectors"},rO={class:"selector-tournament"},lO={class:"selector-seasons"},cO={key:3,class:"stories-circle-wrapper"},dO=["onClick"],hO={class:"story-result"},uO={key:0,class:"font-bold"},mO={key:1,class:"font-bold"},fO={class:"story-match"},pO={key:4,class:"container-games"},gO={key:6,class:"container-players"},yO={class:"container-tops"};function bO(s,e,t,a,i,o){const r=n.resolveComponent("Stories"),l=n.resolveComponent("CarouselFullScreen"),d=n.resolveComponent("GSCTournamentSelect"),c=n.resolveComponent("GSCSeasonSelect"),h=n.resolveComponent("GSCSlider"),u=n.resolveComponent("GSCGames");n.resolveComponent("DiscoverVideos");const f=n.resolveComponent("GSCGridTeamsMatches"),p=n.resolveComponent("GSCTableCalendar"),m=n.resolveComponent("GSCPlayersLanding"),g=n.resolveComponent("GSCTops");return n.openBlock(),n.createElementBlock("div",VP,[i.isStoriesVisible&&t.showStories?(n.openBlock(),n.createBlock(r,{key:0,stories:i.currentStories,"start-story-index":i.currentStoriesLastIndex,"is-first-game-stories":i.currentStoryIndex===0,"is-last-game-stories":i.currentStoryIndex===i.storiesItems.length-1,onLastStoryIndex:o.changeIndexStory,onClose:o.onCloseStories,onSwipe:o.onSwipeStories,onVideoNextBack:o.onClickNextBackVideo,onVideoPlay:o.onVideoPlay},null,8,["stories","start-story-index","is-first-game-stories","is-last-game-stories","onLastStoryIndex","onClose","onSwipe","onVideoNextBack","onVideoPlay"])):n.createCommentVNode("",!0),i.isCarouselFullScreenVisible?(n.openBlock(),n.createBlock(l,{key:1,"player-queue":i.carouselPlayerQueue,"is-play-seeker":i.isPlaySeeker,"playlist-index":0,onClose:o.onClickCloseCarousel},null,8,["player-queue","is-play-seeker","onClose"])):n.createCommentVNode("",!0),o.isPlaySeekerAvailable?(n.openBlock(),n.createElementBlock("div",UP,[n.createElementVNode("div",zP,[GP,n.createElementVNode("div",jP,[HP,n.createElementVNode("div",{role:"button",class:"play-seeker-image__info__legends-and-button__button",onClick:e[0]||(e[0]=(...y)=>o.onClickPlaySeeker&&o.onClickPlaySeeker(...y))},[n.createElementVNode("div",WP,[n.createElementVNode("img",{src:`${i.imagesUrl}icn-play.svg`,alt:""},null,8,KP)]),qP])])]),n.createElementVNode("div",YP,[n.createElementVNode("img",{src:`${i.imagesUrl}players@2x.png`,alt:""},null,8,JP)])])):n.createCommentVNode("",!0),a.elementSize.width<=680&&a.elementSize.width>0?(n.openBlock(),n.createElementBlock("div",XP,[n.createElementVNode("div",ZP,[n.createVNode(d,{"current-season-id":t.currentSeasonId,width:"100%","api-url":t.tournamentsApiUrl,onInput:o.onInputTournament,onChangeTournaments:o.onChangeTournaments},null,8,["current-season-id","api-url","onInput","onChangeTournaments"])]),n.createElementVNode("div",QP,[n.createVNode(c,{"current-season-id":t.currentSeasonId,width:"100%",seasons:i.tournamentSelectedDropDowns.seasons,onInput:o.onInputSeason},null,8,["current-season-id","seasons","onInput"])])])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(o.containerbackground)},[n.createElementVNode("div",{class:n.normalizeClass(o.containerdata)},[a.elementSize.width<=680?(n.openBlock(),n.createElementBlock("div",eO,[tO,n.createElementVNode("div",sO,[t.isFemale?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode("Bienvenida ")],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode("Bienvenido ")],64)),i.is_public?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createTextVNode("a GolStats ")],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createTextVNode(n.toDisplayString(o.formatUsername(t.user.name)),1)],64))])])):n.createCommentVNode("",!0),a.elementSize.width>680?(n.openBlock(),n.createElementBlock("div",aO,"Inicio")):n.createCommentVNode("",!0),a.elementSize.width>680?(n.openBlock(),n.createElementBlock("div",nO,[n.createElementVNode("div",iO,[t.isFemale?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode("Bienvenida ")],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode("Bienvenido ")],64)),i.is_public?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createTextVNode("a GolStats ")],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createTextVNode(n.toDisplayString(o.formatUsername(t.user.name)),1)],64))]),n.createElementVNode("div",oO,[n.createElementVNode("div",rO,[n.createVNode(d,{"current-season-id":t.currentSeasonId,"api-url":t.tournamentsApiUrl,onInput:o.onInputTournament,onChangeTournaments:o.onChangeTournaments},null,8,["current-season-id","api-url","onInput","onChangeTournaments"])]),n.createElementVNode("div",lO,[n.createVNode(c,{"current-season-id":t.currentSeasonId,seasons:i.tournamentSelectedDropDowns.seasons,onInput:o.onInputSeason},null,8,["current-season-id","seasons","onInput"])])])])):n.createCommentVNode("",!0),i.gamesAllStories.length>0&&!i.is_public&&i.show_stories&&t.showStories?(n.openBlock(),n.createElementBlock("div",cO,[(n.openBlock(),n.createBlock(h,{key:i.keyupdate,height:"130px",pxScroll:86,scrollColor:"none",arrowsPosition:"absolute","background-color":"none",arrowsScrollHide:!0,arrowsHideOnNoScroll:!0,arrowsBackground:"rgba(255,255,255,.16)",arrowsContainerBgL:"linear-gradient(270deg, rgba(13,29,42,0.1) 0%, rgba(13,29,42,1) 70%)",arrowsContainerBgR:"linear-gradient(90deg, rgba(13,29,42,0.1) 0%, rgba(13,29,42,1) 70%)",arrowsMargin:0,arrowsRadius:"50%",arrowsBorder:"#ddd"},{default:n.withCtx(()=>[n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.gamesAllStories,(y,b)=>(n.openBlock(),n.createElementBlock("div",{key:b,class:"story-container-game",onClick:S=>o.onClickStory({item:y,index:b})},[n.createElementVNode("div",{class:"story-circle",style:n.normalizeStyle(y.is_live==1?(y.status_storie==1,"border: 2px solid #cbee6b !important;"):y.status_storie==1?"border: 2px solid #2248a2 !important;":"border: 2px solid #41485B !important;")},[n.createElementVNode("div",{class:"circle-item-home",style:n.normalizeStyle("background-image: url(https://az755631.vo.msecnd.net/teams-80/"+y.home_team+".png)")},null,4),n.createElementVNode("div",{class:"circle-item-away",style:n.normalizeStyle("background-image: url(https://az755631.vo.msecnd.net/teams-80/"+y.visiting_team+".png)")},null,4)],4),n.createElementVNode("div",hO,[n.createTextVNode(n.toDisplayString(y.home_team_acronym)+" ",1),y.score.length>0?(n.openBlock(),n.createElementBlock("span",uO,n.toDisplayString(isNaN(y.score[0])?0:y.score[0]),1)):n.createCommentVNode("",!0),n.createTextVNode(":"),y.score.length>0?(n.openBlock(),n.createElementBlock("span",mO,n.toDisplayString(isNaN(y.score[1])?0:y.score[1]),1)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(y.visiting_team_acronym),1)]),n.createElementVNode("div",fO,n.toDisplayString(y.matchday_name.replace("Matchday","JOR").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SFI").replace("Playoffs 4","SFV").replace("Playoffs 5","FI").replace("Playoffs 6","FV")),1)],8,dO))),128))]),_:1}))])):n.createCommentVNode("",!0),Object.keys(i.tournamentSelected).length>0?(n.openBlock(),n.createElementBlock("div",pO,[n.createVNode(u,{"component-width":a.elementSize.width,isplayer:t.isplayer,"is-full":o.isGenericLike,data:o.games,"tournament-schedule-keys":i.tournamentScheduleKeys,"default-match-day-key":i.selectedRound,user:t.user,"current-tournament":i.tournamentSelected,"is-live-button-visible":!!i.allLiveGames.length,onClickCalendar:o.onClickCalendar,onClickMatch:o.onClickMatch,onChangeMatchDay:o.onChangeMatchDayGames,onChangeIsLeagueSelected:o.onChangeIsLeagueSelected,onClickLive:o.onClickLive},null,8,["component-width","isplayer","is-full","data","tournament-schedule-keys","default-match-day-key","user","current-tournament","is-live-button-visible","onClickCalendar","onClickMatch","onChangeMatchDay","onChangeIsLeagueSelected","onClickLive"])])):n.createCommentVNode("",!0),n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(o.containerGridCalendarTable)},[n.createElementVNode("div",{class:"container-grid",style:n.normalizeStyle(a.elementSize.width<748?"width: 100%":"")},[n.createVNode(f,{isPlayer:t.isplayer&&!o.isGenericLike,"player-id":t.user.player,"team-id":t.user.team,"tournament-selected":i.tournamentSelected,"is-public":i.is_public,"season-selected":i.seasonSelected.id,"next-rival-id":Object.keys(i.fullTournamentSchedule).length>0?t.user.team==i.fullTournamentSchedule.data.prematch.home_team?i.fullTournamentSchedule.data.prematch.visiting_team:i.fullTournamentSchedule.data.prematch.home_team:0,"team-img":"https://az755631.vo.msecnd.net/teams-150/"+t.user.team+".png","player-img":"https://az755631.vo.msecnd.net/players-profile/"+t.user.player+".png","rival-img":Object.keys(i.fullTournamentSchedule).length>0?t.user.team==i.fullTournamentSchedule.data.prematch.home_team?"https://az755631.vo.msecnd.net/teams-150/"+i.fullTournamentSchedule.data.prematch.visiting_team+".png":"https://az755631.vo.msecnd.net/teams-150/"+i.fullTournamentSchedule.data.prematch.home_team+".png":"","has-team":!o.isGenericLike,"component-width":a.elementSize.width,onAction:o.clickCard},null,8,["isPlayer","player-id","team-id","tournament-selected","is-public","season-selected","next-rival-id","team-img","player-img","rival-img","has-team","component-width","onAction"])],4),n.createElementVNode("div",{class:"container-calendar-table",style:n.normalizeStyle(a.elementSize.width<1e3?"width: 100%; margin-top: 30px;":"")},[i.isPreviousDataLoaded?(n.openBlock(),n.createBlock(p,{season:i.seasonSelected,seasons:i.seasonsSelected,"tournament-type":i.tournamentType,tournament:i.tournamentSelected.id,privileges:t.privileges,"is-public":i.is_public,key:i.updateTableCalendar,"team-id":o.teamSelected,componentWidth:a.elementSize&&a.elementSize.width?a.elementSize.width:0,tournaments:i.currentTournaments,onAction:o.onAction,onOnOpenProfile:o.onOpenProfile,onOpenmedia:o.onOpenMedia},null,8,["season","seasons","tournament-type","tournament","privileges","is-public","team-id","componentWidth","tournaments","onAction","onOnOpenProfile","onOpenmedia"])):n.createCommentVNode("",!0)],4)],2),o.isGenericLike?n.createCommentVNode("",!0):n.withDirectives((n.openBlock(),n.createElementBlock("div",gO,[i.isPreviousDataLoaded?(n.openBlock(),n.createBlock(m,{key:0,"tournament-selected":i.tournamentSelected,onClickProfileBtn:o.clickProfileBtn,onViewAll:o.viewAll,onTotalPlayers:o.getTotalPlayers,"team-id":t.user.team,"season-id":i.seasonSelected.id,"is-player":!!t.user.player},null,8,["tournament-selected","onClickProfileBtn","onViewAll","onTotalPlayers","team-id","season-id","is-player"])):n.createCommentVNode("",!0)],512)),[[n.vShow,i.playersLength>0]]),n.createElementVNode("div",yO,[i.isPreviousDataLoaded?(n.openBlock(),n.createBlock(g,{key:0,"tournament-selected":i.tournamentSelected,onMore:o.moreTops,"show-switch":!o.isGenericLike,season:i.seasonSelected.id,"show-more":!i.is_public,"team-id":t.user.team,"active-videos":i.is_public?t.privileges.vr_privileges:!0,onOpenmedia:o.onOpenMedia},null,8,["tournament-selected","onMore","show-switch","season","show-more","team-id","active-videos","onOpenmedia"])):n.createCommentVNode("",!0)]),i.is_public?(n.openBlock(),n.createElementBlock("div",{key:7,class:"b2c-image",onClick:e[1]||(e[1]=(...y)=>o.abrirNuevaVentana&&o.abrirNuevaVentana(...y))})):n.createCommentVNode("",!0)],2)],2)],512)}const SO=qe($P,[["render",bO],["__scopeId","data-v-08d0a29b"]]);hs.GSCLanding=SO,Object.defineProperty(hs,Symbol.toStringTag,{value:"Module"})});
|