@viewlift/player-backup 2.0.312-backup → 2.0.313-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/{autoNextVideo-405fbb9c.js → autoNextVideo-1219220b.js} +1 -1
- package/cjs/bundle.css +738 -738
- package/cjs/{features-497aa685.js → features-1b6f9b76.js} +1 -1
- package/cjs/generic-460c2f4c.js +1 -0
- package/cjs/{index-1b1814b2.js → index-15040639.js} +1 -1
- package/cjs/{index-f0e7f225.js → index-d012ce66.js} +1 -1
- package/cjs/{index-a3c4762d.js → index-df46f39c.js} +1 -1
- package/cjs/{index-160bf3cf.js → index-fed823e4.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-d97aac93.js → multicamv2-b46493cd.js} +1 -1
- package/cjs/{multicamv2-b7179cca.js → multicamv2-fb311cf2.js} +1 -1
- package/cjs/{nextEpisodeButton-d8673023.js → nextEpisodeButton-651ab380.js} +1 -1
- package/cjs/{playlist-da78386b.js → playlist-649c8f45.js} +1 -1
- package/cjs/{series-a44ff797.js → series-b109f9a2.js} +1 -1
- package/cjs/{series-v2-d70b0c21.js → series-v2-86b32c0e.js} +1 -1
- package/cjs/{series-v2-f583f57c.js → series-v2-d2950b02.js} +1 -1
- package/cjs/{skin-329840ee.js → skin-08149121.js} +1 -1
- package/cjs/{skin-43fd6f9f.js → skin-2193cc41.js} +1 -1
- package/cjs/{skin-64a712c1.js → skin-222dc6b7.js} +1 -1
- package/cjs/{skin-57d7b91d.js → skin-4e3170cf.js} +1 -1
- package/cjs/{skin-fe84f7e4.js → skin-765e1355.js} +1 -1
- package/cjs/{skin-125b2f1b.js → skin-886a6d4b.js} +1 -1
- package/cjs/{skin-ca777bf7.js → skin-8bcb6a55.js} +1 -1
- package/cjs/{skin-b8d21775.js → skin-c8d40d82.js} +1 -1
- package/cjs/{skin-986ee45f.js → skin-dbacca02.js} +1 -1
- package/cjs/{skin-765eaa0a.js → skin-e4a31cb3.js} +1 -1
- package/cjs/{videoSelector-78d2a88e.js → videoSelector-13aaa2d8.js} +1 -1
- package/cjs/{videoSelector-dd2d5324.js → videoSelector-6a0fa8d0.js} +1 -1
- package/esm/{autoNextVideo-d7d17130.js → autoNextVideo-1ade2ac8.js} +1 -1
- package/esm/bundle.css +738 -738
- package/esm/{features-f8a70ef8.js → features-c38a5458.js} +1 -1
- package/esm/{generic-e99fa280.js → generic-859e1b0f.js} +1 -1
- package/esm/{index-5e82fbd8.js → index-022a4725.js} +1 -1
- package/esm/{index-0a27b711.js → index-41558ed2.js} +1 -1
- package/esm/{index-7fc11ec8.js → index-4fd3b927.js} +1 -1
- package/esm/{index-e3e95c56.js → index-6c225809.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-6816cd94.js → multicamv2-21b1f1c1.js} +1 -1
- package/esm/{multicamv2-20f178e4.js → multicamv2-71e2abdd.js} +1 -1
- package/esm/{nextEpisodeButton-5c8edd3e.js → nextEpisodeButton-36f416dc.js} +1 -1
- package/esm/{playlist-dd6e58b6.js → playlist-d838f1a7.js} +1 -1
- package/esm/{series-46f0c516.js → series-d1b982ab.js} +1 -1
- package/esm/{series-v2-d433b819.js → series-v2-03cef666.js} +1 -1
- package/esm/{series-v2-8adf9d91.js → series-v2-2559637f.js} +1 -1
- package/esm/{skin-45f8682c.js → skin-08cd7f59.js} +1 -1
- package/esm/{skin-11edae05.js → skin-0fb217b1.js} +1 -1
- package/esm/{skin-7198271b.js → skin-2080b142.js} +1 -1
- package/esm/{skin-4eadb6ed.js → skin-21d67daa.js} +1 -1
- package/esm/{skin-f24e5bea.js → skin-255cf575.js} +1 -1
- package/esm/{skin-e26bb2ef.js → skin-361a4e27.js} +1 -1
- package/esm/{skin-e7a418d5.js → skin-49aa30ba.js} +1 -1
- package/esm/{skin-06d0e08e.js → skin-77405f2e.js} +1 -1
- package/esm/{skin-12cd8332.js → skin-77c06b80.js} +1 -1
- package/esm/{skin-9aeadb01.js → skin-a28700c4.js} +1 -1
- package/esm/{videoSelector-0713849a.js → videoSelector-25b6e54e.js} +1 -1
- package/esm/{videoSelector-54aca560.js → videoSelector-556c1f53.js} +1 -1
- package/package.json +2 -2
- package/cjs/generic-215f4b2f.js +0 -1
- package/cjs/index-eed20004.js +0 -1
- package/cjs/skin-645e94e3.js +0 -1
- package/esm/autoNextVideo-8969c6df.js +0 -1
- package/esm/features-412626fb.js +0 -1
- package/esm/generic-34f78811.js +0 -1
- package/esm/index-06ad6212.js +0 -1
- package/esm/index-07cb2e05.js +0 -1
- package/esm/index-88ef87d6.js +0 -1
- package/esm/index-f3d95023.js +0 -1
- package/esm/multicamv2-5850afc8.js +0 -1
- package/esm/multicamv2-7d56314d.js +0 -1
- package/esm/nextEpisodeButton-e5c7a4f2.js +0 -1
- package/esm/playlist-47344207.js +0 -1
- package/esm/series-74ab47cc.js +0 -1
- package/esm/series-v2-15df8835.js +0 -1
- package/esm/series-v2-3b5e2560.js +0 -1
- package/esm/skin-1ffbc63d.js +0 -1
- package/esm/skin-212eda31.js +0 -1
- package/esm/skin-29b49d84.js +0 -1
- package/esm/skin-4abc33d7.js +0 -1
- package/esm/skin-6d648b73.js +0 -1
- package/esm/skin-a02fbfbe.js +0 -1
- package/esm/skin-b236cc43.js +0 -1
- package/esm/skin-b2991b04.js +0 -1
- package/esm/skin-c90e133a.js +0 -1
- package/esm/skin-e56529d4.js +0 -1
- package/esm/videoSelector-6ac21745.js +0 -1
- package/esm/videoSelector-a5e0df6e.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/typeof";import{e as n,v as t,a2 as a,
|
|
1
|
+
import e from"@babel/runtime/helpers/typeof";import{e as n,v as t,a2 as a,S as o}from"./generic-859e1b0f.js";import{g as r}from"./skin-3653c5b3.js";import i from"@babel/runtime/helpers/toConsumableArray";import l from"@babel/runtime/helpers/slicedToArray";import{g as c}from"./localisation-0bf399a1.js";var s=!1,u=function(e,n,t){var a=r(e);a?n>=0&&n<=a.duration()?(t({status:!0,msg:"Successfully seeked to timestamp : ".concat(n)}),a.currentTime(n)):t({status:!1,msg:"Out of bounds, please provide a valid timestamp"}):t("Cannot find player with id: '".concat(e,"'"))},d=function(e,n){var t=r(e);if(!t)return"Cannot find player with id: '".concat(e,"'");try{return t.playbackRate(n),"Playback speed set to ".concat(n,"x")}catch(e){return"Error: ".concat(e)}},v=function(e,o){var i=r(e);i?(i.on("ended",function(){return s=!0}),i.on("timeupdate",function(){if(!i.paused()&&s){var e,r,l=null===(e=n())||void 0===e||null===(r=e.video)||void 0===r?void 0:r.id;t.get(l)?(t.clear(),a.clear(),o(),t.set(l)):(t.clear(),t.set(l)),s=!1}})):o("Cannot find player with id: '".concat(e,"'"))},m=function(e,n){var t=r(e);t?t.on("timeupdate",function(){return n(t.currentTime())}):n("Cannot find player with id: '".concat(e,"'"))},f=function(e,n){var t=r(e);t?t.on("ended",function(){return n(!0)}):n("Cannot find player with id: '".concat(e,"'"))},h=function(e){var n=r(e);return n?n.duration():"Cannot find player with id: '".concat(e,"'")};function g(){var n=function(e,n){var t=r(e);if(!t)throw"Cannot find player with id: '".concat(e,"'");if("function"!=typeof n)throw"Callback function (cb) is missing or not a function";return t};return{onPlay:function(e,t){n(e,t).on("play",function(){return t()})},onPause:function(e,t){n(e,t).on("pause",function(){return t()})},onMute:function(e,t){var a=n(e,t);a.on("volumechange",function(){a.muted()?t({muted:!0}):t({muted:!1})})},onPictureInPictureChange:function(e,t){var a=n(e,t);a.on("enterpictureinpicture",function(){t({pip:!0})}),a.on("leavepictureinpicture",function(){t({pip:!1})})},onFullScreenChange:function(e,t){var a=n(e,t);a.on("fullscreenchange",function(e){a.isFullscreen_?t({isFullscreen:!0}):t({isFullscreen:!1})})},onSetVolume:function(e,t){var a=n(e,t);a.on("volumechange",function(){var e=100*a.volume().toFixed(2);a.muted()?t({vol:0}):t({vol:e})})},onSeeked:function(e,t){var a=n(e,t);a.on("seeked",function(){t({seeked:a.currentTime()})})},onSubtitleEnable:function(e,t){var a=n(e,t);a.textTracks().on("change",function(e){console.log(a.textTracks());var n=a.textTracks().tracks_.filter(function(e){return("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode});n.length>0&&t({enabled:n[0]})})},onDisableSubtitles:function(e,t){var a=n(e,t);a.textTracks().on("change",function(e){var n,o;console.log(a.textTracks()),(null==a||null===(n=a.textTracks())||void 0===n||null===(o=n.tracks_)||void 0===o?void 0:o.every(function(e){return"showing"!=e.mode}))&&t({captions_disabled:!0})})},onSubtitleCueChange:function(t,a){var o=n(t,a);o.on("loadeddata",function(){var n,t,r,i,l,c=o.textTracks();"object"==e(o.dash)&&null!=o.dash&&o.dash.mediaPlayer.on(null===(t=window)||void 0===t||null===(r=t.dashjs)||void 0===r||null===(i=r.MediaPlayer)||void 0===i||null===(l=i.events)||void 0===l?void 0:l.CAPTION_RENDERED,function(e){a(e)});for(var s=0;s<c.length;s++){var u=c[s];"metadata"===u.kind&&(u.mode="hidden",n=u)}n&&n.addEventListener("cuechange",function(){var e=n.activeCues;if(e&&e.length>0)for(var t=0;t<e.length;t++){var o=e[t];a(o)}else console.log("no active cue at this moment")})})},onError:function(e,t){var a=n(e,t);a.on("error",function(){var e,n;t({error:null==a||null===(e=a.error())||void 0===e?void 0:e.code,msg:null==a||null===(n=a.error())||void 0===n?void 0:n.message})})}}}var p,E=null,y=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),a=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=a>0&&t>4?a:0,r=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),a=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(a-=1),a<0&&(t-=1),t}(new Date,new Date(n));return[r>0&&o>0?r:0,o,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},C=function(e){var n,t=l(e,8),a=t[0],o=t[1],r=t[2],i=t[3],c=t[4],s=t[5],u=t[6],d=t[7];n=a>=1?" ".concat(a," Year"):o>=1?" ".concat(o," month"):r>=1?" ".concat(r," week"):i>=1?" ".concat(i," day"):c<24&&c>=12?" ".concat(c," hour"):c>0?"".concat(c," hours ").concat(s," minutes ").concat(u," seconds"):s>0?"".concat(s," minutes ").concat(u," seconds"):"".concat(u," seconds"),d.textContent="".concat(n)},D=(p={scheduleStartTimeMs:0,scheduleEndTimeMs:0},{get:function(){return p},set:function(e){p={scheduleStartTimeMs:null==e?void 0:e.startDateTime,scheduleEndTimeMs:null==e?void 0:e.endDateTime}}});function w(e,n,t,a){if(e){var o=function(){var e,o,l=null===(e=D.get())||void 0===e?void 0:e.scheduleStartTimeMs,s=null===(o=D.get())||void 0===o?void 0:o.scheduleEndTimeMs,u=Date.now();if(u-s>0){var d=document.getElementsByClassName("error-message")[0];return d&&(d.textContent=c("eventEnded")||"Game has ended",a.textContent=""),clearInterval(r),void(null==t||t())}var v=l-u;if(v/1e3<=0)return clearInterval(r),null==n||n([0,0,0,0,0,0,0,a]),void(null==t||t());var m=y(v,l);null==n||n([].concat(i(m),[a]))};o();var r=setInterval(o,1e3);return r}}var T=function(e,n,t){var a,o,r,i,l,s,u,d,v=null==n||null===(a=n.response)||void 0===a||null===(o=a.data)||void 0===o?void 0:o.errorCode,m=(null==n||null===(r=n.response)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.errorMessage)||(null==n?void 0:n.message)||null;D.set({startDateTime:null==n||null===(l=n.response)||void 0===l||null===(s=l.data)||void 0===s?void 0:s.scheduleStartDate,endDateTime:null==n||null===(u=n.response)||void 0===u||null===(d=u.data)||void 0===d?void 0:d.scheduleEndDate}),function(e,n,t,a){var o,r,i=Date.now(),l=null===(o=D.get())||void 0===o?void 0:o.scheduleStartTimeMs,s=null===(r=D.get())||void 0===r?void 0:r.scheduleEndTimeMs,u=function(e,n,t,a){var o;e<0?o=c("eventNotStarted")||a||"Game starts in":(n>0||"VIDEO_NOT_EXISTS"==t)&&(o=c("eventEnded")||a||"Game has ended");return o||a}(i-l,i-s,n,t);if(document.getElementsByClassName("error-container")[0]){var d=document.getElementsByClassName("error-message")[0];d&&(d.textContent="".concat(u));var v=document.getElementsByClassName("error-timer-message")[0];v&&w(Math.abs(l),C,a,v)}else{var m=document.getElementById(e).parentElement;if(m){var f=document.createElement("div");f.className="error-container";var h=document.createElement("div");h.className="error-message";var g=document.createElement("div");g.className="error-timer-message",h.textContent="".concat(u),f.appendChild(h),f.appendChild(g),m.append(f),w(Math.abs(l),C,a,g)}}}(e,v,m,t)};function M(e,n){var t=n.scheduleEndDate,a=n.scheduleStartDate;D.set({startDateTime:a,endDateTime:t}),E&&clearInterval(E),E=setInterval(function(){var n,t=Date.now(),a=null===(n=D.get())||void 0===n?void 0:n.scheduleEndTimeMs;if(console.log("scheduleEndTimeMs",a),a&&t>a){var i;console.log("Game ended");var l=r(e);if(o(e)&&l){var s;l.dispose(),console.log("Player disposed");var u=null===(s=document.getElementsByClassName("vl-container"))||void 0===s?void 0:s[0],d=document.createElement("video");d.id=e,d.className="video-js",d.style.width="100%",d.style.height="100%",u&&u.appendChild(d)}var v=c("eventEnded")||"Game has ended",m=null===(i=document.getElementsByClassName("error-container"))||void 0===i?void 0:i[0];if(m){var f=m.querySelector(".error-message");f&&(f.textContent=v)}else{var h=document.getElementById(e),g=null==h?void 0:h.parentElement;if(g){(m=document.createElement("div")).className="error-container";var p=document.createElement("div");p.className="error-message",p.textContent=v,m.appendChild(p),g.append(m)}}clearInterval(E)}},1e3)}export{T as a,f as b,u as c,d,v as e,h as g,M as h,m as o,g as p,D as s};
|
|
@@ -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 I,z as E,A as D,B as O,C as j,D as C,E as P,F as x,G as _,H as A,I as R,J as L,K as N,L as M,M as U,N as B,O as F,P as H,Q as V,R as z,S as q,T as G,U as W,V as K,W as Y,X as $,Y as J,Z as X,_ as Q,$ as Z,a0 as ee,a1 as ne}from"./generic-e99fa280.js";import te from"@babel/runtime/helpers/defineProperty";import re from"@babel/runtime/helpers/asyncToGenerator";import oe from"@babel/runtime/regenerator";import ie from"video.js";import le from"@babel/runtime/helpers/classCallCheck";import ae from"@babel/runtime/helpers/createClass";import ue from"@babel/runtime/helpers/get";import se from"@babel/runtime/helpers/inherits";import ce from"@babel/runtime/helpers/possibleConstructorReturn";import de from"@babel/runtime/helpers/getPrototypeOf";import{h as ve,a as fe,s as pe,o as me,g as he,b as ge,c as ye,d as be,p as we,e as ke}from"./index-07cb2e05.js";import{g as Se,d as Te,s as Ie,a as Ee,e as De}from"./captions-75f20905.js";import{g as Oe}from"./renditions-620d93b3.js";import{playSelectedResolution as je}from"./resolution-2ee017b4.js";import{g as Ce,i as Pe,t as xe,p as _e,a as Ae}from"./skin-3653c5b3.js";import{d as Re}from"./browser-de5f6a74.js";import{s as Le}from"./localisation-0bf399a1.js";import Ne from"@babel/runtime/helpers/typeof";import"@viewlift/comscore/index.js";import Me from"@babel/runtime/helpers/toConsumableArray";import{createSSETransport as Ue}from"@viewlift/sse";import{r as Be}from"./relatedVideosManager-8dd9aa24.js";function Fe(e,n,t,r){var o=ue(de(1&r?e.prototype:e),n,t);return 2&r&&"function"==typeof o?function(e){return o.apply(t,e)}:o}function He(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(He=function(){return!!e})()}var Ve=ie.getComponent("TextTrackSettings"),ze=ie.dom,qe=[{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"}],Ge=qe.map(function(e){return e.value}),We="16",Ke="vlp-caption-font-size-px",Ye="vlp-caption-font-size-style",$e=".vjs-font-percent > select",Je=function(e){return-1!==Ge.indexOf(e)?e:We},Xe=null;Ve?(Xe=function(){se(r,Ve);var e,n,t=(e=r,n=He(),function(){var t,r=de(e);if(n){var o=de(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return ce(this,t)});function r(e,n){var o;return le(this,r),(o=t.call(this,e,n)).customUiReady_=!0,o.applyCustomFontSizeUI_(),o}return ae(r,[{key:"applyCustomFontSizeUI_",value:function(){this.replaceFontSizeOptions_(),this.bindFontSizeChange_(),this.restoreCustomFontSize_()}},{key:"replaceFontSizeOptions_",value:function(){var e=this.$($e);if(e){for(;e.firstChild;)e.removeChild(e.firstChild);qe.forEach(function(n){e.appendChild(ze.createEl("option",{value:n.value,textContent:n.label}))}),e.value=We}}},{key:"bindFontSizeChange_",value:function(){var e=this,n=this.$($e);n&&this.on(n,"change",function(){return e.applyFontSize_(n.value)})}},{key:"applyFontSize_",value:function(e){var n=Je(e);if("undefined"!=typeof document){var t=document.getElementById(Ye);t||((t=document.createElement("style")).id=Ye,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(Ke)}catch(e){}var n=Je(e),t=this.$($e);t&&(t.value=n),this.applyFontSize_(n)}},{key:"getValues",value:function(){var e=Fe(r,"getValues",this,3)([]);return e&&delete e.fontPercent,e||{}}},{key:"setDefaults",value:function(){if(Fe(r,"setDefaults",this,3)([]),this.customUiReady_){var e=this.$($e);e&&(e.value=We),this.applyFontSize_(We)}}},{key:"saveSettings",value:function(){if(Fe(r,"saveSettings",this,3)([]),this.options_&&this.options_.persistTextTrackSettings){var e=this.$($e);if(e)try{window.localStorage.setItem(Ke,Je(e.value))}catch(e){}}}},{key:"handleLanguagechange",value:function(){Fe(r,"handleLanguagechange",this,3)([]),this.applyCustomFontSizeUI_()}}]),r}(),ie.registerComponent("TextTrackSettings",Xe)):console.warn("[vlp] CustomTextTrackSettings: video.js TextTrackSettings is not registered; skipping override.");var Qe=function(e){return new Promise(function(n,t){if(Ze(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)}})},Ze=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},en=function(e,n,t){var r=Ce(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,"'")})},nn=function(e){var n=Ce(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},tn=function(){var e=re(oe.mark(function e(n){var t,r,o,i,l;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Ce(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,Qe("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(ie),e.finish(13);case 16:(l=ie.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"==Re()?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)}}(),rn=function(e,n){var t=Ce(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,r,o,i,l,a=this.el(),u=ie.dom.getPointerPosition(a,n).x;ie.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 on=function(){var e=re(oe.mark(function e(){return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Qe("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)}}(),ln=function(){var n=re(oe.mark(function n(){return oe.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)}}(),an=function(){var e=re(oe.mark(function e(){return oe.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){ie.getPlugin("eme")||ie.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),un=function(){var e=re(oe.mark(function e(){var n;return oe.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(ie),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)}}(),sn=function(){var e=re(oe.mark(function e(){return oe.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)}}(),cn=function(){var e=re(oe.mark(function e(){return oe.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)}}(),dn=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){Qe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(ie)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(ie)})},loadAdsLibrary:on,loadEMELibrary:an,loadMuxPlugin:un,loadDvrSeekbar:sn,loadContribDash:cn,loadComscorePlugin:ln});function vn(e){return fn.apply(this,arguments)}function fn(){return(fn=re(oe.mark(function e(n){var t;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,on();case 3:t&&"Safari"==Re()&&Promise.resolve().then(function(){return dn}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function pn(e){return mn.apply(this,arguments)}function mn(){return(mn=re(oe.mark(function e(n){var t,r,o,i,l,a,u,s,c,d;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d=Ce(n.playerId),e.next=3,ln();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 hn(e,n){return gn.apply(this,arguments)}function gn(){return(gn=re(oe.mark(function e(n,t){var r,o,i,l,a,u,s,c,d,v,f,p,m,h;return oe.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"==Re()?an():"caliente"!=(null===(h=window)||void 0===h?void 0:h.siteName)?cn():an():"Safari"!=Re()&&f?cn():null,p?pn(n):null,m?un():null,tn(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 yn(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 bn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?yn(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):yn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var wn=new Set,kn=null,Sn=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"]=Cn(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"]=Dn(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=On(e),f["c3.cm.genreList"]=In(e),f["c3.cm.genre"]=Tn(e),f["c3.cm.channel"]=En(e,i);var m=_n(r(),e);return f=bn(bn({},f),m)},Tn=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"},In=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"},En=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"},Dn=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"},On=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"},jn=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)},Cn=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Pn,xn,_n=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},An=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"}},Rn=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Ln=function(){var e=re(oe.mark(function e(n,t){var r,o,l,a,u,s,c,d,v,f,p,m;return oe.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=Ce(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=An(t.keySystem);p("contentInfo",{DRMEnabled:r})}else p("contentInfo",{DRMEnabled:"None"})}),n||p("contentInfo",{DRMEnabled:"None"})}),f.on("loadstart",function(){var e,n;kn&&kn!==f.currentSrc()&&p("playbackEnded"),p("setPlayer",f),wn.clear(),kn=f.currentSrc();var r=Rn(f.currentType()),o=i(),u=Sn(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]=jn(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",Nn.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(){wn.has(f.currentSrc())||(wn.add(f.currentSrc()),p("playbackStarted",null))}),f.on("ended",function(){wn.has(f.currentSrc())&&wn.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==wn||wn.clear(),p("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Nn=(Pn={},{setData:function(e){Pn=bn(bn({},Pn),e)},getData:function(){return Pn}}),Mn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-4eadb6ed.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-06d0e08e.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-6d648b73.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-7198271b.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-12cd8332.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?import("./skin-e56529d4.js").then(function(t){t.initialiseSkin(e,n)}):"news"==t?import("./skin-c90e133a.js").then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?import("./skin-11edae05.js").then(function(t){t.initialiseSkin(e,n)}):"mini"==t?import("./skin-e7a418d5.js").then(function(t){t.initialiseSkin(e,n)}):"CN_NEWS"==t&&import("./skin-4abc33d7.js").then(function(t){t.initialiseSkin(e,n)})};function Un(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 Bn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Un(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Un(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Fn=[],Hn=0,Vn=null;function zn(){xn=null,Fn=[],Hn=0,Vn=null}function qn(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=Gn(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 Bn(Bn({},e),{},te({},n,u[n]))},{}),c=o.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===xn});c<0?o.push(Bn(Bn({content:s},e),{},{addedDate:l,updateDate:l})):o[c]=Bn(Bn(Bn({},o[c]),e),{},{updateDate:l});localStorage.setItem("".concat(r),JSON.stringify(o))}(y={completed:c,watchedTime:h,watchedPercentage:g},d,n.siteOwner):(y=Bn(Bn({videoId:xn,watchedTime:h,watchedPercentage:g,doneWatching:c,profileId:d},Vn&&{seriesId:Vn}),p&&{originalObjectId:p}),l(y).then(function(e){}).catch(function(e){})),Hn=v+t}function Gn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Wn(e,n,t){var r=Gn(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 Kn=!1,Yn=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)&&!Kn){var i=$n(e,"videoAssets","secondaryVideoAssets"),l=a(i,n);return l&&u(n,l),Kn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function $n(e,n,t){if(Array.isArray(e))return e.map(function(e){return $n(e,n,t)});if(null!==e&&"object"===Ne(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]=$n(e[o],n,t)}),r}return e}function Jn(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 Xn(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)?Xn(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 Xn(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 Qn(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 Zn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Qn(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var et=function(e,n,t,r){var o,l,a,u,m,h=r.res,g=r.sres,y=Ce(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(Zn({status:!0,msg:"Player Initialised"},g?{seriesResponse:g,response:h}:{response:h}))}),y.on("loadeddata",function(){var t,r,o,l,a=Se(e);if(null==a||a.map(function(n){return Te(e,n.id)}),S&&"Safari"===Re())try{var u;null==y||null===(u=y.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==y||!y.muted())&&en(e,sessionStorage.getItem("volume")||"100");var s=i();if(d(n),v(),null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.isExternal){var c=Zn(Zn({},n),h);!function(e,n){var t,r,o;if(null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&"function"==typeof(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.cb)){var i,l,a,u=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,s=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.completionThreshold)||95,c=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.cb,d=-1;e.on("seeked",function(){var n=Math.floor(e.currentTime()),t=n-n%u;if(d=t,t>0){var r=Math.floor(n/e.duration()*100);c({watchedTime:n,watchedPercentage:r,doneWatching:r>=s})}}),e.on("timeupdate",function(){var n=Math.floor(e.currentTime()),t=n-n%u;if(n%u===0&&t!==d){d=t;var r=Math.floor(n/e.duration()*100);c({watchedTime:n,watchedPercentage:r,doneWatching:r>=s||!1})}}),e.on("ended",function(){c({watchedTime:Math.floor(e.duration()),watchedPercentage:100,doneWatching:!0})})}}(y,c)}else if(null!=n&&n.watchHistory&&null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.enable&&(!n.isAnonymousUser||null!=n&&null!==(o=n.watchHistory)&&void 0!==o&&o.saveOffline)){var f,p,m=Zn(Zn({},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&&(Vn=null==n||null===(o=n.series)||void 0===o?void 0:o.id),Fn=[],Hn=0,xn=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=Ce(e);a&&(a.on("dispose",zn),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());Fn.includes(Hn)||(e!=Hn||e<l?e>Hn&&(Hn=e+l):(Fn.push(e),qn(a,n,l)))}}),a.one("ended",function(){qn(a,n,l,!0)}))}(e,m,null==s||null===(f=s.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.id)}if(null!=n&&null!==(l=n.analytics)&&void 0!==l&&l.muxKey&&null!=y&&y.mux){var g,b,w,k,T,I,E=(null===(g=i())||void 0===g?void 0:g.video)||(null==h?void 0:h.video),D=null==E?void 0:E.gist,O={env_key:null==n||null===(b=n.analytics)||void 0===b?void 0:b.muxKey,player_name:"vl-web-player",player_version:null===(w=window)||void 0===w?void 0:w.vl_player_version,video_id:null==D?void 0:D.id,video_title:null==D?void 0:D.title,video_series:null==E||null===(k=E.series)||void 0===k?void 0:k.title,video_stream_type:null!=E&&null!==(T=E.streamingInfo)&&void 0!==T&&T.isLiveStream?"live":"video",viewer_user_id:null==n||null===(I=n.analytics)||void 0===I?void 0:I.userId};y.mux({debug:!1,data:O})}}),y.textTracks().on("change",function(n){var t=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];Ie(e),y.trigger("subtitlechanged",t)}),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&&Yn(h,e)}),y.on("error",function(){var n,r;(console.log("ERROR",y.error(),y.error().code),4===y.error().code&&k)?Yn(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{var h,g,b,w,k,S,T,I=null!==(h=null==n?void 0:n.watchHistoryResumeTime)&&void 0!==h?h:null==n||null===(g=n.watchHistory)||void 0===g?void 0:g.watchedTime,E=null!==(b=null!==(w=null==n?void 0:n.watchedPercentage)&&void 0!==w?w:null==n||null===(k=n.watchHistory)||void 0===k?void 0:k.watchedPercentage)&&void 0!==b?b:0,D=null!==(S=null==n||null===(T=n.watchHistory)||void 0===T?void 0:T.completionThreshold)&&void 0!==S?S:95;I&&E<D&&setTimeout(function(){y.currentTime(I)},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"==Ne(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=Jn(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=[],d=Jn(n);try{for(d.s();!(s=d.n()).done;){var v,f,p,m=s.value;("Chrome"==Re()||"Edge"==Re()&&(null!==(v=navigator)&&void 0!==v&&null!==(f=v.userAgent)&&void 0!==f&&f.includes("Macintosh")||!w))&&null!=m&&null!==(p=m.label)&&void 0!==p&&p.includes("5.1")?y.audioTracks().removeTrack(m):c.push(m)}}catch(e){d.e(e)}finally{d.f()}for(var h=c.find(function(e){return"main"===e.kind}),g=h||c.find(function(e){return e.enabled})||c[0],b=0,k=c;b<k.length;b++){var S=k[b];S.enabled=S===g}}}))};function nt(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 tt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?nt(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nt(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function rt(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 ot(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)?ot(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 ot(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 it={debug:5,info:4,warn:3,error:2,fatal:1,none:0,off:0,DEBUG:5,INFO:4,WARN:3,ERROR:2,FATAL:1,NONE:0,OFF:0};function lt(e,n,t){var r=j.getConfig()||{};T(e,{status:t,message:"DRM ".concat(n," request failed")},"playback",{requestKind:n,videoId:null==r?void 0:r.videoId})}function at(e){try{if(null!=e&&e.__vlLicenseUrl)return e.__vlLicenseUrl;var n=null==e?void 0:e.keySystems;if(n)for(var t=0,r=Object.keys(n);t<r.length;t++){var o=n[r[t]];if("string"==typeof o)return o;if(null!=o&&o.url)return o.url;if(null!=o&&o.licenseUri)return o.licenseUri}var i=null==e?void 0:e.keySystemOptions;if(Array.isArray(i)){var l,a=rt(i);try{for(a.s();!(l=a.n()).done;){var u,s,c,d=l.value,v=(null==d||null===(u=d.options)||void 0===u?void 0:u.serverURL)||(null==d||null===(s=d.options)||void 0===s?void 0:s.licenseUri)||(null==d||null===(c=d.options)||void 0===c?void 0:c.url);if(v)return v}}catch(e){a.e(e)}finally{a.f()}}}catch(e){}return""}function ut(e){if(null!=e&&e.__vlDrmLicenseUrl)return e.__vlDrmLicenseUrl;try{return at("function"==typeof e.currentSource?e.currentSource():null)}catch(e){return""}}function st(e,n){n&&!n.__vlDrmDashHooksInstalled&&(n.__vlDrmDashHooksInstalled=!0,"function"==typeof n.addResponseInterceptor&&n.addResponseInterceptor(function(e){try{var n=(null==e?void 0:e.request)||{},t=(null==e?void 0:e.url)||(null==n?void 0:n.url)||"",r=I(t,(null==n?void 0:n.type)||(null==e?void 0:e.type));if(E(r)){var o=D(e,null);O(o)||lt(t,r,o)}}catch(e){}return Promise.resolve(e)}),"function"==typeof n.registerLicenseRequestFilter&&n.registerLicenseRequestFilter(function(e){try{null!=e&&e.url&&(n.__vlLastLicenseUrl=e.url)}catch(e){}return Promise.resolve()}),"function"==typeof n.on&&n.on("public_licenseRequestComplete",function(t){try{var r,o,i,l;if(null==t||!t.error)return;var a=null!==(r=null==t||null===(o=t.error)||void 0===o||null===(i=o.data)||void 0===i?void 0:i.responseCode)&&void 0!==r?r:D(null,t.error);lt((null==t||null===(l=t.data)||void 0===l?void 0:l.url)||n.__vlLastLicenseUrl||ut(e)||"","license",a)}catch(e){}}))}var ct=!1,dt=null,vt=new Set;function ft(e){if(e&&!e.__vlDrmDashRegistered){e.__vlDrmDashRegistered=!0,vt.add(e),e.__vlDrmDashEnabled=!0;var n=function(){e.__vlDrmDashRegistered&&(e.__vlDrmDashRegistered=!1,e.__vlDrmDashEnabled=!1,vt.delete(e),function(){if(ct&&!(vt.size>0)){var e=null==ie?void 0:ie.Html5DashJS;e&&"function"==typeof e.removeHook&&"function"==typeof dt&&e.removeHook("beforeinitialize",dt),ct=!1,dt=null}}())};"function"==typeof e.one?e.one("dispose",n):"function"==typeof e.on&&e.on("dispose",n)}}function pt(e){if(e){ft(e),function(){if(!ct){var e=null==ie?void 0:ie.Html5DashJS;e&&"function"==typeof e.hook&&(dt=function(e,n){null!=e&&e.__vlDrmDashEnabled&&st(e,n)},ct=!0,e.hook("beforeinitialize",dt))}}(),function(e){e&&!e.__vlEmeDrmErrorInstalled&&(e.__vlEmeDrmErrorInstalled=!0,e.on("error",function(){try{var n,t="function"==typeof e.error?e.error():null;if(!t||!S(t))return;if(null!=e&&null!==(n=e.dash)&&void 0!==n&&n.mediaPlayer)return;lt(ut(e),"license",null)}catch(e){}}))}(e);var n=function(){var n;!function(e){var n,t,r=null==e||null===(n=e.tech_)||void 0===n||null===(t=n.vhs)||void 0===t?void 0:t.xhr;r&&"function"==typeof r.onResponse&&!e.__vlDrmVhsHooksInstalled&&(e.__vlDrmVhsHooksInstalled=!0,r.onResponse(function(e,n,t){try{var r=function(e){return(null==e?void 0:e.uri)||(null==e?void 0:e.url)||(null==e?void 0:e.src)||""}(e),o=I(r,null==e?void 0:e.type);if(!E(o))return;var i=D(t,n);O(i)&&!n||lt(r,o,i)}catch(e){}}))}(e),st(e,null==e||null===(n=e.dash)||void 0===n?void 0:n.mediaPlayer)};n(),e.on("xhr-hooks-ready",n),e.on("loadstart",function(){setTimeout(n,0)})}}var mt=function(e,n,t,r){var o,i,l,s,c,d,v,p,S,T,I,E,D,O,j,C,P,x,_,A,R,L,N,M,U,B,F,H,V,z,q,G,W,K,Y,$,J,X,Q=n.res,Z=void 0===Q?null:Q,ee=n.sres,ne=void 0===ee?null:ee,le=function(){try{var e,n,t=new URLSearchParams((null===(e=window)||void 0===e||null===(n=e.location)||void 0===n?void 0:n.search)||""),r=t.get("loglevel")||null;return{playerDebug:"true"===t.get("playerdebug"),logLevel:r,dashLogLevel:null!=r&&null!=it[r]?it[r]:5}}catch(e){return{playerDebug:!1,logLevel:null,dashLogLevel:5}}}(),ae=le.playerDebug,ue=le.logLevel,se=le.dashLogLevel;ae&&(console.log("[PLAYER DEBUG] config:",t),console.log("[PLAYER DEBUG] entitlement (res):",Z),ne&&console.log("[PLAYER DEBUG] series response (sres):",ne));var ce=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],de=(null===(o=Z)||void 0===o?void 0:o.contentType)||"video",ve=Pe(null===(i=Z)||void 0===i||null===(l=i[de])||void 0===l||null===(s=l.gist)||void 0===s?void 0:s.videoImageUrl)||Pe(null===(c=Z)||void 0===c||null===(d=c[de])||void 0===d||null===(v=d.gist)||void 0===v||null===(p=v.imageGist)||void 0===p?void 0:p.r16x9),fe=(null===(S=Z)||void 0===S||null===(T=S[de])||void 0===T||null===(I=T.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,pe=!(null===(E=Z)||void 0===E||null===(D=E[de])||void 0===D||null===(O=D.streamingInfo)||void 0===O||!O.isLiveStream)||"linearchannel"===de,me=(null===(j=Z)||void 0===j||null===(C=j.ads)||void 0===C||null===(P=C.preRoll)||void 0===P||null===(x=P.adTags)||void 0===x||null===(_=x.web)||void 0===_?void 0:_.active)&&(null===(A=Z)||void 0===A||null===(R=A.ads)||void 0===R||null===(L=R.preRoll)||void 0===L||null===(N=L.adTags)||void 0===N||null===(M=N.web)||void 0===M?void 0:M.url);Z=tt(tt({},Z),{},{audioAssetSource:null==t?void 0:t.audioAssetSource});var he=(null==t||null===(U=t.customData)||void 0===U?void 0:U.ads)||{},ge=(null===(B=Z)||void 0===B||null===(F=B[de])||void 0===F?void 0:F.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==he?void 0:he.vodAdSticherProvider)||!1,ye=!(null===(H=Z)||void 0===H||null===(V=H[de])||void 0===V||!V.isSSAIEnabled)&&"TRANSMIT"==(null==he?void 0:he.liveAdSticherProvider)&&!(null==he||!he.liveAdClientSideTracking),be=(null==t?void 0:t.latency)||6,we=(null==t?void 0:t.skin_settings)||{},ke=null,Se=(J={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==we?void 0:we.pictureInPictureToggle)||!1},playbackRates:null!=we&&we.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==t.skin,liveui:fe},te(J,"autoplay",null==t?void 0:t.autoplay),te(J,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!me),te(J,"loop",(null==t?void 0:t.loop)||!1),te(J,"audioPosterMode",null==t?void 0:t.audioPosterMode),te(J,"html5",tt(tt({dash:tt(tt({},!ie.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:tt(tt({},((null==t?void 0:t.debugConfig)&&(null==t||null===(z=t.debugConfig)||void 0===z?void 0:z.enable)||ae)&&{debug:{logLevel:se}}),{},{streaming:{delay:{liveDelay:be},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:tt({},"IE"==Re()&&{enableStallFix:!0,stallSeek:1}),abr:tt(tt(tt(tt({},(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:tt(tt(tt({},(null==t?void 0:t.initialBandwidth)&&{bandwidth:t.initialBandwidth}),{},{liveRangeSafeTimeDelta:be,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==t||!t.initialBandwidth},(null==t||null===(q=t.customData)||void 0===q?void 0:q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(G=null==t?void 0:t.enableLowInitialPlaylist)&&void 0!==G&&G},((null==t?void 0:t.debugConfig)&&(null==t||null===(W=t.debugConfig)||void 0===W?void 0:W.enable)||ae)&&{debug:!0}),debug:(null==t?void 0:t.debugConfig)&&(null==t||null===(K=t.debugConfig)||void 0===K?void 0:K.enable)||ae||!1,nativeTextTracks:"Safari"==Re()},0==(null==t||null===(Y=t.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===($=t.customData)||void 0===$?void 0:$.nativeVideoTracks)&&{nativeVideoTracks:!1})),te(J,"poster",ve),te(J,"techOrder",ce),te(J,"chromecast",{requestCustomDataFn:function(n){var r,o,i=Ce(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,I=(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=I;var E=(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=E}var D=(null==e||null===(r=e[f])||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.contentType)||"VIDEO";p.contentType=D;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 C=null==e||null===(s=e[f])||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=C,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}(Z,n,l),u=l.find(function(e){return"showing"===e.mode})||null;return ke=u?{language:u.language||u.lang||null,label:u.label||null}:null,tt(tt({},a),{},{activeCaption:{enabled:!!u,language:(null==u?void 0:u.language)||(null==u?void 0:u.lang)||null,label:(null==u?void 0:u.label)||null},transmitTrackingUrl:m.get()||null,convivaMetaData:tt({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},Nn.getData())})},modifyLoadRequestFn:function(n){var t,r,o,i,l,a=Ce(e),u=(null==a?void 0:a.currentSource())||{};!(null===(t=Z)||void 0===t||null===(r=t[de])||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}}),J);if(!ie.getPlayers()[e]){(null!=t&&t.debugConfig&&null!=t&&null!==(X=t.debugConfig)&&void 0!==X&&X.enable||ae)&&ie.log.level(ue||"debug");var Te=ie(e,Se,function(){var n=re(oe.mark(function n(){var o,i,l,s,c,d,v,p,m,S,T,I,E,D,O,j,C,P,x,_,A,R;return oe.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return pt(Te),console.log(Te),console.log(ie.VERSION),console.log(ie.getPlugins()),n.next=6,hn(t,Z);case 6:if(null!=t&&t.debugConfig&&null!=t&&null!==(o=t.debugConfig)&&void 0!==o&&o.enable||ae){try{ie.log.level(ue||"debug")}catch(e){}(E=function(){try{var e,n,t;null==Te||null===(e=Te.dash)||void 0===e||null===(n=e.mediaPlayer)||void 0===n||null===(t=n.updateSettings)||void 0===t||t.call(n,{debug:{logLevel:se}})}catch(e){}})(),Te.one("loadedmetadata",E)}if(D=null===(i=Z)||void 0===i||null===(l=i[de])||void 0===l||null===(s=l.liveDetails)||void 0===s?void 0:s.startOverTime,pe&&r.resolve(tt({status:!0,msg:"Player Initialised"},ne?{seriesResponse:ne,response:Z}:{response:Z})),y(e,{analyticsCb:null==t?void 0:t.analyticsCb,analyticsEventParams:null==t?void 0:t.analyticsEventParams,userId:null==t?void 0:t.userId}),Ln(e,t),Te.on("chromecastConnected",function(){var e=Te.textTracks().tracks_.find(function(e){return("captions"===e.kind||"subtitles"===e.kind)&&"showing"===e.mode}),n=e?{language:e.language||null,label:e.label||null}:null,t=function(){var e=n||ke;if(e){var t=Te.textTracks().tracks_.filter(function(e){return"captions"===e.kind||"subtitles"===e.kind}),r=t.find(function(n){return e.language&&n.language===e.language})||t.find(function(n){return e.label&&n.label===e.label})||t[0];r&&"showing"!==r.mode&&(r.mode="showing")}};Te.one("loadeddata",function(){return setTimeout(t,0)}),setTimeout(t,1500)}),/Android/i.test(navigator.userAgent)&&(ie.options.vhs.overrideNative=!0),fe&&rn(e,D),!me||null!=t&&null!==(c=t.customData)&&void 0!==c&&c.disableAds||b(e,me,Z),O=a(Z,e),console.log(O),ae&&(console.log("[PLAYER DEBUG] source:",O),console.log("[PLAYER DEBUG] videojs options:",Se)),null!=t&&t.nearestClusterUrl&&(O=w(O,t.nearestClusterUrl)),!ge){n.next=25;break}return n.next=22,k(e,Z);case 22:O=n.sent,n.next=29;break;case 25:if(!ye){n.next=29;break}return n.next=28,g(O,Z,e);case 28:O=n.sent;case 29:Te&&(Te.__vlDrmLicenseUrl=at(O)),O?u(e,O):(r.reject({status:!1,msg:"Incompatible / Missing Source",response:Z}),f(e,"Incompatible / Missing Source")),((null===(d=Z)||void 0===d||null===(v=d[de])||void 0===v||null===(p=v.contentDetails)||void 0===p||null===(m=p.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(S=Z)||void 0===S||null===(T=S[de])||void 0===T||null===(I=T.closedCaptions)||void 0===I?void 0:I.length)>0)&&(R=(null===(C=Z)||void 0===C||null===(P=C[de])||void 0===P||null===(x=P.contentDetails)||void 0===x?void 0:x.closedCaptions)||(null===(_=Z)||void 0===_||null===(A=_[de])||void 0===A?void 0:A.closedCaptions),j=R.filter(function(e){return"VTT"===e.format}),Ee(e,j)),null!=t&&t.disableControls?h(e):Mn(e,tt(tt(tt({},t),Se),{},{liveVideo:pe,isDvrEnabled:fe,res:Z,sres:ne})),et(e,tt(tt(tt({},t),Se),{},{liveVideo:pe}),r,{res:Z,sres:ne});case 34:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function ht(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?ht(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ht(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var yt=function(e,n){var t=n.resolve,r=n.reject,o=null==e?void 0:e.playerId,i=bt(e);mt(o,{res:i},e,{resolve:t,reject:r})},bt=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)||[],S=(null==e||null===(c=e.customData)||void 0===c||null===(d=c.ads)||void 0===d?void 0:d.isSSAIEnabled)||!1,T=null==e?void 0:e.token,I=C(T);null==I||I.site;var E=null==I?void 0:I.siteId,D=(null==e||null===(v=e.customData)||void 0===v||null===(f=v.comscore)||void 0===f?void 0:f.video)||null,O=gt(gt({id:"".concat(E,"_external")},!h&&{directPlaybackUrl:null==m?void 0:m.url}),{},{video:gt(gt(gt(gt(gt({drmEnabled:h,streamingInfo:gt(gt({videoAssets:gt(gt({},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==D?void 0:D.isLiveStream)&&{isLiveStream:null==D?void 0:D.isLiveStream})},S&&{isSSAIEnabled:S}),{},{metadata:k,liveDetails:{isDvrEnabled:null==p?void 0:p.isDvrEnabled},gist:gt(gt(gt({},y&&{videoImageUrl:y}),(null==D?void 0:D.videoId)&&{id:null==D?void 0:D.videoId}),(null==D?void 0:D.videoTitle)&&{title:null==D?void 0:D.videoTitle}),contentDetails:gt({},(null==b?void 0:b.length)>0&&{closedCaptions:Me(b)})},(null==D?void 0:D.runtime)&&{runtime:null==D?void 0:D.runtime}),(null==D?void 0:D.publishDate)&&{publishDate:null==D?void 0:D.publishDate}),(null==D?void 0:D.platform)&&{platform:null==D?void 0:D.platform}),(null==D?void 0:D.series)&&{series:null==D?void 0:D.series}),ads:{preRoll:{adTags:{web:gt(gt({},g&&{active:!0}),g&&{url:g})}}}});return D&&(null!=D&&D.isDvrEnabled&&(O.video.liveDetails=gt(gt({},O.video.liveDetails),{},{isDvrEnabled:null==D?void 0:D.isDvrEnabled})),null!=D&&D.metadata&&(O.video.metadata=[].concat(Me(O.video.metadata),Me(null==D?void 0:D.metadata)))),O};function wt(e,n){return kt.apply(this,arguments)}function kt(){return(kt=re(oe.mark(function e(n,t){var r,o,i,l,a,u,c,d,v;return oe.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,A();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),P(a,d,v).then(function(e){var t,r,o,v,f,p,m,h,g,y,b;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 w=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,k=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;ve(u,{scheduleEndDate:w,scheduleStartDate:k});var S=null==e?void 0:e.data;if(null!=n&&null!==(y=n.watchHistory)&&void 0!==y&&y.isExternal)S.contentType="video",mt(u,{res:S},n,{resolve:i,reject:l});else if(null!=n&&n.watchHistory&&null!=n&&null!==(b=n.watchHistory)&&void 0!==b&&b.enable&&!c){var T;if((null===(T=n.watchHistory)||void 0===T?void 0:T.saveOffline)||!1){var I,E,D,O=Wn((null===(I=n.watchHistory)||void 0===I?void 0:I.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===(D=O[0])||void 0===D?void 0:D.watchedPercentage)||null;S.contentType="video",mt(u,{res:S},n,{resolve:i,reject:l})}else x(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(){}).finally(function(){mt(u,{res:S},n,{resolve:i,reject:l})})}else mt(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&&fe(u,e,i),_(e,u,l,a)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function St(e,n){return Tt.apply(this,arguments)}function Tt(){return(Tt=re(oe.mark(function e(n,t){var r,o,i,l,a,u,s,c;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,e.next=3,A();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),R(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,mt(u,{res:t},n,{resolve:i,reject:l})}).catch(function(e){_(e,u,l,videoId)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function It(e,n){return Et.apply(this,arguments)}function Et(){return(Et=re(oe.mark(function e(n,t){var r,o,i,l,a,u,c;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,e.next=3,A();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,M.set(parseInt(u)),c=null==n||null===(r=n.series)||void 0===r?void 0:r.id,L(c,l).then(function(e){var t,r,u,d=e.data,v=e.data.seasons;U(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);N(c,l),P(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),mt(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:o,reject:i})}).catch(function(e){_(e,a,i,videoId)})}).catch(function(e){_(e,a,i)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Dt,Ot=(Dt=new Map,{set:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=Array.isArray(n)?n:[];return Dt.set(e,t),t},get:function(e){return Dt.get(e)||[]},remove:function(e){Dt.delete(e)}});function jt(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 Ct(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 Pt(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)?Pt(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 Pt(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 xt=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)}},_t=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 At(e){var n=null,t=null,r="none",o=function(o){var i=Ce(e);if(!i)return null;if("pdt"===r&&null!=n)return t+(o-n);var l=_t(i);return Number.isFinite(l)?l-(Date.now()/1e3-o):null},i=function(){var n=Ce(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=Ce(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=Ct(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?jt(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):jt(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(xt(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}(xt(e).start)},playerTimeToChapterIndex:function(o,i){var l=function(o){var i=Ce(e);if(!i)return null;if("pdt"===r&&null!=n)return n+(o-t);var l=_t(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=xt(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 Rt(e){return"livedvr"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).timeMode?At(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=Ce(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=Ce(e),t=n&&n.duration();return{start:0,end:Number.isFinite(t)?t:0}},refreshAnchor:function(){},anchorInfo:function(){return{source:"vod"}}}}(e)}var Lt="chapter-change",Nt="chapter-click",Mt="chapters-updated";function Ut(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Ce(e);r?r.trigger(n,t):console.error("[CHAPTERS] Player instance not found")}function Bt(e){var n=Ce(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(Lt,e)},onChapterClick:function(e){return t(Nt,e)},onChaptersUpdated:function(e){return t(Mt,e)}}}var Ft="vjs-chapter-marker",Ht="vjs-chapter-preview",Vt=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 zt(e,n){var t=n.store,r=n.mapper,o=n.chaptersConfig,i=void 0===o?{}:o,l=n.seek,a=Ce(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=Ce(e),i=Vt(o);if(i){var l=function(e){if(s&&s.isConnected)return s;(s=document.createElement("div")).className=Ht;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 ie.formatTime(n,n);var t=(r.windowBounds()||{}).end;if(!Number.isFinite(t))return"";var o=Math.max(0,t-n);return"-".concat(ie.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=Ce(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=Ft,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=_e(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),Ut(e,Nt,{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(Ft,"--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(Ft,"--active"))}},y=function(){var n=Ce(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),Ut(e,Lt,{chapter:i>=0?o[i]:null}))}},b=xe(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=Ce(e),o=Vt(n);o&&(o.querySelectorAll(".".concat(Ft)).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=Vt(Ce(e));n&&n.querySelectorAll(".".concat(Ft,", .").concat(Ht)).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),Ut(e,Lt,{chapter:r[o]})))}}}var qt=new Map,Gt=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}},Wt=function(e){var n=qt.get(e);if(n)return n;n={mapper:Rt(e,{timeMode:"vod"}),markers:null,chaptersConfig:{},timeMode:"vod"},qt.set(e,n);var t=Ce(e);return t&&t.on("dispose",function(){return Zt(e)}),n},Kt=function(e){var n=qt.get(e),t=function(e){var n=qt.get(e);if(!n||n.markers)return(null==n?void 0:n.markers)||null;var t=Ce(e);return t&&Gt(t)?(n.markers=zt(e,{store:Ot,mapper:n.mapper,chaptersConfig:n.chaptersConfig,seek:function(n){return Qt(e,n)}}),n.markers):null}(e);t&&n&&t.render()};function Yt(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=Ce(e);if(!u)return!1;Array.isArray(r)&&r.length&&Ot.set(e,r);var s=qt.get(e);null!=s&&s.markers&&s.markers.destroy();var c={mapper:Rt(e,{timeMode:i}),markers:null,chaptersConfig:a||{},timeMode:i,disposed:!1};qt.set(e,c);var d=function(){c.disposed||Kt(e)};return u.one("loadeddata",d),Gt(u)&&d(),u.on("dispose",function(){return Zt(e)}),!0}function $t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Wt(e),Ot.set(e,n),Kt(e),Ut(e,Mt,{chapters:Ot.get(e)}),!0}function Jt(e){return Ot.get(e)}function Xt(e){Ot.set(e,[]);var n=qt.get(e);return null!=n&&n.markers&&n.markers.render(),Ut(e,Mt,{chapters:[]}),!0}function Qt(e,n){var t,r,o=Ce(e),i=Wt(e);if(!o)return!1;var l=Ot.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 Zt(e){var n=qt.get(e);n&&(n.disposed=!0,n.markers&&n.markers.destroy()),qt.delete(e),Ot.remove(e)}var er,nr=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 Ue({site:n,sseBaseUrl:t,getToken:A,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),pe.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 tr(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 rr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?tr(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):tr(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function or(){return{loadVideoInstantly:B,onTimeUpdate:me,getVideoDuration:he,onVideoEnded:ge,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=re(oe.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,T,I,E,D,O,C,x,A,R,L,N,M,U;return oe.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!q(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,T=null==e?void 0:e.asat,I=(null==e||null===(o=e.epg)||void 0===o?void 0:o.enable)||!1,E=null==e?void 0:e.videoId,D=(null==e||null===(i=e.series)||void 0===i?void 0:i.enable)||!1,O=(null==e?void 0:e.streamingInfo)||!1,window.videoId=E,C=null==e?void 0:e.token,!Q(e)){n.next=18;break}if(sessionStorage.setItem("vlp_token",C),Z().set(null==e?void 0:e.refreshToken),C&&!ee(C)){n.next=17;break}return r({status:!1,msg:"".concat(C?"Token is expired !":"Missing Authorization Token"),response:{token:C}}),n.abrupt("return");case 17:er=JSON.parse(atob(C.split(".")[1]));case 18:return window.siteName=null===(l=er)||void 0===l?void 0:l.site,window.siteId=null===(a=er)||void 0===a?void 0:a.siteId,e.isAnonymousUser=!(null===(u=er)||void 0===u||!u.anonymousId),e.siteOwner=(null===(s=er)||void 0===s?void 0:s.site)||null,e.userId=(null===(c=er)||void 0===c?void 0:c.userId)||null,J((null===(d=er)||void 0===d?void 0:d.userId)||(null===(v=er)||void 0===v?void 0:v.anonymousId)||null),window.watchHistory=e.watchHistory||null,x=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,Le(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),X.set(e.apiBaseUrl),null!=e&&e.skin&&!Ae(e.skin)||(e.skin="VL_ONE"),j.setConfig(e),Be.reset(),Be.set(null==e?void 0:e.relatedVideos),n.next=39,vn(e);case 39:A&&Qe("https://www.googletagmanager.com/gtag/js?id=".concat(A)).then(function(){return ne(A)}).catch(function(e){}),(L=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(x)))&&L.addEventListener("contextmenu",function(e){return e.preventDefault()}),(N=nr({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}))&&!N.isConnectionActive()&&N.connect(),S?(U={directPlaybackUrl:S,id:M="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},T?P(M,C).then(function(n){var o=(null==n?void 0:n.data)||{};mt(x,{res:rr(rr({},o),U)},e,{resolve:t,reject:r})}).catch(function(e){_(e,x,r,M)}):mt(x,{res:U},e,{resolve:t,reject:r})):O?yt(e,{resolve:t,reject:r}):D?It(e,{resolve:t,reject:r}):I?St(e,{resolve:t,reject:r}):wt(e,{resolve:t,reject:r});case 45:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:Oe,skip:F,getPlayer:Ce,play:H,pause:V,detectBrowser:Re,rewind:z,loadVideo:u,seekToTimeStamp:ye,isPlayerInitialised:q,load:G,authenticateLC:W,dispose:K,enableCaptions:De,disableCaptions:Te,getCaptions:Se,playSelectedResolution:je,getSource:a,setVolume:en,getVolume:nn,disableControls:h,setPlaybackSpeed:be,getEntitlementData:Y,getSsaiEvents:$,playerEvents:we,onReplay:ke,relatedVideosManager:Be,setChapters:$t,getChapters:Jt,clearChapters:Xt,seekToChapter:Qt,getChapterEvents:Bt}}export{or as V,Yt 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 I,z as E,A as D,B as O,C as j,D as C,E as P,F as x,G as _,H as A,I as R,J as L,K as N,L as M,M as U,N as B,O as F,P as H,Q as V,R as z,S as q,T as G,U as W,V as K,W as Y,X as $,Y as J,Z as X,_ as Q,$ as Z,a0 as ee,a1 as ne}from"./generic-859e1b0f.js";import te from"@babel/runtime/helpers/defineProperty";import re from"@babel/runtime/helpers/asyncToGenerator";import oe from"@babel/runtime/regenerator";import ie from"video.js";import le from"@babel/runtime/helpers/classCallCheck";import ae from"@babel/runtime/helpers/createClass";import ue from"@babel/runtime/helpers/get";import se from"@babel/runtime/helpers/inherits";import ce from"@babel/runtime/helpers/possibleConstructorReturn";import de from"@babel/runtime/helpers/getPrototypeOf";import{h as ve,a as fe,s as pe,o as me,g as he,b as ge,c as ye,d as be,p as we,e as ke}from"./index-022a4725.js";import{g as Se,d as Te,s as Ie,a as Ee,e as De}from"./captions-75f20905.js";import{g as Oe}from"./renditions-620d93b3.js";import{playSelectedResolution as je}from"./resolution-2ee017b4.js";import{g as Ce,i as Pe,t as xe,p as _e,a as Ae}from"./skin-3653c5b3.js";import{d as Re}from"./browser-de5f6a74.js";import{s as Le}from"./localisation-0bf399a1.js";import Ne from"@babel/runtime/helpers/typeof";import"@viewlift/comscore/index.js";import Me from"@babel/runtime/helpers/toConsumableArray";import{createSSETransport as Ue}from"@viewlift/sse";import{r as Be}from"./relatedVideosManager-8dd9aa24.js";function Fe(e,n,t,r){var o=ue(de(1&r?e.prototype:e),n,t);return 2&r&&"function"==typeof o?function(e){return o.apply(t,e)}:o}function He(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(He=function(){return!!e})()}var Ve=ie.getComponent("TextTrackSettings"),ze=ie.dom,qe=[{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"}],Ge=qe.map(function(e){return e.value}),We="16",Ke="vlp-caption-font-size-px",Ye="vlp-caption-font-size-style",$e=".vjs-font-percent > select",Je=function(e){return-1!==Ge.indexOf(e)?e:We},Xe=null;Ve?(Xe=function(){se(r,Ve);var e,n,t=(e=r,n=He(),function(){var t,r=de(e);if(n){var o=de(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return ce(this,t)});function r(e,n){var o;return le(this,r),(o=t.call(this,e,n)).customUiReady_=!0,o.applyCustomFontSizeUI_(),o}return ae(r,[{key:"applyCustomFontSizeUI_",value:function(){this.replaceFontSizeOptions_(),this.bindFontSizeChange_(),this.restoreCustomFontSize_()}},{key:"replaceFontSizeOptions_",value:function(){var e=this.$($e);if(e){for(;e.firstChild;)e.removeChild(e.firstChild);qe.forEach(function(n){e.appendChild(ze.createEl("option",{value:n.value,textContent:n.label}))}),e.value=We}}},{key:"bindFontSizeChange_",value:function(){var e=this,n=this.$($e);n&&this.on(n,"change",function(){return e.applyFontSize_(n.value)})}},{key:"applyFontSize_",value:function(e){var n=Je(e);if("undefined"!=typeof document){var t=document.getElementById(Ye);t||((t=document.createElement("style")).id=Ye,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(Ke)}catch(e){}var n=Je(e),t=this.$($e);t&&(t.value=n),this.applyFontSize_(n)}},{key:"getValues",value:function(){var e=Fe(r,"getValues",this,3)([]);return e&&delete e.fontPercent,e||{}}},{key:"setDefaults",value:function(){if(Fe(r,"setDefaults",this,3)([]),this.customUiReady_){var e=this.$($e);e&&(e.value=We),this.applyFontSize_(We)}}},{key:"saveSettings",value:function(){if(Fe(r,"saveSettings",this,3)([]),this.options_&&this.options_.persistTextTrackSettings){var e=this.$($e);if(e)try{window.localStorage.setItem(Ke,Je(e.value))}catch(e){}}}},{key:"handleLanguagechange",value:function(){Fe(r,"handleLanguagechange",this,3)([]),this.applyCustomFontSizeUI_()}}]),r}(),ie.registerComponent("TextTrackSettings",Xe)):console.warn("[vlp] CustomTextTrackSettings: video.js TextTrackSettings is not registered; skipping override.");var Qe=function(e){return new Promise(function(n,t){if(Ze(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)}})},Ze=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},en=function(e,n,t){var r=Ce(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,"'")})},nn=function(e){var n=Ce(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},tn=function(){var e=re(oe.mark(function e(n){var t,r,o,i,l;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Ce(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,Qe("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(ie),e.finish(13);case 16:(l=ie.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"==Re()?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)}}(),rn=function(e,n){var t=Ce(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,r,o,i,l,a=this.el(),u=ie.dom.getPointerPosition(a,n).x;ie.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 on=function(){var e=re(oe.mark(function e(){return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Qe("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)}}(),ln=function(){var n=re(oe.mark(function n(){return oe.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)}}(),an=function(){var e=re(oe.mark(function e(){return oe.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){ie.getPlugin("eme")||ie.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),un=function(){var e=re(oe.mark(function e(){var n;return oe.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(ie),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)}}(),sn=function(){var e=re(oe.mark(function e(){return oe.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)}}(),cn=function(){var e=re(oe.mark(function e(){return oe.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)}}(),dn=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){Qe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(ie)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(ie)})},loadAdsLibrary:on,loadEMELibrary:an,loadMuxPlugin:un,loadDvrSeekbar:sn,loadContribDash:cn,loadComscorePlugin:ln});function vn(e){return fn.apply(this,arguments)}function fn(){return(fn=re(oe.mark(function e(n){var t;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,on();case 3:t&&"Safari"==Re()&&Promise.resolve().then(function(){return dn}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function pn(e){return mn.apply(this,arguments)}function mn(){return(mn=re(oe.mark(function e(n){var t,r,o,i,l,a,u,s,c,d;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d=Ce(n.playerId),e.next=3,ln();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 hn(e,n){return gn.apply(this,arguments)}function gn(){return(gn=re(oe.mark(function e(n,t){var r,o,i,l,a,u,s,c,d,v,f,p,m,h;return oe.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"==Re()?an():"caliente"!=(null===(h=window)||void 0===h?void 0:h.siteName)?cn():an():"Safari"!=Re()&&f?cn():null,p?pn(n):null,m?un():null,tn(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 yn(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 bn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?yn(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):yn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var wn=new Set,kn=null,Sn=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"]=Cn(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"]=Dn(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=On(e),f["c3.cm.genreList"]=In(e),f["c3.cm.genre"]=Tn(e),f["c3.cm.channel"]=En(e,i);var m=_n(r(),e);return f=bn(bn({},f),m)},Tn=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"},In=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"},En=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"},Dn=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"},On=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"},jn=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)},Cn=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Pn,xn,_n=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},An=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"}},Rn=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Ln=function(){var e=re(oe.mark(function e(n,t){var r,o,l,a,u,s,c,d,v,f,p,m;return oe.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=Ce(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=An(t.keySystem);p("contentInfo",{DRMEnabled:r})}else p("contentInfo",{DRMEnabled:"None"})}),n||p("contentInfo",{DRMEnabled:"None"})}),f.on("loadstart",function(){var e,n;kn&&kn!==f.currentSrc()&&p("playbackEnded"),p("setPlayer",f),wn.clear(),kn=f.currentSrc();var r=Rn(f.currentType()),o=i(),u=Sn(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]=jn(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",Nn.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(){wn.has(f.currentSrc())||(wn.add(f.currentSrc()),p("playbackStarted",null))}),f.on("ended",function(){wn.has(f.currentSrc())&&wn.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==wn||wn.clear(),p("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Nn=(Pn={},{setData:function(e){Pn=bn(bn({},Pn),e)},getData:function(){return Pn}}),Mn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-21d67daa.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-77405f2e.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-255cf575.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-2080b142.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-77c06b80.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?import("./skin-08cd7f59.js").then(function(t){t.initialiseSkin(e,n)}):"news"==t?import("./skin-a28700c4.js").then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?import("./skin-0fb217b1.js").then(function(t){t.initialiseSkin(e,n)}):"mini"==t?import("./skin-49aa30ba.js").then(function(t){t.initialiseSkin(e,n)}):"CN_NEWS"==t&&import("./skin-361a4e27.js").then(function(t){t.initialiseSkin(e,n)})};function Un(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 Bn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Un(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Un(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Fn=[],Hn=0,Vn=null;function zn(){xn=null,Fn=[],Hn=0,Vn=null}function qn(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=Gn(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 Bn(Bn({},e),{},te({},n,u[n]))},{}),c=o.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===xn});c<0?o.push(Bn(Bn({content:s},e),{},{addedDate:l,updateDate:l})):o[c]=Bn(Bn(Bn({},o[c]),e),{},{updateDate:l});localStorage.setItem("".concat(r),JSON.stringify(o))}(y={completed:c,watchedTime:h,watchedPercentage:g},d,n.siteOwner):(y=Bn(Bn({videoId:xn,watchedTime:h,watchedPercentage:g,doneWatching:c,profileId:d},Vn&&{seriesId:Vn}),p&&{originalObjectId:p}),l(y).then(function(e){}).catch(function(e){})),Hn=v+t}function Gn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Wn(e,n,t){var r=Gn(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 Kn=!1,Yn=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)&&!Kn){var i=$n(e,"videoAssets","secondaryVideoAssets"),l=a(i,n);return l&&u(n,l),Kn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function $n(e,n,t){if(Array.isArray(e))return e.map(function(e){return $n(e,n,t)});if(null!==e&&"object"===Ne(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]=$n(e[o],n,t)}),r}return e}function Jn(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 Xn(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)?Xn(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 Xn(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 Qn(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 Zn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Qn(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var et=function(e,n,t,r){var o,l,a,u,m,h=r.res,g=r.sres,y=Ce(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(Zn({status:!0,msg:"Player Initialised"},g?{seriesResponse:g,response:h}:{response:h}))}),y.on("loadeddata",function(){var t,r,o,l,a=Se(e);if(null==a||a.map(function(n){return Te(e,n.id)}),S&&"Safari"===Re())try{var u;null==y||null===(u=y.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==y||!y.muted())&&en(e,sessionStorage.getItem("volume")||"100");var s=i();if(d(n),v(),null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.isExternal){var c=Zn(Zn({},n),h);!function(e,n){var t,r,o;if(null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&"function"==typeof(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.cb)){var i,l,a,u=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,s=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.completionThreshold)||95,c=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.cb,d=-1;e.on("seeked",function(){var n=Math.floor(e.currentTime()),t=n-n%u;if(d=t,t>0){var r=Math.floor(n/e.duration()*100);c({watchedTime:n,watchedPercentage:r,doneWatching:r>=s})}}),e.on("timeupdate",function(){var n=Math.floor(e.currentTime()),t=n-n%u;if(n%u===0&&t!==d){d=t;var r=Math.floor(n/e.duration()*100);c({watchedTime:n,watchedPercentage:r,doneWatching:r>=s||!1})}}),e.on("ended",function(){c({watchedTime:Math.floor(e.duration()),watchedPercentage:100,doneWatching:!0})})}}(y,c)}else if(null!=n&&n.watchHistory&&null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.enable&&(!n.isAnonymousUser||null!=n&&null!==(o=n.watchHistory)&&void 0!==o&&o.saveOffline)){var f,p,m=Zn(Zn({},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&&(Vn=null==n||null===(o=n.series)||void 0===o?void 0:o.id),Fn=[],Hn=0,xn=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=Ce(e);a&&(a.on("dispose",zn),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());Fn.includes(Hn)||(e!=Hn||e<l?e>Hn&&(Hn=e+l):(Fn.push(e),qn(a,n,l)))}}),a.one("ended",function(){qn(a,n,l,!0)}))}(e,m,null==s||null===(f=s.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.id)}if(null!=n&&null!==(l=n.analytics)&&void 0!==l&&l.muxKey&&null!=y&&y.mux){var g,b,w,k,T,I,E=(null===(g=i())||void 0===g?void 0:g.video)||(null==h?void 0:h.video),D=null==E?void 0:E.gist,O={env_key:null==n||null===(b=n.analytics)||void 0===b?void 0:b.muxKey,player_name:"vl-web-player",player_version:null===(w=window)||void 0===w?void 0:w.vl_player_version,video_id:null==D?void 0:D.id,video_title:null==D?void 0:D.title,video_series:null==E||null===(k=E.series)||void 0===k?void 0:k.title,video_stream_type:null!=E&&null!==(T=E.streamingInfo)&&void 0!==T&&T.isLiveStream?"live":"video",viewer_user_id:null==n||null===(I=n.analytics)||void 0===I?void 0:I.userId};y.mux({debug:!1,data:O})}}),y.textTracks().on("change",function(n){var t=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];Ie(e),y.trigger("subtitlechanged",t)}),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&&Yn(h,e)}),y.on("error",function(){var n,r;(console.log("ERROR",y.error(),y.error().code),4===y.error().code&&k)?Yn(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{var h,g,b,w,k,S,T,I=null!==(h=null==n?void 0:n.watchHistoryResumeTime)&&void 0!==h?h:null==n||null===(g=n.watchHistory)||void 0===g?void 0:g.watchedTime,E=null!==(b=null!==(w=null==n?void 0:n.watchedPercentage)&&void 0!==w?w:null==n||null===(k=n.watchHistory)||void 0===k?void 0:k.watchedPercentage)&&void 0!==b?b:0,D=null!==(S=null==n||null===(T=n.watchHistory)||void 0===T?void 0:T.completionThreshold)&&void 0!==S?S:95;I&&E<D&&setTimeout(function(){y.currentTime(I)},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"==Ne(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=Jn(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=[],d=Jn(n);try{for(d.s();!(s=d.n()).done;){var v,f,p,m=s.value;("Chrome"==Re()||"Edge"==Re()&&(null!==(v=navigator)&&void 0!==v&&null!==(f=v.userAgent)&&void 0!==f&&f.includes("Macintosh")||!w))&&null!=m&&null!==(p=m.label)&&void 0!==p&&p.includes("5.1")?y.audioTracks().removeTrack(m):c.push(m)}}catch(e){d.e(e)}finally{d.f()}for(var h=c.find(function(e){return"main"===e.kind}),g=h||c.find(function(e){return e.enabled})||c[0],b=0,k=c;b<k.length;b++){var S=k[b];S.enabled=S===g}}}))};function nt(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 tt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?nt(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nt(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function rt(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 ot(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)?ot(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 ot(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 it={debug:5,info:4,warn:3,error:2,fatal:1,none:0,off:0,DEBUG:5,INFO:4,WARN:3,ERROR:2,FATAL:1,NONE:0,OFF:0};function lt(e,n,t){var r=j.getConfig()||{};T(e,{status:t,message:"DRM ".concat(n," request failed")},"playback",{requestKind:n,videoId:null==r?void 0:r.videoId})}function at(e){try{if(null!=e&&e.__vlLicenseUrl)return e.__vlLicenseUrl;var n=null==e?void 0:e.keySystems;if(n)for(var t=0,r=Object.keys(n);t<r.length;t++){var o=n[r[t]];if("string"==typeof o)return o;if(null!=o&&o.url)return o.url;if(null!=o&&o.licenseUri)return o.licenseUri}var i=null==e?void 0:e.keySystemOptions;if(Array.isArray(i)){var l,a=rt(i);try{for(a.s();!(l=a.n()).done;){var u,s,c,d=l.value,v=(null==d||null===(u=d.options)||void 0===u?void 0:u.serverURL)||(null==d||null===(s=d.options)||void 0===s?void 0:s.licenseUri)||(null==d||null===(c=d.options)||void 0===c?void 0:c.url);if(v)return v}}catch(e){a.e(e)}finally{a.f()}}}catch(e){}return""}function ut(e){if(null!=e&&e.__vlDrmLicenseUrl)return e.__vlDrmLicenseUrl;try{return at("function"==typeof e.currentSource?e.currentSource():null)}catch(e){return""}}function st(e,n){n&&!n.__vlDrmDashHooksInstalled&&(n.__vlDrmDashHooksInstalled=!0,"function"==typeof n.addResponseInterceptor&&n.addResponseInterceptor(function(e){try{var n=(null==e?void 0:e.request)||{},t=(null==e?void 0:e.url)||(null==n?void 0:n.url)||"",r=I(t,(null==n?void 0:n.type)||(null==e?void 0:e.type));if(E(r)){var o=D(e,null);O(o)||lt(t,r,o)}}catch(e){}return Promise.resolve(e)}),"function"==typeof n.registerLicenseRequestFilter&&n.registerLicenseRequestFilter(function(e){try{null!=e&&e.url&&(n.__vlLastLicenseUrl=e.url)}catch(e){}return Promise.resolve()}),"function"==typeof n.on&&n.on("public_licenseRequestComplete",function(t){try{var r,o,i,l;if(null==t||!t.error)return;var a=null!==(r=null==t||null===(o=t.error)||void 0===o||null===(i=o.data)||void 0===i?void 0:i.responseCode)&&void 0!==r?r:D(null,t.error);lt((null==t||null===(l=t.data)||void 0===l?void 0:l.url)||n.__vlLastLicenseUrl||ut(e)||"","license",a)}catch(e){}}))}var ct=!1,dt=null,vt=new Set;function ft(e){if(e&&!e.__vlDrmDashRegistered){e.__vlDrmDashRegistered=!0,vt.add(e),e.__vlDrmDashEnabled=!0;var n=function(){e.__vlDrmDashRegistered&&(e.__vlDrmDashRegistered=!1,e.__vlDrmDashEnabled=!1,vt.delete(e),function(){if(ct&&!(vt.size>0)){var e=null==ie?void 0:ie.Html5DashJS;e&&"function"==typeof e.removeHook&&"function"==typeof dt&&e.removeHook("beforeinitialize",dt),ct=!1,dt=null}}())};"function"==typeof e.one?e.one("dispose",n):"function"==typeof e.on&&e.on("dispose",n)}}function pt(e){if(e){ft(e),function(){if(!ct){var e=null==ie?void 0:ie.Html5DashJS;e&&"function"==typeof e.hook&&(dt=function(e,n){null!=e&&e.__vlDrmDashEnabled&&st(e,n)},ct=!0,e.hook("beforeinitialize",dt))}}(),function(e){e&&!e.__vlEmeDrmErrorInstalled&&(e.__vlEmeDrmErrorInstalled=!0,e.on("error",function(){try{var n,t="function"==typeof e.error?e.error():null;if(!t||!S(t))return;if(null!=e&&null!==(n=e.dash)&&void 0!==n&&n.mediaPlayer)return;lt(ut(e),"license",null)}catch(e){}}))}(e);var n=function(){var n;!function(e){var n,t,r=null==e||null===(n=e.tech_)||void 0===n||null===(t=n.vhs)||void 0===t?void 0:t.xhr;r&&"function"==typeof r.onResponse&&!e.__vlDrmVhsHooksInstalled&&(e.__vlDrmVhsHooksInstalled=!0,r.onResponse(function(e,n,t){try{var r=function(e){return(null==e?void 0:e.uri)||(null==e?void 0:e.url)||(null==e?void 0:e.src)||""}(e),o=I(r,null==e?void 0:e.type);if(!E(o))return;var i=D(t,n);O(i)&&!n||lt(r,o,i)}catch(e){}}))}(e),st(e,null==e||null===(n=e.dash)||void 0===n?void 0:n.mediaPlayer)};n(),e.on("xhr-hooks-ready",n),e.on("loadstart",function(){setTimeout(n,0)})}}var mt=function(e,n,t,r){var o,i,l,s,c,d,v,p,S,T,I,E,D,O,j,C,P,x,_,A,R,L,N,M,U,B,F,H,V,z,q,G,W,K,Y,$,J,X,Q=n.res,Z=void 0===Q?null:Q,ee=n.sres,ne=void 0===ee?null:ee,le=function(){try{var e,n,t=new URLSearchParams((null===(e=window)||void 0===e||null===(n=e.location)||void 0===n?void 0:n.search)||""),r=t.get("loglevel")||null;return{playerDebug:"true"===t.get("playerdebug"),logLevel:r,dashLogLevel:null!=r&&null!=it[r]?it[r]:5}}catch(e){return{playerDebug:!1,logLevel:null,dashLogLevel:5}}}(),ae=le.playerDebug,ue=le.logLevel,se=le.dashLogLevel;ae&&(console.log("[PLAYER DEBUG] config:",t),console.log("[PLAYER DEBUG] entitlement (res):",Z),ne&&console.log("[PLAYER DEBUG] series response (sres):",ne));var ce=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],de=(null===(o=Z)||void 0===o?void 0:o.contentType)||"video",ve=Pe(null===(i=Z)||void 0===i||null===(l=i[de])||void 0===l||null===(s=l.gist)||void 0===s?void 0:s.videoImageUrl)||Pe(null===(c=Z)||void 0===c||null===(d=c[de])||void 0===d||null===(v=d.gist)||void 0===v||null===(p=v.imageGist)||void 0===p?void 0:p.r16x9),fe=(null===(S=Z)||void 0===S||null===(T=S[de])||void 0===T||null===(I=T.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,pe=!(null===(E=Z)||void 0===E||null===(D=E[de])||void 0===D||null===(O=D.streamingInfo)||void 0===O||!O.isLiveStream)||"linearchannel"===de,me=(null===(j=Z)||void 0===j||null===(C=j.ads)||void 0===C||null===(P=C.preRoll)||void 0===P||null===(x=P.adTags)||void 0===x||null===(_=x.web)||void 0===_?void 0:_.active)&&(null===(A=Z)||void 0===A||null===(R=A.ads)||void 0===R||null===(L=R.preRoll)||void 0===L||null===(N=L.adTags)||void 0===N||null===(M=N.web)||void 0===M?void 0:M.url);Z=tt(tt({},Z),{},{audioAssetSource:null==t?void 0:t.audioAssetSource});var he=(null==t||null===(U=t.customData)||void 0===U?void 0:U.ads)||{},ge=(null===(B=Z)||void 0===B||null===(F=B[de])||void 0===F?void 0:F.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==he?void 0:he.vodAdSticherProvider)||!1,ye=!(null===(H=Z)||void 0===H||null===(V=H[de])||void 0===V||!V.isSSAIEnabled)&&"TRANSMIT"==(null==he?void 0:he.liveAdSticherProvider)&&!(null==he||!he.liveAdClientSideTracking),be=(null==t?void 0:t.latency)||6,we=(null==t?void 0:t.skin_settings)||{},ke=null,Se=(J={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==we?void 0:we.pictureInPictureToggle)||!1},playbackRates:null!=we&&we.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==t.skin,liveui:fe},te(J,"autoplay",null==t?void 0:t.autoplay),te(J,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!me),te(J,"loop",(null==t?void 0:t.loop)||!1),te(J,"audioPosterMode",null==t?void 0:t.audioPosterMode),te(J,"html5",tt(tt({dash:tt(tt({},!ie.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:tt(tt({},((null==t?void 0:t.debugConfig)&&(null==t||null===(z=t.debugConfig)||void 0===z?void 0:z.enable)||ae)&&{debug:{logLevel:se}}),{},{streaming:{delay:{liveDelay:be},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:tt({},"IE"==Re()&&{enableStallFix:!0,stallSeek:1}),abr:tt(tt(tt(tt({},(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:tt(tt(tt({},(null==t?void 0:t.initialBandwidth)&&{bandwidth:t.initialBandwidth}),{},{liveRangeSafeTimeDelta:be,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==t||!t.initialBandwidth},(null==t||null===(q=t.customData)||void 0===q?void 0:q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(G=null==t?void 0:t.enableLowInitialPlaylist)&&void 0!==G&&G},((null==t?void 0:t.debugConfig)&&(null==t||null===(W=t.debugConfig)||void 0===W?void 0:W.enable)||ae)&&{debug:!0}),debug:(null==t?void 0:t.debugConfig)&&(null==t||null===(K=t.debugConfig)||void 0===K?void 0:K.enable)||ae||!1,nativeTextTracks:"Safari"==Re()},0==(null==t||null===(Y=t.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===($=t.customData)||void 0===$?void 0:$.nativeVideoTracks)&&{nativeVideoTracks:!1})),te(J,"poster",ve),te(J,"techOrder",ce),te(J,"chromecast",{requestCustomDataFn:function(n){var r,o,i=Ce(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,I=(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=I;var E=(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=E}var D=(null==e||null===(r=e[f])||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.contentType)||"VIDEO";p.contentType=D;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 C=null==e||null===(s=e[f])||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=C,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}(Z,n,l),u=l.find(function(e){return"showing"===e.mode})||null;return ke=u?{language:u.language||u.lang||null,label:u.label||null}:null,tt(tt({},a),{},{activeCaption:{enabled:!!u,language:(null==u?void 0:u.language)||(null==u?void 0:u.lang)||null,label:(null==u?void 0:u.label)||null},transmitTrackingUrl:m.get()||null,convivaMetaData:tt({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},Nn.getData())})},modifyLoadRequestFn:function(n){var t,r,o,i,l,a=Ce(e),u=(null==a?void 0:a.currentSource())||{};!(null===(t=Z)||void 0===t||null===(r=t[de])||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}}),J);if(!ie.getPlayers()[e]){(null!=t&&t.debugConfig&&null!=t&&null!==(X=t.debugConfig)&&void 0!==X&&X.enable||ae)&&ie.log.level(ue||"debug");var Te=ie(e,Se,function(){var n=re(oe.mark(function n(){var o,i,l,s,c,d,v,p,m,S,T,I,E,D,O,j,C,P,x,_,A,R;return oe.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return pt(Te),console.log(Te),console.log(ie.VERSION),console.log(ie.getPlugins()),n.next=6,hn(t,Z);case 6:if(null!=t&&t.debugConfig&&null!=t&&null!==(o=t.debugConfig)&&void 0!==o&&o.enable||ae){try{ie.log.level(ue||"debug")}catch(e){}(E=function(){try{var e,n,t;null==Te||null===(e=Te.dash)||void 0===e||null===(n=e.mediaPlayer)||void 0===n||null===(t=n.updateSettings)||void 0===t||t.call(n,{debug:{logLevel:se}})}catch(e){}})(),Te.one("loadedmetadata",E)}if(D=null===(i=Z)||void 0===i||null===(l=i[de])||void 0===l||null===(s=l.liveDetails)||void 0===s?void 0:s.startOverTime,pe&&r.resolve(tt({status:!0,msg:"Player Initialised"},ne?{seriesResponse:ne,response:Z}:{response:Z})),y(e,{analyticsCb:null==t?void 0:t.analyticsCb,analyticsEventParams:null==t?void 0:t.analyticsEventParams,userId:null==t?void 0:t.userId}),Ln(e,t),Te.on("chromecastConnected",function(){var e=Te.textTracks().tracks_.find(function(e){return("captions"===e.kind||"subtitles"===e.kind)&&"showing"===e.mode}),n=e?{language:e.language||null,label:e.label||null}:null,t=function(){var e=n||ke;if(e){var t=Te.textTracks().tracks_.filter(function(e){return"captions"===e.kind||"subtitles"===e.kind}),r=t.find(function(n){return e.language&&n.language===e.language})||t.find(function(n){return e.label&&n.label===e.label})||t[0];r&&"showing"!==r.mode&&(r.mode="showing")}};Te.one("loadeddata",function(){return setTimeout(t,0)}),setTimeout(t,1500)}),/Android/i.test(navigator.userAgent)&&(ie.options.vhs.overrideNative=!0),fe&&rn(e,D),!me||null!=t&&null!==(c=t.customData)&&void 0!==c&&c.disableAds||b(e,me,Z),O=a(Z,e),console.log(O),ae&&(console.log("[PLAYER DEBUG] source:",O),console.log("[PLAYER DEBUG] videojs options:",Se)),null!=t&&t.nearestClusterUrl&&(O=w(O,t.nearestClusterUrl)),!ge){n.next=25;break}return n.next=22,k(e,Z);case 22:O=n.sent,n.next=29;break;case 25:if(!ye){n.next=29;break}return n.next=28,g(O,Z,e);case 28:O=n.sent;case 29:Te&&(Te.__vlDrmLicenseUrl=at(O)),O?u(e,O):(r.reject({status:!1,msg:"Incompatible / Missing Source",response:Z}),f(e,"Incompatible / Missing Source")),((null===(d=Z)||void 0===d||null===(v=d[de])||void 0===v||null===(p=v.contentDetails)||void 0===p||null===(m=p.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(S=Z)||void 0===S||null===(T=S[de])||void 0===T||null===(I=T.closedCaptions)||void 0===I?void 0:I.length)>0)&&(R=(null===(C=Z)||void 0===C||null===(P=C[de])||void 0===P||null===(x=P.contentDetails)||void 0===x?void 0:x.closedCaptions)||(null===(_=Z)||void 0===_||null===(A=_[de])||void 0===A?void 0:A.closedCaptions),j=R.filter(function(e){return"VTT"===e.format}),Ee(e,j)),null!=t&&t.disableControls?h(e):Mn(e,tt(tt(tt({},t),Se),{},{liveVideo:pe,isDvrEnabled:fe,res:Z,sres:ne})),et(e,tt(tt(tt({},t),Se),{},{liveVideo:pe}),r,{res:Z,sres:ne});case 34:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function ht(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?ht(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ht(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var yt=function(e,n){var t=n.resolve,r=n.reject,o=null==e?void 0:e.playerId,i=bt(e);mt(o,{res:i},e,{resolve:t,reject:r})},bt=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)||[],S=(null==e||null===(c=e.customData)||void 0===c||null===(d=c.ads)||void 0===d?void 0:d.isSSAIEnabled)||!1,T=null==e?void 0:e.token,I=C(T);null==I||I.site;var E=null==I?void 0:I.siteId,D=(null==e||null===(v=e.customData)||void 0===v||null===(f=v.comscore)||void 0===f?void 0:f.video)||null,O=gt(gt({id:"".concat(E,"_external")},!h&&{directPlaybackUrl:null==m?void 0:m.url}),{},{video:gt(gt(gt(gt(gt({drmEnabled:h,streamingInfo:gt(gt({videoAssets:gt(gt({},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==D?void 0:D.isLiveStream)&&{isLiveStream:null==D?void 0:D.isLiveStream})},S&&{isSSAIEnabled:S}),{},{metadata:k,liveDetails:{isDvrEnabled:null==p?void 0:p.isDvrEnabled},gist:gt(gt(gt({},y&&{videoImageUrl:y}),(null==D?void 0:D.videoId)&&{id:null==D?void 0:D.videoId}),(null==D?void 0:D.videoTitle)&&{title:null==D?void 0:D.videoTitle}),contentDetails:gt({},(null==b?void 0:b.length)>0&&{closedCaptions:Me(b)})},(null==D?void 0:D.runtime)&&{runtime:null==D?void 0:D.runtime}),(null==D?void 0:D.publishDate)&&{publishDate:null==D?void 0:D.publishDate}),(null==D?void 0:D.platform)&&{platform:null==D?void 0:D.platform}),(null==D?void 0:D.series)&&{series:null==D?void 0:D.series}),ads:{preRoll:{adTags:{web:gt(gt({},g&&{active:!0}),g&&{url:g})}}}});return D&&(null!=D&&D.isDvrEnabled&&(O.video.liveDetails=gt(gt({},O.video.liveDetails),{},{isDvrEnabled:null==D?void 0:D.isDvrEnabled})),null!=D&&D.metadata&&(O.video.metadata=[].concat(Me(O.video.metadata),Me(null==D?void 0:D.metadata)))),O};function wt(e,n){return kt.apply(this,arguments)}function kt(){return(kt=re(oe.mark(function e(n,t){var r,o,i,l,a,u,c,d,v;return oe.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,A();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),P(a,d,v).then(function(e){var t,r,o,v,f,p,m,h,g,y,b;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 w=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,k=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;ve(u,{scheduleEndDate:w,scheduleStartDate:k});var S=null==e?void 0:e.data;if(null!=n&&null!==(y=n.watchHistory)&&void 0!==y&&y.isExternal)S.contentType="video",mt(u,{res:S},n,{resolve:i,reject:l});else if(null!=n&&n.watchHistory&&null!=n&&null!==(b=n.watchHistory)&&void 0!==b&&b.enable&&!c){var T;if((null===(T=n.watchHistory)||void 0===T?void 0:T.saveOffline)||!1){var I,E,D,O=Wn((null===(I=n.watchHistory)||void 0===I?void 0:I.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===(D=O[0])||void 0===D?void 0:D.watchedPercentage)||null;S.contentType="video",mt(u,{res:S},n,{resolve:i,reject:l})}else x(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(){}).finally(function(){mt(u,{res:S},n,{resolve:i,reject:l})})}else mt(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&&fe(u,e,i),_(e,u,l,a)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function St(e,n){return Tt.apply(this,arguments)}function Tt(){return(Tt=re(oe.mark(function e(n,t){var r,o,i,l,a,u,s,c;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,e.next=3,A();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),R(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,mt(u,{res:t},n,{resolve:i,reject:l})}).catch(function(e){_(e,u,l,videoId)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function It(e,n){return Et.apply(this,arguments)}function Et(){return(Et=re(oe.mark(function e(n,t){var r,o,i,l,a,u,c;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,e.next=3,A();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,M.set(parseInt(u)),c=null==n||null===(r=n.series)||void 0===r?void 0:r.id,L(c,l).then(function(e){var t,r,u,d=e.data,v=e.data.seasons;U(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);N(c,l),P(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),mt(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:o,reject:i})}).catch(function(e){_(e,a,i,videoId)})}).catch(function(e){_(e,a,i)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Dt,Ot=(Dt=new Map,{set:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=Array.isArray(n)?n:[];return Dt.set(e,t),t},get:function(e){return Dt.get(e)||[]},remove:function(e){Dt.delete(e)}});function jt(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 Ct(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 Pt(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)?Pt(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 Pt(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 xt=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)}},_t=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 At(e){var n=null,t=null,r="none",o=function(o){var i=Ce(e);if(!i)return null;if("pdt"===r&&null!=n)return t+(o-n);var l=_t(i);return Number.isFinite(l)?l-(Date.now()/1e3-o):null},i=function(){var n=Ce(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=Ce(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=Ct(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?jt(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):jt(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(xt(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}(xt(e).start)},playerTimeToChapterIndex:function(o,i){var l=function(o){var i=Ce(e);if(!i)return null;if("pdt"===r&&null!=n)return n+(o-t);var l=_t(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=xt(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 Rt(e){return"livedvr"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).timeMode?At(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=Ce(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=Ce(e),t=n&&n.duration();return{start:0,end:Number.isFinite(t)?t:0}},refreshAnchor:function(){},anchorInfo:function(){return{source:"vod"}}}}(e)}var Lt="chapter-change",Nt="chapter-click",Mt="chapters-updated";function Ut(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Ce(e);r?r.trigger(n,t):console.error("[CHAPTERS] Player instance not found")}function Bt(e){var n=Ce(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(Lt,e)},onChapterClick:function(e){return t(Nt,e)},onChaptersUpdated:function(e){return t(Mt,e)}}}var Ft="vjs-chapter-marker",Ht="vjs-chapter-preview",Vt=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 zt(e,n){var t=n.store,r=n.mapper,o=n.chaptersConfig,i=void 0===o?{}:o,l=n.seek,a=Ce(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=Ce(e),i=Vt(o);if(i){var l=function(e){if(s&&s.isConnected)return s;(s=document.createElement("div")).className=Ht;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 ie.formatTime(n,n);var t=(r.windowBounds()||{}).end;if(!Number.isFinite(t))return"";var o=Math.max(0,t-n);return"-".concat(ie.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=Ce(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=Ft,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=_e(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),Ut(e,Nt,{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(Ft,"--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(Ft,"--active"))}},y=function(){var n=Ce(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),Ut(e,Lt,{chapter:i>=0?o[i]:null}))}},b=xe(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=Ce(e),o=Vt(n);o&&(o.querySelectorAll(".".concat(Ft)).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=Vt(Ce(e));n&&n.querySelectorAll(".".concat(Ft,", .").concat(Ht)).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),Ut(e,Lt,{chapter:r[o]})))}}}var qt=new Map,Gt=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}},Wt=function(e){var n=qt.get(e);if(n)return n;n={mapper:Rt(e,{timeMode:"vod"}),markers:null,chaptersConfig:{},timeMode:"vod"},qt.set(e,n);var t=Ce(e);return t&&t.on("dispose",function(){return Zt(e)}),n},Kt=function(e){var n=qt.get(e),t=function(e){var n=qt.get(e);if(!n||n.markers)return(null==n?void 0:n.markers)||null;var t=Ce(e);return t&&Gt(t)?(n.markers=zt(e,{store:Ot,mapper:n.mapper,chaptersConfig:n.chaptersConfig,seek:function(n){return Qt(e,n)}}),n.markers):null}(e);t&&n&&t.render()};function Yt(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=Ce(e);if(!u)return!1;Array.isArray(r)&&r.length&&Ot.set(e,r);var s=qt.get(e);null!=s&&s.markers&&s.markers.destroy();var c={mapper:Rt(e,{timeMode:i}),markers:null,chaptersConfig:a||{},timeMode:i,disposed:!1};qt.set(e,c);var d=function(){c.disposed||Kt(e)};return u.one("loadeddata",d),Gt(u)&&d(),u.on("dispose",function(){return Zt(e)}),!0}function $t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Wt(e),Ot.set(e,n),Kt(e),Ut(e,Mt,{chapters:Ot.get(e)}),!0}function Jt(e){return Ot.get(e)}function Xt(e){Ot.set(e,[]);var n=qt.get(e);return null!=n&&n.markers&&n.markers.render(),Ut(e,Mt,{chapters:[]}),!0}function Qt(e,n){var t,r,o=Ce(e),i=Wt(e);if(!o)return!1;var l=Ot.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 Zt(e){var n=qt.get(e);n&&(n.disposed=!0,n.markers&&n.markers.destroy()),qt.delete(e),Ot.remove(e)}var er,nr=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 Ue({site:n,sseBaseUrl:t,getToken:A,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),pe.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 tr(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 rr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?tr(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):tr(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function or(){return{loadVideoInstantly:B,onTimeUpdate:me,getVideoDuration:he,onVideoEnded:ge,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=re(oe.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,T,I,E,D,O,C,x,A,R,L,N,M,U;return oe.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!q(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,T=null==e?void 0:e.asat,I=(null==e||null===(o=e.epg)||void 0===o?void 0:o.enable)||!1,E=null==e?void 0:e.videoId,D=(null==e||null===(i=e.series)||void 0===i?void 0:i.enable)||!1,O=(null==e?void 0:e.streamingInfo)||!1,window.videoId=E,C=null==e?void 0:e.token,!Q(e)){n.next=18;break}if(sessionStorage.setItem("vlp_token",C),Z().set(null==e?void 0:e.refreshToken),C&&!ee(C)){n.next=17;break}return r({status:!1,msg:"".concat(C?"Token is expired !":"Missing Authorization Token"),response:{token:C}}),n.abrupt("return");case 17:er=JSON.parse(atob(C.split(".")[1]));case 18:return window.siteName=null===(l=er)||void 0===l?void 0:l.site,window.siteId=null===(a=er)||void 0===a?void 0:a.siteId,e.isAnonymousUser=!(null===(u=er)||void 0===u||!u.anonymousId),e.siteOwner=(null===(s=er)||void 0===s?void 0:s.site)||null,e.userId=(null===(c=er)||void 0===c?void 0:c.userId)||null,J((null===(d=er)||void 0===d?void 0:d.userId)||(null===(v=er)||void 0===v?void 0:v.anonymousId)||null),window.watchHistory=e.watchHistory||null,x=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,Le(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),X.set(e.apiBaseUrl),null!=e&&e.skin&&!Ae(e.skin)||(e.skin="VL_ONE"),j.setConfig(e),Be.reset(),Be.set(null==e?void 0:e.relatedVideos),n.next=39,vn(e);case 39:A&&Qe("https://www.googletagmanager.com/gtag/js?id=".concat(A)).then(function(){return ne(A)}).catch(function(e){}),(L=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(x)))&&L.addEventListener("contextmenu",function(e){return e.preventDefault()}),(N=nr({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}))&&!N.isConnectionActive()&&N.connect(),S?(U={directPlaybackUrl:S,id:M="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},T?P(M,C).then(function(n){var o=(null==n?void 0:n.data)||{};mt(x,{res:rr(rr({},o),U)},e,{resolve:t,reject:r})}).catch(function(e){_(e,x,r,M)}):mt(x,{res:U},e,{resolve:t,reject:r})):O?yt(e,{resolve:t,reject:r}):D?It(e,{resolve:t,reject:r}):I?St(e,{resolve:t,reject:r}):wt(e,{resolve:t,reject:r});case 45:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:Oe,skip:F,getPlayer:Ce,play:H,pause:V,detectBrowser:Re,rewind:z,loadVideo:u,seekToTimeStamp:ye,isPlayerInitialised:q,load:G,authenticateLC:W,dispose:K,enableCaptions:De,disableCaptions:Te,getCaptions:Se,playSelectedResolution:je,getSource:a,setVolume:en,getVolume:nn,disableControls:h,setPlaybackSpeed:be,getEntitlementData:Y,getSsaiEvents:$,playerEvents:we,onReplay:ke,relatedVideosManager:Be,setChapters:$t,getChapters:Jt,clearChapters:Xt,seekToChapter:Qt,getChapterEvents:Bt}}export{or as V,Yt as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-6c225809.js";import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{t as r,g as n}from"./skin-3653c5b3.js";import i from"@babel/runtime/helpers/defineProperty";import a from"@babel/runtime/helpers/slicedToArray";import{e as u}from"./generic-859e1b0f.js";function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var l="my-player";function c(e){var t=e.split("\n"),r=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),n={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(n.resolution=e.split("=")[1]),e.includes("URI")&&(n.uri=e.split("=")[1].replace(/"/g,""))}),r.push(n)}}),r}function p(){return(p=e(t.mark(function e(r){var n,i,u,o,s,l,c,p,d,m,f,b,g,v,h,x,y,w,k,j,E,N,A,T;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r._tiles){e.next=2;break}return e.abrupt("return",r._tiles);case 2:return e.prev=2,e.next=5,fetch(r.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return i=e.sent,e.next=11,createImageBitmap(i);case 11:for(u=e.sent,o=r.layout.split("x").map(Number),s=a(o,2),l=s[0],c=s[1],p=u.width/c,d=u.height/l,m=[],f=0;f<l;f++)for(b=0;b<c;b++)(g=document.createElement("canvas")).width=p,g.height=d,g.getContext("2d").drawImage(u,b*p,f*d,p,d,0,0,p,d),v=g.toDataURL("image/png"),m.push({uri:v,duration:r.duration}),r._tiles=m;return e.abrupt("return",m);case 20:for(e.prev=20,e.t0=e.catch(2),h=r.layout.split("x").map(Number),x=a(h,2),y=x[0],w=x[1],k=[],j=0;j<y*w;j++)k.push({uri:null===(E=window)||void 0===E||null===(N=E.app_data)||void 0===N||null===(A=N.appcmsMain)||void 0===A||null===(T=A.images)||void 0===T?void 0:T.placeholderCover,duration:r.duration});return e.abrupt("return",k);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function d(e,t){return m.apply(this,arguments)}function m(){return(m=e(t.mark(function e(r,n){var i,a;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=n,e.prev=1,e.next=4,fetch(r);case 4:return i=e.sent,e.next=7,i.text();case 7:return a=e.sent,e.abrupt("return",c(a));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function f(e,t,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=n(l);if(i&&a){var u=i.getBoundingClientRect(),o=(e.clientX-u.left)/u.width,s=function(e,t){var r,n;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var u=Math.floor((i+a)/2),o=t[u];if(o===e)return o;o<e?i=u+1:a=u-1}var s=null!==(r=t[i])&&void 0!==r?r:1/0,l=null!==(n=t[a])&&void 0!==n?n:-1/0;return Math.abs(s-e)<Math.abs(l-e)?s:l}(Math.round(o*a.duration()),r),c=t[s];c&&!c.loading&&(c.loading=!0,function(e){return p.apply(this,arguments)}(c).then(function(e){var t=e[c.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),c.loading=!1,c.src=t.uri}))}}function b(e){return g.apply(this,arguments)}function g(){return(g=e(t.mark(function e(n){var u,o,l,c;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u={},n.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),n=a(r,2),o=n[0]*n[1],l=e.duration,c=0;c<o;c++){var p,d=Math.round((t*o+c)*l);u[d]=s(s({},e),{},{duration:e.duration,tileIndex:c,loading:!1,style:(p={left:"-60px",height:"85px",width:"130px"},i(p,"left","-60px"),i(p,"border","1px solid transparent"),i(p,"borderRadius","4px"),p)})}}),o=Object.keys(u).map(Number).sort(function(e,t){return e-t}),null==(l=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||l.addEventListener("mousemove",r(function(e){return f(e,u,o)},500)),null==(c=document.querySelector(".vjs-progress-control.vjs-control"))||c.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",r(function(e){return f(e,u,o)},500))}),e.abrupt("return",u);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var v=function(){var r=e(t.mark(function e(r,n){var i,u,o,s,l,c,p,d;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r+n);case 2:return i=e.sent,e.next=5,i.text();case 5:u=e.sent,o=u.split("\n").map(function(e){return e.trim()}),s=[],l=null,c=0;case 10:if(!(c<(null==o?void 0:o.length))){e.next=27;break}if(!(p=o[c]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},d=p.split(":")[1]||"",d.split(",").forEach(function(e){var t=e.split("="),r=a(t,2),n=r[0],i=r[1];n&&i&&(l[n.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!p.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(p.includes("jpg")||p.includes("png")||p.includes("jpeg"))&&(l.uri=p.includes("http")?p:r+p,s.push(l),l=null);case 24:c++,e.next=10;break;case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}},e)}));return function(e,t){return r.apply(this,arguments)}}();function h(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function x(e,t){return y.apply(this,arguments)}function y(){return(y=e(t.mark(function e(r,i){var o,s,c,p,d,m,f,b,g,v,x,y,j,E,N,A,T,O,I,S,M,P,R,$,B,L,D,U,C,X,q,_,F,G,W,z,H,J,K,Q,V,Y,Z,ee,te,re,ne,ie,ae,ue,oe,se,le,ce,pe,de,me,fe;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=i,o=n(i),s=r.split("/"),c=s.findIndex(function(e){return"dash"===e.toLowerCase()}),p=h(-1!==c?s.slice(0,c+1).join("/"):new URL(r).origin),e.prev=5,e.next=8,fetch(r);case 8:return b=e.sent,e.next=11,b.text();case 11:g=e.sent,v=new DOMParser,x=v.parseFromString(g,"application/xml"),y=(null==o?void 0:o.duration())||(null===(d=u())||void 0===d||null===(m=d.video)||void 0===m?void 0:m.runtime),j=(null==x||null===(f=x.querySelector("MPD > BaseURL"))||void 0===f?void 0:f.textContent)||p+"/",E=x.getElementsByTagName("AdaptationSet"),N=0;case 18:if(!(N<E.length)){e.next=72;break}if(("image"!==(A=E[N]).getAttribute("contentType")||"image/png"!==A.getAttribute("mimeType"))&&"image/jpeg"!==A.getAttribute("mimeType")){e.next=69;break}if(O=A.getElementsByTagName("SegmentTemplate")[0],I=null===(T=O.getElementsByTagName("SegmentTimeline"))||void 0===T?void 0:T[0],!O||!I){e.next=48;break}if(P=I.getElementsByTagName("S"),R=parseInt(null===(S=P[0])||void 0===S?void 0:S.getAttribute("t")),$=parseInt(null===(M=P[0])||void 0===M?void 0:M.getAttribute("d")),B=A.getElementsByTagName("Representation")[0],L=B.getElementsByTagName("EssentialProperty")[0],D=L.getAttribute("value"),U=null==D?void 0:D.split("x"),C=a(U,2),X=C[0],q=C[1],!O){e.next=46;break}if(O.getAttribute("media"),_=O.getAttribute("timescale"),F=(_?$/_:$)/(X*q),G=B.getAttribute("id"),W=Math.round(y/F),z=Math.ceil(W/(X*q)),H=O.getAttribute("media"),parseInt(O.getAttribute("startNumber")),!isNaN(parseInt(z))){e.next=43;break}return e.abrupt("return");case 43:for(J=[],N=0;N<z;N++)Q="/"==(K=H)[0]?new URL(p).origin:p+"/",J.push({duration:F,layout:D,uri:Q+K.replace("$Time$",R+N*$).replace("$RepresentationID$",G)});return e.abrupt("return",J);case 46:e.next=69;break;case 48:if(V=A.getElementsByTagName("Representation")[0],Y=V.getElementsByTagName("EssentialProperty")[0],Z=Y.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=a(ee,2),re=te[0],ne=te[1],!O){e.next=69;break}if(O.getAttribute("media"),ie=O.getAttribute("duration"),ae=O.getAttribute("timescale"),ue=(ae?ie/ae:ie)/(re*ne),oe=V.getAttribute("id"),se=Math.round(y/ue),le=Math.ceil(se/(re*ne)),ce=O.getAttribute("media"),pe=parseInt(O.getAttribute("startNumber"))||0,!isNaN(parseInt(le))){e.next=65;break}return e.abrupt("return");case 65:for(de=[],me=w(ce),N=0;N<le;N++)fe=me?k(me,N+pe):ce,de.push({duration:ue,layout:Z,uri:j+fe.replace("$Number$",N+pe).replace("$RepresentationID$",oe)});return e.abrupt("return",de);case 69:N++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function w(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function k(e,t){var r=e.match(/%0(\d+)d/);if(!r)return e;var n=parseInt(r[1],10),i=String(t).padStart(n,"0");return e.replace(/\$Number%0\d+d\$/,i)}function j(e){return E.apply(this,arguments)}function E(){return(E=e(t.mark(function e(r){var i,a,u,o,s,l,c,p,m,f,g,h,y,w,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s=n(r),l=s.currentSource(),c=l.src,c=null!==(i=c)&&void 0!==i&&i.includes("blob")?null==s||null===(a=s.getSource)||void 0===a?void 0:a.call(s):c,null===(u=c)||void 0===u||!u.includes("m3u8")){e.next=19;break}return e.next=6,d(c,r);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,f=m.uri,g=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,v(g,f);case 12:return h=e.sent,e.next=15,b(h);case 15:y=e.sent,s.thumbnails(y);case 17:e.next=28;break;case 19:if(null===(o=c)||void 0===o||!o.includes("mpd")){e.next=28;break}return e.next=22,x(c,r);case 22:if(!((null==(w=e.sent)?void 0:w.length)>0)){e.next=28;break}return e.next=26,b(w);case 26:k=e.sent,s.thumbnails(k);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}export{j as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,d as n}from"./skin-3653c5b3.js";import{a4 as a,b as i}from"./generic-
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,d as n}from"./skin-3653c5b3.js";import{a4 as a,b as i}from"./generic-859e1b0f.js";import{s as l}from"./autoNextVideo-1ade2ac8.js";import{r as o}from"./relatedVideosManager-8dd9aa24.js";import r from"@babel/runtime/helpers/typeof";import d from"video.js";var s,u,c,m,p=[],v=!1,f=null,h=!1,g=null,x=null,y=null,C=null,E=null,b=function(){null!=f&&(clearInterval(f),f=null),h=!1},w="next-ep-preview-player-thumb",N=function(e,t){if(e){var n,a,i,l,o;(null==(n=t)||null===(a=n.gist)||void 0===a||null===(i=a.imageGist)||void 0===i?void 0:i.r16x9)||(null==n?void 0:n.img)||null===(l=window)||void 0===l||null===(o=l.customData)||void 0===o||o.fallbackImage;var r=e.getElementsByClassName(w)[0];r||((r=document.createElement("div")).className=w,r.setAttribute("aria-hidden","true"),e.appendChild(r))}},A=function(e,t){if(e){var n=e.getElementsByClassName(w)[0];n&&(n.style.visibility=t?"visible":"hidden")}},L=function(){var e=document.createElement("div");e.className="next-heading-wrapper";var t=document.createElement("div");t.className="next-ep-header";var n=document.createElement("span");n.className="next-ep-header-text",n.textContent="Next up in";var a=document.createElement("span");return a.className="next-ep-duration",a.textContent="10",t.append(n,a),e.append(t),e},B=function(e,t,a,i){var l,o,r,d,s,u=null==e?void 0:e.title,c=(null==e||null===(l=e.gist)||void 0===l?void 0:l.description)||(null==e?void 0:e.description)||"",m=document.createElement("div");m.className="next-ep-content";var p=document.createElement("div");p.className="next-ep-thumb-wrap";var f=document.createElement("img");f.className="next-ep-img",f.alt="",f.src=(null==e||null===(o=e.gist)||void 0===o||null===(r=o.imageGist)||void 0===r?void 0:r.r16x9)||(null==e?void 0:e.img)||(null===(d=window)||void 0===d||null===(s=d.customData)||void 0===s?void 0:s.fallbackImage);var h=function(e){if(null==e||Number.isNaN(Number(e)))return"";var t=Math.floor(Number(e)),n=Math.floor(t/60),a=t%60;return"".concat(n,":").concat(String(a).padStart(2,"0"))}(null==e?void 0:e.runtime),g=document.createElement("div");g.className="next-ep-thumb-runtime",g.textContent=h,h||g.classList.add("next-ep-thumb-runtime--empty"),p.appendChild(f),p.appendChild(g);var x=document.createElement("div");x.className="next-ep-meta";var y=document.createElement("div");y.className="next-ep-title",y.textContent="".concat(u||"");var C=document.createElement("div");C.className="next-ep-desc",C.textContent=c||"",String(c||"").trim()||C.classList.add("next-ep-desc--empty");var E=document.createElement("div");E.className="next-ep-meta-row";var w=document.createElement("span");w.className="next-ep-badge";var N=function(e){if(null==e?void 0:e.isClip)return"CLIP"}(e);w.textContent=N,N||w.classList.add("next-ep-badge--empty");var A=document.createElement("span");A.className="next-ep-episode",A.textContent=function(e){if(!e||"string"!=typeof e)return"";var t=e.match(/^S(\d+)\s*E(\d+)$/i)||e.match(/^S(\d+)E(\d+)$/i);return t?"S".concat(t[1]," E").concat(Number(t[2])):e}(null==e?void 0:e.episodeDisplayAttribute)||"";var L=document.createElement("div");L.className="next-ep-meta-row-left",L.appendChild(w),L.appendChild(A);var B=document.createElement("img");B.className="next-ep-network-logo",B.alt="";var S=function(e){var t,n,a;if(e){var i=null===(t=window)||void 0===t||null===(n=t.app_data)||void 0===n||null===(a=n.appcmsMain)||void 0===a?void 0:a.networks;if(e&&i){var l=null==i?void 0:i.find(function(t){if(t.identifier==e)return t});return null==l?void 0:l.badgeImage}}}(null==e?void 0:e.network);S?B.src=S:B.classList.add("next-ep-network-logo--empty"),E.appendChild(L),x.appendChild(y),x.appendChild(C),x.appendChild(E);var j=document.createElement("div");return j.className="next-ep-meta-with-logo",j.appendChild(x),j.appendChild(B),m.appendChild(p),m.appendChild(j),m.onclick=n(function(){b(),null==t||t.remove(),v=!0,I(a)},400),m},S=function n(l,r){var d;if(v=!1,C=l,E=r,y&&(y(),y=null),null!=r&&null!==(d=r.series)&&void 0!==d&&d.enable){var s;p=[];var u=i();null==u||u.map(function(t){var n;return(n=p).push.apply(n,e(t.episodes))}),null==r||null===(s=r.series)||void 0===s||s.cb}else{var c=o.get();p=(null==c?void 0:c.content)||[],null==c||c.cb,y=o.subscribe(function(){y&&(y(),y=null),C&&E&&n(C,E)})}var m=t(l);if(m){!function(e){e&&x&&(e.off("timeupdate",x),x=null)}(t(g)),b(),g=l,x=function(){var e,t;if(!v){var n=m.duration(),i=m.currentTime(),o=Number.isFinite(n)&&n>0?n-i:1/0,r=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0],d=document.getElementById(l),s=a()<=(null===(t=p)||void 0===t?void 0:t.length)-1;if(o>1){if(null!=f||h){b();var u=null==r?void 0:r.querySelector(".next-ep-header .next-ep-duration");u&&(u.textContent="10")}return r&&(r.style.visibility="hidden"),void A(d,!1)}s?(r&&(r.style.visibility="visible"),A(d,!0),h||null!=f||(m.pause(l),h=!0,function(e){var t;if(null==f){var n=null===(t=document.getElementsByClassName("next-ep-preview"))||void 0===t?void 0:t[0],i=null==n?void 0:n.querySelector(".next-ep-header .next-ep-duration");if(i){var l=10;i.textContent="10",f=setInterval(function(){l--,i.textContent=String(l),0===l&&(clearInterval(f),f=null,h=!1,p.filter(function(e,t){return t==a()}),I(e))},1e3)}}}(l))):A(d,!1)}},m.on("timeupdate",x);var w,S=p.filter(function(e,t){return t==a()});if((null==S?void 0:S.length)>0)if(null!==(w=document.getElementsByClassName("next-ep-preview"))&&void 0!==w&&w[0]){var j,k,P=null===(j=document.getElementsByClassName("next-ep-preview"))||void 0===j?void 0:j[0];P.style.visibility="hidden",null===(k=P.querySelector(".next-ep-preview-inner"))||void 0===k||k.remove(),Array.from(P.children).forEach(function(e){e.classList.contains("next-ep-content")&&e.remove()});var M=P.querySelector(".next-heading-wrapper");if(M){var O=M.querySelector(".next-ep-header"),q=null==O?void 0:O.querySelector(".next-ep-duration");if(!q&&O){O.textContent="";var F=document.createElement("span");F.className="next-ep-header-text",F.textContent="Next up in",(q=document.createElement("span")).className="next-ep-duration",q.textContent="10",O.append(F,q)}else q&&(q.textContent="10")}else M=L(),P.insertBefore(M,P.firstChild);P.appendChild(B(S[0],P,l));var T=document.getElementById(l);N(T,S[0]),A(T,!1)}else{var X=document.createElement("div");X.className="next-ep-preview",X.style.visibility="hidden";var D=document.getElementById(l);D.append(X);var R=L();X.append(R);var G=B(S[0],X,l);X.append(G),N(D,S[0]),A(D,!1)}}},I=function(e,n){var i=t(e);if(i){var o=i.duration();if(Number.isFinite(o)&&!(o<=0)){i.pause(e);var r=a();l(r,e,p)}}};function j(e,n){var a=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var l=document.createElement("div");l.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",l.append(o),a.el().appendChild(l),a.on("useractive",function(){l.classList.remove("vjs-fade")}),a.on("userinactive",function(){a.paused()||l.classList.add("vjs-fade")}),a.on("fullscreenchange",function(){a.isFullscreen_?l.style.top="3.2rem":l.style.top="1rem"})}}s={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},u=function e(){var t,n,a,i,l;for(a in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[a])i.hasOwnProperty(l)&&("object"===r(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},c=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},m=function e(t){return"HTML"!==t.nodeName&&"static"===c(t)("position")?e(t.offsetParent):t},d.registerPlugin("thumbnails",function(e){var t,n,a,i,l,o,r,d;function p(){document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",p),d()}n=u({},s,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",a=document.createElement("img"),t.appendChild(a),a.src=n[0].src,a.className="vjs-thumbnail",u(a.style,n[0].style),a.style.left||a.style.right||(a.onload=function(){a.style.left=-a.naturalWidth/2+"px"}),o=i.duration(),i.on("durationchange",function(e){o=i.duration()}),i.on("loadedmetadata",function(e){o=i.duration()}),(l=i.controlBar.progressControl).el().appendChild(t),r=function(e){var i,r,d,s,p,v,f,h,g,x;for(r in d=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((x=m(l.el()).getBoundingClientRect()).width||x.right)+g,v=e.pageX,e.changedTouches&&(v=e.changedTouches[0].pageX),s=v||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=m(l.el()).getBoundingClientRect().left+g,i=Math.floor((s-l.el().offsetLeft)/l.width()*o),n)i>r&&(d=Math.max(d,r));(p=n[d]).src&&a.src!=p.src&&(a.src=p.src),p.style&&a.style!=p.style&&u(a.style,p.style),s+(h=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=c(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(a,p.width||n[0].width)/2)>f?s-=s+h-f:s<h&&(s=h),t.style.left=s+"px"},l.on("mousemove",r),l.on("touchmove",r),l.on("pointerdown",function(e){document.addEventListener("pointermove",r),document.addEventListener("pointerup",p)}),d=function(e){t.style.left="-1000px"},l.on("mouseout",d),l.on("touchcancel",d),l.on("touchend",d),i.on("userinactive",d)});export{S as a,j as b};
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"video.js/dist/video-js.min.css";import"./generic-
|
|
1
|
+
import"video.js/dist/video-js.min.css";import"./generic-859e1b0f.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"video.js";export{V as default}from"./index-41558ed2.js";import"./index-022a4725.js";import"./captions-75f20905.js";import"./renditions-620d93b3.js";import"./resolution-2ee017b4.js";import"./skin-3653c5b3.js";import"./browser-de5f6a74.js";import"./localisation-0bf399a1.js";import"./relatedVideosManager-8dd9aa24.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 e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import n from"video.js";import{i as s,g as i,j as l}from"./icons-262bef63.js";import{
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import n from"video.js";import{i as s,g as i,j as l}from"./icons-262bef63.js";import{T as c,P as m}from"./generic-859e1b0f.js";import{j as d,g as p}from"./skin-3653c5b3.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-de5f6a74.js";import"md5";import"js-cookie";import"./captions-75f20905.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@viewlift/comscore/index.js";function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}var h=n.getComponent("Component"),v=function(){r(b,h);var v,f,y=(v=b,f=u(),function(){var e,t=a(v);if(f){var r=a(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return o(this,e)});function b(t){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,b),(r=y.call(this,t,o)).playerId=o.playerId,r.seriesData=o.sres,r.streams=o.streams,r.currentVideoData=o.res,r.initialiseStructure(),r.loadCSS(),r}return t(b,[{key:"createEl",value:function(){var e=n.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=n.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(s())});return n.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-1fb5149a.js").then(function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this.el(),t=n.dom.createEl("div",{className:"stream-container hidden"});n.dom.$(".stream-selector-icon",this.el()).onclick=function(){var r;null!==(r=t.classList)&&void 0!==r&&r.contains("hidden")?(d(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var r=document.getElementById(this.playerId);if(r){var o=window.getComputedStyle(r,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(o,"px"),r.style.overflow="hidden",n.dom.appendContent(e,t),this.addFunctionality(t)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),o=n.dom.createEl("div",{className:"stream-selector-head"}),a=n.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i())});a.onclick=function(){e.classList.add("hidden"),r.classList.remove("open"),e.style.right="-350px"};for(var s=n.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=n.dom.createEl("div",{className:"stream-selector-content"}),u=n.dom.createEl("div",{className:"stream-tray"}),h=function(e){var r,o=n.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(l())});0==e&&(o.classList.add("selected"),o.style.border="4px solid #D2393B"),o.onclick=function(){for(var r=n.dom.$$(".stream"),a=0;a<r.length;a++)r[a].style.border="none",r[a].classList.remove("selected");o.classList.add("selected"),o.style.border="4px solid #D2393B",c(t.playerId,t.streams[e].id).then(function(e){m(t.playerId),console.log(e)}).catch(function(e){console.log(e)})},o.style.backgroundImage="url(".concat(t.streams[e].img,")");var a=document.createElement("img");a.className="stream-thumbnail-image",a.src="".concat(null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img),a.alt="No Thumbnail Available",o.append(a),n.dom.appendContent(u,o),n.dom.appendContent(d,u)},v=0;v<this.streams.length;v++)h(v);n.dom.appendContent(o,a),n.dom.appendContent(o,s),n.dom.appendContent(e,o),n.dom.appendContent(e,d),p(this.playerId).on("fullscreenchange",function(){var r=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(r,"px")})}}]),b}();export{v as default};
|