@viewlift/player-backup 2.0.372-backup → 2.0.374-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-1de87b37.js → autoNextVideo-5e7d8d82.js} +1 -1
- package/cjs/browser-3670a923.js +1 -0
- package/cjs/bundle.css +91 -4
- package/cjs/{caption-settings-2e123c0a.js → caption-settings-ab12e597.js} +1 -1
- package/cjs/features-cbd3ffbc.js +1 -0
- package/cjs/generic-c7514457.js +1 -0
- package/cjs/{icons-eb807ef0.js → icons-437e83c9.js} +1 -1
- package/cjs/index-229e6633.js +1 -0
- package/cjs/{index-9f6ff3ce.js → index-7808bb34.js} +1 -1
- package/cjs/{index-6c930113.js → index-bd2cea3b.js} +1 -1
- package/cjs/{index-13c964bd.js → index-c012f460.js} +1 -1
- package/cjs/index-d6a9396e.js +1 -0
- package/cjs/index-e6d4964c.js +1 -0
- package/cjs/index.js +1 -1
- package/cjs/manager-2b3a6487.js +1 -0
- package/cjs/multicamv2-c45a26f8.js +1 -0
- package/cjs/multicamv2-f76b2b38.js +1 -0
- package/cjs/nextEpisodeButton-be60b6d5.js +1 -0
- package/cjs/playerControlEvents-dff5ab1f.js +1 -0
- package/cjs/playlist-5217569f.js +1 -0
- package/cjs/resolution-be86b83a.js +1 -0
- package/cjs/series-bc7bd286.js +1 -0
- package/cjs/series-v2-49bae2d8.js +1 -0
- package/cjs/series-v2-8903abfd.js +1 -0
- package/cjs/settings-icon-c8f4a047.js +1 -0
- package/cjs/skin-204fe291.js +1 -0
- package/cjs/skin-2ef82d4d.js +1 -0
- package/cjs/skin-4310b7e5.js +1 -0
- package/cjs/skin-4ee709a2.js +1 -0
- package/cjs/skin-71400f76.js +1 -0
- package/cjs/skin-7b80b868.js +1 -0
- package/cjs/skin-a79c2a20.js +1 -0
- package/cjs/skin-b980185d.js +1 -0
- package/cjs/skin-c2bd6a58.js +1 -0
- package/cjs/skin-d3a286cd.js +1 -0
- package/cjs/videoSelector-47711692.js +1 -0
- package/cjs/videoSelector-7e9c4a54.js +1 -0
- package/esm/{autoNextVideo-26c54bdc.js → autoNextVideo-f87a024b.js} +1 -1
- package/esm/{browser-05efadfa.js → browser-de5f6a74.js} +1 -1
- package/esm/bundle.css +91 -4
- package/esm/{caption-settings-cae99815.js → caption-settings-e89adea1.js} +1 -1
- package/esm/features-025eb534.js +1 -0
- package/esm/generic-2fdcd94b.js +1 -0
- package/esm/{icons-262bef63.js → icons-f9c8be77.js} +1 -1
- package/esm/{index-b6b8e83c.js → index-4990081f.js} +1 -1
- package/esm/index-60891d60.js +1 -0
- package/esm/index-bd73318d.js +1 -0
- package/esm/index-d33d67a8.js +1 -0
- package/esm/{index-8df977a2.js → index-e00d7013.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/manager-71943445.js +1 -0
- package/esm/multicamv2-0a84fc50.js +1 -0
- package/esm/multicamv2-6e8753de.js +1 -0
- package/esm/nextEpisodeButton-1fb95d25.js +1 -0
- package/esm/playerControlEvents-11d3d4f4.js +1 -0
- package/esm/playlist-9b5b5099.js +1 -0
- package/esm/resolution-0e5b6f63.js +1 -0
- package/esm/series-0ceb2ca6.js +1 -0
- package/esm/series-v2-40ce53e8.js +1 -0
- package/esm/series-v2-537682c3.js +1 -0
- package/esm/settings-icon-38decab0.js +1 -0
- package/esm/skin-10c2735f.js +1 -0
- package/esm/skin-1c75f7ee.js +1 -0
- package/esm/skin-2f50415e.js +1 -0
- package/esm/skin-64b5c4fd.js +1 -0
- package/esm/skin-79d2cbfb.js +1 -0
- package/esm/skin-8dd2b774.js +1 -0
- package/esm/skin-979ddc20.js +1 -0
- package/esm/skin-ab4b6536.js +1 -0
- package/esm/skin-c3f56df0.js +1 -0
- package/esm/skin-fae217c6.js +1 -0
- package/esm/src/assets/icons.d.ts +1 -0
- package/esm/src/components/vertical-view-btn/index.d.ts +10 -0
- package/esm/src/core/util.d.ts +1 -0
- package/esm/src/features.d.ts +1 -0
- package/esm/src/helpers/playerControlEvents.d.ts +1 -0
- package/esm/src/index.d.ts +1 -0
- package/esm/videoSelector-a3ab0577.js +1 -0
- package/esm/videoSelector-a57cc9f6.js +1 -0
- package/package.json +1 -1
- package/cjs/browser-2807cc02.js +0 -1
- package/cjs/features-fb354bdf.js +0 -1
- package/cjs/generic-99674f84.js +0 -1
- package/cjs/index-44029519.js +0 -1
- package/cjs/index-c8d3434c.js +0 -1
- package/cjs/multicamv2-4f899f5b.js +0 -1
- package/cjs/multicamv2-c1992e8b.js +0 -1
- package/cjs/nextEpisodeButton-a46ce6e7.js +0 -1
- package/cjs/playlist-293754bb.js +0 -1
- package/cjs/resolution-687b9e26.js +0 -1
- package/cjs/series-d088d841.js +0 -1
- package/cjs/series-v2-0c2eacfb.js +0 -1
- package/cjs/series-v2-f17756fd.js +0 -1
- package/cjs/settings-icon-059ca993.js +0 -1
- package/cjs/skin-08318a13.js +0 -1
- package/cjs/skin-17c49807.js +0 -1
- package/cjs/skin-1c4a9fd0.js +0 -1
- package/cjs/skin-4e658b73.js +0 -1
- package/cjs/skin-7ccfa17f.js +0 -1
- package/cjs/skin-8274aa73.js +0 -1
- package/cjs/skin-8e8812e7.js +0 -1
- package/cjs/skin-d93d100a.js +0 -1
- package/cjs/skin-ddf67ad6.js +0 -1
- package/cjs/skin-f42536d3.js +0 -1
- package/cjs/videoSelector-8d2b061a.js +0 -1
- package/cjs/videoSelector-b2ff6d07.js +0 -1
- package/esm/features-6a8ec3d9.js +0 -1
- package/esm/generic-8217ebae.js +0 -1
- package/esm/index-7f79b7cc.js +0 -1
- package/esm/index-88594e95.js +0 -1
- package/esm/multicamv2-3dbf3cda.js +0 -1
- package/esm/multicamv2-5d5f14e4.js +0 -1
- package/esm/nextEpisodeButton-be7d23a9.js +0 -1
- package/esm/playlist-a2171ef4.js +0 -1
- package/esm/resolution-43f91f56.js +0 -1
- package/esm/series-d945cf27.js +0 -1
- package/esm/series-v2-b2f729c0.js +0 -1
- package/esm/series-v2-e1dca8ae.js +0 -1
- package/esm/settings-icon-de1c6c28.js +0 -1
- package/esm/skin-11a96569.js +0 -1
- package/esm/skin-164a4ee4.js +0 -1
- package/esm/skin-213e0f77.js +0 -1
- package/esm/skin-27e6fbc2.js +0 -1
- package/esm/skin-60316abd.js +0 -1
- package/esm/skin-671f189b.js +0 -1
- package/esm/skin-6ecfa34b.js +0 -1
- package/esm/skin-75086116.js +0 -1
- package/esm/skin-bc17c40c.js +0 -1
- package/esm/skin-c77b0c8a.js +0 -1
- package/esm/videoSelector-72ee1c83.js +0 -1
- package/esm/videoSelector-7b3ac9bc.js +0 -1
package/cjs/generic-99674f84.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),i=require("video.js"),r=require("axios"),o=require("./browser-2807cc02.js"),a=require("./skin-66dce245.js"),l=require("md5"),s=require("js-cookie"),d=require("./captions-8c1f9c07.js"),u=require("@babel/runtime/helpers/typeof"),c=require("@babel/runtime/helpers/toConsumableArray"),v=require("@babel/runtime/helpers/slicedToArray"),f=require("@viewlift/comscore/index.js"),p=require("@babel/runtime/helpers/classCallCheck"),m=require("@babel/runtime/helpers/createClass");function h(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function g(e,n){h("event",e,n)}var y={name:"@viewlift/player",version:"2.1.70",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",scripts:{prepublishOnly:"release-assistant","test:chromecast":"mocha -- 'remote/chromecast/tests/**/*.test.js'","test:airplay":"mocha -- 'remote/airplay/tests/**/*.test.js'"},dependencies:{"@viewlift/sse":"^0.0.3","broadcast-channel":"^7.3.0","@viewlift/comscore":"^1.0.19",axios:"^1.18.1",md5:"^2.3.0",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","jwt-decode":"^4.0.0","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3","webcomponents.js":"git+https://git@github.com/webcomponents/webcomponentsjs.git#v0.7.24"},devDependencies:{"expect.js":"^0.3.1",mocha:"^10.8.2",sinon:"^2.4.1"},overrides:{"min-document":"^2.19.1"}},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"},T=function(e){return!!e&&"drm"===function(e){var n;if(5===Number(null==e?void 0:e.code))return"drm";var t="".concat(null!==(n=null==e?void 0:e.code)&&void 0!==n?n:""," ").concat(function(e){var n,t,i,r,o;return(null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t?void 0:t.errorMessage)||(null==e||null===(i=e.response)||void 0===i||null===(r=i.data)||void 0===r?void 0:r.message)||(null==e||null===(o=e.response)||void 0===o?void 0:o.statusText)||(null==e?void 0:e.message)||"unknown_error"}(e)).toLowerCase();return/(drm|license|widevine|playready|fairplay|eme|key|hdcp)/.test(t)?"drm":/(network|manifest|segment|playlist|http|xhr|fetch|timeout)/.test(t)?"network":/(decode|mediaerror|mediasource|appendbuffer|sourcebuffer)/.test(t)?"decode":"player"}(e)},b=new Set(["license","key","server_certificate"]);function _(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}var I="asset_not_found",E="geo_blocking_issue",S="entitlement_mismatch",k="DRM/License Failures",A=new Set(["contentgeorestricted","contentgeorestrictedbyhba","content_not_available_for_country"]),O=[/geo[\s_-]?block/i,/geo[\s_-]?restrict/i,/geographic/i,/not available in your/i,/outside.*(?:region|country|territory)/i,/\bcountry\b/i,/\bterritory\b/i],P=[/entitlement/i,/not entitled/i,/subscription/i,/not subscribed/i,/access denied/i,/\bunauthorized\b/i,/\bforbidden\b/i,/\bpremium\b/i,/upgrade required/i,/tv[\s_-]?provider/i,/\bprovider\b/i],D=[/not found/i,/no content/i,/does not exist/i,/\bmissing\b/i,/not available currently/i,/not available/i],L=function(e,n,t,i){var r=Number(e),o=String(n||"");return T(i)?k:A.has(function(e){return String(e||"").toLowerCase().replace(/[\s-]/g,"_")}(t))||O.some(function(e){return e.test(o)})?E:P.some(function(e){return e.test(o)})?S:D.some(function(e){return e.test(o)})||404===r?I:451===r?E:S},C=function(n,t,i){var r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};console.log("emitApiErrorEvent",{apiName:n,error:t,errorCategory:i,meta:a});var l,s,d,u,c,v=(null==(c=o.playerConfigManager.getConfig()||{})?void 0:c.apiErrorCb)||(null==c?void 0:c.onApiError)||(null==c||null===(l=c.customData)||void 0===l?void 0:l.apiErrorCb)||(null==c||null===(s=c.customData)||void 0===s?void 0:s.onApiError)||(null==c||null===(d=c.customData)||void 0===d||null===(u=d.callbacks)||void 0===u?void 0:u.onApiError)||null;if("function"==typeof v){console.log("emitApiErrorEvent",t);var f=(null==t||null===(r=t.response)||void 0===r?void 0:r.status)||(null==t?void 0:t.status)||0,p=function(e){var n,t,i,r,o;return(null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t?void 0:t.errorMessage)||(null==e||null===(i=e.response)||void 0===i||null===(r=i.data)||void 0===r?void 0:r.message)||(null==e||null===(o=e.response)||void 0===o?void 0:o.statusText)||(null==e?void 0:e.message)||"unknown_error"}(t),m=function(e){var n,t,i,r,o,a;return(null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t?void 0:t.errorCode)||(null==e||null===(i=e.response)||void 0===i||null===(r=i.data)||void 0===r?void 0:r.error_code)||(null==e||null===(o=e.response)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.code)||(null==e?void 0:e.errorCode)||null}(t),h=L(f,p,m,t),g=function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?_(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):_(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}({errorcode:f||m,errormessage:p,errorcategory:i||h},a);n&&(g.apiPath=n);try{v(h,g)}catch(e){console.warn("[VLPlayer] apiError callback failed:",e)}}};function x(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function F(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?x(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):x(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var j=y;window.vl_player_version=j.version;var R,M=["videoDetails","linearChannel","series","entitlementData"],V=function(e,n){var t,i,r;return null!==(t=null==e||null===(i=e.endpoints)||void 0===i||null===(r=i[n])||void 0===r?void 0:r.useGlobal)&&void 0!==t?t:M.includes(n)},N=function(e){var n,t,i,r=null===(n=o.playerConfigManager.getConfig())||void 0===n?void 0:n.api;return F(F({},V(r,e)&&(null==r?void 0:r.headers)),null==r||null===(t=r.endpoints)||void 0===t||null===(i=t[e])||void 0===i?void 0:i.headers)},U=function(e){var n,t,i,r=null===(n=o.playerConfigManager.getConfig())||void 0===n?void 0:n.api;return F(F({},V(r,e)&&(null==r?void 0:r.params)),null==r||null===(t=r.endpoints)||void 0===t||null===(i=t[e])||void 0===i?void 0:i.params)},W=function(){var e,n,t,i;return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementBaseUrl)+"/video/status":z.get()+"".concat(null==w?void 0:w.getVideoDetails)},B=function(e,n){var t,i,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse)return new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})});var a,l,s,d,u=W();return r({url:W(),params:F(F({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:o},null===(a=window)||void 0===a||null===(l=a.customData)||void 0===l?void 0:l.entitlement),U("videoDetails")),method:"GET",headers:F({Authorization:n,"Sdk-Version":j.version,"x-player-name":"videojs",adbTempToken:null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d?void 0:d.adbTempToken},N("videoDetails")),withCredentials:!0}).catch(function(n){throw C(u,n,"content",{videoId:e}),n})},H=function(e,n){var t,i,o,a,l,s,d=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse)return new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})});var u=z.get()+w.getLinearChannelDetails;return r({url:u,params:F(F(F(F(F(F({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:d},(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===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.entitlement),U("linearChannel")),method:"GET",headers:F({Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO",adbTempToken:null===(l=window)||void 0===l||null===(s=l.customData)||void 0===s?void 0:s.adbTempToken},N("linearChannel"))}).catch(function(n){throw C(u,n,"content",{videoId:null==e?void 0:e.id,channelId:null==e?void 0:e.channelId,programId:null==e?void 0:e.programId}),n})},q=function(){var e=n(t.mark(function e(n){var i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ae();case 2:return i=e.sent,e.abrupt("return",r({url:z.get()+"".concat(null==w?void 0:w.saveWatchHistoryV2),method:"POST",headers:F({Authorization:i},N("saveWatchHistory")),data:F({},n),params:F(F({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId}),U("saveWatchHistory"))}).catch(function(e){throw C("saveWatchHistory",e,"content",{videoId:null==n?void 0:n.videoId,profileId:null==n?void 0:n.profileId}),e}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),G=function(e,n){var t,i,o=window.contentType,a=z.get()+"".concat(null==w?void 0:w.getVideoInfoV2,"/").concat(o,"/").concat(e);return r({method:"GET",url:a,headers:F({Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(i=t.watchHistory)||void 0===i?void 0:i.xApiKey},N("videoInfo")),params:U("videoInfo"),timeout:15e3}).catch(function(n){throw C(a,n,"content",{videoId:e,contentType:o}),n})},Y=function(e){var n=e.videoId,t=z.get()+"".concat(null==w?void 0:w.getSeriesWatchHistoryV2,"/").concat(n);return r({method:"GET",url:t,headers:F({Authorization:e.token},N("seriesWatchHistory")),params:U("seriesWatchHistory"),timeout:15e3}).catch(function(i){throw C(t,i,"content",{seriesId:n,videoId:null==e?void 0:e.videoId}),i})},z=(R=null==w?void 0:w.apiBaseUrl,{set:function(e){e&&(R=e)},get:function(){return R}}),Q=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},K=null;function X(){return{set:function(e){e&&(K=e)},get:function(){return K}}}var J,$,Z,ee,ne,te,ie,re=function(){var e=n(t.mark(function e(){var n,i,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=X().get(),i=z.get(),n){e.next=4;break}throw new Error("Missing refresh token");case 4:return e.prev=4,e.next=7,r({method:"GET",url:"".concat(i,"/identity/refresh/").concat(n),headers:N("refreshToken"),params:U("refreshToken")});case 7:return o=e.sent,e.abrupt("return",o);case 11:throw e.prev=11,e.t0=e.catch(4),e.t0;case 14:case"end":return e.stop()}},e,null,[[4,11]])}));return function(){return e.apply(this,arguments)}}(),oe=null,ae=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"))||!Q(n)){e.next=6;break}return oe||(oe=re().then(function(e){var t,i,r=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,o=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return r&&sessionStorage.setItem("vlp_token",r),o&&X().set(o),r||n}).catch(function(e){return n}).finally(function(){oe=null})),e.abrupt("return",oe);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),le=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},se=(te=new Map,{set:function(e){var n,t=(null==e||null===(n=e.video)||void 0===n?void 0:n.id)||e||null;te.set(t,(te.get(t)||0)+1)},get:function(e){return te.get(e)},clear:function(){te.clear()}}),de=function(e){$=e},ue=function(){return $},ce=function(){return J},ve=function(e){Z=e},fe=function(e){if(ee){var n=ee.get(e);ve(n+1)}},pe=(ie=0,{set:function(e){e>=0&&(ie=e)},get:function(){return ie}});function me(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function he(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?me(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):me(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var ge=0,ye=null,we=null,Te=!1,be=!1,_e=[],Ie=null;function Ee(e,n,t,i){e&&(i?e.one(n,t):e.on(n,t),_e.push({type:"player",player:e,event:n,handler:t}))}function Se(e,n,t){if(e){var i=_e.findIndex(function(i){return"player"===i.type&&i.player===e&&i.event===n&&i.handler===t});-1!==i&&_e.splice(i,1),e.off(n,t)}}function ke(e,n,t){var i;e&&null!=e&&e.ima&&"function"==typeof(null==e||null===(i=e.ima)||void 0===i?void 0:i.addEventListener)&&(e.ima.addEventListener(n,t),_e.push({type:"ima",player:e,eventType:n,handler:t}))}var Ae=function(){if(Ie){try{var e=Ie,n=e.seekToLive,t=e.originalHandleClick;n&&"function"==typeof t&&(n.handleClick=t)}catch(e){console.error(e)}Ie=null}},Oe=function(){_e.forEach(function(e){try{"player"===e.type?e.player.off(e.event,e.handler):"ima"===e.type&&function(e,n,t){if(null!=e&&e.ima){var i=e.ima;if("function"!=typeof i.removeEventListener){var r="function"==typeof i.getAdsManager?i.getAdsManager():null;r&&"function"==typeof r.removeEventListener&&r.removeEventListener(n,t)}else i.removeEventListener(n,t)}}(e.player,e.eventType,e.handler)}catch(e){console.error(e)}}),_e.length=0,Ae(),ge=0,ye=null,we=null,Te=!1,be=!1,"function"==typeof window.cleanupTimers&&window.cleanupTimers()},Pe=function(){var e,n,t,i,r,o,a,l=ue();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.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==l?void 0:l.channelId)}))||void 0===t||null===(i=t.content)||void 0===i?void 0:i.id:(null==l||null===(r=l.video)||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.id)||(null==l||null===(a=l.video)||void 0===a?void 0:a.id)||(null==l?void 0:l.id)},De=null,Le=null,Ce=function(){var e,n,t=Pe();return"linearchannel"===(null===(e=ue())||void 0===e?void 0:e.contentType)&&t&&t===Le&&De||(Le=t,De=(n=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)})()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n()),De},xe=function(){var e=ue(),n=(null==e?void 0:e.contentType)||"video",t="";if("undefined"==typeof window)return"";if("linearchannel"===n){var i,r,o,a;t=null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(o=r.beacon)||void 0===o||null===(a=o.params)||void 0===a?void 0:a.title}else{var l,s,d,u,c,v,f=null==e||null===(l=e.video)||void 0===l||null===(s=l.gist)||void 0===s?void 0:s.title,p=null===(d=window)||void 0===d||null===(u=d.customData)||void 0===u||null===(c=u.beacon)||void 0===c||null===(v=c.params)||void 0===v?void 0:v.title;t=p||f?p===f?p:f:""}return t};function Fe(){return ye||window.sessionStorage.getItem("uid")}function je(){return Re.apply(this,arguments)}function Re(){return(Re=n(t.mark(function e(){var n,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ae();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Me(e){return e?String(e):""}window.initialise=function(e){window.sid=Ce(),window.environment="production",window.platform="WEBSITE",window.failedToStartTimer=null,window.droppedStreamTimer=null,window.firstFrameFired=!1,window.isAdPlaying=!1,window._pingTimes=[],window._pingTimeUpdateHandler=null,streamFailures(e),buffering(e),ads(e),ping(e),Ve(e),Ne(e)};var Ve=function(e){Ee(e,"play",function(){"pause"!==we||e.scrubbing()||(we="play",g("RESUME",{pfm:window.platform,uid:Fe(),vid:Pe(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:"RESUME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}))}),Ee(e,"playing",function(){window.firstFrameFired&&!e.scrubbing()&&(we="play")}),Ee(e,"pause",function(){setTimeout(function(){!Te&&window.firstFrameFired&&"play"===we&&(we="pause",g("PAUSE",{pfm:window.platform,uid:Fe(),vid:Pe(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:"PAUSE",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}))},50)})},Ne=function(e){if(e){var n=0,t=0,i=0,r=0;Ee(e,"timeupdate",o),Ee(e,"seeking",function(){Te||(Te=!0,Se(e,"timeupdate",o),Ee(e,"seeked",a,!0))}),Ee(e,"seeked",a)}function o(){n=t,t=Math.floor(e.currentTime()),n<t&&(r=n,n=t)}function a(){if(be)be=!1;else{i=Math.floor(e.currentTime());var n=Math.floor(i-r);if(0!==n&&window.firstFrameFired){var t=n>0?"SEEK_FORWARD":"SEEK_BACKWARD";g(t,{pfm:window.platform,uid:Fe(),vid:Pe(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:t,videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}r=Math.floor(e.currentTime()),setTimeout(function(){Te=!1},50),Ee(e,"timeupdate",o)}}};window.cleanupTimers=function(){clearInterval(window.bufferingTimer),clearTimeout(window.failedToStartTimer),clearTimeout(window.droppedStreamTimer),window.failedToStartTimer=null,window.droppedStreamTimer=null},window.fireStreamFailure=function(e){var n,t,i,r=a.getPlayer(),o=null!=r&&r.el_?Math.floor(r.currentTime()):0;window.cleanupTimers(),g(e,he({pfm:window.platform,uid:Fe(),vid:Pe(),videoPosition:o},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:e,videoPosition:o,isAdEvent:!1})},window.streamFailures=function(e){Ee(e,"error",function(){var e=window.firstFrameFired?"DROPPED_STREAM":"FAILED_TO_START";window.fireStreamFailure(e)})},window.firstFrame=function(e,n,t){Ee(e,"play",tryCatch(function(){var i,r,o;window.ttFirstFrameStartTime_In_MS=performance.now(),we="play",window.failedToStartTimer=setTimeout(function(){window.firstFrameFired||window.fireStreamFailure("FAILED_TO_START")},3e4),g("PLAY",he({pfm:window.platform,uid:Fe(),vid:Pe(),videoPosition:Math.floor(e.currentTime())},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(o=r.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",he({"Video ID":Pe(),watchTime:Math.floor(e.currentTime())},t))}),!0)},window.buffering=function(e){Ee(e,"waiting",tryCatch(function(){window.firstFrameFired&&(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:(clearInterval(window.bufferingTimer),clearTimeout(window.droppedStreamTimer),window.droppedStreamTimer=null)},100),window.firstFrameFired&&(clearTimeout(window.droppedStreamTimer),window.droppedStreamTimer=setTimeout(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()&&window.fireStreamFailure("DROPPED_STREAM")},45e3)))}))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var r,o,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting")&&ge<4)ge++,g("BUFFERING",he({pfm:window.platform,uid:Fe(),vid:Pe(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o||null===(a=o.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return l}window.ttFirstFrameStartTime_In_MS=null},window.endFirstFrame=function(e){var n=tryCatch(function(){var t,i,r;if(window.ttFirstFrameStartTime_In_MS&&!window.firstFrameFired)if(window.isAdPlaying)console.log("'playing' event ignored during ad playback.");else{clearInterval(window.bufferingTimer),clearTimeout(window.failedToStartTimer),window.failedToStartTimer=null,window.firstFrameFired=!0;var o=(performance.now()-window.ttFirstFrameStartTime_In_MS)/1e3;window.ttFirstFrameStartTime_In_MS=null,window.totalBufferTime=o||0,g("FIRST_FRAME",he({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:parseFloat(null==o?void 0:o.toFixed(2)),bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:Fe(),vid:Pe()},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(r=i.beacon)||void 0===r?void 0:r.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:parseFloat(null==o?void 0:o.toFixed(2)),bufferHealth:window.getRemainingBufferTime(e)}),Se(e,"timeupdate",n)}});Ee(e,"timeupdate",n)},window.ads=function(e){function n(){var n,t,i,r,o,a;window.isAdPlaying=!0,!window.firstFrameFired&&window.failedToStartTimer&&clearTimeout(window.failedToStartTimer),g("AD_REQUEST",he({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:Fe(),vid:Pe(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),g("AD_IMPRESSION",he({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:Fe(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:Pe()},null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o||null===(a=o.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}function t(){window.isAdPlaying=!1,window.firstFrameFired||(window.failedToStartTimer=setTimeout(function(){window.firstFrameFired||window.fireStreamFailure("FAILED_TO_START")},3e4))}function i(){window.isAdPlaying=!1,window.firstFrameFired||(window.failedToStartTimer=setTimeout(function(){window.firstFrameFired||window.fireStreamFailure("FAILED_TO_START")},3e4))}var r=!1;function o(){var o,a,l,s;r||null!==(o=window)&&void 0!==o&&null!==(a=o.google)&&void 0!==a&&null!==(l=a.ima)&&void 0!==l&&null!==(s=l.AdEvent)&&void 0!==s&&s.Type&&null!=e&&e.ima&&"function"==typeof e.ima.addEventListener&&("function"==typeof e.ima.getAdsManager?e.ima.getAdsManager():null)&&(ke(e,window.google.ima.AdEvent.Type.STARTED,n),ke(e,window.google.ima.AdEvent.Type.SKIPPED,t),ke(e,window.google.ima.AdEvent.Type.COMPLETE,i),r=!0)}Ee(e,"adsready",o),o()};var Ue=function(e,n,t){var i;fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:t,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:(null===(i=e.tech_)||void 0===i?void 0:i.vhs)&&window.getBitrate(e)})};window.fireExitPing=function(e){if(!window.isAdPlaying){var n=null!=e&&e.el_?Math.floor(e.currentTime()):0;n<=0||Ue(e,n,n)}},window.ping=function(e){window._pingTimeUpdateHandler&&(Se(e,"timeupdate",window._pingTimeUpdateHandler),window._pingTimeUpdateHandler=null),window._pingTimes||(window._pingTimes=[]),window._pingTimeUpdateHandler=function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!window._pingTimes.includes(n)&&(ge=0,window._pingTimes.push(n),Ue(e,n,30))},Ee(e,"dispose",tryCatch(function(){console.log('Player DISPOSED >> "dispose" event fired >>> firing exit PING'),window.fireExitPing(e)})),Ee(e,"timeupdate",window._pingTimeUpdateHandler)},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),i=e.buffered(),r=0;r<i.length;r++){var o=i.start(r),a=i.end(r);if(We(n,o,a)){var l=Math.round(t-a);if(isFinite(l))return l}}})()};var We=function(e,n,t){return e>=n&&e<=t},Be=function(){var e,n=ue(),t=(null==n?void 0:n.contentType)||"video";return(null==n||null===(e=n[t])||void 0===e?void 0:e.network)||null};window.fireEvent=function(){var e=n(t.mark(function e(n){var i,a,l,s,d,u,c,v,f,p,m,h,g,y,T,b,_,I,E,S,k,A,O,P;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.isBotUserAgent()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,ae();case 4:return E=e.sent,S=le(E),k=null==S?void 0:S.site,A=null==S?void 0:S.siteId,O=xe(Pe()),e.t0=he,e.t1=he,e.t2=he,e.t3=he({aid:k,cid:A,pfm:window.platform},null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a||null===(l=a.beacon)||void 0===l?void 0:l.params),e.t4={},e.t5=Fe(),e.t6=Pe(),e.t7=n.url||document.location.href,e.t8=n.ref||(null===(s=window)||void 0===s||null===(d=s.location)||void 0===d?void 0:d.ref)||document.referrer,e.t9=n.eventName,e.t10=null!==(u=n.videoPosition)&&void 0!==u?u:null,e.t11=window.environment,e.t12=n.dp1||"",e.t13=n.dp2||"",e.t14=n.dp3||"",e.t15=n.dp4||"",e.t16=n.dp5||"",e.t17=!0===n.isAdEvent?n.videoPosition:null,e.t18=!0===n.isAdEvent?Me(n.adPosition):"",e.next=30,je();case 30:e.t19=e.sent,e.t20=n.playerType||"native",e.t21=n.mediaType||"VIDEO",e.t22=window.sid,e.t23=null!==(c=n.ttFirstFrame)&&void 0!==c?c:null,e.t24=null!==(v=n.bitrate)&&void 0!==v?v:null,e.t25=null!==(f=n.resHeight)&&void 0!==f?f:null,e.t26=null!==(p=n.resWidth)&&void 0!==p?p:null,e.t27=null!==(m=n.bufferHealth)&&void 0!==m?m:null,e.t28=null!==(h=Be())&&void 0!==h?h:null,e.t29=null!=k?k:null,e.t30={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,networkname:e.t28,brandname:e.t29},e.t31=(null==n?void 0:n.duration)&&{duration:n.duration},e.t32=(0,e.t2)(e.t3,e.t4,e.t30,e.t31),e.t33=null===(g=window)||void 0===g||null===(y=g.customData)||void 0===y||null===(T=y.beacon)||void 0===T?void 0:T.params,e.t34=(0,e.t1)(e.t32,e.t33),e.t35=O&&{title:O},e.t36=(0,e.t0)(e.t34,e.t35),P=[e.t36],r({url:(null===(b=window)||void 0===b||null===(_=b.customData)||void 0===_||null===(I=_.beacon)||void 0===I?void 0:I.url)||z.get()+w.getBeaconUrl,method:"post",headers:he({Authorization:E},N("beacon")),params:U("beacon"),contentType:"application/x-www-form-urlencoded",dataType:"text",data:P}).catch(function(e){console.error(e)});case 50:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};function He(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&!o.isBotUserAgent()){var t=o.playerConfigManager.getConfig();if(null==t||!t.disableBeacon){null!=n&&n.userId&&(ye=n.userId);var i=a.getPlayer(e);window.initialise(i,null==n?void 0:n.analyticsCb),window.firstFrame(i,null==n?void 0:n.analyticsCb,null==n?void 0:n.analyticsEventParams),window.endFirstFrame(i),window.watchLive(i)}}}window.watchLive=function(e){var n;if(e){var t=null==e||null===(n=e.controlBar)||void 0===n?void 0:n.getChild("SeekToLive");if(t){Ae();var i=t.handleClick;Ie={seekToLive:t,originalHandleClick:i},t.handleClick=function(n){var t,r;return null!==(t=e.liveTracker)&&void 0!==t&&null!==(r=t.atLiveEdge)&&void 0!==r&&r.call(t)||(!function(e){var n,t,i;g("WATCH_LIVE",he({eventName:"WATCH_LIVE",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:Fe(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:Pe()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"WATCH_LIVE",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!1})}(e),be=!0),i.call(this,n)}}}};var qe=function(){var e=pe.get();return e>=0?e+1:1},Ge=function(){var e,n,t,i=ce(),r=ue(),o=null==r||null===(e=r.video)||void 0===e?void 0:e.id,a=pe.get(),l=null==i||null===(n=i[a])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===o});return l>=0?l+1:1};function Ye(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function ze(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ye(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Ye(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var Qe=l,Ke=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},Xe=function(e){var n=Je(e,"video.tags",[]),t=Je(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},Je=function(e,n,t){for(var i=0,r=(n=n.split(".")).length;i<r;i++){var o;e=null===(o=e)||void 0===o?void 0:o[n[i]]}return e||t},$e=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID";return e?n:n.includes("browser-")?n.replace("browser-",""):n},Ze=function(){var e,n,t,i,r,o,l,d,u,c,v,f,p,m,h,g,y,w,T,b,_,I,E,S,k,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",O=arguments.length>1?arguments[1]:void 0,P=arguments.length>2?arguments[2]:void 0;if(null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.disableMacros)return A;var D=(null==P?void 0:P.siteName)||(null==P?void 0:P.site)||"",L=(null==P?void 0:P.contentType)||"video",C=(null==P||null===(t=P[L])||void 0===t?void 0:t.metadata)||(null==P||null===(i=P[L])||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.metadata),x=a.getPlayer(O);if(!A.includes("VIEWLIFT_"))return A;var F,j=window.getComputedStyle(document.getElementById(O),null),R=Math.trunc(j.getPropertyValue("height").slice(0,-2)),M=Math.trunc(j.getPropertyValue("width").slice(0,-2)),V="linearchannel"===L?null==P||null===(o=P.linearchannel)||void 0===o||null===(l=o.channels)||void 0===l||null===(d=l.find(function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)}))||void 0===d||null===(u=d.content)||void 0===u?void 0:u.id:Je(P,"video.gist.id",""),N="linearchannel"===L?null==P||null===(c=P.linearchannel)||void 0===c||null===(v=c.channels)||void 0===v||null===(f=v.find(function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)}))||void 0===f?void 0:f.title:Je(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),U=null,W=null;"function"==typeof window.__gpp&&(null===(F=window)||void 0===F||F.__gpp("ping",function(e){U=null==e?void 0:e.gppString,W=null==e?void 0:e.sectionList[0]}));var B=s.get("us_privacy")||s.get("usprivacy"),H=void 0!==B?B:"1YNN",q=null!==(p=null===(m=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===m?void 0:m.fwIdentifier)&&void 0!==p?p:null,G=ze(ze({},en(C)),{},{VIEWLIFT_WIDTH:M,VIEWLIFT_HEIGHT:R,VIEWLIFT_SIZE:Ke(M,R),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(h=window)||void 0===h?void 0:h.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Je(P,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Je(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Je(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==x||null===(g=x.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==x||null===(y=x.options_)||void 0===y?void 0:y.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D||"usanetwork"==D||"golfchannel"==D?"":$e(!1),VIEWLIFT_DID:"spinco"==D||"usanetwork"==D||"golfchannel"==D?"":$e(),VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:Xe(P),VIEWLIFT_MEDIA_ID:V,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Je(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:V,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Je(P,"video.gist.permalink","")),VIEWLIFT_CONSENT:s.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Je(null===(w=window)||void 0===w||null===(T=w.app_data)||void 0===T||null===(b=T.site)||void 0===b?void 0:b.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==D||"usanetwork"==D||"golfchannel"==D?"":Je(null===(_=window)||void 0===_||null===(I=_.app_data)||void 0===I||null===(E=I.site)||void 0===E?void 0:E.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:H,VIEWLIFT_TVE_PROVIDER:q?Qe(q):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*Je(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Je(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:V,VIEWLIFT_CONTENT_TITLE:N,VIEWLIFT_CONTENT_SERIES_TITLE:Je(P,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Je(P,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:Ge(),VIEWLIFT_SEASON_NUMBER:qe(),VIEWLIFT_CONTENT_TAGS:Xe(P),VIEWLIFT_GPP_SID:W||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:U||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:"",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:""},null===(S=window)||void 0===S||null===(k=S.customData)||void 0===k?void 0:k.macros);for(var Y in G){var z=new RegExp(Y,"g");A=A.replace(z,G[Y])}return A},en=function(e){var n,t,i,r,a,l,s,d,u,c={},v=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){v.set(e.name,e.value)}));var f=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.subscription)||void 0===i?void 0:i.SVOD)||!1,p=(null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a||null===(l=a.subscription)||void 0===l?void 0:l.TVE)||!1;return f||p?(o.isMobile()?f?c=ze(ze({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||""}):p&&(c=ze(ze({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.tve.csai")||""})):f?c=ze(ze({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||""}):p&&(c=ze(ze({},c),{},{VIEWLIFT_CSID:v.get("csid.web.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.tve.csai")||""})),f?c=ze(ze({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||"",VIEWLIFT_SFID_CSAI:v.get(o.isMobile()?"sfid.mweb.dtc.csai":"sfid.web.dtc.csai")||""}):p&&(c=ze(ze({},c),{},{VIEWLIFT_SFID:v.get("sfid.tve")||v.get("sfid.web.tve")||"",VIEWLIFT_SFID_CSAI:v.get(o.isMobile()?"sfid.mweb.tve.csai":"sfid.web.tve.csai")||""})),c=o.isMobile()?ze(ze({},c),{},{VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):ze(ze({},c),{},{VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})):(c=ze(ze({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||"",VIEWLIFT_SFID_CSAI:v.get(o.isMobile()?"sfid.mweb.dtc.csai":"sfid.web.dtc.csai")||""}),c=o.isMobile()?ze(ze({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):ze(ze({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})),c=ze(ze({},c),{},{VIEWLIFT_AFID:v.get("afid"),VIEWLIFT_NIELSEN_APP_ID:Je(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(u=d.appcmsMain)||void 0===u?void 0:u.analytics,"nielsen.id")||v.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:v.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:v.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:v.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},nn=function(e,n){var t,i,r,a,l,s,d,u,c,v,f,p,m,h=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[h])||void 0===t?void 0:t.drmEnabled,y=null==e||null===(i=e[h])||void 0===i||null===(r=i.streamingInfo)||void 0===r?void 0:r.videoAssets,w=null==e||null===(a=e[h])||void 0===a||null===(l=a.streamingInfo)||void 0===l?void 0:l.audioAssets,T=(null==e||null===(s=e[h])||void 0===s||null===(d=s.streamingInfo)||void 0===d||null===(u=d.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(c=e[h])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var b=(null==e||null===(f=e[h])||void 0===f||null===(p=f.streamingInfo)||void 0===p||null===(m=p.videoAssets)||void 0===m?void 0:m.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=w&&w.hls)return rn(w);if(g){var _=on(y,n);return _.src=Ze(_.src,n,e),_}if("Safari"!==o.detectBrowser()&&b)return tn(y);if(T){var I=rn(y);return I.src=Ze(I.src,n,e),I}if(null!=y&&y.mpeg){var E=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(y);return E.src=Ze(E.src,n,e),E}return null},tn=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},rn=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},on=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,l=e.widevine,s=e.playReady,d=o.detectBrowser();if(a.getPlayer(n),"Safari"===d){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",__vlLicenseUrl:(null==e?void 0:e.licenseUrl)||"",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(r,function(e,n,i){console.log(e),e&&t(e),t(null,new Uint8Array(i))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,r,o){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(a,function(e,n,t){console.log(e),e&&o(e),o(null,t)})}}}}}(r);return an(n),u}var c,v={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(c=window)||void 0===c?void 0:c.siteName)?(an(n),v.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==s?void 0:s.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==s?void 0:s.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==s?void 0:s.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==s?void 0:s.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==s?void 0:s.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),v};var an=function(e){var n=a.getPlayer(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==o.detectBrowser()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},ln=function(e,n){if(Promise.resolve().then(function(){return require("./error-26d5a3c3.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 i=document.getElementById(e);if(i){var r=document.createElement("div");r.className="error-container";var o=document.createElement("div");o.className="error-message",o.innerHTML="".concat(n),r.appendChild(o),i.append(r)}}},sn=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var dn=!1,un=function(e,n,t){var i=Ze(n,e,t),r=a.getPlayer(e);if(n&&window.google){if("function"!=typeof r.ima&&"object"!==u(r.ima))return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,i,r,o=a.getPlayer(e);if(null!==o.el_){dn=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),dn&&null!==o.el_&&("function"==typeof o.ima?o.ima(l):setTimeout(function(){o.ima.setContentWithAdTag(null,n,!0),o.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"),o.one(d,function(){u&&o.ima.initializeAdDisplayContainer()}),function(e){if(!e._adVolumeSynced){e._adVolumeSynced=!0;var n=function(){try{var n=e.ima&&e.ima.getAdsManager&&e.ima.getAdsManager();if(!n||"function"!=typeof n.setVolume)return;n.setVolume(e.muted()?0:e.volume())}catch(e){}};e.on(["volumechange","advolumechange"],n),e.on("ads-manager",n)}}(o);var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.adEventHandler)||null;o.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),o.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})})}),o.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}};var cn,vn=(cn=!0,{enable:function(){cn=!0},disable:function(){cn=!1},get enabled(){return cn}}),fn="ssai-breakStart",pn="ssai-adImpression",mn="ssai-firstQuartile",hn="ssai-midpoint",gn="ssai-thirdQuartile",yn="ssai-complete",wn="ssai-breakEnd",Tn={breakStart:fn,impression:pn,firstQuartile:mn,midpoint:hn,thirdQuartile:gn,complete:yn,breakEnd:wn};function bn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=a.getPlayer(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var i=n.eventType,r=Tn[i];r&&t.trigger(r,n)}function _n(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function In(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?_n(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):_n(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var En,Sn=(En={},{get:function(){return En},set:function(e){En=e}});function kn(e,n){var t,i,r,o,l,s,d,u,c,v,p,m,h,g,y,w,T,b,_,I,E,S=null==e?void 0:e.playerId,k=a.getPlayer(S);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var A=ue(),O=(null==A||null===(i=A.video)||void 0===i?void 0:i.metadata)||[],P=(null==O?void 0:O.length)&&O.filter(function(e){return"advertisingGenre"===e.name});if(null!==(r=P)&&void 0!==r&&r.length){var D=P.map(function(e){return e.value});P=null==D?void 0:D.join(",")}f.destroyComscoreTag();var L,C,x,F=null===(o=window)||void 0===o?void 0:o.lcProgrammeDetails,j=Array.isArray(null==F?void 0:F.category)?null==F||null===(l=F.category)||void 0===l?void 0:l.join(","):(null==F?void 0:F.category)||null,R=In(In(In({},null==A?void 0:A.video),null==A?void 0:A.linearchannel),{},{siteName:(null==e||null===(s=e.comscore)||void 0===s?void 0:s.applicationName)||(null==e||null===(d=e.comscore)||void 0===d||null===(u=d.metadata)||void 0===u?void 0:u.siteName)||(null==A?void 0:A.site)||null,programId:(null==F?void 0:F.videotmsid)||null,programTitle:(null==F?void 0:F.lcProgrammeName)||null,episodeId:(null==F?void 0:F.videotmsid)||null,seasonNumber:(null==A||null===(c=A.video)||void 0===c||null===(v=c.series)||void 0===v?void 0:v.seasonNumber)||(null==F||null===(p=F.seriesDetails)||void 0===p?void 0:p.season)||null,episodeNumber:(null==A||null===(m=A.video)||void 0===m||null===(h=m.series)||void 0===h?void 0:h.episodeNumber)||(null==F||null===(g=F.seriesDetails)||void 0===g?void 0:g.episode)||null,episodeTitle:(null==F?void 0:F.lcSubTitle)||null,isCompleteEpisode:!!(null!=A&&null!==(y=A.video)&&void 0!==y&&y.series||null!=F&&null!==(w=F.seriesDetails)&&void 0!==w&&w.episode),genre:P||j,comscoreConfig:{implementationId:(null==e||null===(T=e.comscore)||void 0===T?void 0:T.implementationId)||null,projectId:(null==e||null===(b=e.comscore)||void 0===b?void 0:b.projectId)||null}}),M=null==e||null===(_=e.comscore)||void 0===_||null===(I=_.metadata)||void 0===I?void 0:I.contentType;if(null!=R&&null!==(E=R.streamingInfo)&&void 0!==E&&E.isLiveStream?R.contentType="Live":R.contentType=M||"LongFormOnDemand",null==R||!R.network){var V,N=(null==R?void 0:R.metadata)||[],U=null==N||null===(V=N.find(function(e){return"network"===e.name}))||void 0===V?void 0:V.value;R.network=U||null}null!=R&&R.network&&null!=R&&R.genre&&(R.customGenre="".concat(R.network,"_").concat((null==R?void 0:R.programTitle)||(L=R,null!=L&&L.series?null==L||null===(x=L.series)||void 0===x?void 0:x.title:null==L||null===(C=L.gist)||void 0===C?void 0:C.title),"_").concat(R.genre)),null!=F&&F.airDate&&(R.publishDate=F.airDate),null!=R&&R.runtime&&"function"==typeof k.duration&&(R.runtime=1e3*Math.ceil(k.duration()));var W=f.formulateComscorePayload(R,k);console.log("comscoreOptions player data",W),f.createComscoreStreamingTag(In({playerName:"Video.js"},W)),f.setComscorePlayerInstance(k)}}function An(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function On(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?An(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):An(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}function Pn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Dn(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)?Dn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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 o,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,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function Dn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=Array(n);t<n;t++)i[t]=e[t];return i}var Ln=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}();function Cn(e,n){return xn.apply(this,arguments)}function xn(){return(xn=n(t.mark(function e(n,i){var r,o,l,s,d,u,c,f,p,m,h,g,y,w,T,b,_,I;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a.getPlayer(n),l=nn(i,n),s=l.src,d=(null==i?void 0:i.contentType)||"video",null==i||null===(r=i[d])||void 0===r||null===(o=r.streamingInfo)||void 0===o||o.isLiveStream,u=s.replace("/dash/","/session/").replace("/master/","/session/"),u=Ze(u,n,i),c=jn(u),f=v(c,2),p=f[0],m=f[1],h=Fn(m)||{},u=new URL(u.split("?")[0]),Object.keys(m).length>0&&Object.entries(m).forEach(function(e){var n=v(e,2),t=n[0],i=n[1];u.searchParams.set(t,i)}),e.prev=11,e.next=14,fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(On({adsParams:On({},p)},h))});case 14:return g=e.sent,e.next=17,g.json();case 17:return y=e.sent,w="https://"+new URL(u).hostname,T=y.trackingUrl,b=y.manifestUrl,_=w+T,I=w+b,Ln.set(_),console.log("%c TRACKING URL","background: #bdf369; color: #000",_),l.src=I,e.abrupt("return",l);case 29:return e.prev=29,e.t0=e.catch(11),e.abrupt("return",l);case 32:case"end":return e.stop()}},e,null,[[11,29]])}))).apply(this,arguments)}function Fn(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=v(e,2),t=n[0],i=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(i)]}))||{}}function jn(e){var n={};if(!e.split("?")[1])return[{},{}];var t,i=new URL(e,window.location.origin),r=Pn((null==i?void 0:i.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var o=v(t.value,2),a=o[0],l=o[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 f=v(c[u],2),p=f[0],m=f[1];if(p.startsWith("ads."))s[p.replace(/^ads\./,"")]=m;else d[p]=m}return[s,d]}var Rn,Mn,Vn,Nn=new Map;function Un(e,n){return Wn.apply(this,arguments)}function Wn(){return Wn=n(t.mark(function e(i,r){var o,l,s,d,u,v,f,p,m,h,g,y,w,T,b,_,I,E,S,k,A,O,P,D,L;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:L=function(e,n,t,r,o,l){var s,d,u=a.getPlayer(i);if(!u.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds,e<P&&O.clear(),P=e;var v=(null==n||null===(s=n.ads)||void 0===s||null===(d=s[r])||void 0===d?void 0:d.adId)||c;Math.floor(u.currentTime());var f,p=Pn(t);try{for(p.s();!(f=p.n()).done;){var m,h,g,y=f.value,w=y.eventType,T=y.beaconUrls,b=y.startTimeInSeconds,_=y.startTime,I=y.durationInSeconds,E=b||0,S=T,k=(null===(m=window)||void 0===m||null===(h=m.customData)||void 0===h||null===(g=h.ads)||void 0===g?void 0:g.adEventHandler)||null,A="".concat(E,"_").concat(w),L=Nn.get("pod-".concat(o))||[];if(console.warn(e,E,"map:",w,"condition1:",e>=E,"map:",Nn),e>=E&&!L.includes(A)){L.push(A),Nn.set("pod-".concat(o),L);try{D(w,n,S,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,w,n)}if("function"==typeof k)try{var C,x={eventType:w,startTimeInSeconds:b,startTime:_,durationInSeconds:I,ad:null==n||null===(C=n.ads)||void 0===C?void 0:C[r],adIndex:r};k({adsData:x}),bn(i,x)}catch(e){console.error("Error when calling ads callback:",e)}var F=Sn.get();if(F&&0!==Object.keys(F).length){var j=F.formulateComscoreAdPayload,R=F.startComscoreAdTracking,M=F.finishComscoreAdTracking,V=F.endComscoreAdTracking,N="".concat(E,"_").concat(v,"_").concat(w);if(!O.has(N))if(O.set(N,!0),"impression"===w){var U,W=Ln.get();R(j(On(On({},null==n||null===(U=n.ads)||void 0===U?void 0:U[r]),{},{trackingUrl:W})))}else"complete"===w?M():"breakEnd"===w&&V()}}}}catch(e){p.e(e)}finally{p.f()}}},D=function(e,n,t,i){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(i.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(i.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},A=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},Nn.clear(),window.isAdPlaying=!1,m=Ln.get(),(h=a.getPlayer(i)).one("loadeddata",function(){m&&k(m)}),g=new Map,y=new Map,w=-1,T=(null===(o=document)||void 0===o||null===(l=o.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==h||null===(s=h.controlBar)||void 0===s?void 0:s.getChild("videoSelector"))||null,_=(null==h||null===(d=h.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,I=(null==h||null===(u=h.el())||void 0===u||null===(v=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===v?void 0:v[0])||null,E=(null==h||null===(f=h.el())||void 0===f||null===(p=f.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===p?void 0:p[0])||null,S=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return c(i);var r=[],o=null==i?void 0:i.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),a=(null==o||null===(e=o.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,l=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],s=null==l||null===(n=l.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),d=(null==s?void 0:s.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!d&&a){var u=null==s?void 0:s.map(function(e){return On(On({},e),{},{eventType:"videoView",beaconUrls:[a]})});null!=u&&u[0]&&r.push(null==u?void 0:u[0])}return r},k=function(){var e=n(t.mark(function e(n){var o,l,s,d,u,v,f,p,m,h,k,O,P,D,C,x,F,j,R,M,V,N,U,W,B,H;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return N=function(e){document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",N),0===e.button&&j(F)},V=function(e){},M=function(e){if(null!=e){var n,t=null,i=Pn(p);try{for(i.s();!(n=i.n()).done;){var r=n.value,o=r.startTimeInSeconds,a=r.ads;Array.isArray(a)&&(null==a?void 0:a.length)>0&&(o>e||g.has(o)||(null===t||o>t.startTimeInSeconds)&&(t=r))}}catch(e){i.e(e)}finally{i.f()}t?(console.log("Resume: seeking back to recent ad break:",t.startTimeInSeconds,"then resuming to",e),m={position:e,podStart:t.startTimeInSeconds,podEndTime:t.startTimeInSeconds+t.durationInSeconds,entered:!1},setTimeout(function(){h.currentTime(t.startTimeInSeconds+.4)},100)):(m=null,h.currentTime(e),R(e))}},R=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.currentTime(),t=null,i=Pn(p);try{for(i.s();!(e=i.n()).done;){var r=e.value,o=r.startTimeInSeconds,a=r.durationInSeconds,l=(r.ads,Math.floor(o+a));n>=o&&n<=l&&(t=l,g.set(o,!0))}}catch(e){i.e(e)}finally{i.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){h.currentTime(t+2.2)},100))},j=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.currentTime();if(!(null==e||e<0||n<=e)){var t,i=null,r=Pn(p);try{for(r.s();!(t=r.n()).done;){var o=t.value,a=o.startTimeInSeconds,l=o.ads;Array.isArray(l)&&(null==l?void 0:l.length)>0&&(g.has(a)||a>e&&a<=n&&(null===i||a>i.startTimeInSeconds)&&(i=o))}}catch(e){r.e(e)}finally{r.f()}null!==i&&(g.set(i.startTimeInSeconds,!0),y.set(i.startTimeInSeconds,!0),m={position:n,podStart:i.startTimeInSeconds,podEndTime:i.startTimeInSeconds+i.durationInSeconds,entered:!1},console.log("Seeking back to ad pod:",i.startTimeInSeconds,"then resuming to",n),setTimeout(function(){h.currentTime(i.startTimeInSeconds+.4)},100))}},e.next=8,fetch(n);case 8:return u=e.sent,e.next=11,u.json();case 11:v=e.sent,f=v.avails,p=[],m=null,h=a.getPlayer(i),k=h.controlBar.progressControl,O=k.seekBar.el(),null===(o=document)||void 0===o||o.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),f.map(function(e,n){var t;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t||t.length),p.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:S(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),r&&M(r),null!=p&&p.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",p),window.adsQueueList=p,"function"==typeof(x=(null===(P=window)||void 0===P||null===(D=P.customData)||void 0===D||null===(C=D.ads)||void 0===C?void 0:C.onAdBreaksLoaded)||null)&&x(p)),console.log(p,"data"),p.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,i=h.duration();if(!(n>i||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/i*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(r,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(r,"%"),o.style.pointerEvents="none",O.appendChild(o)}}),h._timeUpdateHandler&&h.off("timeupdate",h._timeUpdateHandler),h._timeUpdateHandler=a.throttle(function(){var e=h.currentTime();if(e!==w){w=e;for(var n=!1,t=function(){var t=p[i],r=t.startTimeInSeconds,o=t.durationInSeconds,a=t.ads,l=r+o;if(e>=r-1.2&&e<=l+1.2){var s;e>=r&&e<=l&&Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n=!0),e>l&&g.set(r,!0),vn.disable(),T&&T.classList.add("vjs-hidden"),I&&(I.style.pointerEvents="none",I.classList.add("vjs-hidden")),E&&(E.style.pointerEvents="none",E.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),k.el().classList.add("hide-progress-bar");for(var d=e-r,u=0,v=0,f=0;f<a.length;f++){var m,h=null==a||null===(m=a[f])||void 0===m?void 0:m.durationInSeconds;if(d<u+h){v=f;break}u+=h}a[v];var w=Math.max(0,o-d),S=Math.round(w);U.style.display="block",H.textContent="".concat(v+1," of ").concat(a.length," • ").concat(A(S));var O=[];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)});O.push.apply(O,c(n))}),(null==t||null===(s=t.podSlotImpressionBeacon)||void 0===s?void 0:s.length)>0&&O.push.apply(O,c(null==t?void 0:t.podSlotImpressionBeacon)),L(e,t,O,v,i),"break"}y.delete(r)},i=0;i<p.length;i++){if("break"===t())break}if(window.isAdPlaying=n,m&&!h.seeking()&&(e>=m.podStart&&e<=m.podEndTime&&(m.entered=!0),m.entered&&e>=m.podEndTime)){var r=m.position;m=null,setTimeout(function(){h.currentTime(r),R(r)},300)}n||(U.style.display="none",k.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),I&&(I.style.pointerEvents="auto",I.classList.remove("vjs-hidden")),E&&(E.style.pointerEvents="auto",E.classList.remove("vjs-hidden")),vn.enable())}},1e3),h.on("timeupdate",h._timeUpdateHandler),null===(l=document)||void 0===l||l.addEventListener("keydown",function(e){if(vn.enabled&&"ArrowRight"==e.key){var n=h.currentTime();pi(i,10),j(n,n+10),e.stopPropagation()}}),F=-1,k.el().addEventListener("pointerdown",function(e){0===e.button&&(F=h.currentTime(),document.addEventListener("pointermove",V),document.addEventListener("pointerup",N))}),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()}),(U=document.createElement("div")).className="ssai-ad-container",(W=document.createElement("div")).className="sponsored-adbox",(B=document.createElement("div")).className="sponsored-text",B.textContent="Sponsored Ad",W.append(B),(H=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",U.append(W),U.append(H),h.el().appendChild(U);case 47:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),O=new Map,P=-1;case 21:case"end":return e.stop()}},e)})),Wn.apply(this,arguments)}function Bn(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 Hn(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)?Hn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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 o,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,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function Hn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=Array(n);t<n;t++)i[t]=e[t];return i}function qn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Gn(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?qn(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):qn(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var Yn={},zn=(null===(Rn=window)||void 0===Rn||null===(Mn=Rn.location)||void 0===Mn||null===(Vn=Mn.search)||void 0===Vn?void 0:Vn.includes("debug=true"))||!1,Qn=null;function Kn(e){return Xn.apply(this,arguments)}function Xn(){return Xn=n(t.mark(function e(i){var r,o,l,s,d,u,v,f,p,m,h,g,y,w,T,b,_,I,E,S,k,A,O,P,D,L,C;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:C=function(e,n,t,r,o){var l,s,d=a.getPlayer(i);if(!d.seeking()){var u=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(l=n.ads)||void 0===l||null===(s=l[r])||void 0===s?void 0:s.adId)||u;Math.floor(d.currentTime());var v,f=Bn(t);try{for(f.s();!(v=f.n()).done;){var p,m,h,g=v.value,y=g.eventType,w=g.beaconUrls,T=g.startTimeInSeconds,b=g.startTime,_=g.durationInSeconds,I=(g.eventId,T||u),E=w,S=(null===(p=window)||void 0===p||null===(m=p.customData)||void 0===m||null===(h=m.ads)||void 0===h?void 0:h.adEventHandler)||null,k="".concat(c,"_").concat(y),A="pod-".concat(u);P.has(A)||P.set(A,new Set);var O=P.get(A);if(zn&&console.warn(e,I,"map:",y,"condition1:",e>=I,"map:",P),e>=I&&e<=I+D&&!O.has(k)){O.add(k);try{L(y,n,E,d)}catch(e){console.error("Error when calling triggerAdBeacon:",e,y,n)}if("function"==typeof S)try{var C,x={eventType:y,startTimeInSeconds:T,startTime:b,durationInSeconds:_,ad:null==n||null===(C=n.ads)||void 0===C?void 0:C[r],adIndex:r};S({adsData:x}),bn(i,x)}catch(e){console.error("Error when calling ads callback:",e)}var F=Sn.get();if(F&&0!==Object.keys(F).length){var j=F.formulateComscoreAdPayload,R=F.startComscoreAdTracking,M=F.finishComscoreAdTracking,V=F.endComscoreAdTracking;if("impression"===y){var N,U=Ln.get();R(j(Gn(Gn({},null==n||null===(N=n.ads)||void 0===N?void 0:N[r]),{},{trackingUrl:U})))}else"complete"===y?M():"breakEnd"===y&&V()}}}}catch(e){f.e(e)}finally{f.f()}}},L=function(e,n,t,i){var r,o,a;"breakEnd"===e&&(null===(r=Yn)||void 0===r?void 0:r.currentAdIndex)+1!=(null===(o=Yn)||void 0===o?void 0:o.totalAds)&&(null==n||null===(a=n.ads)||void 0===a?void 0:a.length)>0||(zn&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(i.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})}))},h=function(){Qn&&clearInterval(Qn)},p=Ln.get(),(m=a.getPlayer(i)).one("loadeddata",function(){h(),Qn=setInterval(function(){p&&!m.paused()&&O(p)},2e3)}),m.on("dispose",function(){h()}),g=new Map,y=new Map,w=-1,T=null,b=(null===(r=document)||void 0===r||null===(o=r.getElementsByClassName("tvProviderImage"))||void 0===o?void 0:o[0])||null,_=(null==m||null===(l=m.controlBar)||void 0===l?void 0:l.getChild("videoSelector"))||null,I=(null==m||null===(s=m.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,E=(null==m||null===(d=m.el())||void 0===d||null===(u=d.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===u?void 0:u[0])||null,S=(null==m||null===(v=m.el())||void 0===v||null===(f=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===f?void 0:f[0])||null,k=!1,A=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return c(i);var r=[],o=null==i?void 0:i.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),a=(null==o||null===(e=o.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,l=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],s=null==l||null===(n=l.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),d=(null==s?void 0:s.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!d&&a){var u=null==s?void 0:s.map(function(e){return Gn(Gn({},e),{},{eventType:"videoView",beaconUrls:[a]})});null!=u&&u[0]&&r.push(null==u?void 0:u[0])}return r},O=function(){var e=n(t.mark(function e(n){var r,o,l,s,d,u,v,f,p,m,h,O;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=new URL(n),T&&s.searchParams.append("nextToken",T),e.next=4,fetch(s.toString(),{method:"GET"});case 4:return d=e.sent,e.next=7,d.json();case 7:u=e.sent,v=u.avails,f=u.nextToken||null,T=f,p=[],m=a.getPlayer(i),h=null==m||null===(r=m.controlBar)||void 0===r?void 0:r.progressControl,O=null==h||null===(o=h.seekBar)||void 0===o?void 0:o.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),v.map(function(e,n){p.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:A(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),zn&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",p),null!=p&&p.length&&(window.adsQueueList=p),p.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,i=m.duration();if(!(n>i||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/i*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(r,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(r,"%"),o.style.pointerEvents="none",O.appendChild(o)}}),m._timeUpdateHandler&&m.off("timeupdate",null==m?void 0:m._timeUpdateHandler),m._timeUpdateHandler=a.throttle(function(){if(hi(i)){var e=null==m?void 0:m.currentTime();if(e!==w){w=e;for(var n=function(){var n=p[t],i=n.startTimeInSeconds,r=n.durationInSeconds,o=n.ads,a=i+r;if(e>=i-1.2&&e<=a+1.2){var l;k=!!(e>=i&&e<=a&&Array.isArray(o)&&(null==o?void 0:o.length)>0),e>a&&g.set(i,!0),vn.disable(),b&&b.classList.add("vjs-hidden"),E&&(E.style.pointerEvents="none",E.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),I&&(I.el().style.pointerEvents="none",I.el().classList.add("vjs-hidden")),h.el().classList.add("hide-progress-bar");for(var s=e-i,d=0,u=0,v=0;v<o.length;v++){var f,m=null==o||null===(f=o[v])||void 0===f?void 0:f.durationInSeconds;if(s<d+m){u=v;break}d+=m}setTimeout(function(){Yn.totalAds=null==o?void 0:o.length,Yn.currentAdIndex=u},1e3);var w=[];return null==o||o.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});w.push.apply(w,c(n))}),(null==n||null===(l=n.podSlotImpressionBeacon)||void 0===l?void 0:l.length)>0&&w.push.apply(w,c(null==n?void 0:n.podSlotImpressionBeacon)),C(e,n,w,u),"break"}y.delete(i)},t=0;t<p.length;t++){if("break"===n())break}k||(Yn={},h.el().classList.remove("hide-progress-bar"),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),I&&(I.el().style.pointerEvents="auto",I.el().classList.remove("vjs-hidden")),b&&b.classList.remove("vjs-hidden"),E&&(E.style.pointerEvents="auto",E.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),vn.enable())}}},1e3),m.on("timeupdate",m._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),P=new Map,D=2.5;case 22:case"end":return e.stop()}},e)})),Xn.apply(this,arguments)}var Jn=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function $n(e){return JSON.stringify((e||[]).map(function(e){return{availId:e.availId,startTimeInSeconds:e.startTimeInSeconds,durationInSeconds:e.durationInSeconds,ads:(e.ads||[]).map(function(e){return{adId:e.adId,startTimeInSeconds:e.startTimeInSeconds,durationInSeconds:e.durationInSeconds}})}}))}var Zn=function(){function e(n,t,i,r){p(this,e),this.video_=r,this.ad_=n,this.skipOffset_=function(e){if(!e)return null;var n=new RegExp(Jn.source,"g");n.lastIndex=0;var t=n.exec(e);if(!t)return null;var i=Number(t[1])||0,r=Number(t[2]),o=Number(t[3]),a=Number(t[6])||0;return r>59||o>59?null:a/1e3+o+60*r+3600*i}(null==n?void 0:n.skipOffset),this.adPosition_=t,this.totalAds_=i,this.isSkipped_=!1}return m(e,[{key:"isClientRendering",value:function(){return!1}},{key:"getDuration",value:function(){var e,n;return null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.durationInSeconds)&&void 0!==e?e:0}},{key:"getRemainingTime",value:function(){var e,n,t,i,r,o;return(null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.startTimeInSeconds)&&void 0!==e?e:0)+(null!==(t=null===(i=this.ad_)||void 0===i?void 0:i.durationInSeconds)&&void 0!==t?t:0)-(null!==(r=null===(o=this.video_)||void 0===o?void 0:o.currentTime)&&void 0!==r?r:0)}},{key:"isSkippable",value:function(){return"number"==typeof this.skipOffset_}},{key:"getTimeUntilSkippable",value:function(){if("number"!=typeof this.skipOffset_)return this.getRemainingTime();var e=this.getRemainingTime()+this.skipOffset_-this.getDuration();return Math.max(e,0)}},{key:"canSkipNow",value:function(){return 0===this.getTimeUntilSkippable()}},{key:"skip",value:function(){this.isSkipped_=!0,this.video_&&(this.video_.currentTime+=this.getRemainingTime())}},{key:"isLinear",value:function(){return!0}},{key:"getSequenceLength",value:function(){return this.totalAds_||1}},{key:"getPositionInSequence",value:function(){return this.adPosition_||1}},{key:"getTitle",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.adTitle)||""}},{key:"getVastAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.vastAdId)||""}},{key:"getAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.adId)||""}},{key:"getCreativeAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.creativeId)||""}},{key:"getTimeOffset",value:function(){var e,n;return null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.startTimeInSeconds)&&void 0!==e?e:0}},{key:"release",value:function(){this.ad_=null,this.adPosition_=null,this.totalAds_=null}},{key:"isSkipped",value:function(){return this.isSkipped_}}]),e}(),et="impression",nt="start",tt="mute",it="unmute",rt="resume",ot="pause",at="firstQuartile",lt="midpoint",st="thirdQuartile",dt="complete",ut="skip",ct="breakStart",vt="breakEnd",ft="skipStateChanged",pt="ad_impression",mt="ad_started",ht="ad_muted",gt="ad_volume_changed",yt="ad_resumed",wt="ad_paused",Tt="ad_first_quartile",bt="ad_midpoint",_t="ad_third_quartile",It="ad_complete",Et="ad_stopped",St="ad_skipped",kt="ad_skip_state_changed",At="ad_break_started",Ot="ad_break_ended",Pt="ads_loaded",Dt="ad_cuepoints_changed";function Lt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Ct(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Lt(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Lt(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}function xt(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 Ft(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)?Ft(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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 o,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,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function Ft(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=Array(n);t<n;t++)i[t]=e[t];return i}var jt="[Transmit]";function Rt(e){var n,t,i;if(null==e)return{avails:[],nextToken:null,dashAvailabilityStartTime:null};var r=null!==(n=e.dashAvailabilityStartTime)&&void 0!==n?n:null,o=null!==(t=e.nextToken)&&void 0!==t?t:null,a=[];if(Array.isArray(e.avails))a=e.avails;else if(Array.isArray(e)){var l,s,d,u,c=e[0];if(c&&Array.isArray(c.avails))a=c.avails,r=null!==(l=null!==(s=r)&&void 0!==s?s:c.dashAvailabilityStartTime)&&void 0!==l?l:null,o=null!==(d=null!==(u=o)&&void 0!==u?u:c.nextToken)&&void 0!==d?d:null;else a=e}else if(Array.isArray(null==e||null===(i=e.data)||void 0===i?void 0:i.avails)){var v,f,p,m;a=e.data.avails,o=null!==(v=null!==(f=o)&&void 0!==f?f:e.data.nextToken)&&void 0!==v?v:null,r=null!==(p=null!==(m=r)&&void 0!==m?m:e.data.dashAvailabilityStartTime)&&void 0!==p?p:null}else Array.isArray(null==e?void 0:e.data)&&(a=e.data);return{avails:a,nextToken:o,dashAvailabilityStartTime:r}}var Mt=function(){function e(n,t,i){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};p(this,e),this.video_=n,this.player_=t,this.onEvent_="function"==typeof i?i:function(){},this.dashManifestUrl_=o.dashManifestUrl||null,this.config_=null,this.trackingUrl_="",this.firstTrackingRequest_=!0,this.nextToken_=null,this.dashAvailabilityStartTime_=0,this.dashAvailabilityStartTimeResolved_=!1,this.pollIntervalMs_=2e3,this.pollId_=null,this.adBreaks_=[],this.ad_=null,this.transmitAd_=null,this.transmitAdBreak_=null,this.eventsSent_=new Set,this.firedBeacons_=new Set,this.adBreakListenersAttached_=!1,this.globalListeners_=[],this.adListeners_=[],this.videoTimeupdate_=null,this.lastMutedForAd_=null,this.onDispose_=function(){return r.release()},this.apiTimelineAbsolute_=!1}var i,r,a;return m(e,[{key:"configure",value:function(e){this.config_=e}},{key:"addTrackingUrl",value:function(e){this.trackingUrl_=e||"",this.onEvent_({type:Pt,loadTime:0})}},{key:"getCuePoints",value:function(){var e,n=new Map,t=xt(this.adBreaks_);try{for(t.s();!(e=t.n()).done;){var i,r=xt(e.value.ads||[]);try{for(r.s();!(i=r.n()).done;){var o=i.value,a=o.startTimeInSeconds,l=a+o.durationInSeconds;if(isFinite(a)&&isFinite(l)&&!(l<=a)){var s="".concat(a.toFixed(1),"|").concat(l.toFixed(1));n.has(s)||n.set(s,{start:a,end:l})}}}catch(e){r.e(e)}finally{r.f()}}}catch(e){t.e(e)}finally{t.f()}return Array.from(n.values()).sort(function(e,n){return e.start-n.start})}},{key:"onManifestUpdated",value:function(){this.trackingUrl_&&(this.requestTrackingInfo_(this.firstTrackingRequest_),this.firstTrackingRequest_=!1,this.ensurePolling_())}},{key:"stop",value:function(){this.onEnded_(),this.detachAllListeners_(),this.eventsSent_.clear(),this.firedBeacons_.clear(),this.trackingUrl_="",this.firstTrackingRequest_=!0,this.nextToken_=null,this.dashAvailabilityStartTime_=0,this.dashAvailabilityStartTimeResolved_=!1,this.apiTimelineAbsolute_=!1,this.adBreaks_=[],this.adBreakListenersAttached_=!1,this.pollId_&&(clearInterval(this.pollId_),this.pollId_=null)}},{key:"release",value:function(){this.stop()}},{key:"ensurePolling_",value:function(){var e=this;this.pollId_||(this.pollId_=setInterval(function(){var n,t;e.trackingUrl_&&(null!==(n=e.player_)&&void 0!==n&&null!==(t=n.paused)&&void 0!==t&&t.call(n)||e.requestTrackingInfo_(!1))},this.pollIntervalMs_))}},{key:"requestTrackingInfo_",value:(a=n(t.mark(function e(n){var i,r,o,a,l,s,d,u,c,v,f,p,m,h,g,y,w;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,r=new Map,o=0,a=null;case 4:if(!(o<10)){e.next=25;break}return l=new URL(this.trackingUrl_),this.nextToken_&&l.searchParams.set("nextToken",this.nextToken_),e.next=9,fetch(l.toString(),{method:"GET"});case 9:return s=e.sent,e.next=12,s.json();case 12:d=e.sent,o++,(u=Rt(d)).dashAvailabilityStartTime&&!a&&(a=u.dashAvailabilityStartTime),c=xt(u.avails);try{for(c.s();!(v=c.n()).done;)f=v.value,p=(null==f?void 0:f.availId)||"".concat(null==f?void 0:f.startTimeInSeconds),r.set(p,f)}catch(e){c.e(e)}finally{c.f()}if((m=u.nextToken||null)&&m!==this.nextToken_){e.next=22;break}return this.nextToken_=m,e.abrupt("break",25);case 22:this.nextToken_=m,e.next=4;break;case 25:if(h=Array.from(r.values()),this.updateApiTimelineAbsoluteFlag_(h),g=(null==h||null===(i=h[0])||void 0===i?void 0:i.startTimeInSeconds)||0,this.apiTimelineAbsolute_){e.next=33;break}return e.next=31,this.resolveDashAvailabilityStartTime_(a,g);case 31:e.next=35;break;case 33:this.dashAvailabilityStartTimeResolved_=!0,this.dashAvailabilityStartTime_=0;case 35:h.length?(y=this.normalizeAvails_(h),$n(this.adBreaks_)!==$n(y)&&(this.adBreaks_=y,w=this.getCuePoints(),this.onEvent_({type:Dt,cuepoints:w}))):this.adBreaks_.length&&(this.onEvent_({type:Dt,cuepoints:[]}),this.onEnded_(),this.adBreaks_=[]),n&&this.setupAdBreakListeners_(),e.next=42;break;case 39:e.prev=39,e.t0=e.catch(0),console.warn(jt,"tracking info fetch failed",e.t0);case 42:case"end":return e.stop()}},e,this,[[0,39]])})),function(e){return a.apply(this,arguments)})},{key:"updateApiTimelineAbsoluteFlag_",value:function(e){this.apiTimelineAbsolute_=!1;var n,t=1e6,i=xt(e||[]);try{for(i.s();!(n=i.n()).done;){var r,o=n.value;if((null!==(r=null==o?void 0:o.startTimeInSeconds)&&void 0!==r?r:0)>t)return void(this.apiTimelineAbsolute_=!0);var a,l=xt((null==o?void 0:o.ads)||[]);try{for(l.s();!(a=l.n()).done;){var s,d=a.value;if((null!==(s=null==d?void 0:d.startTimeInSeconds)&&void 0!==s?s:0)>t)return void(this.apiTimelineAbsolute_=!0)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){i.e(e)}finally{i.f()}}},{key:"normalizeAvails_",value:function(e){var n=this,t=this.apiTimelineAbsolute_?0:this.dashAvailabilityStartTime_||0;return e.map(function(e){var i=n.resolveAbsoluteStart_(e,t,null);return Ct(Ct({},e),{},{startTimeInSeconds:i,ads:(e.ads||[]).map(function(r){return Ct(Ct({},r),{},{startTimeInSeconds:n.resolveAbsoluteStart_(r,t,e,i)})})})})}},{key:"resolveAbsoluteStart_",value:function(e,n,t,i){var r=null==e?void 0:e.adProgramDateTime;if(r){var o=new Date(r).getTime()/1e3;if(isFinite(o)&&o>0)return o}return null!=t&&t.adProgramDateTime&&"number"==typeof i?i+((e.startTimeInSeconds||0)-(t.startTimeInSeconds||0)):(e.startTimeInSeconds||0)+n}},{key:"resolveDashAvailabilityStartTime_",value:(r=n(t.mark(function e(n,i){var r,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.dashAvailabilityStartTimeResolved_){e.next=2;break}return e.abrupt("return");case 2:if(!n){e.next=8;break}if(r=new Date(n).getTime()/1e3,!(isFinite(r)&&r>0)){e.next=8;break}return this.dashAvailabilityStartTime_=r,this.dashAvailabilityStartTimeResolved_=!0,e.abrupt("return");case 8:if(!(i>0)){e.next=13;break}return e.next=11,this.fetchDashAvailabilityStartTimeFromMpd_();case 11:(o=e.sent)>0&&(this.dashAvailabilityStartTime_=o,this.dashAvailabilityStartTimeResolved_=!0);case 13:case"end":return e.stop()}},e,this)})),function(e,n){return r.apply(this,arguments)})},{key:"fetchDashAvailabilityStartTimeFromMpd_",value:(i=n(t.mark(function e(){var n,i,r,o,a,l;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,(i=this.dashManifestUrl_||this.getCurrentSourceUrl_())&&i.includes(".mpd")){e.next=4;break}return e.abrupt("return",0);case 4:return e.next=6,fetch(i);case 6:return r=e.sent,e.next=9,r.text();case 9:return o=e.sent,a=(new DOMParser).parseFromString(o,"application/xml"),l=null===(n=a.querySelector("MPD"))||void 0===n?void 0:n.getAttribute("availabilityStartTime"),e.abrupt("return",l?new Date(l).getTime()/1e3:0);case 15:return e.prev=15,e.t0=e.catch(0),console.warn(jt,"MPD availabilityStartTime parse failed",e.t0),e.abrupt("return",0);case 19:case"end":return e.stop()}},e,this,[[0,15]])})),function(){return i.apply(this,arguments)})},{key:"getCurrentSourceUrl_",value:function(){try{var e,n,t,i,r=(null===(e=this.player_)||void 0===e||null===(n=e.currentSrc)||void 0===n?void 0:n.call(e))||(null===(t=this.player_)||void 0===t||null===(i=t.src)||void 0===i?void 0:i.call(t));return"string"==typeof r?r:(null==r?void 0:r.src)||""}catch(e){return""}}},{key:"setupAdBreakListeners_",value:function(){var e=this;if(!this.adBreakListenersAttached_){this.adBreakListenersAttached_=!0,this.onTimeupdate_();this.attachGlobalListener_("timeupdate",function(){return e.onTimeupdate_()}),this.attachGlobalListener_("dispose",this.onDispose_),this.video_&&(this.videoTimeupdate_=function(){return e.onTimeupdate_()},this.video_.addEventListener("timeupdate",this.videoTimeupdate_))}}},{key:"isHlsSource_",value:function(){var e,n,t=this.getCurrentSourceUrl_().toLowerCase(),i=((null===(e=this.player_)||void 0===e||null===(n=e.currentType)||void 0===n?void 0:n.call(e))||"").toLowerCase();return t.includes(".m3u8")||"application/x-mpegurl"===i||"application/vnd.apple.mpegurl"===i}},{key:"isDashSource_",value:function(){var e,n,t=this.getCurrentSourceUrl_().toLowerCase();return"application/dash+xml"===((null===(e=this.player_)||void 0===e||null===(n=e.currentType)||void 0===n?void 0:n.call(e))||"").toLowerCase()||t.includes(".mpd")}},{key:"getDashMediaPlayerTimelineSeconds_",value:function(){try{var e,n,t=null===(e=this.player_)||void 0===e||null===(n=e.dash)||void 0===n?void 0:n.mediaPlayer;if(!t||"function"!=typeof t.time)return null;var i=t.time();return"number"==typeof i&&isFinite(i)&&i>1e6?i:null}catch(e){return null}}},{key:"getCurrentTime_",value:function(){var e,n,t,i=null!==(e=null===(n=this.video_)||void 0===n?void 0:n.currentTime)&&void 0!==e?e:0,r=o.detectBrowser();if(this.isHlsSource_()){var a,l,s=i,d=null===(a=this.player_)||void 0===a||null===(l=a.seekable)||void 0===l?void 0:l.call(a);return d&&d.length>0&&(s=d.end(d.length-1)),Date.now()/1e3-(s-i)}if(this.isDashSource_()){var u,c,v,f=this.getDashMediaPlayerTimelineSeconds_();if(null!=f)return f;var p=null===(u=this.player_)||void 0===u||null===(c=u.seekable)||void 0===c?void 0:c.call(u),m="function"==typeof(null===(v=this.player_)||void 0===v?void 0:v.currentTime)?this.player_.currentTime():i;if(p&&p.length>0){var h=p.start(0);if(h>1e6&&h+m>1e6)return h+m}if(this.apiTimelineAbsolute_&&(this.dashAvailabilityStartTime_||0)>1e9)return(this.dashAvailabilityStartTime_||0)+m}return"Safari"===r?i:"function"==typeof(null===(t=this.player_)||void 0===t?void 0:t.currentTime)?this.player_.currentTime():i}},{key:"onTimeupdate_",value:function(){if(this.ad_||this.adBreaks_.length){var e=this.getCurrentTime_();if(this.ad_){var n,t;this.sendInProgressEvents_(e,this.transmitAd_);var i=this.ad_.getDuration(),r=(null!==(n=null===(t=this.transmitAd_)||void 0===t?void 0:t.startTimeInSeconds)&&void 0!==n?n:0)+i,o=r-e;this.ad_.canSkipNow()&&o>0&&i>0&&this.sendTrackingEvent_(ft),i>0&&e>=r&&this.onEnded_()}this.ad_||this.checkLinearAds_(e)}}},{key:"sendInProgressEvents_",value:function(e,n){if(n){var t=n.startTimeInSeconds+.25*n.durationInSeconds,i=n.startTimeInSeconds+.5*n.durationInSeconds,r=n.startTimeInSeconds+.75*n.durationInSeconds;e>=t&&!this.eventsSent_.has(at)&&(this.eventsSent_.add(at),this.sendTrackingEvent_(at)),e>=i&&!this.eventsSent_.has(lt)&&(this.eventsSent_.add(lt),this.sendTrackingEvent_(lt)),e>=r&&!this.eventsSent_.has(st)&&(this.eventsSent_.add(st),this.sendTrackingEvent_(st))}}},{key:"flushPendingQuartiles_",value:function(){for(var e=0,n=[at,lt,st];e<n.length;e++){var t=n[e];this.eventsSent_.has(t)||(this.eventsSent_.add(t),this.sendTrackingEvent_(t))}}},{key:"checkLinearAds_",value:function(e){var n,t=xt(this.adBreaks_);try{for(t.s();!(n=t.n()).done;){var i=n.value;if(this.ad_)break;for(var r=i.ads||[],o=0;o<r.length;o++){var a=r[o],l=a.startTimeInSeconds,s=l+a.durationInSeconds;if(l<=e&&s>e){this.onEnded_(),this.transmitAdBreak_=i,this.transmitAd_=a,this.ad_=new Zn(a,o+1,r.length,this.video_),0===o&&this.sendTrackingEvent_(ct),this.setupCurrentAdListeners_();break}}}}catch(e){t.e(e)}finally{t.f()}}},{key:"onEnded_",value:function(){this.ad_&&this.transmitAd_&&(this.ad_.isSkipped()||this.flushPendingQuartiles_(),this.removeCurrentAdListeners_(this.ad_.isSkipped()),this.ad_.getPositionInSequence()===this.ad_.getSequenceLength()&&this.sendTrackingEvent_(vt),this.ad_=null,this.transmitAd_=null,this.transmitAdBreak_=null)}},{key:"setupCurrentAdListeners_",value:function(){var e,n,t,i,r,o=this,a=!1;null!==(e=this.player_)&&void 0!==e&&null!==(n=e.paused)&&void 0!==n&&n.call(e)?a=!0:(this.sendTrackingEvent_(et),this.sendTrackingEvent_(nt)),this.lastMutedForAd_=null!==(t=null===(i=this.player_)||void 0===i||null===(r=i.muted)||void 0===r?void 0:r.call(i))&&void 0!==t&&t,this.attachAdListener_("volumechange",function(){var e,n,t,i=null!==(e=null===(n=o.player_)||void 0===n||null===(t=n.muted)||void 0===t?void 0:t.call(n))&&void 0!==e&&e;i!==o.lastMutedForAd_&&(o.lastMutedForAd_=i,i?o.sendTrackingEvent_(tt):o.sendTrackingEvent_(it))}),this.attachAdListener_("play",function(){a?(o.sendTrackingEvent_(et),o.sendTrackingEvent_(nt),a=!1):o.sendTrackingEvent_(rt)}),this.attachAdListener_("pause",function(){o.sendTrackingEvent_(ot)})}},{key:"removeCurrentAdListeners_",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.sendTrackingEvent_(e?ut:dt),this.detachAdListeners_(),this.eventsSent_.clear()}},{key:"attachGlobalListener_",value:function(e,n){this.player_&&(this.player_.on(e,n),this.globalListeners_.push({event:e,handler:n}))}},{key:"attachAdListener_",value:function(e,n){this.player_&&(this.player_.on(e,n),this.adListeners_.push({event:e,handler:n}))}},{key:"detachAdListeners_",value:function(){var e,n=xt(this.adListeners_);try{for(n.s();!(e=n.n()).done;){var t,i,r=e.value,o=r.event,a=r.handler;null===(t=this.player_)||void 0===t||null===(i=t.off)||void 0===i||i.call(t,o,a)}}catch(e){n.e(e)}finally{n.f()}this.adListeners_=[]}},{key:"detachAllListeners_",value:function(){this.detachAdListeners_();var e,n=xt(this.globalListeners_);try{for(n.s();!(e=n.n()).done;){var t,i,r=e.value,o=r.event,a=r.handler;null===(t=this.player_)||void 0===t||null===(i=t.off)||void 0===i||i.call(t,o,a)}}catch(e){n.e(e)}finally{n.f()}this.globalListeners_=[],this.video_&&this.videoTimeupdate_&&(this.video_.removeEventListener("timeupdate",this.videoTimeupdate_),this.videoTimeupdate_=null)}},{key:"startComscoreForCurrentAd_",value:function(){try{var e=Sn.get();if(!e||0===Object.keys(e).length)return;var n=e.formulateComscoreAdPayload,t=e.startComscoreAdTracking,i=Ln.get();t(n(Ct(Ct({},this.transmitAd_),{},{trackingUrl:i})))}catch(e){console.warn(jt,"comscore start failed",e)}}},{key:"sendTrackingEvent_",value:function(e){var n,t=this;if(this.transmitAd_&&this.transmitAdBreak_){var i=(this.transmitAd_.trackingEvents||[]).find(function(n){return n.eventType===e});if(i||(i=(this.transmitAdBreak_.adBreakTrackingEvents||[]).find(function(n){return n.eventType===e})),i&&(null===(n=this.config_)||void 0===n||!n.disableTrackingEvents)){var r,o,a,l=(null===(r=this.transmitAd_)||void 0===r?void 0:r.adId)||(null===(o=this.transmitAdBreak_)||void 0===o?void 0:o.availId)||"unknown",s=xt(i.beaconUrls||[]);try{var d=function(){var n=a.value;if(!n)return"continue";var i="".concat(l,"|").concat(e,"|").concat(n);if(t.firedBeacons_.has(i))return"continue";t.firedBeacons_.add(i),fetch(n,{mode:"no-cors"}).catch(function(e){console.warn(jt,"beacon failed",n,e)})};for(s.s();!(a=s.n()).done;)d()}catch(e){s.e(e)}finally{s.f()}}var u=Sn.get(),c=u&&Object.keys(u).length?u:null;switch(e){case et:this.onEvent_({type:pt}),this.startComscoreForCurrentAd_();break;case nt:this.onEvent_({type:mt,ad:this.ad_});break;case tt:this.onEvent_({type:ht});break;case it:this.onEvent_({type:gt});break;case rt:this.onEvent_({type:yt});break;case ot:this.onEvent_({type:wt});break;case at:this.onEvent_({type:Tt});break;case lt:this.onEvent_({type:bt});break;case st:this.onEvent_({type:_t});break;case dt:this.onEvent_({type:It}),this.onEvent_({type:Et}),null!=c&&c.finishComscoreAdTracking&&c.finishComscoreAdTracking();break;case ut:this.onEvent_({type:St}),this.onEvent_({type:Et});break;case ct:this.onEvent_({type:At});break;case vt:this.onEvent_({type:Ot}),null!=c&&c.endComscoreAdTracking&&c.endComscoreAdTracking();break;case ft:this.onEvent_({type:kt})}}else console.warn(jt,"sendTrackingEvent_ skipped — no active ad",{eventType:e})}}]),e}();function Vt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Nt(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Vt(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Vt(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var Ut={dash:"tracking/initialize/dash",hls:"tracking/initialize/hls"};function Wt(e){if(null==e||!e.src)return null;var n=(e.type||"").toLowerCase(),t=String(e.src).toLowerCase();return"application/dash+xml"===n||t.includes(".mpd")?"dash":"application/x-mpegurl"===n||"application/vnd.apple.mpegurl"===n||t.includes(".m3u8")?"hls":null}function Bt(e,n,t){return Ht.apply(this,arguments)}function Ht(){return(Ht=n(t.mark(function e(n,i,r){var o,a,l,s,d,u,c,v,f,p,m;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=Wt(n)){e.next=3;break}return e.abrupt("return",n);case 3:return a=Ze(n.src,r,i),l=a.replace(o,Ut[o]),console.log("[Transmit] session init →",l),e.prev=6,e.next=9,fetch(l,{method:"GET",redirect:"follow"});case 9:return s=e.sent,e.next=12,s.json();case 12:if(d=e.sent,console.log("[Transmit] session response",d),u="dash"===o?null==d?void 0:d.dashUrl:null==d?void 0:d.hlsUrl,c=null==d?void 0:d.trackingUrl,u&&c){e.next=18;break}return e.abrupt("return",n);case 18:return v=new URL(l),f=v.hostname,p="https://".concat(f).concat(u),m="https://".concat(f).concat(c),Ln.set(m),console.log("[Transmit] session ready",{manifestUrl:p,trackingUrl:m}),e.abrupt("return",Nt(Nt({},n),{},{src:p}));case 26:return e.prev=26,e.t0=e.catch(6),console.warn("[Transmit] session init failed",e.t0),e.abrupt("return",n);case 30:case"end":return e.stop()}},e,null,[[6,26]])}))).apply(this,arguments)}var qt=null;function Gt(e,n){var t;if(qt)return console.log("[Transmit] initializeTransmit skipped — manager already initialised"),qt;var i=Ln.get();if(!i)return console.warn("[Transmit] initializeTransmit skipped — no tracking URL"),null;var r=a.getPlayer(e);if(!r)return console.warn("[Transmit] initializeTransmit skipped — no player"),null;var o=(null===(t=r.el())||void 0===t?void 0:t.querySelector("video"))||null,l=function(e){try{var n="function"==typeof(null==e?void 0:e.currentSrc)&&e.currentSrc()||"function"==typeof(null==e?void 0:e.src)&&e.src()||"";if("application/dash+xml"===("function"==typeof(null==e?void 0:e.currentType)&&e.currentType()||"")||String(n).includes(".mpd"))return n}catch(e){}return null}(r);return(qt=new Mt(o,r,function(e){var t,i;console.log("[Transmit] ad event",e);var r=null==n||null===(t=n.customData)||void 0===t||null===(i=t.ads)||void 0===i?void 0:i.adEventHandler;if("function"==typeof r)try{r(e)}catch(e){console.warn("[Transmit] adEventHandler threw",e)}},{dashManifestUrl:l})).configure({disableTrackingEvents:!1}),qt.addTrackingUrl(i),qt.onManifestUpdated(),qt}function Yt(){qt&&(qt.release(),qt=null)}function zt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Qt(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?zt(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):zt(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var Kt,Xt="player-control-action",Jt={PAUSE:"Pause",RESUME:"Resume",REPLAY:"Replay",DVR_SCRUB:"DVR Scrub",GO_LIVE:"Go Live",CC_ON:"CC On",CC_OFF:"CC Off",FULLSCREEN_ENTER:"Full Screen Enter",FULLSCREEN_EXIT:"Full Screen Exit",MUTE:"Mute",UNMUTE:"Unmute"},$t=new Map,Zt=function(e){try{return!!e.muted()||0===e.volume()}catch(e){return!1}},ei=function(e){try{for(var n=e.textTracks(),t=0;t<n.length;t+=1){var i=n[t];if(("captions"===i.kind||"subtitles"===i.kind)&&"showing"===i.mode)return!0}}catch(e){}return!1},ni=function(e){try{return!!e.ads&&"function"==typeof e.ads.isInAdMode&&e.ads.isInAdMode()}catch(e){return!1}};function ti(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&n){var i=0;try{i=e.currentTime()||0}catch(e){}e.trigger(Xt,Qt({playeraction:n,at:i},t))}}function ii(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=$t.get(e);t&&(n.pause&&(t.expectPause+=n.pause),n.play&&(t.expectPlay+=n.play))}function ri(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function oi(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ri(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):ri(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var ai=[],li=0,si=null;function di(){Kt=null,ai=[],li=0,si=null}function ui(n,t,i){var r,o,a,l,s,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==t||null===(r=t.watchHistory)||void 0===r||r.apiVersion;var u=null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.profileId,c=Math.floor(n.currentTime()),v=Math.floor(n.duration());null==t||null===(a=t.watchHistory)||void 0===a||a.xapiKey;var f=(null==t||null===(l=t.video)||void 0===l?void 0:l.originalObjectId)||null,p=(null==t||null===(s=t.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,m=Math.floor(n.currentTime()),h=d?100:Math.floor(c/v*100),g={};p?function(n,t,i){var r=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(i),o=ci(r),a=(new Date).getTime(),l=ue(),s=(null==l?void 0:l.video)||{},d=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(n,t){return oi(oi({},n),{},e({},t,s[t]))},{}),u=o.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===Kt});u<0?o.push(oi(oi({content:d},n),{},{addedDate:a,updateDate:a})):o[u]=oi(oi(oi({},o[u]),n),{},{updateDate:a});localStorage.setItem("".concat(r),JSON.stringify(o))}(g={completed:d,watchedTime:m,watchedPercentage:h},u,t.siteOwner):(g=oi(oi({videoId:Kt,watchedTime:m,watchedPercentage:h,doneWatching:d,profileId:u},si&&{seriesId:si}),f&&{originalObjectId:f}),q(g).then(function(e){}).catch(function(e){})),li=c+i}function ci(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function vi(e,n){setTimeout(function(){e.currentTime(n)},0),e.one("playing",function(){e.currentTime()<n-1&&e.currentTime(n)})}function fi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}var pi=function(e,n){var t=i(e),r=t.currentTime()+n;t.currentTime(r)},mi=function(e,n){var t=i(e),r=t.currentTime(),o=r<=n?0:r-n;t.currentTime(o)},hi=function(e){return!!i.getPlayer("".concat(e))},gi=function(){var e=n(t.mark(function e(i,r){var l,s,d,u,c=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=c.length>2&&void 0!==c[2]&&c[2],e.next=3,ae();case 3:return s=e.sent,d=a.getPlayer(i),u=o.playerConfigManager.getConfig(),e.abrupt("return",new Promise(function(e,o){H(r,s).then(function(){var o=n(t.mark(function n(o){var a,s,c,v,f,p,m,h,g,y,w;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(Yt(),(p=null==o?void 0:o.data).contentType="linearchannel",p.channelId=null==r?void 0:r.channelId,m=(null===(a=window.customData)||void 0===a?void 0:a.ads)||(null===(s=window)||void 0===s||null===(c=s.app_data)||void 0===c||null===(v=c.appcmsMain)||void 0===v?void 0:v.adsConfig)||{},h=!(null==p||null===(f=p.linearchannel)||void 0===f||!f.isSSAIEnabled),g=h&&"MEDIA_TAILOR"==(null==m?void 0:m.vodAdSticherProvider),y=h&&"TRANSMIT"==(null==m?void 0:m.liveAdSticherProvider)&&!(null==m||!m.liveAdClientSideTracking),w=nn(p,i),!g){n.next=16;break}return n.next=12,Cn(i,p);case 12:w=n.sent,l=!0,n.next=21;break;case 16:if(!y){n.next=21;break}return n.next=19,Bt(w,p,i);case 19:w=n.sent,l=!0;case 21:de(p),w&&l?(Oe(),He(i,{analyticsCb:null==u?void 0:u.analyticsCb,analyticsEventParams:null==u?void 0:u.analyticsEventParams,userId:null==u?void 0:u.userId}),Ti(i,w),y?Gt(i,{customData:window.customData||{ads:m}}):g&&Kn(i),d.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:p})})):(Sn.get()&&0!==Object.keys(Sn.get()).length&&kn({playerId:i,comscore:{enable:!0}}),e({status:!0,msg:"Feed authenticated",response:p}));case 23:case"end":return n.stop()}},n)}));return function(e){return o.apply(this,arguments)}}()).catch(function(e){o({status:!1,msg:"Cannot load feed",response:e})})}));case 7:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),yi=function(){var e=n(t.mark(function e(i,r,l){var s,u,c,v,f,p,m,h;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ae();case 2:return v=e.sent,f=o.playerConfigManager.getConfig(),console.log("load video"),(ce()||null)&&fe(r),p=0,m=0,h=null,null!==(s=window)&&void 0!==s&&s.watchHistory&&null!==(u=window)&&void 0!==u&&null!==(c=u.watchHistory)&&void 0!==c&&c.enable&&G(r,v).then(function(e){var n,t,i,r,o,a,l,s,d;(null===(n=window)||void 0===n||null===(t=n.watchHistory)||void 0===t||!t.cb||null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.isExternal||null===(o=window)||void 0===o||null===(a=o.watchHistory)||void 0===a||a.cb(null==e?void 0:e.data),p=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,(m=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedPercentage)||null)<95)&&(h=(null==e||null===(d=e.data)||void 0===d?void 0:d.watchedTime)||null)}).catch(function(){}),e.abrupt("return",new Promise(function(e,o){B(r,v).then(function(){var r=n(t.mark(function n(r){var l,s,u,c,v,g,y,w,T,b,_,I,E,S,k,A,O,P,D,L,C,x,F,j,R,M,V,N,U,W,B,H,q,G,Y,z,Q,K,X,J,$;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(A=null==r?void 0:r.data,O=(null==A?void 0:A.contentType)||"video",P=(null===(l=window.customData)||void 0===l?void 0:l.ads)||(null===(s=window)||void 0===s||null===(u=s.app_data)||void 0===u||null===(c=u.appcmsMain)||void 0===c?void 0:c.adsConfig)||{},D=!(null==A||null===(v=A[O])||void 0===v||!v.isSSAIEnabled),L=D&&"MEDIA_TAILOR"==(null==P?void 0:P.vodAdSticherProvider),C=D&&"TRANSMIT"==(null==P?void 0:P.liveAdSticherProvider)&&!(null==P||!P.liveAdClientSideTracking),x=!(null==A||null===(g=A[O])||void 0===g||null===(y=g.streamingInfo)||void 0===y||!y.isLiveStream)||"linearchannel"===O,de(r.data),(F=(null==A||null===(w=A.ads)||void 0===w||null===(T=w.preRoll)||void 0===T||null===(b=T.adTags)||void 0===b||null===(_=b.web)||void 0===_?void 0:_.active)&&(null==A||null===(I=A.ads)||void 0===I||null===(E=I.preRoll)||void 0===E||null===(S=E.adTags)||void 0===S||null===(k=S.web)||void 0===k?void 0:k.url))&&un(i,F,A),j=nn(A,i),!L){n.next=17;break}return n.next=14,Cn(i,A);case 14:j=n.sent,n.next=22;break;case 17:if(!C||!x){n.next=22;break}return Yt(),n.next=21,Bt(j,A,i);case 21:j=n.sent;case 22:if(!j){n.next=40;break}if(Y=(null==A||null===(R=A.video)||void 0===R||null===(M=R.gist)||void 0===M?void 0:M.videoImageUrl)||(null==A||null===(V=A.video)||void 0===V||null===(N=V.gist)||void 0===N||null===(U=N.imageGist)||void 0===U?void 0:U.r16x9),z=a.getPlayer(i)){n.next=28;break}return console.error("[VL][player-core] player not found for id=".concat(i),{player:z}),n.abrupt("return",o({status:!1,msg:"Player not found",response:{}}));case 28:z.poster(Y),Oe(),He(i,{analyticsCb:null==f?void 0:f.analyticsCb,analyticsEventParams:null==f?void 0:f.analyticsEventParams,userId:null==f?void 0:f.userId}),Ti(i,j),C&&x?Gt(i,{customData:window.customData||{ads:P}}):L&&Un(i,h),z.on("loadstart",function(){x&&e({status:!0,msg:"Video Loaded",response:A})}),z.on("loadeddata",function(){sn(),e({status:!0,msg:"Video Loaded",response:A})}),z.one("play",function(){!p||L||C&&x||m<95&&vi(z,p)}),z.one("error",function(){var e;o({status:!1,msg:(null==z||null===(e=z.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==A||null===(W=A.video)||void 0===W||null===(B=W.contentDetails)||void 0===B||null===(H=B.closedCaptions)||void 0===H?void 0:H.length)>0||(null==A||null===(q=A.video)||void 0===q||null===(G=q.closedCaptions)||void 0===G?void 0:G.length)>0?($=(null==A||null===(K=A.video)||void 0===K||null===(X=K.contentDetails)||void 0===X?void 0:X.closedCaptions)||(null==A||null===(J=A.video)||void 0===J?void 0:J.closedCaptions),Q=$.filter(function(e){return"VTT"===e.format}),d.addCaptions(i,Q)):d.removeCaptions(i),n.next=42;break;case 40:ln(i,"Incompatible Source, only hls,mp4,drm content is allowed"),o("Incompatible Source, only hls,mp4,drm content is allowed");case 42:case"end":return n.stop()}},n)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){bi(e,i,o,r)})}));case 12:case"end":return e.stop()}},e)}));return function(n,t,i){return e.apply(this,arguments)}}(),wi=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()},Ti=function(e,n){console.log("load video in core",n);var t=a.getPlayer(e);t&&t.src(n)},bi=function(n,t,i,r){var o,a,l,s,d,u,c=null==n||null===(o=n.response)||void 0===o||null===(a=o.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);hi(t)&&ln(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[c])||"".concat(v)),i&&i(function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?fi(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):fi(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))};exports.PLAYER_ACTIONS=Jt,exports.authenticateLC=gi,exports.baseUrlManager=z,exports.classifyRequestKind=function(e,n){var t=String(n||"").toLowerCase();if(t.includes("license"))return"license";if(t.includes("certificate"))return"server_certificate";if(t.includes("manifest"))return"manifest";if(t.includes("key"))return"key";if(t.includes("segment")||t.includes("media"))return"segment";var i=String(e||"").split("?")[0].toLowerCase();return i.endsWith(".mpd")||i.endsWith(".m3u8")||i.endsWith(".ism/manifest")?"manifest":/\.(m4s|mp4|m4a|m4v|ts|aac|webm|cmf[av]|mp4a)$/.test(i)?"segment":/license|widevine|playready|fairplay|drm/.test(i)?"license":/cert|certificate/.test(i)?"server_certificate":/\.key($|\?)/.test(i)||/\/key\//.test(i)?"key":"other"},exports.clearError=sn,exports.comscoreInstanceManager=Sn,exports.createIdxMapping=function(e){ee=new Map,e.map(function(e,n){ee.set(e.id,n)})},exports.createSeriesWatchMap=function(e,n){var t=new Map;Y({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),ne=t}).catch(function(e){return console.log(e)})},exports.disableControls=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")},exports.dispose=function(e){Yt();var n=a.getPlayer(e),t=(Sn.get()||{}).destroyComscoreTag;if(wi(),t&&t(),a.clearEventListeners(),window.onresize=null,n)n.dispose();else{var i=document.getElementById(e);i&&i.remove()}},exports.emitApiErrorEvent=C,exports.extractStatusCode=function(e,n){for(var t=0,i=[null==e?void 0:e.statusCode,null==e?void 0:e.status,null==e?void 0:e.code,null==n?void 0:n.statusCode,null==n?void 0:n.status,null==n?void 0:n.code];t<i.length;t++){var r=Number(i[t]);if(Number.isFinite(r)&&r>0)return r}return null},exports.getCurrentSeries=ce,exports.getCurrentVideo=ue,exports.getDecodedToken=le,exports.getEntitlementData=function(e,n,t,i){var o,a;return r({url:t,params:F({id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==i?void 0:i.latitude,longitude:null==i?void 0:i.longitude},U("entitlementData")),method:"GET",headers:F({Authorization:n,adbTempToken:null===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.adbTempToken},N("entitlementData")),withCredentials:!0}).catch(function(n){throw C(t,n,"content",{videoId:e,url:t}),n})},exports.getEpisodeNumber=Ge,exports.getLinearChannelDetails=H,exports.getPlayerControlEvents=function(e){var n=a.getPlayer(e);return n?{onPlayerAction:function(e){var t=function(n,t){return e(t)};return n.on(Xt,t),function(){return n.off(Xt,t)}}}:(console.error("[PLAYER-CONTROL] Player instance not found"),{})},exports.getSGAIEnabledSource=Cn,exports.getSeasonNumber=qe,exports.getSeriesDetails=function(e,n){var t,i,o=le(n),a=(null==o?void 0:o.site)||null;if(null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.seriesData)return new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.seriesData})});var l=z.get()+"/v3/content/series/".concat(e);return r({url:l,params:F({site:a},U("series")),method:"GET",headers:F({Authorization:n},N("series"))}).catch(function(n){throw C(l,n,"content",{videoId:e}),n})},exports.getSeriesWatchHistory=Y,exports.getSeriesWatchMap=function(){return ne},exports.getSource=nn,exports.getSsaiEvents=function(e){var n=a.getPlayer(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var i=function(e,n){return t(n)};return n.on(e,i),function(){return n.off(e,i)}};return{adBreakStart:function(e){return t(fn,e)},adImpression:function(e){return t(pn,e)},adFirstQuartile:function(e){return t(mn,e)},adMidpoint:function(e){return t(hn,e)},adThirdQuartile:function(e){return t(gn,e)},adComplete:function(e){return t(yn,e)},adBreakEnd:function(e){return t(wn,e)}}},exports.getToken=ae,exports.getTransmitEnabledSource=Bt,exports.getUpdatedClusterSource=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:i}},exports.getUserId=Fe,exports.getVideoDetails=B,exports.getVideoIdx=function(){return Z},exports.getVideoInfo=G,exports.getWatchHistoryByIdFromStorage=function(e,n,t){var i=ci(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),r=[];return i&&Array.isArray(i)&&(r=i.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),r},exports.handleError=ln,exports.initPlayerControlEvents=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.liveVideo,r=void 0!==t&&t,o=n.isDvrEnabled,l=void 0!==o&&o,s=a.getPlayer(e);if(!s)return!1;var d=$t.get(e);if(d)return d.live=!!r,d.dvr=!!l,d.paused=!1,d.expectPause=0,d.expectPlay=0,d.pendingScrub=!1,d.muted=Zt(s),d.ccOn=ei(s),!0;var u={paused:!1,muted:Zt(s),ccOn:ei(s),expectPause:0,expectPlay:0,pendingScrub:!1,live:!!r,dvr:!!l};$t.set(e,u);var c=function(e,n){return ti(s,e,Qt({isLive:u.live},n))};return s.on("pause",function(){if(u.expectPause>0)return u.expectPause-=1,void(u.paused=!0);u.paused||s.ended()||ni(s)||(u.paused=!0,c(Jt.PAUSE))}),s.on("play",function(){if(u.expectPlay>0)return u.expectPlay-=1,void(u.paused=!1);u.paused&&(u.paused=!1,ni(s)||c(Jt.RESUME))}),s.on("volumechange",function(){var e=Zt(s);e!==u.muted&&(u.muted=e,c(e?Jt.MUTE:Jt.UNMUTE))}),s.on("fullscreenchange",function(){c(s.isFullscreen()?Jt.FULLSCREEN_ENTER:Jt.FULLSCREEN_EXIT)}),s.textTracks().on("change",function(){var e=ei(s);e!==u.ccOn&&(u.ccOn=e,c(e?Jt.CC_ON:Jt.CC_OFF))}),s.on(Xt,function(e,n){n&&n.playeraction===Jt.GO_LIVE&&(u.pendingScrub=!1,u.paused&&(u.expectPlay+=1))}),s.ready(function(){var e=s.controlBar&&s.controlBar.progressControl&&"function"==typeof s.controlBar.progressControl.el?s.controlBar.progressControl.el():null,n=function(e){if(function(e){var n=i.dom&&i.dom.isSingleLeftClick;return"function"!=typeof n||n(e)}(e)){var n=!function(e){var n=e&&e.target;return!(!n||"function"!=typeof n.closest||!n.closest(".".concat("vjs-chapter-marker")))}(e);u.pendingScrub=n,n&&!s.paused()&&(u.expectPause+=1,u.expectPlay+=1)}};e&&"function"==typeof e.addEventListener&&(e.addEventListener("mousedown",n,!0),e.addEventListener("touchstart",n,!0)),s.on("seeked",function(){u.pendingScrub&&(u.pendingScrub=!1,(u.live||u.dvr)&&c(Jt.DVR_SCRUB))});var t=s.controlBar?s.controlBar.getChild("SeekToLive"):null;t&&"function"==typeof t.on&&t.on("click",function(){return c(Jt.GO_LIVE)})}),s.on("dispose",function(){$t.delete(e)}),!0},exports.initialiseAdvertisement=un,exports.initialiseComscoreStreamingTracking=kn,exports.initialiseKeyboardEvents=function(e,n){var t,i,r,o=a.getPlayer(e),l=null==o||null===(t=o.controlBar)||void 0===t||null===(i=t.playToggle)||void 0===i?void 0:i.el_,s=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var i,r,a,d,u,c,v,f,p,m,h;if(vn.enabled&&(!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName&&!(null===(i=t.target)||void 0===i||null===(r=i.closest)||void 0===r?void 0:r.call(i,'.vjs-control-bar button, .vjs-control-bar [role="button"]')))){var g=t.key,y=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(g)&&(t.preventDefault(),null==s||s.focus()),g){case" ":null==l||l.click();break;case"m":case"M":o.muted(!o.muted());break;case"f":case"F":null===(a=document.querySelector(".vjs-fullscreen-control"))||void 0===a||a.click();break;case"ArrowLeft":y&&!1===n.liveui||mi(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(c=u.appcmsMain)||void 0===c||null===(v=c.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)&&null!==(f=window)&&void 0!==f&&null!==(p=f.app_data)&&void 0!==p&&null!==(m=p.appcmsMain)&&void 0!==m&&null!==(h=m.adsConfig)&&void 0!==h&&h.vodAdClientSideTracking)return;y||pi(e,10)}}},!0)},exports.initializeTransmit=Gt,exports.initiateErrorHandling=bi,exports.initiateWatchHistoryHandling=function(e,n,t){var i,r,o;null!=n&&n.series&&null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable&&(si=null==n||null===(r=n.series)||void 0===r?void 0:r.id),ai=[],li=0,Kt=t;var l=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,s=a.getPlayer(e);s&&(s.on("dispose",di),s.on("timeupdate",function(){if(!s.seeking()&&!window.isAdPlaying){var e=Math.floor(s.currentTime());ai.includes(li)||(e!=li||e<l?e>li&&(li=e+l):(ai.push(e),ui(s,n,l)))}}),s.on("seeked",function(){var e=Math.floor(s.currentTime());li=e+l,ai=[]}),s.one("ended",function(){ui(s,n,l,!0)}))},exports.initiateWatchHistoryHandlingExternal=function(e,n){var t,i,r;if(null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.cb&&"function"==typeof(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.cb)){var o,a,l,s=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,d=(null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.completionThreshold)||95,u=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.cb,c=-1;e.on("seeked",function(){if(!window.isAdPlaying){var n=Math.floor(e.currentTime()),t=n-n%s;if(c=t,t>0){var i=Math.floor(n/e.duration()*100);u({watchedTime:n,watchedPercentage:i,doneWatching:i>=d})}}}),e.on("timeupdate",function(){if(!window.isAdPlaying){var n=Math.floor(e.currentTime()),t=n-n%s;if(n%s===0&&t!==c){c=t;var i=Math.floor(n/e.duration()*100);u({watchedTime:n,watchedPercentage:i,doneWatching:i>=d||!1})}}}),e.on("ended",function(){u({watchedTime:Math.floor(e.duration()),watchedPercentage:100,doneWatching:!0})})}},exports.inititateBeacon=He,exports.isDrmError=T,exports.isDrmRequestKind=function(e){return b.has(e)},exports.isHttpOk=function(e){return null==e||e>=200&&e<400},exports.isPaused=function(e){return i(e).paused()},exports.isPlayerInitialised=hi,exports.isTokenExpired=Q,exports.load=yi,exports.loadVideo=Ti,exports.loadVideoInstantly=function(e,n,t){var i=a.getPlayer(e);return i.src(n),new Promise(function(e,n){var r=0;i.one("loadedmetadata",function(){clearTimeout(r),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){r=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},exports.pause=function(e){var n=i(e);n.paused()||ii(e,{pause:1}),n.pause()},exports.play=function(e){var n=i(e);n.paused()&&ii(e,{play:1}),n.play()},exports.refreshTokenManager=X,exports.resyncControlState=function(e){var n=$t.get(e),t=a.getPlayer(e);if(n&&t){try{n.paused=!!t.paused()}catch(e){}n.muted=Zt(t),n.ccOn=ei(t)}},exports.rewind=mi,exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],h("js",new Date),h("config",e)},exports.seasonIdxManager=pe,exports.seekToResumeTime=vi,exports.setCurrentSeries=function(e){J=e},exports.setCurrentVideo=de,exports.setUserId=function(e){e&&"undefined"!=typeof window&&window.sessionStorage&&window.sessionStorage.setItem("uid",e)},exports.setVideoIdx=ve,exports.setVideoIdxById=fe,exports.setupAdvertisementMarkers=Un,exports.setupAdvertisementMarkersForLinear=Kn,exports.skip=pi,exports.token_authentication_enabled=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},exports.trackMap=Nn,exports.trackingUrlManager=Ln,exports.triggerPlayerAction=ti,exports.videoReplayTracker=se;
|
package/cjs/index-44029519.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/typeof"),n=require("./generic-99674f84.js"),t=require("./skin-66dce245.js"),a=require("@babel/runtime/helpers/toConsumableArray"),o=require("@babel/runtime/helpers/slicedToArray"),r=require("./localisation-56e0a999.js"),i=!1;var l,c=null,s=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),a=function(e,n){var t;return t=12*(n.getFullYear()-e.getFullYear()),t-=e.getMonth(),(t+=n.getMonth())<=0?0:t}(new Date,new Date(n)),o=a>0&&t>4?a:0,r=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),a=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(a-=1),a<0&&(t-=1),t}(new Date,new Date(n));return[r>0&&o>0?r:0,o,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},u=function(e){var n,t=o(e,8),a=t[0],r=t[1],i=t[2],l=t[3],c=t[4],s=t[5],u=t[6],d=t[7];n=a>=1?" ".concat(a," Year"):r>=1?" ".concat(r," month"):i>=1?" ".concat(i," week"):l>=1?" ".concat(l," day"):c<24&&c>=12?" ".concat(c," hour"):c>0?"".concat(c," hours ").concat(s," minutes ").concat(u," seconds"):s>0?"".concat(s," minutes ").concat(u," seconds"):"".concat(u," seconds"),d.textContent="".concat(n)},d=(l={scheduleStartTimeMs:0,scheduleEndTimeMs:0},{get:function(){return l},set:function(e){l={scheduleStartTimeMs:null==e?void 0:e.startDateTime,scheduleEndTimeMs:null==e?void 0:e.endDateTime}}});function v(e,n,t,o){if(e){var i=function(){var e,i,c=null===(e=d.get())||void 0===e?void 0:e.scheduleStartTimeMs,u=null===(i=d.get())||void 0===i?void 0:i.scheduleEndTimeMs,v=Date.now();if(v-u>0){var m=document.getElementsByClassName("error-message")[0];return m&&(m.textContent=r.getLocalisation("eventEnded")||"Game has ended",o.textContent=""),clearInterval(l),void(null==t||t())}var f=c-v;if(f/1e3<=0)return clearInterval(l),null==n||n([0,0,0,0,0,0,0,o]),void(null==t||t());var g=s(f,c);null==n||n([].concat(a(g),[o]))};i();var l=setInterval(i,1e3);return l}}exports.getVideoDuration=function(e){var n=t.getPlayer(e);return n?n.duration():"Cannot find player with id: '".concat(e,"'")},exports.handleCountdownTimer=function(e,n,t){var a,o,i,l,c,s,m,f,g=null==n||null===(a=n.response)||void 0===a||null===(o=a.data)||void 0===o?void 0:o.errorCode,h=(null==n||null===(i=n.response)||void 0===i||null===(l=i.data)||void 0===l?void 0:l.errorMessage)||(null==n?void 0:n.message)||null;d.set({startDateTime:null==n||null===(c=n.response)||void 0===c||null===(s=c.data)||void 0===s?void 0:s.scheduleStartDate,endDateTime:null==n||null===(m=n.response)||void 0===m||null===(f=m.data)||void 0===f?void 0:f.scheduleEndDate}),function(e,n,t,a){var o,i,l=Date.now(),c=null===(o=d.get())||void 0===o?void 0:o.scheduleStartTimeMs,s=null===(i=d.get())||void 0===i?void 0:i.scheduleEndTimeMs,m=function(e,n,t,a){var o;e<0?o=r.getLocalisation("eventNotStarted")||a||"Game starts in":(n>0||"VIDEO_NOT_EXISTS"==t)&&(o=r.getLocalisation("eventEnded")||a||"Game has ended");return o||a}(l-c,l-s,n,t);if(document.getElementsByClassName("error-container")[0]){var f=document.getElementsByClassName("error-message")[0];f&&(f.textContent="".concat(m));var g=document.getElementsByClassName("error-timer-message")[0];g&&v(Math.abs(c),u,a,g)}else{var h=document.getElementById(e).parentElement;if(h){var p=document.createElement("div");p.className="error-container";var y=document.createElement("div");y.className="error-message";var T=document.createElement("div");T.className="error-timer-message",y.textContent="".concat(m),p.appendChild(y),p.appendChild(T),h.append(p),v(Math.abs(c),u,a,T)}}}(e,g,h,t)},exports.handlePlayerMessage=function(e,a){var o=a.scheduleEndDate,i=a.scheduleStartDate;d.set({startDateTime:i,endDateTime:o}),c&&clearInterval(c),c=setInterval(function(){var a,o=Date.now(),i=null===(a=d.get())||void 0===a?void 0:a.scheduleEndTimeMs;if(console.log("scheduleEndTimeMs",i),i&&o>i){var l;console.log("Game ended");var s=t.getPlayer(e);if(n.isPlayerInitialised(e)&&s){var u;s.dispose(),console.log("Player disposed");var v=null===(u=document.getElementsByClassName("vl-container"))||void 0===u?void 0:u[0],m=document.createElement("video");m.id=e,m.className="video-js",m.style.width="100%",m.style.height="100%",v&&v.appendChild(m)}var f=r.getLocalisation("eventEnded")||"Game has ended",g=null===(l=document.getElementsByClassName("error-container"))||void 0===l?void 0:l[0];if(g){var h=g.querySelector(".error-message");h&&(h.textContent=f)}else{var p=document.getElementById(e),y=null==p?void 0:p.parentElement;if(y){(g=document.createElement("div")).className="error-container";var T=document.createElement("div");T.className="error-message",T.textContent=f,g.appendChild(T),y.append(g)}}clearInterval(c)}},1e3)},exports.onReplay=function(e,a){var o=t.getPlayer(e);o?(o.on("ended",function(){return i=!0}),o.on("timeupdate",function(){if(!o.paused()&&i){var e,t,r=null===(e=n.getCurrentVideo())||void 0===e||null===(t=e.video)||void 0===t?void 0:t.id;n.videoReplayTracker.get(r)?(n.videoReplayTracker.clear(),n.trackMap.clear(),a(),n.videoReplayTracker.set(r)):(n.videoReplayTracker.clear(),n.videoReplayTracker.set(r)),i=!1}})):a("Cannot find player with id: '".concat(e,"'"))},exports.onTimeUpdate=function(e,n){var a=t.getPlayer(e);a?a.on("timeupdate",function(){return n(a.currentTime())}):n("Cannot find player with id: '".concat(e,"'"))},exports.onVideoEnded=function(e,n){var a=t.getPlayer(e);a?a.on("ended",function(){return n(!0)}):n("Cannot find player with id: '".concat(e,"'"))},exports.playerEvents=function(){var n=function(e,n){var a=t.getPlayer(e);if(!a)throw"Cannot find player with id: '".concat(e,"'");if("function"!=typeof n)throw"Callback function (cb) is missing or not a function";return a};return{onPlay:function(e,t){n(e,t).on("play",function(){return t()})},onPause:function(e,t){n(e,t).on("pause",function(){return t()})},onMute:function(e,t){var a=n(e,t);a.on("volumechange",function(){a.muted()?t({muted:!0}):t({muted:!1})})},onPictureInPictureChange:function(e,t){var a=n(e,t);a.on("enterpictureinpicture",function(){t({pip:!0})}),a.on("leavepictureinpicture",function(){t({pip:!1})})},onFullScreenChange:function(e,t){var a=n(e,t);a.on("fullscreenchange",function(e){a.isFullscreen_?t({isFullscreen:!0}):t({isFullscreen:!1})})},onSetVolume:function(e,t){var a=n(e,t);a.on("volumechange",function(){var e=100*a.volume().toFixed(2);a.muted()?t({vol:0}):t({vol:e})})},onSeeked:function(e,t){var a=n(e,t);a.on("seeked",function(){t({seeked:a.currentTime()})})},onSubtitleEnable:function(e,t){var a=n(e,t);a.textTracks().on("change",function(e){console.log(a.textTracks());var n=a.textTracks().tracks_.filter(function(e){return("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode});n.length>0&&t({enabled:n[0]})})},onDisableSubtitles:function(e,t){var a=n(e,t);a.textTracks().on("change",function(e){var n,o;console.log(a.textTracks()),(null==a||null===(n=a.textTracks())||void 0===n||null===(o=n.tracks_)||void 0===o?void 0:o.every(function(e){return"showing"!=e.mode}))&&t({captions_disabled:!0})})},onSubtitleCueChange:function(t,a){var o=n(t,a);o.on("loadeddata",function(){var n,t,r,i,l,c=o.textTracks();"object"==e(o.dash)&&null!=o.dash&&o.dash.mediaPlayer.on(null===(t=window)||void 0===t||null===(r=t.dashjs)||void 0===r||null===(i=r.MediaPlayer)||void 0===i||null===(l=i.events)||void 0===l?void 0:l.CAPTION_RENDERED,function(e){a(e)});for(var s=0;s<c.length;s++){var u=c[s];"metadata"===u.kind&&(u.mode="hidden",n=u)}n&&n.addEventListener("cuechange",function(){var e=n.activeCues;if(e&&e.length>0)for(var t=0;t<e.length;t++){var o=e[t];a(o)}else console.log("no active cue at this moment")})})},onError:function(e,t){var a=n(e,t);a.on("error",function(){var e,n;t({error:null==a||null===(e=a.error())||void 0===e?void 0:e.code,msg:null==a||null===(n=a.error())||void 0===n?void 0:n.message})})}}},exports.scheduleTimerInstanceManager=d,exports.seekToTimeStamp=function(e,n,a){var o=t.getPlayer(e);o?n>=0&&n<=o.duration()?(a({status:!0,msg:"Successfully seeked to timestamp : ".concat(n)}),o.currentTime(n)):a({status:!1,msg:"Out of bounds, please provide a valid timestamp"}):a("Cannot find player with id: '".concat(e,"'"))},exports.setPlaybackSpeed=function(e,n){var a=t.getPlayer(e);if(!a)return"Cannot find player with id: '".concat(e,"'");try{return a.playbackRate(n),"Playback speed set to ".concat(n,"x")}catch(e){return"Error: ".concat(e)}};
|
package/cjs/index-c8d3434c.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),t=require("@babel/runtime/helpers/get"),i=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),o=require("video.js"),s=require("./generic-99674f84.js");function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./browser-2807cc02.js"),require("./skin-66dce245.js"),require("@babel/runtime/helpers/toConsumableArray"),require("md5"),require("js-cookie"),require("./captions-8c1f9c07.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js");var u={startTime:0,timeLive:3600},c=0,p=u.timeLive,h=o.getComponent("Button"),d=o.getComponent("Component"),m=o.getComponent("ProgressControl"),v=m.getComponent("SeekBar"),f=m.getComponent("PlayProgressBar"),b=m.getComponent("LoadProgressBar"),y=o.getComponent("MouseTimeDisplay");b.prototype.update=function(e){var r=this.player_.buffered(),t=this.player_.duration(),i=this.player_.bufferedEnd(),a=this.partEls_,n=function(e,r){var t=e/r||0;return 100*(t>=1?1:t)+"%"};0!==n(i,t)&&(this.el_.style.width=n(i,t));for(var o=0;o<r.length;o++){var s=r.start(o),l=r.end(o),u=a[o];u||(u=this.el_.appendChild(document.createElement("div")),a[o]=u),0!==n(s,i)&&(u.style.left=n(s,i)),0!==n(l-s,i)&&(u.style.width=n(l-s,i))}for(var c=a.length;c>r.length;c--)this.el_.removeChild(a[c-1]);a.length=r.length},v.prototype.update_=function(e,r){var t=this.player_.duration(),i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.el_.setAttribute("aria-valuenow",(100*r).toFixed(2)),t!==Number.POSITIVE_INFINITY&&this.el_.setAttribute("aria-valuetext","-".concat(o.formatTime(t-i,t))),this.bar.update(o.dom.getBoundingClientRect(this.el_),r)},v.prototype.handleMouseMove=function(e){var r=1-this.calculateDistance(e),t=this.player_.seekable().end(0)-r*p;t===this.player_.duration()&&(t-=.1),this.player_.currentTime(t),this.update()},f.prototype.update=function(e,r){var t=this,i=this.player_.duration();this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var a=t.player_.scrubbing()?t.player_.getCache().currentTime:t.player_.currentTime(),n=o.formatTime(i-a,i);0!==r&&i!==Number.POSITIVE_INFINITY&&t.getChild("timeTooltip").update(e,r,"-".concat(n))})},y.prototype.update=function(e,r){var t=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var i=o.formatTime(p-r*p,p);t.el_.style.left="".concat(e.width*r,"px"),0!==r&&t.player_.duration()!==Number.POSITIVE_INFINITY&&t.getChild("timeTooltip").update(e,r,"-".concat(i))})};var _=function(e){var r=this;e||(e=u),this.on("timeupdate",function(e){var t,i;(i=(t=r).seekable())&&i.length&&(i.end(0)-t.currentTime()<20?t.controlBar.liveButton.addClass("onair"):t.controlBar.liveButton.removeClass("onair"),t.duration(t.seekable().end(0)),c||(c=p=t.seekable().end(0)))}),this.on("pause",function(e){r.controlBar.liveButton.removeClass("onair")}),this.ready(function(){var t;t=r,o.mergeOptions(u,e),t.addClass("vjs-dvr-seekbar"),t.controlBar.addClass("vjs-dvr-control-bar"),t.controlBar.progressControl.seekBar.__proto__.__proto__.update=function(){if(this.el_){var e;e="VolumeBar"===this.name_?this.getPercent():1-(this.player_.duration()-this.player_.currentTime())/p;var r=this.bar;if(r){("number"!=typeof e||e!=e||e<0||e===1/0)&&(e=0),e>1&&(e=1);var t=(100*e).toFixed(2)+"%",i=r.el().style;return 0!==e&&(this.vertical()?i.height=t:i.width=t),e}}},t.controlBar.progressControl&&t.controlBar.progressControl.addClass("vjs-dvr-progress-control"),t.controlBar.liveButton=t.controlBar.addChild("liveButton"),t.controlBar.el().insertBefore(t.controlBar.liveButton.el(),t.controlBar.progressControl.el())})},g=function(){i(p,h);var o,u,c=(o=p,u=l(),function(){var e,r=n(o);if(u){var t=n(this).constructor;e=Reflect.construct(r,arguments,t)}else e=r.apply(this,arguments);return a(this,e)});function p(r,t){var i;e(this,p),(i=c.call(this,r,t)).controlText("Seek to live"),i.el().setAttribute("tabindex","0");var a=i.el().querySelector(".vjs-icon-placeholder");return a?a.outerHTML='<span class="liveCircle" aria-hidden="true"></span><span class="liveText" aria-hidden="true">LIVE</span>':i.el().insertAdjacentHTML("afterbegin",'<span class="liveCircle" aria-hidden="true"></span><span class="liveText" aria-hidden="true">LIVE</span>'),r.paused()||i.addClass("onair"),i}return r(p,[{key:"buildCSSClass",value:function(){return"vjs-live-button ".concat(function(e,r,i,a){var o=t(n(1&a?e.prototype:e),r,i);return 2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o}(p,"buildCSSClass",this,3)([]))}},{key:"handleClick",value:function(e){var r=this.player_.seekable().end(0);s.triggerPlayerAction(this.player_,s.PLAYER_ACTIONS.GO_LIVE),this.player_.currentTime(r),this.player_.play()}}]),p}();d.registerComponent("LiveButton",g),(o.registerPlugin||o.plugin)("dvrSeekbar",_),exports.default=_;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),n=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),s=require("video.js"),i=require("./icons-eb807ef0.js"),o=require("./generic-99674f84.js"),l=require("./skin-66dce245.js");function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./browser-2807cc02.js"),require("md5"),require("js-cookie"),require("./captions-8c1f9c07.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js");var d=s.getComponent("Component"),u=function(){r(h,d);var u,m,p=(u=h,m=c(),function(){var e,t=a(u);if(m){var r=a(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return n(this,e)});function h(t){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,h),(r=p.call(this,t,n)).playerId=n.playerId,r.seriesData=n.sres,r.streams=n.streams,r.currentVideoData=n.res,r.initialiseStructure(),r.loadCSS(),r}return t(h,[{key:"createEl",value:function(){var e=s.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=s.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(i.BroadcastIcon())});return s.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./multicamv2-7a86b517.js")}).then(function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this.el(),t=s.dom.createEl("div",{className:"stream-container hidden"});s.dom.$(".stream-selector-icon",this.el()).onclick=function(){var r;null!==(r=t.classList)&&void 0!==r&&r.contains("hidden")?(l.closeOpenDrawers(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var r=document.getElementById(this.playerId);if(r){var n=window.getComputedStyle(r,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(n,"px"),r.style.overflow="hidden",s.dom.appendContent(e,t),this.addFunctionality(t)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),n=s.dom.createEl("div",{className:"stream-selector-head"}),a=s.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i.crossIconSvg())});a.onclick=function(){e.classList.add("hidden"),r.classList.remove("open"),e.style.right="-350px"};for(var c=s.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=s.dom.createEl("div",{className:"stream-selector-content"}),u=s.dom.createEl("div",{className:"stream-tray"}),m=function(e){var r,n=s.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(i.SelectedStream())});0==e&&(n.classList.add("selected"),n.style.border="4px solid #D2393B"),n.onclick=function(){for(var r=s.dom.$$(".stream"),a=0;a<r.length;a++)r[a].style.border="none",r[a].classList.remove("selected");n.classList.add("selected"),n.style.border="4px solid #D2393B",o.load(t.playerId,t.streams[e].id).then(function(e){o.play(t.playerId),console.log(e)}).catch(function(e){console.log(e)})},n.style.backgroundImage="url(".concat(t.streams[e].img,")");var a=document.createElement("img");a.className="stream-thumbnail-image",a.src="".concat(null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img),a.alt="No Thumbnail Available",n.append(a),s.dom.appendContent(u,n),s.dom.appendContent(d,u)},p=0;p<this.streams.length;p++)m(p);s.dom.appendContent(n,a),s.dom.appendContent(n,c),s.dom.appendContent(e,n),s.dom.appendContent(e,d),l.getPlayer(this.playerId).on("fullscreenchange",function(){var r=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(r,"px")})}}]),h}();exports.default=u;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),s=require("video.js"),i=require("./icons-eb807ef0.js"),o=require("./generic-99674f84.js"),l=require("./skin-66dce245.js");function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./browser-2807cc02.js"),require("md5"),require("js-cookie"),require("./captions-8c1f9c07.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js");var d=s.getComponent("Component"),u=function(){r(v,d);var u,m,p=(u=v,m=c(),function(){var e,t=n(u);if(m){var r=n(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return a(this,e)});function v(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,v),(r=p.call(this,t,a)).playerId=a.playerId,r.seriesData=a.sres,r.streams=a.streams,r.currentVideoData=a.res,r.initialiseStructure(),r.loadCSS(),r}return t(v,[{key:"createEl",value:function(){var e=s.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=s.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(i.BroadcastIcon())});return s.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./multicamv2-1efdbdb9.js")}).then(function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),r=s.dom.createEl("div",{className:"stream-container hidden"});s.dom.$(".stream-selector-icon",this.el()).onclick=function(){var a;null!==(a=r.classList)&&void 0!==a&&a.contains("hidden")?(l.closeOpenDrawers(),r.classList.remove("hidden"),t.classList.add("open"),l.setUpdatedElHeight(e.playerId,r)):(r.classList.add("hidden"),t.classList.remove("open"))};var a=document.getElementById(this.playerId);if(a){var n=window.getComputedStyle(a,null).getPropertyValue("height").slice(0,-2);r.style.height="".concat(n,"px"),a.style.overflow="hidden",s.dom.appendContent(t,r),this.addFunctionality(r)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),a=s.dom.createEl("div",{className:"stream-selector-head"}),n=s.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i.crossIconSvg())});n.onclick=function(){e.classList.add("hidden"),r.classList.remove("open")};for(var c=s.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=s.dom.createEl("div",{className:"stream-selector-content"}),u=s.dom.createEl("div",{className:"stream-tray"}),m=function(e){var r,a,n,l=s.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(i.SelectedStream())});0==e&&(l.classList.add("selected"),l.style.border="2px solid #D2393B"),l.onclick=function(){for(var r=s.dom.$$(".stream"),a=0;a<r.length;a++)r[a].style.border="none",r[a].classList.remove("selected");l.classList.add("selected"),l.style.border="2px solid #D2393B",o.load(t.playerId,t.streams[e].id).then(function(e){o.play(t.playerId),console.log(e)}).catch(function(e){console.log(e)})},l.style.backgroundImage="url(".concat(t.streams[e].img,")");var c=document.createElement("img");c.className="stream-thumbnail-image",c.src="".concat((null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img)||(null===(a=window)||void 0===a||null===(n=a.customData)||void 0===n?void 0:n.fallbackImage)),l.append(c),s.dom.appendContent(u,l),s.dom.appendContent(d,u)},p=0;p<this.streams.length;p++)m(p);s.dom.appendContent(a,n),s.dom.appendContent(a,c),s.dom.appendContent(e,a),s.dom.appendContent(e,d),l.handleDrawerResizing(this.playerId,e)}}]),v}();exports.default=u;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),t=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),i=require("@babel/runtime/helpers/getPrototypeOf"),o=require("video.js"),l=require("./icons-eb807ef0.js"),s=require("./generic-99674f84.js"),a=require("./skin-66dce245.js");function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./browser-2807cc02.js"),require("md5"),require("js-cookie"),require("./captions-8c1f9c07.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js");var u=o.getComponent("Component"),c=function(){t(p,u);var s,a,c=(s=p,a=d(),function(){var e,n=i(s);if(a){var t=i(this).constructor;e=Reflect.construct(n,arguments,t)}else e=n.apply(this,arguments);return r(this,e)});function p(n){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,p),(t=c.call(this,n,r)).playerId=r.playerId,t.seriesData=r.sres,t.currentVideoData=r.res,t.initialiseStructure(),t.loadCSS(),t}return n(p,[{key:"createEl",value:function(){var e=o.dom.createEl("div",{className:"play-next"}),n=o.dom.createEl("div",{className:"play-next-icon",innerHTML:"".concat(l.PlayNextEpisodeSvg(window.controlsColor?window.controlsColor:"white"))});return o.dom.appendContent(e,n),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./nextEpisodeButton-b6e6586f.js")}).then(function(e){var n=document.createElement("style");n.id="multicam",n.append("".concat(e.default)),document.head.appendChild(n)})}},{key:"initialiseStructure",value:function(){var e=this.el(),n=o.dom.createEl("div",{className:"next-eps nextepisode-hidden"}),t=o.dom.createEl("div",{className:"next",innerHTML:"Next Episode"}),r=o.dom.createEl("div",{className:"nextep-meta-details next-margin"}),i=o.dom.createEl("div",{className:"next-eps-image"}),l=o.dom.createEl("div",{className:"next-eps-description"});o.dom.appendContent(r,i),o.dom.appendContent(r,l),o.dom.appendContent(n,t),o.dom.appendContent(n,r),this.toggleContentOnHover(e,n),o.dom.appendContent(e,n)}},{key:"toggleContentOnHover",value:function(e,n){e.addEventListener("mouseover",function(){o.dom.removeClass(n,"nextepisode-hidden")}),n.addEventListener("mouseover",function(){o.dom.removeClass(n,"nextepisode-hidden")}),e.addEventListener("mouseout",function(){o.dom.addClass(n,"nextepisode-hidden")}),n.addEventListener("mouseout",function(){o.dom.addClass(n,"nextepisode-hidden")})}}]),p}(),p=function(e,n){for(var t=-1,r=0;r<e.length;r++)for(var i=0;i<e[r].episodes.length;i++)if(e[r].episodes[i].id===n){t=r;break}return t},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;if(!(e&&n>=0))return{prevEp:null,nextEp:null};var t=e.episodes.length,r=n-1>=0?n-1:t-1,i=(n+1)%t,o=t>1?e.episodes[r]:null,l=t>1?e.episodes[i]:null;return r===i&&(0===r?l=null:o=null),{prevEp:o,nextEp:l,prevEpIdx:r,nextEpIdx:i}},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,t=null;return e?(e.episodes.forEach(function(e,r){e.gist.id===n&&(t=r)}),t):null},h=function(e){var n,t;o.dom.$(".next-eps"),o.dom.$(".play-next").onclick=function(){var n;s.load("my-player",null==e||null===(n=e.gist)||void 0===n?void 0:n.id).then(function(e){s.setCurrentVideo(e.response)})};var r=o.dom.$(".next-eps-image"),i=a.parseHtmlString("<img src=".concat(null==e||null===(n=e.gist)||void 0===n?void 0:n.videoImageUrl," />")),l=null==i?void 0:i.firstChild;null==r||r.append(l);for(var d=o.dom.$(".next-eps-description"),u=a.parseHtmlString("<div class='next-eps-title'>".concat(null==e?void 0:e.title,"</div>\n <div class='next-eps-description-details'>").concat(null==e||null===(t=e.gist)||void 0===t?void 0:t.description,"</div>"));null!=u&&u.firstChild;)null==d||d.appendChild(u.firstChild)};exports.default=c,exports.initaliseFunctionality=function(e,n){var t=p(e,n.video.gist.id),r=m(e[t],n.video.gist.id),i=v(e[t],r);h(i.nextEp)};
|
package/cjs/playlist-293754bb.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),l=require("@babel/runtime/helpers/inherits"),i=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),o=require("video.js"),r=require("./icons-eb807ef0.js"),s=require("./generic-99674f84.js"),c=require("./autoNextVideo-1de87b37.js"),d=require("./skin-66dce245.js");function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./browser-2807cc02.js"),require("md5"),require("js-cookie"),require("./captions-8c1f9c07.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js"),require("./index-44029519.js"),require("./localisation-56e0a999.js");var p=o.getComponent("Component"),m=function(){l(h,p);var m,v,y=(m=h,v=u(),function(){var e,t=a(m);if(v){var n=a(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return i(this,e)});function h(e){var n,l,i,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,h),(a=y.call(this,e,o)).playerId=o.playerId,a.seriesData=o.sres,a.videos=null==o||null===(n=o.playlist)||void 0===n?void 0:n.content,a.cb=(null==o||null===(l=o.playlist)||void 0===l?void 0:l.cb)||null,a.autoNext=(null==o||null===(i=o.playlist)||void 0===i?void 0:i.autoNext)||!1,a.currentVideoData=o.res,a.initialiseStructure(),a.loadCSS(),a.autoNext&&c.autoPlayNext({playerId:a.playerId,content:a.videos,cb:a.cb}),a}return n(h,[{key:"createEl",value:function(){var e=o.dom.createEl("div",{className:"playlist-selection vjs-control vjs-button"});e.style.position="unset";var t=o.dom.createEl("div",{className:"playlist-selector-icon",innerHTML:"".concat(r.EpisodesSvg())});return o.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./playlist-df87ca90.js")}).then(function(e){var t=document.createElement("style");t.id="playlist-selection",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this.el(),t=o.dom.createEl("div",{className:"selection-container hidden"});o.dom.$(".playlist-selector-icon",this.el()).onclick=function(){var n;null!==(n=t.classList)&&void 0!==n&&n.contains("hidden")?(d.closeOpenDrawers(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var n=document.getElementById(this.playerId);if(n){var l=window.getComputedStyle(n,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(l,"px"),o.dom.appendContent(e,t),n.style.overflow="hidden",this.addFunctionality(t)}}},{key:"addFunctionality",value:function(t){var n=this,l=this.el(),i=o.dom.createEl("div",{className:"playlist-selector-head"}),a=o.dom.createEl("div",{className:"playlist-selector-cross-icon",innerHTML:"".concat(r.crossIconSvg())});a.onclick=function(){t.classList.add("hidden"),l.classList.remove("open"),t.style.right="-350px"};for(var c=o.dom.createEl("div",{className:"playlist-selector-title",innerHTML:"Playlist"}),u=o.dom.createEl("div",{className:"playlist-selector-content"}),p=function(t){var l,i,a=o.dom.createEl("div",{className:"playlist-container"}),r=o.dom.createEl("div",{className:"playlist-section",index:t}),c=o.dom.createEl("div",{className:"playlist-title",innerHTML:"".concat((null===(l=n.videos[t])||void 0===l?void 0:l.title)||"")}),d=o.dom.createEl("div",{className:"playlist-progress-bar",innerHTML:"<div style='width:".concat(n.videos[t].watchedPercentage,"%' class='playlist-progress-bar-value'></div>")});o.dom.appendContent(r,c),o.dom.appendContent(r,d),o.dom.appendContent(a,r),o.dom.appendContent(u,a);var p=o.dom.createEl("div",{className:"playlist-section-expanded hidden"}),m=o.dom.createEl("div",{className:"playlist-description",innerHTML:"".concat((null===(i=n.videos[t])||void 0===i?void 0:i.description)||"")}),v=o.dom.createEl("div",{className:"playlist-image"});v.style.backgroundImage="url(".concat(n.videos[t].img,")"),o.dom.appendContent(p,v),o.dom.appendContent(p,m),o.dom.appendContent(a,p),o.dom.appendContent(u,a),p.onclick=function(e){e.stopPropagation(),s.setVideoIdx(t+1),s.load(n.playerId,n.videos[t].id).then(function(e){null!=n&&n.cb&&n.cb(e)}).catch(function(e){null!=n&&n.cb&&n.cb(e)})},r.onclick=function(t){var n,l,i,o=document.getElementsByClassName("playlist-selector-content")[0].childNodes,r=(o=e(o))[t.target.index].getElementsByClassName("playlist-section-expanded")[0];null!=r&&null!==(n=r.classList)&&void 0!==n&&n.contains("hidden")?(a.style.backgroundColor="#0000007d",null==r||null===(l=r.classList)||void 0===l||l.remove("hidden")):(null==r||null===(i=r.classList)||void 0===i||i.add("hidden"),a.style.backgroundColor="unset")}},m=0;m<this.videos.length;m++)p(m);o.dom.appendContent(i,a),o.dom.appendContent(i,c),o.dom.appendContent(t,i),o.dom.appendContent(t,u),d.getPlayer(this.playerId).on("fullscreenchange",function(){var e=document.getElementById(n.playerId);if(e){var l=window.getComputedStyle(e,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(l,"px")}})}}]),h}();exports.default=m;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),i=require("@babel/runtime/helpers/assertThisInitialized"),o=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),d=require("@babel/runtime/helpers/getPrototypeOf"),l=require("@babel/runtime/helpers/defineProperty"),r=require("video.js"),s=require("./skin-66dce245.js"),u=require("./browser-2807cc02.js"),c=function(){var e;return(null===(e=u.playerConfigManager.getConfig())||void 0===e?void 0:e.qualityLabels)||{}},v=function(e){var t;if(null==e||"Auto"===e)return null;var n=c(),i=null!==(t=n[e])&&void 0!==t?t:n[String(e)];return null==i||""===i?null:i},m=function(){var e=c().auto;return null!=e&&""!==e?e:"Auto"};function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}var p=r.getComponent("Component"),f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.bitRate,i=t.includeBitrate,o=v(e);if(null!=o)return o;var a=function(e){return e>719&&e<1081?"<span>HD</span>":e>1081&&e<1500?"<span>2K (HD)</span>":e>1501?"<span>4K (HD)</span>":""}(e);return i?"".concat(e,"p @ ").concat(n,"mbps ").concat(a):"".concat(e,"p ").concat(a)},g=function(){o(b,p);var c,v,g=(c=b,v=h(),function(){var e,t=d(c);if(v){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)});function b(n){var o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,b),o=g.call(this,n,a),l(i(o),"masterRenditions",[]),l(i(o),"addCustomFont",function(e){var t=r.dom.createEl("div",{className:"font hideCustomFonts"}),n=r.dom.createEl("p",{className:"customFontHeading",innerHTML:"Font Size"});r.dom.appendContent(t,n);var i=r.dom.createEl("div",{className:"font-options"});i.style.fontSize="12px",o.fontSizeOptions.map(function(e,t){var n=r.dom.createEl("div",{className:"options",innerHTML:'<div class="radio-item" >\n <input class=opt'.concat(t,' type="radio" id=').concat(e,' name="item" />\n <label class="radio-btn-lable" for=').concat(e,">").concat(e,"pt</label>\n </div>")});n.addEventListener("click",function(e){var t=e.target.id;o.changeFontSize(t)}),r.dom.appendContent(i,n)}),r.dom.appendContent(t,i),r.dom.appendContent(e,t)}),l(i(o),"resetRenditions",function(){e(document.getElementsByClassName("rendition")).map(function(e){r.dom.removeClass(e,"selected")})}),o.playerId=null==a?void 0:a.playerId,o.skin=null==a?void 0:a.skin,o.icon=null==a?void 0:a.icon,o.masterRenditions=[],o.fontSizeOptions=[10,12,14],o.createRenditions(a.renditions),window.height=null,o}return n(b,[{key:"toggleContentOnHover",value:function(e,t){var n=r.dom.$(".setting-icon",e);n.addEventListener("mouseover",function(){r.dom.removeClass(t,"resolution_hidden")}),t.addEventListener("mouseover",function(){r.dom.removeClass(t,"resolution_hidden")}),n.addEventListener("mouseout",function(){r.dom.addClass(t,"resolution_hidden")}),t.addEventListener("mouseout",function(){r.dom.addClass(t,"resolution_hidden")})}},{key:"changeFontSize",value:function(e){var t=r.dom.$(".renditions",this.contentEl()),n=r.dom.$(".font-options",this.contentEl());t.style.fontSize="".concat(e,"px"),n.style.fontSize="".concat(e,"px")}},{key:"createRenditions",value:function(e){var t=this,n=this.el(),i=r.dom.$(".setting-icon",this.el()),o=s.parseSvgString(this.icon);if(i.append(o),"live"===this.skin){var a=document.createTextNode(" Settings");i.appendChild(a)}var d=r.dom.createEl("div",{className:"content resolution_hidden"}),l=r.dom.createEl("div",{innerHTML:"Quality",className:"title"}),c=r.dom.createEl("div",{className:"resolution"});r.dom.appendContent(c,l),this.toggleContentOnHover(n,d);var v=r.dom.createEl("div",{className:"renditions"});this.player_.tech_.vhs?(e.map(function(e,n){var i,o,a=r.dom.createEl("div",{className:"relative"}),d=(((null==e||null===(i=e.playlist)||void 0===i?void 0:i.attributes["AVERAGE-BANDWIDTH"])||(null==e||null===(o=e.playlist)||void 0===o?void 0:o.attributes.BANDWIDTH))/1048576).toFixed(1),l=f(e.height,{bitRate:d,includeBitrate:!0}),s=r.dom.createEl("p",{innerHTML:l,className:"rendition",res:e.height,bandwidth:e.bandwidth});r.dom.appendContent(a,s),r.dom.appendContent(v,a),s.addEventListener("click",function(e){window.height===e.target.res&&e.target.bandwidth==window.bandwidth||(t.resetRenditions(),window.height=e.target.res,window.bandwidth=parseInt(e.target.bandwidth),window.selectedVideo=e.target.video,y(t.playerId,e.target),r.dom.addClass(s,"selected"))})}),this.addAutoRendition("nondrm",v),"Safari"!=u.detectBrowser()&&this.addDynamicSwitchIfAuto()):(e.map(function(e,n){var i=r.dom.createEl("div",{className:"relative"}),o=(e.bitrate/1e6).toFixed(1),a=f(e.height,{bitRate:o,includeBitrate:Boolean(window.enableResolutionsBitrate)}),d=r.dom.createEl("p",{innerHTML:a,className:"rendition",res:e.height,qualityIndex:e.qualityIndex});r.dom.appendContent(i,d),r.dom.appendContent(v,i),d.addEventListener("click",function(e){window.height===e.target.res&&e.target.bandwidth==window.bandwidth||(t.resetRenditions(),window.height=e.target.res,window.selectedVideo=e.target.video,window.qualityIndex=e.target.qualityIndex,y(t.playerId,e.target),r.dom.addClass(d,"selected"))})}),this.addAutoRendition("drm",v)),r.dom.appendContent(c,v),r.dom.appendContent(d,c),r.dom.appendContent(n,d)}},{key:"addDynamicSwitchIfAuto",value:function(){for(var e,t=this.player_.textTracks(),n=0;n<t.length;n++)"segment-metadata"===t[n].label&&(e=t[n]);var i=null,o=m();e&&e.on("cuechange",function(){var t,n,a=e.activeCues[0];if(console.log((null==a||null===(t=a.value)||void 0===t||null===(n=t.resolution)||void 0===n?void 0:n.height)+"p"),a&&document.querySelector(".auto.selected")){var d,l,r,s,u,c,v,m;if(null!=a&&null!==(d=a.value)&&void 0!==d&&null!==(l=d.resolution)&&void 0!==l&&l.height&&i!==(null==a||null===(r=a.value)||void 0===r||null===(s=r.resolution)||void 0===s?void 0:s.height))document.querySelector(".auto.selected").textContent="".concat(o," ").concat(null==a||null===(v=a.value)||void 0===v||null===(m=v.resolution)||void 0===m?void 0:m.height,"p");i=null==a||null===(u=a.value)||void 0===u||null===(c=u.resolution)||void 0===c?void 0:c.height}})}},{key:"createEl",value:function(){var e=r.dom.createEl("div",{className:"container"}),t=r.dom.createEl("div",{className:"setting-icon"});return r.dom.appendContent(e,t),e}},{key:"addAutoRendition",value:function(e,t){var n=this,i=m();if("nondrm"==e){var o,a,d,l,s=null===(o=this.player_)||void 0===o||null===(a=o.tech_)||void 0===a?void 0:a.vhs.selectPlaylist().attributes.RESOLUTION.height,u=null===(d=this.player_)||void 0===d||null===(l=d.tech_)||void 0===l?void 0:l.vhs.selectPlaylist().attributes.BANDWIDTH,c=r.dom.createEl("div",{className:"relative"}),v=r.dom.createEl("p",{innerHTML:"".concat(i," ").concat(s,"p"),className:"rendition auto selected",bandwidth:u,res:s});v.addEventListener("click",function(e){window.height!==e.target.res&&(n.resetRenditions(),r.dom.addClass(v,"selected"),window.height=e.target.res,window.bandwidth=parseInt(e.target.bandwidth),window.selectedVideo=e.target.video,y(n.playerId,null,!0))}),r.dom.appendContent(c,v),r.dom.appendContent(t,c)}else{var h=r.dom.createEl("div",{className:"relative"}),p=r.dom.createEl("p",{innerHTML:i,className:"rendition selected",qualityIndex:"auto"});p.addEventListener("click",function(e){n.resetRenditions(),r.dom.addClass(p,"selected"),window.qualityIndex=e.target.qualityIndex,window.selectedVideo=e.target.video,y(n.playerId,null,!0)}),r.dom.appendContent(h,p),r.dom.appendContent(t,h)}}}]),b}(),y=function(e,t,n){var i,o=s.getPlayer(e),a=null==t?void 0:t.bandwidth;if((null==o||null===(i=o.tech_)||void 0===i?void 0:i.vhs)||!1){o.tech_.vhs.representations().forEach(function(e){n||e.bandwidth===a?e.enabled(!0):e.enabled(!1)}),o.handleTechPlaying_();var d=o.currentTime();o.currentTime(0),setTimeout(function(){o.currentTime(d)},100);var l=r.dom.$(".content");l&&r.dom.addClass(l,"resolution_hidden")}else{var u=null==t?void 0:t.qualityIndex;if(n){var c,v;null==o||null===(c=o.dash)||void 0===c||null===(v=c.mediaPlayer)||void 0===v||v.resetSettings()}else{var m,h,p,f;null==o||null===(m=o.dash)||void 0===m||null===(h=m.mediaPlayer)||void 0===h||h.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!1}}}}),null==o||null===(p=o.dash)||void 0===p||null===(f=p.mediaPlayer)||void 0===f||f.setRepresentationForTypeByIndex("video",u,!0);var g=o.currentTime();o.currentTime(0),setTimeout(function(){o.currentTime(g)},100);var y=r.dom.$(".content");y&&r.dom.addClass(y,"resolution_hidden")}}},b=Object.freeze({__proto__:null,playSelectedResolution:y,default:g});exports.playSelectedResolution=y,exports.resolution=b,exports.resolveAutoQualityLabel=m,exports.resolveEnhancedBitrateLabel=function(){return c().enhanced||""},exports.resolveHeightQualityLabel=v;
|
package/cjs/series-d088d841.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),i=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),s=require("@babel/runtime/helpers/assertThisInitialized"),n=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),o=require("@babel/runtime/helpers/defineProperty"),l=require("@babel/runtime/regenerator"),c=require("video.js"),d=require("./generic-99674f84.js"),u=require("./icons-eb807ef0.js"),p=require("./skin-66dce245.js");require("axios"),require("./browser-2807cc02.js"),require("md5"),require("js-cookie"),require("./captions-8c1f9c07.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js");var v=function(e){document.getElementById("".concat(e)).classList.add("vjs-waiting")};function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}var f,m=c.getComponent("Component"),g=function(){n(d,m);var e,l,c=(e=d,l=h(),function(){var i,t=a(e);if(l){var s=a(this).constructor;i=Reflect.construct(t,arguments,s)}else i=t.apply(this,arguments);return r(this,i)});function d(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i(this,d),t=c.call(this,e,n),o(s(t),"seriesData",[]),t.seriesData=n.seriesData,f=n.playerId,y(t.el(),t.seriesData),t.loadCSS(),t}return t(d,[{key:"createEl",value:function(){var e=document.createElement("div");return e.classList.add("vjs-season-list"),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./series-9c237975.js")}).then(function(e){var i=document.createElement("style");i.id="series",i.append("".concat(e.default)),document.head.appendChild(i)})}}]),d}();function b(){return(b=e(l.mark(function e(i,t,s,n){return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:d.pause(f),v(f),d.load(f,t).then(function(e){d.setCurrentVideo(e.response),d.play(f)});case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function y(e,i){for(var t='<div class="hover-div"></div>\n '.concat(u.EpisodesSvg(),'\n <div class="player-season-list-container on-click-toggle">\n <div id="season-list" class="season-list">\n <div class="season-list-head">seasons</div>\n <div class="season-name-container">\n ').concat(function(e){return e.map(function(e,i){return'<div\n class="season-title-sdk"\n key='.concat("title-".concat(e.title),'\n > <div class="season-container">\n ',e.title,"\n </div>\n </div>\n ")}).join("")}(i),'\n </div>\n </div>\n <div id="episode-list" class="episode-list hide-container"><div id="episodes-back-btn" class="episodes-back-btn" >\n <svg class=\'icon icon-backward\' height="22px" width="22px" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0.383092 19.5818C-0.0882695 19.0669 -0.124672 18.2566 0.273985 17.6961L0.382714 17.5615L7.30134 9.99714L0.383092 2.43893C-0.0882694 1.92406 -0.124672 1.11374 0.273985 0.553232L0.382714 0.418625C0.853882 -0.0964584 1.59542 -0.136236 2.10835 0.299398L2.23153 0.418213L11 9.99608L2.23191 19.5814C1.72148 20.1394 0.893733 20.1396 0.383092 19.5818Z" fill="white"/>\n </svg>\n <span>Episodes<span></div> <div id="episode-container" class="episode-container"> </div></div>\n </div>');null!=e&&e.firstChild;)e.removeChild(e.firstChild);for(var s=p.parseHtmlString(t);null!=s&&s.firstChild;)e.appendChild(s.firstChild)}exports.customSeasonList=y,exports.handleSeasonChange=function(e,i,t,s){var n=document.getElementById("season-list"),r=document.getElementById("episode-list"),a=document.getElementById("episode-container");e.id;for(var o=e.episodes.map(function(e,i){return'\n <div id="episode-wrapper" class="episode-wrapper">\n <div class="episode-title" id="episode-title">\n <div class="details-wrapper">\n <div id="title-wrapper" class="title-wrapper">'.concat(i+1," ").concat(e.title,' </div>\n <div class="progress-bar-div">\n <div id="progress-div" class="progress-div"></div>\n </div>\n </div>\n <div class="meta-details">\n <div class="episode-image lazy" style="width:124px; height: 70px;">\n <img src=').concat(e.gist.videoImageUrl,' alt="').concat(e.title,'\'s cover"></img>\n </div>\n <div class="description-wrapper">').concat(e.gist.description,"</div>\n </div>\n </div>\n </div>")}).join("");null!=a&&a.firstChild;)a.removeChild(a.firstChild);for(var l=p.parseHtmlString(o);null!=l&&l.firstChild;)a.appendChild(l.firstChild);!function(e){d.getSeriesWatchHistory(e).then(function(e){var i=e.data,t=document.querySelectorAll("#progress-div");t&&i.map(function(e,i){e&&e.watchedPercentage&&t[i]&&(t[i].style.width=e.watchedPercentage+"px")})}).catch(function(e){})}(s),n.classList.toggle("hide-container"),r.classList.toggle("hide-container");var c=document.querySelectorAll(".details-wrapper"),u=document.querySelectorAll("#episode-title"),v=document.querySelectorAll(".meta-details"),h=document.querySelector("#episodes-back-btn"),f=e.id,m=e.episodes;h.addEventListener("click",function(){return function(e,i){e.classList.remove("hide-container"),i.classList.add("hide-container")}(n,r)});for(var g=function(i){c[i].addEventListener("click",function(){return function(e,i,t){var s=i.querySelector(".meta-details");i.classList.toggle("episode-active"),s.classList.toggle("metadetails-active"),t.forEach(function(i,s){s!==e&&(t[s].classList.remove("episode-active"),t[s].querySelector(".meta-details").classList.remove("metadetails-active"))})}(i,u[i],u)}),v[i].addEventListener("click",function(){return function(e,i,t,s){return b.apply(this,arguments)}(i,m[i].id,t,u)}),e.episodes[i].id==f&&u[i].classList.add("highlight-active-eps")},y=0;y<c.length;y++)g(y)},exports.seriesModule=g;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),s=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/assertThisInitialized"),o=require("@babel/runtime/helpers/inherits"),i=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),r=require("video.js"),a=require("./icons-eb807ef0.js"),d=require("./generic-99674f84.js"),c=require("./skin-66dce245.js"),u=require("./autoNextVideo-1de87b37.js");function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./browser-2807cc02.js"),require("md5"),require("js-cookie"),require("./captions-8c1f9c07.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js"),require("./index-44029519.js"),require("./localisation-56e0a999.js");var m=r.getComponent("Component"),p=function(){o(y,m);var p,h,g=(p=y,h=v(),function(){var e,t=l(p);if(h){var s=l(this).constructor;e=Reflect.construct(t,arguments,s)}else e=t.apply(this,arguments);return i(this,e)});function y(s){var o,i,l,r,a,c,v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,y),(c=g.call(this,s,v)).playerId=v.playerId,c.seriesData=v.sres,c.videos=null==v||null===(o=v.sres)||void 0===o?void 0:o.seasons,c.currentVideoData=v.res,c.initialiseStructure(),c.loadCSS(),c.selectedSeason=0,c.cb=null==v||null===(i=v.series)||void 0===i?void 0:i.cb,c.autoPlayNext=(null==v||null===(l=v.series)||void 0===l?void 0:l.autoPlayNext)||!1,sessionStorage.getItem("token"),c.watchMap=d.getSeriesWatchMap(),null!==(r=n(c))&&void 0!==r&&r.autoPlayNext&&null!=v&&null!==(a=v.series)&&void 0!==a&&a.enable){var m,p,h,f,b=null==v||null===(m=v.sres)||void 0===m?void 0:m.seasons,C=[];b.map(function(t){C.push.apply(C,e(t.episodes))}),d.createIdxMapping(C),d.setVideoIdxById(null===(p=c.options_)||void 0===p||null===(h=p.res)||void 0===h||null===(f=h.video)||void 0===f?void 0:f.id),u.autoPlayNext({playerId:c.playerId,content:C,cb:c.cb,series:null==v?void 0:v.sres})}return c}return s(y,[{key:"createEl",value:function(){var e=r.dom.createEl("div",{className:"series-selection vjs-control vjs-button"});e.style.position="unset";var t=r.dom.createEl("button",{className:"series-selector-icon",title:"season selector",innerHTML:"".concat(a.PlaylistIcon())});return r.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./series-v2-b67b1a33.js")}).then(function(e){var t=document.getElementById("series-v2");t||((t=document.createElement("style")).id="series-v2",document.head.appendChild(t)),t.textContent="".concat(e.default)})}},{key:"toggleOpenClose",value:function(e){var t,s=this.el();null!=e&&null!==(t=e.classList)&&void 0!==t&&t.contains("hidden")?(c.closeOpenDrawers(),e.classList.remove("hidden"),e.hidden=!1,s.classList.add("open"),c.setUpdatedElHeight(this.playerId,e)):(e.classList.add("hidden"),e.hidden=!0,s.classList.remove("open"))}},{key:"handleTabIndexSelector",value:function(){var e,t=document.getElementsByClassName("season-holder");document.getElementById("sr-announcer").textContent="season selector dialog open",null!==(e=document.getElementsByClassName("series-selector-cross-icon"))&&void 0!==e&&e[0]&&(document.getElementsByClassName("series-selector-cross-icon")[0].tabIndex=0);for(var s=0;s<(null==t?void 0:t.length);s++)t[s].tabIndex=0}},{key:"handleCloseTabIndex",value:function(){var e,t,s=this,n=document.getElementsByClassName("season-holder");document.getElementById("sr-announcer").textContent="season selector dialog closed",null!==(e=document.getElementsByClassName("series-selector-cross-icon"))&&void 0!==e&&e[0]&&(document.getElementsByClassName("series-selector-cross-icon")[0].tabIndex=-1);for(var o=0;o<(null==n?void 0:n.length);o++)n[o]&&(n[o].tabIndex=-1);for(var i=(null===(t=this.el())||void 0===t?void 0:t.querySelectorAll(".series-container"))||[],l=0;l<i.length;l++)i[l].tabIndex=-1;this._suppressToggleClick=!0,setTimeout(function(){document.getElementsByClassName("series-selector-icon")[0]&&document.getElementsByClassName("series-selector-icon")[0].focus({preventScroll:!0}),setTimeout(function(){s._suppressToggleClick=!1},300)},100)}},{key:"focusFirstSeason",value:function(){var e=r.dom.$(".season-holder",this.el())||r.dom.$(".series-container",this.el());e&&e.focus()}},{key:"focusFirstEpisode",value:function(){var e=r.dom.$(".series-container",this.el());e&&e.focus()}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),s=r.dom.createEl("div",{className:"series-selection-container hidden"});s.setAttribute("aria-labelledby","seasons"),s.hidden=!0;var n=r.dom.$(".series-selector-icon",this.el());n.onpointerdown=function(){e._allowToggle=!0},n.onmousedown=function(){e._allowToggle=!0},n.onkeydown=function(t){"Enter"!==t.key&&" "!==t.key||(e._allowToggle=!0)},n.onclick=function(){if(!e._suppressToggleClick){var t=s.classList.contains("hidden");t&&!e._allowToggle||(e._allowToggle=!1,e.toggleOpenClose(s),t?(e.handleTabIndexSelector(),s.classList.contains("hidden")||e.focusFirstSeason()):e.handleCloseTabIndex())}};var o=document.getElementById(this.playerId);if(o){var i=window.getComputedStyle(o,null).getPropertyValue("height").slice(0,-2);s.style.height="".concat(i,"px"),r.dom.appendContent(t,s),o.style.overflow="hidden",this.addFunctionality(s)}}},{key:"handleSeriesCloseIcon",value:function(e,t,s){if("series-selector-cross-icon"===e.className)t.classList.add("hidden"),t.hidden=!0,s.classList.remove("open"),this.handleCloseTabIndex();else if("series-selector-back-icon"===e.className){var n=r.dom.$(".series-selector-content",this.el());for(r.dom.$(".series-selector-cross-icon",this.el()),e.className="series-selector-cross-icon";null!=n&&n.firstChild;)n.removeChild(n.firstChild);var o=this.createSeasonLister();for(r.dom.appendContent(n,o),r.dom.$(".series-selector-title",this.el()).textContent="Seasons";null!=e&&e.firstChild;)e.removeChild(e.firstChild);var i=c.parseSvgString(a.crossIconSvg());e.appendChild(i)}}},{key:"addFunctionality",value:function(e){var t=this,s=this.el(),n=r.dom.createEl("div",{className:"series-selector-head"}),o=r.dom.createEl("button",{className:"series-selector-cross-icon",ariaLabel:"close season selector",innerHTML:"".concat(a.crossIconSvg()),tabIndex:-1});o.onclick=function(){t.handleSeriesCloseIcon(o,e,s)},o.onkeydown=function(n){"Enter"===n.key&&t.handleSeriesCloseIcon(o,e,s)};var i=r.dom.createEl("h2",{className:"series-selector-title",ariaLabel:"Seasons",innerHTML:"Seasons",id:"seasons"}),l=r.dom.createEl("div",{style:"position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;",ariaLive:"assertive",id:"sr-announcer",tabIndex:-1}),d=r.dom.createEl("div",{className:"series-selector-content"}),u=this.createSeasonLister();r.dom.appendContent(n,l),r.dom.appendContent(d,u),r.dom.appendContent(n,o),r.dom.appendContent(n,i),r.dom.appendContent(e,n),r.dom.appendContent(e,d),c.handleDrawerResizing(this.playerId,e)}},{key:"createSeasonLister",value:function(){var e=this;c.getPlayer(this.playerId);for(var t=d.getCurrentSeries(),s=r.dom.createEl("div",{className:"season-container"}),n=function(n){var o,i,l,a,c=document.createElement("label");c.className="season-holder",c.ariaLabel=null===(o=t[n])||void 0===o?void 0:o.title,c.role="button",c.type="button",c.tabIndex=-1,c.setAttribute("aria-LabelledBy",null===(i=t[n])||void 0===i?void 0:i.title),c.setAttribute("for","season-".concat(n));var u=document.createElement("div");u.className="season - ".concat(n),u.textContent=null===(l=t[n])||void 0===l?void 0:l.title,u.id=null===(a=t[n])||void 0===a?void 0:a.title;var v=r.dom.createEl("input",{className:"radio - ".concat(n),id:"season-".concat(n),name:"season-radio"});v.setAttribute("type","radio"),e.selectedSeason==n&&(v.checked=!0),v.onclick=function(t){d.seasonIdxManager.set(n),e.showSeasonDetails(n)},c.onkeydown=function(t){"Enter"===t.key&&(d.seasonIdxManager.set(n),e.showSeasonDetails(n))},r.dom.appendContent(c,v),r.dom.appendContent(c,u),r.dom.appendContent(s,c)},o=0;o<t.length;o++)n(o);return s}},{key:"loadSeriesAssetById",value:function(e,t){var s,n=this;d.setVideoIdxById(null===(s=e[t])||void 0===s?void 0:s.id),d.load(this.playerId,e[t].id).then(function(e){null!=n&&n.cb&&n.cb(e)}).catch(function(e){null!=n&&n.cb&&n.cb(e)})}},{key:"getSeasonDetailsContainer",value:function(t,s){var n=this;t=t.map(function(e){var t,s,o,i,l,r,a,d,c;return{id:null==e?void 0:e.id,title:null==e?void 0:e.title,description:null==e||null===(t=e.gist)||void 0===t?void 0:t.description,img:(null==e||null===(s=e.gist)||void 0===s||null===(o=s.imageGist)||void 0===o?void 0:o.r16x9)||(null===(i=window)||void 0===i||null===(l=i.app_data)||void 0===l||null===(r=l.appcmsMain)||void 0===r||null===(a=r.images)||void 0===a?void 0:a.placeholderCover),watchedPercentage:(null==n||null===(d=n.watchMap)||void 0===d||null===(c=d.get(null==e?void 0:e.id))||void 0===c?void 0:c.p)||0}});for(var o=function(o){var i,l,a,d,u,v=r.dom.createEl("div",{className:"series-container",tabIndex:0,role:"button",type:"button"}),m=r.dom.createEl("div",{className:"series-section-data",index:o,innerHTML:"".concat((null===(i=t[o])||void 0===i?void 0:i.title)||"")});r.dom.createEl("div",{className:"series-title",innerHTML:"".concat((null===(l=t[o])||void 0===l?void 0:l.title)||"")}),r.dom.createEl("div",{className:"series-progress-bar",innerHTML:"<div style='width:".concat(t[o].watchedPercentage,"%' class='series-progress-bar-value'></div>")});var p=r.dom.createEl("div",{className:"series-section-image"}),h=(null===(a=t[o])||void 0===a?void 0:a.description)||"";(null===(d=h)||void 0===d?void 0:d.length)>170&&(h=h.substr(0,170)+"..."),r.dom.createEl("div",{className:"series-description",innerHTML:"".concat(h||"")});var g=r.dom.createEl("img",{className:"series-image"});g.src="".concat(c.impolicy16x9(null===(u=t[o])||void 0===u?void 0:u.img)),g.alt="Episode ".concat(o+1),g.ariaHidden=!0,r.dom.appendContent(p,g),r.dom.appendContent(v,p),r.dom.appendContent(v,m),r.dom.appendContent(s,v),v.onclick=function(e){e.stopPropagation(),n.loadSeriesAssetById(t,o)},v.onkeydown=function(e){"Enter"===e.key&&(e.stopPropagation(),n.loadSeriesAssetById(t,o))},m.onclick=function(t){var s,n,o,i=document.getElementsByClassName("series-selector-content")[0].childNodes,l=(i=e(i))[t.target.index].getElementsByClassName("series-section-expanded")[0];null!=l&&null!==(s=l.classList)&&void 0!==s&&s.contains("hidden")?(v.style.backgroundColor="#0000007d",null==l||null===(n=l.classList)||void 0===n||n.remove("hidden")):(null==l||null===(o=l.classList)||void 0===o||o.add("hidden"),v.style.backgroundColor="unset")}},i=0;i<t.length;i++)o(i);return parent}},{key:"showSeasonDetails",value:function(e){this.selectedSeason=e;for(var t=r.dom.$(".series-selector-content",this.el());null!=t&&t.firstChild;)t.removeChild(t.firstChild);var s=d.getCurrentSeries()[e].episodes;this.getSeasonDetailsContainer(s,t);var n=r.dom.$(".series-selector-cross-icon",this.el());for(n.className="series-selector-back-icon";null!=n&&n.firstChild;)n.removeChild(n.firstChild);var o=c.parseSvgString(a.BackIcon());n.appendChild(o),r.dom.$(".series-selector-title",this.el()).textContent="Season ".concat(e+1),this.focusFirstEpisode()}}]),y}();exports.default=p;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),s=require("@babel/runtime/helpers/assertThisInitialized"),i=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),r=require("@babel/runtime/helpers/getPrototypeOf"),l=require("video.js"),a=require("./icons-eb807ef0.js"),d=require("./generic-99674f84.js"),c=require("./skin-66dce245.js"),u=require("./autoNextVideo-1de87b37.js");function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./browser-2807cc02.js"),require("md5"),require("js-cookie"),require("./captions-8c1f9c07.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js"),require("./index-44029519.js"),require("./localisation-56e0a999.js");var p=l.getComponent("Component"),m=function(){i(f,p);var m,h,g=(m=f,h=v(),function(){var e,t=r(m);if(h){var n=r(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return o(this,e)});function f(n){var i,o,r,l,a,c,v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,f),(c=g.call(this,n,v)).playerId=v.playerId,c.seriesData=v.sres,c.videos=null==v||null===(i=v.sres)||void 0===i?void 0:i.seasons,c.currentVideoData=v.res,c.initialiseStructure(),c.loadCSS(),c.selectedSeason=0,c.cb=null==v||null===(o=v.series)||void 0===o?void 0:o.cb,c.autoPlayNext=(null==v||null===(r=v.series)||void 0===r?void 0:r.autoPlayNext)||!1,sessionStorage.getItem("token"),c.watchMap=d.getSeriesWatchMap(),null!==(l=s(c))&&void 0!==l&&l.autoPlayNext&&null!=v&&null!==(a=v.series)&&void 0!==a&&a.enable){var p,m,h,C,y=null==v||null===(p=v.sres)||void 0===p?void 0:p.seasons,b=[];y.map(function(t){b.push.apply(b,e(t.episodes))}),d.createIdxMapping(b),d.setVideoIdxById(null===(m=c.options_)||void 0===m||null===(h=m.res)||void 0===h||null===(C=h.video)||void 0===C?void 0:C.id),u.autoPlayNext({playerId:c.playerId,content:b,cb:c.cb,series:null==v?void 0:v.sres})}return c}return n(f,[{key:"createEl",value:function(){var e=l.dom.createEl("div",{className:"series-selection vjs-control vjs-button"});e.style.position="unset";var t=l.dom.createEl("div",{className:"series-selector-icon",innerHTML:"".concat(a.EpisodesSvg())});return l.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./series-v2-e037e14e.js")}).then(function(e){var t=document.createElement("style");t.id="series-v2",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"toggleOpenClose",value:function(e){var t,n=this.el();null!=e&&null!==(t=e.classList)&&void 0!==t&&t.contains("hidden")?(c.closeOpenDrawers(),e.classList.remove("hidden"),n.classList.add("open"),e.style.right="0px"):(e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px")}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),n=l.dom.createEl("div",{className:"series-selection-container hidden"});l.dom.$(".series-selector-icon",this.el()).onclick=function(){return e.toggleOpenClose(n)};var s=document.getElementById(this.playerId);if(s){var i=window.getComputedStyle(s,null).getPropertyValue("height").slice(0,-2);n.style.height="".concat(i,"px"),l.dom.appendContent(t,n),s.style.overflow="hidden",this.addFunctionality(n)}}},{key:"addFunctionality",value:function(e){var t=this,n=this.el(),s=l.dom.createEl("div",{className:"series-selector-head"}),i=l.dom.createEl("div",{className:"series-selector-cross-icon",innerHTML:"".concat(a.crossIconSvg())});i.onclick=function(){if("series-selector-cross-icon"===i.className)e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px";else if("series-selector-back-icon"===i.className){var s=l.dom.$(".series-selector-content",t.el());for(l.dom.$(".series-selector-cross-icon",t.el()),i.className="series-selector-cross-icon";null!=s&&s.firstChild;)s.removeChild(s.firstChild);var o=t.createSeasonLister();for(l.dom.appendContent(s,o),l.dom.$(".series-selector-title",t.el()).textContent="Seasons";null!=i&&i.firstChild;)i.removeChild(i.firstChild);var r=c.parseSvgString(a.crossIconSvg());i.appendChild(r)}};var o=l.dom.createEl("div",{className:"series-selector-title",innerHTML:"Seasons"}),r=l.dom.createEl("div",{className:"series-selector-content"}),d=this.createSeasonLister();l.dom.appendContent(r,d),l.dom.appendContent(s,i),l.dom.appendContent(s,o),l.dom.appendContent(e,s),l.dom.appendContent(e,r),c.getPlayer(this.playerId).on("fullscreenchange",function(){var n=document.getElementById(t.playerId);if(n){var s=window.getComputedStyle(n,null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(s,"px")}})}},{key:"createSeasonLister",value:function(){var e=this;c.getPlayer(this.playerId);for(var t=d.getCurrentSeries(),n=l.dom.createEl("div",{className:"season-container"}),s=function(s){var i,o=document.createElement("label");o.className="season-holder",o.setAttribute("for","season-".concat(s));var r=document.createElement("div");r.className="season - ".concat(s),r.textContent=null===(i=t[s])||void 0===i?void 0:i.title;var a=l.dom.createEl("input",{className:"radio - ".concat(s),id:"season-".concat(s),name:"season-radio"});a.setAttribute("type","radio"),e.selectedSeason==s&&(a.checked=!0),a.onclick=function(t){d.seasonIdxManager.set(s),e.showSeasonDetails(s)},l.dom.appendContent(o,a),l.dom.appendContent(o,r),l.dom.appendContent(n,o)},i=0;i<t.length;i++)s(i);return n}},{key:"getSeasonDetailsContainer",value:function(t,n){var s=this;t=t.map(function(e){var t,n,i,o,r;return{id:null==e?void 0:e.id,title:null==e?void 0:e.title,description:null==e||null===(t=e.gist)||void 0===t?void 0:t.description,img:null==e||null===(n=e.gist)||void 0===n||null===(i=n.imageGist)||void 0===i?void 0:i.r16x9,watchedPercentage:(null==s||null===(o=s.watchMap)||void 0===o||null===(r=o.get(null==e?void 0:e.id))||void 0===r?void 0:r.p)||0}});for(var i=function(i){var o,r,a,c,u,v,p,m=l.dom.createEl("div",{className:"series-container"}),h=l.dom.createEl("div",{className:"series-section",index:i}),g=l.dom.createEl("div",{className:"series-title",innerHTML:"".concat((null===(o=t[i])||void 0===o?void 0:o.title)||"")}),f=l.dom.createEl("div",{className:"series-progress-bar",innerHTML:"<div style='width:".concat(t[i].watchedPercentage,"%' class='series-progress-bar-value'></div>")});l.dom.appendContent(h,g),l.dom.appendContent(h,f),l.dom.appendContent(m,h),l.dom.appendContent(n,m);var C=l.dom.createEl("div",{className:"series-section-expanded hidden"}),y=(null===(r=t[i])||void 0===r?void 0:r.description)||"";(null===(a=y)||void 0===a?void 0:a.length)>170&&(y=y.substr(0,170)+"...");var b=l.dom.createEl("div",{className:"series-description",innerHTML:"".concat(y||"")}),S=l.dom.createEl("img",{className:"series-image"});S.src="".concat((null===(c=t[i])||void 0===c?void 0:c.img)||(null===(u=window)||void 0===u||null===(v=u.customData)||void 0===v?void 0:v.fallbackImage)),S.alt="".concat(null===(p=t[i])||void 0===p?void 0:p.title),l.dom.appendContent(C,S),l.dom.appendContent(C,b),l.dom.appendContent(m,C),l.dom.appendContent(n,m),C.onclick=function(e){var n;e.stopPropagation(),d.setVideoIdxById(null===(n=t[i])||void 0===n?void 0:n.id),d.load(s.playerId,t[i].id).then(function(e){null!=s&&s.cb&&s.cb(e)}).catch(function(e){null!=s&&s.cb&&s.cb(e)})},h.onclick=function(t){var n,s,i,o=document.getElementsByClassName("series-selector-content")[0].childNodes,r=(o=e(o))[t.target.index].getElementsByClassName("series-section-expanded")[0];null!=r&&null!==(n=r.classList)&&void 0!==n&&n.contains("hidden")?(m.style.backgroundColor="#0000007d",null==r||null===(s=r.classList)||void 0===s||s.remove("hidden")):(null==r||null===(i=r.classList)||void 0===i||i.add("hidden"),m.style.backgroundColor="unset")}},o=0;o<t.length;o++)i(o);return parent}},{key:"showSeasonDetails",value:function(e){this.selectedSeason=e;for(var t=l.dom.$(".series-selector-content",this.el());null!=t&&t.firstChild;)t.removeChild(t.firstChild);var n=d.getCurrentSeries()[e].episodes;this.getSeasonDetailsContainer(n,t);var s=l.dom.$(".series-selector-cross-icon",this.el());for(s.className="series-selector-back-icon";null!=s&&s.firstChild;)s.removeChild(s.firstChild);var i=c.parseSvgString(a.BackIcon());s.appendChild(i),l.dom.$(".series-selector-title",this.el()).textContent="Season ".concat(e+1)}}]),f}();exports.default=m;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),a=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),i=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),r=require("video.js"),o=require("./icons-eb807ef0.js"),d=require("./skin-66dce245.js"),s=require("./renditions-627bdfad.js"),c=require("./resolution-687b9e26.js"),u=require("./localisation-56e0a999.js");function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/defineProperty"),require("./browser-2807cc02.js");var v=r.getComponent("Component"),h=function(){n(y,v);var h,m,g=(h=y,m=p(),function(){var e,t=l(h);if(m){var a=l(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return i(this,e)});function y(e){var a,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,y),(a=g.call(this,e,n)).playerId=n.playerId,a.seriesData=n.sres,a.currentVideoData=n.res,a.initialiseStructure(),a.loadCSS(),a.resolutionBitrateMap,a}return a(y,[{key:"fillResolutionBitrateMap",value:function(e){var t=this;this.resolutionBitrateMap=new Map,e.forEach(function(e){var a=(null==e?void 0:e.bandwidth)||(null==e?void 0:e.bitrate);if(a){var n=null==t?void 0:t.resolutionBitrateMap.get(null==e?void 0:e.height);t.resolutionBitrateMap.set(null==e?void 0:e.height,Math.min(a,n||1/0))}})}},{key:"isEnhancedBitrate",value:function(e){var t,a=(null==e?void 0:e.bandwidth)||(null==e?void 0:e.bitrate),n=null==this||null===(t=this.resolutionBitrateMap)||void 0===t?void 0:t.get(null==e?void 0:e.height);return!(!a||!n)&&a>n}},{key:"createEl",value:function(){var e=r.dom.createEl("div",{className:"settings-selection vjs-control vjs-button"});e.style.position="unset";var t=r.dom.createEl("div",{className:"settings-selector-icon",innerHTML:"".concat(o.SettingsSvgV2())});return r.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./settings-icon-8d364c01.js")}).then(function(e){var t=document.createElement("style");t.id="video-captions",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),a=r.dom.createEl("div",{className:"selection-container hidden"});r.dom.$(".settings-selector-icon",this.el()).onclick=function(){var n;null!==(n=a.classList)&&void 0!==n&&n.contains("hidden")?(d.closeOpenDrawers(),a.classList.remove("hidden"),t.classList.add("open"),a.style.right="0px",d.setUpdatedElHeight(e.playerId,a)):(a.classList.add("hidden"),t.classList.remove("open"),a.style.right="-350px")};var n=document.getElementById(this.playerId);if(n){var i=window.getComputedStyle(n,null).getPropertyValue("height");a.style.height="".concat(i),r.dom.appendContent(t,a),n.style.overflow="hidden",this.addFunctionality(a),d.detectOrientationChange(this.playerId,a)}}},{key:"addFunctionality",value:function(e){var t=this.el(),a=r.dom.createEl("div",{className:"settings-selector-head"}),n=r.dom.createEl("div",{className:"settings-selector-cross-icon",innerHTML:"".concat(o.crossIconSvg())});n.onclick=function(){e.classList.add("hidden"),t.classList.remove("open"),e.style.right="-350px"};var i=r.dom.createEl("div",{className:"settings-selector-title",innerHTML:u.getLocalisation("settingsTitle")||"Settings"}),l=r.dom.createEl("div",{className:"settings-selector-content"}),s=r.dom.createEl("div",{className:"settings-container"}),c=this.createVideoQualityContainer();r.dom.appendContent(s,c);var p=this.createAudioQualityContainer();r.dom.appendContent(s,p),r.dom.appendContent(a,n),r.dom.appendContent(a,i),r.dom.appendContent(e,a),r.dom.appendContent(e,l),r.dom.appendContent(l,s),d.handleDrawerResizing(this.playerId,e)}},{key:"createAudioQualityContainer",value:function(){var e=d.getPlayer(this.playerId),t=null==e?void 0:e.audioTracks().tracks_;if(!((null==t?void 0:t.length)<=1)){var a=r.dom.createEl("div",{className:"audio-language-container"}),n=r.dom.createEl("div",{className:"audio-language-container-title",innerHTML:u.getLocalisation("audioLanguageText")||"Audio Language"});r.dom.appendContent(a,n);for(var i=function(e){var n,i=document.createElement("label");i.className="audio-language-holder",i.setAttribute("for","language-radio-".concat(e));var l=document.createElement("div");l.className="audio - ".concat(e),l.textContent=null==t||null===(n=t[e])||void 0===n?void 0:n.label;var o=r.dom.createEl("input",{className:"radio - ".concat(e),id:"language-radio-".concat(e),name:"audio-language-radio"});o.setAttribute("type","radio"),1==t[e].enabled&&(o.checked=!0),o.onchange=function(a){t.map(function(e){e.enabled=!1}),t[e].enabled=!0},r.dom.appendContent(i,o),r.dom.appendContent(i,l),r.dom.appendContent(a,i)},l=0;l<t.length;l++)i(l);return a}}},{key:"createVideoQualityContainer",value:function(){var t=this,a=r.dom.createEl("div",{className:"video-quality-container"}),n=r.dom.createEl("div",{className:"video-quality-container-title",innerHTML:u.getLocalisation("videoQualityText")||"Video Quality"});r.dom.appendContent(a,n);var i=[].concat(e(s.getRenditions(this.playerId)),[{height:"Auto"}]).sort(function(e,t){return(null==t?void 0:t.qualityIndex)-(null==e?void 0:e.qualityIndex)});this.fillResolutionBitrateMap(i),c.playSelectedResolution(this.playerId,"raw",!0);for(var l=function(e){var n,l=document.createElement("label"),s=document.createElement("div"),u=document.createElement("div");u.className="video-quality-bitrate-label",s.className="video-quality-holder",l.className="video-quality-label-container",l.setAttribute("for","quality".concat(e));var p=document.createElement("div");p.className="video-quality - ".concat(e);var v=null==i||null===(n=i[e])||void 0===n?void 0:n.height,h="Auto"==v,m=h?null:c.resolveHeightQualityLabel(v);if(h)for(var g=d.parseHtmlString(c.resolveAutoQualityLabel());null!=g&&g.firstChild;)p.appendChild(g.firstChild);else if(null!=m)for(var y=d.parseHtmlString(m);null!=y&&y.firstChild;)p.appendChild(y.firstChild);else if(p.appendChild(document.createTextNode("".concat(v,"p"))),v>=720)for(var f=d.parseHtmlString("<span class='hd-rendition'> HD </span>");null!=f&&f.firstChild;)p.appendChild(f.firstChild);var C="".concat(t.isEnhancedBitrate(i[e])?c.resolveEnhancedBitrateLabel():""),b=document.createTextNode(C);u.appendChild(b);var E=r.dom.createEl("input",{className:"radio - ".concat(e," radio-btn"),id:"quality".concat(e),name:"quality-radio",rendata:"".concat(i[e]),checked:"".concat(e==i.length-1)});E.setAttribute("type","radio"),E.onchange=function(a){var n=i[e];"true"=="".concat("Auto"==i[e].height)?c.playSelectedResolution(t.playerId,n,!0):c.playSelectedResolution(t.playerId,n)};var q=document.createElement("span");q.className=C?"check-mark center":"check-mark";var k=d.parseSvgString(o.TickMarkIcon());q.appendChild(k),s.appendChild(E),s.appendChild(q),s.appendChild(p),r.dom.appendContent(l,s),l.appendChild(u),r.dom.appendContent(a,l)},p=0;p<i.length;p++)l(p);return a}}]),y}();exports.default=h;
|
package/cjs/skin-08318a13.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./features-fb354bdf.js"),l=require("./skin-66dce245.js"),i=require("./index-9f6ff3ce.js"),n=require("./index-13c964bd.js"),t=require("./browser-2807cc02.js"),r=require("@babel/runtime/helpers/defineProperty"),o=require("@babel/runtime/helpers/toConsumableArray"),u=require("video.js");require("videojs-contrib-quality-menu");var a=require("./resolution-687b9e26.js"),d=require("./relatedVideosManager-0a220d05.js"),v=require("./generic-99674f84.js"),s=require("./icons-eb807ef0.js");function c(e,l){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);l&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),i.push.apply(i,n)}return i}function p(e){for(var l=1;l<arguments.length;l++){var i=null!=arguments[l]?arguments[l]:{};l%2?c(Object(i),!0).forEach(function(l){r(e,l,i[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach(function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(i,l))})}return e}require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./renditions-627bdfad.js"),require("./localisation-56e0a999.js"),require("./autoNextVideo-1de87b37.js"),require("./index-44029519.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("@babel/runtime/helpers/assertThisInitialized"),require("axios"),require("md5"),require("js-cookie"),require("./captions-8c1f9c07.js"),require("@viewlift/comscore/index.js");var b=function(e,l){var i,n;if(e&&null!=l){e.options_.label=l;var t=null===(i=e.el())||void 0===i||null===(n=i.querySelector)||void 0===n?void 0:n.call(i,".vjs-menu-item-text");t&&(t.innerHTML=l)}},f=function(e){var l,i;return null!==(l=null!==(i=null==e?void 0:e.bitrate)&&void 0!==i?i:null==e?void 0:e.bandwidth)&&void 0!==l?l:0},y=function(e){var l=a.resolveEnhancedBitrateLabel();return l?"".concat(e," ").concat(l):e},g=function(e){var l,i=null===(l=t.playerConfigManager.getConfig())||void 0===l?void 0:l.qualityLabels,n=a.resolveAutoQualityLabel();if(null!=i&&i.auto&&"function"==typeof u.addLanguage){var r="function"==typeof e.language&&e.language()||"en";u.addLanguage(r,{Auto:i.auto})}var d=function(e){var l,i=e.getChild("controlBar");return i&&(i.getChild("QualityMenuButton")||(null===(l=i.children())||void 0===l?void 0:l.find(function(e){return"QualityMenuButton"===(null==e?void 0:e.name_)})))||null}(e);if(d&&!d._qualityLabelsPatched){if(d._qualityLabelsPatched=!0,"function"==typeof d.groupByResolution_){var v=d.groupByResolution_.bind(d);d.groupByResolution_=function(){var e=this;return v().reduce(function(l,i){return l.concat(function(e,l){var i,n=o(l.levels||[]).sort(function(l,i){return f(e[i])-f(e[l])}),t=a.resolveHeightQualityLabel(null==e||null===(i=e[n[0]])||void 0===i?void 0:i.height),r=null!=t?t:l.label,u=null!=t?"":l.subLabel,d=f(e[n[n.length-1]]);return f(e[n[0]])===d?[p(p({},l),{},{label:r,subLabel:u})]:n.map(function(i){return p(p({},l),{},{levels:[i],active:e.selectedIndex===i,label:f(e[i])>d?y(r):r,subLabel:u})})}(e.qualityLevels_,i))},[])}}if("function"==typeof d.createItems){var s=d.createItems.bind(d);d.createItems=function(){var e=s();return e.forEach(function(e){var l;return b(e,null===(l=e.options_)||void 0===l?void 0:l.label)}),this.autoMenuItem_&&null!=i&&i.auto&&b(this.autoMenuItem_,n),e}}"function"==typeof d.update&&d.update()}},h=function(e){var i=l.getPlayer(e);if(i){var n=function(e){var l,i,n,t,r,o=null==e||null===(l=e.dash)||void 0===l?void 0:l.mediaPlayer;if(o&&"function"==typeof e.qualityLevels&&e._dashQualityLevelsFor!==o){var u=(null===(i=o.getRepresentationsByType)||void 0===i?void 0:i.call(o,"video"))||[];if(u.length){e._dashQualityLevelsFor=o;for(var a=e.qualityLevels();a.length;)a.removeQualityLevel(a[0]);var d=function(e){return(null==e?void 0:e.bandwidth)||1e3*((null==e?void 0:e.bitrateInKbit)||0)},v=u.map(function(){return!0}),s=!1,c=function(){s=!1;var e=u.filter(function(e,l){return v[l]});if(e.length&&e.length!==u.length){var l=e.reduce(function(e,l){return d(l)>d(e)?l:e});o.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!1}}}}),o.setRepresentationForTypeById("video",l.id,!0)}else o.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!0}}}})};u.forEach(function(e,l){a.addQualityLevel({id:String(e.id),width:e.width,height:e.height,bandwidth:d(e),enabled:function(e){if("boolean"!=typeof e)return v[l];v[l]=e,s||(s=!0,Promise.resolve().then(c))}})});var p=function(e){var l=u.findIndex(function(l){return l.id===(null==e?void 0:e.id)});l<0||a.selectedIndex===l||(a.selectedIndex_=l,a.trigger({type:"change",selectedIndex:l}))},b=null===(n=window)||void 0===n||null===(t=n.dashjs)||void 0===t||null===(r=t.MediaPlayer)||void 0===r?void 0:r.events;return null!=b&&b.QUALITY_CHANGE_RENDERED&&o.on(b.QUALITY_CHANGE_RENDERED,function(e){var l=e.mediaType,i=e.newRepresentation;"video"===l&&p(i)}),function(){var e;return p(null===(e=o.getCurrentRepresentationForType)||void 0===e?void 0:e.call(o,"video"))}}}}(i);"function"==typeof i.qualityMenu&&i.qualityMenu({useResolutionLabels:!0}),i.ready(function(){g(i),n&&n()}),i.on("loadstart",function(){i.ready(function(){return g(i)})})}};var m=function(e,i){var n,t,r,o,a,d,v,s,c,p,b,f,y=l.getPlayer(e),g=(null==i?void 0:i.theme)||{},h=u.dom.$(".vjs-play-progress"),m=u.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");m&&(m.style.color="".concat(null===(n=window)||void 0===n||null===(t=n.app_data)||void 0===t||null===(r=t.appcmsMain)||void 0===r||null===(o=r.brand)||void 0===o||null===(a=o.cta)||void 0===a||null===(d=a.primary)||void 0===d?void 0:d.backgroundColor)),h&&(h.style.background="".concat(null===(v=window)||void 0===v||null===(s=v.app_data)||void 0===s||null===(c=s.appcmsMain)||void 0===c||null===(p=c.brand)||void 0===p||null===(b=p.cta)||void 0===b||null===(f=b.primary)||void 0===f?void 0:f.backgroundColor));var q=y.getChild("BigPlayButton")||null;(null==g?void 0:g.progressBarColor)&&h&&(h.style.background=g.progressBarColor),(null==g?void 0:g.playButtonBackgroundColor)&&q&&(q.el().style.background=g.playButtonBackgroundColor),(null==g?void 0:g.playButtonColor)&&m&&(m.style.color=g.playButtonColor),(null==g?void 0:g.playButtonType)&&("square"==(null==g?void 0:g.playButtonType)?q.el().style.borderRadius=".3em":q.el().style.borderRadius="1.3em")};exports.initialiseSkin=function(r,o){l.getPlayer(r).addClass("skin_vlone"),function(r,o){var u,a=l.getPlayer(r),v=(null==o||null===(u=o.res)||void 0===u?void 0:u.siteId)||"";a&&(a.on("loadeddata",function(){var e,l,u,a,s,c,p,b;h(r);var f=(null===(e=d.relatedVideosManager.get())||void 0===e||null===(l=e.content)||void 0===l?void 0:l.length)>0;if(!(null!=o&&null!==(u=o.series)&&void 0!==u&&u.enable||null!==(a=window)&&void 0!==a&&null!==(s=a.app_data)&&void 0!==s&&null!==(c=s.appcmsMain)&&void 0!==c&&null!==(p=c.features)&&void 0!==p&&p.auto_play||f)||null!=o&&o.liveVideo){if(!(null!=o&&o.liveVideo||null!=o&&null!==(b=o.series)&&void 0!==b&&b.enable)){var y;y=d.relatedVideosManager.subscribe(function(e){var l;(null==e||null===(l=e.content)||void 0===l?void 0:l.length)>0&&(i.addNextEpPreview(r,o),y&&y())})}}else i.addNextEpPreview(r,o);null!=o&&o.liveVideo||t.isMobile()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===v||n.initiateTrickplay(r)}),a.one("play",function(){var l,i,n,t;null!==(l=window)&&void 0!==l&&null!==(i=l.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(r,null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t?void 0:t.iframeOverlayUrl)}))}(r,o),function(n,t){var r,o,u,a,c,p,b,f=l.getPlayer(n),y=(null==t?void 0:t.liveVideo)||!1,g=(null==t||null===(r=t.res)||void 0===r?void 0:r.contentType)||"video",h=(null==t||null===(o=t.res)||void 0===o||null===(u=o[g])||void 0===u?void 0:u.isSSAIEnabled)||!1,m=v.getSource(null==t?void 0:t.res,n)||{};m.src;var q=(null==t?void 0:t.skin_settings)||{},w=(null==t||null===(a=t.customData)||void 0===a?void 0:a.ads)||{};if(y&&(null==t||!t.liveui)){var j,L=null==f||null===(j=f.controlBar)||void 0===j?void 0:j.getChild("LiveDisplay"),_=(null==L?void 0:L.el())||null,S=null==_?void 0:_.querySelector(".vjs-live-display");if(_&&S){var k,B,C=document.createElement("button");C.type="button",C.className="vjs-live-display",C.setAttribute("aria-label","live"),C.textContent="LIVE";var P=function(){try{var e;null==f||null===(e=f.liveTracker)||void 0===e||e.seekToLiveEdge()}catch(e){console.log(e,"Cannot seek to LE")}};C.addEventListener("click",P),S.replaceWith(C),L&&(L.contentEl_=C);var E=live_button_el.querySelector(".vjs-live-display")||live_button_el,T=function(){var e,l,i,n=null===(e=null==f||null===(l=f.liveTracker)||void 0===l||null===(i=l.atLiveEdge)||void 0===i?void 0:i.call(l))||void 0===e||e;E.classList.toggle("vjs-behind-live",!n)};null==f||null===(k=f.liveTracker)||void 0===k||null===(B=k.on)||void 0===B||B.call(k,"liveedgechange",T),T(),_.removeAttribute("tabindex"),_.removeAttribute("role"),_.removeAttribute("aria-label")}}null!=q&&q.skipBtn&&0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)&&e.addSkipButton(n,"VL_ONE",s.SkipSvgV2());(null!=q&&q.rewindBtn&&0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)||1==(null==t?void 0:t.liveui))&&e.addRewindButton(n,"VL_ONE",s.RewindSvgV2());var O,M=d.relatedVideosManager.get();(null==M||null===(c=M.content)||void 0===c?void 0:c.length)>0&&e.addVideoSelector(n,M);O=d.relatedVideosManager.subscribe(function(i){var t,r,o=l.getPlayer(n);(null==o||null===(t=o.controlBar)||void 0===t||!t.getChild("videoSelector"))&&(null==i||null===(r=i.content)||void 0===r?void 0:r.length)>0&&(e.addVideoSelector(n,i),O&&O())}),null!=t&&null!==(p=t.series)&&void 0!==p&&p.enable&&e.addSeriesSelectorV2(n,t);(null==t||null===(b=t.streams)||void 0===b?void 0:b.length)>1&&e.addMulticamSelector(n,null==t?void 0:t.streams);if(i.addTVProviderImage(n,t),v.initialiseKeyboardEvents(n,t),h&&y&&"TRANSMIT"==(null==w?void 0:w.liveAdSticherProvider)&&!(null==w||!w.liveAdClientSideTracking))v.initializeTransmit(n,t);else if("MEDIA_TAILOR"==(null==w?void 0:w.vodAdSticherProvider)&&null!=w&&w.vodAdClientSideTracking&&h)if(y)v.setupAdvertisementMarkersForLinear(n);else{var I,A=null;if(null!=t&&null!==(I=t.series)&&void 0!==I&&I.enable){var V,R,x,D,N,Q=null===(V=v.getCurrentVideo())||void 0===V||null===(R=V.video)||void 0===R||null===(x=R.gist)||void 0===x?void 0:x.id,H=v.getSeriesWatchMap(),F=(null==H?void 0:H.get(Q))||{t:0,p:0},U=F.t,G=F.p;"function"==typeof(null===(D=window)||void 0===D||null===(N=D.watchHistory)||void 0===N?void 0:N.cb)&&window.watchHistory.cb({watchedTime:U}),G<95&&(A=U)}else{var K=t.watchHistoryResumeTime;t.watchedPercentage<95&&(A=K)}v.setupAdvertisementMarkers(n,A)}}(r,o),m(r,o)};
|