@viewlift/player-backup 2.0.295-backup → 2.0.296-backup
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/cjs/bundle.css +849 -829
- package/cjs/{index-b639e99c.js → index-229dec72.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{skin-3a02681c.js → skin-8780e2a2.js} +1 -1
- package/esm/bundle.css +849 -829
- package/esm/components/chapters/markers.d.ts +6 -0
- package/esm/{index-8acba85e.js → index-2be4a3d8.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{skin-4d5df1a3.js → skin-f95bee67.js} +1 -1
- package/package.json +1 -1
|
@@ -7,4 +7,10 @@ export function mountMarkers(playerId: any, { store, mapper, chaptersConfig, see
|
|
|
7
7
|
render(): void;
|
|
8
8
|
reposition(): void;
|
|
9
9
|
destroy(): void;
|
|
10
|
+
setActiveBySegment?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
render: () => void;
|
|
13
|
+
reposition: () => void;
|
|
14
|
+
destroy: () => void;
|
|
15
|
+
setActiveBySegment: (segmentId: any) => void;
|
|
10
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"video.js/dist/video-js.min.css";import{c as e,g as n,a as t,b as r,d as o,e as i,s as l,f as a,l as u,h as s,v as c,i as d,j as v,k as f,m as p,t as m,n as h,o as g,p as y,q as b,r as w,u as k,w as S,x as T,y as E,z as I,A as C,B as O,C as j,D,E as P,F as x,G as N,H as A,I as R,J as _,K as M,L,M as B,N as F,O as U,P as V,Q as H,R as z,S as G,T as q,U as K,V as Y,W,X as $}from"./generic-c057edc5.js";import J from"@babel/runtime/helpers/defineProperty";import X from"@babel/runtime/helpers/asyncToGenerator";import Q from"@babel/runtime/regenerator";import Z from"video.js";import ee from"@babel/runtime/helpers/classCallCheck";import ne from"@babel/runtime/helpers/createClass";import te from"@babel/runtime/helpers/get";import re from"@babel/runtime/helpers/inherits";import oe from"@babel/runtime/helpers/possibleConstructorReturn";import ie from"@babel/runtime/helpers/getPrototypeOf";import{o as le,g as ae,a as ue,s as se,b as ce,p as de,c as ve}from"./util-371cec8c.js";import{g as fe,d as pe,a as me,e as he}from"./captions-a7cd63fa.js";import{g as ge}from"./renditions-225582e2.js";import{playSelectedResolution as ye}from"./resolution-0fbfb20a.js";import{g as be,i as we,t as ke,p as Se,a as Te}from"./skin-606a59c2.js";import{d as Ee}from"./browser-d4613b36.js";import{g as Ie,s as Ce}from"./localisation-0bf399a1.js";import Oe from"@babel/runtime/helpers/typeof";import"@viewlift/comscore/index.js";import je from"@babel/runtime/helpers/toConsumableArray";import De from"@babel/runtime/helpers/slicedToArray";import{createSSETransport as Pe}from"@viewlift/sse";function xe(e,n,t,r){var o=te(ie(1&r?e.prototype:e),n,t);return 2&r&&"function"==typeof o?function(e){return o.apply(t,e)}:o}function Ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ne=function(){return!!e})()}var Ae=Z.getComponent("TextTrackSettings"),Re=Z.dom,_e=[{value:"12",label:"12px"},{value:"14",label:"14px"},{value:"16",label:"16px"},{value:"18",label:"18px"},{value:"20",label:"20px"},{value:"24",label:"24px"},{value:"28",label:"28px"},{value:"32",label:"32px"}],Me=_e.map(function(e){return e.value}),Le="16",Be="vlp-caption-font-size-px",Fe="vlp-caption-font-size-style",Ue=".vjs-font-percent > select",Ve=function(e){return-1!==Me.indexOf(e)?e:Le},He=null;Ae?(He=function(){re(r,Ae);var e,n,t=(e=r,n=Ne(),function(){var t,r=ie(e);if(n){var o=ie(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return oe(this,t)});function r(e,n){var o;return ee(this,r),(o=t.call(this,e,n)).customUiReady_=!0,o.applyCustomFontSizeUI_(),o}return ne(r,[{key:"applyCustomFontSizeUI_",value:function(){this.replaceFontSizeOptions_(),this.bindFontSizeChange_(),this.restoreCustomFontSize_()}},{key:"replaceFontSizeOptions_",value:function(){var e=this.$(Ue);if(e){for(;e.firstChild;)e.removeChild(e.firstChild);_e.forEach(function(n){e.appendChild(Re.createEl("option",{value:n.value,textContent:n.label}))}),e.value=Le}}},{key:"bindFontSizeChange_",value:function(){var e=this,n=this.$(Ue);n&&this.on(n,"change",function(){return e.applyFontSize_(n.value)})}},{key:"applyFontSize_",value:function(e){var n=Ve(e);if("undefined"!=typeof document){var t=document.getElementById(Fe);t||((t=document.createElement("style")).id=Fe,document.head.appendChild(t)),t.textContent=[".vjs-text-track-cue,",".vjs-text-track-cue > div,",".vjs-text-track-display-ttml,",".vjs-text-track-display-ttml span,",".vjs-text-track-display-ttml div","{ font-size: ".concat(n,"px !important; line-height: normal !important; }")].join(" ")}}},{key:"restoreCustomFontSize_",value:function(){var e=null;try{e=window.localStorage.getItem(Be)}catch(e){}var n=Ve(e),t=this.$(Ue);t&&(t.value=n),this.applyFontSize_(n)}},{key:"getValues",value:function(){var e=xe(r,"getValues",this,3)([]);return e&&delete e.fontPercent,e||{}}},{key:"setDefaults",value:function(){if(xe(r,"setDefaults",this,3)([]),this.customUiReady_){var e=this.$(Ue);e&&(e.value=Le),this.applyFontSize_(Le)}}},{key:"saveSettings",value:function(){if(xe(r,"saveSettings",this,3)([]),this.options_&&this.options_.persistTextTrackSettings){var e=this.$(Ue);if(e)try{window.localStorage.setItem(Be,Ve(e.value))}catch(e){}}}},{key:"handleLanguagechange",value:function(){xe(r,"handleLanguagechange",this,3)([]),this.applyCustomFontSizeUI_()}}]),r}(),Z.registerComponent("TextTrackSettings",He)):console.warn("[vlp] CustomTextTrackSettings: video.js TextTrackSettings is not registered; skipping override.");var ze=function(e){return new Promise(function(n,t){if(Ge(e))t("".concat(e," is alread initialised"));else{var r=document.createElement("script");r.async=!0,r.src=e,r.onload=function(){n()},r.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(r)}})},Ge=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},qe=function(e,n,t){var r=be(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var o=parseFloat(n)/100;r.volume(o),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},Ke=function(e){var n=be(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Ye=function(){var e=X(Q.mark(function e(n){var t,r,o,i,l;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=be(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return i=e.sent,e.prev=5,e.next=8,ze("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,i.default(Z),e.finish(13);case 16:(l=Z.getTech("chromecast"))&&!l.prototype.seeking&&(l.prototype.seeking=function(){}),null!==(o=window)&&void 0!==o&&o.cast?null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.chromecastReceiverId&&null!=n&&n.airplay&&"Safari"==Ee()?null==r||r.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),We=function(e,n){var t=be(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,r,o,i,l,a=this.el(),u=Z.dom.getPointerPosition(a,n).x;Z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var s=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(i=o.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S;if(console.log(s),s&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*u,d.seek()}})};var $e=function(){var e=X(Q.mark(function e(){return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),ze("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Je=function(){var n=X(Q.mark(function n(){return Q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,import("@viewlift/comscore/index.js").then(function(n){e.set(n)});case 2:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}(),Xe=function(){var e=X(Q.mark(function e(){return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){Z.getPlugin("eme")||Z.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Qe=function(){var e=X(Q.mark(function e(){var n;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(Z),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),Ze=function(){var e=X(Q.mark(function e(){return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-5d92eaa3.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),en=function(){var e=X(Q.mark(function e(){return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-e31d9fb5.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),nn=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){ze("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(Z)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(Z)})},loadAdsLibrary:$e,loadEMELibrary:Xe,loadMuxPlugin:Qe,loadDvrSeekbar:Ze,loadContribDash:en,loadComscorePlugin:Je});function tn(e){return rn.apply(this,arguments)}function rn(){return(rn=X(Q.mark(function e(n){var t;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,$e();case 3:t&&"Safari"==Ee()&&Promise.resolve().then(function(){return nn}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function on(e){return ln.apply(this,arguments)}function ln(){return(ln=X(Q.mark(function e(n){var t,r,o,i,l,a,u,s,c,d;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d=be(n.playerId),e.next=3,Je();case 3:d.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(r=n.comscore)||void 0===r?void 0:r.endpoint,applicationName:(null==n||null===(o=n.comscore)||void 0===o?void 0:o.applicationName)||(null===(i=window)||void 0===i?void 0:i.siteName)||null,implementationId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.implementationId,projectId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.projectId,debug:(null==n||null===(u=n.comscore)||void 0===u?void 0:u.debug)||!1,persistentLabels:(null==n||null===(s=n.comscore)||void 0===s?void 0:s.persistentLabels)||{},metadata:(null==n||null===(c=n.comscore)||void 0===c?void 0:c.metadata)||{}});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function an(e,n){return un.apply(this,arguments)}function un(){return(un=X(Q.mark(function e(n,t){var r,o,i,l,a,u,s,c,d,v,f,p,m,h;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d=(null==t?void 0:t.contentType)||"video",v=null==t||null===(r=t[d])||void 0===r?void 0:r.drmEnabled,null==t||null===(o=t[d])||void 0===o||null===(i=o.liveDetails)||void 0===i||i.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==t||null===(l=t[d])||void 0===l||null===(a=l.streamingInfo)||void 0===a||null===(u=a.videoAssets)||void 0===u?void 0:u.dash)||null,p=(null==n||null===(s=n.comscore)||void 0===s?void 0:s.enable)||!1,m=!(null==n||null===(c=n.analytics)||void 0===c||!c.muxKey),e.prev=7,e.next=10,Promise.allSettled([v?"Safari"==Ee()?Xe():"caliente"!=(null===(h=window)||void 0===h?void 0:h.siteName)?en():Xe():"Safari"!=Ee()&&f?en():null,p?on(n):null,m?Qe():null,Ye(n)]);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),console.log("Error",e.t0);case 15:case"end":return e.stop()}},e,null,[[7,12]])}))).apply(this,arguments)}function sn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function cn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?sn(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):sn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var dn=new Set,vn=null,fn=function(e,t,o,i){var l,a,u,s,c,d,v,f={},p=(null==e?void 0:e.contentType)||"video";f["c3.cm.id"]=(null===(l=e[p])||void 0===l?void 0:l.id)||"Null",f["c3.cm.contentType"]=wn(e),f[null==o||null===(a=o.Constants)||void 0===a?void 0:a.IS_LIVE]=!(null==e||!e.linearchannel),f[null==o||null===(u=o.Constants)||void 0===u?void 0:u.STREAM_URL]=t.currentSrc(),f[null==o||null===(s=o.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===n()?"NULL":n(),f["c3.cm.categoryType"]=gn(e),f["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),f.DRMEnabled=(null===(c=e[p])||void 0===c?void 0:c.drmEnabled)||"None",f.DAIStream=null!==(d=e[p])&&void 0!==d&&null!==(v=d.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",f[o.Constants.DEFAULT_RESOURCE]="AKAMAI",f["c3.cm.brand"]="NULL",f.CDVREnabled=yn(e),f["c3.cm.genreList"]=mn(e),f["c3.cm.genre"]=pn(e),f["c3.cm.channel"]=hn(e,i);var m=Tn(r(),e);return f=cn(cn({},f),m)},pn=function(e){var n,t,r,o=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[o])||void 0===n||null===(t=n.gist)||void 0===t||null===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},mn=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},hn=function(e,n){var t,r,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null===(r=((null==e||null===(t=e[o])||void 0===t?void 0:t.channels)||[]).find(function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)}))||void 0===r?void 0:r.title)||"NULL"},gn=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},yn=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",o=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return o?"YES":"NO"},bn=function(e,n){var t,r,o=(n||{}).epg;if(o&&null!=o&&o.enable&&null!=o&&o.programTitle)return o.programTitle;var i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[i])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.title)||"Null";return"".concat(l)},wn=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var kn,Sn,Tn=function(e,n){var r,i,l,a,u,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return s;var c=o(),d=t();return s["c3.cm.seriesName"]=(null==n||null===(r=n.video)||void 0===r||null===(i=r.series)||void 0===i?void 0:i.title)||"Null",s["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",s["c3.cm.showTitle"]=(null==e||null===(l=e[c-1])||void 0===l||null===(a=l.episodes)||void 0===a||null===(u=a[d-1])||void 0===u?void 0:u.title)||"Null",s["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",s},En=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},In=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Cn=function(){var e=X(Q.mark(function e(n,t){var r,o,l,a,u,s,c,d,v,f,p,m;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(null==t?void 0:t.convivaConfig)||{},o=r.trackConvivaPlayerEvent,l=r.paymentHandler,a=r.tveProvider,u=r.enable,s=r.appName,d=(c=t||{}).token,v=c.epg,u){e.next=4;break}return e.abrupt("return");case 4:if(f=be(n),"function"==typeof(p=o)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,p("getConvivaObject");case 10:if(m=e.sent){e.next=13;break}return e.abrupt("return");case 13:f.ready(function(){var e=f.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=En(t.keySystem);p("contentInfo",{DRMEnabled:r})}else p("contentInfo",{DRMEnabled:"None"})}),n||p("contentInfo",{DRMEnabled:"None"})}),f.on("loadstart",function(){var e,n;vn&&vn!==f.currentSrc()&&p("playbackEnded"),p("setPlayer",f),dn.clear(),vn=f.currentSrc();var r=In(f.currentType()),o=i(),u=fn(o,f,m,v);u[null==m||null===(e=m.Constants)||void 0===e?void 0:e.PLAYER_NAME]=s||"WEB",u[null==m||null===(n=m.Constants)||void 0===n?void 0:n.ASSET_NAME]=bn(o,t),u.authToken=d||"NULL",u.streamType=r,u.D2CType=l||"NONE",u.subscriberType=a?"MVPD":"FREE"!==l?"D2C":"FREE",u["c3.cm.affiliate"]=a||"NULL",On.setData(u),p("contentInfo",u)}),f.on("loadedmetadata",function(){var e,n=f.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})}),f.on("play",function(){dn.has(f.currentSrc())||(dn.add(f.currentSrc()),p("playbackStarted",null))}),f.on("ended",function(){dn.has(f.currentSrc())&&dn.delete(f.currentSrc()),p("playbackEnded")}),f.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:f,adsLoader:null==e?void 0:e.adsLoader})}),f.on("dispose",function(){null==dn||dn.clear(),p("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),On=(kn={},{setData:function(e){kn=cn(cn({},kn),e)},getData:function(){return kn}}),jn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-d184c7e3.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-a9c23cad.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-dac31c35.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-601e36bf.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-9a9606e2.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?import("./skin-3aa64a01.js").then(function(t){t.initialiseSkin(e,n)}):"news"==t?import("./skin-bce765b0.js").then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?import("./skin-280dfe76.js").then(function(t){t.initialiseSkin(e,n)}):"mini"==t?import("./skin-109c4ba7.js").then(function(t){t.initialiseSkin(e,n)}):"CN_NEWS"==t&&import("./skin-4d5df1a3.js").then(function(t){t.initialiseSkin(e,n)})};function Dn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Pn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Dn(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Dn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var xn=[],Nn=0,An=null;function Rn(){Sn=null,xn=[],Nn=0,An=null}function _n(e,n,t){var r,o,a,u,s,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(r=n.watchHistory)||void 0===r||r.apiVersion;var d=null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.profileId,v=Math.floor(e.currentTime()),f=Math.floor(e.duration());null==n||null===(a=n.watchHistory)||void 0===a||a.xapiKey;var p=(null==n||null===(u=n.video)||void 0===u?void 0:u.originalObjectId)||null,m=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,h=Math.floor(e.currentTime()),g=c?100:Math.floor(v/f*100),y={};m?function(e,n,t){var r=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),o=Mn(r),l=(new Date).getTime(),a=i(),u=(null==a?void 0:a.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return Pn(Pn({},e),{},J({},n,u[n]))},{}),c=o.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===Sn});c<0?o.push(Pn(Pn({content:s},e),{},{addedDate:l,updateDate:l})):o[c]=Pn(Pn(Pn({},o[c]),e),{},{updateDate:l});localStorage.setItem("".concat(r),JSON.stringify(o))}(y={completed:c,watchedTime:h,watchedPercentage:g},d,n.siteOwner):(y=Pn(Pn({videoId:Sn,watchedTime:h,watchedPercentage:g,doneWatching:c,profileId:d},An&&{seriesId:An}),p&&{originalObjectId:p}),l(y).then(function(e){}).catch(function(e){})),Nn=v+t}function Mn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Ln(e,n,t){var r=Mn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return r&&Array.isArray(r)&&(o=r.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),o}var Bn=!1,Fn=function(e,n){var t,r,o=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[o])||void 0===t||null===(r=t.streamingInfo)||void 0===r?void 0:r.secondaryVideoAssets)||null)&&!Bn){var i=Un(e,"videoAssets","secondaryVideoAssets"),l=a(i,n);return l&&u(n,l),Bn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Un(e,n,t){if(Array.isArray(e))return e.map(function(e){return Un(e,n,t)});if(null!==e&&"object"===Oe(e)){var r={};return Object.keys(e).forEach(function(o){o===n&&void 0!==e[t]?r[o]=e[t]:o===t&&void 0!==e[n]?r[o]=e[n]:r[o]=Un(e[o],n,t)}),r}return e}function Vn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Hn(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Hn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function Hn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function zn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Gn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?zn(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var qn=function(e,n,t,r){var o,l,a,u,m,h=r.res,g=r.sres,y=be(e),b=(null==h?void 0:h.contentType)||"video",w=(null==h||null===(o=h[b])||void 0===o?void 0:o.drmEnabled)||!1,k=!(null==h||null===(l=h[b])||void 0===l||null===(a=l.streamingInfo)||void 0===a||!a.isLiveStream)||"linearchannel"===b,S=(null==h||null===(u=h[b])||void 0===u||null===(m=u.liveDetails)||void 0===m?void 0:m.isDvrEnabled)||!1;s(h),c.set(h),y&&(y.on("loadstart",function(){k?t.resolve({status:!0,msg:"Video Loaded",response:h}):t.resolve(Gn({status:!0,msg:"Player Initialised"},g?{seriesResponse:g,response:h}:{response:h}))}),y.on("loadeddata",function(){var t,r,o,l=fe(e);if(null==l||l.map(function(n){return pe(e,n.id)}),S&&"Safari"===Ee())try{var a;null==y||null===(a=y.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==y||!y.muted())&&qe(e,sessionStorage.getItem("volume")||"100");var u=i();if(d(n),v(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.saveOffline)){var s,c,f=Gn(Gn({},n),h);!function(e,n,t){var r,o,i;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(An=null==n||null===(o=n.series)||void 0===o?void 0:o.id),xn=[],Nn=0,Sn=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=be(e);a&&(a.on("dispose",Rn),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());xn.includes(Nn)||(e!=Nn||e<l?e>Nn&&(Nn=e+l):(xn.push(e),_n(a,n,l)))}}),a.one("ended",function(){_n(a,n,l,!0)}))}(e,f,null==u||null===(s=u.video)||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.id)}if(null!=n&&null!==(o=n.analytics)&&void 0!==o&&o.muxKey&&null!=y&&y.mux){var p,m,g,b,w,k,T=(null===(p=i())||void 0===p?void 0:p.video)||(null==h?void 0:h.video),E=null==T?void 0:T.gist,I={env_key:null==n||null===(m=n.analytics)||void 0===m?void 0:m.muxKey,player_name:"vl-web-player",player_version:null===(g=window)||void 0===g?void 0:g.vl_player_version,video_id:null==E?void 0:E.id,video_title:null==E?void 0:E.title,video_series:null==T||null===(b=T.series)||void 0===b?void 0:b.title,video_stream_type:null!=T&&null!==(w=T.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==n||null===(k=n.analytics)||void 0===k?void 0:k.userId};y.mux({debug:!1,data:I})}}),y.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];y.trigger("subtitlechanged",n)}),y.on("subtitlechanged",function(e,n){var t,r,o,i,l,a,u,s,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(i=o.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(c=s.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===f){var m,h=p.getMediaSession(),g=h.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),h.editTracksInfo(m)}}),y.tech_.on("retryplaylist",function(){k&&Fn(h,e)}),y.on("error",function(){var n,r;(console.log("ERROR",y.error(),y.error().code),4===y.error().code&&k)?Fn(h,e):(f(e,(null==y||null===(n=y.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==y||null===(r=y.error())||void 0===r?void 0:r.message)||"Some error occured",response:h}))}),y.one("play",function(){var e,t,r,o,l;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(r=t.appcmsMain)||void 0===r||null===(o=r.adsConfig)||void 0===o||!o.vodAdClientSideTracking){if(null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable){var a,u,s,c=null===(a=i())||void 0===a||null===(u=a.video)||void 0===u||null===(s=u.gist)||void 0===s?void 0:s.id,d=p(),v=(null==d?void 0:d.get(c))||{t:0,p:0},f=v.t,m=v.p;f&&m<95&&setTimeout(function(){y.currentTime(f)},0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout(function(){y.currentTime(null==n?void 0:n.watchHistoryResumeTime)},0);if(null!=y&&y.dvrSeekbar)try{y.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),y.on("volumechange",function(){var e=100*y.volume().toFixed(2);y.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),y.on("chromecastDisconnected",function(){if(k){y.currentSource();for(var e=y.textTracks(),n=e.length-1;n>=0;n--)y.removeRemoteTextTrack(e[n])}}),y.one("loadeddata",function(){var e,n=(null==y||null===(e=y.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),r=(n.language||n.label||"").toUpperCase();return t<r?-1:t>r?1:0}),"object"==Oe(y.dash)){var t,r,o,i=null==y||null===(t=y.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),l=null==i?void 0:i.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=Vn(n);try{for(a.s();!(o=a.n()).done;){var u=o.value;if(l&&(null==u?void 0:u.id)=="dash-audio-".concat(l.index)){u.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var s,c=Vn(n);try{for(c.s();!(s=c.n()).done;){var d,v,f,p=s.value;if(("Chrome"==Ee()||"Edge"==Ee()&&(null!==(d=navigator)&&void 0!==d&&null!==(v=d.userAgent)&&void 0!==v&&v.includes("Macintosh")||!w))&&null!=p&&null!==(f=p.label)&&void 0!==f&&f.includes("5.1"))y.audioTracks().removeTrack(p);else{if("main"==p.kind){p.enabled=!0;break}p.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}}))};function Kn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Yn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kn(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Wn=function(e,n,t,r){var o,i,l,s,c,d,v,p,S,T,E,I,C,O,j,D,P,x,N,A,R,_,M,L,B,F,U,V,H,z,G,q,K,Y,W,$,ee,ne,te,re=n.res,oe=void 0===re?null:re,ie=n.sres,le=void 0===ie?null:ie,ae=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],ue=(null===(o=oe)||void 0===o?void 0:o.contentType)||"video",se=we(null===(i=oe)||void 0===i||null===(l=i[ue])||void 0===l||null===(s=l.gist)||void 0===s?void 0:s.videoImageUrl)||we(null===(c=oe)||void 0===c||null===(d=c[ue])||void 0===d||null===(v=d.gist)||void 0===v||null===(p=v.imageGist)||void 0===p?void 0:p.r16x9),ce=(null===(S=oe)||void 0===S||null===(T=S[ue])||void 0===T||null===(E=T.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,de=!(null===(I=oe)||void 0===I||null===(C=I[ue])||void 0===C||null===(O=C.streamingInfo)||void 0===O||!O.isLiveStream)||"linearchannel"===ue,ve=(null===(j=oe)||void 0===j||null===(D=j.ads)||void 0===D||null===(P=D.preRoll)||void 0===P||null===(x=P.adTags)||void 0===x||null===(N=x.web)||void 0===N?void 0:N.active)&&(null===(A=oe)||void 0===A||null===(R=A.ads)||void 0===R||null===(_=R.preRoll)||void 0===_||null===(M=_.adTags)||void 0===M||null===(L=M.web)||void 0===L?void 0:L.url);oe=Yn(Yn({},oe),{},{audioAssetSource:null==t?void 0:t.audioAssetSource});var fe=(null==t||null===(B=t.customData)||void 0===B?void 0:B.ads)||{},pe=(null===(F=oe)||void 0===F||null===(U=F[ue])||void 0===U?void 0:U.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==fe?void 0:fe.vodAdSticherProvider)||!1,he=!(null===(V=oe)||void 0===V||null===(H=V[ue])||void 0===H||!H.isSSAIEnabled)&&"TRANSMIT"==(null==fe?void 0:fe.liveAdSticherProvider)&&!(null==fe||!fe.liveAdClientSideTracking),ge=(null==t?void 0:t.latency)||6,ye=(null==t?void 0:t.skin_settings)||{},ke=(ne={enableSmoothSeeking:!0,controls:0!=(null==t?void 0:t.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==t?void 0:t.muted)||!1,autoplay:(null==t?void 0:t.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==ye?void 0:ye.pictureInPictureToggle)||!1},playbackRates:null!=ye&&ye.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==t.skin,liveui:ce},J(ne,"autoplay",null==t?void 0:t.autoplay),J(ne,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!ve),J(ne,"loop",(null==t?void 0:t.loop)||!1),J(ne,"audioPosterMode",null==t?void 0:t.audioPosterMode),J(ne,"html5",Yn(Yn({dash:Yn(Yn(Yn({},!Z.browser.IS_SAFARI&&{useTTML:!0}),(null==t?void 0:t.debugConfig)&&(null==t||null===(z=t.debugConfig)||void 0===z?void 0:z.enable)&&{debug:!0,logLevel:null!=t&&null!==(G=t.debugConfig)&&void 0!==G&&G.logLevel?null==t||null===(q=t.debugConfig)||void 0===q?void 0:q.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ge},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:Yn({},"IE"==Ee()&&{enableStallFix:!0,stallSeek:1}),abr:Yn(Yn(Yn(Yn({},(null==t?void 0:t.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==t?void 0:t.initialBandwidth)/1e3}}),(null==t?void 0:t.maxBitrate)&&{maxBitrate:{audio:-1,video:(null==t?void 0:t.maxBitrate)/1e3}}),(null==t?void 0:t.minBitrate)&&{minBitrate:{audio:-1,video:(null==t?void 0:t.minBitrate)/1e3}}),{},{rules:{throughputRule:{active:!0},bolaRule:{active:!1},insufficientBufferRule:{active:!1},switchHistoryRule:{active:!1},droppedFramesRule:{active:!1},abandonRequestsRule:{active:!1}},autoSwitchBitrate:{video:!0,audio:!0}})}}}),vhs:Yn(Yn(Yn({},(null==t?void 0:t.initialBandwidth)&&{bandwidth:t.initialBandwidth}),{},{liveRangeSafeTimeDelta:ge,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==t||!t.initialBandwidth},(null==t||null===(K=t.customData)||void 0===K?void 0:K.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(Y=null==t?void 0:t.enableLowInitialPlaylist)&&void 0!==Y&&Y}),debug:(null==t?void 0:t.debugConfig)&&(null==t||null===(W=t.debugConfig)||void 0===W?void 0:W.enable)||!1,nativeTextTracks:"Safari"==Ee()},0==(null==t||null===($=t.customData)||void 0===$?void 0:$.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===(ee=t.customData)||void 0===ee?void 0:ee.nativeVideoTracks)&&{nativeVideoTracks:!1})),J(ne,"poster",se),J(ne,"techOrder",ae),J(ne,"chromecast",{requestCustomDataFn:function(n){var r,o,i=be(e),l=((null==i?void 0:i.textTracksJson_)||i.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),a=function(e,n,t){var r,o,i,l,a,u,s,c,d,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,h,g,y,b,w,k,S;p.isDrmEnabled=!0;var T=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,E=(null==T?void 0:T.url)||(null==n||null===(h=n.keySystemOptions)||void 0===h||null===(g=h[0])||void 0===g||null===(y=g.options)||void 0===y?void 0:y.serverURL);p.licenseUrl=E;var I=(null==T?void 0:T.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);p.licenseToken=I}var C=(null==e||null===(r=e[f])||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.contentType)||"VIDEO";p.contentType=C;var O=null==e||null===(i=e[f])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;p.duration=O;var j=null==e||null===(a=e[f])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;p.mediaTitle=j;var D=null==e||null===(s=e[f])||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=D,p.subTitles=t,p.DVR=(null==e||null===(d=e[f])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(oe,n,l);return Yn(Yn({},a),{},{transmitTrackingUrl:m.get()||null,convivaMetaData:Yn({customerKey:(null==t||null===(r=t.convivaConfig)||void 0===r?void 0:r.customerKey)||null,debug:(null==t||null===(o=t.convivaConfig)||void 0===o?void 0:o.debug)||!1},On.getData())})},modifyLoadRequestFn:function(n){var t,r,o,i,l,a=be(e),u=(null==a?void 0:a.currentSource())||{};!(null===(t=oe)||void 0===t||null===(r=t[ue])||void 0===r||null===(o=r.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(l=u.src)&&void 0!==l&&l.includes(".m3u8")&&(n.media.hlsSegmentFormat="fmp4",n.media.hlsVideoSegmentFormat="fmp4");return n}}),ne);if(!Z.getPlayers()[e]){null!=t&&t.debugConfig&&null!=t&&null!==(te=t.debugConfig)&&void 0!==te&&te.enable&&Z.log.level("debug");var Se=Z(e,ke,function(){var n=X(Q.mark(function n(){var o,i,l,s,c,d,v,p,m,S,T,E,I,C,O,j,D,P,x,N;return Q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(Se),console.log(Z.VERSION),console.log(Z.getPlugins()),n.next=5,an(t,oe);case 5:if(E=null===(o=oe)||void 0===o||null===(i=o[ue])||void 0===i||null===(l=i.liveDetails)||void 0===l?void 0:l.startOverTime,de&&r.resolve(Yn({status:!0,msg:"Player Initialised"},le?{seriesResponse:le,response:oe}:{response:oe})),y(e,{analyticsCb:null==t?void 0:t.analyticsCb,analyticsEventParams:null==t?void 0:t.analyticsEventParams,userId:null==t?void 0:t.userId}),Cn(e,t),/Android/i.test(navigator.userAgent)&&(Z.options.vhs.overrideNative=!0),ce&&We(e,E),!ve||null!=t&&null!==(s=t.customData)&&void 0!==s&&s.disableAds||b(e,ve,oe),I=a(oe,e),console.log(I),null!=t&&t.nearestClusterUrl&&(I=w(I,t.nearestClusterUrl)),!pe){n.next=21;break}return n.next=18,k(e,oe);case 18:I=n.sent,n.next=25;break;case 21:if(!he){n.next=25;break}return n.next=24,g(I,oe,e);case 24:I=n.sent;case 25:I?u(e,I):(r.reject({status:!1,msg:"Incompatible / Missing Source",response:oe}),f(e,"Incompatible / Missing Source")),((null===(c=oe)||void 0===c||null===(d=c[ue])||void 0===d||null===(v=d.contentDetails)||void 0===v||null===(p=v.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(m=oe)||void 0===m||null===(S=m[ue])||void 0===S||null===(T=S.closedCaptions)||void 0===T?void 0:T.length)>0)&&(N=(null===(O=oe)||void 0===O||null===(j=O[ue])||void 0===j||null===(D=j.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(P=oe)||void 0===P||null===(x=P[ue])||void 0===x?void 0:x.closedCaptions),C=N.filter(function(e){return"VTT"===e.format}),me(e,C)),null!=t&&t.disableControls?h(e):jn(e,Yn(Yn(Yn({},t),ke),{},{liveVideo:de,isDvrEnabled:ce,res:oe,sres:le})),qn(e,Yn(Yn(Yn({},t),ke),{},{liveVideo:de}),r,{res:oe,sres:le});case 29:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function $n(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Jn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?$n(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$n(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Xn,Qn=function(e,n){var t=n.resolve,r=n.reject,o=null==e?void 0:e.playerId,i=Zn(e);Wn(o,{res:i},e,{resolve:t,reject:r})},Zn=function(e){var n,t,r,o,i,l,a,u,s,c,d,v,f,p=null==e?void 0:e.streamingInfo,m=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,h=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,g=(null==e||null===(r=e.streamingInfo)||void 0===r||null===(o=r.ads)||void 0===o?void 0:o.url)||null,y=(null==e||null===(i=e.streamingInfo)||void 0===i?void 0:i.posterUrl)||null,b=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.subtitles)||[],w=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(u=a.videoAssets)||void 0===u?void 0:u.drmProvider)||null,k=(null==e||null===(s=e.streamingInfo)||void 0===s?void 0:s.macroMap)||[],T=(null==e||null===(c=e.customData)||void 0===c||null===(d=c.ads)||void 0===d?void 0:d.isSSAIEnabled)||!1,E=null==e?void 0:e.token,I=S(E);null==I||I.site;var C=null==I?void 0:I.siteId,O=(null==e||null===(v=e.customData)||void 0===v||null===(f=v.comscore)||void 0===f?void 0:f.video)||null,j=Jn(Jn({id:"".concat(C,"_external")},!h&&{directPlaybackUrl:null==m?void 0:m.url}),{},{video:Jn(Jn(Jn(Jn(Jn({drmEnabled:h,streamingInfo:Jn(Jn({videoAssets:Jn(Jn({},w&&{drmProvider:w}),{},{widevine:null==m?void 0:m.widevine,fairPlay:null==m?void 0:m.fairPlay,playReady:null==m?void 0:m.playReady})},(null==p?void 0:p.isDvrEnabled)&&{isLiveStream:!0}),(null==O?void 0:O.isLiveStream)&&{isLiveStream:null==O?void 0:O.isLiveStream})},T&&{isSSAIEnabled:T}),{},{metadata:k,liveDetails:{isDvrEnabled:null==p?void 0:p.isDvrEnabled},gist:Jn(Jn(Jn({},y&&{videoImageUrl:y}),(null==O?void 0:O.videoId)&&{id:null==O?void 0:O.videoId}),(null==O?void 0:O.videoTitle)&&{title:null==O?void 0:O.videoTitle}),contentDetails:Jn({},(null==b?void 0:b.length)>0&&{closedCaptions:je(b)})},(null==O?void 0:O.runtime)&&{runtime:null==O?void 0:O.runtime}),(null==O?void 0:O.publishDate)&&{publishDate:null==O?void 0:O.publishDate}),(null==O?void 0:O.platform)&&{platform:null==O?void 0:O.platform}),(null==O?void 0:O.series)&&{series:null==O?void 0:O.series}),ads:{preRoll:{adTags:{web:Jn(Jn({},g&&{active:!0}),g&&{url:g})}}}});return O&&(null!=O&&O.isDvrEnabled&&(j.video.liveDetails=Jn(Jn({},j.video.liveDetails),{},{isDvrEnabled:null==O?void 0:O.isDvrEnabled})),null!=O&&O.metadata&&(j.video.metadata=[].concat(je(j.video.metadata),je(null==O?void 0:O.metadata)))),j},et=null,nt=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),r=function(e,n){var t;return t=12*(n.getFullYear()-e.getFullYear()),t-=e.getMonth(),(t+=n.getMonth())<=0?0:t}(new Date,new Date(n)),o=r>0&&t>4?r:0,i=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),r=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(r-=1),r<0&&(t-=1),t}(new Date,new Date(n));return[i>0&&o>0?i:0,o,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},tt=function(e){var n,t=De(e,8),r=t[0],o=t[1],i=t[2],l=t[3],a=t[4],u=t[5],s=t[6],c=t[7];n=r>=1?" ".concat(r," Year"):o>=1?" ".concat(o," month"):i>=1?" ".concat(i," week"):l>=1?" ".concat(l," day"):a<24&&a>=12?" ".concat(a," hour"):a>0?"".concat(a," hours ").concat(u," minutes ").concat(s," seconds"):u>0?"".concat(u," minutes ").concat(s," seconds"):"".concat(s," seconds"),c.textContent="".concat(n)},rt=(Xn={scheduleStartTimeMs:0,scheduleEndTimeMs:0},{get:function(){return Xn},set:function(e){Xn={scheduleStartTimeMs:null==e?void 0:e.startDateTime,scheduleEndTimeMs:null==e?void 0:e.endDateTime}}});function ot(e,n,t,r){if(e){var o=function(){var e,o,l=null===(e=rt.get())||void 0===e?void 0:e.scheduleStartTimeMs,a=null===(o=rt.get())||void 0===o?void 0:o.scheduleEndTimeMs,u=Date.now();if(u-a>0){var s=document.getElementsByClassName("error-message")[0];return s&&(s.textContent=Ie("eventEnded")||"Game has ended",r.textContent=""),clearInterval(i),void(null==t||t())}var c=l-u;if(c/1e3<=0)return clearInterval(i),null==n||n([0,0,0,0,0,0,0,r]),void(null==t||t());var d=nt(c,l);null==n||n([].concat(je(d),[r]))};o();var i=setInterval(o,1e3);return i}}var it=function(e,n,t){var r,o,i,l,a,u,s,c,d=null==n||null===(r=n.response)||void 0===r||null===(o=r.data)||void 0===o?void 0:o.errorCode,v=(null==n||null===(i=n.response)||void 0===i||null===(l=i.data)||void 0===l?void 0:l.errorMessage)||(null==n?void 0:n.message)||null;rt.set({startDateTime:null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,endDateTime:null==n||null===(s=n.response)||void 0===s||null===(c=s.data)||void 0===c?void 0:c.scheduleEndDate}),function(e,n,t,r){var o,i,l=Date.now(),a=null===(o=rt.get())||void 0===o?void 0:o.scheduleStartTimeMs,u=null===(i=rt.get())||void 0===i?void 0:i.scheduleEndTimeMs,s=function(e,n,t,r){var o;e<0?o=Ie("eventNotStarted")||r||"Game starts in":(n>0||"VIDEO_NOT_EXISTS"==t)&&(o=Ie("eventEnded")||r||"Game has ended");return o||r}(l-a,l-u,n,t);if(document.getElementsByClassName("error-container")[0]){var c=document.getElementsByClassName("error-message")[0];c&&(c.textContent="".concat(s));var d=document.getElementsByClassName("error-timer-message")[0];d&&ot(Math.abs(a),tt,r,d)}else{var v=document.getElementById(e).parentElement;if(v){var f=document.createElement("div");f.className="error-container";var p=document.createElement("div");p.className="error-message";var m=document.createElement("div");m.className="error-timer-message",p.textContent="".concat(s),f.appendChild(p),f.appendChild(m),v.append(f),ot(Math.abs(a),tt,r,m)}}}(e,d,v,t)};function lt(e,n){var t=n.scheduleEndDate,r=n.scheduleStartDate;rt.set({startDateTime:r,endDateTime:t}),et&&clearInterval(et),et=setInterval(function(){var n,t=Date.now(),r=null===(n=rt.get())||void 0===n?void 0:n.scheduleEndTimeMs;if(console.log("scheduleEndTimeMs",r),r&&t>r){var o;console.log("Game ended");var i=be(e);if(T(e)&&i){var l;i.dispose(),console.log("Player disposed");var a=null===(l=document.getElementsByClassName("vl-container"))||void 0===l?void 0:l[0],u=document.createElement("video");u.id=e,u.className="video-js",u.style.width="100%",u.style.height="100%",a&&a.appendChild(u)}var s=Ie("eventEnded")||"Game has ended",c=null===(o=document.getElementsByClassName("error-container"))||void 0===o?void 0:o[0];if(c){var d=c.querySelector(".error-message");d&&(d.textContent=s)}else{var v=document.getElementById(e),f=null==v?void 0:v.parentElement;if(f){(c=document.createElement("div")).className="error-container";var p=document.createElement("div");p.className="error-message",p.textContent=s,c.appendChild(p),f.append(c)}}clearInterval(et)}},1e3)}function at(e,n){return ut.apply(this,arguments)}function ut(){return(ut=X(Q.mark(function e(n,t){var r,o,i,l,a,u,c,d,v;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,a=null==n?void 0:n.videoId,u=null==n?void 0:n.playerId,c=!(null==n||!n.anonymousId),e.next=6,O();case 6:d=e.sent,v=!1===(null==n||null===(r=n.customData)||void 0===r||null===(o=r.ads)||void 0===o?void 0:o.isSSAIEnabled),E(a,d,v).then(function(e){var t,r,o,v,f,p,m,h,g,y;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(r=t.video)||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.contentType,s(null==e?void 0:e.data);var b=null==e||null===(v=e.data)||void 0===v||null===(f=v.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.scheduleEndDate,w=null==e||null===(m=e.data)||void 0===m||null===(h=m.video)||void 0===h||null===(g=h.gist)||void 0===g?void 0:g.scheduleStartDate;lt(u,{scheduleEndDate:b,scheduleStartDate:w});var k,S=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(y=n.watchHistory)&&void 0!==y&&y.enable&&!c)if((null===(k=n.watchHistory)||void 0===k?void 0:k.saveOffline)||!1){var T,E,C,O=Ln((null===(T=n.watchHistory)||void 0===T?void 0:T.profileId)||"",a,null==n?void 0:n.siteOwner);if(O&&O.length)n.watchHistoryResumeTime=(null===(E=O[0])||void 0===E?void 0:E.watchedTime)||null,n.watchedPercentage=(null===(C=O[0])||void 0===C?void 0:C.watchedPercentage)||null;S.contentType="video",Wn(u,{res:S},n,{resolve:i,reject:l})}else I(a,d).then(function(e){var t,r,o,i,l,a;null!==(t=window)&&void 0!==t&&null!==(r=t.watchHistory)&&void 0!==r&&r.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,S.contentType="video"}).catch(function(e){var n,t,r,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(o=r.watchHistory)||void 0===o||o.cb(e))}).finally(function(){Wn(u,{res:S},n,{resolve:i,reject:l})});else Wn(u,{res:S},n,{resolve:i,reject:l})}).catch(function(e){var t,r,o=(null==n||null===(t=n.event)||void 0===t?void 0:t.showScheduleTimer)||!1,i=(null==n||null===(r=n.event)||void 0===r?void 0:r.onCountdownComplete)||null;o&&it(u,e,i),C(e,u,l,a)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function st(e,n){return ct.apply(this,arguments)}function ct(){return(ct=X(Q.mark(function e(n,t){var r,o,i,l,a,u,s,c;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,e.next=3,O();case 3:a=e.sent,u=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,c=!1===(null==n||null===(r=n.customData)||void 0===r||null===(o=r.ads)||void 0===o?void 0:o.isSSAIEnabled),j(s,a,c).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,Wn(u,{res:t},n,{resolve:i,reject:l})}).catch(function(e){C(e,u,l,videoId)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function dt(e,n){return vt.apply(this,arguments)}function vt(){return(vt=X(Q.mark(function e(n,t){var r,o,i,l,a,u,c;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,e.next=3,O();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,x.set(parseInt(u)),c=null==n||null===(r=n.series)||void 0===r?void 0:r.id,D(c,l).then(function(e){var t,r,u,d=e.data,v=e.data.seasons;N(v);var f=videoId||(null==v||null===(t=v[0])||void 0===t||null===(r=t.episodes)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.id);P(c,l),E(f,l).then(function(e){var t,r,l;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(r=t.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,s(e.data),Wn(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:o,reject:i})}).catch(function(e){C(e,a,i,videoId)})}).catch(function(e){C(e,a,i)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}var ft,pt=(ft=new Map,{set:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=Array.isArray(n)?n:[];return ft.set(e,t),t},get:function(e){return ft.get(e)||[]},remove:function(e){ft.delete(e)}});function mt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function ht(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return gt(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gt(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function gt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var yt=function(e){var n=Date.parse(null==e?void 0:e.eventStartUtc),t=Number.isFinite(n)?n/1e3:0;return{start:t+(Number(null==e?void 0:e.startTime)||0),end:t+(Number(null==e?void 0:e.endTime)||0)}},bt=function(e){var n;try{var t,r,o=null==e||null===(t=e.liveTracker)||void 0===t||null===(r=t.seekableEnd)||void 0===r?void 0:r.call(t);if(Number.isFinite(o))return o}catch(e){}var i=null==e||null===(n=e.seekable)||void 0===n?void 0:n.call(e);return i&&i.length?i.end(i.length-1):NaN};function wt(e){var n=null,t=null,r="none",o=function(o){var i=be(e);if(!i)return null;if("pdt"===r&&null!=n)return t+(o-n);var l=bt(i);return Number.isFinite(l)?l-(Date.now()/1e3-o):null},i=function(){var n=be(e),t=n&&n.seekable();return t&&t.length?{start:t.start(0),end:t.end(t.length-1)}:{start:0,end:0}};return{refreshAnchor:function(){var o=be(e);if(o){var i=function(e){try{var n=e.tech(!0),t=n&&n.vhs,r=t&&t.playlists,o=r&&"function"==typeof r.media&&r.media();return o&&o.segments||null}catch(e){return null}}(o),l=o.currentTime()||0;if(i&&i.length){var a,u=null,s=1/0,c=ht(i);try{for(c.s();!(a=c.n()).done;){var d=a.value;if(d&&"number"==typeof d.programDateTime&&"number"==typeof d.start&&Number.isFinite(d.start)){var v=Math.abs(d.start-l);v<s&&(s=v,u=d)}}}catch(e){c.e(e)}finally{c.f()}if(u)return n=u.programDateTime/1e3,t=u.start,void(r="pdt")}n=null,t=null,r="now"}},anchorInfo:function(){return function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?mt(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mt(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}({anchorPdtSec:n,anchorPlayerT:t,source:r},i())},chapterToPlayerTime:function(e){return o(yt(e).start)},chapterStartPercent:function(e){return function(e){var n=i(),t=n.start,r=n.end;if(!(r>t))return null;var l=o(e);return null==l||l<t||l>r?null:(l-t)/(r-t)*100}(yt(e).start)},playerTimeToChapterIndex:function(o,i){var l=function(o){var i=be(e);if(!i)return null;if("pdt"===r&&null!=n)return n+(o-t);var l=bt(i);return Number.isFinite(l)?Date.now()/1e3-(l-o):null}(o);if(null==l)return-1;for(var a=-1,u=0;u<i.length;u++){var s=yt(i[u]),c=s.start,d=s.end,v=Math.max(d,c+.001);l>=c&&l<v&&(a=u)}return a},windowBounds:i}}function kt(e){return"livedvr"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).timeMode?wt(e):function(e){var n=function(e){return Number(null==e?void 0:e.startTime)||0},t=function(e){var t=Number(null==e?void 0:e.endTime);return Number.isFinite(t)?t:n(e)};return{chapterToPlayerTime:function(e){return n(e)},chapterStartPercent:function(t){var r=be(e),o=r&&r.duration();if(!Number.isFinite(o)||o<=0)return null;var i,l=n(t);return l<0||l>o?null:100*((i=l/o)<0?0:i>1?1:i)},playerTimeToChapterIndex:function(e,r){for(var o=-1,i=0;i<r.length;i++){var l=n(r[i]),a=Math.max(t(r[i]),l+.001);e>=l&&e<a&&(o=i)}return o},windowBounds:function(){var n=be(e),t=n&&n.duration();return{start:0,end:Number.isFinite(t)?t:0}},refreshAnchor:function(){},anchorInfo:function(){return{source:"vod"}}}}(e)}var St="chapter-change",Tt="chapter-click",Et="chapters-updated";function It(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=be(e);r?r.trigger(n,t):console.error("[CHAPTERS] Player instance not found")}function Ct(e){var n=be(e);if(!n)return console.error("[CHAPTERS] Player instance not found"),{};var t=function(e,t){var r=function(e,n){return t(n)};return n.on(e,r),function(){return n.off(e,r)}};return{onChapterChange:function(e){return t(St,e)},onChapterClick:function(e){return t(Tt,e)},onChaptersUpdated:function(e){return t(Et,e)}}}var Ot="vjs-chapter-marker",jt="vjs-chapter-preview",Dt=function(e){try{var n,t,r;return(null==e||null===(n=e.controlBar)||void 0===n||null===(t=n.progressControl)||void 0===t||null===(r=t.seekBar)||void 0===r?void 0:r.el())||null}catch(e){return null}};function Pt(e,n){var t=n.store,r=n.mapper,o=n.chaptersConfig,i=void 0===o?{}:o,l=n.seek,a=be(e);if(!a)return{render:function(){},reposition:function(){},destroy:function(){}};var u=new Map,s=null,c=-1,d=function(){return!0===(null==i?void 0:i.enable)},v=function(n,t){var o=be(e),i=Dt(o);if(i){var l=function(e){if(s&&s.isConnected)return s;(s=document.createElement("div")).className=jt;var n=document.createElement("div");n.className="vjs-chapter-preview__time";var t=document.createElement("div");t.className="vjs-chapter-preview__label",s.appendChild(n),s.appendChild(t);var r=document.createElement("span");return r.className="vjs-chapter-preview__pointer",s.appendChild(r),s._time=n,s._label=t,e.appendChild(s),s}(i);l._time.textContent=function(e){try{var n=r.chapterToPlayerTime(e);if(null==n||!Number.isFinite(n))return"";if("vod"===("function"==typeof r.anchorInfo?r.anchorInfo():{}).source)return Z.formatTime(n,n);var t=(r.windowBounds()||{}).end;if(!Number.isFinite(t))return"";var o=Math.max(0,t-n);return"-".concat(Z.formatTime(o,o))}catch(e){return""}}(n),l._label.textContent=(null==n?void 0:n.label)||"",l.style.left="".concat(t,"%"),l.classList.add("vjs-chapter-preview--visible")}},f=function(){s&&s.classList.remove("vjs-chapter-preview--visible")},p=function(n){var t=document.createElement("div");t.className=Ot,t.dataset.segmentId=String(n.segmentId);var o=function(e){var n=null!=e&&e.icon?String(e.icon).trim():"";if(!n)return null;var t=document.createElement("span");if(t.className="vjs-chapter-marker__icon","<"===n.charAt(0)){var r=Se(n);r&&t.appendChild(r)}else{var o=document.createElement("img");o.src=n,o.alt="",t.appendChild(o)}return t}(n);return o&&t.appendChild(o),t.addEventListener("click",function(t){t.stopPropagation(),"function"==typeof l&&l(n.segmentId),It(e,Tt,{chapter:n})}),t.addEventListener("mouseenter",function(){var e=r.chapterStartPercent(n);null!=e&&v(n,e)}),t.addEventListener("mouseleave",f),t},m=function(){d()&&0!==u.size&&(r.refreshAnchor(),t.get(e).forEach(function(e){var n=u.get(String(e.segmentId));if(n){var t=r.chapterStartPercent(e);null==t?n.style.display="none":(n.style.display="",n.style.left="".concat(t,"%"))}}))},h=function(){var n=be(e);if(n){var o=t.get(e),i=r.playerTimeToChapterIndex(n.currentTime()||0,o);if(i!==c){c=i,u.forEach(function(e){return e.classList.remove("".concat(Ot,"--active"))});var l=i>=0?o[i]:null;if(l){var a=u.get(String(l.segmentId));a&&a.classList.add("".concat(Ot,"--active"))}It(e,St,{chapter:l})}}},g=ke(function(){m(),h()},1e3),y=function(){m(),h()};a.on("timeupdate",g),a.on("seeked",y);var b=!1;try{a.liveTracker&&"function"==typeof a.liveTracker.on&&(a.liveTracker.on("liveedgechange",m),b=!0)}catch(e){}var w=null;(function(){try{return"function"==typeof r.anchorInfo&&"vod"!==r.anchorInfo().source}catch(e){return!1}})()&&(w=setInterval(m,500));return{render:function(){var n=be(e),o=Dt(n);o&&(o.querySelectorAll(".".concat(Ot)).forEach(function(e){return e.remove()}),u.clear(),c=-1,d()&&(r.refreshAnchor(),t.get(e).forEach(function(e){var n=p(e);o.appendChild(n),u.set(String(e.segmentId),n)}),m()))},reposition:m,destroy:function(){try{a.off("timeupdate",g),a.off("seeked",y),b&&a.liveTracker.off("liveedgechange",m)}catch(e){}w&&(clearInterval(w),w=null);var n=Dt(be(e));n&&n.querySelectorAll(".".concat(Ot,", .").concat(jt)).forEach(function(e){return e.remove()}),u.clear(),s=null}}}var xt=new Map,Nt=function(e){try{var n,t,r;return!(null==e||null===(n=e.controlBar)||void 0===n||null===(t=n.progressControl)||void 0===t||null===(r=t.seekBar)||void 0===r||!r.el())}catch(e){return!1}},At=function(e){var n=xt.get(e);if(n)return n;n={mapper:kt(e,{timeMode:"vod"}),markers:null,chaptersConfig:{},timeMode:"vod"},xt.set(e,n);var t=be(e);return t&&t.on("dispose",function(){return Ut(e)}),n},Rt=function(e){var n=xt.get(e),t=function(e){var n=xt.get(e);if(!n||n.markers)return(null==n?void 0:n.markers)||null;var t=be(e);return t&&Nt(t)?(n.markers=Pt(e,{store:pt,mapper:n.mapper,chaptersConfig:n.chaptersConfig,seek:function(n){return Ft(e,n)}}),n.markers):null}(e);t&&n&&t.render()};function _t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.chapters,r=void 0===t?[]:t,o=n.timeMode,i=void 0===o?"vod":o;n.res;var l=n.chaptersConfig,a=void 0===l?{}:l,u=be(e);if(!u)return!1;Array.isArray(r)&&r.length&&pt.set(e,r);var s={mapper:kt(e,{timeMode:i}),markers:null,chaptersConfig:a||{},timeMode:i,disposed:!1};xt.set(e,s);var c=function(){s.disposed||Rt(e)};return u.one("loadeddata",c),Nt(u)&&c(),u.on("dispose",function(){return Ut(e)}),!0}function Mt(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return At(e),pt.set(e,n),Rt(e),It(e,Et,{chapters:pt.get(e)}),!0}function Lt(e){return pt.get(e)}function Bt(e){pt.set(e,[]);var n=xt.get(e);return null!=n&&n.markers&&n.markers.render(),It(e,Et,{chapters:[]}),!0}function Ft(e,n){var t=be(e),r=At(e);if(!t)return!1;var o=pt.get(e).find(function(e){return e.segmentId===n});if(!o)return!1;r.mapper.refreshAnchor();var i=r.mapper.chapterToPlayerTime(o);if(null==i||!Number.isFinite(i))return!1;var l=r.mapper.windowBounds(),a=l.start,u=l.end;return Number.isFinite(a)&&Number.isFinite(u)&&u>a&&(i=Math.min(Math.max(i,a),u-.1)),t.currentTime(i),!0}function Ut(e){var n=xt.get(e);n&&(n.disposed=!0,n.markers&&n.markers.destroy()),xt.delete(e),pt.remove(e)}var Vt,Ht=function(e){var n=e.enable,t=e.site,r=e.sseBaseUrl,o=e.sseEndpoint,l=e.debug;if(n){var a=function(e){var n=e.site,t=e.sseBaseUrl,r=e.sseEndpoint,o=e.debug,l=void 0!==o&&o;return Pe({site:n,sseBaseUrl:t,getToken:O,sseEndpoint:r,onOpen:function(e){var n=e.userId,t=e.endpoint;l&&console.log("SSE Connected:",n,t)},onMessage:function(e){var n,t,r,o,a,u,s,c,d,v;if(l&&console.log("SSE Message:",e),(null===(n=i())||void 0===n||null===(t=n.video)||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.id)===(null==e||null===(o=e.payload)||void 0===o?void 0:o.id)&&"GAME_STATE_CHANGE"===(null==e?void 0:e.notificationType)){var f=1e3*(null==e||null===(a=e.payload)||void 0===a||null===(u=a.states)||void 0===u||null===(s=u.live)||void 0===s?void 0:s.startDateTime),p=1e3*(null==e||null===(c=e.payload)||void 0===c||null===(d=c.states)||void 0===d||null===(v=d.end)||void 0===v?void 0:v.endDateTime);f&&p&&(console.log("Setting schedule timer",f,p),rt.set({startDateTime:f,endDateTime:p}))}},onReconnectAttempt:function(e){l&&console.log("Reconnect attempt:",e)},onHeartbeatTimeout:function(e){var n=e.elapsed;l&&console.warn("Heartbeat timeout after:",n)},onTokenInvalid:function(e){l&&console.error("Invalid token:",e),window.location.href="/login"},onError:function(e,n){l&&console.error("SSE Error:",e,n)},onClose:function(){l&&console.log("SSE Closed")}})}({site:t,sseBaseUrl:r,sseEndpoint:o,debug:void 0!==l&&l});return a._sseBaseUrl=r,a._site=t,a._sseEndpoint=o,a}};function zt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Gt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?zt(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zt(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function qt(){return{loadVideoInstantly:A,onTimeUpdate:le,getVideoDuration:ae,onVideoEnded:ue,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=X(Q.mark(function n(t,r){var o,i,l,a,u,s,c,d,v,f,p,m,h,g,y,b,w,k,S,I,O,j,D,P,x,N,A,R,_,M,L,B;return Q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!T(null==e?void 0:e.playerId)){n.next=3;break}return t({status:!0,msg:"Player already initialised",skipped:!0}),n.abrupt("return");case 3:if(S=(null==e?void 0:e.videoSourceUrl)||!1,I=null==e?void 0:e.asat,O=(null==e||null===(o=e.epg)||void 0===o?void 0:o.enable)||!1,j=null==e?void 0:e.videoId,D=(null==e||null===(i=e.series)||void 0===i?void 0:i.enable)||!1,P=(null==e?void 0:e.streamingInfo)||!1,window.videoId=j,x=null==e?void 0:e.token,!K(e)){n.next=18;break}if(sessionStorage.setItem("vlp_token",x),Y().set(null==e?void 0:e.refreshToken),x&&!W(x)){n.next=17;break}return r({status:!1,msg:"".concat(x?"Token is expired !":"Missing Authorization Token"),response:{token:x}}),n.abrupt("return");case 17:Vt=JSON.parse(atob(x.split(".")[1]));case 18:return window.siteName=null===(l=Vt)||void 0===l?void 0:l.site,window.siteId=null===(a=Vt)||void 0===a?void 0:a.siteId,e.isAnonymousUser=!(null===(u=Vt)||void 0===u||!u.anonymousId),e.siteOwner=(null===(s=Vt)||void 0===s?void 0:s.site)||null,e.userId=(null===(c=Vt)||void 0===c?void 0:c.userId)||null,z((null===(d=Vt)||void 0===d?void 0:d.userId)||(null===(v=Vt)||void 0===v?void 0:v.anonymousId)||null),window.watchHistory=e.watchHistory||null,N=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(f=e.series)&&void 0!==f&&f.enable?null:null==e?void 0:e.chromecastReceiverId,A=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,(R=null==e?void 0:e.errors)&&(window.customErrors=R),window.customData=null==e?void 0:e.customData,Ce(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),G.set(e.apiBaseUrl),null!=e&&e.skin&&!Te(e.skin)||(e.skin="VL_ONE"),q.setConfig(e),n.next=37,tn(e);case 37:A&&ze("https://www.googletagmanager.com/gtag/js?id=".concat(A)).then(function(){return $(A)}).catch(function(e){}),(_=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(N)))&&_.addEventListener("contextmenu",function(e){return e.preventDefault()}),(M=Ht({enable:null==e||null===(g=e.sse)||void 0===g?void 0:g.enable,site:null==e||null===(y=e.sse)||void 0===y?void 0:y.siteName,sseBaseUrl:null==e||null===(b=e.sse)||void 0===b?void 0:b.sseBaseUrl,sseEndpoint:null==e||null===(w=e.sse)||void 0===w?void 0:w.sseEndpoint,debug:null==e||null===(k=e.sse)||void 0===k?void 0:k.debug}))&&!M.isConnectionActive()&&M.connect(),S?(B={directPlaybackUrl:S,id:L="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},I?E(L,x).then(function(n){var o=(null==n?void 0:n.data)||{};Wn(N,{res:Gt(Gt({},o),B)},e,{resolve:t,reject:r})}).catch(function(e){C(e,N,r,L)}):Wn(N,{res:B},e,{resolve:t,reject:r})):P?Qn(e,{resolve:t,reject:r}):D?dt(e,{resolve:t,reject:r}):O?st(e,{resolve:t,reject:r}):at(e,{resolve:t,reject:r});case 43:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:ge,skip:R,getPlayer:be,play:_,pause:M,detectBrowser:Ee,rewind:L,loadVideo:u,seekToTimeStamp:se,isPlayerInitialised:T,load:B,authenticateLC:F,dispose:U,enableCaptions:he,disableCaptions:pe,getCaptions:fe,playSelectedResolution:ye,getSource:a,setVolume:qe,getVolume:Ke,disableControls:h,setPlaybackSpeed:ce,getEntitlementData:V,getSsaiEvents:H,playerEvents:de,onReplay:ve,setChapters:Mt,getChapters:Lt,clearChapters:Bt,seekToChapter:Ft,getChapterEvents:Ct}}export{qt as V,_t as i};
|
|
1
|
+
import"video.js/dist/video-js.min.css";import{c as e,g as n,a as t,b as r,d as o,e as i,s as l,f as a,l as u,h as s,v as c,i as d,j as v,k as f,m as p,t as m,n as h,o as g,p as y,q as b,r as w,u as k,w as S,x as T,y as E,z as I,A as C,B as O,C as j,D,E as x,F as P,G as A,H as N,I as R,J as M,K as _,L,M as B,N as F,O as U,P as V,Q as H,R as z,S as G,T as q,U as K,V as Y,W,X as $}from"./generic-c057edc5.js";import J from"@babel/runtime/helpers/defineProperty";import X from"@babel/runtime/helpers/asyncToGenerator";import Q from"@babel/runtime/regenerator";import Z from"video.js";import ee from"@babel/runtime/helpers/classCallCheck";import ne from"@babel/runtime/helpers/createClass";import te from"@babel/runtime/helpers/get";import re from"@babel/runtime/helpers/inherits";import oe from"@babel/runtime/helpers/possibleConstructorReturn";import ie from"@babel/runtime/helpers/getPrototypeOf";import{o as le,g as ae,a as ue,s as se,b as ce,p as de,c as ve}from"./util-371cec8c.js";import{g as fe,d as pe,a as me,e as he}from"./captions-a7cd63fa.js";import{g as ge}from"./renditions-225582e2.js";import{playSelectedResolution as ye}from"./resolution-0fbfb20a.js";import{g as be,i as we,t as ke,p as Se,a as Te}from"./skin-606a59c2.js";import{d as Ee}from"./browser-d4613b36.js";import{g as Ie,s as Ce}from"./localisation-0bf399a1.js";import Oe from"@babel/runtime/helpers/typeof";import"@viewlift/comscore/index.js";import je from"@babel/runtime/helpers/toConsumableArray";import De from"@babel/runtime/helpers/slicedToArray";import{createSSETransport as xe}from"@viewlift/sse";function Pe(e,n,t,r){var o=te(ie(1&r?e.prototype:e),n,t);return 2&r&&"function"==typeof o?function(e){return o.apply(t,e)}:o}function Ae(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ae=function(){return!!e})()}var Ne=Z.getComponent("TextTrackSettings"),Re=Z.dom,Me=[{value:"12",label:"12px"},{value:"14",label:"14px"},{value:"16",label:"16px"},{value:"18",label:"18px"},{value:"20",label:"20px"},{value:"24",label:"24px"},{value:"28",label:"28px"},{value:"32",label:"32px"}],_e=Me.map(function(e){return e.value}),Le="16",Be="vlp-caption-font-size-px",Fe="vlp-caption-font-size-style",Ue=".vjs-font-percent > select",Ve=function(e){return-1!==_e.indexOf(e)?e:Le},He=null;Ne?(He=function(){re(r,Ne);var e,n,t=(e=r,n=Ae(),function(){var t,r=ie(e);if(n){var o=ie(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return oe(this,t)});function r(e,n){var o;return ee(this,r),(o=t.call(this,e,n)).customUiReady_=!0,o.applyCustomFontSizeUI_(),o}return ne(r,[{key:"applyCustomFontSizeUI_",value:function(){this.replaceFontSizeOptions_(),this.bindFontSizeChange_(),this.restoreCustomFontSize_()}},{key:"replaceFontSizeOptions_",value:function(){var e=this.$(Ue);if(e){for(;e.firstChild;)e.removeChild(e.firstChild);Me.forEach(function(n){e.appendChild(Re.createEl("option",{value:n.value,textContent:n.label}))}),e.value=Le}}},{key:"bindFontSizeChange_",value:function(){var e=this,n=this.$(Ue);n&&this.on(n,"change",function(){return e.applyFontSize_(n.value)})}},{key:"applyFontSize_",value:function(e){var n=Ve(e);if("undefined"!=typeof document){var t=document.getElementById(Fe);t||((t=document.createElement("style")).id=Fe,document.head.appendChild(t)),t.textContent=[".vjs-text-track-cue,",".vjs-text-track-cue > div,",".vjs-text-track-display-ttml,",".vjs-text-track-display-ttml span,",".vjs-text-track-display-ttml div","{ font-size: ".concat(n,"px !important; line-height: normal !important; }")].join(" ")}}},{key:"restoreCustomFontSize_",value:function(){var e=null;try{e=window.localStorage.getItem(Be)}catch(e){}var n=Ve(e),t=this.$(Ue);t&&(t.value=n),this.applyFontSize_(n)}},{key:"getValues",value:function(){var e=Pe(r,"getValues",this,3)([]);return e&&delete e.fontPercent,e||{}}},{key:"setDefaults",value:function(){if(Pe(r,"setDefaults",this,3)([]),this.customUiReady_){var e=this.$(Ue);e&&(e.value=Le),this.applyFontSize_(Le)}}},{key:"saveSettings",value:function(){if(Pe(r,"saveSettings",this,3)([]),this.options_&&this.options_.persistTextTrackSettings){var e=this.$(Ue);if(e)try{window.localStorage.setItem(Be,Ve(e.value))}catch(e){}}}},{key:"handleLanguagechange",value:function(){Pe(r,"handleLanguagechange",this,3)([]),this.applyCustomFontSizeUI_()}}]),r}(),Z.registerComponent("TextTrackSettings",He)):console.warn("[vlp] CustomTextTrackSettings: video.js TextTrackSettings is not registered; skipping override.");var ze=function(e){return new Promise(function(n,t){if(Ge(e))t("".concat(e," is alread initialised"));else{var r=document.createElement("script");r.async=!0,r.src=e,r.onload=function(){n()},r.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(r)}})},Ge=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},qe=function(e,n,t){var r=be(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var o=parseFloat(n)/100;r.volume(o),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},Ke=function(e){var n=be(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Ye=function(){var e=X(Q.mark(function e(n){var t,r,o,i,l;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=be(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return i=e.sent,e.prev=5,e.next=8,ze("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,i.default(Z),e.finish(13);case 16:(l=Z.getTech("chromecast"))&&!l.prototype.seeking&&(l.prototype.seeking=function(){}),null!==(o=window)&&void 0!==o&&o.cast?null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.chromecastReceiverId&&null!=n&&n.airplay&&"Safari"==Ee()?null==r||r.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),We=function(e,n){var t=be(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,r,o,i,l,a=this.el(),u=Z.dom.getPointerPosition(a,n).x;Z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var s=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(i=o.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S;if(console.log(s),s&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*u,d.seek()}})};var $e=function(){var e=X(Q.mark(function e(){return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),ze("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Je=function(){var n=X(Q.mark(function n(){return Q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,import("@viewlift/comscore/index.js").then(function(n){e.set(n)});case 2:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}(),Xe=function(){var e=X(Q.mark(function e(){return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){Z.getPlugin("eme")||Z.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Qe=function(){var e=X(Q.mark(function e(){var n;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(Z),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),Ze=function(){var e=X(Q.mark(function e(){return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-5d92eaa3.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),en=function(){var e=X(Q.mark(function e(){return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-e31d9fb5.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),nn=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){ze("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(Z)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(Z)})},loadAdsLibrary:$e,loadEMELibrary:Xe,loadMuxPlugin:Qe,loadDvrSeekbar:Ze,loadContribDash:en,loadComscorePlugin:Je});function tn(e){return rn.apply(this,arguments)}function rn(){return(rn=X(Q.mark(function e(n){var t;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,$e();case 3:t&&"Safari"==Ee()&&Promise.resolve().then(function(){return nn}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function on(e){return ln.apply(this,arguments)}function ln(){return(ln=X(Q.mark(function e(n){var t,r,o,i,l,a,u,s,c,d;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d=be(n.playerId),e.next=3,Je();case 3:d.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(r=n.comscore)||void 0===r?void 0:r.endpoint,applicationName:(null==n||null===(o=n.comscore)||void 0===o?void 0:o.applicationName)||(null===(i=window)||void 0===i?void 0:i.siteName)||null,implementationId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.implementationId,projectId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.projectId,debug:(null==n||null===(u=n.comscore)||void 0===u?void 0:u.debug)||!1,persistentLabels:(null==n||null===(s=n.comscore)||void 0===s?void 0:s.persistentLabels)||{},metadata:(null==n||null===(c=n.comscore)||void 0===c?void 0:c.metadata)||{}});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function an(e,n){return un.apply(this,arguments)}function un(){return(un=X(Q.mark(function e(n,t){var r,o,i,l,a,u,s,c,d,v,f,p,m,h;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d=(null==t?void 0:t.contentType)||"video",v=null==t||null===(r=t[d])||void 0===r?void 0:r.drmEnabled,null==t||null===(o=t[d])||void 0===o||null===(i=o.liveDetails)||void 0===i||i.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==t||null===(l=t[d])||void 0===l||null===(a=l.streamingInfo)||void 0===a||null===(u=a.videoAssets)||void 0===u?void 0:u.dash)||null,p=(null==n||null===(s=n.comscore)||void 0===s?void 0:s.enable)||!1,m=!(null==n||null===(c=n.analytics)||void 0===c||!c.muxKey),e.prev=7,e.next=10,Promise.allSettled([v?"Safari"==Ee()?Xe():"caliente"!=(null===(h=window)||void 0===h?void 0:h.siteName)?en():Xe():"Safari"!=Ee()&&f?en():null,p?on(n):null,m?Qe():null,Ye(n)]);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),console.log("Error",e.t0);case 15:case"end":return e.stop()}},e,null,[[7,12]])}))).apply(this,arguments)}function sn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function cn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?sn(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):sn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var dn=new Set,vn=null,fn=function(e,t,o,i){var l,a,u,s,c,d,v,f={},p=(null==e?void 0:e.contentType)||"video";f["c3.cm.id"]=(null===(l=e[p])||void 0===l?void 0:l.id)||"Null",f["c3.cm.contentType"]=wn(e),f[null==o||null===(a=o.Constants)||void 0===a?void 0:a.IS_LIVE]=!(null==e||!e.linearchannel),f[null==o||null===(u=o.Constants)||void 0===u?void 0:u.STREAM_URL]=t.currentSrc(),f[null==o||null===(s=o.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===n()?"NULL":n(),f["c3.cm.categoryType"]=gn(e),f["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),f.DRMEnabled=(null===(c=e[p])||void 0===c?void 0:c.drmEnabled)||"None",f.DAIStream=null!==(d=e[p])&&void 0!==d&&null!==(v=d.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",f[o.Constants.DEFAULT_RESOURCE]="AKAMAI",f["c3.cm.brand"]="NULL",f.CDVREnabled=yn(e),f["c3.cm.genreList"]=mn(e),f["c3.cm.genre"]=pn(e),f["c3.cm.channel"]=hn(e,i);var m=Tn(r(),e);return f=cn(cn({},f),m)},pn=function(e){var n,t,r,o=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[o])||void 0===n||null===(t=n.gist)||void 0===t||null===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},mn=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},hn=function(e,n){var t,r,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null===(r=((null==e||null===(t=e[o])||void 0===t?void 0:t.channels)||[]).find(function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)}))||void 0===r?void 0:r.title)||"NULL"},gn=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},yn=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",o=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return o?"YES":"NO"},bn=function(e,n){var t,r,o=(n||{}).epg;if(o&&null!=o&&o.enable&&null!=o&&o.programTitle)return o.programTitle;var i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[i])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.title)||"Null";return"".concat(l)},wn=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var kn,Sn,Tn=function(e,n){var r,i,l,a,u,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return s;var c=o(),d=t();return s["c3.cm.seriesName"]=(null==n||null===(r=n.video)||void 0===r||null===(i=r.series)||void 0===i?void 0:i.title)||"Null",s["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",s["c3.cm.showTitle"]=(null==e||null===(l=e[c-1])||void 0===l||null===(a=l.episodes)||void 0===a||null===(u=a[d-1])||void 0===u?void 0:u.title)||"Null",s["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",s},En=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},In=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Cn=function(){var e=X(Q.mark(function e(n,t){var r,o,l,a,u,s,c,d,v,f,p,m;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(null==t?void 0:t.convivaConfig)||{},o=r.trackConvivaPlayerEvent,l=r.paymentHandler,a=r.tveProvider,u=r.enable,s=r.appName,d=(c=t||{}).token,v=c.epg,u){e.next=4;break}return e.abrupt("return");case 4:if(f=be(n),"function"==typeof(p=o)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,p("getConvivaObject");case 10:if(m=e.sent){e.next=13;break}return e.abrupt("return");case 13:f.ready(function(){var e=f.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=En(t.keySystem);p("contentInfo",{DRMEnabled:r})}else p("contentInfo",{DRMEnabled:"None"})}),n||p("contentInfo",{DRMEnabled:"None"})}),f.on("loadstart",function(){var e,n;vn&&vn!==f.currentSrc()&&p("playbackEnded"),p("setPlayer",f),dn.clear(),vn=f.currentSrc();var r=In(f.currentType()),o=i(),u=fn(o,f,m,v);u[null==m||null===(e=m.Constants)||void 0===e?void 0:e.PLAYER_NAME]=s||"WEB",u[null==m||null===(n=m.Constants)||void 0===n?void 0:n.ASSET_NAME]=bn(o,t),u.authToken=d||"NULL",u.streamType=r,u.D2CType=l||"NONE",u.subscriberType=a?"MVPD":"FREE"!==l?"D2C":"FREE",u["c3.cm.affiliate"]=a||"NULL",On.setData(u),p("contentInfo",u)}),f.on("loadedmetadata",function(){var e,n=f.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})}),f.on("play",function(){dn.has(f.currentSrc())||(dn.add(f.currentSrc()),p("playbackStarted",null))}),f.on("ended",function(){dn.has(f.currentSrc())&&dn.delete(f.currentSrc()),p("playbackEnded")}),f.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:f,adsLoader:null==e?void 0:e.adsLoader})}),f.on("dispose",function(){null==dn||dn.clear(),p("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),On=(kn={},{setData:function(e){kn=cn(cn({},kn),e)},getData:function(){return kn}}),jn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-d184c7e3.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-a9c23cad.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-dac31c35.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-601e36bf.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-9a9606e2.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?import("./skin-3aa64a01.js").then(function(t){t.initialiseSkin(e,n)}):"news"==t?import("./skin-bce765b0.js").then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?import("./skin-280dfe76.js").then(function(t){t.initialiseSkin(e,n)}):"mini"==t?import("./skin-109c4ba7.js").then(function(t){t.initialiseSkin(e,n)}):"CN_NEWS"==t&&import("./skin-f95bee67.js").then(function(t){t.initialiseSkin(e,n)})};function Dn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function xn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Dn(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Dn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Pn=[],An=0,Nn=null;function Rn(){Sn=null,Pn=[],An=0,Nn=null}function Mn(e,n,t){var r,o,a,u,s,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(r=n.watchHistory)||void 0===r||r.apiVersion;var d=null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.profileId,v=Math.floor(e.currentTime()),f=Math.floor(e.duration());null==n||null===(a=n.watchHistory)||void 0===a||a.xapiKey;var p=(null==n||null===(u=n.video)||void 0===u?void 0:u.originalObjectId)||null,m=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,h=Math.floor(e.currentTime()),g=c?100:Math.floor(v/f*100),y={};m?function(e,n,t){var r=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),o=_n(r),l=(new Date).getTime(),a=i(),u=(null==a?void 0:a.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return xn(xn({},e),{},J({},n,u[n]))},{}),c=o.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===Sn});c<0?o.push(xn(xn({content:s},e),{},{addedDate:l,updateDate:l})):o[c]=xn(xn(xn({},o[c]),e),{},{updateDate:l});localStorage.setItem("".concat(r),JSON.stringify(o))}(y={completed:c,watchedTime:h,watchedPercentage:g},d,n.siteOwner):(y=xn(xn({videoId:Sn,watchedTime:h,watchedPercentage:g,doneWatching:c,profileId:d},Nn&&{seriesId:Nn}),p&&{originalObjectId:p}),l(y).then(function(e){}).catch(function(e){})),An=v+t}function _n(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Ln(e,n,t){var r=_n(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return r&&Array.isArray(r)&&(o=r.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),o}var Bn=!1,Fn=function(e,n){var t,r,o=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[o])||void 0===t||null===(r=t.streamingInfo)||void 0===r?void 0:r.secondaryVideoAssets)||null)&&!Bn){var i=Un(e,"videoAssets","secondaryVideoAssets"),l=a(i,n);return l&&u(n,l),Bn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Un(e,n,t){if(Array.isArray(e))return e.map(function(e){return Un(e,n,t)});if(null!==e&&"object"===Oe(e)){var r={};return Object.keys(e).forEach(function(o){o===n&&void 0!==e[t]?r[o]=e[t]:o===t&&void 0!==e[n]?r[o]=e[n]:r[o]=Un(e[o],n,t)}),r}return e}function Vn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Hn(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Hn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function Hn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function zn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Gn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?zn(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var qn=function(e,n,t,r){var o,l,a,u,m,h=r.res,g=r.sres,y=be(e),b=(null==h?void 0:h.contentType)||"video",w=(null==h||null===(o=h[b])||void 0===o?void 0:o.drmEnabled)||!1,k=!(null==h||null===(l=h[b])||void 0===l||null===(a=l.streamingInfo)||void 0===a||!a.isLiveStream)||"linearchannel"===b,S=(null==h||null===(u=h[b])||void 0===u||null===(m=u.liveDetails)||void 0===m?void 0:m.isDvrEnabled)||!1;s(h),c.set(h),y&&(y.on("loadstart",function(){k?t.resolve({status:!0,msg:"Video Loaded",response:h}):t.resolve(Gn({status:!0,msg:"Player Initialised"},g?{seriesResponse:g,response:h}:{response:h}))}),y.on("loadeddata",function(){var t,r,o,l=fe(e);if(null==l||l.map(function(n){return pe(e,n.id)}),S&&"Safari"===Ee())try{var a;null==y||null===(a=y.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==y||!y.muted())&&qe(e,sessionStorage.getItem("volume")||"100");var u=i();if(d(n),v(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.saveOffline)){var s,c,f=Gn(Gn({},n),h);!function(e,n,t){var r,o,i;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(Nn=null==n||null===(o=n.series)||void 0===o?void 0:o.id),Pn=[],An=0,Sn=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=be(e);a&&(a.on("dispose",Rn),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());Pn.includes(An)||(e!=An||e<l?e>An&&(An=e+l):(Pn.push(e),Mn(a,n,l)))}}),a.one("ended",function(){Mn(a,n,l,!0)}))}(e,f,null==u||null===(s=u.video)||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.id)}if(null!=n&&null!==(o=n.analytics)&&void 0!==o&&o.muxKey&&null!=y&&y.mux){var p,m,g,b,w,k,T=(null===(p=i())||void 0===p?void 0:p.video)||(null==h?void 0:h.video),E=null==T?void 0:T.gist,I={env_key:null==n||null===(m=n.analytics)||void 0===m?void 0:m.muxKey,player_name:"vl-web-player",player_version:null===(g=window)||void 0===g?void 0:g.vl_player_version,video_id:null==E?void 0:E.id,video_title:null==E?void 0:E.title,video_series:null==T||null===(b=T.series)||void 0===b?void 0:b.title,video_stream_type:null!=T&&null!==(w=T.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==n||null===(k=n.analytics)||void 0===k?void 0:k.userId};y.mux({debug:!1,data:I})}}),y.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];y.trigger("subtitlechanged",n)}),y.on("subtitlechanged",function(e,n){var t,r,o,i,l,a,u,s,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(i=o.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(c=s.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===f){var m,h=p.getMediaSession(),g=h.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),h.editTracksInfo(m)}}),y.tech_.on("retryplaylist",function(){k&&Fn(h,e)}),y.on("error",function(){var n,r;(console.log("ERROR",y.error(),y.error().code),4===y.error().code&&k)?Fn(h,e):(f(e,(null==y||null===(n=y.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==y||null===(r=y.error())||void 0===r?void 0:r.message)||"Some error occured",response:h}))}),y.one("play",function(){var e,t,r,o,l;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(r=t.appcmsMain)||void 0===r||null===(o=r.adsConfig)||void 0===o||!o.vodAdClientSideTracking){if(null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable){var a,u,s,c=null===(a=i())||void 0===a||null===(u=a.video)||void 0===u||null===(s=u.gist)||void 0===s?void 0:s.id,d=p(),v=(null==d?void 0:d.get(c))||{t:0,p:0},f=v.t,m=v.p;f&&m<95&&setTimeout(function(){y.currentTime(f)},0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout(function(){y.currentTime(null==n?void 0:n.watchHistoryResumeTime)},0);if(null!=y&&y.dvrSeekbar)try{y.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),y.on("volumechange",function(){var e=100*y.volume().toFixed(2);y.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),y.on("chromecastDisconnected",function(){if(k){y.currentSource();for(var e=y.textTracks(),n=e.length-1;n>=0;n--)y.removeRemoteTextTrack(e[n])}}),y.one("loadeddata",function(){var e,n=(null==y||null===(e=y.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),r=(n.language||n.label||"").toUpperCase();return t<r?-1:t>r?1:0}),"object"==Oe(y.dash)){var t,r,o,i=null==y||null===(t=y.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),l=null==i?void 0:i.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=Vn(n);try{for(a.s();!(o=a.n()).done;){var u=o.value;if(l&&(null==u?void 0:u.id)=="dash-audio-".concat(l.index)){u.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var s,c=Vn(n);try{for(c.s();!(s=c.n()).done;){var d,v,f,p=s.value;if(("Chrome"==Ee()||"Edge"==Ee()&&(null!==(d=navigator)&&void 0!==d&&null!==(v=d.userAgent)&&void 0!==v&&v.includes("Macintosh")||!w))&&null!=p&&null!==(f=p.label)&&void 0!==f&&f.includes("5.1"))y.audioTracks().removeTrack(p);else{if("main"==p.kind){p.enabled=!0;break}p.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}}))};function Kn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Yn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kn(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Wn=function(e,n,t,r){var o,i,l,s,c,d,v,p,S,T,E,I,C,O,j,D,x,P,A,N,R,M,_,L,B,F,U,V,H,z,G,q,K,Y,W,$,ee,ne,te,re=n.res,oe=void 0===re?null:re,ie=n.sres,le=void 0===ie?null:ie,ae=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],ue=(null===(o=oe)||void 0===o?void 0:o.contentType)||"video",se=we(null===(i=oe)||void 0===i||null===(l=i[ue])||void 0===l||null===(s=l.gist)||void 0===s?void 0:s.videoImageUrl)||we(null===(c=oe)||void 0===c||null===(d=c[ue])||void 0===d||null===(v=d.gist)||void 0===v||null===(p=v.imageGist)||void 0===p?void 0:p.r16x9),ce=(null===(S=oe)||void 0===S||null===(T=S[ue])||void 0===T||null===(E=T.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,de=!(null===(I=oe)||void 0===I||null===(C=I[ue])||void 0===C||null===(O=C.streamingInfo)||void 0===O||!O.isLiveStream)||"linearchannel"===ue,ve=(null===(j=oe)||void 0===j||null===(D=j.ads)||void 0===D||null===(x=D.preRoll)||void 0===x||null===(P=x.adTags)||void 0===P||null===(A=P.web)||void 0===A?void 0:A.active)&&(null===(N=oe)||void 0===N||null===(R=N.ads)||void 0===R||null===(M=R.preRoll)||void 0===M||null===(_=M.adTags)||void 0===_||null===(L=_.web)||void 0===L?void 0:L.url);oe=Yn(Yn({},oe),{},{audioAssetSource:null==t?void 0:t.audioAssetSource});var fe=(null==t||null===(B=t.customData)||void 0===B?void 0:B.ads)||{},pe=(null===(F=oe)||void 0===F||null===(U=F[ue])||void 0===U?void 0:U.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==fe?void 0:fe.vodAdSticherProvider)||!1,he=!(null===(V=oe)||void 0===V||null===(H=V[ue])||void 0===H||!H.isSSAIEnabled)&&"TRANSMIT"==(null==fe?void 0:fe.liveAdSticherProvider)&&!(null==fe||!fe.liveAdClientSideTracking),ge=(null==t?void 0:t.latency)||6,ye=(null==t?void 0:t.skin_settings)||{},ke=(ne={enableSmoothSeeking:!0,controls:0!=(null==t?void 0:t.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==t?void 0:t.muted)||!1,autoplay:(null==t?void 0:t.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==ye?void 0:ye.pictureInPictureToggle)||!1},playbackRates:null!=ye&&ye.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==t.skin,liveui:ce},J(ne,"autoplay",null==t?void 0:t.autoplay),J(ne,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!ve),J(ne,"loop",(null==t?void 0:t.loop)||!1),J(ne,"audioPosterMode",null==t?void 0:t.audioPosterMode),J(ne,"html5",Yn(Yn({dash:Yn(Yn(Yn({},!Z.browser.IS_SAFARI&&{useTTML:!0}),(null==t?void 0:t.debugConfig)&&(null==t||null===(z=t.debugConfig)||void 0===z?void 0:z.enable)&&{debug:!0,logLevel:null!=t&&null!==(G=t.debugConfig)&&void 0!==G&&G.logLevel?null==t||null===(q=t.debugConfig)||void 0===q?void 0:q.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ge},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:Yn({},"IE"==Ee()&&{enableStallFix:!0,stallSeek:1}),abr:Yn(Yn(Yn(Yn({},(null==t?void 0:t.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==t?void 0:t.initialBandwidth)/1e3}}),(null==t?void 0:t.maxBitrate)&&{maxBitrate:{audio:-1,video:(null==t?void 0:t.maxBitrate)/1e3}}),(null==t?void 0:t.minBitrate)&&{minBitrate:{audio:-1,video:(null==t?void 0:t.minBitrate)/1e3}}),{},{rules:{throughputRule:{active:!0},bolaRule:{active:!1},insufficientBufferRule:{active:!1},switchHistoryRule:{active:!1},droppedFramesRule:{active:!1},abandonRequestsRule:{active:!1}},autoSwitchBitrate:{video:!0,audio:!0}})}}}),vhs:Yn(Yn(Yn({},(null==t?void 0:t.initialBandwidth)&&{bandwidth:t.initialBandwidth}),{},{liveRangeSafeTimeDelta:ge,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==t||!t.initialBandwidth},(null==t||null===(K=t.customData)||void 0===K?void 0:K.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(Y=null==t?void 0:t.enableLowInitialPlaylist)&&void 0!==Y&&Y}),debug:(null==t?void 0:t.debugConfig)&&(null==t||null===(W=t.debugConfig)||void 0===W?void 0:W.enable)||!1,nativeTextTracks:"Safari"==Ee()},0==(null==t||null===($=t.customData)||void 0===$?void 0:$.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===(ee=t.customData)||void 0===ee?void 0:ee.nativeVideoTracks)&&{nativeVideoTracks:!1})),J(ne,"poster",se),J(ne,"techOrder",ae),J(ne,"chromecast",{requestCustomDataFn:function(n){var r,o,i=be(e),l=((null==i?void 0:i.textTracksJson_)||i.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),a=function(e,n,t){var r,o,i,l,a,u,s,c,d,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,h,g,y,b,w,k,S;p.isDrmEnabled=!0;var T=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,E=(null==T?void 0:T.url)||(null==n||null===(h=n.keySystemOptions)||void 0===h||null===(g=h[0])||void 0===g||null===(y=g.options)||void 0===y?void 0:y.serverURL);p.licenseUrl=E;var I=(null==T?void 0:T.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);p.licenseToken=I}var C=(null==e||null===(r=e[f])||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.contentType)||"VIDEO";p.contentType=C;var O=null==e||null===(i=e[f])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;p.duration=O;var j=null==e||null===(a=e[f])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;p.mediaTitle=j;var D=null==e||null===(s=e[f])||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=D,p.subTitles=t,p.DVR=(null==e||null===(d=e[f])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(oe,n,l);return Yn(Yn({},a),{},{transmitTrackingUrl:m.get()||null,convivaMetaData:Yn({customerKey:(null==t||null===(r=t.convivaConfig)||void 0===r?void 0:r.customerKey)||null,debug:(null==t||null===(o=t.convivaConfig)||void 0===o?void 0:o.debug)||!1},On.getData())})},modifyLoadRequestFn:function(n){var t,r,o,i,l,a=be(e),u=(null==a?void 0:a.currentSource())||{};!(null===(t=oe)||void 0===t||null===(r=t[ue])||void 0===r||null===(o=r.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(l=u.src)&&void 0!==l&&l.includes(".m3u8")&&(n.media.hlsSegmentFormat="fmp4",n.media.hlsVideoSegmentFormat="fmp4");return n}}),ne);if(!Z.getPlayers()[e]){null!=t&&t.debugConfig&&null!=t&&null!==(te=t.debugConfig)&&void 0!==te&&te.enable&&Z.log.level("debug");var Se=Z(e,ke,function(){var n=X(Q.mark(function n(){var o,i,l,s,c,d,v,p,m,S,T,E,I,C,O,j,D,x,P,A;return Q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(Se),console.log(Z.VERSION),console.log(Z.getPlugins()),n.next=5,an(t,oe);case 5:if(E=null===(o=oe)||void 0===o||null===(i=o[ue])||void 0===i||null===(l=i.liveDetails)||void 0===l?void 0:l.startOverTime,de&&r.resolve(Yn({status:!0,msg:"Player Initialised"},le?{seriesResponse:le,response:oe}:{response:oe})),y(e,{analyticsCb:null==t?void 0:t.analyticsCb,analyticsEventParams:null==t?void 0:t.analyticsEventParams,userId:null==t?void 0:t.userId}),Cn(e,t),/Android/i.test(navigator.userAgent)&&(Z.options.vhs.overrideNative=!0),ce&&We(e,E),!ve||null!=t&&null!==(s=t.customData)&&void 0!==s&&s.disableAds||b(e,ve,oe),I=a(oe,e),console.log(I),null!=t&&t.nearestClusterUrl&&(I=w(I,t.nearestClusterUrl)),!pe){n.next=21;break}return n.next=18,k(e,oe);case 18:I=n.sent,n.next=25;break;case 21:if(!he){n.next=25;break}return n.next=24,g(I,oe,e);case 24:I=n.sent;case 25:I?u(e,I):(r.reject({status:!1,msg:"Incompatible / Missing Source",response:oe}),f(e,"Incompatible / Missing Source")),((null===(c=oe)||void 0===c||null===(d=c[ue])||void 0===d||null===(v=d.contentDetails)||void 0===v||null===(p=v.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(m=oe)||void 0===m||null===(S=m[ue])||void 0===S||null===(T=S.closedCaptions)||void 0===T?void 0:T.length)>0)&&(A=(null===(O=oe)||void 0===O||null===(j=O[ue])||void 0===j||null===(D=j.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(x=oe)||void 0===x||null===(P=x[ue])||void 0===P?void 0:P.closedCaptions),C=A.filter(function(e){return"VTT"===e.format}),me(e,C)),null!=t&&t.disableControls?h(e):jn(e,Yn(Yn(Yn({},t),ke),{},{liveVideo:de,isDvrEnabled:ce,res:oe,sres:le})),qn(e,Yn(Yn(Yn({},t),ke),{},{liveVideo:de}),r,{res:oe,sres:le});case 29:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function $n(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Jn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?$n(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$n(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Xn,Qn=function(e,n){var t=n.resolve,r=n.reject,o=null==e?void 0:e.playerId,i=Zn(e);Wn(o,{res:i},e,{resolve:t,reject:r})},Zn=function(e){var n,t,r,o,i,l,a,u,s,c,d,v,f,p=null==e?void 0:e.streamingInfo,m=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,h=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,g=(null==e||null===(r=e.streamingInfo)||void 0===r||null===(o=r.ads)||void 0===o?void 0:o.url)||null,y=(null==e||null===(i=e.streamingInfo)||void 0===i?void 0:i.posterUrl)||null,b=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.subtitles)||[],w=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(u=a.videoAssets)||void 0===u?void 0:u.drmProvider)||null,k=(null==e||null===(s=e.streamingInfo)||void 0===s?void 0:s.macroMap)||[],T=(null==e||null===(c=e.customData)||void 0===c||null===(d=c.ads)||void 0===d?void 0:d.isSSAIEnabled)||!1,E=null==e?void 0:e.token,I=S(E);null==I||I.site;var C=null==I?void 0:I.siteId,O=(null==e||null===(v=e.customData)||void 0===v||null===(f=v.comscore)||void 0===f?void 0:f.video)||null,j=Jn(Jn({id:"".concat(C,"_external")},!h&&{directPlaybackUrl:null==m?void 0:m.url}),{},{video:Jn(Jn(Jn(Jn(Jn({drmEnabled:h,streamingInfo:Jn(Jn({videoAssets:Jn(Jn({},w&&{drmProvider:w}),{},{widevine:null==m?void 0:m.widevine,fairPlay:null==m?void 0:m.fairPlay,playReady:null==m?void 0:m.playReady})},(null==p?void 0:p.isDvrEnabled)&&{isLiveStream:!0}),(null==O?void 0:O.isLiveStream)&&{isLiveStream:null==O?void 0:O.isLiveStream})},T&&{isSSAIEnabled:T}),{},{metadata:k,liveDetails:{isDvrEnabled:null==p?void 0:p.isDvrEnabled},gist:Jn(Jn(Jn({},y&&{videoImageUrl:y}),(null==O?void 0:O.videoId)&&{id:null==O?void 0:O.videoId}),(null==O?void 0:O.videoTitle)&&{title:null==O?void 0:O.videoTitle}),contentDetails:Jn({},(null==b?void 0:b.length)>0&&{closedCaptions:je(b)})},(null==O?void 0:O.runtime)&&{runtime:null==O?void 0:O.runtime}),(null==O?void 0:O.publishDate)&&{publishDate:null==O?void 0:O.publishDate}),(null==O?void 0:O.platform)&&{platform:null==O?void 0:O.platform}),(null==O?void 0:O.series)&&{series:null==O?void 0:O.series}),ads:{preRoll:{adTags:{web:Jn(Jn({},g&&{active:!0}),g&&{url:g})}}}});return O&&(null!=O&&O.isDvrEnabled&&(j.video.liveDetails=Jn(Jn({},j.video.liveDetails),{},{isDvrEnabled:null==O?void 0:O.isDvrEnabled})),null!=O&&O.metadata&&(j.video.metadata=[].concat(je(j.video.metadata),je(null==O?void 0:O.metadata)))),j},et=null,nt=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),r=function(e,n){var t;return t=12*(n.getFullYear()-e.getFullYear()),t-=e.getMonth(),(t+=n.getMonth())<=0?0:t}(new Date,new Date(n)),o=r>0&&t>4?r:0,i=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),r=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(r-=1),r<0&&(t-=1),t}(new Date,new Date(n));return[i>0&&o>0?i:0,o,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},tt=function(e){var n,t=De(e,8),r=t[0],o=t[1],i=t[2],l=t[3],a=t[4],u=t[5],s=t[6],c=t[7];n=r>=1?" ".concat(r," Year"):o>=1?" ".concat(o," month"):i>=1?" ".concat(i," week"):l>=1?" ".concat(l," day"):a<24&&a>=12?" ".concat(a," hour"):a>0?"".concat(a," hours ").concat(u," minutes ").concat(s," seconds"):u>0?"".concat(u," minutes ").concat(s," seconds"):"".concat(s," seconds"),c.textContent="".concat(n)},rt=(Xn={scheduleStartTimeMs:0,scheduleEndTimeMs:0},{get:function(){return Xn},set:function(e){Xn={scheduleStartTimeMs:null==e?void 0:e.startDateTime,scheduleEndTimeMs:null==e?void 0:e.endDateTime}}});function ot(e,n,t,r){if(e){var o=function(){var e,o,l=null===(e=rt.get())||void 0===e?void 0:e.scheduleStartTimeMs,a=null===(o=rt.get())||void 0===o?void 0:o.scheduleEndTimeMs,u=Date.now();if(u-a>0){var s=document.getElementsByClassName("error-message")[0];return s&&(s.textContent=Ie("eventEnded")||"Game has ended",r.textContent=""),clearInterval(i),void(null==t||t())}var c=l-u;if(c/1e3<=0)return clearInterval(i),null==n||n([0,0,0,0,0,0,0,r]),void(null==t||t());var d=nt(c,l);null==n||n([].concat(je(d),[r]))};o();var i=setInterval(o,1e3);return i}}var it=function(e,n,t){var r,o,i,l,a,u,s,c,d=null==n||null===(r=n.response)||void 0===r||null===(o=r.data)||void 0===o?void 0:o.errorCode,v=(null==n||null===(i=n.response)||void 0===i||null===(l=i.data)||void 0===l?void 0:l.errorMessage)||(null==n?void 0:n.message)||null;rt.set({startDateTime:null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,endDateTime:null==n||null===(s=n.response)||void 0===s||null===(c=s.data)||void 0===c?void 0:c.scheduleEndDate}),function(e,n,t,r){var o,i,l=Date.now(),a=null===(o=rt.get())||void 0===o?void 0:o.scheduleStartTimeMs,u=null===(i=rt.get())||void 0===i?void 0:i.scheduleEndTimeMs,s=function(e,n,t,r){var o;e<0?o=Ie("eventNotStarted")||r||"Game starts in":(n>0||"VIDEO_NOT_EXISTS"==t)&&(o=Ie("eventEnded")||r||"Game has ended");return o||r}(l-a,l-u,n,t);if(document.getElementsByClassName("error-container")[0]){var c=document.getElementsByClassName("error-message")[0];c&&(c.textContent="".concat(s));var d=document.getElementsByClassName("error-timer-message")[0];d&&ot(Math.abs(a),tt,r,d)}else{var v=document.getElementById(e).parentElement;if(v){var f=document.createElement("div");f.className="error-container";var p=document.createElement("div");p.className="error-message";var m=document.createElement("div");m.className="error-timer-message",p.textContent="".concat(s),f.appendChild(p),f.appendChild(m),v.append(f),ot(Math.abs(a),tt,r,m)}}}(e,d,v,t)};function lt(e,n){var t=n.scheduleEndDate,r=n.scheduleStartDate;rt.set({startDateTime:r,endDateTime:t}),et&&clearInterval(et),et=setInterval(function(){var n,t=Date.now(),r=null===(n=rt.get())||void 0===n?void 0:n.scheduleEndTimeMs;if(console.log("scheduleEndTimeMs",r),r&&t>r){var o;console.log("Game ended");var i=be(e);if(T(e)&&i){var l;i.dispose(),console.log("Player disposed");var a=null===(l=document.getElementsByClassName("vl-container"))||void 0===l?void 0:l[0],u=document.createElement("video");u.id=e,u.className="video-js",u.style.width="100%",u.style.height="100%",a&&a.appendChild(u)}var s=Ie("eventEnded")||"Game has ended",c=null===(o=document.getElementsByClassName("error-container"))||void 0===o?void 0:o[0];if(c){var d=c.querySelector(".error-message");d&&(d.textContent=s)}else{var v=document.getElementById(e),f=null==v?void 0:v.parentElement;if(f){(c=document.createElement("div")).className="error-container";var p=document.createElement("div");p.className="error-message",p.textContent=s,c.appendChild(p),f.append(c)}}clearInterval(et)}},1e3)}function at(e,n){return ut.apply(this,arguments)}function ut(){return(ut=X(Q.mark(function e(n,t){var r,o,i,l,a,u,c,d,v;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,a=null==n?void 0:n.videoId,u=null==n?void 0:n.playerId,c=!(null==n||!n.anonymousId),e.next=6,O();case 6:d=e.sent,v=!1===(null==n||null===(r=n.customData)||void 0===r||null===(o=r.ads)||void 0===o?void 0:o.isSSAIEnabled),E(a,d,v).then(function(e){var t,r,o,v,f,p,m,h,g,y;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(r=t.video)||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.contentType,s(null==e?void 0:e.data);var b=null==e||null===(v=e.data)||void 0===v||null===(f=v.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.scheduleEndDate,w=null==e||null===(m=e.data)||void 0===m||null===(h=m.video)||void 0===h||null===(g=h.gist)||void 0===g?void 0:g.scheduleStartDate;lt(u,{scheduleEndDate:b,scheduleStartDate:w});var k,S=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(y=n.watchHistory)&&void 0!==y&&y.enable&&!c)if((null===(k=n.watchHistory)||void 0===k?void 0:k.saveOffline)||!1){var T,E,C,O=Ln((null===(T=n.watchHistory)||void 0===T?void 0:T.profileId)||"",a,null==n?void 0:n.siteOwner);if(O&&O.length)n.watchHistoryResumeTime=(null===(E=O[0])||void 0===E?void 0:E.watchedTime)||null,n.watchedPercentage=(null===(C=O[0])||void 0===C?void 0:C.watchedPercentage)||null;S.contentType="video",Wn(u,{res:S},n,{resolve:i,reject:l})}else I(a,d).then(function(e){var t,r,o,i,l,a;null!==(t=window)&&void 0!==t&&null!==(r=t.watchHistory)&&void 0!==r&&r.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,S.contentType="video"}).catch(function(e){var n,t,r,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(o=r.watchHistory)||void 0===o||o.cb(e))}).finally(function(){Wn(u,{res:S},n,{resolve:i,reject:l})});else Wn(u,{res:S},n,{resolve:i,reject:l})}).catch(function(e){var t,r,o=(null==n||null===(t=n.event)||void 0===t?void 0:t.showScheduleTimer)||!1,i=(null==n||null===(r=n.event)||void 0===r?void 0:r.onCountdownComplete)||null;o&&it(u,e,i),C(e,u,l,a)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function st(e,n){return ct.apply(this,arguments)}function ct(){return(ct=X(Q.mark(function e(n,t){var r,o,i,l,a,u,s,c;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,e.next=3,O();case 3:a=e.sent,u=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,c=!1===(null==n||null===(r=n.customData)||void 0===r||null===(o=r.ads)||void 0===o?void 0:o.isSSAIEnabled),j(s,a,c).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,Wn(u,{res:t},n,{resolve:i,reject:l})}).catch(function(e){C(e,u,l,videoId)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function dt(e,n){return vt.apply(this,arguments)}function vt(){return(vt=X(Q.mark(function e(n,t){var r,o,i,l,a,u,c;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,e.next=3,O();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,P.set(parseInt(u)),c=null==n||null===(r=n.series)||void 0===r?void 0:r.id,D(c,l).then(function(e){var t,r,u,d=e.data,v=e.data.seasons;A(v);var f=videoId||(null==v||null===(t=v[0])||void 0===t||null===(r=t.episodes)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.id);x(c,l),E(f,l).then(function(e){var t,r,l;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(r=t.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,s(e.data),Wn(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:o,reject:i})}).catch(function(e){C(e,a,i,videoId)})}).catch(function(e){C(e,a,i)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}var ft,pt=(ft=new Map,{set:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=Array.isArray(n)?n:[];return ft.set(e,t),t},get:function(e){return ft.get(e)||[]},remove:function(e){ft.delete(e)}});function mt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function ht(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return gt(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gt(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function gt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var yt=function(e){var n=Date.parse(null==e?void 0:e.eventStartUtc),t=Number.isFinite(n)?n/1e3:0;return{start:t+(Number(null==e?void 0:e.startTime)||0),end:t+(Number(null==e?void 0:e.endTime)||0)}},bt=function(e){var n;try{var t,r,o=null==e||null===(t=e.liveTracker)||void 0===t||null===(r=t.seekableEnd)||void 0===r?void 0:r.call(t);if(Number.isFinite(o))return o}catch(e){}var i=null==e||null===(n=e.seekable)||void 0===n?void 0:n.call(e);return i&&i.length?i.end(i.length-1):NaN};function wt(e){var n=null,t=null,r="none",o=function(o){var i=be(e);if(!i)return null;if("pdt"===r&&null!=n)return t+(o-n);var l=bt(i);return Number.isFinite(l)?l-(Date.now()/1e3-o):null},i=function(){var n=be(e),t=n&&n.seekable();return t&&t.length?{start:t.start(0),end:t.end(t.length-1)}:{start:0,end:0}};return{refreshAnchor:function(){var o=be(e);if(o){var i=function(e){try{var n=e.tech(!0),t=n&&n.vhs,r=t&&t.playlists,o=r&&"function"==typeof r.media&&r.media();return o&&o.segments||null}catch(e){return null}}(o),l=o.currentTime()||0;if(i&&i.length){var a,u=null,s=1/0,c=ht(i);try{for(c.s();!(a=c.n()).done;){var d=a.value;if(d&&"number"==typeof d.programDateTime&&"number"==typeof d.start&&Number.isFinite(d.start)){var v=Math.abs(d.start-l);v<s&&(s=v,u=d)}}}catch(e){c.e(e)}finally{c.f()}if(u)return n=u.programDateTime/1e3,t=u.start,void(r="pdt")}n=null,t=null,r="now"}},anchorInfo:function(){return function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?mt(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mt(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}({anchorPdtSec:n,anchorPlayerT:t,source:r},i())},chapterToPlayerTime:function(e){return o(yt(e).start)},chapterStartPercent:function(e){return function(e){var n=i(),t=n.start,r=n.end;if(!(r>t))return null;var l=o(e);return null==l||l<t||l>r?null:(l-t)/(r-t)*100}(yt(e).start)},playerTimeToChapterIndex:function(o,i){var l=function(o){var i=be(e);if(!i)return null;if("pdt"===r&&null!=n)return n+(o-t);var l=bt(i);return Number.isFinite(l)?Date.now()/1e3-(l-o):null}(o);if(null==l)return-1;for(var a=-1,u=0;u<i.length;u++){var s=yt(i[u]),c=s.start,d=s.end,v=Math.max(d,c+.001);l>=c&&l<v&&(a=u)}return a},windowBounds:i}}function kt(e){return"livedvr"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).timeMode?wt(e):function(e){var n=function(e){return Number(null==e?void 0:e.startTime)||0},t=function(e){var t=Number(null==e?void 0:e.endTime);return Number.isFinite(t)?t:n(e)};return{chapterToPlayerTime:function(e){return n(e)},chapterStartPercent:function(t){var r=be(e),o=r&&r.duration();if(!Number.isFinite(o)||o<=0)return null;var i,l=n(t);return l<0||l>o?null:100*((i=l/o)<0?0:i>1?1:i)},playerTimeToChapterIndex:function(e,r){for(var o=-1,i=0;i<r.length;i++){var l=n(r[i]),a=Math.max(t(r[i]),l+.001);e>=l&&e<a&&(o=i)}return o},windowBounds:function(){var n=be(e),t=n&&n.duration();return{start:0,end:Number.isFinite(t)?t:0}},refreshAnchor:function(){},anchorInfo:function(){return{source:"vod"}}}}(e)}var St="chapter-change",Tt="chapter-click",Et="chapters-updated";function It(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=be(e);r?r.trigger(n,t):console.error("[CHAPTERS] Player instance not found")}function Ct(e){var n=be(e);if(!n)return console.error("[CHAPTERS] Player instance not found"),{};var t=function(e,t){var r=function(e,n){return t(n)};return n.on(e,r),function(){return n.off(e,r)}};return{onChapterChange:function(e){return t(St,e)},onChapterClick:function(e){return t(Tt,e)},onChaptersUpdated:function(e){return t(Et,e)}}}var Ot="vjs-chapter-marker",jt="vjs-chapter-preview",Dt=function(e){try{var n,t,r;return(null==e||null===(n=e.controlBar)||void 0===n||null===(t=n.progressControl)||void 0===t||null===(r=t.seekBar)||void 0===r?void 0:r.el())||null}catch(e){return null}};function xt(e,n){var t=n.store,r=n.mapper,o=n.chaptersConfig,i=void 0===o?{}:o,l=n.seek,a=be(e);if(!a)return{render:function(){},reposition:function(){},destroy:function(){}};var u=new Map,s=null,c=-1,d=function(){return!0===(null==i?void 0:i.enable)},v=function(n,t){var o=be(e),i=Dt(o);if(i){var l=function(e){if(s&&s.isConnected)return s;(s=document.createElement("div")).className=jt;var n=document.createElement("div");n.className="vjs-chapter-preview__time";var t=document.createElement("div");t.className="vjs-chapter-preview__label",s.appendChild(n),s.appendChild(t);var r=document.createElement("span");return r.className="vjs-chapter-preview__pointer",s.appendChild(r),s._time=n,s._label=t,s._pointer=r,e.appendChild(s),s}(i);l._time.textContent=function(e){try{var n=r.chapterToPlayerTime(e);if(null==n||!Number.isFinite(n))return"";if("vod"===("function"==typeof r.anchorInfo?r.anchorInfo():{}).source)return Z.formatTime(n,n);var t=(r.windowBounds()||{}).end;if(!Number.isFinite(t))return"";var o=Math.max(0,t-n);return"-".concat(Z.formatTime(o,o))}catch(e){return""}}(n),l._label.textContent=(null==n?void 0:n.label)||"",l.classList.add("vjs-chapter-preview--visible");var a="function"==typeof(null==o?void 0:o.el)?o.el():null;a&&a.classList.add("vlp-chapter-preview-open"),function(e,n,t,r){var o="function"==typeof(null==t?void 0:t.el)?t.el():null;if(o){var i=o.getBoundingClientRect(),l=n.getBoundingClientRect(),a=e.offsetWidth||300,u=a/2,s=l.left+r/100*l.width,c=i.left+8+u,d=i.right-8-u,v=s;d>=c&&(v=Math.min(Math.max(s,c),d));var f=v-u-l.left;if(e.style.left="".concat(f,"px"),e.style.transform="none",e._pointer){var p=Math.min(Math.max(s-(l.left+f),8),a-8);e._pointer.style.left="".concat(p,"px")}}else e.style.left="".concat(r,"%")}(l,i,o,t)}},f=function(){s&&s.classList.remove("vjs-chapter-preview--visible");var n=be(e),t="function"==typeof(null==n?void 0:n.el)?n.el():null;t&&t.classList.remove("vlp-chapter-preview-open")},p=function(n){var t=document.createElement("div");t.className=Ot,t.dataset.segmentId=String(n.segmentId);var o=function(e){var n=null!=e&&e.icon?String(e.icon).trim():"";if(!n)return null;var t=document.createElement("span");if(t.className="vjs-chapter-marker__icon","<"===n.charAt(0)){var r=Se(n);r&&t.appendChild(r)}else{var o=document.createElement("img");o.src=n,o.alt="",t.appendChild(o)}return t}(n);return o&&t.appendChild(o),t.addEventListener("click",function(t){t.stopPropagation(),"function"==typeof l&&l(n.segmentId),It(e,Tt,{chapter:n})}),t.addEventListener("mouseenter",function(){var e=r.chapterStartPercent(n);null!=e&&v(n,e)}),t.addEventListener("mouseleave",f),t},m=function(){d()&&0!==u.size&&(r.refreshAnchor(),t.get(e).forEach(function(e){var n=u.get(String(e.segmentId));if(n){var t=r.chapterStartPercent(e);null==t?n.style.display="none":(n.style.display="",n.style.left="".concat(t,"%"))}}))},h=0,g=function(n){u.forEach(function(e){return e.classList.remove("".concat(Ot,"--active"))});var r=t.get(e),o=n>=0?r[n]:null;if(o){var i=u.get(String(o.segmentId));i&&i.classList.add("".concat(Ot,"--active"))}},y=function(){var n=be(e);if(n){var o=t.get(e),i=r.playerTimeToChapterIndex(n.currentTime()||0,o);-1===i&&Date.now()<h||i!==c&&(c=i,g(i),It(e,St,{chapter:i>=0?o[i]:null}))}},b=ke(function(){m(),y()},1e3),w=function(){m(),y()};a.on("timeupdate",b),a.on("seeked",w);var k=!1;try{a.liveTracker&&"function"==typeof a.liveTracker.on&&(a.liveTracker.on("liveedgechange",m),k=!0)}catch(e){}var S=null;(function(){try{return"function"==typeof r.anchorInfo&&"vod"!==r.anchorInfo().source}catch(e){return!1}})()&&(S=setInterval(m,500));return{render:function(){var n=be(e),o=Dt(n);o&&(o.querySelectorAll(".".concat(Ot)).forEach(function(e){return e.remove()}),u.clear(),d()&&(r.refreshAnchor(),t.get(e).forEach(function(e){var n=p(e);o.appendChild(n),u.set(String(e.segmentId),n)}),m(),g(c),y()))},reposition:m,destroy:function(){try{a.off("timeupdate",b),a.off("seeked",w),k&&a.liveTracker.off("liveedgechange",m)}catch(e){}S&&(clearInterval(S),S=null);var n=Dt(be(e));n&&n.querySelectorAll(".".concat(Ot,", .").concat(jt)).forEach(function(e){return e.remove()}),u.clear(),s=null},setActiveBySegment:function(n){var r=t.get(e),o=r.findIndex(function(e){return String(e.segmentId)===String(n)});o<0||(h=Date.now()+1500,o!==c&&(c=o,g(o),It(e,St,{chapter:r[o]})))}}}var Pt=new Map,At=function(e){try{var n,t,r;return!(null==e||null===(n=e.controlBar)||void 0===n||null===(t=n.progressControl)||void 0===t||null===(r=t.seekBar)||void 0===r||!r.el())}catch(e){return!1}},Nt=function(e){var n=Pt.get(e);if(n)return n;n={mapper:kt(e,{timeMode:"vod"}),markers:null,chaptersConfig:{},timeMode:"vod"},Pt.set(e,n);var t=be(e);return t&&t.on("dispose",function(){return Ut(e)}),n},Rt=function(e){var n=Pt.get(e),t=function(e){var n=Pt.get(e);if(!n||n.markers)return(null==n?void 0:n.markers)||null;var t=be(e);return t&&At(t)?(n.markers=xt(e,{store:pt,mapper:n.mapper,chaptersConfig:n.chaptersConfig,seek:function(n){return Ft(e,n)}}),n.markers):null}(e);t&&n&&t.render()};function Mt(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.chapters,r=void 0===t?[]:t,o=n.timeMode,i=void 0===o?"vod":o;n.res;var l=n.chaptersConfig,a=void 0===l?{}:l,u=be(e);if(!u)return!1;Array.isArray(r)&&r.length&&pt.set(e,r);var s=Pt.get(e);null!=s&&s.markers&&s.markers.destroy();var c={mapper:kt(e,{timeMode:i}),markers:null,chaptersConfig:a||{},timeMode:i,disposed:!1};Pt.set(e,c);var d=function(){c.disposed||Rt(e)};return u.one("loadeddata",d),At(u)&&d(),u.on("dispose",function(){return Ut(e)}),!0}function _t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Nt(e),pt.set(e,n),Rt(e),It(e,Et,{chapters:pt.get(e)}),!0}function Lt(e){return pt.get(e)}function Bt(e){pt.set(e,[]);var n=Pt.get(e);return null!=n&&n.markers&&n.markers.render(),It(e,Et,{chapters:[]}),!0}function Ft(e,n){var t,r,o=be(e),i=Nt(e);if(!o)return!1;var l=pt.get(e).find(function(e){return e.segmentId===n});if(!l)return!1;i.mapper.refreshAnchor();var a=i.mapper.chapterToPlayerTime(l);if(null==a||!Number.isFinite(a))return!1;var u=i.mapper.windowBounds(),s=u.start,c=u.end;return Number.isFinite(s)&&Number.isFinite(c)&&c>s&&(a=Math.min(Math.max(a,s),c-.1)),o.currentTime(a),null===(t=i.markers)||void 0===t||null===(r=t.setActiveBySegment)||void 0===r||r.call(t,n),!0}function Ut(e){var n=Pt.get(e);n&&(n.disposed=!0,n.markers&&n.markers.destroy()),Pt.delete(e),pt.remove(e)}var Vt,Ht=function(e){var n=e.enable,t=e.site,r=e.sseBaseUrl,o=e.sseEndpoint,l=e.debug;if(n){var a=function(e){var n=e.site,t=e.sseBaseUrl,r=e.sseEndpoint,o=e.debug,l=void 0!==o&&o;return xe({site:n,sseBaseUrl:t,getToken:O,sseEndpoint:r,onOpen:function(e){var n=e.userId,t=e.endpoint;l&&console.log("SSE Connected:",n,t)},onMessage:function(e){var n,t,r,o,a,u,s,c,d,v;if(l&&console.log("SSE Message:",e),(null===(n=i())||void 0===n||null===(t=n.video)||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.id)===(null==e||null===(o=e.payload)||void 0===o?void 0:o.id)&&"GAME_STATE_CHANGE"===(null==e?void 0:e.notificationType)){var f=1e3*(null==e||null===(a=e.payload)||void 0===a||null===(u=a.states)||void 0===u||null===(s=u.live)||void 0===s?void 0:s.startDateTime),p=1e3*(null==e||null===(c=e.payload)||void 0===c||null===(d=c.states)||void 0===d||null===(v=d.end)||void 0===v?void 0:v.endDateTime);f&&p&&(console.log("Setting schedule timer",f,p),rt.set({startDateTime:f,endDateTime:p}))}},onReconnectAttempt:function(e){l&&console.log("Reconnect attempt:",e)},onHeartbeatTimeout:function(e){var n=e.elapsed;l&&console.warn("Heartbeat timeout after:",n)},onTokenInvalid:function(e){l&&console.error("Invalid token:",e),window.location.href="/login"},onError:function(e,n){l&&console.error("SSE Error:",e,n)},onClose:function(){l&&console.log("SSE Closed")}})}({site:t,sseBaseUrl:r,sseEndpoint:o,debug:void 0!==l&&l});return a._sseBaseUrl=r,a._site=t,a._sseEndpoint=o,a}};function zt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Gt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?zt(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zt(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function qt(){return{loadVideoInstantly:N,onTimeUpdate:le,getVideoDuration:ae,onVideoEnded:ue,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=X(Q.mark(function n(t,r){var o,i,l,a,u,s,c,d,v,f,p,m,h,g,y,b,w,k,S,I,O,j,D,x,P,A,N,R,M,_,L,B;return Q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!T(null==e?void 0:e.playerId)){n.next=3;break}return t({status:!0,msg:"Player already initialised",skipped:!0}),n.abrupt("return");case 3:if(S=(null==e?void 0:e.videoSourceUrl)||!1,I=null==e?void 0:e.asat,O=(null==e||null===(o=e.epg)||void 0===o?void 0:o.enable)||!1,j=null==e?void 0:e.videoId,D=(null==e||null===(i=e.series)||void 0===i?void 0:i.enable)||!1,x=(null==e?void 0:e.streamingInfo)||!1,window.videoId=j,P=null==e?void 0:e.token,!K(e)){n.next=18;break}if(sessionStorage.setItem("vlp_token",P),Y().set(null==e?void 0:e.refreshToken),P&&!W(P)){n.next=17;break}return r({status:!1,msg:"".concat(P?"Token is expired !":"Missing Authorization Token"),response:{token:P}}),n.abrupt("return");case 17:Vt=JSON.parse(atob(P.split(".")[1]));case 18:return window.siteName=null===(l=Vt)||void 0===l?void 0:l.site,window.siteId=null===(a=Vt)||void 0===a?void 0:a.siteId,e.isAnonymousUser=!(null===(u=Vt)||void 0===u||!u.anonymousId),e.siteOwner=(null===(s=Vt)||void 0===s?void 0:s.site)||null,e.userId=(null===(c=Vt)||void 0===c?void 0:c.userId)||null,z((null===(d=Vt)||void 0===d?void 0:d.userId)||(null===(v=Vt)||void 0===v?void 0:v.anonymousId)||null),window.watchHistory=e.watchHistory||null,A=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(f=e.series)&&void 0!==f&&f.enable?null:null==e?void 0:e.chromecastReceiverId,N=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,(R=null==e?void 0:e.errors)&&(window.customErrors=R),window.customData=null==e?void 0:e.customData,Ce(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),G.set(e.apiBaseUrl),null!=e&&e.skin&&!Te(e.skin)||(e.skin="VL_ONE"),q.setConfig(e),n.next=37,tn(e);case 37:N&&ze("https://www.googletagmanager.com/gtag/js?id=".concat(N)).then(function(){return $(N)}).catch(function(e){}),(M=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(A)))&&M.addEventListener("contextmenu",function(e){return e.preventDefault()}),(_=Ht({enable:null==e||null===(g=e.sse)||void 0===g?void 0:g.enable,site:null==e||null===(y=e.sse)||void 0===y?void 0:y.siteName,sseBaseUrl:null==e||null===(b=e.sse)||void 0===b?void 0:b.sseBaseUrl,sseEndpoint:null==e||null===(w=e.sse)||void 0===w?void 0:w.sseEndpoint,debug:null==e||null===(k=e.sse)||void 0===k?void 0:k.debug}))&&!_.isConnectionActive()&&_.connect(),S?(B={directPlaybackUrl:S,id:L="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},I?E(L,P).then(function(n){var o=(null==n?void 0:n.data)||{};Wn(A,{res:Gt(Gt({},o),B)},e,{resolve:t,reject:r})}).catch(function(e){C(e,A,r,L)}):Wn(A,{res:B},e,{resolve:t,reject:r})):x?Qn(e,{resolve:t,reject:r}):D?dt(e,{resolve:t,reject:r}):O?st(e,{resolve:t,reject:r}):at(e,{resolve:t,reject:r});case 43:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:ge,skip:R,getPlayer:be,play:M,pause:_,detectBrowser:Ee,rewind:L,loadVideo:u,seekToTimeStamp:se,isPlayerInitialised:T,load:B,authenticateLC:F,dispose:U,enableCaptions:he,disableCaptions:pe,getCaptions:fe,playSelectedResolution:ye,getSource:a,setVolume:qe,getVolume:Ke,disableControls:h,setPlaybackSpeed:ce,getEntitlementData:V,getSsaiEvents:H,playerEvents:de,onReplay:ve,setChapters:_t,getChapters:Lt,clearChapters:Bt,seekToChapter:Ft,getChapterEvents:Ct}}export{qt as V,Mt as i};
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"video.js/dist/video-js.min.css";import"./generic-c057edc5.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"video.js";export{V as default}from"./index-
|
|
1
|
+
import"video.js/dist/video-js.min.css";import"./generic-c057edc5.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"video.js";export{V as default}from"./index-2be4a3d8.js";import"./util-371cec8c.js";import"./captions-a7cd63fa.js";import"./renditions-225582e2.js";import"./resolution-0fbfb20a.js";import"./skin-606a59c2.js";import"./browser-d4613b36.js";import"./localisation-0bf399a1.js";import"axios";import"md5";import"js-cookie";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@viewlift/comscore/index.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/get";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"@viewlift/sse";import"@babel/runtime/helpers/assertThisInitialized";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as l,p as e,e as i}from"./skin-606a59c2.js";import{i as n}from"./index-8acba85e.js";import{T as o}from"./generic-c057edc5.js";import{e as r}from"./features-2852e53e.js";import{g as t}from"./localisation-0bf399a1.js";import"@babel/runtime/helpers/toConsumableArray";import"video.js";import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/get";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./util-371cec8c.js";import"@babel/runtime/helpers/typeof";import"./captions-a7cd63fa.js";import"./renditions-225582e2.js";import"./resolution-0fbfb20a.js";import"@babel/runtime/helpers/assertThisInitialized";import"./browser-d4613b36.js";import"@viewlift/comscore/index.js";import"@babel/runtime/helpers/slicedToArray";import"@viewlift/sse";import"axios";import"md5";import"js-cookie";var a='<svg xmlns="http://www.w3.org/2000/svg" style="display:none">\n <defs>\n <symbol id="vjs-icon-pause" viewBox="0 0 17 16">\n <path d="M6.00138 15.4894C6.02138 15.7494 5.82138 15.9694 5.56138 15.9894C5.54138 15.9894 5.52138 15.9894 5.50138 15.9894H2.50138C2.24138 16.0094 2.02138 15.8094 2.00138 15.5494C2.00138 15.5294 2.00138 15.5094 2.00138 15.4894V0.499411C1.98138 0.239411 2.18138 0.0194107 2.44138 -0.000589337C2.46138 -0.000589337 2.48138 -0.000589337 2.50138 -0.000589337H5.50138C5.76138 -0.0205893 5.98138 0.179411 6.00138 0.439411C6.00138 0.459411 6.00138 0.479411 6.00138 0.499411V15.4894ZM14.0014 0.509411C14.0214 0.249411 13.8214 0.0294105 13.5614 0.00941051C13.5414 0.00941051 13.5214 0.00941051 13.5014 0.00941051H10.5014C10.2414 -0.0105895 10.0214 0.189411 10.0014 0.449411C10.0014 0.469411 10.0014 0.489411 10.0014 0.509411V15.4994C9.98138 15.7594 10.1814 15.9794 10.4414 15.9994C10.4614 15.9994 10.4814 15.9994 10.5014 15.9994H13.5014C13.7614 16.0194 13.9814 15.8194 14.0014 15.5594C14.0014 15.5394 14.0014 15.5194 14.0014 15.4994V0.509411Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-play" viewBox="0 0 17 16">\n <path d="M0.38279 15.9526C0.28279 16.0326 0.142791 16.0126 0.0527906 15.9126C0.0127906 15.8626 -0.00720943 15.8026 0.00279057 15.7326V0.262601C-0.0172094 0.132601 0.0727907 0.0226013 0.192791 0.00260128C0.262791 -0.00739872 0.32279 0.0126014 0.38279 0.0426014L15.8528 7.8126C16.0628 7.9226 16.0628 8.0926 15.8528 8.1926L0.38279 15.9526Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-fullscreen" viewBox="0 0 24 24">\n <path d="M7 14H5V19H10V17H7V14ZM5 10H7V7H10V5H5V10ZM17 17H14V19H19V14H17V17ZM14 5V7H17V10H19V5H14Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-fullscreen-back" viewBox="0 0 24 24">\n <path d="M10.92 13.49L10.08 18.5C10.04 18.77 9.84001 18.83 9.64001 18.64L8.20001 17.2L5.41001 19.99L3.99001 18.57L6.78001 15.78L5.34001 14.34C5.15001 14.15 5.21001 13.95 5.48001 13.9L10.49 13.06C10.67 13.01 10.85 13.12 10.9 13.3C10.94 13.37 10.94 13.43 10.92 13.49ZM17.21 8.21L20 5.42L18.58 4L15.79 6.79L14.35 5.35C14.16 5.16 13.96 5.22 13.91 5.49L13.07 10.5C13.02 10.68 13.13 10.86 13.31 10.91C13.36 10.93 13.43 10.93 13.48 10.91L18.49 10.07C18.76 10.03 18.82 9.83 18.63 9.63L17.21 8.21Z" fill="#EBEBEB"/>\n </symbol>\n <symbol id="vjs-icon-volume" viewBox="0 0 24 24">\n <path d="M3 9.00047V15.0005H7L12 20.0005V4.00047L7 9.00047H3ZM16.5 12.0005C16.5 10.2305 15.48 8.71047 14 7.97047V16.0205C15.48 15.2905 16.5 13.7705 16.5 12.0005ZM14 3.23047V5.29047C16.89 6.15047 19 8.83047 19 12.0005C19 15.1705 16.89 17.8505 14 18.7105V20.7705C18.01 19.8605 21 16.2805 21 12.0005C21 7.72047 18.01 4.14047 14 3.23047Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-mute" viewBox="0 0 24 24">\n <path d="M11.65 4.28V19.72C11.65 20 11.48 20.08 11.27 19.89L5.86 15.09H2.9C2.62 15.09 2.38 14.86 2.38 14.57V9.43C2.38 9.15 2.61 8.91 2.9 8.91H5.86L11.27 4.11C11.48 3.92 11.65 3.99 11.65 4.28Z" fill="#EBEBEB"/>\n <path d="M19.0909 12.5238L21.2626 14.6955L19.8146 16.1436L17.6429 13.9718L15.4711 16.1436L14.0231 14.6955L16.1948 12.5238L14.0231 10.352L15.4711 8.904L17.6429 11.0757L19.8146 8.904L21.2626 10.352L19.0909 12.5238Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-pip" viewBox="0 0 24 24">\n <path d="M19 7H11V13H19V7ZM21 3H3C1.9 3 1 3.9 1 5V19C1 20.1 1.9 20.98 3 20.98H21C22.1 20.98 23 20.1 23 19V5C23 3.9 22.1 3 21 3ZM21 19.01H3V4.98H21V19.01Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-captions" viewBox="0 0 18 16">\n <path d="M16.5 1.5V14.5H1.5V1.5H16.5ZM16 0H2C0.89 0 0 0.9 0 2V14C0 15.1 0.89 16 2 16H16C17.1 16 18 15.1 18 14V2C18 0.9 17.1 0 16 0ZM8 7H6.5V6.5H4.5V9.5H6.5V9H8V10C8 10.55 7.55 11 7 11H4C3.45 11 3 10.55 3 10V6C3 5.45 3.45 5 4 5H7C7.55 5 8 5.45 8 6V7ZM15 7H13.5V6.5H11.5V9.5H13.5V9H15V10C15 10.55 14.55 11 14 11H11C10.45 11 10 10.55 10 10V6C10 5.45 10.45 5 11 5H14C14.55 5 15 5.45 15 6V7Z" fill="white"/>\n </symbol>\n </defs>\n</svg>',s='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M11.99 5V1L6.98999 6L11.99 11V7C15.3 7 17.99 9.69 17.99 13C17.99 16.31 15.3 19 11.99 19C8.67999 19 5.98999 16.31 5.98999 13H3.98999C3.98999 17.42 7.56999 21 11.99 21C16.41 21 19.99 17.42 19.99 13C19.99 8.58 16.41 5 11.99 5Z" fill="white"/>\n<path d="M10.89 16H10.04V12.74L9.03003 13.05V12.36L10.8 11.73H10.89V16Z" fill="white"/>\n<path d="M15.17 14.24C15.17 14.56 15.14 14.84 15.07 15.06C15 15.28 14.9 15.48 14.78 15.63C14.66 15.78 14.5 15.89 14.33 15.96C14.16 16.03 13.96 16.06 13.74 16.06C13.52 16.06 13.33 16.03 13.15 15.96C12.97 15.89 12.82 15.78 12.69 15.63C12.56 15.48 12.46 15.29 12.39 15.06C12.32 14.83 12.28 14.56 12.28 14.24V13.5C12.28 13.18 12.31 12.9 12.38 12.68C12.45 12.46 12.55 12.26 12.67 12.11C12.79 11.96 12.95 11.85 13.12 11.78C13.29 11.71 13.49 11.68 13.71 11.68C13.93 11.68 14.12 11.71 14.3 11.78C14.48 11.85 14.63 11.96 14.76 12.11C14.89 12.26 14.99 12.45 15.06 12.68C15.13 12.91 15.17 13.18 15.17 13.5V14.24ZM14.32 13.38C14.32 13.19 14.31 13.03 14.28 12.9C14.25 12.77 14.21 12.67 14.16 12.59C14.11 12.51 14.05 12.45 13.97 12.42C13.89 12.39 13.81 12.37 13.72 12.37C13.63 12.37 13.54 12.39 13.47 12.42C13.4 12.45 13.33 12.51 13.28 12.59C13.23 12.67 13.19 12.77 13.16 12.9C13.13 13.03 13.12 13.19 13.12 13.38V14.35C13.12 14.54 13.13 14.7 13.16 14.83C13.19 14.96 13.23 15.07 13.28 15.15C13.33 15.23 13.39 15.29 13.47 15.32C13.55 15.35 13.63 15.37 13.72 15.37C13.81 15.37 13.9 15.35 13.97 15.32C14.04 15.29 14.11 15.23 14.16 15.15C14.21 15.07 14.25 14.96 14.27 14.83C14.29 14.7 14.31 14.54 14.31 14.35V13.38H14.32Z" fill="white"/>\n</svg>';function u(u,v){l(u).addClass("skin_cn_news"),function(n,o){var r,s,u,v,c=l(n);if(!c)return;if(c.el().insertBefore(e(a),null!==(r=c.el().firstChild)&&void 0!==r?r:null),null===(s=c.controlBar)||void 0===s||s.removeChild("VolumePanel"),null===(u=c.controlBar)||void 0===u||u.addChild("VolumePanel",{inline:!0},1),!(null!==(v=c.controlBar)&&void 0!==v&&v.getChild("PictureInPictureToggle"))){var d,C,p=null===(d=c.controlBar)||void 0===d?void 0:d.getChild("FullscreenToggle"),m=p?c.controlBar.children().indexOf(p):void 0;null===(C=c.controlBar)||void 0===C||C.addChild("PictureInPictureToggle",{},m)}(function(l){var e,n,o,r=(null==l||null===(e=l.controlBar)||void 0===e||null===(n=e.getChild("PlayToggle"))||void 0===n||null===(o=n.el())||void 0===o?void 0:o.firstChild)||null;if(!r)return;var t=i(r,l.paused()?"#vjs-icon-play":"#vjs-icon-pause");l.on("play",function(){return t.setAttributeNS(null,"href","#vjs-icon-pause")}),l.on("pause",function(){return t.setAttributeNS(null,"href","#vjs-icon-play")})})(c),function(l){var e,n,o=(null==l||null===(e=l.controlBar)||void 0===e||null===(n=e.getChild("VolumePanel"))||void 0===n?void 0:n.el())||null,r=null==o?void 0:o.querySelector(".vjs-mute-control .vjs-icon-placeholder");if(!r)return;var t=i(r,l.muted()?"#vjs-icon-mute":"#vjs-icon-volume");l.on("volumechange",function(){var e=l.muted()||0===l.volume();t.setAttributeNS(null,"href",e?"#vjs-icon-mute":"#vjs-icon-volume")})}(c),function(l){var e,n,o,r=(null==l||null===(e=l.controlBar)||void 0===e||null===(n=e.getChild("PictureInPictureToggle"))||void 0===n||null===(o=n.el())||void 0===o?void 0:o.querySelector(".vjs-icon-placeholder"))||null;if(!r)return;i(r,"#vjs-icon-pip")}(c),function(l){var e,n,o=(null==l||null===(e=l.controlBar)||void 0===e||null===(n=e.getChild("SubsCapsButton"))||void 0===n?void 0:n.el())||null,r=null==o?void 0:o.querySelector(".vjs-icon-placeholder");if(!r)return;i(r,"#vjs-icon-captions");var t=function(){for(var e=l.textTracks(),i=!1,n=0;n<e.length;n++){var r=e[n];if(("captions"===r.kind||"subtitles"===r.kind)&&"showing"===r.mode){i=!0;break}}o.classList.toggle("vjs-cc-on",i)};t(),l.textTracks().on("change",t)}(c),function(l){var e,n,o,r=(null==l||null===(e=l.controlBar)||void 0===e||null===(n=e.getChild("FullscreenToggle"))||void 0===n||null===(o=n.el())||void 0===o?void 0:o.firstChild)||null;if(!r)return;var t=i(r,"#vjs-icon-fullscreen");l.on("fullscreenchange",function(){null==t||t.setAttributeNS(null,"href",l.isFullscreen()?"#vjs-icon-fullscreen-back":"#vjs-icon-fullscreen")})}(c),function(l,e){var i,n=null==l||null===(i=l.controlBar)||void 0===i?void 0:i.getChild("SeekToLive");if(n){var o,r,a=n.el().querySelector(".vjs-seek-to-live-text"),s=t("liveText")||"LIVE",u=t("goLiveText")||"GO LIVE",v=function(){var e,i;a&&(a.textContent=null!==(e=l.liveTracker)&&void 0!==e&&null!==(i=e.atLiveEdge)&&void 0!==i&&i.call(e)?s:u)};v(),l.on("timeupdate",v),null===(o=l.liveTracker)||void 0===o||null===(r=o.on)||void 0===r||r.call(o,"liveedgechange",v),n.on("click",function(){if(l.paused())try{l.play()}catch(l){}})}if(null!=e&&e.liveVideo&&null!=e&&e.liveui&&l.liveTracker){var c=function(){return function(l){var e,i,n,o,r=null==l||null===(e=l.controlBar)||void 0===e||null===(i=e.remainingTimeDisplay)||void 0===i?void 0:i.el();if(!r)return;var t=r.querySelector(".vjs-remaining-time-display");null!==(n=l.liveTracker)&&void 0!==n&&null!==(o=n.atLiveEdge)&&void 0!==o&&o.call(n)?r.style.display="none":(r.style.display="flex",t&&(t.innerText=(a=function(l){var e=l.seekable();return e&&e.length>0?Math.max(0,e.end(0)-l.currentTime()):0}(l),s=Math.floor(a/3600),u=Math.floor(a%3600/60),v=Math.floor(a%60),c=function(l){return String(l).padStart(2,"0")},0===s?"".concat(c(u),":").concat(c(v)):"".concat(c(s),":").concat(c(u),":").concat(c(v)))));var a,s,u,v,c}(l)};l.liveTracker.on("liveedgechange",c),l.on("timeupdate",c)}}(c,o)}(u,v),function(e,i){var t,a,u,v,c,d,C=(null==i?void 0:i.liveVideo)||!1,p=(null==i||null===(t=i.res)||void 0===t?void 0:t.contentType)||"video",m=(null==i||null===(a=i.res)||void 0===a||null===(u=a[p])||void 0===u||null===(v=u.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,h=C&&m?"livedvr":"vod";(null!=i&&i.liveui||m)&&r(e,"CN_NEWS",s);var f=o.getConfig();if(null!=f&&null!==(c=f.chaptersConfig)&&void 0!==c&&c.enable||null!=f&&null!==(d=f.chapters)&&void 0!==d&&d.length){var g;!function(e,i){var n,o=null===(n=l(e))||void 0===n?void 0:n.el();if(!o||!i)return;var r=function(l,e){null!=e&&""!==e&&o.style.setProperty(l,e)};r("--vl-chapter-color",i.markerColor),r("--vl-chapter-active",i.markerActiveColor),r("--vl-chapter-hover",i.markerHoverColor),r("--vl-chapter-size",null!=i.markerSize?"".concat(i.markerSize,"px"):null),r("--vl-chapter-opacity",null!=i.markerOpacity?String(i.markerOpacity):null),r("--vl-chapter-tooltip",i.tooltipColor)}(e,null==f||null===(g=f.chaptersConfig)||void 0===g?void 0:g.style),n(e,{chapters:(null==f?void 0:f.chapters)||[],timeMode:h,res:null==i?void 0:i.res,chaptersConfig:(null==f?void 0:f.chaptersConfig)||{}})}}(u,v)}export{u as initialiseSkin};
|
|
1
|
+
import{g as l,p as e,e as i}from"./skin-606a59c2.js";import{i as n}from"./index-2be4a3d8.js";import{T as o}from"./generic-c057edc5.js";import{e as r}from"./features-2852e53e.js";import{g as t}from"./localisation-0bf399a1.js";import"@babel/runtime/helpers/toConsumableArray";import"video.js";import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/get";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./util-371cec8c.js";import"@babel/runtime/helpers/typeof";import"./captions-a7cd63fa.js";import"./renditions-225582e2.js";import"./resolution-0fbfb20a.js";import"@babel/runtime/helpers/assertThisInitialized";import"./browser-d4613b36.js";import"@viewlift/comscore/index.js";import"@babel/runtime/helpers/slicedToArray";import"@viewlift/sse";import"axios";import"md5";import"js-cookie";var a='<svg xmlns="http://www.w3.org/2000/svg" style="display:none">\n <defs>\n <symbol id="vjs-icon-pause" viewBox="0 0 17 16">\n <path d="M6.00138 15.4894C6.02138 15.7494 5.82138 15.9694 5.56138 15.9894C5.54138 15.9894 5.52138 15.9894 5.50138 15.9894H2.50138C2.24138 16.0094 2.02138 15.8094 2.00138 15.5494C2.00138 15.5294 2.00138 15.5094 2.00138 15.4894V0.499411C1.98138 0.239411 2.18138 0.0194107 2.44138 -0.000589337C2.46138 -0.000589337 2.48138 -0.000589337 2.50138 -0.000589337H5.50138C5.76138 -0.0205893 5.98138 0.179411 6.00138 0.439411C6.00138 0.459411 6.00138 0.479411 6.00138 0.499411V15.4894ZM14.0014 0.509411C14.0214 0.249411 13.8214 0.0294105 13.5614 0.00941051C13.5414 0.00941051 13.5214 0.00941051 13.5014 0.00941051H10.5014C10.2414 -0.0105895 10.0214 0.189411 10.0014 0.449411C10.0014 0.469411 10.0014 0.489411 10.0014 0.509411V15.4994C9.98138 15.7594 10.1814 15.9794 10.4414 15.9994C10.4614 15.9994 10.4814 15.9994 10.5014 15.9994H13.5014C13.7614 16.0194 13.9814 15.8194 14.0014 15.5594C14.0014 15.5394 14.0014 15.5194 14.0014 15.4994V0.509411Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-play" viewBox="0 0 17 16">\n <path d="M0.38279 15.9526C0.28279 16.0326 0.142791 16.0126 0.0527906 15.9126C0.0127906 15.8626 -0.00720943 15.8026 0.00279057 15.7326V0.262601C-0.0172094 0.132601 0.0727907 0.0226013 0.192791 0.00260128C0.262791 -0.00739872 0.32279 0.0126014 0.38279 0.0426014L15.8528 7.8126C16.0628 7.9226 16.0628 8.0926 15.8528 8.1926L0.38279 15.9526Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-fullscreen" viewBox="0 0 24 24">\n <path d="M7 14H5V19H10V17H7V14ZM5 10H7V7H10V5H5V10ZM17 17H14V19H19V14H17V17ZM14 5V7H17V10H19V5H14Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-fullscreen-back" viewBox="0 0 24 24">\n <path d="M10.92 13.49L10.08 18.5C10.04 18.77 9.84001 18.83 9.64001 18.64L8.20001 17.2L5.41001 19.99L3.99001 18.57L6.78001 15.78L5.34001 14.34C5.15001 14.15 5.21001 13.95 5.48001 13.9L10.49 13.06C10.67 13.01 10.85 13.12 10.9 13.3C10.94 13.37 10.94 13.43 10.92 13.49ZM17.21 8.21L20 5.42L18.58 4L15.79 6.79L14.35 5.35C14.16 5.16 13.96 5.22 13.91 5.49L13.07 10.5C13.02 10.68 13.13 10.86 13.31 10.91C13.36 10.93 13.43 10.93 13.48 10.91L18.49 10.07C18.76 10.03 18.82 9.83 18.63 9.63L17.21 8.21Z" fill="#EBEBEB"/>\n </symbol>\n <symbol id="vjs-icon-volume" viewBox="0 0 24 24">\n <path d="M3 9.00047V15.0005H7L12 20.0005V4.00047L7 9.00047H3ZM16.5 12.0005C16.5 10.2305 15.48 8.71047 14 7.97047V16.0205C15.48 15.2905 16.5 13.7705 16.5 12.0005ZM14 3.23047V5.29047C16.89 6.15047 19 8.83047 19 12.0005C19 15.1705 16.89 17.8505 14 18.7105V20.7705C18.01 19.8605 21 16.2805 21 12.0005C21 7.72047 18.01 4.14047 14 3.23047Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-mute" viewBox="0 0 24 24">\n <path d="M11.65 4.28V19.72C11.65 20 11.48 20.08 11.27 19.89L5.86 15.09H2.9C2.62 15.09 2.38 14.86 2.38 14.57V9.43C2.38 9.15 2.61 8.91 2.9 8.91H5.86L11.27 4.11C11.48 3.92 11.65 3.99 11.65 4.28Z" fill="#EBEBEB"/>\n <path d="M19.0909 12.5238L21.2626 14.6955L19.8146 16.1436L17.6429 13.9718L15.4711 16.1436L14.0231 14.6955L16.1948 12.5238L14.0231 10.352L15.4711 8.904L17.6429 11.0757L19.8146 8.904L21.2626 10.352L19.0909 12.5238Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-pip" viewBox="0 0 24 24">\n <path d="M19 7H11V13H19V7ZM21 3H3C1.9 3 1 3.9 1 5V19C1 20.1 1.9 20.98 3 20.98H21C22.1 20.98 23 20.1 23 19V5C23 3.9 22.1 3 21 3ZM21 19.01H3V4.98H21V19.01Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-captions" viewBox="0 0 18 16">\n <path d="M16.5 1.5V14.5H1.5V1.5H16.5ZM16 0H2C0.89 0 0 0.9 0 2V14C0 15.1 0.89 16 2 16H16C17.1 16 18 15.1 18 14V2C18 0.9 17.1 0 16 0ZM8 7H6.5V6.5H4.5V9.5H6.5V9H8V10C8 10.55 7.55 11 7 11H4C3.45 11 3 10.55 3 10V6C3 5.45 3.45 5 4 5H7C7.55 5 8 5.45 8 6V7ZM15 7H13.5V6.5H11.5V9.5H13.5V9H15V10C15 10.55 14.55 11 14 11H11C10.45 11 10 10.55 10 10V6C10 5.45 10.45 5 11 5H14C14.55 5 15 5.45 15 6V7Z" fill="white"/>\n </symbol>\n </defs>\n</svg>',s='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M11.99 5V1L6.98999 6L11.99 11V7C15.3 7 17.99 9.69 17.99 13C17.99 16.31 15.3 19 11.99 19C8.67999 19 5.98999 16.31 5.98999 13H3.98999C3.98999 17.42 7.56999 21 11.99 21C16.41 21 19.99 17.42 19.99 13C19.99 8.58 16.41 5 11.99 5Z" fill="white"/>\n<path d="M10.89 16H10.04V12.74L9.03003 13.05V12.36L10.8 11.73H10.89V16Z" fill="white"/>\n<path d="M15.17 14.24C15.17 14.56 15.14 14.84 15.07 15.06C15 15.28 14.9 15.48 14.78 15.63C14.66 15.78 14.5 15.89 14.33 15.96C14.16 16.03 13.96 16.06 13.74 16.06C13.52 16.06 13.33 16.03 13.15 15.96C12.97 15.89 12.82 15.78 12.69 15.63C12.56 15.48 12.46 15.29 12.39 15.06C12.32 14.83 12.28 14.56 12.28 14.24V13.5C12.28 13.18 12.31 12.9 12.38 12.68C12.45 12.46 12.55 12.26 12.67 12.11C12.79 11.96 12.95 11.85 13.12 11.78C13.29 11.71 13.49 11.68 13.71 11.68C13.93 11.68 14.12 11.71 14.3 11.78C14.48 11.85 14.63 11.96 14.76 12.11C14.89 12.26 14.99 12.45 15.06 12.68C15.13 12.91 15.17 13.18 15.17 13.5V14.24ZM14.32 13.38C14.32 13.19 14.31 13.03 14.28 12.9C14.25 12.77 14.21 12.67 14.16 12.59C14.11 12.51 14.05 12.45 13.97 12.42C13.89 12.39 13.81 12.37 13.72 12.37C13.63 12.37 13.54 12.39 13.47 12.42C13.4 12.45 13.33 12.51 13.28 12.59C13.23 12.67 13.19 12.77 13.16 12.9C13.13 13.03 13.12 13.19 13.12 13.38V14.35C13.12 14.54 13.13 14.7 13.16 14.83C13.19 14.96 13.23 15.07 13.28 15.15C13.33 15.23 13.39 15.29 13.47 15.32C13.55 15.35 13.63 15.37 13.72 15.37C13.81 15.37 13.9 15.35 13.97 15.32C14.04 15.29 14.11 15.23 14.16 15.15C14.21 15.07 14.25 14.96 14.27 14.83C14.29 14.7 14.31 14.54 14.31 14.35V13.38H14.32Z" fill="white"/>\n</svg>';function u(u,v){l(u).addClass("skin_cn_news"),function(n,o){var r,s,u,v,c=l(n);if(!c)return;if(c.el().insertBefore(e(a),null!==(r=c.el().firstChild)&&void 0!==r?r:null),null===(s=c.controlBar)||void 0===s||s.removeChild("VolumePanel"),null===(u=c.controlBar)||void 0===u||u.addChild("VolumePanel",{inline:!0},1),!(null!==(v=c.controlBar)&&void 0!==v&&v.getChild("PictureInPictureToggle"))){var d,C,p=null===(d=c.controlBar)||void 0===d?void 0:d.getChild("FullscreenToggle"),m=p?c.controlBar.children().indexOf(p):void 0;null===(C=c.controlBar)||void 0===C||C.addChild("PictureInPictureToggle",{},m)}(function(l){var e,n,o,r=(null==l||null===(e=l.controlBar)||void 0===e||null===(n=e.getChild("PlayToggle"))||void 0===n||null===(o=n.el())||void 0===o?void 0:o.firstChild)||null;if(!r)return;var t=i(r,l.paused()?"#vjs-icon-play":"#vjs-icon-pause");l.on("play",function(){return t.setAttributeNS(null,"href","#vjs-icon-pause")}),l.on("pause",function(){return t.setAttributeNS(null,"href","#vjs-icon-play")})})(c),function(l){var e,n,o=(null==l||null===(e=l.controlBar)||void 0===e||null===(n=e.getChild("VolumePanel"))||void 0===n?void 0:n.el())||null,r=null==o?void 0:o.querySelector(".vjs-mute-control .vjs-icon-placeholder");if(!r)return;var t=i(r,l.muted()?"#vjs-icon-mute":"#vjs-icon-volume");l.on("volumechange",function(){var e=l.muted()||0===l.volume();t.setAttributeNS(null,"href",e?"#vjs-icon-mute":"#vjs-icon-volume")})}(c),function(l){var e,n,o,r=(null==l||null===(e=l.controlBar)||void 0===e||null===(n=e.getChild("PictureInPictureToggle"))||void 0===n||null===(o=n.el())||void 0===o?void 0:o.querySelector(".vjs-icon-placeholder"))||null;if(!r)return;i(r,"#vjs-icon-pip")}(c),function(l){var e,n,o=(null==l||null===(e=l.controlBar)||void 0===e||null===(n=e.getChild("SubsCapsButton"))||void 0===n?void 0:n.el())||null,r=null==o?void 0:o.querySelector(".vjs-icon-placeholder");if(!r)return;i(r,"#vjs-icon-captions");var t=function(){for(var e=l.textTracks(),i=!1,n=0;n<e.length;n++){var r=e[n];if(("captions"===r.kind||"subtitles"===r.kind)&&"showing"===r.mode){i=!0;break}}o.classList.toggle("vjs-cc-on",i)};t(),l.textTracks().on("change",t)}(c),function(l){var e,n,o,r=(null==l||null===(e=l.controlBar)||void 0===e||null===(n=e.getChild("FullscreenToggle"))||void 0===n||null===(o=n.el())||void 0===o?void 0:o.firstChild)||null;if(!r)return;var t=i(r,"#vjs-icon-fullscreen");l.on("fullscreenchange",function(){null==t||t.setAttributeNS(null,"href",l.isFullscreen()?"#vjs-icon-fullscreen-back":"#vjs-icon-fullscreen")})}(c),function(l,e){var i,n=null==l||null===(i=l.controlBar)||void 0===i?void 0:i.getChild("SeekToLive");if(n){var o,r,a=n.el().querySelector(".vjs-seek-to-live-text"),s=t("liveText")||"LIVE",u=t("goLiveText")||"GO LIVE",v=function(){var e,i;a&&(a.textContent=null!==(e=l.liveTracker)&&void 0!==e&&null!==(i=e.atLiveEdge)&&void 0!==i&&i.call(e)?s:u)};v(),l.on("timeupdate",v),null===(o=l.liveTracker)||void 0===o||null===(r=o.on)||void 0===r||r.call(o,"liveedgechange",v),n.on("click",function(){if(l.paused())try{l.play()}catch(l){}})}if(null!=e&&e.liveVideo&&null!=e&&e.liveui&&l.liveTracker){var c=function(){return function(l){var e,i,n,o,r=null==l||null===(e=l.controlBar)||void 0===e||null===(i=e.remainingTimeDisplay)||void 0===i?void 0:i.el();if(!r)return;var t=r.querySelector(".vjs-remaining-time-display");null!==(n=l.liveTracker)&&void 0!==n&&null!==(o=n.atLiveEdge)&&void 0!==o&&o.call(n)?r.style.display="none":(r.style.display="flex",t&&(t.innerText=(a=function(l){var e=l.seekable();return e&&e.length>0?Math.max(0,e.end(0)-l.currentTime()):0}(l),s=Math.floor(a/3600),u=Math.floor(a%3600/60),v=Math.floor(a%60),c=function(l){return String(l).padStart(2,"0")},0===s?"".concat(c(u),":").concat(c(v)):"".concat(c(s),":").concat(c(u),":").concat(c(v)))));var a,s,u,v,c}(l)};l.liveTracker.on("liveedgechange",c),l.on("timeupdate",c)}}(c,o)}(u,v),function(e,i){var t,a,u,v,c,d,C=(null==i?void 0:i.liveVideo)||!1,p=(null==i||null===(t=i.res)||void 0===t?void 0:t.contentType)||"video",m=(null==i||null===(a=i.res)||void 0===a||null===(u=a[p])||void 0===u||null===(v=u.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,h=C&&m?"livedvr":"vod";(null!=i&&i.liveui||m)&&r(e,"CN_NEWS",s);var f=o.getConfig();if(null!=f&&null!==(c=f.chaptersConfig)&&void 0!==c&&c.enable||null!=f&&null!==(d=f.chapters)&&void 0!==d&&d.length){var g;!function(e,i){var n,o=null===(n=l(e))||void 0===n?void 0:n.el();if(!o||!i)return;var r=function(l,e){null!=e&&""!==e&&o.style.setProperty(l,e)};r("--vl-chapter-color",i.markerColor),r("--vl-chapter-active",i.markerActiveColor),r("--vl-chapter-hover",i.markerHoverColor),r("--vl-chapter-size",null!=i.markerSize?"".concat(i.markerSize,"px"):null),r("--vl-chapter-opacity",null!=i.markerOpacity?String(i.markerOpacity):null),r("--vl-chapter-tooltip",i.tooltipColor)}(e,null==f||null===(g=f.chaptersConfig)||void 0===g?void 0:g.style),n(e,{chapters:(null==f?void 0:f.chapters)||[],timeMode:h,res:null==i?void 0:i.res,chaptersConfig:(null==f?void 0:f.chaptersConfig)||{}})}}(u,v)}export{u as initialiseSkin};
|