@viewlift/player-backup 2.0.105-backup → 2.0.107-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/esm/bundle.css CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
 
5
5
 
6
+
6
7
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
7
8
  height: 0.7em;
8
9
  position: absolute;
@@ -186,7 +187,6 @@
186
187
  font-weight: bold
187
188
  }
188
189
 
189
-
190
190
  /* CSS for videojs-dvr-seekbar */
191
191
 
192
192
  .video-js.vjs-dvr-seekbar {
@@ -361,8 +361,6 @@
361
361
 
362
362
 
363
363
 
364
-
365
-
366
364
  .video-js .multicamera-parent.default{
367
365
  height: 345px;
368
366
  position: absolute;
@@ -443,6 +441,8 @@
443
441
 
444
442
 
445
443
 
444
+
445
+
446
446
  /* nextep */
447
447
  .next-ep-preview{
448
448
  position: absolute;
@@ -518,6 +518,38 @@
518
518
  margin-left: 8px;
519
519
  }
520
520
  }
521
+ /* a wrapper element that tracks the mouse vertically */
522
+ .vjs-thumbnail-holder {
523
+ position: absolute;
524
+ left: -1000px;
525
+ }
526
+
527
+ /* the thumbnail image itself */
528
+ .vjs-thumbnail {
529
+ position: absolute;
530
+ left: 0;
531
+ bottom: 1.3em;
532
+ opacity: 0;
533
+ transition: opacity .2s ease;
534
+ -webkit-transition: opacity .2s ease;
535
+ -moz-transition: opacity .2s ease;
536
+ -mz-transition: opacity .2s ease;
537
+ }
538
+
539
+ /* fade in the thumbnail when hovering over the progress bar */
540
+ /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
541
+ .vjs-progress-control:hover .vjs-thumbnail,
542
+ .vjs-progress-control.fake-active .vjs-thumbnail,
543
+ .vjs-progress-control:active .vjs-thumbnail {
544
+ opacity: 1;
545
+ }
546
+
547
+ /* ... but hide the thumbnail when hovering directly over it */
548
+ .vjs-progress-control:hover .vjs-thumbnail:hover,
549
+ .vjs-progress-control:active .vjs-thumbnail:active {
550
+ opacity: 0;
551
+ }
552
+
521
553
  .video-js.vjs-quality-menu {
522
554
  display: block;
523
555
  }
@@ -588,38 +620,6 @@
588
620
  -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
589
621
  animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
590
622
  }
591
- /* a wrapper element that tracks the mouse vertically */
592
- .vjs-thumbnail-holder {
593
- position: absolute;
594
- left: -1000px;
595
- }
596
-
597
- /* the thumbnail image itself */
598
- .vjs-thumbnail {
599
- position: absolute;
600
- left: 0;
601
- bottom: 1.3em;
602
- opacity: 0;
603
- transition: opacity .2s ease;
604
- -webkit-transition: opacity .2s ease;
605
- -moz-transition: opacity .2s ease;
606
- -mz-transition: opacity .2s ease;
607
- }
608
-
609
- /* fade in the thumbnail when hovering over the progress bar */
610
- /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
611
- .vjs-progress-control:hover .vjs-thumbnail,
612
- .vjs-progress-control.fake-active .vjs-thumbnail,
613
- .vjs-progress-control:active .vjs-thumbnail {
614
- opacity: 1;
615
- }
616
-
617
- /* ... but hide the thumbnail when hovering directly over it */
618
- .vjs-progress-control:hover .vjs-thumbnail:hover,
619
- .vjs-progress-control:active .vjs-thumbnail:active {
620
- opacity: 0;
621
- }
622
-
623
623
  .vjs-poster {
624
624
  display: inline-block;
625
625
  vertical-align: middle;
@@ -1 +1 @@
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{r as a,k as s}from"./generic-76d748e7.js";import{g as c}from"./renditions-6323832e.js";import{g as d,p as u}from"./skin-58b9263c.js";import{g as p}from"./localisation-0bf399a1.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=p("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=u(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=u(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-fcace655.js").then(function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=d(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-df6e9d73.js").then(function(r){var o=r.default,l=d(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-ac83a128.js").then(function(r){var o=r.seriesModule,l=d(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-1e40c9c3.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},S=function(e,t){import("./caption-settings-8804cef9.js").then(function(n){var r,o,l,a,s=n.default,c=d(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)})},E=function(e,t){import("./settings-icon-eb8e680a.js").then(function(n){var r,o,l,a,s=n.default,c=d(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)})},O=function(e,t){import("./playlist-30ca3b74.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)})},w=function(e,t){import("./series-v2-7765e849.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},I=function(e,t){import("./multicamv2-93b415f6.js").then(function(n){var r=n.default,o=d(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=d(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=d(e).el(),n=0,r=d(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},L=function(e,t){import("./videoSelector-994c8adf.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},N=function(e,t){import("./series-v2-eb8252bd.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},_=function(e,t){import("./multicamv2-a5915be0.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})};export{B as a,j as b,b as c,y as d,C as e,E as f,S as g,M as h,g as i,L as j,_ as k,O as l,N as m,P as n,k as o,w as p,I as q};
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{r as a,k as s}from"./generic-76d748e7.js";import{g as c}from"./renditions-6323832e.js";import{g as d,p as u}from"./skin-58b9263c.js";import{g as p}from"./localisation-0bf399a1.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=p("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=u(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=u(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-fcace655.js").then(function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=d(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-df6e9d73.js").then(function(r){var o=r.default,l=d(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-ac83a128.js").then(function(r){var o=r.seriesModule,l=d(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-1e40c9c3.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},S=function(e,t){import("./caption-settings-8804cef9.js").then(function(n){var r,o,l,a,s=n.default,c=d(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)})},E=function(e,t){import("./settings-icon-eb8e680a.js").then(function(n){var r,o,l,a,s=n.default,c=d(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)})},O=function(e,t){import("./playlist-30ca3b74.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)})},w=function(e,t){import("./series-v2-ee6d5ae4.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},I=function(e,t){import("./multicamv2-93b415f6.js").then(function(n){var r=n.default,o=d(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=d(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=d(e).el(),n=0,r=d(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},L=function(e,t){import("./videoSelector-994c8adf.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},N=function(e,t){import("./series-v2-eb8252bd.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},_=function(e,t){import("./multicamv2-a5915be0.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})};export{B as a,j as b,b as c,y as d,C as e,E as f,S as g,M as h,g as i,L as j,_ as k,O as l,N as m,P as n,k as o,w as p,I as q};
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import{g as e,a as n,b as t,c as o,d as r,s as i,e as l,l as a,f as s,h as u,i as c,j as d,k as v,r as f,m as p,n as m,o as y,p as g,q as h,t as b,u as w,v as k,w as S,x as O,y as j,z as T,A as I,B as P,C as E,D,E as A,F as x,G as C,H as R,I as L,J as N,K as M,L as _,M as V,N as U,O as B,P as H}from"./generic-76d748e7.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 q,g as z,a as J,s as W,b as X}from"./util-80257541.js";import{g as Y,d as $,a as Z,e as ee}from"./captions-b7fd8308.js";import{g as ne}from"./renditions-6323832e.js";import{playSelectedResolution as te}from"./resolution-fcace655.js";import{g as oe,t as re,i as ie,a as le}from"./skin-58b9263c.js";import{d as ae}from"./browser-d4613b36.js";import{s as se}from"./localisation-0bf399a1.js";import ue from"@babel/runtime/helpers/typeof";import ce from"@babel/runtime/helpers/toConsumableArray";import de from"@babel/runtime/helpers/slicedToArray";var ve=function(e){return new Promise(function(n,t){if(fe(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)}})},fe=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},pe=function(e,n,t){var o=oe(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var r=parseFloat(n)/100;o.volume(r),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,"'")})},me=function(e){var n=oe(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},ye=function(){var e=G(Q.mark(function e(n){var t,o,r,i,l;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=oe(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return i=e.sent,e.prev=5,e.next=8,ve("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,i.default(K),e.finish(13);case 16:(l=K.getTech("chromecast"))&&!l.prototype.seeking&&(l.prototype.seeking=function(){}),null!==(r=window)&&void 0!==r&&r.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.airplay&&"Safari"==ae()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),ge=function(e,n){var t=oe(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,r,i,l,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,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(i=r.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}})};var he=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"),ve("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)}}(),be=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)}}(),we=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)}}(),ke=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)}}(),Se=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-6c1ba1fe.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)}}(),Oe=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){ve("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:he,loadEMELibrary:be,loadMuxPlugin:we,loadDvrSeekbar:ke,loadContribDash:Se});function je(e){return Te.apply(this,arguments)}function Te(){return(Te=G(Q.mark(function e(n){var t;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,he();case 3:t&&"Safari"==ae()&&Promise.resolve().then(function(){return Oe}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ie(e,n){return Pe.apply(this,arguments)}function Pe(){return(Pe=G(Q.mark(function e(n,t){var o,r,i,l,a,s,u,c,d,v;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u=(null==t?void 0:t.contentType)||"video",c=null==t||null===(o=t[u])||void 0===o?void 0:o.drmEnabled,null==t||null===(r=t[u])||void 0===r||null===(i=r.liveDetails)||void 0===i||i.isDvrEnabled,null==n||n.showPositiveSeekbar,d=(null==t||null===(l=t[u])||void 0===l||null===(a=l.streamingInfo)||void 0===a||null===(s=a.videoAssets)||void 0===s?void 0:s.dash)||null,e.prev=5,e.next=8,Promise.allSettled([c?"Safari"==ae()?be():"caliente"!=(null===(v=window)||void 0===v?void 0:v.siteName)?Se():be():"Safari"!=ae()&&d?Se():null,ye(n)]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}},e,null,[[5,10]])}))).apply(this,arguments)}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 De(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ee(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ee(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ae=new Set,xe=null,Ce=function(n,o,r){var i,l,a,s,u,c,d,v={},f=(null==n?void 0:n.contentType)||"video";v["c3.cm.id"]=(null===(i=n[f])||void 0===i?void 0:i.id)||"Null",v["c3.cm.contentType"]=Ue(n),v[null==r||null===(l=r.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),v[null==r||null===(a=r.Constants)||void 0===a?void 0:a.STREAM_URL]=o.currentSrc(),v[null==r||null===(s=r.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===e()?"NULL":e(),v["c3.cm.categoryType"]=Me(n),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=n[f])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(c=n[f])&&void 0!==c&&null!==(d=c.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[r.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=_e(n),v["c3.cm.genreList"]=Le(n),v["c3.cm.genre"]=Re(n),v["c3.cm.channel"]=Ne(n);var p=He(t(),n);return v=De(De({},v),p)},Re=function(e){var n,t,o,r=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[r])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},Le=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"},Ne=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},Me=function(e){return(null==e?void 0:e.contentType)||"null"},_e=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return r?"YES":"NO"},Ve=function(e,n){var t,o,r=(n||{}).epg;if(r&&null!=r&&r.enable&&null!=r&&r.programTitle)return r.programTitle;var i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[i])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},Ue=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Be,He=function(e,t){var r,i,l,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!t||null!=t&&t.linearchannel)return u;var c=o(),d=n();return u["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(i=r.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(l=e[c-1])||void 0===l||null===(a=l.episodes)||void 0===a||null===(s=a[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},Fe=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"}},Ge=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Qe=function(){var e=G(Q.mark(function e(n,t){var o,i,l,a,s,u,c,d,v,f;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,a=o.tveProvider,s=o.enable,u=o.appName,c=(t||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(d=oe(n),"function"==typeof(v=i)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(f=e.sent){e.next=13;break}return e.abrupt("return");case 13:d.ready(function(){var e=d.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=Fe(t.keySystem);v("contentInfo",{DRMEnabled:o})}else v("contentInfo",{DRMEnabled:"None"})}),n||v("contentInfo",{DRMEnabled:"None"})}),d.on("loadstart",function(){var e,n;xe&&xe!==d.currentSrc()&&v("playbackEnded"),v("setPlayer",d),Ae.clear(),xe=d.currentSrc();var o=Ge(d.currentType()),i=r(),s=Ce(i,d,f);s[null==f||null===(e=f.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",s[null==f||null===(n=f.Constants)||void 0===n?void 0:n.ASSET_NAME]=Ve(i,t),s.authToken=c||"NULL",s.streamType=o,s.D2CType=l||"NONE",s.subscriberType=a||(l?"D2C":"FREE"),s["c3.cm.affiliate"]=a||"NULL",v("contentInfo",s)}),d.on("loadedmetadata",function(){var e,n=d.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})}),d.on("play",function(){Ae.has(d.currentSrc())||(Ae.add(d.currentSrc()),v("playbackStarted",null))}),d.on("ended",function(){Ae.has(d.currentSrc())&&Ae.delete(d.currentSrc()),v("playbackEnded")}),d.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:d,adsLoader:null==e?void 0:e.adsLoader})}),d.on("dispose",function(){null==Ae||Ae.clear(),v("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Ke=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-d84d3645.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-b121228d.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-9785e13d.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-3c20c768.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-66fc3448.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t&&import("./skin-ecfbfb99.js").then(function(t){t.initialiseSkin(e,n)})};function qe(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 ze(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?qe(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qe(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Je=[],We=0,Xe=null;function Ye(e,n,t){var o,l,a,s,u,c=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===(l=n.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(e.currentTime()),f=Math.floor(e.duration());null==n||null===(a=n.watchHistory)||void 0===a||a.xapiKey;var p=(null==n||null===(s=n.video)||void 0===s?void 0:s.originalObjectId)||null,m=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,y=Math.floor(e.currentTime()),g=c?100:Math.floor(v/f*100),h={};m?function(e,n,t){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),i=$e(o),l=(new Date).getTime(),a=r(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return ze(ze({},e),{},F({},n,s[n]))},{}),c=i.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===Be});c<0?i.push(ze(ze({content:u},e),{},{addedDate:l,updateDate:l})):i[c]=ze(ze(ze({},i[c]),e),{},{updateDate:l});localStorage.setItem("".concat(o),JSON.stringify(i))}(h={completed:c,watchedTime:y,watchedPercentage:g},d,n.siteOwner):(h=ze(ze({videoId:Be,watchedTime:y,watchedPercentage:g,doneWatching:c,profileId:d},Xe&&{seriesId:Xe}),p&&{originalObjectId:p}),i(h).then(function(e){}).catch(function(e){})),We=v+t}function $e(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Ze(e,n,t){var o=$e(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),r=[];return o&&Array.isArray(o)&&(r=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),r}var en=!1,nn=function(e,n){var t,o,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[r])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!en){var i=tn(e,"videoAssets","secondaryVideoAssets"),s=l(i,n);return s&&a(n,s),en=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function tn(e,n,t){if(Array.isArray(e))return e.map(function(e){return tn(e,n,t)});if(null!==e&&"object"===ue(e)){var o={};return Object.keys(e).forEach(function(r){r===n&&void 0!==e[t]?o[r]=e[t]:r===t&&void 0!==e[n]?o[r]=e[n]:o[r]=tn(e[r],n,t)}),o}return e}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,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function 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}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 an(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 sn=function(e,n,t,o){var i,l,a,v,f=o.res,p=o.sres,m=oe(e),y=(null==f?void 0:f.contentType)||"video",g=(null==f?void 0:f[y].drmEnabled)||!1,h=(null==f||null===(i=f[y])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1,b=(null==f||null===(a=f[y])||void 0===a||null===(v=a.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1;s(f),m&&(m.on("loadstart",function(){h?t.resolve({status:!0,msg:"Video Loaded",response:f}):t.resolve(an({status:!0,msg:"Player Initialised"},p?{seriesResponse:p,response:f}:{response:f}))}),m.on("loadeddata",function(){var t,o,i,l=Y(e);if(null==l||l.map(function(n){return $(e,n.id)}),b&&"Safari"===ae())try{var a;null==m||null===(a=m.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&pe(e,sessionStorage.getItem("volume")||"100");var s=r();if(u(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(o=n.watchHistory)&&void 0!==o&&o.saveOffline)){var c,d,v=an(an({},n),f);!function(e,n,t){var o,r,i;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(Xe=null==n||null===(r=n.series)||void 0===r?void 0:r.id),Je=[],We=0,Be=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=oe(e);a&&(a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());Je.includes(We)||(e==We?(Je.push(e),Ye(a,n,l)):e>We&&(We=e+l))}}),a.one("ended",function(){Ye(a,n,l,!0)}))}(e,v,null==s||null===(c=s.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.id)}if(null!=n&&null!==(i=n.analytics)&&void 0!==i&&i.muxKey&&null!=m&&m.mux){var p,y,g,h,w,k,S=(null===(p=r())||void 0===p?void 0:p.video)||(null==f?void 0:f.video),O=null==S?void 0:S.gist,j={env_key:null==n||null===(y=n.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(g=window)||void 0===g?void 0:g.vl_player_version,video_id:null==O?void 0:O.id,video_title:null==O?void 0:O.title,video_series:null==S||null===(h=S.series)||void 0===h?void 0:h.title,video_stream_type:null!=S&&null!==(w=S.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==n||null===(k=n.analytics)||void 0===k?void 0:k.userId};m.mux({debug:!1,data:j})}}),m.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];m.trigger("subtitlechanged",n)}),m.on("subtitlechanged",function(e,n){var t,o,r,i,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(i=r.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===f){var m,y=p.getMediaSession(),g=y.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}}),m.tech_.on("retryplaylist",function(){h&&nn(f,e)}),m.on("error",function(){var n,o;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?nn(f,e):(c(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==m||null===(o=m.error())||void 0===o?void 0:o.message)||"Some error occured",response:f}))}),m.one("play",function(){var e,t,o,i,l;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(o=t.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable){var a,s,u,c=null===(a=r())||void 0===a||null===(s=a.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.id,v=d(),f=(null==v?void 0:v.get(c))||{t:0,p:0},p=f.t,y=f.p;p&&y<95&&setTimeout(function(){m.currentTime(p)},0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout(function(){m.currentTime(null==n?void 0:n.watchHistoryResumeTime)},0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),m.on("volumechange",function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),m.on("chromecastDisconnected",function(){if(h){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}}),m.one("loadeddata",function(){var e,n=(null==m||null===(e=m.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if("object"==ue(m.dash)){var t,o,r,i=null==m||null===(t=m.dash)||void 0===t||null===(o=t.mediaPlayer)||void 0===o?void 0:o.getTracksFor("audio"),l=null==i?void 0:i.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=on(n);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(l&&(null==s?void 0:s.id)=="dash-audio-".concat(l.index)){s.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var u,c=on(n);try{for(c.s();!(u=c.n()).done;){var d,v,f,p=u.value;("Chrome"==ae()||"Edge"==ae()&&(null!==(d=navigator)&&void 0!==d&&null!==(v=d.userAgent)&&void 0!==v&&v.includes("Macintosh")||!g))&&null!=p&&null!==(f=p.label)&&void 0!==f&&f.includes("5.1")?m.audioTracks().removeTrack(p):"main"==p.kind?p.enabled=!0:p.enabled=!1}}catch(e){c.e(e)}finally{c.f()}}}))};function un(e,n){var t,o,r,i=oe(e),l=null==i||null===(t=i.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,a=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var o,r,s,u,c,d,p,m,y;if(dn.enabled&&"input"!=t.target.localName){var g=t.key,h=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(g)&&(t.preventDefault(),null==a||a.focus()),g){case" ":null==l||l.click();break;case"m":case"M":i.muted(!i.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":h&&!1===n.liveui||f(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(s=r.app_data)||void 0===s||null===(u=s.appcmsMain)||void 0===u||null===(c=u.adsConfig)||void 0===c?void 0:c.vodAdSticherProvider)&&null!==(d=window)&&void 0!==d&&null!==(p=d.app_data)&&void 0!==p&&null!==(m=p.appcmsMain)&&void 0!==m&&null!==(y=m.adsConfig)&&void 0!==y&&y.vodAdClientSideTracking)return;h||v(e,10)}}},!0)}var cn,dn=(cn=!0,{enable:function(){cn=!0},disable:function(){cn=!1},get enabled(){return cn}});function vn(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 fn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?vn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):vn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function pn(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,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function 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}var yn,gn,hn=(yn="",{set:function(e){e&&(yn=e)},get:function(){return yn}}),bn=(gn=null,{set:function(e){gn=e},get position(){return gn}});function wn(e,n){return kn.apply(this,arguments)}function kn(){return(kn=G(Q.mark(function e(n,t){var o,r,i,a,s,u,c,d,v,f,m,y,g,h;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return oe(n),o=l(t,n),r=o.src,i=r.replace("/dash/","/session/").replace("master","session"),i=p(i,n,t),a=Sn(i),s=de(a,2),u=s[0],c=s[1],i=new URL(i.split("?")[0]),Object.keys(c).length>0&&Object.entries(c).forEach(function(e){var n=de(e,2),t=n[0],o=n[1];i.searchParams.set(t,o)}),e.prev=8,e.next=11,fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:fn({},u)})});case 11:return d=e.sent,e.next=14,d.json();case 14:return v=e.sent,f="https://"+new URL(i).hostname,m=v.trackingUrl,y=v.manifestUrl,g=f+m,h=f+y,hn.set(g),console.log("%c TRACKING URL","background: #bdf369; color: #000",g),o.src=h,e.abrupt("return",o);case 26:return e.prev=26,e.t0=e.catch(8),e.abrupt("return",o);case 29:case"end":return e.stop()}},e,null,[[8,26]])}))).apply(this,arguments)}function Sn(e){var n={},t=e.split("?")[1];if(!t)return[{},{}];var o,r=pn(t.split("&"));try{for(r.s();!(o=r.n()).done;){var i=o.value.split("="),l=de(i,2),a=l[0],s=l[1];n[decodeURIComponent(a)]=decodeURIComponent(s||"")}}catch(e){r.e(e)}finally{r.f()}for(var u={},c={},d=0,v=Object.entries(n);d<v.length;d++){var f=de(v[d],2),p=f[0],m=f[1];if(p.startsWith("ads."))u[p.replace(/^ads\./,"")]=m;else c[p]=m}return[u,c]}var On,jn=(On=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),On=Array.isArray(e)?ce(e):On},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",On),ce(On)}});function Tn(e,n){return In.apply(this,arguments)}function In(){return In=G(Q.mark(function e(n,t){var o,r,i,l,a,s,u,c,d,f,p,m,y,g,h,b,w;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:w=function(e,t,o,r,i,l){var a=oe(n);if(!a.seeking()){t.startTimeInSeconds,t.durationInSeconds,Math.floor(a.currentTime());var s,u=pn(o);try{var c=function(){var n,o,u,c=s.value,d=c.eventType,v=c.beaconUrls,f=c.startTimeInSeconds,p=c.startTime,m=c.durationInSeconds,y=f||0,g=v,w=(null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o||null===(u=o.ads)||void 0===u?void 0:u.adEventHandler)||null,k="".concat(y,"_").concat(d),S=h.get("pod-".concat(i))||[];if(console.warn(e,y,"map:",d,"condition1:",e>=y,"map:",h),e>=y&&!S.includes(k)){S.push(k),h.set("pod-".concat(i),S);try{b(d,t,g,a)}catch(e){console.error("Error when calling triggerAdBeacon:",e,d,t)}if("breakEnd"==d){var O=bn.position;bn.set(null),setTimeout(function(){null!=O&&(a.currentTime(O),l())},500)}if("function"==typeof w)try{var j;w({adsData:{eventType:d,startTimeInSeconds:f,startTime:p,durationInSeconds:m,ad:null==t||null===(j=t.ads)||void 0===j?void 0:j[r],adIndex:r}})}catch(e){console.error("Error when calling ads callback:",e)}}};for(u.s();!(s=u.n()).done;)c()}catch(e){u.e(e)}finally{u.f()}}},b=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)})})},g=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},bn.set(t),a=hn.get(),(s=oe(n)).one("loadeddata",function(){a&&y(a)}),u=new Map,c=new Map,d=-1,f=(null===(o=document)||void 0===o||null===(r=o.getElementsByClassName("tvProviderImage"))||void 0===r?void 0:r[0])||null,p=(null==s||null===(i=s.controlBar)||void 0===i?void 0:i.getChild("videoSelector"))||null,m=(null==s||null===(l=s.controlBar)||void 0===l?void 0:l.getChild("seriesV2"))||null,y=function(){var e=G(Q.mark(function e(o){var r,i,l,a,s,y,h,b,k,S,O,j,T,I,P,E,D;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return T=function(e){document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",T),0===e.button&&S()},j=function(e){},O=function(){var e,n=h.currentTime(),t=null,o=pn(y);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=(r.ads,Math.floor(i+l));n>=i&&n<=a&&(t=a,u.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){h.currentTime(t+2.2)},100))},S=function(){var e,n=h.currentTime(),t=null,o=pn(y);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=r.ads,s=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>s||n>i)&&!u.has(i)||n>=i&&n<=s)&&(t=i,u.set(i,!0),c.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){h.currentTime(t+.4)},100))},i=!1,e.next=7,fetch(o);case 7:return l=e.sent,e.next=10,l.json();case 10:a=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",a),s=a.avails,y=[],h=oe(n),b=h.controlBar.progressControl,k=b.seekBar.el(),s.map(function(e,n){var t,o,r;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(i=!0),y.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:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(r=o.filter(function(e){return"breakStart"==(null==e?void 0:e.eventType)}))||void 0===r?void 0:r[0])||[]})}),!i&&t&&(h.currentTime(t),O()),null!=y&&y.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",y),jn.setQueuePoints(y),window.adsQueueList=y),y.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=h.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",k.appendChild(i)}}),h.on("timeupdate",re(function(){var e=h.currentTime();if(e!==d){d=e;for(var n=!1,t=function(){var t=y[o],r=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,a=r+i;if(e>=r-1.2&&e<=a+1.2){e>=r&&!c.has(r)&&!h.seeking()&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&"Safari"==ae()&&0!=r&&(console.log("jfc"),h.currentTime(0),setTimeout(function(){h.currentTime(r+.4)},500),c.set(r,!0)),e>=r&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&u.set(r,!0),dn.disable(),f&&f.classList.add("vjs-hidden"),p&&(p.el().style.pointerEvents="none",p.el().classList.add("vjs-hidden")),m&&(m.el().style.pointerEvents="none",m.el().classList.add("vjs-hidden")),b.el().style.visibility="hidden";for(var s=e-r,d=0,v=0,k=0;k<l.length;k++){var S,j=null==l||null===(S=l[k])||void 0===S?void 0:S.durationInSeconds;if(s<d+j){v=k;break}d+=j}var T=l[v],P=s-d,E=Math.max(0,(null==T?void 0:T.durationInSeconds)-P),A=Math.round(E);I.style.display="block",D.textContent="".concat(v+1," of ").concat(l.length," • ").concat(g(A));var x=[];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)});x.push.apply(x,ce(n))}),Array.isArray(l)&&0==(null==l?void 0:l.length)&&x.push(null==t?void 0:t.podSlotImpressionBeacon),w(e,t,x,v,o,O),"break"}c.delete(r)},o=0;o<y.length;o++){if("break"===t())break}n||(I.style.display="none",b.el().style.visibility="visible",p&&(p.el().style.pointerEvents="auto",p.el().classList.remove("vjs-hidden")),m&&(m.el().style.pointerEvents="auto",m.el().classList.remove("vjs-hidden")),f&&f.classList.remove("vjs-hidden"),dn.enable())}},1e3)),null===(r=document)||void 0===r||r.addEventListener("keydown",function(e){dn.enabled&&"ArrowRight"==e.key&&(S(),v(n,10),e.stopPropagation())}),b.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",j),document.addEventListener("pointerup",T))}),(I=document.createElement("div")).className="ssai-ad-container",(P=document.createElement("div")).className="sponsored-adbox",(E=document.createElement("div")).className="sponsored-text",E.textContent="Sponsored Ad",P.append(E),(D=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",I.append(P),I.append(D),h.el().appendChild(I);case 40:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),h=new Map;case 16:case"end":return e.stop()}},e)})),In.apply(this,arguments)}function Pn(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 En(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Pn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Pn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Dn=function(e,n,t,o){var r,i,s,u,d,v,f,p,b,w,k,S,O,j,T,I,P,E,D,A,x,C,R,L,N,M,_,V,U,B,H,q,z,J,W,X=n.res,Y=void 0===X?null:X,$=n.sres,ee=void 0===$?null:$,ne=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(r=Y)||void 0===r?void 0:r.contentType)||"video",re=ie(null===(i=Y)||void 0===i||null===(s=i[te])||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl)||ie(null===(d=Y)||void 0===d||null===(v=d[te])||void 0===v||null===(f=v.gist)||void 0===f||null===(p=f.imageGist)||void 0===p?void 0:p.r16x9),le=(null===(b=Y)||void 0===b||null===(w=b[te])||void 0===w||null===(k=w.liveDetails)||void 0===k?void 0:k.isDvrEnabled)||!1,se=(null===(S=Y)||void 0===S||null===(O=S[te])||void 0===O||null===(j=O.streamingInfo)||void 0===j?void 0:j.isLiveStream)||!1,ue=(null===(T=Y)||void 0===T||null===(I=T.ads)||void 0===I||null===(P=I.preRoll)||void 0===P||null===(E=P.adTags)||void 0===E||null===(D=E.web)||void 0===D?void 0:D.active)&&(null===(A=Y)||void 0===A||null===(x=A.ads)||void 0===x||null===(C=x.preRoll)||void 0===C||null===(R=C.adTags)||void 0===R||null===(L=R.web)||void 0===L?void 0:L.url);Y=En(En({},Y),{},{audioAssetSource:null==t?void 0:t.audioAssetSource});var ce="MEDIA_TAILOR"==(null===(N=window)||void 0===N||null===(M=N.app_data)||void 0===M||null===(_=M.appcmsMain)||void 0===_||null===(V=_.adsConfig)||void 0===V?void 0:V.vodAdSticherProvider)||!1,de=(null==t?void 0:t.latency)||6,ve=(W={enableSmoothSeeking:!0,controls:0!=(null==t?void 0:t.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==t?void 0:t.muted)||!1,autoplay:(null==t?void 0:t.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==t.skin,liveui:le},F(W,"autoplay",null==t?void 0:t.autoplay),F(W,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!ue),F(W,"loop",(null==t?void 0:t.loop)||!1),F(W,"audioPosterMode",null==t?void 0:t.audioPosterMode),F(W,"html5",En(En({dash:En(En(En({},!K.browser.IS_SAFARI&&{useTTML:!0}),(null==t?void 0:t.debugConfig)&&(null==t||null===(U=t.debugConfig)||void 0===U?void 0:U.enable)&&{debug:!0,logLevel:null!=t&&null!==(B=t.debugConfig)&&void 0!==B&&B.logLevel?null==t||null===(H=t.debugConfig)||void 0===H?void 0:H.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:de},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:En(En({liveRangeSafeTimeDelta:de,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==t||null===(q=t.customData)||void 0===q?void 0:q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0}),debug:!0,nativeTextTracks:"Safari"==ae()},0==(null==t||null===(z=t.customData)||void 0===z?void 0:z.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===(J=t.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),F(W,"poster",re),F(W,"techOrder",ne),F(W,"chromecast",{requestCustomDataFn:function(n){var t=oe(e),o=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind});return function(e,n,t){var o,r,i,l,a,s,u,c,d,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,y,g,h,b,w,k,S;p.isDrmEnabled=!0;var O=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,j=(null==O?void 0:O.url)||(null==n||null===(y=n.keySystemOptions)||void 0===y||null===(g=y[0])||void 0===g||null===(h=g.options)||void 0===h?void 0:h.serverURL);p.licenseUrl=j;var T=(null==O?void 0:O.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=T}var I=(null==e||null===(o=e[f])||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType)||"VIDEO";p.contentType=I;var P=null==e||null===(i=e[f])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;p.duration=P;var E=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=E;var D=null==e||null===(u=e[f])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=D,p.subTitles=t,p.DVR=(null==e||null===(d=e[f])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(Y,n,o)},modifyLoadRequestFn:function(n){var t,o,r,i,l,a=oe(e),s=(null==a?void 0:a.currentSource())||{};!(null===(t=Y)||void 0===t||null===(o=t[te])||void 0===o||null===(r=o.streamingInfo)||void 0===r||null===(i=r.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(l=s.src)&&void 0!==l&&l.includes(".m3u8")&&(n.media.hlsSegmentFormat="fmp4",n.media.hlsVideoSegmentFormat="fmp4");return n}}),W);if(!K.getPlayers()[e]){K.log.level("debug");var fe=K(e,ve,function(){var n=G(Q.mark(function n(){var r,i,s,u,d,v,f,p,b,w,k,S,O,j,T,I,P,E,D,A;return Q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(fe),console.log(K.VERSION),console.log(K.getPlugins()),n.next=5,Ie(t,Y);case 5:if(S=null===(r=Y)||void 0===r||null===(i=r[te])||void 0===i||null===(s=i.liveDetails)||void 0===s?void 0:s.startOverTime,se&&o.resolve(En({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Y}:{response:Y})),y(e,null==t?void 0:t.analyticsCb),Qe(e,t),/Android/i.test(navigator.userAgent)&&(K.options.vhs.overrideNative=!0),le&&ge(e,S),!ue||null!=t&&null!==(u=t.customData)&&void 0!==u&&u.disableAds||g(e,ue,Y),O=l(Y,e),console.log(O),null!=t&&t.nearestClusterUrl&&(O=h(O,t.nearestClusterUrl)),!ce){n.next=19;break}return n.next=18,wn(e,Y);case 18:O=n.sent;case 19:O?a(e,O):(o.reject({status:!1,msg:"Incompatible / Missing Source",response:Y}),c(e,"Incompatible / Missing Source")),((null===(d=Y)||void 0===d||null===(v=d[te])||void 0===v||null===(f=v.contentDetails)||void 0===f||null===(p=f.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(b=Y)||void 0===b||null===(w=b[te])||void 0===w||null===(k=w.closedCaptions)||void 0===k?void 0:k.length)>0)&&(A=(null===(T=Y)||void 0===T||null===(I=T[te])||void 0===I||null===(P=I.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null===(E=Y)||void 0===E||null===(D=E[te])||void 0===D?void 0:D.closedCaptions),j=A.filter(function(e){return"VTT"===e.format}),Z(e,j)),null!=t&&t.disableControls?m(e):Ke(e,En(En(En({},t),ve),{},{liveVideo:se,isDvrEnabled:le,res:Y,sres:ee})),sn(e,En(En(En({},t),ve),{},{liveVideo:se}),o,{res:Y,sres:ee});case 23:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}},An={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function xn(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 Cn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?xn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):xn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Rn,Ln=function(e,n){var t=n.resolve,o=n.reject,r=null==e?void 0:e.playerId,i=Nn(e);Dn(r,{res:i},e,{resolve:t,reject:o})},Nn=function(e){var n,t,o=null==e?void 0:e.streamingInfo,r=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,i=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,l=null==e?void 0:e.token,a=b(l),s=null==a?void 0:a.site;return Cn(Cn({id:null==An?void 0:An[s]},!i&&{directPlaybackUrl:null==r?void 0:r.url}),{},{video:{drmEnabled:i,streamingInfo:{videoAssets:{widevine:null==r?void 0:r.widevine,fairPlay:null==r?void 0:r.fairPlay,playReady:null==r?void 0:r.playReady}},liveDetails:{isDvrEnabled:null==o?void 0:o.isDvrEnabled}}})};function Mn(e,n){return _n.apply(this,arguments)}function _n(){return(_n=G(Q.mark(function e(n,t){var o,r,i,l,a,u;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,r=t.reject,i=null==n?void 0:n.videoId,l=null==n?void 0:n.playerId,a=!(null==n||!n.anonymousId),e.next=6,O();case 6:u=e.sent,w(i,u).then(function(e){var t,c,d,v;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(c=t.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.contentType,s(null==e?void 0:e.data);var f,p=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(v=n.watchHistory)&&void 0!==v&&v.enable&&!a)if((null===(f=n.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var m,y,g,h=Ze((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",i,null==n?void 0:n.siteOwner);if(h&&h.length)n.watchHistoryResumeTime=(null===(y=h[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(g=h[0])||void 0===g?void 0:g.watchedPercentage)||null;p.contentType="video",Dn(l,{res:p},n,{resolve:o,reject:r})}else k(i,u).then(function(e){var t,o,r,i,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"}).catch(function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))}).finally(function(){Dn(l,{res:p},n,{resolve:o,reject:r})});else Dn(l,{res:p},n,{resolve:o,reject:r})}).catch(function(e){S(e,l,r,i)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Vn(e,n){return Un.apply(this,arguments)}function Un(){return(Un=G(Q.mark(function e(n,t){var o,r,i,l,a;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,r=t.reject,e.next=3,O();case 3:i=e.sent,l=null==n?void 0:n.playerId,a=null==n?void 0:n.epg,j(a,i).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==a?void 0:a.channelId,Dn(l,{res:t},n,{resolve:o,reject:r})}).catch(function(e){S(e,l,r,videoId)});case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Bn(e,n){return Hn.apply(this,arguments)}function Hn(){return(Hn=G(Q.mark(function e(n,t){var o,r,i,l,a,u,c;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.resolve,i=t.reject,e.next=3,O();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,P.set(parseInt(u)),c=null==n||null===(o=n.series)||void 0===o?void 0:o.id,T(c,l).then(function(e){var t,o,u,d=e.data,v=e.data.seasons;E(v);var f=videoId||(null==v||null===(t=v[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);I(c,l),w(f,l).then(function(e){var t,o,l;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.contentType,s(e.data),Dn(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:r,reject:i})}).catch(function(e){S(e,a,i,videoId)})}).catch(function(e){S(e,a,i)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Fn(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 Gn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Fn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Qn(){return{loadVideoInstantly:D,onTimeUpdate:q,getVideoDuration:z,onVideoEnded:J,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 r,i,l,a,s,u,c,d,v,f,p,m,y,g,h,b,k,O,j,T,I,P,E;return Q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!C(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(p=(null==e?void 0:e.videoSourceUrl)||!1,m=null==e?void 0:e.asat,y=(null==e||null===(r=e.epg)||void 0===r?void 0:r.enable)||!1,g=null==e?void 0:e.videoId,h=(null==e||null===(i=e.series)||void 0===i?void 0:i.enable)||!1,b=(null==e?void 0:e.streamingInfo)||!1,window.videoId=g,k=null==e?void 0:e.token,!V(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",k),U().set(null==e?void 0:e.refreshToken),k&&!B(k)){n.next=16;break}return o({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}}),n.abrupt("return");case 16:Rn=JSON.parse(atob(k.split(".")[1]));case 17:return e.isAnonymousUser=!(null===(l=Rn)||void 0===l||!l.anonymousId),e.siteOwner=(null===(a=Rn)||void 0===a?void 0:a.site)||null,e.userId=(null===(s=Rn)||void 0===s?void 0:s.userId)||null,window.sessionStorage.setItem("uid",null===(u=Rn)||void 0===u?void 0:u.userId),window.watchHistory=e.watchHistory||null,O=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(c=e.series)&&void 0!==c&&c.enable?null:null==e?void 0:e.chromecastReceiverId,j=(null==e||null===(d=e.analytics)||void 0===d?void 0:d.gaId)||null,(T=null==e?void 0:e.errors)&&(window.customErrors=T),window.customData=null==e?void 0:e.customData,se(null==e||null===(v=e.customData)||void 0===v?void 0:v.localisation),_.set(e.apiBaseUrl),null!=e&&e.skin&&!le(e.skin)||(e.skin="VL_ONE"),n.next=33,je(e);case 33:j&&ve("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then(function(){return H(j)}).catch(function(e){}),(I=null===(f=document)||void 0===f?void 0:f.getElementById("".concat(O)))&&I.addEventListener("contextmenu",function(e){return e.preventDefault()}),p?(E={directPlaybackUrl:p,id:P="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},m?w(P,k).then(function(n){var r=(null==n?void 0:n.data)||{};Dn(O,{res:Gn(Gn({},r),E)},e,{resolve:t,reject:o})}).catch(function(e){S(e,O,o,P)}):Dn(O,{res:E},e,{resolve:t,reject:o})):b?Ln(e,{resolve:t,reject:o}):h?Bn(e,{resolve:t,reject:o}):y?Vn(e,{resolve:t,reject:o}):Mn(e,{resolve:t,reject:o});case 37:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:ne,skip:v,getPlayer:oe,play:A,pause:x,detectBrowser:ae,rewind:f,loadVideo:a,seekToTimeStamp:W,isPlayerInitialised:C,load:R,authenticateLC:L,dispose:N,enableCaptions:ee,disableCaptions:$,getCaptions:Y,playSelectedResolution:te,getSource:l,setVolume:pe,getVolume:me,disableControls:m,setPlaybackSpeed:X,getEntitlementData:M,adsQueuePointManager:jn}}export{Qn as V,un as i,Tn as s};
1
+ import"video.js/dist/video-js.min.css";import{g as e,a as n,b as t,c as o,d as r,s as i,e as l,l as a,f as s,h as u,i as c,j as d,k as v,r as f,m as p,n as m,o as y,p as g,q as h,t as b,u as w,v as k,w as S,x as O,y as j,z as T,A as I,B as P,C as E,D,E as A,F as x,G as C,H as R,I as L,J as N,K as M,L as _,M as V,N as U,O as B,P as H}from"./generic-76d748e7.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 q,g as z,a as J,s as W,b as X}from"./util-80257541.js";import{g as Y,d as $,a as Z,e as ee}from"./captions-b7fd8308.js";import{g as ne}from"./renditions-6323832e.js";import{playSelectedResolution as te}from"./resolution-fcace655.js";import{g as oe,t as re,i as ie,a as le}from"./skin-58b9263c.js";import{d as ae}from"./browser-d4613b36.js";import{s as se}from"./localisation-0bf399a1.js";import ue from"@babel/runtime/helpers/typeof";import ce from"@babel/runtime/helpers/toConsumableArray";import de from"@babel/runtime/helpers/slicedToArray";var ve=function(e){return new Promise(function(n,t){if(fe(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)}})},fe=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},pe=function(e,n,t){var o=oe(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var r=parseFloat(n)/100;o.volume(r),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,"'")})},me=function(e){var n=oe(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},ye=function(){var e=G(Q.mark(function e(n){var t,o,r,i,l;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=oe(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return i=e.sent,e.prev=5,e.next=8,ve("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,i.default(K),e.finish(13);case 16:(l=K.getTech("chromecast"))&&!l.prototype.seeking&&(l.prototype.seeking=function(){}),null!==(r=window)&&void 0!==r&&r.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.airplay&&"Safari"==ae()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),ge=function(e,n){var t=oe(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,r,i,l,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,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(i=r.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}})};var he=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"),ve("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)}}(),be=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)}}(),we=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)}}(),ke=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)}}(),Se=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-6c1ba1fe.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)}}(),Oe=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){ve("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:he,loadEMELibrary:be,loadMuxPlugin:we,loadDvrSeekbar:ke,loadContribDash:Se});function je(e){return Te.apply(this,arguments)}function Te(){return(Te=G(Q.mark(function e(n){var t;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,he();case 3:t&&"Safari"==ae()&&Promise.resolve().then(function(){return Oe}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ie(e,n){return Pe.apply(this,arguments)}function Pe(){return(Pe=G(Q.mark(function e(n,t){var o,r,i,l,a,s,u,c,d,v;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u=(null==t?void 0:t.contentType)||"video",c=null==t||null===(o=t[u])||void 0===o?void 0:o.drmEnabled,null==t||null===(r=t[u])||void 0===r||null===(i=r.liveDetails)||void 0===i||i.isDvrEnabled,null==n||n.showPositiveSeekbar,d=(null==t||null===(l=t[u])||void 0===l||null===(a=l.streamingInfo)||void 0===a||null===(s=a.videoAssets)||void 0===s?void 0:s.dash)||null,e.prev=5,e.next=8,Promise.allSettled([c?"Safari"==ae()?be():"caliente"!=(null===(v=window)||void 0===v?void 0:v.siteName)?Se():be():"Safari"!=ae()&&d?Se():null,ye(n)]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}},e,null,[[5,10]])}))).apply(this,arguments)}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 De(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ee(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ee(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ae=new Set,xe=null,Ce=function(n,o,r){var i,l,a,s,u,c,d,v={},f=(null==n?void 0:n.contentType)||"video";v["c3.cm.id"]=(null===(i=n[f])||void 0===i?void 0:i.id)||"Null",v["c3.cm.contentType"]=Ue(n),v[null==r||null===(l=r.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),v[null==r||null===(a=r.Constants)||void 0===a?void 0:a.STREAM_URL]=o.currentSrc(),v[null==r||null===(s=r.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===e()?"NULL":e(),v["c3.cm.categoryType"]=Me(n),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=n[f])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(c=n[f])&&void 0!==c&&null!==(d=c.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[r.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=_e(n),v["c3.cm.genreList"]=Le(n),v["c3.cm.genre"]=Re(n),v["c3.cm.channel"]=Ne(n);var p=He(t(),n);return v=De(De({},v),p)},Re=function(e){var n,t,o,r=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[r])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},Le=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"},Ne=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},Me=function(e){return(null==e?void 0:e.contentType)||"null"},_e=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return r?"YES":"NO"},Ve=function(e,n){var t,o,r=(n||{}).epg;if(r&&null!=r&&r.enable&&null!=r&&r.programTitle)return r.programTitle;var i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[i])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},Ue=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Be,He=function(e,t){var r,i,l,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!t||null!=t&&t.linearchannel)return u;var c=o(),d=n();return u["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(i=r.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(l=e[c-1])||void 0===l||null===(a=l.episodes)||void 0===a||null===(s=a[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},Fe=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"}},Ge=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Qe=function(){var e=G(Q.mark(function e(n,t){var o,i,l,a,s,u,c,d,v,f;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,a=o.tveProvider,s=o.enable,u=o.appName,c=(t||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(d=oe(n),"function"==typeof(v=i)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(f=e.sent){e.next=13;break}return e.abrupt("return");case 13:d.ready(function(){var e=d.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=Fe(t.keySystem);v("contentInfo",{DRMEnabled:o})}else v("contentInfo",{DRMEnabled:"None"})}),n||v("contentInfo",{DRMEnabled:"None"})}),d.on("loadstart",function(){var e,n;xe&&xe!==d.currentSrc()&&v("playbackEnded"),v("setPlayer",d),Ae.clear(),xe=d.currentSrc();var o=Ge(d.currentType()),i=r(),s=Ce(i,d,f);s[null==f||null===(e=f.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",s[null==f||null===(n=f.Constants)||void 0===n?void 0:n.ASSET_NAME]=Ve(i,t),s.authToken=c||"NULL",s.streamType=o,s.D2CType=l||"NONE",s.subscriberType=a||(l?"D2C":"FREE"),s["c3.cm.affiliate"]=a||"NULL",v("contentInfo",s)}),d.on("loadedmetadata",function(){var e,n=d.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})}),d.on("play",function(){Ae.has(d.currentSrc())||(Ae.add(d.currentSrc()),v("playbackStarted",null))}),d.on("ended",function(){Ae.has(d.currentSrc())&&Ae.delete(d.currentSrc()),v("playbackEnded")}),d.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:d,adsLoader:null==e?void 0:e.adsLoader})}),d.on("dispose",function(){null==Ae||Ae.clear(),v("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Ke=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-81407982.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-b121228d.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-ee56f7b5.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-4c7628cf.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-66fc3448.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t&&import("./skin-c28415c0.js").then(function(t){t.initialiseSkin(e,n)})};function qe(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 ze(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?qe(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qe(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Je=[],We=0,Xe=null;function Ye(e,n,t){var o,l,a,s,u,c=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===(l=n.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(e.currentTime()),f=Math.floor(e.duration());null==n||null===(a=n.watchHistory)||void 0===a||a.xapiKey;var p=(null==n||null===(s=n.video)||void 0===s?void 0:s.originalObjectId)||null,m=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,y=Math.floor(e.currentTime()),g=c?100:Math.floor(v/f*100),h={};m?function(e,n,t){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),i=$e(o),l=(new Date).getTime(),a=r(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return ze(ze({},e),{},F({},n,s[n]))},{}),c=i.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===Be});c<0?i.push(ze(ze({content:u},e),{},{addedDate:l,updateDate:l})):i[c]=ze(ze(ze({},i[c]),e),{},{updateDate:l});localStorage.setItem("".concat(o),JSON.stringify(i))}(h={completed:c,watchedTime:y,watchedPercentage:g},d,n.siteOwner):(h=ze(ze({videoId:Be,watchedTime:y,watchedPercentage:g,doneWatching:c,profileId:d},Xe&&{seriesId:Xe}),p&&{originalObjectId:p}),i(h).then(function(e){}).catch(function(e){})),We=v+t}function $e(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Ze(e,n,t){var o=$e(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),r=[];return o&&Array.isArray(o)&&(r=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),r}var en=!1,nn=function(e,n){var t,o,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[r])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!en){var i=tn(e,"videoAssets","secondaryVideoAssets"),s=l(i,n);return s&&a(n,s),en=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function tn(e,n,t){if(Array.isArray(e))return e.map(function(e){return tn(e,n,t)});if(null!==e&&"object"===ue(e)){var o={};return Object.keys(e).forEach(function(r){r===n&&void 0!==e[t]?o[r]=e[t]:r===t&&void 0!==e[n]?o[r]=e[n]:o[r]=tn(e[r],n,t)}),o}return e}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,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function 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}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 an(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 sn=function(e,n,t,o){var i,l,a,v,f=o.res,p=o.sres,m=oe(e),y=(null==f?void 0:f.contentType)||"video",g=(null==f?void 0:f[y].drmEnabled)||!1,h=(null==f||null===(i=f[y])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1,b=(null==f||null===(a=f[y])||void 0===a||null===(v=a.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1;s(f),m&&(m.on("loadstart",function(){h?t.resolve({status:!0,msg:"Video Loaded",response:f}):t.resolve(an({status:!0,msg:"Player Initialised"},p?{seriesResponse:p,response:f}:{response:f}))}),m.on("loadeddata",function(){var t,o,i,l=Y(e);if(null==l||l.map(function(n){return $(e,n.id)}),b&&"Safari"===ae())try{var a;null==m||null===(a=m.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&pe(e,sessionStorage.getItem("volume")||"100");var s=r();if(u(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(o=n.watchHistory)&&void 0!==o&&o.saveOffline)){var c,d,v=an(an({},n),f);!function(e,n,t){var o,r,i;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(Xe=null==n||null===(r=n.series)||void 0===r?void 0:r.id),Je=[],We=0,Be=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=oe(e);a&&(a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());Je.includes(We)||(e==We?(Je.push(e),Ye(a,n,l)):e>We&&(We=e+l))}}),a.one("ended",function(){Ye(a,n,l,!0)}))}(e,v,null==s||null===(c=s.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.id)}if(null!=n&&null!==(i=n.analytics)&&void 0!==i&&i.muxKey&&null!=m&&m.mux){var p,y,g,h,w,k,S=(null===(p=r())||void 0===p?void 0:p.video)||(null==f?void 0:f.video),O=null==S?void 0:S.gist,j={env_key:null==n||null===(y=n.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(g=window)||void 0===g?void 0:g.vl_player_version,video_id:null==O?void 0:O.id,video_title:null==O?void 0:O.title,video_series:null==S||null===(h=S.series)||void 0===h?void 0:h.title,video_stream_type:null!=S&&null!==(w=S.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==n||null===(k=n.analytics)||void 0===k?void 0:k.userId};m.mux({debug:!1,data:j})}}),m.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];m.trigger("subtitlechanged",n)}),m.on("subtitlechanged",function(e,n){var t,o,r,i,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(i=r.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===f){var m,y=p.getMediaSession(),g=y.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}}),m.tech_.on("retryplaylist",function(){h&&nn(f,e)}),m.on("error",function(){var n,o;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?nn(f,e):(c(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==m||null===(o=m.error())||void 0===o?void 0:o.message)||"Some error occured",response:f}))}),m.one("play",function(){var e,t,o,i,l;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(o=t.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable){var a,s,u,c=null===(a=r())||void 0===a||null===(s=a.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.id,v=d(),f=(null==v?void 0:v.get(c))||{t:0,p:0},p=f.t,y=f.p;p&&y<95&&setTimeout(function(){m.currentTime(p)},0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout(function(){m.currentTime(null==n?void 0:n.watchHistoryResumeTime)},0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),m.on("volumechange",function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),m.on("chromecastDisconnected",function(){if(h){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}}),m.one("loadeddata",function(){var e,n=(null==m||null===(e=m.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if("object"==ue(m.dash)){var t,o,r,i=null==m||null===(t=m.dash)||void 0===t||null===(o=t.mediaPlayer)||void 0===o?void 0:o.getTracksFor("audio"),l=null==i?void 0:i.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=on(n);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(l&&(null==s?void 0:s.id)=="dash-audio-".concat(l.index)){s.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var u,c=on(n);try{for(c.s();!(u=c.n()).done;){var d,v,f,p=u.value;("Chrome"==ae()||"Edge"==ae()&&(null!==(d=navigator)&&void 0!==d&&null!==(v=d.userAgent)&&void 0!==v&&v.includes("Macintosh")||!g))&&null!=p&&null!==(f=p.label)&&void 0!==f&&f.includes("5.1")?m.audioTracks().removeTrack(p):"main"==p.kind?p.enabled=!0:p.enabled=!1}}catch(e){c.e(e)}finally{c.f()}}}))};function un(e,n){var t,o,r,i=oe(e),l=null==i||null===(t=i.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,a=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var o,r,s,u,c,d,p,m,y;if(dn.enabled&&"input"!=t.target.localName){var g=t.key,h=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(g)&&(t.preventDefault(),null==a||a.focus()),g){case" ":null==l||l.click();break;case"m":case"M":i.muted(!i.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":h&&!1===n.liveui||f(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(s=r.app_data)||void 0===s||null===(u=s.appcmsMain)||void 0===u||null===(c=u.adsConfig)||void 0===c?void 0:c.vodAdSticherProvider)&&null!==(d=window)&&void 0!==d&&null!==(p=d.app_data)&&void 0!==p&&null!==(m=p.appcmsMain)&&void 0!==m&&null!==(y=m.adsConfig)&&void 0!==y&&y.vodAdClientSideTracking)return;h||v(e,10)}}},!0)}var cn,dn=(cn=!0,{enable:function(){cn=!0},disable:function(){cn=!1},get enabled(){return cn}});function vn(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 fn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?vn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):vn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function pn(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,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function 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}var yn,gn,hn=(yn="",{set:function(e){e&&(yn=e)},get:function(){return yn}}),bn=(gn=null,{set:function(e){gn=e},get position(){return gn}});function wn(e,n){return kn.apply(this,arguments)}function kn(){return(kn=G(Q.mark(function e(n,t){var o,r,i,a,s,u,c,d,v,f,m,y,g,h;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return oe(n),o=l(t,n),r=o.src,i=r.replace("/dash/","/session/").replace("master","session"),i=p(i,n,t),a=Sn(i),s=de(a,2),u=s[0],c=s[1],i=new URL(i.split("?")[0]),Object.keys(c).length>0&&Object.entries(c).forEach(function(e){var n=de(e,2),t=n[0],o=n[1];i.searchParams.set(t,o)}),e.prev=8,e.next=11,fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:fn({},u)})});case 11:return d=e.sent,e.next=14,d.json();case 14:return v=e.sent,f="https://"+new URL(i).hostname,m=v.trackingUrl,y=v.manifestUrl,g=f+m,h=f+y,hn.set(g),console.log("%c TRACKING URL","background: #bdf369; color: #000",g),o.src=h,e.abrupt("return",o);case 26:return e.prev=26,e.t0=e.catch(8),e.abrupt("return",o);case 29:case"end":return e.stop()}},e,null,[[8,26]])}))).apply(this,arguments)}function Sn(e){var n={},t=e.split("?")[1];if(!t)return[{},{}];var o,r=pn(t.split("&"));try{for(r.s();!(o=r.n()).done;){var i=o.value.split("="),l=de(i,2),a=l[0],s=l[1];n[decodeURIComponent(a)]=decodeURIComponent(s||"")}}catch(e){r.e(e)}finally{r.f()}for(var u={},c={},d=0,v=Object.entries(n);d<v.length;d++){var f=de(v[d],2),p=f[0],m=f[1];if(p.startsWith("ads."))u[p.replace(/^ads\./,"")]=m;else c[p]=m}return[u,c]}var On,jn=(On=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),On=Array.isArray(e)?ce(e):On},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",On),ce(On)}});function Tn(e,n){return In.apply(this,arguments)}function In(){return In=G(Q.mark(function e(n,t){var o,r,i,l,a,s,u,c,d,f,p,m,y,g,h,b,w;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:w=function(e,t,o,r,i,l){var a=oe(n);if(!a.seeking()){t.startTimeInSeconds,t.durationInSeconds,Math.floor(a.currentTime());var s,u=pn(o);try{var c=function(){var n,o,u,c=s.value,d=c.eventType,v=c.beaconUrls,f=c.startTimeInSeconds,p=c.startTime,m=c.durationInSeconds,y=f||0,g=v,w=(null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o||null===(u=o.ads)||void 0===u?void 0:u.adEventHandler)||null,k="".concat(y,"_").concat(d),S=h.get("pod-".concat(i))||[];if(console.warn(e,y,"map:",d,"condition1:",e>=y,"map:",h),e>=y&&!S.includes(k)){S.push(k),h.set("pod-".concat(i),S);try{b(d,t,g,a)}catch(e){console.error("Error when calling triggerAdBeacon:",e,d,t)}if("breakEnd"==d){var O=bn.position;bn.set(null),setTimeout(function(){null!=O&&(a.currentTime(O),l())},500)}if("function"==typeof w)try{var j;w({adsData:{eventType:d,startTimeInSeconds:f,startTime:p,durationInSeconds:m,ad:null==t||null===(j=t.ads)||void 0===j?void 0:j[r],adIndex:r}})}catch(e){console.error("Error when calling ads callback:",e)}}};for(u.s();!(s=u.n()).done;)c()}catch(e){u.e(e)}finally{u.f()}}},b=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)})})},g=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},bn.set(t),a=hn.get(),(s=oe(n)).one("loadeddata",function(){a&&y(a)}),u=new Map,c=new Map,d=-1,f=(null===(o=document)||void 0===o||null===(r=o.getElementsByClassName("tvProviderImage"))||void 0===r?void 0:r[0])||null,p=(null==s||null===(i=s.controlBar)||void 0===i?void 0:i.getChild("videoSelector"))||null,m=(null==s||null===(l=s.controlBar)||void 0===l?void 0:l.getChild("seriesV2"))||null,y=function(){var e=G(Q.mark(function e(o){var r,i,l,a,s,y,h,b,k,S,O,j,T,I,P,E,D;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return T=function(e){document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",T),0===e.button&&S()},j=function(e){},O=function(){var e,n=h.currentTime(),t=null,o=pn(y);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=(r.ads,Math.floor(i+l));n>=i&&n<=a&&(t=a,u.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){h.currentTime(t+2.2)},100))},S=function(){var e,n=h.currentTime(),t=null,o=pn(y);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=r.ads,s=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>s||n>i)&&!u.has(i)||n>=i&&n<=s)&&(t=i,u.set(i,!0),c.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){h.currentTime(t+.4)},100))},i=!1,e.next=7,fetch(o);case 7:return l=e.sent,e.next=10,l.json();case 10:a=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",a),s=a.avails,y=[],h=oe(n),b=h.controlBar.progressControl,k=b.seekBar.el(),s.map(function(e,n){var t,o,r;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(i=!0),y.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:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(r=o.filter(function(e){return"breakStart"==(null==e?void 0:e.eventType)}))||void 0===r?void 0:r[0])||[]})}),!i&&t&&(h.currentTime(t),O()),null!=y&&y.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",y),jn.setQueuePoints(y),window.adsQueueList=y),y.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=h.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",k.appendChild(i)}}),h.on("timeupdate",re(function(){var e=h.currentTime();if(e!==d){d=e;for(var n=!1,t=function(){var t=y[o],r=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,a=r+i;if(e>=r-1.2&&e<=a+1.2){e>=r&&!c.has(r)&&!h.seeking()&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&"Safari"==ae()&&0!=r&&(console.log("jfc"),h.currentTime(0),setTimeout(function(){h.currentTime(r+.4)},500),c.set(r,!0)),e>=r&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&u.set(r,!0),dn.disable(),f&&f.classList.add("vjs-hidden"),p&&(p.el().style.pointerEvents="none",p.el().classList.add("vjs-hidden")),m&&(m.el().style.pointerEvents="none",m.el().classList.add("vjs-hidden")),b.el().style.visibility="hidden";for(var s=e-r,d=0,v=0,k=0;k<l.length;k++){var S,j=null==l||null===(S=l[k])||void 0===S?void 0:S.durationInSeconds;if(s<d+j){v=k;break}d+=j}var T=l[v],P=s-d,E=Math.max(0,(null==T?void 0:T.durationInSeconds)-P),A=Math.round(E);I.style.display="block",D.textContent="".concat(v+1," of ").concat(l.length," • ").concat(g(A));var x=[];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)});x.push.apply(x,ce(n))}),Array.isArray(l)&&0==(null==l?void 0:l.length)&&x.push(null==t?void 0:t.podSlotImpressionBeacon),w(e,t,x,v,o,O),"break"}c.delete(r)},o=0;o<y.length;o++){if("break"===t())break}n||(I.style.display="none",b.el().style.visibility="visible",p&&(p.el().style.pointerEvents="auto",p.el().classList.remove("vjs-hidden")),m&&(m.el().style.pointerEvents="auto",m.el().classList.remove("vjs-hidden")),f&&f.classList.remove("vjs-hidden"),dn.enable())}},1e3)),null===(r=document)||void 0===r||r.addEventListener("keydown",function(e){dn.enabled&&"ArrowRight"==e.key&&(S(),v(n,10),e.stopPropagation())}),b.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",j),document.addEventListener("pointerup",T))}),(I=document.createElement("div")).className="ssai-ad-container",(P=document.createElement("div")).className="sponsored-adbox",(E=document.createElement("div")).className="sponsored-text",E.textContent="Sponsored Ad",P.append(E),(D=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",I.append(P),I.append(D),h.el().appendChild(I);case 40:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),h=new Map;case 16:case"end":return e.stop()}},e)})),In.apply(this,arguments)}function Pn(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 En(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Pn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Pn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Dn=function(e,n,t,o){var r,i,s,u,d,v,f,p,b,w,k,S,O,j,T,I,P,E,D,A,x,C,R,L,N,M,_,V,U,B,H,q,z,J,W,X=n.res,Y=void 0===X?null:X,$=n.sres,ee=void 0===$?null:$,ne=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(r=Y)||void 0===r?void 0:r.contentType)||"video",re=ie(null===(i=Y)||void 0===i||null===(s=i[te])||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl)||ie(null===(d=Y)||void 0===d||null===(v=d[te])||void 0===v||null===(f=v.gist)||void 0===f||null===(p=f.imageGist)||void 0===p?void 0:p.r16x9),le=(null===(b=Y)||void 0===b||null===(w=b[te])||void 0===w||null===(k=w.liveDetails)||void 0===k?void 0:k.isDvrEnabled)||!1,se=(null===(S=Y)||void 0===S||null===(O=S[te])||void 0===O||null===(j=O.streamingInfo)||void 0===j?void 0:j.isLiveStream)||!1,ue=(null===(T=Y)||void 0===T||null===(I=T.ads)||void 0===I||null===(P=I.preRoll)||void 0===P||null===(E=P.adTags)||void 0===E||null===(D=E.web)||void 0===D?void 0:D.active)&&(null===(A=Y)||void 0===A||null===(x=A.ads)||void 0===x||null===(C=x.preRoll)||void 0===C||null===(R=C.adTags)||void 0===R||null===(L=R.web)||void 0===L?void 0:L.url);Y=En(En({},Y),{},{audioAssetSource:null==t?void 0:t.audioAssetSource});var ce="MEDIA_TAILOR"==(null===(N=window)||void 0===N||null===(M=N.app_data)||void 0===M||null===(_=M.appcmsMain)||void 0===_||null===(V=_.adsConfig)||void 0===V?void 0:V.vodAdSticherProvider)||!1,de=(null==t?void 0:t.latency)||6,ve=(W={enableSmoothSeeking:!0,controls:0!=(null==t?void 0:t.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==t?void 0:t.muted)||!1,autoplay:(null==t?void 0:t.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==t.skin,liveui:le},F(W,"autoplay",null==t?void 0:t.autoplay),F(W,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!ue),F(W,"loop",(null==t?void 0:t.loop)||!1),F(W,"audioPosterMode",null==t?void 0:t.audioPosterMode),F(W,"html5",En(En({dash:En(En(En({},!K.browser.IS_SAFARI&&{useTTML:!0}),(null==t?void 0:t.debugConfig)&&(null==t||null===(U=t.debugConfig)||void 0===U?void 0:U.enable)&&{debug:!0,logLevel:null!=t&&null!==(B=t.debugConfig)&&void 0!==B&&B.logLevel?null==t||null===(H=t.debugConfig)||void 0===H?void 0:H.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:de},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:En(En({liveRangeSafeTimeDelta:de,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==t||null===(q=t.customData)||void 0===q?void 0:q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0}),debug:!0,nativeTextTracks:"Safari"==ae()},0==(null==t||null===(z=t.customData)||void 0===z?void 0:z.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===(J=t.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),F(W,"poster",re),F(W,"techOrder",ne),F(W,"chromecast",{requestCustomDataFn:function(n){var t=oe(e),o=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind});return function(e,n,t){var o,r,i,l,a,s,u,c,d,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,y,g,h,b,w,k,S;p.isDrmEnabled=!0;var O=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,j=(null==O?void 0:O.url)||(null==n||null===(y=n.keySystemOptions)||void 0===y||null===(g=y[0])||void 0===g||null===(h=g.options)||void 0===h?void 0:h.serverURL);p.licenseUrl=j;var T=(null==O?void 0:O.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=T}var I=(null==e||null===(o=e[f])||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType)||"VIDEO";p.contentType=I;var P=null==e||null===(i=e[f])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;p.duration=P;var E=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=E;var D=null==e||null===(u=e[f])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=D,p.subTitles=t,p.DVR=(null==e||null===(d=e[f])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(Y,n,o)},modifyLoadRequestFn:function(n){var t,o,r,i,l,a=oe(e),s=(null==a?void 0:a.currentSource())||{};!(null===(t=Y)||void 0===t||null===(o=t[te])||void 0===o||null===(r=o.streamingInfo)||void 0===r||null===(i=r.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(l=s.src)&&void 0!==l&&l.includes(".m3u8")&&(n.media.hlsSegmentFormat="fmp4",n.media.hlsVideoSegmentFormat="fmp4");return n}}),W);if(!K.getPlayers()[e]){K.log.level("debug");var fe=K(e,ve,function(){var n=G(Q.mark(function n(){var r,i,s,u,d,v,f,p,b,w,k,S,O,j,T,I,P,E,D,A;return Q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(fe),console.log(K.VERSION),console.log(K.getPlugins()),n.next=5,Ie(t,Y);case 5:if(S=null===(r=Y)||void 0===r||null===(i=r[te])||void 0===i||null===(s=i.liveDetails)||void 0===s?void 0:s.startOverTime,se&&o.resolve(En({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Y}:{response:Y})),y(e,null==t?void 0:t.analyticsCb),Qe(e,t),/Android/i.test(navigator.userAgent)&&(K.options.vhs.overrideNative=!0),le&&ge(e,S),!ue||null!=t&&null!==(u=t.customData)&&void 0!==u&&u.disableAds||g(e,ue,Y),O=l(Y,e),console.log(O),null!=t&&t.nearestClusterUrl&&(O=h(O,t.nearestClusterUrl)),!ce){n.next=19;break}return n.next=18,wn(e,Y);case 18:O=n.sent;case 19:O?a(e,O):(o.reject({status:!1,msg:"Incompatible / Missing Source",response:Y}),c(e,"Incompatible / Missing Source")),((null===(d=Y)||void 0===d||null===(v=d[te])||void 0===v||null===(f=v.contentDetails)||void 0===f||null===(p=f.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(b=Y)||void 0===b||null===(w=b[te])||void 0===w||null===(k=w.closedCaptions)||void 0===k?void 0:k.length)>0)&&(A=(null===(T=Y)||void 0===T||null===(I=T[te])||void 0===I||null===(P=I.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null===(E=Y)||void 0===E||null===(D=E[te])||void 0===D?void 0:D.closedCaptions),j=A.filter(function(e){return"VTT"===e.format}),Z(e,j)),null!=t&&t.disableControls?m(e):Ke(e,En(En(En({},t),ve),{},{liveVideo:se,isDvrEnabled:le,res:Y,sres:ee})),sn(e,En(En(En({},t),ve),{},{liveVideo:se}),o,{res:Y,sres:ee});case 23:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}},An={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function xn(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 Cn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?xn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):xn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Rn,Ln=function(e,n){var t=n.resolve,o=n.reject,r=null==e?void 0:e.playerId,i=Nn(e);Dn(r,{res:i},e,{resolve:t,reject:o})},Nn=function(e){var n,t,o=null==e?void 0:e.streamingInfo,r=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,i=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,l=null==e?void 0:e.token,a=b(l),s=null==a?void 0:a.site;return Cn(Cn({id:null==An?void 0:An[s]},!i&&{directPlaybackUrl:null==r?void 0:r.url}),{},{video:{drmEnabled:i,streamingInfo:{videoAssets:{widevine:null==r?void 0:r.widevine,fairPlay:null==r?void 0:r.fairPlay,playReady:null==r?void 0:r.playReady}},liveDetails:{isDvrEnabled:null==o?void 0:o.isDvrEnabled}}})};function Mn(e,n){return _n.apply(this,arguments)}function _n(){return(_n=G(Q.mark(function e(n,t){var o,r,i,l,a,u;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,r=t.reject,i=null==n?void 0:n.videoId,l=null==n?void 0:n.playerId,a=!(null==n||!n.anonymousId),e.next=6,O();case 6:u=e.sent,w(i,u).then(function(e){var t,c,d,v;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(c=t.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.contentType,s(null==e?void 0:e.data);var f,p=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(v=n.watchHistory)&&void 0!==v&&v.enable&&!a)if((null===(f=n.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var m,y,g,h=Ze((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",i,null==n?void 0:n.siteOwner);if(h&&h.length)n.watchHistoryResumeTime=(null===(y=h[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(g=h[0])||void 0===g?void 0:g.watchedPercentage)||null;p.contentType="video",Dn(l,{res:p},n,{resolve:o,reject:r})}else k(i,u).then(function(e){var t,o,r,i,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"}).catch(function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))}).finally(function(){Dn(l,{res:p},n,{resolve:o,reject:r})});else Dn(l,{res:p},n,{resolve:o,reject:r})}).catch(function(e){S(e,l,r,i)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Vn(e,n){return Un.apply(this,arguments)}function Un(){return(Un=G(Q.mark(function e(n,t){var o,r,i,l,a;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,r=t.reject,e.next=3,O();case 3:i=e.sent,l=null==n?void 0:n.playerId,a=null==n?void 0:n.epg,j(a,i).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==a?void 0:a.channelId,Dn(l,{res:t},n,{resolve:o,reject:r})}).catch(function(e){S(e,l,r,videoId)});case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Bn(e,n){return Hn.apply(this,arguments)}function Hn(){return(Hn=G(Q.mark(function e(n,t){var o,r,i,l,a,u,c;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.resolve,i=t.reject,e.next=3,O();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,P.set(parseInt(u)),c=null==n||null===(o=n.series)||void 0===o?void 0:o.id,T(c,l).then(function(e){var t,o,u,d=e.data,v=e.data.seasons;E(v);var f=videoId||(null==v||null===(t=v[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);I(c,l),w(f,l).then(function(e){var t,o,l;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.contentType,s(e.data),Dn(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:r,reject:i})}).catch(function(e){S(e,a,i,videoId)})}).catch(function(e){S(e,a,i)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Fn(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 Gn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Fn(Object(t),!0).forEach(function(n){F(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Qn(){return{loadVideoInstantly:D,onTimeUpdate:q,getVideoDuration:z,onVideoEnded:J,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 r,i,l,a,s,u,c,d,v,f,p,m,y,g,h,b,k,O,j,T,I,P,E;return Q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!C(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(p=(null==e?void 0:e.videoSourceUrl)||!1,m=null==e?void 0:e.asat,y=(null==e||null===(r=e.epg)||void 0===r?void 0:r.enable)||!1,g=null==e?void 0:e.videoId,h=(null==e||null===(i=e.series)||void 0===i?void 0:i.enable)||!1,b=(null==e?void 0:e.streamingInfo)||!1,window.videoId=g,k=null==e?void 0:e.token,!V(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",k),U().set(null==e?void 0:e.refreshToken),k&&!B(k)){n.next=16;break}return o({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}}),n.abrupt("return");case 16:Rn=JSON.parse(atob(k.split(".")[1]));case 17:return e.isAnonymousUser=!(null===(l=Rn)||void 0===l||!l.anonymousId),e.siteOwner=(null===(a=Rn)||void 0===a?void 0:a.site)||null,e.userId=(null===(s=Rn)||void 0===s?void 0:s.userId)||null,window.sessionStorage.setItem("uid",null===(u=Rn)||void 0===u?void 0:u.userId),window.watchHistory=e.watchHistory||null,O=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(c=e.series)&&void 0!==c&&c.enable?null:null==e?void 0:e.chromecastReceiverId,j=(null==e||null===(d=e.analytics)||void 0===d?void 0:d.gaId)||null,(T=null==e?void 0:e.errors)&&(window.customErrors=T),window.customData=null==e?void 0:e.customData,se(null==e||null===(v=e.customData)||void 0===v?void 0:v.localisation),_.set(e.apiBaseUrl),null!=e&&e.skin&&!le(e.skin)||(e.skin="VL_ONE"),n.next=33,je(e);case 33:j&&ve("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then(function(){return H(j)}).catch(function(e){}),(I=null===(f=document)||void 0===f?void 0:f.getElementById("".concat(O)))&&I.addEventListener("contextmenu",function(e){return e.preventDefault()}),p?(E={directPlaybackUrl:p,id:P="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},m?w(P,k).then(function(n){var r=(null==n?void 0:n.data)||{};Dn(O,{res:Gn(Gn({},r),E)},e,{resolve:t,reject:o})}).catch(function(e){S(e,O,o,P)}):Dn(O,{res:E},e,{resolve:t,reject:o})):b?Ln(e,{resolve:t,reject:o}):h?Bn(e,{resolve:t,reject:o}):y?Vn(e,{resolve:t,reject:o}):Mn(e,{resolve:t,reject:o});case 37:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:ne,skip:v,getPlayer:oe,play:A,pause:x,detectBrowser:ae,rewind:f,loadVideo:a,seekToTimeStamp:W,isPlayerInitialised:C,load:R,authenticateLC:L,dispose:N,enableCaptions:ee,disableCaptions:$,getCaptions:Y,playSelectedResolution:te,getSource:l,setVolume:pe,getVolume:me,disableControls:m,setPlaybackSpeed:X,getEntitlementData:M,adsQueuePointManager:jn}}export{Qn as V,un as i,Tn as s};
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import"./generic-76d748e7.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"video.js";export{V as default}from"./index-c50e1261.js";import"./util-80257541.js";import"./captions-b7fd8308.js";import"./renditions-6323832e.js";import"./resolution-fcace655.js";import"./skin-58b9263c.js";import"./browser-d4613b36.js";import"./localisation-0bf399a1.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";
1
+ import"video.js/dist/video-js.min.css";import"./generic-76d748e7.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"video.js";export{V as default}from"./index-67c081c3.js";import"./util-80257541.js";import"./captions-b7fd8308.js";import"./renditions-6323832e.js";import"./resolution-fcace655.js";import"./skin-58b9263c.js";import"./browser-d4613b36.js";import"./localisation-0bf399a1.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/classCallCheck";import s from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/assertThisInitialized";import n from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{f as r,e as d,B as c}from"./icons-0676e9c7.js";import{j as u,U as m,V as v,H as p,b as h,B as f}from"./generic-76d748e7.js";import{e as b,s as y,p as C,j as g,g as E,i as N}from"./skin-58b9263c.js";import{a as k}from"./autoNextVideo-613b5bf9.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-d4613b36.js";import"js-cookie";import"ua-parser-js";import"./captions-b7fd8308.js";import"./util-80257541.js";function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(I=function(){return!!e})()}var S=a.getComponent("Component"),x=function(){n(w,S);var x,L,B=(x=w,L=I(),function(){var e,t=l(x);if(L){var s=l(this).constructor;e=Reflect.construct(t,arguments,s)}else e=t.apply(this,arguments);return i(this,e)});function w(s){var n,i,l,a,r,d,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,w),(d=B.call(this,s,c)).playerId=c.playerId,d.seriesData=c.sres,d.videos=null==c||null===(n=c.sres)||void 0===n?void 0:n.seasons,d.currentVideoData=c.res,d.initialiseStructure(),d.loadCSS(),d.selectedSeason=0,d.cb=null==c||null===(i=c.series)||void 0===i?void 0:i.cb,d.autoPlayNext=(null==c||null===(l=c.series)||void 0===l?void 0:l.autoPlayNext)||!1,sessionStorage.getItem("token"),d.watchMap=u(),null!==(a=o(d))&&void 0!==a&&a.autoPlayNext&&null!=c&&null!==(r=c.series)&&void 0!==r&&r.enable){var p,h,f,b,y=null==c||null===(p=c.sres)||void 0===p?void 0:p.seasons,C=[];y.map(function(t){C.push.apply(C,e(t.episodes))}),m(C),v(null===(h=d.options_)||void 0===h||null===(f=h.res)||void 0===f||null===(b=f.video)||void 0===b?void 0:b.id),k({playerId:d.playerId,content:C,cb:d.cb,series:null==c?void 0:c.sres})}return d}return s(w,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"series-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("button",{className:"series-selector-icon",title:"season selector",innerHTML:"".concat(r())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./series-v2-6e9853f8.js").then(function(e){var t=document.createElement("style");t.id="series-v2",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"toggleOpenClose",value:function(e){var t,s=this.el();null!=e&&null!==(t=e.classList)&&void 0!==t&&t.contains("hidden")?(b(),e.classList.remove("hidden"),s.classList.add("open"),y(this.playerId,e)):(e.classList.add("hidden"),s.classList.remove("open"))}},{key:"handleTabIndexSelector",value:function(){var e,t=document.getElementsByClassName("season-holder");document.getElementById("sr-announcer").textContent="season selector dialog open",null!==(e=document.getElementsByClassName("series-selector-cross-icon"))&&void 0!==e&&e[0]&&(document.getElementsByClassName("series-selector-cross-icon")[0].tabIndex=0);for(var s=0;s<(null==t?void 0:t.length);s++)t[s].tabIndex=0}},{key:"handleCloseTabIndex",value:function(){var e,t=document.getElementsByClassName("season-holder");document.getElementById("sr-announcer").textContent="season selector dialog closed",null!==(e=document.getElementsByClassName("series-selector-cross-icon"))&&void 0!==e&&e[0]&&(document.getElementsByClassName("series-selector-cross-icon")[0].tabIndex=-1);for(var s=0;s<(null==t?void 0:t.length);s++)t[s]&&(t[s].tabIndex=-1);setTimeout(function(){document.getElementsByClassName("series-selector-icon")[0]&&document.getElementsByClassName("series-selector-icon")[0].focus()},100)}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),s=a.dom.createEl("div",{className:"series-selection-container hidden",role:"dialog",ariaModal:"true"});s.setAttribute("aria-labelledby","seasons"),a.dom.$(".series-selector-icon",this.el()).onclick=function(){e.toggleOpenClose(s),e.handleTabIndexSelector()};var o=document.getElementById(this.playerId);if(o){var n=window.getComputedStyle(o,null).getPropertyValue("height").slice(0,-2);s.style.height="".concat(n,"px"),a.dom.appendContent(t,s),o.style.overflow="hidden",this.addFunctionality(s)}}},{key:"handleSeriesCloseIcon",value:function(e,t,s){if("series-selector-cross-icon"===e.className)t.classList.add("hidden"),s.classList.remove("open"),this.handleCloseTabIndex();else if("series-selector-back-icon"===e.className){var o=a.dom.$(".series-selector-content",this.el());for(a.dom.$(".series-selector-cross-icon",this.el()),e.className="series-selector-cross-icon";null!=o&&o.firstChild;)o.removeChild(o.firstChild);var n=this.createSeasonLister();for(a.dom.appendContent(o,n),a.dom.$(".series-selector-title",this.el()).textContent="Seasons";null!=e&&e.firstChild;)e.removeChild(e.firstChild);var i=C(d());e.appendChild(i)}}},{key:"addFunctionality",value:function(e){var t=this,s=this.el(),o=a.dom.createEl("div",{className:"series-selector-head"}),n=a.dom.createEl("button",{className:"series-selector-cross-icon",ariaLabel:"close season selector",innerHTML:"".concat(d()),tabIndex:-1});n.onclick=function(){t.handleSeriesCloseIcon(n,e,s)},n.onkeydown=function(o){"Enter"===o.key&&t.handleSeriesCloseIcon(n,e,s)};var i=a.dom.createEl("h2",{className:"series-selector-title",ariaLabel:"Seasons",innerHTML:"Seasons",id:"seasons"}),l=a.dom.createEl("div",{style:"position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;",ariaLive:"assertive",id:"sr-announcer",tabIndex:-1}),r=a.dom.createEl("div",{className:"series-selector-content"}),c=this.createSeasonLister();a.dom.appendContent(o,l),a.dom.appendContent(r,c),a.dom.appendContent(o,n),a.dom.appendContent(o,i),a.dom.appendContent(e,o),a.dom.appendContent(e,r),g(this.playerId,e)}},{key:"createSeasonLister",value:function(){var e=this;E(this.playerId);for(var t=h(),s=a.dom.createEl("div",{className:"season-container"}),o=function(o){var n,i,l,r,d=document.createElement("label");d.className="season-holder",d.ariaLabel=null===(n=t[o])||void 0===n?void 0:n.title,d.role="button",d.type="button",d.setAttribute("aria-LabelledBy",null===(i=t[o])||void 0===i?void 0:i.title),d.setAttribute("for","season-".concat(o));var c=document.createElement("div");c.className="season - ".concat(o),c.textContent=null===(l=t[o])||void 0===l?void 0:l.title,c.id=null===(r=t[o])||void 0===r?void 0:r.title;var u=a.dom.createEl("input",{className:"radio - ".concat(o),id:"season-".concat(o),name:"season-radio"});u.setAttribute("type","radio"),e.selectedSeason==o&&(u.checked=!0),u.onclick=function(t){f.set(o),e.showSeasonDetails(o)},d.onkeydown=function(t){"Enter"===t.key&&(f.set(o),e.showSeasonDetails(o))},a.dom.appendContent(d,u),a.dom.appendContent(d,c),a.dom.appendContent(s,d)},n=0;n<t.length;n++)o(n);return s}},{key:"loadSeriesAssetById",value:function(e,t){var s,o=this;v(null===(s=e[t])||void 0===s?void 0:s.id),p(this.playerId,e[t].id).then(function(e){null!=o&&o.cb&&o.cb(e)}).catch(function(e){null!=o&&o.cb&&o.cb(e)})}},{key:"getSeasonDetailsContainer",value:function(t,s){var o=this;t=t.map(function(e){var t,s,n,i,l,a,r,d,c;return{id:null==e?void 0:e.id,title:null==e?void 0:e.title,description:null==e||null===(t=e.gist)||void 0===t?void 0:t.description,img:(null==e||null===(s=e.gist)||void 0===s||null===(n=s.imageGist)||void 0===n?void 0:n.r16x9)||(null===(i=window)||void 0===i||null===(l=i.app_data)||void 0===l||null===(a=l.appcmsMain)||void 0===a||null===(r=a.images)||void 0===r?void 0:r.placeholderCover),watchedPercentage:(null==o||null===(d=o.watchMap)||void 0===d||null===(c=d.get(null==e?void 0:e.id))||void 0===c?void 0:c.p)||0}});for(var n=function(n){var i,l,r,d,c,u=a.dom.createEl("div",{className:"series-container",tabIndex:0,role:"button",type:"button"}),m=a.dom.createEl("div",{className:"series-section-data",index:n,innerHTML:"".concat((null===(i=t[n])||void 0===i?void 0:i.title)||"")});a.dom.createEl("div",{className:"series-title",innerHTML:"".concat((null===(l=t[n])||void 0===l?void 0:l.title)||"")}),a.dom.createEl("div",{className:"series-progress-bar",innerHTML:"<div style='width:".concat(t[n].watchedPercentage,"%' class='series-progress-bar-value'></div>")});var v=a.dom.createEl("div",{className:"series-section-image"}),p=(null===(r=t[n])||void 0===r?void 0:r.description)||"";(null===(d=p)||void 0===d?void 0:d.length)>170&&(p=p.substr(0,170)+"..."),a.dom.createEl("div",{className:"series-description",innerHTML:"".concat(p||"")});var h=a.dom.createEl("img",{className:"series-image"});h.src="".concat(N(null===(c=t[n])||void 0===c?void 0:c.img)),h.alt="Episode ".concat(n+1),a.dom.appendContent(v,h),a.dom.appendContent(u,v),a.dom.appendContent(u,m),a.dom.appendContent(s,u),u.onclick=function(e){e.stopPropagation(),o.loadSeriesAssetById(t,n)},u.onkeydown=function(e){"Enter"===e.key&&(e.stopPropagation(),o.loadSeriesAssetById(t,n))},m.onclick=function(t){var s,o,n,i=document.getElementsByClassName("series-selector-content")[0].childNodes,l=(i=e(i))[t.target.index].getElementsByClassName("series-section-expanded")[0];null!=l&&null!==(s=l.classList)&&void 0!==s&&s.contains("hidden")?(u.style.backgroundColor="#0000007d",null==l||null===(o=l.classList)||void 0===o||o.remove("hidden")):(null==l||null===(n=l.classList)||void 0===n||n.add("hidden"),u.style.backgroundColor="unset")}},i=0;i<t.length;i++)n(i);return parent}},{key:"showSeasonDetails",value:function(e){this.selectedSeason=e;for(var t=a.dom.$(".series-selector-content",this.el());null!=t&&t.firstChild;)t.removeChild(t.firstChild);var s=h()[e].episodes;this.getSeasonDetailsContainer(s,t);var o=a.dom.$(".series-selector-cross-icon",this.el());for(o.className="series-selector-back-icon";null!=o&&o.firstChild;)o.removeChild(o.firstChild);var n=C(c());o.appendChild(n),a.dom.$(".series-selector-title",this.el()).textContent="Season ".concat(e+1)}}]),w}();export{x as default};
@@ -1 +1 @@
1
- import{g as e}from"./skin-58b9263c.js";import{f as r,n as t}from"./features-0ccf9856.js";import{g as o}from"./renditions-6323832e.js";import{r as i}from"./captions-b7fd8308.js";import"@babel/runtime/helpers/toConsumableArray";import"video.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./generic-76d748e7.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-d4613b36.js";import"js-cookie";import"ua-parser-js";import"./localisation-0bf399a1.js";function s(s,n){import("./skin-271fa63f.js").then(function(e){var r=document.createElement("style");r.id="multiplayer_css",r.append("".concat(e.default)),document.head.appendChild(r)}),function(t,s){e(t).on("loadeddata",function(){var e;(null===(e=o(t))||void 0===e?void 0:e.length)>0&&r(t,s),null!=s&&s.disableCaptions&&i(t)})}(s,n),function(r){var o=e(r);o.controls(!1),t(r)}(s)}export{s as initialiseSkin};
1
+ import{g as e}from"./skin-58b9263c.js";import{f as r,n as t}from"./features-031a5a79.js";import{g as o}from"./renditions-6323832e.js";import{r as i}from"./captions-b7fd8308.js";import"@babel/runtime/helpers/toConsumableArray";import"video.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./generic-76d748e7.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-d4613b36.js";import"js-cookie";import"ua-parser-js";import"./localisation-0bf399a1.js";function s(s,n){import("./skin-271fa63f.js").then(function(e){var r=document.createElement("style");r.id="multiplayer_css",r.append("".concat(e.default)),document.head.appendChild(r)}),function(t,s){e(t).on("loadeddata",function(){var e;(null===(e=o(t))||void 0===e?void 0:e.length)>0&&r(t,s),null!=s&&s.disableCaptions&&i(t)})}(s,n),function(r){var o=e(r);o.controls(!1),t(r)}(s)}export{s as initialiseSkin};
@@ -1 +1 @@
1
- import{a as e,b as t,c as s,d as i,e as o}from"./features-0ccf9856.js";import{i as r}from"./index-c50e1261.js";import{S as n,M as l,a,N as m,b as d,R as p}from"./icons-0676e9c7.js";import{g as u,b as c}from"./skin-58b9263c.js";import{d as b}from"./generic-76d748e7.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./renditions-6323832e.js";import"./localisation-0bf399a1.js";import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"./util-80257541.js";import"./captions-b7fd8308.js";import"./resolution-fcace655.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/assertThisInitialized";import"./browser-d4613b36.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";import"axios";import"js-cookie";import"ua-parser-js";function v(v,h){u(v).addClass("skin_default"),r(v,h),import("./skin-71be210e.js").then(function(e){var t=document.createElement("style");t.id="def_skin",t.append("".concat(e.default)),document.head.appendChild(t)}),function(e,t){0==t.liveVideo&&0==t.liveui&&i(e,"default",d());(0==t.liveVideo&&0==t.liveui||1==t.liveui)&&o(e,"default",p())}(v,h),function(i,o){var r=u(i),l=(null==o?void 0:o.sres)||null;r.on("loadeddata",function(){e(i,"default",n()),l&&import("./nextEpisodeButton-df6e9d73.js").then(function(e){e.initaliseFunctionality(o.sres.seasons,b())})}),r.one("loadedmetadata",function(){var e;l&&(t(i,null==o||null===(e=o.sres)||void 0===e?void 0:e.seasons,o),s(o.sres,o.res,i))})}(v,h),function(e,t){var s,i,o,r,n=u(e),d=document.getElementsByClassName("vjs-current-time")[0],p=document.getElementsByClassName("vjs-duration")[0],b=document.getElementsByClassName("vjs-time-divider")[0];t.liveVideo&&(d&&(d.style.display="none"),p&&(p.style.display="none"),b&&(b.style.display="none"));null===(s=n.controlBar.getChild("FullscreenToggle"))||void 0===s||null===(i=s.el())||void 0===i||i.appendChild(c(l(window.controlsColor))),null===(o=n.controlBar.getChild("FullscreenToggle"))||void 0===o||null===(r=o.el())||void 0===r||r.appendChild(c(a(window.controlsColor)));var v=n.controlBar.getChild("SubsCapsButton").el();document.getElementById(e).getElementsByClassName("vjs-subs-caps-button")[1].appendChild(c(m()));var h=document.createElement("div");h.classList.add("caption-header"),v.querySelector(".vjs-menu-content").insertBefore(h,v.querySelector(".vjs-menu-item"))}(v,h)}export{v as initialiseSkin};
1
+ import{a as e,b as t,c as s,d as i,e as o}from"./features-031a5a79.js";import{i as r}from"./index-67c081c3.js";import{S as n,M as l,a,N as m,b as d,R as p}from"./icons-0676e9c7.js";import{g as u,b as c}from"./skin-58b9263c.js";import{d as b}from"./generic-76d748e7.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./renditions-6323832e.js";import"./localisation-0bf399a1.js";import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"./util-80257541.js";import"./captions-b7fd8308.js";import"./resolution-fcace655.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/assertThisInitialized";import"./browser-d4613b36.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";import"axios";import"js-cookie";import"ua-parser-js";function v(v,h){u(v).addClass("skin_default"),r(v,h),import("./skin-71be210e.js").then(function(e){var t=document.createElement("style");t.id="def_skin",t.append("".concat(e.default)),document.head.appendChild(t)}),function(e,t){0==t.liveVideo&&0==t.liveui&&i(e,"default",d());(0==t.liveVideo&&0==t.liveui||1==t.liveui)&&o(e,"default",p())}(v,h),function(i,o){var r=u(i),l=(null==o?void 0:o.sres)||null;r.on("loadeddata",function(){e(i,"default",n()),l&&import("./nextEpisodeButton-df6e9d73.js").then(function(e){e.initaliseFunctionality(o.sres.seasons,b())})}),r.one("loadedmetadata",function(){var e;l&&(t(i,null==o||null===(e=o.sres)||void 0===e?void 0:e.seasons,o),s(o.sres,o.res,i))})}(v,h),function(e,t){var s,i,o,r,n=u(e),d=document.getElementsByClassName("vjs-current-time")[0],p=document.getElementsByClassName("vjs-duration")[0],b=document.getElementsByClassName("vjs-time-divider")[0];t.liveVideo&&(d&&(d.style.display="none"),p&&(p.style.display="none"),b&&(b.style.display="none"));null===(s=n.controlBar.getChild("FullscreenToggle"))||void 0===s||null===(i=s.el())||void 0===i||i.appendChild(c(l(window.controlsColor))),null===(o=n.controlBar.getChild("FullscreenToggle"))||void 0===o||null===(r=o.el())||void 0===r||r.appendChild(c(a(window.controlsColor)));var v=n.controlBar.getChild("SubsCapsButton").el();document.getElementById(e).getElementsByClassName("vjs-subs-caps-button")[1].appendChild(c(m()));var h=document.createElement("div");h.classList.add("caption-header"),v.querySelector(".vjs-menu-content").insertBefore(h,v.querySelector(".vjs-menu-item"))}(v,h)}export{v as initialiseSkin};
@@ -0,0 +1 @@
1
+ import{h as o,o as l,p as i,q as e}from"./features-031a5a79.js";import{g as r}from"./skin-58b9263c.js";import{a as n,b as a}from"./index-810dc03a.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/helpers/toConsumableArray";import"videojs-contrib-quality-menu";import t from"video.js";import{i as s,s as d}from"./index-67c081c3.js";import{e as u,d as p,j as v}from"./generic-76d748e7.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./renditions-6323832e.js";import"./localisation-0bf399a1.js";import"./autoNextVideo-613b5bf9.js";import"./util-80257541.js";import"./icons-0676e9c7.js";import"@babel/runtime/helpers/typeof";import"video.js/dist/video-js.min.css";import"./captions-b7fd8308.js";import"./resolution-fcace655.js";import"@babel/runtime/helpers/assertThisInitialized";import"./browser-d4613b36.js";import"axios";import"js-cookie";import"ua-parser-js";function m(l,i){var e=r(l);e&&(e.on("loadeddata",function(){var o,e,a,t,s;!function(o){var l=r(o);l&&(null==l||l.qualityMenu,l.qualityMenu({useResolutionLabels:!0}))}(l),!(null!=i&&null!==(o=i.series)&&void 0!==o&&o.enable||null!==(e=window)&&void 0!==e&&null!==(a=e.app_data)&&void 0!==a&&null!==(t=a.appcmsMain)&&void 0!==t&&null!==(s=t.features)&&void 0!==s&&s.auto_play)||null!=i&&i.liveVideo||n(l,i)}),e.one("play",function(){var i,e,r,n;null!==(i=window)&&void 0!==i&&null!==(e=i.customData)&&void 0!==e&&e.iframeOverlayUrl&&o(l,null===(r=window)||void 0===r||null===(n=r.customData)||void 0===n?void 0:n.iframeOverlayUrl)}))}function c(o,n){r(o).addClass("skin_vlone"),m(o,n),function(o,r){var n,t,m,c,b,y,g,f,h,j,C,w,B=u(null==r?void 0:r.res,o)||{};B.src,(null==r||null===(n=r.relatedVideos)||void 0===n||null===(t=n.content)||void 0===t?void 0:t.length)>0&&l(o,null==r?void 0:r.relatedVideos);null!=r&&null!==(m=r.series)&&void 0!==m&&m.enable&&i(o,r);(null==r||null===(c=r.streams)||void 0===c?void 0:c.length)>1&&e(o,null==r?void 0:r.streams);if(a(o,r),s(o,r),"MEDIA_TAILOR"==(null===(b=window)||void 0===b||null===(y=b.app_data)||void 0===y||null===(g=y.appcmsMain)||void 0===g||null===(f=g.adsConfig)||void 0===f?void 0:f.vodAdSticherProvider)&&null!==(h=window)&&void 0!==h&&null!==(j=h.app_data)&&void 0!==j&&null!==(C=j.appcmsMain)&&void 0!==C&&null!==(w=C.adsConfig)&&void 0!==w&&w.vodAdClientSideTracking){var k,M=null;if(null!=r&&null!==(k=r.series)&&void 0!==k&&k.enable){var T,_,A,R=null===(T=p())||void 0===T||null===(_=T.video)||void 0===_||null===(A=_.gist)||void 0===A?void 0:A.id,q=v(),x=(null==q?void 0:q.get(R))||{t:0,p:0},P=x.t;x.p<95&&(M=P)}else{var O=r.watchHistoryResumeTime;r.watchedPercentage<95&&(M=O)}d(o,M)}}(o,n),b(o,n)}var b=function(o,l){var i,e,n,a,s,d,u,p,v,m,c,b,y=r(o),g=(null==l?void 0:l.theme)||{},f=t.dom.$(".vjs-play-progress"),h=t.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");h&&(h.style.color="".concat(null===(i=window)||void 0===i||null===(e=i.app_data)||void 0===e||null===(n=e.appcmsMain)||void 0===n||null===(a=n.brand)||void 0===a||null===(s=a.cta)||void 0===s||null===(d=s.primary)||void 0===d?void 0:d.backgroundColor)),f&&(f.style.background="".concat(null===(u=window)||void 0===u||null===(p=u.app_data)||void 0===p||null===(v=p.appcmsMain)||void 0===v||null===(m=v.brand)||void 0===m||null===(c=m.cta)||void 0===c||null===(b=c.primary)||void 0===b?void 0:b.backgroundColor));var j=y.getChild("BigPlayButton")||null;(null==g?void 0:g.progressBarColor)&&f&&(f.style.background=g.progressBarColor),(null==g?void 0:g.playButtonBackgroundColor)&&j&&(j.el().style.background=g.playButtonBackgroundColor),(null==g?void 0:g.playButtonColor)&&h&&(h.style.color=g.playButtonColor),(null==g?void 0:g.playButtonType)&&("square"==(null==g?void 0:g.playButtonType)?j.el().style.borderRadius=".3em":j.el().style.borderRadius="1.3em")};export{c as initialiseSkin};
@@ -1 +1 @@
1
- import{f as e,g as t,h as r,d as n,e as i,i as l,j as a,k as o,l as u,m as s}from"./features-0ccf9856.js";import{M as c,a as d,c as p,d as m}from"./icons-0676e9c7.js";import{t as v,g as f,b as h}from"./skin-58b9263c.js";import{g as b}from"./renditions-6323832e.js";import{g}from"./captions-b7fd8308.js";import{a as y,b as x}from"./index-810dc03a.js";import j from"@babel/runtime/helpers/asyncToGenerator";import w from"@babel/runtime/regenerator";import k from"@babel/runtime/helpers/defineProperty";import E from"@babel/runtime/helpers/slicedToArray";import{d as N}from"./generic-76d748e7.js";import{i as A,d as C}from"./browser-d4613b36.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/toConsumableArray";import"./autoNextVideo-613b5bf9.js";import"./util-80257541.js";import"@babel/runtime/helpers/typeof";import"axios";import"js-cookie";import"ua-parser-js";function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach(function(t){k(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var I="my-player";function S(e){var t=e.split("\n"),r=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),n={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(n.resolution=e.split("=")[1]),e.includes("URI")&&(n.uri=e.split("=")[1].replace(/"/g,""))}),r.push(n)}}),r}function M(){return(M=j(w.mark(function e(t){var r,n,i,l,a,o,u,s,c,d,p,m,v,f,h,b,g,y,x,j,k,N,A,C;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return r=e.sent,e.next=8,r.blob();case 8:return n=e.sent,e.next=11,createImageBitmap(n);case 11:for(i=e.sent,l=t.layout.split("x").map(Number),a=E(l,2),o=a[0],u=a[1],s=i.width/u,c=i.height/o,d=[],p=0;p<o;p++)for(m=0;m<u;m++)(v=document.createElement("canvas")).width=s,v.height=c,v.getContext("2d").drawImage(i,m*s,p*c,s,c,0,0,s,c),f=v.toDataURL("image/png"),d.push({uri:f,duration:t.duration}),t._tiles=d;return e.abrupt("return",d);case 20:for(e.prev=20,e.t0=e.catch(2),h=t.layout.split("x").map(Number),b=E(h,2),g=b[0],y=b[1],x=[],j=0;j<g*y;j++)x.push({uri:null===(k=window)||void 0===k||null===(N=k.app_data)||void 0===N||null===(A=N.appcmsMain)||void 0===A||null===(C=A.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",x);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function B(e,t){return R.apply(this,arguments)}function R(){return(R=j(w.mark(function e(t,r){var n,i;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return I=r,e.prev=1,e.next=4,fetch(t);case 4:return n=e.sent,e.next=7,n.text();case 7:return i=e.sent,e.abrupt("return",S(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function P(e,t,r){var n=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),i=f(I);if(n&&i){var l=n.getBoundingClientRect(),a=(e.clientX-l.left)/l.width,o=function(e,t){var r,n;if(!t||0===t.length)return null;var i=0,l=t.length-1;for(;i<=l;){var a=Math.floor((i+l)/2),o=t[a];if(o===e)return o;o<e?i=a+1:l=a-1}var u=null!==(r=t[i])&&void 0!==r?r:1/0,s=null!==(n=t[l])&&void 0!==n?n:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(a*i.duration()),r),u=t[o];u&&!u.loading&&(u.loading=!0,function(e){return M.apply(this,arguments)}(u).then(function(e){var t=e[u.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),u.loading=!1,u.src=t.uri}))}}function D(e){return L.apply(this,arguments)}function L(){return(L=j(w.mark(function e(t){var r,n,i,l;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r={},t.forEach(function(e,t){for(var n=e.layout.split("x").map(Number),i=E(n,2),l=i[0]*i[1],a=e.duration,o=0;o<l;o++){var u,s=Math.round((t*l+o)*a);r[s]=T(T({},e),{},{duration:e.duration,tileIndex:o,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},k(u,"left","-60px"),k(u,"border","1px solid transparent"),k(u,"borderRadius","4px"),u)})}}),n=Object.keys(r).map(Number).sort(function(e,t){return e-t}),null==(i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||i.addEventListener("mousemove",v(function(e){return P(e,r,n)},500)),null==(l=document.querySelector(".vjs-progress-control.vjs-control"))||l.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",v(function(e){return P(e,r,n)},500))}),e.abrupt("return",r);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var V=function(){var e=j(w.mark(function e(t,r){var n,i,l,a,o,u,s,c;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+r);case 2:return n=e.sent,e.next=5,n.text();case 5:i=e.sent,l=i.split("\n").map(function(e){return e.trim()}),a=[],o=null,u=0;case 10:if(!(u<(null==l?void 0:l.length))){e.next=27;break}if(!(s=l[u]).startsWith("#EXT-X-TILES")){e.next=19;break}o={resolution:null,duration:null,uri:null,layout:null},c=s.split(":")[1]||"",c.split(",").forEach(function(e){var t=e.split("="),r=E(t,2),n=r[0],i=r[1];n&&i&&(o[n.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(o.uri=s.includes("http")?s:t+s,a.push(o),o=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}();function $(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function U(e,t){return _.apply(this,arguments)}function _(){return(_=j(w.mark(function e(t,r){var n,i,l,a,o,u,s,c,d,p,m,v,h,b,g,y,x,j,k,A,C,O,T,S,M,B,R,P,D,L,V,U,_,q,z,W,G,H,J,K,Q,Y,Z,ee,te,re,ne,ie,le,ae,oe,ue,se,ce,de,pe,me,ve;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return I=r,n=f(r),i=t.split("/"),l=i.findIndex(function(e){return"dash"===e.toLowerCase()}),a=$(-1!==l?i.slice(0,l+1).join("/"):new URL(t).origin),e.prev=5,e.next=8,fetch(t);case 8:return c=e.sent,e.next=11,c.text();case 11:d=e.sent,p=new DOMParser,m=p.parseFromString(d,"application/xml"),v=(null==n?void 0:n.duration())||(null===(o=N())||void 0===o||null===(u=o.video)||void 0===u?void 0:u.runtime),h=(null==m||null===(s=m.querySelector("MPD > BaseURL"))||void 0===s?void 0:s.textContent)||a+"/",b=m.getElementsByTagName("AdaptationSet"),g=0;case 18:if(!(g<b.length)){e.next=72;break}if(("image"!==(y=b[g]).getAttribute("contentType")||"image/png"!==y.getAttribute("mimeType"))&&"image/jpeg"!==y.getAttribute("mimeType")){e.next=69;break}if(j=y.getElementsByTagName("SegmentTemplate")[0],k=null===(x=j.getElementsByTagName("SegmentTimeline"))||void 0===x?void 0:x[0],!j||!k){e.next=48;break}if(O=k.getElementsByTagName("S"),T=parseInt(null===(A=O[0])||void 0===A?void 0:A.getAttribute("t")),S=parseInt(null===(C=O[0])||void 0===C?void 0:C.getAttribute("d")),M=y.getElementsByTagName("Representation")[0],B=M.getElementsByTagName("EssentialProperty")[0],R=B.getAttribute("value"),P=null==R?void 0:R.split("x"),D=E(P,2),L=D[0],V=D[1],!j){e.next=46;break}if(j.getAttribute("media"),U=j.getAttribute("timescale"),_=(U?S/U:S)/(L*V),q=M.getAttribute("id"),z=Math.round(v/_),W=Math.ceil(z/(L*V)),G=j.getAttribute("media"),parseInt(j.getAttribute("startNumber")),!isNaN(parseInt(W))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],g=0;g<W;g++)K="/"==(J=G)[0]?new URL(a).origin:a+"/",H.push({duration:_,layout:R,uri:K+J.replace("$Time$",T+g*S).replace("$RepresentationID$",q)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(Q=y.getElementsByTagName("Representation")[0],Y=Q.getElementsByTagName("EssentialProperty")[0],Z=Y.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=E(ee,2),re=te[0],ne=te[1],!j){e.next=69;break}if(j.getAttribute("media"),ie=j.getAttribute("duration"),le=j.getAttribute("timescale"),ae=(le?ie/le:ie)/(re*ne),oe=Q.getAttribute("id"),ue=Math.round(v/ae),se=Math.ceil(ue/(re*ne)),ce=j.getAttribute("media"),de=parseInt(j.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],me=F(ce),g=0;g<se;g++)ve=me?X(me,g+de):ce,pe.push({duration:ae,layout:Z,uri:h+ve.replace("$Number$",g+de).replace("$RepresentationID$",oe)});return e.abrupt("return",pe);case 69:g++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function F(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function X(e,t){var r=e.match(/%0(\d+)d/);if(!r)return e;var n=parseInt(r[1],10),i=String(t).padStart(n,"0");return e.replace(/\$Number%0\d+d\$/,i)}function q(){return(q=j(w.mark(function e(t){var r,n,i,l,a,o,u,s,c,d,p,m,v,h,b,g;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=f(t),u=o.currentSource(),s=u.src,s=null!==(r=s)&&void 0!==r&&r.includes("blob")?null===(n=window)||void 0===n||null===(i=n.player)||void 0===i?void 0:i.getSource():s,null===(l=s)||void 0===l||!l.includes("m3u8")){e.next=19;break}return e.next=6,B(s,t);case 6:if(!((null==(c=e.sent)?void 0:c.length)>0)){e.next=17;break}return d=(null==c?void 0:c[0])||null,p=d.uri,m=s.substring(0,s.lastIndexOf("/"))+"/",e.next=12,V(m,p);case 12:return v=e.sent,e.next=15,D(v);case 15:h=e.sent,o.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(a=s)||void 0===a||!a.includes("mpd")){e.next=28;break}return e.next=22,U(s,t);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,D(b);case 26:g=e.sent,o.thumbnails(g);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}function z(n,i){var l=f(n);l&&(l.on("loadeddata",function(){var r,a,o,u,s,c,d;(null===(r=b(n))||void 0===r?void 0:r.length)>0&&e(n,i),(null===(a=g(n))||void 0===a?void 0:a.length)>0&&t(n,i),!(null!=i&&null!==(o=i.series)&&void 0!==o&&o.enable||null!==(u=window)&&void 0!==u&&null!==(s=u.app_data)&&void 0!==s&&null!==(c=s.appcmsMain)&&void 0!==c&&null!==(d=c.features)&&void 0!==d&&d.auto_play)||null!=i&&i.liveVideo||y(n,i),function(e,t){var r,n=Math.floor(e/60),i=null===(r=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===r?void 0:r[0];i&&(i.style.marginRight=n>60?"56px":"41px");var l=document.getElementsByClassName("vjs-live-control")[0],a=document.getElementsByClassName("vjs-time-control");t&&l.classList.value.includes("vjs-hidden")&&(a[0].style.display="block",i&&(i.style.marginRight="56px"))}(l.duration(),(null==i?void 0:i.liveVideo)||!1),null!=i&&i.liveVideo||A()||function(e){q.apply(this,arguments)}(n)}),l.one("play",function(){var e,t,i,l;null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.iframeOverlayUrl&&r(n,null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.iframeOverlayUrl)}))}function W(e,t){f(e).addClass("skin_defaultv2"),function(){"Chrome"==C()&&import("./chromett-a3cbb2e1.js").then(function(e){var t=document.createElement("style");t.id="chromett",t.append("".concat(e.default)),document.head.appendChild(t)});import("./skin-e4b35c14.js").then(function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)})}(),z(e,t),function(e,t){var r,n,i,l,a,o,u=f(e);null==u||null===(r=u.controlBar)||void 0===r||null===(n=r.getChild("FullscreenToggle"))||void 0===n||null===(i=n.el())||void 0===i||i.appendChild(h(c(window.controlsColor))),null==u||null===(l=u.controlBar)||void 0===l||null===(a=l.getChild("FullscreenToggle"))||void 0===a||null===(o=a.el())||void 0===o||o.appendChild(h(d(window.controlsColor)));var s=document.getElementsByClassName("vjs-time-control");t.liveVideo&&s[0]&&(s[0].style.display="none")}(e,t),function(e,t){var r,c,d,v,f,h;0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)&&n(e,"defaultV2",p());(0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)||1==(null==t?void 0:t.liveui))&&i(e,"defaultV2",m());t.liveVideo||l(e);(null==t||null===(r=t.relatedVideos)||void 0===r||null===(c=r.content)||void 0===c?void 0:c.length)>0&&a(e,null==t?void 0:t.relatedVideos);(null==t||null===(d=t.streams)||void 0===d?void 0:d.length)>1&&o(e,null==t?void 0:t.streams);(null==t||null===(v=t.playlist)||void 0===v||null===(f=v.content)||void 0===f?void 0:f.length)>0&&u(e,null==t?void 0:t.playlist);null!=t&&null!==(h=t.series)&&void 0!==h&&h.enable&&s(e,t)}(e,t),x(e,t)}export{W as initialiseSkin};
1
+ import{f as e,g as t,h as r,d as n,e as i,i as l,j as a,k as o,l as u,m as s}from"./features-031a5a79.js";import{M as c,a as d,c as p,d as m}from"./icons-0676e9c7.js";import{t as v,g as f,b as h}from"./skin-58b9263c.js";import{g as b}from"./renditions-6323832e.js";import{g}from"./captions-b7fd8308.js";import{a as y,b as x}from"./index-810dc03a.js";import j from"@babel/runtime/helpers/asyncToGenerator";import w from"@babel/runtime/regenerator";import k from"@babel/runtime/helpers/defineProperty";import E from"@babel/runtime/helpers/slicedToArray";import{d as N}from"./generic-76d748e7.js";import{i as A,d as C}from"./browser-d4613b36.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/toConsumableArray";import"./autoNextVideo-613b5bf9.js";import"./util-80257541.js";import"@babel/runtime/helpers/typeof";import"axios";import"js-cookie";import"ua-parser-js";function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach(function(t){k(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var I="my-player";function S(e){var t=e.split("\n"),r=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),n={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(n.resolution=e.split("=")[1]),e.includes("URI")&&(n.uri=e.split("=")[1].replace(/"/g,""))}),r.push(n)}}),r}function M(){return(M=j(w.mark(function e(t){var r,n,i,l,a,o,u,s,c,d,p,m,v,f,h,b,g,y,x,j,k,N,A,C;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return r=e.sent,e.next=8,r.blob();case 8:return n=e.sent,e.next=11,createImageBitmap(n);case 11:for(i=e.sent,l=t.layout.split("x").map(Number),a=E(l,2),o=a[0],u=a[1],s=i.width/u,c=i.height/o,d=[],p=0;p<o;p++)for(m=0;m<u;m++)(v=document.createElement("canvas")).width=s,v.height=c,v.getContext("2d").drawImage(i,m*s,p*c,s,c,0,0,s,c),f=v.toDataURL("image/png"),d.push({uri:f,duration:t.duration}),t._tiles=d;return e.abrupt("return",d);case 20:for(e.prev=20,e.t0=e.catch(2),h=t.layout.split("x").map(Number),b=E(h,2),g=b[0],y=b[1],x=[],j=0;j<g*y;j++)x.push({uri:null===(k=window)||void 0===k||null===(N=k.app_data)||void 0===N||null===(A=N.appcmsMain)||void 0===A||null===(C=A.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",x);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function B(e,t){return R.apply(this,arguments)}function R(){return(R=j(w.mark(function e(t,r){var n,i;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return I=r,e.prev=1,e.next=4,fetch(t);case 4:return n=e.sent,e.next=7,n.text();case 7:return i=e.sent,e.abrupt("return",S(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function P(e,t,r){var n=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),i=f(I);if(n&&i){var l=n.getBoundingClientRect(),a=(e.clientX-l.left)/l.width,o=function(e,t){var r,n;if(!t||0===t.length)return null;var i=0,l=t.length-1;for(;i<=l;){var a=Math.floor((i+l)/2),o=t[a];if(o===e)return o;o<e?i=a+1:l=a-1}var u=null!==(r=t[i])&&void 0!==r?r:1/0,s=null!==(n=t[l])&&void 0!==n?n:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(a*i.duration()),r),u=t[o];u&&!u.loading&&(u.loading=!0,function(e){return M.apply(this,arguments)}(u).then(function(e){var t=e[u.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),u.loading=!1,u.src=t.uri}))}}function D(e){return L.apply(this,arguments)}function L(){return(L=j(w.mark(function e(t){var r,n,i,l;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r={},t.forEach(function(e,t){for(var n=e.layout.split("x").map(Number),i=E(n,2),l=i[0]*i[1],a=e.duration,o=0;o<l;o++){var u,s=Math.round((t*l+o)*a);r[s]=T(T({},e),{},{duration:e.duration,tileIndex:o,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},k(u,"left","-60px"),k(u,"border","1px solid transparent"),k(u,"borderRadius","4px"),u)})}}),n=Object.keys(r).map(Number).sort(function(e,t){return e-t}),null==(i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||i.addEventListener("mousemove",v(function(e){return P(e,r,n)},500)),null==(l=document.querySelector(".vjs-progress-control.vjs-control"))||l.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",v(function(e){return P(e,r,n)},500))}),e.abrupt("return",r);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var V=function(){var e=j(w.mark(function e(t,r){var n,i,l,a,o,u,s,c;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+r);case 2:return n=e.sent,e.next=5,n.text();case 5:i=e.sent,l=i.split("\n").map(function(e){return e.trim()}),a=[],o=null,u=0;case 10:if(!(u<(null==l?void 0:l.length))){e.next=27;break}if(!(s=l[u]).startsWith("#EXT-X-TILES")){e.next=19;break}o={resolution:null,duration:null,uri:null,layout:null},c=s.split(":")[1]||"",c.split(",").forEach(function(e){var t=e.split("="),r=E(t,2),n=r[0],i=r[1];n&&i&&(o[n.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(o.uri=s.includes("http")?s:t+s,a.push(o),o=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}();function $(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function U(e,t){return _.apply(this,arguments)}function _(){return(_=j(w.mark(function e(t,r){var n,i,l,a,o,u,s,c,d,p,m,v,h,b,g,y,x,j,k,A,C,O,T,S,M,B,R,P,D,L,V,U,_,q,z,W,G,H,J,K,Q,Y,Z,ee,te,re,ne,ie,le,ae,oe,ue,se,ce,de,pe,me,ve;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return I=r,n=f(r),i=t.split("/"),l=i.findIndex(function(e){return"dash"===e.toLowerCase()}),a=$(-1!==l?i.slice(0,l+1).join("/"):new URL(t).origin),e.prev=5,e.next=8,fetch(t);case 8:return c=e.sent,e.next=11,c.text();case 11:d=e.sent,p=new DOMParser,m=p.parseFromString(d,"application/xml"),v=(null==n?void 0:n.duration())||(null===(o=N())||void 0===o||null===(u=o.video)||void 0===u?void 0:u.runtime),h=(null==m||null===(s=m.querySelector("MPD > BaseURL"))||void 0===s?void 0:s.textContent)||a+"/",b=m.getElementsByTagName("AdaptationSet"),g=0;case 18:if(!(g<b.length)){e.next=72;break}if(("image"!==(y=b[g]).getAttribute("contentType")||"image/png"!==y.getAttribute("mimeType"))&&"image/jpeg"!==y.getAttribute("mimeType")){e.next=69;break}if(j=y.getElementsByTagName("SegmentTemplate")[0],k=null===(x=j.getElementsByTagName("SegmentTimeline"))||void 0===x?void 0:x[0],!j||!k){e.next=48;break}if(O=k.getElementsByTagName("S"),T=parseInt(null===(A=O[0])||void 0===A?void 0:A.getAttribute("t")),S=parseInt(null===(C=O[0])||void 0===C?void 0:C.getAttribute("d")),M=y.getElementsByTagName("Representation")[0],B=M.getElementsByTagName("EssentialProperty")[0],R=B.getAttribute("value"),P=null==R?void 0:R.split("x"),D=E(P,2),L=D[0],V=D[1],!j){e.next=46;break}if(j.getAttribute("media"),U=j.getAttribute("timescale"),_=(U?S/U:S)/(L*V),q=M.getAttribute("id"),z=Math.round(v/_),W=Math.ceil(z/(L*V)),G=j.getAttribute("media"),parseInt(j.getAttribute("startNumber")),!isNaN(parseInt(W))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],g=0;g<W;g++)K="/"==(J=G)[0]?new URL(a).origin:a+"/",H.push({duration:_,layout:R,uri:K+J.replace("$Time$",T+g*S).replace("$RepresentationID$",q)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(Q=y.getElementsByTagName("Representation")[0],Y=Q.getElementsByTagName("EssentialProperty")[0],Z=Y.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=E(ee,2),re=te[0],ne=te[1],!j){e.next=69;break}if(j.getAttribute("media"),ie=j.getAttribute("duration"),le=j.getAttribute("timescale"),ae=(le?ie/le:ie)/(re*ne),oe=Q.getAttribute("id"),ue=Math.round(v/ae),se=Math.ceil(ue/(re*ne)),ce=j.getAttribute("media"),de=parseInt(j.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],me=F(ce),g=0;g<se;g++)ve=me?X(me,g+de):ce,pe.push({duration:ae,layout:Z,uri:h+ve.replace("$Number$",g+de).replace("$RepresentationID$",oe)});return e.abrupt("return",pe);case 69:g++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function F(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function X(e,t){var r=e.match(/%0(\d+)d/);if(!r)return e;var n=parseInt(r[1],10),i=String(t).padStart(n,"0");return e.replace(/\$Number%0\d+d\$/,i)}function q(){return(q=j(w.mark(function e(t){var r,n,i,l,a,o,u,s,c,d,p,m,v,h,b,g;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=f(t),u=o.currentSource(),s=u.src,s=null!==(r=s)&&void 0!==r&&r.includes("blob")?null===(n=window)||void 0===n||null===(i=n.player)||void 0===i?void 0:i.getSource():s,null===(l=s)||void 0===l||!l.includes("m3u8")){e.next=19;break}return e.next=6,B(s,t);case 6:if(!((null==(c=e.sent)?void 0:c.length)>0)){e.next=17;break}return d=(null==c?void 0:c[0])||null,p=d.uri,m=s.substring(0,s.lastIndexOf("/"))+"/",e.next=12,V(m,p);case 12:return v=e.sent,e.next=15,D(v);case 15:h=e.sent,o.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(a=s)||void 0===a||!a.includes("mpd")){e.next=28;break}return e.next=22,U(s,t);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,D(b);case 26:g=e.sent,o.thumbnails(g);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}function z(n,i){var l=f(n);l&&(l.on("loadeddata",function(){var r,a,o,u,s,c,d;(null===(r=b(n))||void 0===r?void 0:r.length)>0&&e(n,i),(null===(a=g(n))||void 0===a?void 0:a.length)>0&&t(n,i),!(null!=i&&null!==(o=i.series)&&void 0!==o&&o.enable||null!==(u=window)&&void 0!==u&&null!==(s=u.app_data)&&void 0!==s&&null!==(c=s.appcmsMain)&&void 0!==c&&null!==(d=c.features)&&void 0!==d&&d.auto_play)||null!=i&&i.liveVideo||y(n,i),function(e,t){var r,n=Math.floor(e/60),i=null===(r=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===r?void 0:r[0];i&&(i.style.marginRight=n>60?"56px":"41px");var l=document.getElementsByClassName("vjs-live-control")[0],a=document.getElementsByClassName("vjs-time-control");t&&l.classList.value.includes("vjs-hidden")&&(a[0].style.display="block",i&&(i.style.marginRight="56px"))}(l.duration(),(null==i?void 0:i.liveVideo)||!1),null!=i&&i.liveVideo||A()||function(e){q.apply(this,arguments)}(n)}),l.one("play",function(){var e,t,i,l;null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.iframeOverlayUrl&&r(n,null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.iframeOverlayUrl)}))}function W(e,t){f(e).addClass("skin_defaultv2"),function(){"Chrome"==C()&&import("./chromett-a3cbb2e1.js").then(function(e){var t=document.createElement("style");t.id="chromett",t.append("".concat(e.default)),document.head.appendChild(t)});import("./skin-e4b35c14.js").then(function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)})}(),z(e,t),function(e,t){var r,n,i,l,a,o,u=f(e);null==u||null===(r=u.controlBar)||void 0===r||null===(n=r.getChild("FullscreenToggle"))||void 0===n||null===(i=n.el())||void 0===i||i.appendChild(h(c(window.controlsColor))),null==u||null===(l=u.controlBar)||void 0===l||null===(a=l.getChild("FullscreenToggle"))||void 0===a||null===(o=a.el())||void 0===o||o.appendChild(h(d(window.controlsColor)));var s=document.getElementsByClassName("vjs-time-control");t.liveVideo&&s[0]&&(s[0].style.display="none")}(e,t),function(e,t){var r,c,d,v,f,h;0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)&&n(e,"defaultV2",p());(0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)||1==(null==t?void 0:t.liveui))&&i(e,"defaultV2",m());t.liveVideo||l(e);(null==t||null===(r=t.relatedVideos)||void 0===r||null===(c=r.content)||void 0===c?void 0:c.length)>0&&a(e,null==t?void 0:t.relatedVideos);(null==t||null===(d=t.streams)||void 0===d?void 0:d.length)>1&&o(e,null==t?void 0:t.streams);(null==t||null===(v=t.playlist)||void 0===v||null===(f=v.content)||void 0===f?void 0:f.length)>0&&u(e,null==t?void 0:t.playlist);null!=t&&null!==(h=t.series)&&void 0!==h&&h.enable&&s(e,t)}(e,t),x(e,t)}export{W as initialiseSkin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "2.0.105-backup",
3
+ "version": "2.0.107-backup",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "amdName": "_playerCore",
6
6
  "dependencies": {