@viewlift/player-backup 2.0.311-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-fc2b431a.js → autoNextVideo-1219220b.js} +1 -1
- package/cjs/bundle.css +1009 -1009
- package/cjs/{features-82d9ca88.js → features-1b6f9b76.js} +1 -1
- package/cjs/{generic-4ce1f920.js → generic-460c2f4c.js} +1 -1
- package/cjs/{index-f1e5b1d5.js → index-15040639.js} +1 -1
- package/cjs/index-d012ce66.js +1 -0
- package/cjs/{index-797d8a32.js → index-df46f39c.js} +1 -1
- package/cjs/{index-b1300549.js → index-fed823e4.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-25a94798.js → multicamv2-b46493cd.js} +1 -1
- package/cjs/{multicamv2-23894cf4.js → multicamv2-fb311cf2.js} +1 -1
- package/cjs/{nextEpisodeButton-aefe2360.js → nextEpisodeButton-651ab380.js} +1 -1
- package/cjs/{playlist-5c5ae2cc.js → playlist-649c8f45.js} +1 -1
- package/cjs/{series-53707da1.js → series-b109f9a2.js} +1 -1
- package/cjs/{series-v2-9ce94819.js → series-v2-86b32c0e.js} +1 -1
- package/cjs/{series-v2-0a721372.js → series-v2-d2950b02.js} +1 -1
- package/cjs/{skin-83ddc49a.js → skin-08149121.js} +1 -1
- package/cjs/{skin-cfb04340.js → skin-2193cc41.js} +1 -1
- package/cjs/{skin-9d5d2398.js → skin-222dc6b7.js} +1 -1
- package/cjs/{skin-880a2f6b.js → skin-4e3170cf.js} +1 -1
- package/cjs/{skin-1ccfd6d0.js → skin-765e1355.js} +1 -1
- package/cjs/{skin-c583857e.js → skin-886a6d4b.js} +1 -1
- package/cjs/{skin-bf731683.js → skin-8bcb6a55.js} +1 -1
- package/cjs/{skin-7ec3be36.js → skin-c8d40d82.js} +1 -1
- package/cjs/{skin-01efeb40.js → skin-dbacca02.js} +1 -1
- package/cjs/{skin-467293c8.js → skin-e4a31cb3.js} +1 -1
- package/cjs/{videoSelector-c73db767.js → videoSelector-13aaa2d8.js} +1 -1
- package/cjs/{videoSelector-2c01eb95.js → videoSelector-6a0fa8d0.js} +1 -1
- package/esm/{autoNextVideo-87c3e2a1.js → autoNextVideo-1ade2ac8.js} +1 -1
- package/esm/bundle.css +1009 -1009
- package/esm/{features-bb94cb4f.js → features-c38a5458.js} +1 -1
- package/esm/{generic-eb5ecc78.js → generic-859e1b0f.js} +1 -1
- package/esm/{index-54dd8002.js → index-022a4725.js} +1 -1
- package/esm/index-41558ed2.js +1 -0
- package/esm/{index-bf078f35.js → index-4fd3b927.js} +1 -1
- package/esm/{index-6b1a53a6.js → index-6c225809.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-1d7d506c.js → multicamv2-21b1f1c1.js} +1 -1
- package/esm/{multicamv2-49e47601.js → multicamv2-71e2abdd.js} +1 -1
- package/esm/{nextEpisodeButton-b81b9816.js → nextEpisodeButton-36f416dc.js} +1 -1
- package/esm/{playlist-344f2c42.js → playlist-d838f1a7.js} +1 -1
- package/esm/{series-5fe561c3.js → series-d1b982ab.js} +1 -1
- package/esm/{series-v2-61c35597.js → series-v2-03cef666.js} +1 -1
- package/esm/{series-v2-85bfd9eb.js → series-v2-2559637f.js} +1 -1
- package/esm/{skin-4c3bb9d8.js → skin-08cd7f59.js} +1 -1
- package/esm/{skin-75142274.js → skin-0fb217b1.js} +1 -1
- package/esm/{skin-497e0641.js → skin-2080b142.js} +1 -1
- package/esm/{skin-a5c5b87f.js → skin-21d67daa.js} +1 -1
- package/esm/{skin-cccac219.js → skin-255cf575.js} +1 -1
- package/esm/{skin-dd8b0e02.js → skin-361a4e27.js} +1 -1
- package/esm/{skin-991aeb3d.js → skin-49aa30ba.js} +1 -1
- package/esm/{skin-b575a309.js → skin-77405f2e.js} +1 -1
- package/esm/{skin-872cc671.js → skin-77c06b80.js} +1 -1
- package/esm/{skin-c4422c7c.js → skin-a28700c4.js} +1 -1
- package/esm/{videoSelector-ea4bd7c8.js → videoSelector-25b6e54e.js} +1 -1
- package/esm/{videoSelector-93d7b4c1.js → videoSelector-556c1f53.js} +1 -1
- package/package.json +2 -2
- package/cjs/index-6eb3b36c.js +0 -1
- package/esm/index-3d5ab252.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/get";import n from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import l from"video.js";import{E as r,g as d}from"./icons-262bef63.js";import{
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/get";import n from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import l from"video.js";import{E as r,g as d}from"./icons-262bef63.js";import{T as s,a6 as c}from"./generic-859e1b0f.js";import{m,j as u,s as v,k as p,l as h}from"./skin-3653c5b3.js";import{a as f,u as b}from"./autoNextVideo-1ade2ac8.js";import{g as y}from"./localisation-0bf399a1.js";import{r as g}from"./relatedVideosManager-8dd9aa24.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";import"./index-022a4725.js";function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(C=function(){return!!e})()}var N=l.getComponent("Component"),E=function(){n(I,N);var E,k,j=(E=I,k=C(),function(){var e,t=a(E);if(k){var o=a(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return i(this,e)});function I(t){var o,n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,I),(i=j.call(this,t,a)).playerId=a.playerId,i.seriesData=a.sres,i.videos=a.related.content,i.cb=(null==a||null===(o=a.related)||void 0===o?void 0:o.cb)||null,i.autoNext=(null==a||null===(n=a.related)||void 0===n?void 0:n.autoNext)||!1,i.currentVideoData=a.res,i.initialiseStructure(),i.loadCSS(),i.autoNext&&(c(0),f({playerId:i.playerId,content:i.videos,cb:i.cb})),i._unsubRelated=g.subscribe(function(e){var t;i.videos=(null==e?void 0:e.content)||i.videos,i.cb=null!==(t=null==e?void 0:e.cb)&&void 0!==t?t:i.cb,b(i.videos),i._refreshList()}),i}return t(I,[{key:"_buildVideoItem",value:function(e){var t,o,n,i,a,r=this,d=l.dom.createEl("div",{className:"video -".concat(e)}),u=l.dom.createEl("div",{className:"recommended -".concat(e)});u.setAttribute("video-idx",e),u.onclick=function(){c(e+1);for(var t=l.dom.$$(".recommended"),o=0;o<t.length;o++)t[o].style.border="none";m(e),s(r.playerId,r.videos[e].id).then(function(e){r.cb&&r.cb(e)}).catch(function(e){r.cb&&r.cb(e)})};var v=document.createElement("img");v.className="related-thumbnail-image",v.src="".concat((null==this||null===(t=this.videos)||void 0===t||null===(o=t[e])||void 0===o?void 0:o.img)||(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.fallbackImage)),v.alt="No Thumbnail Available",u.append(v);var p=l.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==this||null===(a=this.videos[e])||void 0===a?void 0:a.title)||"")});return l.dom.appendContent(d,u),l.dom.appendContent(d,p),d}},{key:"_refreshList",value:function(){var e=this.el().querySelector(".video-container");if(e){l.dom.emptyEl(e);for(var t=0;t<this.videos.length;t++)l.dom.appendContent(e,this._buildVideoItem(t))}}},{key:"dispose",value:function(){this._unsubRelated&&this._unsubRelated(),function(e,t,n,i){var l=o(a(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof l?function(e){return l.apply(n,e)}:l}(I,"dispose",this,3)([])}},{key:"createEl",value:function(){var e=l.dom.createEl("div",{className:"video-selection vjs-control vjs-button"});e.style.position="unset";var t=l.dom.createEl("div",{className:"video-selector-icon",innerHTML:"".concat(r())});return l.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./videoSelector-8e258d45.js").then(function(e){var t=document.createElement("style");t.id="video-selection",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),o=l.dom.createEl("div",{className:"video-selection-container hidden"});l.dom.$(".video-selector-icon",this.el()).onclick=function(){var n;null!==(n=o.classList)&&void 0!==n&&n.contains("hidden")?(u(),o.classList.remove("hidden"),t.classList.add("open"),o.style.right="0px",v(e.playerId,o)):(o.classList.add("hidden"),t.classList.remove("open"),o.style.right="-350px")};var n=document.getElementById(this.playerId);if(n){var i=window.getComputedStyle(n,null).getPropertyValue("height");o.style.height="".concat(i),l.dom.appendContent(t,o),n.style.overflow="hidden",this.addFunctionality(o),p(this.playerId,o)}}},{key:"toggleOpenClose",value:function(){}},{key:"addFunctionality",value:function(e){var t=this,o=this.el(),n=l.dom.createEl("div",{className:"video-selector-head"}),i=l.dom.createEl("div",{className:"video-selector-cross-icon",innerHTML:"".concat(d())});i.onclick=function(){e.classList.add("hidden"),o.classList.remove("open"),e.style.right="-350px"};for(var a=l.dom.createEl("div",{className:"video-selector-title",innerHTML:y("relatedVideoTitle")||"Recommended"}),r=l.dom.createEl("div",{className:"video-selector-content"}),u=l.dom.createEl("div",{className:"video-container"}),v=function(e){var o,n,i,a,d,v=l.dom.createEl("div",{className:"video -".concat(e)}),p=l.dom.createEl("div",{className:"recommended -".concat(e)});p.setAttribute("video-idx",e),p.onclick=function(){c(e+1);for(var o=l.dom.$$(".recommended"),n=0;n<o.length;n++)o[n].style.border="none";m(e),s(t.playerId,t.videos[e].id).then(function(e){t.cb&&t.cb(e)}).catch(function(e){t.cb&&t.cb(e)})};var h=document.createElement("img");h.className="related-thumbnail-image",h.src="".concat((null==t||null===(o=t.videos)||void 0===o||null===(n=o[e])||void 0===n?void 0:n.img)||(null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.fallbackImage)),h.alt="No Thumbnail Available",p.append(h);var f=l.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==t||null===(d=t.videos[e])||void 0===d?void 0:d.title)||"")});l.dom.appendContent(v,p),l.dom.appendContent(v,f),l.dom.appendContent(u,v),l.dom.appendContent(r,u)},p=0;p<this.videos.length;p++)v(p);l.dom.appendContent(n,i),l.dom.appendContent(n,a),l.dom.appendContent(e,n),l.dom.appendContent(e,r),h(this.playerId,e)}}]),I}();export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/get";import n from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{f as d,g as s}from"./icons-262bef63.js";import{
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/get";import n from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{f as d,g as s}from"./icons-262bef63.js";import{T as r,a6 as c}from"./generic-859e1b0f.js";import{i as m,j as u,s as v,k as p,h,l as b}from"./skin-3653c5b3.js";import{a as f,u as y}from"./autoNextVideo-1ade2ac8.js";import{g as C}from"./localisation-0bf399a1.js";import{r as g}from"./relatedVideosManager-8dd9aa24.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";import"./index-022a4725.js";function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(E=function(){return!!e})()}var I=a.getComponent("Component"),N=function(){n(j,I);var N,k,x=(N=j,k=E(),function(){var e,t=l(N);if(k){var o=l(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return i(this,e)});function j(t){var o,n,i,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,j),(i=x.call(this,t,l)).playerId=l.playerId,i.seriesData=l.sres,i.videos=l.related.content,i.cb=(null==l||null===(o=l.related)||void 0===o?void 0:o.cb)||null,i.autoNext=(null==l||null===(n=l.related)||void 0===n?void 0:n.autoNext)||!1,i.currentVideoData=l.res,i.initialiseStructure(),i.loadCSS(),i.autoNext&&(c(0),f({playerId:i.playerId,content:i.videos,cb:i.cb})),i._unsubRelated=g.subscribe(function(e){var t;i.videos=(null==e?void 0:e.content)||i.videos,i.cb=null!==(t=null==e?void 0:e.cb)&&void 0!==t?t:i.cb,y(i.videos),i._refreshList()}),i}return t(j,[{key:"_buildVideoItem",value:function(e){var t,o,n,i,l,d,s,r,c,u=this,v=a.dom.createEl("div",{className:"video -".concat(e)}),p=a.dom.createEl("div",{className:"recommended -".concat(e),ariaLabel:"".concat(this.videos[e].title),type:"button",tabIndex:-1});p.setAttribute("video-idx",e),p.onkeydown=function(t){"Enter"===t.key&&u.loadVideoAssetById(e)},p.onclick=function(){u.loadVideoAssetById(e)};var h=document.createElement("img");h.className="related-thumbnail-image",h.src="".concat(m(null==this||null===(t=this.videos)||void 0===t||null===(o=t[e])||void 0===o?void 0:o.img)||m(null===(n=window)||void 0===n||null===(i=n.app_data)||void 0===i||null===(l=i.appcmsMain)||void 0===l||null===(d=l.images)||void 0===d?void 0:d.placeholderCover)),h.alt="".concat((null==this||null===(s=this.videos[e])||void 0===s||null===(r=s.title)||void 0===r?void 0:r.trim().split(/\s+/).slice(0,2).join(" "))||""),p.append(h);var b=a.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==this||null===(c=this.videos[e])||void 0===c?void 0:c.title)||"")});return a.dom.appendContent(v,p),a.dom.appendContent(v,b),v}},{key:"_refreshList",value:function(){var e=this.el().querySelector(".video-container");if(e){a.dom.emptyEl(e);for(var t=0;t<this.videos.length;t++)a.dom.appendContent(e,this._buildVideoItem(t))}}},{key:"dispose",value:function(){this._unsubRelated&&this._unsubRelated(),function(e,t,n,i){var a=o(l(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof a?function(e){return a.apply(n,e)}:a}(j,"dispose",this,3)([])}},{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"video-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("button",{className:"video-selector-icon",title:"video selector",innerHTML:"".concat(d())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./videoSelector-def99d5e.js").then(function(e){var t=document.createElement("style");t.id="video-selection",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),o=a.dom.createEl("div",{className:"video-selection-container hidden"});a.dom.$(".video-selector-icon",this.el()).onclick=function(){var n;e.handleTabIndexSelector(),null!==(n=o.classList)&&void 0!==n&&n.contains("hidden")?(u(),o.classList.remove("hidden"),t.classList.add("open"),v(e.playerId,o)):(o.classList.add("hidden"),t.classList.remove("open"))};var n=document.getElementById(this.playerId);if(n){var i=window.getComputedStyle(n,null).getPropertyValue("height");o.style.height="".concat(i),a.dom.appendContent(t,o),n.style.overflow="hidden",this.addFunctionality(o),p(this.playerId,o)}}},{key:"loadVideoAssetById",value:function(e){var t=this;c(e+1);for(var o=a.dom.$$(".recommended"),n=0;n<o.length;n++)o[n].style.border="none";h(e),r(this.playerId,this.videos[e].id).then(function(e){t.cb&&t.cb(e)}).catch(function(e){t.cb&&t.cb(e)})}},{key:"handleTabIndexSelector",value:function(){var e,t,o;null!==(e=document.getElementsByClassName("video-selector-cross-icon"))&&void 0!==e&&e[0]&&(document.getElementsByClassName("video-selector-cross-icon")[0].tabIndex=0);for(var n=document.getElementsByClassName("video-accessibility"),i=(null==n||null===(t=n[0])||void 0===t||null===(o=t.children)||void 0===o?void 0:o.length)||0,l=0;l<i;l++)document.getElementsByClassName("recommended -".concat(l))[0]&&(document.getElementsByClassName("recommended -".concat(l))[0].tabIndex=0)}},{key:"handleCloseTabIndex",value:function(){var e,t,o;null!==(e=document.getElementsByClassName("video-selector-cross-icon"))&&void 0!==e&&e[0]&&(document.getElementsByClassName("video-selector-cross-icon")[0].tabIndex=-1);for(var n=document.getElementsByClassName("video-accessibility"),i=(null==n||null===(t=n[0])||void 0===t||null===(o=t.children)||void 0===o?void 0:o.length)||0,l=0;l<i;l++)document.getElementsByClassName("recommended -".concat(l))&&(document.getElementsByClassName("recommended -".concat(l))[0].tabIndex=-1)}},{key:"addFunctionality",value:function(e){var t=this,o=this.el(),n=a.dom.createEl("div",{className:"video-selector-head"}),i=a.dom.createEl("div",{className:"video-selector-cross-icon",ariaLabel:"close video selector",tabIndex:-1,innerHTML:"".concat(s())});i.onkeydown=function(n){"Enter"===n.key&&(e.classList.add("hidden"),o.classList.remove("open"),t.handleCloseTabIndex())},i.onclick=function(){e.classList.add("hidden"),o.classList.remove("open"),t.handleCloseTabIndex()};for(var l=a.dom.createEl("div",{className:"video-selector-title",innerHTML:C("relatedVideoTitle")||"Recommended"}),d=a.dom.createEl("div",{className:"video-selector-content",tabIndex:-1}),r=a.dom.createEl("div",{className:"video-container video-accessibility"}),c=function(e){var o,n,i,l,s,c,u,v,p=a.dom.createEl("div",{className:"video -".concat(e)}),h=a.dom.createEl("div",{className:"recommended -".concat(e),ariaLabel:"".concat(t.videos[e].title),type:"button",tabIndex:-1});h.setAttribute("video-idx",e),h.onkeydown=function(o){"Enter"===o.key&&t.loadVideoAssetById(e)},h.onclick=function(){t.loadVideoAssetById(e)};var b=document.createElement("img");b.className="related-thumbnail-image",b.src="".concat(m(null==t||null===(o=t.videos)||void 0===o||null===(n=o[e])||void 0===n?void 0:n.img)||m(null===(i=window)||void 0===i||null===(l=i.app_data)||void 0===l||null===(s=l.appcmsMain)||void 0===s||null===(c=s.images)||void 0===c?void 0:c.placeholderCover)),b.alt="".concat((null==t||null===(u=t.videos[e])||void 0===u?void 0:u.title.trim().split(/\s+/).slice(0,2).join(" "))||""),h.append(b);var f=a.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==t||null===(v=t.videos[e])||void 0===v?void 0:v.title)||"")});a.dom.appendContent(p,h),a.dom.appendContent(p,f),a.dom.appendContent(r,p),a.dom.appendContent(d,r)},u=0;u<this.videos.length;u++)c(u);a.dom.appendContent(n,l),a.dom.appendContent(n,i),a.dom.appendContent(e,n),a.dom.appendContent(e,d),b(this.playerId,e)}}]),j}();export{N as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viewlift/player-backup",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.313-backup",
|
|
4
4
|
"main": "dist/bundle.cjs.js",
|
|
5
5
|
"types": "dist/@viewlift/player/esm/index.d.ts",
|
|
6
6
|
"amdName": "_playerCore",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@silvermine/videojs-chromecast": "^1.4.1",
|
|
13
13
|
"@viewlift/sse": "^0.0.3",
|
|
14
14
|
"broadcast-channel": "^7.3.0",
|
|
15
|
-
"@viewlift/comscore": "^1.0.
|
|
15
|
+
"@viewlift/comscore": "^1.0.19",
|
|
16
16
|
"axios": "^1.2.3",
|
|
17
17
|
"md5": "^2.3.0",
|
|
18
18
|
"ima": "npm:videojs-ima@2.2.0",
|
package/cjs/index-6eb3b36c.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-4ce1f920.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),i=require("video.js"),o=require("@babel/runtime/helpers/classCallCheck"),l=require("@babel/runtime/helpers/createClass"),a=require("@babel/runtime/helpers/get"),u=require("@babel/runtime/helpers/inherits"),s=require("@babel/runtime/helpers/possibleConstructorReturn"),c=require("@babel/runtime/helpers/getPrototypeOf"),d=require("./index-b1300549.js"),v=require("./captions-0ca41a03.js"),f=require("./renditions-627bdfad.js"),p=require("./resolution-3af2cf1b.js"),m=require("./skin-66dce245.js"),g=require("./browser-3670a923.js"),h=require("./localisation-56e0a999.js"),y=require("@babel/runtime/helpers/typeof");require("@viewlift/comscore/index.js");var b=require("@babel/runtime/helpers/toConsumableArray"),w=require("@viewlift/sse"),k=require("./relatedVideosManager-eeeaf32c.js");function S(e,n,t,r){var i=a(c(1&r?e.prototype:e),n,t);return 2&r&&"function"==typeof i?function(e){return i.apply(t,e)}:i}function T(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(T=function(){return!!e})()}var P=i.getComponent("TextTrackSettings"),E=i.dom,I=[{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"}],C=I.map(function(e){return e.value}),D="16",O="vlp-caption-font-size-px",j="vlp-caption-font-size-style",x=".vjs-font-percent > select",_=function(e){return-1!==C.indexOf(e)?e:D},A=null;P?(A=function(){u(r,P);var e,n,t=(e=r,n=T(),function(){var t,r=c(e);if(n){var i=c(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return s(this,t)});function r(e,n){var i;return o(this,r),(i=t.call(this,e,n)).customUiReady_=!0,i.applyCustomFontSizeUI_(),i}return l(r,[{key:"applyCustomFontSizeUI_",value:function(){this.replaceFontSizeOptions_(),this.bindFontSizeChange_(),this.restoreCustomFontSize_()}},{key:"replaceFontSizeOptions_",value:function(){var e=this.$(x);if(e){for(;e.firstChild;)e.removeChild(e.firstChild);I.forEach(function(n){e.appendChild(E.createEl("option",{value:n.value,textContent:n.label}))}),e.value=D}}},{key:"bindFontSizeChange_",value:function(){var e=this,n=this.$(x);n&&this.on(n,"change",function(){return e.applyFontSize_(n.value)})}},{key:"applyFontSize_",value:function(e){var n=_(e);if("undefined"!=typeof document){var t=document.getElementById(j);t||((t=document.createElement("style")).id=j,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(O)}catch(e){}var n=_(e),t=this.$(x);t&&(t.value=n),this.applyFontSize_(n)}},{key:"getValues",value:function(){var e=S(r,"getValues",this,3)([]);return e&&delete e.fontPercent,e||{}}},{key:"setDefaults",value:function(){if(S(r,"setDefaults",this,3)([]),this.customUiReady_){var e=this.$(x);e&&(e.value=D),this.applyFontSize_(D)}}},{key:"saveSettings",value:function(){if(S(r,"saveSettings",this,3)([]),this.options_&&this.options_.persistTextTrackSettings){var e=this.$(x);if(e)try{window.localStorage.setItem(O,_(e.value))}catch(e){}}}},{key:"handleLanguagechange",value:function(){S(r,"handleLanguagechange",this,3)([]),this.applyCustomFontSizeUI_()}}]),r}(),i.registerComponent("TextTrackSettings",A)):console.warn("[vlp] CustomTextTrackSettings: video.js TextTrackSettings is not registered; skipping override.");var R=function(e){return new Promise(function(n,t){if(L(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)}})},L=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},N=function(e,n,t){var r=m.getPlayer(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var i=parseFloat(n)/100;r.volume(i),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,"'")})},M=function(e){var n=m.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},B=function(){var e=t(r.mark(function e(n){var t,o,l,a,u;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=m.getPlayer(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 a=e.sent,e.prev=5,e.next=8,R("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,a.default(i),e.finish(13);case 16:(u=i.getTech("chromecast"))&&!u.prototype.seeking&&(u.prototype.seeking=function(){}),null!==(l=window)&&void 0!==l&&l.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.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"==g.detectBrowser()?null==o||o.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)}}(),U=function(e,n){var t=m.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,r,o,l,a,u=this.el(),s=i.dom.getPointerPosition(u,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var c=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(c),c&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*s,v.seek()}})};var V=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),R("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)}}(),H=function(){var n=t(r.mark(function n(){return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,import("@viewlift/comscore/index.js").then(function(n){e.comscoreInstanceManager.set(n)});case 2:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}(),q=function(){var e=t(r.mark(function e(){return r.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){i.getPlugin("eme")||i.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),F=function(){var e=t(r.mark(function e(){var n;return r.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(i),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)}}(),z=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./index-84cce26a.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)}}(),G=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./videojs-dash5.es-072614bc.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)}}(),K=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){R("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(i)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(i)})},loadAdsLibrary:V,loadEMELibrary:q,loadMuxPlugin:F,loadDvrSeekbar:z,loadContribDash:G,loadComscorePlugin:H});function W(e){return Y.apply(this,arguments)}function Y(){return(Y=t(r.mark(function e(n){var t;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,V();case 3:t&&"Safari"==g.detectBrowser()&&Promise.resolve().then(function(){return K}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $(e){return J.apply(this,arguments)}function J(){return(J=t(r.mark(function e(n){var t,i,o,l,a,u,s,c,d,v;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return v=m.getPlayer(n.playerId),e.next=3,H();case 3:v.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,applicationName:(null==n||null===(o=n.comscore)||void 0===o?void 0:o.applicationName)||(null===(l=window)||void 0===l?void 0:l.siteName)||null,implementationId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.implementationId,projectId:null==n||null===(u=n.comscore)||void 0===u?void 0:u.projectId,debug:(null==n||null===(s=n.comscore)||void 0===s?void 0:s.debug)||!1,persistentLabels:(null==n||null===(c=n.comscore)||void 0===c?void 0:c.persistentLabels)||{},metadata:(null==n||null===(d=n.comscore)||void 0===d?void 0:d.metadata)||{}});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function X(e,n){return Q.apply(this,arguments)}function Q(){return(Q=t(r.mark(function e(n,t){var i,o,l,a,u,s,c,d,v,f,p,m,h,y;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==t?void 0:t.contentType)||"video",f=null==t||null===(i=t[v])||void 0===i?void 0:i.drmEnabled,null==t||null===(o=t[v])||void 0===o||null===(l=o.liveDetails)||void 0===l||l.isDvrEnabled,null==n||n.showPositiveSeekbar,p=(null==t||null===(a=t[v])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.dash)||null,m=(null==n||null===(c=n.comscore)||void 0===c?void 0:c.enable)||!1,h=!(null==n||null===(d=n.analytics)||void 0===d||!d.muxKey),e.prev=7,e.next=10,Promise.allSettled([f?"Safari"==g.detectBrowser()?q():"caliente"!=(null===(y=window)||void 0===y?void 0:y.siteName)?G():q():"Safari"!=g.detectBrowser()&&p?G():null,m?$(n):null,h?F():null,B(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 Z(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 ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ne=new Set,te=null,re=function(n,t,r,i){var o,l,a,u,s,c,d,v={},f=(null==n?void 0:n.contentType)||"video";v["c3.cm.id"]=(null===(o=n[f])||void 0===o?void 0:o.id)||"Null",v["c3.cm.contentType"]=ce(n),v[null==r||null===(l=r.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),v[null==r||null===(a=r.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),v[null==r||null===(u=r.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),v["c3.cm.categoryType"]=ae(n),v["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"}}(),v.DRMEnabled=(null===(s=n[f])||void 0===s?void 0:s.drmEnabled)||"None",v.DAIStream=null!==(c=n[f])&&void 0!==c&&null!==(d=c.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[r.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=ue(n),v["c3.cm.genreList"]=oe(n),v["c3.cm.genre"]=ie(n),v["c3.cm.channel"]=le(n,i);var p=fe(e.getCurrentSeries(),n);return v=ee(ee({},v),p)},ie=function(e){var n,t,r,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},oe=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"},le=function(e,n){var t,r,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(r=((null==e||null===(t=e[i])||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"},ae=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"},ue=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},se=function(e,n){var t,r,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var o=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[o])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.title)||"Null";return"".concat(l)},ce=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var de,ve,fe=function(n,t){var r,i,o,l,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return u;var s=e.getSeasonNumber(),c=e.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(i=r.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==n||null===(o=n[s-1])||void 0===o||null===(l=o.episodes)||void 0===l||null===(a=l[c-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",u},pe=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"}},me=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},ge=function(){var n=t(r.mark(function n(t,i){var o,l,a,u,s,c,d,v,f,p,g,h;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(o=(null==i?void 0:i.convivaConfig)||{},l=o.trackConvivaPlayerEvent,a=o.paymentHandler,u=o.tveProvider,s=o.enable,c=o.appName,v=(d=i||{}).token,f=d.epg,s){n.next=4;break}return n.abrupt("return");case 4:if(p=m.getPlayer(t),"function"==typeof(g=l)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,g("getConvivaObject");case 10:if(h=n.sent){n.next=13;break}return n.abrupt("return");case 13:p.ready(function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=pe(t.keySystem);g("contentInfo",{DRMEnabled:r})}else g("contentInfo",{DRMEnabled:"None"})}),n||g("contentInfo",{DRMEnabled:"None"})}),p.on("loadstart",function(){var n,t;te&&te!==p.currentSrc()&&g("playbackEnded"),g("setPlayer",p),ne.clear(),te=p.currentSrc();var r=me(p.currentType()),o=e.getCurrentVideo(),l=re(o,p,h,f);l[null==h||null===(n=h.Constants)||void 0===n?void 0:n.PLAYER_NAME]=c||"WEB",l[null==h||null===(t=h.Constants)||void 0===t?void 0:t.ASSET_NAME]=se(o,i),l.authToken=v||"NULL",l.streamType=r,l.D2CType=a||"NONE",l.subscriberType=u?"MVPD":"FREE"!==a?"D2C":"FREE",l["c3.cm.affiliate"]=u||"NULL",he.setData(l),g("contentInfo",l)}),p.on("loadedmetadata",function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),g("contentInfo",{screenResolution:e})}),p.on("play",function(){ne.has(p.currentSrc())||(ne.add(p.currentSrc()),g("playbackStarted",null))}),p.on("ended",function(){ne.has(p.currentSrc())&&ne.delete(p.currentSrc()),g("playbackEnded")}),p.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&g("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})}),p.on("dispose",function(){null==ne||ne.clear(),g("playbackEnded")});case 20:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}(),he=(de={},{setData:function(e){de=ee(ee({},de),e)},getData:function(){return de}}),ye=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-bf731683.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-cfb04340.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-467293c8.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-1ccfd6d0.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-7ec3be36.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?Promise.resolve().then(function(){return require("./skin-83ddc49a.js")}).then(function(t){t.initialiseSkin(e,n)}):"news"==t?Promise.resolve().then(function(){return require("./skin-01efeb40.js")}).then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?Promise.resolve().then(function(){return require("./skin-9d5d2398.js")}).then(function(t){t.initialiseSkin(e,n)}):"mini"==t?Promise.resolve().then(function(){return require("./skin-c583857e.js")}).then(function(t){t.initialiseSkin(e,n)}):"CN_NEWS"==t&&Promise.resolve().then(function(){return require("./skin-880a2f6b.js")}).then(function(t){t.initialiseSkin(e,n)})};function be(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 we(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?be(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ke=[],Se=0,Te=null;function Pe(){ve=null,ke=[],Se=0,Te=null}function Ee(t,r,i){var o,l,a,u,s,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==r||null===(o=r.watchHistory)||void 0===o||o.apiVersion;var d=null==r||null===(l=r.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),f=Math.floor(t.duration());null==r||null===(a=r.watchHistory)||void 0===a||a.xapiKey;var p=(null==r||null===(u=r.video)||void 0===u?void 0:u.originalObjectId)||null,m=(null==r||null===(s=r.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,g=Math.floor(t.currentTime()),h=c?100:Math.floor(v/f*100),y={};m?function(t,r,i){var o=r?"watchhistory-data-".concat(r):"watchhistory-data-guest-".concat(i),l=Ie(o),a=(new Date).getTime(),u=e.getCurrentVideo(),s=(null==u?void 0:u.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,t){return we(we({},e),{},n({},t,s[t]))},{}),d=l.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===ve});d<0?l.push(we(we({content:c},t),{},{addedDate:a,updateDate:a})):l[d]=we(we(we({},l[d]),t),{},{updateDate:a});localStorage.setItem("".concat(o),JSON.stringify(l))}(y={completed:c,watchedTime:g,watchedPercentage:h},d,r.siteOwner):(y=we(we({videoId:ve,watchedTime:g,watchedPercentage:h,doneWatching:c,profileId:d},Te&&{seriesId:Te}),p&&{originalObjectId:p}),e.saveWatchHistory(y).then(function(e){}).catch(function(e){})),Se=v+i}function Ie(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Ce(e,n,t){var r=Ie(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return r&&Array.isArray(r)&&(i=r.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i}var De=!1,Oe=function(n,t){var r,i,o=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(r=n[o])||void 0===r||null===(i=r.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!De){var l=je(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),De=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function je(e,n,t){if(Array.isArray(e))return e.map(function(e){return je(e,n,t)});if(null!==e&&"object"===y(e)){var r={};return Object.keys(e).forEach(function(i){i===n&&void 0!==e[t]?r[i]=e[t]:i===t&&void 0!==e[n]?r[i]=e[n]:r[i]=je(e[i],n,t)}),r}return e}function xe(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 _e(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)?_e(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,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,o=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw o}}}}function _e(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 Ae(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 Re(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ae(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ae(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Le=function(n,t,r,i){var o,l,a,u,s,c=i.res,d=i.sres,f=m.getPlayer(n),p=(null==c?void 0:c.contentType)||"video",h=(null==c||null===(o=c[p])||void 0===o?void 0:o.drmEnabled)||!1,b=!(null==c||null===(l=c[p])||void 0===l||null===(a=l.streamingInfo)||void 0===a||!a.isLiveStream)||"linearchannel"===p,w=(null==c||null===(u=c[p])||void 0===u||null===(s=u.liveDetails)||void 0===s?void 0:s.isDvrEnabled)||!1;e.setCurrentVideo(c),e.videoReplayTracker.set(c),f&&(f.on("loadstart",function(){b?r.resolve({status:!0,msg:"Video Loaded",response:c}):r.resolve(Re({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:c}:{response:c}))}),f.on("loadeddata",function(){var r,i,o,l,a=v.getCaptions(n);if(null==a||a.map(function(e){return v.disableCaptions(n,e.id)}),w&&"Safari"===g.detectBrowser())try{var u;null==f||null===(u=f.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==f||!f.muted())&&N(n,sessionStorage.getItem("volume")||"100");var s=e.getCurrentVideo();if(e.initialiseComscoreStreamingTracking(t),e.clearError(),null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.isExternal){var d=Re(Re({},t),c);!function(e,n){var t,r,i;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===(i=n.watchHistory)||void 0===i?void 0:i.cb)){var o,l,a,u=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.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})})}}(f,d)}else if(null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var p,h,y=Re(Re({},t),c);!function(e,n,t){var r,i,o;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(Te=null==n||null===(i=n.series)||void 0===i?void 0:i.id),ke=[],Se=0,ve=t;var l=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,a=m.getPlayer(e);a&&(a.on("dispose",Pe),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());ke.includes(Se)||(e!=Se||e<l?e>Se&&(Se=e+l):(ke.push(e),Ee(a,n,l)))}}),a.one("ended",function(){Ee(a,n,l,!0)}))}(n,y,null==s||null===(p=s.video)||void 0===p||null===(h=p.gist)||void 0===h?void 0:h.id)}if(null!=t&&null!==(l=t.analytics)&&void 0!==l&&l.muxKey&&null!=f&&f.mux){var b,k,S,T,P,E,I=(null===(b=e.getCurrentVideo())||void 0===b?void 0:b.video)||(null==c?void 0:c.video),C=null==I?void 0:I.gist,D={env_key:null==t||null===(k=t.analytics)||void 0===k?void 0:k.muxKey,player_name:"vl-web-player",player_version:null===(S=window)||void 0===S?void 0:S.vl_player_version,video_id:null==C?void 0:C.id,video_title:null==C?void 0:C.title,video_series:null==I||null===(T=I.series)||void 0===T?void 0:T.title,video_stream_type:null!=I&&null!==(P=I.streamingInfo)&&void 0!==P&&P.isLiveStream?"live":"video",viewer_user_id:null==t||null===(E=t.analytics)||void 0===E?void 0:E.userId};f.mux({debug:!1,data:D})}}),f.textTracks().on("change",function(e){var t=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];v.syncTtmlDisplay(n),f.trigger("subtitlechanged",t)}),f.on("subtitlechanged",function(e,n){var t,r,i,o,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===(i=r.framework)||void 0===i||null===(o=i.CastContext)||void 0===o||null===(l=o.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,g=p.getMediaSession(),h=g.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}}),f.tech_.on("retryplaylist",function(){b&&Oe(c,n)}),f.on("error",function(){var t,i;(console.log("ERROR",f.error(),f.error().code),4===f.error().code&&b)?Oe(c,n):(e.handleError(n,(null==f||null===(t=f.error())||void 0===t?void 0:t.message)||"Some error occured"),r.reject({status:!1,msg:(null==f||null===(i=f.error())||void 0===i?void 0:i.message)||"Some error occured",response:c}))}),f.one("play",function(){var n,r,i,o,l;if(null===(n=window)||void 0===n||null===(r=n.app_data)||void 0===r||null===(i=r.appcmsMain)||void 0===i||null===(o=i.adsConfig)||void 0===o||!o.vodAdClientSideTracking){if(null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable){var a,u,s,c=null===(a=e.getCurrentVideo())||void 0===a||null===(u=a.video)||void 0===u||null===(s=u.gist)||void 0===s?void 0:s.id,d=e.getSeriesWatchMap(),v=(null==d?void 0:d.get(c))||{t:0,p:0},p=v.t,m=v.p;p&&m<95&&setTimeout(function(){f.currentTime(p)},0)}else{var g,h,y,b,w,k,S,T=null!==(g=null==t?void 0:t.watchHistoryResumeTime)&&void 0!==g?g:null==t||null===(h=t.watchHistory)||void 0===h?void 0:h.watchedTime,P=null!==(y=null!==(b=null==t?void 0:t.watchedPercentage)&&void 0!==b?b:null==t||null===(w=t.watchHistory)||void 0===w?void 0:w.watchedPercentage)&&void 0!==y?y:0,E=null!==(k=null==t||null===(S=t.watchHistory)||void 0===S?void 0:S.completionThreshold)&&void 0!==k?k:95;T&&P<E&&setTimeout(function(){f.currentTime(T)},0)}if(null!=f&&f.dvrSeekbar)try{f.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),f.on("volumechange",function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),f.on("chromecastDisconnected",function(){if(b){f.currentSource();for(var e=f.textTracks(),n=e.length-1;n>=0;n--)f.removeRemoteTextTrack(e[n])}}),f.one("loadeddata",function(){var e,n=(null==f||null===(e=f.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"==y(f.dash)){var t,r,i,o=null==f||null===(t=f.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),l=null==o?void 0:o.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=xe(n);try{for(a.s();!(i=a.n()).done;){var u=i.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=xe(n);try{for(d.s();!(s=d.n()).done;){var v,p,m,b=s.value;("Chrome"==g.detectBrowser()||"Edge"==g.detectBrowser()&&(null!==(v=navigator)&&void 0!==v&&null!==(p=v.userAgent)&&void 0!==p&&p.includes("Macintosh")||!h))&&null!=b&&null!==(m=b.label)&&void 0!==m&&m.includes("5.1")?f.audioTracks().removeTrack(b):c.push(b)}}catch(e){d.e(e)}finally{d.f()}for(var w=c.find(function(e){return"main"===e.kind}),k=w||c.find(function(e){return e.enabled})||c[0],S=0,T=c;S<T.length;S++){var P=T[S];P.enabled=P===k}}}))};function Ne(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 Me(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ne(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Be(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 Ue(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)?Ue(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,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,o=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw o}}}}function Ue(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 Ve={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 He(n,t,r){e.emitApiErrorEvent(n,{status:r,message:"DRM ".concat(t," request failed")},"playback",{requestKind:t})}function qe(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 i=n[r[t]];if("string"==typeof i)return i;if(null!=i&&i.url)return i.url;if(null!=i&&i.licenseUri)return i.licenseUri}var o=null==e?void 0:e.keySystemOptions;if(Array.isArray(o)){var l,a=Be(o);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 Fe(e){if(null!=e&&e.__vlDrmLicenseUrl)return e.__vlDrmLicenseUrl;try{return qe("function"==typeof e.currentSource?e.currentSource():null)}catch(e){return""}}function ze(n,t){t&&!t.__vlDrmDashHooksInstalled&&(t.__vlDrmDashHooksInstalled=!0,"function"==typeof t.addResponseInterceptor&&t.addResponseInterceptor(function(n){try{var t=(null==n?void 0:n.request)||{},r=(null==n?void 0:n.url)||(null==t?void 0:t.url)||"",i=e.classifyRequestKind(r,(null==t?void 0:t.type)||(null==n?void 0:n.type));if(e.isDrmRequestKind(i)){var o=e.extractStatusCode(n,null);e.isHttpOk(o)||He(r,i,o)}}catch(e){}return Promise.resolve(n)}),"function"==typeof t.registerLicenseRequestFilter&&t.registerLicenseRequestFilter(function(e){try{null!=e&&e.url&&(t.__vlLastLicenseUrl=e.url)}catch(e){}return Promise.resolve()}),"function"==typeof t.on&&t.on("public_licenseRequestComplete",function(r){try{var i,o,l,a;if(null==r||!r.error)return;var u=null!==(i=null==r||null===(o=r.error)||void 0===o||null===(l=o.data)||void 0===l?void 0:l.responseCode)&&void 0!==i?i:e.extractStatusCode(null,r.error);He((null==r||null===(a=r.data)||void 0===a?void 0:a.url)||t.__vlLastLicenseUrl||Fe(n)||"","license",u)}catch(e){}}))}var Ge=!1,Ke=null,We=new Set;function Ye(e){if(e&&!e.__vlDrmDashRegistered){e.__vlDrmDashRegistered=!0,We.add(e),e.__vlDrmDashEnabled=!0;var n=function(){e.__vlDrmDashRegistered&&(e.__vlDrmDashRegistered=!1,e.__vlDrmDashEnabled=!1,We.delete(e),function(){if(Ge&&!(We.size>0)){var e=null==i?void 0:i.Html5DashJS;e&&"function"==typeof e.removeHook&&"function"==typeof Ke&&e.removeHook("beforeinitialize",Ke),Ge=!1,Ke=null}}())};"function"==typeof e.one?e.one("dispose",n):"function"==typeof e.on&&e.on("dispose",n)}}function $e(n){if(n){Ye(n),function(){if(!Ge){var e=null==i?void 0:i.Html5DashJS;e&&"function"==typeof e.hook&&(Ke=function(e,n){null!=e&&e.__vlDrmDashEnabled&&ze(e,n)},Ge=!0,e.hook("beforeinitialize",Ke))}}(),function(n){n&&!n.__vlEmeDrmErrorInstalled&&(n.__vlEmeDrmErrorInstalled=!0,n.on("error",function(){try{var t,r="function"==typeof n.error?n.error():null;if(!r||!e.isDrmError(r))return;if(null!=n&&null!==(t=n.dash)&&void 0!==t&&t.mediaPlayer)return;He(Fe(n),"license",null)}catch(e){}}))}(n);var t=function(){var t;!function(n){var t,r,i=null==n||null===(t=n.tech_)||void 0===t||null===(r=t.vhs)||void 0===r?void 0:r.xhr;i&&"function"==typeof i.onResponse&&!n.__vlDrmVhsHooksInstalled&&(n.__vlDrmVhsHooksInstalled=!0,i.onResponse(function(n,t,r){try{var i=function(e){return(null==e?void 0:e.uri)||(null==e?void 0:e.url)||(null==e?void 0:e.src)||""}(n),o=e.classifyRequestKind(i,null==n?void 0:n.type);if(!e.isDrmRequestKind(o))return;var l=e.extractStatusCode(r,t);e.isHttpOk(l)&&!t||He(i,o,l)}catch(e){}}))}(n),ze(n,null==n||null===(t=n.dash)||void 0===t?void 0:t.mediaPlayer)};t(),n.on("xhr-hooks-ready",t),n.on("loadstart",function(){setTimeout(t,0)})}}var Je=function(o,l,a,u){var s,c,d,f,p,h,y,b,w,k,S,T,P,E,I,C,D,O,j,x,_,A,R,L,N,M,B,V,H,q,F,z,G,K,W,Y,$,J,Q=l.res,Z=void 0===Q?null:Q,ee=l.sres,ne=void 0===ee?null:ee,te=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!=Ve[r]?Ve[r]:5}}catch(e){return{playerDebug:!1,logLevel:null,dashLogLevel:5}}}(),re=te.playerDebug,ie=te.logLevel,oe=te.dashLogLevel;re&&(console.log("[PLAYER DEBUG] config:",a),console.log("[PLAYER DEBUG] entitlement (res):",Z),ne&&console.log("[PLAYER DEBUG] series response (sres):",ne));var le=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],ae=(null===(s=Z)||void 0===s?void 0:s.contentType)||"video",ue=m.impolicy16x9(null===(c=Z)||void 0===c||null===(d=c[ae])||void 0===d||null===(f=d.gist)||void 0===f?void 0:f.videoImageUrl)||m.impolicy16x9(null===(p=Z)||void 0===p||null===(h=p[ae])||void 0===h||null===(y=h.gist)||void 0===y||null===(b=y.imageGist)||void 0===b?void 0:b.r16x9),se=(null===(w=Z)||void 0===w||null===(k=w[ae])||void 0===k||null===(S=k.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,ce=!(null===(T=Z)||void 0===T||null===(P=T[ae])||void 0===P||null===(E=P.streamingInfo)||void 0===E||!E.isLiveStream)||"linearchannel"===ae,de=(null===(I=Z)||void 0===I||null===(C=I.ads)||void 0===C||null===(D=C.preRoll)||void 0===D||null===(O=D.adTags)||void 0===O||null===(j=O.web)||void 0===j?void 0:j.active)&&(null===(x=Z)||void 0===x||null===(_=x.ads)||void 0===_||null===(A=_.preRoll)||void 0===A||null===(R=A.adTags)||void 0===R||null===(L=R.web)||void 0===L?void 0:L.url);Z=Me(Me({},Z),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ve=(null==a||null===(N=a.customData)||void 0===N?void 0:N.ads)||{},fe=(null===(M=Z)||void 0===M||null===(B=M[ae])||void 0===B?void 0:B.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==ve?void 0:ve.vodAdSticherProvider)||!1,pe=!(null===(V=Z)||void 0===V||null===(H=V[ae])||void 0===H||!H.isSSAIEnabled)&&"TRANSMIT"==(null==ve?void 0:ve.liveAdSticherProvider)&&!(null==ve||!ve.liveAdClientSideTracking),me=(null==a?void 0:a.latency)||6,be=(null==a?void 0:a.skin_settings)||{},we=null,ke=($={enableSmoothSeeking:!0,controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==be?void 0:be.pictureInPictureToggle)||!1},playbackRates:null!=be&&be.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==a.skin,liveui:se},n($,"autoplay",null==a?void 0:a.autoplay),n($,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!de),n($,"loop",(null==a?void 0:a.loop)||!1),n($,"audioPosterMode",null==a?void 0:a.audioPosterMode),n($,"html5",Me(Me({dash:Me(Me({},!i.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:Me(Me({},((null==a?void 0:a.debugConfig)&&(null==a||null===(q=a.debugConfig)||void 0===q?void 0:q.enable)||re)&&{debug:{logLevel:oe}}),{},{streaming:{delay:{liveDelay:me},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:Me({},"IE"==g.detectBrowser()&&{enableStallFix:!0,stallSeek:1}),abr:Me(Me(Me(Me({},(null==a?void 0:a.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==a?void 0:a.initialBandwidth)/1e3}}),(null==a?void 0:a.maxBitrate)&&{maxBitrate:{audio:-1,video:(null==a?void 0:a.maxBitrate)/1e3}}),(null==a?void 0:a.minBitrate)&&{minBitrate:{audio:-1,video:(null==a?void 0:a.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:Me(Me(Me({},(null==a?void 0:a.initialBandwidth)&&{bandwidth:a.initialBandwidth}),{},{liveRangeSafeTimeDelta:me,useDevicePixelRatio:!0,experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==a||!a.initialBandwidth},(null==a||null===(F=a.customData)||void 0===F?void 0:F.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(z=null==a?void 0:a.enableLowInitialPlaylist)&&void 0!==z&&z},((null==a?void 0:a.debugConfig)&&(null==a||null===(G=a.debugConfig)||void 0===G?void 0:G.enable)||re)&&{debug:!0}),debug:(null==a?void 0:a.debugConfig)&&(null==a||null===(K=a.debugConfig)||void 0===K?void 0:K.enable)||re||!1,nativeTextTracks:"Safari"==g.detectBrowser()},0==(null==a||null===(W=a.customData)||void 0===W?void 0:W.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(Y=a.customData)||void 0===Y?void 0:Y.nativeVideoTracks)&&{nativeVideoTracks:!1})),n($,"poster",ue),n($,"techOrder",le),n($,"chromecast",{requestCustomDataFn:function(n){var t,r,i=m.getPlayer(o),l=((null==i?void 0:i.textTracksJson_)||i.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),u=function(e,n,t){var r,i,o,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,g,h,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,P=(null==T?void 0:T.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(h=g[0])||void 0===h||null===(y=h.options)||void 0===y?void 0:y.serverURL);p.licenseUrl=P;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 I=(null==e||null===(r=e[f])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=I;var C=null==e||null===(o=e[f])||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.runtime;p.duration=C;var D=null==e||null===(a=e[f])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;p.mediaTitle=D;var O=null==e||null===(s=e[f])||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=O,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),s=l.find(function(e){return"showing"===e.mode})||null;return we=s?{language:s.language||s.lang||null,label:s.label||null}:null,Me(Me({},u),{},{activeCaption:{enabled:!!s,language:(null==s?void 0:s.language)||(null==s?void 0:s.lang)||null,label:(null==s?void 0:s.label)||null},transmitTrackingUrl:e.trackingUrlManager.get()||null,convivaMetaData:Me({customerKey:(null==a||null===(t=a.convivaConfig)||void 0===t?void 0:t.customerKey)||null,debug:(null==a||null===(r=a.convivaConfig)||void 0===r?void 0:r.debug)||!1},he.getData())})},modifyLoadRequestFn:function(e){var n,t,r,i,l,a=m.getPlayer(o),u=(null==a?void 0:a.currentSource())||{};!(null===(n=Z)||void 0===n||null===(t=n[ae])||void 0===t||null===(r=t.streamingInfo)||void 0===r||null===(i=r.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")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),$);if(!i.getPlayers()[o]){(null!=a&&a.debugConfig&&null!=a&&null!==(J=a.debugConfig)&&void 0!==J&&J.enable||re)&&i.log.level(ie||"debug");var Se=i(o,ke,function(){var n=t(r.mark(function n(){var t,l,s,c,d,f,p,m,g,h,y,b,w,k,S,T,P,E,I,C,D,O;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return $e(Se),console.log(Se),console.log(i.VERSION),console.log(i.getPlugins()),n.next=6,X(a,Z);case 6:if(null!=a&&a.debugConfig&&null!=a&&null!==(t=a.debugConfig)&&void 0!==t&&t.enable||re){try{i.log.level(ie||"debug")}catch(e){}(w=function(){try{var e,n,t;null==Se||null===(e=Se.dash)||void 0===e||null===(n=e.mediaPlayer)||void 0===n||null===(t=n.updateSettings)||void 0===t||t.call(n,{debug:{logLevel:oe}})}catch(e){}})(),Se.one("loadedmetadata",w)}if(k=null===(l=Z)||void 0===l||null===(s=l[ae])||void 0===s||null===(c=s.liveDetails)||void 0===c?void 0:c.startOverTime,ce&&u.resolve(Me({status:!0,msg:"Player Initialised"},ne?{seriesResponse:ne,response:Z}:{response:Z})),e.inititateBeacon(o,{analyticsCb:null==a?void 0:a.analyticsCb,analyticsEventParams:null==a?void 0:a.analyticsEventParams,userId:null==a?void 0:a.userId}),ge(o,a),Se.on("chromecastConnected",function(){var e=Se.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||we;if(e){var t=Se.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")}};Se.one("loadeddata",function(){return setTimeout(t,0)}),setTimeout(t,1500)}),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),se&&U(o,k),!de||null!=a&&null!==(d=a.customData)&&void 0!==d&&d.disableAds||e.initialiseAdvertisement(o,de,Z),S=e.getSource(Z,o),console.log(S),re&&(console.log("[PLAYER DEBUG] source:",S),console.log("[PLAYER DEBUG] videojs options:",ke)),null!=a&&a.nearestClusterUrl&&(S=e.getUpdatedClusterSource(S,a.nearestClusterUrl)),!fe){n.next=25;break}return n.next=22,e.getSGAIEnabledSource(o,Z);case 22:S=n.sent,n.next=29;break;case 25:if(!pe){n.next=29;break}return n.next=28,e.getTransmitEnabledSource(S,Z,o);case 28:S=n.sent;case 29:Se&&(Se.__vlDrmLicenseUrl=qe(S)),S?e.loadVideo(o,S):(u.reject({status:!1,msg:"Incompatible / Missing Source",response:Z}),e.handleError(o,"Incompatible / Missing Source")),((null===(f=Z)||void 0===f||null===(p=f[ae])||void 0===p||null===(m=p.contentDetails)||void 0===m||null===(g=m.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(h=Z)||void 0===h||null===(y=h[ae])||void 0===y||null===(b=y.closedCaptions)||void 0===b?void 0:b.length)>0)&&(O=(null===(P=Z)||void 0===P||null===(E=P[ae])||void 0===E||null===(I=E.contentDetails)||void 0===I?void 0:I.closedCaptions)||(null===(C=Z)||void 0===C||null===(D=C[ae])||void 0===D?void 0:D.closedCaptions),T=O.filter(function(e){return"VTT"===e.format}),v.addCaptions(o,T)),null!=a&&a.disableControls?e.disableControls(o):ye(o,Me(Me(Me({},a),ke),{},{liveVideo:ce,isDvrEnabled:se,res:Z,sres:ne})),Le(o,Me(Me(Me({},a),ke),{},{liveVideo:ce}),u,{res:Z,sres:ne});case 34:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function Xe(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 Qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Ze=function(e,n){var t=n.resolve,r=n.reject,i=null==e?void 0:e.playerId,o=en(e);Je(i,{res:o},e,{resolve:t,reject:r})},en=function(n){var t,r,i,o,l,a,u,s,c,d,v,f,p,m=null==n?void 0:n.streamingInfo,g=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,h=(null==n||null===(r=n.streamingInfo)||void 0===r?void 0:r.isDrmEnabled)||null,y=(null==n||null===(i=n.streamingInfo)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.url)||null,w=(null==n||null===(l=n.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,k=(null==n||null===(a=n.streamingInfo)||void 0===a?void 0:a.subtitles)||[],S=(null==n||null===(u=n.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,T=(null==n||null===(c=n.streamingInfo)||void 0===c?void 0:c.macroMap)||[],P=(null==n||null===(d=n.customData)||void 0===d||null===(v=d.ads)||void 0===v?void 0:v.isSSAIEnabled)||!1,E=null==n?void 0:n.token,I=e.getDecodedToken(E);null==I||I.site;var C=null==I?void 0:I.siteId,D=(null==n||null===(f=n.customData)||void 0===f||null===(p=f.comscore)||void 0===p?void 0:p.video)||null,O=Qe(Qe({id:"".concat(C,"_external")},!h&&{directPlaybackUrl:null==g?void 0:g.url}),{},{video:Qe(Qe(Qe(Qe(Qe({drmEnabled:h,streamingInfo:Qe(Qe({videoAssets:Qe(Qe({},S&&{drmProvider:S}),{},{widevine:null==g?void 0:g.widevine,fairPlay:null==g?void 0:g.fairPlay,playReady:null==g?void 0:g.playReady})},(null==m?void 0:m.isDvrEnabled)&&{isLiveStream:!0}),(null==D?void 0:D.isLiveStream)&&{isLiveStream:null==D?void 0:D.isLiveStream})},P&&{isSSAIEnabled:P}),{},{metadata:T,liveDetails:{isDvrEnabled:null==m?void 0:m.isDvrEnabled},gist:Qe(Qe(Qe({},w&&{videoImageUrl:w}),(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:Qe({},(null==k?void 0:k.length)>0&&{closedCaptions:b(k)})},(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:Qe(Qe({},y&&{active:!0}),y&&{url:y})}}}});return D&&(null!=D&&D.isDvrEnabled&&(O.video.liveDetails=Qe(Qe({},O.video.liveDetails),{},{isDvrEnabled:null==D?void 0:D.isDvrEnabled})),null!=D&&D.metadata&&(O.video.metadata=[].concat(b(O.video.metadata),b(null==D?void 0:D.metadata)))),O};function nn(e,n){return tn.apply(this,arguments)}function tn(){return(tn=t(r.mark(function n(t,i){var o,l,a,u,s,c,v,f,p;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,s=null==t?void 0:t.videoId,c=null==t?void 0:t.playerId,v=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:f=n.sent,p=!1===(null==t||null===(o=t.customData)||void 0===o||null===(l=o.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getVideoDetails(s,f,p).then(function(n){var r,i,o,l,p,m,g,h,y,b,w;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(i=r.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType,e.setCurrentVideo(null==n?void 0:n.data);var k=null==n||null===(l=n.data)||void 0===l||null===(p=l.video)||void 0===p||null===(m=p.gist)||void 0===m?void 0:m.scheduleEndDate,S=null==n||null===(g=n.data)||void 0===g||null===(h=g.video)||void 0===h||null===(y=h.gist)||void 0===y?void 0:y.scheduleStartDate;d.handlePlayerMessage(c,{scheduleEndDate:k,scheduleStartDate:S});var T=null==n?void 0:n.data;if(null!=t&&null!==(b=t.watchHistory)&&void 0!==b&&b.isExternal)T.contentType="video",Je(c,{res:T},t,{resolve:a,reject:u});else if(null!=t&&t.watchHistory&&null!=t&&null!==(w=t.watchHistory)&&void 0!==w&&w.enable&&!v){var P;if((null===(P=t.watchHistory)||void 0===P?void 0:P.saveOffline)||!1){var E,I,C,D=Ce((null===(E=t.watchHistory)||void 0===E?void 0:E.profileId)||"",s,null==t?void 0:t.siteOwner);if(D&&D.length)t.watchHistoryResumeTime=(null===(I=D[0])||void 0===I?void 0:I.watchedTime)||null,t.watchedPercentage=(null===(C=D[0])||void 0===C?void 0:C.watchedPercentage)||null;T.contentType="video",Je(c,{res:T},t,{resolve:a,reject:u})}else e.getVideoInfo(s,f).then(function(e){var n,r,i,o,l,a;null!==(n=window)&&void 0!==n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,T.contentType="video"}).catch(function(){}).finally(function(){Je(c,{res:T},t,{resolve:a,reject:u})})}else Je(c,{res:T},t,{resolve:a,reject:u})}).catch(function(n){var r,i,o=(null==t||null===(r=t.event)||void 0===r?void 0:r.showScheduleTimer)||!1,l=(null==t||null===(i=t.event)||void 0===i?void 0:i.onCountdownComplete)||null;o&&d.handleCountdownTimer(c,n,l),e.initiateErrorHandling(n,c,u,s)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function rn(e,n){return on.apply(this,arguments)}function on(){return(on=t(r.mark(function n(t,i){var o,l,a,u,s,c,d,v;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,n.next=3,e.getToken();case 3:s=n.sent,c=null==t?void 0:t.playerId,d=null==t?void 0:t.epg,v=!1===(null==t||null===(o=t.customData)||void 0===o||null===(l=o.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getLinearChannelDetails(d,s,v).then(function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==d?void 0:d.channelId,Je(c,{res:n},t,{resolve:a,reject:u})}).catch(function(n){e.initiateErrorHandling(n,c,u,videoId)});case 8:case"end":return n.stop()}},n)}))).apply(this,arguments)}function ln(e,n){return an.apply(this,arguments)}function an(){return(an=t(r.mark(function n(t,i){var o,l,a,u,s,c,d;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:u=n.sent,s=null==t?void 0:t.playerId,c=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(c)),d=null==t||null===(o=t.series)||void 0===o?void 0:o.id,e.getSeriesDetails(d,u).then(function(n){var r,i,o,c=n.data,v=n.data.seasons;e.setCurrentSeries(v);var f=videoId||(null==v||null===(r=v[0])||void 0===r||null===(i=r.episodes)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.id);e.createSeriesWatchMap(d,u),e.getVideoDetails(f,u).then(function(n){var r,i,o;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(i=r.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType,e.setCurrentVideo(n.data),Je(s,{res:null==n?void 0:n.data,sres:c},t,{resolve:l,reject:a})}).catch(function(n){e.initiateErrorHandling(n,s,a,videoId)})}).catch(function(n){e.initiateErrorHandling(n,s,a)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}var un,sn=(un=new Map,{set:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=Array.isArray(n)?n:[];return un.set(e,t),t},get:function(e){return un.get(e)||[]},remove:function(e){un.delete(e)}});function cn(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 dn(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 vn(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)?vn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,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,o=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw o}}}}function vn(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 fn=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)}},pn=function(e){var n;try{var t,r,i=null==e||null===(t=e.liveTracker)||void 0===t||null===(r=t.seekableEnd)||void 0===r?void 0:r.call(t);if(Number.isFinite(i))return i}catch(e){}var o=null==e||null===(n=e.seekable)||void 0===n?void 0:n.call(e);return o&&o.length?o.end(o.length-1):NaN};function mn(e){var t=null,r=null,i="none",o=function(n){var o=m.getPlayer(e);if(!o)return null;if("pdt"===i&&null!=t)return r+(n-t);var l=pn(o);return Number.isFinite(l)?l-(Date.now()/1e3-n):null},l=function(){var n=m.getPlayer(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 n=m.getPlayer(e);if(n){var o=function(e){try{var n=e.tech(!0),t=n&&n.vhs,r=t&&t.playlists,i=r&&"function"==typeof r.media&&r.media();return i&&i.segments||null}catch(e){return null}}(n),l=n.currentTime()||0;if(o&&o.length){var a,u=null,s=1/0,c=dn(o);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 t=u.programDateTime/1e3,r=u.start,void(i="pdt")}t=null,r=null,i="now"}},anchorInfo:function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cn(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}({anchorPdtSec:t,anchorPlayerT:r,source:i},l())},chapterToPlayerTime:function(e){return o(fn(e).start)},chapterStartPercent:function(e){return function(e){var n=l(),t=n.start,r=n.end;if(!(r>t))return null;var i=o(e);return null==i||i<t||i>r?null:(i-t)/(r-t)*100}(fn(e).start)},playerTimeToChapterIndex:function(n,o){var l=function(n){var o=m.getPlayer(e);if(!o)return null;if("pdt"===i&&null!=t)return t+(n-r);var l=pn(o);return Number.isFinite(l)?Date.now()/1e3-(l-n):null}(n);if(null==l)return-1;for(var a=-1,u=0;u<o.length;u++){var s=fn(o[u]),c=s.start,d=s.end,v=Math.max(d,c+.001);l>=c&&l<v&&(a=u)}return a},windowBounds:l}}function gn(e){return"livedvr"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).timeMode?mn(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=m.getPlayer(e),i=r&&r.duration();if(!Number.isFinite(i)||i<=0)return null;var o,l=n(t);return l<0||l>i?null:100*((o=l/i)<0?0:o>1?1:o)},playerTimeToChapterIndex:function(e,r){for(var i=-1,o=0;o<r.length;o++){var l=n(r[o]),a=Math.max(t(r[o]),l+.001);e>=l&&e<a&&(i=o)}return i},windowBounds:function(){var n=m.getPlayer(e),t=n&&n.duration();return{start:0,end:Number.isFinite(t)?t:0}},refreshAnchor:function(){},anchorInfo:function(){return{source:"vod"}}}}(e)}var hn="chapter-change",yn="chapter-click",bn="chapters-updated";function wn(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=m.getPlayer(e);r?r.trigger(n,t):console.error("[CHAPTERS] Player instance not found")}function kn(e){var n=m.getPlayer(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(hn,e)},onChapterClick:function(e){return t(yn,e)},onChaptersUpdated:function(e){return t(bn,e)}}}var Sn="vjs-chapter-marker",Tn="vjs-chapter-preview",Pn=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 En(e,n){var t=n.store,r=n.mapper,o=n.chaptersConfig,l=void 0===o?{}:o,a=n.seek,u=m.getPlayer(e);if(!u)return{render:function(){},reposition:function(){},destroy:function(){}};var s=new Map,c=null,d=-1,v=function(){return!0===(null==l?void 0:l.enable)},f=function(n,t){var o=m.getPlayer(e),l=Pn(o);if(l){var a=function(e){if(c&&c.isConnected)return c;(c=document.createElement("div")).className=Tn;var n=document.createElement("div");n.className="vjs-chapter-preview__time";var t=document.createElement("div");t.className="vjs-chapter-preview__label",c.appendChild(n),c.appendChild(t);var r=document.createElement("span");return r.className="vjs-chapter-preview__pointer",c.appendChild(r),c._time=n,c._label=t,c._pointer=r,e.appendChild(c),c}(l);a._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 i.formatTime(n,n);var t=(r.windowBounds()||{}).end;if(!Number.isFinite(t))return"";var o=Math.max(0,t-n);return"-".concat(i.formatTime(o,o))}catch(e){return""}}(n),a._label.textContent=(null==n?void 0:n.label)||"",a.classList.add("vjs-chapter-preview--visible");var u="function"==typeof(null==o?void 0:o.el)?o.el():null;u&&u.classList.add("vlp-chapter-preview-open"),function(e,n,t,r){var i="function"==typeof(null==t?void 0:t.el)?t.el():null;if(i){var o=i.getBoundingClientRect(),l=n.getBoundingClientRect(),a=e.offsetWidth||300,u=a/2,s=l.left+r/100*l.width,c=o.left+8+u,d=o.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,"%")}(a,l,o,t)}},p=function(){c&&c.classList.remove("vjs-chapter-preview--visible");var n=m.getPlayer(e),t="function"==typeof(null==n?void 0:n.el)?n.el():null;t&&t.classList.remove("vlp-chapter-preview-open")},g=function(n){var t=document.createElement("div");t.className=Sn,t.dataset.segmentId=String(n.segmentId);var i=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=m.parseSvgString(n);r&&t.appendChild(r)}else{var i=document.createElement("img");i.src=n,i.alt="",t.appendChild(i)}return t}(n);return i&&t.appendChild(i),t.addEventListener("click",function(t){t.stopPropagation(),"function"==typeof a&&a(n.segmentId),wn(e,yn,{chapter:n})}),t.addEventListener("mouseenter",function(){var e=r.chapterStartPercent(n);null!=e&&f(n,e)}),t.addEventListener("mouseleave",p),t},h=function(){v()&&0!==s.size&&(r.refreshAnchor(),t.get(e).forEach(function(e){var n=s.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,"%"))}}))},y=0,b=function(n){s.forEach(function(e){return e.classList.remove("".concat(Sn,"--active"))});var r=t.get(e),i=n>=0?r[n]:null;if(i){var o=s.get(String(i.segmentId));o&&o.classList.add("".concat(Sn,"--active"))}},w=function(){var n=m.getPlayer(e);if(n){var i=t.get(e),o=r.playerTimeToChapterIndex(n.currentTime()||0,i);-1===o&&Date.now()<y||o!==d&&(d=o,b(o),wn(e,hn,{chapter:o>=0?i[o]:null}))}},k=m.throttle(function(){h(),w()},1e3),S=function(){h(),w()};u.on("timeupdate",k),u.on("seeked",S);var T=!1;try{u.liveTracker&&"function"==typeof u.liveTracker.on&&(u.liveTracker.on("liveedgechange",h),T=!0)}catch(e){}var P=null;(function(){try{return"function"==typeof r.anchorInfo&&"vod"!==r.anchorInfo().source}catch(e){return!1}})()&&(P=setInterval(h,500));return{render:function(){var n=m.getPlayer(e),i=Pn(n);i&&(i.querySelectorAll(".".concat(Sn)).forEach(function(e){return e.remove()}),s.clear(),v()&&(r.refreshAnchor(),t.get(e).forEach(function(e){var n=g(e);i.appendChild(n),s.set(String(e.segmentId),n)}),h(),b(d),w()))},reposition:h,destroy:function(){try{u.off("timeupdate",k),u.off("seeked",S),T&&u.liveTracker.off("liveedgechange",h)}catch(e){}P&&(clearInterval(P),P=null);var n=Pn(m.getPlayer(e));n&&n.querySelectorAll(".".concat(Sn,", .").concat(Tn)).forEach(function(e){return e.remove()}),s.clear(),c=null},setActiveBySegment:function(n){var r=t.get(e),i=r.findIndex(function(e){return String(e.segmentId)===String(n)});i<0||(y=Date.now()+1500,i!==d&&(d=i,b(i),wn(e,hn,{chapter:r[i]})))}}}var In=new Map,Cn=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}},Dn=function(e){var n=In.get(e);if(n)return n;n={mapper:gn(e,{timeMode:"vod"}),markers:null,chaptersConfig:{},timeMode:"vod"},In.set(e,n);var t=m.getPlayer(e);return t&&t.on("dispose",function(){return Rn(e)}),n},On=function(e){var n=In.get(e),t=function(e){var n=In.get(e);if(!n||n.markers)return(null==n?void 0:n.markers)||null;var t=m.getPlayer(e);return t&&Cn(t)?(n.markers=En(e,{store:sn,mapper:n.mapper,chaptersConfig:n.chaptersConfig,seek:function(n){return An(e,n)}}),n.markers):null}(e);t&&n&&t.render()};function jn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Dn(e),sn.set(e,n),On(e),wn(e,bn,{chapters:sn.get(e)}),!0}function xn(e){return sn.get(e)}function _n(e){sn.set(e,[]);var n=In.get(e);return null!=n&&n.markers&&n.markers.render(),wn(e,bn,{chapters:[]}),!0}function An(e,n){var t,r,i=m.getPlayer(e),o=Dn(e);if(!i)return!1;var l=sn.get(e).find(function(e){return e.segmentId===n});if(!l)return!1;o.mapper.refreshAnchor();var a=o.mapper.chapterToPlayerTime(l);if(null==a||!Number.isFinite(a))return!1;var u=o.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)),i.currentTime(a),null===(t=o.markers)||void 0===t||null===(r=t.setActiveBySegment)||void 0===r||r.call(t,n),!0}function Rn(e){var n=In.get(e);n&&(n.disposed=!0,n.markers&&n.markers.destroy()),In.delete(e),sn.remove(e)}var Ln,Nn=function(n){var t=n.site,r=n.sseBaseUrl,i=n.sseEndpoint,o=n.debug,l=void 0!==o&&o;return w.createSSETransport({site:t,sseBaseUrl:r,getToken:e.getToken,sseEndpoint:i,onOpen:function(e){var n=e.userId,t=e.endpoint;l&&console.log("SSE Connected:",n,t)},onMessage:function(n){var t,r,i,o,a,u,s,c,v,f;if(l&&console.log("SSE Message:",n),(null===(t=e.getCurrentVideo())||void 0===t||null===(r=t.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)===(null==n||null===(o=n.payload)||void 0===o?void 0:o.id)&&"GAME_STATE_CHANGE"===(null==n?void 0:n.notificationType)){var p=1e3*(null==n||null===(a=n.payload)||void 0===a||null===(u=a.states)||void 0===u||null===(s=u.live)||void 0===s?void 0:s.startDateTime),m=1e3*(null==n||null===(c=n.payload)||void 0===c||null===(v=c.states)||void 0===v||null===(f=v.end)||void 0===f?void 0:f.endDateTime);p&&m&&(console.log("Setting schedule timer",p,m),d.scheduleTimerInstanceManager.set({startDateTime:p,endDateTime:m}))}},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")}})},Mn=function(e){var n=e.enable,t=e.site,r=e.sseBaseUrl,i=e.sseEndpoint,o=e.debug;if(n){var l=Nn({site:t,sseBaseUrl:r,sseEndpoint:i,debug:void 0!==o&&o});return l._sseBaseUrl=r,l._site=t,l._sseEndpoint=i,l}};function Bn(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 Un(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bn(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:d.onTimeUpdate,getVideoDuration:d.getVideoDuration,onVideoEnded:d.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=t(r.mark(function t(i,o){var l,a,u,s,c,d,v,f,p,g,y,b,w,S,T,P,E,I,C,D,O,j,x,_,A,L,N,M,B,U,V,H;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=3;break}return i({status:!0,msg:"Player already initialised",skipped:!0}),t.abrupt("return");case 3:if(C=(null==n?void 0:n.videoSourceUrl)||!1,D=null==n?void 0:n.asat,O=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,j=null==n?void 0:n.videoId,x=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,_=(null==n?void 0:n.streamingInfo)||!1,window.videoId=j,A=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=18;break}if(sessionStorage.setItem("vlp_token",A),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),A&&!e.isTokenExpired(A)){t.next=17;break}return o({status:!1,msg:"".concat(A?"Token is expired !":"Missing Authorization Token"),response:{token:A}}),t.abrupt("return");case 17:Ln=JSON.parse(atob(A.split(".")[1]));case 18:return window.siteName=null===(u=Ln)||void 0===u?void 0:u.site,window.siteId=null===(s=Ln)||void 0===s?void 0:s.siteId,n.isAnonymousUser=!(null===(c=Ln)||void 0===c||!c.anonymousId),n.siteOwner=(null===(d=Ln)||void 0===d?void 0:d.site)||null,n.userId=(null===(v=Ln)||void 0===v?void 0:v.userId)||null,e.setUserId((null===(f=Ln)||void 0===f?void 0:f.userId)||(null===(p=Ln)||void 0===p?void 0:p.anonymousId)||null),window.watchHistory=n.watchHistory||null,L=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(g=n.series)&&void 0!==g&&g.enable?null:null==n?void 0:n.chromecastReceiverId,N=(null==n||null===(y=n.analytics)||void 0===y?void 0:y.gaId)||null,(M=null==n?void 0:n.errors)&&(window.customErrors=M),window.customData=null==n?void 0:n.customData,h.setLocalisation(null==n||null===(b=n.customData)||void 0===b?void 0:b.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!m.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),e.playerConfigManager.setConfig(n),k.relatedVideosManager.reset(),k.relatedVideosManager.set(null==n?void 0:n.relatedVideos),t.next=39,W(n);case 39:N&&R("https://www.googletagmanager.com/gtag/js?id=".concat(N)).then(function(){return e.runGtag(N)}).catch(function(e){}),(B=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(L)))&&B.addEventListener("contextmenu",function(e){return e.preventDefault()}),(U=Mn({enable:null==n||null===(S=n.sse)||void 0===S?void 0:S.enable,site:null==n||null===(T=n.sse)||void 0===T?void 0:T.siteName,sseBaseUrl:null==n||null===(P=n.sse)||void 0===P?void 0:P.sseBaseUrl,sseEndpoint:null==n||null===(E=n.sse)||void 0===E?void 0:E.sseEndpoint,debug:null==n||null===(I=n.sse)||void 0===I?void 0:I.debug}))&&!U.isConnectionActive()&&U.connect(),C?(H={directPlaybackUrl:C,id:V="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},D?e.getVideoDetails(V,A).then(function(e){var t=(null==e?void 0:e.data)||{};Je(L,{res:Un(Un({},t),H)},n,{resolve:i,reject:o})}).catch(function(n){e.initiateErrorHandling(n,L,o,V)}):Je(L,{res:H},n,{resolve:i,reject:o})):_?Ze(n,{resolve:i,reject:o}):x?ln(n,{resolve:i,reject:o}):O?rn(n,{resolve:i,reject:o}):nn(n,{resolve:i,reject:o});case 45:case"end":return t.stop()}},t)}));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:f.getRenditions,skip:e.skip,getPlayer:m.getPlayer,play:e.play,pause:e.pause,detectBrowser:g.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:d.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:v.enableCaptions,disableCaptions:v.disableCaptions,getCaptions:v.getCaptions,playSelectedResolution:p.playSelectedResolution,getSource:e.getSource,setVolume:N,getVolume:M,disableControls:e.disableControls,setPlaybackSpeed:d.setPlaybackSpeed,getEntitlementData:e.getEntitlementData,getSsaiEvents:e.getSsaiEvents,playerEvents:d.playerEvents,onReplay:d.onReplay,relatedVideosManager:k.relatedVideosManager,setChapters:jn,getChapters:xn,clearChapters:_n,seekToChapter:An,getChapterEvents:kn}},exports.initChapters=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.chapters,r=void 0===t?[]:t,i=n.timeMode,o=void 0===i?"vod":i;n.res;var l=n.chaptersConfig,a=void 0===l?{}:l,u=m.getPlayer(e);if(!u)return!1;Array.isArray(r)&&r.length&&sn.set(e,r);var s=In.get(e);null!=s&&s.markers&&s.markers.destroy();var c={mapper:gn(e,{timeMode:o}),markers:null,chaptersConfig:a||{},timeMode:o,disposed:!1};In.set(e,c);var d=function(){c.disposed||On(e)};return u.one("loadeddata",d),Cn(u)&&d(),u.on("dispose",function(){return Rn(e)}),!0};
|
package/esm/index-3d5ab252.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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-eb5ecc78.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-54dd8002.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-a5c5b87f.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-b575a309.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-cccac219.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-497e0641.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-872cc671.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?import("./skin-4c3bb9d8.js").then(function(t){t.initialiseSkin(e,n)}):"news"==t?import("./skin-c4422c7c.js").then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?import("./skin-75142274.js").then(function(t){t.initialiseSkin(e,n)}):"mini"==t?import("./skin-991aeb3d.js").then(function(t){t.initialiseSkin(e,n)}):"CN_NEWS"==t&&import("./skin-dd8b0e02.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){T(e,{status:t,message:"DRM ".concat(n," request failed")},"playback",{requestKind:n})}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=j(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,_();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),C(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 P(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),x(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,_();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),A(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){x(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,_();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,N.set(parseInt(u)),c=null==n||null===(r=n.series)||void 0===r?void 0:r.id,R(c,l).then(function(e){var t,r,u,d=e.data,v=e.data.seasons;M(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);L(c,l),C(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){x(e,a,i,videoId)})}).catch(function(e){x(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:_,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:U,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,j,P,_,A,R,L,N,M;return oe.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!z(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,j=null==e?void 0:e.token,!Q(e)){n.next=18;break}if(sessionStorage.setItem("vlp_token",j),Z().set(null==e?void 0:e.refreshToken),j&&!ee(j)){n.next=17;break}return r({status:!1,msg:"".concat(j?"Token is expired !":"Missing Authorization Token"),response:{token:j}}),n.abrupt("return");case 17:er=JSON.parse(atob(j.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,$((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,P=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,_=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,(A=null==e?void 0:e.errors)&&(window.customErrors=A),window.customData=null==e?void 0:e.customData,Le(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),J.set(e.apiBaseUrl),null!=e&&e.skin&&!Ae(e.skin)||(e.skin="VL_ONE"),X.setConfig(e),Be.reset(),Be.set(null==e?void 0:e.relatedVideos),n.next=39,vn(e);case 39:_&&Qe("https://www.googletagmanager.com/gtag/js?id=".concat(_)).then(function(){return ne(_)}).catch(function(e){}),(R=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(P)))&&R.addEventListener("contextmenu",function(e){return e.preventDefault()}),(L=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}))&&!L.isConnectionActive()&&L.connect(),S?(M={directPlaybackUrl:S,id:N="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},T?C(N,j).then(function(n){var o=(null==n?void 0:n.data)||{};mt(P,{res:rr(rr({},o),M)},e,{resolve:t,reject:r})}).catch(function(e){x(e,P,r,N)}):mt(P,{res:M},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:B,getPlayer:Ce,play:F,pause:H,detectBrowser:Re,rewind:V,loadVideo:u,seekToTimeStamp:ye,isPlayerInitialised:z,load:q,authenticateLC:G,dispose:W,enableCaptions:De,disableCaptions:Te,getCaptions:Se,playSelectedResolution:je,getSource:a,setVolume:en,getVolume:nn,disableControls:h,setPlaybackSpeed:be,getEntitlementData:K,getSsaiEvents:Y,playerEvents:we,onReplay:ke,relatedVideosManager:Be,setChapters:$t,getChapters:Jt,clearChapters:Xt,seekToChapter:Qt,getChapterEvents:Bt}}export{or as V,Yt as i};
|