@viewlift/player-backup 2.0.168-backup → 2.0.169-backup

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/bundle.css CHANGED
@@ -397,8 +397,6 @@
397
397
 
398
398
 
399
399
 
400
-
401
-
402
400
  .video-js .multicamera-parent.default{
403
401
  height: 345px;
404
402
  position: absolute;
@@ -480,6 +478,8 @@
480
478
 
481
479
 
482
480
 
481
+
482
+
483
483
  /* nextep */
484
484
  .next-ep-preview{
485
485
  position: absolute;
@@ -555,38 +555,6 @@
555
555
  margin-left: 8px;
556
556
  }
557
557
  }
558
- /* a wrapper element that tracks the mouse vertically */
559
- .vjs-thumbnail-holder {
560
- position: absolute;
561
- left: -1000px;
562
- }
563
-
564
- /* the thumbnail image itself */
565
- .vjs-thumbnail {
566
- position: absolute;
567
- left: 0;
568
- bottom: 1.3em;
569
- opacity: 0;
570
- transition: opacity .2s ease;
571
- -webkit-transition: opacity .2s ease;
572
- -moz-transition: opacity .2s ease;
573
- -mz-transition: opacity .2s ease;
574
- }
575
-
576
- /* fade in the thumbnail when hovering over the progress bar */
577
- /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
578
- .vjs-progress-control:hover .vjs-thumbnail,
579
- .vjs-progress-control.fake-active .vjs-thumbnail,
580
- .vjs-progress-control:active .vjs-thumbnail {
581
- opacity: 1;
582
- }
583
-
584
- /* ... but hide the thumbnail when hovering directly over it */
585
- .vjs-progress-control:hover .vjs-thumbnail:hover,
586
- .vjs-progress-control:active .vjs-thumbnail:active {
587
- opacity: 0;
588
- }
589
-
590
558
  .video-js.vjs-quality-menu {
591
559
  display: block;
592
560
  }
@@ -657,6 +625,38 @@
657
625
  -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
658
626
  animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
659
627
  }
628
+ /* a wrapper element that tracks the mouse vertically */
629
+ .vjs-thumbnail-holder {
630
+ position: absolute;
631
+ left: -1000px;
632
+ }
633
+
634
+ /* the thumbnail image itself */
635
+ .vjs-thumbnail {
636
+ position: absolute;
637
+ left: 0;
638
+ bottom: 1.3em;
639
+ opacity: 0;
640
+ transition: opacity .2s ease;
641
+ -webkit-transition: opacity .2s ease;
642
+ -moz-transition: opacity .2s ease;
643
+ -mz-transition: opacity .2s ease;
644
+ }
645
+
646
+ /* fade in the thumbnail when hovering over the progress bar */
647
+ /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
648
+ .vjs-progress-control:hover .vjs-thumbnail,
649
+ .vjs-progress-control.fake-active .vjs-thumbnail,
650
+ .vjs-progress-control:active .vjs-thumbnail {
651
+ opacity: 1;
652
+ }
653
+
654
+ /* ... but hide the thumbnail when hovering directly over it */
655
+ .vjs-progress-control:hover .vjs-thumbnail:hover,
656
+ .vjs-progress-control:active .vjs-thumbnail:active {
657
+ opacity: 0;
658
+ }
659
+
660
660
  .vjs-poster {
661
661
  display: inline-block;
662
662
  vertical-align: middle;
@@ -1 +1 @@
1
- "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator");require("axios");var o=require("./generic-9f637989.js"),i=require("./player_instance-fcf6a8fb.js"),r=require("video.js"),l=require("./util-ca307e43.js"),a=require("./captions-dbc83a75.js"),s=require("./resolution-f9dcc1b4.js"),u=require("./skin-516012d7.js"),d=require("./localisation-56e0a999.js"),c=require("./currentVideoInfo-31d70bec.js"),v=require("@babel/runtime/helpers/typeof"),p=require("./icons-2609dbe4.js"),f=require("./helper-a50a8ffc.js"),m=require("@babel/runtime/helpers/toConsumableArray"),g=function(e){return new Promise((function(n,t){if(y(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)}}))},y=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},h=function(e,n,t){var o=i.getPlayer(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,"'")})},b=function(e){var n=i.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},w=function(){var e=n(t.mark((function e(n){var l,a,s,u,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=i.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable||!(null!=n&&n.chromecastReceiverId||null!=n&&n.airplay)){e.next=10;break}return e.prev=2,e.next=5,g("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.log("Error",e.t0);case 10:if(null!=n&&null!==(a=n.series)&&void 0!==a&&a.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=13,import("@silvermine/videojs-chromecast");case 13:e.sent.default(r),(d=r.getTech("chromecast"))&&!d.prototype.seeking&&(d.prototype.seeking=function(){}),null!==(u=window)&&void 0!==u&&u.cast?null==s||s.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==s||s.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==o.detectBrowser()?null==s||s.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(n){return e.apply(this,arguments)}}(),k=function(e,n){var t=i.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,l,a,s=this.el(),u=r.dom.getPointerPosition(s,n).x;r.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*u,v.seek()}}))};var I=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),g("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)}}(),S=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.resolve().then((function(){return xe}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=n(t.mark((function e(){return t.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){r.getPlugin("eme")||r.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=n(t.mark((function e(){var n;return t.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(r),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)}}(),O=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./index-3f0e537b.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)}}(),C=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./videojs-dash5.es-3854764f.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)}}(),D=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){g("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(r)}))},loadAdsLibrary:I,loadEMELibrary:P,loadMuxPlugin:T,loadDvrSeekbar:O,loadContribDash:C,loadComscorePlugin:S});function j(e){return E.apply(this,arguments)}function E(){return(E=n(t.mark((function e(n){var i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(null==n?void 0:n.airplay)||!1,e.next=3,I();case 3:i&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return D})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(e){return x.apply(this,arguments)}function x(){return(x=n(t.mark((function e(n){var o,r,l,a,s,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=i.getPlayer(n.playerId),e.next=3,S();case 3:u.comscore({publisherId:null==n||null===(o=n.comscore)||void 0===o?void 0:o.publishedId,endpoint:null==n||null===(r=n.comscore)||void 0===r?void 0:r.endpoint,implementationId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.implementationId,projectId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.projectId,debug:(null==n||null===(s=n.comscore)||void 0===s?void 0:s.debug)||!1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(e,n){return L.apply(this,arguments)}function L(){return(L=n(t.mark((function e(n,i){var r,l,a,s,u,d,c,v,p,f,m,g;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==i?void 0:i.contentType)||"video",p=null==i||null===(r=i[v])||void 0===r?void 0:r.drmEnabled,null==i||null===(l=i[v])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==i||null===(s=i[v])||void 0===s||null===(u=s.streamingInfo)||void 0===u||null===(d=u.videoAssets)||void 0===d?void 0:d.dash)||null,m=(null==n||null===(c=n.comscore)||void 0===c?void 0:c.enable)||!1,e.prev=6,A(n),e.next=10,Promise.allSettled([p?"Safari"==o.detectBrowser()?P():"caliente"!=(null===(g=window)||void 0===g?void 0:g.siteName)?C():P():"Safari"!=o.detectBrowser()&&f?C():null,m?w(n):null,w(n)]);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),console.log("Error",e.t0);case 15:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function _(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 R(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?_(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):_(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var M=new Set,V=null,B=function(e,n,t){var i,r,l,a,s,u,d,v={},p=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(i=e[p])||void 0===i?void 0:i.id)||"Null",v["c3.cm.contentType"]=G(e),v[null==t||null===(r=t.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==e||!e.linearchannel),v[null==t||null===(l=t.Constants)||void 0===l?void 0:l.STREAM_URL]=n.currentSrc(),v[null==t||null===(a=t.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===o.getUserId()?"NULL":o.getUserId(),v["c3.cm.categoryType"]=F(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(s=e[p])||void 0===s?void 0:s.drmEnabled)||"None",v.DAIStream=null!==(u=e[p])&&void 0!==u&&null!==(d=u.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[t.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=W(e),v["c3.cm.genreList"]=U(e),v["c3.cm.genre"]=H(e),v["c3.cm.channel"]=q(e);var f=Y(c.getCurrentSeries(),e);return v=R(R({},v),f)},H=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},U=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"},q=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"},F=function(e){return(null==e?void 0:e.contentType)||"null"},W=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},z=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},G=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var K,J,Y=function(e,n){var t,i,r,l,a,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return s;var u=o.getSeasonNumber(),d=o.getEpisodeNumber();return s["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(i=t.series)||void 0===i?void 0:i.title)||"Null",s["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",s["c3.cm.showTitle"]=(null==e||null===(r=e[u-1])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",s["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",s},X=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"}},Q=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},$=function(){var e=n(t.mark((function e(n,o){var r,l,a,s,u,d,v,p,f,m;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(null==o?void 0:o.convivaConfig)||{},l=r.trackConvivaPlayerEvent,a=r.paymentHandler,s=r.tveProvider,u=r.enable,d=r.appName,v=(o||{}).token,u){e.next=4;break}return e.abrupt("return");case 4:if(p=i.getPlayer(n),"function"==typeof(f=l)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,f("getConvivaObject");case 10:if(m=e.sent){e.next=13;break}return e.abrupt("return");case 13:p.ready((function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=X(t.keySystem);f("contentInfo",{DRMEnabled:o})}else f("contentInfo",{DRMEnabled:"None"})})),n||f("contentInfo",{DRMEnabled:"None"})})),p.on("loadstart",(function(){var e,n;V&&V!==p.currentSrc()&&f("playbackEnded"),f("setPlayer",p),M.clear(),V=p.currentSrc();var t=Q(p.currentType()),i=c.getCurrentVideo(),r=B(i,p,m);r[null==m||null===(e=m.Constants)||void 0===e?void 0:e.PLAYER_NAME]=d||"WEB",r[null==m||null===(n=m.Constants)||void 0===n?void 0:n.ASSET_NAME]=z(i,o),r.authToken=v||"NULL",r.streamType=t,r.D2CType=a||"NONE",r.subscriberType=s||(a?"D2C":"FREE"),r["c3.cm.affiliate"]=s||"NULL",Z.setData(r),f("contentInfo",r)})),p.on("loadedmetadata",(function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),f("contentInfo",{screenResolution:e})})),p.on("play",(function(){M.has(p.currentSrc())||(M.add(p.currentSrc()),f("playbackStarted",null))})),p.on("ended",(function(){M.has(p.currentSrc())&&M.delete(p.currentSrc()),f("playbackEnded")})),p.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&f("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})})),p.on("dispose",(function(){null==M||M.clear(),f("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Z=(K={},{setData:function(e){K=R(R({},K),e)},getData:function(){return K}}),ee=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-8a2b1efa.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-bbe15a2f.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-d7744eae.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-7dad68a3.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-97b54404.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?Promise.resolve().then((function(){return require("./skin-6a7648fc.js")})).then((function(t){t.initialiseSkin(e,n)})):"news"==t&&Promise.resolve().then((function(){return require("./skin-c60a42cc.js")})).then((function(t){t.initialiseSkin(e,n)}))};function ne(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 te(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ne(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var oe=[],ie=0,re=null;function le(){console.log("Cleaning up watch history data"),J=null,oe=[],ie=0,re=null}function ae(e,n,t){var i,r,l,a,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(i=n.watchHistory)||void 0===i||i.apiVersion;var d=null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(l=n.watchHistory)||void 0===l||l.xapiKey;var p=(null==n||null===(a=n.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,m=Math.floor(e.currentTime()),g=u?100:Math.floor(c/v*100),y={};f?ue(y={completed:u,watchedTime:m,watchedPercentage:g},d,n.siteOwner):(y=te(te({videoId:J,watchedTime:m,watchedPercentage:g,doneWatching:u,profileId:d},re&&{seriesId:re}),p&&{originalObjectId:p}),o.saveWatchHistory(y).then((function(e){})).catch((function(e){}))),ie=c+t}function se(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function ue(n,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=se(i),l=(new Date).getTime(),a=c.getCurrentVideo(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return te(te({},n),{},e({},t,s[t]))}),{}),d=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===J}));d<0?r.push(te(te({content:u},n),{},{addedDate:l,updateDate:l})):r[d]=te(te(te({},r[d]),n),{},{updateDate:l}),localStorage.setItem("".concat(i),JSON.stringify(r))}function de(e,n,t){var o=se(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var ce=!1,ve=function(e,n){var t,i,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[r])||void 0===t||null===(i=t.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!ce){var l=pe(e,"videoAssets","secondaryVideoAssets"),a=o.getSource(l,n);return a&&o.loadVideo(n,a),ce=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function pe(e,n,t){if(Array.isArray(e))return e.map((function(e){return pe(e,n,t)}));if(null!==e&&"object"===v(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=pe(e[i],n,t)})),o}return e}function fe(e){var n=e.publisherId,t=e.persistentLabels;if(!window.ns_||!window.ns_.analytics)throw new Error("Comscore library not loaded or analytics reference missing");var o=window.ns_.analytics;o.PlatformApi.setPlatformAPI(o.PlatformApi.PlatformApis.WebBrowser);var i=new o.configuration.PublisherConfiguration({publisherId:String(n),persistentLabels:{cs_ucfr:(null==t?void 0:t.userConsent)||"",cs_fpid:(null==t?void 0:t.userId)||""}});return o.configuration.addClient(i),o.configuration.enableFirstPartyCookie(),o.configuration.enableImplementationValidationMode(),o.start(),console.log("[Comscore] Library initialized for publisher:",n),window.analytics=o,o}var me=null,ge=null,ye=null,he=[],be="content",we=null;function ke(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(window.analytics){var n=window.analytics,t=new n.StreamingAnalytics;me=t,we=e,e.implementationId&&t.setImplementationId(e.implementationId),e.projectId&&t.setProjectId(e.projectId),t.setMediaPlayerName(e.playerName||"Video.js"),t.setMediaPlayerVersion(e.playerVersion||"8.x"),t.createPlaybackSession(),e.isDvr&&t.setDVRWindowLength((null==e?void 0:e.dvrWindowLength)||0);var o=new n.StreamingAnalytics.ContentMetadata;return o.setMediaType(n.StreamingAnalytics.ContentMetadata.ContentType[e.contentType||"LONG_FORM_ON_DEMAND"]),o.setUniqueId(e.uniqueId),o.setLength((null==e?void 0:e.isLive)?0:e.duration||0),o.setStationTitle(e.stationTitle),o.setPublisherName(e.publisherName),o.setProgramTitle(e.programTitle),o.setDateOfDigitalAiring(e.digitalAirdate.year,e.digitalAirdate.month,e.digitalAirdate.day),o.setDateOfTvAiring(e.tvAiring.year,e.tvAiring.month,e.tvAiring.day),o.carryTvAdvertisementLoad(e.isDaiAds?"1":null),o.setEpisodeTitle(null==e?void 0:e.contentTitle),o.setEpisodeSeasonNumber(e.seasonNumber),o.setEpisodeNumber(e.episodeNumber),o.setProgramId(e.programId),o.setEpisodeId(e.episodeId),o.setGenreName(e.contentGenre),o.setDictionaryClassificationC3(e.brand||"null"),o.setDictionaryClassificationC4(e.platform||"null"),o.setDictionaryClassificationC6(e.genre||"null"),o.classifyAsCompleteEpisode(e.completeEpisode?"1":null),t.setMetadata(o),ge=o,t.notifyPlay(),console.log("[Comscore] StreamingAnalytics initialized for:",e.programTitle),t}console.error("[Comscore] analytics SDK not found.")}var Ie=!1;function Se(e){if(e)if(me){var n=me;ye=e;var t=function(){return"content"===be&&n.notifyPlay()},o=function(){return"content"===be&&n.notifyPause()},i=function(){return"content"===be&&n.notifyEnd()},r=function(){return n.notifySeekStart()},l=function(){n.notifyBufferStart(),function(e,n){Ie||(Ie=!0,e.any(["playing","timeupdate"],(function(){Ie=!1,n.notifyBufferStop(),n.notifyPlay()})))}(e,n)};e.on("play",t),e.on("pause",o),e.on("ended",i),e.on("seeking",r),e.on("waiting",l),e.on("timeupdate",(function(){if(null==we?void 0:we.isLive)return n.startFromPosition(0);n.startFromPosition&&"function"==typeof e.currentTime&&n.startFromPosition(1e3*e.currentTime())})),he.push((function(){e.off("play",t),e.off("pause",o),e.off("ended",i),e.off("seeking",r),e.off("waiting",l)})),console.log("[Comscore] Player events attached.")}else console.warn("[Comscore] Tag not initialized. Call initializeComscoreTag() first.");else console.warn("[Comscore] No player instance provided.")}function Pe(){return!!me||(console.warn("[Comscore] Tag not initialized."),!1)}function Te(e){var n=e.isLive,t=e.startTimeInSeconds;return n?analytics.StreamingAnalytics.AdvertisementMetadata.LIVE:0==t?analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_POST_ROLL:t===("function"==typeof(null==ye?void 0:ye.getDuration)&&(null==ye?void 0:ye.getDuration()))?ns_.analytics.StreamingAnalytics.AdvertisementMetadata.AdvertisementType.ON_DEMAND_POST_ROLL:analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_MID_ROLL}function Oe(){if(he.forEach((function(e){return e()})),he=[],me){try{me.notifyEnd()}catch(e){}me=null}ye=null,ge=null,be="content",console.log("[Comscore] Streaming Tag destroyed.")}function Ce(e){var n,t,o,i,r,l,a,s,u={ContentType:(null==e?void 0:e.contentType)||"LONG_FORM_ON_DEMAND",uniqueId:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.id,duration:(null==e?void 0:e.runtime)||0,stationTitle:null==e?void 0:e.siteName,publisherName:null==e?void 0:e.network,programTitle:(null==e?void 0:e.programTitle)||De(e),programId:(null==e?void 0:e.programId)||je(e),episodeId:(null==e?void 0:e.episodeId)||(null===(t=null==e?void 0:e.gist)||void 0===t?void 0:t.id),contentTitle:null===(o=null==e?void 0:e.gist)||void 0===o?void 0:o.title,isLive:null===(i=null==e?void 0:e.streamingInfo)||void 0===i?void 0:i.isLiveStream,brand:null==e?void 0:e.network,seasonNumber:(null==e?void 0:e.seasonNumber)||Ae(null==e?void 0:e.episodeDisplayAttribute).season,episodeNumber:(null==e?void 0:e.episodeNumber)||Ae(null==e?void 0:e.episodeDisplayAttribute).episode,platform:(null==e?void 0:e.platform)||"browser",genre:(null==e?void 0:e.genre)||"null",completeEpisode:(null==e?void 0:e.isCompleteEpisode)||!0,digitalAirdate:Ee(null==e?void 0:e.publishDate),tvAiring:Ee(null==e?void 0:e.publishDate),contentGenre:null==e?void 0:e.genre,isDaiAds:!!(null==e?void 0:e.isDaiAds),isDvr:(null===(r=null==e?void 0:e.streamInfo)||void 0===r?void 0:r.isDvr)||!1,dvrWindowLength:(null===(l=null==e?void 0:e.streamInfo)||void 0===l?void 0:l.isDvr)&&(null===(a=null==e?void 0:e.streamInfo)||void 0===a?void 0:a.dvrWindowLength)||0,implementationId:null===(s=null==e?void 0:e.comscoreConfig)||void 0===s?void 0:s.implementationId};return"LINEARCHANNEL"===(null==e?void 0:e.contentType)&&(u.ContentType="LIVE"),u}function De(e){var n,t;return(null==e?void 0:e.series)?null===(t=null==e?void 0:e.series)||void 0===t?void 0:t.title:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.title}function je(e){var n,t;return(null==e?void 0:e.series)?null===(t=null==e?void 0:e.series)||void 0===t?void 0:t.id:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.id}function Ee(e){var n=new Date(1e3*Number(e));return{year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate()}}function Ae(e){if(!e)return{season:null,episode:null};var n=e.match(/S(\d+)\s*E(\d+)/i);return n?{season:Number(n[1]),episode:Number(n[2])}:{season:null,episode:null}}!function(e){e.registerPlugin("comscore",(function(e){console.log(this),console.log("hello form comscore plugin",e);var n=e||{};!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;new Promise((function(t,o){var i=document.createElement("script");i.src=n||"https://appcms.staging.asset.viewlift.com/comscore.js",i.async=!0,document.head.appendChild(i),i.onload=function(){fe({publisherId:e||"40813950"})},i.onerror=function(e){o("Error while loading script ".concat(src," : ").concat(e))}}))}(n.publisherId,n.endpoint)}))}(r);var xe=Object.freeze({__proto__:null,createComscoreStreamingTag:ke,destroyComscoreTag:Oe,endComscoreAdTracking:function(){if(me){var e=me;e.notifyPause(),e.notifyEnd(),be="content",ge&&(e.setMetadata(ge),e.notifyPlay()),console.log("[Comscore] Ad ended. Resumed content playback.")}},finishComscoreAdTracking:function(){me&&(me.notifyPause(),console.log("[Comscore] Ad Finished. Resumed content playback."))},formulateComscoreAdPayload:function(e){return{id:null==e?void 0:e.adId,adTitle:null==e?void 0:e.adTitle,adDuration:(null==e?void 0:e.durationInSeconds)||0,startTimeInSeconds:(null==e?void 0:e.startTimeInSeconds)||0,campaignId:null==e?void 0:e.campaignId,placementId:null==e?void 0:e.placementId,trackingUrl:null==e?void 0:e.trackingUrl}},formulateComscorePayload:Ce,getComscoreTagInstance:function(){return me},setComscorePlayerInstance:Se,startComscoreAdTracking:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!me&&!window.analytics)return console.log("is StreamingAnalytics started Initialised?",Pe()),void console.warn("[Comscore] Tag not initialized or analytics missing.");var n=window.analytics,t=me;be="ad",t.notifyPause();var o=new n.StreamingAnalytics.AdvertisementMetadata;o.setMediaType(Te({isLive:null==we?void 0:we.isLive,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds})),o.setUniqueId(e.id||"ad-001"),o.setLength(e.durationMs||0),o.setTitle(e.title||"Advertisement"),o.setServerCampaignId(e.campaignId),o.setRelatedContentMetadata(ge),o.setDeliveryType(n.StreamingAnalytics.AdvertisementMetadata.AdvertisementDeliveryType.NATIONAL),o.setPlacementId(e.placementId);var i={cs_ad_tu:null==e?void 0:e.trackingUrl,ns_st_ami:null==e?void 0:e.creativeId};o.addCustomLabels(i),t.setMetadata(o),t.notifyPlay(),console.log("[Comscore] Ad started:",e)}});function Ne(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 Le(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ne(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function _e(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 Re(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)?Re(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function Re(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 Me(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 Ve(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Me(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Be=function(e,n,t,r){var l,s,u,d,p,f=r.res,m=r.sres,g=i.getPlayer(e),y=(null==f?void 0:f.contentType)||"video",b=(null==f||null===(l=f[y])||void 0===l?void 0:l.drmEnabled)||!1,w=(null==f||null===(s=f[y])||void 0===s||null===(u=s.streamingInfo)||void 0===u?void 0:u.isLiveStream)||!1,k=(null==f||null===(d=f[y])||void 0===d||null===(p=d.liveDetails)||void 0===p?void 0:p.isDvrEnabled)||!1;c.setCurrentVideo(f),c.videoReplayTracker.set(f),g&&(g.on("loadstart",(function(){w?t.resolve({status:!0,msg:"Video Loaded",response:f}):t.resolve(Ve({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:f}:{response:f}))})),g.on("loadeddata",(function(){var t,r,l,s=a.getCaptions(e);if(null==s||s.map((function(n){return a.disableCaptions(e,n.id)})),k&&"Safari"===o.detectBrowser())try{var u;null==g||null===(u=g.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==g||!g.muted())&&h(e,sessionStorage.getItem("volume")||"100");var d=c.getCurrentVideo();if(function(e,n){var t,o,r,l,a,s,u,d,v=null==e?void 0:e.playerId,p=i.getPlayer(v),f=null==n?void 0:n.siteName;if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var m=c.getCurrentVideo();Oe();var g=null===(o=window)||void 0===o?void 0:o.lcProgrammeDetails,y=Ce(Le(Le({},null==m?void 0:m.video),{},{siteName:f,programId:(null==g?void 0:g.videotmsid)||null,programTitle:(null==g?void 0:g.lcProgrammeName)||null,episodeId:(null==g?void 0:g.videotmsid)||null,seasonNumber:(null==g||null===(r=g.seriesDetails)||void 0===r?void 0:r.season)||null,episodeNumber:(null==g||null===(l=g.seriesDetails)||void 0===l?void 0:l.episode)||null,isCompleteEpisode:!!(null!=m&&null!==(a=m.video)&&void 0!==a&&a.series||null!=g&&null!==(s=g.seriesDetails)&&void 0!==s&&s.episode),genre:null,comscoreConfig:{implementationId:(null==e||null===(u=e.comscore)||void 0===u?void 0:u.implementationId)||null,projectId:(null==e||null===(d=e.comscore)||void 0===d?void 0:d.projectId)||null}}));console.log("comscoreOptions player data",y),ke(Le({playerName:"Video.js"},y)),Se(p)}}(n,f),o.clearError(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.saveOffline)){var v,p,m=Ve(Ve({},n),f);!function(e,n,t){var o,r,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(re=null==n||null===(r=n.series)||void 0===r?void 0:r.id),oe=[],ie=0,J=t;var a=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,s=i.getPlayer(e);s&&(s.on("dispose",le),s.on("timeupdate",(function(){if(!s.seeking()){var e=Math.floor(s.currentTime());oe.includes(ie)||(e!=ie||e<a?e>ie&&(ie=e+a):(oe.push(e),ae(s,n,a)))}})),s.one("ended",(function(){ae(s,n,a,!0)})))}(e,m,null==d||null===(v=d.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=n&&null!==(l=n.analytics)&&void 0!==l&&l.muxKey&&null!=g&&g.mux){var y,b,w,I,S,P,T=(null===(y=c.getCurrentVideo())||void 0===y?void 0:y.video)||(null==f?void 0:f.video),O=null==T?void 0:T.gist,C={env_key:null==n||null===(b=n.analytics)||void 0===b?void 0:b.muxKey,player_name:"vl-web-player",player_version:null===(w=window)||void 0===w?void 0:w.vl_player_version,video_id:null==O?void 0:O.id,video_title:null==O?void 0:O.title,video_series:null==T||null===(I=T.series)||void 0===I?void 0:I.title,video_stream_type:null!=T&&null!==(S=T.streamingInfo)&&void 0!==S&&S.isLiveStream?"live":"video",viewer_user_id:null==n||null===(P=n.analytics)||void 0===P?void 0:P.userId};g.mux({debug:!1,data:C})}})),g.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];g.trigger("subtitlechanged",n)})),g.on("subtitlechanged",(function(e,n){var t,o,i,r,l,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}})),g.tech_.on("retryplaylist",(function(){w&&ve(f,e)})),g.on("error",(function(){var n,i;(console.log("ERROR",g.error(),g.error().code),4===g.error().code&&w)?ve(f,e):(o.handleError(e,(null==g||null===(n=g.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==g||null===(i=g.error())||void 0===i?void 0:i.message)||"Some error occured",response:f}))})),g.one("play",(function(){var e,t,o,i,r;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!==(r=n.series)&&void 0!==r&&r.enable){var l,a,s,u=null===(l=c.getCurrentVideo())||void 0===l||null===(a=l.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.id,d=c.getSeriesWatchMap(),v=(null==d?void 0:d.get(u))||{t:0,p:0},p=v.t,f=v.p;p&&f<95&&setTimeout((function(){g.currentTime(p)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){g.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=g&&g.dvrSeekbar)try{g.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),g.on("volumechange",(function(){var e=100*g.volume().toFixed(2);g.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),g.on("chromecastDisconnected",(function(){if(w){g.currentSource();for(var e=g.textTracks(),n=e.length-1;n>=0;n--)g.removeRemoteTextTrack(e[n])}})),g.one("loadeddata",(function(){var e,n=(null==g||null===(e=g.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0})),"object"==v(g.dash)){var t,i,r,l=null==g||null===(t=g.dash)||void 0===t||null===(i=t.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==l?void 0:l.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),s=_e(n);try{for(s.s();!(r=s.n()).done;){var u=r.value;if(a&&(null==u?void 0:u.id)=="dash-audio-".concat(a.index)){u.enabled=!0;break}}}catch(e){s.e(e)}finally{s.f()}}else{var d,c=_e(n);try{for(c.s();!(d=c.n()).done;){var p,f,m,y=d.value;if(("Chrome"==o.detectBrowser()||"Edge"==o.detectBrowser()&&(null!==(p=navigator)&&void 0!==p&&null!==(f=p.userAgent)&&void 0!==f&&f.includes("Macintosh")||!b))&&null!=y&&null!==(m=y.label)&&void 0!==m&&m.includes("5.1"))g.audioTracks().removeTrack(y);else{if("main"==y.kind){y.enabled=!0;break}y.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}})))};function He(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function Ue(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function qe(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(c.getCurrentEpgPrograms()||[]).filter((function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function Fe(e,n){var t=i.getPlayer(e);if(t){var o=n.dvrConfig,r=void 0===o?{}:o,l=n.videoId;n.epg;var a=r.playLive,s=r.playFromBegining,u=r.programs;c.setCurrentEpgPrograms(u),t.on("loadeddata",(function(){f.checkDvrStartOverEnabled(n)?s?f.playFromBeginningHandler(t,n):a?f.playLiveOrResumeHandler(t,l):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,r=n.epg,l=o.buttonConfig,a=void 0===l?{}:l,s=a.watchLive;a.resume;var u=a.startFromBegining,d=i;if(r&&null!=r&&r.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!f.getWatchedTime(d),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var m=f.getCurrentProgramThumbnail(n);m&&(p.style.backgroundImage="url(".concat(m,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=ze(o,v),p.style.display="flex",e.el().appendChild(p),f.pauseAndHideControl(e),We("watch-live-resume-btn",s,(function(){f.showControl(e,p),f.playLiveOrResumeHandler(e,d)})),We("watch-begining-btn",u,(function(){f.showControl(e,p),f.playFromBeginningHandler(e,n)}))}(t,n),f.handleLiveStartOverBtn({player:t,showWatchLive:!0,showStartOver:!0})):f.removeDvrStartOver(t)})),t.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,r=e.seekable(),l=r.start(0),a=r.end(r.length-1)-l,s=JSON.parse(sessionStorage.getItem("epgConfig")),u=t,d=!0;if(s&&null!=s&&s.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==s?void 0:s.programId),u=null==s?void 0:s.programId}e.on("seeking",(function(){i=!0})),e.on("seeked",(function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;u="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}f.saveWatchedTime(u,o),f.getProgramStartTime(e,n),f.handleLiveStartOverBtn({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");u="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(f.saveWatchedTime(u,t),o=t,function(e,n){qe(n).forEach((function(t){var o=t.id,i=t.title,r=t.time,l=document.getElementById(o);if(l){var a=Math.min(r/n*100,99.5);l.style.left="".concat(a,"%")}else{var s=e.controlBar.progressControl.seekBar.el(),u=He(o,i,Math.min(r/n*100,99.5));s.appendChild(u)}}))}(e,a))}}))}(t,n)}))}else console.warn("Player instance is required to initialize start over.")}function We(e,n,t){var o,i,r=document.getElementById(e);r&&(i=n,(o=r)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),r.addEventListener("click",t))}function ze(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,r=t.startFromBegining,l=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(p.watchLiveIcon2()," ").concat(l,"</button>"),s='<button id="watch-begining-btn">'.concat(p.startLiveIcon()," ").concat((null==r?void 0:r.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(s,"</div>")}function Ge(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 Ke(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ge(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Je=function(l,s,d,c){var v,p,f,m,g,y,h,b,w,I,S,P,T,O,C,D,j,E,A,x,L,_,R,M,V,B,H,U,q,F,W,z,G,K,J,Y,X,Q,ne,te,oe=s.res,ie=void 0===oe?null:oe,re=s.sres,le=void 0===re?null:re,ae=null!=d&&d.chromecastReceiverId?["chromecast","html5"]:["html5"],se=(null===(v=ie)||void 0===v?void 0:v.contentType)||"video",ue=u.impolicy16x9(null===(p=ie)||void 0===p||null===(f=p[se])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||u.impolicy16x9(null===(g=ie)||void 0===g||null===(y=g[se])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),de=(null===(w=ie)||void 0===w||null===(I=w[se])||void 0===I||null===(S=I.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,ce=(null===(P=ie)||void 0===P||null===(T=P[se])||void 0===T||null===(O=T.streamingInfo)||void 0===O?void 0:O.isLiveStream)||!1,ve=(null===(C=ie)||void 0===C||null===(D=C.ads)||void 0===D||null===(j=D.preRoll)||void 0===j||null===(E=j.adTags)||void 0===E||null===(A=E.web)||void 0===A?void 0:A.active)&&(null===(x=ie)||void 0===x||null===(L=x.ads)||void 0===L||null===(_=L.preRoll)||void 0===_||null===(R=_.adTags)||void 0===R||null===(M=R.web)||void 0===M?void 0:M.url),pe=(null===(V=ie=Ke(Ke({},ie),{},{audioAssetSource:null==d?void 0:d.audioAssetSource}))||void 0===V||null===(B=V[se])||void 0===B?void 0:B.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(H=window)||void 0===H||null===(U=H.app_data)||void 0===U||null===(q=U.appcmsMain)||void 0===q||null===(F=q.adsConfig)||void 0===F?void 0:F.vodAdSticherProvider)||!1,fe=(null==d?void 0:d.latency)||6,me=(null==d?void 0:d.skin_settings)||{};null==d||d.dvrConfig;var ge=(ne={enableSmoothSeeking:!0,controls:0!=(null==d?void 0:d.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==d?void 0:d.muted)||!1,autoplay:(null==d?void 0:d.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==me?void 0:me.pictureInPictureToggle)||!1},playbackRates:null!=me&&me.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==d.skin,liveui:de},e(ne,"autoplay",null==d?void 0:d.autoplay),e(ne,"normalizeAutoplay",(null==d?void 0:d.autoplay)&&!ve),e(ne,"loop",(null==d?void 0:d.loop)||!1),e(ne,"audioPosterMode",null==d?void 0:d.audioPosterMode),e(ne,"html5",Ke(Ke({dash:Ke(Ke(Ke({},!r.browser.IS_SAFARI&&{useTTML:!0}),(null==d?void 0:d.debugConfig)&&(null==d||null===(W=d.debugConfig)||void 0===W?void 0:W.enable)&&{debug:!0,logLevel:null!=d&&null!==(z=d.debugConfig)&&void 0!==z&&z.logLevel?null==d||null===(G=d.debugConfig)||void 0===G?void 0:G.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:fe},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Ke(Ke({liveRangeSafeTimeDelta:fe,useDevicePixelRatio:!0,experimentalLLHLS:(null==d?void 0:d.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==d||null===(K=d.customData)||void 0===K?void 0:K.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(J=null==d?void 0:d.enableLowInitialPlaylist)||void 0===J||J}),debug:(null==d?void 0:d.debugConfig)&&(null==d||null===(Y=d.debugConfig)||void 0===Y?void 0:Y.enable)||!1,nativeTextTracks:"Safari"==o.detectBrowser()},0==(null==d||null===(X=d.customData)||void 0===X?void 0:X.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==d||null===(Q=d.customData)||void 0===Q?void 0:Q.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(ne,"poster",ue),e(ne,"techOrder",ae),e(ne,"chromecast",{requestCustomDataFn:function(e){var n,t,o=i.getPlayer(l),r=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,t){var o,i,r,l,a,s,u,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,y,h,b,w,k,I;f.isDrmEnabled=!0;var S=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,P=(null==S?void 0:S.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=P;var T=(null==S?void 0:S.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===(I=k.httpRequestHeaders)||void 0===I?void 0:I["X-AxDRM-Message"]);f.licenseToken=T}var O=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=O;var C=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=C;var D=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=D;var j=null==e||null===(u=e[p])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=j,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(ie,e,r);return Ke(Ke({},a),{},{convivaMetaData:Ke({customerKey:(null==d||null===(n=d.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==d||null===(t=d.convivaConfig)||void 0===t?void 0:t.debug)||!1},Z.getData())})},modifyLoadRequestFn:function(e){var n,t,o,r,a,s=i.getPlayer(l),u=(null==s?void 0:s.currentSource())||{};!(null===(n=ie)||void 0===n||null===(t=n[se])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(r=o.videoAssets)||void 0===r?void 0:r.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(a=u.src)&&void 0!==a&&a.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),ne);if(!r.getPlayers()[l]){null!=d&&d.debugConfig&&null!=d&&null!==(te=d.debugConfig)&&void 0!==te&&te.enable&&r.log.level("debug");var ye=r(l,ge,function(){var e=n(t.mark((function e(){var n,i,s,u,v,p,f,m,g,y,h,b,w,I,S,P,T,O,C,D,j;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(ye),console.log(r.VERSION),console.log(r.getPlugins()),e.next=5,N(d,ie);case 5:if(w=null===(n=ie)||void 0===n||null===(i=n[se])||void 0===i||null===(s=i.liveDetails)||void 0===s?void 0:s.startOverTime,ce&&c.resolve(Ke({status:!0,msg:"Player Initialised"},le?{seriesResponse:le,response:ie}:{response:ie})),de&&null!=d&&null!==(u=d.dvrConfig)&&void 0!==u&&u.enable&&Fe(l,Ke(Ke({},d),{},{isDvrEnabled:de})),o.inititateBeacon(l,null==d?void 0:d.analyticsCb,null==d?void 0:d.customData),$(l,d),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),de&&k(l,w),!ve||null!=d&&null!==(v=d.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(l,ve,ie),I=o.getSource(ie,l),console.log(I),null!=d&&d.nearestClusterUrl&&(I=o.getUpdatedClusterSource(I,d.nearestClusterUrl)),!pe){e.next=21;break}return e.next=20,o.getSGAIEnabledSource(l,ie);case 20:I=e.sent;case 21:I?o.loadVideo(l,I):(c.reject({status:!1,msg:"Incompatible / Missing Source",response:ie}),o.handleError(l,"Incompatible / Missing Source")),((null===(p=ie)||void 0===p||null===(f=p[se])||void 0===f||null===(m=f.contentDetails)||void 0===m||null===(g=m.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=ie)||void 0===y||null===(h=y[se])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(j=(null===(P=ie)||void 0===P||null===(T=P[se])||void 0===T||null===(O=T.contentDetails)||void 0===O?void 0:O.closedCaptions)||(null===(C=ie)||void 0===C||null===(D=C[se])||void 0===D?void 0:D.closedCaptions),S=j.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),a.addCaptions(l,S)),null!=d&&d.disableControls?o.disableControls(l):ee(l,Ke(Ke(Ke({},d),ge),{},{liveVideo:ce,isDvrEnabled:de,res:ie,sres:le})),Be(l,Ke(Ke(Ke({},d),ge),{},{liveVideo:ce}),c,{res:ie,sres:le});case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}},Ye={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function Xe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Qe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Xe(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var $e,Ze=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,r=en(e);Je(i,{res:r},e,{resolve:t,reject:o})},en=function(e){var n,t,i,r,l,a,s,u,d=null==e?void 0:e.streamingInfo,c=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,v=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,p=(null==e||null===(i=e.streamingInfo)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.url)||null,f=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,g=(null==e||null===(a=e.streamingInfo)||void 0===a?void 0:a.subtitles)||[],y=(null==e||null===(s=e.streamingInfo)||void 0===s||null===(u=s.videoAssets)||void 0===u?void 0:u.drmProvider)||null,h=null==e?void 0:e.token,b=o.getDecodedToken(h),w=null==b?void 0:b.site;return Qe(Qe({id:null==Ye?void 0:Ye[w]},!v&&{directPlaybackUrl:null==c?void 0:c.url}),{},{video:{drmEnabled:v,streamingInfo:{videoAssets:Qe(Qe({},y&&{drmProvider:y}),{},{widevine:null==c?void 0:c.widevine,fairPlay:null==c?void 0:c.fairPlay,playReady:null==c?void 0:c.playReady})},liveDetails:{isDvrEnabled:null==d?void 0:d.isDvrEnabled},gist:Qe({},f&&{videoImageUrl:f}),contentDetails:Qe({},(null==g?void 0:g.length)>0&&{closedCaptions:m(g)})},ads:{preRoll:{adTags:{web:Qe(Qe({},p&&{active:!0}),p&&{url:p})}}}})};function nn(e,n){return tn.apply(this,arguments)}function tn(){return(tn=n(t.mark((function e(n,i){var r,l,a,s,u,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.resolve,l=i.reject,a=null==n?void 0:n.videoId,s=null==n?void 0:n.playerId,u=!(null==n||!n.anonymousId),e.next=6,o.getToken();case 6:d=e.sent,o.getVideoDetails(a,d).then((function(e){var t,i,v,p;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(i=t.video)||void 0===i||null===(v=i.gist)||void 0===v?void 0:v.contentType,c.setCurrentVideo(null==e?void 0:e.data);var f,m=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(p=n.watchHistory)&&void 0!==p&&p.enable&&!u)if((null===(f=n.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var g,y,h,b=de((null===(g=n.watchHistory)||void 0===g?void 0:g.profileId)||"",a,null==n?void 0:n.siteOwner);if(b&&b.length)n.watchHistoryResumeTime=(null===(y=b[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(h=b[0])||void 0===h?void 0:h.watchedPercentage)||null;m.contentType="video",Je(s,{res:m},n,{resolve:r,reject:l})}else o.getVideoInfo(a,d).then((function(e){var t,o,i,r,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.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,m.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){Je(s,{res:m},n,{resolve:r,reject:l})}));else Je(s,{res:m},n,{resolve:r,reject:l})})).catch((function(e){o.initiateErrorHandling(e,s,l,a)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function on(e,n){return rn.apply(this,arguments)}function rn(){return(rn=n(t.mark((function e(n,i){var r,l,a,s,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.resolve,l=i.reject,e.next=3,o.getToken();case 3:a=e.sent,s=null==n?void 0:n.playerId,u=null==n?void 0:n.epg,o.getLinearChannelDetails(u,a).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==u?void 0:u.channelId,Je(s,{res:t},n,{resolve:r,reject:l})})).catch((function(e){o.initiateErrorHandling(e,s,l,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ln(e,n){return an.apply(this,arguments)}function an(){return(an=n(t.mark((function e(n,i){var r,l,a,s,u,d,v;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=i.resolve,a=i.reject,e.next=3,o.getToken();case 3:s=e.sent,u=null==n?void 0:n.playerId,d=sessionStorage.getItem("season-idx")||0,c.seasonIdxManager.set(parseInt(d)),v=null==n||null===(r=n.series)||void 0===r?void 0:r.id,o.getSeriesDetails(v,s).then((function(e){var t,i,r,d=e.data,p=e.data.seasons;c.setCurrentSeries(p);var f=videoId||(null==p||null===(t=p[0])||void 0===t||null===(i=t.episodes)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.id);o.createSeriesWatchMap(v,s),o.getVideoDetails(f,s).then((function(e){var t,o,i;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,c.setCurrentVideo(e.data),Je(u,{res:null==e?void 0:e.data,sres:d},n,{resolve:l,reject:a})})).catch((function(e){o.initiateErrorHandling(e,u,a,videoId)}))})).catch((function(e){o.initiateErrorHandling(e,u,a)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function un(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?sn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):sn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}exports.VLPlayerCore=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=n(t.mark((function n(i,r){var l,a,s,c,v,p,f,m,y,h,b,w,k,I,S,P,T,O,C,D,E,A,x,N,L;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(k=(null==e?void 0:e.videoSourceUrl)||!1,I=null==e?void 0:e.asat,S=(null==e||null===(l=e.epg)||void 0===l?void 0:l.enable)||!1,P=null==e?void 0:e.videoId,T=(null==e||null===(a=e.series)||void 0===a?void 0:a.enable)||!1,O=(null==e?void 0:e.streamingInfo)||!1,window.videoId=P,C=null==e?void 0:e.token,!o.token_authentication_enabled(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",C),o.refreshTokenManager().set(null==e?void 0:e.refreshToken),C&&!o.isTokenExpired(C)){n.next=16;break}return r({status:!1,msg:"".concat(C?"Token is expired !":"Missing Authorization Token"),response:{token:C}}),n.abrupt("return");case 16:$e=JSON.parse(atob(C.split(".")[1]));case 17:return window.siteName=null===(s=$e)||void 0===s?void 0:s.site,window.siteId=null===(c=$e)||void 0===c?void 0:c.siteId,e.isAnonymousUser=!(null===(v=$e)||void 0===v||!v.anonymousId),e.siteOwner=(null===(p=$e)||void 0===p?void 0:p.site)||null,e.userId=(null===(f=$e)||void 0===f?void 0:f.userId)||null,window.sessionStorage.setItem("uid",null===(m=$e)||void 0===m?void 0:m.userId),window.watchHistory=e.watchHistory||null,D=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(y=e.series)&&void 0!==y&&y.enable?null:null==e?void 0:e.chromecastReceiverId,E=(null==e||null===(h=e.analytics)||void 0===h?void 0:h.gaId)||null,(A=null==e?void 0:e.errors)&&(window.customErrors=A),window.customData=null==e?void 0:e.customData,d.setLocalisation(null==e||null===(b=e.customData)||void 0===b?void 0:b.localisation),o.baseUrlManager.set(e.apiBaseUrl),null!=e&&e.skin&&!u.isNotAValidSkin(e.skin)||(e.skin="VL_ONE"),n.next=35,j(e);case 35:E&&g("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return o.runGtag(E)})).catch((function(e){})),(x=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(D)))&&x.addEventListener("contextmenu",(function(e){return e.preventDefault()})),k?(L={directPlaybackUrl:k,id:N="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},I?o.getVideoDetails(N,C).then((function(n){var t=(null==n?void 0:n.data)||{};Je(D,{res:un(un({},t),L)},e,{resolve:i,reject:r})})).catch((function(e){o.initiateErrorHandling(e,D,r,N)})):Je(D,{res:L},e,{resolve:i,reject:r})):O?Ze(e,{resolve:i,reject:r}):T?ln(e,{resolve:i,reject:r}):S?on(e,{resolve:i,reject:r}):nn(e,{resolve:i,reject:r});case 39:case"end":return n.stop()}}),n)})));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:s.getRenditions,skip:o.skip,getPlayer:i.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,authenticateLC:o.authenticateLC,dispose:o.dispose,enableCaptions:a.enableCaptions,disableCaptions:a.disableCaptions,getCaptions:a.getCaptions,playSelectedResolution:s.playSelectedResolution,getSource:o.getSource,setVolume:h,getVolume:b,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed,getEntitlementData:o.getEntitlementData,adsQueuePointManager:o.adsQueuePointManager,getSsaiEvents:o.getSsaiEvents,playerEvents:l.playerEvents,onReplay:l.onReplay}},exports.initiateMarker=function(e){var n=i.getPlayer(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var r=t.start(0),l=t.end(t.length-1)-r;Ue(),qe(l).forEach((function(e){var n=e.id,t=e.title,i=e.time,r=He(n,t,Math.min(i/l*100,99.5));o.appendChild(r)}))}},exports.removeMarkers=Ue;
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator");require("axios");var o=require("./generic-9f637989.js"),i=require("./player_instance-fcf6a8fb.js"),r=require("video.js"),l=require("./util-ca307e43.js"),a=require("./captions-dbc83a75.js"),s=require("./resolution-f9dcc1b4.js"),u=require("./skin-516012d7.js"),d=require("./localisation-56e0a999.js"),c=require("./currentVideoInfo-31d70bec.js"),v=require("@babel/runtime/helpers/typeof"),p=require("./icons-2609dbe4.js"),f=require("./helper-a50a8ffc.js"),m=require("@babel/runtime/helpers/toConsumableArray"),g=function(e){return new Promise((function(n,t){if(y(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)}}))},y=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},h=function(e,n,t){var o=i.getPlayer(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,"'")})},b=function(e){var n=i.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},w=function(){var e=n(t.mark((function e(n){var l,a,s,u,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=i.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable||!(null!=n&&n.chromecastReceiverId||null!=n&&n.airplay)){e.next=10;break}return e.prev=2,e.next=5,g("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.log("Error",e.t0);case 10:if(null!=n&&null!==(a=n.series)&&void 0!==a&&a.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=13,import("@silvermine/videojs-chromecast");case 13:e.sent.default(r),(d=r.getTech("chromecast"))&&!d.prototype.seeking&&(d.prototype.seeking=function(){}),null!==(u=window)&&void 0!==u&&u.cast?null==s||s.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==s||s.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==o.detectBrowser()?null==s||s.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(n){return e.apply(this,arguments)}}(),k=function(e,n){var t=i.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,l,a,s=this.el(),u=r.dom.getPointerPosition(s,n).x;r.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*u,v.seek()}}))};var I=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),g("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)}}(),S=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.resolve().then((function(){return xe}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=n(t.mark((function e(){return t.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){r.getPlugin("eme")||r.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=n(t.mark((function e(){var n;return t.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(r),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)}}(),O=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./index-3f0e537b.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)}}(),C=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./videojs-dash5.es-3854764f.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)}}(),D=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){g("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(r)}))},loadAdsLibrary:I,loadEMELibrary:P,loadMuxPlugin:T,loadDvrSeekbar:O,loadContribDash:C,loadComscorePlugin:S});function j(e){return E.apply(this,arguments)}function E(){return(E=n(t.mark((function e(n){var i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(null==n?void 0:n.airplay)||!1,e.next=3,I();case 3:i&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return D})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(e){return x.apply(this,arguments)}function x(){return(x=n(t.mark((function e(n){var o,r,l,a,s,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=i.getPlayer(n.playerId),e.next=3,S();case 3:u.comscore({publisherId:null==n||null===(o=n.comscore)||void 0===o?void 0:o.publishedId,endpoint:null==n||null===(r=n.comscore)||void 0===r?void 0:r.endpoint,implementationId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.implementationId,projectId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.projectId,debug:(null==n||null===(s=n.comscore)||void 0===s?void 0:s.debug)||!1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(e,n){return L.apply(this,arguments)}function L(){return(L=n(t.mark((function e(n,i){var r,l,a,s,u,d,c,v,p,f,m,g;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==i?void 0:i.contentType)||"video",p=null==i||null===(r=i[v])||void 0===r?void 0:r.drmEnabled,null==i||null===(l=i[v])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==i||null===(s=i[v])||void 0===s||null===(u=s.streamingInfo)||void 0===u||null===(d=u.videoAssets)||void 0===d?void 0:d.dash)||null,m=(null==n||null===(c=n.comscore)||void 0===c?void 0:c.enable)||!1,e.prev=6,A(n),e.next=10,Promise.allSettled([p?"Safari"==o.detectBrowser()?P():"caliente"!=(null===(g=window)||void 0===g?void 0:g.siteName)?C():P():"Safari"!=o.detectBrowser()&&f?C():null,m?w(n):null,w(n)]);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),console.log("Error",e.t0);case 15:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function _(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 R(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?_(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):_(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var M=new Set,V=null,B=function(e,n,t){var i,r,l,a,s,u,d,v={},p=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(i=e[p])||void 0===i?void 0:i.id)||"Null",v["c3.cm.contentType"]=z(e),v[null==t||null===(r=t.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==e||!e.linearchannel),v[null==t||null===(l=t.Constants)||void 0===l?void 0:l.STREAM_URL]=n.currentSrc(),v[null==t||null===(a=t.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===o.getUserId()?"NULL":o.getUserId(),v["c3.cm.categoryType"]=F(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(s=e[p])||void 0===s?void 0:s.drmEnabled)||"None",v.DAIStream=null!==(u=e[p])&&void 0!==u&&null!==(d=u.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[t.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=W(e),v["c3.cm.genreList"]=U(e),v["c3.cm.genre"]=H(e),v["c3.cm.channel"]=q(e);var f=Y(c.getCurrentSeries(),e);return v=R(R({},v),f)},H=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},U=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"},q=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"},F=function(e){return(null==e?void 0:e.contentType)||"null"},W=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},G=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},z=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var K,J,Y=function(e,n){var t,i,r,l,a,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return s;var u=o.getSeasonNumber(),d=o.getEpisodeNumber();return s["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(i=t.series)||void 0===i?void 0:i.title)||"Null",s["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",s["c3.cm.showTitle"]=(null==e||null===(r=e[u-1])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",s["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",s},X=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"}},Q=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},$=function(){var e=n(t.mark((function e(n,o){var r,l,a,s,u,d,v,p,f,m;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(null==o?void 0:o.convivaConfig)||{},l=r.trackConvivaPlayerEvent,a=r.paymentHandler,s=r.tveProvider,u=r.enable,d=r.appName,v=(o||{}).token,u){e.next=4;break}return e.abrupt("return");case 4:if(p=i.getPlayer(n),"function"==typeof(f=l)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,f("getConvivaObject");case 10:if(m=e.sent){e.next=13;break}return e.abrupt("return");case 13:p.ready((function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=X(t.keySystem);f("contentInfo",{DRMEnabled:o})}else f("contentInfo",{DRMEnabled:"None"})})),n||f("contentInfo",{DRMEnabled:"None"})})),p.on("loadstart",(function(){var e,n;V&&V!==p.currentSrc()&&f("playbackEnded"),f("setPlayer",p),M.clear(),V=p.currentSrc();var t=Q(p.currentType()),i=c.getCurrentVideo(),r=B(i,p,m);r[null==m||null===(e=m.Constants)||void 0===e?void 0:e.PLAYER_NAME]=d||"WEB",r[null==m||null===(n=m.Constants)||void 0===n?void 0:n.ASSET_NAME]=G(i,o),r.authToken=v||"NULL",r.streamType=t,r.D2CType=a||"NONE",r.subscriberType=s||(a?"D2C":"FREE"),r["c3.cm.affiliate"]=s||"NULL",Z.setData(r),f("contentInfo",r)})),p.on("loadedmetadata",(function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),f("contentInfo",{screenResolution:e})})),p.on("play",(function(){M.has(p.currentSrc())||(M.add(p.currentSrc()),f("playbackStarted",null))})),p.on("ended",(function(){M.has(p.currentSrc())&&M.delete(p.currentSrc()),f("playbackEnded")})),p.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&f("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})})),p.on("dispose",(function(){null==M||M.clear(),f("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Z=(K={},{setData:function(e){K=R(R({},K),e)},getData:function(){return K}}),ee=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-8a2b1efa.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-bbe15a2f.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-d7744eae.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-7dad68a3.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-97b54404.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?Promise.resolve().then((function(){return require("./skin-a1d6ec8a.js")})).then((function(t){t.initialiseSkin(e,n)})):"news"==t&&Promise.resolve().then((function(){return require("./skin-c60a42cc.js")})).then((function(t){t.initialiseSkin(e,n)}))};function ne(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 te(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ne(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var oe=[],ie=0,re=null;function le(){console.log("Cleaning up watch history data"),J=null,oe=[],ie=0,re=null}function ae(e,n,t){var i,r,l,a,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(i=n.watchHistory)||void 0===i||i.apiVersion;var d=null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(l=n.watchHistory)||void 0===l||l.xapiKey;var p=(null==n||null===(a=n.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,m=Math.floor(e.currentTime()),g=u?100:Math.floor(c/v*100),y={};f?ue(y={completed:u,watchedTime:m,watchedPercentage:g},d,n.siteOwner):(y=te(te({videoId:J,watchedTime:m,watchedPercentage:g,doneWatching:u,profileId:d},re&&{seriesId:re}),p&&{originalObjectId:p}),o.saveWatchHistory(y).then((function(e){})).catch((function(e){}))),ie=c+t}function se(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function ue(n,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=se(i),l=(new Date).getTime(),a=c.getCurrentVideo(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return te(te({},n),{},e({},t,s[t]))}),{}),d=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===J}));d<0?r.push(te(te({content:u},n),{},{addedDate:l,updateDate:l})):r[d]=te(te(te({},r[d]),n),{},{updateDate:l}),localStorage.setItem("".concat(i),JSON.stringify(r))}function de(e,n,t){var o=se(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var ce=!1,ve=function(e,n){var t,i,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[r])||void 0===t||null===(i=t.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!ce){var l=pe(e,"videoAssets","secondaryVideoAssets"),a=o.getSource(l,n);return a&&o.loadVideo(n,a),ce=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function pe(e,n,t){if(Array.isArray(e))return e.map((function(e){return pe(e,n,t)}));if(null!==e&&"object"===v(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=pe(e[i],n,t)})),o}return e}function fe(e){var n=e.publisherId,t=e.persistentLabels;if(!window.ns_||!window.ns_.analytics)throw new Error("Comscore library not loaded or analytics reference missing");var o=window.ns_.analytics;o.PlatformApi.setPlatformAPI(o.PlatformApi.PlatformApis.WebBrowser);var i=new o.configuration.PublisherConfiguration({publisherId:String(n),persistentLabels:{cs_ucfr:(null==t?void 0:t.userConsent)||"",cs_fpid:(null==t?void 0:t.userId)||""}});return o.configuration.addClient(i),o.configuration.enableFirstPartyCookie(),o.configuration.enableImplementationValidationMode(),o.start(),console.log("[Comscore] Library initialized for publisher:",n),window.analytics=o,o}var me=null,ge=null,ye=null,he=[],be="content",we=null;function ke(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(window.analytics){var n=window.analytics,t=new n.StreamingAnalytics;me=t,we=e,e.implementationId&&t.setImplementationId(e.implementationId),e.projectId&&t.setProjectId(e.projectId),t.setMediaPlayerName(e.playerName||"Video.js"),t.setMediaPlayerVersion(e.playerVersion||"8.x"),t.createPlaybackSession(),e.isDvr&&t.setDVRWindowLength((null==e?void 0:e.dvrWindowLength)||0);var o=new n.StreamingAnalytics.ContentMetadata;return o.setMediaType(n.StreamingAnalytics.ContentMetadata.ContentType[e.contentType||"LONG_FORM_ON_DEMAND"]),o.setUniqueId(e.uniqueId),o.setLength((null==e?void 0:e.isLive)?0:e.duration||0),o.setStationTitle(e.stationTitle),o.setPublisherName(e.publisherName),o.setProgramTitle(e.programTitle),o.setDateOfDigitalAiring(e.digitalAirdate.year,e.digitalAirdate.month,e.digitalAirdate.day),o.setDateOfTvAiring(e.tvAiring.year,e.tvAiring.month,e.tvAiring.day),o.carryTvAdvertisementLoad(e.isDaiAds?"1":null),o.setEpisodeTitle(null==e?void 0:e.contentTitle),o.setEpisodeSeasonNumber(e.seasonNumber),o.setEpisodeNumber(e.episodeNumber),o.setProgramId(e.programId),o.setEpisodeId(e.episodeId),o.setGenreName(e.contentGenre),o.setDictionaryClassificationC3(e.brand||"null"),o.setDictionaryClassificationC4(e.platform||"null"),o.setDictionaryClassificationC6(e.genre||"null"),o.classifyAsCompleteEpisode(e.completeEpisode?"1":null),t.setMetadata(o),ge=o,t.notifyPlay(),console.log("[Comscore] StreamingAnalytics initialized for:",e.programTitle),t}console.error("[Comscore] analytics SDK not found.")}var Ie=!1;function Se(e){if(e)if(me){var n=me;ye=e;var t=function(){return"content"===be&&n.notifyPlay()},o=function(){return"content"===be&&n.notifyPause()},i=function(){return"content"===be&&n.notifyEnd()},r=function(){return n.notifySeekStart()},l=function(){n.notifyBufferStart(),function(e,n){Ie||(Ie=!0,e.any(["playing","timeupdate"],(function(){Ie=!1,n.notifyBufferStop(),n.notifyPlay()})))}(e,n)};e.on("play",t),e.on("pause",o),e.on("ended",i),e.on("seeking",r),e.on("waiting",l),e.on("timeupdate",(function(){if(null==we?void 0:we.isLive)return n.startFromPosition(0);n.startFromPosition&&"function"==typeof e.currentTime&&n.startFromPosition(1e3*e.currentTime())})),he.push((function(){e.off("play",t),e.off("pause",o),e.off("ended",i),e.off("seeking",r),e.off("waiting",l)})),console.log("[Comscore] Player events attached.")}else console.warn("[Comscore] Tag not initialized. Call initializeComscoreTag() first.");else console.warn("[Comscore] No player instance provided.")}function Pe(){return!!me||(console.warn("[Comscore] Tag not initialized."),!1)}function Te(e){var n=e.isLive,t=e.startTimeInSeconds;return n?analytics.StreamingAnalytics.AdvertisementMetadata.LIVE:0==t?analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_POST_ROLL:t===("function"==typeof(null==ye?void 0:ye.getDuration)&&(null==ye?void 0:ye.getDuration()))?ns_.analytics.StreamingAnalytics.AdvertisementMetadata.AdvertisementType.ON_DEMAND_POST_ROLL:analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_MID_ROLL}function Oe(){if(he.forEach((function(e){return e()})),he=[],me){try{me.notifyEnd()}catch(e){}me=null}ye=null,ge=null,be="content",console.log("[Comscore] Streaming Tag destroyed.")}function Ce(e){var n,t,o,i,r,l,a,s,u={ContentType:(null==e?void 0:e.contentType)||"LONG_FORM_ON_DEMAND",uniqueId:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.id,duration:(null==e?void 0:e.runtime)||0,stationTitle:null==e?void 0:e.siteName,publisherName:null==e?void 0:e.network,programTitle:(null==e?void 0:e.programTitle)||De(e),programId:(null==e?void 0:e.programId)||je(e),episodeId:(null==e?void 0:e.episodeId)||(null===(t=null==e?void 0:e.gist)||void 0===t?void 0:t.id),contentTitle:null===(o=null==e?void 0:e.gist)||void 0===o?void 0:o.title,isLive:null===(i=null==e?void 0:e.streamingInfo)||void 0===i?void 0:i.isLiveStream,brand:null==e?void 0:e.network,seasonNumber:(null==e?void 0:e.seasonNumber)||Ae(null==e?void 0:e.episodeDisplayAttribute).season,episodeNumber:(null==e?void 0:e.episodeNumber)||Ae(null==e?void 0:e.episodeDisplayAttribute).episode,platform:(null==e?void 0:e.platform)||"browser",genre:(null==e?void 0:e.genre)||"null",completeEpisode:(null==e?void 0:e.isCompleteEpisode)||!0,digitalAirdate:Ee(null==e?void 0:e.publishDate),tvAiring:Ee(null==e?void 0:e.publishDate),contentGenre:null==e?void 0:e.genre,isDaiAds:!!(null==e?void 0:e.isDaiAds),isDvr:(null===(r=null==e?void 0:e.streamInfo)||void 0===r?void 0:r.isDvr)||!1,dvrWindowLength:(null===(l=null==e?void 0:e.streamInfo)||void 0===l?void 0:l.isDvr)&&(null===(a=null==e?void 0:e.streamInfo)||void 0===a?void 0:a.dvrWindowLength)||0,implementationId:null===(s=null==e?void 0:e.comscoreConfig)||void 0===s?void 0:s.implementationId};return"LINEARCHANNEL"===(null==e?void 0:e.contentType)&&(u.ContentType="LIVE"),u}function De(e){var n,t;return(null==e?void 0:e.series)?null===(t=null==e?void 0:e.series)||void 0===t?void 0:t.title:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.title}function je(e){var n,t;return(null==e?void 0:e.series)?null===(t=null==e?void 0:e.series)||void 0===t?void 0:t.id:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.id}function Ee(e){var n=new Date(1e3*Number(e));return{year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate()}}function Ae(e){if(!e)return{season:null,episode:null};var n=e.match(/S(\d+)\s*E(\d+)/i);return n?{season:Number(n[1]),episode:Number(n[2])}:{season:null,episode:null}}!function(e){e.registerPlugin("comscore",(function(e){console.log(this),console.log("hello form comscore plugin",e);var n=e||{};!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;new Promise((function(t,o){var i=document.createElement("script");i.src=n||"https://appcms.staging.asset.viewlift.com/comscore.js",i.async=!0,document.head.appendChild(i),i.onload=function(){fe({publisherId:e||"40813950"})},i.onerror=function(e){o("Error while loading script ".concat(src," : ").concat(e))}}))}(n.publisherId,n.endpoint)}))}(r);var xe=Object.freeze({__proto__:null,createComscoreStreamingTag:ke,destroyComscoreTag:Oe,endComscoreAdTracking:function(){if(me){var e=me;e.notifyPause(),e.notifyEnd(),be="content",ge&&(e.setMetadata(ge),e.notifyPlay()),console.log("[Comscore] Ad ended. Resumed content playback.")}},finishComscoreAdTracking:function(){me&&(me.notifyPause(),console.log("[Comscore] Ad Finished. Resumed content playback."))},formulateComscoreAdPayload:function(e){return{id:null==e?void 0:e.adId,adTitle:null==e?void 0:e.adTitle,adDuration:(null==e?void 0:e.durationInSeconds)||0,startTimeInSeconds:(null==e?void 0:e.startTimeInSeconds)||0,campaignId:null==e?void 0:e.campaignId,placementId:null==e?void 0:e.placementId,trackingUrl:null==e?void 0:e.trackingUrl}},formulateComscorePayload:Ce,getComscoreTagInstance:function(){return me},setComscorePlayerInstance:Se,startComscoreAdTracking:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!me&&!window.analytics)return console.log("is StreamingAnalytics started Initialised?",Pe()),void console.warn("[Comscore] Tag not initialized or analytics missing.");var n=window.analytics,t=me;be="ad",t.notifyPause();var o=new n.StreamingAnalytics.AdvertisementMetadata;o.setMediaType(Te({isLive:null==we?void 0:we.isLive,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds})),o.setUniqueId(e.id||"ad-001"),o.setLength(e.durationMs||0),o.setTitle(e.title||"Advertisement"),o.setServerCampaignId(e.campaignId),o.setRelatedContentMetadata(ge),o.setDeliveryType(n.StreamingAnalytics.AdvertisementMetadata.AdvertisementDeliveryType.NATIONAL),o.setPlacementId(e.placementId);var i={cs_ad_tu:null==e?void 0:e.trackingUrl,ns_st_ami:null==e?void 0:e.creativeId};o.addCustomLabels(i),t.setMetadata(o),t.notifyPlay(),console.log("[Comscore] Ad started:",e)}});function Ne(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 Le(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ne(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function _e(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 Re(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)?Re(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function Re(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 Me(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 Ve(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Me(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Be=function(e,n,t,r){var l,s,u,d,p,f=r.res,m=r.sres,g=i.getPlayer(e),y=(null==f?void 0:f.contentType)||"video",b=(null==f||null===(l=f[y])||void 0===l?void 0:l.drmEnabled)||!1,w=(null==f||null===(s=f[y])||void 0===s||null===(u=s.streamingInfo)||void 0===u?void 0:u.isLiveStream)||!1,k=(null==f||null===(d=f[y])||void 0===d||null===(p=d.liveDetails)||void 0===p?void 0:p.isDvrEnabled)||!1;c.setCurrentVideo(f),c.videoReplayTracker.set(f),g&&(g.on("loadstart",(function(){w?t.resolve({status:!0,msg:"Video Loaded",response:f}):t.resolve(Ve({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:f}:{response:f}))})),g.on("loadeddata",(function(){var t,r,l,s=a.getCaptions(e);if(null==s||s.map((function(n){return a.disableCaptions(e,n.id)})),k&&"Safari"===o.detectBrowser())try{var u;null==g||null===(u=g.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==g||!g.muted())&&h(e,sessionStorage.getItem("volume")||"100");var d=c.getCurrentVideo();if(function(e,n){var t,o,r,l,a,s,u,d,v,p,f,m=null==e?void 0:e.playerId,g=i.getPlayer(m),y=null==n?void 0:n.siteName;if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var h=c.getCurrentVideo(),b=(null==h||null===(o=h.video)||void 0===o?void 0:o.metadata)||[],w=(null==b?void 0:b.length)&&b.filter((function(e){return"advertisingGenre"===e.name}));if(null!==(r=w)&&void 0!==r&&r.length){var k=w.map((function(e){return e.value}));w=null==k?void 0:k.join(",")}Oe();var I=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,S=Array.isArray(null==I?void 0:I.category)?null==I||null===(a=I.category)||void 0===a?void 0:a.join(","):(null==I?void 0:I.category)||null,P=Ce(Le(Le({},null==h?void 0:h.video),{},{siteName:y,programId:(null==I?void 0:I.videotmsid)||null,programTitle:(null==I?void 0:I.lcProgrammeName)||null,episodeId:(null==I?void 0:I.videotmsid)||null,seasonNumber:(null==I||null===(s=I.seriesDetails)||void 0===s?void 0:s.season)||null,episodeNumber:(null==I||null===(u=I.seriesDetails)||void 0===u?void 0:u.episode)||null,isCompleteEpisode:!!(null!=h&&null!==(d=h.video)&&void 0!==d&&d.series||null!=I&&null!==(v=I.seriesDetails)&&void 0!==v&&v.episode),genre:w||S,comscoreConfig:{implementationId:(null==e||null===(p=e.comscore)||void 0===p?void 0:p.implementationId)||null,projectId:(null==e||null===(f=e.comscore)||void 0===f?void 0:f.projectId)||null}}));console.log("comscoreOptions player data",P),ke(Le({playerName:"Video.js"},P)),Se(g)}}(n,f),o.clearError(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.saveOffline)){var v,p,m=Ve(Ve({},n),f);!function(e,n,t){var o,r,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(re=null==n||null===(r=n.series)||void 0===r?void 0:r.id),oe=[],ie=0,J=t;var a=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,s=i.getPlayer(e);s&&(s.on("dispose",le),s.on("timeupdate",(function(){if(!s.seeking()){var e=Math.floor(s.currentTime());oe.includes(ie)||(e!=ie||e<a?e>ie&&(ie=e+a):(oe.push(e),ae(s,n,a)))}})),s.one("ended",(function(){ae(s,n,a,!0)})))}(e,m,null==d||null===(v=d.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=n&&null!==(l=n.analytics)&&void 0!==l&&l.muxKey&&null!=g&&g.mux){var y,b,w,I,S,P,T=(null===(y=c.getCurrentVideo())||void 0===y?void 0:y.video)||(null==f?void 0:f.video),O=null==T?void 0:T.gist,C={env_key:null==n||null===(b=n.analytics)||void 0===b?void 0:b.muxKey,player_name:"vl-web-player",player_version:null===(w=window)||void 0===w?void 0:w.vl_player_version,video_id:null==O?void 0:O.id,video_title:null==O?void 0:O.title,video_series:null==T||null===(I=T.series)||void 0===I?void 0:I.title,video_stream_type:null!=T&&null!==(S=T.streamingInfo)&&void 0!==S&&S.isLiveStream?"live":"video",viewer_user_id:null==n||null===(P=n.analytics)||void 0===P?void 0:P.userId};g.mux({debug:!1,data:C})}})),g.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];g.trigger("subtitlechanged",n)})),g.on("subtitlechanged",(function(e,n){var t,o,i,r,l,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}})),g.tech_.on("retryplaylist",(function(){w&&ve(f,e)})),g.on("error",(function(){var n,i;(console.log("ERROR",g.error(),g.error().code),4===g.error().code&&w)?ve(f,e):(o.handleError(e,(null==g||null===(n=g.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==g||null===(i=g.error())||void 0===i?void 0:i.message)||"Some error occured",response:f}))})),g.one("play",(function(){var e,t,o,i,r;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!==(r=n.series)&&void 0!==r&&r.enable){var l,a,s,u=null===(l=c.getCurrentVideo())||void 0===l||null===(a=l.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.id,d=c.getSeriesWatchMap(),v=(null==d?void 0:d.get(u))||{t:0,p:0},p=v.t,f=v.p;p&&f<95&&setTimeout((function(){g.currentTime(p)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){g.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=g&&g.dvrSeekbar)try{g.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),g.on("volumechange",(function(){var e=100*g.volume().toFixed(2);g.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),g.on("chromecastDisconnected",(function(){if(w){g.currentSource();for(var e=g.textTracks(),n=e.length-1;n>=0;n--)g.removeRemoteTextTrack(e[n])}})),g.one("loadeddata",(function(){var e,n=(null==g||null===(e=g.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0})),"object"==v(g.dash)){var t,i,r,l=null==g||null===(t=g.dash)||void 0===t||null===(i=t.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==l?void 0:l.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),s=_e(n);try{for(s.s();!(r=s.n()).done;){var u=r.value;if(a&&(null==u?void 0:u.id)=="dash-audio-".concat(a.index)){u.enabled=!0;break}}}catch(e){s.e(e)}finally{s.f()}}else{var d,c=_e(n);try{for(c.s();!(d=c.n()).done;){var p,f,m,y=d.value;if(("Chrome"==o.detectBrowser()||"Edge"==o.detectBrowser()&&(null!==(p=navigator)&&void 0!==p&&null!==(f=p.userAgent)&&void 0!==f&&f.includes("Macintosh")||!b))&&null!=y&&null!==(m=y.label)&&void 0!==m&&m.includes("5.1"))g.audioTracks().removeTrack(y);else{if("main"==y.kind){y.enabled=!0;break}y.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}})))};function He(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function Ue(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function qe(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(c.getCurrentEpgPrograms()||[]).filter((function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function Fe(e,n){var t=i.getPlayer(e);if(t){var o=n.dvrConfig,r=void 0===o?{}:o,l=n.videoId;n.epg;var a=r.playLive,s=r.playFromBegining,u=r.programs;c.setCurrentEpgPrograms(u),t.on("loadeddata",(function(){f.checkDvrStartOverEnabled(n)?s?f.playFromBeginningHandler(t,n):a?f.playLiveOrResumeHandler(t,l):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,r=n.epg,l=o.buttonConfig,a=void 0===l?{}:l,s=a.watchLive;a.resume;var u=a.startFromBegining,d=i;if(r&&null!=r&&r.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!f.getWatchedTime(d),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var m=f.getCurrentProgramThumbnail(n);m&&(p.style.backgroundImage="url(".concat(m,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=Ge(o,v),p.style.display="flex",e.el().appendChild(p),f.pauseAndHideControl(e),We("watch-live-resume-btn",s,(function(){f.showControl(e,p),f.playLiveOrResumeHandler(e,d)})),We("watch-begining-btn",u,(function(){f.showControl(e,p),f.playFromBeginningHandler(e,n)}))}(t,n),f.handleLiveStartOverBtn({player:t,showWatchLive:!0,showStartOver:!0})):f.removeDvrStartOver(t)})),t.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,r=e.seekable(),l=r.start(0),a=r.end(r.length-1)-l,s=JSON.parse(sessionStorage.getItem("epgConfig")),u=t,d=!0;if(s&&null!=s&&s.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==s?void 0:s.programId),u=null==s?void 0:s.programId}e.on("seeking",(function(){i=!0})),e.on("seeked",(function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;u="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}f.saveWatchedTime(u,o),f.getProgramStartTime(e,n),f.handleLiveStartOverBtn({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");u="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(f.saveWatchedTime(u,t),o=t,function(e,n){qe(n).forEach((function(t){var o=t.id,i=t.title,r=t.time,l=document.getElementById(o);if(l){var a=Math.min(r/n*100,99.5);l.style.left="".concat(a,"%")}else{var s=e.controlBar.progressControl.seekBar.el(),u=He(o,i,Math.min(r/n*100,99.5));s.appendChild(u)}}))}(e,a))}}))}(t,n)}))}else console.warn("Player instance is required to initialize start over.")}function We(e,n,t){var o,i,r=document.getElementById(e);r&&(i=n,(o=r)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),r.addEventListener("click",t))}function Ge(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,r=t.startFromBegining,l=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(p.watchLiveIcon2()," ").concat(l,"</button>"),s='<button id="watch-begining-btn">'.concat(p.startLiveIcon()," ").concat((null==r?void 0:r.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(s,"</div>")}function ze(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 Ke(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ze(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Je=function(l,s,d,c){var v,p,f,m,g,y,h,b,w,I,S,P,T,O,C,D,j,E,A,x,L,_,R,M,V,B,H,U,q,F,W,G,z,K,J,Y,X,Q,ne,te,oe=s.res,ie=void 0===oe?null:oe,re=s.sres,le=void 0===re?null:re,ae=null!=d&&d.chromecastReceiverId?["chromecast","html5"]:["html5"],se=(null===(v=ie)||void 0===v?void 0:v.contentType)||"video",ue=u.impolicy16x9(null===(p=ie)||void 0===p||null===(f=p[se])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||u.impolicy16x9(null===(g=ie)||void 0===g||null===(y=g[se])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),de=(null===(w=ie)||void 0===w||null===(I=w[se])||void 0===I||null===(S=I.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,ce=(null===(P=ie)||void 0===P||null===(T=P[se])||void 0===T||null===(O=T.streamingInfo)||void 0===O?void 0:O.isLiveStream)||!1,ve=(null===(C=ie)||void 0===C||null===(D=C.ads)||void 0===D||null===(j=D.preRoll)||void 0===j||null===(E=j.adTags)||void 0===E||null===(A=E.web)||void 0===A?void 0:A.active)&&(null===(x=ie)||void 0===x||null===(L=x.ads)||void 0===L||null===(_=L.preRoll)||void 0===_||null===(R=_.adTags)||void 0===R||null===(M=R.web)||void 0===M?void 0:M.url),pe=(null===(V=ie=Ke(Ke({},ie),{},{audioAssetSource:null==d?void 0:d.audioAssetSource}))||void 0===V||null===(B=V[se])||void 0===B?void 0:B.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(H=window)||void 0===H||null===(U=H.app_data)||void 0===U||null===(q=U.appcmsMain)||void 0===q||null===(F=q.adsConfig)||void 0===F?void 0:F.vodAdSticherProvider)||!1,fe=(null==d?void 0:d.latency)||6,me=(null==d?void 0:d.skin_settings)||{};null==d||d.dvrConfig;var ge=(ne={enableSmoothSeeking:!0,controls:0!=(null==d?void 0:d.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==d?void 0:d.muted)||!1,autoplay:(null==d?void 0:d.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==me?void 0:me.pictureInPictureToggle)||!1},playbackRates:null!=me&&me.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==d.skin,liveui:de},e(ne,"autoplay",null==d?void 0:d.autoplay),e(ne,"normalizeAutoplay",(null==d?void 0:d.autoplay)&&!ve),e(ne,"loop",(null==d?void 0:d.loop)||!1),e(ne,"audioPosterMode",null==d?void 0:d.audioPosterMode),e(ne,"html5",Ke(Ke({dash:Ke(Ke(Ke({},!r.browser.IS_SAFARI&&{useTTML:!0}),(null==d?void 0:d.debugConfig)&&(null==d||null===(W=d.debugConfig)||void 0===W?void 0:W.enable)&&{debug:!0,logLevel:null!=d&&null!==(G=d.debugConfig)&&void 0!==G&&G.logLevel?null==d||null===(z=d.debugConfig)||void 0===z?void 0:z.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:fe},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Ke(Ke({liveRangeSafeTimeDelta:fe,useDevicePixelRatio:!0,experimentalLLHLS:(null==d?void 0:d.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==d||null===(K=d.customData)||void 0===K?void 0:K.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(J=null==d?void 0:d.enableLowInitialPlaylist)||void 0===J||J}),debug:(null==d?void 0:d.debugConfig)&&(null==d||null===(Y=d.debugConfig)||void 0===Y?void 0:Y.enable)||!1,nativeTextTracks:"Safari"==o.detectBrowser()},0==(null==d||null===(X=d.customData)||void 0===X?void 0:X.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==d||null===(Q=d.customData)||void 0===Q?void 0:Q.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(ne,"poster",ue),e(ne,"techOrder",ae),e(ne,"chromecast",{requestCustomDataFn:function(e){var n,t,o=i.getPlayer(l),r=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,t){var o,i,r,l,a,s,u,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,y,h,b,w,k,I;f.isDrmEnabled=!0;var S=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,P=(null==S?void 0:S.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=P;var T=(null==S?void 0:S.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===(I=k.httpRequestHeaders)||void 0===I?void 0:I["X-AxDRM-Message"]);f.licenseToken=T}var O=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=O;var C=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=C;var D=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=D;var j=null==e||null===(u=e[p])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=j,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(ie,e,r);return Ke(Ke({},a),{},{convivaMetaData:Ke({customerKey:(null==d||null===(n=d.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==d||null===(t=d.convivaConfig)||void 0===t?void 0:t.debug)||!1},Z.getData())})},modifyLoadRequestFn:function(e){var n,t,o,r,a,s=i.getPlayer(l),u=(null==s?void 0:s.currentSource())||{};!(null===(n=ie)||void 0===n||null===(t=n[se])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(r=o.videoAssets)||void 0===r?void 0:r.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(a=u.src)&&void 0!==a&&a.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),ne);if(!r.getPlayers()[l]){null!=d&&d.debugConfig&&null!=d&&null!==(te=d.debugConfig)&&void 0!==te&&te.enable&&r.log.level("debug");var ye=r(l,ge,function(){var e=n(t.mark((function e(){var n,i,s,u,v,p,f,m,g,y,h,b,w,I,S,P,T,O,C,D,j;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(ye),console.log(r.VERSION),console.log(r.getPlugins()),e.next=5,N(d,ie);case 5:if(w=null===(n=ie)||void 0===n||null===(i=n[se])||void 0===i||null===(s=i.liveDetails)||void 0===s?void 0:s.startOverTime,ce&&c.resolve(Ke({status:!0,msg:"Player Initialised"},le?{seriesResponse:le,response:ie}:{response:ie})),de&&null!=d&&null!==(u=d.dvrConfig)&&void 0!==u&&u.enable&&Fe(l,Ke(Ke({},d),{},{isDvrEnabled:de})),o.inititateBeacon(l,null==d?void 0:d.analyticsCb,null==d?void 0:d.customData),$(l,d),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),de&&k(l,w),!ve||null!=d&&null!==(v=d.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(l,ve,ie),I=o.getSource(ie,l),console.log(I),null!=d&&d.nearestClusterUrl&&(I=o.getUpdatedClusterSource(I,d.nearestClusterUrl)),!pe){e.next=21;break}return e.next=20,o.getSGAIEnabledSource(l,ie);case 20:I=e.sent;case 21:I?o.loadVideo(l,I):(c.reject({status:!1,msg:"Incompatible / Missing Source",response:ie}),o.handleError(l,"Incompatible / Missing Source")),((null===(p=ie)||void 0===p||null===(f=p[se])||void 0===f||null===(m=f.contentDetails)||void 0===m||null===(g=m.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=ie)||void 0===y||null===(h=y[se])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(j=(null===(P=ie)||void 0===P||null===(T=P[se])||void 0===T||null===(O=T.contentDetails)||void 0===O?void 0:O.closedCaptions)||(null===(C=ie)||void 0===C||null===(D=C[se])||void 0===D?void 0:D.closedCaptions),S=j.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),a.addCaptions(l,S)),null!=d&&d.disableControls?o.disableControls(l):ee(l,Ke(Ke(Ke({},d),ge),{},{liveVideo:ce,isDvrEnabled:de,res:ie,sres:le})),Be(l,Ke(Ke(Ke({},d),ge),{},{liveVideo:ce}),c,{res:ie,sres:le});case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}},Ye={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function Xe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Qe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Xe(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var $e,Ze=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,r=en(e);Je(i,{res:r},e,{resolve:t,reject:o})},en=function(e){var n,t,i,r,l,a,s,u,d=null==e?void 0:e.streamingInfo,c=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,v=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,p=(null==e||null===(i=e.streamingInfo)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.url)||null,f=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,g=(null==e||null===(a=e.streamingInfo)||void 0===a?void 0:a.subtitles)||[],y=(null==e||null===(s=e.streamingInfo)||void 0===s||null===(u=s.videoAssets)||void 0===u?void 0:u.drmProvider)||null,h=null==e?void 0:e.token,b=o.getDecodedToken(h),w=null==b?void 0:b.site;return Qe(Qe({id:null==Ye?void 0:Ye[w]},!v&&{directPlaybackUrl:null==c?void 0:c.url}),{},{video:{drmEnabled:v,streamingInfo:{videoAssets:Qe(Qe({},y&&{drmProvider:y}),{},{widevine:null==c?void 0:c.widevine,fairPlay:null==c?void 0:c.fairPlay,playReady:null==c?void 0:c.playReady})},liveDetails:{isDvrEnabled:null==d?void 0:d.isDvrEnabled},gist:Qe({},f&&{videoImageUrl:f}),contentDetails:Qe({},(null==g?void 0:g.length)>0&&{closedCaptions:m(g)})},ads:{preRoll:{adTags:{web:Qe(Qe({},p&&{active:!0}),p&&{url:p})}}}})};function nn(e,n){return tn.apply(this,arguments)}function tn(){return(tn=n(t.mark((function e(n,i){var r,l,a,s,u,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.resolve,l=i.reject,a=null==n?void 0:n.videoId,s=null==n?void 0:n.playerId,u=!(null==n||!n.anonymousId),e.next=6,o.getToken();case 6:d=e.sent,o.getVideoDetails(a,d).then((function(e){var t,i,v,p;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(i=t.video)||void 0===i||null===(v=i.gist)||void 0===v?void 0:v.contentType,c.setCurrentVideo(null==e?void 0:e.data);var f,m=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(p=n.watchHistory)&&void 0!==p&&p.enable&&!u)if((null===(f=n.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var g,y,h,b=de((null===(g=n.watchHistory)||void 0===g?void 0:g.profileId)||"",a,null==n?void 0:n.siteOwner);if(b&&b.length)n.watchHistoryResumeTime=(null===(y=b[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(h=b[0])||void 0===h?void 0:h.watchedPercentage)||null;m.contentType="video",Je(s,{res:m},n,{resolve:r,reject:l})}else o.getVideoInfo(a,d).then((function(e){var t,o,i,r,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.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,m.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){Je(s,{res:m},n,{resolve:r,reject:l})}));else Je(s,{res:m},n,{resolve:r,reject:l})})).catch((function(e){o.initiateErrorHandling(e,s,l,a)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function on(e,n){return rn.apply(this,arguments)}function rn(){return(rn=n(t.mark((function e(n,i){var r,l,a,s,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.resolve,l=i.reject,e.next=3,o.getToken();case 3:a=e.sent,s=null==n?void 0:n.playerId,u=null==n?void 0:n.epg,o.getLinearChannelDetails(u,a).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==u?void 0:u.channelId,Je(s,{res:t},n,{resolve:r,reject:l})})).catch((function(e){o.initiateErrorHandling(e,s,l,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ln(e,n){return an.apply(this,arguments)}function an(){return(an=n(t.mark((function e(n,i){var r,l,a,s,u,d,v;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=i.resolve,a=i.reject,e.next=3,o.getToken();case 3:s=e.sent,u=null==n?void 0:n.playerId,d=sessionStorage.getItem("season-idx")||0,c.seasonIdxManager.set(parseInt(d)),v=null==n||null===(r=n.series)||void 0===r?void 0:r.id,o.getSeriesDetails(v,s).then((function(e){var t,i,r,d=e.data,p=e.data.seasons;c.setCurrentSeries(p);var f=videoId||(null==p||null===(t=p[0])||void 0===t||null===(i=t.episodes)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.id);o.createSeriesWatchMap(v,s),o.getVideoDetails(f,s).then((function(e){var t,o,i;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,c.setCurrentVideo(e.data),Je(u,{res:null==e?void 0:e.data,sres:d},n,{resolve:l,reject:a})})).catch((function(e){o.initiateErrorHandling(e,u,a,videoId)}))})).catch((function(e){o.initiateErrorHandling(e,u,a)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function un(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?sn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):sn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}exports.VLPlayerCore=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=n(t.mark((function n(i,r){var l,a,s,c,v,p,f,m,y,h,b,w,k,I,S,P,T,O,C,D,E,A,x,N,L;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(k=(null==e?void 0:e.videoSourceUrl)||!1,I=null==e?void 0:e.asat,S=(null==e||null===(l=e.epg)||void 0===l?void 0:l.enable)||!1,P=null==e?void 0:e.videoId,T=(null==e||null===(a=e.series)||void 0===a?void 0:a.enable)||!1,O=(null==e?void 0:e.streamingInfo)||!1,window.videoId=P,C=null==e?void 0:e.token,!o.token_authentication_enabled(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",C),o.refreshTokenManager().set(null==e?void 0:e.refreshToken),C&&!o.isTokenExpired(C)){n.next=16;break}return r({status:!1,msg:"".concat(C?"Token is expired !":"Missing Authorization Token"),response:{token:C}}),n.abrupt("return");case 16:$e=JSON.parse(atob(C.split(".")[1]));case 17:return window.siteName=null===(s=$e)||void 0===s?void 0:s.site,window.siteId=null===(c=$e)||void 0===c?void 0:c.siteId,e.isAnonymousUser=!(null===(v=$e)||void 0===v||!v.anonymousId),e.siteOwner=(null===(p=$e)||void 0===p?void 0:p.site)||null,e.userId=(null===(f=$e)||void 0===f?void 0:f.userId)||null,window.sessionStorage.setItem("uid",null===(m=$e)||void 0===m?void 0:m.userId),window.watchHistory=e.watchHistory||null,D=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(y=e.series)&&void 0!==y&&y.enable?null:null==e?void 0:e.chromecastReceiverId,E=(null==e||null===(h=e.analytics)||void 0===h?void 0:h.gaId)||null,(A=null==e?void 0:e.errors)&&(window.customErrors=A),window.customData=null==e?void 0:e.customData,d.setLocalisation(null==e||null===(b=e.customData)||void 0===b?void 0:b.localisation),o.baseUrlManager.set(e.apiBaseUrl),null!=e&&e.skin&&!u.isNotAValidSkin(e.skin)||(e.skin="VL_ONE"),n.next=35,j(e);case 35:E&&g("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return o.runGtag(E)})).catch((function(e){})),(x=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(D)))&&x.addEventListener("contextmenu",(function(e){return e.preventDefault()})),k?(L={directPlaybackUrl:k,id:N="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},I?o.getVideoDetails(N,C).then((function(n){var t=(null==n?void 0:n.data)||{};Je(D,{res:un(un({},t),L)},e,{resolve:i,reject:r})})).catch((function(e){o.initiateErrorHandling(e,D,r,N)})):Je(D,{res:L},e,{resolve:i,reject:r})):O?Ze(e,{resolve:i,reject:r}):T?ln(e,{resolve:i,reject:r}):S?on(e,{resolve:i,reject:r}):nn(e,{resolve:i,reject:r});case 39:case"end":return n.stop()}}),n)})));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:s.getRenditions,skip:o.skip,getPlayer:i.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,authenticateLC:o.authenticateLC,dispose:o.dispose,enableCaptions:a.enableCaptions,disableCaptions:a.disableCaptions,getCaptions:a.getCaptions,playSelectedResolution:s.playSelectedResolution,getSource:o.getSource,setVolume:h,getVolume:b,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed,getEntitlementData:o.getEntitlementData,adsQueuePointManager:o.adsQueuePointManager,getSsaiEvents:o.getSsaiEvents,playerEvents:l.playerEvents,onReplay:l.onReplay}},exports.initiateMarker=function(e){var n=i.getPlayer(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var r=t.start(0),l=t.end(t.length-1)-r;Ue(),qe(l).forEach((function(e){var n=e.id,t=e.title,i=e.time,r=He(n,t,Math.min(i/l*100,99.5));o.appendChild(r)}))}},exports.removeMarkers=Ue;
package/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("video.js/dist/video-js.min.css"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./generic-9f637989.js"),require("./player_instance-fcf6a8fb.js"),require("video.js");var e=require("./index-87ce75ce.js");require("./util-ca307e43.js"),require("./captions-dbc83a75.js"),require("./resolution-f9dcc1b4.js"),require("./skin-516012d7.js"),require("./localisation-56e0a999.js"),require("js-cookie"),require("./currentVideoInfo-31d70bec.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/typeof"),require("./icons-2609dbe4.js"),require("./helper-a50a8ffc.js"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),module.exports=e.VLPlayerCore;
1
+ "use strict";require("video.js/dist/video-js.min.css"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./generic-9f637989.js"),require("./player_instance-fcf6a8fb.js"),require("video.js");var e=require("./index-e5fc9b6e.js");require("./util-ca307e43.js"),require("./captions-dbc83a75.js"),require("./resolution-f9dcc1b4.js"),require("./skin-516012d7.js"),require("./localisation-56e0a999.js"),require("js-cookie"),require("./currentVideoInfo-31d70bec.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/typeof"),require("./icons-2609dbe4.js"),require("./helper-a50a8ffc.js"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),module.exports=e.VLPlayerCore;
@@ -1 +1 @@
1
- "use strict";var e=require("./features-9af43661.js"),l=require("./player_instance-fcf6a8fb.js"),i=require("./index-050c0e0f.js"),r=require("./generic-9f637989.js");require("videojs-contrib-quality-menu");var n=require("./index-87ce75ce.js"),o=require("./helper-a50a8ffc.js"),t=require("./currentVideoInfo-31d70bec.js"),u=require("video.js"),a=require("./icons-2609dbe4.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./resolution-f9dcc1b4.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/assertThisInitialized"),require("./skin-516012d7.js"),require("./localisation-56e0a999.js"),require("./autoNextVideo-b18583b0.js"),require("./util-ca307e43.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("@babel/runtime/helpers/slicedToArray"),require("axios"),require("js-cookie"),require("./captions-dbc83a75.js"),require("video.js/dist/video-js.min.css");function d(u,a){var d=l.getPlayer(u);d&&(d.on("loadeddata",(function(){var e,s,v,c,p,b=o.checkDvrStartOverEnabled(a),m=t.getCurrentEpgPrograms();d.qualityLevels()&&d.qualityLevels().length&&function(e){var i=l.getPlayer(e);i&&(null==i||i.qualityMenu,i.qualityMenu({useResolutionLabels:!0}))}(u),!(null!=a&&null!==(e=a.series)&&void 0!==e&&e.enable||null!==(s=window)&&void 0!==s&&null!==(v=s.app_data)&&void 0!==v&&null!==(c=v.appcmsMain)&&void 0!==c&&null!==(p=c.features)&&void 0!==p&&p.auto_play)||null!=a&&a.liveVideo||i.addNextEpPreview(u,a),null!=a&&a.liveVideo||r.isMobile()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||i.initiateTrickplay(u),b&&m&&m.length?n.initiateMarker(u):n.removeMarkers()})),d.one("play",(function(){var l,i,r,n;null!==(l=window)&&void 0!==l&&null!==(i=l.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(u,null===(r=window)||void 0===r||null===(n=r.customData)||void 0===n?void 0:n.iframeOverlayUrl)})))}var s=function(e,i){var r,n,o,t,a,d,s,v,c,p,b,m,g=l.getPlayer(e),h=(null==i?void 0:i.theme)||{},y=u.dom.$(".vjs-play-progress"),f=u.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");f&&(f.style.color="".concat(null===(r=window)||void 0===r||null===(n=r.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(t=o.brand)||void 0===t||null===(a=t.cta)||void 0===a||null===(d=a.primary)||void 0===d?void 0:d.backgroundColor)),y&&(y.style.background="".concat(null===(s=window)||void 0===s||null===(v=s.app_data)||void 0===v||null===(c=v.appcmsMain)||void 0===c||null===(p=c.brand)||void 0===p||null===(b=p.cta)||void 0===b||null===(m=b.primary)||void 0===m?void 0:m.backgroundColor));var q=g.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&y&&(y.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&q&&(q.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&f&&(f.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?q.el().style.borderRadius=".3em":q.el().style.borderRadius="1.3em")};exports.initialiseSkin=function(n,u){l.getPlayer(n).addClass("skin_vlone"),d(n,u),function(l,n){var u,d,s,v,c,p,b,m,g,h,y,f,q,j,w,k,C=(null==n?void 0:n.liveVideo)||!1,B=(null==n||null===(u=n.res)||void 0===u?void 0:u.contentType)||"video",M=(null==n||null===(d=n.res)||void 0===d||null===(s=d[B])||void 0===s?void 0:s.isSSAIEnabled)||!1,S=r.getSource(null==n?void 0:n.res,l)||{};S.src;var T=(null==n?void 0:n.skin_settings)||{};o.checkDvrStartOverEnabled(n),null!=T&&T.skipBtn&&0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)&&e.addSkipButton(l,"VL_ONE",a.SkipSvgV2());(null!=T&&T.rewindBtn&&0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)||1==(null==n?void 0:n.liveui))&&e.addRewindButton(l,"VL_ONE",a.RewindSvgV2());(null==n||null===(v=n.relatedVideos)||void 0===v||null===(c=v.content)||void 0===c?void 0:c.length)>0&&e.addVideoSelector(l,null==n?void 0:n.relatedVideos);null!=n&&null!==(p=n.series)&&void 0!==p&&p.enable&&e.addSeriesSelectorV2(l,n);(null==n||null===(b=n.streams)||void 0===b?void 0:b.length)>1&&e.addMulticamSelector(l,null==n?void 0:n.streams);if(i.addTVProviderImage(l,n),r.initialiseKeyboardEvents(l,n),"MEDIA_TAILOR"==(null===(m=window)||void 0===m||null===(g=m.app_data)||void 0===g||null===(h=g.appcmsMain)||void 0===h||null===(y=h.adsConfig)||void 0===y?void 0:y.vodAdSticherProvider)&&null!==(f=window)&&void 0!==f&&null!==(q=f.app_data)&&void 0!==q&&null!==(j=q.appcmsMain)&&void 0!==j&&null!==(w=j.adsConfig)&&void 0!==w&&w.vodAdClientSideTracking&&M)if(C)r.setupAdvertisementMarkersForLinear(l);else{var V,L=null;if(null!=n&&null!==(V=n.series)&&void 0!==V&&V.enable){var E,P,_,A,O,x=null===(E=t.getCurrentVideo())||void 0===E||null===(P=E.video)||void 0===P||null===(_=P.gist)||void 0===_?void 0:_.id,R=t.getSeriesWatchMap(),D=(null==R?void 0:R.get(x))||{t:0,p:0},I=D.t,N=D.p;"function"==typeof(null===(A=window)||void 0===A||null===(O=A.watchHistory)||void 0===O?void 0:O.cb)&&window.watchHistory.cb({watchedTime:I}),N<95&&(L=I)}else{var F=n.watchHistoryResumeTime;n.watchedPercentage<95&&(L=F)}r.setupAdvertisementMarkers(l,L)}null!=n&&n.isDvrEnabled&&null!=n&&null!==(k=n.dvrConfig)&&void 0!==k&&k.enable&&(e.addStartFromBeginningButton(l,n),e.addWatchLiveButton(l,n))}(n,u),s(n,u),function(e){var i,r,n,o=l.getPlayer(e),t=null;if(!o)return;var u=o.controlBar.getChild("VolumePanel"),a=null===(i=u.getChild("MuteToggle"))||void 0===i?void 0:i.el(),d=null==u||null===(r=u.el())||void 0===r?void 0:r.querySelector(".vjs-volume-bar"),s=null==u||null===(n=u.el())||void 0===n?void 0:n.querySelector(".vjs-volume-level");if(!u||!d||!s)return;function v(e){e.preventDefault(),t&&(clearTimeout(t),t=null),p(b(e.touches[0]))}function c(e){e.preventDefault(),p(b(e.changedTouches[0])),t=setTimeout((function(){u.el().classList.remove("vjs-hover")}),2e3)}function p(e){var l=Math.min(Math.max(e,0),100);s.style.height=l+"%",d.setAttribute("aria-valuenow",l),d.setAttribute("aria-valuetext",l+"%"),o.volume(l/100)}function b(e){var l=d.getBoundingClientRect(),i=e.clientY-l.top,r=l.height;return 100-Math.min(Math.max(i/r*100,0),100)}a.addEventListener("touchend",(function(){null!=u&&u.el()&&(u.el().classList.toggle("vjs-hover"),o.muted(!1),t&&(clearTimeout(t),t=null),t=setTimeout((function(){u.el().classList.remove("vjs-hover")}),2e3))})),d.addEventListener("touchmove",v,{passive:!1}),d.addEventListener("touchstart",v,{passive:!1}),d.addEventListener("touchend",c,{passive:!1})}(n)};
1
+ "use strict";var e=require("./features-9af43661.js"),l=require("./player_instance-fcf6a8fb.js"),i=require("./index-050c0e0f.js"),r=require("./generic-9f637989.js");require("videojs-contrib-quality-menu");var n=require("./index-e5fc9b6e.js"),o=require("./helper-a50a8ffc.js"),t=require("./currentVideoInfo-31d70bec.js"),u=require("video.js"),a=require("./icons-2609dbe4.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./resolution-f9dcc1b4.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/assertThisInitialized"),require("./skin-516012d7.js"),require("./localisation-56e0a999.js"),require("./autoNextVideo-b18583b0.js"),require("./util-ca307e43.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("@babel/runtime/helpers/slicedToArray"),require("axios"),require("js-cookie"),require("./captions-dbc83a75.js"),require("video.js/dist/video-js.min.css");function d(u,a){var d=l.getPlayer(u);d&&(d.on("loadeddata",(function(){var e,s,v,c,p,b=o.checkDvrStartOverEnabled(a),m=t.getCurrentEpgPrograms();d.qualityLevels()&&d.qualityLevels().length&&function(e){var i=l.getPlayer(e);i&&(null==i||i.qualityMenu,i.qualityMenu({useResolutionLabels:!0}))}(u),!(null!=a&&null!==(e=a.series)&&void 0!==e&&e.enable||null!==(s=window)&&void 0!==s&&null!==(v=s.app_data)&&void 0!==v&&null!==(c=v.appcmsMain)&&void 0!==c&&null!==(p=c.features)&&void 0!==p&&p.auto_play)||null!=a&&a.liveVideo||i.addNextEpPreview(u,a),null!=a&&a.liveVideo||r.isMobile()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||i.initiateTrickplay(u),b&&m&&m.length?n.initiateMarker(u):n.removeMarkers()})),d.one("play",(function(){var l,i,r,n;null!==(l=window)&&void 0!==l&&null!==(i=l.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(u,null===(r=window)||void 0===r||null===(n=r.customData)||void 0===n?void 0:n.iframeOverlayUrl)})))}var s=function(e,i){var r,n,o,t,a,d,s,v,c,p,b,m,g=l.getPlayer(e),h=(null==i?void 0:i.theme)||{},y=u.dom.$(".vjs-play-progress"),f=u.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");f&&(f.style.color="".concat(null===(r=window)||void 0===r||null===(n=r.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(t=o.brand)||void 0===t||null===(a=t.cta)||void 0===a||null===(d=a.primary)||void 0===d?void 0:d.backgroundColor)),y&&(y.style.background="".concat(null===(s=window)||void 0===s||null===(v=s.app_data)||void 0===v||null===(c=v.appcmsMain)||void 0===c||null===(p=c.brand)||void 0===p||null===(b=p.cta)||void 0===b||null===(m=b.primary)||void 0===m?void 0:m.backgroundColor));var q=g.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&y&&(y.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&q&&(q.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&f&&(f.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?q.el().style.borderRadius=".3em":q.el().style.borderRadius="1.3em")};exports.initialiseSkin=function(n,u){l.getPlayer(n).addClass("skin_vlone"),d(n,u),function(l,n){var u,d,s,v,c,p,b,m,g,h,y,f,q,j,w,k,C=(null==n?void 0:n.liveVideo)||!1,B=(null==n||null===(u=n.res)||void 0===u?void 0:u.contentType)||"video",M=(null==n||null===(d=n.res)||void 0===d||null===(s=d[B])||void 0===s?void 0:s.isSSAIEnabled)||!1,S=r.getSource(null==n?void 0:n.res,l)||{};S.src;var T=(null==n?void 0:n.skin_settings)||{};o.checkDvrStartOverEnabled(n),null!=T&&T.skipBtn&&0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)&&e.addSkipButton(l,"VL_ONE",a.SkipSvgV2());(null!=T&&T.rewindBtn&&0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)||1==(null==n?void 0:n.liveui))&&e.addRewindButton(l,"VL_ONE",a.RewindSvgV2());(null==n||null===(v=n.relatedVideos)||void 0===v||null===(c=v.content)||void 0===c?void 0:c.length)>0&&e.addVideoSelector(l,null==n?void 0:n.relatedVideos);null!=n&&null!==(p=n.series)&&void 0!==p&&p.enable&&e.addSeriesSelectorV2(l,n);(null==n||null===(b=n.streams)||void 0===b?void 0:b.length)>1&&e.addMulticamSelector(l,null==n?void 0:n.streams);if(i.addTVProviderImage(l,n),r.initialiseKeyboardEvents(l,n),"MEDIA_TAILOR"==(null===(m=window)||void 0===m||null===(g=m.app_data)||void 0===g||null===(h=g.appcmsMain)||void 0===h||null===(y=h.adsConfig)||void 0===y?void 0:y.vodAdSticherProvider)&&null!==(f=window)&&void 0!==f&&null!==(q=f.app_data)&&void 0!==q&&null!==(j=q.appcmsMain)&&void 0!==j&&null!==(w=j.adsConfig)&&void 0!==w&&w.vodAdClientSideTracking&&M)if(C)r.setupAdvertisementMarkersForLinear(l);else{var V,L=null;if(null!=n&&null!==(V=n.series)&&void 0!==V&&V.enable){var E,P,_,A,O,x=null===(E=t.getCurrentVideo())||void 0===E||null===(P=E.video)||void 0===P||null===(_=P.gist)||void 0===_?void 0:_.id,R=t.getSeriesWatchMap(),D=(null==R?void 0:R.get(x))||{t:0,p:0},I=D.t,N=D.p;"function"==typeof(null===(A=window)||void 0===A||null===(O=A.watchHistory)||void 0===O?void 0:O.cb)&&window.watchHistory.cb({watchedTime:I}),N<95&&(L=I)}else{var F=n.watchHistoryResumeTime;n.watchedPercentage<95&&(L=F)}r.setupAdvertisementMarkers(l,L)}null!=n&&n.isDvrEnabled&&null!=n&&null!==(k=n.dvrConfig)&&void 0!==k&&k.enable&&(e.addStartFromBeginningButton(l,n),e.addWatchLiveButton(l,n))}(n,u),s(n,u),function(e){var i,r,n,o=l.getPlayer(e),t=null;if(!o)return;var u=o.controlBar.getChild("VolumePanel"),a=null===(i=u.getChild("MuteToggle"))||void 0===i?void 0:i.el(),d=null==u||null===(r=u.el())||void 0===r?void 0:r.querySelector(".vjs-volume-bar"),s=null==u||null===(n=u.el())||void 0===n?void 0:n.querySelector(".vjs-volume-level");if(!u||!d||!s)return;function v(e){e.preventDefault(),t&&(clearTimeout(t),t=null),p(b(e.touches[0]))}function c(e){e.preventDefault(),p(b(e.changedTouches[0])),t=setTimeout((function(){u.el().classList.remove("vjs-hover")}),2e3)}function p(e){var l=Math.min(Math.max(e,0),100);s.style.height=l+"%",d.setAttribute("aria-valuenow",l),d.setAttribute("aria-valuetext",l+"%"),o.volume(l/100)}function b(e){var l=d.getBoundingClientRect(),i=e.clientY-l.top,r=l.height;return 100-Math.min(Math.max(i/r*100,0),100)}a.addEventListener("touchend",(function(){null!=u&&u.el()&&(u.el().classList.toggle("vjs-hover"),o.muted(!1),t&&(clearTimeout(t),t=null),t=setTimeout((function(){u.el().classList.remove("vjs-hover")}),2e3))})),d.addEventListener("touchmove",v,{passive:!1}),d.addEventListener("touchstart",v,{passive:!1}),d.addEventListener("touchend",c,{passive:!1})}(n)};
package/esm/bundle.css CHANGED
@@ -397,8 +397,6 @@
397
397
 
398
398
 
399
399
 
400
-
401
-
402
400
  .video-js .multicamera-parent.default{
403
401
  height: 345px;
404
402
  position: absolute;
@@ -480,6 +478,8 @@
480
478
 
481
479
 
482
480
 
481
+
482
+
483
483
  /* nextep */
484
484
  .next-ep-preview{
485
485
  position: absolute;
@@ -555,38 +555,6 @@
555
555
  margin-left: 8px;
556
556
  }
557
557
  }
558
- /* a wrapper element that tracks the mouse vertically */
559
- .vjs-thumbnail-holder {
560
- position: absolute;
561
- left: -1000px;
562
- }
563
-
564
- /* the thumbnail image itself */
565
- .vjs-thumbnail {
566
- position: absolute;
567
- left: 0;
568
- bottom: 1.3em;
569
- opacity: 0;
570
- transition: opacity .2s ease;
571
- -webkit-transition: opacity .2s ease;
572
- -moz-transition: opacity .2s ease;
573
- -mz-transition: opacity .2s ease;
574
- }
575
-
576
- /* fade in the thumbnail when hovering over the progress bar */
577
- /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
578
- .vjs-progress-control:hover .vjs-thumbnail,
579
- .vjs-progress-control.fake-active .vjs-thumbnail,
580
- .vjs-progress-control:active .vjs-thumbnail {
581
- opacity: 1;
582
- }
583
-
584
- /* ... but hide the thumbnail when hovering directly over it */
585
- .vjs-progress-control:hover .vjs-thumbnail:hover,
586
- .vjs-progress-control:active .vjs-thumbnail:active {
587
- opacity: 0;
588
- }
589
-
590
558
  .video-js.vjs-quality-menu {
591
559
  display: block;
592
560
  }
@@ -657,6 +625,38 @@
657
625
  -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
658
626
  animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
659
627
  }
628
+ /* a wrapper element that tracks the mouse vertically */
629
+ .vjs-thumbnail-holder {
630
+ position: absolute;
631
+ left: -1000px;
632
+ }
633
+
634
+ /* the thumbnail image itself */
635
+ .vjs-thumbnail {
636
+ position: absolute;
637
+ left: 0;
638
+ bottom: 1.3em;
639
+ opacity: 0;
640
+ transition: opacity .2s ease;
641
+ -webkit-transition: opacity .2s ease;
642
+ -moz-transition: opacity .2s ease;
643
+ -mz-transition: opacity .2s ease;
644
+ }
645
+
646
+ /* fade in the thumbnail when hovering over the progress bar */
647
+ /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
648
+ .vjs-progress-control:hover .vjs-thumbnail,
649
+ .vjs-progress-control.fake-active .vjs-thumbnail,
650
+ .vjs-progress-control:active .vjs-thumbnail {
651
+ opacity: 1;
652
+ }
653
+
654
+ /* ... but hide the thumbnail when hovering directly over it */
655
+ .vjs-progress-control:hover .vjs-thumbnail:hover,
656
+ .vjs-progress-control:active .vjs-thumbnail:active {
657
+ opacity: 0;
658
+ }
659
+
660
660
  .vjs-poster {
661
661
  display: inline-block;
662
662
  vertical-align: middle;
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import"axios";import{d as o,g as i,a as l,b as r,s as a,c as s,l as u,e as d,h as c,f as v,i as p,j as f,k as m,m as g,n as y,o as b,p as h,q as w,r as I,t as k,u as O,v as S,w as T,x as P,y as j,z as C,A as D,B as E,C as A,D as x,E as N,F as L,G as _,H as R,I as M,J as V,K as B,L as U,M as F}from"./generic-e21fdb61.js";import{g as H}from"./player_instance-34118a5b.js";import z from"video.js";import{o as W,g as q,a as G,s as K,b as J,p as Y,c as X}from"./util-7d5b2427.js";import{g as Q,d as $,a as Z,e as ee}from"./captions-f507e8ee.js";import{g as ne,p as te}from"./resolution-1c59b0f3.js";import{i as oe,a as ie}from"./skin-d5091b86.js";import{s as le}from"./localisation-0bf399a1.js";import{g as re,a as ae,s as se,v as ue,b as de,c as ce,d as ve,e as pe,f as fe}from"./currentVideoInfo-a8a254c2.js";import me from"@babel/runtime/helpers/typeof";import{s as ge,w as ye}from"./icons-37daa6b3.js";import{c as be,p as he,a as we,h as Ie,r as ke,g as Oe,b as Se,d as Te,s as Pe,e as je,f as Ce}from"./helper-349e076f.js";import De from"@babel/runtime/helpers/toConsumableArray";var Ee=function(e){return new Promise((function(n,t){if(Ae(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)}}))},Ae=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},xe=function(e,n,t){var o=H(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},Ne=function(e){var n=H(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Le=function(){var e=n(t.mark((function e(n){var i,l,r,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=H(null==n?void 0:n.playerId),null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable||!(null!=n&&n.chromecastReceiverId||null!=n&&n.airplay)){e.next=10;break}return e.prev=2,e.next=5,Ee("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.log("Error",e.t0);case 10:if(null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=13,import("@silvermine/videojs-chromecast");case 13:e.sent.default(z),(s=z.getTech("chromecast"))&&!s.prototype.seeking&&(s.prototype.seeking=function(){}),null!==(a=window)&&void 0!==a&&a.cast?null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==o()?null==r||r.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(n){return e.apply(this,arguments)}}(),_e=function(e,n){var t=H(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,l,r,a=this.el(),s=z.dom.getPointerPosition(a,n).x;z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S;if(console.log(u),u&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};var Re=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Ee("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)}}(),Me=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.resolve().then((function(){return Kn}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ve=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){z.getPlugin("eme")||z.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Be=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(z),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-8e3eab6d.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)}}(),Fe=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-08c7635e.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)}}(),He=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){Ee("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(z)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(z)}))},loadAdsLibrary:Re,loadEMELibrary:Ve,loadMuxPlugin:Be,loadDvrSeekbar:Ue,loadContribDash:Fe,loadComscorePlugin:Me});function ze(e){return We.apply(this,arguments)}function We(){return(We=n(t.mark((function e(n){var i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(null==n?void 0:n.airplay)||!1,e.next=3,Re();case 3:i&&"Safari"==o()&&Promise.resolve().then((function(){return He})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qe(e){return Ge.apply(this,arguments)}function Ge(){return(Ge=n(t.mark((function e(n){var o,i,l,r,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=H(n.playerId),e.next=3,Me();case 3:s.comscore({publisherId:null==n||null===(o=n.comscore)||void 0===o?void 0:o.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,implementationId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.implementationId,projectId:null==n||null===(r=n.comscore)||void 0===r?void 0:r.projectId,debug:(null==n||null===(a=n.comscore)||void 0===a?void 0:a.debug)||!1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ke(e,n){return Je.apply(this,arguments)}function Je(){return(Je=n(t.mark((function e(n,i){var l,r,a,s,u,d,c,v,p,f,m,g;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==i?void 0:i.contentType)||"video",p=null==i||null===(l=i[v])||void 0===l?void 0:l.drmEnabled,null==i||null===(r=i[v])||void 0===r||null===(a=r.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==i||null===(s=i[v])||void 0===s||null===(u=s.streamingInfo)||void 0===u||null===(d=u.videoAssets)||void 0===d?void 0:d.dash)||null,m=(null==n||null===(c=n.comscore)||void 0===c?void 0:c.enable)||!1,e.prev=6,qe(n),e.next=10,Promise.allSettled([p?"Safari"==o()?Ve():"caliente"!=(null===(g=window)||void 0===g?void 0:g.siteName)?Fe():Ve():"Safari"!=o()&&f?Fe():null,m?Le(n):null,Le(n)]);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),console.log("Error",e.t0);case 15:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function Ye(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 Xe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ye(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ye(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Qe=new Set,$e=null,Ze=function(e,n,t){var o,l,r,a,s,u,d,c={},v=(null==e?void 0:e.contentType)||"video";c["c3.cm.id"]=(null===(o=e[v])||void 0===o?void 0:o.id)||"Null",c["c3.cm.contentType"]=an(e),c[null==t||null===(l=t.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==e||!e.linearchannel),c[null==t||null===(r=t.Constants)||void 0===r?void 0:r.STREAM_URL]=n.currentSrc(),c[null==t||null===(a=t.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===i()?"NULL":i(),c["c3.cm.categoryType"]=on(e),c["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"}}(),c.DRMEnabled=(null===(s=e[v])||void 0===s?void 0:s.drmEnabled)||"None",c.DAIStream=null!==(u=e[v])&&void 0!==u&&null!==(d=u.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",c[t.Constants.DEFAULT_RESOURCE]="AKAMAI",c["c3.cm.brand"]="NULL",c.CDVREnabled=ln(e),c["c3.cm.genreList"]=nn(e),c["c3.cm.genre"]=en(e),c["c3.cm.channel"]=tn(e);var p=dn(re(),e);return c=Xe(Xe({},c),p)},en=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},nn=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"},tn=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"},on=function(e){return(null==e?void 0:e.contentType)||"null"},ln=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},rn=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(t=e[l])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(r)},an=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var sn,un,dn=function(e,n){var t,o,i,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var d=r(),c=l();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(o=t.series)||void 0===o?void 0:o.title)||"Null",u["c3.cm.seasonNumber"]=(null==d?void 0:d.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(i=e[d-1])||void 0===i||null===(a=i.episodes)||void 0===a||null===(s=a[c-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",u},cn=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"}},vn=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},pn=function(){var e=n(t.mark((function e(n,o){var i,l,r,a,s,u,d,c,v,p;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},l=i.trackConvivaPlayerEvent,r=i.paymentHandler,a=i.tveProvider,s=i.enable,u=i.appName,d=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(c=H(n),"function"==typeof(v=l)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(p=e.sent){e.next=13;break}return e.abrupt("return");case 13:c.ready((function(){var e=c.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=cn(t.keySystem);v("contentInfo",{DRMEnabled:o})}else v("contentInfo",{DRMEnabled:"None"})})),n||v("contentInfo",{DRMEnabled:"None"})})),c.on("loadstart",(function(){var e,n;$e&&$e!==c.currentSrc()&&v("playbackEnded"),v("setPlayer",c),Qe.clear(),$e=c.currentSrc();var t=vn(c.currentType()),i=ae(),l=Ze(i,c,p);l[null==p||null===(e=p.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",l[null==p||null===(n=p.Constants)||void 0===n?void 0:n.ASSET_NAME]=rn(i,o),l.authToken=d||"NULL",l.streamType=t,l.D2CType=r||"NONE",l.subscriberType=a||(r?"D2C":"FREE"),l["c3.cm.affiliate"]=a||"NULL",fn.setData(l),v("contentInfo",l)})),c.on("loadedmetadata",(function(){var e,n=c.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})})),c.on("play",(function(){Qe.has(c.currentSrc())||(Qe.add(c.currentSrc()),v("playbackStarted",null))})),c.on("ended",(function(){Qe.has(c.currentSrc())&&Qe.delete(c.currentSrc()),v("playbackEnded")})),c.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:c,adsLoader:null==e?void 0:e.adsLoader})})),c.on("dispose",(function(){null==Qe||Qe.clear(),v("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),fn=(sn={},{setData:function(e){sn=Xe(Xe({},sn),e)},getData:function(){return sn}}),mn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-f4aa20b4.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-df073080.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-9c9a2ee9.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-88d3eb07.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-9f13e83e.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?import("./skin-59b6384c.js").then((function(t){t.initialiseSkin(e,n)})):"news"==t&&import("./skin-c91fa37f.js").then((function(t){t.initialiseSkin(e,n)}))};function gn(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 yn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?gn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):gn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var bn=[],hn=0,wn=null;function In(){console.log("Cleaning up watch history data"),un=null,bn=[],hn=0,wn=null}function kn(e,n,t){var o,i,l,r,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var d=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(l=n.watchHistory)||void 0===l||l.xapiKey;var p=(null==n||null===(r=n.video)||void 0===r?void 0:r.originalObjectId)||null,f=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,m=Math.floor(e.currentTime()),g=u?100:Math.floor(c/v*100),y={};f?Sn(y={completed:u,watchedTime:m,watchedPercentage:g},d,n.siteOwner):(y=yn(yn({videoId:un,watchedTime:m,watchedPercentage:g,doneWatching:u,profileId:d},wn&&{seriesId:wn}),p&&{originalObjectId:p}),a(y).then((function(e){})).catch((function(e){}))),hn=c+t}function On(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Sn(n,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),l=On(i),r=(new Date).getTime(),a=ae(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return yn(yn({},n),{},e({},t,s[t]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===un}));d<0?l.push(yn(yn({content:u},n),{},{addedDate:r,updateDate:r})):l[d]=yn(yn(yn({},l[d]),n),{},{updateDate:r}),localStorage.setItem("".concat(i),JSON.stringify(l))}function Tn(e,n,t){var o=On(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var Pn=!1,jn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!Pn){var l=Cn(e,"videoAssets","secondaryVideoAssets"),r=s(l,n);return r&&u(n,r),Pn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Cn(e,n,t){if(Array.isArray(e))return e.map((function(e){return Cn(e,n,t)}));if(null!==e&&"object"===me(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=Cn(e[i],n,t)})),o}return e}function Dn(e){var n=e.publisherId,t=e.persistentLabels;if(!window.ns_||!window.ns_.analytics)throw new Error("Comscore library not loaded or analytics reference missing");var o=window.ns_.analytics;o.PlatformApi.setPlatformAPI(o.PlatformApi.PlatformApis.WebBrowser);var i=new o.configuration.PublisherConfiguration({publisherId:String(n),persistentLabels:{cs_ucfr:(null==t?void 0:t.userConsent)||"",cs_fpid:(null==t?void 0:t.userId)||""}});return o.configuration.addClient(i),o.configuration.enableFirstPartyCookie(),o.configuration.enableImplementationValidationMode(),o.start(),console.log("[Comscore] Library initialized for publisher:",n),window.analytics=o,o}var En=null,An=null,xn=null,Nn=[],Ln="content",_n=null;function Rn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(window.analytics){var n=window.analytics,t=new n.StreamingAnalytics;En=t,_n=e,e.implementationId&&t.setImplementationId(e.implementationId),e.projectId&&t.setProjectId(e.projectId),t.setMediaPlayerName(e.playerName||"Video.js"),t.setMediaPlayerVersion(e.playerVersion||"8.x"),t.createPlaybackSession(),e.isDvr&&t.setDVRWindowLength((null==e?void 0:e.dvrWindowLength)||0);var o=new n.StreamingAnalytics.ContentMetadata;return o.setMediaType(n.StreamingAnalytics.ContentMetadata.ContentType[e.contentType||"LONG_FORM_ON_DEMAND"]),o.setUniqueId(e.uniqueId),o.setLength((null==e?void 0:e.isLive)?0:e.duration||0),o.setStationTitle(e.stationTitle),o.setPublisherName(e.publisherName),o.setProgramTitle(e.programTitle),o.setDateOfDigitalAiring(e.digitalAirdate.year,e.digitalAirdate.month,e.digitalAirdate.day),o.setDateOfTvAiring(e.tvAiring.year,e.tvAiring.month,e.tvAiring.day),o.carryTvAdvertisementLoad(e.isDaiAds?"1":null),o.setEpisodeTitle(null==e?void 0:e.contentTitle),o.setEpisodeSeasonNumber(e.seasonNumber),o.setEpisodeNumber(e.episodeNumber),o.setProgramId(e.programId),o.setEpisodeId(e.episodeId),o.setGenreName(e.contentGenre),o.setDictionaryClassificationC3(e.brand||"null"),o.setDictionaryClassificationC4(e.platform||"null"),o.setDictionaryClassificationC6(e.genre||"null"),o.classifyAsCompleteEpisode(e.completeEpisode?"1":null),t.setMetadata(o),An=o,t.notifyPlay(),console.log("[Comscore] StreamingAnalytics initialized for:",e.programTitle),t}console.error("[Comscore] analytics SDK not found.")}var Mn=!1;function Vn(e){if(e)if(En){var n=En;xn=e;var t=function(){return"content"===Ln&&n.notifyPlay()},o=function(){return"content"===Ln&&n.notifyPause()},i=function(){return"content"===Ln&&n.notifyEnd()},l=function(){return n.notifySeekStart()},r=function(){n.notifyBufferStart(),function(e,n){Mn||(Mn=!0,e.any(["playing","timeupdate"],(function(){Mn=!1,n.notifyBufferStop(),n.notifyPlay()})))}(e,n)};e.on("play",t),e.on("pause",o),e.on("ended",i),e.on("seeking",l),e.on("waiting",r),e.on("timeupdate",(function(){if(null==_n?void 0:_n.isLive)return n.startFromPosition(0);n.startFromPosition&&"function"==typeof e.currentTime&&n.startFromPosition(1e3*e.currentTime())})),Nn.push((function(){e.off("play",t),e.off("pause",o),e.off("ended",i),e.off("seeking",l),e.off("waiting",r)})),console.log("[Comscore] Player events attached.")}else console.warn("[Comscore] Tag not initialized. Call initializeComscoreTag() first.");else console.warn("[Comscore] No player instance provided.")}function Bn(){return!!En||(console.warn("[Comscore] Tag not initialized."),!1)}function Un(e){var n=e.isLive,t=e.startTimeInSeconds;return n?analytics.StreamingAnalytics.AdvertisementMetadata.LIVE:0==t?analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_POST_ROLL:t===("function"==typeof(null==xn?void 0:xn.getDuration)&&(null==xn?void 0:xn.getDuration()))?ns_.analytics.StreamingAnalytics.AdvertisementMetadata.AdvertisementType.ON_DEMAND_POST_ROLL:analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_MID_ROLL}function Fn(){if(Nn.forEach((function(e){return e()})),Nn=[],En){try{En.notifyEnd()}catch(e){}En=null}xn=null,An=null,Ln="content",console.log("[Comscore] Streaming Tag destroyed.")}function Hn(e){var n,t,o,i,l,r,a,s,u={ContentType:(null==e?void 0:e.contentType)||"LONG_FORM_ON_DEMAND",uniqueId:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.id,duration:(null==e?void 0:e.runtime)||0,stationTitle:null==e?void 0:e.siteName,publisherName:null==e?void 0:e.network,programTitle:(null==e?void 0:e.programTitle)||zn(e),programId:(null==e?void 0:e.programId)||Wn(e),episodeId:(null==e?void 0:e.episodeId)||(null===(t=null==e?void 0:e.gist)||void 0===t?void 0:t.id),contentTitle:null===(o=null==e?void 0:e.gist)||void 0===o?void 0:o.title,isLive:null===(i=null==e?void 0:e.streamingInfo)||void 0===i?void 0:i.isLiveStream,brand:null==e?void 0:e.network,seasonNumber:(null==e?void 0:e.seasonNumber)||Gn(null==e?void 0:e.episodeDisplayAttribute).season,episodeNumber:(null==e?void 0:e.episodeNumber)||Gn(null==e?void 0:e.episodeDisplayAttribute).episode,platform:(null==e?void 0:e.platform)||"browser",genre:(null==e?void 0:e.genre)||"null",completeEpisode:(null==e?void 0:e.isCompleteEpisode)||!0,digitalAirdate:qn(null==e?void 0:e.publishDate),tvAiring:qn(null==e?void 0:e.publishDate),contentGenre:null==e?void 0:e.genre,isDaiAds:!!(null==e?void 0:e.isDaiAds),isDvr:(null===(l=null==e?void 0:e.streamInfo)||void 0===l?void 0:l.isDvr)||!1,dvrWindowLength:(null===(r=null==e?void 0:e.streamInfo)||void 0===r?void 0:r.isDvr)&&(null===(a=null==e?void 0:e.streamInfo)||void 0===a?void 0:a.dvrWindowLength)||0,implementationId:null===(s=null==e?void 0:e.comscoreConfig)||void 0===s?void 0:s.implementationId};return"LINEARCHANNEL"===(null==e?void 0:e.contentType)&&(u.ContentType="LIVE"),u}function zn(e){var n,t;return(null==e?void 0:e.series)?null===(t=null==e?void 0:e.series)||void 0===t?void 0:t.title:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.title}function Wn(e){var n,t;return(null==e?void 0:e.series)?null===(t=null==e?void 0:e.series)||void 0===t?void 0:t.id:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.id}function qn(e){var n=new Date(1e3*Number(e));return{year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate()}}function Gn(e){if(!e)return{season:null,episode:null};var n=e.match(/S(\d+)\s*E(\d+)/i);return n?{season:Number(n[1]),episode:Number(n[2])}:{season:null,episode:null}}!function(e){e.registerPlugin("comscore",(function(e){console.log(this),console.log("hello form comscore plugin",e);var n=e||{};!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;new Promise((function(t,o){var i=document.createElement("script");i.src=n||"https://appcms.staging.asset.viewlift.com/comscore.js",i.async=!0,document.head.appendChild(i),i.onload=function(){Dn({publisherId:e||"40813950"})},i.onerror=function(e){o("Error while loading script ".concat(src," : ").concat(e))}}))}(n.publisherId,n.endpoint)}))}(z);var Kn=Object.freeze({__proto__:null,createComscoreStreamingTag:Rn,destroyComscoreTag:Fn,endComscoreAdTracking:function(){if(En){var e=En;e.notifyPause(),e.notifyEnd(),Ln="content",An&&(e.setMetadata(An),e.notifyPlay()),console.log("[Comscore] Ad ended. Resumed content playback.")}},finishComscoreAdTracking:function(){En&&(En.notifyPause(),console.log("[Comscore] Ad Finished. Resumed content playback."))},formulateComscoreAdPayload:function(e){return{id:null==e?void 0:e.adId,adTitle:null==e?void 0:e.adTitle,adDuration:(null==e?void 0:e.durationInSeconds)||0,startTimeInSeconds:(null==e?void 0:e.startTimeInSeconds)||0,campaignId:null==e?void 0:e.campaignId,placementId:null==e?void 0:e.placementId,trackingUrl:null==e?void 0:e.trackingUrl}},formulateComscorePayload:Hn,getComscoreTagInstance:function(){return En},setComscorePlayerInstance:Vn,startComscoreAdTracking:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!En&&!window.analytics)return console.log("is StreamingAnalytics started Initialised?",Bn()),void console.warn("[Comscore] Tag not initialized or analytics missing.");var n=window.analytics,t=En;Ln="ad",t.notifyPause();var o=new n.StreamingAnalytics.AdvertisementMetadata;o.setMediaType(Un({isLive:null==_n?void 0:_n.isLive,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds})),o.setUniqueId(e.id||"ad-001"),o.setLength(e.durationMs||0),o.setTitle(e.title||"Advertisement"),o.setServerCampaignId(e.campaignId),o.setRelatedContentMetadata(An),o.setDeliveryType(n.StreamingAnalytics.AdvertisementMetadata.AdvertisementDeliveryType.NATIONAL),o.setPlacementId(e.placementId);var i={cs_ad_tu:null==e?void 0:e.trackingUrl,ns_st_ami:null==e?void 0:e.creativeId};o.addCustomLabels(i),t.setMetadata(o),t.notifyPlay(),console.log("[Comscore] Ad started:",e)}});function Jn(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 Yn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Jn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Jn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function Xn(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 Qn(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)?Qn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){a=!0,l=e},f:function(){try{r||null==t.return||t.return()}finally{if(a)throw l}}}}function Qn(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 $n(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Zn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?$n(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):$n(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var et=function(e,n,t,i){var l,r,a,s,u,v=i.res,p=i.sres,f=H(e),m=(null==v?void 0:v.contentType)||"video",g=(null==v||null===(l=v[m])||void 0===l?void 0:l.drmEnabled)||!1,y=(null==v||null===(r=v[m])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,b=(null==v||null===(s=v[m])||void 0===s||null===(u=s.liveDetails)||void 0===u?void 0:u.isDvrEnabled)||!1;se(v),ue.set(v),f&&(f.on("loadstart",(function(){y?t.resolve({status:!0,msg:"Video Loaded",response:v}):t.resolve(Zn({status:!0,msg:"Player Initialised"},p?{seriesResponse:p,response:v}:{response:v}))})),f.on("loadeddata",(function(){var t,i,l,r=Q(e);if(null==r||r.map((function(n){return $(e,n.id)})),b&&"Safari"===o())try{var a;null==f||null===(a=f.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==f||!f.muted())&&xe(e,sessionStorage.getItem("volume")||"100");var s=ae();if(function(e,n){var t,o,i,l,r,a,s,u,d=null==e?void 0:e.playerId,c=H(d),v=null==n?void 0:n.siteName;if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var p=ae();Fn();var f=null===(o=window)||void 0===o?void 0:o.lcProgrammeDetails,m=Hn(Yn(Yn({},null==p?void 0:p.video),{},{siteName:v,programId:(null==f?void 0:f.videotmsid)||null,programTitle:(null==f?void 0:f.lcProgrammeName)||null,episodeId:(null==f?void 0:f.videotmsid)||null,seasonNumber:(null==f||null===(i=f.seriesDetails)||void 0===i?void 0:i.season)||null,episodeNumber:(null==f||null===(l=f.seriesDetails)||void 0===l?void 0:l.episode)||null,isCompleteEpisode:!!(null!=p&&null!==(r=p.video)&&void 0!==r&&r.series||null!=f&&null!==(a=f.seriesDetails)&&void 0!==a&&a.episode),genre:null,comscoreConfig:{implementationId:(null==e||null===(s=e.comscore)||void 0===s?void 0:s.implementationId)||null,projectId:(null==e||null===(u=e.comscore)||void 0===u?void 0:u.projectId)||null}}));console.log("comscoreOptions player data",m),Rn(Yn({playerName:"Video.js"},m)),Vn(c)}}(n,v),d(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.saveOffline)){var u,c,p=Zn(Zn({},n),v);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(wn=null==n||null===(i=n.series)||void 0===i?void 0:i.id),bn=[],hn=0,un=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=H(e);a&&(a.on("dispose",In),a.on("timeupdate",(function(){if(!a.seeking()){var e=Math.floor(a.currentTime());bn.includes(hn)||(e!=hn||e<r?e>hn&&(hn=e+r):(bn.push(e),kn(a,n,r)))}})),a.one("ended",(function(){kn(a,n,r,!0)})))}(e,p,null==s||null===(u=s.video)||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.id)}if(null!=n&&null!==(l=n.analytics)&&void 0!==l&&l.muxKey&&null!=f&&f.mux){var m,g,y,h,w,I,k=(null===(m=ae())||void 0===m?void 0:m.video)||(null==v?void 0:v.video),O=null==k?void 0:k.gist,S={env_key:null==n||null===(g=n.analytics)||void 0===g?void 0:g.muxKey,player_name:"vl-web-player",player_version:null===(y=window)||void 0===y?void 0:y.vl_player_version,video_id:null==O?void 0:O.id,video_title:null==O?void 0:O.title,video_series:null==k||null===(h=k.series)||void 0===h?void 0:h.title,video_stream_type:null!=k&&null!==(w=k.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==n||null===(I=n.analytics)||void 0===I?void 0:I.userId};f.mux({debug:!1,data:S})}})),f.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];f.trigger("subtitlechanged",n)})),f.on("subtitlechanged",(function(e,n){var t,o,i,l,r,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}})),f.tech_.on("retryplaylist",(function(){y&&jn(v,e)})),f.on("error",(function(){var n,o;(console.log("ERROR",f.error(),f.error().code),4===f.error().code&&y)?jn(v,e):(c(e,(null==f||null===(n=f.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==f||null===(o=f.error())||void 0===o?void 0:o.message)||"Some error occured",response:v}))})),f.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 r,a,s,u=null===(r=ae())||void 0===r||null===(a=r.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.id,d=de(),c=(null==d?void 0:d.get(u))||{t:0,p:0},v=c.t,p=c.p;v&&p<95&&setTimeout((function(){f.currentTime(v)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){f.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=f&&f.dvrSeekbar)try{f.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),f.on("volumechange",(function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),f.on("chromecastDisconnected",(function(){if(y){f.currentSource();for(var e=f.textTracks(),n=e.length-1;n>=0;n--)f.removeRemoteTextTrack(e[n])}})),f.one("loadeddata",(function(){var e,n=(null==f||null===(e=f.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0})),"object"==me(f.dash)){var t,i,l,r=null==f||null===(t=f.dash)||void 0===t||null===(i=t.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==r?void 0:r.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),s=Xn(n);try{for(s.s();!(l=s.n()).done;){var u=l.value;if(a&&(null==u?void 0:u.id)=="dash-audio-".concat(a.index)){u.enabled=!0;break}}}catch(e){s.e(e)}finally{s.f()}}else{var d,c=Xn(n);try{for(c.s();!(d=c.n()).done;){var v,p,m,y=d.value;if(("Chrome"==o()||"Edge"==o()&&(null!==(v=navigator)&&void 0!==v&&null!==(p=v.userAgent)&&void 0!==p&&p.includes("Macintosh")||!g))&&null!=y&&null!==(m=y.label)&&void 0!==m&&m.includes("5.1"))f.audioTracks().removeTrack(y);else{if("main"==y.kind){y.enabled=!0;break}y.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}})))};function nt(e){var n=H(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),l=t.end(t.length-1)-i;ot(),it(l).forEach((function(e){var n=e.id,t=e.title,i=e.time,r=tt(n,t,Math.min(i/l*100,99.5));o.appendChild(r)}))}}function tt(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function ot(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function it(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(ce()||[]).filter((function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function lt(e,n){var t=H(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,l=n.videoId;n.epg;var r=i.playLive,a=i.playFromBegining,s=i.programs;ve(s),t.on("loadeddata",(function(){be(n)?a?he(t,n):r?we(t,l):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,l=n.epg,r=o.buttonConfig,a=void 0===r?{}:r,s=a.watchLive;a.resume;var u=a.startFromBegining,d=i;if(l&&null!=l&&l.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!Oe(d),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var f=Se(n);f&&(p.style.backgroundImage="url(".concat(f,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=at(o,v),p.style.display="flex",e.el().appendChild(p),Te(e),rt("watch-live-resume-btn",s,(function(){Ce(e,p),we(e,d)})),rt("watch-begining-btn",u,(function(){Ce(e,p),he(e,n)}))}(t,n),Ie({player:t,showWatchLive:!0,showStartOver:!0})):ke(t)})),t.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,l=e.seekable(),r=l.start(0),a=l.end(l.length-1)-r,s=JSON.parse(sessionStorage.getItem("epgConfig")),u=t,d=!0;if(s&&null!=s&&s.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==s?void 0:s.programId),u=null==s?void 0:s.programId}e.on("seeking",(function(){i=!0})),e.on("seeked",(function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;u="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}Pe(u,o),je(e,n),Ie({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");u="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(Pe(u,t),o=t,function(e,n){it(n).forEach((function(t){var o=t.id,i=t.title,l=t.time,r=document.getElementById(o);if(r){var a=Math.min(l/n*100,99.5);r.style.left="".concat(a,"%")}else{var s=e.controlBar.progressControl.seekBar.el(),u=tt(o,i,Math.min(l/n*100,99.5));s.appendChild(u)}}))}(e,a))}}))}(t,n)}))}else console.warn("Player instance is required to initialize start over.")}function rt(e,n,t){var o,i,l=document.getElementById(e);l&&(i=n,(o=l)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),l.addEventListener("click",t))}function at(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,l=t.startFromBegining,r=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(ye()," ").concat(r,"</button>"),s='<button id="watch-begining-btn">'.concat(ge()," ").concat((null==l?void 0:l.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(s,"</div>")}function st(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 ut(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?st(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):st(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var dt=function(i,l,r,a){var d,y,b,h,w,I,k,O,S,T,P,j,C,D,E,A,x,N,L,_,R,M,V,B,U,F,W,q,G,K,J,Y,X,Q,$,ee,ne,te,ie,le,re=l.res,ae=void 0===re?null:re,se=l.sres,ue=void 0===se?null:se,de=null!=r&&r.chromecastReceiverId?["chromecast","html5"]:["html5"],ce=(null===(d=ae)||void 0===d?void 0:d.contentType)||"video",ve=oe(null===(y=ae)||void 0===y||null===(b=y[ce])||void 0===b||null===(h=b.gist)||void 0===h?void 0:h.videoImageUrl)||oe(null===(w=ae)||void 0===w||null===(I=w[ce])||void 0===I||null===(k=I.gist)||void 0===k||null===(O=k.imageGist)||void 0===O?void 0:O.r16x9),pe=(null===(S=ae)||void 0===S||null===(T=S[ce])||void 0===T||null===(P=T.liveDetails)||void 0===P?void 0:P.isDvrEnabled)||!1,fe=(null===(j=ae)||void 0===j||null===(C=j[ce])||void 0===C||null===(D=C.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,me=(null===(E=ae)||void 0===E||null===(A=E.ads)||void 0===A||null===(x=A.preRoll)||void 0===x||null===(N=x.adTags)||void 0===N||null===(L=N.web)||void 0===L?void 0:L.active)&&(null===(_=ae)||void 0===_||null===(R=_.ads)||void 0===R||null===(M=R.preRoll)||void 0===M||null===(V=M.adTags)||void 0===V||null===(B=V.web)||void 0===B?void 0:B.url),ge=(null===(U=ae=ut(ut({},ae),{},{audioAssetSource:null==r?void 0:r.audioAssetSource}))||void 0===U||null===(F=U[ce])||void 0===F?void 0:F.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(W=window)||void 0===W||null===(q=W.app_data)||void 0===q||null===(G=q.appcmsMain)||void 0===G||null===(K=G.adsConfig)||void 0===K?void 0:K.vodAdSticherProvider)||!1,ye=(null==r?void 0:r.latency)||6,be=(null==r?void 0:r.skin_settings)||{};null==r||r.dvrConfig;var he=(ie={enableSmoothSeeking:!0,controls:0!=(null==r?void 0:r.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==r?void 0:r.muted)||!1,autoplay:(null==r?void 0:r.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==be?void 0:be.pictureInPictureToggle)||!1},playbackRates:null!=be&&be.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==r.skin,liveui:pe},e(ie,"autoplay",null==r?void 0:r.autoplay),e(ie,"normalizeAutoplay",(null==r?void 0:r.autoplay)&&!me),e(ie,"loop",(null==r?void 0:r.loop)||!1),e(ie,"audioPosterMode",null==r?void 0:r.audioPosterMode),e(ie,"html5",ut(ut({dash:ut(ut(ut({},!z.browser.IS_SAFARI&&{useTTML:!0}),(null==r?void 0:r.debugConfig)&&(null==r||null===(J=r.debugConfig)||void 0===J?void 0:J.enable)&&{debug:!0,logLevel:null!=r&&null!==(Y=r.debugConfig)&&void 0!==Y&&Y.logLevel?null==r||null===(X=r.debugConfig)||void 0===X?void 0:X.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ye},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:ut(ut({liveRangeSafeTimeDelta:ye,useDevicePixelRatio:!0,experimentalLLHLS:(null==r?void 0:r.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==r||null===(Q=r.customData)||void 0===Q?void 0:Q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===($=null==r?void 0:r.enableLowInitialPlaylist)||void 0===$||$}),debug:(null==r?void 0:r.debugConfig)&&(null==r||null===(ee=r.debugConfig)||void 0===ee?void 0:ee.enable)||!1,nativeTextTracks:"Safari"==o()},0==(null==r||null===(ne=r.customData)||void 0===ne?void 0:ne.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==r||null===(te=r.customData)||void 0===te?void 0:te.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(ie,"poster",ve),e(ie,"techOrder",de),e(ie,"chromecast",{requestCustomDataFn:function(e){var n,t,o=H(i),l=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,t){var o,i,l,r,a,s,u,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,y,b,h,w,I,k;f.isDrmEnabled=!0;var O=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,S=(null==O?void 0:O.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(b=y.options)||void 0===b?void 0:b.serverURL);f.licenseUrl=S;var T=(null==O?void 0:O.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(h=n.keySystemOptions)||void 0===h||null===(w=h[0])||void 0===w||null===(I=w.options)||void 0===I||null===(k=I.httpRequestHeaders)||void 0===k?void 0:k["X-AxDRM-Message"]);f.licenseToken=T}var P=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=P;var j=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;f.duration=j;var C=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=C;var D=null==e||null===(u=e[p])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=D,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(ae,e,l);return ut(ut({},a),{},{convivaMetaData:ut({customerKey:(null==r||null===(n=r.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==r||null===(t=r.convivaConfig)||void 0===t?void 0:t.debug)||!1},fn.getData())})},modifyLoadRequestFn:function(e){var n,t,o,l,r,a=H(i),s=(null==a?void 0:a.currentSource())||{};!(null===(n=ae)||void 0===n||null===(t=n[ce])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(l=o.videoAssets)||void 0===l?void 0:l.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(r=s.src)&&void 0!==r&&r.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),ie);if(!z.getPlayers()[i]){null!=r&&r.debugConfig&&null!=r&&null!==(le=r.debugConfig)&&void 0!==le&&le.enable&&z.log.level("debug");var we=z(i,he,function(){var e=n(t.mark((function e(){var n,o,l,d,y,b,h,w,I,k,O,S,T,P,j,C,D,E,A,x,N;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(we),console.log(z.VERSION),console.log(z.getPlugins()),e.next=5,Ke(r,ae);case 5:if(T=null===(n=ae)||void 0===n||null===(o=n[ce])||void 0===o||null===(l=o.liveDetails)||void 0===l?void 0:l.startOverTime,fe&&a.resolve(ut({status:!0,msg:"Player Initialised"},ue?{seriesResponse:ue,response:ae}:{response:ae})),pe&&null!=r&&null!==(d=r.dvrConfig)&&void 0!==d&&d.enable&&lt(i,ut(ut({},r),{},{isDvrEnabled:pe})),p(i,null==r?void 0:r.analyticsCb,null==r?void 0:r.customData),pn(i,r),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),pe&&_e(i,T),!me||null!=r&&null!==(y=r.customData)&&void 0!==y&&y.disableAds||f(i,me,ae),P=s(ae,i),console.log(P),null!=r&&r.nearestClusterUrl&&(P=m(P,r.nearestClusterUrl)),!ge){e.next=21;break}return e.next=20,g(i,ae);case 20:P=e.sent;case 21:P?u(i,P):(a.reject({status:!1,msg:"Incompatible / Missing Source",response:ae}),c(i,"Incompatible / Missing Source")),((null===(b=ae)||void 0===b||null===(h=b[ce])||void 0===h||null===(w=h.contentDetails)||void 0===w||null===(I=w.closedCaptions)||void 0===I?void 0:I.length)>0||(null===(k=ae)||void 0===k||null===(O=k[ce])||void 0===O||null===(S=O.closedCaptions)||void 0===S?void 0:S.length)>0)&&(N=(null===(C=ae)||void 0===C||null===(D=C[ce])||void 0===D||null===(E=D.contentDetails)||void 0===E?void 0:E.closedCaptions)||(null===(A=ae)||void 0===A||null===(x=A[ce])||void 0===x?void 0:x.closedCaptions),j=N.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),Z(i,j)),null!=r&&r.disableControls?v(i):mn(i,ut(ut(ut({},r),he),{},{liveVideo:fe,isDvrEnabled:pe,res:ae,sres:ue})),et(i,ut(ut(ut({},r),he),{},{liveVideo:fe}),a,{res:ae,sres:ue});case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}},ct={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function vt(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 pt(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):vt(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var ft,mt=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,l=gt(e);dt(i,{res:l},e,{resolve:t,reject:o})},gt=function(e){var n,t,o,i,l,r,a,s,u=null==e?void 0:e.streamingInfo,d=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,c=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,v=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.url)||null,p=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,f=(null==e||null===(r=e.streamingInfo)||void 0===r?void 0:r.subtitles)||[],m=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(s=a.videoAssets)||void 0===s?void 0:s.drmProvider)||null,g=null==e?void 0:e.token,b=y(g),h=null==b?void 0:b.site;return pt(pt({id:null==ct?void 0:ct[h]},!c&&{directPlaybackUrl:null==d?void 0:d.url}),{},{video:{drmEnabled:c,streamingInfo:{videoAssets:pt(pt({},m&&{drmProvider:m}),{},{widevine:null==d?void 0:d.widevine,fairPlay:null==d?void 0:d.fairPlay,playReady:null==d?void 0:d.playReady})},liveDetails:{isDvrEnabled:null==u?void 0:u.isDvrEnabled},gist:pt({},p&&{videoImageUrl:p}),contentDetails:pt({},(null==f?void 0:f.length)>0&&{closedCaptions:De(f)})},ads:{preRoll:{adTags:{web:pt(pt({},v&&{active:!0}),v&&{url:v})}}}})};function yt(e,n){return bt.apply(this,arguments)}function bt(){return(bt=n(t.mark((function e(n,o){var i,l,r,a,s,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.resolve,l=o.reject,r=null==n?void 0:n.videoId,a=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,I();case 6:u=e.sent,b(r,u).then((function(e){var t,o,d,c;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(d=o.gist)||void 0===d?void 0:d.contentType,se(null==e?void 0:e.data);var v,p=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(c=n.watchHistory)&&void 0!==c&&c.enable&&!s)if((null===(v=n.watchHistory)||void 0===v?void 0:v.saveOffline)||!1){var f,m,g,y=Tn((null===(f=n.watchHistory)||void 0===f?void 0:f.profileId)||"",r,null==n?void 0:n.siteOwner);if(y&&y.length)n.watchHistoryResumeTime=(null===(m=y[0])||void 0===m?void 0:m.watchedTime)||null,n.watchedPercentage=(null===(g=y[0])||void 0===g?void 0:g.watchedPercentage)||null;p.contentType="video",dt(a,{res:p},n,{resolve:i,reject:l})}else h(r,u).then((function(e){var t,o,i,l,r,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(l=i.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){dt(a,{res:p},n,{resolve:i,reject:l})}));else dt(a,{res:p},n,{resolve:i,reject:l})})).catch((function(e){w(e,a,l,r)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ht(e,n){return wt.apply(this,arguments)}function wt(){return(wt=n(t.mark((function e(n,o){var i,l,r,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.resolve,l=o.reject,e.next=3,I();case 3:r=e.sent,a=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,k(s,r).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,dt(a,{res:t},n,{resolve:i,reject:l})})).catch((function(e){w(e,a,l,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function It(e,n){return kt.apply(this,arguments)}function kt(){return(kt=n(t.mark((function e(n,o){var i,l,r,a,s,u,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=o.resolve,r=o.reject,e.next=3,I();case 3:a=e.sent,s=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,pe.set(parseInt(u)),d=null==n||null===(i=n.series)||void 0===i?void 0:i.id,O(d,a).then((function(e){var t,o,i,u=e.data,c=e.data.seasons;fe(c);var v=videoId||(null==c||null===(t=c[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.id);S(d,a),b(v,a).then((function(e){var t,o,i;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,se(e.data),dt(s,{res:null==e?void 0:e.data,sres:u},n,{resolve:l,reject:r})})).catch((function(e){w(e,s,r,videoId)}))})).catch((function(e){w(e,s,r)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ot(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 St(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ot(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function Tt(){return{loadVideoInstantly:T,onTimeUpdate:W,getVideoDuration:q,onVideoEnded:G,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=n(t.mark((function n(o,i){var l,r,a,s,u,d,c,v,p,f,m,g,y,h,I,k,O,S,T,P,j,C,D,A,x;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!E(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(y=(null==e?void 0:e.videoSourceUrl)||!1,h=null==e?void 0:e.asat,I=(null==e||null===(l=e.epg)||void 0===l?void 0:l.enable)||!1,k=null==e?void 0:e.videoId,O=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1,S=(null==e?void 0:e.streamingInfo)||!1,window.videoId=k,T=null==e?void 0:e.token,!V(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",T),B().set(null==e?void 0:e.refreshToken),T&&!U(T)){n.next=16;break}return i({status:!1,msg:"".concat(T?"Token is expired !":"Missing Authorization Token"),response:{token:T}}),n.abrupt("return");case 16:ft=JSON.parse(atob(T.split(".")[1]));case 17:return window.siteName=null===(a=ft)||void 0===a?void 0:a.site,window.siteId=null===(s=ft)||void 0===s?void 0:s.siteId,e.isAnonymousUser=!(null===(u=ft)||void 0===u||!u.anonymousId),e.siteOwner=(null===(d=ft)||void 0===d?void 0:d.site)||null,e.userId=(null===(c=ft)||void 0===c?void 0:c.userId)||null,window.sessionStorage.setItem("uid",null===(v=ft)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,P=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(p=e.series)&&void 0!==p&&p.enable?null:null==e?void 0:e.chromecastReceiverId,j=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,(C=null==e?void 0:e.errors)&&(window.customErrors=C),window.customData=null==e?void 0:e.customData,le(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),M.set(e.apiBaseUrl),null!=e&&e.skin&&!ie(e.skin)||(e.skin="VL_ONE"),n.next=35,ze(e);case 35:j&&Ee("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then((function(){return F(j)})).catch((function(e){})),(D=null===(g=document)||void 0===g?void 0:g.getElementById("".concat(P)))&&D.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y?(x={directPlaybackUrl:y,id:A="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},h?b(A,T).then((function(n){var t=(null==n?void 0:n.data)||{};dt(P,{res:St(St({},t),x)},e,{resolve:o,reject:i})})).catch((function(e){w(e,P,i,A)})):dt(P,{res:x},e,{resolve:o,reject:i})):S?mt(e,{resolve:o,reject:i}):O?It(e,{resolve:o,reject:i}):I?ht(e,{resolve:o,reject:i}):yt(e,{resolve:o,reject:i});case 39:case"end":return n.stop()}}),n)})));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:ne,skip:P,getPlayer:H,play:j,pause:C,detectBrowser:o,rewind:D,loadVideo:u,seekToTimeStamp:K,isPlayerInitialised:E,load:A,authenticateLC:x,dispose:N,enableCaptions:ee,disableCaptions:$,getCaptions:Q,playSelectedResolution:te,getSource:s,setVolume:xe,getVolume:Ne,disableControls:v,setPlaybackSpeed:J,getEntitlementData:L,adsQueuePointManager:_,getSsaiEvents:R,playerEvents:Y,onReplay:X}}export{Tt as V,nt as i,ot as r};
1
+ import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import"axios";import{d as o,g as i,a as l,b as r,s as a,c as s,l as u,e as d,h as c,f as v,i as p,j as f,k as m,m as g,n as y,o as b,p as h,q as w,r as I,t as k,u as O,v as S,w as T,x as j,y as P,z as C,A as D,B as E,C as A,D as x,E as N,F as L,G as _,H as R,I as M,J as V,K as B,L as U,M as F}from"./generic-e21fdb61.js";import{g as H}from"./player_instance-34118a5b.js";import z from"video.js";import{o as G,g as W,a as q,s as K,b as J,p as Y,c as X}from"./util-7d5b2427.js";import{g as Q,d as $,a as Z,e as ee}from"./captions-f507e8ee.js";import{g as ne,p as te}from"./resolution-1c59b0f3.js";import{i as oe,a as ie}from"./skin-d5091b86.js";import{s as le}from"./localisation-0bf399a1.js";import{g as re,a as ae,s as se,v as ue,b as de,c as ce,d as ve,e as pe,f as fe}from"./currentVideoInfo-a8a254c2.js";import me from"@babel/runtime/helpers/typeof";import{s as ge,w as ye}from"./icons-37daa6b3.js";import{c as be,p as he,a as we,h as Ie,r as ke,g as Oe,b as Se,d as Te,s as je,e as Pe,f as Ce}from"./helper-349e076f.js";import De from"@babel/runtime/helpers/toConsumableArray";var Ee=function(e){return new Promise((function(n,t){if(Ae(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)}}))},Ae=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},xe=function(e,n,t){var o=H(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},Ne=function(e){var n=H(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Le=function(){var e=n(t.mark((function e(n){var i,l,r,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=H(null==n?void 0:n.playerId),null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable||!(null!=n&&n.chromecastReceiverId||null!=n&&n.airplay)){e.next=10;break}return e.prev=2,e.next=5,Ee("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.log("Error",e.t0);case 10:if(null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=13,import("@silvermine/videojs-chromecast");case 13:e.sent.default(z),(s=z.getTech("chromecast"))&&!s.prototype.seeking&&(s.prototype.seeking=function(){}),null!==(a=window)&&void 0!==a&&a.cast?null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==o()?null==r||r.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(n){return e.apply(this,arguments)}}(),_e=function(e,n){var t=H(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,l,r,a=this.el(),s=z.dom.getPointerPosition(a,n).x;z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S;if(console.log(u),u&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};var Re=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Ee("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)}}(),Me=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.resolve().then((function(){return Kn}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ve=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){z.getPlugin("eme")||z.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Be=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(z),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-8e3eab6d.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)}}(),Fe=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-08c7635e.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)}}(),He=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){Ee("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(z)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(z)}))},loadAdsLibrary:Re,loadEMELibrary:Ve,loadMuxPlugin:Be,loadDvrSeekbar:Ue,loadContribDash:Fe,loadComscorePlugin:Me});function ze(e){return Ge.apply(this,arguments)}function Ge(){return(Ge=n(t.mark((function e(n){var i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(null==n?void 0:n.airplay)||!1,e.next=3,Re();case 3:i&&"Safari"==o()&&Promise.resolve().then((function(){return He})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function We(e){return qe.apply(this,arguments)}function qe(){return(qe=n(t.mark((function e(n){var o,i,l,r,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=H(n.playerId),e.next=3,Me();case 3:s.comscore({publisherId:null==n||null===(o=n.comscore)||void 0===o?void 0:o.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,implementationId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.implementationId,projectId:null==n||null===(r=n.comscore)||void 0===r?void 0:r.projectId,debug:(null==n||null===(a=n.comscore)||void 0===a?void 0:a.debug)||!1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ke(e,n){return Je.apply(this,arguments)}function Je(){return(Je=n(t.mark((function e(n,i){var l,r,a,s,u,d,c,v,p,f,m,g;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==i?void 0:i.contentType)||"video",p=null==i||null===(l=i[v])||void 0===l?void 0:l.drmEnabled,null==i||null===(r=i[v])||void 0===r||null===(a=r.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==i||null===(s=i[v])||void 0===s||null===(u=s.streamingInfo)||void 0===u||null===(d=u.videoAssets)||void 0===d?void 0:d.dash)||null,m=(null==n||null===(c=n.comscore)||void 0===c?void 0:c.enable)||!1,e.prev=6,We(n),e.next=10,Promise.allSettled([p?"Safari"==o()?Ve():"caliente"!=(null===(g=window)||void 0===g?void 0:g.siteName)?Fe():Ve():"Safari"!=o()&&f?Fe():null,m?Le(n):null,Le(n)]);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),console.log("Error",e.t0);case 15:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function Ye(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 Xe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ye(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ye(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Qe=new Set,$e=null,Ze=function(e,n,t){var o,l,r,a,s,u,d,c={},v=(null==e?void 0:e.contentType)||"video";c["c3.cm.id"]=(null===(o=e[v])||void 0===o?void 0:o.id)||"Null",c["c3.cm.contentType"]=an(e),c[null==t||null===(l=t.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==e||!e.linearchannel),c[null==t||null===(r=t.Constants)||void 0===r?void 0:r.STREAM_URL]=n.currentSrc(),c[null==t||null===(a=t.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===i()?"NULL":i(),c["c3.cm.categoryType"]=on(e),c["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"}}(),c.DRMEnabled=(null===(s=e[v])||void 0===s?void 0:s.drmEnabled)||"None",c.DAIStream=null!==(u=e[v])&&void 0!==u&&null!==(d=u.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",c[t.Constants.DEFAULT_RESOURCE]="AKAMAI",c["c3.cm.brand"]="NULL",c.CDVREnabled=ln(e),c["c3.cm.genreList"]=nn(e),c["c3.cm.genre"]=en(e),c["c3.cm.channel"]=tn(e);var p=dn(re(),e);return c=Xe(Xe({},c),p)},en=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},nn=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"},tn=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"},on=function(e){return(null==e?void 0:e.contentType)||"null"},ln=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},rn=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(t=e[l])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(r)},an=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var sn,un,dn=function(e,n){var t,o,i,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var d=r(),c=l();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(o=t.series)||void 0===o?void 0:o.title)||"Null",u["c3.cm.seasonNumber"]=(null==d?void 0:d.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(i=e[d-1])||void 0===i||null===(a=i.episodes)||void 0===a||null===(s=a[c-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",u},cn=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"}},vn=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},pn=function(){var e=n(t.mark((function e(n,o){var i,l,r,a,s,u,d,c,v,p;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},l=i.trackConvivaPlayerEvent,r=i.paymentHandler,a=i.tveProvider,s=i.enable,u=i.appName,d=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(c=H(n),"function"==typeof(v=l)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(p=e.sent){e.next=13;break}return e.abrupt("return");case 13:c.ready((function(){var e=c.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=cn(t.keySystem);v("contentInfo",{DRMEnabled:o})}else v("contentInfo",{DRMEnabled:"None"})})),n||v("contentInfo",{DRMEnabled:"None"})})),c.on("loadstart",(function(){var e,n;$e&&$e!==c.currentSrc()&&v("playbackEnded"),v("setPlayer",c),Qe.clear(),$e=c.currentSrc();var t=vn(c.currentType()),i=ae(),l=Ze(i,c,p);l[null==p||null===(e=p.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",l[null==p||null===(n=p.Constants)||void 0===n?void 0:n.ASSET_NAME]=rn(i,o),l.authToken=d||"NULL",l.streamType=t,l.D2CType=r||"NONE",l.subscriberType=a||(r?"D2C":"FREE"),l["c3.cm.affiliate"]=a||"NULL",fn.setData(l),v("contentInfo",l)})),c.on("loadedmetadata",(function(){var e,n=c.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})})),c.on("play",(function(){Qe.has(c.currentSrc())||(Qe.add(c.currentSrc()),v("playbackStarted",null))})),c.on("ended",(function(){Qe.has(c.currentSrc())&&Qe.delete(c.currentSrc()),v("playbackEnded")})),c.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:c,adsLoader:null==e?void 0:e.adsLoader})})),c.on("dispose",(function(){null==Qe||Qe.clear(),v("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),fn=(sn={},{setData:function(e){sn=Xe(Xe({},sn),e)},getData:function(){return sn}}),mn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-f4aa20b4.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-df073080.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-9c9a2ee9.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-88d3eb07.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-9f13e83e.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?import("./skin-5c7fa838.js").then((function(t){t.initialiseSkin(e,n)})):"news"==t&&import("./skin-c91fa37f.js").then((function(t){t.initialiseSkin(e,n)}))};function gn(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 yn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?gn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):gn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var bn=[],hn=0,wn=null;function In(){console.log("Cleaning up watch history data"),un=null,bn=[],hn=0,wn=null}function kn(e,n,t){var o,i,l,r,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var d=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(l=n.watchHistory)||void 0===l||l.xapiKey;var p=(null==n||null===(r=n.video)||void 0===r?void 0:r.originalObjectId)||null,f=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,m=Math.floor(e.currentTime()),g=u?100:Math.floor(c/v*100),y={};f?Sn(y={completed:u,watchedTime:m,watchedPercentage:g},d,n.siteOwner):(y=yn(yn({videoId:un,watchedTime:m,watchedPercentage:g,doneWatching:u,profileId:d},wn&&{seriesId:wn}),p&&{originalObjectId:p}),a(y).then((function(e){})).catch((function(e){}))),hn=c+t}function On(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Sn(n,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),l=On(i),r=(new Date).getTime(),a=ae(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return yn(yn({},n),{},e({},t,s[t]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===un}));d<0?l.push(yn(yn({content:u},n),{},{addedDate:r,updateDate:r})):l[d]=yn(yn(yn({},l[d]),n),{},{updateDate:r}),localStorage.setItem("".concat(i),JSON.stringify(l))}function Tn(e,n,t){var o=On(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var jn=!1,Pn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!jn){var l=Cn(e,"videoAssets","secondaryVideoAssets"),r=s(l,n);return r&&u(n,r),jn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Cn(e,n,t){if(Array.isArray(e))return e.map((function(e){return Cn(e,n,t)}));if(null!==e&&"object"===me(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=Cn(e[i],n,t)})),o}return e}function Dn(e){var n=e.publisherId,t=e.persistentLabels;if(!window.ns_||!window.ns_.analytics)throw new Error("Comscore library not loaded or analytics reference missing");var o=window.ns_.analytics;o.PlatformApi.setPlatformAPI(o.PlatformApi.PlatformApis.WebBrowser);var i=new o.configuration.PublisherConfiguration({publisherId:String(n),persistentLabels:{cs_ucfr:(null==t?void 0:t.userConsent)||"",cs_fpid:(null==t?void 0:t.userId)||""}});return o.configuration.addClient(i),o.configuration.enableFirstPartyCookie(),o.configuration.enableImplementationValidationMode(),o.start(),console.log("[Comscore] Library initialized for publisher:",n),window.analytics=o,o}var En=null,An=null,xn=null,Nn=[],Ln="content",_n=null;function Rn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(window.analytics){var n=window.analytics,t=new n.StreamingAnalytics;En=t,_n=e,e.implementationId&&t.setImplementationId(e.implementationId),e.projectId&&t.setProjectId(e.projectId),t.setMediaPlayerName(e.playerName||"Video.js"),t.setMediaPlayerVersion(e.playerVersion||"8.x"),t.createPlaybackSession(),e.isDvr&&t.setDVRWindowLength((null==e?void 0:e.dvrWindowLength)||0);var o=new n.StreamingAnalytics.ContentMetadata;return o.setMediaType(n.StreamingAnalytics.ContentMetadata.ContentType[e.contentType||"LONG_FORM_ON_DEMAND"]),o.setUniqueId(e.uniqueId),o.setLength((null==e?void 0:e.isLive)?0:e.duration||0),o.setStationTitle(e.stationTitle),o.setPublisherName(e.publisherName),o.setProgramTitle(e.programTitle),o.setDateOfDigitalAiring(e.digitalAirdate.year,e.digitalAirdate.month,e.digitalAirdate.day),o.setDateOfTvAiring(e.tvAiring.year,e.tvAiring.month,e.tvAiring.day),o.carryTvAdvertisementLoad(e.isDaiAds?"1":null),o.setEpisodeTitle(null==e?void 0:e.contentTitle),o.setEpisodeSeasonNumber(e.seasonNumber),o.setEpisodeNumber(e.episodeNumber),o.setProgramId(e.programId),o.setEpisodeId(e.episodeId),o.setGenreName(e.contentGenre),o.setDictionaryClassificationC3(e.brand||"null"),o.setDictionaryClassificationC4(e.platform||"null"),o.setDictionaryClassificationC6(e.genre||"null"),o.classifyAsCompleteEpisode(e.completeEpisode?"1":null),t.setMetadata(o),An=o,t.notifyPlay(),console.log("[Comscore] StreamingAnalytics initialized for:",e.programTitle),t}console.error("[Comscore] analytics SDK not found.")}var Mn=!1;function Vn(e){if(e)if(En){var n=En;xn=e;var t=function(){return"content"===Ln&&n.notifyPlay()},o=function(){return"content"===Ln&&n.notifyPause()},i=function(){return"content"===Ln&&n.notifyEnd()},l=function(){return n.notifySeekStart()},r=function(){n.notifyBufferStart(),function(e,n){Mn||(Mn=!0,e.any(["playing","timeupdate"],(function(){Mn=!1,n.notifyBufferStop(),n.notifyPlay()})))}(e,n)};e.on("play",t),e.on("pause",o),e.on("ended",i),e.on("seeking",l),e.on("waiting",r),e.on("timeupdate",(function(){if(null==_n?void 0:_n.isLive)return n.startFromPosition(0);n.startFromPosition&&"function"==typeof e.currentTime&&n.startFromPosition(1e3*e.currentTime())})),Nn.push((function(){e.off("play",t),e.off("pause",o),e.off("ended",i),e.off("seeking",l),e.off("waiting",r)})),console.log("[Comscore] Player events attached.")}else console.warn("[Comscore] Tag not initialized. Call initializeComscoreTag() first.");else console.warn("[Comscore] No player instance provided.")}function Bn(){return!!En||(console.warn("[Comscore] Tag not initialized."),!1)}function Un(e){var n=e.isLive,t=e.startTimeInSeconds;return n?analytics.StreamingAnalytics.AdvertisementMetadata.LIVE:0==t?analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_POST_ROLL:t===("function"==typeof(null==xn?void 0:xn.getDuration)&&(null==xn?void 0:xn.getDuration()))?ns_.analytics.StreamingAnalytics.AdvertisementMetadata.AdvertisementType.ON_DEMAND_POST_ROLL:analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_MID_ROLL}function Fn(){if(Nn.forEach((function(e){return e()})),Nn=[],En){try{En.notifyEnd()}catch(e){}En=null}xn=null,An=null,Ln="content",console.log("[Comscore] Streaming Tag destroyed.")}function Hn(e){var n,t,o,i,l,r,a,s,u={ContentType:(null==e?void 0:e.contentType)||"LONG_FORM_ON_DEMAND",uniqueId:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.id,duration:(null==e?void 0:e.runtime)||0,stationTitle:null==e?void 0:e.siteName,publisherName:null==e?void 0:e.network,programTitle:(null==e?void 0:e.programTitle)||zn(e),programId:(null==e?void 0:e.programId)||Gn(e),episodeId:(null==e?void 0:e.episodeId)||(null===(t=null==e?void 0:e.gist)||void 0===t?void 0:t.id),contentTitle:null===(o=null==e?void 0:e.gist)||void 0===o?void 0:o.title,isLive:null===(i=null==e?void 0:e.streamingInfo)||void 0===i?void 0:i.isLiveStream,brand:null==e?void 0:e.network,seasonNumber:(null==e?void 0:e.seasonNumber)||qn(null==e?void 0:e.episodeDisplayAttribute).season,episodeNumber:(null==e?void 0:e.episodeNumber)||qn(null==e?void 0:e.episodeDisplayAttribute).episode,platform:(null==e?void 0:e.platform)||"browser",genre:(null==e?void 0:e.genre)||"null",completeEpisode:(null==e?void 0:e.isCompleteEpisode)||!0,digitalAirdate:Wn(null==e?void 0:e.publishDate),tvAiring:Wn(null==e?void 0:e.publishDate),contentGenre:null==e?void 0:e.genre,isDaiAds:!!(null==e?void 0:e.isDaiAds),isDvr:(null===(l=null==e?void 0:e.streamInfo)||void 0===l?void 0:l.isDvr)||!1,dvrWindowLength:(null===(r=null==e?void 0:e.streamInfo)||void 0===r?void 0:r.isDvr)&&(null===(a=null==e?void 0:e.streamInfo)||void 0===a?void 0:a.dvrWindowLength)||0,implementationId:null===(s=null==e?void 0:e.comscoreConfig)||void 0===s?void 0:s.implementationId};return"LINEARCHANNEL"===(null==e?void 0:e.contentType)&&(u.ContentType="LIVE"),u}function zn(e){var n,t;return(null==e?void 0:e.series)?null===(t=null==e?void 0:e.series)||void 0===t?void 0:t.title:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.title}function Gn(e){var n,t;return(null==e?void 0:e.series)?null===(t=null==e?void 0:e.series)||void 0===t?void 0:t.id:null===(n=null==e?void 0:e.gist)||void 0===n?void 0:n.id}function Wn(e){var n=new Date(1e3*Number(e));return{year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate()}}function qn(e){if(!e)return{season:null,episode:null};var n=e.match(/S(\d+)\s*E(\d+)/i);return n?{season:Number(n[1]),episode:Number(n[2])}:{season:null,episode:null}}!function(e){e.registerPlugin("comscore",(function(e){console.log(this),console.log("hello form comscore plugin",e);var n=e||{};!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;new Promise((function(t,o){var i=document.createElement("script");i.src=n||"https://appcms.staging.asset.viewlift.com/comscore.js",i.async=!0,document.head.appendChild(i),i.onload=function(){Dn({publisherId:e||"40813950"})},i.onerror=function(e){o("Error while loading script ".concat(src," : ").concat(e))}}))}(n.publisherId,n.endpoint)}))}(z);var Kn=Object.freeze({__proto__:null,createComscoreStreamingTag:Rn,destroyComscoreTag:Fn,endComscoreAdTracking:function(){if(En){var e=En;e.notifyPause(),e.notifyEnd(),Ln="content",An&&(e.setMetadata(An),e.notifyPlay()),console.log("[Comscore] Ad ended. Resumed content playback.")}},finishComscoreAdTracking:function(){En&&(En.notifyPause(),console.log("[Comscore] Ad Finished. Resumed content playback."))},formulateComscoreAdPayload:function(e){return{id:null==e?void 0:e.adId,adTitle:null==e?void 0:e.adTitle,adDuration:(null==e?void 0:e.durationInSeconds)||0,startTimeInSeconds:(null==e?void 0:e.startTimeInSeconds)||0,campaignId:null==e?void 0:e.campaignId,placementId:null==e?void 0:e.placementId,trackingUrl:null==e?void 0:e.trackingUrl}},formulateComscorePayload:Hn,getComscoreTagInstance:function(){return En},setComscorePlayerInstance:Vn,startComscoreAdTracking:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!En&&!window.analytics)return console.log("is StreamingAnalytics started Initialised?",Bn()),void console.warn("[Comscore] Tag not initialized or analytics missing.");var n=window.analytics,t=En;Ln="ad",t.notifyPause();var o=new n.StreamingAnalytics.AdvertisementMetadata;o.setMediaType(Un({isLive:null==_n?void 0:_n.isLive,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds})),o.setUniqueId(e.id||"ad-001"),o.setLength(e.durationMs||0),o.setTitle(e.title||"Advertisement"),o.setServerCampaignId(e.campaignId),o.setRelatedContentMetadata(An),o.setDeliveryType(n.StreamingAnalytics.AdvertisementMetadata.AdvertisementDeliveryType.NATIONAL),o.setPlacementId(e.placementId);var i={cs_ad_tu:null==e?void 0:e.trackingUrl,ns_st_ami:null==e?void 0:e.creativeId};o.addCustomLabels(i),t.setMetadata(o),t.notifyPlay(),console.log("[Comscore] Ad started:",e)}});function Jn(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 Yn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Jn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Jn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function Xn(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 Qn(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)?Qn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){a=!0,l=e},f:function(){try{r||null==t.return||t.return()}finally{if(a)throw l}}}}function Qn(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 $n(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Zn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?$n(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):$n(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var et=function(e,n,t,i){var l,r,a,s,u,v=i.res,p=i.sres,f=H(e),m=(null==v?void 0:v.contentType)||"video",g=(null==v||null===(l=v[m])||void 0===l?void 0:l.drmEnabled)||!1,y=(null==v||null===(r=v[m])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,b=(null==v||null===(s=v[m])||void 0===s||null===(u=s.liveDetails)||void 0===u?void 0:u.isDvrEnabled)||!1;se(v),ue.set(v),f&&(f.on("loadstart",(function(){y?t.resolve({status:!0,msg:"Video Loaded",response:v}):t.resolve(Zn({status:!0,msg:"Player Initialised"},p?{seriesResponse:p,response:v}:{response:v}))})),f.on("loadeddata",(function(){var t,i,l,r=Q(e);if(null==r||r.map((function(n){return $(e,n.id)})),b&&"Safari"===o())try{var a;null==f||null===(a=f.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==f||!f.muted())&&xe(e,sessionStorage.getItem("volume")||"100");var s=ae();if(function(e,n){var t,o,i,l,r,a,s,u,d,c,v,p=null==e?void 0:e.playerId,f=H(p),m=null==n?void 0:n.siteName;if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var g=ae(),y=(null==g||null===(o=g.video)||void 0===o?void 0:o.metadata)||[],b=(null==y?void 0:y.length)&&y.filter((function(e){return"advertisingGenre"===e.name}));if(null!==(i=b)&&void 0!==i&&i.length){var h=b.map((function(e){return e.value}));b=null==h?void 0:h.join(",")}Fn();var w=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,I=Array.isArray(null==w?void 0:w.category)?null==w||null===(r=w.category)||void 0===r?void 0:r.join(","):(null==w?void 0:w.category)||null,k=Hn(Yn(Yn({},null==g?void 0:g.video),{},{siteName:m,programId:(null==w?void 0:w.videotmsid)||null,programTitle:(null==w?void 0:w.lcProgrammeName)||null,episodeId:(null==w?void 0:w.videotmsid)||null,seasonNumber:(null==w||null===(a=w.seriesDetails)||void 0===a?void 0:a.season)||null,episodeNumber:(null==w||null===(s=w.seriesDetails)||void 0===s?void 0:s.episode)||null,isCompleteEpisode:!!(null!=g&&null!==(u=g.video)&&void 0!==u&&u.series||null!=w&&null!==(d=w.seriesDetails)&&void 0!==d&&d.episode),genre:b||I,comscoreConfig:{implementationId:(null==e||null===(c=e.comscore)||void 0===c?void 0:c.implementationId)||null,projectId:(null==e||null===(v=e.comscore)||void 0===v?void 0:v.projectId)||null}}));console.log("comscoreOptions player data",k),Rn(Yn({playerName:"Video.js"},k)),Vn(f)}}(n,v),d(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.saveOffline)){var u,c,p=Zn(Zn({},n),v);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(wn=null==n||null===(i=n.series)||void 0===i?void 0:i.id),bn=[],hn=0,un=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=H(e);a&&(a.on("dispose",In),a.on("timeupdate",(function(){if(!a.seeking()){var e=Math.floor(a.currentTime());bn.includes(hn)||(e!=hn||e<r?e>hn&&(hn=e+r):(bn.push(e),kn(a,n,r)))}})),a.one("ended",(function(){kn(a,n,r,!0)})))}(e,p,null==s||null===(u=s.video)||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.id)}if(null!=n&&null!==(l=n.analytics)&&void 0!==l&&l.muxKey&&null!=f&&f.mux){var m,g,y,h,w,I,k=(null===(m=ae())||void 0===m?void 0:m.video)||(null==v?void 0:v.video),O=null==k?void 0:k.gist,S={env_key:null==n||null===(g=n.analytics)||void 0===g?void 0:g.muxKey,player_name:"vl-web-player",player_version:null===(y=window)||void 0===y?void 0:y.vl_player_version,video_id:null==O?void 0:O.id,video_title:null==O?void 0:O.title,video_series:null==k||null===(h=k.series)||void 0===h?void 0:h.title,video_stream_type:null!=k&&null!==(w=k.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==n||null===(I=n.analytics)||void 0===I?void 0:I.userId};f.mux({debug:!1,data:S})}})),f.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];f.trigger("subtitlechanged",n)})),f.on("subtitlechanged",(function(e,n){var t,o,i,l,r,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}})),f.tech_.on("retryplaylist",(function(){y&&Pn(v,e)})),f.on("error",(function(){var n,o;(console.log("ERROR",f.error(),f.error().code),4===f.error().code&&y)?Pn(v,e):(c(e,(null==f||null===(n=f.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==f||null===(o=f.error())||void 0===o?void 0:o.message)||"Some error occured",response:v}))})),f.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 r,a,s,u=null===(r=ae())||void 0===r||null===(a=r.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.id,d=de(),c=(null==d?void 0:d.get(u))||{t:0,p:0},v=c.t,p=c.p;v&&p<95&&setTimeout((function(){f.currentTime(v)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){f.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=f&&f.dvrSeekbar)try{f.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),f.on("volumechange",(function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),f.on("chromecastDisconnected",(function(){if(y){f.currentSource();for(var e=f.textTracks(),n=e.length-1;n>=0;n--)f.removeRemoteTextTrack(e[n])}})),f.one("loadeddata",(function(){var e,n=(null==f||null===(e=f.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0})),"object"==me(f.dash)){var t,i,l,r=null==f||null===(t=f.dash)||void 0===t||null===(i=t.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==r?void 0:r.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),s=Xn(n);try{for(s.s();!(l=s.n()).done;){var u=l.value;if(a&&(null==u?void 0:u.id)=="dash-audio-".concat(a.index)){u.enabled=!0;break}}}catch(e){s.e(e)}finally{s.f()}}else{var d,c=Xn(n);try{for(c.s();!(d=c.n()).done;){var v,p,m,y=d.value;if(("Chrome"==o()||"Edge"==o()&&(null!==(v=navigator)&&void 0!==v&&null!==(p=v.userAgent)&&void 0!==p&&p.includes("Macintosh")||!g))&&null!=y&&null!==(m=y.label)&&void 0!==m&&m.includes("5.1"))f.audioTracks().removeTrack(y);else{if("main"==y.kind){y.enabled=!0;break}y.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}})))};function nt(e){var n=H(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),l=t.end(t.length-1)-i;ot(),it(l).forEach((function(e){var n=e.id,t=e.title,i=e.time,r=tt(n,t,Math.min(i/l*100,99.5));o.appendChild(r)}))}}function tt(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function ot(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function it(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(ce()||[]).filter((function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function lt(e,n){var t=H(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,l=n.videoId;n.epg;var r=i.playLive,a=i.playFromBegining,s=i.programs;ve(s),t.on("loadeddata",(function(){be(n)?a?he(t,n):r?we(t,l):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,l=n.epg,r=o.buttonConfig,a=void 0===r?{}:r,s=a.watchLive;a.resume;var u=a.startFromBegining,d=i;if(l&&null!=l&&l.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!Oe(d),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var f=Se(n);f&&(p.style.backgroundImage="url(".concat(f,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=at(o,v),p.style.display="flex",e.el().appendChild(p),Te(e),rt("watch-live-resume-btn",s,(function(){Ce(e,p),we(e,d)})),rt("watch-begining-btn",u,(function(){Ce(e,p),he(e,n)}))}(t,n),Ie({player:t,showWatchLive:!0,showStartOver:!0})):ke(t)})),t.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,l=e.seekable(),r=l.start(0),a=l.end(l.length-1)-r,s=JSON.parse(sessionStorage.getItem("epgConfig")),u=t,d=!0;if(s&&null!=s&&s.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==s?void 0:s.programId),u=null==s?void 0:s.programId}e.on("seeking",(function(){i=!0})),e.on("seeked",(function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;u="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}je(u,o),Pe(e,n),Ie({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");u="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(je(u,t),o=t,function(e,n){it(n).forEach((function(t){var o=t.id,i=t.title,l=t.time,r=document.getElementById(o);if(r){var a=Math.min(l/n*100,99.5);r.style.left="".concat(a,"%")}else{var s=e.controlBar.progressControl.seekBar.el(),u=tt(o,i,Math.min(l/n*100,99.5));s.appendChild(u)}}))}(e,a))}}))}(t,n)}))}else console.warn("Player instance is required to initialize start over.")}function rt(e,n,t){var o,i,l=document.getElementById(e);l&&(i=n,(o=l)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),l.addEventListener("click",t))}function at(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,l=t.startFromBegining,r=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(ye()," ").concat(r,"</button>"),s='<button id="watch-begining-btn">'.concat(ge()," ").concat((null==l?void 0:l.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(s,"</div>")}function st(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 ut(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?st(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):st(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var dt=function(i,l,r,a){var d,y,b,h,w,I,k,O,S,T,j,P,C,D,E,A,x,N,L,_,R,M,V,B,U,F,G,W,q,K,J,Y,X,Q,$,ee,ne,te,ie,le,re=l.res,ae=void 0===re?null:re,se=l.sres,ue=void 0===se?null:se,de=null!=r&&r.chromecastReceiverId?["chromecast","html5"]:["html5"],ce=(null===(d=ae)||void 0===d?void 0:d.contentType)||"video",ve=oe(null===(y=ae)||void 0===y||null===(b=y[ce])||void 0===b||null===(h=b.gist)||void 0===h?void 0:h.videoImageUrl)||oe(null===(w=ae)||void 0===w||null===(I=w[ce])||void 0===I||null===(k=I.gist)||void 0===k||null===(O=k.imageGist)||void 0===O?void 0:O.r16x9),pe=(null===(S=ae)||void 0===S||null===(T=S[ce])||void 0===T||null===(j=T.liveDetails)||void 0===j?void 0:j.isDvrEnabled)||!1,fe=(null===(P=ae)||void 0===P||null===(C=P[ce])||void 0===C||null===(D=C.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,me=(null===(E=ae)||void 0===E||null===(A=E.ads)||void 0===A||null===(x=A.preRoll)||void 0===x||null===(N=x.adTags)||void 0===N||null===(L=N.web)||void 0===L?void 0:L.active)&&(null===(_=ae)||void 0===_||null===(R=_.ads)||void 0===R||null===(M=R.preRoll)||void 0===M||null===(V=M.adTags)||void 0===V||null===(B=V.web)||void 0===B?void 0:B.url),ge=(null===(U=ae=ut(ut({},ae),{},{audioAssetSource:null==r?void 0:r.audioAssetSource}))||void 0===U||null===(F=U[ce])||void 0===F?void 0:F.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(G=window)||void 0===G||null===(W=G.app_data)||void 0===W||null===(q=W.appcmsMain)||void 0===q||null===(K=q.adsConfig)||void 0===K?void 0:K.vodAdSticherProvider)||!1,ye=(null==r?void 0:r.latency)||6,be=(null==r?void 0:r.skin_settings)||{};null==r||r.dvrConfig;var he=(ie={enableSmoothSeeking:!0,controls:0!=(null==r?void 0:r.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==r?void 0:r.muted)||!1,autoplay:(null==r?void 0:r.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==be?void 0:be.pictureInPictureToggle)||!1},playbackRates:null!=be&&be.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==r.skin,liveui:pe},e(ie,"autoplay",null==r?void 0:r.autoplay),e(ie,"normalizeAutoplay",(null==r?void 0:r.autoplay)&&!me),e(ie,"loop",(null==r?void 0:r.loop)||!1),e(ie,"audioPosterMode",null==r?void 0:r.audioPosterMode),e(ie,"html5",ut(ut({dash:ut(ut(ut({},!z.browser.IS_SAFARI&&{useTTML:!0}),(null==r?void 0:r.debugConfig)&&(null==r||null===(J=r.debugConfig)||void 0===J?void 0:J.enable)&&{debug:!0,logLevel:null!=r&&null!==(Y=r.debugConfig)&&void 0!==Y&&Y.logLevel?null==r||null===(X=r.debugConfig)||void 0===X?void 0:X.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ye},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:ut(ut({liveRangeSafeTimeDelta:ye,useDevicePixelRatio:!0,experimentalLLHLS:(null==r?void 0:r.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==r||null===(Q=r.customData)||void 0===Q?void 0:Q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===($=null==r?void 0:r.enableLowInitialPlaylist)||void 0===$||$}),debug:(null==r?void 0:r.debugConfig)&&(null==r||null===(ee=r.debugConfig)||void 0===ee?void 0:ee.enable)||!1,nativeTextTracks:"Safari"==o()},0==(null==r||null===(ne=r.customData)||void 0===ne?void 0:ne.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==r||null===(te=r.customData)||void 0===te?void 0:te.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(ie,"poster",ve),e(ie,"techOrder",de),e(ie,"chromecast",{requestCustomDataFn:function(e){var n,t,o=H(i),l=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,t){var o,i,l,r,a,s,u,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,y,b,h,w,I,k;f.isDrmEnabled=!0;var O=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,S=(null==O?void 0:O.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(b=y.options)||void 0===b?void 0:b.serverURL);f.licenseUrl=S;var T=(null==O?void 0:O.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(h=n.keySystemOptions)||void 0===h||null===(w=h[0])||void 0===w||null===(I=w.options)||void 0===I||null===(k=I.httpRequestHeaders)||void 0===k?void 0:k["X-AxDRM-Message"]);f.licenseToken=T}var j=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=j;var P=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;f.duration=P;var C=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=C;var D=null==e||null===(u=e[p])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=D,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(ae,e,l);return ut(ut({},a),{},{convivaMetaData:ut({customerKey:(null==r||null===(n=r.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==r||null===(t=r.convivaConfig)||void 0===t?void 0:t.debug)||!1},fn.getData())})},modifyLoadRequestFn:function(e){var n,t,o,l,r,a=H(i),s=(null==a?void 0:a.currentSource())||{};!(null===(n=ae)||void 0===n||null===(t=n[ce])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(l=o.videoAssets)||void 0===l?void 0:l.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(r=s.src)&&void 0!==r&&r.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),ie);if(!z.getPlayers()[i]){null!=r&&r.debugConfig&&null!=r&&null!==(le=r.debugConfig)&&void 0!==le&&le.enable&&z.log.level("debug");var we=z(i,he,function(){var e=n(t.mark((function e(){var n,o,l,d,y,b,h,w,I,k,O,S,T,j,P,C,D,E,A,x,N;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(we),console.log(z.VERSION),console.log(z.getPlugins()),e.next=5,Ke(r,ae);case 5:if(T=null===(n=ae)||void 0===n||null===(o=n[ce])||void 0===o||null===(l=o.liveDetails)||void 0===l?void 0:l.startOverTime,fe&&a.resolve(ut({status:!0,msg:"Player Initialised"},ue?{seriesResponse:ue,response:ae}:{response:ae})),pe&&null!=r&&null!==(d=r.dvrConfig)&&void 0!==d&&d.enable&&lt(i,ut(ut({},r),{},{isDvrEnabled:pe})),p(i,null==r?void 0:r.analyticsCb,null==r?void 0:r.customData),pn(i,r),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),pe&&_e(i,T),!me||null!=r&&null!==(y=r.customData)&&void 0!==y&&y.disableAds||f(i,me,ae),j=s(ae,i),console.log(j),null!=r&&r.nearestClusterUrl&&(j=m(j,r.nearestClusterUrl)),!ge){e.next=21;break}return e.next=20,g(i,ae);case 20:j=e.sent;case 21:j?u(i,j):(a.reject({status:!1,msg:"Incompatible / Missing Source",response:ae}),c(i,"Incompatible / Missing Source")),((null===(b=ae)||void 0===b||null===(h=b[ce])||void 0===h||null===(w=h.contentDetails)||void 0===w||null===(I=w.closedCaptions)||void 0===I?void 0:I.length)>0||(null===(k=ae)||void 0===k||null===(O=k[ce])||void 0===O||null===(S=O.closedCaptions)||void 0===S?void 0:S.length)>0)&&(N=(null===(C=ae)||void 0===C||null===(D=C[ce])||void 0===D||null===(E=D.contentDetails)||void 0===E?void 0:E.closedCaptions)||(null===(A=ae)||void 0===A||null===(x=A[ce])||void 0===x?void 0:x.closedCaptions),P=N.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),Z(i,P)),null!=r&&r.disableControls?v(i):mn(i,ut(ut(ut({},r),he),{},{liveVideo:fe,isDvrEnabled:pe,res:ae,sres:ue})),et(i,ut(ut(ut({},r),he),{},{liveVideo:fe}),a,{res:ae,sres:ue});case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}},ct={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function vt(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 pt(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):vt(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var ft,mt=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,l=gt(e);dt(i,{res:l},e,{resolve:t,reject:o})},gt=function(e){var n,t,o,i,l,r,a,s,u=null==e?void 0:e.streamingInfo,d=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,c=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,v=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.url)||null,p=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,f=(null==e||null===(r=e.streamingInfo)||void 0===r?void 0:r.subtitles)||[],m=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(s=a.videoAssets)||void 0===s?void 0:s.drmProvider)||null,g=null==e?void 0:e.token,b=y(g),h=null==b?void 0:b.site;return pt(pt({id:null==ct?void 0:ct[h]},!c&&{directPlaybackUrl:null==d?void 0:d.url}),{},{video:{drmEnabled:c,streamingInfo:{videoAssets:pt(pt({},m&&{drmProvider:m}),{},{widevine:null==d?void 0:d.widevine,fairPlay:null==d?void 0:d.fairPlay,playReady:null==d?void 0:d.playReady})},liveDetails:{isDvrEnabled:null==u?void 0:u.isDvrEnabled},gist:pt({},p&&{videoImageUrl:p}),contentDetails:pt({},(null==f?void 0:f.length)>0&&{closedCaptions:De(f)})},ads:{preRoll:{adTags:{web:pt(pt({},v&&{active:!0}),v&&{url:v})}}}})};function yt(e,n){return bt.apply(this,arguments)}function bt(){return(bt=n(t.mark((function e(n,o){var i,l,r,a,s,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.resolve,l=o.reject,r=null==n?void 0:n.videoId,a=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,I();case 6:u=e.sent,b(r,u).then((function(e){var t,o,d,c;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(d=o.gist)||void 0===d?void 0:d.contentType,se(null==e?void 0:e.data);var v,p=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(c=n.watchHistory)&&void 0!==c&&c.enable&&!s)if((null===(v=n.watchHistory)||void 0===v?void 0:v.saveOffline)||!1){var f,m,g,y=Tn((null===(f=n.watchHistory)||void 0===f?void 0:f.profileId)||"",r,null==n?void 0:n.siteOwner);if(y&&y.length)n.watchHistoryResumeTime=(null===(m=y[0])||void 0===m?void 0:m.watchedTime)||null,n.watchedPercentage=(null===(g=y[0])||void 0===g?void 0:g.watchedPercentage)||null;p.contentType="video",dt(a,{res:p},n,{resolve:i,reject:l})}else h(r,u).then((function(e){var t,o,i,l,r,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(l=i.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){dt(a,{res:p},n,{resolve:i,reject:l})}));else dt(a,{res:p},n,{resolve:i,reject:l})})).catch((function(e){w(e,a,l,r)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ht(e,n){return wt.apply(this,arguments)}function wt(){return(wt=n(t.mark((function e(n,o){var i,l,r,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.resolve,l=o.reject,e.next=3,I();case 3:r=e.sent,a=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,k(s,r).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,dt(a,{res:t},n,{resolve:i,reject:l})})).catch((function(e){w(e,a,l,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function It(e,n){return kt.apply(this,arguments)}function kt(){return(kt=n(t.mark((function e(n,o){var i,l,r,a,s,u,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=o.resolve,r=o.reject,e.next=3,I();case 3:a=e.sent,s=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,pe.set(parseInt(u)),d=null==n||null===(i=n.series)||void 0===i?void 0:i.id,O(d,a).then((function(e){var t,o,i,u=e.data,c=e.data.seasons;fe(c);var v=videoId||(null==c||null===(t=c[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.id);S(d,a),b(v,a).then((function(e){var t,o,i;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,se(e.data),dt(s,{res:null==e?void 0:e.data,sres:u},n,{resolve:l,reject:r})})).catch((function(e){w(e,s,r,videoId)}))})).catch((function(e){w(e,s,r)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ot(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 St(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ot(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function Tt(){return{loadVideoInstantly:T,onTimeUpdate:G,getVideoDuration:W,onVideoEnded:q,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=n(t.mark((function n(o,i){var l,r,a,s,u,d,c,v,p,f,m,g,y,h,I,k,O,S,T,j,P,C,D,A,x;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!E(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(y=(null==e?void 0:e.videoSourceUrl)||!1,h=null==e?void 0:e.asat,I=(null==e||null===(l=e.epg)||void 0===l?void 0:l.enable)||!1,k=null==e?void 0:e.videoId,O=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1,S=(null==e?void 0:e.streamingInfo)||!1,window.videoId=k,T=null==e?void 0:e.token,!V(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",T),B().set(null==e?void 0:e.refreshToken),T&&!U(T)){n.next=16;break}return i({status:!1,msg:"".concat(T?"Token is expired !":"Missing Authorization Token"),response:{token:T}}),n.abrupt("return");case 16:ft=JSON.parse(atob(T.split(".")[1]));case 17:return window.siteName=null===(a=ft)||void 0===a?void 0:a.site,window.siteId=null===(s=ft)||void 0===s?void 0:s.siteId,e.isAnonymousUser=!(null===(u=ft)||void 0===u||!u.anonymousId),e.siteOwner=(null===(d=ft)||void 0===d?void 0:d.site)||null,e.userId=(null===(c=ft)||void 0===c?void 0:c.userId)||null,window.sessionStorage.setItem("uid",null===(v=ft)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,j=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(p=e.series)&&void 0!==p&&p.enable?null:null==e?void 0:e.chromecastReceiverId,P=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,(C=null==e?void 0:e.errors)&&(window.customErrors=C),window.customData=null==e?void 0:e.customData,le(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),M.set(e.apiBaseUrl),null!=e&&e.skin&&!ie(e.skin)||(e.skin="VL_ONE"),n.next=35,ze(e);case 35:P&&Ee("https://www.googletagmanager.com/gtag/js?id=".concat(P)).then((function(){return F(P)})).catch((function(e){})),(D=null===(g=document)||void 0===g?void 0:g.getElementById("".concat(j)))&&D.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y?(x={directPlaybackUrl:y,id:A="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},h?b(A,T).then((function(n){var t=(null==n?void 0:n.data)||{};dt(j,{res:St(St({},t),x)},e,{resolve:o,reject:i})})).catch((function(e){w(e,j,i,A)})):dt(j,{res:x},e,{resolve:o,reject:i})):S?mt(e,{resolve:o,reject:i}):O?It(e,{resolve:o,reject:i}):I?ht(e,{resolve:o,reject:i}):yt(e,{resolve:o,reject:i});case 39:case"end":return n.stop()}}),n)})));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:ne,skip:j,getPlayer:H,play:P,pause:C,detectBrowser:o,rewind:D,loadVideo:u,seekToTimeStamp:K,isPlayerInitialised:E,load:A,authenticateLC:x,dispose:N,enableCaptions:ee,disableCaptions:$,getCaptions:Q,playSelectedResolution:te,getSource:s,setVolume:xe,getVolume:Ne,disableControls:v,setPlaybackSpeed:J,getEntitlementData:L,adsQueuePointManager:_,getSsaiEvents:R,playerEvents:Y,onReplay:X}}export{Tt as V,nt as i,ot as r};
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./generic-e21fdb61.js";import"./player_instance-34118a5b.js";import"video.js";export{V as default}from"./index-6fd2c528.js";import"./util-7d5b2427.js";import"./captions-f507e8ee.js";import"./resolution-1c59b0f3.js";import"./skin-d5091b86.js";import"./localisation-0bf399a1.js";import"js-cookie";import"./currentVideoInfo-a8a254c2.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/helpers/typeof";import"./icons-37daa6b3.js";import"./helper-349e076f.js";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"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./generic-e21fdb61.js";import"./player_instance-34118a5b.js";import"video.js";export{V as default}from"./index-b5c2b4c0.js";import"./util-7d5b2427.js";import"./captions-f507e8ee.js";import"./resolution-1c59b0f3.js";import"./skin-d5091b86.js";import"./localisation-0bf399a1.js";import"js-cookie";import"./currentVideoInfo-a8a254c2.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/helpers/typeof";import"./icons-37daa6b3.js";import"./helper-349e076f.js";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 +1 @@
1
- import{h as l,d as e,e as o,o as i,p as n,q as t,r as a,s as r}from"./features-afa6b543.js";import{g as u}from"./player_instance-34118a5b.js";import{a as s,i as d,b as v}from"./index-abc06824.js";import{P as p,c,O as m,R as b,S as h}from"./generic-e21fdb61.js";import"videojs-contrib-quality-menu";import{i as f,r as y}from"./index-6fd2c528.js";import{c as g}from"./helper-349e076f.js";import{c as j,a as w,b as C}from"./currentVideoInfo-a8a254c2.js";import B from"video.js";import{c as T,d as k}from"./icons-37daa6b3.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"./resolution-1c59b0f3.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/assertThisInitialized";import"./skin-d5091b86.js";import"./localisation-0bf399a1.js";import"./autoNextVideo-b2b1dcef.js";import"./util-7d5b2427.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/slicedToArray";import"axios";import"js-cookie";import"./captions-f507e8ee.js";import"video.js/dist/video-js.min.css";function L(e,o){var i=u(e);i&&(i.on("loadeddata",(function(){var l,n,t,a,r,v=g(o),c=j();i.qualityLevels()&&i.qualityLevels().length&&function(l){var e=u(l);e&&(null==e||e.qualityMenu,e.qualityMenu({useResolutionLabels:!0}))}(e),!(null!=o&&null!==(l=o.series)&&void 0!==l&&l.enable||null!==(n=window)&&void 0!==n&&null!==(t=n.app_data)&&void 0!==t&&null!==(a=t.appcmsMain)&&void 0!==a&&null!==(r=a.features)&&void 0!==r&&r.auto_play)||null!=o&&o.liveVideo||s(e,o),null!=o&&o.liveVideo||p()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||d(e),v&&c&&c.length?f(e):y()})),i.one("play",(function(){var o,i,n,t;null!==(o=window)&&void 0!==o&&null!==(i=o.customData)&&void 0!==i&&i.iframeOverlayUrl&&l(e,null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t?void 0:t.iframeOverlayUrl)})))}function M(l,s){u(l).addClass("skin_vlone"),L(l,s),function(l,u){var s,d,p,f,y,j,B,L,M,V,_,q,A,E,x,R,I=(null==u?void 0:u.liveVideo)||!1,O=(null==u||null===(s=u.res)||void 0===s?void 0:s.contentType)||"video",P=(null==u||null===(d=u.res)||void 0===d||null===(p=d[O])||void 0===p?void 0:p.isSSAIEnabled)||!1,S=c(null==u?void 0:u.res,l)||{};S.src;var D=(null==u?void 0:u.skin_settings)||{};g(u),null!=D&&D.skipBtn&&0==(null==u?void 0:u.liveVideo)&&0==(null==u?void 0:u.liveui)&&e(l,"VL_ONE",T());(null!=D&&D.rewindBtn&&0==(null==u?void 0:u.liveVideo)&&0==(null==u?void 0:u.liveui)||1==(null==u?void 0:u.liveui))&&o(l,"VL_ONE",k());(null==u||null===(f=u.relatedVideos)||void 0===f||null===(y=f.content)||void 0===y?void 0:y.length)>0&&i(l,null==u?void 0:u.relatedVideos);null!=u&&null!==(j=u.series)&&void 0!==j&&j.enable&&n(l,u);(null==u||null===(B=u.streams)||void 0===B?void 0:B.length)>1&&t(l,null==u?void 0:u.streams);if(v(l,u),m(l,u),"MEDIA_TAILOR"==(null===(L=window)||void 0===L||null===(M=L.app_data)||void 0===M||null===(V=M.appcmsMain)||void 0===V||null===(_=V.adsConfig)||void 0===_?void 0:_.vodAdSticherProvider)&&null!==(q=window)&&void 0!==q&&null!==(A=q.app_data)&&void 0!==A&&null!==(E=A.appcmsMain)&&void 0!==E&&null!==(x=E.adsConfig)&&void 0!==x&&x.vodAdClientSideTracking&&P)if(I)b(l);else{var H,N=null;if(null!=u&&null!==(H=u.series)&&void 0!==H&&H.enable){var G,U,$,z,F,Y=null===(G=w())||void 0===G||null===(U=G.video)||void 0===U||null===($=U.gist)||void 0===$?void 0:$.id,J=C(),K=(null==J?void 0:J.get(Y))||{t:0,p:0},Q=K.t,W=K.p;"function"==typeof(null===(z=window)||void 0===z||null===(F=z.watchHistory)||void 0===F?void 0:F.cb)&&window.watchHistory.cb({watchedTime:Q}),W<95&&(N=Q)}else{var X=u.watchHistoryResumeTime;u.watchedPercentage<95&&(N=X)}h(l,N)}null!=u&&u.isDvrEnabled&&null!=u&&null!==(R=u.dvrConfig)&&void 0!==R&&R.enable&&(a(l,u),r(l,u))}(l,s),V(l,s),function(l){var e,o,i,n=u(l),t=null;if(!n)return;var a=n.controlBar.getChild("VolumePanel"),r=null===(e=a.getChild("MuteToggle"))||void 0===e?void 0:e.el(),s=null==a||null===(o=a.el())||void 0===o?void 0:o.querySelector(".vjs-volume-bar"),d=null==a||null===(i=a.el())||void 0===i?void 0:i.querySelector(".vjs-volume-level");if(!a||!s||!d)return;function v(l){l.preventDefault(),t&&(clearTimeout(t),t=null),c(m(l.touches[0]))}function p(l){l.preventDefault(),c(m(l.changedTouches[0])),t=setTimeout((function(){a.el().classList.remove("vjs-hover")}),2e3)}function c(l){var e=Math.min(Math.max(l,0),100);d.style.height=e+"%",s.setAttribute("aria-valuenow",e),s.setAttribute("aria-valuetext",e+"%"),n.volume(e/100)}function m(l){var e=s.getBoundingClientRect(),o=l.clientY-e.top,i=e.height;return 100-Math.min(Math.max(o/i*100,0),100)}r.addEventListener("touchend",(function(){null!=a&&a.el()&&(a.el().classList.toggle("vjs-hover"),n.muted(!1),t&&(clearTimeout(t),t=null),t=setTimeout((function(){a.el().classList.remove("vjs-hover")}),2e3))})),s.addEventListener("touchmove",v,{passive:!1}),s.addEventListener("touchstart",v,{passive:!1}),s.addEventListener("touchend",p,{passive:!1})}(l)}var V=function(l,e){var o,i,n,t,a,r,s,d,v,p,c,m,b=u(l),h=(null==e?void 0:e.theme)||{},f=B.dom.$(".vjs-play-progress"),y=B.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");y&&(y.style.color="".concat(null===(o=window)||void 0===o||null===(i=o.app_data)||void 0===i||null===(n=i.appcmsMain)||void 0===n||null===(t=n.brand)||void 0===t||null===(a=t.cta)||void 0===a||null===(r=a.primary)||void 0===r?void 0:r.backgroundColor)),f&&(f.style.background="".concat(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(v=d.appcmsMain)||void 0===v||null===(p=v.brand)||void 0===p||null===(c=p.cta)||void 0===c||null===(m=c.primary)||void 0===m?void 0:m.backgroundColor));var g=b.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&f&&(f.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&g&&(g.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&y&&(y.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?g.el().style.borderRadius=".3em":g.el().style.borderRadius="1.3em")};export{M as initialiseSkin};
1
+ import{h as l,d as e,e as o,o as i,p as n,q as t,r as a,s as r}from"./features-afa6b543.js";import{g as u}from"./player_instance-34118a5b.js";import{a as s,i as d,b as v}from"./index-abc06824.js";import{P as p,c,O as m,R as b,S as h}from"./generic-e21fdb61.js";import"videojs-contrib-quality-menu";import{i as f,r as y}from"./index-b5c2b4c0.js";import{c as g}from"./helper-349e076f.js";import{c as j,a as w,b as C}from"./currentVideoInfo-a8a254c2.js";import B from"video.js";import{c as T,d as k}from"./icons-37daa6b3.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"./resolution-1c59b0f3.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/assertThisInitialized";import"./skin-d5091b86.js";import"./localisation-0bf399a1.js";import"./autoNextVideo-b2b1dcef.js";import"./util-7d5b2427.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/slicedToArray";import"axios";import"js-cookie";import"./captions-f507e8ee.js";import"video.js/dist/video-js.min.css";function L(e,o){var i=u(e);i&&(i.on("loadeddata",(function(){var l,n,t,a,r,v=g(o),c=j();i.qualityLevels()&&i.qualityLevels().length&&function(l){var e=u(l);e&&(null==e||e.qualityMenu,e.qualityMenu({useResolutionLabels:!0}))}(e),!(null!=o&&null!==(l=o.series)&&void 0!==l&&l.enable||null!==(n=window)&&void 0!==n&&null!==(t=n.app_data)&&void 0!==t&&null!==(a=t.appcmsMain)&&void 0!==a&&null!==(r=a.features)&&void 0!==r&&r.auto_play)||null!=o&&o.liveVideo||s(e,o),null!=o&&o.liveVideo||p()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||d(e),v&&c&&c.length?f(e):y()})),i.one("play",(function(){var o,i,n,t;null!==(o=window)&&void 0!==o&&null!==(i=o.customData)&&void 0!==i&&i.iframeOverlayUrl&&l(e,null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t?void 0:t.iframeOverlayUrl)})))}function M(l,s){u(l).addClass("skin_vlone"),L(l,s),function(l,u){var s,d,p,f,y,j,B,L,M,V,_,q,A,E,x,R,I=(null==u?void 0:u.liveVideo)||!1,O=(null==u||null===(s=u.res)||void 0===s?void 0:s.contentType)||"video",P=(null==u||null===(d=u.res)||void 0===d||null===(p=d[O])||void 0===p?void 0:p.isSSAIEnabled)||!1,S=c(null==u?void 0:u.res,l)||{};S.src;var D=(null==u?void 0:u.skin_settings)||{};g(u),null!=D&&D.skipBtn&&0==(null==u?void 0:u.liveVideo)&&0==(null==u?void 0:u.liveui)&&e(l,"VL_ONE",T());(null!=D&&D.rewindBtn&&0==(null==u?void 0:u.liveVideo)&&0==(null==u?void 0:u.liveui)||1==(null==u?void 0:u.liveui))&&o(l,"VL_ONE",k());(null==u||null===(f=u.relatedVideos)||void 0===f||null===(y=f.content)||void 0===y?void 0:y.length)>0&&i(l,null==u?void 0:u.relatedVideos);null!=u&&null!==(j=u.series)&&void 0!==j&&j.enable&&n(l,u);(null==u||null===(B=u.streams)||void 0===B?void 0:B.length)>1&&t(l,null==u?void 0:u.streams);if(v(l,u),m(l,u),"MEDIA_TAILOR"==(null===(L=window)||void 0===L||null===(M=L.app_data)||void 0===M||null===(V=M.appcmsMain)||void 0===V||null===(_=V.adsConfig)||void 0===_?void 0:_.vodAdSticherProvider)&&null!==(q=window)&&void 0!==q&&null!==(A=q.app_data)&&void 0!==A&&null!==(E=A.appcmsMain)&&void 0!==E&&null!==(x=E.adsConfig)&&void 0!==x&&x.vodAdClientSideTracking&&P)if(I)b(l);else{var H,N=null;if(null!=u&&null!==(H=u.series)&&void 0!==H&&H.enable){var G,U,$,z,F,Y=null===(G=w())||void 0===G||null===(U=G.video)||void 0===U||null===($=U.gist)||void 0===$?void 0:$.id,J=C(),K=(null==J?void 0:J.get(Y))||{t:0,p:0},Q=K.t,W=K.p;"function"==typeof(null===(z=window)||void 0===z||null===(F=z.watchHistory)||void 0===F?void 0:F.cb)&&window.watchHistory.cb({watchedTime:Q}),W<95&&(N=Q)}else{var X=u.watchHistoryResumeTime;u.watchedPercentage<95&&(N=X)}h(l,N)}null!=u&&u.isDvrEnabled&&null!=u&&null!==(R=u.dvrConfig)&&void 0!==R&&R.enable&&(a(l,u),r(l,u))}(l,s),V(l,s),function(l){var e,o,i,n=u(l),t=null;if(!n)return;var a=n.controlBar.getChild("VolumePanel"),r=null===(e=a.getChild("MuteToggle"))||void 0===e?void 0:e.el(),s=null==a||null===(o=a.el())||void 0===o?void 0:o.querySelector(".vjs-volume-bar"),d=null==a||null===(i=a.el())||void 0===i?void 0:i.querySelector(".vjs-volume-level");if(!a||!s||!d)return;function v(l){l.preventDefault(),t&&(clearTimeout(t),t=null),c(m(l.touches[0]))}function p(l){l.preventDefault(),c(m(l.changedTouches[0])),t=setTimeout((function(){a.el().classList.remove("vjs-hover")}),2e3)}function c(l){var e=Math.min(Math.max(l,0),100);d.style.height=e+"%",s.setAttribute("aria-valuenow",e),s.setAttribute("aria-valuetext",e+"%"),n.volume(e/100)}function m(l){var e=s.getBoundingClientRect(),o=l.clientY-e.top,i=e.height;return 100-Math.min(Math.max(o/i*100,0),100)}r.addEventListener("touchend",(function(){null!=a&&a.el()&&(a.el().classList.toggle("vjs-hover"),n.muted(!1),t&&(clearTimeout(t),t=null),t=setTimeout((function(){a.el().classList.remove("vjs-hover")}),2e3))})),s.addEventListener("touchmove",v,{passive:!1}),s.addEventListener("touchstart",v,{passive:!1}),s.addEventListener("touchend",p,{passive:!1})}(l)}var V=function(l,e){var o,i,n,t,a,r,s,d,v,p,c,m,b=u(l),h=(null==e?void 0:e.theme)||{},f=B.dom.$(".vjs-play-progress"),y=B.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");y&&(y.style.color="".concat(null===(o=window)||void 0===o||null===(i=o.app_data)||void 0===i||null===(n=i.appcmsMain)||void 0===n||null===(t=n.brand)||void 0===t||null===(a=t.cta)||void 0===a||null===(r=a.primary)||void 0===r?void 0:r.backgroundColor)),f&&(f.style.background="".concat(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(v=d.appcmsMain)||void 0===v||null===(p=v.brand)||void 0===p||null===(c=p.cta)||void 0===c||null===(m=c.primary)||void 0===m?void 0:m.backgroundColor));var g=b.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&f&&(f.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&g&&(g.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&y&&(y.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?g.el().style.borderRadius=".3em":g.el().style.borderRadius="1.3em")};export{M as initialiseSkin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "2.0.168-backup",
3
+ "version": "2.0.169-backup",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "types": "dist/@viewlift/player/esm/index.d.ts",
6
6
  "amdName": "_playerCore",