@viewlift/player-backup 2.0.167-backup → 2.0.168-backup
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{autoNextVideo-e4995e92.js → autoNextVideo-b18583b0.js} +1 -1
- package/cjs/bundle.css +1 -1
- package/cjs/{features-d2db3e37.js → features-9af43661.js} +1 -1
- package/cjs/generic-9f637989.js +1 -0
- package/cjs/{index-747e2009.js → index-050c0e0f.js} +1 -1
- package/cjs/index-87ce75ce.js +1 -0
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-b6c3ac63.js → multicamv2-a12dd551.js} +1 -1
- package/cjs/{multicamv2-5f75d08f.js → multicamv2-a659a2b1.js} +1 -1
- package/cjs/{nextEpisodeButton-0b9059ca.js → nextEpisodeButton-a1b94489.js} +1 -1
- package/cjs/{playlist-d668a2fd.js → playlist-1314bb95.js} +1 -1
- package/cjs/{series-8139e733.js → series-c1490c2e.js} +1 -1
- package/cjs/{series-v2-a8e215bd.js → series-v2-93f3be92.js} +1 -1
- package/cjs/{series-v2-54f56ef1.js → series-v2-f6b8ba96.js} +1 -1
- package/cjs/{skin-e619b11d.js → skin-6a7648fc.js} +1 -1
- package/cjs/{skin-563ff1fb.js → skin-7dad68a3.js} +1 -1
- package/cjs/{skin-3ce40661.js → skin-8a2b1efa.js} +1 -1
- package/cjs/{skin-26178b94.js → skin-97b54404.js} +1 -1
- package/cjs/{skin-c2bc0e0f.js → skin-bbe15a2f.js} +1 -1
- package/cjs/{skin-4c8eaccc.js → skin-c60a42cc.js} +1 -1
- package/cjs/{skin-f5f5982a.js → skin-d7744eae.js} +1 -1
- package/cjs/{util-5bfdca54.js → util-ca307e43.js} +1 -1
- package/cjs/{videoSelector-fde8315b.js → videoSelector-521d73d1.js} +1 -1
- package/cjs/{videoSelector-3d426add.js → videoSelector-c26fa0bc.js} +1 -1
- package/esm/{autoNextVideo-36b258d2.js → autoNextVideo-b2b1dcef.js} +1 -1
- package/esm/bundle.css +1 -1
- package/esm/{features-1c8c3d26.js → features-afa6b543.js} +1 -1
- package/esm/{generic-600345dd.js → generic-e21fdb61.js} +1 -1
- package/esm/index-6fd2c528.js +1 -0
- package/esm/{index-6a5f708e.js → index-abc06824.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-a5dc0495.js → multicamv2-a17c68b4.js} +1 -1
- package/esm/{multicamv2-4d1c04cd.js → multicamv2-bef0bb77.js} +1 -1
- package/esm/{nextEpisodeButton-0cdfc3ca.js → nextEpisodeButton-a17c23de.js} +1 -1
- package/esm/{playlist-f9653119.js → playlist-dfcb4552.js} +1 -1
- package/esm/plugins/comscore_dist/index.min.d.ts +6 -6
- package/esm/{series-ccac55d6.js → series-f68b4534.js} +1 -1
- package/esm/{series-v2-bff6e686.js → series-v2-0dd9b510.js} +1 -1
- package/esm/{series-v2-03ac6855.js → series-v2-eb3fb4a4.js} +1 -1
- package/esm/{skin-c906c57a.js → skin-59b6384c.js} +1 -1
- package/esm/{skin-6be189db.js → skin-88d3eb07.js} +1 -1
- package/esm/{skin-155f05a7.js → skin-9c9a2ee9.js} +1 -1
- package/esm/{skin-e5f1364d.js → skin-9f13e83e.js} +1 -1
- package/esm/{skin-5dd52773.js → skin-c91fa37f.js} +1 -1
- package/esm/{skin-3348a39f.js → skin-df073080.js} +1 -1
- package/esm/{skin-5947508c.js → skin-f4aa20b4.js} +1 -1
- package/esm/{util-d20b0680.js → util-7d5b2427.js} +1 -1
- package/esm/{videoSelector-270264de.js → videoSelector-31ecc342.js} +1 -1
- package/esm/{videoSelector-ba112f30.js → videoSelector-bc90f24e.js} +1 -1
- package/package.json +1 -1
- package/cjs/generic-6799d4f3.js +0 -1
- package/cjs/index-31f2745c.js +0 -1
- package/esm/index-ecadb973.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import r from"axios";import{g as i}from"./player_instance-34118a5b.js";import a from"js-cookie";import{a as l,e as s,g as d,h as u,s as c,i as v,d as m}from"./currentVideoInfo-a8a254c2.js";import{a as f,r as p}from"./captions-f507e8ee.js";import{t as I,c as g}from"./skin-d5091b86.js";import h from"@babel/runtime/helpers/toConsumableArray";import y from"@babel/runtime/helpers/slicedToArray";function E(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function T(e){window.dataLayer=window.dataLayer||[],E("js",new Date),E("config",e)}function b(e,n){E("event",e,n)}var w={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function _(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 S(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 A={name:"@viewlift/player",version:"2.0.61",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=A.version;var O,L=function(e,n){var t,o,i,a,l,s,d,u;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):r({url:null!==(l=window)&&void 0!==l&&null!==(s=l.customData)&&void 0!==s&&s.overrideEntitlementBaseUrl?(null===(d=window)||void 0===d||null===(u=d.customData)||void 0===u?void 0:u.overrideEntitlementBaseUrl)+"/video/status":N.get()+"".concat(null==w?void 0:w.getVideoDetails),params:S({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":A.version,"x-player-name":"videojs"},withCredentials:!0})},P=function(e,n){var t,o,i,a;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):r({url:N.get()+w.getLinearChannelDetails,params:S(S(S(S(S({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},D=function(e,n){var t,o,i=H(n),a=(null==i?void 0:i.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})})):r({url:N.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},C=function(){var e=n(t.mark((function e(n){var o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return o=e.sent,e.abrupt("return",r({url:N.get()+"".concat(null==w?void 0:w.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:S({},n),params:S({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),k=function(e,n){var t,o,i=window.contentType;return r({method:"GET",url:N.get()+"".concat(null==w?void 0:w.getVideoInfoV2,"/").concat(i,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},R=function(e){var n=e.videoId;return r({method:"GET",url:N.get()+"".concat(null==w?void 0:w.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},N=(O=null==w?void 0:w.apiBaseUrl,{set:function(e){e&&(O=e)},get:function(){return O}}),F=function(e,n,t,o){return r({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},V=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},j=null;function W(){return{set:function(e){e&&(j=e)},get:function(){return j}}}var M=function(){var e=n(t.mark((function e(){var n,o,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=W().get(),o=N.get(),e.prev=2,e.next=5,r({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return i=e.sent,e.abrupt("return",i);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),U=null,B=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!V(n)){e.next=6;break}return U||(U=M().then((function(e){var t,o,r=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,i=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return r&&sessionStorage.setItem("vlp_token",r),i&&W().set(i),r||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){U=null}))),e.abrupt("return",U);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},H=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function G(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 Q(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?G(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):G(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Y=100,z=function(){var e,n,t,o,r,i,a,s=l();return"linearchannel"===((null==s?void 0:s.contentType)||"video")?null==s||null===(e=s.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find((function(e){return(null==e?void 0:e.id)===(null==s?void 0:s.channelId)})))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==s||null===(r=s.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)||(null==s||null===(a=s.video)||void 0===a?void 0:a.id)||(null==s?void 0:s.id)};function q(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function K(){var e=window.sessionStorage.getItem("uid");return e||(e=q(),window.sessionStorage.setItem("uid",e),e)}function X(){return J.apply(this,arguments)}function J(){return(J=n(t.mark((function e(){var n,o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $(e){return e?String(e):""}var Z=function(e){return function(){try{return e.apply(void 0,arguments)}catch(e){return console.error(e),null}}};function ee(e,o){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=q(),s="production",d="WEBSITE",u=null,c=0,v=null,m=0,f=0,p=!1,I=[],g=i(e);if(g){var h=function(){var e,n,t,o;return Math.round((null==g||null===(e=g.tech_)||void 0===e||null===(n=e.vhs)||void 0===n||null===(t=n.selectPlaylist())||void 0===t||null===(o=t.attributes)||void 0===o?void 0:o.BANDWIDTH)/1e3)},y=Z((function(){for(var e=g.currentTime(),n=g.buffered(),t=0;t<n.length;t++){var o=n.start(t),r=n.end(t);if(e>=o&&e<=r)return Math.round(r-e)}return 0})),E=function(){var e=n(t.mark((function e(n){var o,i,u,c,v,m,f,p,I,g,h;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return I=e.sent,g=H(I),e.t0=Q,e.t1=Q,e.t2=null==g?void 0:g.site,e.t3=null==g?void 0:g.siteId,e.t4=d,e.t5=K(),e.t6=z(),e.t7=n.url||document.location.href,e.t8=n.ref||document.referrer,e.t9=n.eventName,e.t10=null!==(o=n.videoPosition)&&void 0!==o?o:null,e.t11=s,e.t12=n.dp1||"",e.t13=n.dp2||"",e.t14=n.dp3||"",e.t15=n.dp4||"",e.t16=n.dp5||"",e.t17=n.isAdEvent?n.videoPosition:null,e.t18=n.isAdEvent?$(n.adPosition):"",e.next=25,X();case 25:e.t19=e.sent,e.t20=n.playerType||"videojs",e.t21=n.mediaType||"VIDEO",e.t22=l,e.t23=null!==(i=n.ttFirstFrame)&&void 0!==i?i:null,e.t24=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t25=null!==(c=n.resHeight)&&void 0!==c?c:null,e.t26=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t27=null!==(m=n.bufferHealth)&&void 0!==m?m:null,e.t28={aid:e.t2,cid:e.t3,pfm:e.t4,uid:e.t5,vid:e.t6,url:e.t7,ref:e.t8,pa:e.t9,vpos:e.t10,environment:e.t11,dp1:e.t12,dp2:e.t13,dp3:e.t14,dp4:e.t15,dp5:e.t16,apos:e.t17,apod:e.t18,profid:e.t19,player:e.t20,media_type:e.t21,stream_id:e.t22,embedurl:"",ttfirstframe:e.t23,bitrate:e.t24,connectionspeed:null,resolutionheight:e.t25,resolutionwidth:e.t26,bufferhealth:e.t27},e.t29=(null==n?void 0:n.duration)&&{duration:n.duration},e.t30=(0,e.t1)(e.t28,e.t29),e.t31=null==a||null===(f=a.beacon)||void 0===f?void 0:f.params,e.t32=(0,e.t0)(e.t30,e.t31),h=[e.t32],r({url:(null==a||null===(p=a.beacon)||void 0===p?void 0:p.url)||N.get()+w.getBeaconUrl,method:"post",headers:{Authorization:I},contentType:"application/x-www-form-urlencoded",dataType:"text",data:h}).catch((function(e){return console.error(e)}));case 41:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),T=function(e){if(!g.paused()&&g.readyState()>2)return clearInterval(u),clearInterval(v),e;var n,t=e+.1;return+t.toFixed(2)>=5&&f<4&&p?(f++,b("BUFFERING",Q({pfm:d,uid:K(),vid:z(),videoPosition:Math.floor(g.currentTime)},null==a||null===(n=a.beacon)||void 0===n?void 0:n.params)),E({eventName:"BUFFERING",videoPosition:Math.floor(g.currentTime),isAdEvent:!1}),0):t},_=function(){var e=Math.floor(g.currentTime);g.on("error",(function(){var n,t=Math.floor(g.currentTime);clearInterval(u);var o=e===t?"FAILED_TO_START":"DROPPED_STREAM";b(o,Q({pfm:d,uid:K(),vid:z(),videoPosition:t},null==a||null===(n=a.beacon)||void 0===n?void 0:n.params)),E({eventName:o,videoPosition:t,isAdEvent:!1})}))},S=function(){var e=Z((function(){var e;c=0,v=setInterval((function(){c=T(c)}),Y),b("PLAY",Q({pfm:d,uid:K(),vid:z(),videoPosition:Math.floor(g.currentTime)},null==a||null===(e=a.beacon)||void 0===e?void 0:e.params)),E({eventName:"PLAY",videoPosition:Math.floor(g.currentTime),isAdEvent:!1}),o&&o("started_video_playback",{"Video ID":z(),watchTime:Math.floor(g.currentTime)})}));g.one("play",e)},A=function(){g.one("timeupdate",(function(){var e;clearInterval(v),clearInterval(u),m=c||0,b("FIRST_FRAME",Q({pfm:d,uid:K(),vid:z(),videoPosition:Math.floor(g.currentTime),ttFirstFrame:c,bufferHealth:y()},null==a||null===(e=a.beacon)||void 0===e?void 0:e.params)),E({eventName:"FIRST_FRAME",videoPosition:Math.floor(g.currentTime),isAdEvent:!1,ttFirstFrame:c,bufferHealth:y()}),p=!0,c=0}))},O=function(){var e=!1;g.on("waiting",Z((function(){p&&(e=!0,clearInterval(u),u=setInterval((function(){e&&!g.paused()?m=T(m):clearInterval(u)}),Y))}))),g.on("playing",Z((function(){e=!1,clearInterval(u)})))},L=function(){var e=function(e){var n,t,o,r=Q({videoPosition:Math.floor(g.currentTime),isAdEvent:!0,bufferHealth:y(),pfm:d,uid:K(),vid:z(),resHeight:(null===(n=videoElement)||void 0===n?void 0:n.videoHeight)||null,resWidth:(null===(t=videoElement)||void 0===t?void 0:t.videoWidth)||null},null==a||null===(o=a.beacon)||void 0===o?void 0:o.params);b(e,Q({},r)),E(Q({eventName:e,adPosition:1},r))};g.on("adstart",(function(){e("AD_REQUEST"),e("AD_IMPRESSION")})),g.on("adskip",(function(){c=0})),g.on("adend",(function(){c=0}))},P=function(){g.on("timeupdate",(function(){var e=Math.floor(g.currentTime());if(e>=30&&e%30==0&&!I.includes(e)){var n,t=null===(n=g.el().getElementsByTagName("video"))||void 0===n?void 0:n[0];f=0,I.push(e),E({eventName:"PING",videoPosition:e,isAdEvent:!1,duration:30,resHeight:(null==t?void 0:t.videoHeight)||null,resWidth:(null==t?void 0:t.videoWidth)||null,bufferHealth:y(),bitrate:h()})}}))};_(),O(),L(),P(),S(),g.on("loadeddata",A)}else console.error("Videojs: Player instance not found.")}function ne(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&ee(e,n,t)}var te=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},oe=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},re=function(e,n){var t=new Map;R({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),u(t)})).catch((function(e){return console.log(e)}))},ie=function(){var e=s.get();return e>=0?e+1:1},ae=function(){var e,n,t,o=d(),r=l(),i=null==r||null===(e=r.video)||void 0===e?void 0:e.id,a=s.get(),u=null==o||null===(n=o[a])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex((function(e){return(null==e?void 0:e.id)===i}));return u>=0?u+1:1};function le(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 se(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?le(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):le(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var de=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ue=function(e){var n=ce(e,"video.tags",[]),t=ce(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},ce=function(e,n,t){for(var o=0,r=(n=n.split(".")).length;o<r;o++){var i;e=null===(i=e)||void 0===i?void 0:i[n[o]]}return e||t},ve=function(){var n,t,o,r,l,s,d,u,c,v,m,f,p,I,g,h,y,E,T,b,w,_,S,A,O=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",L=arguments.length>1?arguments[1]:void 0,P=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return O;var D=(null==P?void 0:P.siteName)||"",C=(null==P?void 0:P.contentType)||"video",k=(null==P||null===(o=P[C])||void 0===o?void 0:o.metadata)||(null==P||null===(r=P[C])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.metadata),R=i(L);if(!O.includes("VIEWLIFT_"))return O;var N,F=window.getComputedStyle(document.getElementById(L),null),V=Math.trunc(F.getPropertyValue("height").slice(0,-2)),j=Math.trunc(F.getPropertyValue("width").slice(0,-2)),W="linearchannel"===C?null==P||null===(s=P.linearchannel)||void 0===s||null===(d=s.channels)||void 0===d||null===(u=d.find((function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)})))||void 0===u||null===(c=u.content)||void 0===c?void 0:c.id:ce(P,"video.gist.id",""),M="linearchannel"===C?null==P||null===(v=P.linearchannel)||void 0===v||null===(m=v.channels)||void 0===m||null===(f=m.find((function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)})))||void 0===f?void 0:f.title:ce(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),U=null,B=null;"function"==typeof window.__gpp&&(null===(N=window)||void 0===N||N.__gpp("ping",(function(e){U=null==e?void 0:e.gppString,B=null==e?void 0:e.sectionList[0]})));var x=se(se({},me(k)),{},(_={VIEWLIFT_WIDTH:j,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:de(j,V),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(p=window)||void 0===p?void 0:p.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:ce(P,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:ce(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:ce(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(I=R.options_)||void 0===I?void 0:I.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(g=R.options_)||void 0===g?void 0:g.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D||"usanetwork"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ue(P),VIEWLIFT_MEDIA_ID:W,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(ce(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:W,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+ce(P,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:ce(null===(h=window)||void 0===h||null===(y=h.app_data)||void 0===y||null===(E=y.site)||void 0===E?void 0:E.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==D||"usanetwork"==D?"":ce(null===(T=window)||void 0===T||null===(b=T.app_data)||void 0===b||null===(w=b.site)||void 0===w?void 0:w.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*ce(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:ce(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:W,VIEWLIFT_CONTENT_TITLE:M,VIEWLIFT_CONTENT_SERIES_TITLE:ce(P,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:ce(P,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ae(),VIEWLIFT_SEASON_NUMBER:ie(),VIEWLIFT_CONTENT_TAGS:ue(P),VIEWLIFT_GPP_SID:B||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:U||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(_,"VIEWLIFT_LAT",""),e(_,"VIEWLIFT_APP_BUNDLE",""),e(_,"VIEWLIFT_ATT_CONSENT",""),_),null===(S=window)||void 0===S||null===(A=S.customData)||void 0===A?void 0:A.macros);for(var H in x){var G=new RegExp(H,"g");O=O.replace(G,x[H])}return O},me=function(e){var n,t,o,r,i,a,l={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){s.set(e.name,e.value)})));var d=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,u=(null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(a=i.subscription)||void 0===a?void 0:a.TVE)||!1;return d||u?(oe()?d?l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):u&&(l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):d?l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):u&&(l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),d?l=se(se({},l),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):u&&(l=se(se({},l),{},{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),l=oe()?se(se({},l),{},{VIEWLIFT_PROF:s.get("prof.mweb")||""}):se(se({},l),{},{VIEWLIFT_PROF:s.get("prof.web")||""})):(l=se(se({},l),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),l=oe()?se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),l=se(se({},l),{},{VIEWLIFT_AFID:s.get("afid"),VIEWLIFT_NIELSEN_APP_ID:s.get("VIEWLIFT_NIELSEN_APP_ID")||"VIEWLIFT_NIELSEN_APP_ID",VIEWLIFT_CHANNEL:s.get("VIEWLIFT_CHANNEL")||"VIEWLIFT_CHANNEL",VIEWLIFT_GRACE_NOTE_ID:s.get("VIEWLIFT_GRACE_NOTE_ID")||"VIEWLIFT_GRACE_NOTE_ID"})},fe=function(e,n){var t,o,r,i,a,l,s,d,u,c,v,m,f,p=(null==e?void 0:e.contentType)||"video",I=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,g=null==e||null===(o=e[p])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.videoAssets,h=null==e||null===(i=e[p])||void 0===i||null===(a=i.streamingInfo)||void 0===a?void 0:a.audioAssets,y=(null==e||null===(l=e[p])||void 0===l||null===(s=l.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.hls)||!1;null==e||null===(u=e[p])||void 0===u||null===(c=u.liveDetails)||void 0===c||c.isDvrEnabled;var E=(null==e||null===(v=e[p])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(f=m.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=h&&h.hls)return Ie(h);if(I){var T=ge(g,n);return T.src=ve(T.src,n,e),T}if("Safari"!==te()&&E)return pe(g);if(y){var b=Ie(g);return b.src=ve(b.src,n,e),b}if(null!=g&&g.mpeg){var w=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(g);return w.src=ve(w.src,n,e),w}return null},pe=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},Ie=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},ge=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,a=e.widevine,l=e.playReady,s=te();if(i(n),"Safari"===s){var d=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(r,(function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))}))},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,r,i){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(a,(function(e,n,t){console.log(e),e&&i(e),i(null,t)}))}}}}}(r);return he(n),d}var u,c={src:a.url,type:"application/dash+xml"};return"caliente"==(null===(u=window)||void 0===u?void 0:u.siteName)?(he(n),c.keySystems={"com.widevine.alpha":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==l?void 0:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var he=function(e){var n=i(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==te()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},ye=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:o}},Ee=function(e,n){if(import("./error-2395864b.js").then((function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)})),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var r=document.createElement("div");r.className="error-container";var i=document.createElement("div");i.className="error-message",i.innerHTML="".concat(n),r.appendChild(i),o.append(r)}}},Te=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var be=!1,we=function(e,n,t){var o=ve(n,e,t),r=i(e);if(n&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,o,r,a=i(e);if(null!==a.el_){be=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),be&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout((function(){a.ima.setContentWithAdTag(null,n,!0),a.ima.requestAds()}),1e3));var s=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&s.hasAttribute("controls")&&s.removeAttribute("controls");var d="click",u=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(u=!0,d="touchend"),a.one(d,(function(){u&&a.ima.initializeAdDisplayContainer()}));var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.ads)||void 0===r?void 0:r.adEventHandler)||null;a.one("ads-ad-started",(function(){c&&c({status:"STARTED",msg:"Advertisement Started"})})),a.one("ads-manager",(function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})),n.addEventListener(google.ima.AdEvent.Type.LOADED,(function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})}))})),a.on("adserror",(function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})}))}}(e,o)}};function _e(e,n){var t,o,r,a=i(e),l=null==a||null===(t=a.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,s=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",(function(t){var o,r,i,d,u,c,v,m,f;if(Ae.enabled&&"input"!=t.target.localName){var p=t.key,I=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==s||s.focus()),p){case" ":null==l||l.click();break;case"m":case"M":a.muted(!a.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":I&&!1===n.liveui||vn(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(d=i.appcmsMain)||void 0===d||null===(u=d.adsConfig)||void 0===u?void 0:u.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(m=v.appcmsMain)&&void 0!==m&&null!==(f=m.adsConfig)&&void 0!==f&&f.vodAdClientSideTracking)return;I||cn(e,10)}}}),!0)}var Se,Ae=(Se=!0,{enable:function(){Se=!0},disable:function(){Se=!1},get enabled(){return Se}}),Oe="ssai-breakStart",Le="ssai-adImpression",Pe="ssai-firstQuartile",De="ssai-midpoint",Ce="ssai-thirdQuartile",ke="ssai-complete",Re="ssai-breakEnd",Ne={breakStart:Oe,impression:Le,firstQuartile:Pe,midpoint:De,thirdQuartile:Ce,complete:ke,breakEnd:Re};function Fe(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=i(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,r=Ne[o];r&&t.trigger(r,n)}function Ve(e){var n=i(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(Oe,e)},adImpression:function(e){return t(Le,e)},adFirstQuartile:function(e){return t(Pe,e)},adMidpoint:function(e){return t(De,e)},adThirdQuartile:function(e){return t(Ce,e)},adComplete:function(e){return t(ke,e)},adBreakEnd:function(e){return t(Re,e)}}}function je(e){var n=e.isLive,t=e.startTimeInSeconds;return n?analytics.StreamingAnalytics.AdvertisementMetadata.LIVE:0==t?analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_POST_ROLL:!1===t?ns_.analytics.StreamingAnalytics.AdvertisementMetadata.AdvertisementType.ON_DEMAND_POST_ROLL:analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_MID_ROLL}function We(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!window.analytics)return console.log("is StreamingAnalytics started Initialised?",(console.warn("[Comscore] Tag not initialized."),!1)),void console.warn("[Comscore] Tag not initialized or analytics missing.");var n=window.analytics,t=null;t.notifyPause();var o=new n.StreamingAnalytics.AdvertisementMetadata;o.setMediaType(je({isLive:void 0,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(null),o.setDeliveryType(n.StreamingAnalytics.AdvertisementMetadata.AdvertisementDeliveryType.NATIONAL),o.setPlacementId(e.placementId);var r={cs_ad_tu:e.trackingUrl};o.addCustomLabels(r),t.setMetadata(o),t.notifyPlay(),console.log("[Comscore] Ad started:",e)}function Me(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}}function Ue(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 Be(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ue(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function xe(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return He(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)?He(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}function He(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}o.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 r=document.createElement("script");r.src=n||"https://appcms.staging.asset.viewlift.com/comscore.js",r.async=!0,document.head.appendChild(r),r.onload=function(){!function(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 r=new o.configuration.PublisherConfiguration({publisherId:String(n),persistentLabels:{cs_ucfr:(null==t?void 0:t.userConsent)||"",cs_fpid:(null==t?void 0:t.userId)||""}});o.configuration.addClient(r),o.configuration.enableFirstPartyCookie(),o.configuration.enableImplementationValidationMode(),o.start(),console.log("[Comscore] Library initialized for publisher:",n),window.analytics=o}({publisherId:e||"40813950"})},r.onerror=function(e){o("Error while loading script ".concat(src," : ").concat(e))}}))}(n.publisherId,n.endpoint)}));var Ge,Qe=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),Ye=(Ge=null,{set:function(e){Ge=e},get position(){return Ge}});function ze(e,n){return qe.apply(this,arguments)}function qe(){return(qe=n(t.mark((function e(n,o){var r,a,l,s,d,u,c,v,m,f,p,I,g,h,E,T,b,w;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(n),l=fe(o,n),s=l.src,d=(null==o?void 0:o.contentType)||"video",u=(null==o||null===(r=o[d])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,c=s.replace("/dash/","/session/").replace("/master/","/session/"),c=ve(c,n,o),v=Ke(c),m=y(v,2),f=m[0],p=m[1],c=new URL(c.split("?")[0]),Object.keys(p).length>0&&Object.entries(p).forEach((function(e){var n=y(e,2),t=n[0],o=n[1];c.searchParams.set(t,o)})),e.prev=10,e.next=13,fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Be({adsParams:Be({},f)},u&&{availSuppression:{mode:"BEHIND_LIVE_EDGE",value:"00:00:00"}}))});case 13:return I=e.sent,e.next=16,I.json();case 16:return g=e.sent,h="https://"+new URL(c).hostname,E=g.trackingUrl,T=g.manifestUrl,b=h+E,w=h+T,Qe.set(b),console.log("%c TRACKING URL","background: #bdf369; color: #000",b),l.src=w,e.abrupt("return",l);case 28:return e.prev=28,e.t0=e.catch(10),e.abrupt("return",l);case 31:case"end":return e.stop()}}),e,null,[[10,28]])})))).apply(this,arguments)}function Ke(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=xe((null==o?void 0:o.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var i=y(t.value,2),a=i[0],l=i[1];n[decodeURIComponent(a)]=decodeURIComponent(l||"")}}catch(e){r.e(e)}finally{r.f()}for(var s={},d={},u=0,c=Object.entries(n);u<c.length;u++){var v=y(c[u],2),m=v[0],f=v[1];if(m.startsWith("ads."))s[m.replace(/^ads\./,"")]=f;else d[m]=f}return[s,d]}var Xe,Je=(Xe=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),Xe=Array.isArray(e)?h(e):Xe},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",Xe),h(Xe)}}),$e=new Map;function Ze(e,n){return en.apply(this,arguments)}function en(){return en=n(t.mark((function e(o,r){var a,l,s,d,u,c,v,m,f,p,g,y,E,T,b,w,_,S,A,O,L,P;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P=function(e,n,t,r,a,l){var s=i(o);if(!s.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(s.currentTime());var d,u=xe(t);try{var c=function(){var t,i,u,c=d.value,v=c.eventType,m=c.beaconUrls,f=c.startTimeInSeconds,p=c.startTime,I=c.durationInSeconds,g=f||0,h=m,y=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(u=i.ads)||void 0===u?void 0:u.adEventHandler)||null,E="".concat(g,"_").concat(v),T=$e.get("pod-".concat(a))||[];if(console.warn(e,g,"map:",v,"condition1:",e>=g,"map:",$e),e>=g&&!T.includes(E)){T.push(E),$e.set("pod-".concat(a),T);try{L(v,n,h,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,v,n)}if("breakEnd"==v){var b=Ye.position;Ye.set(null),setTimeout((function(){null!=b&&(s.currentTime(b),l())}),500)}if("function"==typeof y)try{var w,_={eventType:v,startTimeInSeconds:f,startTime:p,durationInSeconds:I,ad:null==n||null===(w=n.ads)||void 0===w?void 0:w[r],adIndex:r};y({adsData:_}),Fe(o,_)}catch(e){console.error("Error when calling ads callback:",e)}if("impression"===v){var S,A=Qe.get();We(Me(Be(Be({},null==n||null===(S=n.ads)||void 0===S?void 0:S[r]),{},{trackingUrl:A})))}}};for(u.s();!(d=u.n()).done;)c()}catch(e){u.e(e)}finally{u.f()}}},L=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))},O=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},$e.clear(),Ye.set(r),f=Qe.get(),(p=i(o)).one("loadeddata",(function(){f&&A(f)})),g=new Map,y=new Map,E=-1,T=(null===(a=document)||void 0===a||null===(l=a.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==p||null===(s=p.controlBar)||void 0===s?void 0:s.getChild("videoSelector"))||null,w=(null==p||null===(d=p.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,_=(null==p||null===(u=p.el())||void 0===u||null===(c=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,S=(null==p||null===(v=p.el())||void 0===v||null===(m=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,A=function(){var e=n(t.mark((function e(n){var a,l,s,d,u,c,v,m,f,p,A,L,D,C,k,R,N,F,V,j;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return R=function(e){document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",R),0===e.button&&D()},k=function(e){},C=function(){var e,n=p.currentTime(),t=null,o=xe(f);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,a=r.durationInSeconds,l=(r.ads,Math.floor(i+a));n>=i&&n<=l&&(t=l,g.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout((function(){p.currentTime(t+2.2)}),100))},D=function(){var e,n=p.currentTime(),t=null,o=xe(f);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,a=r.durationInSeconds,l=r.ads,s=Math.floor(i+a);(Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n>s||n>i)&&!g.has(i)||n>=i&&n<=s)&&(t=i,g.set(i,!0),y.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout((function(){p.currentTime(t+.4)}),100))},u=!1,e.next=7,fetch(n);case 7:return c=e.sent,e.next=10,c.json();case 10:v=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",v),m=v.avails,f=[],p=i(o),A=p.controlBar.progressControl,L=A.seekBar.el(),null===(a=document)||void 0===a||a.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),m.map((function(e,n){var t,o,r;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(u=!0),f.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(r=o.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===r?void 0:r[0])||[]})})),!u&&r&&(p.currentTime(r),C()),null!=f&&f.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",f),window.adsQueueList=f),console.log(f,"data"),f.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,o=p.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",L.appendChild(i)}})),p._timeUpdateHandler&&p.off("timeupdate",p._timeUpdateHandler),p._timeUpdateHandler=I((function(){var e=p.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=f[o],r=t.startTimeInSeconds,i=t.durationInSeconds,a=t.ads,l=r+i;if(e>=r-1.2&&e<=l+1.2){e>=r&&e<=l&&Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n=!0),e>l&&g.set(r,!0),Ae.disable(),T&&T.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),w&&(w.el().style.pointerEvents="none",w.el().classList.add("vjs-hidden")),A.el().classList.add("hide-progress-bar");for(var s=e-r,d=0,u=0,c=0;c<a.length;c++){var v,m=null==a||null===(v=a[c])||void 0===v?void 0:v.durationInSeconds;if(s<d+m){u=c;break}d+=m}a[u];var p=Math.max(0,i-s),I=Math.round(p);N.style.display="block",j.textContent="".concat(u+1," of ").concat(a.length," • ").concat(O(I));var E=[];return null==a||a.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));E.push.apply(E,h(n))})),Array.isArray(a)&&0==(null==a?void 0:a.length)&&E.push(null==t?void 0:t.podSlotImpressionBeacon),P(e,t,E,u,o,C),"break"}y.delete(r)},o=0;o<f.length;o++){if("break"===t())break}n||(N.style.display="none",A.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),w&&(w.el().style.pointerEvents="auto",w.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),Ae.enable())}}),1e3),p.on("timeupdate",p._timeUpdateHandler),null===(l=document)||void 0===l||l.addEventListener("keydown",(function(e){Ae.enabled&&"ArrowRight"==e.key&&(D(),cn(o,10),e.stopPropagation())})),A.el().addEventListener("pointerdown",(function(e){0===e.button&&(document.addEventListener("pointermove",k),document.addEventListener("pointerup",R))})),null===(s=document)||void 0===s||null===(d=s.querySelectorAll(".ssai-ad-container"))||void 0===d||d.forEach((function(e){return null==e?void 0:e.remove()})),(N=document.createElement("div")).className="ssai-ad-container",(F=document.createElement("div")).className="sponsored-adbox",(V=document.createElement("div")).className="sponsored-text",V.textContent="Sponsored Ad",F.append(V),(j=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",N.append(F),N.append(j),p.el().appendChild(N);case 45:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();case 18:case"end":return e.stop()}}),e)}))),en.apply(this,arguments)}function nn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return tn(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?tn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}function tn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var on={},rn=null;function an(e){return ln.apply(this,arguments)}function ln(){return ln=n(t.mark((function e(o){var r,a,l,s,d,u,c,v,m,f,p,g,y,E,T,b,w,_,S,A,O,L,P,D,C,k;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k=function(e,n,t,r,a){var l=i(o);if(!l.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(l.currentTime());var s,d=nn(t);try{for(d.s();!(s=d.n()).done;){var u,c,v,m=s.value,f=m.eventType,p=m.beaconUrls,I=m.startTimeInSeconds,g=m.startTime,h=m.durationInSeconds,y=I||0,E=p,T=(null===(u=window)||void 0===u||null===(c=u.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.adEventHandler)||null,b="".concat(y,"_").concat(f),w=P.get("pod-".concat(a))||[];if(console.warn(e,y,"map:",f,"condition1:",e>=y,"map:",P),e>=y&&e<=y+D&&!w.includes(b)){w.push(b),P.set("pod-".concat(a),w);try{C(f,n,E,l)}catch(e){console.error("Error when calling triggerAdBeacon:",e,f,n)}if("function"==typeof T)try{var _,S={eventType:f,startTimeInSeconds:I,startTime:g,durationInSeconds:h,ad:null==n||null===(_=n.ads)||void 0===_?void 0:_[r],adIndex:r};T({adsData:S}),Fe(o,S)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){d.e(e)}finally{d.f()}}},C=function(e,n,t,o){var r,i;"breakEnd"!==e||(null===(r=on)||void 0===r?void 0:r.currentAdIndex)+1==(null===(i=on)||void 0===i?void 0:i.totalAds)?(console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))):console.log("SKIPPED FROM FIRING")},p=function(){rn&&clearInterval(rn)},m=Qe.get(),(f=i(o)).one("loadeddata",(function(){p(),rn=setInterval((function(){m&&!f.paused()&&L(m)}),2e3)})),f.on("dispose",(function(){p()})),g=new Map,y=new Map,E=-1,T=null,b=(null===(r=document)||void 0===r||null===(a=r.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,w=(null==f||null===(l=f.controlBar)||void 0===l?void 0:l.getChild("videoSelector"))||null,_=(null==f||null===(s=f.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,S=(null==f||null===(d=f.el())||void 0===d||null===(u=d.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===u?void 0:u[0])||null,A=(null==f||null===(c=f.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===v?void 0:v[0])||null,O=!1,L=function(){var e=n(t.mark((function e(n){var r,a,l,s,d,u,c,v,m,f;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=new URL(n),T&&a.searchParams.append("nextToken",T),e.next=4,fetch(a.toString(),{method:"GET"});case 4:return l=e.sent,e.next=7,l.json();case 7:s=e.sent,d=s.avails,u=s.nextToken||null,T=u,c=[],v=i(o),m=v.controlBar.progressControl,f=m.seekBar.el(),null===(r=document)||void 0===r||r.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),d.map((function(e,n){var t,o;c.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(t=e.adBreakTrackingEvents)||void 0===t||null===(o=t.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===o?void 0:o[0])||[]})})),console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),null!=c&&c.length&&(window.adsQueueList=c),c.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,o=v.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",f.appendChild(i)}})),v._timeUpdateHandler&&v.off("timeupdate",v._timeUpdateHandler),v._timeUpdateHandler=I((function(){var e=v.currentTime();if(e!==E){E=e;for(var n=function(){var n=c[t],o=n.startTimeInSeconds,r=n.durationInSeconds,i=n.ads,a=o+r;if(e>=o-1.2&&e<=a+1.2){O=!!(e>=o&&e<=a&&Array.isArray(i)&&(null==i?void 0:i.length)>0),e>a&&g.set(o,!0),Ae.disable(),b&&b.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),A&&(A.style.pointerEvents="none",A.classList.add("vjs-hidden")),w&&(w.el().style.pointerEvents="none",w.el().classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),m.el().classList.add("hide-progress-bar");for(var l=e-o,s=0,d=0,u=0;u<i.length;u++){var v,f=null==i||null===(v=i[u])||void 0===v?void 0:v.durationInSeconds;if(l<s+f){d=u;break}s+=f}setTimeout((function(){on.totalAds=null==i?void 0:i.length,on.currentAdIndex=d}),1e3);var p=[];return null==i||i.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));p.push.apply(p,h(n))})),Array.isArray(i)&&0==(null==i?void 0:i.length)&&p.push(null==n?void 0:n.podSlotImpressionBeacon),k(e,n,p,d,t),"break"}y.delete(o)},t=0;t<c.length;t++){if("break"===n())break}O||(on={},m.el().classList.remove("hide-progress-bar"),w&&(w.el().style.pointerEvents="auto",w.el().classList.remove("vjs-hidden")),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),b&&b.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),A&&(A.style.pointerEvents="auto",A.classList.remove("vjs-hidden")),Ae.enable())}}),1e3),v.on("timeupdate",v._timeUpdateHandler);case 23:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),P=new Map,D=2.5;case 21:case"end":return e.stop()}}),e)}))),ln.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}var dn=function(e){o(e).play()},un=function(e){o(e).pause()},cn=function(e,n){var t=o(e),r=t.currentTime()+n;t.currentTime(r)},vn=function(e,n){var t=o(e),r=t.currentTime(),i=r<=n?0:r-n;t.currentTime(i)},mn=function(e){return!!o.getPlayer("".concat(e))},fn=function(e){return o(e).paused()},pn=function(){var e=n(t.mark((function e(o,r){var a,l,s,d=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=d.length>2&&void 0!==d[2]&&d[2],e.next=3,B();case 3:return l=e.sent,s=i(o),e.abrupt("return",new Promise((function(e,i){var d=(null==r?void 0:r.programs)||[];null==r||delete r.programs,P(r,l).then(function(){var i=n(t.mark((function n(i){var l,u,v,f,p,I,g,h;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(I=null==i?void 0:i.data,window.sid=q(),I.contentType="linearchannel",I.channelId=null==r?void 0:r.channelId,g=(null==I||null===(l=I.linearchannel)||void 0===l?void 0:l.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(u=window)||void 0===u||null===(v=u.app_data)||void 0===v||null===(f=v.appcmsMain)||void 0===f||null===(p=f.adsConfig)||void 0===p?void 0:p.vodAdSticherProvider)||!1,h=fe(I,o),!g){n.next=11;break}return n.next=9,ze(o,I);case 9:h=n.sent,a=!0;case 11:c(I),m(d),sessionStorage.setItem("program_switched",!0),h&&a?(En(o,h),g&&an(o),s.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:I})}))):e({status:!0,msg:"Feed authenticated",response:I});case 15:case"end":return n.stop()}}),n)})));return function(e){return i.apply(this,arguments)}}()).catch((function(e){i({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),In=function(){var e=n(t.mark((function e(o,r,a){var l,s,u,m,I,g,h;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return m=e.sent,(d()||null)&&v(r),I=0,g=0,h=null,null!==(l=window)&&void 0!==l&&l.watchHistory&&null!==(s=window)&&void 0!==s&&null!==(u=s.watchHistory)&&void 0!==u&&u.enable&&k(r,m).then((function(e){var n,t,o,r,i,a,l;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),I=(null==e||null===(i=e.data)||void 0===i?void 0:i.watchedTime)||null,(g=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null)<95)&&(h=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null)})).catch((function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))})),e.abrupt("return",new Promise((function(e,a){L(r,m).then(function(){var r=n(t.mark((function n(r){var l,s,d,u,v,m,y,E,T,b,w,_,S,A,O,L,P,D,C,k,R,N,F,V,j,W,M,U,B,x,H,G,Q,Y,z,q,K,X;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(L=null==r?void 0:r.data,P=(null==L?void 0:L.contentType)||"video",D=(null==L||null===(l=L[P])||void 0===l?void 0:l.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(u=d.appcmsMain)||void 0===u||null===(v=u.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,C=(null==L||null===(m=L.video)||void 0===m||null===(y=m.streamingInfo)||void 0===y?void 0:y.isLiveStream)||!1,c(r.data),(k=(null==L||null===(E=L.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(b=T.adTags)||void 0===b||null===(w=b.web)||void 0===w?void 0:w.active)&&(null==L||null===(_=L.ads)||void 0===_||null===(S=_.preRoll)||void 0===S||null===(A=S.adTags)||void 0===A||null===(O=A.web)||void 0===O?void 0:O.url))&&we(o,k,L),R=fe(L,o),!D){n.next=12;break}return n.next=11,ze(o,L);case 11:R=n.sent;case 12:R?(G=(null==L||null===(N=L.video)||void 0===N||null===(F=N.gist)||void 0===F?void 0:F.videoImageUrl)||(null==L||null===(V=L.video)||void 0===V||null===(j=V.gist)||void 0===j||null===(W=j.imageGist)||void 0===W?void 0:W.r16x9),(Q=i(o)).poster(G),En(o,R),D&&Ze(o,h),Q.on("loadstart",(function(){C&&e({status:!0,msg:"Video Loaded",response:L})})),Q.on("loadeddata",(function(){Te(),e({status:!0,msg:"Video Loaded",response:L})})),Q.one("play",(function(){I&&!D&&g<95&&setTimeout((function(){Q.currentTime(I)}),0)})),Q.one("error",(function(){var e;a({status:!1,msg:(null==Q||null===(e=Q.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==L||null===(M=L.video)||void 0===M||null===(U=M.contentDetails)||void 0===U||null===(B=U.closedCaptions)||void 0===B?void 0:B.length)>0||(null==L||null===(x=L.video)||void 0===x||null===(H=x.closedCaptions)||void 0===H?void 0:H.length)>0?(X=(null==L||null===(z=L.video)||void 0===z||null===(q=z.contentDetails)||void 0===q?void 0:q.closedCaptions)||(null==L||null===(K=L.video)||void 0===K?void 0:K.closedCaptions),Y=X.filter((function(e){return"VTT"===e.format})),f(o,Y)):p(o)):(Ee(o,"Incompatible Source, only hls,mp4,drm content is allowed"),a("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}}),n)})));return function(e){return r.apply(this,arguments)}}()).catch((function(e){Tn(e,o,a,r)}))})));case 10:case"end":return e.stop()}}),e)})));return function(n,t,o){return e.apply(this,arguments)}}(),gn=function(e,n,t){var o=i(e);return o.src(n),new Promise((function(e,n){var r=0;o.one("loadedmetadata",(function(){clearTimeout(r),e({status:!0,msg:"video loaded"})})),o.one("loadstart",(function(e){r=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},hn=function(e){var n=i(e);if(yn(),g(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},yn=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},En=function(e,n){var t=i(e);t&&t.src(n)},Tn=function(n,t,o,r){var i,a,l,s,d,u,c=null==n||null===(i=n.response)||void 0===i||null===(a=i.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(s=l.data)||void 0===s?void 0:s.errorMessage)||(null==n?void 0:n.message);mn(t)&&Ee(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?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}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))},bn=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")};export{vn as A,mn as B,In as C,pn as D,hn as E,F,Je as G,Ve as H,N as I,x as J,W as K,V as L,T as M,$e as N,_e as O,oe as P,fn as Q,an as R,Ze as S,R as T,ae as a,ie as b,fe as c,te as d,Te as e,bn as f,K as g,Ee as h,ne as i,we as j,ye as k,En as l,ze as m,H as n,L as o,k as p,Tn as q,B as r,C as s,P as t,D as u,re as v,gn as w,cn as x,dn as y,un as z};
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import r from"axios";import{g as i}from"./player_instance-34118a5b.js";import a from"js-cookie";import{a as l,e as s,g as d,h as u,s as c,i as v,d as m}from"./currentVideoInfo-a8a254c2.js";import{a as f,r as p}from"./captions-f507e8ee.js";import{t as I,c as g}from"./skin-d5091b86.js";import h from"@babel/runtime/helpers/toConsumableArray";import y from"@babel/runtime/helpers/slicedToArray";function E(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function T(e){window.dataLayer=window.dataLayer||[],E("js",new Date),E("config",e)}function b(e,n){E("event",e,n)}var w={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function _(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 S(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 A={name:"@viewlift/player",version:"2.0.61",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=A.version;var O,L=function(e,n){var t,o,i,a,l,s,d,u;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):r({url:null!==(l=window)&&void 0!==l&&null!==(s=l.customData)&&void 0!==s&&s.overrideEntitlementBaseUrl?(null===(d=window)||void 0===d||null===(u=d.customData)||void 0===u?void 0:u.overrideEntitlementBaseUrl)+"/video/status":N.get()+"".concat(null==w?void 0:w.getVideoDetails),params:S({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":A.version,"x-player-name":"videojs"},withCredentials:!0})},P=function(e,n){var t,o,i,a;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):r({url:N.get()+w.getLinearChannelDetails,params:S(S(S(S(S({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},D=function(e,n){var t,o,i=H(n),a=(null==i?void 0:i.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})})):r({url:N.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},C=function(){var e=n(t.mark((function e(n){var o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return o=e.sent,e.abrupt("return",r({url:N.get()+"".concat(null==w?void 0:w.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:S({},n),params:S({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),k=function(e,n){var t,o,i=window.contentType;return r({method:"GET",url:N.get()+"".concat(null==w?void 0:w.getVideoInfoV2,"/").concat(i,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},R=function(e){var n=e.videoId;return r({method:"GET",url:N.get()+"".concat(null==w?void 0:w.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},N=(O=null==w?void 0:w.apiBaseUrl,{set:function(e){e&&(O=e)},get:function(){return O}}),F=function(e,n,t,o){return r({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},V=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},j=null;function W(){return{set:function(e){e&&(j=e)},get:function(){return j}}}var M=function(){var e=n(t.mark((function e(){var n,o,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=W().get(),o=N.get(),e.prev=2,e.next=5,r({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return i=e.sent,e.abrupt("return",i);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),U=null,B=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!V(n)){e.next=6;break}return U||(U=M().then((function(e){var t,o,r=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,i=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return r&&sessionStorage.setItem("vlp_token",r),i&&W().set(i),r||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){U=null}))),e.abrupt("return",U);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},H=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function G(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 Q(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?G(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):G(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Y=100,z=function(){var e,n,t,o,r,i,a,s=l();return"linearchannel"===((null==s?void 0:s.contentType)||"video")?null==s||null===(e=s.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find((function(e){return(null==e?void 0:e.id)===(null==s?void 0:s.channelId)})))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==s||null===(r=s.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)||(null==s||null===(a=s.video)||void 0===a?void 0:a.id)||(null==s?void 0:s.id)};function q(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function K(){var e=window.sessionStorage.getItem("uid");return e||(e=q(),window.sessionStorage.setItem("uid",e),e)}function X(){return J.apply(this,arguments)}function J(){return(J=n(t.mark((function e(){var n,o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $(e){return e?String(e):""}var Z=function(e){return function(){try{return e.apply(void 0,arguments)}catch(e){return console.error(e),null}}};function ee(e,o){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=q(),s="production",d="WEBSITE",u=null,c=0,v=null,m=0,f=0,p=!1,I=[],g=i(e);if(g){var h=function(){var e,n,t,o;return Math.round((null==g||null===(e=g.tech_)||void 0===e||null===(n=e.vhs)||void 0===n||null===(t=n.selectPlaylist())||void 0===t||null===(o=t.attributes)||void 0===o?void 0:o.BANDWIDTH)/1e3)},y=Z((function(){for(var e=g.currentTime(),n=g.buffered(),t=0;t<n.length;t++){var o=n.start(t),r=n.end(t);if(e>=o&&e<=r)return Math.round(r-e)}return 0})),E=function(){var e=n(t.mark((function e(n){var o,i,u,c,v,m,f,p,I,g,h;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return I=e.sent,g=H(I),e.t0=Q,e.t1=Q,e.t2=null==g?void 0:g.site,e.t3=null==g?void 0:g.siteId,e.t4=d,e.t5=K(),e.t6=z(),e.t7=n.url||document.location.href,e.t8=n.ref||document.referrer,e.t9=n.eventName,e.t10=null!==(o=n.videoPosition)&&void 0!==o?o:null,e.t11=s,e.t12=n.dp1||"",e.t13=n.dp2||"",e.t14=n.dp3||"",e.t15=n.dp4||"",e.t16=n.dp5||"",e.t17=n.isAdEvent?n.videoPosition:null,e.t18=n.isAdEvent?$(n.adPosition):"",e.next=25,X();case 25:e.t19=e.sent,e.t20=n.playerType||"videojs",e.t21=n.mediaType||"VIDEO",e.t22=l,e.t23=null!==(i=n.ttFirstFrame)&&void 0!==i?i:null,e.t24=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t25=null!==(c=n.resHeight)&&void 0!==c?c:null,e.t26=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t27=null!==(m=n.bufferHealth)&&void 0!==m?m:null,e.t28={aid:e.t2,cid:e.t3,pfm:e.t4,uid:e.t5,vid:e.t6,url:e.t7,ref:e.t8,pa:e.t9,vpos:e.t10,environment:e.t11,dp1:e.t12,dp2:e.t13,dp3:e.t14,dp4:e.t15,dp5:e.t16,apos:e.t17,apod:e.t18,profid:e.t19,player:e.t20,media_type:e.t21,stream_id:e.t22,embedurl:"",ttfirstframe:e.t23,bitrate:e.t24,connectionspeed:null,resolutionheight:e.t25,resolutionwidth:e.t26,bufferhealth:e.t27},e.t29=(null==n?void 0:n.duration)&&{duration:n.duration},e.t30=(0,e.t1)(e.t28,e.t29),e.t31=null==a||null===(f=a.beacon)||void 0===f?void 0:f.params,e.t32=(0,e.t0)(e.t30,e.t31),h=[e.t32],r({url:(null==a||null===(p=a.beacon)||void 0===p?void 0:p.url)||N.get()+w.getBeaconUrl,method:"post",headers:{Authorization:I},contentType:"application/x-www-form-urlencoded",dataType:"text",data:h}).catch((function(e){return console.error(e)}));case 41:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),T=function(e){if(!g.paused()&&g.readyState()>2)return clearInterval(u),clearInterval(v),e;var n,t=e+.1;return+t.toFixed(2)>=5&&f<4&&p?(f++,b("BUFFERING",Q({pfm:d,uid:K(),vid:z(),videoPosition:Math.floor(g.currentTime)},null==a||null===(n=a.beacon)||void 0===n?void 0:n.params)),E({eventName:"BUFFERING",videoPosition:Math.floor(g.currentTime),isAdEvent:!1}),0):t},_=function(){var e=Math.floor(g.currentTime);g.on("error",(function(){var n,t=Math.floor(g.currentTime);clearInterval(u);var o=e===t?"FAILED_TO_START":"DROPPED_STREAM";b(o,Q({pfm:d,uid:K(),vid:z(),videoPosition:t},null==a||null===(n=a.beacon)||void 0===n?void 0:n.params)),E({eventName:o,videoPosition:t,isAdEvent:!1})}))},S=function(){var e=Z((function(){var e;c=0,v=setInterval((function(){c=T(c)}),Y),b("PLAY",Q({pfm:d,uid:K(),vid:z(),videoPosition:Math.floor(g.currentTime)},null==a||null===(e=a.beacon)||void 0===e?void 0:e.params)),E({eventName:"PLAY",videoPosition:Math.floor(g.currentTime),isAdEvent:!1}),o&&o("started_video_playback",{"Video ID":z(),watchTime:Math.floor(g.currentTime)})}));g.one("play",e)},A=function(){g.one("timeupdate",(function(){var e;clearInterval(v),clearInterval(u),m=c||0,b("FIRST_FRAME",Q({pfm:d,uid:K(),vid:z(),videoPosition:Math.floor(g.currentTime),ttFirstFrame:c,bufferHealth:y()},null==a||null===(e=a.beacon)||void 0===e?void 0:e.params)),E({eventName:"FIRST_FRAME",videoPosition:Math.floor(g.currentTime),isAdEvent:!1,ttFirstFrame:c,bufferHealth:y()}),p=!0,c=0}))},O=function(){var e=!1;g.on("waiting",Z((function(){p&&(e=!0,clearInterval(u),u=setInterval((function(){e&&!g.paused()?m=T(m):clearInterval(u)}),Y))}))),g.on("playing",Z((function(){e=!1,clearInterval(u)})))},L=function(){var e=function(e){var n,t,o,r=Q({videoPosition:Math.floor(g.currentTime),isAdEvent:!0,bufferHealth:y(),pfm:d,uid:K(),vid:z(),resHeight:(null===(n=videoElement)||void 0===n?void 0:n.videoHeight)||null,resWidth:(null===(t=videoElement)||void 0===t?void 0:t.videoWidth)||null},null==a||null===(o=a.beacon)||void 0===o?void 0:o.params);b(e,Q({},r)),E(Q({eventName:e,adPosition:1},r))};g.on("adstart",(function(){e("AD_REQUEST"),e("AD_IMPRESSION")})),g.on("adskip",(function(){c=0})),g.on("adend",(function(){c=0}))},P=function(){g.on("timeupdate",(function(){var e=Math.floor(g.currentTime());if(e>=30&&e%30==0&&!I.includes(e)){var n,t=null===(n=g.el().getElementsByTagName("video"))||void 0===n?void 0:n[0];f=0,I.push(e),E({eventName:"PING",videoPosition:e,isAdEvent:!1,duration:30,resHeight:(null==t?void 0:t.videoHeight)||null,resWidth:(null==t?void 0:t.videoWidth)||null,bufferHealth:y(),bitrate:h()})}}))};_(),O(),L(),P(),S(),g.on("loadeddata",A)}else console.error("Videojs: Player instance not found.")}function ne(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&ee(e,n,t)}var te=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},oe=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},re=function(e,n){var t=new Map;R({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),u(t)})).catch((function(e){return console.log(e)}))},ie=function(){var e=s.get();return e>=0?e+1:1},ae=function(){var e,n,t,o=d(),r=l(),i=null==r||null===(e=r.video)||void 0===e?void 0:e.id,a=s.get(),u=null==o||null===(n=o[a])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex((function(e){return(null==e?void 0:e.id)===i}));return u>=0?u+1:1};function le(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 se(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?le(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):le(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var de=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ue=function(e){var n=ce(e,"video.tags",[]),t=ce(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},ce=function(e,n,t){for(var o=0,r=(n=n.split(".")).length;o<r;o++){var i;e=null===(i=e)||void 0===i?void 0:i[n[o]]}return e||t},ve=function(){var n,t,o,r,l,s,d,u,c,v,m,f,p,I,g,h,y,E,T,b,w,_,S,A,O=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",L=arguments.length>1?arguments[1]:void 0,P=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return O;var D=(null==P?void 0:P.siteName)||"",C=(null==P?void 0:P.contentType)||"video",k=(null==P||null===(o=P[C])||void 0===o?void 0:o.metadata)||(null==P||null===(r=P[C])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.metadata),R=i(L);if(!O.includes("VIEWLIFT_"))return O;var N,F=window.getComputedStyle(document.getElementById(L),null),V=Math.trunc(F.getPropertyValue("height").slice(0,-2)),j=Math.trunc(F.getPropertyValue("width").slice(0,-2)),W="linearchannel"===C?null==P||null===(s=P.linearchannel)||void 0===s||null===(d=s.channels)||void 0===d||null===(u=d.find((function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)})))||void 0===u||null===(c=u.content)||void 0===c?void 0:c.id:ce(P,"video.gist.id",""),M="linearchannel"===C?null==P||null===(v=P.linearchannel)||void 0===v||null===(m=v.channels)||void 0===m||null===(f=m.find((function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)})))||void 0===f?void 0:f.title:ce(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),U=null,B=null;"function"==typeof window.__gpp&&(null===(N=window)||void 0===N||N.__gpp("ping",(function(e){U=null==e?void 0:e.gppString,B=null==e?void 0:e.sectionList[0]})));var x=se(se({},me(k)),{},(_={VIEWLIFT_WIDTH:j,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:de(j,V),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(p=window)||void 0===p?void 0:p.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:ce(P,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:ce(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:ce(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(I=R.options_)||void 0===I?void 0:I.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(g=R.options_)||void 0===g?void 0:g.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D||"usanetwork"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ue(P),VIEWLIFT_MEDIA_ID:W,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(ce(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:W,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+ce(P,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:ce(null===(h=window)||void 0===h||null===(y=h.app_data)||void 0===y||null===(E=y.site)||void 0===E?void 0:E.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==D||"usanetwork"==D?"":ce(null===(T=window)||void 0===T||null===(b=T.app_data)||void 0===b||null===(w=b.site)||void 0===w?void 0:w.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*ce(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:ce(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:W,VIEWLIFT_CONTENT_TITLE:M,VIEWLIFT_CONTENT_SERIES_TITLE:ce(P,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:ce(P,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ae(),VIEWLIFT_SEASON_NUMBER:ie(),VIEWLIFT_CONTENT_TAGS:ue(P),VIEWLIFT_GPP_SID:B||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:U||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(_,"VIEWLIFT_LAT",""),e(_,"VIEWLIFT_APP_BUNDLE",""),e(_,"VIEWLIFT_ATT_CONSENT",""),_),null===(S=window)||void 0===S||null===(A=S.customData)||void 0===A?void 0:A.macros);for(var H in x){var G=new RegExp(H,"g");O=O.replace(G,x[H])}return O},me=function(e){var n,t,o,r,i,a,l={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){s.set(e.name,e.value)})));var d=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,u=(null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(a=i.subscription)||void 0===a?void 0:a.TVE)||!1;return d||u?(oe()?d?l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):u&&(l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):d?l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):u&&(l=se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),d?l=se(se({},l),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):u&&(l=se(se({},l),{},{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),l=oe()?se(se({},l),{},{VIEWLIFT_PROF:s.get("prof.mweb")||""}):se(se({},l),{},{VIEWLIFT_PROF:s.get("prof.web")||""})):(l=se(se({},l),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),l=oe()?se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):se(se({},l),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),l=se(se({},l),{},{VIEWLIFT_AFID:s.get("afid"),VIEWLIFT_NIELSEN_APP_ID:s.get("VIEWLIFT_NIELSEN_APP_ID")||"VIEWLIFT_NIELSEN_APP_ID",VIEWLIFT_CHANNEL:s.get("VIEWLIFT_CHANNEL")||"VIEWLIFT_CHANNEL",VIEWLIFT_GRACE_NOTE_ID:s.get("VIEWLIFT_GRACE_NOTE_ID")||"VIEWLIFT_GRACE_NOTE_ID"})},fe=function(e,n){var t,o,r,i,a,l,s,d,u,c,v,m,f,p=(null==e?void 0:e.contentType)||"video",I=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,g=null==e||null===(o=e[p])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.videoAssets,h=null==e||null===(i=e[p])||void 0===i||null===(a=i.streamingInfo)||void 0===a?void 0:a.audioAssets,y=(null==e||null===(l=e[p])||void 0===l||null===(s=l.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.hls)||!1;null==e||null===(u=e[p])||void 0===u||null===(c=u.liveDetails)||void 0===c||c.isDvrEnabled;var E=(null==e||null===(v=e[p])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(f=m.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=h&&h.hls)return Ie(h);if(I){var T=ge(g,n);return T.src=ve(T.src,n,e),T}if("Safari"!==te()&&E)return pe(g);if(y){var b=Ie(g);return b.src=ve(b.src,n,e),b}if(null!=g&&g.mpeg){var w=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(g);return w.src=ve(w.src,n,e),w}return null},pe=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},Ie=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},ge=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,a=e.widevine,l=e.playReady,s=te();if(i(n),"Safari"===s){var d=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(r,(function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))}))},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,r,i){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(a,(function(e,n,t){console.log(e),e&&i(e),i(null,t)}))}}}}}(r);return he(n),d}var u,c={src:a.url,type:"application/dash+xml"};return"caliente"==(null===(u=window)||void 0===u?void 0:u.siteName)?(he(n),c.keySystems={"com.widevine.alpha":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==l?void 0:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var he=function(e){var n=i(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==te()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},ye=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:o}},Ee=function(e,n){if(import("./error-2395864b.js").then((function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)})),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var r=document.createElement("div");r.className="error-container";var i=document.createElement("div");i.className="error-message",i.innerHTML="".concat(n),r.appendChild(i),o.append(r)}}},Te=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var be=!1,we=function(e,n,t){var o=ve(n,e,t),r=i(e);if(n&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,o,r,a=i(e);if(null!==a.el_){be=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),be&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout((function(){a.ima.setContentWithAdTag(null,n,!0),a.ima.requestAds()}),1e3));var s=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&s.hasAttribute("controls")&&s.removeAttribute("controls");var d="click",u=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(u=!0,d="touchend"),a.one(d,(function(){u&&a.ima.initializeAdDisplayContainer()}));var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.ads)||void 0===r?void 0:r.adEventHandler)||null;a.one("ads-ad-started",(function(){c&&c({status:"STARTED",msg:"Advertisement Started"})})),a.one("ads-manager",(function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})),n.addEventListener(google.ima.AdEvent.Type.LOADED,(function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})}))})),a.on("adserror",(function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})}))}}(e,o)}};function _e(e,n){var t,o,r,a=i(e),l=null==a||null===(t=a.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,s=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",(function(t){var o,r,i,d,u,c,v,m,f;if(Ae.enabled&&"input"!=t.target.localName){var p=t.key,I=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==s||s.focus()),p){case" ":null==l||l.click();break;case"m":case"M":a.muted(!a.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":I&&!1===n.liveui||vn(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(d=i.appcmsMain)||void 0===d||null===(u=d.adsConfig)||void 0===u?void 0:u.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(m=v.appcmsMain)&&void 0!==m&&null!==(f=m.adsConfig)&&void 0!==f&&f.vodAdClientSideTracking)return;I||cn(e,10)}}}),!0)}var Se,Ae=(Se=!0,{enable:function(){Se=!0},disable:function(){Se=!1},get enabled(){return Se}}),Oe="ssai-breakStart",Le="ssai-adImpression",Pe="ssai-firstQuartile",De="ssai-midpoint",Ce="ssai-thirdQuartile",ke="ssai-complete",Re="ssai-breakEnd",Ne={breakStart:Oe,impression:Le,firstQuartile:Pe,midpoint:De,thirdQuartile:Ce,complete:ke,breakEnd:Re};function Fe(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=i(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,r=Ne[o];r&&t.trigger(r,n)}function Ve(e){var n=i(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(Oe,e)},adImpression:function(e){return t(Le,e)},adFirstQuartile:function(e){return t(Pe,e)},adMidpoint:function(e){return t(De,e)},adThirdQuartile:function(e){return t(Ce,e)},adComplete:function(e){return t(ke,e)},adBreakEnd:function(e){return t(Re,e)}}}function je(e){var n=e.isLive,t=e.startTimeInSeconds;return n?analytics.StreamingAnalytics.AdvertisementMetadata.LIVE:0==t?analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_POST_ROLL:!1===t?ns_.analytics.StreamingAnalytics.AdvertisementMetadata.AdvertisementType.ON_DEMAND_POST_ROLL:analytics.StreamingAnalytics.AdvertisementMetadata.ON_DEMAND_MID_ROLL}function We(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!window.analytics)return console.log("is StreamingAnalytics started Initialised?",(console.warn("[Comscore] Tag not initialized."),!1)),void console.warn("[Comscore] Tag not initialized or analytics missing.");var n=window.analytics,t=null;t.notifyPause();var o=new n.StreamingAnalytics.AdvertisementMetadata;o.setMediaType(je({isLive:void 0,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(null),o.setDeliveryType(n.StreamingAnalytics.AdvertisementMetadata.AdvertisementDeliveryType.NATIONAL),o.setPlacementId(e.placementId);var r={cs_ad_tu:null==e?void 0:e.trackingUrl,ns_st_ami:null==e?void 0:e.creativeId};o.addCustomLabels(r),t.setMetadata(o),t.notifyPlay(),console.log("[Comscore] Ad started:",e)}function Me(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}}function Ue(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 Be(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ue(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function xe(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return He(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)?He(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}function He(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}o.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 r=document.createElement("script");r.src=n||"https://appcms.staging.asset.viewlift.com/comscore.js",r.async=!0,document.head.appendChild(r),r.onload=function(){!function(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 r=new o.configuration.PublisherConfiguration({publisherId:String(n),persistentLabels:{cs_ucfr:(null==t?void 0:t.userConsent)||"",cs_fpid:(null==t?void 0:t.userId)||""}});o.configuration.addClient(r),o.configuration.enableFirstPartyCookie(),o.configuration.enableImplementationValidationMode(),o.start(),console.log("[Comscore] Library initialized for publisher:",n),window.analytics=o}({publisherId:e||"40813950"})},r.onerror=function(e){o("Error while loading script ".concat(src," : ").concat(e))}}))}(n.publisherId,n.endpoint)}));var Ge,Qe=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),Ye=(Ge=null,{set:function(e){Ge=e},get position(){return Ge}});function ze(e,n){return qe.apply(this,arguments)}function qe(){return(qe=n(t.mark((function e(n,o){var r,a,l,s,d,u,c,v,m,f,p,I,g,h,E,T,b,w;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(n),l=fe(o,n),s=l.src,d=(null==o?void 0:o.contentType)||"video",u=(null==o||null===(r=o[d])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,c=s.replace("/dash/","/session/").replace("/master/","/session/"),c=ve(c,n,o),v=Ke(c),m=y(v,2),f=m[0],p=m[1],c=new URL(c.split("?")[0]),Object.keys(p).length>0&&Object.entries(p).forEach((function(e){var n=y(e,2),t=n[0],o=n[1];c.searchParams.set(t,o)})),e.prev=10,e.next=13,fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Be({adsParams:Be({},f)},u&&{availSuppression:{mode:"BEHIND_LIVE_EDGE",value:"00:00:00"}}))});case 13:return I=e.sent,e.next=16,I.json();case 16:return g=e.sent,h="https://"+new URL(c).hostname,E=g.trackingUrl,T=g.manifestUrl,b=h+E,w=h+T,Qe.set(b),console.log("%c TRACKING URL","background: #bdf369; color: #000",b),l.src=w,e.abrupt("return",l);case 28:return e.prev=28,e.t0=e.catch(10),e.abrupt("return",l);case 31:case"end":return e.stop()}}),e,null,[[10,28]])})))).apply(this,arguments)}function Ke(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=xe((null==o?void 0:o.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var i=y(t.value,2),a=i[0],l=i[1];n[decodeURIComponent(a)]=decodeURIComponent(l||"")}}catch(e){r.e(e)}finally{r.f()}for(var s={},d={},u=0,c=Object.entries(n);u<c.length;u++){var v=y(c[u],2),m=v[0],f=v[1];if(m.startsWith("ads."))s[m.replace(/^ads\./,"")]=f;else d[m]=f}return[s,d]}var Xe,Je=(Xe=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),Xe=Array.isArray(e)?h(e):Xe},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",Xe),h(Xe)}}),$e=new Map;function Ze(e,n){return en.apply(this,arguments)}function en(){return en=n(t.mark((function e(o,r){var a,l,s,d,u,c,v,m,f,p,g,y,E,T,b,w,_,S,A,O,L,P;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P=function(e,n,t,r,a,l){var s=i(o);if(!s.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(s.currentTime());var d,u=xe(t);try{var c=function(){var t,i,u,c=d.value,v=c.eventType,m=c.beaconUrls,f=c.startTimeInSeconds,p=c.startTime,I=c.durationInSeconds,g=f||0,h=m,y=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(u=i.ads)||void 0===u?void 0:u.adEventHandler)||null,E="".concat(g,"_").concat(v),T=$e.get("pod-".concat(a))||[];if(console.warn(e,g,"map:",v,"condition1:",e>=g,"map:",$e),e>=g&&!T.includes(E)){T.push(E),$e.set("pod-".concat(a),T);try{L(v,n,h,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,v,n)}if("breakEnd"==v){var b=Ye.position;Ye.set(null),setTimeout((function(){null!=b&&(s.currentTime(b),l())}),500)}if("function"==typeof y)try{var w,_={eventType:v,startTimeInSeconds:f,startTime:p,durationInSeconds:I,ad:null==n||null===(w=n.ads)||void 0===w?void 0:w[r],adIndex:r};y({adsData:_}),Fe(o,_)}catch(e){console.error("Error when calling ads callback:",e)}if("impression"===v){var S,A=Qe.get();We(Me(Be(Be({},null==n||null===(S=n.ads)||void 0===S?void 0:S[r]),{},{trackingUrl:A})))}}};for(u.s();!(d=u.n()).done;)c()}catch(e){u.e(e)}finally{u.f()}}},L=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))},O=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},$e.clear(),Ye.set(r),f=Qe.get(),(p=i(o)).one("loadeddata",(function(){f&&A(f)})),g=new Map,y=new Map,E=-1,T=(null===(a=document)||void 0===a||null===(l=a.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==p||null===(s=p.controlBar)||void 0===s?void 0:s.getChild("videoSelector"))||null,w=(null==p||null===(d=p.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,_=(null==p||null===(u=p.el())||void 0===u||null===(c=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,S=(null==p||null===(v=p.el())||void 0===v||null===(m=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,A=function(){var e=n(t.mark((function e(n){var a,l,s,d,u,c,v,m,f,p,A,L,D,C,k,R,N,F,V,j;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return R=function(e){document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",R),0===e.button&&D()},k=function(e){},C=function(){var e,n=p.currentTime(),t=null,o=xe(f);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,a=r.durationInSeconds,l=(r.ads,Math.floor(i+a));n>=i&&n<=l&&(t=l,g.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout((function(){p.currentTime(t+2.2)}),100))},D=function(){var e,n=p.currentTime(),t=null,o=xe(f);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,a=r.durationInSeconds,l=r.ads,s=Math.floor(i+a);(Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n>s||n>i)&&!g.has(i)||n>=i&&n<=s)&&(t=i,g.set(i,!0),y.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout((function(){p.currentTime(t+.4)}),100))},u=!1,e.next=7,fetch(n);case 7:return c=e.sent,e.next=10,c.json();case 10:v=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",v),m=v.avails,f=[],p=i(o),A=p.controlBar.progressControl,L=A.seekBar.el(),null===(a=document)||void 0===a||a.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),m.map((function(e,n){var t,o,r;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(u=!0),f.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(r=o.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===r?void 0:r[0])||[]})})),!u&&r&&(p.currentTime(r),C()),null!=f&&f.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",f),window.adsQueueList=f),console.log(f,"data"),f.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,o=p.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",L.appendChild(i)}})),p._timeUpdateHandler&&p.off("timeupdate",p._timeUpdateHandler),p._timeUpdateHandler=I((function(){var e=p.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=f[o],r=t.startTimeInSeconds,i=t.durationInSeconds,a=t.ads,l=r+i;if(e>=r-1.2&&e<=l+1.2){e>=r&&e<=l&&Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n=!0),e>l&&g.set(r,!0),Ae.disable(),T&&T.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),w&&(w.el().style.pointerEvents="none",w.el().classList.add("vjs-hidden")),A.el().classList.add("hide-progress-bar");for(var s=e-r,d=0,u=0,c=0;c<a.length;c++){var v,m=null==a||null===(v=a[c])||void 0===v?void 0:v.durationInSeconds;if(s<d+m){u=c;break}d+=m}a[u];var p=Math.max(0,i-s),I=Math.round(p);N.style.display="block",j.textContent="".concat(u+1," of ").concat(a.length," • ").concat(O(I));var E=[];return null==a||a.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));E.push.apply(E,h(n))})),Array.isArray(a)&&0==(null==a?void 0:a.length)&&E.push(null==t?void 0:t.podSlotImpressionBeacon),P(e,t,E,u,o,C),"break"}y.delete(r)},o=0;o<f.length;o++){if("break"===t())break}n||(N.style.display="none",A.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),w&&(w.el().style.pointerEvents="auto",w.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),Ae.enable())}}),1e3),p.on("timeupdate",p._timeUpdateHandler),null===(l=document)||void 0===l||l.addEventListener("keydown",(function(e){Ae.enabled&&"ArrowRight"==e.key&&(D(),cn(o,10),e.stopPropagation())})),A.el().addEventListener("pointerdown",(function(e){0===e.button&&(document.addEventListener("pointermove",k),document.addEventListener("pointerup",R))})),null===(s=document)||void 0===s||null===(d=s.querySelectorAll(".ssai-ad-container"))||void 0===d||d.forEach((function(e){return null==e?void 0:e.remove()})),(N=document.createElement("div")).className="ssai-ad-container",(F=document.createElement("div")).className="sponsored-adbox",(V=document.createElement("div")).className="sponsored-text",V.textContent="Sponsored Ad",F.append(V),(j=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",N.append(F),N.append(j),p.el().appendChild(N);case 45:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();case 18:case"end":return e.stop()}}),e)}))),en.apply(this,arguments)}function nn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return tn(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?tn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}function tn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var on={},rn=null;function an(e){return ln.apply(this,arguments)}function ln(){return ln=n(t.mark((function e(o){var r,a,l,s,d,u,c,v,m,f,p,g,y,E,T,b,w,_,S,A,O,L,P,D,C,k;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k=function(e,n,t,r,a){var l=i(o);if(!l.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(l.currentTime());var s,d=nn(t);try{for(d.s();!(s=d.n()).done;){var u,c,v,m=s.value,f=m.eventType,p=m.beaconUrls,I=m.startTimeInSeconds,g=m.startTime,h=m.durationInSeconds,y=I||0,E=p,T=(null===(u=window)||void 0===u||null===(c=u.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.adEventHandler)||null,b="".concat(y,"_").concat(f),w=P.get("pod-".concat(a))||[];if(console.warn(e,y,"map:",f,"condition1:",e>=y,"map:",P),e>=y&&e<=y+D&&!w.includes(b)){w.push(b),P.set("pod-".concat(a),w);try{C(f,n,E,l)}catch(e){console.error("Error when calling triggerAdBeacon:",e,f,n)}if("function"==typeof T)try{var _,S={eventType:f,startTimeInSeconds:I,startTime:g,durationInSeconds:h,ad:null==n||null===(_=n.ads)||void 0===_?void 0:_[r],adIndex:r};T({adsData:S}),Fe(o,S)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){d.e(e)}finally{d.f()}}},C=function(e,n,t,o){var r,i;"breakEnd"!==e||(null===(r=on)||void 0===r?void 0:r.currentAdIndex)+1==(null===(i=on)||void 0===i?void 0:i.totalAds)?(console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))):console.log("SKIPPED FROM FIRING")},p=function(){rn&&clearInterval(rn)},m=Qe.get(),(f=i(o)).one("loadeddata",(function(){p(),rn=setInterval((function(){m&&!f.paused()&&L(m)}),2e3)})),f.on("dispose",(function(){p()})),g=new Map,y=new Map,E=-1,T=null,b=(null===(r=document)||void 0===r||null===(a=r.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,w=(null==f||null===(l=f.controlBar)||void 0===l?void 0:l.getChild("videoSelector"))||null,_=(null==f||null===(s=f.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,S=(null==f||null===(d=f.el())||void 0===d||null===(u=d.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===u?void 0:u[0])||null,A=(null==f||null===(c=f.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===v?void 0:v[0])||null,O=!1,L=function(){var e=n(t.mark((function e(n){var r,a,l,s,d,u,c,v,m,f;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=new URL(n),T&&a.searchParams.append("nextToken",T),e.next=4,fetch(a.toString(),{method:"GET"});case 4:return l=e.sent,e.next=7,l.json();case 7:s=e.sent,d=s.avails,u=s.nextToken||null,T=u,c=[],v=i(o),m=v.controlBar.progressControl,f=m.seekBar.el(),null===(r=document)||void 0===r||r.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),d.map((function(e,n){var t,o;c.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(t=e.adBreakTrackingEvents)||void 0===t||null===(o=t.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===o?void 0:o[0])||[]})})),console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),null!=c&&c.length&&(window.adsQueueList=c),c.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,o=v.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",f.appendChild(i)}})),v._timeUpdateHandler&&v.off("timeupdate",v._timeUpdateHandler),v._timeUpdateHandler=I((function(){var e=v.currentTime();if(e!==E){E=e;for(var n=function(){var n=c[t],o=n.startTimeInSeconds,r=n.durationInSeconds,i=n.ads,a=o+r;if(e>=o-1.2&&e<=a+1.2){O=!!(e>=o&&e<=a&&Array.isArray(i)&&(null==i?void 0:i.length)>0),e>a&&g.set(o,!0),Ae.disable(),b&&b.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),A&&(A.style.pointerEvents="none",A.classList.add("vjs-hidden")),w&&(w.el().style.pointerEvents="none",w.el().classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),m.el().classList.add("hide-progress-bar");for(var l=e-o,s=0,d=0,u=0;u<i.length;u++){var v,f=null==i||null===(v=i[u])||void 0===v?void 0:v.durationInSeconds;if(l<s+f){d=u;break}s+=f}setTimeout((function(){on.totalAds=null==i?void 0:i.length,on.currentAdIndex=d}),1e3);var p=[];return null==i||i.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));p.push.apply(p,h(n))})),Array.isArray(i)&&0==(null==i?void 0:i.length)&&p.push(null==n?void 0:n.podSlotImpressionBeacon),k(e,n,p,d,t),"break"}y.delete(o)},t=0;t<c.length;t++){if("break"===n())break}O||(on={},m.el().classList.remove("hide-progress-bar"),w&&(w.el().style.pointerEvents="auto",w.el().classList.remove("vjs-hidden")),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),b&&b.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),A&&(A.style.pointerEvents="auto",A.classList.remove("vjs-hidden")),Ae.enable())}}),1e3),v.on("timeupdate",v._timeUpdateHandler);case 23:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),P=new Map,D=2.5;case 21:case"end":return e.stop()}}),e)}))),ln.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}var dn=function(e){o(e).play()},un=function(e){o(e).pause()},cn=function(e,n){var t=o(e),r=t.currentTime()+n;t.currentTime(r)},vn=function(e,n){var t=o(e),r=t.currentTime(),i=r<=n?0:r-n;t.currentTime(i)},mn=function(e){return!!o.getPlayer("".concat(e))},fn=function(e){return o(e).paused()},pn=function(){var e=n(t.mark((function e(o,r){var a,l,s,d=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=d.length>2&&void 0!==d[2]&&d[2],e.next=3,B();case 3:return l=e.sent,s=i(o),e.abrupt("return",new Promise((function(e,i){var d=(null==r?void 0:r.programs)||[];null==r||delete r.programs,P(r,l).then(function(){var i=n(t.mark((function n(i){var l,u,v,f,p,I,g,h;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(I=null==i?void 0:i.data,window.sid=q(),I.contentType="linearchannel",I.channelId=null==r?void 0:r.channelId,g=(null==I||null===(l=I.linearchannel)||void 0===l?void 0:l.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(u=window)||void 0===u||null===(v=u.app_data)||void 0===v||null===(f=v.appcmsMain)||void 0===f||null===(p=f.adsConfig)||void 0===p?void 0:p.vodAdSticherProvider)||!1,h=fe(I,o),!g){n.next=11;break}return n.next=9,ze(o,I);case 9:h=n.sent,a=!0;case 11:c(I),m(d),sessionStorage.setItem("program_switched",!0),h&&a?(En(o,h),g&&an(o),s.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:I})}))):e({status:!0,msg:"Feed authenticated",response:I});case 15:case"end":return n.stop()}}),n)})));return function(e){return i.apply(this,arguments)}}()).catch((function(e){i({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),In=function(){var e=n(t.mark((function e(o,r,a){var l,s,u,m,I,g,h;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return m=e.sent,(d()||null)&&v(r),I=0,g=0,h=null,null!==(l=window)&&void 0!==l&&l.watchHistory&&null!==(s=window)&&void 0!==s&&null!==(u=s.watchHistory)&&void 0!==u&&u.enable&&k(r,m).then((function(e){var n,t,o,r,i,a,l;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),I=(null==e||null===(i=e.data)||void 0===i?void 0:i.watchedTime)||null,(g=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null)<95)&&(h=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null)})).catch((function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))})),e.abrupt("return",new Promise((function(e,a){L(r,m).then(function(){var r=n(t.mark((function n(r){var l,s,d,u,v,m,y,E,T,b,w,_,S,A,O,L,P,D,C,k,R,N,F,V,j,W,M,U,B,x,H,G,Q,Y,z,q,K,X;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(L=null==r?void 0:r.data,P=(null==L?void 0:L.contentType)||"video",D=(null==L||null===(l=L[P])||void 0===l?void 0:l.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(u=d.appcmsMain)||void 0===u||null===(v=u.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,C=(null==L||null===(m=L.video)||void 0===m||null===(y=m.streamingInfo)||void 0===y?void 0:y.isLiveStream)||!1,c(r.data),(k=(null==L||null===(E=L.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(b=T.adTags)||void 0===b||null===(w=b.web)||void 0===w?void 0:w.active)&&(null==L||null===(_=L.ads)||void 0===_||null===(S=_.preRoll)||void 0===S||null===(A=S.adTags)||void 0===A||null===(O=A.web)||void 0===O?void 0:O.url))&&we(o,k,L),R=fe(L,o),!D){n.next=12;break}return n.next=11,ze(o,L);case 11:R=n.sent;case 12:R?(G=(null==L||null===(N=L.video)||void 0===N||null===(F=N.gist)||void 0===F?void 0:F.videoImageUrl)||(null==L||null===(V=L.video)||void 0===V||null===(j=V.gist)||void 0===j||null===(W=j.imageGist)||void 0===W?void 0:W.r16x9),(Q=i(o)).poster(G),En(o,R),D&&Ze(o,h),Q.on("loadstart",(function(){C&&e({status:!0,msg:"Video Loaded",response:L})})),Q.on("loadeddata",(function(){Te(),e({status:!0,msg:"Video Loaded",response:L})})),Q.one("play",(function(){I&&!D&&g<95&&setTimeout((function(){Q.currentTime(I)}),0)})),Q.one("error",(function(){var e;a({status:!1,msg:(null==Q||null===(e=Q.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==L||null===(M=L.video)||void 0===M||null===(U=M.contentDetails)||void 0===U||null===(B=U.closedCaptions)||void 0===B?void 0:B.length)>0||(null==L||null===(x=L.video)||void 0===x||null===(H=x.closedCaptions)||void 0===H?void 0:H.length)>0?(X=(null==L||null===(z=L.video)||void 0===z||null===(q=z.contentDetails)||void 0===q?void 0:q.closedCaptions)||(null==L||null===(K=L.video)||void 0===K?void 0:K.closedCaptions),Y=X.filter((function(e){return"VTT"===e.format})),f(o,Y)):p(o)):(Ee(o,"Incompatible Source, only hls,mp4,drm content is allowed"),a("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}}),n)})));return function(e){return r.apply(this,arguments)}}()).catch((function(e){Tn(e,o,a,r)}))})));case 10:case"end":return e.stop()}}),e)})));return function(n,t,o){return e.apply(this,arguments)}}(),gn=function(e,n,t){var o=i(e);return o.src(n),new Promise((function(e,n){var r=0;o.one("loadedmetadata",(function(){clearTimeout(r),e({status:!0,msg:"video loaded"})})),o.one("loadstart",(function(e){r=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},hn=function(e){var n=i(e);if(yn(),g(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},yn=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},En=function(e,n){var t=i(e);t&&t.src(n)},Tn=function(n,t,o,r){var i,a,l,s,d,u,c=null==n||null===(i=n.response)||void 0===i||null===(a=i.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(s=l.data)||void 0===s?void 0:s.errorMessage)||(null==n?void 0:n.message);mn(t)&&Ee(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?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}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))},bn=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")};export{vn as A,mn as B,In as C,pn as D,hn as E,F,Je as G,Ve as H,N as I,x as J,W as K,V as L,T as M,$e as N,_e as O,oe as P,fn as Q,an as R,Ze as S,R as T,ae as a,ie as b,fe as c,te as d,Te as e,bn as f,K as g,Ee as h,ne as i,we as j,ye as k,En as l,ze as m,H as n,L as o,k as p,Tn as q,B as r,C as s,P as t,D as u,re as v,gn as w,cn as x,dn as y,un as z};
|
|
@@ -0,0 +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&<(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 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./player_instance-34118a5b.js";import{j as n,g as r,a as i}from"./currentVideoInfo-a8a254c2.js";import{s as o}from"./autoNextVideo-36b258d2.js";import{e as a}from"./icons-37daa6b3.js";import{p as l,d as u,t as s}from"./skin-d5091b86.js";import c from"@babel/runtime/helpers/typeof";import d from"video.js";import p from"@babel/runtime/helpers/asyncToGenerator";import m from"@babel/runtime/regenerator";import v from"@babel/runtime/helpers/defineProperty";import f from"@babel/runtime/helpers/slicedToArray";var g,h,b,y,x=[],w=!1,E=function(i,o){var s;if(w=!1,null!=o&&null!==(s=o.series)&&void 0!==s&&s.enable){var c;x=[];var d=r();null==d||d.map((function(t){var n;return(n=x).push.apply(n,e(t.episodes))})),null==o||null===(c=o.series)||void 0===c||c.cb}else{var p,m;x=(null==o||null===(p=o.relatedVideos)||void 0===p?void 0:p.content)||[],null==o||null===(m=o.relatedVideos)||void 0===m||m.cb}var v=t(i);v.on("timeupdate",(function(){var e,t;if(!w){var r=Math.floor(v.currentTime()),i=v.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=x)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}}));var f,g=x.filter((function(e,t){return t==n()}));if((null==g?void 0:g.length)>0)if(null!==(f=document.getElementsByClassName("next-ep-preview"))&&void 0!==f&&f[0]){var h,b,y,E,N,j,k,C,O,T,I,B;(null===(h=document.getElementsByClassName("next-ep-preview"))||void 0===h?void 0:h[0]).style.visibility="hidden";var L=null===(b=document.getElementsByClassName("next-ep-title"))||void 0===b?void 0:b[0],S=null===(y=document.getElementsByClassName("next-ep-img"))||void 0===y?void 0:y[0],M=null===(E=document.getElementsByClassName("next-ep-content"))||void 0===E?void 0:E[0],P=null===(N=g[0])||void 0===N?void 0:N.title;(null===(j=P)||void 0===j?void 0:j.length)>60&&(P=P.substr(0,60)+"..."),L.textContent="".concat(P),S.src=(null===(k=g[0])||void 0===k||null===(C=k.gist)||void 0===C||null===(O=C.imageGist)||void 0===O?void 0:O.r16x9)||(null==g||null===(T=g[0])||void 0===T?void 0:T.img)||(null===(I=window)||void 0===I||null===(B=I.customData)||void 0===B?void 0:B.fallbackImage),M.onclick=function(){return A(i)}}else{var R,D,$,X,F,U,_,G,q=document.createElement("div");q.className="next-ep-preview",q.style.visibility="hidden",document.getElementById(i).append(q);var V=document.createElement("div");V.className="next-heading-wrapper";var W=document.createElement("div");W.className="next-ep-header",W.textContent="Next up";var z=document.createElement("div");z.className="next-ep-close",z.onclick=function(){q.style.visibility="hidden",w=!0},z.appendChild(l(a())),V.append(W),V.append(z);var H=null===(R=g[0])||void 0===R?void 0:R.title,Q=document.createElement("img");Q.className="next-ep-img",Q.src=(null===(D=g[0])||void 0===D||null===($=D.gist)||void 0===$||null===(X=$.imageGist)||void 0===X?void 0:X.r16x9)||(null==g||null===(F=g[0])||void 0===F?void 0:F.img)||(null===(U=window)||void 0===U||null===(_=U.customData)||void 0===_?void 0:_.fallbackImage);var Y=document.createElement("div");Y.className="next-ep-title",(null===(G=H)||void 0===G?void 0:G.length)>60&&(H=H.substr(0,60)+"..."),Y.textContent="".concat(H);var J=document.createElement("div");J.className="next-ep-content",J.append(Q),J.append(Y),J.onclick=u((function(){null==q||q.remove(),w=!0,A(i)}),400),q.append(V),q.append(J)}},A=function(e,r){var i=t(e),a=Math.floor(i.currentTime());if(Math.floor(i.duration())!=a){i.pause(e);var l=n();o(l,e,x)}};function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}g={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},h=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===c(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},b=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},y=function e(t){return"HTML"!==t.nodeName&&"static"===b(t)("position")?e(t.offsetParent):t},d.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=h({},g,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",h(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",(function(e){a=i.duration()})),i.on("loadedmetadata",(function(e){a=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,m,v,f;for(l in u=0,v=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((f=y(o.el()).getBoundingClientRect()).width||f.right)+v,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=y(o.el()).getBoundingClientRect().left+v,i=Math.floor((s-o.el().offsetLeft)/o.width()*a),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&h(r.style,c.style),s+(m=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=b(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+m-p:s<m&&(s=m),t.style.left=s+"px"},o.on("mousemove",l),o.on("touchmove",l),o.on("pointerdown",(function(e){document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)})),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var k="my-player";function C(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function O(){return(O=p(m.mark((function e(t){var n,r,i,o,a,l,u,s,c,d,p,v,g,h,b,y,x,w,E,A,N,j,k,C;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,o=t.layout.split("x").map(Number),a=f(o,2),l=a[0],u=a[1],s=i.width/u,c=i.height/l,d=[],p=0;p<l;p++)for(v=0;v<u;v++)(g=document.createElement("canvas")).width=s,g.height=c,g.getContext("2d").drawImage(i,v*s,p*c,s,c,0,0,s,c),h=g.toDataURL("image/png"),d.push({uri:h,duration:t.duration}),t._tiles=d;return e.abrupt("return",d);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=f(b,2),x=y[0],w=y[1],E=[],A=0;A<x*w;A++)E.push({uri:null===(N=window)||void 0===N||null===(j=N.app_data)||void 0===j||null===(k=j.appcmsMain)||void 0===k||null===(C=k.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",E);case 26:case"end":return e.stop()}}),e,null,[[2,20]])})))).apply(this,arguments)}function T(e,t){return I.apply(this,arguments)}function I(){return(I=p(m.mark((function e(t,n){var r,i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",C(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}}),e,null,[[1,11]])})))).apply(this,arguments)}function B(e,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),o=t(k);if(i&&o){var a=i.getBoundingClientRect(),l=(e.clientX-a.left)/a.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,o=t.length-1;for(;i<=o;){var a=Math.floor((i+o)/2),l=t[a];if(l===e)return l;l<e?i=a+1:o=a-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[o])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*o.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return O.apply(this,arguments)}(s).then((function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri})))}}function L(e){return S.apply(this,arguments)}function S(){return(S=p(m.mark((function e(t){var n,r,i,o;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t.forEach((function(e,t){for(var r=e.layout.split("x").map(Number),i=f(r,2),o=i[0]*i[1],a=e.duration,l=0;l<o;l++){var u,s=Math.round((t*o+l)*a);n[s]=j(j({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},v(u,"left","-60px"),v(u,"border","1px solid transparent"),v(u,"borderRadius","4px"),u)})}})),r=Object.keys(n).map(Number).sort((function(e,t){return e-t})),null==(i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||i.addEventListener("mousemove",s((function(e){return B(e,n,r)}),500)),null==(o=document.querySelector(".vjs-progress-control.vjs-control"))||o.addEventListener("pointerdown",(function(e){document.addEventListener("pointermove",s((function(e){return B(e,n,r)}),500))})),e.abrupt("return",n);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var M=function(){var e=p(m.mark((function e(t,n){var r,i,o,a,l,u,s,c;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:i=e.sent,o=i.split("\n").map((function(e){return e.trim()})),a=[],l=null,u=0;case 10:if(!(u<(null==o?void 0:o.length))){e.next=27;break}if(!(s=o[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},c=s.split(":")[1]||"",c.split(",").forEach((function(e){var t=e.split("="),n=f(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())})),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(l.uri=s.includes("http")?s:t+s,a.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function P(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function R(e,t){return D.apply(this,arguments)}function D(){return(D=p(m.mark((function e(n,r){var o,a,l,u,s,c,d,p,v,g,h,b,y,x,w,E,A,N,j,C,O,T,I,B,L,S,M,R,D,F,U,_,G,q,V,W,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,oe,ae,le,ue,se,ce,de,pe,me,ve;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k=r,o=t(r),a=n.split("/"),l=a.findIndex((function(e){return"dash"===e.toLowerCase()})),u=P(-1!==l?a.slice(0,l+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return p=e.sent,e.next=11,p.text();case 11:v=e.sent,g=new DOMParser,h=g.parseFromString(v,"application/xml"),b=(null==o?void 0:o.duration())||(null===(s=i())||void 0===s||null===(c=s.video)||void 0===c?void 0:c.runtime),y=(null==h||null===(d=h.querySelector("MPD > BaseURL"))||void 0===d?void 0:d.textContent)||u+"/",x=h.getElementsByTagName("AdaptationSet"),w=0;case 18:if(!(w<x.length)){e.next=72;break}if(("image"!==(E=x[w]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(N=E.getElementsByTagName("SegmentTemplate")[0],j=null===(A=N.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!N||!j){e.next=48;break}if(T=j.getElementsByTagName("S"),I=parseInt(null===(C=T[0])||void 0===C?void 0:C.getAttribute("t")),B=parseInt(null===(O=T[0])||void 0===O?void 0:O.getAttribute("d")),L=E.getElementsByTagName("Representation")[0],S=L.getElementsByTagName("EssentialProperty")[0],M=S.getAttribute("value"),R=null==M?void 0:M.split("x"),D=f(R,2),F=D[0],U=D[1],!N){e.next=46;break}if(N.getAttribute("media"),_=N.getAttribute("timescale"),G=(_?B/_:B)/(F*U),q=L.getAttribute("id"),V=Math.round(b/G),W=Math.ceil(V/(F*U)),z=N.getAttribute("media"),parseInt(N.getAttribute("startNumber")),!isNaN(parseInt(W))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],w=0;w<W;w++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:G,layout:M,uri:Y+Q.replace("$Time$",I+w*B).replace("$RepresentationID$",q)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=f(ee,2),ne=te[0],re=te[1],!N){e.next=69;break}if(N.getAttribute("media"),ie=N.getAttribute("duration"),oe=N.getAttribute("timescale"),ae=(oe?ie/oe:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/ae),se=Math.ceil(ue/(ne*re)),ce=N.getAttribute("media"),de=parseInt(N.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],me=$(ce),w=0;w<se;w++)ve=me?X(me,w+de):ce,pe.push({duration:ae,layout:Z,uri:y+ve.replace("$Number$",w+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:w++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}}),e,null,[[5,76]])})))).apply(this,arguments)}function $(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function X(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function F(e){return U.apply(this,arguments)}function U(){return(U=p(m.mark((function e(n){var r,i,o,a,l,u,s,c,d,p,v,f,g,h,b,y;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),s=u.currentSource(),c=s.src,c=null!==(r=c)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():c,null===(a=c)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,T(c,n);case 6:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=17;break}return p=(null==d?void 0:d[0])||null,v=p.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,M(f,v);case 12:return g=e.sent,e.next=15,L(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(l=c)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,R(c,n);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,L(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",(function(){o.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||o.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}export{E as a,_ as b,F as i};
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./player_instance-34118a5b.js";import{j as n,g as r,a as i}from"./currentVideoInfo-a8a254c2.js";import{s as o}from"./autoNextVideo-b2b1dcef.js";import{e as a}from"./icons-37daa6b3.js";import{p as l,d as u,t as s}from"./skin-d5091b86.js";import c from"@babel/runtime/helpers/typeof";import d from"video.js";import p from"@babel/runtime/helpers/asyncToGenerator";import m from"@babel/runtime/regenerator";import v from"@babel/runtime/helpers/defineProperty";import f from"@babel/runtime/helpers/slicedToArray";var g,h,b,y,x=[],w=!1,E=function(i,o){var s;if(w=!1,null!=o&&null!==(s=o.series)&&void 0!==s&&s.enable){var c;x=[];var d=r();null==d||d.map((function(t){var n;return(n=x).push.apply(n,e(t.episodes))})),null==o||null===(c=o.series)||void 0===c||c.cb}else{var p,m;x=(null==o||null===(p=o.relatedVideos)||void 0===p?void 0:p.content)||[],null==o||null===(m=o.relatedVideos)||void 0===m||m.cb}var v=t(i);v.on("timeupdate",(function(){var e,t;if(!w){var r=Math.floor(v.currentTime()),i=v.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=x)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}}));var f,g=x.filter((function(e,t){return t==n()}));if((null==g?void 0:g.length)>0)if(null!==(f=document.getElementsByClassName("next-ep-preview"))&&void 0!==f&&f[0]){var h,b,y,E,N,j,k,C,O,T,I,B;(null===(h=document.getElementsByClassName("next-ep-preview"))||void 0===h?void 0:h[0]).style.visibility="hidden";var L=null===(b=document.getElementsByClassName("next-ep-title"))||void 0===b?void 0:b[0],S=null===(y=document.getElementsByClassName("next-ep-img"))||void 0===y?void 0:y[0],M=null===(E=document.getElementsByClassName("next-ep-content"))||void 0===E?void 0:E[0],P=null===(N=g[0])||void 0===N?void 0:N.title;(null===(j=P)||void 0===j?void 0:j.length)>60&&(P=P.substr(0,60)+"..."),L.textContent="".concat(P),S.src=(null===(k=g[0])||void 0===k||null===(C=k.gist)||void 0===C||null===(O=C.imageGist)||void 0===O?void 0:O.r16x9)||(null==g||null===(T=g[0])||void 0===T?void 0:T.img)||(null===(I=window)||void 0===I||null===(B=I.customData)||void 0===B?void 0:B.fallbackImage),M.onclick=function(){return A(i)}}else{var R,D,$,X,F,U,_,G,q=document.createElement("div");q.className="next-ep-preview",q.style.visibility="hidden",document.getElementById(i).append(q);var V=document.createElement("div");V.className="next-heading-wrapper";var W=document.createElement("div");W.className="next-ep-header",W.textContent="Next up";var z=document.createElement("div");z.className="next-ep-close",z.onclick=function(){q.style.visibility="hidden",w=!0},z.appendChild(l(a())),V.append(W),V.append(z);var H=null===(R=g[0])||void 0===R?void 0:R.title,Q=document.createElement("img");Q.className="next-ep-img",Q.src=(null===(D=g[0])||void 0===D||null===($=D.gist)||void 0===$||null===(X=$.imageGist)||void 0===X?void 0:X.r16x9)||(null==g||null===(F=g[0])||void 0===F?void 0:F.img)||(null===(U=window)||void 0===U||null===(_=U.customData)||void 0===_?void 0:_.fallbackImage);var Y=document.createElement("div");Y.className="next-ep-title",(null===(G=H)||void 0===G?void 0:G.length)>60&&(H=H.substr(0,60)+"..."),Y.textContent="".concat(H);var J=document.createElement("div");J.className="next-ep-content",J.append(Q),J.append(Y),J.onclick=u((function(){null==q||q.remove(),w=!0,A(i)}),400),q.append(V),q.append(J)}},A=function(e,r){var i=t(e),a=Math.floor(i.currentTime());if(Math.floor(i.duration())!=a){i.pause(e);var l=n();o(l,e,x)}};function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}g={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},h=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===c(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},b=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},y=function e(t){return"HTML"!==t.nodeName&&"static"===b(t)("position")?e(t.offsetParent):t},d.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=h({},g,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",h(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",(function(e){a=i.duration()})),i.on("loadedmetadata",(function(e){a=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,m,v,f;for(l in u=0,v=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((f=y(o.el()).getBoundingClientRect()).width||f.right)+v,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=y(o.el()).getBoundingClientRect().left+v,i=Math.floor((s-o.el().offsetLeft)/o.width()*a),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&h(r.style,c.style),s+(m=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=b(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+m-p:s<m&&(s=m),t.style.left=s+"px"},o.on("mousemove",l),o.on("touchmove",l),o.on("pointerdown",(function(e){document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)})),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var k="my-player";function C(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function O(){return(O=p(m.mark((function e(t){var n,r,i,o,a,l,u,s,c,d,p,v,g,h,b,y,x,w,E,A,N,j,k,C;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,o=t.layout.split("x").map(Number),a=f(o,2),l=a[0],u=a[1],s=i.width/u,c=i.height/l,d=[],p=0;p<l;p++)for(v=0;v<u;v++)(g=document.createElement("canvas")).width=s,g.height=c,g.getContext("2d").drawImage(i,v*s,p*c,s,c,0,0,s,c),h=g.toDataURL("image/png"),d.push({uri:h,duration:t.duration}),t._tiles=d;return e.abrupt("return",d);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=f(b,2),x=y[0],w=y[1],E=[],A=0;A<x*w;A++)E.push({uri:null===(N=window)||void 0===N||null===(j=N.app_data)||void 0===j||null===(k=j.appcmsMain)||void 0===k||null===(C=k.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",E);case 26:case"end":return e.stop()}}),e,null,[[2,20]])})))).apply(this,arguments)}function T(e,t){return I.apply(this,arguments)}function I(){return(I=p(m.mark((function e(t,n){var r,i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",C(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}}),e,null,[[1,11]])})))).apply(this,arguments)}function B(e,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),o=t(k);if(i&&o){var a=i.getBoundingClientRect(),l=(e.clientX-a.left)/a.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,o=t.length-1;for(;i<=o;){var a=Math.floor((i+o)/2),l=t[a];if(l===e)return l;l<e?i=a+1:o=a-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[o])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*o.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return O.apply(this,arguments)}(s).then((function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri})))}}function L(e){return S.apply(this,arguments)}function S(){return(S=p(m.mark((function e(t){var n,r,i,o;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t.forEach((function(e,t){for(var r=e.layout.split("x").map(Number),i=f(r,2),o=i[0]*i[1],a=e.duration,l=0;l<o;l++){var u,s=Math.round((t*o+l)*a);n[s]=j(j({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},v(u,"left","-60px"),v(u,"border","1px solid transparent"),v(u,"borderRadius","4px"),u)})}})),r=Object.keys(n).map(Number).sort((function(e,t){return e-t})),null==(i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||i.addEventListener("mousemove",s((function(e){return B(e,n,r)}),500)),null==(o=document.querySelector(".vjs-progress-control.vjs-control"))||o.addEventListener("pointerdown",(function(e){document.addEventListener("pointermove",s((function(e){return B(e,n,r)}),500))})),e.abrupt("return",n);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var M=function(){var e=p(m.mark((function e(t,n){var r,i,o,a,l,u,s,c;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:i=e.sent,o=i.split("\n").map((function(e){return e.trim()})),a=[],l=null,u=0;case 10:if(!(u<(null==o?void 0:o.length))){e.next=27;break}if(!(s=o[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},c=s.split(":")[1]||"",c.split(",").forEach((function(e){var t=e.split("="),n=f(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())})),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(l.uri=s.includes("http")?s:t+s,a.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function P(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function R(e,t){return D.apply(this,arguments)}function D(){return(D=p(m.mark((function e(n,r){var o,a,l,u,s,c,d,p,v,g,h,b,y,x,w,E,A,N,j,C,O,T,I,B,L,S,M,R,D,F,U,_,G,q,V,W,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,oe,ae,le,ue,se,ce,de,pe,me,ve;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k=r,o=t(r),a=n.split("/"),l=a.findIndex((function(e){return"dash"===e.toLowerCase()})),u=P(-1!==l?a.slice(0,l+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return p=e.sent,e.next=11,p.text();case 11:v=e.sent,g=new DOMParser,h=g.parseFromString(v,"application/xml"),b=(null==o?void 0:o.duration())||(null===(s=i())||void 0===s||null===(c=s.video)||void 0===c?void 0:c.runtime),y=(null==h||null===(d=h.querySelector("MPD > BaseURL"))||void 0===d?void 0:d.textContent)||u+"/",x=h.getElementsByTagName("AdaptationSet"),w=0;case 18:if(!(w<x.length)){e.next=72;break}if(("image"!==(E=x[w]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(N=E.getElementsByTagName("SegmentTemplate")[0],j=null===(A=N.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!N||!j){e.next=48;break}if(T=j.getElementsByTagName("S"),I=parseInt(null===(C=T[0])||void 0===C?void 0:C.getAttribute("t")),B=parseInt(null===(O=T[0])||void 0===O?void 0:O.getAttribute("d")),L=E.getElementsByTagName("Representation")[0],S=L.getElementsByTagName("EssentialProperty")[0],M=S.getAttribute("value"),R=null==M?void 0:M.split("x"),D=f(R,2),F=D[0],U=D[1],!N){e.next=46;break}if(N.getAttribute("media"),_=N.getAttribute("timescale"),G=(_?B/_:B)/(F*U),q=L.getAttribute("id"),V=Math.round(b/G),W=Math.ceil(V/(F*U)),z=N.getAttribute("media"),parseInt(N.getAttribute("startNumber")),!isNaN(parseInt(W))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],w=0;w<W;w++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:G,layout:M,uri:Y+Q.replace("$Time$",I+w*B).replace("$RepresentationID$",q)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=f(ee,2),ne=te[0],re=te[1],!N){e.next=69;break}if(N.getAttribute("media"),ie=N.getAttribute("duration"),oe=N.getAttribute("timescale"),ae=(oe?ie/oe:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/ae),se=Math.ceil(ue/(ne*re)),ce=N.getAttribute("media"),de=parseInt(N.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],me=$(ce),w=0;w<se;w++)ve=me?X(me,w+de):ce,pe.push({duration:ae,layout:Z,uri:y+ve.replace("$Number$",w+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:w++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}}),e,null,[[5,76]])})))).apply(this,arguments)}function $(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function X(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function F(e){return U.apply(this,arguments)}function U(){return(U=p(m.mark((function e(n){var r,i,o,a,l,u,s,c,d,p,v,f,g,h,b,y;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),s=u.currentSource(),c=s.src,c=null!==(r=c)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():c,null===(a=c)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,T(c,n);case 6:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=17;break}return p=(null==d?void 0:d[0])||null,v=p.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,M(f,v);case 12:return g=e.sent,e.next=15,L(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(l=c)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,R(c,n);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,L(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",(function(){o.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||o.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}export{E as a,_ as b,F as i};
|
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-
|
|
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";
|