@viewlift/player-backup 2.0.258-backup → 2.0.260-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-1c6abafe.js → autoNextVideo-e42fc428.js} +1 -1
- package/cjs/bundle.css +500 -500
- package/cjs/{features-25da73a6.js → features-cd48b2b6.js} +1 -1
- package/cjs/{generic-939a3e97.js → generic-f04cb45e.js} +1 -1
- package/cjs/{index-04b27b15.js → index-1736603c.js} +1 -1
- package/cjs/{index-e4393a77.js → index-5bdf1cfd.js} +1 -1
- package/cjs/index-eafb9077.js +1 -0
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-ee975960.js → multicamv2-4d7833f1.js} +1 -1
- package/cjs/{multicamv2-138af789.js → multicamv2-825cb17d.js} +1 -1
- package/cjs/{nextEpisodeButton-2ba4aa6f.js → nextEpisodeButton-056dd4d9.js} +1 -1
- package/cjs/{playlist-9710ef70.js → playlist-4932e799.js} +1 -1
- package/cjs/{series-602d1f2c.js → series-c3a14f61.js} +1 -1
- package/cjs/{series-v2-f67606dc.js → series-v2-1d193d93.js} +1 -1
- package/cjs/{series-v2-0fe2e1c3.js → series-v2-57b1c5b8.js} +1 -1
- package/cjs/{skin-7afce973.js → skin-066dceed.js} +1 -1
- package/cjs/{skin-46d92899.js → skin-3ea04cef.js} +1 -1
- package/cjs/{skin-56e72a1b.js → skin-77549792.js} +1 -1
- package/cjs/{skin-334830ee.js → skin-80fd2d0c.js} +1 -1
- package/cjs/{skin-f55aefe8.js → skin-969cc371.js} +1 -1
- package/cjs/{skin-cea29f97.js → skin-add44dae.js} +1 -1
- package/cjs/{skin-14f83052.js → skin-c1af6004.js} +1 -1
- package/cjs/{skin-5493ce5f.js → skin-cfc775a4.js} +1 -1
- package/cjs/{skin-08a270c1.js → skin-e54f3fd3.js} +1 -1
- package/cjs/{util-233dec09.js → util-7186e89f.js} +1 -1
- package/cjs/{videoSelector-dcbb1d54.js → videoSelector-5f1cf380.js} +1 -1
- package/cjs/{videoSelector-2d51c4d2.js → videoSelector-810471f8.js} +1 -1
- package/esm/{autoNextVideo-15f76d85.js → autoNextVideo-7323cf5f.js} +1 -1
- package/esm/bundle.css +500 -500
- package/esm/{features-ab6f492e.js → features-f634dd8c.js} +1 -1
- package/esm/{generic-2f9efcf1.js → generic-7505da7f.js} +1 -1
- package/esm/helpers/secondary-switching.d.ts +1 -1
- package/esm/{index-7304e60f.js → index-04f28499.js} +1 -1
- package/esm/index-3860a02a.js +1 -0
- package/esm/{index-b507b376.js → index-aee2840d.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-9166cf23.js → multicamv2-b2a07ed1.js} +1 -1
- package/esm/{multicamv2-a8db4d7f.js → multicamv2-d19801a7.js} +1 -1
- package/esm/{nextEpisodeButton-2a75ce5c.js → nextEpisodeButton-29cc11c2.js} +1 -1
- package/esm/{playlist-78ea48cc.js → playlist-2b356158.js} +1 -1
- package/esm/{series-c0b5c787.js → series-dee1a2af.js} +1 -1
- package/esm/{series-v2-8e5ff7c1.js → series-v2-b13de828.js} +1 -1
- package/esm/{series-v2-1263db01.js → series-v2-f7307228.js} +1 -1
- package/esm/skin-5a424471.js +1 -0
- package/esm/{skin-032174d9.js → skin-61229ce9.js} +1 -1
- package/esm/{skin-066d481a.js → skin-6cf385ed.js} +1 -1
- package/{cjs/skin-861125f0.js → esm/skin-8db4ed62.js} +1 -1
- package/esm/{skin-e9914c42.js → skin-a2b5e469.js} +1 -1
- package/esm/{skin-74d07b0b.js → skin-aeae977d.js} +1 -1
- package/esm/{skin-d8ab9efc.js → skin-b3357b0d.js} +1 -1
- package/esm/skin-d656e076.js +1 -0
- package/esm/{skin-01da91f0.js → skin-f21ef5ec.js} +1 -1
- package/esm/{util-5b3b1f9c.js → util-a420b997.js} +1 -1
- package/esm/utilities/managers.d.ts +4 -0
- package/esm/{videoSelector-c8e01367.js → videoSelector-0bea276f.js} +1 -1
- package/esm/{videoSelector-cf7538bf.js → videoSelector-40c30c18.js} +1 -1
- package/package.json +1 -1
- package/cjs/autoNextVideo-7423bae2.js +0 -1
- package/cjs/autoNextVideo-cb31894f.js +0 -1
- package/cjs/features-258a9a64.js +0 -1
- package/cjs/features-b6127bee.js +0 -1
- package/cjs/generic-29d5b2ec.js +0 -1
- package/cjs/generic-743174bb.js +0 -1
- package/cjs/index-20de6bc7.js +0 -1
- package/cjs/index-2b05c277.js +0 -1
- package/cjs/index-5b18b394.js +0 -1
- package/cjs/index-64db4d74.js +0 -1
- package/cjs/index-67289ebc.js +0 -1
- package/cjs/index-67e8cb8e.js +0 -1
- package/cjs/index-73a1b75f.js +0 -1
- package/cjs/index-8047cfe4.js +0 -1
- package/cjs/index-99c100ab.js +0 -1
- package/cjs/index-afff893e.js +0 -1
- package/cjs/index-c51fccda.js +0 -1
- package/cjs/index-e5d7c072.js +0 -1
- package/cjs/multicamv2-3f9ffd46.js +0 -1
- package/cjs/multicamv2-4a67a1c7.js +0 -1
- package/cjs/multicamv2-574b49ad.js +0 -1
- package/cjs/multicamv2-92e2b919.js +0 -1
- package/cjs/nextEpisodeButton-10a8c935.js +0 -1
- package/cjs/nextEpisodeButton-6aebdc8a.js +0 -1
- package/cjs/playlist-a6c55be5.js +0 -1
- package/cjs/playlist-d6f8e3b6.js +0 -1
- package/cjs/series-ab2fb794.js +0 -1
- package/cjs/series-c3138dfb.js +0 -1
- package/cjs/series-v2-04bb2f24.js +0 -1
- package/cjs/series-v2-3578532c.js +0 -1
- package/cjs/series-v2-693bc5cc.js +0 -1
- package/cjs/series-v2-8694c212.js +0 -1
- package/cjs/skin-02df14d4.js +0 -1
- package/cjs/skin-29a5361a.js +0 -1
- package/cjs/skin-31d84d3e.js +0 -1
- package/cjs/skin-3d6f28e9.js +0 -1
- package/cjs/skin-5e4b3ad1.js +0 -1
- package/cjs/skin-6e922e32.js +0 -1
- package/cjs/skin-7e40bdaa.js +0 -1
- package/cjs/skin-84cac674.js +0 -1
- package/cjs/skin-98b66c5d.js +0 -1
- package/cjs/skin-9d420b99.js +0 -1
- package/cjs/skin-ab226d57.js +0 -1
- package/cjs/skin-ae3ca001.js +0 -1
- package/cjs/skin-ae526505.js +0 -1
- package/cjs/skin-af838b06.js +0 -1
- package/cjs/skin-b671419f.js +0 -1
- package/cjs/skin-bac14ade.js +0 -1
- package/cjs/skin-bf73e43b.js +0 -1
- package/cjs/skin-c2d7c6d3.js +0 -1
- package/cjs/skin-cfa023f1.js +0 -1
- package/cjs/skin-d5a8b61b.js +0 -1
- package/cjs/skin-dbeec98f.js +0 -1
- package/cjs/skin-eac05283.js +0 -1
- package/cjs/util-4769ed5b.js +0 -1
- package/cjs/util-fbe3d806.js +0 -1
- package/cjs/videoSelector-29fbaa66.js +0 -1
- package/cjs/videoSelector-9d841083.js +0 -1
- package/cjs/videoSelector-a122278c.js +0 -1
- package/cjs/videoSelector-eddf015c.js +0 -1
- package/cjs/videojs-dash5.es-8bc4e9b4.js +0 -1
- package/cjs/videojs-dash5.es-f9629f7f.js +0 -1
- package/esm/autoNextVideo-281e802c.js +0 -1
- package/esm/autoNextVideo-f6a502c9.js +0 -1
- package/esm/features-c3e53ffd.js +0 -1
- package/esm/features-d7440f39.js +0 -1
- package/esm/generic-1697c09f.js +0 -1
- package/esm/generic-205dfe5c.js +0 -1
- package/esm/index-13b7c455.js +0 -1
- package/esm/index-1d1f438d.js +0 -1
- package/esm/index-403dd12e.js +0 -1
- package/esm/index-433697e2.js +0 -1
- package/esm/index-62e1ef44.js +0 -1
- package/esm/index-a3bbcba7.js +0 -1
- package/esm/index-c880c052.js +0 -1
- package/esm/index-cf927b34.js +0 -1
- package/esm/index-e1345c4e.js +0 -1
- package/esm/index-e796a94f.js +0 -1
- package/esm/index-ebda7269.js +0 -1
- package/esm/index-f2d0aa7c.js +0 -1
- package/esm/multicamv2-051519e5.js +0 -1
- package/esm/multicamv2-e247f9b6.js +0 -1
- package/esm/multicamv2-e85ff8d3.js +0 -1
- package/esm/multicamv2-f8c068cb.js +0 -1
- package/esm/nextEpisodeButton-a6ef9e2a.js +0 -1
- package/esm/nextEpisodeButton-e79ba9ea.js +0 -1
- package/esm/playlist-3b568899.js +0 -1
- package/esm/playlist-b9595b14.js +0 -1
- package/esm/series-9dcc32b9.js +0 -1
- package/esm/series-c73c97f1.js +0 -1
- package/esm/series-v2-10742435.js +0 -1
- package/esm/series-v2-52212b58.js +0 -1
- package/esm/series-v2-647dcbf9.js +0 -1
- package/esm/series-v2-b5cece98.js +0 -1
- package/esm/skin-017721f3.js +0 -1
- package/esm/skin-072ed58b.js +0 -1
- package/esm/skin-0ca780ee.js +0 -1
- package/esm/skin-0f0bb3f9.js +0 -1
- package/esm/skin-130e5b01.js +0 -1
- package/esm/skin-1629e49c.js +0 -1
- package/esm/skin-1a12c6ed.js +0 -1
- package/esm/skin-258904b8.js +0 -1
- package/esm/skin-35e4ade3.js +0 -1
- package/esm/skin-3628bdf0.js +0 -1
- package/esm/skin-3e6fd83b.js +0 -1
- package/esm/skin-4ad0fccc.js +0 -1
- package/esm/skin-4cc51263.js +0 -1
- package/esm/skin-508bd0e2.js +0 -1
- package/esm/skin-5ca6263c.js +0 -1
- package/esm/skin-7c5ac76d.js +0 -1
- package/esm/skin-b3e77849.js +0 -1
- package/esm/skin-b8e87cdb.js +0 -1
- package/esm/skin-c05be60d.js +0 -1
- package/esm/skin-c4422587.js +0 -1
- package/esm/skin-c906e1c0.js +0 -1
- package/esm/skin-cb4566f3.js +0 -1
- package/esm/skin-cc9878af.js +0 -1
- package/esm/skin-e8919754.js +0 -1
- package/esm/skin-f5b2d1cc.js +0 -1
- package/esm/skin-f9988297.js +0 -1
- package/esm/util-90b9fbc3.js +0 -1
- package/esm/util-b1ec6897.js +0 -1
- package/esm/videoSelector-0c6d2d43.js +0 -1
- package/esm/videoSelector-3c635dc2.js +0 -1
- package/esm/videoSelector-9d611c93.js +0 -1
- package/esm/videoSelector-b8f21092.js +0 -1
- package/esm/videojs-dash5.es-600b6231.js +0 -1
- package/esm/videojs-dash5.es-bc6f319d.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as n,j as t,k as o}from"./currentVideoInfo-0b234e55.js";import{E as i,T as e}from"./generic-1697c09f.js";import{a as r}from"./util-5b3b1f9c.js";import{h as s}from"./skin-65765793.js";import{g as a}from"./player_instance-34118a5b.js";var c,u=0,f=0,m=function(m){clearTimeout(u);var d=null==m?void 0:m.content;c=null==m?void 0:m.cb;var h=m.playerId;r(h,function(){var r=a(h);0!==(null==r?void 0:r.currentTime())&&((f=t())>d.length-1||(o(f+1),i(h,d[f].id).then(function(t){s(f,h),n(t.response),f++,p(t)}).catch(function(n){p(n),s(f,h),f++,u=setTimeout(function(){e(h)&&l(f,h,d)},5e3)})))})},l=function n(t,e,r,a){f=t,t>r.length-1||(o(f+1),i(e,r[t].id).then(function(n){s(f,e),f++,p(n)}).catch(function(t){p(t),setTimeout(function(){s(f,e),f++,n(f,e,r)},5e3)}))},p=function(n){c&&c(n)};export{m as a,l as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as n,j as t,k as o}from"./currentVideoInfo-0b234e55.js";import{E as i,T as e}from"./generic-205dfe5c.js";import{a as r}from"./util-b1ec6897.js";import{h as s}from"./skin-65765793.js";import{g as a}from"./player_instance-34118a5b.js";var c,u=0,f=0,m=function(m){clearTimeout(u);var d=null==m?void 0:m.content;c=null==m?void 0:m.cb;var h=m.playerId;r(h,function(){var r=a(h);0!==(null==r?void 0:r.currentTime())&&((f=t())>d.length-1||(o(f+1),i(h,d[f].id).then(function(t){s(f,h),n(t.response),f++,p(t)}).catch(function(n){p(n),s(f,h),f++,u=setTimeout(function(){e(h)&&l(f,h,d)},5e3)})))})},l=function n(t,e,r,a){f=t,t>r.length-1||(o(f+1),i(e,r[t].id).then(function(n){s(f,e),f++,p(n)}).catch(function(t){p(t),setTimeout(function(){s(f,e),f++,n(f,e,r)},5e3)}))},p=function(n){c&&c(n)};export{m as a,l as s};
|
package/esm/features-c3e53ffd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{C as a,z as s}from"./generic-1697c09f.js";import{g as c}from"./resolution-62be852a.js";import{p as d}from"./skin-65765793.js";import{g as u}from"./localisation-0bf399a1.js";import{g as p}from"./player_instance-34118a5b.js";function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?m(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function f(e){var t=v();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}var g=function(e){var o=function(e){r(i,e);var o=f(i);function i(e,n){var r;t(this,i);var l=(r=o.call(this,e,n)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=u("slowMoText")||"Slow Mo",r}return n(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},C=function(e,o,l){var s=function(o){r(s,o);var i=f(s);function s(e,n){var r;t(this,s);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button");var a=d(l);return o.append(a),r}return n(s,[{key:"handleClick",value:function(){a(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},y=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-skip-button");var s=d(l);return o.append(s),r}return n(a,[{key:"handleClick",value:function(){s(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},B=function(e,t,n){import("./resolution-v2-6446fe47.js").then(function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=p(e),a=c(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:a},l.controlBar.children().length-4))})},b=function(e,t,n){import("./nextEpisodeButton-2a75ce5c.js").then(function(r){var o=r.default,l=p(n);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:n,sres:e,res:t},l.controlBar.children().length-5)})},j=function(e,t,n){import("./series-c73c97f1.js").then(function(r){var o=r.seriesModule,l=p(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var a=document.querySelectorAll(".season-title-sdk"),s=function(e){a[e].addEventListener("click",function(){t[e]&&r.handleSeasonChange(t[e],e,l,n)})},c=0;c<a.length;c++)s(c)})},k=function(e,t){import("./videoSelector-9d611c93.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},I=function(e,t){import("./caption-settings-3a5e2e2d.js").then(function(n){var r,o,l,a,s=n.default,c=p(e);i.registerComponent("captionSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)})},S=function(e,t){import("./settings-icon-7d9e5221.js").then(function(n){var r,o,l,a,s=n.default,c=p(e);i.registerComponent("settingsSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)})},w=function(e,t){import("./playlist-b9595b14.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)})},E=function(e,t){import("./series-v2-1263db01.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},O=function(e,t){import("./multicamv2-9166cf23.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},M=function(e,t){var n=p(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},P=function(e){var t=p(e).el(),n=0,r=p(e);r.addChild("fullscreenToggle");var o=function(){var e,n=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];n&&n.click()};r.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;r.el().addEventListener("touchend",function(){var e=(new Date).getTime(),r=e-n;if(r<300&&r>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}n=e}),window._multiplayer_dbTapHandler=o},x=function(e,t){import("./videoSelector-3c635dc2.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},L=function(e,t){import("./series-v2-647dcbf9.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},_=function(e,t){import("./multicamv2-051519e5.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},D=function(e,t){import("./index-2ab55f4b.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("MuteButton",r),o.addChild("MuteButton",h({playerId:e},t))})},N=function(e,t){import("./start-begin-btn-16534825.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("startFromBeginingButton",r);var l=o.getChild("controlBar").addChild("startFromBeginingButton",h({playerId:e},t),o.controlBar.children().findIndex(function(e){return"PlayToggle"===e.name_}));o.startFromBeginningButton=l})},T=function(e,t){import("./watch-live-btn-ddcfab89.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("watchLiveButton",r);var l=o.getChild("controlBar").addChild("watchLiveButton",h({playerId:e},t),o.controlBar.children().findIndex(function(e){return"PlayToggle"===e.name_})+1);o.watchLiveButton=l})};export{B as a,j as b,b as c,y as d,C as e,S as f,I as g,M as h,g as i,x as j,_ as k,w as l,L as m,P as n,k as o,E as p,O as q,N as r,T as s,D as t};
|
package/esm/features-d7440f39.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{C as a,z as s}from"./generic-205dfe5c.js";import{g as c}from"./resolution-62be852a.js";import{p as d}from"./skin-65765793.js";import{g as u}from"./localisation-0bf399a1.js";import{g as p}from"./player_instance-34118a5b.js";function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?m(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function f(e){var t=v();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}var g=function(e){var o=function(e){r(i,e);var o=f(i);function i(e,n){var r;t(this,i);var l=(r=o.call(this,e,n)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=u("slowMoText")||"Slow Mo",r}return n(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},C=function(e,o,l){var s=function(o){r(s,o);var i=f(s);function s(e,n){var r;t(this,s);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button");var a=d(l);return o.append(a),r}return n(s,[{key:"handleClick",value:function(){a(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},y=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-skip-button");var s=d(l);return o.append(s),r}return n(a,[{key:"handleClick",value:function(){s(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},B=function(e,t,n){import("./resolution-v2-6446fe47.js").then(function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=p(e),a=c(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:a},l.controlBar.children().length-4))})},b=function(e,t,n){import("./nextEpisodeButton-e79ba9ea.js").then(function(r){var o=r.default,l=p(n);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:n,sres:e,res:t},l.controlBar.children().length-5)})},j=function(e,t,n){import("./series-c0b5c787.js").then(function(r){var o=r.seriesModule,l=p(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var a=document.querySelectorAll(".season-title-sdk"),s=function(e){a[e].addEventListener("click",function(){t[e]&&r.handleSeasonChange(t[e],e,l,n)})},c=0;c<a.length;c++)s(c)})},k=function(e,t){import("./videoSelector-c8e01367.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},I=function(e,t){import("./caption-settings-3a5e2e2d.js").then(function(n){var r,o,l,a,s=n.default,c=p(e);i.registerComponent("captionSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)})},S=function(e,t){import("./settings-icon-7d9e5221.js").then(function(n){var r,o,l,a,s=n.default,c=p(e);i.registerComponent("settingsSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)})},w=function(e,t){import("./playlist-3b568899.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)})},E=function(e,t){import("./series-v2-b5cece98.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},O=function(e,t){import("./multicamv2-f8c068cb.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},M=function(e,t){var n=p(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},P=function(e){var t=p(e).el(),n=0,r=p(e);r.addChild("fullscreenToggle");var o=function(){var e,n=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];n&&n.click()};r.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;r.el().addEventListener("touchend",function(){var e=(new Date).getTime(),r=e-n;if(r<300&&r>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}n=e}),window._multiplayer_dbTapHandler=o},x=function(e,t){import("./videoSelector-cf7538bf.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},L=function(e,t){import("./series-v2-8e5ff7c1.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},_=function(e,t){import("./multicamv2-a8db4d7f.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},D=function(e,t){import("./index-2ab55f4b.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("MuteButton",r),o.addChild("MuteButton",h({playerId:e},t))})},N=function(e,t){import("./start-begin-btn-16534825.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("startFromBeginingButton",r);var l=o.getChild("controlBar").addChild("startFromBeginingButton",h({playerId:e},t),o.controlBar.children().findIndex(function(e){return"PlayToggle"===e.name_}));o.startFromBeginningButton=l})},T=function(e,t){import("./watch-live-btn-ddcfab89.js").then(function(n){var r=n.default,o=p(e);i.registerComponent("watchLiveButton",r);var l=o.getChild("controlBar").addChild("watchLiveButton",h({playerId:e},t),o.controlBar.children().findIndex(function(e){return"PlayToggle"===e.name_})+1);o.watchLiveButton=l})};export{B as a,j as b,b as c,y as d,C as e,S as f,I as g,M as h,g as i,x as j,_ as k,w as l,L as m,P as n,k as o,E as p,O as q,N as r,T as s,D as t};
|
package/esm/generic-1697c09f.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import i from"axios";import{g as r}from"./player_instance-34118a5b.js";import l from"md5";import a from"js-cookie";import{a as d,e as u,g as s,h as c,s as v,i as m,d as f}from"./currentVideoInfo-0b234e55.js";import{a as p,r as g}from"./captions-78bd2908.js";import h from"@babel/runtime/helpers/typeof";import{t as w,c as E}from"./skin-65765793.js";import I from"@babel/runtime/helpers/toConsumableArray";import y from"@babel/runtime/helpers/slicedToArray";import{destroyComscoreTag as T,formulateComscorePayload as b,createComscoreStreamingTag as _,setComscorePlayerInstance as S}from"@viewlift/comscore/index.js";function O(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function A(e){window.dataLayer=window.dataLayer||[],O("js",new Date),O("config",e)}function D(e,n){O("event",e,n)}var P={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function L(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function k(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?L(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):L(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var R={name:"@viewlift/player",version:"2.1.23",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1","@viewlift/sse":"^0.0.3","@viewlift/comscore":"^1.0.9",axios:"^1.2.3",md5:"^2.3.0","broadcast-channel":"^7.3.0",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","jwt-decode":"^4.0.0","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"},overrides:{"min-document":"^2.19.1"}};window.vl_player_version=R.version;var F,C=function(){var e,n,t,o;return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementBaseUrl)+"/video/status":B.get()+"".concat(null==P?void 0:P.getVideoDetails)},j=function(e,n){var t,o,r,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):i({url:C(),params:k({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":R.version,"x-player-name":"videojs",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken},withCredentials:!0})},N=function(e,n){var t,o,r,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):i({url:B.get()+P.getLinearChannelDetails,params:k(k(k(k(k({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken}})},V=function(e,n){var t,o,r=X(n),l=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})}):i({url:B.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},W=function(){var e=n(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K();case 2:return o=e.sent,e.abrupt("return",i({url:B.get()+"".concat(null==P?void 0:P.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:k({},n),params:k({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),U=function(e,n){var t,o,r=window.contentType;return i({method:"GET",url:B.get()+"".concat(null==P?void 0:P.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},M=function(e){var n=e.videoId;return i({method:"GET",url:B.get()+"".concat(null==P?void 0:P.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},B=(F=null==P?void 0:P.apiBaseUrl,{set:function(e){e&&(F=e)},get:function(){return F}}),x=function(e,n,t,o){var r,l;return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n,adbTempToken:null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.adbTempToken},withCredentials:!0})},H=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},G=null;function Q(){return{set:function(e){e&&(G=e)},get:function(){return G}}}var Y=function(){var e=n(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=Q().get(),o=B.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),z=null,K=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!H(n)){e.next=6;break}return z||(z=Y().then(function(e){var t,o,i=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&Q().set(r),i||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){z=null})),e.abrupt("return",z);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),q=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},X=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function J(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function $(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?J(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):J(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Z=0,ee=null,ne=!1,te=function(){var e,n,t,o,i,r,l,a=d();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==a||null===(i=a.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function oe(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function ie(){return re.apply(this,arguments)}function re(){return(re=n(t.mark(function e(){var n,o,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K();case 2:if(n=e.sent,o=X(n),!(i=null==o?void 0:o.userId)){e.next=9;break}return e.abrupt("return",i);case 9:return i=oe(),window.sessionStorage.setItem("uid",i),e.abrupt("return",i);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function le(){return ae.apply(this,arguments)}function ae(){return(ae=n(t.mark(function e(){var n,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function de(e){return e?String(e):""}window.initialise=function(e){window.sid=oe(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e),ue(e),se(e)};var ue=function(e){e.on("play",function(){"pause"!==ee||e.scrubbing()||(ee="play",D("RESUME",{pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:"RESUME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}))}),e.on("pause",function(){setTimeout(function(){ne||(ee="pause",D("PAUSE",{pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:"PAUSE",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}))},50)})},se=function(e){if(e){var n=0,t=0,o=0,i=0;e.on("timeupdate",r),e.on("seeking",function(){if(ne)return;ne=!0,e.off("timeupdate",r),e.one("seeked",l)}),e.on("seeked",l)}function r(){n=t,t=Math.floor(e.currentTime()),n<t&&(i=n,n=t)}function l(){var n,t;o=Math.floor(e.currentTime());var l=Math.floor(o-i);if(0!==l&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")){var a=l>0?"SEEK_FORWARD":"SEEK_BACKWARD";D(a,{pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:a,videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}i=Math.floor(e.currentTime()),setTimeout(function(){ne=!1},50),e.on("timeupdate",r)}};window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",function(){var t,o,i,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,D(r?"FAILED_TO_START":"DROPPED_STREAM",$({pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n,t){e.one("play",tryCatch(function(){var o,i,r;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),ee="play",D("PLAY",$({pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i||null===(r=i.beacon)||void 0===r?void 0:r.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",$({"Video ID":te(),watchTime:Math.floor(e.currentTime())},t))}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,n){var t,o;if(n.el_){var i,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(o=t.className)&&void 0!==o&&o.includes("vjs-waiting")&&Z<4)Z++,D("BUFFERING",$({pfm:window.platform,uid:ie(),vid:te(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,o;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,D("FIRST_FRAME",$({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),vid:te()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var n,t,o,i,r,l;D("AD_REQUEST",$({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),vid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),D("AD_IMPRESSION",$({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:te()},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(Z=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),o=e.buffered(),i=0;i<o.length;i++){var r=o.start(i),l=o.end(i);if(ce(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var ce=function(e,n,t){return e>=n&&e<=t},ve=function(){var e,n=d(),t=(null==n?void 0:n.contentType)||"video";return(null==n||null===(e=n[t])||void 0===e?void 0:e.network)||null};function me(e,n,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var o=r(e);window.initialise(o,n),window.firstFrame(o,n,t),o.on("loadedmetadata",function(){window.endFirstFrame(o)})}}window.fireEvent=function(){var e=n(t.mark(function e(n){var o,r,l,a,d,u,s,c,v,m,f,p,g,h,w,E,I,y,T,b,_;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K();case 2:return I=e.sent,y=X(I),T=null==y?void 0:y.site,b=null==y?void 0:y.siteId,e.t0=$,e.t1=$,e.t2=$({aid:T,cid:b,pfm:window.platform},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params),e.t3={},e.next=12,ie();case 12:return e.t4=e.sent,e.t5=te(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:null,e.t17=!0===n.isAdEvent?de(n.adPosition):"",e.next=28,le();case 28:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27=null!==(m=ve())&&void 0!==m?m:null,e.t28=null!=T?T:null,e.t29={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26,networkname:e.t27,brandname:e.t28},e.t30=(null==n?void 0:n.duration)&&{duration:n.duration},e.t31=(0,e.t1)(e.t2,e.t3,e.t29,e.t30),e.t32=null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t33=(0,e.t0)(e.t31,e.t32),_=[e.t33],i({url:(null===(h=window)||void 0===h||null===(w=h.customData)||void 0===w||null===(E=w.beacon)||void 0===E?void 0:E.url)||B.get()+P.getBeaconUrl,method:"post",headers:{Authorization:I},contentType:"application/x-www-form-urlencoded",dataType:"text",data:_}).catch(function(e){console.error(e)});case 46:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var fe=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},pe=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},ge=function(e,n){var t=new Map;M({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),c(t)}).catch(function(e){return console.log(e)})},he=function(){var e=u.get();return e>=0?e+1:1},we=function(){var e,n,t,o=s(),i=d(),r=null==i||null===(e=i.video)||void 0===e?void 0:e.id,l=u.get(),a=null==o||null===(n=o[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};function Ee(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ie(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ee(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var ye=l,Te=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},be=function(e){var n=_e(e,"video.tags",[]),t=_e(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},_e=function(e,n,t){for(var o=0,i=(n=n.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[n[o]]}return e||t},Se=function(){var n,t,o,i,l,d,u,s,c,v,m,f,p,g,h,w,E,I,y,T,b,_,S,O,A,D,P=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",L=arguments.length>1?arguments[1]:void 0,k=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return P;var R=(null==k?void 0:k.siteName)||(null==k?void 0:k.site)||"",F=(null==k?void 0:k.contentType)||"video",C=(null==k||null===(o=k[F])||void 0===o?void 0:o.metadata)||(null==k||null===(i=k[F])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.metadata),j=r(L);if(!P.includes("VIEWLIFT_"))return P;var N,V=window.getComputedStyle(document.getElementById(L),null),W=Math.trunc(V.getPropertyValue("height").slice(0,-2)),U=Math.trunc(V.getPropertyValue("width").slice(0,-2)),M="linearchannel"===F?null==k||null===(d=k.linearchannel)||void 0===d||null===(u=d.channels)||void 0===u||null===(s=u.find(function(e){return(null==e?void 0:e.id)===(null==k?void 0:k.channelId)}))||void 0===s||null===(c=s.content)||void 0===c?void 0:c.id:_e(k,"video.gist.id",""),B="linearchannel"===F?null==k||null===(v=k.linearchannel)||void 0===v||null===(m=v.channels)||void 0===m||null===(f=m.find(function(e){return(null==e?void 0:e.id)===(null==k?void 0:k.channelId)}))||void 0===f?void 0:f.title:_e(k,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),x=null,H=null;"function"==typeof window.__gpp&&(null===(N=window)||void 0===N||N.__gpp("ping",function(e){x=null==e?void 0:e.gppString,H=null==e?void 0:e.sectionList[0]}));var G=a.get("us_privacy")||a.get("usprivacy"),Q=void 0!==G?G:"1YNN",Y=null!==(p=null===(g=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===g?void 0:g.fwIdentifier)&&void 0!==p?p:null,z=Ie(Ie({},Oe(C)),{},(O={VIEWLIFT_WIDTH:U,VIEWLIFT_HEIGHT:W,VIEWLIFT_SIZE:Te(U,W),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(h=window)||void 0===h?void 0:h.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:_e(k,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:_e(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:_e(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==j||null===(w=j.options_)||void 0===w?void 0:w.autoplay)||1,VIEWLIFT_MUTE:(null==j||null===(E=j.options_)||void 0===E?void 0:E.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==R||"usanetwork"==R?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:be(k),VIEWLIFT_MEDIA_ID:M,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(_e(k,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:M,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+_e(k,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:_e(null===(I=window)||void 0===I||null===(y=I.app_data)||void 0===y||null===(T=y.site)||void 0===T?void 0:T.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==R||"usanetwork"==R?"":_e(null===(b=window)||void 0===b||null===(_=b.app_data)||void 0===_||null===(S=_.site)||void 0===S?void 0:S.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:Q,VIEWLIFT_TVE_PROVIDER:Y?ye(Y):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*_e(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:_e(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:M,VIEWLIFT_CONTENT_TITLE:B,VIEWLIFT_CONTENT_SERIES_TITLE:_e(k,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:_e(k,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:we(),VIEWLIFT_SEASON_NUMBER:he(),VIEWLIFT_CONTENT_TAGS:be(k),VIEWLIFT_GPP_SID:H||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:x||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(O,"VIEWLIFT_LAT",""),e(O,"VIEWLIFT_APP_BUNDLE",""),e(O,"VIEWLIFT_ATT_CONSENT",""),O),null===(A=window)||void 0===A||null===(D=A.customData)||void 0===D?void 0:D.macros);for(var K in z){var q=new RegExp(K,"g");P=P.replace(q,z[K])}return P},Oe=function(e){var n,t,o,i,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,s=(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return u||s?(pe()?u?a=Ie(Ie({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(a=Ie(Ie({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?a=Ie(Ie({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(a=Ie(Ie({},a),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?a=Ie(Ie({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}):s&&(a=Ie(Ie({},a),{},{VIEWLIFT_SFID:d.get("sfid.tve")||d.get("sfid.web.tve")||""})),a=pe()?Ie(Ie({},a),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):Ie(Ie({},a),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(a=Ie(Ie({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}),a=pe()?Ie(Ie({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):Ie(Ie({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),a=Ie(Ie({},a),{},{VIEWLIFT_AFID:d.get("afid"),VIEWLIFT_NIELSEN_APP_ID:d.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:d.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:d.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:d.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},Ae=function(e,n){var t,o,i,r,l,a,d,u,s,c,v,m,f,p=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,h=null==e||null===(o=e[p])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,w=null==e||null===(r=e[p])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,E=(null==e||null===(a=e[p])||void 0===a||null===(d=a.streamingInfo)||void 0===d||null===(u=d.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(s=e[p])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var I=(null==e||null===(v=e[p])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(f=m.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=w&&w.hls)return Pe(w);if(g){var y=Le(h,n);return y.src=Se(y.src,n,e),y}if("Safari"!==fe()&&I)return De(h);if(E){var T=Pe(h);return T.src=Se(T.src,n,e),T}if(null!=h&&h.mpeg){var b=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(h);return b.src=Se(b.src,n,e),b}return null},De=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},Pe=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},Le=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=fe();if(r(n),"Safari"===d){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,i,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(i);return ke(n),u}var s,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(ke(n),c.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==a?void 0:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var ke=function(e){var n=r(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==fe()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Re=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var i=t.split(".com")[1]||"";return{src:i?"".concat(n).concat(i):t,type:o}},Fe=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),i.appendChild(r),o.append(i)}}},Ce=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var je=!1,Ne=function(e,n,t){var o=Se(n,e,t),i=r(e);if(n&&window.google){if("function"!=typeof i.ima&&"object"!==h(i.ima))return;i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,o,i,l=r(e);if(null!==l.el_){je=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),je&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}),n.addEventListener(google.ima.AdEvent.Type.LOADED,function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,o)}};function Ve(e,n){var t,o,i,l=r(e),a=null==l||null===(t=l.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,d=document.getElementsByTagName("video")[0];null===(i=document)||void 0===i||i.addEventListener("keydown",function(t){var o,i,r,u,s,c,v,m,f;if(Ue.enabled&&!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName){var p=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==d||d.focus()),p){case" ":null==a||a.click();break;case"m":case"M":l.muted(!l.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":g&&!1===n.liveui||Cn(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(i=window)||void 0===i||null===(r=i.app_data)||void 0===r||null===(u=r.appcmsMain)||void 0===u||null===(s=u.adsConfig)||void 0===s?void 0:s.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(m=v.appcmsMain)&&void 0!==m&&null!==(f=m.adsConfig)&&void 0!==f&&f.vodAdClientSideTracking)return;g||Fn(e,10)}}},!0)}var We,Ue=(We=!0,{enable:function(){We=!0},disable:function(){We=!1},get enabled(){return We}}),Me="ssai-breakStart",Be="ssai-adImpression",xe="ssai-firstQuartile",He="ssai-midpoint",Ge="ssai-thirdQuartile",Qe="ssai-complete",Ye="ssai-breakEnd",ze={breakStart:Me,impression:Be,firstQuartile:xe,midpoint:He,thirdQuartile:Ge,complete:Qe,breakEnd:Ye};function Ke(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,i=ze[o];i&&t.trigger(i,n)}function qe(e){var n=r(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(Me,e)},adImpression:function(e){return t(Be,e)},adFirstQuartile:function(e){return t(xe,e)},adMidpoint:function(e){return t(He,e)},adThirdQuartile:function(e){return t(Ge,e)},adComplete:function(e){return t(Qe,e)},adBreakEnd:function(e){return t(Ye,e)}}}function Xe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Je(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Xe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var $e,Ze=($e=null,{get:function(){return $e},set:function(e){$e=e}});function en(e,n){var t,o,i,l,a,u,s,c,v,m,f,p,g,h,w,E,I=null==e?void 0:e.playerId,y=r(I);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var O=d(),A=(null==O||null===(o=O.video)||void 0===o?void 0:o.metadata)||[],D=(null==A?void 0:A.length)&&A.filter(function(e){return"advertisingGenre"===e.name});if(null!==(i=D)&&void 0!==i&&i.length){var P=D.map(function(e){return e.value});D=null==P?void 0:P.join(",")}T();var L,k,R,F=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,C=Array.isArray(null==F?void 0:F.category)?null==F||null===(a=F.category)||void 0===a?void 0:a.join(","):(null==F?void 0:F.category)||null,j=Je(Je(Je({},null==O?void 0:O.video),null==O?void 0:O.linearchannel),{},{siteName:(null==O?void 0:O.site)||null,programId:(null==F?void 0:F.videotmsid)||null,programTitle:(null==F?void 0:F.lcProgrammeName)||null,episodeId:(null==F?void 0:F.videotmsid)||null,seasonNumber:(null==O||null===(u=O.video)||void 0===u||null===(s=u.series)||void 0===s?void 0:s.seasonNumber)||(null==F||null===(c=F.seriesDetails)||void 0===c?void 0:c.season)||null,episodeNumber:(null==O||null===(v=O.video)||void 0===v||null===(m=v.series)||void 0===m?void 0:m.episodeNumber)||(null==F||null===(f=F.seriesDetails)||void 0===f?void 0:f.episode)||null,episodeTitle:(null==F?void 0:F.lcSubTitle)||null,isCompleteEpisode:!!(null!=O&&null!==(p=O.video)&&void 0!==p&&p.series||null!=F&&null!==(g=F.seriesDetails)&&void 0!==g&&g.episode),genre:D||C,comscoreConfig:{implementationId:(null==e||null===(h=e.comscore)||void 0===h?void 0:h.implementationId)||null,projectId:(null==e||null===(w=e.comscore)||void 0===w?void 0:w.projectId)||null}});if(null!=j&&null!==(E=j.streamingInfo)&&void 0!==E&&E.isLiveStream?j.contentType="LIVE":j.contentType="LONG_FORM_ON_DEMAND",null==j||!j.network){var N,V=(null==j?void 0:j.metadata)||[],W=null==V||null===(N=V.find(function(e){return"network"===e.name}))||void 0===N?void 0:N.value;j.network=W||null}null!=j&&j.network&&null!=j&&j.genre&&(j.customGenre="".concat(j.network,"_").concat((null==j?void 0:j.programTitle)||(L=j,null!=L&&L.series?null==L||null===(R=L.series)||void 0===R?void 0:R.title:null==L||null===(k=L.gist)||void 0===k?void 0:k.title),"_").concat(j.genre)),null!=F&&F.airDate&&(j.publishDate=F.airDate),null!=j&&j.runtime&&(j.runtime=1e3*((null==j?void 0:j.runtime)||0));var U=b(j,y);console.log("comscoreOptions player data",U),_(Je({playerName:"Video.js"},U)),S(y)}}function nn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function tn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?nn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):nn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function on(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 rn(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)?rn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},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 r,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,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function rn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var ln,an=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),dn=(ln=null,{set:function(e){ln=e},get position(){return ln}});function un(e,n){return sn.apply(this,arguments)}function sn(){return(sn=n(t.mark(function e(n,o){var i,l,a,d,u,s,c,v,m,f,p,g,h,w,E,I,T,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r(n),a=Ae(o,n),d=a.src,u=(null==o?void 0:o.contentType)||"video",null==o||null===(i=o[u])||void 0===i||null===(l=i.streamingInfo)||void 0===l||l.isLiveStream,s=d.replace("/dash/","/session/").replace("/master/","/session/"),s=Se(s,n,o),c=vn(s),v=y(c,2),m=v[0],f=v[1],p=cn(f)||{},s=new URL(s.split("?")[0]),Object.keys(f).length>0&&Object.entries(f).forEach(function(e){var n=y(e,2),t=n[0],o=n[1];s.searchParams.set(t,o)}),e.prev=11,e.next=14,fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(tn({adsParams:tn({},m)},p))});case 14:return g=e.sent,e.next=17,g.json();case 17:return h=e.sent,w="https://"+new URL(s).hostname,E=h.trackingUrl,I=h.manifestUrl,T=w+E,b=w+I,an.set(T),console.log("%c TRACKING URL","background: #bdf369; color: #000",T),a.src=b,e.abrupt("return",a);case 29:return e.prev=29,e.t0=e.catch(11),e.abrupt("return",a);case 32:case"end":return e.stop()}},e,null,[[11,29]])}))).apply(this,arguments)}function cn(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=y(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]}))||{}}function vn(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),i=on((null==o?void 0:o.searchParams)||[]);try{for(i.s();!(t=i.n()).done;){var r=y(t.value,2),l=r[0],a=r[1];n[decodeURIComponent(l)]=decodeURIComponent(a||"")}}catch(e){i.e(e)}finally{i.f()}for(var d={},u={},s=0,c=Object.entries(n);s<c.length;s++){var v=y(c[s],2),m=v[0],f=v[1];if(m.startsWith("ads."))d[m.replace(/^ads\./,"")]=f;else u[m]=f}return[d,u]}var mn,fn,pn,gn,hn=(mn=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),mn=Array.isArray(e)?I(e):mn},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",mn),I(mn)}}),wn=new Map;function En(e,n){return In.apply(this,arguments)}function In(){return In=n(t.mark(function e(o,i){var l,a,d,u,s,c,v,m,f,p,g,h,E,y,T,b,_,S,O,A,D,P,L,k,R,F;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:F=function(e,n,t,i,l,a){var d,u,s=r(o);if(!s.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds;var v=(null==n||null===(d=n.ads)||void 0===d||null===(u=d[i])||void 0===u?void 0:u.adId)||c;e<k&&L.clear(),k=e,Math.floor(s.currentTime());var m,f=on(t);try{var p=function(){var t,r,l,d=m.value,u=d.eventType,f=d.beaconUrls,p=d.startTimeInSeconds,g=d.startTime,h=d.durationInSeconds,w=p||c,E=f,I=(null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r||null===(l=r.ads)||void 0===l?void 0:l.adEventHandler)||null,y="".concat(v,"_").concat(u),T="pod-".concat(c);wn.has(T)||wn.set(T,new Set);var b=wn.get(T);if(console.warn(e,w,"map:",u,"condition1:",e>=w,"map:",wn),e>=w&&e<=w+P){if(!b.has(y)){b.add(y);try{R(u,n,E,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,u,n)}if("breakEnd"==u){var _=dn.position;dn.set(null),setTimeout(function(){null!=_&&(s.currentTime(_),a())},500)}if("function"==typeof I)try{var S,O={eventType:u,startTimeInSeconds:p,startTime:g,durationInSeconds:h,ad:null==n||null===(S=n.ads)||void 0===S?void 0:S[i],pod:n,adIndex:i};I({adsData:O}),Ke(o,O)}catch(e){console.error("Error when calling ads callback:",e)}}var A=Ze.get();if(A&&0!==Object.keys(A).length){var D=A.formulateComscoreAdPayload,k=A.startComscoreAdTracking,F=A.finishComscoreAdTracking,C=A.endComscoreAdTracking,j="".concat(w,"_").concat(v,"_").concat(u);if(!L.has(j))if(L.set(j,!0),"impression"===u){var N,V=an.get();k(D(tn(tn({},null==n||null===(N=n.ads)||void 0===N?void 0:N[i]),{},{trackingUrl:V})))}else"complete"===u?F():"breakEnd"===u&&C()}}};for(f.s();!(m=f.n()).done;)p()}catch(e){f.e(e)}finally{f.f()}}},R=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},D=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},wn.clear(),dn.set(i),f=an.get(),(p=r(o)).one("loadeddata",function(){f&&A(f)}),g=new Map,h=new Map,E=-1,y=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,T=(null==p||null===(d=p.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,b=(null==p||null===(u=p.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,_=(null==p||null===(s=p.el())||void 0===s||null===(c=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,S=(null==p||null===(v=p.el())||void 0===v||null===(m=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,O=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return I(o);var i=[],r=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==r||null===(e=r.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,a=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&l){var s=null==d?void 0:d.map(function(e){return tn(tn({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&i.push(null==s?void 0:s[0])}return i},A=function(){var e=n(t.mark(function e(n){var l,a,d,u,s,c,v,m,f,p,A,P,L,k,R,C,j,N,V,W,U,M,B,x;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return W=function(e){document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",W),0===e.button&&j()},V=function(e){},N=function(){var e,n=p.currentTime(),t=null,o=on(f);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=(i.ads,Math.floor(r+l));n>=r&&n<=a&&(t=a,g.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){p.currentTime(t+2.2)},100))},j=function(){var e,n=p.currentTime(),t=null,o=on(f);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=i.ads,d=Math.floor(r+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>d||n>r)&&!g.has(r)||n>=r&&n<=d)&&(t=r,g.set(r,!0),h.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){p.currentTime(t-.4)},100))},s=!1,e.next=7,fetch(n);case 7:return c=e.sent,e.next=10,c.json();case 10:v=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",v),m=v.avails,f=[],p=r(o),A=p.controlBar.progressControl,P=A.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),m.map(function(e,n){var t;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(s=!0),f.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:O(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),!s&&i&&(p.currentTime(i),N()),null!=f&&f.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",f),window.adsQueueList=f,"function"==typeof(C=(null===(L=window)||void 0===L||null===(k=L.customData)||void 0===k||null===(R=k.ads)||void 0===R?void 0:R.onAdBreaksLoaded)||null)&&(null==f?void 0:f.length)>0&&C(f)),console.log(f,"data"),f.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=p.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",P.appendChild(r)}}),p._timeUpdateHandler&&p.off("timeupdate",p._timeUpdateHandler),p._timeUpdateHandler=w(function(){var e=p.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=f[o],i=t.startTimeInSeconds,r=t.durationInSeconds,l=t.ads,a=i+r;if(e>=i-4&&e<=a+4){var d;e>=i&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&g.set(i,!0),Ue.disable(),y&&y.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),A.el().classList.add("hide-progress-bar");for(var u=e-i,s=0,c=0,v=0;v<l.length;v++){var m,p=null==l||null===(m=l[v])||void 0===m?void 0:m.durationInSeconds;if(u<s+p){c=v;break}s+=p}l[c];var w=Math.max(0,r-u),E=Math.round(w);U.style.display="block",x.textContent="".concat(c+1," of ").concat(l.length," • ").concat(D(E));var O=[];return null==l||l.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});O.push.apply(O,I(n))}),(null==t||null===(d=t.podSlotImpressionBeacon)||void 0===d?void 0:d.length)>0&&O.push.apply(O,I(null==t?void 0:t.podSlotImpressionBeacon)),F(e,t,O,c,0,N),"break"}h.delete(i)},o=0;o<f.length;o++){if("break"===t())break}n||(U.style.display="none",A.el().classList.remove("hide-progress-bar"),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),y&&y.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),Ue.enable())}},1e3),p.on("timeupdate",p._timeUpdateHandler),null===(a=document)||void 0===a||a.addEventListener("keydown",function(e){Ue.enabled&&"ArrowRight"==e.key&&(j(),Fn(o,10),e.stopPropagation())}),A.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",W))}),null===(d=document)||void 0===d||null===(u=d.querySelectorAll(".ssai-ad-container"))||void 0===u||u.forEach(function(e){return null==e?void 0:e.remove()}),(U=document.createElement("div")).className="ssai-ad-container",(M=document.createElement("div")).className="sponsored-adbox",(B=document.createElement("div")).className="sponsored-text",B.textContent="Sponsored Ad",M.append(B),(x=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",U.append(M),U.append(x),p.el().appendChild(U);case 45:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),P=1.5,L=new Map,k=-1;case 21:case"end":return e.stop()}},e)})),In.apply(this,arguments)}function yn(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 Tn(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)?Tn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},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 r,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,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function Tn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function bn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function _n(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?bn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):bn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Sn={},On=(null===(fn=window)||void 0===fn||null===(pn=fn.location)||void 0===pn||null===(gn=pn.search)||void 0===gn?void 0:gn.includes("debug=true"))||!1,An=null;function Dn(e){return Pn.apply(this,arguments)}function Pn(){return Pn=n(t.mark(function e(o){var i,l,a,d,u,s,c,v,m,f,p,g,h,E,y,T,b,_,S,O,A,D,P,L,k,R,F;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:F=function(e,n,t,i,l){var a,d,u=r(o);if(!u.seeking()){var s=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(a=n.ads)||void 0===a||null===(d=a[i])||void 0===d?void 0:d.adId)||s;Math.floor(u.currentTime());var v,m=yn(t);try{for(m.s();!(v=m.n()).done;){var f,p,g,h=v.value,w=h.eventType,E=h.beaconUrls,I=h.startTimeInSeconds,y=h.startTime,T=h.durationInSeconds,b=(h.eventId,I||s),_=E,S=(null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(g=p.ads)||void 0===g?void 0:g.adEventHandler)||null,O="".concat(c,"_").concat(w),A="pod-".concat(s);L.has(A)||L.set(A,new Set);var D=L.get(A);if(On&&console.warn(e,b,"map:",w,"condition1:",e>=b,"map:",L),e>=b&&e<=b+k&&!D.has(O)){D.add(O);try{R(w,n,_,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,w,n)}if("function"==typeof S)try{var P,F={eventType:w,startTimeInSeconds:I,startTime:y,durationInSeconds:T,ad:null==n||null===(P=n.ads)||void 0===P?void 0:P[i],pod:n,adIndex:i};S({adsData:F}),Ke(o,F)}catch(e){console.error("Error when calling ads callback:",e)}var C=Ze.get();if(C&&0!==Object.keys(C).length){var j=C.formulateComscoreAdPayload,N=C.startComscoreAdTracking,V=C.finishComscoreAdTracking,W=C.endComscoreAdTracking;if("impression"===w){var U,M=an.get();N(j(_n(_n({},null==n||null===(U=n.ads)||void 0===U?void 0:U[i]),{},{trackingUrl:M})))}else"complete"===w?V():"breakEnd"===w&&W()}}}}catch(e){m.e(e)}finally{m.f()}}},R=function(e,n,t,o){var i,r,l;"breakEnd"===e&&(null===(i=Sn)||void 0===i?void 0:i.currentAdIndex)+1!=(null===(r=Sn)||void 0===r?void 0:r.totalAds)&&(null==n||null===(l=n.ads)||void 0===l?void 0:l.length)>0||(On&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})}))},p=function(){An&&clearInterval(An)},m=an.get(),(f=r(o)).one("loadeddata",function(){p(),An=setInterval(function(){m&&!f.paused()&&P(m)},2e3)}),f.on("dispose",function(){p()}),g=new Map,h=new Map,E=-1,y=null,T=(null===(i=document)||void 0===i||null===(l=i.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==f||null===(a=f.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,_=(null==f||null===(d=f.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,S=(null==f||null===(u=f.el())||void 0===u||null===(s=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===s?void 0:s[0])||null,O=(null==f||null===(c=f.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===v?void 0:v[0])||null,A=!1,D=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return I(o);var i=[],r=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==r||null===(e=r.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,a=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&l){var s=null==d?void 0:d.map(function(e){return _n(_n({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&i.push(null==s?void 0:s[0])}return i},P=function(){var e=n(t.mark(function e(n){var i,l,a,d,u,s,c,v,m,f,p,P,L,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=new URL(n),y&&l.searchParams.append("nextToken",y),e.next=4,fetch(l.toString(),{method:"GET"});case 4:return a=e.sent,e.next=7,a.json();case 7:d=e.sent,u=d.avails,s=d.nextToken||null,y=s,c=[],v=r(o),m=v.controlBar.progressControl,f=m.seekBar.el(),null===(i=document)||void 0===i||i.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),u.map(function(e,n){c.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:D(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),On&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),null!=c&&c.length&&(window.adsQueueList=c,"function"==typeof(k=(null===(p=window)||void 0===p||null===(P=p.customData)||void 0===P||null===(L=P.ads)||void 0===L?void 0:L.onAdBreaksLoaded)||null)&&(null==c?void 0:c.length)>0&&k(c)),c.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=v.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",f.appendChild(r)}}),v._timeUpdateHandler&&v.off("timeupdate",v._timeUpdateHandler),v._timeUpdateHandler=w(function(){var e=v.currentTime();if(e!==E){E=e;for(var n=function(){var n=c[t],o=n.startTimeInSeconds,i=n.durationInSeconds,r=n.ads,l=o+i;if(e>=o-1.2&&e<=l+1.2){var a;A=!!(e>=o&&e<=l&&Array.isArray(r)&&(null==r?void 0:r.length)>0),e>l&&g.set(o,!0),Ue.disable(),T&&T.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),O&&(O.style.pointerEvents="none",O.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),m.el().classList.add("hide-progress-bar");for(var d=e-o,u=0,s=0,v=0;v<r.length;v++){var f,p=null==r||null===(f=r[v])||void 0===f?void 0:f.durationInSeconds;if(d<u+p){s=v;break}u+=p}setTimeout(function(){Sn.totalAds=null==r?void 0:r.length,Sn.currentAdIndex=s},1e3);var w=[];return null==r||r.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});w.push.apply(w,I(n))}),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&w.push.apply(w,I(null==n?void 0:n.podSlotImpressionBeacon)),F(e,n,w,s),"break"}h.delete(o)},t=0;t<c.length;t++){if("break"===n())break}A||(Sn={},m.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),Ue.enable())}},1e3),v.on("timeupdate",v._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),L=new Map,k=2.5;case 22:case"end":return e.stop()}},e)})),Pn.apply(this,arguments)}function Ln(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}var kn=function(e){o(e).play()},Rn=function(e){o(e).pause()},Fn=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},Cn=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},jn=function(e){return!!o.getPlayer("".concat(e))},Nn=function(e){return o(e).paused()},Vn=function(){var e=n(t.mark(function e(o,i){var l,a,d,u=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=u.length>2&&void 0!==u[2]&&u[2],e.next=3,K();case 3:return a=e.sent,d=r(o),e.abrupt("return",new Promise(function(e,r){var u=(null==i?void 0:i.programs)||[];null==i||delete i.programs,N(i,a).then(function(){var r=n(t.mark(function n(r){var a,s,c,m,p,g,h,w;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(a=null==r?void 0:r.data,window.sid=oe(),a.contentType="linearchannel",a.channelId=null==i?void 0:i.channelId,v(a),f(u),!l){n.next=16;break}if(h=(null==a||null===(s=a.linearchannel)||void 0===s?void 0:s.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(c=window)||void 0===c||null===(m=c.app_data)||void 0===m||null===(p=m.appcmsMain)||void 0===p||null===(g=p.adsConfig)||void 0===g?void 0:g.vodAdSticherProvider)||!1,w=Ae(a,o),!h){n.next=13;break}return n.next=12,un(o,a);case 12:w=n.sent;case 13:w&&(xn(o,w),h&&Dn(o),d.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:a})})),n.next=17;break;case 16:e({status:!0,msg:"Feed authenticated",response:a});case 17:case"end":return n.stop()}},n)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){r({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Wn=function(){var e=n(t.mark(function e(o,i,l){var a,d,u,c,f,h,w;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K();case 2:return c=e.sent,(s()||null)&&m(i),f=0,h=0,w=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(d=window)&&void 0!==d&&null!==(u=d.watchHistory)&&void 0!==u&&u.enable&&U(i,c).then(function(e){var n,t,o,i,r,l,a;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),f=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,(h=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null)<95)&&(w=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedTime)||null)}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}),e.abrupt("return",new Promise(function(e,l){j(i,c).then(function(){var i=n(t.mark(function n(i){var a,d,u,s,c,m,E,I,y,T,b,_,S,O,A,D,P,L,k,R,F,C,j,N,V,W,U,M,B,x,H,G,Q,Y,z,K,q,X;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(D=null==i?void 0:i.data,P=(null==D?void 0:D.contentType)||"video",L=(null==D||null===(a=D[P])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(s=u.appcmsMain)||void 0===s||null===(c=s.adsConfig)||void 0===c?void 0:c.vodAdSticherProvider)||!1,k=(null==D||null===(m=D.video)||void 0===m||null===(E=m.streamingInfo)||void 0===E?void 0:E.isLiveStream)||!1,v(i.data),(R=(null==D||null===(I=D.ads)||void 0===I||null===(y=I.preRoll)||void 0===y||null===(T=y.adTags)||void 0===T||null===(b=T.web)||void 0===b?void 0:b.active)&&(null==D||null===(_=D.ads)||void 0===_||null===(S=_.preRoll)||void 0===S||null===(O=S.adTags)||void 0===O||null===(A=O.web)||void 0===A?void 0:A.url))&&Ne(o,R,D),F=Ae(D,o),!L){n.next=12;break}return n.next=11,un(o,D);case 11:F=n.sent;case 12:F?(G=(null==D||null===(C=D.video)||void 0===C||null===(j=C.gist)||void 0===j?void 0:j.videoImageUrl)||(null==D||null===(N=D.video)||void 0===N||null===(V=N.gist)||void 0===V||null===(W=V.imageGist)||void 0===W?void 0:W.r16x9),(Q=r(o)).poster(G),xn(o,F),L&&En(o,w),Q.on("loadstart",function(){k&&e({status:!0,msg:"Video Loaded",response:D})}),Q.on("loadeddata",function(){Ce(),e({status:!0,msg:"Video Loaded",response:D})}),Q.one("play",function(){f&&!L&&h<95&&setTimeout(function(){Q.currentTime(f)},0)}),Q.one("error",function(){var e;l({status:!1,msg:(null==Q||null===(e=Q.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==D||null===(U=D.video)||void 0===U||null===(M=U.contentDetails)||void 0===M||null===(B=M.closedCaptions)||void 0===B?void 0:B.length)>0||(null==D||null===(x=D.video)||void 0===x||null===(H=x.closedCaptions)||void 0===H?void 0:H.length)>0?(X=(null==D||null===(z=D.video)||void 0===z||null===(K=z.contentDetails)||void 0===K?void 0:K.closedCaptions)||(null==D||null===(q=D.video)||void 0===q?void 0:q.closedCaptions),Y=X.filter(function(e){return"VTT"===e.format}),p(o,Y)):g(o)):(Fe(o,"Incompatible Source, only hls,mp4,drm content is allowed"),l("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}},n)}));return function(e){return i.apply(this,arguments)}}()).catch(function(e){Hn(e,o,l,i)})}));case 10:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),Un=function(e,n,t){var o=r(e);return o.src(n),new Promise(function(e,n){var i=0;o.one("loadedmetadata",function(){clearTimeout(i),e({status:!0,msg:"video loaded"})}),o.one("loadstart",function(e){i=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},Mn=function(e){var n=(Ze.get()||{}).destroyComscoreTag,t=r(e);if(Bn(),"function"==typeof n&&n(),E(),window.onresize=null,t)t.dispose();else{var o=document.getElementById(e);o&&o.remove()}},Bn=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},xn=function(e,n){var t=r(e);t&&t.src(n)},Hn=function(n,t,o,i){var r,l,a,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);jn(t)&&Fe(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ln(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ln(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},i&&{videoId:i}))},Gn=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var i=n.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")},Qn=function(e){var n,t=r(e);return!(null!=t&&null!==(n=t.liveTracker)&&void 0!==n&&n.atLiveEdge())||null};export{kn as A,Rn as B,Cn as C,jn as D,Wn as E,Vn as F,Mn as G,x as H,hn as I,qe as J,Qn as K,B as L,q as M,Q as N,H as O,A as P,wn as Q,Ve as R,pe as S,Nn as T,Dn as U,En as V,M as W,we as a,he as b,Ze as c,fe as d,Ae as e,Ce as f,ie as g,Fe as h,en as i,Gn as j,me as k,xn as l,Ne as m,Re as n,un as o,X as p,j as q,U as r,W as s,Hn as t,K as u,N as v,V as w,ge as x,Un as y,Fn as z};
|
package/esm/generic-205dfe5c.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import i from"axios";import{g as r}from"./player_instance-34118a5b.js";import l from"md5";import a from"js-cookie";import{a as d,e as u,g as s,h as c,s as v,i as m,d as f}from"./currentVideoInfo-0b234e55.js";import{a as p,r as g}from"./captions-78bd2908.js";import h from"@babel/runtime/helpers/typeof";import{t as w,c as E}from"./skin-65765793.js";import I from"@babel/runtime/helpers/toConsumableArray";import y from"@babel/runtime/helpers/slicedToArray";import{destroyComscoreTag as T,formulateComscorePayload as b,createComscoreStreamingTag as _,setComscorePlayerInstance as S}from"@viewlift/comscore/index.js";function O(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function A(e){window.dataLayer=window.dataLayer||[],O("js",new Date),O("config",e)}function D(e,n){O("event",e,n)}var P={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function L(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function k(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?L(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):L(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var R={name:"@viewlift/player",version:"2.1.23",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1","@viewlift/sse":"^0.0.3","@viewlift/comscore":"^1.0.8",axios:"^1.2.3",md5:"^2.3.0","broadcast-channel":"^7.3.0",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","jwt-decode":"^4.0.0","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"},overrides:{"min-document":"^2.19.1"}};window.vl_player_version=R.version;var F,C=function(){var e,n,t,o;return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementBaseUrl)+"/video/status":B.get()+"".concat(null==P?void 0:P.getVideoDetails)},j=function(e,n){var t,o,r,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):i({url:C(),params:k({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":R.version,"x-player-name":"videojs",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken},withCredentials:!0})},N=function(e,n){var t,o,r,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):i({url:B.get()+P.getLinearChannelDetails,params:k(k(k(k(k({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken}})},V=function(e,n){var t,o,r=X(n),l=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})}):i({url:B.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},W=function(){var e=n(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K();case 2:return o=e.sent,e.abrupt("return",i({url:B.get()+"".concat(null==P?void 0:P.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:k({},n),params:k({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),U=function(e,n){var t,o,r=window.contentType;return i({method:"GET",url:B.get()+"".concat(null==P?void 0:P.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},M=function(e){var n=e.videoId;return i({method:"GET",url:B.get()+"".concat(null==P?void 0:P.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},B=(F=null==P?void 0:P.apiBaseUrl,{set:function(e){e&&(F=e)},get:function(){return F}}),x=function(e,n,t,o){var r,l;return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n,adbTempToken:null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.adbTempToken},withCredentials:!0})},H=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},G=null;function Q(){return{set:function(e){e&&(G=e)},get:function(){return G}}}var Y=function(){var e=n(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=Q().get(),o=B.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),z=null,K=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!H(n)){e.next=6;break}return z||(z=Y().then(function(e){var t,o,i=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&Q().set(r),i||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){z=null})),e.abrupt("return",z);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),q=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},X=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function J(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function $(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?J(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):J(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Z=0,ee=null,ne=!1,te=function(){var e,n,t,o,i,r,l,a=d();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==a||null===(i=a.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function oe(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function ie(){return re.apply(this,arguments)}function re(){return(re=n(t.mark(function e(){var n,o,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K();case 2:if(n=e.sent,o=X(n),!(i=null==o?void 0:o.userId)){e.next=9;break}return e.abrupt("return",i);case 9:return i=oe(),window.sessionStorage.setItem("uid",i),e.abrupt("return",i);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function le(){return ae.apply(this,arguments)}function ae(){return(ae=n(t.mark(function e(){var n,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function de(e){return e?String(e):""}window.initialise=function(e){window.sid=oe(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e),ue(e),se(e)};var ue=function(e){e.on("play",function(){"pause"!==ee||e.scrubbing()||(ee="play",D("RESUME",{pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:"RESUME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}))}),e.on("pause",function(){setTimeout(function(){ne||(ee="pause",D("PAUSE",{pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:"PAUSE",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}))},50)})},se=function(e){if(e){var n=0,t=0,o=0,i=0;e.on("timeupdate",r),e.on("seeking",function(){if(ne)return;ne=!0,e.off("timeupdate",r),e.one("seeked",l)}),e.on("seeked",l)}function r(){n=t,t=Math.floor(e.currentTime()),n<t&&(i=n,n=t)}function l(){var n,t;o=Math.floor(e.currentTime());var l=Math.floor(o-i);if(0!==l&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")){var a=l>0?"SEEK_FORWARD":"SEEK_BACKWARD";D(a,{pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:a,videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}i=Math.floor(e.currentTime()),setTimeout(function(){ne=!1},50),e.on("timeupdate",r)}};window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",function(){var t,o,i,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,D(r?"FAILED_TO_START":"DROPPED_STREAM",$({pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n,t){e.one("play",tryCatch(function(){var o,i,r;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),ee="play",D("PLAY",$({pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i||null===(r=i.beacon)||void 0===r?void 0:r.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",$({"Video ID":te(),watchTime:Math.floor(e.currentTime())},t))}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,n){var t,o;if(n.el_){var i,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(o=t.className)&&void 0!==o&&o.includes("vjs-waiting")&&Z<4)Z++,D("BUFFERING",$({pfm:window.platform,uid:ie(),vid:te(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,o;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,D("FIRST_FRAME",$({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),vid:te()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var n,t,o,i,r,l;D("AD_REQUEST",$({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),vid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),D("AD_IMPRESSION",$({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:te()},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(Z=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),o=e.buffered(),i=0;i<o.length;i++){var r=o.start(i),l=o.end(i);if(ce(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var ce=function(e,n,t){return e>=n&&e<=t},ve=function(){var e,n=d(),t=(null==n?void 0:n.contentType)||"video";return(null==n||null===(e=n[t])||void 0===e?void 0:e.network)||null};function me(e,n,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var o=r(e);window.initialise(o,n),window.firstFrame(o,n,t),o.on("loadedmetadata",function(){window.endFirstFrame(o)})}}window.fireEvent=function(){var e=n(t.mark(function e(n){var o,r,l,a,d,u,s,c,v,m,f,p,g,h,w,E,I,y,T,b,_;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K();case 2:return I=e.sent,y=X(I),T=null==y?void 0:y.site,b=null==y?void 0:y.siteId,e.t0=$,e.t1=$,e.t2=$({aid:T,cid:b,pfm:window.platform},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params),e.t3={},e.next=12,ie();case 12:return e.t4=e.sent,e.t5=te(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:null,e.t17=!0===n.isAdEvent?de(n.adPosition):"",e.next=28,le();case 28:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27=null!==(m=ve())&&void 0!==m?m:null,e.t28=null!=T?T:null,e.t29={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26,networkname:e.t27,brandname:e.t28},e.t30=(null==n?void 0:n.duration)&&{duration:n.duration},e.t31=(0,e.t1)(e.t2,e.t3,e.t29,e.t30),e.t32=null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t33=(0,e.t0)(e.t31,e.t32),_=[e.t33],i({url:(null===(h=window)||void 0===h||null===(w=h.customData)||void 0===w||null===(E=w.beacon)||void 0===E?void 0:E.url)||B.get()+P.getBeaconUrl,method:"post",headers:{Authorization:I},contentType:"application/x-www-form-urlencoded",dataType:"text",data:_}).catch(function(e){console.error(e)});case 46:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var fe=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},pe=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},ge=function(e,n){var t=new Map;M({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),c(t)}).catch(function(e){return console.log(e)})},he=function(){var e=u.get();return e>=0?e+1:1},we=function(){var e,n,t,o=s(),i=d(),r=null==i||null===(e=i.video)||void 0===e?void 0:e.id,l=u.get(),a=null==o||null===(n=o[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};function Ee(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ie(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ee(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var ye=l,Te=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},be=function(e){var n=_e(e,"video.tags",[]),t=_e(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},_e=function(e,n,t){for(var o=0,i=(n=n.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[n[o]]}return e||t},Se=function(){var n,t,o,i,l,d,u,s,c,v,m,f,p,g,h,w,E,I,y,T,b,_,S,O,A,D,P=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",L=arguments.length>1?arguments[1]:void 0,k=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return P;var R=(null==k?void 0:k.siteName)||(null==k?void 0:k.site)||"",F=(null==k?void 0:k.contentType)||"video",C=(null==k||null===(o=k[F])||void 0===o?void 0:o.metadata)||(null==k||null===(i=k[F])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.metadata),j=r(L);if(!P.includes("VIEWLIFT_"))return P;var N,V=window.getComputedStyle(document.getElementById(L),null),W=Math.trunc(V.getPropertyValue("height").slice(0,-2)),U=Math.trunc(V.getPropertyValue("width").slice(0,-2)),M="linearchannel"===F?null==k||null===(d=k.linearchannel)||void 0===d||null===(u=d.channels)||void 0===u||null===(s=u.find(function(e){return(null==e?void 0:e.id)===(null==k?void 0:k.channelId)}))||void 0===s||null===(c=s.content)||void 0===c?void 0:c.id:_e(k,"video.gist.id",""),B="linearchannel"===F?null==k||null===(v=k.linearchannel)||void 0===v||null===(m=v.channels)||void 0===m||null===(f=m.find(function(e){return(null==e?void 0:e.id)===(null==k?void 0:k.channelId)}))||void 0===f?void 0:f.title:_e(k,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),x=null,H=null;"function"==typeof window.__gpp&&(null===(N=window)||void 0===N||N.__gpp("ping",function(e){x=null==e?void 0:e.gppString,H=null==e?void 0:e.sectionList[0]}));var G=a.get("us_privacy")||a.get("usprivacy"),Q=void 0!==G?G:"1YNN",Y=null!==(p=null===(g=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===g?void 0:g.fwIdentifier)&&void 0!==p?p:null,z=Ie(Ie({},Oe(C)),{},(O={VIEWLIFT_WIDTH:U,VIEWLIFT_HEIGHT:W,VIEWLIFT_SIZE:Te(U,W),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(h=window)||void 0===h?void 0:h.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:_e(k,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:_e(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:_e(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==j||null===(w=j.options_)||void 0===w?void 0:w.autoplay)||1,VIEWLIFT_MUTE:(null==j||null===(E=j.options_)||void 0===E?void 0:E.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==R||"usanetwork"==R?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:be(k),VIEWLIFT_MEDIA_ID:M,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(_e(k,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:M,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+_e(k,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:_e(null===(I=window)||void 0===I||null===(y=I.app_data)||void 0===y||null===(T=y.site)||void 0===T?void 0:T.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==R||"usanetwork"==R?"":_e(null===(b=window)||void 0===b||null===(_=b.app_data)||void 0===_||null===(S=_.site)||void 0===S?void 0:S.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:Q,VIEWLIFT_TVE_PROVIDER:Y?ye(Y):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*_e(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:_e(k,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:M,VIEWLIFT_CONTENT_TITLE:B,VIEWLIFT_CONTENT_SERIES_TITLE:_e(k,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:_e(k,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:we(),VIEWLIFT_SEASON_NUMBER:he(),VIEWLIFT_CONTENT_TAGS:be(k),VIEWLIFT_GPP_SID:H||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:x||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(O,"VIEWLIFT_LAT",""),e(O,"VIEWLIFT_APP_BUNDLE",""),e(O,"VIEWLIFT_ATT_CONSENT",""),O),null===(A=window)||void 0===A||null===(D=A.customData)||void 0===D?void 0:D.macros);for(var K in z){var q=new RegExp(K,"g");P=P.replace(q,z[K])}return P},Oe=function(e){var n,t,o,i,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,s=(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return u||s?(pe()?u?a=Ie(Ie({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(a=Ie(Ie({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?a=Ie(Ie({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(a=Ie(Ie({},a),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?a=Ie(Ie({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}):s&&(a=Ie(Ie({},a),{},{VIEWLIFT_SFID:d.get("sfid.tve")||d.get("sfid.web.tve")||""})),a=pe()?Ie(Ie({},a),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):Ie(Ie({},a),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(a=Ie(Ie({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}),a=pe()?Ie(Ie({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):Ie(Ie({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),a=Ie(Ie({},a),{},{VIEWLIFT_AFID:d.get("afid"),VIEWLIFT_NIELSEN_APP_ID:d.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:d.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:d.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:d.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},Ae=function(e,n){var t,o,i,r,l,a,d,u,s,c,v,m,f,p=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,h=null==e||null===(o=e[p])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,w=null==e||null===(r=e[p])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,E=(null==e||null===(a=e[p])||void 0===a||null===(d=a.streamingInfo)||void 0===d||null===(u=d.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(s=e[p])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var I=(null==e||null===(v=e[p])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(f=m.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=w&&w.hls)return Pe(w);if(g){var y=Le(h,n);return y.src=Se(y.src,n,e),y}if("Safari"!==fe()&&I)return De(h);if(E){var T=Pe(h);return T.src=Se(T.src,n,e),T}if(null!=h&&h.mpeg){var b=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(h);return b.src=Se(b.src,n,e),b}return null},De=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},Pe=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},Le=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=fe();if(r(n),"Safari"===d){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,i,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(i);return ke(n),u}var s,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(ke(n),c.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==a?void 0:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var ke=function(e){var n=r(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==fe()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Re=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var i=t.split(".com")[1]||"";return{src:i?"".concat(n).concat(i):t,type:o}},Fe=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),i.appendChild(r),o.append(i)}}},Ce=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var je=!1,Ne=function(e,n,t){var o=Se(n,e,t),i=r(e);if(n&&window.google){if("function"!=typeof i.ima&&"object"!==h(i.ima))return;i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,o,i,l=r(e);if(null!==l.el_){je=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),je&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}),n.addEventListener(google.ima.AdEvent.Type.LOADED,function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,o)}};function Ve(e,n){var t,o,i,l=r(e),a=null==l||null===(t=l.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,d=document.getElementsByTagName("video")[0];null===(i=document)||void 0===i||i.addEventListener("keydown",function(t){var o,i,r,u,s,c,v,m,f;if(Ue.enabled&&!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName){var p=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==d||d.focus()),p){case" ":null==a||a.click();break;case"m":case"M":l.muted(!l.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":g&&!1===n.liveui||Cn(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(i=window)||void 0===i||null===(r=i.app_data)||void 0===r||null===(u=r.appcmsMain)||void 0===u||null===(s=u.adsConfig)||void 0===s?void 0:s.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(m=v.appcmsMain)&&void 0!==m&&null!==(f=m.adsConfig)&&void 0!==f&&f.vodAdClientSideTracking)return;g||Fn(e,10)}}},!0)}var We,Ue=(We=!0,{enable:function(){We=!0},disable:function(){We=!1},get enabled(){return We}}),Me="ssai-breakStart",Be="ssai-adImpression",xe="ssai-firstQuartile",He="ssai-midpoint",Ge="ssai-thirdQuartile",Qe="ssai-complete",Ye="ssai-breakEnd",ze={breakStart:Me,impression:Be,firstQuartile:xe,midpoint:He,thirdQuartile:Ge,complete:Qe,breakEnd:Ye};function Ke(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,i=ze[o];i&&t.trigger(i,n)}function qe(e){var n=r(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(Me,e)},adImpression:function(e){return t(Be,e)},adFirstQuartile:function(e){return t(xe,e)},adMidpoint:function(e){return t(He,e)},adThirdQuartile:function(e){return t(Ge,e)},adComplete:function(e){return t(Qe,e)},adBreakEnd:function(e){return t(Ye,e)}}}function Xe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Je(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Xe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var $e,Ze=($e=null,{get:function(){return $e},set:function(e){$e=e}});function en(e,n){var t,o,i,l,a,u,s,c,v,m,f,p,g,h,w,E,I=null==e?void 0:e.playerId,y=r(I);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var O=d(),A=(null==O||null===(o=O.video)||void 0===o?void 0:o.metadata)||[],D=(null==A?void 0:A.length)&&A.filter(function(e){return"advertisingGenre"===e.name});if(null!==(i=D)&&void 0!==i&&i.length){var P=D.map(function(e){return e.value});D=null==P?void 0:P.join(",")}T();var L,k,R,F=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,C=Array.isArray(null==F?void 0:F.category)?null==F||null===(a=F.category)||void 0===a?void 0:a.join(","):(null==F?void 0:F.category)||null,j=Je(Je(Je({},null==O?void 0:O.video),null==O?void 0:O.linearchannel),{},{siteName:(null==O?void 0:O.site)||null,programId:(null==F?void 0:F.videotmsid)||null,programTitle:(null==F?void 0:F.lcProgrammeName)||null,episodeId:(null==F?void 0:F.videotmsid)||null,seasonNumber:(null==O||null===(u=O.video)||void 0===u||null===(s=u.series)||void 0===s?void 0:s.seasonNumber)||(null==F||null===(c=F.seriesDetails)||void 0===c?void 0:c.season)||null,episodeNumber:(null==O||null===(v=O.video)||void 0===v||null===(m=v.series)||void 0===m?void 0:m.episodeNumber)||(null==F||null===(f=F.seriesDetails)||void 0===f?void 0:f.episode)||null,episodeTitle:(null==F?void 0:F.lcSubTitle)||null,isCompleteEpisode:!!(null!=O&&null!==(p=O.video)&&void 0!==p&&p.series||null!=F&&null!==(g=F.seriesDetails)&&void 0!==g&&g.episode),genre:D||C,comscoreConfig:{implementationId:(null==e||null===(h=e.comscore)||void 0===h?void 0:h.implementationId)||null,projectId:(null==e||null===(w=e.comscore)||void 0===w?void 0:w.projectId)||null}});if(null!=j&&null!==(E=j.streamingInfo)&&void 0!==E&&E.isLiveStream?j.contentType="LIVE":j.contentType="LONG_FORM_ON_DEMAND",null==j||!j.network){var N,V=(null==j?void 0:j.metadata)||[],W=null==V||null===(N=V.find(function(e){return"network"===e.name}))||void 0===N?void 0:N.value;j.network=W||null}null!=j&&j.network&&null!=j&&j.genre&&(j.customGenre="".concat(j.network,"_").concat((null==j?void 0:j.programTitle)||(L=j,null!=L&&L.series?null==L||null===(R=L.series)||void 0===R?void 0:R.title:null==L||null===(k=L.gist)||void 0===k?void 0:k.title),"_").concat(j.genre)),null!=F&&F.airDate&&(j.publishDate=F.airDate),null!=j&&j.runtime&&(j.runtime=1e3*((null==j?void 0:j.runtime)||0));var U=b(j,y);console.log("comscoreOptions player data",U),_(Je({playerName:"Video.js"},U)),S(y)}}function nn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function tn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?nn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):nn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function on(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 rn(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)?rn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},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 r,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,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function rn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var ln,an=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),dn=(ln=null,{set:function(e){ln=e},get position(){return ln}});function un(e,n){return sn.apply(this,arguments)}function sn(){return(sn=n(t.mark(function e(n,o){var i,l,a,d,u,s,c,v,m,f,p,g,h,w,E,I,T,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r(n),a=Ae(o,n),d=a.src,u=(null==o?void 0:o.contentType)||"video",null==o||null===(i=o[u])||void 0===i||null===(l=i.streamingInfo)||void 0===l||l.isLiveStream,s=d.replace("/dash/","/session/").replace("/master/","/session/"),s=Se(s,n,o),c=vn(s),v=y(c,2),m=v[0],f=v[1],p=cn(f)||{},s=new URL(s.split("?")[0]),Object.keys(f).length>0&&Object.entries(f).forEach(function(e){var n=y(e,2),t=n[0],o=n[1];s.searchParams.set(t,o)}),e.prev=11,e.next=14,fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(tn({adsParams:tn({},m)},p))});case 14:return g=e.sent,e.next=17,g.json();case 17:return h=e.sent,w="https://"+new URL(s).hostname,E=h.trackingUrl,I=h.manifestUrl,T=w+E,b=w+I,an.set(T),console.log("%c TRACKING URL","background: #bdf369; color: #000",T),a.src=b,e.abrupt("return",a);case 29:return e.prev=29,e.t0=e.catch(11),e.abrupt("return",a);case 32:case"end":return e.stop()}},e,null,[[11,29]])}))).apply(this,arguments)}function cn(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=y(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]}))||{}}function vn(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),i=on((null==o?void 0:o.searchParams)||[]);try{for(i.s();!(t=i.n()).done;){var r=y(t.value,2),l=r[0],a=r[1];n[decodeURIComponent(l)]=decodeURIComponent(a||"")}}catch(e){i.e(e)}finally{i.f()}for(var d={},u={},s=0,c=Object.entries(n);s<c.length;s++){var v=y(c[s],2),m=v[0],f=v[1];if(m.startsWith("ads."))d[m.replace(/^ads\./,"")]=f;else u[m]=f}return[d,u]}var mn,fn,pn,gn,hn=(mn=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),mn=Array.isArray(e)?I(e):mn},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",mn),I(mn)}}),wn=new Map;function En(e,n){return In.apply(this,arguments)}function In(){return In=n(t.mark(function e(o,i){var l,a,d,u,s,c,v,m,f,p,g,h,E,y,T,b,_,S,O,A,D,P,L,k,R,F;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:F=function(e,n,t,i,l,a){var d,u,s=r(o);if(!s.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds;var v=(null==n||null===(d=n.ads)||void 0===d||null===(u=d[i])||void 0===u?void 0:u.adId)||c;e<k&&L.clear(),k=e,Math.floor(s.currentTime());var m,f=on(t);try{var p=function(){var t,r,l,d=m.value,u=d.eventType,f=d.beaconUrls,p=d.startTimeInSeconds,g=d.startTime,h=d.durationInSeconds,w=p||c,E=f,I=(null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r||null===(l=r.ads)||void 0===l?void 0:l.adEventHandler)||null,y="".concat(v,"_").concat(u),T="pod-".concat(c);wn.has(T)||wn.set(T,new Set);var b=wn.get(T);if(console.warn(e,w,"map:",u,"condition1:",e>=w,"map:",wn),e>=w&&e<=w+P){if(!b.has(y)){b.add(y);try{R(u,n,E,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,u,n)}if("breakEnd"==u){var _=dn.position;dn.set(null),setTimeout(function(){null!=_&&(s.currentTime(_),a())},500)}if("function"==typeof I)try{var S,O={eventType:u,startTimeInSeconds:p,startTime:g,durationInSeconds:h,ad:null==n||null===(S=n.ads)||void 0===S?void 0:S[i],pod:n,adIndex:i};I({adsData:O}),Ke(o,O)}catch(e){console.error("Error when calling ads callback:",e)}}var A=Ze.get();if(A&&0!==Object.keys(A).length){var D=A.formulateComscoreAdPayload,k=A.startComscoreAdTracking,F=A.finishComscoreAdTracking,C=A.endComscoreAdTracking,j="".concat(w,"_").concat(v,"_").concat(u);if(!L.has(j))if(L.set(j,!0),"impression"===u){var N,V=an.get();k(D(tn(tn({},null==n||null===(N=n.ads)||void 0===N?void 0:N[i]),{},{trackingUrl:V})))}else"complete"===u?F():"breakEnd"===u&&C()}}};for(f.s();!(m=f.n()).done;)p()}catch(e){f.e(e)}finally{f.f()}}},R=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},D=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},wn.clear(),dn.set(i),f=an.get(),(p=r(o)).one("loadeddata",function(){f&&A(f)}),g=new Map,h=new Map,E=-1,y=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,T=(null==p||null===(d=p.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,b=(null==p||null===(u=p.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,_=(null==p||null===(s=p.el())||void 0===s||null===(c=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,S=(null==p||null===(v=p.el())||void 0===v||null===(m=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,O=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return I(o);var i=[],r=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==r||null===(e=r.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,a=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&l){var s=null==d?void 0:d.map(function(e){return tn(tn({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&i.push(null==s?void 0:s[0])}return i},A=function(){var e=n(t.mark(function e(n){var l,a,d,u,s,c,v,m,f,p,A,P,L,k,R,C,j,N,V,W,U,M,B,x;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return W=function(e){document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",W),0===e.button&&j()},V=function(e){},N=function(){var e,n=p.currentTime(),t=null,o=on(f);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=(i.ads,Math.floor(r+l));n>=r&&n<=a&&(t=a,g.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){p.currentTime(t+2.2)},100))},j=function(){var e,n=p.currentTime(),t=null,o=on(f);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=i.ads,d=Math.floor(r+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>d||n>r)&&!g.has(r)||n>=r&&n<=d)&&(t=r,g.set(r,!0),h.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){p.currentTime(t-.4)},100))},s=!1,e.next=7,fetch(n);case 7:return c=e.sent,e.next=10,c.json();case 10:v=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",v),m=v.avails,f=[],p=r(o),A=p.controlBar.progressControl,P=A.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),m.map(function(e,n){var t;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(s=!0),f.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:O(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),!s&&i&&(p.currentTime(i),N()),null!=f&&f.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",f),window.adsQueueList=f,"function"==typeof(C=(null===(L=window)||void 0===L||null===(k=L.customData)||void 0===k||null===(R=k.ads)||void 0===R?void 0:R.onAdBreaksLoaded)||null)&&(null==f?void 0:f.length)>0&&C(f)),console.log(f,"data"),f.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=p.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",P.appendChild(r)}}),p._timeUpdateHandler&&p.off("timeupdate",p._timeUpdateHandler),p._timeUpdateHandler=w(function(){var e=p.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=f[o],i=t.startTimeInSeconds,r=t.durationInSeconds,l=t.ads,a=i+r;if(e>=i-4&&e<=a+4){var d;e>=i&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&g.set(i,!0),Ue.disable(),y&&y.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),A.el().classList.add("hide-progress-bar");for(var u=e-i,s=0,c=0,v=0;v<l.length;v++){var m,p=null==l||null===(m=l[v])||void 0===m?void 0:m.durationInSeconds;if(u<s+p){c=v;break}s+=p}l[c];var w=Math.max(0,r-u),E=Math.round(w);U.style.display="block",x.textContent="".concat(c+1," of ").concat(l.length," • ").concat(D(E));var O=[];return null==l||l.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});O.push.apply(O,I(n))}),(null==t||null===(d=t.podSlotImpressionBeacon)||void 0===d?void 0:d.length)>0&&O.push.apply(O,I(null==t?void 0:t.podSlotImpressionBeacon)),F(e,t,O,c,0,N),"break"}h.delete(i)},o=0;o<f.length;o++){if("break"===t())break}n||(U.style.display="none",A.el().classList.remove("hide-progress-bar"),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),y&&y.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),Ue.enable())}},1e3),p.on("timeupdate",p._timeUpdateHandler),null===(a=document)||void 0===a||a.addEventListener("keydown",function(e){Ue.enabled&&"ArrowRight"==e.key&&(j(),Fn(o,10),e.stopPropagation())}),A.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",W))}),null===(d=document)||void 0===d||null===(u=d.querySelectorAll(".ssai-ad-container"))||void 0===u||u.forEach(function(e){return null==e?void 0:e.remove()}),(U=document.createElement("div")).className="ssai-ad-container",(M=document.createElement("div")).className="sponsored-adbox",(B=document.createElement("div")).className="sponsored-text",B.textContent="Sponsored Ad",M.append(B),(x=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",U.append(M),U.append(x),p.el().appendChild(U);case 45:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),P=1.5,L=new Map,k=-1;case 21:case"end":return e.stop()}},e)})),In.apply(this,arguments)}function yn(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 Tn(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)?Tn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},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 r,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,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function Tn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function bn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function _n(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?bn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):bn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Sn={},On=(null===(fn=window)||void 0===fn||null===(pn=fn.location)||void 0===pn||null===(gn=pn.search)||void 0===gn?void 0:gn.includes("debug=true"))||!1,An=null;function Dn(e){return Pn.apply(this,arguments)}function Pn(){return Pn=n(t.mark(function e(o){var i,l,a,d,u,s,c,v,m,f,p,g,h,E,y,T,b,_,S,O,A,D,P,L,k,R,F;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:F=function(e,n,t,i,l){var a,d,u=r(o);if(!u.seeking()){var s=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(a=n.ads)||void 0===a||null===(d=a[i])||void 0===d?void 0:d.adId)||s;Math.floor(u.currentTime());var v,m=yn(t);try{for(m.s();!(v=m.n()).done;){var f,p,g,h=v.value,w=h.eventType,E=h.beaconUrls,I=h.startTimeInSeconds,y=h.startTime,T=h.durationInSeconds,b=(h.eventId,I||s),_=E,S=(null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(g=p.ads)||void 0===g?void 0:g.adEventHandler)||null,O="".concat(c,"_").concat(w),A="pod-".concat(s);L.has(A)||L.set(A,new Set);var D=L.get(A);if(On&&console.warn(e,b,"map:",w,"condition1:",e>=b,"map:",L),e>=b&&e<=b+k&&!D.has(O)){D.add(O);try{R(w,n,_,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,w,n)}if("function"==typeof S)try{var P,F={eventType:w,startTimeInSeconds:I,startTime:y,durationInSeconds:T,ad:null==n||null===(P=n.ads)||void 0===P?void 0:P[i],pod:n,adIndex:i};S({adsData:F}),Ke(o,F)}catch(e){console.error("Error when calling ads callback:",e)}var C=Ze.get();if(C&&0!==Object.keys(C).length){var j=C.formulateComscoreAdPayload,N=C.startComscoreAdTracking,V=C.finishComscoreAdTracking,W=C.endComscoreAdTracking;if("impression"===w){var U,M=an.get();N(j(_n(_n({},null==n||null===(U=n.ads)||void 0===U?void 0:U[i]),{},{trackingUrl:M})))}else"complete"===w?V():"breakEnd"===w&&W()}}}}catch(e){m.e(e)}finally{m.f()}}},R=function(e,n,t,o){var i,r,l;"breakEnd"===e&&(null===(i=Sn)||void 0===i?void 0:i.currentAdIndex)+1!=(null===(r=Sn)||void 0===r?void 0:r.totalAds)&&(null==n||null===(l=n.ads)||void 0===l?void 0:l.length)>0||(On&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})}))},p=function(){An&&clearInterval(An)},m=an.get(),(f=r(o)).one("loadeddata",function(){p(),An=setInterval(function(){m&&!f.paused()&&P(m)},2e3)}),f.on("dispose",function(){p()}),g=new Map,h=new Map,E=-1,y=null,T=(null===(i=document)||void 0===i||null===(l=i.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==f||null===(a=f.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,_=(null==f||null===(d=f.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,S=(null==f||null===(u=f.el())||void 0===u||null===(s=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===s?void 0:s[0])||null,O=(null==f||null===(c=f.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===v?void 0:v[0])||null,A=!1,D=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return I(o);var i=[],r=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==r||null===(e=r.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,a=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&l){var s=null==d?void 0:d.map(function(e){return _n(_n({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&i.push(null==s?void 0:s[0])}return i},P=function(){var e=n(t.mark(function e(n){var i,l,a,d,u,s,c,v,m,f,p,P,L,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=new URL(n),y&&l.searchParams.append("nextToken",y),e.next=4,fetch(l.toString(),{method:"GET"});case 4:return a=e.sent,e.next=7,a.json();case 7:d=e.sent,u=d.avails,s=d.nextToken||null,y=s,c=[],v=r(o),m=v.controlBar.progressControl,f=m.seekBar.el(),null===(i=document)||void 0===i||i.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),u.map(function(e,n){c.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:D(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),On&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),null!=c&&c.length&&(window.adsQueueList=c,"function"==typeof(k=(null===(p=window)||void 0===p||null===(P=p.customData)||void 0===P||null===(L=P.ads)||void 0===L?void 0:L.onAdBreaksLoaded)||null)&&(null==c?void 0:c.length)>0&&k(c)),c.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=v.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",f.appendChild(r)}}),v._timeUpdateHandler&&v.off("timeupdate",v._timeUpdateHandler),v._timeUpdateHandler=w(function(){var e=v.currentTime();if(e!==E){E=e;for(var n=function(){var n=c[t],o=n.startTimeInSeconds,i=n.durationInSeconds,r=n.ads,l=o+i;if(e>=o-1.2&&e<=l+1.2){var a;A=!!(e>=o&&e<=l&&Array.isArray(r)&&(null==r?void 0:r.length)>0),e>l&&g.set(o,!0),Ue.disable(),T&&T.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),O&&(O.style.pointerEvents="none",O.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),m.el().classList.add("hide-progress-bar");for(var d=e-o,u=0,s=0,v=0;v<r.length;v++){var f,p=null==r||null===(f=r[v])||void 0===f?void 0:f.durationInSeconds;if(d<u+p){s=v;break}u+=p}setTimeout(function(){Sn.totalAds=null==r?void 0:r.length,Sn.currentAdIndex=s},1e3);var w=[];return null==r||r.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});w.push.apply(w,I(n))}),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&w.push.apply(w,I(null==n?void 0:n.podSlotImpressionBeacon)),F(e,n,w,s),"break"}h.delete(o)},t=0;t<c.length;t++){if("break"===n())break}A||(Sn={},m.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),Ue.enable())}},1e3),v.on("timeupdate",v._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),L=new Map,k=2.5;case 22:case"end":return e.stop()}},e)})),Pn.apply(this,arguments)}function Ln(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}var kn=function(e){o(e).play()},Rn=function(e){o(e).pause()},Fn=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},Cn=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},jn=function(e){return!!o.getPlayer("".concat(e))},Nn=function(e){return o(e).paused()},Vn=function(){var e=n(t.mark(function e(o,i){var l,a,d,u=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=u.length>2&&void 0!==u[2]&&u[2],e.next=3,K();case 3:return a=e.sent,d=r(o),e.abrupt("return",new Promise(function(e,r){var u=(null==i?void 0:i.programs)||[];null==i||delete i.programs,N(i,a).then(function(){var r=n(t.mark(function n(r){var a,s,c,m,p,g,h,w;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(a=null==r?void 0:r.data,window.sid=oe(),a.contentType="linearchannel",a.channelId=null==i?void 0:i.channelId,v(a),f(u),!l){n.next=16;break}if(h=(null==a||null===(s=a.linearchannel)||void 0===s?void 0:s.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(c=window)||void 0===c||null===(m=c.app_data)||void 0===m||null===(p=m.appcmsMain)||void 0===p||null===(g=p.adsConfig)||void 0===g?void 0:g.vodAdSticherProvider)||!1,w=Ae(a,o),!h){n.next=13;break}return n.next=12,un(o,a);case 12:w=n.sent;case 13:w&&(xn(o,w),h&&Dn(o),d.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:a})})),n.next=17;break;case 16:e({status:!0,msg:"Feed authenticated",response:a});case 17:case"end":return n.stop()}},n)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){r({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Wn=function(){var e=n(t.mark(function e(o,i,l){var a,d,u,c,f,h,w;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K();case 2:return c=e.sent,(s()||null)&&m(i),f=0,h=0,w=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(d=window)&&void 0!==d&&null!==(u=d.watchHistory)&&void 0!==u&&u.enable&&U(i,c).then(function(e){var n,t,o,i,r,l,a;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),f=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,(h=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null)<95)&&(w=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedTime)||null)}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}),e.abrupt("return",new Promise(function(e,l){j(i,c).then(function(){var i=n(t.mark(function n(i){var a,d,u,s,c,m,E,I,y,T,b,_,S,O,A,D,P,L,k,R,F,C,j,N,V,W,U,M,B,x,H,G,Q,Y,z,K,q,X;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(D=null==i?void 0:i.data,P=(null==D?void 0:D.contentType)||"video",L=(null==D||null===(a=D[P])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(s=u.appcmsMain)||void 0===s||null===(c=s.adsConfig)||void 0===c?void 0:c.vodAdSticherProvider)||!1,k=(null==D||null===(m=D.video)||void 0===m||null===(E=m.streamingInfo)||void 0===E?void 0:E.isLiveStream)||!1,v(i.data),(R=(null==D||null===(I=D.ads)||void 0===I||null===(y=I.preRoll)||void 0===y||null===(T=y.adTags)||void 0===T||null===(b=T.web)||void 0===b?void 0:b.active)&&(null==D||null===(_=D.ads)||void 0===_||null===(S=_.preRoll)||void 0===S||null===(O=S.adTags)||void 0===O||null===(A=O.web)||void 0===A?void 0:A.url))&&Ne(o,R,D),F=Ae(D,o),!L){n.next=12;break}return n.next=11,un(o,D);case 11:F=n.sent;case 12:F?(G=(null==D||null===(C=D.video)||void 0===C||null===(j=C.gist)||void 0===j?void 0:j.videoImageUrl)||(null==D||null===(N=D.video)||void 0===N||null===(V=N.gist)||void 0===V||null===(W=V.imageGist)||void 0===W?void 0:W.r16x9),(Q=r(o)).poster(G),xn(o,F),L&&En(o,w),Q.on("loadstart",function(){k&&e({status:!0,msg:"Video Loaded",response:D})}),Q.on("loadeddata",function(){Ce(),e({status:!0,msg:"Video Loaded",response:D})}),Q.one("play",function(){f&&!L&&h<95&&setTimeout(function(){Q.currentTime(f)},0)}),Q.one("error",function(){var e;l({status:!1,msg:(null==Q||null===(e=Q.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==D||null===(U=D.video)||void 0===U||null===(M=U.contentDetails)||void 0===M||null===(B=M.closedCaptions)||void 0===B?void 0:B.length)>0||(null==D||null===(x=D.video)||void 0===x||null===(H=x.closedCaptions)||void 0===H?void 0:H.length)>0?(X=(null==D||null===(z=D.video)||void 0===z||null===(K=z.contentDetails)||void 0===K?void 0:K.closedCaptions)||(null==D||null===(q=D.video)||void 0===q?void 0:q.closedCaptions),Y=X.filter(function(e){return"VTT"===e.format}),p(o,Y)):g(o)):(Fe(o,"Incompatible Source, only hls,mp4,drm content is allowed"),l("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}},n)}));return function(e){return i.apply(this,arguments)}}()).catch(function(e){Hn(e,o,l,i)})}));case 10:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),Un=function(e,n,t){var o=r(e);return o.src(n),new Promise(function(e,n){var i=0;o.one("loadedmetadata",function(){clearTimeout(i),e({status:!0,msg:"video loaded"})}),o.one("loadstart",function(e){i=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},Mn=function(e){var n=(Ze.get()||{}).destroyComscoreTag,t=r(e);if(Bn(),"function"==typeof n&&n(),E(),window.onresize=null,t)t.dispose();else{var o=document.getElementById(e);o&&o.remove()}},Bn=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},xn=function(e,n){var t=r(e);t&&t.src(n)},Hn=function(n,t,o,i){var r,l,a,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);jn(t)&&Fe(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ln(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ln(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},i&&{videoId:i}))},Gn=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var i=n.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")},Qn=function(e){var n,t=r(e);return!(null!=t&&null!==(n=t.liveTracker)&&void 0!==n&&n.atLiveEdge())||null};export{kn as A,Rn as B,Cn as C,jn as D,Wn as E,Vn as F,Mn as G,x as H,hn as I,qe as J,Qn as K,B as L,q as M,Q as N,H as O,A as P,wn as Q,Ve as R,pe as S,Nn as T,Dn as U,En as V,M as W,we as a,he as b,Ze as c,fe as d,Ae as e,Ce as f,ie as g,Fe as h,en as i,Gn as j,me as k,xn as l,Ne as m,Re as n,un as o,X as p,j as q,U as r,W as s,Hn as t,K as u,N as v,V as w,ge as x,Un as y,Fn as z};
|
package/esm/index-13b7c455.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"video.js/dist/video-js.min.css";import{d as e,c as n,g as t,a as o,b as i,s as l,e as r,l as a,i as s,f as u,h as d,j as c,k as v,m,n as p,o as f,p as g,q as h,r as y,t as b,u as w,v as k,w as S,x as I,y as E,z as D,A as T,B as O,C as j,D as C,E as P,F as x,G as N,H as A,I as R,J as M,K as L,L as _,M as B,N as V,O as U,P as H}from"./generic-2f9efcf1.js";import F from"@babel/runtime/helpers/defineProperty";import G from"@babel/runtime/helpers/asyncToGenerator";import q from"@babel/runtime/regenerator";import K from"video.js";import{o as J,g as W,a as Y,s as z,b as X,p as Q,c as $}from"./util-90b9fbc3.js";import{g as Z,d as ee,a as ne,e as te}from"./captions-78bd2908.js";import{g as oe,p as ie}from"./resolution-62be852a.js";import{i as le,a as re}from"./skin-65765793.js";import{g as ae}from"./player_instance-34118a5b.js";import{g as se,s as ue}from"./localisation-0bf399a1.js";import{g as de,a as ce,s as ve,v as me,b as pe,c as fe,d as ge,e as he,f as ye}from"./currentVideoInfo-0b234e55.js";import be from"@babel/runtime/helpers/typeof";import{s as we,w as ke}from"./icons-37daa6b3.js";import{c as Se,p as Ie,a as Ee,h as De,r as Te,g as Oe,b as je,d as Ce,s as Pe,e as xe,f as Ne}from"./helper-d52dff3c.js";import Ae from"@babel/runtime/helpers/toConsumableArray";import Re from"@babel/runtime/helpers/slicedToArray";import{createSSETransport as Me}from"@viewlift/sse";var Le=function(e){return new Promise(function(n,t){if(_e(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}})},_e=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Be=function(e,n,t){var o=ae(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.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,"'")})},Ve=function(e){var n=ae(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Ue=function(){var n=G(q.mark(function n(t){var o,i,l,r,a;return q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(l=ae(null==t?void 0:t.playerId),null!=t&&null!==(o=t.series)&&void 0!==o&&o.enable||!(null!=t&&t.chromecastReceiverId||null!=t&&t.airplay)){n.next=10;break}return n.prev=2,n.next=5,Le("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:n.next=10;break;case 7:n.prev=7,n.t0=n.catch(2),console.log("Error",n.t0);case 10:if(null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=13,import("@silvermine/videojs-chromecast");case 13:n.sent.default(K),(a=K.getTech("chromecast"))&&!a.prototype.seeking&&(a.prototype.seeking=function(){}),null!==(r=window)&&void 0!==r&&r.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=t&&t.airplay&&"Safari"==e()?null==l||l.airPlay({addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return n.stop()}},n,null,[[2,7]])}));return function(e){return n.apply(this,arguments)}}(),He=function(e,n){var t=ae(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,i,l,r,a=this.el(),s=K.dom.getPointerPosition(a,n).x;K.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S;if(console.log(u),u&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}})};var Fe=function(){var e=G(q.mark(function e(){return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Le("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)}}(),Ge=function(){var e=G(q.mark(function e(){return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("@viewlift/comscore/index.js").then(function(e){n.set(e)});case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),qe=function(){var e=G(q.mark(function e(){return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){K.getPlugin("eme")||K.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ke=function(){var e=G(q.mark(function e(){var n;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(K),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)}}(),Je=function(){var e=G(q.mark(function e(){return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-5d92eaa3.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),We=function(){var e=G(q.mark(function e(){return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-1a1bf509.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)}}(),Ye=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){Le("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(K)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(K)})},loadAdsLibrary:Fe,loadEMELibrary:qe,loadMuxPlugin:Ke,loadDvrSeekbar:Je,loadContribDash:We,loadComscorePlugin:Ge});function ze(e){return Xe.apply(this,arguments)}function Xe(){return(Xe=G(q.mark(function n(t){var o,i,l;return q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return o=(null==t?void 0:t.airplay)||!1,n.next=3,Fe();case 3:o&&"Safari"==e()?Promise.resolve().then(function(){return Ye}).then(function(e){e.importAirplay()}):(l=(null===(i=document)||void 0===i?void 0:i.getElementById(null==t?void 0:t.playerId))||null)&&l.setAttribute("x-webkit-airplay","deny");case 4:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Qe(e){return $e.apply(this,arguments)}function $e(){return($e=G(q.mark(function e(n){var t,o,i,l,r,a,s,u;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u=ae(n.playerId),e.next=3,Ge();case 3:u.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(o=n.comscore)||void 0===o?void 0:o.endpoint,applicationName:(null==n||null===(i=n.comscore)||void 0===i?void 0:i.applicationName)||(null===(l=window)||void 0===l?void 0:l.siteName)||null,implementationId:null==n||null===(r=n.comscore)||void 0===r?void 0:r.implementationId,projectId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.projectId,debug:(null==n||null===(s=n.comscore)||void 0===s?void 0:s.debug)||!1});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ze(e,n){return en.apply(this,arguments)}function en(){return(en=G(q.mark(function n(t,o){var i,l,r,a,s,u,d,c,v,m,p,f,g,h;return q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return v=(null==o?void 0:o.contentType)||"video",m=null==o||null===(i=o[v])||void 0===i?void 0:i.drmEnabled,null==o||null===(l=o[v])||void 0===l||null===(r=l.liveDetails)||void 0===r||r.isDvrEnabled,null==t||t.showPositiveSeekbar,p=(null==o||null===(a=o[v])||void 0===a||null===(s=a.streamingInfo)||void 0===s||null===(u=s.videoAssets)||void 0===u?void 0:u.dash)||null,f=(null==t||null===(d=t.comscore)||void 0===d?void 0:d.enable)||!1,g=!(null==t||null===(c=t.analytics)||void 0===c||!c.muxKey),n.prev=7,n.next=10,Promise.allSettled([m?"Safari"==e()?qe():"caliente"!=(null===(h=window)||void 0===h?void 0:h.siteName)?We():qe():"Safari"!=e()&&p?We():null,f?Qe(t):null,g?Ke():null,Ue(t)]);case 10:n.next=15;break;case 12:n.prev=12,n.t0=n.catch(7),console.log("Error",n.t0);case 15:case"end":return n.stop()}},n,null,[[7,12]])}))).apply(this,arguments)}function nn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function tn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?nn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var on=new Set,ln=null,rn=function(e,n,o,i){var l,r,a,s,u,d,c,v={},m=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(l=e[m])||void 0===l?void 0:l.id)||"Null",v["c3.cm.contentType"]=mn(e),v[null==o||null===(r=o.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==e||!e.linearchannel),v[null==o||null===(a=o.Constants)||void 0===a?void 0:a.STREAM_URL]=n.currentSrc(),v[null==o||null===(s=o.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===t()?"NULL":t(),v["c3.cm.categoryType"]=dn(e),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===(u=e[m])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(d=e[m])&&void 0!==d&&null!==(c=d.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",v[o.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=cn(e),v["c3.cm.genreList"]=sn(e),v["c3.cm.genre"]=an(e),v["c3.cm.channel"]=un(e,i);var p=gn(de(),e);return v=tn(tn({},v),p)},an=function(e){var n,t,o,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===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},sn=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"},un=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(o=((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===o?void 0:o.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"},cn=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},vn=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(t=e[l])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(r)},mn=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var pn,fn,gn=function(e,n){var t,l,r,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var d=i(),c=o();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(l=t.series)||void 0===l?void 0:l.title)||"Null",u["c3.cm.seasonNumber"]=(null==d?void 0:d.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(r=e[d-1])||void 0===r||null===(a=r.episodes)||void 0===a||null===(s=a[c-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",u},hn=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"}},yn=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},bn=function(){var e=G(q.mark(function e(n,t){var o,i,l,r,a,s,u,d,c,v,m,p;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(null==t?void 0:t.convivaConfig)||{},i=o.trackConvivaPlayerEvent,l=o.paymentHandler,r=o.tveProvider,a=o.enable,s=o.appName,d=(u=t||{}).token,c=u.epg,a){e.next=4;break}return e.abrupt("return");case 4:if(v=ae(n),"function"==typeof(m=i)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,m("getConvivaObject");case 10:if(p=e.sent){e.next=13;break}return e.abrupt("return");case 13:v.ready(function(){var e=v.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=hn(t.keySystem);m("contentInfo",{DRMEnabled:o})}else m("contentInfo",{DRMEnabled:"None"})}),n||m("contentInfo",{DRMEnabled:"None"})}),v.on("loadstart",function(){var e,n;ln&&ln!==v.currentSrc()&&m("playbackEnded"),m("setPlayer",v),on.clear(),ln=v.currentSrc();var o=yn(v.currentType()),i=ce(),a=rn(i,v,p,c);a[null==p||null===(e=p.Constants)||void 0===e?void 0:e.PLAYER_NAME]=s||"WEB",a[null==p||null===(n=p.Constants)||void 0===n?void 0:n.ASSET_NAME]=vn(i,t),a.authToken=d||"NULL",a.streamType=o,a.D2CType=l||"NONE",a.subscriberType=r?"MVPD":"FREE"!==l?"D2C":"FREE",a["c3.cm.affiliate"]=r||"NULL",wn.setData(a),m("contentInfo",a)}),v.on("loadedmetadata",function(){var e,n=v.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),m("contentInfo",{screenResolution:e})}),v.on("play",function(){on.has(v.currentSrc())||(on.add(v.currentSrc()),m("playbackStarted",null))}),v.on("ended",function(){on.has(v.currentSrc())&&on.delete(v.currentSrc()),m("playbackEnded")}),v.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&m("initAdSensor",{player:v,adsLoader:null==e?void 0:e.adsLoader})}),v.on("dispose",function(){null==on||on.clear(),m("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),wn=(pn={},{setData:function(e){pn=tn(tn({},pn),e)},getData:function(){return pn}}),kn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-01da91f0.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-f5b2d1cc.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-74d07b0b.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-e9914c42.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-c906e1c0.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?import("./skin-017721f3.js").then(function(t){t.initialiseSkin(e,n)}):"news"==t?import("./skin-b8e87cdb.js").then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?import("./skin-c4422587.js").then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&import("./skin-258904b8.js").then(function(t){t.initialiseSkin(e,n)})};function Sn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function In(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Sn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Sn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var En=[],Dn=0,Tn=null;function On(){console.log("Cleaning up watch history data"),fn=null,En=[],Dn=0,Tn=null}function jn(e,n,t){var o,i,r,a,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var d=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(r=n.watchHistory)||void 0===r||r.xapiKey;var m=(null==n||null===(a=n.video)||void 0===a?void 0:a.originalObjectId)||null,p=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,f=Math.floor(e.currentTime()),g=u?100:Math.floor(c/v*100),h={};p?function(e,n,t){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),i=Cn(o),l=(new Date).getTime(),r=ce(),a=(null==r?void 0:r.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return In(In({},e),{},F({},n,a[n]))},{}),u=i.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===fn});u<0?i.push(In(In({content:s},e),{},{addedDate:l,updateDate:l})):i[u]=In(In(In({},i[u]),e),{},{updateDate:l});localStorage.setItem("".concat(o),JSON.stringify(i))}(h={completed:u,watchedTime:f,watchedPercentage:g},d,n.siteOwner):(h=In(In({videoId:fn,watchedTime:f,watchedPercentage:g,doneWatching:u,profileId:d},Tn&&{seriesId:Tn}),m&&{originalObjectId:m}),l(h).then(function(e){}).catch(function(e){})),Dn=c+t}function Cn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Pn(e,n,t){var o=Cn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i}var xn=!1,Nn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!xn){var l=An(e,"videoAssets","secondaryVideoAssets"),s=r(l,n);return s&&a(n,s),xn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function An(e,n,t){if(Array.isArray(e))return e.map(function(e){return An(e,n,t)});if(null!==e&&"object"===be(e)){var o={};return Object.keys(e).forEach(function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=An(e[i],n,t)}),o}return e}function Rn(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 Mn(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)?Mn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},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 l,r=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){a=!0,l=e},f:function(){try{r||null==t.return||t.return()}finally{if(a)throw l}}}}function Mn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function Ln(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function _n(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ln(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ln(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Bn=function(n,t,o,i){var l,r,a,c,v,m=i.res,p=i.sres,f=ae(n),g=(null==m?void 0:m.contentType)||"video",h=(null==m||null===(l=m[g])||void 0===l?void 0:l.drmEnabled)||!1,y=(null==m||null===(r=m[g])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,b=(null==m||null===(c=m[g])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1;ve(m),me.set(m),f&&(f.on("loadstart",function(){y?o.resolve({status:!0,msg:"Video Loaded",response:m}):o.resolve(_n({status:!0,msg:"Player Initialised"},p?{seriesResponse:p,response:m}:{response:m}))}),f.on("loadeddata",function(){var o,i,l,r=Z(n);if(null==r||r.map(function(e){return ee(n,e.id)}),b&&"Safari"===e())try{var a;null==f||null===(a=f.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==f||!f.muted())&&Be(n,sessionStorage.getItem("volume")||"100");var d=ce();if(s(t),u(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var c,v,p=_n(_n({},t),m);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(Tn=null==n||null===(i=n.series)||void 0===i?void 0:i.id),En=[],Dn=0,fn=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=ae(e);a&&(a.on("dispose",On),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());En.includes(Dn)||(e!=Dn||e<r?e>Dn&&(Dn=e+r):(En.push(e),jn(a,n,r)))}}),a.one("ended",function(){jn(a,n,r,!0)}))}(n,p,null==d||null===(c=d.video)||void 0===c||null===(v=c.gist)||void 0===v?void 0:v.id)}if(null!=t&&null!==(l=t.analytics)&&void 0!==l&&l.muxKey&&null!=f&&f.mux){var g,h,y,w,k,S,I=(null===(g=ce())||void 0===g?void 0:g.video)||(null==m?void 0:m.video),E=null==I?void 0:I.gist,D={env_key:null==t||null===(h=t.analytics)||void 0===h?void 0:h.muxKey,player_name:"vl-web-player",player_version:null===(y=window)||void 0===y?void 0:y.vl_player_version,video_id:null==E?void 0:E.id,video_title:null==E?void 0:E.title,video_series:null==I||null===(w=I.series)||void 0===w?void 0:w.title,video_stream_type:null!=I&&null!==(k=I.streamingInfo)&&void 0!==k&&k.isLiveStream?"live":"video",viewer_user_id:null==t||null===(S=t.analytics)||void 0===S?void 0:S.userId};f.mux({debug:!1,data:D})}}),f.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];f.trigger("subtitlechanged",n)}),f.on("subtitlechanged",function(e,n){var t,o,i,l,r,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var f,g=p.getMediaSession(),h=g.media.tracks.filter(function(e){return"TEXT"==e.type});f=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(f)}}),f.tech_.on("retryplaylist",function(){y&&Nn(m,n)}),f.on("error",function(){var e,t;(console.log("ERROR",f.error(),f.error().code),4===f.error().code&&y)?Nn(m,n):(d(n,(null==f||null===(e=f.error())||void 0===e?void 0:e.message)||"Some error occured"),o.reject({status:!1,msg:(null==f||null===(t=f.error())||void 0===t?void 0:t.message)||"Some error occured",response:m}))}),f.one("play",function(){var e,n,o,i,l;if(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable){var r,a,s,u=null===(r=ce())||void 0===r||null===(a=r.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.id,d=pe(),c=(null==d?void 0:d.get(u))||{t:0,p:0},v=c.t,m=c.p;v&&m<95&&setTimeout(function(){f.currentTime(v)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){f.currentTime(null==t?void 0:t.watchHistoryResumeTime)},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(y){f.currentSource();for(var e=f.textTracks(),n=e.length-1;n>=0;n--)f.removeRemoteTextTrack(e[n])}}),f.one("loadeddata",function(){var n,t=(null==f||null===(n=f.audioTracks())||void 0===n?void 0:n.tracks_)||null;if(t)if(t.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0}),"object"==be(f.dash)){var o,i,l,r=null==f||null===(o=f.dash)||void 0===o||null===(i=o.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==r?void 0:r.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),s=Rn(t);try{for(s.s();!(l=s.n()).done;){var u=l.value;if(a&&(null==u?void 0:u.id)=="dash-audio-".concat(a.index)){u.enabled=!0;break}}}catch(e){s.e(e)}finally{s.f()}}else{var d,c=Rn(t);try{for(c.s();!(d=c.n()).done;){var v,m,p,g=d.value;if(("Chrome"==e()||"Edge"==e()&&(null!==(v=navigator)&&void 0!==v&&null!==(m=v.userAgent)&&void 0!==m&&m.includes("Macintosh")||!h))&&null!=g&&null!==(p=g.label)&&void 0!==p&&p.includes("5.1"))f.audioTracks().removeTrack(g);else{if("main"==g.kind){g.enabled=!0;break}g.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}}))};function Vn(e){var n=ae(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),l=t.end(t.length-1)-i;Hn(),Fn(l).forEach(function(e){var n=e.id,t=e.title,i=e.time,r=Un(n,t,Math.min(i/l*100,99.5));o.appendChild(r)})}}function Un(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function Hn(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach(function(e){e.remove()})}function Fn(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(fe()||[]).filter(function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n}).map(function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}})}function Gn(e,n){var t=ae(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,l=n.videoId;n.epg;var r=i.playLive,a=i.playFromBegining,s=i.programs;ge(s),t.on("loadeddata",function(){Se(n)?a?Ie(t,n):r?Ee(t,l):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,l=n.epg,r=o.buttonConfig,a=void 0===r?{}:r,s=a.watchLive;a.resume;var u=a.startFromBegining,d=i;if(l&&null!=l&&l.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!Oe(d),m=document.querySelector(".vjs-dvr-btn-overlay");m||((m=document.createElement("div")).className="vjs-dvr-btn-overlay");var p=je(n);p&&(m.style.backgroundImage="url(".concat(p,")"),m.style.backgroundPosition="center center",m.style.backgroundRepeat="no-repeat",m.style.backgroundSize="cover");m.innerHTML=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,l=t.startFromBegining,r=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(ke()," ").concat(r,"</button>"),s='<button id="watch-begining-btn">'.concat(we()," ").concat((null==l?void 0:l.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(s,"</div>")}(o,v),m.style.display="flex",e.el().appendChild(m),Ce(e),qn("watch-live-resume-btn",s,function(){Ne(e,m),Ee(e,d)}),qn("watch-begining-btn",u,function(){Ne(e,m),Ie(e,n)})}(t,n),De({player:t,showWatchLive:!0,showStartOver:!0})):Te(t)}),t.one("loadedmetadata",function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,l=e.seekable(),r=l.start(0),a=l.end(l.length-1)-r,s=JSON.parse(sessionStorage.getItem("epgConfig")),u=t,d=!0;if(s&&null!=s&&s.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==s?void 0:s.programId),u=null==s?void 0:s.programId}e.on("seeking",function(){i=!0}),e.on("seeked",function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;u="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}Pe(u,o),xe(e,n),De({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})}),e.on("timeupdate",function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");u="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(Pe(u,t),o=t,function(e,n){Fn(n).forEach(function(t){var o=t.id,i=t.title,l=t.time,r=document.getElementById(o);if(r){var a=Math.min(l/n*100,99.5);r.style.left="".concat(a,"%")}else{var s=e.controlBar.progressControl.seekBar.el(),u=Un(o,i,Math.min(l/n*100,99.5));s.appendChild(u)}})}(e,a))}})}(t,n)})}else console.warn("Player instance is required to initialize start over.")}function qn(e,n,t){var o,i,l=document.getElementById(e);l&&(i=n,(o=l)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),l.addEventListener("click",t))}function Kn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Jn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Wn=function(n,t,o,i){var l,s,u,g,h,y,b,w,k,S,I,E,D,T,O,j,C,P,x,N,A,R,M,L,_,B,V,U,H,J,W,Y,z,X,Q,$,Z,ee=t.res,te=void 0===ee?null:ee,oe=t.sres,ie=void 0===oe?null:oe,re=null!=o&&o.chromecastReceiverId?["chromecast","html5"]:["html5"],se=(null===(l=te)||void 0===l?void 0:l.contentType)||"video",ue=le(null===(s=te)||void 0===s||null===(u=s[se])||void 0===u||null===(g=u.gist)||void 0===g?void 0:g.videoImageUrl)||le(null===(h=te)||void 0===h||null===(y=h[se])||void 0===y||null===(b=y.gist)||void 0===b||null===(w=b.imageGist)||void 0===w?void 0:w.r16x9),de=(null===(k=te)||void 0===k||null===(S=k[se])||void 0===S||null===(I=S.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,ce=(null===(E=te)||void 0===E||null===(D=E[se])||void 0===D||null===(T=D.streamingInfo)||void 0===T?void 0:T.isLiveStream)||!1,ve=(null===(O=te)||void 0===O||null===(j=O.ads)||void 0===j||null===(C=j.preRoll)||void 0===C||null===(P=C.adTags)||void 0===P||null===(x=P.web)||void 0===x?void 0:x.active)&&(null===(N=te)||void 0===N||null===(A=N.ads)||void 0===A||null===(R=A.preRoll)||void 0===R||null===(M=R.adTags)||void 0===M||null===(L=M.web)||void 0===L?void 0:L.url);te=Jn(Jn({},te),{},{audioAssetSource:null==o?void 0:o.audioAssetSource});var me=(null==o||null===(_=o.customData)||void 0===_?void 0:_.ads)||{},pe=(null===(B=te)||void 0===B||null===(V=B[se])||void 0===V?void 0:V.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==me?void 0:me.vodAdSticherProvider)||!1,fe=(null==o?void 0:o.latency)||6,ge=(null==o?void 0:o.skin_settings)||{};null==o||o.dvrConfig;var he=($={enableSmoothSeeking:!0,controls:0!=(null==o?void 0:o.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==o?void 0:o.muted)||!1,autoplay:(null==o?void 0:o.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==ge?void 0:ge.pictureInPictureToggle)||!1},playbackRates:null!=ge&&ge.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==o.skin,liveui:de},F($,"autoplay",null==o?void 0:o.autoplay),F($,"normalizeAutoplay",(null==o?void 0:o.autoplay)&&!ve),F($,"loop",(null==o?void 0:o.loop)||!1),F($,"audioPosterMode",null==o?void 0:o.audioPosterMode),F($,"html5",Jn(Jn({dash:Jn(Jn(Jn({},!K.browser.IS_SAFARI&&{useTTML:!0}),(null==o?void 0:o.debugConfig)&&(null==o||null===(U=o.debugConfig)||void 0===U?void 0:U.enable)&&{debug:!0,logLevel:null!=o&&null!==(H=o.debugConfig)&&void 0!==H&&H.logLevel?null==o||null===(J=o.debugConfig)||void 0===J?void 0:J.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:fe},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:Jn(Jn({},(null==o?void 0:o.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==o?void 0:o.initialBandwidth)/1e3}}),{},{autoSwitchBitrate:{video:!0,audio:!0},additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}})}}}),vhs:Jn(Jn(Jn({},(null==o?void 0:o.initialBandwidth)&&{bandwidth:o.initialBandwidth}),{},{liveRangeSafeTimeDelta:fe,useDevicePixelRatio:!0,experimentalLLHLS:(null==o?void 0:o.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==o||!o.initialBandwidth},(null==o||null===(W=o.customData)||void 0===W?void 0:W.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(Y=null==o?void 0:o.enableLowInitialPlaylist)&&void 0!==Y&&Y}),debug:(null==o?void 0:o.debugConfig)&&(null==o||null===(z=o.debugConfig)||void 0===z?void 0:z.enable)||!1,nativeTextTracks:"Safari"==e()},0==(null==o||null===(X=o.customData)||void 0===X?void 0:X.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==o||null===(Q=o.customData)||void 0===Q?void 0:Q.nativeVideoTracks)&&{nativeVideoTracks:!1})),F($,"poster",ue),F($,"techOrder",re),F($,"chromecast",{requestCustomDataFn:function(e){var t,i,l=ae(n),r=((null==l?void 0:l.textTracksJson_)||l.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),a=function(e,n,t){var o,i,l,r,a,s,u,d,c,v,m=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){var f,g,h,y,b,w,k,S;p.isDrmEnabled=!0;var I=(null==n||null===(f=n.keySystems)||void 0===f?void 0:f["com.widevine.alpha"])||null,E=(null==I?void 0:I.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=E;var D=(null==I?void 0:I.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=D}var T=(null==e||null===(o=e[m])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=T;var O=null==e||null===(l=e[m])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;p.duration=O;var j=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=j;var C=null==e||null===(u=e[m])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return p.mediaImage=C,p.subTitles=t,p.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(te,e,r);return Jn(Jn({},a),{},{convivaMetaData:Jn({customerKey:(null==o||null===(t=o.convivaConfig)||void 0===t?void 0:t.customerKey)||null,debug:(null==o||null===(i=o.convivaConfig)||void 0===i?void 0:i.debug)||!1},wn.getData())})},modifyLoadRequestFn:function(e){var t,o,i,l,r,a=ae(n),s=(null==a?void 0:a.currentSource())||{};!(null===(t=te)||void 0===t||null===(o=t[se])||void 0===o||null===(i=o.streamingInfo)||void 0===i||null===(l=i.videoAssets)||void 0===l?void 0:l.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(r=s.src)&&void 0!==r&&r.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),$);if(!K.getPlayers()[n]){null!=o&&o.debugConfig&&null!=o&&null!==(Z=o.debugConfig)&&void 0!==Z&&Z.enable&&K.log.level("debug");var ye=K(n,he,function(){var e=G(q.mark(function e(){var t,l,s,u,g,h,y,b,w,k,S,I,E,D,T,O,j,C,P,x,N;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(ye),console.log(K.VERSION),console.log(K.getPlugins()),e.next=5,Ze(o,te);case 5:if(E=null===(t=te)||void 0===t||null===(l=t[se])||void 0===l||null===(s=l.liveDetails)||void 0===s?void 0:s.startOverTime,ce&&i.resolve(Jn({status:!0,msg:"Player Initialised"},ie?{seriesResponse:ie,response:te}:{response:te})),de&&null!=o&&null!==(u=o.dvrConfig)&&void 0!==u&&u.enable&&Gn(n,Jn(Jn({},o),{},{isDvrEnabled:de})),v(n,null==o?void 0:o.analyticsCb,null==o?void 0:o.analyticsEventParams),bn(n,o),/Android/i.test(navigator.userAgent)&&(K.options.vhs.overrideNative=!0),de&&He(n,E),!ve||null!=o&&null!==(g=o.customData)&&void 0!==g&&g.disableAds||m(n,ve,te),D=r(te,n),console.log(D),null!=o&&o.nearestClusterUrl&&(D=p(D,o.nearestClusterUrl)),!pe){e.next=21;break}return e.next=20,f(n,te);case 20:D=e.sent;case 21:D?a(n,D):(i.reject({status:!1,msg:"Incompatible / Missing Source",response:te}),d(n,"Incompatible / Missing Source")),((null===(h=te)||void 0===h||null===(y=h[se])||void 0===y||null===(b=y.contentDetails)||void 0===b||null===(w=b.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(k=te)||void 0===k||null===(S=k[se])||void 0===S||null===(I=S.closedCaptions)||void 0===I?void 0:I.length)>0)&&(N=(null===(O=te)||void 0===O||null===(j=O[se])||void 0===j||null===(C=j.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null===(P=te)||void 0===P||null===(x=P[se])||void 0===x?void 0:x.closedCaptions),T=N.filter(function(e){return"VTT"===e.format||"WEBVTT"===e.format}),ne(n,T)),null!=o&&o.disableControls?c(n):kn(n,Jn(Jn(Jn({},o),he),{},{liveVideo:ce,isDvrEnabled:de,res:te,sres:ie})),Bn(n,Jn(Jn(Jn({},o),he),{},{liveVideo:ce}),i,{res:te,sres:ie});case 25:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}())}};function Yn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function zn(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){F(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 Xn,Qn=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,l=$n(e);Wn(i,{res:l},e,{resolve:t,reject:o})},$n=function(e){var n,t,o,i,l,r,a,s,u,d,c,v,m,p=null==e?void 0:e.streamingInfo,f=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,y=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.url)||null,b=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,w=(null==e||null===(r=e.streamingInfo)||void 0===r?void 0:r.subtitles)||[],k=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(s=a.videoAssets)||void 0===s?void 0:s.drmProvider)||null,S=(null==e||null===(u=e.streamingInfo)||void 0===u?void 0:u.macroMap)||[],I=(null==e||null===(d=e.customData)||void 0===d||null===(c=d.ads)||void 0===c?void 0:c.isSSAIEnabled)||!1,E=null==e?void 0:e.token,D=g(E);null==D||D.site;var T=null==D?void 0:D.siteId,O=(null==e||null===(v=e.customData)||void 0===v||null===(m=v.comscore)||void 0===m?void 0:m.video)||null,j=zn(zn({id:"".concat(T,"_external")},!h&&{directPlaybackUrl:null==f?void 0:f.url}),{},{video:zn(zn(zn(zn(zn({drmEnabled:h,streamingInfo:zn(zn({videoAssets:zn(zn({},k&&{drmProvider:k}),{},{widevine:null==f?void 0:f.widevine,fairPlay:null==f?void 0:f.fairPlay,playReady:null==f?void 0:f.playReady})},(null==p?void 0:p.isDvrEnabled)&&{isLiveStream:!0}),(null==O?void 0:O.isLiveStream)&&{isLiveStream:null==O?void 0:O.isLiveStream})},I&&{isSSAIEnabled:I}),{},{metadata:S,liveDetails:{isDvrEnabled:null==p?void 0:p.isDvrEnabled},gist:zn(zn(zn({},b&&{videoImageUrl:b}),(null==O?void 0:O.videoId)&&{id:null==O?void 0:O.videoId}),(null==O?void 0:O.videoTitle)&&{title:null==O?void 0:O.videoTitle}),contentDetails:zn({},(null==w?void 0:w.length)>0&&{closedCaptions:Ae(w)})},(null==O?void 0:O.runtime)&&{runtime:null==O?void 0:O.runtime}),(null==O?void 0:O.publishDate)&&{publishDate:null==O?void 0:O.publishDate}),(null==O?void 0:O.platform)&&{platform:null==O?void 0:O.platform}),(null==O?void 0:O.series)&&{series:null==O?void 0:O.series}),ads:{preRoll:{adTags:{web:zn(zn({},y&&{active:!0}),y&&{url:y})}}}});return O&&(null!=O&&O.isDvrEnabled&&(j.video.liveDetails=zn(zn({},j.video.liveDetails),{},{isDvrEnabled:null==O?void 0:O.isDvrEnabled})),null!=O&&O.metadata&&(j.video.metadata=[].concat(Ae(j.video.metadata),Ae(null==O?void 0:O.metadata)))),j},Zn=null,et=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),o=function(e,n){var t;return t=12*(n.getFullYear()-e.getFullYear()),t-=e.getMonth(),(t+=n.getMonth())<=0?0:t}(new Date,new Date(n)),i=o>0&&t>4?o:0,l=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),o=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(o-=1),o<0&&(t-=1),t}(new Date,new Date(n));return[l>0&&i>0?l:0,i,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},nt=function(e){var n,t=Re(e,8),o=t[0],i=t[1],l=t[2],r=t[3],a=t[4],s=t[5],u=t[6],d=t[7];n=o>=1?" ".concat(o," Year"):i>=1?" ".concat(i," month"):l>=1?" ".concat(l," week"):r>=1?" ".concat(r," day"):a<24&&a>=12?" ".concat(a," hour"):a>0?"".concat(a," hours ").concat(s," minutes ").concat(u," seconds"):s>0?"".concat(s," minutes ").concat(u," seconds"):"".concat(u," seconds"),d.textContent="".concat(n)},tt=(Xn={scheduleStartTimeMs:0,scheduleEndTimeMs:0},{get:function(){return Xn},set:function(e){Xn={scheduleStartTimeMs:null==e?void 0:e.startDateTime,scheduleEndTimeMs:null==e?void 0:e.endDateTime}}});function ot(e,n,t,o){if(e){var i=function(){var e,i,r=null===(e=tt.get())||void 0===e?void 0:e.scheduleStartTimeMs,a=null===(i=tt.get())||void 0===i?void 0:i.scheduleEndTimeMs,s=Date.now();if(s-a>0){var u=document.getElementsByClassName("error-message")[0];return u&&(u.textContent=se("eventEnded")||"Game has ended",o.textContent=""),clearInterval(l),void(null==t||t())}var d=r-s;if(d/1e3<=0)return clearInterval(l),null==n||n([0,0,0,0,0,0,0,o]),void(null==t||t());var c=et(d,r);null==n||n([].concat(Ae(c),[o]))};i();var l=setInterval(i,1e3);return l}}var it=function(e,n,t){var o,i,l,r,a,s,u,d,c=null==n||null===(o=n.response)||void 0===o||null===(i=o.data)||void 0===i?void 0:i.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(r=l.data)||void 0===r?void 0:r.errorMessage)||(null==n?void 0:n.message)||null;tt.set({startDateTime:null==n||null===(a=n.response)||void 0===a||null===(s=a.data)||void 0===s?void 0:s.scheduleStartDate,endDateTime:null==n||null===(u=n.response)||void 0===u||null===(d=u.data)||void 0===d?void 0:d.scheduleEndDate}),function(e,n,t,o){var i,l,r=Date.now(),a=null===(i=tt.get())||void 0===i?void 0:i.scheduleStartTimeMs,s=null===(l=tt.get())||void 0===l?void 0:l.scheduleEndTimeMs,u=function(e,n,t,o){var i;e<0?i=se("eventNotStarted")||o||"Game starts in":(n>0||"VIDEO_NOT_EXISTS"==t)&&(i=se("eventEnded")||o||"Game has ended");return i||o}(r-a,r-s,n,t);if(document.getElementsByClassName("error-container")[0]){var d=document.getElementsByClassName("error-message")[0];d&&(d.textContent="".concat(u));var c=document.getElementsByClassName("error-timer-message")[0];c&&ot(Math.abs(a),nt,o,c)}else{var v=document.getElementById(e).parentElement;if(v){var m=document.createElement("div");m.className="error-container";var p=document.createElement("div");p.className="error-message";var f=document.createElement("div");f.className="error-timer-message",p.textContent="".concat(u),m.appendChild(p),m.appendChild(f),v.append(m),ot(Math.abs(a),nt,o,f)}}}(e,c,v,t)};function lt(e,n){var t=n.scheduleEndDate,o=n.scheduleStartDate;tt.set({startDateTime:o,endDateTime:t}),Zn&&clearInterval(Zn),Zn=setInterval(function(){var n,t=Date.now(),o=null===(n=tt.get())||void 0===n?void 0:n.scheduleEndTimeMs;if(console.log("scheduleEndTimeMs",o),o&&t>o){var i;console.log("Game ended");var l=ae(e);if(h(e)&&l){var r;l.dispose(),console.log("Player disposed");var a=null===(r=document.getElementsByClassName("vl-container"))||void 0===r?void 0:r[0],s=document.createElement("video");s.id=e,s.className="video-js",s.style.width="100%",s.style.height="100%",a&&a.appendChild(s)}var u=se("eventEnded")||"Game has ended",d=null===(i=document.getElementsByClassName("error-container"))||void 0===i?void 0:i[0];if(d){var c=d.querySelector(".error-message");c&&(c.textContent=u)}else{var v=document.getElementById(e),m=null==v?void 0:v.parentElement;if(m){(d=document.createElement("div")).className="error-container";var p=document.createElement("div");p.className="error-message",p.textContent=u,d.appendChild(p),m.append(d)}}clearInterval(Zn)}},1e3)}function rt(e,n){return at.apply(this,arguments)}function at(){return(at=G(q.mark(function e(n,t){var o,i,l,r,a,s,u,d,c;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=t.resolve,r=t.reject,a=null==n?void 0:n.videoId,s=null==n?void 0:n.playerId,u=!(null==n||!n.anonymousId),e.next=6,k();case 6:d=e.sent,c=!1===(null==n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.isSSAIEnabled),y(a,d,c).then(function(e){var t,o,i,c,v,m,p,f,g,h;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,ve(null==e?void 0:e.data);var y=null==e||null===(c=e.data)||void 0===c||null===(v=c.video)||void 0===v||null===(m=v.gist)||void 0===m?void 0:m.scheduleEndDate,w=null==e||null===(p=e.data)||void 0===p||null===(f=p.video)||void 0===f||null===(g=f.gist)||void 0===g?void 0:g.scheduleStartDate;lt(s,{scheduleEndDate:y,scheduleStartDate:w});var k,S=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(h=n.watchHistory)&&void 0!==h&&h.enable&&!u)if((null===(k=n.watchHistory)||void 0===k?void 0:k.saveOffline)||!1){var I,E,D,T=Pn((null===(I=n.watchHistory)||void 0===I?void 0:I.profileId)||"",a,null==n?void 0:n.siteOwner);if(T&&T.length)n.watchHistoryResumeTime=(null===(E=T[0])||void 0===E?void 0:E.watchedTime)||null,n.watchedPercentage=(null===(D=T[0])||void 0===D?void 0:D.watchedPercentage)||null;S.contentType="video",Wn(s,{res:S},n,{resolve:l,reject:r})}else b(a,d).then(function(e){var t,o,i,l,r,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(l=i.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,S.contentType="video"}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}).finally(function(){Wn(s,{res:S},n,{resolve:l,reject:r})});else Wn(s,{res:S},n,{resolve:l,reject:r})}).catch(function(e){var t,o,i=(null==n||null===(t=n.event)||void 0===t?void 0:t.showScheduleTimer)||!1,l=(null==n||null===(o=n.event)||void 0===o?void 0:o.onCountdownComplete)||null;i&&it(s,e,l),w(e,s,r,a)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function st(e,n){return ut.apply(this,arguments)}function ut(){return(ut=G(q.mark(function e(n,t){var o,i,l,r,a,s,u,d;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=t.resolve,r=t.reject,e.next=3,k();case 3:a=e.sent,s=null==n?void 0:n.playerId,u=null==n?void 0:n.epg,d=!1===(null==n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.isSSAIEnabled),S(u,a,d).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==u?void 0:u.channelId,Wn(s,{res:t},n,{resolve:l,reject:r})}).catch(function(e){w(e,s,r,videoId)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function dt(e,n){return ct.apply(this,arguments)}function ct(){return(ct=G(q.mark(function e(n,t){var o,i,l,r,a,s,u;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,e.next=3,k();case 3:r=e.sent,a=null==n?void 0:n.playerId,s=sessionStorage.getItem("season-idx")||0,he.set(parseInt(s)),u=null==n||null===(o=n.series)||void 0===o?void 0:o.id,I(u,r).then(function(e){var t,o,s,d=e.data,c=e.data.seasons;ye(c);var v=videoId||(null==c||null===(t=c[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(s=o[0])||void 0===s?void 0:s.id);E(u,r),y(v,r).then(function(e){var t,o,r;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType,ve(e.data),Wn(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:i,reject:l})}).catch(function(e){w(e,a,l,videoId)})}).catch(function(e){w(e,a,l)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}var vt,mt=function(e){var n=e.enable,t=e.site,o=e.sseBaseUrl,i=e.sseEndpoint;if(n){var l=function(e){var n=e.site,t=e.sseBaseUrl,o=e.sseEndpoint;return Me({site:n,sseBaseUrl:t,getToken:k,sseEndpoint:o,onOpen:function(e){var n=e.userId,t=e.endpoint;console.log("SSE Connected:",n,t)},onMessage:function(e){var n,t,o,i,l,r,a,s,u;if(console.log("SSE Message:",e),(null===(n=ce())||void 0===n||null===(t=n.video)||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.id)===(null==e?void 0:e.id)&&"GAME_STATE_CHANGE"===(null==e?void 0:e.notificationType)){var d=1e3*(null==e||null===(i=e.payload)||void 0===i||null===(l=i.states)||void 0===l||null===(r=l.live)||void 0===r?void 0:r.startDateTime),c=1e3*(null==e||null===(a=e.payload)||void 0===a||null===(s=a.states)||void 0===s||null===(u=s.end)||void 0===u?void 0:u.endDateTime);d&&c&&(console.log("Setting schedule timer",d,c),tt.set({startDateTime:d,endDateTime:c}))}},onReconnectAttempt:function(e){console.log("Reconnect attempt:",e)},onHeartbeatTimeout:function(e){var n=e.elapsed;console.warn("Heartbeat timeout after:",n)},onTokenInvalid:function(e){console.error("Invalid token:",e),window.location.href="/login"},onError:function(e,n){console.error("SSE Error:",e,n)},onClose:function(){console.log("SSE Closed")}})}({site:t,sseBaseUrl:o,sseEndpoint:i});return l._sseBaseUrl=o,l._site=t,l._sseEndpoint=i,l}};function pt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function ft(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?pt(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pt(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function gt(){return{loadVideoInstantly:D,onTimeUpdate:J,getVideoDuration:W,onVideoEnded:Y,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=G(q.mark(function n(t,o){var i,l,r,a,s,u,d,c,v,m,p,f,g,b,k,S,I,E,D,T,O,j,C,P,x,N,A,R,M,L;return q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!h(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(I=(null==e?void 0:e.videoSourceUrl)||!1,E=null==e?void 0:e.asat,D=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,T=null==e?void 0:e.videoId,O=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,j=(null==e?void 0:e.streamingInfo)||!1,window.videoId=T,C=null==e?void 0:e.token,!B(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",C),V().set(null==e?void 0:e.refreshToken),C&&!U(C)){n.next=16;break}return o({status:!1,msg:"".concat(C?"Token is expired !":"Missing Authorization Token"),response:{token:C}}),n.abrupt("return");case 16:vt=JSON.parse(atob(C.split(".")[1]));case 17:return window.siteName=null===(r=vt)||void 0===r?void 0:r.site,window.siteId=null===(a=vt)||void 0===a?void 0:a.siteId,e.isAnonymousUser=!(null===(s=vt)||void 0===s||!s.anonymousId),e.siteOwner=(null===(u=vt)||void 0===u?void 0:u.site)||null,e.userId=(null===(d=vt)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(c=vt)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,P=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(v=e.series)&&void 0!==v&&v.enable?null:null==e?void 0:e.chromecastReceiverId,x=(null==e||null===(m=e.analytics)||void 0===m?void 0:m.gaId)||null,(N=null==e?void 0:e.errors)&&(window.customErrors=N),window.customData=null==e?void 0:e.customData,ue(null==e||null===(p=e.customData)||void 0===p?void 0:p.localisation),_.set(e.apiBaseUrl),null!=e&&e.skin&&!re(e.skin)||(e.skin="VL_ONE"),n.next=35,ze(e);case 35:x&&Le("https://www.googletagmanager.com/gtag/js?id=".concat(x)).then(function(){return H(x)}).catch(function(e){}),(A=null===(f=document)||void 0===f?void 0:f.getElementById("".concat(P)))&&A.addEventListener("contextmenu",function(e){return e.preventDefault()}),(R=mt({enable:null==e||null===(g=e.sse)||void 0===g?void 0:g.enable,site:null==e||null===(b=e.sse)||void 0===b?void 0:b.siteName,sseBaseUrl:null==e||null===(k=e.sse)||void 0===k?void 0:k.sseBaseUrl,sseEndpoint:null==e||null===(S=e.sse)||void 0===S?void 0:S.sseEndpoint}))&&!R.isConnectionActive()&&R.connect(),I?(L={directPlaybackUrl:I,id:M="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},E?y(M,C).then(function(n){var i=(null==n?void 0:n.data)||{};Wn(P,{res:ft(ft({},i),L)},e,{resolve:t,reject:o})}).catch(function(e){w(e,P,o,M)}):Wn(P,{res:L},e,{resolve:t,reject:o})):j?Qn(e,{resolve:t,reject:o}):O?dt(e,{resolve:t,reject:o}):D?st(e,{resolve:t,reject:o}):rt(e,{resolve:t,reject:o});case 41:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:oe,skip:T,getPlayer:ae,play:O,pause:j,detectBrowser:e,rewind:C,loadVideo:a,seekToTimeStamp:z,isPlayerInitialised:h,load:P,authenticateLC:x,dispose:N,enableCaptions:te,disableCaptions:ee,getCaptions:Z,playSelectedResolution:ie,getSource:r,setVolume:Be,getVolume:Ve,disableControls:c,setPlaybackSpeed:X,getEntitlementData:A,adsQueuePointManager:R,getSsaiEvents:M,playerEvents:Q,onReplay:$,isBehindLive:L}}export{gt as V,Vn as i,Hn as r};
|