bitmovin-analytics 2.53.0 → 2.53.2
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/README.md +1 -1
- package/bitmovin-analytics-bitmovin-player-web-x.d.ts +0 -2
- package/bitmovin-analytics-bitmovin-player-web-x.js +2 -2
- package/bitmovin-analytics-bitmovin-player-web-x.js.map +1 -1
- package/bitmovin-analytics-bitmovin-player.d.ts +0 -2
- package/bitmovin-analytics-bitmovin-player.js +2 -2
- package/bitmovin-analytics-bitmovin-player.js.map +1 -1
- package/bitmovin-analytics.d.ts +0 -29
- package/bitmovin-analytics.js +2 -2
- package/bitmovin-analytics.js.map +1 -1
- package/package.json +1 -1
package/bitmovin-analytics.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code and its use and distribution, is subject to the terms
|
|
6
6
|
* and conditions of the applicable license agreement.
|
|
7
7
|
*
|
|
8
|
-
* Bitmovin Analytics Collector Version 2.53.
|
|
8
|
+
* Bitmovin Analytics Collector Version 2.53.2
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bitmovin=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.analytics=t())}(self,(function(){return function(){var e={2595:function(e,t){var n;n={VERSION:"2.4.0",Result:{SUCCEEDED:1,NOTRANSITION:2,CANCELLED:3,PENDING:4},Error:{INVALID_TRANSITION:100,PENDING_TRANSITION:200,INVALID_CALLBACK:300},WILDCARD:"*",ASYNC:"async",create:function(e,t){var i="string"==typeof e.initial?{state:e.initial}:e.initial,a=e.terminal||e.final,r=t||e.target||{},o=e.events||[],s=e.callbacks||{},l={},u={},c=function(e){var t=Array.isArray(e.from)?e.from:e.from?[e.from]:[n.WILDCARD];l[e.name]=l[e.name]||{};for(var i=0;i<t.length;i++)u[t[i]]=u[t[i]]||[],u[t[i]].push(e.name),l[e.name][t[i]]=e.to||t[i];e.to&&(u[e.to]=u[e.to]||[])};i&&(i.event=i.event||"startup",c({name:i.event,from:"none",to:i.state}));for(var d=0;d<o.length;d++)c(o[d]);for(var E in l)l.hasOwnProperty(E)&&(r[E]=n.buildEvent(E,l[E]));for(var E in s)s.hasOwnProperty(E)&&(r[E]=s[E]);return r.current="none",r.is=function(e){return Array.isArray(e)?e.indexOf(this.current)>=0:this.current===e},r.can=function(e){return!this.transition&&void 0!==l[e]&&(l[e].hasOwnProperty(this.current)||l[e].hasOwnProperty(n.WILDCARD))},r.cannot=function(e){return!this.can(e)},r.transitions=function(){return(u[this.current]||[]).concat(u[n.WILDCARD]||[])},r.isFinished=function(){return this.is(a)},r.error=e.error||function(e,t,n,i,a,r,o){throw o||r},r.states=function(){return Object.keys(u).sort()},i&&!i.defer&&r[i.event](),r},doCallback:function(e,t,i,a,r,o){if(t)try{return t.apply(e,[i,a,r].concat(o))}catch(t){return e.error(i,a,r,o,n.Error.INVALID_CALLBACK,"an exception occurred in a caller-provided callback function",t)}},beforeAnyEvent:function(e,t,i,a,r){return n.doCallback(e,e.onbeforeevent,t,i,a,r)},afterAnyEvent:function(e,t,i,a,r){return n.doCallback(e,e.onafterevent||e.onevent,t,i,a,r)},leaveAnyState:function(e,t,i,a,r){return n.doCallback(e,e.onleavestate,t,i,a,r)},enterAnyState:function(e,t,i,a,r){return n.doCallback(e,e.onenterstate||e.onstate,t,i,a,r)},changeState:function(e,t,i,a,r){return n.doCallback(e,e.onchangestate,t,i,a,r)},beforeThisEvent:function(e,t,i,a,r){return n.doCallback(e,e["onbefore"+t],t,i,a,r)},afterThisEvent:function(e,t,i,a,r){return n.doCallback(e,e["onafter"+t]||e["on"+t],t,i,a,r)},leaveThisState:function(e,t,i,a,r){return n.doCallback(e,e["onleave"+i],t,i,a,r)},enterThisState:function(e,t,i,a,r){return n.doCallback(e,e["onenter"+a]||e["on"+a],t,i,a,r)},beforeEvent:function(e,t,i,a,r){if(!1===n.beforeThisEvent(e,t,i,a,r)||!1===n.beforeAnyEvent(e,t,i,a,r))return!1},afterEvent:function(e,t,i,a,r){n.afterThisEvent(e,t,i,a,r),n.afterAnyEvent(e,t,i,a,r)},leaveState:function(e,t,i,a,r){var o=n.leaveThisState(e,t,i,a,r),s=n.leaveAnyState(e,t,i,a,r);return!1!==o&&!1!==s&&(n.ASYNC===o||n.ASYNC===s?n.ASYNC:void 0)},enterState:function(e,t,i,a,r){n.enterThisState(e,t,i,a,r),n.enterAnyState(e,t,i,a,r)},buildEvent:function(e,t){return function(){var i=this.current,a=t[i]||(t[n.WILDCARD]!=n.WILDCARD?t[n.WILDCARD]:i)||i,r=Array.prototype.slice.call(arguments);if(this.transition)return this.error(e,i,a,r,n.Error.PENDING_TRANSITION,"event "+e+" inappropriate because previous transition did not complete");if(this.cannot(e))return this.error(e,i,a,r,n.Error.INVALID_TRANSITION,"event "+e+" inappropriate in current state "+this.current);if(!1===n.beforeEvent(this,e,i,a,r))return n.Result.CANCELLED;if(i===a)return n.afterEvent(this,e,i,a,r),n.Result.NOTRANSITION;var o=this;this.transition=function(){return o.transition=null,o.current=a,n.enterState(o,e,i,a,r),n.changeState(o,e,i,a,r),n.afterEvent(o,e,i,a,r),n.Result.SUCCEEDED},this.transition.cancel=function(){o.transition=null,n.afterEvent(o,e,i,a,r)};var s=n.leaveState(this,e,i,a,r);return!1===s?(this.transition=null,n.Result.CANCELLED):n.ASYNC===s?n.Result.PENDING:this.transition?this.transition():void 0}}},e.exports&&(t=e.exports=n),t.StateMachine=n},3703:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AmazonIVSAdapter=void 0;var i=n(4350),a=n(8331),r=n(9627),o=n(1916),s=n(2108),l=n(4926),u=n(9876),c=n(2857),d=function(){function e(e,t,n){if((0,s.hasPlayerAlreadyBeenAugmented)(t))o.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance");else{(0,s.markPlayerInstanceAsAugmented)(t);var l=(0,a.sanitizeAnalyticsConfig)(e);if((0,r.areCollectorRequirementsValid)(l)){(0,a.guardAgainstDuplicatedUserId)(l);var d=new c.SourceUrlProvider;this.internalAdapter=new u.AmazonIVSInternalAdapter(t,d,n),this.analytics=i.Analytics.create(l,this.internalAdapter),this.wrapPlayerLoad(t,d)}}}return e.prototype.wrapPlayerLoad=function(e,t){var n=e.load;e.load=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return t.m3u8Url=i[0],n.apply(e,i)}},Object.defineProperty(e.prototype,"version",{get:function(){return l.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,s.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){if((0,s.isDefined)(this.analytics))throw new Error("Method not implemented.")},e.version=l.VERSION,e}();t.AmazonIVSAdapter=d},9876:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.AmazonIVSInternalAdapter=void 0;var o=n(5611),s=n(2663),l=n(556),u=n(8525),c=n(7224),d=n(3413),E=n(3848),p=n(8510),v=n(2647),h=n(5440),f=n(2751),m=n(9653),A=n(9027),y=function(e){function t(t,n,i){var a=e.call(this,i)||this;a.getPlayerVersion=function(){return a.player.getVersion()},a.getPlayerName=function(){return l.Player.AMAZON_IVS},a.getPlayerTech=function(){return"html5"},a.getAutoPlay=function(){return a.player.isAutoplay()},a.player=t,a.sourceUrlProvider=n;var r=new s.HeartbeatService((function(){return a.currentTime})),u=new o.AmazonIVSStateMachine(a.stateMachineCallbacks,r,a.opts);r.setListener(u),a.stateMachine=u;var c=new h.AmazonIVSPlayerContext(t);return a.listener=f.AmazonIVSPlayerEventListener.create(a,c,a.qualityChangeService),a.playerStatisticsProvider=new p.default(t.getHTMLVideoElement()),a.windowEventListener=new A.WindowEventListener(a.windowEventTracker,a,c),a}return a(t,e),t.prototype.initialize=function(e){var t=this;return this.listener.startMonitoring(this.player),this.windowEventListener.startMonitoring(),m.default.RELEASE.subscribe((function(){t.release()})),[]},Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.player.getPosition()},enumerable:!1,configurable:!0}),t.prototype.resetSourceRelatedState=function(){this.drmPerformanceInfo=void 0,this.playerStatisticsProvider.reset()},t.prototype.getCurrentPlaybackInfo=function(){var e=this.player.getHTMLVideoElement();return r(r(r({droppedFrames:this.playerStatisticsProvider.getDroppedFrames(),isLive:this.player.getDuration()===1/0,isMuted:this.player.isMuted(),playerTech:this.getPlayerTech(),videoWindowWidth:e.clientWidth,videoWindowHeight:e.clientHeight,videoPlaybackHeight:e.videoHeight,videoPlaybackWidth:e.videoWidth,videoBitrate:this.player.getQuality().bitrate,videoDuration:(0,d.normalizeVideoDuration)(this.player.getDuration()),size:(0,E.isVideoInFullscreen)()?u.PlayerSize.Fullscreen:u.PlayerSize.Window},this.getVideoAndAudioCodecs()),this.getCommonPlaybackInfo()),{streamFormat:c.StreamTypes.hls,m3u8Url:this.sourceUrlProvider.m3u8Url})},t.prototype.getVideoAndAudioCodecs=function(){var e=this.player.getQuality().codecs.split(",");return 2==e.length?{videoCodec:e[0],audioCodec:e[1]}:{}},t}(v.InternalAdapter);t.AmazonIVSInternalAdapter=y},3037:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorService=void 0;var i=n(2361),a=function(){function e(e,t){this.dispatcher=e,this.playerContext=t}return e.prototype.onError=function(e){var t={currentTime:this.playerContext.position,code:e.code,message:e.message,originalError:e,data:{exceptionMessage:e.message,exceptionStacktrace:[e.source]}};this.dispatcher.eventCallback(i.Event.ERROR,t)},e}();t.ErrorService=a},3003:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PauseEventDispatcher=void 0;var i,a=n(2361);!function(e){e[e.IDLE=0]="IDLE",e[e.PAUSE_SCHEDULED=1]="PAUSE_SCHEDULED",e[e.PAUSE_CANCELLED=2]="PAUSE_CANCELLED"}(i||(i={}));var r=function(){function e(e,t){this.dispatcher=e,this.playerContext=t,this.EVENT_DELAY_MS=10,this.state=i.IDLE}return e.prototype.cancelPause=function(){this.state==i.PAUSE_SCHEDULED&&(this.state=i.PAUSE_CANCELLED)},e.prototype.schedulePauseEvent=function(){var e=this;if(this.state!=i.PAUSE_SCHEDULED){this.state=i.PAUSE_SCHEDULED;var t={currentTime:this.playerContext.position};setTimeout((function(){e.triggerPause(t),e.state=i.IDLE}),this.EVENT_DELAY_MS,this)}},e.prototype.triggerPause=function(e){this.state!=i.PAUSE_CANCELLED&&this.dispatcher.eventCallback(a.Event.PAUSE,e)},e}();t.PauseEventDispatcher=r},9810:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlaybackService=void 0;var i=n(2361),a=n(3003),r=function(){function e(e,t,n,i){this.dispatcher=e,this.playerContext=t,this.pauseDispatcher=n,this.qualityChangeService=i,this.ignorePause=!1}return e.prototype.onStartupPlaying=function(){var e=this;this.ignorePause=!0,setTimeout((function(){e.ignorePause=!1}),100)},e.prototype.onPause=function(){this.ignorePause||this.pauseDispatcher.schedulePauseEvent()},e.prototype.onPlaying=function(){this.pauseDispatcher.cancelPause(),this.playing()},e.prototype.onRebuffering=function(){this.pauseDispatcher.cancelPause(),this.startBuffering()},e.prototype.onQualityChange=function(e){this.qualityChange(e)},e.prototype.onSeek=function(){this.seek()},e.prototype.onSeeked=function(){this.seeked()},e.prototype.startBuffering=function(){var e=this.playerContext.position;this.dispatcher.eventCallback(i.Event.START_BUFFERING,{currentTime:e})},e.prototype.playing=function(){var e=this.playerContext.position;this.dispatcher.eventCallback(i.Event.PLAYING,{currentTime:e})},e.prototype.qualityChange=function(e){if(this.qualityChangeService.shouldAllowVideoQualityChange(e.bitrate)){this.qualityChangeService.setVideoBitrate(e.bitrate);var t=this.playerContext.position;this.dispatcher.eventCallback(i.Event.VIDEO_CHANGE,{type:"video",bitrate:e.bitrate,width:e.width,height:e.height,codec:e.codecs,currentTime:t})}else this.qualityChangeService.setVideoBitrate(e.bitrate)},e.prototype.seek=function(){if(!this.playerContext.isLive){this.pauseDispatcher.cancelPause();var e=this.playerContext.position;this.dispatcher.eventCallback(i.Event.SEEK,{currentTime:e})}},e.prototype.seeked=function(){if(!this.playerContext.isLive){this.pauseDispatcher.cancelPause();var e=this.playerContext.position;this.dispatcher.eventCallback(i.Event.SEEKED,{currentTime:e})}},e.create=function(t,n,i){return new e(t,n,new a.PauseEventDispatcher(t,n),i)},e}();t.PlaybackService=r},4025:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VideoStartupService=void 0;var i,a=n(2361);!function(e){e[e.SETUP=0]="SETUP",e[e.IDLE=1]="IDLE",e[e.STARTUP=2]="STARTUP",e[e.STARTUP_FINISHED=3]="STARTUP_FINISHED"}(i||(i={}));var r=function(){function e(e,t,n){this.dispatcher=e,this.playerContext=t,this.qualityChangeService=n,this.state=i.SETUP}return Object.defineProperty(e.prototype,"finishedStartup",{get:function(){return this.state==i.STARTUP_FINISHED},enumerable:!1,configurable:!0}),e.prototype.onInitialized=function(){this.finishSetup()},e.prototype.onPlay=function(){this.startStartup()},e.prototype.onPlaying=function(){this.finishStartup()},e.prototype.finishSetup=function(){this.state=i.IDLE;var e=this.playerContext.position;this.dispatcher.eventCallback(a.Event.READY,{currentTime:e})},e.prototype.startStartup=function(){if(this.state==i.IDLE){this.state=i.STARTUP;var e=this.playerContext.position;this.dispatcher.eventCallback(a.Event.PLAY,{currentTime:e})}},e.prototype.finishStartup=function(){if(this.state==i.STARTUP){this.state=i.STARTUP_FINISHED;var e=this.playerContext.position;this.dispatcher.eventCallback(a.Event.PLAYING,{currentTime:e}),this.qualityChangeService.resetValues(),this.qualityChangeService.setStartupHasFinished(void 0,void 0)}},e}();t.VideoStartupService=r},5440:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AmazonIVSPlayerContext=void 0;var n=function(){function e(e){this.player=e}return Object.defineProperty(e.prototype,"position",{get:function(){return this.player.getPosition()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLive",{get:function(){return this.player.getDuration()===1/0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentQuality",{get:function(){return this.player.getQuality()},enumerable:!1,configurable:!0}),e}();t.AmazonIVSPlayerContext=n},2235:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AmazonIVSPlayerEventHandler=void 0;var i=n(1916),a=n(5063),r=n(3037),o=n(9810),s=n(4025),l=function(){function e(e,t,n){this.videoStartupService=e,this.playbackService=t,this.errorService=n}return e.prototype.onRebuffering=function(){i.logger.log("onRebuffering"),this.playbackService.onRebuffering()},e.prototype.onDurationChanged=function(e){i.logger.log("onDurationChanged: "+e)},e.prototype.onError=function(e){i.logger.log("onError: "+(0,a.tryJSONStringify)(e)),this.errorService.onError(e)},e.prototype.onInitialized=function(){i.logger.log("onInitialized"),this.videoStartupService.finishedStartup||this.videoStartupService.onInitialized()},e.prototype.onQualityChanged=function(e){i.logger.log("onQualityChanged: "+(0,a.tryJSONStringify)(e)),this.playbackService.onQualityChange(e)},e.prototype.onTimeUpdate=function(e){i.logger.log("onTimeUpdate: "+e)},e.prototype.onPlay=function(e){this.videoStartupService.finishedStartup?i.logger.log("onPlay:",e):this.videoStartupService.onPlay()},e.prototype.onPause=function(e){this.videoStartupService.finishedStartup&&(i.logger.log("onPause:",e),this.playbackService.onPause())},e.prototype.onPlaying=function(e){i.logger.log("onPlaying:",e),this.videoStartupService.finishedStartup?this.playbackService.onPlaying():(this.videoStartupService.onPlaying(),this.playbackService.onStartupPlaying())},e.prototype.onSeek=function(){this.videoStartupService.finishedStartup&&this.playbackService.onSeek()},e.prototype.onSeeked=function(){this.videoStartupService.finishedStartup&&this.playbackService.onSeeked()},e.create=function(t,n,i){return new e(new s.VideoStartupService(t,n,i),o.PlaybackService.create(t,n,i),new r.ErrorService(t,n))},e}();t.AmazonIVSPlayerEventHandler=l},2751:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AmazonIVSPlayerEventListener=t.IVS_PLAYER_EVENT=void 0;var i=n(2235);t.IVS_PLAYER_EVENT={DURATION_CHANGED:"PlayerDurationChanged",ERROR:"PlayerError",INITIALIZED:"PlayerInitialized",QUALITY_CHANGED:"PlayerQualityChanged",REBUFFERING:"PlayerRebuffering",SEEK_COMPLETED:"PlayerSeekCompleted",TIME_UPDATE:"PlayerTimeUpdate",PLAYBACK_RATE_CHANGED:"PlayerPlaybackRateChanged",PLAYBACK_BLOCKED:"PlayerPlaybackBlocked"};var a=function(){function e(e){this.eventHandler=e}return e.prototype.startMonitoring=function(e){this.startMonitoringIVSPlayer(e),this.startMonitoringHTMLVideoElement(e.getHTMLVideoElement())},e.prototype.startMonitoringHTMLVideoElement=function(e){e.addEventListener("play",this.eventHandler.onPlay.bind(this.eventHandler)),e.addEventListener("playing",this.eventHandler.onPlaying.bind(this.eventHandler)),e.addEventListener("pause",this.eventHandler.onPause.bind(this.eventHandler)),e.addEventListener("seeking",this.eventHandler.onSeek.bind(this.eventHandler)),e.addEventListener("seeked",this.eventHandler.onSeeked.bind(this.eventHandler))},e.prototype.startMonitoringIVSPlayer=function(e){e.addEventListener(t.IVS_PLAYER_EVENT.REBUFFERING,this.eventHandler.onRebuffering.bind(this.eventHandler)),e.addEventListener(t.IVS_PLAYER_EVENT.DURATION_CHANGED,this.eventHandler.onDurationChanged.bind(this.eventHandler)),e.addEventListener(t.IVS_PLAYER_EVENT.ERROR,this.eventHandler.onError.bind(this.eventHandler)),e.addEventListener(t.IVS_PLAYER_EVENT.INITIALIZED,this.eventHandler.onInitialized.bind(this.eventHandler)),e.addEventListener(t.IVS_PLAYER_EVENT.QUALITY_CHANGED,this.eventHandler.onQualityChanged.bind(this.eventHandler)),e.addEventListener(t.IVS_PLAYER_EVENT.TIME_UPDATE,this.eventHandler.onTimeUpdate.bind(this.eventHandler))},e.create=function(t,n,a){return new e(i.AmazonIVSPlayerEventHandler.create(t,n,a))},e}();t.AmazonIVSPlayerEventListener=a},2857:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceUrlProvider=void 0;var n=function(){};t.SourceUrlProvider=n},9653:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i="RELEASE",a=function(){function e(){var e;this.observer=((e={})[i]=[],e)}return e.prototype.subscribe=function(e,t){this.observer[e].push(t)},e.prototype.trigger=function(e){this.observer[e].forEach((function(e){e()}))},e}(),r=new a,o={RELEASE:(n=i,{subscribe:function(e){r.subscribe(n,e)},trigger:function(){r.trigger(n)}})};t.default=o},9027:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowEventListener=void 0;var i,a=n(2361),r=n(9653);!function(e){e[e.IDLE=0]="IDLE",e[e.UNLOADED=1]="UNLOADED"}(i||(i={}));var o=function(){function e(e,t,n){var o=this;this.windowEventTracker=e,this.dispatcher=t,this.playerContext=n,this.state=i.IDLE,this.onPageUnload=function(){o.state==i.IDLE&&(o.dispatcher.eventCallback(a.Event.UNLOAD,{currentTime:o.playerContext.position}),o.state=i.UNLOADED,r.default.RELEASE.trigger())}}return e.prototype.startMonitoring=function(){this.windowEventTracker.addEventListener("beforeunload",this.onPageUnload),this.windowEventTracker.addEventListener("unload",this.onPageUnload)},e}();t.WindowEventListener=o},887:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bitmovin8AdModule=void 0;var i=n(5063),a=n(5517),r=n(2953),o=n(436),s=function(){function e(e,t){var n=this;this.player=e,this.windowEventTracker=t,this.adCallbacks=new a.AdCallbacks,this.isLinearAdActive=function(){return n.player.ads&&n.player.ads.isLinearAdActive()||!1},this.getContainer=function(){return n.player.getContainer()},this.getAdModuleInfo=function(){return n.player.ads?n.player.ads.getModuleInfo():{name:void 0,version:void 0}},this.currentTime=function(){return n.player.getCurrentTime()},this.register()}return e.prototype.getAutoPlay=function(){return(0,o.getAutoPlay)(this.player)},e.prototype.register=function(){var e=this;this.player.on(this.player.exports.PlayerEvent.Play,(function(t){"advertising-api"===t.issuer&&e.adCallbacks.onPlay()})),this.player.on(this.player.exports.PlayerEvent.Paused,(function(t){"advertising-api"===t.issuer&&e.adCallbacks.onPause()})),this.player.on(this.player.exports.PlayerEvent.AdStarted,(function(t){e.adCallbacks.onAdStarted((0,r.mapBitmovinAd)(t.ad))})),this.player.on(this.player.exports.PlayerEvent.AdFinished,(function(t){e.adCallbacks.onAdFinished((0,r.mapBitmovinAd)(t.ad))})),this.player.on(this.player.exports.PlayerEvent.AdBreakStarted,(function(t){e.adCallbacks.onAdBreakStarted((0,r.mapBitmovinAdBreak)(t.adBreak))})),this.player.on(this.player.exports.PlayerEvent.AdBreakFinished,(function(t){e.adCallbacks.onAdBreakFinished((0,r.mapBitmovinAdBreak)(t.adBreak))})),this.player.on(this.player.exports.PlayerEvent.AdClicked,(function(t){e.adCallbacks.onAdClicked({clickThroughUrl:t.clickThroughUrl})})),this.player.on(this.player.exports.PlayerEvent.AdQuartile,(function(t){e.adCallbacks.onAdQuartile({quartile:t.quartile})})),this.player.on(this.player.exports.PlayerEvent.AdSkipped,(function(t){e.adCallbacks.onAdSkipped((0,r.mapBitmovinAd)(t.ad))})),this.player.on(this.player.exports.PlayerEvent.AdError,(function(t){var n;e.adCallbacks.onAdError((0,r.mapBitmovinAdError)(t,null===(n=e.player.ads.getActiveAd())||void 0===n?void 0:n.id))})),this.player.on(this.player.exports.PlayerEvent.AdManifestLoaded,(function(t){var n,a,o=t.adConfig,s="vmap"===(null===(n=null==o?void 0:o.tag)||void 0===n?void 0:n.type),l=(0,i.isNotNullish)(t.adConfig)?(0,r.mapBitmovinAdBreak)(t.adConfig):void 0,u=null===(a=t.downloadTiming)||void 0===a?void 0:a.downloadTime;e.adCallbacks.onAdManifestLoaded({adBreakInfo:l,manifestDownloadTime:u,isVmap:s})}));var t=function(){e.adCallbacks.onBeforeUnload()};this.windowEventTracker.addEventListener("beforeunload",t),this.windowEventTracker.addEventListener("unload",t)},e}();t.Bitmovin8AdModule=s},4679:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bitmovin8Adapter=void 0;var i=n(4350),a=n(6398),r=n(8331),o=n(9627),s=n(1916),l=n(2108),u=n(4926),c=n(4067),d=n(6596),E=function(){function e(e,t){var n,u=this;if(this.ssai={adBreakStart:function(e){if((0,l.isDefined)(u.internalAdapter)){var t=(0,c.sanitizeBitmovin8AdapterSsaiAdBreakMetadataAdPosition)(e);if((0,a.hasValidSsaiAdBreakMetadataStructure)(t)){var n=(0,a.simplySanitizeSsaiAdBreakMetadata)(t);u.internalAdapter.ssaiService.adBreakStart(n)}}},adStart:function(e){if((0,l.isDefined)(u.analytics)&&(0,l.isDefined)(u.internalAdapter)&&(0,a.hasValidSsaiAdMetadataStructure)(e)){var t=(0,a.simplySanitizeSsaiAdMetadata)(e);u.internalAdapter.ssaiService.adStart(t),u.analytics.setConfigParameters(),u.analytics.setAutoDetectedDeviceInformation()}},adQuartileFinished:function(e,t){if((0,l.isDefined)(u.analytics)&&(0,l.isDefined)(u.internalAdapter)&&(0,a.hasValidSsaiAdQuartileStructure)(e)){var n=(0,a.sanitizeSsaiAdQuartileMetadata)(t);u.internalAdapter.ssaiService.adQuartileFinished(e,n)}},adBreakEnd:function(){(0,l.isDefined)(u.analytics)&&(0,l.isDefined)(u.internalAdapter)&&(u.internalAdapter.ssaiService.adBreakEnd(),u.analytics.setConfigParameters(),u.analytics.setAutoDetectedDeviceInformation())}},(0,l.hasPlayerAlreadyBeenAugmented)(e))s.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance");else{(0,l.markPlayerInstanceAsAugmented)(e);var E=e.getConfig(),p=(0,r.sanitizeAnalyticsConfig)(E.analytics);if((0,o.areCollectorRequirementsValid)(p)){(0,r.guardAgainstDuplicatedUserId)(p),p.playerKey=null!==(n=p.playerKey)&&void 0!==n?n:E.key;var v=d.Bitmovin8InternalAdapter.create(e,t);this.internalAdapter=v,this.analytics=i.Analytics.create(p,this.internalAdapter),e.analytics=this,this.wrapPlayerLoad(e,this.analytics,v)}}}return e.prototype.wrapPlayerLoad=function(e,t,n){var i=e.load;e.load=function(){for(var a=[],r=0;r<arguments.length;r++)a[r]=arguments[r];if(a.length>0){var o=a[0].analytics;t.sourceChange(o)}return n.trackLoadstartWithAutoplay(),i.apply(e,a)}},Object.defineProperty(e.prototype,"version",{get:function(){return u.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,l.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,l.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,l.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,l.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){(0,l.isDefined)(this.analytics)&&this.analytics.sourceChange(e)},e.version=u.VERSION,e}();t.Bitmovin8Adapter=E},6596:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Bitmovin8InternalAdapter=void 0;var o,s=n(2403),l=n(9664),u=n(2663),c=n(6235),d=n(4916),E=n(6743),p=n(5878),v=n(3458),h=n(2361),f=n(556),m=n(8525),A=n(7614),y=n(9557),S=n(7881),T=n(3413),g=n(5248),I=n(1916),N=n(4649),D=n(5063),C=n(2647),_=n(887),P=n(7543),b=n(8676),R=n(665),U=n(436);!function(e){e.Fullscreen="fullscreen",e.Inline="inline",e.PictureInPicture="pictureinpicture"}(o||(o={}));var L=function(e){function t(t,n,i,a,r,o,l){var c=e.call(this,l)||this;c.onBeforeUnLoadEvent=!1,c.getPlayerVersion=function(){return c.player.version},c.getPlayerName=function(){return f.Player.BITMOVIN},c.getPlayerTech=function(){return c.player.getPlayerType()},c.getDrmPerformanceInfo=function(){return c.drmPerformanceInfo},c.httpRequestTrackingAdapter=r,c._videoCompletionTracker=a,c.segmentTracker=i,c.speedMeter=n,c.player=t;var d=new u.HeartbeatService((function(){return t.getCurrentTime()})),E=new s.Bitmovin8AnalyticsStateMachine(c.stateMachineCallbacks,d,c.opts);return d.setListener(E),c.sourceInfoFallbackService=o,c.stateMachine=E,c}return a(t,e),Object.defineProperty(t.prototype,"currentTime",{get:function(){var e;try{if((0,D.isNotNullish)(null===(e=this.player)||void 0===e?void 0:e.getCurrentTime)&&!this.isAdPlaying)return this.player.getCurrentTime()}catch(e){I.logger.warn("Analytics Collector attempted to access player, but player is not available anymore")}return this.lastTrackedCurrentTime?this.lastTrackedCurrentTime:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAdPlaying",{get:function(){var e=this.player.ads&&this.player.ads.getActiveAd();return(0,D.isNotNullish)(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"supportsDeferredLicenseLoading",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"adModule",{get:function(){return this._adModule},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoCompletionTracker",{get:function(){return this._videoCompletionTracker},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){var t=this;this.registerPlayerEventListeners(),this.registerUnloadEventListeners(),this._adModule=new _.Bitmovin8AdModule(this.player,this.windowEventTracker),this.ssaiService.activate({getPlayerCurrentTime:function(){return t.currentTime},reportEngagementInteraction:function(t){e.sendSsaiEngagementAdSample(t)},reportPlaybackInteraction:function(e,n){t.stateMachine.sendPlayingSample(e,n,!0)}});var n=new S.HttpRequestTracking([this.httpRequestTrackingAdapter]);return[new y.ErrorDetailTracking(e.errorDetailTrackingSettingsProvider,new A.ErrorDetailBackend(e.errorDetailTrackingSettingsProvider.collectorConfig),[e.errorDetailSubscribable],n)]},t.prototype.resetSourceRelatedState=function(){this.ssaiService.resetSourceRelatedState(),e.prototype.resetSourceRelatedState.call(this)},t.prototype.getAutoPlay=function(){return(0,U.getAutoPlay)(this.player)},t.prototype.getCurrentPlaybackInfo=function(){var t,n=this.player.getContainer(),i=r(r({},e.prototype.getCommonPlaybackInfo.call(this)),{size:this.player.getViewMode()===o.Fullscreen?m.PlayerSize.Fullscreen:m.PlayerSize.Window,playerTech:this.getPlayerTech(),isLive:this.player.isLive(),videoDuration:(0,T.normalizeVideoDuration)(this.videoDuration),streamFormat:this.player.getStreamType(),videoWindowWidth:null==n?void 0:n.offsetWidth,videoWindowHeight:null==n?void 0:n.offsetHeight,isMuted:this.player.isMuted(),isCasting:this.player.isCasting(),audioLanguage:(0,D.isNotNullish)(this.player.getAudio())?null===(t=this.player.getAudio())||void 0===t?void 0:t.lang:void 0,subtitleEnabled:!1,droppedFrames:(0,D.isNotNullish)(this.player.getSource())?this.player.getDroppedVideoFrames():0});return this.applySubtitleProperties(i),this.applyPlaybackQualityProperties(i),this.applyCastingProperties(i),this.applySourceProperties(i),((0,D.isNullish)(i.streamFormat)||"unknown"===i.streamFormat)&&this.sourceInfoFallbackService.applyStreamFormat(i),i},t.prototype.getSegmentInfo=function(){return this.segmentTracker.getSegments()},t.prototype.getDownloadSpeedInfo=function(){return this.speedMeter.getInfo()},t.prototype.resetDownloadSpeedInfoMeasures=function(){this.speedMeter.reset()},t.prototype.onError=function(){this.segmentTracker.reset()},t.prototype.trackLoadstartWithAutoplay=function(){this.getAutoPlay()&&this.eventCallback(h.Event.LOADSTART_AUTOPLAY,{currentTime:this.currentTime})},t.prototype.registerPlayerEventListeners=function(){var e=this;this.player.on(this.player.exports.PlayerEvent.SourceUnloaded,(function(t){e.segmentTracker.reset(),e.eventCallback(h.Event.SOURCE_UNLOADED,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.SourceLoaded,(function(t){e._videoCompletionTracker.reset(),e.videoDuration=e.player.getDuration(),e._videoCompletionTracker.setVideoDuration(e.player.getDuration()),e.sourceInfoFallbackService.setStreamFormat(e.player.getStreamType()),e.eventCallback(h.Event.SOURCE_LOADED,{})})),this.player.on(this.player.exports.PlayerEvent.CastStarted,(function(t){e.eventCallback(h.Event.START_CAST,t)})),this.player.on(this.player.exports.PlayerEvent.CastStopped,(function(){e.eventCallback(h.Event.END_CAST,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.Play,(function(t){"ui-seek"!==t.issuer&&e.eventCallback(h.Event.PLAY,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.Playing,(function(t){"advertising-api"!==t.issuer&&e.eventCallback(h.Event.PLAYING,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.Paused,(function(t){"ui-seek"!==t.issuer&&e.eventCallback(h.Event.PAUSE,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.TimeChanged,(function(t){e.isAdPlaying||(e.lastTrackedCurrentTime=e.player.getCurrentTime()),e.eventCallback(h.Event.TIMECHANGED,{currentTime:e.lastTrackedCurrentTime})})),this.player.on(this.player.exports.PlayerEvent.Seek,(function(t){e.allowSeeking(t)&&e.eventCallback(h.Event.SEEK,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.Seeked,(function(){e.eventCallback(h.Event.SEEKED,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.StallStarted,(function(){e.eventCallback(h.Event.START_BUFFERING,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.StallEnded,(function(){e.eventCallback(h.Event.END_BUFFERING,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.AudioPlaybackQualityChanged,(function(t){var n=t,i=n.sourceQuality,a=n.targetQuality;if(!(0,D.isNullish)(a)){var r={type:"audio",bitrate:a.bitrate,currentTime:e.currentTime,codec:a.codec};(0,D.isNotNullish)(i)&&e.qualityChangeService.shouldAllowAudioQualityChange(a.bitrate)&&e.eventCallback(h.Event.AUDIO_CHANGE,r),e.qualityChangeService.setAudioBitrate(a.bitrate),e.stateMachineCallbacks.updateSampleQualityInfo(r)}})),this.player.on(this.player.exports.PlayerEvent.VideoPlaybackQualityChanged,(function(t){var n=t,i=n.sourceQuality,a=n.targetQuality;if(!(0,D.isNullish)(a)){var r={type:"video",width:a.width,height:a.height,bitrate:a.bitrate,currentTime:e.currentTime,codec:a.codec};(0,D.isNotNullish)(i)&&e.qualityChangeService.shouldAllowVideoQualityChange(a.bitrate)&&e.eventCallback(h.Event.VIDEO_CHANGE,r),e.qualityChangeService.setVideoBitrate(a.bitrate),e.stateMachineCallbacks.updateSampleQualityInfo(r)}})),this.player.on(this.player.exports.PlayerEvent.ViewModeChanged,(function(t){"fullscreen"===t.to?e.eventCallback(h.Event.START_FULLSCREEN,{currentTime:e.currentTime}):"fullscreen"===t.from&&e.eventCallback(h.Event.END_FULLSCREEN,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.AdStarted,(function(t){e.eventCallback(h.Event.START_AD,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.AdFinished,(function(t){e.eventCallback(h.Event.END_AD,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.AdSkipped,(function(t){e.eventCallback(h.Event.END_AD,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.AdError,(function(t){e.eventCallback(h.Event.END_AD,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.Muted,(function(){e.eventCallback(h.Event.MUTE,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.Unmuted,(function(){e.eventCallback(h.Event.UN_MUTE,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.Error,(function(t){e.eventCallback(h.Event.ERROR,{code:t.code,message:t.name,legacyData:t.data,currentTime:e.currentTime,originalError:t,data:{additionalData:(0,D.tryJSONStringify)(t.data)}}),t.code!==v.ErrorCode.BITMOVIN_PLAYER_LICENSING_ERROR.code&&t.code!==v.ErrorCode.SETUP_MISSING_LICENSE_WHITELIST.code||e.onLicenseCallFailed.dispatch({}),e.ssaiService.sendAdEngagementErrorSample({code:t.code,message:t.name,severity:"CRITICAL"},t)})),this.player.on(this.player.exports.PlayerEvent.PlaybackFinished,(function(){e.eventCallback(h.Event.END,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.DownloadFinished,(function(t){0===t.downloadType.indexOf("drm/license/")&&(e.drmPerformanceInfo={drmType:t.downloadType.replace("drm/license/",""),drmLoadTime:1e3*t.downloadTime})})),this.player.on(this.player.exports.PlayerEvent.AudioChanged,(function(t){e.eventCallback(h.Event.AUDIOTRACK_CHANGED,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.SubtitleEnabled,(function(t){e.eventCallback(h.Event.SUBTITLE_CHANGE,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.SubtitleDisabled,(function(t){e.eventCallback(h.Event.SUBTITLE_CHANGE,{currentTime:e.currentTime})})),this.player.on(this.player.exports.PlayerEvent.LicenseValidated,(function(t){t.data.analytics&&void 0!==t.data.analytics.key?e.onLicenseKeyReceived.dispatch({licenseKey:t.data.analytics.key}):e.onLicenseCallFailed.dispatch({})}))},t.prototype.registerUnloadEventListeners=function(){var e=this,t=function(){if(!e.onBeforeUnLoadEvent){e.onBeforeUnLoadEvent=!0;var t=e.lastTrackedCurrentTime;e.eventCallback(h.Event.UNLOAD,{currentTime:t})}e.release()};t=t.bind(!0),this.player.on(this.player.exports.PlayerEvent.Destroy,t),this.windowEventTracker.addEventListener("beforeunload",t),this.windowEventTracker.addEventListener("unload",t)},t.prototype.applySourceProperties=function(e){var t=this.player.getSource();if(!(0,D.isNullish)(t)){e.videoTitle=t.title,e.mpdUrl=t.dash,e.m3u8Url=t.hls;var n=(0,g.getSourceInfoFromBitmovinSourceConfig)(t.progressive,this.player);e.progUrl=n.progUrl,"progressive"===this.player.getStreamType()&&(e.videoBitrate=n.progBitrate)}},t.prototype.applySubtitleProperties=function(e){var t;this.player.subtitles&&(t=this.player.subtitles.list().find((function(e){return!0===e.enabled}))),e.subtitleEnabled=(0,D.isNotNullish)(t),e.subtitleLanguage=(0,D.isNotNullish)(t)?t.lang:null},t.prototype.applyPlaybackQualityProperties=function(e){var t=this.player.getPlaybackVideoData();(0,D.isNotNullish)(t)&&(e.videoBitrate=t.bitrate,e.videoPlaybackHeight=t.height,e.videoPlaybackWidth=t.width,e.videoCodec=t.codec);var n=this.player.getPlaybackAudioData();(0,D.isNotNullish)(n)&&(e.audioBitrate=n.bitrate,e.audioCodec=n.codec)},t.prototype.applyCastingProperties=function(e){var t,n=this.player.isCasting()||this.player.isAirplayActive()||!1;if(e.isCasting=n,n)if(this.player.isAirplayActive())e.castTech=p.CastTech.AirPlay;else{var i=null===(t=(0,U.getPlayerConfig)(this.player))||void 0===t?void 0:t.remotecontrol;if(!(0,D.isNullish)(i))switch(i.type){case"googlecast":e.castTech=p.CastTech.GoogleCast;break;case"websocket":e.castTech=p.CastTech.WebSocket}}},t.prototype.allowSeeking=function(e){var t=e;return Math.abs(t.position-t.seekTarget)>N.ANALYTICS_MIN_SEEK_DIFFERENCE_THRESHOLD},t.create=function(e,n){var i=new R.SpeedMeterAdapter(e,new l.DownloadSpeedMeter).getDownloadSpeedMeter(),a=new b.SegmentTrackerAdapter(e,new c.SegmentTracker).getSegmentTracker(),r=new P.HttpRequestTrackingAdapter(e);return new t(e,i,a,new E.default,r,new d.SourceInfoFallbackService,n)},t}(C.InternalAdapter);t.Bitmovin8InternalAdapter=L},2953:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapBitmovinAdError=function(e,t){var n,r={activeAdId:t},o=e,s=o.data;if((0,i.isNotNullish)(s)&&(r.code=s.code||o.code,r.message=s.message||o.name,"adBreak"in s||"adConfig"in s)){var l=null!==(n=s.adBreak)&&void 0!==n?n:s.adConfig;r.adBreakInfo=a(l)}return r},t.mapBitmovinAd=function(e){var t,n,a,r,o,s,l,u,c,d,E,p={id:e.id,isLinear:e.isLinear,clickThroughUrl:e.clickThroughUrl,width:e.width,height:e.height},v=e.isLinear?e:void 0;(0,i.isNotNullish)(v)&&(p.duration=v.duration,p.skippable=(0,i.isNotNullish)(v.skippableAfter),p.skippableAfter=v.skippableAfter,p.mediaUrl=v.mediaFileUrl);var h=e.data;(0,i.isNotNullish)(h)&&(p.bitrate=h.bitrate,p.mimeType=h.mimeType,p.vastData={adSystem:null===(t=h.adSystem)||void 0===t?void 0:t.name,advertiserName:null===(n=h.advertiser)||void 0===n?void 0:n.name,apiFramework:h.apiFramework,creativeAdId:null===(a=h.creative)||void 0===a?void 0:a.adId,creativeId:null===(r=h.creative)||void 0===r?void 0:r.id,universalAdIdRegistry:null===(s=null===(o=h.creative)||void 0===o?void 0:o.universalAdId)||void 0===s?void 0:s.idRegistry,universalAdIdValue:null===(u=null===(l=h.creative)||void 0===l?void 0:l.universalAdId)||void 0===u?void 0:u.value,adDescription:h.adDescription,adTitle:h.adTitle,wrapperAdsCount:null!==(d=null===(c=h.wrapperAdIds)||void 0===c?void 0:c.length)&&void 0!==d?d:0,surveyUrl:null===(E=h.survey)||void 0===E?void 0:E.uri,minSuggestedDuration:h.minSuggestedDuration});return p},t.mapBitmovinAdBreak=a,t.resolveEffectiveAdTag=r,t.getFallbackIndex=o;var i=n(5063);function a(e){var t={replaceContentDuration:e.replaceContentDuration,fallbackIndex:o(e)};t.id="id"in e?e.id:void 0,t.scheduleTime="scheduleTime"in e?e.scheduleTime:void 0;var n=e,i=r(n),a=i.tagUrl,s=i.tagType;return t.tagUrl=a,t.tagType=s,t.persistent="persistent"in e?n.persistent:void 0,t.position="position"in e?e.position:void 0,t.preloadOffset="preloadOffset"in e?e.preloadOffset:void 0,t}function r(e){if((0,i.isNullish)(e.tag))return{};var t=o(e),n={tagType:e.tag.type,tagUrl:e.tag.url};if((0,i.isNullish)(e.fallbackTags)||t<=0||e.fallbackTags.length<t)return n;var a=e.fallbackTags[t-1];return{tagType:a.type,tagUrl:a.url}}function o(e){var t=e.currentFallbackIndex;return(0,i.isNullish)(t)?0:t}},4067:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeBitmovin8AdapterSsaiAdBreakMetadataAdPosition=void 0;var i=n(5063);t.sanitizeBitmovin8AdapterSsaiAdBreakMetadataAdPosition=function(e){var t=e;return(0,i.isNotNullish)(null==t?void 0:t.adPosition)&&("pre-roll"===t.adPosition?t.adPosition="preroll":"mid-roll"===t.adPosition?t.adPosition="midroll":"post-roll"===(null==t?void 0:t.adPosition)&&(t.adPosition="postroll")),t}},7543:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRequestTrackingAdapter=void 0,t.mapHttpRequestType=l;var i=n(675),a=n(7912),r=n(2974),o=n(5063),s=function(){function e(e){var t=this;this.eventDispatcher=new i.EventDispatcher,this.playerExports=e.exports,e.on(this.playerExports.PlayerEvent.DownloadFinished,(function(e){return t.onDownloadFinished(e)}))}return e.prototype.subscribe=function(e){return this.eventDispatcher.subscribe(e)},e.prototype.unsubscribe=function(e){this.eventDispatcher.unsubscribe(e)},e.prototype.onDownloadFinished=function(e){var t,n,i;this.eventDispatcher.dispatch({httpRequest:{downloadTime:null!==(t=(0,o.calculateTimeWithUndefined)(null==e?void 0:e.downloadTime))&&void 0!==t?t:0,httpStatus:null!==(n=null==e?void 0:e.httpStatus)&&void 0!==n?n:0,success:null!==(i=null==e?void 0:e.success)&&void 0!==i&&i,timestamp:(0,o.getCurrentTimestamp)(),url:null==e?void 0:e.url,size:null==e?void 0:e.size,timeToFirstByte:(0,o.calculateTimeWithUndefined)(null==e?void 0:e.timeToFirstByte),type:l(null==e?void 0:e.downloadType)}})},e}();function l(e){return(0,r.objectValues)(a.HttpRequestType).includes(e)?e:a.HttpRequestType.UNKNOWN}t.HttpRequestTrackingAdapter=s},8676:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentTrackerAdapter=void 0;var i=n(5063),a=function(){function e(e,t){var n=this;this.handleSegmentPlaybackEvent=function(e){n.segmentTracker.removeSegment(e.url)},this.segmentTracker=t,e.on(e.exports.PlayerEvent.DownloadFinished,(function(e){return n.handleOnDownloadFinishEvent(e)})),e.on(e.exports.PlayerEvent.SegmentPlayback,(function(e){return n.handleSegmentPlaybackEvent(e)}))}return e.prototype.getSegmentTracker=function(){return this.segmentTracker},e.prototype.handleOnDownloadFinishEvent=function(e){if(0===e.downloadType.indexOf("media/video")){var t=e.url,n={name:i.getURLResourceName(t),url:t,timestamp:e.timestamp};this.segmentTracker.addSegment(n)}},e}();t.SegmentTrackerAdapter=a},665:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeedMeterAdapter=void 0;var n=function(){function e(e,t){var n=this;this.meter=t,e.on(e.exports.PlayerEvent.DownloadFinished,(function(e){return n.handleOnDownloadFinishEvent(e)}))}return e.prototype.getDownloadSpeedMeter=function(){return this.meter},e.prototype.handleOnDownloadFinishEvent=function(e){e.success&&0===e.downloadType.indexOf("media/video")&&this.meter.addMeasurement({duration:e.downloadTime,size:e.size,timeToFirstByte:e.timeToFirstByte,timestamp:new Date,httpStatus:e.httpStatus})},e}();t.SpeedMeterAdapter=n},681:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlayerModule=void 0;var i=n(4679);t.PlayerModule={name:"analytics",module:{Analytics:i.Bitmovin8Adapter},hooks:{setup:function(e,t){var n=t.getConfig(),i=!n,a=!1===(null==n?void 0:n.analytics);if(i||a)return Promise.resolve();var r=new(0,e.Analytics)(t);return Promise.resolve(r)}}}},436:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPlayerConfig=a,t.getAutoPlay=function(e){var t,n=a(e);if((0,i.isNullish)(n))return!1;return(null===(t=n.playback)||void 0===t?void 0:t.autoplay)||!1};var i=n(5063);function a(e){try{if((0,i.isNullish)(e)||(0,i.isNullish)(e.getConfig()))return;return e.getConfig()}catch(e){return}}},2767:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BitmovinPwxAdapter=void 0;var i=n(4350),a=n(8331),r=n(9627),o=n(4926),s=n(28),l=function(){function e(e,t){var n=this;this.getCurrentImpressionId=function(){return n.analytics.getCurrentImpressionId()},this.getUserId=function(){return n.analytics.getUserId()},this.setCustomData=function(e){return n.internalAdapter.setCustomData(e)},this.setCustomDataOnce=function(e){return n.analytics.setCustomDataOnce(e)},this.sourceChange=function(e){throw new Error("Method not implemented.")};var o=(0,a.sanitizeAnalyticsConfig)(t);if(!(0,r.areCollectorRequirementsValid)(o))throw new Error("Failed to create BitmovinPwxAdapter: domain is required");(0,a.guardAgainstDuplicatedUserId)(o),this.internalAdapter=new s.BitmovinPwxInternalAdapter(e),this.analytics=i.Analytics.create(o,this.internalAdapter)}return e.prototype.dispose=function(){this.internalAdapter.release()},Object.defineProperty(e.prototype,"version",{get:function(){return o.VERSION},enumerable:!1,configurable:!0}),e.version=o.VERSION,e}();t.BitmovinPwxAdapter=l},2506:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BitmovinPwxAnalyticsPackage=void 0;var i,a,r,o=n(5063),s=n(2767),l=n(7299);t.BitmovinPwxAnalyticsPackage=(i="analytics-package",a=function(e,t){var n,i,a=t.registry.get(l.CoreExportNames.CoreEffects),r=a.EventListenerEffectFactory,u=a.StateEffectFactory,c=t.using(r,u),d=c.registry.get(l.BundleExportNames.Logger),E=c.registry.get(l.SourceExportNames.SourceState),p=c.registry.get(l.BundleExportNames.PlayerConfig),v=null!==(n=p.analytics)&&void 0!==n?n:{};v.playerKey=null!==(i=v.playerKey)&&void 0!==i?i:p.key,d.log("Applying analytics config ".concat((0,o.tryJSONStringify)(v)));var h=new s.BitmovinPwxAdapter(c,v);d.log('Analytics package initializing for "'.concat(E.url,'"...'));var f=function(){c.abortSignal.removeEventListener("abort",f),d.log('Analytics package disposing for "'.concat(E.url,'"')),h.dispose()};c.abortSignal.addEventListener("abort",f)},r=[l.BundleExportNames.Logger,l.BundleExportNames.PlayerConfig,l.CoreExportNames.Constants,l.CoreExportNames.CoreEffects,l.CoreExportNames.CoreStateAtoms,l.SourceExportNames.SourceState,l.SourcesApiExportNames.SourceEventBus,l.PlaybackApiEventsPackageExportNames.PlaybackEvent],a._name=i,{onAdd:a,dependencies:r})},5406:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.BitmovinPwxAnalyticsStateMachine=t.State=void 0;var r,o=n(2595),s=n(7596),l=n(8253),u=n(2361),c=n(1652),d=n(1916),E=n(1460),p=n(5063);!function(e){e.END="END",e.ERROR="ERROR",e.PAUSE="PAUSE",e.PLAYING="PLAYING",e.READY="READY",e.SETUP="SETUP",e.SOURCE_LOADED="SOURCE_LOADED",e.STARTUP="STARTUP",e.VIDEOSTART_FAILED="VIDEOSTART_FAILED"}(r||(t.State=r={}));var v=function(e){function t(t,n,i){var a=e.call(this,t,n,i)||this;return a.enabledDebugging=!1,a.debuggingStates=[],a}return a(t,e),t.prototype.createStateMachine=function(e){var t,n=this;return o.StateMachine.create({initial:{state:r.SETUP,event:u.JSM_INITIAL_EVENT},error:l.customStateMachineErrorCallback,events:[{name:u.Event.SOURCE_LOADED,from:[r.SETUP,r.ERROR],to:r.READY},(0,l.on)(u.Event.READY).stayIn(r.READY),(0,l.on)(u.Event.PAUSE).stayIn(r.READY),(0,l.on)(u.Event.TIMECHANGED).stayIn(r.READY),{name:u.Event.PLAY,from:r.READY,to:r.STARTUP},{name:u.Event.PLAYING,from:r.READY,to:r.PLAYING},(0,l.on)(u.Event.PLAY).stayIn(r.STARTUP),(0,l.on)(u.Event.PLAYING).stayIn(r.STARTUP),{name:u.Event.TIMECHANGED,from:r.STARTUP,to:r.PLAYING},(0,l.on)(u.Event.READY).stayIn(r.STARTUP),{name:u.Event.PAUSE,from:r.STARTUP,to:r.READY},(0,l.on)(u.Event.PLAYING).stayIn(r.PLAYING),(0,l.on)(u.Event.TIMECHANGED).stayIn(r.PLAYING),{name:u.Event.PAUSE,from:r.PLAYING,to:r.PAUSE},(0,l.on)(u.Event.TIMECHANGED).stayIn(r.PAUSE),(0,l.on)(u.Event.PAUSE).stayIn(r.PAUSE),{name:u.Event.PLAY,from:r.PAUSE,to:r.PLAYING},{name:u.Event.PLAYING,from:r.PAUSE,to:r.PLAYING},{name:u.Event.END,from:r.PLAYING,to:r.END},{name:u.Event.END,from:r.PAUSE,to:r.END},{name:u.Event.PLAYING,from:r.END,to:r.STARTUP},(0,l.on)(u.Event.TIMECHANGED).stayIn(r.END),(0,l.on)(u.Event.END).stayIn(r.END),{name:u.Event.PLAY,from:r.END,to:r.STARTUP},{name:u.Event.ERROR,from:r.STARTUP,to:r.VIDEOSTART_FAILED},{name:u.Event.ERROR,from:(0,l.getAllStatesBut)([r.STARTUP],r),to:r.ERROR},{name:u.Event.UNLOAD,from:(0,l.getAllStatesBut)([r.STARTUP],r),to:r.END},{name:u.Event.UNLOAD,from:[r.STARTUP],to:r.VIDEOSTART_FAILED}],callbacks:(t={},t["onleave".concat(r.PLAYING)]=function(){n.playingHeartbeatService.stopHeartbeat()},t.onleavestate=function(e,t,i,a,o){if((0,l.logStateMachineTransition)("LEAVE",e,t,i),e!==u.JSM_INITIAL_EVENT&&a){n.addStatesToLog(e,t,i,a,o);var s=a-n.onEnterStateTimestamp,c=t===r.STARTUP&&i===r.PLAYING;n.maybeSetOrClearVideoStartTimeouts(t,i),c&&n.stateMachineCallbacks.startup(s,r.STARTUP.toLowerCase());var E=String(t).toLowerCase();if(e===u.Event.UNLOAD)n.stateMachineCallbacks.unload(s,E);else if(t===r.SETUP)n.stateMachineCallbacks.setup(1,r.SETUP.toLowerCase());else if(e===u.Event.PAUSE&&t===r.STARTUP&&i===r.READY)n.clearVideoStartTimeout();else if(t!==r.ERROR&&!c){var v=n.stateMachineCallbacks[E];if((0,p.isFunction)(v))try{v(s,E,o)}catch(e){d.logger.error("Exception occurred in State Machine callback "+E,o,e)}else(0,l.logMissingCallbackWarning)(t,[r.READY])}}},t["onenter".concat(r.PLAYING)]=function(){n.playingHeartbeatService.startHeartbeat()},t.onenterstate=function(t,i,a,r,o){(0,l.logStateMachineTransition)("ENTER",t,i,a),n.onEnterStateTimestamp=null!=r?r:Date.now(),(0,E.isNumber)(e.starttime)&&t===u.JSM_INITIAL_EVENT&&(n.onEnterStateTimestamp=e.starttime)},t["onafter".concat(u.Event.ERROR)]=function(e,t,i,a,r){n.stateMachineCallbacks.error(r)},t)})},t.prototype.addStatesToLog=function(e,t,n,i,a){this.enabledDebugging&&this.debuggingStates.push(new c.EventDebugging(e,t,n,i,a))},t.prototype.getStates=function(){return this.debuggingStates},t.prototype.setEnabledDebugging=function(e){this.enabledDebugging=e},t.prototype.maybeSetOrClearVideoStartTimeouts=function(e,t){e===r.READY&&t===r.STARTUP?this.setVideoStartTimeout():e===r.STARTUP&&t===r.PLAYING&&this.clearVideoStartTimeout()},t}(s.AnalyticsStateMachine);t.BitmovinPwxAnalyticsStateMachine=v},28:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmovinPwxInternalAdapter=void 0;var o=n(2663),s=n(2361),l=n(556),u=n(7224),c=n(7614),d=n(9557),E=n(3413),p=n(2647),v=n(5406),h=n(7299),f=function(e){function t(t,n){var i=e.call(this,n)||this;i.onBeforeUnLoadEvent=!1,i.context=t;var a=new o.HeartbeatService((function(){return i.currentTime})),r=new v.BitmovinPwxAnalyticsStateMachine(i.stateMachineCallbacks,a,i.opts);return a.setListener(r),i.stateMachine=r,i}return a(t,e),t.prototype.getSource=function(){return this.context.registry.get(h.SourceExportNames.SourceState)},Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.getSource().playback.playhead.position},enumerable:!1,configurable:!0}),t.prototype.getAutoPlay=function(){return this.getSource().config.playback.autoplay},t.prototype.getCurrentPlaybackInfo=function(){var e,t,n,i,a,o,s,l=null===(e=this.getSource().sourceConfig.resources.filter((function(e){return e.url.includes(".m3u8")}))[0])||void 0===e?void 0:e.url,c=null===(t=this.getSource().sourceConfig.resources.filter((function(e){return e.url.includes(".mpd")}))[0])||void 0===t?void 0:t.url,d=null===(n=this.getSource().video.element)||void 0===n?void 0:n.getBoundingClientRect(),p=Math.round(null!==(i=null==d?void 0:d.width)&&void 0!==i?i:1),v=Math.round(null!==(a=null==d?void 0:d.height)&&void 0!==a?a:1),h=void 0;return l?h=u.StreamTypes.hls:c&&(h=u.StreamTypes.dash),r(r({},this.getCommonPlaybackInfo()),{droppedFrames:0,isMuted:null===(o=this.getSource().video.element)||void 0===o?void 0:o.muted,isLive:"live"===this.getSource().stream.type,videoWindowHeight:v,videoWindowWidth:p,videoDuration:(0,E.normalizeVideoDuration)(null===(s=this.getSource().video.element)||void 0===s?void 0:s.duration),videoPlaybackHeight:v,videoPlaybackWidth:p,m3u8Url:l,mpdUrl:c,streamFormat:h,videoCodec:void 0,audioCodec:void 0,videoBitrate:0,audioBitrate:0})},t.prototype.getPlayerName=function(){return l.Player.BITMOVIN_PWX},t.prototype.getPlayerTech=function(){return"webx:html5"},t.prototype.getPlayerVersion=function(){return this.context.registry.get(h.CoreExportNames.Constants).Version},t.prototype.initialize=function(e){return this.registerEventListeners(),this.registerUnloadEventListeners(),[new d.ErrorDetailTracking(e.errorDetailTrackingSettingsProvider,new c.ErrorDetailBackend(e.errorDetailTrackingSettingsProvider.collectorConfig),[e.errorDetailSubscribable],void 0)]},t.prototype.registerUnloadEventListeners=function(){var e=this,t=function(){if(!e.onBeforeUnLoadEvent){e.onBeforeUnLoadEvent=!0;var t=e.context.registry.get(h.SourceExportNames.SourceState).playback.playhead.position;e.eventCallback(s.Event.UNLOAD,{currentTime:t})}e.release()};t=t.bind(!0),this.context.abortSignal.addEventListener("abort",t),this.windowEventTracker.addEventListener("beforeunload",t),this.windowEventTracker.addEventListener("unload",t)},t.prototype.registerEventListeners=function(){var e=this,t=this.context.registry.get(h.SourcesApiExportNames.SourceEventBus),n=this.context.registry.get(h.SourceExportNames.SourceState).playback,i=this.context.registry.get(h.PlaybackApiEventsPackageExportNames.PlaybackEvent);t.on(i.Ready,(function(){e.eventCallback(s.Event.SOURCE_LOADED,{currentTime:n.playhead.position})})),t.on(i.Play,(function(){e.eventCallback(s.Event.PLAY,{currentTime:n.playhead.position})})),t.on(i.Playing,(function(){e.eventCallback(s.Event.PLAYING,{currentTime:n.playhead.position})})),t.on(i.Paused,(function(){e.eventCallback(s.Event.PAUSE,{currentTime:n.playhead.position})})),t.on(i.TimeChanged,(function(){e.eventCallback(s.Event.TIMECHANGED,{currentTime:n.playhead.position})})),t.on(i.VideoAttached,(function(){e.eventCallback(s.Event.SOURCE_LOADED,{currentTime:n.playhead.position})})),t.on(i.Ended,(function(){e.eventCallback(s.Event.END,{currentTime:n.playhead.position})}));var a=function(){var t=e.context.abortSignal.reason;"SourceRemovedError"===t.name||"FrameworkDisposedError"===t.name?e.eventCallback(s.Event.SOURCE_UNLOADED,{currentTime:n.playhead.position}):e.eventCallback(s.Event.ERROR,{currentTime:n.playhead.position,code:1007,message:t.message,data:t,originalError:t}),e.context.abortSignal.removeEventListener("abort",a)};this.context.abortSignal.addEventListener("abort",a)},t}(p.InternalAdapter);t.BitmovinPwxInternalAdapter=f},7299:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourcesApiExportNames=t.SourceExportNames=t.PlaybackApiEventsPackageExportNames=t.CoreExportNames=t.BundleExportNames=void 0;t.BundleExportNames={Logger:"logger",PlayerConfig:"player-config"};t.CoreExportNames={Utils:"utils",Constants:"constants",CoreEffects:"core-effects",CoreStateAtoms:"core-state-atoms"};t.PlaybackApiEventsPackageExportNames={PlaybackEvent:"playback-event"};t.SourceExportNames={CreateSourceStateAtom:"create-source-state-atom",CreateSourceReference:"create-source-reference",SourceReferences:"source-references",SourceState:"source-state-atom"};t.SourcesApiExportNames={SourceApiManager:"source-api-manager",VideoElementUtils:"video-element-utils",SourceEventBus:"source-event-bus"}},5127:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CAFv3Adapter=void 0;var i=n(4350),a=n(8331),r=n(9627),o=n(1916),s=n(2108),l=n(4926),u=n(3236),c=function(){function e(e,t,n){if((0,s.hasPlayerAlreadyBeenAugmented)(t))o.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this CastReceiverContext instance");else{(0,s.markPlayerInstanceAsAugmented)(t);var l=(0,a.sanitizeAnalyticsConfig)(e);(0,r.areCollectorRequirementsValid)(l)&&((0,a.guardAgainstDuplicatedUserId)(l),this.internalAdapter=new u.CAFv3InternalAdapter(t,n),this.analytics=i.Analytics.create(l,this.internalAdapter))}}return Object.defineProperty(e.prototype,"version",{get:function(){return l.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,s.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.sourceChange(e)},e.version=l.VERSION,e}();t.CAFv3Adapter=c},3236:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.CAFv3InternalAdapter=void 0,t.detectCAFv3PlaybackInfoStreamTypeFields=S;var o=n(3453),s=n(2663),l=n(2361),u=n(556),c=n(7224),d=n(7614),E=n(9557),p=n(3413),v=n(1820),h=n(5063),f=n(2647),m=n(1489),A=function(e){function t(t,n){var i=e.call(this,n)||this;i.onBeforeUnLoadEvent=!1,i.activeTextTracks=[],i.getPlayerVersion=function(){var e,t;return null!==(t=null===(e=null===cast||void 0===cast?void 0:cast.framework)||void 0===e?void 0:e.VERSION)&&void 0!==t?t:"unknown"},i.getPlayerName=function(){return u.Player.CHROMECAST_SHAKA},i.getPlayerTech=function(){return"html5"},i.getAutoPlay=function(){var e,t,n;return null!==(n=null===(t=null===(e=i.playerManager.getQueueManager())||void 0===e?void 0:e.getCurrentItem())||void 0===t?void 0:t.autoplay)&&void 0!==n&&n},i.getDrmPerformanceInfo=function(){return i.drmPerformanceInfo};var a=new s.HeartbeatService((function(){return t.getPlayerManager().getCurrentTimeSec()})),r=new o.CAFv3AnalyticsStateMachine(i.stateMachineCallbacks,a,i.opts);return a.setListener(r),i.playerManager=t.getPlayerManager(),i.stateMachine=r,i}return a(t,e),t.prototype.initialize=function(e){return this.registerCastFrameworkEventListeners(),this.registerWindowUnloadEventListeners(),[new E.ErrorDetailTracking(e.errorDetailTrackingSettingsProvider,new d.ErrorDetailBackend(e.errorDetailTrackingSettingsProvider.collectorConfig),[e.errorDetailSubscribable],void 0)]},t.prototype.getCurrentPlaybackInfo=function(){var e,t,n,i=this.playerManager.getStats(),a=null===(e=this.activeTextTracks)||void 0===e?void 0:e.map((function(e){return e.language})).filter(h.isNotNullish);return r(r(r(r({},this.getCommonPlaybackInfo()),S(this.playerManager)),function(e){var t;try{var n=e.getAudioTracksManager().getActiveTrack();return{audioLanguage:null==n?void 0:n.language,audioCodec:null===(t=null==n?void 0:n.audioTrackInfo)||void 0===t?void 0:t.audioCodec,audioBitrate:void 0}}catch(e){return{}}}(this.playerManager)),{isLive:y(this.playerManager),playerTech:this.getPlayerTech(),videoDuration:(0,p.normalizeVideoDuration)(null!==(n=null===(t=this.playerManager.getMediaInformation())||void 0===t?void 0:t.duration)&&void 0!==n?n:0),videoPlaybackHeight:i.height,videoPlaybackWidth:i.width,subtitleLanguage:a?a.join(","):void 0,droppedFrames:0})},Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.playerManager.getCurrentTimeSec()},enumerable:!1,configurable:!0}),t.prototype.registerCastFrameworkEventListeners=function(){var e=this;this.playerManager.addEventListener(m.CastFrameworkEvent.LOADED_METADATA,(function(t){e.eventCallback(l.Event.SOURCE_LOADED,{})})),this.playerManager.addEventListener(m.CastFrameworkEvent.PLAYER_LOAD_COMPLETE,(function(){var t=e.playerManager.getTextTracksManager();e.activeTextTracks=t.getActiveTracks(),e.eventCallback(l.Event.READY,{})})),this.playerManager.addEventListener(m.CastFrameworkEvent.PLAY,(function(t){e.eventCallback(l.Event.PLAY,{currentTime:t.currentMediaTime})})),this.playerManager.addEventListener(m.CastFrameworkEvent.PLAYING,(function(t){e.eventCallback(l.Event.PLAYING,{currentTime:e.currentTime})})),this.playerManager.addEventListener(m.CastFrameworkEvent.TIME_UPDATE,(function(t){e.eventCallback(l.Event.TIMECHANGED,{currentTime:t.currentMediaTime})})),this.playerManager.addEventListener(m.CastFrameworkEvent.PAUSE,(function(t){e.eventCallback(l.Event.PAUSE,{currentTime:e.currentTime})})),this.playerManager.addEventListener(m.CastFrameworkEvent.ERROR,(function(t){var n=(0,h.isNotNullish)(t.error)?t.error:void 0;e.eventCallback(l.Event.ERROR,{currentTime:e.playerManager.getCurrentTimeSec(),code:t.detailedErrorCode,message:t.reason,legacyData:n,originalError:t,data:{additionalData:(0,h.tryJSONStringify)(n)}})})),this.playerManager.addEventListener(m.CastFrameworkEvent.SEEKING,(function(t){e.eventCallback(l.Event.SEEK,{currentTime:t.currentMediaTime})})),this.playerManager.addEventListener(m.CastFrameworkEvent.SEEKED,(function(t){e.eventCallback(l.Event.SEEKED,{currentTime:t.currentMediaTime})})),this.playerManager.addEventListener(m.CastFrameworkEvent.BUFFERING,(function(t){t.isBuffering&&e.eventCallback(l.Event.START_BUFFERING,{currentTime:e.currentTime})})),this.playerManager.addEventListener(m.CastFrameworkEvent.REQUEST_LOAD,(function(t){e.sourceChange({})}))},t.prototype.registerWindowUnloadEventListeners=function(){var e=this,t=function(){e.onBeforeUnLoadEvent||(e.onBeforeUnLoadEvent=!0,e.eventCallback(l.Event.UNLOAD,{currentTime:e.currentTime})),e.release()};this.windowEventTracker.addEventListener("beforeunload",t),this.windowEventTracker.addEventListener("unload",t)},t}(f.InternalAdapter);function y(e){var t;return"LIVE"===(null===(t=e.getMediaInformation())||void 0===t?void 0:t.streamType)||(!!e.getLiveSeekableRange()||void 0)}function S(e){var t,n,i=null===(t=e.getMediaInformation())||void 0===t?void 0:t.contentUrl;((0,h.isNullish)(i)||(0,v.isBlank)(i))&&(i=null===(n=e.getMediaInformation())||void 0===n?void 0:n.contentId);var a=(0,c.getStreamTypesFromURL)(i);return(0,p.buildPlaybackInfoStreamTypeFields)(a,i)}t.CAFv3InternalAdapter=A},1489:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CastFrameworkEvent=void 0,t.CastFrameworkEvent={ALL:"*",BUFFERING:"BUFFERING",ERROR:"ERROR",LOADED_METADATA:"LOADED_METADATA",PAUSE:"PAUSE",PLAY:"PLAY",PLAYING:"PLAYING",PLAYER_LOAD_COMPLETE:"PLAYER_LOAD_COMPLETE",REQUEST_LOAD:"REQUEST_LOAD",SEEKED:"SEEKED",SEEKING:"SEEKING",STALLED:"STALLED",TIME_UPDATE:"TIME_UPDATE"}},9999:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DashjsAdapter=void 0;var i=n(4350),a=n(8331),r=n(9627),o=n(1916),s=n(2108),l=n(4926),u=n(236),c=function(){function e(e,t,n){if((0,s.hasPlayerAlreadyBeenAugmented)(t))o.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance");else{(0,s.markPlayerInstanceAsAugmented)(t);var l=(0,a.sanitizeAnalyticsConfig)(e);(0,r.areCollectorRequirementsValid)(l)&&((0,a.guardAgainstDuplicatedUserId)(l),this.internalAdapter=new u.DashjsInternalAdapter(t,n),this.analytics=i.Analytics.create(l,this.internalAdapter))}}return Object.defineProperty(e.prototype,"version",{get:function(){return l.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,s.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.sourceChange(e)},e.version=l.VERSION,e}();t.DashjsAdapter=c},236:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.DashjsInternalAdapter=void 0;var o=n(2361),s=n(2168),l=n(556),u=n(7614),c=n(9557),d=n(1916),E=n(5063),p=n(7124),v=n(9991),h=function(e){function t(t,n){var i=e.call(this,void 0,n)||this;return i.getPlayerName=function(){return l.Player.DASHJS},i.getPlayerVersion=function(){return i.mediaPlayer.getVersion()},i.mediaPlayer=t,i}return a(t,e),t.prototype.initialize=function(t){var n=this;e.prototype.initialize.call(this,t);var i=null;try{i=this.mediaPlayer.getVideoElement()}catch(e){}return i?(this.setMediaElement(i),this.registerMediaElementEventsForDashJS()):this.mediaPlayer.on("manifestLoaded",(function(){try{i=n.mediaPlayer.getVideoElement(),n.setMediaElement(i),n.registerMediaElementEventsForDashJS()}catch(e){d.logger.errorMessageToUser("Something went wrong while getting underlying HTMLVideoElement. Not possible to attach adapter and initialize Bitmovin Analytics. Error: ",e),n.release()}}),this),[new c.ErrorDetailTracking(t.errorDetailTrackingSettingsProvider,new u.ErrorDetailBackend(t.errorDetailTrackingSettingsProvider.collectorConfig),[t.errorDetailSubscribable],void 0)]},t.prototype.registerMediaElementEventsForDashJS=function(){var e=this,t=this.mediaElement;t&&this.listenToMediaElementEvent("playing",(function(){var n=t.currentTime;e.needsFirstPlayIntent=!1,e.eventCallback(o.Event.TIMECHANGED,{currentTime:n})}))},t.prototype.getCurrentPlaybackInfo=function(){var t=e.prototype.getCurrentPlaybackInfo.call(this),n=r({},t),i=(0,v.getCodecInfo)(this.mediaPlayer);return this.sourceInfoFallbackService.applyAndStoreCodecInfo(n,i),n},t.prototype.getMIMEType=function(){return s.MIMETypes.DASH},t.prototype.getStreamURL=function(){if(this.mediaPlayer){var e=void 0;try{e=this.mediaPlayer.getSource()}catch(e){d.logger.warn("no source available",e)}return(0,E.isNotNullish)(e)?null==e?void 0:e.toString():void 0}},t.prototype.getCurrentQualityLevelInfo=function(){if(!this.mediaPlayer)return null;try{return(0,v.getQualityLevelInfo)(this.mediaPlayer)}catch(e){d.logger.warn("Quality information not available")}return null},t}(p.HTML5InternalAdapter);t.DashjsInternalAdapter=h},9991:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCodecInfo=t.getQualityLevelInfo=void 0;var i=n(5766),a=n(1460),r=n(1820),o=n(5063);t.getQualityLevelInfo=function(e){if(function(e){return(0,o.isFunction)(e.getBitrateInfoListFor)&&(0,o.isFunction)(e.getQualityFor)}(e)){var t=e.getBitrateInfoListFor("video")[e.getQualityFor("video")];return(0,o.isNullish)(t)?null:{width:t.width,height:t.height,bitrate:t.bitrate}}var n=e.getCurrentRepresentationForType("video");return(0,o.isNullish)(n)?null:{width:n.width,height:n.height,bitrate:(0,a.isNumber)(n.bitrateInKbit)?i.Converter.kiloBitsToBits(n.bitrateInKbit):0}};t.getCodecInfo=function(e){var t,n,i,a,o=new RegExp(/codecs="(.*)"/);try{var s=null===(t=e.getCurrentTrackFor("video"))||void 0===t?void 0:t.codec;if((0,r.isValidString)(s)&&!(0,r.isBlank)(s))i=null==(l=o.exec(s))?void 0:l[1]}catch(e){i=void 0}try{var l,u=null===(n=e.getCurrentTrackFor("audio"))||void 0===n?void 0:n.codec;if((0,r.isValidString)(u)&&!(0,r.isBlank)(u))a=null==(l=o.exec(u))?void 0:l[1]}catch(e){a=void 0}return{videoCodec:i,audioCodec:a}}},9566:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HlsAdapter=void 0;var i=n(4350),a=n(8331),r=n(9627),o=n(1916),s=n(2108),l=n(4926),u=n(1601),c=function(){function e(e,t,n){if((0,s.hasPlayerAlreadyBeenAugmented)(t))o.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance");else{(0,s.markPlayerInstanceAsAugmented)(t);var l=(0,a.sanitizeAnalyticsConfig)(e);(0,r.areCollectorRequirementsValid)(l)&&((0,a.guardAgainstDuplicatedUserId)(l),this.internalAdapter=new u.HlsInternalAdapter(t,n),this.analytics=i.Analytics.create(l,this.internalAdapter))}}return Object.defineProperty(e.prototype,"version",{get:function(){return l.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,s.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.sourceChange(e)},e.version=l.VERSION,e}();t.HlsAdapter=c},1601:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getHlsCurrentLevel=t.getHlsCodecInfo=t.HlsInternalAdapter=void 0;var o=n(9664),s=n(2361),l=n(2168),u=n(556),c=n(7614),d=n(9557),E=n(1460),p=n(5063),v=n(7124),h=n(7922),f=n(4778),m=function(e){function n(n,i){var a=e.call(this,void 0,i)||this;return a.getPlayerName=function(){return u.Player.HLSJS},a.getPlayerVersion=function(){return a.hls.constructor.version},a.isLive=function(){var e=(0,t.getHlsCurrentLevel)(a.hls);if(!(0,p.isNullish)(null==e?void 0:e.details))return e.details.live},a.onDestroying=function(){a.eventCallback(s.Event.SOURCE_UNLOADED,{}),a.release()},a.hls=n,a.speedMeter=new f.HlsSpeedMeterAdapter(n,new o.DownloadSpeedMeter).getDownloadSpeedMeter(),a}return a(n,e),n.prototype.initialize=function(t){return e.prototype.initialize.call(this,t),this.registerHlsEvents(),[new d.ErrorDetailTracking(t.errorDetailTrackingSettingsProvider,new c.ErrorDetailBackend(t.errorDetailTrackingSettingsProvider.collectorConfig),[t.errorDetailSubscribable],void 0)]},n.prototype.getCurrentPlaybackInfo=function(){var n=this.getSelectedSubtitleLanguage(),i=r(r({},e.prototype.getCurrentPlaybackInfo.call(this)),{audioLanguage:this.getSelectedAudioLanguage(),subtitleEnabled:(0,p.isNotNullish)(n)?n.enabled:void 0,subtitleLanguage:(0,p.isNotNullish)(n)?n.language:void 0}),a=(0,t.getHlsCodecInfo)(this.hls);return this.sourceInfoFallbackService.applyAndStoreCodecInfo(i,a),i},n.prototype.getDownloadSpeedInfo=function(){return this.speedMeter.getInfo()},n.prototype.resetDownloadSpeedInfoMeasures=function(){this.speedMeter.reset()},n.prototype.getCurrentQualityLevelInfo=function(){var e=(0,t.getHlsCurrentLevel)(this.hls);return e?{bitrate:e.bitrate,width:e.width,height:e.height}:null},n.prototype.getMIMEType=function(){return l.MIMETypes.HLS},n.prototype.getStreamURL=function(){return this.hls.url},n.prototype.registerHlsEvents=function(){this.hls.on(h.HLS_PLAYER_EVENT.MEDIA_ATTACHING,this.onMediaAttaching.bind(this)),this.hls.on(h.HLS_PLAYER_EVENT.MEDIA_DETACHING,this.onMediaDetaching.bind(this)),this.hls.on(h.HLS_PLAYER_EVENT.MANIFEST_LOADING,this.onManifestLoading.bind(this)),this.hls.on(h.HLS_PLAYER_EVENT.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched.bind(this)),this.hls.on(h.HLS_PLAYER_EVENT.SUBTITLE_TRACK_SWITCH,this.onSubtitleLanguageSwitched.bind(this)),this.hls.on(h.HLS_PLAYER_EVENT.DESTROYING,this.onDestroying.bind(this)),this.hls.on(h.HLS_PLAYER_EVENT.ERROR,this.onHlsError.bind(this)),this.hls.media&&(this.onMediaAttaching(),this.onManifestLoading())},n.prototype.onMediaAttaching=function(){this.mediaElement||(this.mediaElement=this.hls.media,this.registerMediaElement(),this.onMaybeReady())},n.prototype.onMediaDetaching=function(){this.unregisterMediaElement()},n.prototype.onManifestLoading=function(){this.onMaybeReady()},n.prototype.onHlsError=function(e,t){if(!t||t.fatal){var n=this.mediaElement,i=void 0;(0,p.isNotNullish)(n)&&(i=n.currentTime);var a=(0,p.isNotNullish)(t)?"".concat(t.type,": ").concat(t.details):void 0;this.eventCallback(s.Event.ERROR,{currentTime:i,code:this.getErrorCodeFromHlsErrorType(t.type),message:a,originalError:t,data:{}})}},n.prototype.onAudioTrackSwitched=function(e,t){var n,i=this.mediaElement;(0,p.isNotNullish)(i)&&(n=i.currentTime),this.eventCallback(s.Event.AUDIOTRACK_CHANGED,{currentTime:n})},n.prototype.onSubtitleLanguageSwitched=function(e,t){var n,i=this.mediaElement;(0,p.isNotNullish)(i)&&(n=i.currentTime),this.eventCallback(s.Event.SUBTITLE_CHANGE,{currentTime:n})},n.prototype.getErrorCodeFromHlsErrorType=function(e){switch(e){case"networkError":return 2;case"mediaError":return 3;case"keySystemError":return 4;case"muxError":return 5;default:return 1}},n.prototype.getSelectedAudioLanguage=function(){if(!((0,p.isNullish)(this.hls.audioTrack)||this.hls.audioTrack<0))return this.hls.audioTracks[this.hls.audioTrack].lang},n.prototype.getSelectedSubtitleLanguage=function(){if((0,p.isNotNullish)(this.hls.subtitleDisplay)){var e=this.hls.subtitleTrack>=0&&!0===this.hls.subtitleDisplay;return{enabled:e,language:e?this.hls.subtitleTracks[this.hls.subtitleTrack].lang:void 0}}var t=this.hls.subtitleTrackController;if((0,p.isNotNullish)(t)&&(0,p.isNotNullish)(t.media))return this.getSelectedSubtitleFromMediaElement(t.media)},n}(v.HTML5InternalAdapter);t.HlsInternalAdapter=m;t.getHlsCodecInfo=function(e){var n=(0,t.getHlsCurrentLevel)(e);if(n)return{videoCodec:n.videoCodec,audioCodec:n.audioCodec}};t.getHlsCurrentLevel=function(e){if(!(0,p.isNullish)(e.levels)&&0!==e.levels.length&&(0,E.isNumber)(e.currentLevel)&&!(e.currentLevel<0))return e.levels[e.currentLevel]}},7922:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.HLS_PLAYER_EVENT=t.PlaylistLevelType=void 0,function(e){e.AUDIO="audio",e.MAIN="main",e.SUBTITLE="subtitle"}(n||(t.PlaylistLevelType=n={})),t.HLS_PLAYER_EVENT={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_DETACHING:"hlsMediaDetaching",MANIFEST_LOADING:"hlsManifestLoading",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",DESTROYING:"hlsDestroying",ERROR:"hlsError"}},4778:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HlsSpeedMeterAdapter=void 0;var i=n(5063),a=function(){function e(e,t){var n=this;this.meter=t,e.on(e.constructor.Events.FRAG_LOADED,(function(e,t){return n.handleFragmentLoadedEvent(t)}))}return e.prototype.getDownloadSpeedMeter=function(){return this.meter},e.prototype.handleFragmentLoadedEvent=function(e){if("main"===e.frag.type){var t=(0,i.isNotNullish)(e.networkDetails)?e.networkDetails.status:void 0;if(!(0,i.isNullish)(t)){var n=e.frag.stats,a=(n.loading.end-n.loading.start)/1e3,r=(n.loading.first-n.loading.start)/1e3,o={duration:a,size:n.total,timeToFirstByte:r,timestamp:new Date,httpStatus:t};this.meter.addMeasurement(o)}}},e}();t.HlsSpeedMeterAdapter=a},7124:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.HTML5InternalAdapter=void 0;var o=n(3674),s=n(2663),l=n(6743),u=n(2361),c=n(2168),d=n(556),E=n(8525),p=n(7224),v=n(3413),h=n(3848),f=n(1916),m=n(5063),A=n(2647),y=n(8510),S=function(e){function t(t,n){var i=e.call(this,n)||this;i.needsFirstPlayIntent=!0,i.onBeforeUnLoadEvent=!1,i.isBuffering=!1,i.isPaused=!1,i.isSeeking=!1,i.previousMediaTimeInSeconds=0,i.previousMutedValue=!1,i.getPlayerName=function(){return d.Player.HTML5},i.getPlayerTech=function(){return"html5"},i.getAutoPlay=function(){return!!i.mediaElement&&i.mediaElement.autoplay},i.getDrmPerformanceInfo=function(){return i.drmPerformanceInfo},i.isLive=function(){if(i.mediaElement&&!isNaN(i.mediaElement.duration))return i.mediaElement.duration===1/0};var a=new s.HeartbeatService((function(){var e;return null!==(e=null==t?void 0:t.currentTime)&&void 0!==e?e:0})),r=new o.HTML5AnalyticsStateMachine(i.stateMachineCallbacks,a,i.opts);return a.setListener(r),i.stateMachine=r,i.mediaElement=t,i.mediaElementEventHandlers=[],i.mediaElementOriginalLoadFn=void 0,i.bufferingTimeout=void 0,i.isBuffering=!1,i.isPaused=!1,i.isSeeking=!1,i.previousMediaTimeInSeconds=0,i.previousClientTime=0,i.needsReadyEvent=!0,i.needsFirstPlayIntent=!0,i._videoCompletionTracker=new l.default,i.playerStatisticsProvider=new y.default(t),i}return a(t,e),Object.defineProperty(t.prototype,"videoCompletionTracker",{get:function(){return this._videoCompletionTracker},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){return this.mediaElement&&this.setMediaElement(),this.registerWindowEvents(),[]},t.prototype.getCurrentPlaybackInfo=function(){var e=this.getStreamType();(0,m.isNotNullish)(e)&&this.sourceInfoFallbackService.setStreamFormat(e);var t=r(r(r({},this.getCommonPlaybackInfo()),(0,v.buildPlaybackInfoStreamTypeFields)(e,this.getStreamURL())),{isLive:this.isLive(),size:(0,h.isVideoInFullscreen)()?E.PlayerSize.Fullscreen:E.PlayerSize.Window,playerTech:this.getPlayerTech(),droppedFrames:this.playerStatisticsProvider.getDroppedFrames()});this.mediaElement&&(t=r(r({},t),{videoDuration:(0,v.normalizeVideoDuration)(this.mediaElement.duration),isMuted:this.mediaElement.muted,videoWindowHeight:this.mediaElement.height,videoWindowWidth:this.mediaElement.width}));var n=this.getCurrentQualityLevelInfo();return n&&(t=r(r({},t),{videoPlaybackHeight:n.height,videoPlaybackWidth:n.width,videoBitrate:n.bitrate})),this.sourceInfoFallbackService.applyStreamFormat(t),t},t.prototype.resetSourceRelatedState=function(){e.prototype.resetSourceRelatedState.call(this),this.playerStatisticsProvider.reset(),this.needsFirstPlayIntent=!0,this.isBuffering=!1,this.isPaused=!1,this.isSeeking=!1,this.previousMediaTimeInSeconds=0,clearTimeout(this.bufferingTimeout)},Object.defineProperty(t.prototype,"currentTime",{get:function(){if(!this.mediaElement)throw new Error("No media attached");return this.mediaElement.currentTime},enumerable:!1,configurable:!0}),t.prototype.release=function(){this.unregisterMediaElement(),e.prototype.release.call(this)},t.prototype.setMediaElement=function(e){if(void 0===e&&(e=null),e&&(this.mediaElement&&this.unregisterMediaElement(),this.mediaElement=e),!this.mediaElement)throw new Error("No media element owned");if(this.mediaElementEventHandlers.length>0)throw new Error("Media element already set (only call this once)");this.registerMediaElement(),this.onMaybeReady()},t.prototype.getMIMEType=function(){var e=this.getStreamURL();if(e&&void 0!==e)return(0,c.getMIMETypeFromFileExtension)(e)},t.prototype.getStreamType=function(){var e=this.getMIMEType();if(e)return(0,p.getStreamTypeFromMIMEType)(e)},t.prototype.getStreamURL=function(){var e=this.mediaElement;if(e)return e.src},t.prototype.registerMediaElement=function(){var e=this,t=this.mediaElement;if(t){this.mediaElementOriginalLoadFn=t.load;var n=this.mediaElementOriginalLoadFn;t.load=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];e.sourceChange({}),n.apply(t,i)},this.listenToMediaElementEvent("loadstart",(function(){T("loadstart ".concat(t.currentTime)),e.sourceChange({})})),this.listenToMediaElementEvent("loadedmetadata",(function(){T("loadedmetadata time:".concat(t.currentTime," / readyState: ").concat(t.readyState)),e.checkQualityLevelAttributes(!0);var n=e.getStreamType();(0,m.isNotNullish)(n)&&e.sourceInfoFallbackService.setStreamFormat(n),(0,m.isNotNullish)(e.mediaElement)&&(e._videoCompletionTracker.reset(),e._videoCompletionTracker.setVideoDuration(e.mediaElement.duration),e.previousMutedValue=e.mediaElement.muted),e.eventCallback(u.Event.SOURCE_LOADED,{})})),this.listenToMediaElementEvent("play",(function(){T("play ".concat(t.currentTime));var n=t.currentTime;e.needsFirstPlayIntent&&(e.previousMediaTimeInSeconds=n),e.needsFirstPlayIntent=!1,e.eventCallback(u.Event.PLAY,{currentTime:n})})),this.listenToMediaElementEvent("pause",(function(){T("pause ".concat(t.currentTime)),e.onPaused()})),this.listenToMediaElementEvent("playing",(function(){T("playing ".concat(t.currentTime)),clearTimeout(e.bufferingTimeout),e.isPaused=!1,e.needsFirstPlayIntent=!1})),this.registerMediaElementErrorEvent(t),this.listenToMediaElementEvent("volumechange",(function(){T("volumechange ".concat(t.currentTime));var n=t.muted,i=t.currentTime,a=t.volume,r=(0,m.isAudioMuted)(n,a);e.previousMutedValue!==r&&(r?e.eventCallback(u.Event.MUTE,{currentTime:i}):e.eventCallback(u.Event.UN_MUTE,{currentTime:i}),e.previousMutedValue=r)})),this.listenToMediaElementEvent("seeking",(function(){T("seeking ".concat(t.currentTime));var n=t.currentTime;e.eventCallback(u.Event.SEEK,{currentTime:n})})),this.listenToMediaElementEvent("seeked",(function(){T("seeked ".concat(t.currentTime));var n=t.currentTime;clearTimeout(e.bufferingTimeout),e.eventCallback(u.Event.SEEKED,{currentTime:n})})),this.listenToMediaElementEvent("timeupdate",(function(){var n=t.currentTime;if(e.isBuffering=!1,e.isSeeking=!1,!e.needsFirstPlayIntent){if(!e.isPaused)1e3*Math.abs(n-e.previousMediaTimeInSeconds)>0&&e.eventCallback(u.Event.TIMECHANGED,{currentTime:n});e.checkQualityLevelAttributes(),e.checkSeeking(),e.checkPlayheadProgress(),e.previousMediaTimeInSeconds=n}})),this.listenToMediaElementEvent("stalled",(function(){})),this.listenToMediaElementEvent("waiting",(function(){T("waiting ".concat(t.currentTime)),e.checkSeeking(),e.onBuffering()}))}},t.prototype.registerMediaElementErrorEvent=function(e){var t=this;this.listenToMediaElementEvent("error",(function(){var n,i;T("error ".concat(e.currentTime));var a=e.currentTime,r=e.error;t.eventCallback(u.Event.ERROR,{currentTime:a,code:null!==(n=null==r?void 0:r.code)&&void 0!==n?n:void 0,message:null!==(i=null==r?void 0:r.message)&&void 0!==i?i:void 0,originalError:r,data:{}})}))},t.prototype.listenToMediaElementEvent=function(e,t){if(!this.mediaElement)throw new Error("No media attached");var n=t.bind(this);this.mediaElementEventHandlers.push({event:e,handler:n}),this.mediaElement.addEventListener(e,n,!1)},t.prototype.onMaybeReady=function(){this.needsReadyEvent&&this.mediaElement&&(this.needsReadyEvent=!1,this.getCurrentPlaybackInfo(),this._videoCompletionTracker.reset(),this._videoCompletionTracker.setVideoDuration(this.mediaElement.duration))},t.prototype.unregisterMediaElement=function(){if(!this.mediaElement)throw new Error("No media element attached");var e=this.mediaElement;this.mediaElementEventHandlers.forEach((function(t){e.removeEventListener(t.event,t.handler)}));var t=this.mediaElementOriginalLoadFn;(0,m.isNotNullish)(t)&&(e.load=t),this.mediaElement=void 0,this.mediaElementEventHandlers=[],this.mediaElementOriginalLoadFn=void 0,clearTimeout(this.bufferingTimeout)},t.prototype.registerWindowEvents=function(){this.windowEventTracker.addEventListener("beforeunload",this.onPageClose.bind(this)),this.windowEventTracker.addEventListener("unload",this.onPageClose.bind(this))},t.prototype.onPageClose=function(){if(!this.onBeforeUnLoadEvent){this.onBeforeUnLoadEvent=!0;var e=this.mediaElement,t=void 0;(0,m.isNotNullish)(e)&&(t=e.currentTime),this.eventCallback(u.Event.UNLOAD,{currentTime:t})}this.release()},t.prototype.checkQualityLevelAttributes=function(e){if(void 0===e&&(e=!1),!this.mediaElement)throw new Error("No media attached");var t=this.mediaElement,n=this.getCurrentQualityLevelInfo();if(n){var i=n.bitrate,a=n.width,r=n.height;if((0,m.isNotNullish)(i)){var o={type:"video",width:a,height:r,bitrate:i,currentTime:t.currentTime};this.qualityChangeService.shouldAllowVideoQualityChange(i)&&(e||this.eventCallback(u.Event.VIDEO_CHANGE,o)),this.qualityChangeService.setVideoBitrate(i),this.stateMachineCallbacks.updateSampleQualityInfo(o)}}},t.prototype.getSelectedSubtitleFromMediaElement=function(e){if(!(0,m.isNullish)(e.textTracks)){for(var t=0,n=e.textTracks;t<n.length;t++){var i=n[t];if((0,m.isNotNullish)(i.mode)&&"showing"===i.mode){var a=(0,m.isNotNullish)(i.language)&&i.language.length>0;return{enabled:a,language:a?i.language:void 0}}}return{enabled:!1}}},t.prototype.onPaused=function(e){if(!this.isPaused){if(!this.mediaElement)throw new Error("No media attached");e||(e=this.mediaElement.currentTime),this.eventCallback(u.Event.PAUSE,{currentTime:e}),this.isPaused=!0}},t.prototype.onBuffering=function(){if(!this.mediaElement)throw new Error("No media attached");var e=this.mediaElement.currentTime;this.isBuffering||this.isPaused&&!this.isSeeking||(this.isSeeking?this.eventCallback(u.Event.SEEK,{currentTime:e}):this.eventCallback(u.Event.START_BUFFERING,{currentTime:e}),this.isBuffering=!0)},t.prototype.checkPlayheadProgress=function(){var e=this;if(!this.mediaElement)throw new Error("No media attached");var n=this.mediaElement;n.paused&&this.onPaused(),clearTimeout(this.bufferingTimeout),this.bufferingTimeout=setTimeout((function(){n.paused||n.ended&&!e.isBuffering||n.currentTime-e.previousMediaTimeInSeconds<t.BUFFERING_TIMECHANGED_TIMEOUT_IN_MS/1e3*.8&&e.onBuffering()}),t.BUFFERING_TIMECHANGED_TIMEOUT_IN_MS)},t.prototype.checkSeeking=function(){if(!this.mediaElement)throw new Error("No media attached");var e=this.mediaElement.currentTime,t=Math.abs(e-this.previousMediaTimeInSeconds);if(t<1)this.previousClientTime=Date.now();else{var n=(Date.now()-this.previousClientTime)/1e3;t>n*(this.mediaElement.playbackRate+.5)&&(this.isSeeking=!0,this.onPaused(this.previousMediaTimeInSeconds+n)),this.previousClientTime=Date.now()}},t.BUFFERING_TIMECHANGED_TIMEOUT_IN_MS=1e3,t}(A.InternalAdapter);t.HTML5InternalAdapter=S;var T=function(e){var t=(new Date).toISOString().substring(11),n="".concat(t,"[HTML5InternalAdapter]"),i="".concat(n,": ").concat(e);f.logger.log(i)}},701:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLVideoElementAdapter=void 0;var i=n(5241),a=n(4350),r=n(8331),o=n(9627),s=n(1916),l=n(2108),u=n(4926),c=n(7238),d=function(){function e(e,t,n,i){if((0,l.hasPlayerAlreadyBeenAugmented)(t))s.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance");else{(0,l.markPlayerInstanceAsAugmented)(t);var u=(0,r.sanitizeAnalyticsConfig)(e);(0,o.areCollectorRequirementsValid)(u)&&((0,r.guardAgainstDuplicatedUserId)(u),this.internalAdapter=new c.HTMLVideoElementInternalAdapter(t,n,i),this.analytics=a.Analytics.create(u,this.internalAdapter))}}return Object.defineProperty(e.prototype,"sessionMetadata",{get:function(){var e=this.internalAdapter;return{setAudioLanguage:function(t){e.sessionData.audioLanguage=(0,i.sanitizeSessionMetadataAudioLanguage)(t)},setSubtitleEnabled:function(t){e.sessionData.subtitleEnabled=(0,i.sanitizeSessionMetadataSubtitleEnabled)(t)},setSubtitleLanguage:function(t){e.sessionData.subtitleLanguage=(0,i.sanitizeSessionMetadataSubtitleLanguage)(t)}}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return u.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,l.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,l.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,l.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,l.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e,t){if((0,l.isDefined)(this.analytics)&&(0,l.isDefined)(this.internalAdapter)){this.analytics.sourceChange(e);var n=this.internalAdapter;n.sessionData.streamFormat=null==t?void 0:t.streamFormat,n.sessionData.audioCodec=null==t?void 0:t.audioCodec,n.sessionData.videoCodec=null==t?void 0:t.videoCodec,n.sessionData.audioLanguage=null==t?void 0:t.audioLanguage}},e.version=u.VERSION,e}();t.HTMLVideoElementAdapter=d},7238:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLVideoElementInternalAdapter=void 0;var r=n(556),o=function(e){function t(t,n,i){var a=e.call(this,t,n)||this;return a.sessionData={},a.getPlayerVersion=function(){return""},a.getPlayerName=function(){return r.Player.HTML5},a.sessionData.streamFormat=null==i?void 0:i.streamFormat,a.sessionData.audioCodec=null==i?void 0:i.audioCodec,a.sessionData.videoCodec=null==i?void 0:i.videoCodec,a.sessionData.audioLanguage=null==i?void 0:i.audioLanguage,a}return a(t,e),t.prototype.getCurrentPlaybackInfo=function(){var t,n,i,a,r,o,s=e.prototype.getCurrentPlaybackInfo.call(this);s.streamFormat=null!==(t=this.sessionData.streamFormat)&&void 0!==t?t:s.streamFormat,s.audioCodec=null!==(n=this.sessionData.audioCodec)&&void 0!==n?n:s.audioCodec,s.videoCodec=null!==(i=this.sessionData.videoCodec)&&void 0!==i?i:s.videoCodec,s.subtitleEnabled=null!==(a=this.sessionData.subtitleEnabled)&&void 0!==a?a:s.subtitleEnabled;var l=null!==(r=this.sessionData.subtitleLanguage)&&void 0!==r?r:s.subtitleLanguage;return s.subtitleLanguage=!0===s.subtitleEnabled?l:void 0,s.audioLanguage=null!==(o=this.sessionData.audioLanguage)&&void 0!==o?o:s.audioLanguage,s},t.prototype.resetSourceRelatedState=function(){e.prototype.resetSourceRelatedState.call(this),this.sessionData={}},t.prototype.getStreamURL=function(){return this.mediaElement?this.mediaElement.currentSrc:void 0},t.prototype.getCurrentQualityLevelInfo=function(){return{bitrate:void 0,width:this.mediaElement?this.mediaElement.videoWidth:void 0,height:this.mediaElement?this.mediaElement.videoHeight:void 0}},t}(n(7124).HTML5InternalAdapter);t.HTMLVideoElementInternalAdapter=o},8510:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.videoElement=e,this.previousTotalDroppedFrames=0}return e.prototype.getDroppedFrames=function(){if(null==this.videoElement)return 0;if(void 0===this.videoElement.getVideoPlaybackQuality)return 0;var e=this.videoElement.getVideoPlaybackQuality().droppedVideoFrames,t=e-this.previousTotalDroppedFrames;return this.previousTotalDroppedFrames=e,t},e.prototype.reset=function(){this.previousTotalDroppedFrames=0},e}();t.default=n},2647:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.InternalAdapter=void 0;var a=n(675),r=n(9796),o=n(4916),s=n(4300),l=n(2361),u=n(4820),c=n(9422),d=n(1916),E=n(5063),p=n(2376),v=function(){function e(e){this.onLicenseKeyReceived=new a.EventDispatcher,this.onLicenseCallFailed=new a.EventDispatcher,this.qualityChangeService=new r.default,this.ssaiService=new s.SsaiService,this.stateMachineCallbacks=i({},u.defaultStateMachineCallbacks),this.sourceInfoFallbackService=new o.SourceInfoFallbackService,this.drmPerformanceInfo=void 0,this.windowEventTracker=new p.WindowEventTracker,e||(e={starttime:void 0}),e.starttime||(e.starttime=(0,E.getCurrentTimestamp)()),this.opts=e}return e.prototype.release=function(){this.stateMachine.resetIntervals(),this.stateMachineCallbacks.release(),this.resetSourceRelatedState(),this.windowEventTracker.release()},e.prototype.eventCallback=function(e,t,n){void 0===n&&(n=Date.now()),t=t||{},this.stateMachine?this.stateMachine.callEvent(e,t,n):d.logger.log("Bitmovin Analytics: StateMachine isn't ready yet")},e.prototype.getCommonPlaybackInfo=function(){var e=(0,c.getGlobalScreenDimensions)();return{screenHeight:null==e?void 0:e.height,screenWidth:null==e?void 0:e.width}},e.prototype.getDrmPerformanceInfo=function(){},e.prototype.getSegmentInfo=function(){return[]},e.prototype.getDownloadSpeedInfo=function(){return{segmentsDownloadCount:0,segmentsDownloadSize:0,segmentsDownloadTime:0,avgDownloadSpeed:0,minDownloadSpeed:0,maxDownloadSpeed:0,avgTimeToFirstByte:0}},e.prototype.resetDownloadSpeedInfoMeasures=function(){},e.prototype.setCustomData=function(e){var t=this.stateMachine.currentState,n={customDataValues:e,currentTime:this.currentTime};!this.stateMachine.currentState||"PAUSE"!==this.stateMachine.currentState&&"PLAYING"!==this.stateMachine.currentState?this.stateMachineCallbacks.customdatachange(void 0,void 0,n):(this.eventCallback(l.Event.CUSTOM_DATA_CHANGE,{currentTime:this.currentTime}),this.eventCallback(l.Event[t],n))},e.prototype.sourceChange=function(e){this.eventCallback(l.Event.MANUAL_SOURCE_CHANGE,{currentTime:this.currentTime,config:e})},e.prototype.resetSourceRelatedState=function(){this.sourceInfoFallbackService.reset(),this.drmPerformanceInfo=void 0},e.prototype.programChange=function(e){var t=this.ssaiService.isInActiveState();this.stateMachine.programChange(this.currentTime,t,e)},e}();t.InternalAdapter=v},5517:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AdQuartile=t.AdCallbacks=void 0;var n,i=function(){this.onAdStarted=function(e){},this.onAdFinished=function(e){},this.onAdBreakStarted=function(e){},this.onAdBreakFinished=function(e){},this.onAdClicked=function(e){},this.onAdError=function(e){},this.onAdManifestLoaded=function(e){},this.onAdQuartile=function(e){},this.onAdSkipped=function(e){},this.onPlay=function(){},this.onPause=function(){},this.onBeforeUnload=function(){}};t.AdCallbacks=i,function(e){e.FIRST_QUARTILE="firstQuartile",e.MIDPOINT="midpoint",e.THIRD_QUARTILE="thirdQuartile"}(n||(t.AdQuartile=n={}))},2063:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShakaAdapter=void 0;var i=n(4350),a=n(2361),r=n(8331),o=n(9627),s=n(1916),l=n(2108),u=n(5063),c=n(4926),d=n(2092),E=function(){function e(e,t,n){if((0,l.hasPlayerAlreadyBeenAugmented)(t))s.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance");else{(0,l.markPlayerInstanceAsAugmented)(t);var a=(0,r.sanitizeAnalyticsConfig)(e);(0,o.areCollectorRequirementsValid)(a)&&((0,r.guardAgainstDuplicatedUserId)(a),this.internalAdapter=new d.ShakaInternalAdapter(t,n),this.analytics=i.Analytics.create(a,this.internalAdapter),this.wrapPlayerLoad(t))}}return e.prototype.wrapPlayerLoad=function(e){var t,n=Object.getPrototypeOf(e),i=null!==(t=Object.getOwnPropertyDescriptor(e,"load"))&&void 0!==t?t:Object.getOwnPropertyDescriptor(n,"load");if(!0===(null==i?void 0:i.writable)||void 0!==(null==i?void 0:i.set)){var r=e.load,o=this.internalAdapter;e.load=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new Promise((function(n,i){r.apply(e,t).then((function(e){return n(e)})).catch((function(e){var t,n={currentTime:0,code:null!==(t=null==e?void 0:e.code)&&void 0!==t?t:void 0,message:(0,u.tryJSONStringify)({category:null==e?void 0:e.category,severity:null==e?void 0:e.severity}),data:{additionalData:(0,u.tryJSONStringify)(null==e?void 0:e.data)},originalError:e};o.eventCallback(a.Event.ERROR,n),i(e)}))}))}}else s.logger.errorMessageToUser("Bitmovin Analytics is unable to intercept player.load method. The provided Shaka player instance appears to be a proxy object (e.g. created via Shaka UI Library). Ensure you provide the local player instance instead.")},Object.defineProperty(e.prototype,"version",{get:function(){return c.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,l.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,l.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,l.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,l.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){(0,l.isDefined)(this.analytics)&&this.analytics.sourceChange(e)},e.version=c.VERSION,e}();t.ShakaAdapter=E},2092:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getShakaStreamFormat=t.getShakaCodecInfo=t.ShakaInternalAdapter=void 0;var o=n(2361),s=n(556),l=n(7224),u=n(7614),c=n(9557),d=n(1916),E=n(5063),p=n(7124),v=n(4654),h=function(e){function n(t,n){var i=e.call(this,t.getMediaElement(),n)||this;return i.getPlayerName=function(){return s.Player.SHAKA},i.getPlayerVersion=function(){return i.player.constructor.version},i.isLive=function(){return i.player?i.player.isLive():void 0},i.registerMediaElementErrorEvent=function(e){i.player.addEventListener(v.ShakaPlayerEvent.ERROR,(function(e){var t,n,a,r,s,l,u,c,d,p,v;i.eventCallback(o.Event.ERROR,{currentTime:null!==(n=null===(t=i.mediaElement)||void 0===t?void 0:t.currentTime)&&void 0!==n?n:0,code:null!==(r=null===(a=e.detail)||void 0===a?void 0:a.code)&&void 0!==r?r:void 0,message:null!==(l=null===(s=e.detail)||void 0===s?void 0:s.message)&&void 0!==l?l:void 0,originalError:e,data:{additionalData:(0,E.tryJSONStringify)(e.detail),exceptionMessage:null!==(c=null===(u=e.detail)||void 0===u?void 0:u.message)&&void 0!==c?c:void 0,exceptionStacktrace:null!==(v=null===(p=null===(d=e.detail)||void 0===d?void 0:d.stack)||void 0===p?void 0:p.split("\n"))&&void 0!==v?v:void 0}})}))},i.player=t,i}return a(n,e),n.prototype.initialize=function(t){var n,i=this;e.prototype.initialize.call(this,t);try{n=this.player.getMediaElement()}catch(e){}if((0,E.isNotNullish)(n))this.setMediaElement(n);else{var a=function(e){if("media-source"===e.state)try{i.player.removeEventListener(v.ShakaPlayerEvent.ONSTATECHANGE,a),i.setMediaElement(i.player.getMediaElement())}catch(e){d.logger.errorMessageToUser("Something went wrong while getting underlying HTMLVideoElement. Not possible to attach adapter and initialize Bitmovin Analytics. Error: ",e),i.release()}};this.player.addEventListener(v.ShakaPlayerEvent.ONSTATECHANGE,a)}return this.player.addEventListener(v.ShakaPlayerEvent.BUFFERING,(function(e){i.checkQualityLevelAttributes()})),this.player.addEventListener(v.ShakaPlayerEvent.ONSTATECHANGE,(function(e){"detach"===e.state&&(i.eventCallback(o.Event.UNLOAD,{}),i.release())})),[new c.ErrorDetailTracking(t.errorDetailTrackingSettingsProvider,new u.ErrorDetailBackend(t.errorDetailTrackingSettingsProvider.collectorConfig),[t.errorDetailSubscribable],void 0)]},n.prototype.getCurrentPlaybackInfo=function(){var n=r({},e.prototype.getCurrentPlaybackInfo.call(this)),i=(0,t.getShakaCodecInfo)(this.player);return this.sourceInfoFallbackService.applyAndStoreCodecInfo(n,i),n},n.prototype.getStreamType=function(){return(0,t.getShakaStreamFormat)(this.player)},n.prototype.getStreamURL=function(){return this.player?this.player.getAssetUri():null},n.prototype.getCurrentQualityLevelInfo=function(){var e=this.player.getVariantTracks().filter((function(e){return e.active})).filter((function(e){return e.videoCodec||void 0!==e.videoId}))[0];return e?{bitrate:e.videoBandwidth||e.bandwidth,width:e.width,height:e.height}:null},n}(p.HTML5InternalAdapter);t.ShakaInternalAdapter=h;t.getShakaCodecInfo=function(e){var t=e.getVariantTracks().find((function(e){return e.active}));return{videoCodec:null==t?void 0:t.videoCodec,audioCodec:null==t?void 0:t.audioCodec}};t.getShakaStreamFormat=function(e){var t,n;if(e){var i=null===(n=null===(t=e.getManifestType)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.toLowerCase();if(i===l.StreamTypes.dash)return l.StreamTypes.dash;if(i===l.StreamTypes.hls)return l.StreamTypes.hls;return(0,E.isNullish)(i)&&3===e.getLoadMode()&&(0,E.isNotNullish)(e.getAssetUri())?l.StreamTypes.prog:void 0}}},4654:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShakaPlayerEvent=void 0,t.ShakaPlayerEvent={UNLOADING:"unloading",ONSTATECHANGE:"onstatechange",STATECHANGED:"statechanged",BUFFERING:"buffering",ERROR:"error"}},1482:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DrmPerformanceService=void 0,t.isDrmLicenseType=o,t.extractDrmType=s;var i=n(7912),a=n(5063),r=function(){function e(){var e=this;this.drmPerformanceInfo=void 0,this.onDownloadFinished=function(t){var n=t.httpRequest;if(n.success&&!(0,a.isNotNullish)(e.drmPerformanceInfo)&&o(n.type)){var i=s(n.type);e.drmPerformanceInfo={drmType:i,drmLoadTime:n.downloadTime}}}}return e.prototype.getInfo=function(){return this.drmPerformanceInfo},e.prototype.reset=function(){this.drmPerformanceInfo=void 0},e}();function o(e){return e===i.HttpRequestType.DRM_LICENSE_WIDEVINE||e===i.HttpRequestType.DRM_LICENSE_FAIRPLAY||e===i.HttpRequestType.DRM_LICENSE_PLAYREADY||e===i.HttpRequestType.DRM_LICENSE_CLEARKEY}function s(e){var t=e.match(/drm\/license\/(.+)/);return t?t[1]:"unknown"}t.DrmPerformanceService=r},7470:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.THEOplayerAdapter=void 0;var i=n(4350),a=n(6398),r=n(9352),o=n(8331),s=n(9627),l=n(1916),u=n(2108),c=n(4926),d=n(7297),E=function(){function e(e,t,n){var r=this;if(this.ssai={adBreakStart:function(e){if((0,u.isDefined)(r.internalAdapter)&&(0,a.hasValidSsaiAdBreakMetadataStructure)(e)){var t=(0,a.simplySanitizeSsaiAdBreakMetadata)(e);r.internalAdapter.ssaiService.adBreakStart(t)}},adStart:function(e){if((0,u.isDefined)(r.analytics)&&(0,u.isDefined)(r.internalAdapter)&&(0,a.hasValidSsaiAdMetadataStructure)(e)){var t=(0,a.simplySanitizeSsaiAdMetadata)(e);r.internalAdapter.ssaiService.adStart(t),r.analytics.setConfigParameters(),r.analytics.setAutoDetectedDeviceInformation()}},adQuartileFinished:function(e,t){if((0,u.isDefined)(r.analytics)&&(0,u.isDefined)(r.internalAdapter)&&(0,a.hasValidSsaiAdQuartileStructure)(e)){var n=(0,a.sanitizeSsaiAdQuartileMetadata)(t);r.internalAdapter.ssaiService.adQuartileFinished(e,n)}},adBreakEnd:function(){(0,u.isDefined)(r.analytics)&&(0,u.isDefined)(r.internalAdapter)&&(r.internalAdapter.ssaiService.adBreakEnd(),r.analytics.setConfigParameters(),r.analytics.setAutoDetectedDeviceInformation())}},(0,u.hasPlayerAlreadyBeenAugmented)(t.element))l.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance");else{(0,u.markPlayerInstanceAsAugmented)(t.element);var c=(0,o.sanitizeAnalyticsConfig)(e);(0,s.areCollectorRequirementsValid)(c)&&((0,o.guardAgainstDuplicatedUserId)(c),this.internalAdapter=new d.THEOplayerInternalAdapter(t,n),this.analytics=i.Analytics.create(c,this.internalAdapter))}}return Object.defineProperty(e.prototype,"version",{get:function(){return c.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,u.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,u.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,u.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,u.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){(0,u.isDefined)(this.analytics)&&this.analytics.sourceChange(e)},e.prototype.programChange=function(e){if((0,r.hasValidSourceMetadataStructure)(e)){var t=(0,r.sanitizeSourceMetadata)(e);(0,u.isDefined)(this.internalAdapter)&&this.internalAdapter.programChange(t)}},e.version=c.VERSION,e}();t.THEOplayerAdapter=E},7297:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.THEOplayerInternalAdapter=void 0,t.detectPlaybackInfoStreamTypeFieldsFromSource=b,t.createSpeedMeasurementFromEvent=R;var o=n(655),s=n(9664),l=n(2663),u=n(5878),c=n(2361),d=n(556),E=n(8525),p=n(7224),v=n(7614),h=n(9557),f=n(7881),m=n(7912),A=n(3413),y=n(9422),S=n(1460),T=n(1820),g=n(5063),I=n(2647),N=n(2935),D=n(1482),C=n(4843),_=n(944),P=function(e){function t(t,n){var i=e.call(this,n)||this;i.speedMeter=new s.DownloadSpeedMeter,i.delayedEventDispatcher=C.DelayedEventDispatcher.create(),i.drmPerformanceService=new D.DrmPerformanceService,i.onBeforeUnLoadEvent=!1,i.videoTrackListeners=new Map,i.audioTrackListeners=new Map,i.getDrmPerformanceInfo=function(){return i.drmPerformanceService.getInfo()},i.player=t,i.networkInterceptor=new _.THEOplayerNetworkInterceptor(t),i.networkInterceptor.subscribe((function(e){var t=R(e);(0,g.isNotNullish)(t)&&i.speedMeter.addMeasurement(t),i.drmPerformanceService.onDownloadFinished(e)}));var a=new l.HeartbeatService((function(){return i.currentTime}));return i.stateMachine=new o.THEOplayerAnalyticsStateMachine(i.stateMachineCallbacks,a,i.opts),a.setListener(i.stateMachine),i.player=t,i}return a(t,e),Object.defineProperty(t.prototype,"adModule",{get:function(){return this._adModule},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){var t=this;this.registerEventListeners(),this.player.ads&&(this._adModule=new N.THEOplayerAdModule(this.player,this.windowEventTracker)),this.ssaiService.activate({getPlayerCurrentTime:function(){return t.currentTime},reportEngagementInteraction:function(t){e.sendSsaiEngagementAdSample(t)},reportPlaybackInteraction:function(e,n){t.stateMachine.sendPlayingSample(e,n,!0)}});var n=new f.HttpRequestTracking([this.networkInterceptor]),i=new h.ErrorDetailTracking(e.errorDetailTrackingSettingsProvider,new v.ErrorDetailBackend(e.errorDetailTrackingSettingsProvider.collectorConfig),[e.errorDetailSubscribable],n);return this.eventCallback(c.Event.READY,{currentTime:this.currentTime}),[i]},t.prototype.getPlayerVersion=function(){var e=(0,y.getGlobalTheoPlayerVersion)();return(0,T.isValidString)(e)&&!(0,T.isBlank)(e)?e:"unknown"},t.prototype.getPlayerName=function(){return d.Player.THEOPLAYER},t.prototype.getPlayerTech=function(){return"html5"},t.prototype.getAutoPlay=function(){var e;return null!==(e=this.player.autoplay)&&void 0!==e&&e},t.prototype.getCurrentPlaybackInfo=function(){var e,t,n,i,a,o,s,l=this.player.videoTracks.find((function(e){return e.enabled})),c=this.player.audioTracks.find((function(e){return e.enabled})),d=this.player.textTracks.find((function(e){return"showing"===e.mode})),p=void 0;return(0,g.isNotNullish)(null===(e=this.player.cast)||void 0===e?void 0:e.airplay)?p=u.CastTech.AirPlay:(0,g.isNotNullish)(null===(t=this.player.cast)||void 0===t?void 0:t.chromecast)&&(p=u.CastTech.GoogleCast),r(r(r({},this.getCommonPlaybackInfo()),b(this.currentSource)),{audioBitrate:null===(n=null==c?void 0:c.activeQuality)||void 0===n?void 0:n.bandwidth,audioCodec:null===(i=null==c?void 0:c.activeQuality)||void 0===i?void 0:i.codecs,audioLanguage:null==c?void 0:c.language,castTech:p,droppedFrames:0,isCasting:!0===(null===(a=this.player.cast)||void 0===a?void 0:a.casting),isLive:!isFinite(this.player.duration),isMuted:this.player.muted,playerTech:this.getPlayerTech(),size:"fullscreen"===this.player.presentation.currentMode?E.PlayerSize.Fullscreen:E.PlayerSize.Window,subtitleEnabled:(0,g.isNotNullish)(d),subtitleLanguage:null==d?void 0:d.language,videoBitrate:null===(o=null==l?void 0:l.activeQuality)||void 0===o?void 0:o.bandwidth,videoCodec:null===(s=null==l?void 0:l.activeQuality)||void 0===s?void 0:s.codecs,videoDuration:(0,A.normalizeVideoDuration)(this.player.duration),videoPlaybackHeight:this.player.videoHeight,videoPlaybackWidth:this.player.videoWidth,videoWindowHeight:this.player.element.offsetHeight,videoWindowWidth:this.player.element.offsetWidth})},Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.player.currentTime},enumerable:!1,configurable:!0}),t.prototype.getDownloadSpeedInfo=function(){return this.speedMeter.getInfo()},t.prototype.resetDownloadSpeedInfoMeasures=function(){this.speedMeter.reset()},t.prototype.resetSourceRelatedState=function(){e.prototype.resetSourceRelatedState.call(this),this.ssaiService.resetSourceRelatedState(),this.videoTrackListeners.forEach((function(e,t){t.removeEventListener("activequalitychanged",e)})),this.videoTrackListeners.clear(),this.audioTrackListeners.forEach((function(e,t){t.removeEventListener("activequalitychanged",e)})),this.audioTrackListeners.clear(),this.lastTrackedCurrentTime=void 0,this.currentSource=void 0,this.speedMeter.reset(),this.drmPerformanceService.reset(),this.networkInterceptor.reset()},t.prototype.eventCallback=function(t,n){this.delayedEventDispatcher.dispatchEvent(t,n,this.stateMachine.currentState,e.prototype.eventCallback.bind(this))},t.prototype.handleVideoQualityChanged=function(e){var t=e.quality,n={type:"video",width:t.width,height:t.height,bitrate:t.bandwidth,currentTime:this.currentTime};this.qualityChangeService.shouldAllowVideoQualityChange(t.bandwidth)&&this.eventCallback(c.Event.VIDEO_CHANGE,n),this.qualityChangeService.setVideoBitrate(t.bandwidth),this.stateMachineCallbacks.updateSampleQualityInfo(n)},t.prototype.handleAudioQualityChanged=function(e){var t=e.quality,n={type:"audio",bitrate:t.bandwidth,currentTime:this.currentTime};this.qualityChangeService.shouldAllowAudioQualityChange(t.bandwidth)&&this.eventCallback(c.Event.AUDIO_CHANGE,n),this.qualityChangeService.setAudioBitrate(t.bandwidth),this.stateMachineCallbacks.updateSampleQualityInfo(n)},t.prototype.registerEventListeners=function(){var e,t,n=this;this.player.addEventListener("sourcechange",(function(e){n.eventCallback(c.Event.READY,{})})),this.player.addEventListener("currentsourcechange",(function(e){(0,g.isNotNullish)(n.currentSource)&&n.eventCallback(c.Event.MANUAL_SOURCE_CHANGE,{currentTime:n.lastTrackedCurrentTime,config:{}}),n.currentSource=e.currentSource})),this.player.addEventListener("play",(function(e){n.eventCallback(c.Event.PLAY,{currentTime:e.currentTime})})),this.player.addEventListener("pause",(function(e){n.eventCallback(c.Event.PAUSE,{currentTime:e.currentTime})})),this.player.videoTracks.addEventListener("addtrack",(function(e){var t=e.track,i=function(e){n.handleVideoQualityChanged(e)};t.addEventListener("activequalitychanged",i),n.videoTrackListeners.set(t,i)})),this.player.videoTracks.addEventListener("removetrack",(function(e){var t=e.track,i=n.videoTrackListeners.get(t);i&&(t.removeEventListener("activequalitychanged",i),n.videoTrackListeners.delete(t))}));for(var i=0,a=this.player.videoTracks;i<a.length;i++){var r=function(e){n.handleVideoQualityChanged(e)};(l=a[i]).addEventListener("activequalitychanged",r),this.videoTrackListeners.set(l,r)}this.player.audioTracks.addEventListener("addtrack",(function(e){var t=e.track,i=function(e){n.handleAudioQualityChanged(e)};t.addEventListener("activequalitychanged",i),n.audioTrackListeners.set(t,i)})),this.player.audioTracks.addEventListener("removetrack",(function(e){var t=e.track,i=n.audioTrackListeners.get(t);i&&(t.removeEventListener("activequalitychanged",i),n.audioTrackListeners.delete(t))}));for(var o=0,s=this.player.audioTracks;o<s.length;o++){var l;r=function(e){n.handleAudioQualityChanged(e)};(l=s[o]).addEventListener("activequalitychanged",r),this.audioTrackListeners.set(l,r)}this.player.addEventListener("seeking",(function(e){n.eventCallback(c.Event.SEEK,{currentTime:n.lastTrackedCurrentTime})})),this.player.addEventListener("timeupdate",(function(e){n.lastTrackedCurrentTime=e.currentTime})),this.player.addEventListener("playing",(function(e){n.eventCallback(c.Event.PLAYING,{currentTime:e.currentTime})})),this.player.addEventListener("waiting",(function(e){n.eventCallback(c.Event.START_BUFFERING,{currentTime:e.currentTime})})),this.player.addEventListener("ended",(function(e){n.eventCallback(c.Event.END,{currentTime:e.currentTime})})),this.player.addEventListener("segmenterror",(function(e){var t,i,a,r,o,s=(0,g.isNotNullish)(null===(t=e.error)||void 0===t?void 0:t.code)?Number(null===(i=e.error)||void 0===i?void 0:i.code):void 0,l=null===(a=e.error)||void 0===a?void 0:a.message,u=(0,T.isValidString)(l)?l:void 0,d=null===(r=e.error)||void 0===r?void 0:r.cause,E=null===(o=e.error)||void 0===o?void 0:o.stack,p=(0,T.isValidString)(E)?E.split("\n"):void 0,v=(0,g.tryJSONStringify)(e);n.eventCallback(c.Event.ERROR,{code:s,message:u,legacyData:v,currentTime:n.currentTime,originalError:d,data:{exceptionMessage:u,exceptionStacktrace:p,additionalData:v}}),n.ssaiService.sendAdEngagementErrorSample({code:s,message:u,severity:"CRITICAL"},e)})),this.player.addEventListener("error",(function(e){var t,i,a=e.errorObject.code,r=e.errorObject.message,o=e.errorObject.cause,s=(0,g.tryJSONStringify)(e.errorObject);n.eventCallback(c.Event.ERROR,{code:a,message:r,legacyData:s,currentTime:n.currentTime,originalError:o,data:{exceptionMessage:r,exceptionStacktrace:null!==(i=null===(t=e.errorObject.stack)||void 0===t?void 0:t.split("\n"))&&void 0!==i?i:void 0,additionalData:s}}),n.ssaiService.sendAdEngagementErrorSample({code:a,message:r,severity:"CRITICAL"},e)})),null===(e=this.player.ads)||void 0===e||e.addEventListener("adbreakbegin",(function(e){n.eventCallback(c.Event.START_AD,{currentTime:n.currentTime})})),null===(t=this.player.ads)||void 0===t||t.addEventListener("adbreakend",(function(e){n.eventCallback(c.Event.END_AD,{currentTime:n.currentTime})}));var u=function(){if(!n.onBeforeUnLoadEvent){n.onBeforeUnLoadEvent=!0;var e=n.lastTrackedCurrentTime;n.eventCallback(c.Event.UNLOAD,{currentTime:e})}n.release()};this.windowEventTracker.addEventListener("beforeunload",u),this.windowEventTracker.addEventListener("unload",u),this.player.addEventListener("destroy",(function(e){u()}))},t}(I.InternalAdapter);function b(e){if((0,g.isNullish)(e))return{};var t=void 0;return(0,g.isNullish)(e.type)||(t=(0,p.getStreamTypeFromMIMEType)(e.type)),(0,g.isNullish)(t)&&(t=(0,p.getStreamTypesFromURL)(e.src)),(0,A.buildPlaybackInfoStreamTypeFields)(t,e.src)}function R(e){var t=e.httpRequest;if(t.success&&(t.type===m.HttpRequestType.MEDIA_VIDEO||t.type===m.HttpRequestType.MEDIA_AUDIO))return{duration:t.downloadTime/1e3,size:(0,S.isNumber)(t.size)?t.size:0,timeToFirstByte:(0,g.isNotNullish)(t.timeToFirstByte)?t.timeToFirstByte/1e3:0,timestamp:new Date,httpStatus:t.httpStatus}}t.THEOplayerInternalAdapter=P},944:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.THEOplayerNetworkInterceptor=t.STALE_REQUEST_TIMEOUT_MS=void 0,t.extractResponseSize=d,t.mapHttpRequestType=E;var i=n(675),a=n(7912),r=n(9422),o=n(1916),s=n(1460),l=n(1820),u=n(5063);t.STALE_REQUEST_TIMEOUT_MS=18e4;var c=function(){function e(e){var t=this;this.player=e,this.eventDispatcher=new i.EventDispatcher,this.pendingRequests=new Map,this.onRequest=function(e){try{var n=e.url;if(!(0,l.isValidString)(n)||(0,l.isBlank)(n))return;var i=(0,r.getGlobalPerformanceNow)(),a=null!=i?i:Date.now();t.cleanupStaleRequests(a);var s={url:n,startTime:a,type:e.type,subType:e.subType,mediaType:e.mediaType},c=t.pendingRequests.get(n);(0,u.isNullish)(c)?t.pendingRequests.set(n,[s]):c.push(s)}catch(e){o.logger.error("THEOplayerNetworkInterceptor: Error in request interceptor",e)}},this.onResponse=function(e){try{var n=e.request;if((0,u.isNullish)(n))return;var i=n.url;if(!(0,l.isValidString)(i)||(0,l.isBlank)(i))return;var a=t.pendingRequests.get(i);if((0,u.isNullish)(a)||0===a.length)return;var c=a.shift();0===a.length&&t.pendingRequests.delete(i);var p=(0,r.getGlobalPerformanceNow)(),v=null!=p?p:Date.now(),h=Math.round(v-c.startTime),f=d(e),m=(0,s.isNumber)(e.status)?e.status:0,A=m>=200&&m<400;t.eventDispatcher.dispatch({httpRequest:{downloadTime:h,httpStatus:m,success:A,timestamp:Date.now(),url:i,size:f,timeToFirstByte:void 0,type:E(c.type,c.subType,c.mediaType,i)}})}catch(e){o.logger.error("THEOplayerNetworkInterceptor: Error in response interceptor",e)}},(0,u.isNullish)(this.player.network)?o.logger.warn("THEOplayerNetworkInterceptor: player.network is not available"):(this.player.network.addRequestInterceptor(this.onRequest),this.player.network.addResponseInterceptor(this.onResponse))}return e.prototype.subscribe=function(e){return this.eventDispatcher.subscribe(e)},e.prototype.unsubscribe=function(e){this.eventDispatcher.unsubscribe(e)},e.prototype.reset=function(){this.pendingRequests.clear()},e.prototype.cleanupStaleRequests=function(e){var n=this;this.pendingRequests.forEach((function(i,a){var r=i.filter((function(n){return e-n.startTime<=t.STALE_REQUEST_TIMEOUT_MS}));0===r.length?n.pendingRequests.delete(a):r.length!==i.length&&n.pendingRequests.set(a,r)}))},e}();function d(e){var t,n,i,a=null!==(n=null===(t=e.headers)||void 0===t?void 0:t["content-length"])&&void 0!==n?n:null===(i=e.headers)||void 0===i?void 0:i["Content-Length"];if((0,u.isNotNullish)(a)){var r=(0,s.parseIntOrUndefined)(a);if((0,u.isNotNullish)(r))return r}if((0,u.isNotNullish)(e.body)){if((0,l.isValidString)(e.body))return e.body.length;if((0,u.isArrayBuffer)(e.body)&&(0,s.isNumber)(e.body.byteLength))return e.body.byteLength}}function E(e,t,n,i){if("content-protection"===e)switch(t){case"widevine-license":return a.HttpRequestType.DRM_LICENSE_WIDEVINE;case"fairplay-license":return a.HttpRequestType.DRM_LICENSE_FAIRPLAY;case"playready-license":return a.HttpRequestType.DRM_LICENSE_PLAYREADY;case"clearkey-license":return a.HttpRequestType.DRM_LICENSE_CLEARKEY;case"aes128-key":return a.HttpRequestType.KEY_HLS_AES;case"fairplay-certificate":return a.HttpRequestType.DRM_CERTIFICATE_FAIRPLAY;default:return a.HttpRequestType.UNKNOWN}return"manifest"===e?(0,l.endsWith)(i,".mpd")?a.HttpRequestType.MANIFEST_DASH:(0,l.endsWith)(i,".m3u8")?a.HttpRequestType.MANIFEST_HLS_MASTER:a.HttpRequestType.UNKNOWN:"video"===n?a.HttpRequestType.MEDIA_VIDEO:"audio"===n?a.HttpRequestType.MEDIA_AUDIO:"text"===n?a.HttpRequestType.MEDIA_SUBTITLES:(0,l.endsWith)(i,".mpd")?a.HttpRequestType.MANIFEST_DASH:(0,l.endsWith)(i,".m3u8")?a.HttpRequestType.MANIFEST_HLS_MASTER:a.HttpRequestType.UNKNOWN}t.THEOplayerNetworkInterceptor=c},405:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapTheoAd=function(e){var t="linear"===e.type,n={id:e.id,isLinear:t,clickThroughUrl:e.clickThrough,width:e.width,height:e.height},i=t?e:void 0;(0,a.isNotNullish)(i)&&(n.mediaUrl=i.mediaUrl);(0,a.isNotNullish)(e.skipOffset)&&(n.skippable=-1!==e.skipOffset,n.skippableAfter=e.skipOffset);(0,a.isNotNullish)(e.duration)&&(n.duration=e.duration);var r="google-ima"===e.integration||"google-dai"===e.integration?e:void 0;(0,a.isNotNullish)(r)&&(n.bitrate=(0,a.isNotNullish)(r.bitrate)?r.bitrate/1e3:void 0,n.mimeType=r.contentType);n.vastData={adSystem:e.adSystem,creativeId:e.creativeId};var o=e.universalAdIds&&e.universalAdIds.length>0?e.universalAdIds[0]:void 0;(0,a.isNotNullish)(o)&&(n.vastData.universalAdIdRegistry=o.adIdRegistry,n.vastData.universalAdIdValue=o.adIdValue);(0,a.isNotNullish)(r)&&(n.vastData.apiFramework=r.apiFramework,n.vastData.adDescription=r.description,n.vastData.adTitle=r.title,n.vastData.wrapperAdsCount=(0,a.isNotNullish)(r.wrapperAdIds)?r.wrapperAdIds.length:void 0);return n},t.mapTheoAdBreak=function(e,t){var n=e.timeOffset;if(!(0,i.isFiniteNumber)(n)||n<0)return{position:void 0,scheduleTime:void 0};if(0===n)return{position:"pre",scheduleTime:0};var r=(0,a.isNotNullish)(t)?Math.abs(n-t):void 0;if((0,a.isNotNullish)(r)&&r<=1)return{position:"post",scheduleTime:t};return{position:String(n),scheduleTime:n}};var i=n(1460),a=n(5063)},2935:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.THEOplayerAdModule=void 0;var i=n(1460),a=n(5063),r=n(5517),o=n(405),s=function(){function e(e,t){var n=this;this.adCallbacks=new r.AdCallbacks,this.isLinearAdActive=function(){return!!n.player.ads&&n.player.ads.playing},this.getContainer=function(){return n.player.element},this.getAdModuleInfo=function(){return{name:"theo-ads",version:void 0}},this.currentTime=function(){return n.player.currentTime},this.getAutoPlay=function(){var e;return null!==(e=n.player.autoplay)&&void 0!==e&&e},this.player=e,this.register(t)}return e.prototype.register=function(e){var t=this,n=this.player.ads;if(!(0,a.isNullish)(n)){n.addEventListener("adbreakbegin",(function(e){t.adCallbacks.onAdBreakStarted((0,o.mapTheoAdBreak)(e.adBreak,t.videoDuration))})),n.addEventListener("adbreakend",(function(e){t.adCallbacks.onAdBreakFinished((0,o.mapTheoAdBreak)(e.adBreak,t.videoDuration))})),n.addEventListener("adbegin",(function(e){t.adCallbacks.onAdStarted((0,o.mapTheoAd)(e.ad))})),n.addEventListener("adend",(function(e){t.adCallbacks.onAdFinished((0,o.mapTheoAd)(e.ad))})),n.addEventListener("adskip",(function(e){t.adCallbacks.onAdSkipped((0,o.mapTheoAd)(e.ad))})),n.addEventListener("aderror",(function(e){var n={};(function(e){return(0,a.isNotNullish)(e)&&"errorCode"in e})(e)&&(n.code=e.errorCode,n.message=e.message);var i=t.player.errorObject;(0,a.isNotNullish)(i)&&(0,a.isNullish)(n.code)&&(n.code=i.code,n.message=i.message),t.adCallbacks.onAdError(n)})),n.addEventListener("adloaded",(function(e){var n,r;(0,i.isFiniteNumber)(t.player.duration)&&t.videoDuration!==t.player.duration&&(t.videoDuration=t.player.duration);var s={isVmap:!1},l=null===(n=t.player.source)||void 0===n?void 0:n.ads;(0,a.isNotNullish)(l)&&l.length>0&&(s.isVmap="vmap"===l[0].type),(0,a.isNotNullish)(null===(r=t.player.ads)||void 0===r?void 0:r.currentAdBreak)&&(s.adBreakInfo=(0,o.mapTheoAdBreak)(t.player.ads.currentAdBreak,t.player.duration)),t.adCallbacks.onAdManifestLoaded(s)}));var r=function(){t.adCallbacks.onBeforeUnload()};e.addEventListener("beforeunload",r),e.addEventListener("unload",r)}},e}();t.THEOplayerAdModule=s},602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallbackScheduler=t.CALLBACK_SCHEDULER_TIMEOUT_DELAY_MS=void 0;var i=n(5063);t.CALLBACK_SCHEDULER_TIMEOUT_DELAY_MS=50;var a=function(){function e(){this.timeout=void 0}return e.prototype.schedule=function(e){var n=this;(0,i.isNotNullish)(this.timeout)||(this.callback=e,this.timeout=setTimeout((function(){var e;null===(e=n.callback)||void 0===e||e.call(n),n.cancel()}),t.CALLBACK_SCHEDULER_TIMEOUT_DELAY_MS))},e.prototype.isScheduled=function(){return(0,i.isNotNullish)(this.timeout)},e.prototype.execute=function(){var e;null===(e=this.callback)||void 0===e||e.call(this),this.cancel()},e.prototype.cancel=function(){clearTimeout(this.timeout),this.timeout=void 0,this.callback=void 0},e}();t.CallbackScheduler=a},4843:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelayedEventDispatcher=void 0;var i=n(655),a=n(2361),r=n(1916),o=n(602),s=function(){function e(e){this.scenarios=e,this.scheduler=new o.CallbackScheduler}return e.create=function(){return new e([{delayEvent:a.Event.PAUSE,inState:i.State.STARTUP,cancelOnEvent:a.Event.ERROR},{delayEvent:a.Event.PAUSE,inState:i.State.PLAYING,cancelOnEvent:a.Event.SEEK},{delayEvent:a.Event.END_AD,inState:i.State.AD_PLAYBACK,cancelOnEvent:a.Event.END}])},e.prototype.dispatchEvent=function(e,t,n,i){var a=this;this.scheduler.isScheduled()&&null!=this.activeScenario&&(this.activeScenario.cancelOnEvent===e?(r.logger.log("⏳ [DelayedEventDispatcher] 🚫 Cancelling delayed '".concat(String(this.activeScenario.delayEvent),"' — canceled by event '").concat(String(e),"'")),this.scheduler.cancel(),this.activeScenario=void 0):(r.logger.log("⏳ [DelayedEventDispatcher] ✅ Executing delayed '".concat(String(this.activeScenario.delayEvent),"' early — unrelated event '").concat(String(e),"' arrived")),this.scheduler.execute(),this.activeScenario=void 0));var o=this.findMatchingScenario(e,n);if(null!=o){var s=Date.now();return this.activeScenario=o,r.logger.log("⏳ [DelayedEventDispatcher] ➕ Delaying '".concat(String(e),"' in state '").concat(n,"'")),void this.scheduler.schedule((function(){a.activeScenario=void 0,i(e,t,s)}))}i(e,t)},e.prototype.findMatchingScenario=function(e,t){for(var n=0,i=this.scenarios;n<i.length;n++){var a=i[n];if(a.delayEvent===e&&a.inState===t)return a}},e}();t.DelayedEventDispatcher=s},4179:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VideojsAdapter=void 0;var i=n(4350),a=n(8331),r=n(9627),o=n(1916),s=n(2108),l=n(4926),u=n(4040),c=function(){function e(e,t,n){if((0,s.hasPlayerAlreadyBeenAugmented)(t))o.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance");else{(0,s.markPlayerInstanceAsAugmented)(t);var l=(0,a.sanitizeAnalyticsConfig)(e);(0,r.areCollectorRequirementsValid)(l)&&((0,a.guardAgainstDuplicatedUserId)(l),this.internalAdapter=new u.VideojsInternalAdapter(t,n),this.analytics=i.Analytics.create(l,this.internalAdapter))}}return Object.defineProperty(e.prototype,"version",{get:function(){return l.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,s.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.sourceChange(e)},e.version=l.VERSION,e}();t.VideojsAdapter=c},4040:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.VideojsInternalAdapter=void 0,t.detectVideoJsPlaybackInfoStreamTypeFields=g;var o=n(5182),s=n(2663),l=n(6743),u=n(5626),c=n(2361),d=n(556),E=n(8525),p=n(7224),v=n(7614),h=n(9557),f=n(3413),m=n(716),A=n(9422),y=n(1820),S=n(5063),T=function(e){function t(t,n){var i=e.call(this,n)||this;i._subtitleInfo={enabled:!1},i.onBeforeUnLoadEvent=!1,i.previousTime=0,i.getPlayerVersion=function(){var e,t,n=null===(t=(e=i.player).version)||void 0===t?void 0:t.call(e)["video.js"];if((0,y.isValidString)(n)&&!(0,y.isBlank)(n))return n;var a=(0,A.getGlobalVideojsVersion)();return(0,y.isValidString)(a)&&!(0,y.isBlank)(a)?a:"unknown"},i.getPlayerName=function(){return d.Player.VIDEOJS},i.getPlayerTech=function(){return"html5"},i.getAutoPlay=function(){return!0===i.player.autoplay()},i.getDrmPerformanceInfo=function(){return i.drmPerformanceInfo},i.player=t;var a=new s.HeartbeatService((function(){return i.currentTime})),r=new o.VideojsAnalyticsStateMachine(i.stateMachineCallbacks,a,i.opts);return a.setListener(r),i.stateMachine=r,i.videoCompletionTracker=new l.default,i}return a(t,e),t.prototype.resetSourceRelatedState=function(){e.prototype.resetSourceRelatedState.call(this),this.videoCompletionTracker.reset(),this.videoCompletionTracker.setVideoDuration(this.player.duration()),this.previousTime=0},t.prototype.initialize=function(e){return this.register(),[new h.ErrorDetailTracking(e.errorDetailTrackingSettingsProvider,new v.ErrorDetailBackend(e.errorDetailTrackingSettingsProvider.collectorConfig),[e.errorDetailSubscribable],void 0)]},t.prototype.getCurrentPlaybackInfo=function(){var e,t,n;this.selectedAudioLanguage=this.getSelectedAudioTrackLanguage(this.player);var i=this.getCodecInfo(this.player.tech({IWillNotUseThisInPlugins:!0})),a=r(r(r({},this.getCommonPlaybackInfo()),g(this.player)),{isLive:isNaN(this.player.duration())?void 0:this.player.duration()===1/0,size:this.player.isFullscreen()?E.PlayerSize.Fullscreen:E.PlayerSize.Window,playerTech:this.getPlayerTech(),isMuted:this.player.muted(),videoDuration:(0,f.normalizeVideoDuration)(this.player.duration()),videoWindowHeight:this.player.height(),videoWindowWidth:this.player.width(),videoPlaybackHeight:this.player.videoHeight(),videoPlaybackWidth:this.player.videoWidth(),audioLanguage:this.selectedAudioLanguage,subtitleEnabled:this._subtitleInfo.enabled,subtitleLanguage:this._subtitleInfo.language,videoCodec:null==i?void 0:i.videoCodec,audioCodec:null==i?void 0:i.audioCodec,droppedFrames:0}),o=this.getCurrentQualityLevelInfo();return o&&(a.videoPlaybackWidth=null!==(e=o.width)&&void 0!==e?e:a.videoPlaybackWidth,a.videoPlaybackHeight=null!==(t=o.height)&&void 0!==t?t:a.videoPlaybackHeight,a.videoBitrate=null!==(n=o.bitrate)&&void 0!==n?n:a.videoBitrate),a},t.prototype.getCurrentQualityLevelInfo=function(){return this.currentVideoJsQualityLevel()},t.prototype.register=function(){var e=this,t=this;this.player.on("loadstart",(function(){t.eventCallback(c.Event.MANUAL_SOURCE_CHANGE,{config:{}})})),this.player.on("loadedmetadata",(function(){t.videoCompletionTracker.reset(),t.videoCompletionTracker.setVideoDuration(this.duration()),t.previousTime=0,t.eventCallback(c.Event.SOURCE_LOADED,{})})),this.player.ready((function(){t._subtitleInfo=t.getSubtitleInfo(this),t.eventCallback(c.Event.READY,{})})),this.player.on("play",(function(){t.eventCallback(c.Event.PLAY,{currentTime:this.currentTime()})})),this.player.on("pause",(function(){this.seeking()||t.eventCallback(c.Event.PAUSE,{currentTime:this.currentTime()})})),this.player.on("error",(function(){var e=this.error();t.eventCallback(c.Event.ERROR,{currentTime:this.currentTime(),code:e.code,message:e.message,originalError:e,data:{}})})),this.player.on("volumechange",(function(){var e=this.muted(),n=this.volume(),i=(0,S.isAudioMuted)(e,n);this.previousMutedValue!==i&&(i?t.eventCallback(c.Event.MUTE,{currentTime:this.currentTime()}):t.eventCallback(c.Event.UN_MUTE,{currentTime:this.currentTime()}),this.previousMutedValue=i)})),this.player.on("seeking",(function(){t.eventCallback(c.Event.SEEK,{currentTime:(0,S.isNotNullish)(t.previousTime)?t.previousTime:this.currentTime()})})),this.player.on("seeked",(function(){t.eventCallback(c.Event.SEEKED,{currentTime:this.currentTime()})})),this.player.on("texttrackchange",(function(){var e=t.getSubtitleInfo(this),n=!!(0,S.isNullish)(t._subtitleInfo)||(0,m.isDifferentSubtitleInfo)(t._subtitleInfo,e);t._subtitleInfo=e,n&&t.eventCallback(c.Event.SUBTITLE_CHANGE,{currentTime:this.currentTime()})})),this.player.audioTracks().on("change",(function(){var e=t.getSelectedAudioTrackLanguage(t.player);(0,S.isNotNullish)(e)&&e!==t.selectedAudioLanguage&&t.eventCallback(c.Event.AUDIOTRACK_CHANGED,{currentTime:t.player.currentTime()})})),this.player.on("stalled",(function(){t.eventCallback(c.Event.START_BUFFERING,{currentTime:this.currentTime()})})),this.player.on("waiting",(function(){t.eventCallback(c.Event.START_BUFFERING,{currentTime:this.currentTime()})})),this.player.on("timeupdate",(function(){this.seeking()||(t.previousTime=this.currentTime()),t.eventCallback(c.Event.TIMECHANGED,{currentTime:this.currentTime()});var e=t.currentVideoJsQualityLevel();if((null==e?void 0:e.height)&&(null==e?void 0:e.width)&&(null==e?void 0:e.bitrate)){var n={type:"video",bitrate:e.bitrate,height:e.height,width:e.width,currentTime:this.currentTime()};t.qualityChangeService.shouldAllowVideoQualityChange(e.bitrate)&&t.eventCallback(c.Event.VIDEO_CHANGE,n),t.qualityChangeService.setVideoBitrate(e.bitrate),t.stateMachineCallbacks.updateSampleQualityInfo(n)}}));var n=function(){if(!e.onBeforeUnLoadEvent){e.onBeforeUnLoadEvent=!0;var t=void 0;(0,S.isNotNullish)(e.player)&&(t=e.player.currentTime()),e.eventCallback(c.Event.UNLOAD,{currentTime:t})}e.release()};n=n.bind(this),this.player.on("dispose",n),this.windowEventTracker.addEventListener("beforeunload",n),this.windowEventTracker.addEventListener("unload",n)},Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.player.currentTime()},enumerable:!1,configurable:!0}),t.prototype.getSelectedAudioTrackLanguage=function(e){for(var t=0,n=e.audioTracks();t<n.length;t++){var i=n[t];if(i.enabled)return i.language}},t.prototype.getSubtitleInfo=function(e){for(var t,n=!1,i=0,a=e.textTracks()||[];i<a.length;i++){var r=a[i];if("showing"===r.mode){n=!0,t=r.language;break}}return{enabled:n,language:t}},t.prototype.currentVideoJsQualityLevel=function(){var e=this.player.tech({IWillNotUseThisInPlugins:!0});if((0,S.isNullish)(e))return null;if((0,S.isNullish)(e.vhs)&&(0,S.isNullish)(e.hls))return null;var t=this.getMediaAttributes(e);return t&&t.bitrate?{bitrate:t.bitrate,width:t.width,height:t.height}:null},t.prototype.getMediaAttributes=function(e){var t;if(e&&(e.vhs?t=e.vhs:e.hls&&(t=e.hls),t&&t.playlists&&(0,S.isFunction)(t.playlists.media))){var n=t.playlists.media();if(n){var i=n.attributes;if(i&&0!==Object.keys(i).length)return{bitrate:i.BANDWIDTH,width:(i.RESOLUTION||{}).width,height:(i.RESOLUTION||{}).height,codecs:i.CODECS}}}},t.prototype.getCodecInfo=function(e){var t=this.getMediaAttributes(e);if(t&&t.codecs){var n=t.codecs.split(",");if(n)return{videoCodec:n.find((function(e){return u.isVideoCodec(e)})),audioCodec:n.find((function(e){return u.isAudioCodec(e)}))}}},t}(n(2647).InternalAdapter);function g(e){var t,n=e.currentSrc(),i=(0,p.getStreamTypesFromURL)(n);if((0,S.isNullish)(i)){var a=null===(t=e.currentType)||void 0===t?void 0:t.call(e);a&&(i=(0,p.getStreamTypeFromMIMEType)(a))}return(0,f.buildPlaybackInfoStreamTypeFields)(i,n)}t.VideojsInternalAdapter=T},7596:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsStateMachine=void 0;var a=n(7906),r=n(3458),o=n(2361),s=n(1916),l=n(4649),u=n(5063),c=n(5063),d=[3e3,5e3,1e4,3e4,59700],E=function(){function e(e,t,n){this.stateMachineCallbacks=e,this.onEnterStateTimestamp=0,this.videoStartupTimeoutMs=l.ANALYTICS_VIDEOSTART_TIMEOUT,this.rebufferTimeoutMs=l.ANALYTICS_REBUFFER_TIMEOUT,this.currentRebufferingIntervalIndex=0,this.stateMachine=this.createStateMachine(n),this.playingHeartbeatService=t}return e.prototype.callEvent=function(e,t,n){var i=this.stateMachine[e];if(null!=i)try{i.call(this.stateMachine,n,t)}catch(i){s.logger.error('StateMachine ignored event "'.concat(e,'" call, because it has thrown exception in the current state "').concat(this.currentState,'"'),t,n,i)}else s.logger.warn('StateMachine ignored event "'.concat(e,'" call, because it was not defined'),t,n)},Object.defineProperty(e.prototype,"currentState",{get:function(){return this.stateMachine.current},enumerable:!1,configurable:!0}),e.prototype.resetIntervals=function(){this.clearVideoStartTimeout(),this.clearRebufferingTimeoutHandle(!0),this.clearRebufferingHeartbeatHandle()},e.prototype.startRebufferingHeartbeatInterval=function(e){var t=this;void 0===e&&(e=!0),this.resetRebufferingHelpers(e),this.startRebufferingTimeoutHandle(),this.rebufferingHeartbeatIntervalHandle=setInterval((function(){var e=t.stateMachine.current.toLowerCase();if("rebuffering"===e){var n=(new Date).getTime(),i=n-t.onEnterStateTimestamp;t.stateMachineCallbacks.heartbeat(i,e,{buffered:i}),t.onEnterStateTimestamp=n,t.currentRebufferingIntervalIndex=Math.min(t.currentRebufferingIntervalIndex+1,d.length-1),t.startRebufferingHeartbeatInterval(!1)}else t.resetRebufferingHelpers()}),d[this.currentRebufferingIntervalIndex])},e.prototype.resetRebufferingHelpers=function(e){void 0===e&&(e=!0),e&&(this.currentRebufferingIntervalIndex=0),this.clearRebufferingHeartbeatHandle(),this.clearRebufferingTimeoutHandle(e)},e.prototype.clearRebufferingHeartbeatHandle=function(){(0,c.isNotNullish)(this.rebufferingHeartbeatIntervalHandle)&&(clearInterval(this.rebufferingHeartbeatIntervalHandle),this.rebufferingHeartbeatIntervalHandle=void 0)},e.prototype.startRebufferingTimeoutHandle=function(){var e=this;this.currentRebufferingIntervalIndex>0||(this.rebufferingTimeoutHandle=setTimeout((function(){e.callEvent(o.Event.ERROR,i(i({},r.ErrorCode.BUFFERING_TIMEOUT_REACHED),{data:{additionalData:"StateMachine timed out after ".concat(e.rebufferTimeoutMs," ms of consecutive buffering.")}}),u.getCurrentTimestamp()),e.stateMachineCallbacks.release()}),this.rebufferTimeoutMs))},e.prototype.clearRebufferingTimeoutHandle=function(e){e&&(0,c.isNotNullish)(this.rebufferingTimeoutHandle)&&(clearTimeout(this.rebufferingTimeoutHandle),this.rebufferingTimeoutHandle=void 0)},e.prototype.setVideoStartTimeout=function(){var e=this;(0,c.isNotNullish)(this.videoStartTimeout)&&this.clearVideoStartTimeout(),this.videoStartTimeout=setTimeout((function(){e.callEvent(o.Event.VIDEOSTART_TIMEOUT,{},Date.now()),e.stateMachineCallbacks.release()}),this.videoStartupTimeoutMs)},e.prototype.clearVideoStartTimeout=function(){clearTimeout(this.videoStartTimeout),this.videoStartTimeout=void 0},e.prototype.onHeartbeat=function(e){this.sendPlayingSample(Date.now(),e)},e.prototype.sendPlayingSample=function(e,t,n,i){void 0===n&&(n=!1),void 0===i&&(i=!1);var r=this.stateMachine.current.toLowerCase();if("playing"===r){this.stateMachineCallbacks.setVideoTimeEndFromEvent({currentTime:t});var o=e-this.onEnterStateTimestamp,l={played:o,isProgramChange:!!i||void 0};n&&(l[a.SSAI_RELATED_SAMPLE_MARKER]=!0),this.stateMachineCallbacks.heartbeat(o,r,l),this.resetCurrentStateStart(e,t)}else s.logger.warn('Unexpected call of "sendPlayingSample" in AnalyticsStateMachine from "'.concat(r,'" state'))},e.prototype.resetCurrentStateStart=function(e,t){this.onEnterStateTimestamp=e,this.stateMachineCallbacks.setVideoTimeStartFromEvent({currentTime:t})},e.prototype.programChange=function(e,t,n){if("SETUP"!==this.stateMachine.current&&"READY"!==this.stateMachine.current&&"STARTUP"!==this.stateMachine.current&&"STARTUP_AUTOPLAY"!==this.stateMachine.current){var i=Date.now();"PLAYING"===this.stateMachine.current?this.sendPlayingSample(i,e,t,!0):this.resetCurrentStateStart(i,e),this.stateMachineCallbacks.programChange(n)}else this.stateMachineCallbacks.updateSourceMetadata(n)},e}();t.AnalyticsStateMachine=E},3453:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,a=0,r=t.length;a<r;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.CAFv3AnalyticsStateMachine=t.State=void 0;var o,s=n(2595),l=n(2361),u=n(3565),c=n(1916),d=n(1460),E=n(5063),p=n(7596),v=n(8253);!function(e){e.CUSTOMDATACHANGE="CUSTOMDATACHANGE",e.ERROR="ERROR",e.PAUSE="PAUSE",e.PLAYING="PLAYING",e.READY="READY",e.REBUFFERING="REBUFFERING",e.SEEKING="SEEKING",e.SEEKING_IN_PAUSE="SEEKING_IN_PAUSE",e.SETUP="SETUP",e.SOURCE_CHANGING="SOURCE_CHANGING",e.STARTUP="STARTUP",e.UNLOADED="UNLOADED",e.VIDEOSTART_FAILED="VIDEOSTART_FAILED"}(o||(t.State=o={}));var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.createStateMachine=function(e){var t,n=this;return(0,s.create)({initial:{state:o.SETUP,event:l.JSM_INITIAL_EVENT},error:v.customStateMachineErrorCallback,events:r(r(r(r(r(r(r(r(r(r(r(r(r(r([],(0,v.whileIn)(o.SETUP).passOver(l.Event.START_BUFFERING),!0),[{name:l.Event.SOURCE_LOADED,from:o.SETUP,to:o.READY},{name:l.Event.READY,from:o.SETUP,to:o.READY}],!1),(0,v.whileIn)(o.READY).passOver(l.Event.READY,l.Event.START_BUFFERING,l.Event.END_BUFFERING,l.Event.TIMECHANGED,l.Event.SEEK,l.Event.SEEKED),!0),[{name:l.Event.PLAY,from:o.READY,to:o.STARTUP},{name:l.Event.ERROR,from:o.STARTUP,to:o.VIDEOSTART_FAILED},{name:l.Event.UNLOAD,from:o.STARTUP,to:o.VIDEOSTART_FAILED},{name:l.Event.VIDEOSTART_TIMEOUT,from:o.STARTUP,to:o.VIDEOSTART_FAILED},{name:l.Event.ERROR,from:(0,v.getAllStatesBut)([o.STARTUP],o),to:o.ERROR},{name:l.Event.UNLOAD,from:(0,v.getAllStatesBut)([o.STARTUP],o),to:o.UNLOADED},{name:l.Event.TIMECHANGED,from:o.STARTUP,to:o.PLAYING}],!1),(0,v.whileIn)(o.PLAYING).passOver(l.Event.TIMECHANGED),!0),[{name:l.Event.START_BUFFERING,from:o.PLAYING,to:o.REBUFFERING},{name:l.Event.TIMECHANGED,from:o.REBUFFERING,to:o.PLAYING},{name:l.Event.PAUSE,from:o.PLAYING,to:o.PAUSE},{name:l.Event.PAUSE,from:o.REBUFFERING,to:o.PAUSE},{name:l.Event.PAUSE,from:o.SEEKING,to:o.PAUSE}],!1),(0,v.whileIn)(o.PAUSE).passOver(l.Event.START_BUFFERING,l.Event.END_BUFFERING),!0),[{name:l.Event.PLAYING,from:o.PAUSE,to:o.PLAYING},{name:l.Event.SEEK,from:o.PAUSE,to:o.SEEKING_IN_PAUSE}],!1),(0,v.whileIn)(o.SEEKING_IN_PAUSE).passOver(l.Event.SEEK,l.Event.START_BUFFERING,l.Event.END_BUFFERING,l.Event.TIMECHANGED),!0),[{name:l.Event.SEEKED,from:o.SEEKING_IN_PAUSE,to:o.PAUSE},{name:l.Event.SEEK,from:o.PLAYING,to:o.SEEKING}],!1),(0,v.whileIn)(o.SEEKING).passOver(l.Event.SEEK,l.Event.START_BUFFERING,l.Event.END_BUFFERING,l.Event.TIMECHANGED),!0),[{name:l.Event.SEEKED,from:o.SEEKING,to:o.PLAYING},{name:l.Event.MANUAL_SOURCE_CHANGE,from:(0,v.getAllStatesBut)([o.SETUP],o),to:o.SOURCE_CHANGING}],!1),(0,v.whileIn)(o.SOURCE_CHANGING).passOver(l.Event.START_BUFFERING,l.Event.TIMECHANGED),!0),[{name:l.Event.SOURCE_LOADED,from:o.SOURCE_CHANGING,to:o.READY},{name:l.Event.CUSTOM_DATA_CHANGE,from:[o.PLAYING,o.PAUSE],to:o.CUSTOMDATACHANGE},{name:l.Event.PLAYING,from:o.CUSTOMDATACHANGE,to:o.PLAYING},{name:l.Event.PAUSE,from:o.CUSTOMDATACHANGE,to:o.PAUSE}],!1),callbacks:(t={},t["onleave".concat(o.PLAYING)]=function(){n.playingHeartbeatService.stopHeartbeat()},t["onleave".concat(o.STARTUP)]=function(){n.clearVideoStartTimeout()},t.onleavestate=function(e,t,i,a,r){if((0,v.logStateMachineTransition)("LEAVE",e,t,i),e!==l.JSM_INITIAL_EVENT&&(t===o.REBUFFERING&&n.resetRebufferingHelpers(),a&&t!==o.ERROR&&!(t===o.PAUSE&&i===o.SEEKING_IN_PAUSE||t===o.SEEKING_IN_PAUSE&&i===o.PAUSE))){r&&n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var s=a-n.onEnterStateTimestamp,d=String(t).toLowerCase();if(t!==o.STARTUP||i!==o.VIDEOSTART_FAILED)if(t!==o.SEEKING)if(e!==l.Event.UNLOAD){var p=n.stateMachineCallbacks[d];if((0,E.isFunction)(p))try{p(s,d,r)}catch(e){c.logger.error("Exception occurred in State Machine callback "+d,r,e)}else(0,v.logMissingCallbackWarning)(t,[o.READY,o.SOURCE_CHANGING])}else n.stateMachineCallbacks.unload(s,d);else n.stateMachineCallbacks.seeking(s);else n.stateMachineCallbacks.videoStartFailed(s,(0,u.createVideoStartFailedReason)(e))}},t["onenter".concat(o.PLAYING)]=function(){n.playingHeartbeatService.startHeartbeat()},t["onenter".concat(o.SOURCE_CHANGING)]=function(e,t,i,a,r){n.stateMachineCallbacks.manualSourceChange(r)},t["onenter".concat(o.STARTUP)]=function(){n.setVideoStartTimeout()},t.onenterstate=function(t,i,a,r,s){(0,v.logStateMachineTransition)("ENTER",t,i,a),i===o.PAUSE&&a===o.SEEKING_IN_PAUSE||i===o.SEEKING_IN_PAUSE&&a===o.PAUSE||(n.onEnterStateTimestamp=null!=r?r:Date.now(),(0,d.isNumber)(e.starttime)&&t===l.JSM_INITIAL_EVENT&&(n.onEnterStateTimestamp=e.starttime),s&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(s),a===o.REBUFFERING&&n.startRebufferingHeartbeatInterval())},t["onafter".concat(l.Event.ERROR)]=function(e,t,i,a,r){n.stateMachineCallbacks.error(r)},t)})},t}(p.AnalyticsStateMachine);t.CAFv3AnalyticsStateMachine=h},3674:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,a=0,r=t.length;a<r;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.HTML5AnalyticsStateMachine=void 0;var o,s=n(2595),l=n(2361),u=n(3565),c=n(1916),d=n(1460),E=n(5063),p=n(7596),v=n(8253);!function(e){e.AD="AD",e.AUDIOTRACK_CHANGING="AUDIOTRACK_CHANGING",e.CASTING="CASTING",e.CUSTOMDATACHANGE="CUSTOMDATACHANGE",e.END="END",e.ERROR="ERROR",e.MUTING_PAUSE="MUTING_PAUSE",e.MUTING_PLAY="MUTING_PLAY",e.MUTING_READY="MUTING_READY",e.PAUSE="PAUSE",e.PAUSED_SEEKING="PAUSED_SEEKING",e.PLAYING="PLAYING",e.QUALITY_CHANGE="QUALITY_CHANGE",e.READY="READY",e.REBUFFERING="REBUFFERING",e.SETUP="SETUP",e.SETUP_SOURCE_CHANGE="SETUP_SOURCE_CHANGE",e.SOURCE_CHANGING="SOURCE_CHANGING",e.STARTUP="STARTUP",e.SUBTITLE_CHANGING="SUBTITLE_CHANGING",e.VIDEOSTART_FAILED="VIDEOSTART_FAILED"}(o||(o={}));var h=function(e){function t(t,n,i){var a=e.call(this,t,n,i)||this;return a.createStateMachine(i),a}return a(t,e),t.prototype.getAllStates=function(){return r([],Object.keys(o).map((function(e){return o[e]})),!0)},t.prototype.getAllStatesBut=function(e){return this.getAllStates().filter((function(t){return e.indexOf(t)<0}))},t.prototype.createStateMachine=function(e){var t,n=this;return s.create({initial:{state:o.SETUP,event:l.JSM_INITIAL_EVENT},error:v.customStateMachineErrorCallback,events:r(r(r(r(r(r(r(r(r(r(r(r(r([{name:l.Event.SOURCE_LOADED,from:[o.SETUP,o.SETUP_SOURCE_CHANGE,o.SOURCE_CHANGING],to:o.READY}],(0,v.whileIn)(o.READY).passOver(l.Event.SEEK,l.Event.SEEKED),!0),[(0,v.on)(l.Event.TIMECHANGED).stayIn(o.SETUP),(0,v.on)(l.Event.SOURCE_LOADED).stayIn(o.READY),{name:l.Event.PLAY,from:o.READY,to:o.STARTUP},{name:l.Event.PLAY,from:o.SOURCE_CHANGING,to:o.STARTUP},{name:l.Event.ERROR,from:o.STARTUP,to:o.VIDEOSTART_FAILED},{name:l.Event.UNLOAD,from:o.STARTUP,to:o.VIDEOSTART_FAILED},{name:l.Event.VIDEOSTART_TIMEOUT,from:o.STARTUP,to:o.VIDEOSTART_FAILED}],!1),(0,v.whileIn)(o.STARTUP).passOver(l.Event.SOURCE_LOADED,l.Event.START_BUFFERING,l.Event.END_BUFFERING,l.Event.VIDEO_CHANGE,l.Event.AUDIO_CHANGE,l.Event.SEEK,l.Event.SEEKED),!0),[{name:l.Event.TIMECHANGED,from:o.READY,to:o.STARTUP},{name:l.Event.TIMECHANGED,from:o.STARTUP,to:o.PLAYING}],!1),(0,v.whileIn)(o.PLAYING).passOver(l.Event.TIMECHANGED),!0),[(0,v.on)(l.Event.SEEKED).stayIn(o.PAUSE),(0,v.on)(l.Event.END_BUFFERING).stayIn(o.PLAYING),{name:l.Event.START_BUFFERING,from:o.PLAYING,to:o.REBUFFERING},(0,v.on)(l.Event.START_BUFFERING).stayIn(o.REBUFFERING),{name:l.Event.PLAY,from:o.REBUFFERING,to:o.PLAYING},{name:l.Event.TIMECHANGED,from:o.REBUFFERING,to:o.PLAYING},{name:l.Event.PAUSE,from:o.PLAYING,to:o.PAUSE},{name:l.Event.PAUSE,from:o.REBUFFERING,to:o.PAUSE},{name:l.Event.PLAY,from:o.PAUSE,to:o.PLAYING},{name:l.Event.TIMECHANGED,from:o.PAUSE,to:o.PLAYING},{name:l.Event.VIDEO_CHANGE,from:o.PLAYING,to:o.QUALITY_CHANGE},{name:l.Event.AUDIO_CHANGE,from:o.PLAYING,to:o.QUALITY_CHANGE},{name:l.Event.FINISH_QUALITY_CHANGE,from:o.QUALITY_CHANGE,to:o.PLAYING},{name:l.Event.SEEK,from:o.PAUSE,to:o.PAUSED_SEEKING}],!1),(0,v.whileIn)(o.PAUSED_SEEKING).passOver(l.Event.PLAY,l.Event.SEEK,l.Event.START_BUFFERING,l.Event.END_BUFFERING),!0),[{name:l.Event.SEEKED,from:o.PAUSED_SEEKING,to:o.PAUSE},{name:l.Event.TIMECHANGED,from:o.PAUSED_SEEKING,to:o.PLAYING},{name:l.Event.PAUSE,from:o.PAUSED_SEEKING,to:o.PAUSE},{name:l.Event.END,from:o.PAUSED_SEEKING,to:o.END},{name:l.Event.END,from:o.PLAYING,to:o.END},{name:l.Event.END,from:o.PAUSE,to:o.END}],!1),(0,v.whileIn)(o.END).passOver(l.Event.PAUSE,l.Event.SEEK,l.Event.SEEKED,l.Event.TIMECHANGED,l.Event.END_BUFFERING,l.Event.START_BUFFERING,l.Event.END),!0),(0,v.whileIn)(o.PLAYING).passOver(l.Event.SEEK,l.Event.SEEKED),!0),[{name:l.Event.PLAY,from:o.END,to:o.PLAYING},{name:l.Event.ERROR,from:this.getAllStatesBut([o.STARTUP]),to:o.ERROR},{name:l.Event.PAUSE,from:o.ERROR,to:o.ERROR},{name:l.Event.UNLOAD,from:this.getAllStatesBut([o.STARTUP]),to:o.END},{name:l.Event.SUBTITLE_CHANGE,from:o.PLAYING,to:o.SUBTITLE_CHANGING},(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.PAUSE),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.READY),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.STARTUP),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.REBUFFERING),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.SUBTITLE_CHANGING),{name:l.Event.TIMECHANGED,from:o.SUBTITLE_CHANGING,to:o.PLAYING},{name:l.Event.AUDIOTRACK_CHANGED,from:o.PLAYING,to:o.AUDIOTRACK_CHANGING},(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.PAUSE),(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.READY),(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.STARTUP),(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.REBUFFERING),(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.AUDIOTRACK_CHANGING),{name:l.Event.TIMECHANGED,from:o.AUDIOTRACK_CHANGING,to:o.PLAYING},{name:l.Event.START_AD,from:o.PLAYING,to:o.AD},{name:l.Event.END_AD,from:o.AD,to:o.PLAYING},{name:l.Event.MUTE,from:o.READY,to:o.MUTING_READY},{name:l.Event.UN_MUTE,from:o.READY,to:o.MUTING_READY},{name:"FINISH_MUTING",from:o.MUTING_READY,to:o.READY},{name:l.Event.MUTE,from:o.PLAYING,to:o.MUTING_PLAY},{name:l.Event.UN_MUTE,from:o.PLAYING,to:o.MUTING_PLAY},{name:"FINISH_MUTING",from:o.MUTING_PLAY,to:o.PLAYING},{name:l.Event.MUTE,from:o.PAUSE,to:o.MUTING_PAUSE},{name:l.Event.UN_MUTE,from:o.PAUSE,to:o.MUTING_PAUSE},{name:"FINISH_MUTING",from:o.MUTING_PAUSE,to:o.PAUSE},{name:l.Event.START_CAST,from:[o.READY,o.PAUSE],to:o.CASTING}],!1),(0,v.whileIn)(o.CASTING).passOver(l.Event.PAUSE,l.Event.PLAY,l.Event.TIMECHANGED,l.Event.MUTE,l.Event.SEEK,l.Event.SEEKED),!0),[{name:l.Event.END_CAST,from:o.CASTING,to:o.READY},{name:l.Event.MANUAL_SOURCE_CHANGE,from:o.SETUP,to:o.SETUP_SOURCE_CHANGE},(0,v.on)(l.Event.MANUAL_SOURCE_CHANGE).stayIn(o.SETUP_SOURCE_CHANGE),{name:l.Event.MANUAL_SOURCE_CHANGE,from:this.getAllStatesBut([o.SETUP,o.SETUP_SOURCE_CHANGE]),to:o.SOURCE_CHANGING},{name:l.Event.SOURCE_UNLOADED,from:this.getAllStates(),to:o.SOURCE_CHANGING},(0,v.on)(l.Event.TIMECHANGED).stayIn(o.SOURCE_CHANGING),(0,v.on)(l.Event.PAUSE).stayIn(o.SOURCE_CHANGING),{name:l.Event.CUSTOM_DATA_CHANGE,from:[o.PLAYING,o.PAUSE],to:o.CUSTOMDATACHANGE},{name:l.Event.PLAYING,from:o.CUSTOMDATACHANGE,to:o.PLAYING},{name:l.Event.PAUSE,from:o.CUSTOMDATACHANGE,to:o.PAUSE}],!1),callbacks:(t={},t["onleave".concat(o.PLAYING)]=function(e,t,i,a,r){n.playingHeartbeatService.stopHeartbeat()},t["onleave".concat(o.STARTUP)]=function(e,t,i,a,r){n.clearVideoStartTimeout()},t.onleavestate=function(e,t,i,a,r){if((0,v.logStateMachineTransition)("LEAVE",e,t,i),e!==l.JSM_INITIAL_EVENT&&(t===o.REBUFFERING&&n.resetRebufferingHelpers(),a&&(t!==o.ERROR||e!==l.Event.MANUAL_SOURCE_CHANGE&&e!==l.Event.SOURCE_UNLOADED))){var s=a-n.onEnterStateTimestamp;r&&i!==o.PAUSED_SEEKING&&n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var d=String(t).toLowerCase();if(i===o.VIDEOSTART_FAILED)n.clearVideoStartTimeout(),n.stateMachineCallbacks.videoStartFailed(s,(0,u.createVideoStartFailedReason)(e));else if(t===o.PAUSED_SEEKING)n.stateMachineCallbacks.seeking(s);else if(e===l.Event.UNLOAD)n.stateMachineCallbacks.unload(s,d);else if(t===o.PAUSE&&i!==o.PAUSED_SEEKING)n.stateMachineCallbacks.pause(s,d);else{var p=n.stateMachineCallbacks[d];if((0,E.isFunction)(p))try{p(s,d,r)}catch(e){c.logger.error("Exception occurred in State Machine callback "+d,r,e)}else(0,v.logMissingCallbackWarning)(t,[o.READY,o.SOURCE_CHANGING,o.SETUP_SOURCE_CHANGE])}r&&i!==o.PAUSED_SEEKING&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(r),e===l.Event.MUTE?n.stateMachineCallbacks.mute():e===l.Event.UN_MUTE&&n.stateMachineCallbacks.unMute()}},t["onenter".concat(o.PLAYING)]=function(e,t,i,a,r){n.onEnterStateTimestamp=a,n.playingHeartbeatService.startHeartbeat()},t["onenter".concat(o.SOURCE_CHANGING)]=function(e,t,i,a,r){e===l.Event.MANUAL_SOURCE_CHANGE&&n.stateMachineCallbacks.manualSourceChange(r)},t["onenter".concat(o.STARTUP)]=function(e,t,i,a,r){n.setVideoStartTimeout()},t["onenter".concat(o.QUALITY_CHANGE)]=function(e,t,i,a,r){n.stateMachineCallbacks.qualitychange(r),n.stateMachine[l.Event.FINISH_QUALITY_CHANGE](a)},t.onenterstate=function(t,i,a,r,s){(0,v.logStateMachineTransition)("ENTER",t,i,a),n.onEnterStateTimestamp=null!=r?r:Date.now(),(0,d.isNumber)(e.starttime)&&t===l.JSM_INITIAL_EVENT&&(n.onEnterStateTimestamp=e.starttime),s&&a!==o.PAUSED_SEEKING&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(s),t===l.Event.START_CAST&&a===o.CASTING&&n.stateMachineCallbacks.startCasting(r,s),a===o.REBUFFERING&&n.startRebufferingHeartbeatInterval()},t["onafter".concat(l.Event.ERROR)]=function(e,t,i,a,r){n.stateMachineCallbacks.error(r)},t.onafterevent=function(e,t,i,a,r){i!==o.MUTING_READY&&i!==o.MUTING_PLAY&&i!==o.MUTING_PAUSE||n.stateMachine.FINISH_MUTING(a)},t)})},t}(p.AnalyticsStateMachine);t.HTML5AnalyticsStateMachine=h},655:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.THEOplayerAnalyticsStateMachine=t.State=void 0;var r,o=n(2595),s=n(2361),l=n(3565),u=n(1460),c=n(7596),d=n(8253);!function(e){e.AD_PLAYBACK="AD_PLAYBACK",e.AD_PLAYBACK_IN_STARTUP="AD_PLAYBACK_IN_STARTUP",e.CUSTOMDATACHANGE="CUSTOMDATACHANGE",e.ERROR="ERROR",e.PAUSE="PAUSE",e.PLAYING="PLAYING",e.QUALITY_CHANGE="QUALITY_CHANGE",e.READY="READY",e.REBUFFERING="REBUFFERING",e.SEEKING="SEEKING",e.SETUP="SETUP",e.SOURCE_CHANGING="SOURCE_CHANGING",e.STARTUP="STARTUP",e.UNLOADED="UNLOADED",e.VIDEOSTART_FAILED="VIDEOSTART_FAILED"}(r||(t.State=r={}));var E=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}return a(t,e),t.prototype.createStateMachine=function(e){var t,n=this;return(0,o.create)({initial:{state:r.SETUP,event:s.JSM_INITIAL_EVENT},error:d.customStateMachineErrorCallback,events:[{name:s.Event.READY,from:r.SETUP,to:r.READY},{name:s.Event.PLAY,from:r.READY,to:r.STARTUP},{name:s.Event.PLAYING,from:r.READY,to:r.PLAYING},{name:s.Event.ERROR,from:r.STARTUP,to:r.VIDEOSTART_FAILED},{name:s.Event.MANUAL_SOURCE_CHANGE,from:r.STARTUP,to:r.VIDEOSTART_FAILED},{name:s.Event.VIDEOSTART_TIMEOUT,from:r.STARTUP,to:r.VIDEOSTART_FAILED},{name:s.Event.READY,from:r.VIDEOSTART_FAILED,to:r.READY},{name:s.Event.PAUSE,from:r.STARTUP,to:r.READY},{name:s.Event.PLAYING,from:r.STARTUP,to:r.PLAYING},{name:s.Event.START_AD,from:r.STARTUP,to:r.AD_PLAYBACK_IN_STARTUP},{name:s.Event.END_AD,from:r.AD_PLAYBACK_IN_STARTUP,to:r.STARTUP},{name:s.Event.START_AD,from:(0,d.getAllStatesBut)([r.STARTUP],r),to:r.AD_PLAYBACK},{name:s.Event.END_AD,from:r.AD_PLAYBACK,to:r.PLAYING},{name:s.Event.END,from:r.AD_PLAYBACK,to:r.PAUSE},{name:s.Event.START_BUFFERING,from:r.PLAYING,to:r.REBUFFERING},{name:s.Event.PLAYING,from:r.REBUFFERING,to:r.PLAYING},{name:s.Event.PAUSE,from:r.REBUFFERING,to:r.PAUSE},{name:s.Event.PAUSE,from:r.PLAYING,to:r.PAUSE},{name:s.Event.PLAYING,from:r.PAUSE,to:r.PLAYING},{name:s.Event.PLAY,from:r.PAUSE,to:r.PLAYING},{name:s.Event.SEEK,from:r.PLAYING,to:r.SEEKING},{name:s.Event.PLAYING,from:r.SEEKING,to:r.PLAYING},{name:s.Event.VIDEO_CHANGE,from:r.PLAYING,to:r.QUALITY_CHANGE},{name:s.Event.AUDIO_CHANGE,from:r.PLAYING,to:r.QUALITY_CHANGE},{name:s.Event.FINISH_QUALITY_CHANGE,from:r.QUALITY_CHANGE,to:r.PLAYING},{name:s.Event.MANUAL_SOURCE_CHANGE,from:(0,d.getAllStatesBut)([r.STARTUP],r),to:r.SOURCE_CHANGING},{name:s.Event.READY,from:r.SOURCE_CHANGING,to:r.READY},{name:s.Event.PLAY,from:r.SOURCE_CHANGING,to:r.STARTUP},{name:s.Event.CUSTOM_DATA_CHANGE,from:[r.PLAYING,r.PAUSE],to:r.CUSTOMDATACHANGE},{name:s.Event.PLAYING,from:r.CUSTOMDATACHANGE,to:r.PLAYING},{name:s.Event.PAUSE,from:r.CUSTOMDATACHANGE,to:r.PAUSE},{name:s.Event.ERROR,from:(0,d.getAllStatesBut)([r.STARTUP,r.VIDEOSTART_FAILED],r),to:r.ERROR},{name:s.Event.UNLOAD,from:"*",to:r.UNLOADED}],callbacks:(t={},t["onbefore".concat(s.Event.UNLOAD)]=function(e,t,i,a,o){n.stateMachineCallbacks.setVideoTimeEndFromEvent(o);var s=a-n.onEnterStateTimestamp;return t===r.STARTUP?n.stateMachineCallbacks.videoStartFailed(s,l.VideoStartFailedReason.PAGE_CLOSED):n.stateMachineCallbacks.unload(s,String(t).toLowerCase()),!1},t["onleave".concat(r.AD_PLAYBACK_IN_STARTUP)]=function(e,t,i,a,r){n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var o=a-n.onEnterStateTimestamp;n.stateMachineCallbacks.ad(o,"ad")},t["onleave".concat(r.AD_PLAYBACK)]=function(e,t,i,a,r){n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var o=a-n.onEnterStateTimestamp;n.stateMachineCallbacks.ad(o,"ad")},t["onleave".concat(r.CUSTOMDATACHANGE)]=function(e,t,i,a,r){n.stateMachineCallbacks.customdatachange(void 0,void 0,r)},t["onleave".concat(r.PAUSE)]=function(e,t,i,a,r){n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var o=a-n.onEnterStateTimestamp;n.stateMachineCallbacks.pause(o,"pause")},t["onleave".concat(r.PLAYING)]=function(e,t,i,a,r){n.playingHeartbeatService.stopHeartbeat(),n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var o=a-n.onEnterStateTimestamp;n.stateMachineCallbacks.playing(o,"playing")},t["onleave".concat(r.REBUFFERING)]=function(e,t,i,a,r){n.resetRebufferingHelpers(),n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var o=a-n.onEnterStateTimestamp;n.stateMachineCallbacks.rebuffering(o,"rebuffering")},t["onleave".concat(r.READY)]=function(e,t,i,a,o){if(e===s.Event.PLAYING&&i===r.PLAYING)return n.stateMachineCallbacks.setVideoTimeEndFromEvent(o),void n.stateMachineCallbacks.startup(1,"startup")},t["onleave".concat(r.SEEKING)]=function(e,t,i,a,r){n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var o=a-n.onEnterStateTimestamp;n.stateMachineCallbacks.seeking(o)},t["onleave".concat(r.SETUP)]=function(e,t,i,a,r){n.stateMachineCallbacks.setVideoTimeEndFromEvent(r),n.stateMachineCallbacks.setup(1,"setup")},t["onleave".concat(r.STARTUP)]=function(e,t,i,a,o){if(n.clearVideoStartTimeout(),i!==r.READY&&i!==r.AD_PLAYBACK_IN_STARTUP){n.stateMachineCallbacks.setVideoTimeEndFromEvent(o);var s=a-n.onEnterStateTimestamp;i!==r.VIDEOSTART_FAILED?n.stateMachineCallbacks.startup(s,"startup"):n.stateMachineCallbacks.videoStartFailed(s,(0,l.createVideoStartFailedReason)(e))}},t.onleavestate=function(e,t,n){(0,d.logStateMachineTransition)("LEAVE",e,t,n)},t["onenter".concat(r.PLAYING)]=function(){n.playingHeartbeatService.startHeartbeat()},t["onenter".concat(r.REBUFFERING)]=function(){n.startRebufferingHeartbeatInterval()},t["onenter".concat(r.STARTUP)]=function(){n.setVideoStartTimeout()},t["onenter".concat(r.QUALITY_CHANGE)]=function(e,t,i,a,r){n.stateMachineCallbacks.qualitychange(r),n.stateMachine[s.Event.FINISH_QUALITY_CHANGE](a)},t.onenterstate=function(t,i,a,r,o){(0,d.logStateMachineTransition)("ENTER",t,i,a),n.onEnterStateTimestamp=null!=r?r:Date.now(),(0,u.isNumber)(e.starttime)&&t===s.JSM_INITIAL_EVENT&&(n.onEnterStateTimestamp=e.starttime),n.stateMachineCallbacks.setVideoTimeStartFromEvent(o)},t["onafter".concat(s.Event.MANUAL_SOURCE_CHANGE)]=function(e,t,i,a,r){n.stateMachineCallbacks.manualSourceChange(r)},t["onafter".concat(s.Event.ERROR)]=function(e,t,i,a,r){n.stateMachineCallbacks.error(r)},t)})},t}(c.AnalyticsStateMachine);t.THEOplayerAnalyticsStateMachine=E},5182:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,a=0,r=t.length;a<r;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.VideojsAnalyticsStateMachine=void 0;var o,s=n(2595),l=n(2361),u=n(3565),c=n(1916),d=n(1460),E=n(5063),p=n(7596),v=n(8253);!function(e){e.AD="AD",e.AUDIOTRACK_CHANGED_PLAYING="AUDIOTRACK_CHANGED_PLAYING",e.AUDIOTRACK_CHANGING="AUDIOTRACK_CHANGING",e.CASTING="CASTING",e.CUSTOMDATACHANGE="CUSTOMDATACHANGE",e.END="END",e.END_PLAY_SEEKING="END_PLAY_SEEKING",e.ERROR="ERROR",e.MUTING_PAUSE="MUTING_PAUSE",e.MUTING_PLAY="MUTING_PLAY",e.MUTING_READY="MUTING_READY",e.PAUSE="PAUSE",e.PAUSED_SEEKING="PAUSED_SEEKING",e.PLAY_SEEKING="PLAY_SEEKING",e.PLAYING="PLAYING",e.QUALITY_CHANGE="QUALITY_CHANGE",e.READY="READY",e.REBUFFERING="REBUFFERING",e.SETUP="SETUP",e.SOURCE_CHANGING="SOURCE_CHANGING",e.STARTUP="STARTUP",e.SUBTITLE_CHANGED_PLAYING="SUBTITLE_CHANGED_PLAYING",e.SUBTITLE_CHANGING="SUBTITLE_CHANGING",e.VIDEOSTART_FAILED="VIDEOSTART_FAILED"}(o||(o={}));var h=function(e){function t(t,n,i){var a=e.call(this,t,n,i)||this;return a.seekTimestamp=0,a.seekedTimestamp=0,a}return a(t,e),t.prototype.getAllStates=function(){return r(r([],Object.keys(o).map((function(e){return o[e]})),!0),["FINISH_PLAY_SEEKING","PLAY_SEEK"],!1)},t.prototype.getAllStatesBut=function(e){return this.getAllStates().filter((function(t){return t!==e}))},t.prototype.createStateMachine=function(e){var t,n=this;return s.create({initial:{state:o.SETUP,event:l.JSM_INITIAL_EVENT},error:v.customStateMachineErrorCallback,events:[{name:l.Event.SOURCE_LOADED,from:[o.SETUP,o.ERROR,o.SOURCE_CHANGING],to:o.READY},(0,v.on)(l.Event.TIMECHANGED).stayIn(o.SETUP),(0,v.on)(l.Event.SOURCE_LOADED).stayIn(o.READY),{name:l.Event.READY,from:[o.SETUP,o.ERROR],to:o.READY},{name:l.Event.PLAY,from:o.READY,to:o.STARTUP},{name:l.Event.ERROR,from:o.STARTUP,to:o.VIDEOSTART_FAILED},{name:l.Event.UNLOAD,from:o.STARTUP,to:o.VIDEOSTART_FAILED},{name:l.Event.VIDEOSTART_TIMEOUT,from:o.STARTUP,to:o.VIDEOSTART_FAILED},(0,v.on)(l.Event.START_BUFFERING).stayIn(o.STARTUP),(0,v.on)(l.Event.END_BUFFERING).stayIn(o.STARTUP),{name:l.Event.TIMECHANGED,from:o.STARTUP,to:o.PLAYING},(0,v.on)(l.Event.TIMECHANGED).stayIn(o.PLAYING),(0,v.on)(l.Event.END_BUFFERING).stayIn(o.PLAYING),{name:l.Event.START_BUFFERING,from:o.PLAYING,to:o.REBUFFERING},(0,v.on)(l.Event.START_BUFFERING).stayIn(o.REBUFFERING),{name:l.Event.TIMECHANGED,from:o.REBUFFERING,to:o.PLAYING},(0,v.on)(l.Event.SEEK).stayIn(o.STARTUP),{name:l.Event.SEEK,from:o.PLAYING,to:o.PLAY_SEEKING},(0,v.on)(l.Event.TIMECHANGED).stayIn(o.PLAY_SEEKING),(0,v.on)(l.Event.TIMECHANGED).stayIn(o.PAUSED_SEEKING),{name:l.Event.PAUSE,from:o.PLAYING,to:o.PAUSE},{name:l.Event.PAUSE,from:o.REBUFFERING,to:o.PAUSE},(0,v.on)(l.Event.TIMECHANGED).stayIn(o.PAUSE),{name:l.Event.PLAY,from:o.PAUSE,to:o.PLAYING},{name:l.Event.VIDEO_CHANGE,from:o.PLAYING,to:o.QUALITY_CHANGE},{name:l.Event.AUDIO_CHANGE,from:o.PLAYING,to:o.QUALITY_CHANGE},{name:l.Event.FINISH_QUALITY_CHANGE,from:o.QUALITY_CHANGE,to:o.PLAYING},{name:l.Event.SEEK,from:o.PAUSE,to:o.PAUSED_SEEKING},(0,v.on)(l.Event.SEEK).stayIn(o.PAUSED_SEEKING),(0,v.on)(l.Event.START_BUFFERING).stayIn(o.PAUSED_SEEKING),(0,v.on)(l.Event.END_BUFFERING).stayIn(o.PAUSED_SEEKING),{name:l.Event.SEEKED,from:o.PAUSED_SEEKING,to:o.PAUSE},{name:l.Event.PLAY,from:o.PAUSED_SEEKING,to:o.PLAYING},{name:l.Event.PAUSE,from:o.PAUSED_SEEKING,to:o.PAUSE},{name:"PLAY_SEEK",from:o.PAUSE,to:o.PLAY_SEEKING},{name:"PLAY_SEEK",from:o.PAUSED_SEEKING,to:o.PLAY_SEEKING},(0,v.on)("PLAY_SEEK").stayIn(o.PLAY_SEEKING),(0,v.on)(l.Event.SEEK).stayIn(o.PLAY_SEEKING),(0,v.on)(l.Event.START_BUFFERING).stayIn(o.PLAY_SEEKING),(0,v.on)(l.Event.END_BUFFERING).stayIn(o.PLAY_SEEKING),(0,v.on)(l.Event.SEEKED).stayIn(o.PLAY_SEEKING),{name:l.Event.SEEKED,from:o.PLAY_SEEKING,to:o.END_PLAY_SEEKING},(0,v.on)(l.Event.START_BUFFERING).stayIn(o.END_PLAY_SEEKING),(0,v.on)(l.Event.END_BUFFERING).stayIn(o.END_PLAY_SEEKING),(0,v.on)(l.Event.SEEKED).stayIn(o.END_PLAY_SEEKING),{name:l.Event.TIMECHANGED,from:o.END_PLAY_SEEKING,to:o.PLAYING},{name:l.Event.END,from:o.PLAY_SEEKING,to:o.END},{name:l.Event.END,from:o.PAUSED_SEEKING,to:o.END},{name:l.Event.END,from:o.PLAYING,to:o.END},{name:l.Event.END,from:o.PAUSE,to:o.END},(0,v.on)(l.Event.SEEK).stayIn(o.END),(0,v.on)(l.Event.SEEKED).stayIn(o.END),(0,v.on)(l.Event.TIMECHANGED).stayIn(o.END),(0,v.on)(l.Event.END_BUFFERING).stayIn(o.END),(0,v.on)(l.Event.START_BUFFERING).stayIn(o.END),(0,v.on)(l.Event.END).stayIn(o.END),(0,v.on)(l.Event.SEEKED).stayIn(o.PLAYING),{name:l.Event.PLAY,from:o.END,to:o.PLAYING},{name:l.Event.ERROR,from:this.getAllStatesBut(o.STARTUP),to:o.ERROR},{name:l.Event.PAUSE,from:o.ERROR,to:o.ERROR},{name:l.Event.SEEK,from:o.END_PLAY_SEEKING,to:o.PLAY_SEEKING},{name:"FINISH_PLAY_SEEKING",from:o.END_PLAY_SEEKING,to:o.PLAYING},{name:l.Event.UNLOAD,from:this.getAllStatesBut(o.STARTUP),to:o.END},{name:l.Event.START_AD,from:o.PLAYING,to:o.AD},{name:l.Event.END_AD,from:o.AD,to:o.PLAYING},(0,v.on)(l.Event.MUTE).stayIn(o.SETUP),{name:l.Event.MUTE,from:o.READY,to:o.MUTING_READY},{name:l.Event.UN_MUTE,from:o.READY,to:o.MUTING_READY},{name:"FINISH_MUTING",from:o.MUTING_READY,to:o.READY},{name:l.Event.MUTE,from:o.PLAYING,to:o.MUTING_PLAY},{name:l.Event.UN_MUTE,from:o.PLAYING,to:o.MUTING_PLAY},{name:"FINISH_MUTING",from:o.MUTING_PLAY,to:o.PLAYING},{name:l.Event.MUTE,from:o.PAUSE,to:o.MUTING_PAUSE},{name:l.Event.UN_MUTE,from:o.PAUSE,to:o.MUTING_PAUSE},{name:"FINISH_MUTING",from:o.MUTING_PAUSE,to:o.PAUSE},{name:l.Event.START_CAST,from:[o.READY,o.PAUSE],to:o.CASTING},(0,v.on)(l.Event.PAUSE).stayIn(o.CASTING),(0,v.on)(l.Event.PLAY).stayIn(o.CASTING),(0,v.on)(l.Event.TIMECHANGED).stayIn(o.CASTING),(0,v.on)(l.Event.MUTE).stayIn(o.CASTING),(0,v.on)(l.Event.SEEK).stayIn(o.CASTING),(0,v.on)(l.Event.SEEKED).stayIn(o.CASTING),{name:l.Event.END_CAST,from:o.CASTING,to:o.READY},(0,v.on)(l.Event.SEEK).stayIn(o.READY),(0,v.on)(l.Event.SEEKED).stayIn(o.READY),{name:l.Event.SEEKED,from:o.STARTUP,to:o.STARTUP},{name:l.Event.AUDIOTRACK_CHANGED,from:o.PLAYING,to:o.AUDIOTRACK_CHANGED_PLAYING},{name:"FINISH_AUDIOTRACK_CHANGING",from:o.AUDIOTRACK_CHANGED_PLAYING,to:o.PLAYING},(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.PAUSE),(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.READY),(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.REBUFFERING),(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.END_PLAY_SEEKING),{name:l.Event.AUDIOTRACK_CHANGED,from:o.AUDIOTRACK_CHANGING,to:o.AUDIOTRACK_CHANGING},{name:l.Event.SUBTITLE_CHANGE,from:o.PLAYING,to:o.SUBTITLE_CHANGED_PLAYING},{name:"FINISH_SUBTITLE_CHANGING",from:o.SUBTITLE_CHANGED_PLAYING,to:o.PLAYING},(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.PAUSE),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.READY),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.REBUFFERING),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.END_PLAY_SEEKING),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.SOURCE_CHANGING),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.SUBTITLE_CHANGING),{name:l.Event.MANUAL_SOURCE_CHANGE,from:this.getAllStatesBut(o.READY),to:o.SOURCE_CHANGING},(0,v.on)(l.Event.MANUAL_SOURCE_CHANGE).stayIn(o.READY),(0,v.on)(l.Event.MANUAL_SOURCE_CHANGE).stayIn(o.SETUP),(0,v.on)(l.Event.TIMECHANGED).stayIn(o.SOURCE_CHANGING),{name:l.Event.PLAY,from:o.SOURCE_CHANGING,to:o.STARTUP},(0,v.on)(l.Event.SOURCE_LOADED).stayIn(o.STARTUP),{name:l.Event.CUSTOM_DATA_CHANGE,from:[o.PLAYING,o.PAUSE],to:o.CUSTOMDATACHANGE},{name:l.Event.PLAYING,from:o.CUSTOMDATACHANGE,to:o.PLAYING},{name:l.Event.PAUSE,from:o.CUSTOMDATACHANGE,to:o.PAUSE}],callbacks:(t={},t["onleave".concat(o.PLAYING)]=function(){n.playingHeartbeatService.stopHeartbeat()},t.onleavestate=function(e,t,i,a,r){if((0,v.logStateMachineTransition)("LEAVE",e,t,i),e!==l.JSM_INITIAL_EVENT&&(t===o.REBUFFERING&&n.resetRebufferingHelpers(),a)){var s=a-n.onEnterStateTimestamp;if(r&&i!==o.PAUSED_SEEKING&&i!==o.END_PLAY_SEEKING&&n.stateMachineCallbacks.setVideoTimeEndFromEvent(r),"PLAY_SEEK"===e&&t===o.PAUSE)return!0;t===o.READY&&i===o.STARTUP?n.setVideoStartTimeout():t!==o.STARTUP||i!==o.PLAYING&&i!==o.VIDEOSTART_FAILED||n.clearVideoStartTimeout();var d=String(t).toLowerCase();if(i===o.VIDEOSTART_FAILED)n.clearVideoStartTimeout(),n.stateMachineCallbacks.videoStartFailed(s,(0,u.createVideoStartFailedReason)(e));else if(t===o.PAUSED_SEEKING){var p=a-n.seekTimestamp;n.stateMachineCallbacks.seeking(p)}else if(t===o.END_PLAY_SEEKING){p=n.seekedTimestamp-n.seekTimestamp;n.stateMachineCallbacks.seeking(p)}else if(e===l.Event.UNLOAD)n.stateMachineCallbacks.unload(s,d);else if(t===o.PAUSE&&i!==o.PAUSED_SEEKING)n.stateMachineCallbacks.pause(s,d);else{var h=n.stateMachineCallbacks[d];if((0,E.isFunction)(h))try{h(s,d,r)}catch(e){c.logger.error("Exception occurred in State Machine callback "+d,r,e)}else(0,v.logMissingCallbackWarning)(t,[o.READY,o.SOURCE_CHANGING,o.MUTING_PAUSE,o.MUTING_PLAY,o.AUDIOTRACK_CHANGED_PLAYING,o.SUBTITLE_CHANGED_PLAYING])}r&&i!==o.PAUSED_SEEKING&&i!==o.PLAY_SEEKING&&i!==o.END_PLAY_SEEKING&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(r),e===l.Event.MUTE?n.stateMachineCallbacks.mute():e===l.Event.UN_MUTE?n.stateMachineCallbacks.unMute():e===l.Event.MANUAL_SOURCE_CHANGE&&n.stateMachineCallbacks.manualSourceChange(r)}},t["onenter".concat(o.PLAYING)]=function(){n.playingHeartbeatService.startHeartbeat()},t["onenter".concat(o.QUALITY_CHANGE)]=function(e,t,i,a,r){n.stateMachineCallbacks.qualitychange(r),n.stateMachine[l.Event.FINISH_QUALITY_CHANGE](a)},t.onenterstate=function(t,i,a,r,s){(0,v.logStateMachineTransition)("ENTER",t,i,a),n.onEnterStateTimestamp=null!=r?r:Date.now(),(0,d.isNumber)(e.starttime)&&t===l.JSM_INITIAL_EVENT&&(n.onEnterStateTimestamp=e.starttime),s&&a!==o.PAUSED_SEEKING&&a!==o.PLAY_SEEKING&&a!==o.END_PLAY_SEEKING&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(s),t===l.Event.SEEK&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(s),t===l.Event.SEEKED&&n.stateMachineCallbacks.setVideoTimeEndFromEvent(s),"PLAY_SEEK"===t&&a===o.PLAY_SEEKING&&a!==o.PLAY_SEEKING&&a!==o.END_PLAY_SEEKING&&(n.seekTimestamp=n.onEnterStateTimestamp),t===l.Event.START_CAST&&a===o.CASTING&&n.stateMachineCallbacks.startCasting(r,s),a===o.REBUFFERING&&n.startRebufferingHeartbeatInterval()},t["onafter".concat(l.Event.ERROR)]=function(e,t,i,a,r){n.stateMachineCallbacks.error(r)},t["onafter".concat(l.Event.SEEK)]=function(e,t,i,a,r){n.seekTimestamp=a},t["onafter".concat(l.Event.SEEKED)]=function(e,t,i,a,r){n.seekedTimestamp=a},t.onafterevent=function(e,t,i,a,r){i!==o.MUTING_READY&&i!==o.MUTING_PLAY&&i!==o.MUTING_PAUSE||n.stateMachine.FINISH_MUTING(a),i===o.AUDIOTRACK_CHANGED_PLAYING&&n.stateMachine.FINISH_AUDIOTRACK_CHANGING(a),i===o.SUBTITLE_CHANGED_PLAYING&&n.stateMachine.FINISH_SUBTITLE_CHANGING(a)},t)})},t}(p.AnalyticsStateMachine);t.VideojsAnalyticsStateMachine=h},5611:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AmazonIVSStateMachine=void 0;var r,o=n(2595),s=n(2361),l=n(3565),u=n(1460),c=n(5063),d=n(7596),E=n(8253);!function(e){e.ERROR="ERROR",e.PAUSE="PAUSE",e.PLAYING="PLAYING",e.QUALITY_CHANGE="QUALITY_CHANGE",e.READY="READY",e.REBUFFERING="REBUFFERING",e.SEEKING="SEEKING",e.SETUP="SETUP",e.STARTUP="STARTUP",e.UNLOADED="UNLOADED",e.VIDEOSTART_FAILED="VIDEOSTART_FAILED"}(r||(r={}));var p=function(e){function t(t,n,i){var a=e.call(this,t,n,i)||this;return a.getStateHandler=function(){var e;return(e={})[r.SETUP]={onenterstate:function(){},onleavestate:function(e){a.stateMachineCallbacks.setup(e,r.SETUP.toLowerCase())}},e[r.READY]={onenterstate:function(){},onleavestate:function(){}},e[r.STARTUP]={onenterstate:function(){a.setVideoStartTimeout()},onleavestate:function(e,t,n){a.clearVideoStartTimeout(),t==r.PLAYING&&a.stateMachineCallbacks.startup(e,r.STARTUP.toLowerCase()),t==r.VIDEOSTART_FAILED&&a.stateMachineCallbacks.videoStartFailed(e,(0,l.createVideoStartFailedReason)(n))}},e[r.PLAYING]={onenterstate:function(){a.playingHeartbeatService.startHeartbeat()},onleavestate:function(e){a.playingHeartbeatService.stopHeartbeat(),a.stateMachineCallbacks.playing(e,r.PLAYING.toLowerCase())}},e[r.PAUSE]={onenterstate:function(){},onleavestate:function(e){a.stateMachineCallbacks.pause(e,r.PAUSE.toLowerCase())}},e[r.REBUFFERING]={onenterstate:function(){a.startRebufferingHeartbeatInterval()},onleavestate:function(e){a.resetRebufferingHelpers(),a.stateMachineCallbacks.rebuffering(e,r.REBUFFERING.toLowerCase())}},e[r.VIDEOSTART_FAILED]={onenterstate:function(e,t){e===s.Event.ERROR&&a.stateMachineCallbacks.error(t)},onleavestate:function(){}},e[r.ERROR]={onenterstate:function(e,t){a.stateMachineCallbacks.error(t)},onleavestate:function(){}},e[r.UNLOADED]={onenterstate:function(){a.stateMachineCallbacks.unload(0,r.UNLOADED)},onleavestate:function(){}},e[r.QUALITY_CHANGE]={onenterstate:function(e,t){a.stateMachineCallbacks.qualitychange(t),a.stateMachine[s.Event.FINISH_QUALITY_CHANGE](a.onEnterStateTimestamp)},onleavestate:function(){}},e[r.SEEKING]={onenterstate:function(){},onleavestate:function(e){a.stateMachineCallbacks.seeking(e)}},e},a}return a(t,e),t.prototype.createStateMachine=function(e){var t=this;return o.StateMachine.create({initial:{state:r.SETUP,event:s.JSM_INITIAL_EVENT},error:E.customStateMachineErrorCallback,events:[{name:s.Event.READY,from:r.SETUP,to:r.READY},{name:s.Event.PLAY,from:r.READY,to:r.STARTUP},{name:s.Event.PLAYING,from:r.STARTUP,to:r.PLAYING},{name:s.Event.PAUSE,from:r.PLAYING,to:r.PAUSE},{name:s.Event.PLAYING,from:r.PAUSE,to:r.PLAYING},{name:s.Event.PLAY,from:r.PAUSE,to:r.PLAYING},{name:s.Event.UNLOAD,from:r.PLAYING,to:r.UNLOADED},{name:s.Event.PLAYING,from:r.ERROR,to:r.PLAYING},{name:s.Event.VIDEO_CHANGE,from:r.PLAYING,to:r.QUALITY_CHANGE},{name:s.Event.FINISH_QUALITY_CHANGE,from:r.QUALITY_CHANGE,to:r.PLAYING},{name:s.Event.SEEK,from:r.PLAYING,to:r.SEEKING},{name:s.Event.SEEKED,from:r.SEEKING,to:r.PLAYING},{name:s.Event.PAUSE,from:r.SEEKING,to:r.PAUSE},{name:s.Event.START_BUFFERING,from:r.PLAYING,to:r.REBUFFERING},{name:s.Event.PLAYING,from:r.REBUFFERING,to:r.PLAYING},{name:s.Event.ERROR,from:r.STARTUP,to:r.VIDEOSTART_FAILED},{name:s.Event.UNLOAD,from:r.STARTUP,to:r.VIDEOSTART_FAILED},{name:s.Event.VIDEOSTART_TIMEOUT,from:r.STARTUP,to:r.VIDEOSTART_FAILED},{name:s.Event.ERROR,from:v([r.STARTUP,r.VIDEOSTART_FAILED]),to:r.ERROR},(0,E.on)(s.Event.PAUSE).stayIn(r.PAUSE),(0,E.on)(s.Event.PAUSE).stayIn(r.STARTUP),(0,E.on)(s.Event.PAUSE).stayIn(r.REBUFFERING),(0,E.on)(s.Event.PLAY).stayIn(r.PLAYING),(0,E.on)(s.Event.PLAYING).stayIn(r.PLAYING),(0,E.on)(s.Event.START_BUFFERING).stayIn(r.PAUSE),(0,E.on)(s.Event.START_BUFFERING).stayIn(r.REBUFFERING),(0,E.on)(s.Event.VIDEOSTART_TIMEOUT).stayIn(r.PLAYING),(0,E.on)(s.Event.VIDEOSTART_TIMEOUT).stayIn(r.PAUSE),(0,E.on)(s.Event.VIDEOSTART_TIMEOUT).stayIn(r.SEEKING),(0,E.on)(s.Event.UNLOAD).stayIn(r.READY),(0,E.on)(s.Event.UNLOAD).stayIn(r.SEEKING),(0,E.on)(s.Event.VIDEO_CHANGE).stayIn(r.QUALITY_CHANGE),(0,E.on)(s.Event.VIDEO_CHANGE).stayIn(r.STARTUP),(0,E.on)(s.Event.VIDEO_CHANGE).stayIn(r.REBUFFERING),(0,E.on)(s.Event.VIDEO_CHANGE).stayIn(r.PAUSE),(0,E.on)(s.Event.VIDEO_CHANGE).stayIn(r.ERROR),(0,E.on)(s.Event.VIDEO_CHANGE).stayIn(r.VIDEOSTART_FAILED),(0,E.on)(s.Event.VIDEO_CHANGE).stayIn(r.READY),(0,E.on)(s.Event.VIDEO_CHANGE).stayIn(r.SEEKING),(0,E.on)(s.Event.SEEK).stayIn(r.SEEKING),(0,E.on)(s.Event.SEEK).stayIn(r.PAUSE),(0,E.on)(s.Event.SEEK).stayIn(r.QUALITY_CHANGE),(0,E.on)(s.Event.SEEK).stayIn(r.REBUFFERING),(0,E.on)(s.Event.SEEK).stayIn(r.ERROR),(0,E.on)(s.Event.SEEK).stayIn(r.STARTUP),(0,E.on)(s.Event.SEEK).stayIn(r.READY),(0,E.on)(s.Event.SEEK).stayIn(r.VIDEOSTART_FAILED),(0,E.on)(s.Event.SEEKED).stayIn(r.PAUSE),(0,E.on)(s.Event.SEEKED).stayIn(r.QUALITY_CHANGE),(0,E.on)(s.Event.SEEKED).stayIn(r.REBUFFERING),(0,E.on)(s.Event.SEEKED).stayIn(r.ERROR),(0,E.on)(s.Event.SEEKED).stayIn(r.STARTUP),(0,E.on)(s.Event.SEEKED).stayIn(r.READY),(0,E.on)(s.Event.SEEKED).stayIn(r.VIDEOSTART_FAILED)],callbacks:{onleavestate:function(e,n,i,a,r){if(!((0,c.isNullish)(e)||(0,c.isNullish)(n)||(0,c.isNullish)(i))&&((0,E.logStateMachineTransition)("LEAVE",e,n,i),e!==s.JSM_INITIAL_EVENT&&a)){r&&t.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var o=a-t.onEnterStateTimestamp;t.getStateHandler()[n].onleavestate(o,i,e)}},onenterstate:function(n,i,a,r,o){(0,c.isNullish)(n)||(0,c.isNullish)(i)||(0,c.isNullish)(a)||((0,E.logStateMachineTransition)("ENTER",n,i,a),t.onEnterStateTimestamp=null!=r?r:Date.now(),(0,u.isNumber)(e.starttime)&&n===s.JSM_INITIAL_EVENT&&(t.onEnterStateTimestamp=e.starttime),o&&t.stateMachineCallbacks.setVideoTimeStartFromEvent(o),t.getStateHandler()[a].onenterstate(n,o))}}})},t}(d.AnalyticsStateMachine);t.AmazonIVSStateMachine=p;var v=function(e){return h().filter((function(t){return e.indexOf(t)<0}))},h=function(){return Object.keys(r).map((function(e){return r[e]}))}},2403:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,a=0,r=t.length;a<r;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Bitmovin8AnalyticsStateMachine=void 0;var o,s,l=n(2595),u=n(2361),c=n(3565),d=n(1652),E=n(1916),p=n(1460),v=n(5063),h=n(7596),f=n(8253);!function(e){e.AD_PAUSE="AD_PAUSE",e.AD_PLAYING="AD_PLAYING",e.AD_READY="AD_READY",e.AD_STARTUP="AD_STARTUP",e.AUDIOTRACK_CHANGING="AUDIOTRACK_CHANGING",e.CASTING="CASTING",e.CUSTOMDATACHANGE="CUSTOMDATACHANGE",e.END="END",e.END_PLAY_SEEKING="END_PLAY_SEEKING",e.ERROR="ERROR",e.INITIAL_SOURCE_CHANGE="INITIAL_SOURCE_CHANGE",e.MUTING_PAUSE="MUTING_PAUSE",e.MUTING_PLAY="MUTING_PLAY",e.MUTING_READY="MUTING_READY",e.PAUSE="PAUSE",e.PLAY_SEEKING="PLAY_SEEKING",e.PLAYING="PLAYING",e.QUALITY_CHANGE="QUALITY_CHANGE",e.READY="READY",e.REBUFFERING="REBUFFERING",e.SETUP="SETUP",e.SOURCE_CHANGING="SOURCE_CHANGING",e.STARTUP="STARTUP",e.STARTUP_AUTOPLAY="STARTUP_AUTOPLAY",e.SUBTITLE_CHANGING="SUBTITLE_CHANGING",e.VIDEOSTART_FAILED="VIDEOSTART_FAILED"}(o||(o={})),function(e){e.PAUSE_AFTER_SOURCE_LOADED="PAUSE_AFTER_SOURCE_LOADED",e.PAUSE_BEFORE_SOURCE_LOADED="PAUSE_BEFORE_SOURCE_LOADED"}(s||(s={}));var m=function(e){function t(t,n,i){var a=e.call(this,t,n,i)||this;return a.debuggingStates=[],a.enabledDebugging=!1,a.sourceLoadedDuringAutoplayStartup=!1,a}return a(t,e),t.prototype.getAllStatesBut=function(e){return this.getAllStates().filter((function(t){return e.indexOf(t)<0}))},t.prototype.getAllStates=function(){return Object.keys(o).map((function(e){return o[e]}))},t.prototype.createStateMachine=function(e){var t,n=this;return l.create({initial:{state:o.SETUP,event:u.JSM_INITIAL_EVENT},error:f.customStateMachineErrorCallback,events:r(r([{name:u.Event.SOURCE_LOADED,from:[o.SETUP,o.ERROR,o.SOURCE_CHANGING,o.INITIAL_SOURCE_CHANGE],to:o.READY},{name:u.Event.PLAY,from:o.READY,to:o.STARTUP},{name:u.Event.PLAYING,from:o.READY,to:o.PLAYING},(0,f.on)(u.Event.READY).stayIn(o.READY),{name:u.Event.ERROR,from:[o.STARTUP,o.AD_STARTUP,o.STARTUP_AUTOPLAY],to:o.VIDEOSTART_FAILED},{name:u.Event.UNLOAD,from:[o.STARTUP,o.AD_STARTUP,o.STARTUP_AUTOPLAY],to:o.VIDEOSTART_FAILED},{name:u.Event.VIDEOSTART_TIMEOUT,from:[o.STARTUP,o.STARTUP_AUTOPLAY],to:o.VIDEOSTART_FAILED},{name:u.Event.SOURCE_UNLOADED,from:[o.STARTUP,o.STARTUP_AUTOPLAY],to:o.VIDEOSTART_FAILED},{name:u.Event.MANUAL_SOURCE_CHANGE,from:[o.STARTUP,o.STARTUP_AUTOPLAY],to:o.VIDEOSTART_FAILED},{name:u.Event.TIMECHANGED,from:[o.STARTUP,o.STARTUP_AUTOPLAY],to:o.PLAYING},(0,f.on)(u.Event.PLAY).stayIn(o.STARTUP),(0,f.on)(u.Event.PLAYING).stayIn(o.STARTUP),(0,f.on)(u.Event.START_BUFFERING).stayIn(o.STARTUP),(0,f.on)(u.Event.END_BUFFERING).stayIn(o.STARTUP),(0,f.on)(u.Event.VIDEO_CHANGE).stayIn(o.STARTUP),(0,f.on)(u.Event.AUDIO_CHANGE).stayIn(o.STARTUP),(0,f.on)(u.Event.READY).stayIn(o.STARTUP),{name:u.Event.PAUSE,from:o.STARTUP,to:o.READY},{name:u.Event.LOADSTART_AUTOPLAY,from:[o.SETUP,o.SOURCE_CHANGING,o.INITIAL_SOURCE_CHANGE],to:o.STARTUP_AUTOPLAY},{name:s.PAUSE_BEFORE_SOURCE_LOADED,from:o.STARTUP_AUTOPLAY,to:o.INITIAL_SOURCE_CHANGE},{name:s.PAUSE_AFTER_SOURCE_LOADED,from:o.STARTUP_AUTOPLAY,to:o.READY}],(0,f.whileIn)(o.STARTUP_AUTOPLAY).passOver(u.Event.PAUSE,u.Event.SOURCE_LOADED),!0),[(0,f.on)(u.Event.PLAYING).stayIn(o.PLAYING),(0,f.on)(u.Event.TIMECHANGED).stayIn(o.PLAYING),(0,f.on)(u.Event.END_BUFFERING).stayIn(o.PLAYING),{name:u.Event.START_BUFFERING,from:o.PLAYING,to:o.REBUFFERING},{name:u.Event.END_BUFFERING,from:o.REBUFFERING,to:o.PLAYING},(0,f.on)(u.Event.TIMECHANGED).stayIn(o.REBUFFERING),{name:u.Event.PAUSE,from:o.PLAYING,to:o.PAUSE},{name:u.Event.PAUSE,from:o.REBUFFERING,to:o.PAUSE},{name:u.Event.PLAY,from:o.PAUSE,to:o.PLAYING},{name:u.Event.VIDEO_CHANGE,from:o.PLAYING,to:o.QUALITY_CHANGE},{name:u.Event.AUDIO_CHANGE,from:o.PLAYING,to:o.QUALITY_CHANGE},{name:u.Event.FINISH_QUALITY_CHANGE,from:o.QUALITY_CHANGE,to:o.PLAYING},{name:u.Event.SEEK,from:o.PLAYING,to:o.PLAY_SEEKING},{name:u.Event.PLAY,from:o.PLAY_SEEKING,to:o.END_PLAY_SEEKING},{name:u.Event.PLAYING,from:o.PLAY_SEEKING,to:o.END_PLAY_SEEKING},{name:u.Event.SEEKED,from:o.PLAY_SEEKING,to:o.END_PLAY_SEEKING},{name:u.Event.SEEK,from:o.END_PLAY_SEEKING,to:o.PLAY_SEEKING},{name:u.Event.PLAYING,from:o.END_PLAY_SEEKING,to:o.PLAYING},{name:u.Event.TIMECHANGED,from:o.END_PLAY_SEEKING,to:o.PLAYING},{name:u.Event.PAUSE,from:[o.PLAY_SEEKING,o.END_PLAY_SEEKING],to:o.PAUSE},(0,f.on)(u.Event.SEEK).stayIn(o.PLAY_SEEKING),(0,f.on)(u.Event.START_BUFFERING).stayIn(o.PLAY_SEEKING),(0,f.on)(u.Event.END_BUFFERING).stayIn(o.PLAY_SEEKING),(0,f.on)(u.Event.START_BUFFERING).stayIn(o.END_PLAY_SEEKING),(0,f.on)(u.Event.END_BUFFERING).stayIn(o.END_PLAY_SEEKING),(0,f.on)(u.Event.SEEKED).stayIn(o.END_PLAY_SEEKING),(0,f.on)(u.Event.PLAY).stayIn(o.END_PLAY_SEEKING),(0,f.on)(u.Event.SEEK).stayIn(o.PAUSE),(0,f.on)(u.Event.SEEKED).stayIn(o.PAUSE),(0,f.on)(u.Event.SEEKED).stayIn(o.PLAYING),{name:u.Event.END,from:o.PLAY_SEEKING,to:o.END},{name:u.Event.END,from:o.PLAYING,to:o.END},{name:u.Event.END,from:o.PAUSE,to:o.END},(0,f.on)(u.Event.SEEK).stayIn(o.END),(0,f.on)(u.Event.SEEKED).stayIn(o.END),(0,f.on)(u.Event.TIMECHANGED).stayIn(o.END),(0,f.on)(u.Event.END_BUFFERING).stayIn(o.END),(0,f.on)(u.Event.START_BUFFERING).stayIn(o.END),(0,f.on)(u.Event.END).stayIn(o.END),{name:u.Event.PLAY,from:o.END,to:o.STARTUP},{name:u.Event.ERROR,from:this.getAllStatesBut([o.STARTUP,o.STARTUP_AUTOPLAY]),to:o.ERROR},{name:u.Event.UNLOAD,from:this.getAllStatesBut([o.STARTUP,o.STARTUP_AUTOPLAY,o.AD_STARTUP]),to:o.END},{name:u.Event.SUBTITLE_CHANGE,from:o.PLAYING,to:o.SUBTITLE_CHANGING},(0,f.on)(u.Event.SUBTITLE_CHANGE).stayIn(o.PAUSE),(0,f.on)(u.Event.SUBTITLE_CHANGE).stayIn(o.REBUFFERING),(0,f.on)(u.Event.SUBTITLE_CHANGE).stayIn(o.END_PLAY_SEEKING),(0,f.on)(u.Event.SUBTITLE_CHANGE).stayIn(o.SUBTITLE_CHANGING),{name:u.Event.TIMECHANGED,from:o.SUBTITLE_CHANGING,to:o.PLAYING},{name:u.Event.AUDIOTRACK_CHANGED,from:o.PLAYING,to:o.AUDIOTRACK_CHANGING},(0,f.on)(u.Event.AUDIOTRACK_CHANGED).stayIn(o.PAUSE),(0,f.on)(u.Event.AUDIOTRACK_CHANGED).stayIn(o.REBUFFERING),(0,f.on)(u.Event.AUDIOTRACK_CHANGED).stayIn(o.END_PLAY_SEEKING),(0,f.on)(u.Event.AUDIOTRACK_CHANGED).stayIn(o.AUDIOTRACK_CHANGING),{name:u.Event.TIMECHANGED,from:o.AUDIOTRACK_CHANGING,to:o.PLAYING},{name:u.Event.START_AD,from:o.STARTUP,to:o.AD_STARTUP},{name:u.Event.END_AD,from:o.AD_STARTUP,to:o.STARTUP},(0,f.on)(u.Event.PLAY).stayIn(o.AD_STARTUP),(0,f.on)(u.Event.PAUSE).stayIn(o.AD_STARTUP),{name:u.Event.START_AD,from:o.READY,to:o.AD_READY},{name:u.Event.END_AD,from:o.AD_READY,to:o.STARTUP},(0,f.on)(u.Event.PLAY).stayIn(o.AD_READY),(0,f.on)(u.Event.PAUSE).stayIn(o.AD_READY),{name:u.Event.START_AD,from:o.PAUSE,to:o.AD_PAUSE},{name:u.Event.END_AD,from:o.AD_PAUSE,to:o.PAUSE},(0,f.on)(u.Event.PLAY).stayIn(o.AD_PAUSE),(0,f.on)(u.Event.PAUSE).stayIn(o.AD_PAUSE),{name:u.Event.START_AD,from:o.PLAYING,to:o.AD_PLAYING},{name:u.Event.END_AD,from:o.AD_PLAYING,to:o.PLAYING},(0,f.on)(u.Event.PLAY).stayIn(o.AD_PLAYING),(0,f.on)(u.Event.PAUSE).stayIn(o.AD_PLAYING),{name:u.Event.END,from:o.AD_PLAYING,to:o.END},(0,f.on)(u.Event.TIMECHANGED).stayIn(o.AD_STARTUP),(0,f.on)(u.Event.TIMECHANGED).stayIn(o.AD_READY),(0,f.on)(u.Event.TIMECHANGED).stayIn(o.AD_PAUSE),(0,f.on)(u.Event.TIMECHANGED).stayIn(o.AD_PLAYING),(0,f.on)(u.Event.END_AD).stayIn(o.PLAYING),(0,f.on)(u.Event.END_AD).stayIn(o.PAUSE),(0,f.on)(u.Event.END_AD).stayIn(o.READY),(0,f.on)(u.Event.END_AD).stayIn(o.STARTUP),{name:u.Event.MUTE,from:o.READY,to:o.MUTING_READY},{name:u.Event.UN_MUTE,from:o.READY,to:o.MUTING_READY},{name:"FINISH_MUTING",from:o.MUTING_READY,to:o.READY},{name:u.Event.MUTE,from:o.PLAYING,to:o.MUTING_PLAY},{name:u.Event.UN_MUTE,from:o.PLAYING,to:o.MUTING_PLAY},{name:"FINISH_MUTING",from:o.MUTING_PLAY,to:o.PLAYING},{name:u.Event.MUTE,from:o.PAUSE,to:o.MUTING_PAUSE},{name:u.Event.UN_MUTE,from:o.PAUSE,to:o.MUTING_PAUSE},{name:"FINISH_MUTING",from:o.MUTING_PAUSE,to:o.PAUSE},{name:u.Event.START_CAST,from:[o.READY,o.PAUSE,o.PLAYING],to:o.CASTING},(0,f.on)(u.Event.PAUSE).stayIn(o.CASTING),(0,f.on)(u.Event.PLAY).stayIn(o.CASTING),(0,f.on)(u.Event.PLAYING).stayIn(o.CASTING),(0,f.on)(u.Event.TIMECHANGED).stayIn(o.CASTING),(0,f.on)(u.Event.MUTE).stayIn(o.CASTING),(0,f.on)(u.Event.UN_MUTE).stayIn(o.CASTING),(0,f.on)(u.Event.SEEK).stayIn(o.CASTING),(0,f.on)(u.Event.SEEKED).stayIn(o.CASTING),{name:u.Event.END_CAST,from:o.CASTING,to:o.READY},(0,f.on)(u.Event.SEEK).stayIn(o.READY),(0,f.on)(u.Event.SEEKED).stayIn(o.READY),(0,f.on)(u.Event.SEEKED).stayIn(o.STARTUP),{name:u.Event.MANUAL_SOURCE_CHANGE,from:this.getAllStatesBut([o.SETUP,o.STARTUP,o.STARTUP_AUTOPLAY]),to:o.SOURCE_CHANGING},{name:u.Event.MANUAL_SOURCE_CHANGE,from:o.SETUP,to:o.INITIAL_SOURCE_CHANGE},{name:u.Event.SOURCE_UNLOADED,from:this.getAllStatesBut([o.STARTUP,o.STARTUP_AUTOPLAY]),to:o.SOURCE_CHANGING},{name:u.Event.CUSTOM_DATA_CHANGE,from:[o.PLAYING,o.PAUSE],to:o.CUSTOMDATACHANGE},{name:u.Event.PLAYING,from:o.CUSTOMDATACHANGE,to:o.PLAYING},{name:u.Event.PAUSE,from:o.CUSTOMDATACHANGE,to:o.PAUSE}],!1),callbacks:(t={},t["onbefore".concat(u.Event.SOURCE_LOADED)]=function(e,t,i,a,r){t===o.STARTUP_AUTOPLAY&&(n.sourceLoadedDuringAutoplayStartup=!0)},t["onbefore".concat(u.Event.SOURCE_UNLOADED)]=function(e,t,i,a,r){return!(t===o.STARTUP_AUTOPLAY&&!n.sourceLoadedDuringAutoplayStartup)},t["onbefore".concat(u.Event.PAUSE)]=function(e,t,i,a,r){return t!==o.STARTUP_AUTOPLAY||(n.sourceLoadedDuringAutoplayStartup?n.stateMachine[s.PAUSE_AFTER_SOURCE_LOADED](a,r):n.stateMachine[s.PAUSE_BEFORE_SOURCE_LOADED](a,r),!1)},t["onleave".concat(o.END_PLAY_SEEKING)]=function(e,t,i,a,r){var s;if(i!==o.PLAY_SEEKING){var l=a-(null!==(s=n.seekStartTimestamp)&&void 0!==s?s:a);n.seekStartTimestamp=void 0,n.stateMachineCallbacks.setVideoTimeEndFromEvent(r),n.stateMachineCallbacks.seeking(l)}},t["onleave".concat(o.PLAYING)]=function(){n.playingHeartbeatService.stopHeartbeat()},t["onleave".concat(o.STARTUP_AUTOPLAY)]=function(){n.sourceLoadedDuringAutoplayStartup=!1,n.clearVideoStartTimeout()},t["onleave".concat(o.PLAY_SEEKING)]=function(e,t,i,a,r){var s;if(i!==o.END_PLAY_SEEKING){var l=a-(null!==(s=n.seekStartTimestamp)&&void 0!==s?s:a);n.seekStartTimestamp=void 0,n.stateMachineCallbacks.seeking(l)}},t.onleavestate=function(e,t,i,a,r){if((0,f.logStateMachineTransition)("LEAVE",e,t,i),e!==u.JSM_INITIAL_EVENT&&(t===o.REBUFFERING&&n.resetRebufferingHelpers(),a)){n.addStatesToLog(e,t,i,a,r);var l=a-n.onEnterStateTimestamp;r&&i!==o.END_PLAY_SEEKING&&n.stateMachineCallbacks.setVideoTimeEndFromEvent(r),r&&e!==u.Event.END_AD&&(n.lastTrackedVideoEndObject=r),t!==o.READY&&t!==o.AD_STARTUP||i!==o.STARTUP?t!==o.STARTUP||i!==o.PLAYING&&i!==o.AD_STARTUP||n.clearVideoStartTimeout():n.setVideoStartTimeout();var d=String(t).toLowerCase();if(i===o.VIDEOSTART_FAILED)n.clearVideoStartTimeout(),n.stateMachineCallbacks.videoStartFailed(l,(0,c.createVideoStartFailedReason)(e));else if(t===o.END_PLAY_SEEKING)(0,v.noOp)();else if(e===u.Event.UNLOAD)n.stateMachineCallbacks.unload(l,d);else if(t===o.AD_PAUSE||t===o.AD_READY||t===o.AD_PLAYING||t===o.AD_STARTUP)(0,v.isNotNullish)(n.lastTrackedVideoEndObject)&&(n.stateMachineCallbacks.setVideoTimeStartFromEvent(n.lastTrackedVideoEndObject),n.stateMachineCallbacks.setVideoTimeEndFromEvent(n.lastTrackedVideoEndObject)),n.stateMachineCallbacks.ad(l,"ad");else if(e===u.Event.START_AD&&t===o.STARTUP)(0,v.noOp)();else if(e===u.Event.SOURCE_LOADED&&t===o.INITIAL_SOURCE_CHANGE)(0,v.noOp)();else if(t===o.SETUP)n.stateMachineCallbacks.setup(1,o.SETUP.toLowerCase());else if(e===u.Event.PAUSE&&t===o.STARTUP&&i===o.READY||e===s.PAUSE_BEFORE_SOURCE_LOADED&&t===o.STARTUP_AUTOPLAY&&i===o.INITIAL_SOURCE_CHANGE||e===s.PAUSE_AFTER_SOURCE_LOADED&&t===o.STARTUP_AUTOPLAY&&i===o.READY)n.clearVideoStartTimeout();else if(t===o.STARTUP_AUTOPLAY)n.stateMachineCallbacks.startup(l,o.STARTUP.toLowerCase());else if(t!==o.ERROR){var p=n.stateMachineCallbacks[d];if((0,v.isFunction)(p))try{p(l,d,r)}catch(e){E.logger.error("Exception occurred in State Machine callback "+d,r,e)}else(0,f.logMissingCallbackWarning)(t,[o.READY,o.SOURCE_CHANGING])}r&&i!==o.END_PLAY_SEEKING&&t!==o.PLAY_SEEKING&&i!==o.PLAY_SEEKING&&t!==o.AD_STARTUP&&t!==o.AD_READY&&t!==o.AD_PLAYING&&t!==o.AD_PAUSE&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(r),e===u.Event.MUTE?n.stateMachineCallbacks.mute():e===u.Event.UN_MUTE&&n.stateMachineCallbacks.unMute()}},t["onenter".concat(o.STARTUP_AUTOPLAY)]=function(){n.setVideoStartTimeout()},t["onenter".concat(o.PLAYING)]=function(){n.playingHeartbeatService.startHeartbeat()},t["onenter".concat(o.PLAY_SEEKING)]=function(e,t,i,a,r){t!==o.END_PLAY_SEEKING&&(n.seekStartTimestamp=a)},t["onenter".concat(o.QUALITY_CHANGE)]=function(e,t,i,a,r){n.stateMachineCallbacks.qualitychange(r),n.stateMachine[u.Event.FINISH_QUALITY_CHANGE](a)},t.onenterstate=function(t,i,a,r,s){(0,f.logStateMachineTransition)("ENTER",t,i,a),n.onEnterStateTimestamp=null!=r?r:Date.now(),(0,p.isNumber)(e.starttime)&&t===u.JSM_INITIAL_EVENT&&(n.onEnterStateTimestamp=e.starttime),!s||a===o.END_PLAY_SEEKING||i===o.PLAY_SEEKING||i===o.AD_STARTUP||i===o.AD_READY||i===o.AD_PLAYING||i===o.AD_PAUSE||t===u.Event.SEEK&&i===o.END_PLAY_SEEKING||n.stateMachineCallbacks.setVideoTimeStartFromEvent(s),t===u.Event.START_CAST&&a===o.CASTING&&n.stateMachineCallbacks.startCasting(r,s),a===o.REBUFFERING&&n.startRebufferingHeartbeatInterval()},t["onafter".concat(u.Event.ERROR)]=function(e,t,i,a,r){n.stateMachineCallbacks.error(r)},t["onafter".concat(u.Event.SOURCE_UNLOADED)]=function(e,t,i,a,r){n.sourceLoadedDuringAutoplayStartup=!1},t.onafterevent=function(e,t,i,a,r){e===u.Event.MANUAL_SOURCE_CHANGE&&t===o.SETUP?n.stateMachineCallbacks.initialSourceChange(r):e===u.Event.MANUAL_SOURCE_CHANGE&&n.stateMachineCallbacks.manualSourceChange(r),i!==o.MUTING_READY&&i!==o.MUTING_PLAY&&i!==o.MUTING_PAUSE||n.stateMachine.FINISH_MUTING(a)},t)})},t.prototype.getStates=function(){return this.debuggingStates},t.prototype.setEnabledDebugging=function(e){this.enabledDebugging=e},t.prototype.addStatesToLog=function(e,t,n,i,a){this.enabledDebugging&&this.debuggingStates.push(new d.EventDebugging(e,t,n,i,a))},t}(h.AnalyticsStateMachine);t.Bitmovin8AnalyticsStateMachine=m},8253:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logStateMachineTransition=t.logMissingCallbackWarning=t.customStateMachineErrorCallback=t.whileIn=t.on=void 0,t.getAllStates=s,t.getAllStatesBut=function(e,t){return s(t).filter((function(t){return e.indexOf(t)<0}))};var i=n(2595),a=n(1916),r=n(2974),o=n(5063);t.on=function(e){return{stayIn:function(t){return{name:e,from:t,to:t}}}};t.whileIn=function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.map((function(t){return{name:t,from:e,to:e}}))};return{runEventCallbacksFor:t,passOver:t}};t.customStateMachineErrorCallback=function(e,t,n,r,s,l,u){var c='StateMachine ignored event "'.concat(e,'", ').concat(l),d={eventName:e,from:t,to:n,args:(0,o.tryJSONStringify)(r),errorCode:s,errorMessage:l};s!==i.Error.INVALID_TRANSITION?a.logger.error(c,d):a.logger.log(c,d)};t.logMissingCallbackWarning=function(e,t){(void 0===t&&(t=[]),(0,o.isNullish)(e))||(0,o.isNullish)(t.find((function(t){return e===t})))&&a.logger.warn("Could not find StateMachine callback function for "+e)};function s(e){return(0,r.objectValues)(e)}t.logStateMachineTransition=function(e,t,n,i){"ENTER"===e?a.logger.log("[ENTER] ".concat((0,a.padRight)(i,20)," EVENT: ").concat((0,a.padRight)(t,20)," from ").concat((0,a.padRight)(n,20))):a.logger.log("[LEAVE] ".concat((0,a.padRight)(n,20)," EVENT: ").concat((0,a.padRight)(t,20)," to ").concat((0,a.padRight)(i,20)))}},5241:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeSessionMetadataAudioLanguage=function(e){if((0,i.isNullish)(e))return;return String(e).substring(0,50)},t.sanitizeSessionMetadataSubtitleEnabled=function(e){if((0,i.isNullish)(e))return;return(0,i.toBoolean)(e)},t.sanitizeSessionMetadataSubtitleLanguage=function(e){if((0,i.isNullish)(e))return;return String(e).substring(0,100)};var i=n(5063)},8917:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.AdAnalytics=void 0;var a=n(5517),r=n(5791),o=n(7232),s=n(4439),l=n(1916),u=n(5063),c=n(5063),d=n(2982),E=n(4926),p=n(3612),v=function(){function e(e,t){var n=this;this.onBeforeUnLoadEvent=!1,this.isPlaying=!1,this.adPodPosition=0,this.analytics=e,this.adapter=t,this.adapter.adCallbacks.onAdStarted=function(e){return n.onAdStarted(e)},this.adapter.adCallbacks.onAdFinished=function(e){return n.onAdFinished(e)},this.adapter.adCallbacks.onAdBreakStarted=function(e){return n.onAdBreakStarted(e)},this.adapter.adCallbacks.onAdBreakFinished=function(e){return n.onAdBreakFinished(e)},this.adapter.adCallbacks.onAdClicked=function(e){return n.onAdClicked(e)},this.adapter.adCallbacks.onAdError=function(e){return n.onAdError(e)},this.adapter.adCallbacks.onAdManifestLoaded=function(e){return n.onAdManifestLoaded(e)},this.adapter.adCallbacks.onPlay=function(){return n.onPlay()},this.adapter.adCallbacks.onPause=function(){return n.onPause()},this.adapter.adCallbacks.onBeforeUnload=function(){return n.onBeforeUnload()},this.adapter.adCallbacks.onAdSkipped=function(e){return n.onAdSkipped(e)},this.adapter.adCallbacks.onAdQuartile=function(e){return n.onAdQuartile(e)},this.viewportTracker=new p.ViewportTracker(this.adapter.getContainer(),(function(){return n.onIntersectionChanged()}),.5)}return e.prototype.release=function(){this.clearCurrentTimeInterval(),this.viewportTracker.dispose(),this.adManifestDownloadTime=void 0},e.prototype.onIntersectionChanged=function(){this.activeAdSample&&(this.isContainerInViewport()?this.enterViewportTimestamp=u.getCurrentTimestamp():this.enterViewportTimestamp&&(this.activeAdSample.timeInViewport=(this.activeAdSample.timeInViewport||0)+u.getCurrentTimestamp()-this.enterViewportTimestamp))},e.prototype.isContainerInViewport=function(){return!this.viewportTracker||this.viewportTracker.isInViewport()},e.prototype.onPlay=function(){if(this.adapter&&this.adapter.isLinearAdActive()&&this.activeAdSample){var e=u.getCurrentTimestamp();this.beginPlayingTimestamp=e,this.enterViewportTimestamp=e,this.isPlaying=!0}},e.prototype.onPause=function(){this.adapter&&this.adapter.isLinearAdActive()&&this.activeAdSample&&(this.updatePlayingTime(this.activeAdSample),this.isPlaying=!1)},e.prototype.onAdManifestLoaded=function(e){e.isVmap?this.sendAnalyticsRequest(new o.AdBreakSample(e.adBreakInfo)):this.adManifestDownloadTime=e.manifestDownloadTime},e.prototype.onAdBreakStarted=function(e){this.adPodPosition=0,this.activeAdBreakSample=new o.AdBreakSample(i(i({},e),{manifestDownloadTime:this.adManifestDownloadTime})),delete this.adManifestDownloadTime,this.adStartupTimestamp=u.getCurrentTimestamp()},e.prototype.onAdBreakFinished=function(e){this.resetActiveAd(),this.activeAdBreakSample=void 0},e.prototype.onAdStarted=function(e){e.isLinear&&(this.resetActiveAd(),this.activeAdSample=new s.AdSample(e),this.currentTime=void 0,this.activeAdSample.adStartupTime=this.adStartupTimestamp?u.getCurrentTimestamp()-this.adStartupTimestamp:void 0,this.startAd(this.activeAdSample))},e.prototype.onAdFinished=function(e){if(this.activeAdBreakSample&&this.activeAdSample){var t=i({},this.activeAdSample);t.completed=1,this.resetActiveAd(),this.completeAd(this.activeAdBreakSample,t,t.adDuration)}},e.prototype.onAdSkipped=function(e){if(this.activeAdBreakSample&&this.activeAdSample){var t=i({},this.activeAdSample);t.skipped=1,t.skipPosition=this.currentTime,t.skipPercentage=u.calculatePercentage(t.skipPosition,this.activeAdSample.adDuration),this.resetActiveAd(),this.completeAd(this.activeAdBreakSample,t,t.skipPosition)}},e.prototype.onAdError=function(e){var t,n,i=new o.AdBreakSample(e.adBreakInfo),a=this.analytics.transformError({code:e.code,message:e.message,severity:"CRITICAL"},e);i.errorCode=a.code,i.errorData=(0,c.tryJSONStringify)({code:e.code,message:e.message}),i.errorMessage=a.message,i.errorSeverity=a.severity,this.activeAdSample&&e.activeAdId&&this.activeAdSample.adId===e.activeAdId&&(n=(t=this.activeAdSample).errorPosition=this.currentTime,t.errorPercentage=u.calculatePercentage(t.errorPosition,t.adDuration)),this.completeAd(i,t,n)},e.prototype.onAdClicked=function(e){this.activeAdSample&&(this.activeAdSample.adClickthroughUrl=e.clickThroughUrl,this.activeAdSample.clicked=1,this.activeAdSample.clickPosition=this.currentTime,this.activeAdSample.clickPercentage=u.calculatePercentage(this.activeAdSample.clickPosition,this.activeAdSample.adDuration))},e.prototype.onAdQuartile=function(e){this.activeAdSample&&(e.quartile===a.AdQuartile.FIRST_QUARTILE?this.activeAdSample.quartile1=1:e.quartile===a.AdQuartile.MIDPOINT?this.activeAdSample.midpoint=1:e.quartile===a.AdQuartile.THIRD_QUARTILE&&(this.activeAdSample.quartile3=1))},e.prototype.onBeforeUnload=function(){if(!this.onBeforeUnLoadEvent&&(this.onBeforeUnLoadEvent=!0,this.activeAdSample&&this.activeAdBreakSample)){var e=i({},this.activeAdSample);e.closed=1,e.closePosition=this.currentTime,e.closePercentage=u.calculatePercentage(e.closePosition,e.adDuration),this.resetActiveAd(),this.completeAd(this.activeAdBreakSample,e,e.closePosition)}},e.prototype.createNewAdAnalyticsSample=function(e){var t=this.adapter.getAdModuleInfo();return i(i({},new r.AdAnalyticsSample(e)),{analyticsVersion:E.VERSION,adModule:t.name,adModuleVersion:t.version,autoplay:this.adapter.getAutoPlay(),pageLoadType:u.getPageLoadType()})},e.prototype.sendAnalyticsRequest=function(e,t){var n=i(i(i({},this.createNewAdAnalyticsSample(this.analytics.sample)),e),t||new s.AdSample);n.time=u.getCurrentTimestamp(),n.adImpressionId=(0,d.generateUUID)(),n.percentageInViewport=u.calculatePercentage(n.timeInViewport,n.timePlayed),this.analytics.backend.sendAdRequest(n)},e.prototype.updatePlayingTime=function(e){var t=u.getCurrentTimestamp();this.beginPlayingTimestamp&&this.isPlaying&&(void 0!==e.timePlayed&&(e.timePlayed+=t-this.beginPlayingTimestamp),this.isContainerInViewport()&&this.enterViewportTimestamp&&void 0!==e.timeInViewport&&(e.timeInViewport+=t-this.enterViewportTimestamp))},e.prototype.startAd=function(t){var n=this;t.started=1,t.timePlayed=0,t.timeInViewport=0,t.adPodPosition=this.adPodPosition;var i=u.getCurrentTimestamp();this.beginPlayingTimestamp=i,this.enterViewportTimestamp=this.isContainerInViewport()?i:void 0,this.isPlaying=!0,this.currentTime=0,this.adPodPosition++,this.currentTimeInterval=setInterval((function(){try{t&&void 0!==t.adDuration&&t.adDuration>0&&n.adapter.isLinearAdActive()&&(n.currentTime=u.calculateTime(Math.max(n.adapter.currentTime(),0)))}catch(e){l.logger.log("AdStarted monitoring interval failed and got cleared",e),n.resetActiveAd()}}),e.TIMEOUT_CURRENT_TIME_INTERVAL)},e.prototype.completeAd=function(e,t,n){void 0===t&&(t=new s.AdSample),t.exitPosition=n,t.playPercentage=u.calculatePercentage(t.exitPosition,t.adDuration),(0,c.isNotNullish)(t.playPercentage)&&(0===t.quartile1&&t.playPercentage>=25&&(t.quartile1=1),0===t.midpoint&&t.playPercentage>=50&&(t.midpoint=1),0===t.quartile3&&t.playPercentage>=75&&(t.quartile3=1)),this.adStartupTimestamp=u.getCurrentTimestamp(),this.updatePlayingTime(t),this.isPlaying=!1,this.sendAnalyticsRequest(e,t)},e.prototype.resetActiveAd=function(){this.clearCurrentTimeInterval(),this.activeAdSample=void 0},e.prototype.clearCurrentTimeInterval=function(){clearInterval(this.currentTimeInterval),delete this.currentTime},e.MODULE_NAME="ads",e.TIMEOUT_CURRENT_TIME_INTERVAL=100,e}();t.AdAnalytics=v},4350:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Analytics=void 0,t.setQualityInfoOnSample=L;var a=n(3588),r=n(3458),o=n(8525),s=n(3565),l=n(6845),u=n(5529),c=n(8331),d=n(404),E=n(5923),p=n(9422),v=n(1916),h=n(1460),f=n(6481),m=n(1820),A=n(5063),y=n(5063),S=n(2982),T=n(4926),g=n(8421),I=n(8917),N=n(3054),D=n(675),C=n(7721),_=n(2226),P=n(847),b=n(8918),R=n(7906),U=function(){function e(e,t,n,a,r,o,s){var l=this;this.adapter=t,this.backendFactory=n,this.sessionHandler=a,this.featureManager=r,this.onErrorDetailEventDispatcher=o,this.identicalErrorReportingLimiter=s,this.hasSentStartupSample=!1,this.droppedSampleFrames=0,this.playerStartupTime=0,this.authenticationCallback={authenticationCompleted:function(e,t){l.featureManager.configureFeatures(e,t)}},this.sourceChange=function(e){if(v.logger.log("Processing Source Change for Analytics",e),(0,y.isNullish)(e))l.adapter.sourceChange(l.config);else{(0,c.guardConfigChangeAgainstMissingTitle)(l.config,e),(0,c.guardConfigChangeAgainstMissingIsLive)(l.config,e),(0,c.guardAgainstDuplicatedUserId)(e);var t=(0,c.mergeAnalyticsConfig)(l.config,e);l.adapter.sourceChange(t)}},this.setCustomDataOnce=function(e){var t=i({},l.config);l.setState("customdatachange"),l.sendSample(e),l.config=i({},t),l.setConfigParameters(),l.setAutoDetectedDeviceInformation()},this.setCustomData=function(e){l.adapter.setCustomData(e)},this.getCurrentImpressionId=function(){return l.sample.impressionId},this.getUserId=function(){return l.sessionHandler.userId},this.changeCustomData=function(e){l.config=i(i({},l.config),(0,u.extractCustomDataFieldsOnly)(e)),l.setConfigParameters(),l.setAutoDetectedDeviceInformation()},this.config=e,this.sessionHandler=new P.SessionPersistenceHandler(this.config);var d=this;this.errorDetailTrackingSettingsProvider={get domain(){return(0,c.getDomainFromAnalyticsConfig)(d.config)},get licenseKey(){var e;return null!==(e=d.config.key)&&void 0!==e?e:""},get impressionId(){var e;return null!==(e=d.getCurrentImpressionId())&&void 0!==e?e:""},get collectorConfig(){return d.config.config}};var E=this.adapter.onLicenseKeyReceived.subscribe((function(e){l.config.key||(l.config.key=e.licenseKey),E()}));this.sample=this.buildInitialSample(),this.droppedSampleFrames=0,this.init(),this.setupStateMachineCallbacks();var p=this.adapter.initialize(this);this.featureManager.registerFeatures(p),this.adapter.adModule&&(this.adAnalytics=new I.AdAnalytics(this,this.adapter.adModule))}return Object.defineProperty(e.prototype,"version",{get:function(){return T.VERSION},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorDetailSubscribable",{get:function(){return this.onErrorDetailEventDispatcher},enumerable:!1,configurable:!0}),e.prototype.init=function(){if(!0===this.adapter.supportsDeferredLicenseLoading||(0,m.isValidString)(this.config.key)&&!(0,m.isBlank)(this.config.key)){v.logger.initialize(this.config.debug),this.featureManager.resetFeatures();var e=(0,c.getDomainFromAnalyticsConfig)(this.config);this.backend=this.backendFactory.createBackend(this.config,{key:this.config.key,domain:e,version:T.VERSION},this.adapter,this.authenticationCallback),this.hasSentStartupSample=!1,this.identicalErrorReportingLimiter.reset(),this.setConfigParameters(),this.setAutoDetectedDeviceInformation(),this.sample.impressionId=(0,S.generateUUID)(),this.sample.userId=this.sessionHandler.userId,this.adapter.videoCompletionTracker&&this.adapter.videoCompletionTracker.reset(),this.adapter.qualityChangeService.resetValues(),this.adapter.ssaiService.resetSourceRelatedState()}else v.logger.errorMessageToUser("Invalid analytics license key provided")},e.prototype.setConfigParameters=function(){var e;this.sample.key=this.config.key,this.sample.playerKey=this.config.playerKey,this.config.player&&(this.sample.player=this.config.player),this.sample.domain=(0,c.getDomainFromAnalyticsConfig)(this.config),this.sample.deviceInformation=(0,c.getDeviceInformationFromAnalyticsConfig)(this.config),this.sample.isLive=!!(0,y.isNotNullish)(this.config.isLive)&&this.config.isLive,this.sample.cdnProvider=this.config.cdnProvider,this.sample.videoId=this.config.videoId,this.sample.videoTitle=this.config.title,this.sample.customUserId=null!==(e=this.config.userId)&&void 0!==e?e:this.config.customUserId,A.transferCustomDataFields(this.config,this.sample),this.sample.experimentName=this.config.experimentName},e.prototype.setAutoDetectedDeviceInformation=function(){var e,t;if(!(0,y.isNotNullish)(null===(e=this.sample.deviceInformation)||void 0===e?void 0:e.model)&&(0,p.hasGlobalWebOSApi)()){var n=(0,g.getWebOSTVModelName)();(0,y.isNullish)(n)||(this.sample.deviceInformation=null!==(t=this.sample.deviceInformation)&&void 0!==t?t:{},this.sample.deviceInformation.model=n)}},e.prototype.setupStateMachineCallbacks=function(){var e=this;this.adapter.stateMachineCallbacks.setup=function(t,n){var i,a;v.logger.log("Setup bitmovin analytics "+e.sample.analyticsVersion+" with impressionId: "+e.sample.impressionId),e.setDuration(t),e.setState(n),e.sample.playerStartupTime=t,e.playerStartupTime=e.sample.playerStartupTime;var r=null===(a=null===(i=E.globalScope.performance)||void 0===i?void 0:i.timing)||void 0===a?void 0:a.navigationStart;if((0,y.isNotNullish)(r)&&(0,h.isFiniteNumber)(r)){var o=Math.round(Date.now()-E.globalScope.performance.timing.navigationStart);e.sample.pageLoadTime=o}e.sendSample()},this.adapter.stateMachineCallbacks.startup=function(t,n){e.setState(n),e.sample.supportedVideoCodecs=d.CodecHelper.supportedVideoFormats;var i=Math.max(t,1);e.setDuration(i),e.sample.videoStartupTime=i,e.sample.startupTime=(e.playerStartupTime||0)+i,e.sample.autoplay=e.adapter.getAutoPlay();var a=e.adapter.getDrmPerformanceInfo();(0,y.isNotNullish)(a)&&(e.sample.drmType=a.drmType,e.sample.drmLoadTime=a.drmLoadTime);var r=e.adapter.getCurrentPlaybackInfo(),o=r.videoBitrate,s=r.audioBitrate;e.adapter.qualityChangeService.setStartupHasFinished(o,s),e.hasSentStartupSample=!0,e.sendSample()},this.adapter.stateMachineCallbacks.programChange=function(t){e.playerStartupTime=0,e.config=(0,c.applySourceMetadataToAnalyticsConfig)(e.config,t),e.sample=e.buildInitialSample(),e.sample.path=(0,m.isValidString)(t.path)?t.path:(0,f.getDefaultSamplePath)(),e.init(),e.setState("programchange"),e.sample.isProgramChange=!0,e.sample.supportedVideoCodecs=d.CodecHelper.supportedVideoFormats;e.setDuration(1),e.sample.videoStartupTime=1,e.sample.startupTime=1,e.sample.autoplay=e.adapter.getAutoPlay(),e.sample.drmType=void 0,e.sample.drmLoadTime=void 0;var n=e.adapter.getCurrentPlaybackInfo(),i=n.videoBitrate,a=n.audioBitrate;e.adapter.qualityChangeService.setStartupHasFinished(i,a),e.hasSentStartupSample=!0,e.sendSample()},this.adapter.stateMachineCallbacks.updateSourceMetadata=function(t){e.config=(0,c.applySourceMetadataToAnalyticsConfig)(e.config,t),e.setConfigParameters(),e.setAutoDetectedDeviceInformation(),e.sample.path=(0,m.isValidString)(t.path)?t.path:(0,f.getDefaultSamplePath)()},this.adapter.stateMachineCallbacks.playing=function(t,n){e.setDuration(t),e.setState(n),e.sample.played=t,e.setCompletionValues(),e.sendSample()},this.adapter.stateMachineCallbacks.unload=function(t,n){var i=e.sample.videoTimeStart;"playing"===n&&(e.setDuration(t),e.setState(n),e.sample.played=t,e.setCompletionValues(),(0,h.isNumber)(e.sample.videoTimeEnd)&&(i=e.sample.videoTimeEnd),e.backend.sendUnloadRequest(e.sample),(0,f.clearSampleStateValues)(e.sample)),e.hasSentStartupSample&&(e.setVideoTimeStart(i),e.setVideoTimeEnd(i),e.setState("closed"),e.backend.sendUnloadRequest(e.sample),(0,f.clearSampleStateValues)(e.sample))},this.adapter.stateMachineCallbacks.heartbeat=function(t,n,a){e.setState(n),e.setDuration(t),e.sample=i(i({},e.sample),a),"playing"===n&&e.setCompletionValues(),e.sendSample()},this.adapter.stateMachineCallbacks.qualitychange=function(t){e.adapter.qualityChangeService.startResetInterval(),e.adapter.qualityChangeService.increaseCounter(),e.adapter.qualityChangeService.hasExceededQualityChangeThreshold()?e.adapter.stateMachineCallbacks.error({code:r.ErrorCode.QUALITY_CHANGE_THRESHOLD_EXCEEDED.code,message:r.ErrorCode.QUALITY_CHANGE_THRESHOLD_EXCEEDED.message,errorSeverity:r.ErrorCode.QUALITY_CHANGE_THRESHOLD_EXCEEDED.errorSeverity,legacyData:void 0,data:{},currentTime:t.currentTime}):(e.setState("qualitychange"),e.setDuration(0),e.adapter.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.adapter.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.adapter.stateMachineCallbacks.updateSampleQualityInfo(t),e.sendSample())},this.adapter.stateMachineCallbacks.updateSampleQualityInfo=function(t){"audio"===t.type?((0,h.isNumber)(t.bitrate)&&(e.sample.audioBitrate=t.bitrate),(0,m.isValidString)(t.codec)&&(e.sample.audioCodec=t.codec)):"video"===t.type&&((0,h.isNumber)(t.bitrate)&&(e.sample.videoBitrate=t.bitrate),(0,m.isValidString)(t.codec)&&(e.sample.videoCodec=t.codec),(0,h.isNumber)(t.height)&&(e.sample.videoPlaybackHeight=t.height),(0,h.isNumber)(t.width)&&(e.sample.videoPlaybackWidth=t.width))},this.adapter.stateMachineCallbacks.audiotrack_changing=function(){e.sendSample()},this.adapter.stateMachineCallbacks.pause=function(t,n){e.setDuration(t),e.setState(n),e.sample.paused=t,e.sendSample()},this.adapter.stateMachineCallbacks.seeking=function(t){e.setDuration(t),e.setState("seeking"),e.sample.seeked=t,e.sendSample()},this.adapter.stateMachineCallbacks.rebuffering=function(t,n){e.setDuration(t),e.setState(n),e.sample.buffered=t,e.sendSample()},this.adapter.stateMachineCallbacks.videoStartFailed=function(t,n){e.setState("startup"),e.sample.videoStartFailed=!0,e.sample.videoStartFailedReason=n,e.sample.duration=t,n!==s.VideoStartFailedReason.PLAYER_ERROR&&(n===s.VideoStartFailedReason.TIMEOUT&&(e.sample.errorCode=r.ErrorCode.VIDEO_STARTUP_TIMEOUT_REACHED.code,e.sample.errorMessage=r.ErrorCode.VIDEO_STARTUP_TIMEOUT_REACHED.message,e.sample.errorSeverity=r.ErrorCode.VIDEO_STARTUP_TIMEOUT_REACHED.errorSeverity,e.onErrorDetailEventDispatcher.dispatch({code:r.ErrorCode.VIDEO_STARTUP_TIMEOUT_REACHED.code,message:r.ErrorCode.VIDEO_STARTUP_TIMEOUT_REACHED.message,severity:r.ErrorCode.VIDEO_STARTUP_TIMEOUT_REACHED.errorSeverity})),e.sendSample())},this.adapter.stateMachineCallbacks.error=function(t){var n,i=e.transformError({code:t.code,message:t.message,severity:null!==(n=t.errorSeverity)&&void 0!==n?n:"CRITICAL"},t.originalError);!i.code||e.identicalErrorReportingLimiter.shouldReportError(i.code,i.severity)?(e.adapter.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.adapter.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.setState("error"),e.setDuration(0),e.sample.errorCode=i.code,e.sample.errorMessage=i.message,e.sample.errorSeverity=i.severity,e.sample.errorData=(0,y.tryJSONStringify)(t.legacyData),e.sample.errorSegments=e.adapter.getSegmentInfo().map((function(e){return e.name})),e.adapter.onError&&e.adapter.onError(),e.onErrorDetailEventDispatcher.dispatch({code:i.code,message:i.message,severity:i.severity,errorData:t.data}),e.sendSample()):v.logger.log("Bitmovin Analytics: Processing of the error with code ".concat(i.code," was ignored because the error limit was exceeded."))},this.adapter.stateMachineCallbacks.ad=function(t,n){e.setDuration(t),e.setState(n),e.sample.ad=a.AD_TYPE.CSAI,e.sendSample()},this.adapter.stateMachineCallbacks.mute=function(){e.sample.isMuted=!0},this.adapter.stateMachineCallbacks.unMute=function(){e.sample.isMuted=!1},this.adapter.stateMachineCallbacks.subtitle_changing=function(){e.sendSample()},this.adapter.stateMachineCallbacks.setVideoTimeEndFromEvent=function(t){(0,h.isNumber)(null==t?void 0:t.currentTime)&&e.setVideoTimeEnd(A.calculateTime(t.currentTime))},this.adapter.stateMachineCallbacks.setVideoTimeStartFromEvent=function(t){(0,h.isNumber)(null==t?void 0:t.currentTime)&&e.setVideoTimeStart(A.calculateTime(t.currentTime))},this.adapter.stateMachineCallbacks.manualSourceChange=function(t){e.adapter.resetSourceRelatedState(),e.sample=e.buildInitialSample(),e.droppedSampleFrames=0,e.playerStartupTime=0,e.config=Object.keys(t.config).length>0?t.config:e.config,e.init()},this.adapter.stateMachineCallbacks.initialSourceChange=function(t){e.config=t.config,e.setConfigParameters(),e.setAutoDetectedDeviceInformation()},this.adapter.stateMachineCallbacks.end=function(){e.sample=e.buildInitialSample(),e.droppedSampleFrames=0,e.playerStartupTime=0,e.init()},this.adapter.stateMachineCallbacks.release=function(){var t;e.backend=new _.NoOpBackend,null===(t=e.adAnalytics)||void 0===t||t.release(),e.adapter.qualityChangeService.stopResetInterval(),e.identicalErrorReportingLimiter.reset()},this.adapter.stateMachineCallbacks.customdatachange=function(t,n,i){(0,y.isNotNullish)(null==i?void 0:i.customDataValues)&&e.changeCustomData(i.customDataValues)}},e.prototype.setDuration=function(e){this.sample.duration=e},e.prototype.setState=function(e){this.sample.state=e},e.prototype.setPlaybackInfoFromAdapter=function(){var e=this.adapter.getCurrentPlaybackInfo();e&&(this.sample.isLive=(0,y.isNotNullish)(this.config.isLive)?this.config.isLive:e.isLive,(0,y.isNullish)(this.sample.isLive)&&(this.sample.isLive=!1),(0,m.isValidString)(e.size)&&(this.sample.size=e.size),(0,m.isValidString)(e.playerTech)&&(this.sample.playerTech=e.playerTech),(0,h.isNumber)(e.videoDuration)&&(this.sample.videoDuration=A.calculateTime(e.videoDuration||0)),(0,m.isValidString)(e.streamFormat)&&(this.sample.streamFormat=e.streamFormat),(0,m.isValidString)(e.mpdUrl)&&(this.sample.mpdUrl=e.mpdUrl),(0,m.isValidString)(e.m3u8Url)&&(this.sample.m3u8Url=e.m3u8Url),(0,m.isValidString)(e.progUrl)&&(this.sample.progUrl=e.progUrl),(0,h.isNumber)(e.videoWindowWidth)&&(this.sample.videoWindowWidth=e.videoWindowWidth),(0,h.isNumber)(e.videoWindowHeight)&&(this.sample.videoWindowHeight=e.videoWindowHeight),(0,h.isNumber)(e.screenHeight)&&(this.sample.screenHeight=e.screenHeight),(0,h.isNumber)(e.screenWidth)&&(this.sample.screenWidth=e.screenWidth),A.isBoolean(e.isMuted)&&(this.sample.isMuted=e.isMuted),A.isBoolean(e.isCasting)&&(this.sample.isCasting=e.isCasting),(0,m.isValidString)(e.castTech)&&(this.sample.castTech=e.castTech),(0,m.isValidString)(e.videoTitle)&&!this.config.title&&(this.sample.videoTitle=e.videoTitle),(0,m.isValidString)(e.audioCodec)&&(this.sample.audioCodec=e.audioCodec),(0,m.isValidString)(e.videoCodec)&&(this.sample.videoCodec=e.videoCodec),(0,m.isValidString)(e.audioLanguage)&&(this.sample.audioLanguage=e.audioLanguage),A.isBoolean(e.subtitleEnabled)&&(this.sample.subtitleEnabled=e.subtitleEnabled),(0,m.isValidString)(e.subtitleLanguage)?this.sample.subtitleLanguage=e.subtitleLanguage:this.sample.subtitleLanguage=void 0,(0,h.isNumber)(e.droppedFrames)&&(this.sample.droppedFrames=Math.max(e.droppedFrames-this.droppedSampleFrames,0),this.droppedSampleFrames=e.droppedFrames))},e.prototype.sendSample=function(e){if(this.setPlaybackInfoFromAdapter(),this.sample.time=A.getCurrentTimestamp(),this.sample.downloadSpeedInfo=this.adapter.getDownloadSpeedInfo(),this.adapter.resetDownloadSpeedInfoMeasures(),this.adapter.ssaiService.manipulate(this.sample),null!=e&&this.changeCustomData(e),(0,y.isNullish)(this.sample.videoBitrate)||this.sample.videoBitrate<=0){L(this.sample,this.adapter.getCurrentPlaybackInfo());var t=i({},this.sample);this.backend.sendRequest(t)}else{t=i({},this.sample);this.backend.sendRequest(t),L(this.sample,this.adapter.getCurrentPlaybackInfo())}(0,f.clearSampleStateValues)(this.sample)},e.prototype.sendSsaiEngagementAdSample=function(e){var t;if(!0===(null===(t=this.config.config)||void 0===t?void 0:t.ssaiEngagementTrackingEnabled))if((0,b.isSsaiEngagementStartedData)(e)){var n=(0,R.createStartedAdSample)(this.sample,e);this.backend.sendAdRequest(n)}else if((0,b.isSsaiEngagementQuartileData)(e)){n=(0,R.createQuartileAdSample)(this.sample,e);this.backend.sendAdRequest(n)}else if((0,b.isSsaiEngagementErrorData)(e)){e.analyticsError=this.transformError(e.analyticsError,e.originalError);var i=(0,R.createErrorAdSample)(this.sample,e);this.backend.sendAdRequest(i)}else;},e.prototype.setCompletionValues=function(){if(this.adapter.videoCompletionTracker){var e=this.adapter.videoCompletionTracker.addWatched({start:this.sample.videoTimeStart,end:this.sample.videoTimeEnd}),t=this.adapter.videoCompletionTracker.getCompletionPercentage();Number.isNaN(e)||Number.isNaN(t)||(this.sample.completed=e,this.sample.completedTotal=t)}},e.prototype.setVideoTimeStart=function(e){this.sample.videoTimeStart=e},e.prototype.setVideoTimeEnd=function(e){this.sample.videoTimeEnd=e},e.prototype.transformError=function(e,t){var n,i,a={code:e.code,message:e.message,severity:e.severity};try{var r=null===(i=null===(n=this.config.config)||void 0===n?void 0:n.errorTransformerCallback)||void 0===i?void 0:i.transform(a,{originalError:t});a.code=(0,h.isNumber)(null==r?void 0:r.code)?null==r?void 0:r.code:a.code,a.message=(0,m.isValidString)(null==r?void 0:r.message)?null==r?void 0:r.message:a.message,a.severity=(0,m.isValidString)(null==r?void 0:r.severity)&&(0,y.isErrorSeverity)(null==r?void 0:r.severity)?r.severity:a.severity}catch(e){v.logger.error("Error in errorTransformerCallback",e)}return a},e.prototype.buildInitialSample=function(){var e,t=this.config.player||this.adapter.getPlayerName(),n=(0,p.getGlobalScreenDimensions)();return{ad:0,analyticsVersion:T.VERSION,audioBitrate:0,buffered:0,completedTotal:0,droppedFrames:0,duration:0,isLive:null!==(e=this.config.isLive)&&void 0!==e&&e,language:(0,p.getGlobalNavigatorLanguage)(),pageLoadTime:0,pageLoadType:A.getPageLoadType(),path:(0,f.getDefaultSamplePath)(),paused:0,platform:"web",played:0,player:t,playerStartupTime:0,playerTech:this.adapter.getPlayerTech(),screenHeight:null==n?void 0:n.height,screenWidth:null==n?void 0:n.width,seeked:0,size:o.PlayerSize.Window,startupTime:0,time:0,userAgent:(0,p.getGlobalNavigatorUserAgent)(),version:t+"-"+this.adapter.getPlayerVersion(),videoBitrate:0,videoDuration:0,videoPlaybackHeight:0,videoPlaybackWidth:0,videoStartupTime:0,videoTimeEnd:0,videoTimeStart:0,videoWindowHeight:0,videoWindowWidth:0}},e.create=function(t,n){return new e(t,n,new N.BackendFactory,new P.SessionPersistenceHandler(t),new l.FeatureManager,new D.EventDispatcher,new C.IdenticalErrorReportingLimiter)},e.version=T.VERSION,e}();function L(e,t){(0,h.isNumber)(t.videoPlaybackHeight)&&(e.videoPlaybackHeight=t.videoPlaybackHeight),(0,h.isNumber)(t.videoPlaybackWidth)&&(e.videoPlaybackWidth=t.videoPlaybackWidth),(0,h.isNumber)(t.videoBitrate)&&(e.videoBitrate=t.videoBitrate),(0,h.isNumber)(t.audioBitrate)&&(e.audioBitrate=t.audioBitrate)}t.Analytics=U},3054:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BackendFactory=void 0;var i=n(5253),a=n(4649),r=n(7540),o=n(3489),s=n(399),l=n(2226),u=n(7390),c=function(){function e(){}return e.prototype.createBackend=function(e,t,n,i){if(!this.isEnabled(e))return new l.NoOpBackend;var a=this.createInnerBackend(e,t,n,i);return this.decorateWithDebuggingBackend(e,a)},e.prototype.decorateWithDebuggingBackend=function(e,t){return e.debug?new r.DebuggingBackend(e,t):t},e.prototype.decorateWithBackendFromConfigIfAvailable=function(e,t){return void 0!==e&&void 0!==e.config&&void 0!==e.config.wrapBackend?e.config.wrapBackend(t):t},e.prototype.isEnabled=function(e){return void 0===e.config||!1!==e.config.enabled},e.prototype.createInnerBackend=function(e,t,n,r){var l=e.config&&e.config.backendUrl||a.ANALYTICS_BACKEND_BASE_URL,c=new o.LicenseCheckingBackend(t,i.LicenseCall,l,n,r);c=this.decorateWithBackendFromConfigIfAvailable(e,c);var d=new u.SequenceNumberBackend(c);return new s.LongPlaytimeFilteringBackend(d)},e}();t.BackendFactory=c},7540:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggingBackend=void 0;var i=n(1916),a=function(){function e(e,t){this.underlying=t,e.debug&&e.debug.fields&&(this.debugFields=e.debug.fields)}return e.prototype.sendRequest=function(e){this.printFields(e),this.underlying.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){this.printFields(e),this.underlying.sendUnloadRequest(e)},e.prototype.sendRequestSynchronous=function(e){this.printFields(e),this.underlying.sendRequestSynchronous(e)},e.prototype.sendAdRequest=function(e){this.underlying.sendAdRequest(e)},e.prototype.printFields=function(e){if(this.debugFields&&this.debugFields.length){var t={};this.debugFields.forEach((function(n){return t[n]=e[n]})),i.logger.table([t])}},e}();t.DebuggingBackend=a},9664:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DownloadSpeedMeter=void 0;var i=n(5766),a=n(3786),r=function(){function e(){this.measures=[]}return e.prototype.reset=function(){this.measures=[]},e.prototype.addMeasurement=function(e){if(!(e.httpStatus>=400)){var t=new a.Measure(e),n=i.Converter.bitsToBytes(3e8);t.speed>=n||this.measures.push(t)}},e.prototype.getInfo=function(){return{segmentsDownloadCount:this.measures.length,segmentsDownloadSize:this.measures.map((function(e){return e.size})).reduce(this.add,0),segmentsDownloadTime:Math.ceil(1e3*this.totalTime()),avgDownloadSpeed:this.avgSpeed(),minDownloadSpeed:this.minSpeed(),maxDownloadSpeed:this.maxSpeed(),avgTimeToFirstByte:this.avgTimeToFirstByte()}},e.prototype.add=function(e,t){return e+t},e.prototype.avgSpeed=function(){if(0===this.measures.length)return 0;var e=this.speeds().reduce((function(e,t){return e+t}),0),t=this.measures.length;return this.bytePerSecondToBitPerSecond(e/t)},e.prototype.bytePerSecondToBitPerSecond=function(e){return i.Converter.bytesToBits(e)},e.prototype.minSpeed=function(){return 0===this.measures.length?0:this.bytePerSecondToBitPerSecond(Math.min.apply(Math,this.speeds()))},e.prototype.speeds=function(){return this.measures.map((function(e){return e.speed}))},e.prototype.maxSpeed=function(){return 0===this.measures.length?0:this.bytePerSecondToBitPerSecond(Math.max.apply(Math,this.speeds()))},e.prototype.totalTime=function(){return 0===this.measures.length?0:this.measures.reduce((function(e,t){return e+t.duration}),0)},e.prototype.avgTimeToFirstByte=function(){if(0===this.measures.length)return 0;var e=this.measures.reduce((function(e,t){return e+1e3*t.timeToFirstByte}),0)/this.measures.length;return Math.ceil(e)},e}();t.DownloadSpeedMeter=r},675:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventDispatcher=void 0;var n=function(){function e(){this.callbacks=[]}return e.prototype.subscribe=function(e){var t=this;return this.callbacks.push(e),function(){return t.unsubscribe(e)}},e.prototype.dispatch=function(e){this.callbacks.slice(0).forEach((function(t){t(e)}))},e.prototype.unsubscribe=function(e){var t=this.callbacks.indexOf(e);t>-1&&this.callbacks.splice(t,1)},Object.defineProperty(e.prototype,"subscriberCount",{get:function(){return this.callbacks.length},enumerable:!1,configurable:!0}),e}();t.EventDispatcher=n},2663:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeartbeatService=t.DEFAULT_HEARTBEAT_INTERVAL_MS=void 0,t.DEFAULT_HEARTBEAT_INTERVAL_MS=59700;var n=function(){function e(e){this.getPlayerCurrentTime=e}return e.prototype.setListener=function(e){this.listener=e},e.prototype.startHeartbeat=function(){var e=this;void 0!==this.heartbeatInterval&&this.clearHeartbeat(),this.heartbeatInterval=setInterval((function(){var t;null===(t=e.listener)||void 0===t||t.onHeartbeat(e.getPlayerCurrentTime())}),t.DEFAULT_HEARTBEAT_INTERVAL_MS)},e.prototype.stopHeartbeat=function(){this.clearHeartbeat()},e.prototype.clearHeartbeat=function(){clearTimeout(this.heartbeatInterval),this.heartbeatInterval=void 0},e}();t.HeartbeatService=n},7721:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdenticalErrorReportingLimiter=void 0;var n=function(){function e(){this._currentErrorCount=0}return e.prototype.shouldReportError=function(t,n){return t===this._lastErrorCode&&n===this._lastErrorSeverity?(this._currentErrorCount++,this._currentErrorCount<=e.MAX_IDENTICAL_ERROR_REPORTING):(this._lastErrorCode=t,this._lastErrorSeverity=n,this._currentErrorCount=1,!0)},e.prototype.reset=function(){this._lastErrorCode=void 0,this._lastErrorSeverity=void 0,this._currentErrorCount=0},e.MAX_IDENTICAL_ERROR_REPORTING=5,e}();t.IdenticalErrorReportingLimiter=n},3489:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.LicenseCheckingBackend=void 0;var a=n(4501),r=n(1916),o=n(4649),s=n(2226),l=n(1125),u=n(2364),c=function(){function e(e,t,n,a,r){var u=this;this.licenseCall=t,this.backendBaseUrl=n,this.adapter=a,this.authenticationCallback=r,this.licenseKeyReceived=function(e){clearTimeout(u.licenseLazyLoadingTimeoutHandle),u.unsubscribeFromAdapter(),u.info.key=e.licenseKey,u.promise=u.wrapLicenseCheckPromiseWithCallback(u.performLicenseCheck(),u.authenticationCallback)},this.licenseCallFailed=function(){clearTimeout(u.licenseLazyLoadingTimeoutHandle),u.unsubscribeFromAdapter(),u.backend=new s.NoOpBackend,u.authenticationCallback.authenticationCompleted(!1,void 0)},this.licenseLazyLoadingTimeout=function(){u.unsubscribeFromAdapter(),u.backend=new s.NoOpBackend,u.authenticationCallback.authenticationCompleted(!1,void 0)},this.info=i({},e),this.backend=new l.QueueBackend,this.licenseCall=t,void 0!==e.key&&""!==e.key?this.promise=this.wrapLicenseCheckPromiseWithCallback(this.performLicenseCheck(),this.authenticationCallback):!0===a.supportsDeferredLicenseLoading?(a.onLicenseKeyReceived.subscribe(this.licenseKeyReceived),a.onLicenseCallFailed.subscribe(this.licenseCallFailed),this.licenseLazyLoadingTimeoutHandle=setTimeout(this.licenseLazyLoadingTimeout,o.ANALYTICS_LICENSECALL_TIMEOUT)):(r.authenticationCompleted(!1,void 0),this.backend=new s.NoOpBackend)}return e.prototype.performLicenseCheck=function(){var e=this,t=this.info,n=t.key,i=t.domain,o=t.version;if(!n||""===n){var l={status:a.LicensingResult.Denied,message:"No license key provided"};return this.backend=new s.NoOpBackend,Promise.resolve(l)}return this.licenseCall(n,i,o,this.backendBaseUrl).then((function(t){if(t.status!==a.LicensingResult.Granted)throw new Error(t.message);var i=new u.RemoteBackend(!0,e.backendBaseUrl,n);return e.backend.flushTo(i),e.backend=i,t})).catch((function(t){return"Ignoring Impression due to DNT Header being set"===t.message?r.logger.error("License Check for Bitmovin Analytics failed because of",t):r.logger.errorMessageToUser("License Check for Bitmovin Analytics failed because of",t),e.backend=new s.NoOpBackend,{status:a.LicensingResult.Denied,message:t.message}}))},e.prototype.sendRequest=function(e){this.backend.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){this.backend.sendUnloadRequest(e)},e.prototype.sendRequestSynchronous=function(e){this.backend.sendRequestSynchronous(e)},e.prototype.sendAdRequest=function(e){this.backend.sendAdRequest(e)},e.prototype.unsubscribeFromAdapter=function(){this.adapter.onLicenseKeyReceived.unsubscribe(this.licenseKeyReceived),this.adapter.onLicenseCallFailed.unsubscribe(this.licenseCallFailed)},e.prototype.wrapLicenseCheckPromiseWithCallback=function(e,t){return e.then((function(e){return t.authenticationCompleted(e.status===a.LicensingResult.Granted,e.features),e}))},e}();t.LicenseCheckingBackend=c},399:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LongPlaytimeFilteringBackend=void 0;var i=n(5063),a=function(){function e(e){this.nextBackend=e}return e.prototype.sendRequest=function(e){this.isPlayedAboveThreshold(e)||this.nextBackend.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){this.isPlayedAboveThreshold(e)||this.nextBackend.sendUnloadRequest(e)},e.prototype.sendRequestSynchronous=function(e){this.isPlayedAboveThreshold(e)||this.nextBackend.sendRequestSynchronous(e)},e.prototype.sendAdRequest=function(e){this.nextBackend.sendAdRequest(e)},e.prototype.isPlayedAboveThreshold=function(e){return((0,i.isNullish)(e.played)?0:e.played)>=9e4},e}();t.LongPlaytimeFilteringBackend=a},3786:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Measure=void 0;var n=function(){function e(e){this.download=e}return Object.defineProperty(e.prototype,"speed",{get:function(){return this.download.size/this.download.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this.download.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.download.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeToFirstByte",{get:function(){return this.download.timeToFirstByte},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestamp",{get:function(){return this.download.timestamp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"httpStatus",{get:function(){return this.download.httpStatus},enumerable:!1,configurable:!0}),e}();t.Measure=n},2226:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoOpBackend=void 0;var n=function(){function e(){}return e.prototype.sendRequest=function(e){},e.prototype.sendUnloadRequest=function(e){},e.prototype.sendRequestSynchronous=function(e){},e.prototype.sendAdRequest=function(e){},e}();t.NoOpBackend=n},9796:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1460),a=n(4649),r=function(){function e(e){void 0===e&&(e=a.ANALYTICS_QUALITY_CHANGE_COUNT_THRESHOLD),this.qualityChangeCount=0,this.previousVideoBitrate=0,this.previousAudioBitrate=0,this.startupHasFinished=!1,this.QUALITY_CHANGE_COUNT_THRESHOLD=e}return e.prototype.resetValues=function(){this.qualityChangeCount=0,this.stopResetInterval(),this.previousVideoBitrate=0,this.previousAudioBitrate=0,this.startupHasFinished=!1},e.prototype.increaseCounter=function(){this.qualityChangeCount++},e.prototype.hasExceededQualityChangeThreshold=function(){return this.qualityChangeCount>this.QUALITY_CHANGE_COUNT_THRESHOLD},e.prototype.setStartupHasFinished=function(e,t){this.startupHasFinished=!0,(0,i.isFiniteNumber)(e)&&(this.previousVideoBitrate=e),(0,i.isFiniteNumber)(t)&&(this.previousAudioBitrate=t)},e.prototype.shouldAllowVideoQualityChange=function(e){return this.startupHasFinished&&(0,i.isFiniteNumber)(e)&&0!==this.previousVideoBitrate&&this.previousVideoBitrate!==e&&!this.hasExceededQualityChangeThreshold()},e.prototype.setVideoBitrate=function(e){this.startupHasFinished&&(this.previousVideoBitrate=e)},e.prototype.shouldAllowAudioQualityChange=function(e){return this.startupHasFinished&&(0,i.isFiniteNumber)(e)&&0!==this.previousAudioBitrate&&this.previousAudioBitrate!==e&&!this.hasExceededQualityChangeThreshold()},e.prototype.setAudioBitrate=function(e){this.startupHasFinished&&(this.previousAudioBitrate=e)},e.prototype.startResetInterval=function(){var e=this;void 0===this.qualityChangeCountResetIntervalId&&(this.qualityChangeCountResetIntervalId=setInterval((function(){e.qualityChangeCount=0}),a.ANALYTICS_QUALITY_CHANGE_COUNT_RESET_INTERVAL))},e.prototype.stopResetInterval=function(){void 0!==this.qualityChangeCountResetIntervalId&&(clearInterval(this.qualityChangeCountResetIntervalId),delete this.qualityChangeCountResetIntervalId)},e}();t.default=r},1125:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueueBackend=void 0;var n=function(){function e(){this.queue=[],this.unloadQueue=[],this.syncQueue=[],this.adQueue=[]}return e.prototype.sendRequest=function(e){this.queue.push(e)},e.prototype.sendUnloadRequest=function(e){this.unloadQueue.push(e)},e.prototype.sendRequestSynchronous=function(e){this.syncQueue.push(e)},e.prototype.sendAdRequest=function(e){this.adQueue.push(e)},e.prototype.flushTo=function(e){this.queue.forEach((function(t){e.sendRequest(t)})),this.unloadQueue.forEach((function(t){e.sendUnloadRequest(t)})),this.syncQueue.forEach((function(t){e.sendRequestSynchronous(t)})),this.adQueue.forEach((function(t){e.sendAdRequest(t)}))},e}();t.QueueBackend=n},2364:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteBackend=void 0;var i=n(5426),a=n(5063),r=function(){function e(e,t,n){this.licenseKey=n,this.hasAdModule=e,this.analyticsCall=new i.AnalyticsCall(t)}return e.prototype.sendRequest=function(e){e.key=this.licenseKey,this.analyticsCall.sendRequest(e,a.noOp)},e.prototype.sendUnloadRequest=function(e){e.key=this.licenseKey,this.analyticsCall.sendUnloadRequest(e)},e.prototype.sendRequestSynchronous=function(e){e.key=this.licenseKey,this.analyticsCall.sendRequestSynchronous(e,a.noOp)},e.prototype.sendAdRequest=function(e){e.key=this.licenseKey,this.hasAdModule&&this.analyticsCall.sendAdRequest(e)},e}();t.RemoteBackend=r},6235:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentTracker=void 0;var n=function(){function e(){this.segments=[]}return e.prototype.reset=function(){this.segments=[]},e.prototype.addSegment=function(e){this.segments.push(e)},e.prototype.removeSegment=function(e){this.segments=this.segments.filter((function(t){return t.url!==e}))},e.prototype.getSegments=function(){return this.segments},e}();t.SegmentTracker=n},7390:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequenceNumberBackend=void 0;var i=n(4649),a=function(){function e(e){this.sequenceNumber=0,this.nextBackend=e}return e.prototype.sendRequest=function(e){this.updateSampleBeforeSending(e),this.isSequenceNumberAboveThreshold(e)||this.nextBackend.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){this.updateSampleBeforeSending(e),this.isSequenceNumberAboveThreshold(e)||this.nextBackend.sendUnloadRequest(e)},e.prototype.sendRequestSynchronous=function(e){this.updateSampleBeforeSending(e),this.isSequenceNumberAboveThreshold(e)||this.nextBackend.sendRequestSynchronous(e)},e.prototype.sendAdRequest=function(e){this.isSequenceNumberAboveThreshold(e)||this.nextBackend.sendAdRequest(e)},e.prototype.updateSampleBeforeSending=function(e){e.sequenceNumber=this.sequenceNumber++},e.prototype.isSequenceNumberAboveThreshold=function(e){var t;return(null!==(t=e.sequenceNumber)&&void 0!==t?t:0)>i.SEQUENCE_NUMBER_LIMIT},e}();t.SequenceNumberBackend=a},847:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateCookieMaxAgeValue=t.validateCookieDomainValue=t.SessionPersistenceHandler=t.COOKIE_DEFAULT_MAX_AGE=t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID=void 0;var i=n(3848),a=n(1460),r=n(1820),o=n(5063),s=n(2982);t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID="bitmovin_analytics_uuid",t.COOKIE_DEFAULT_MAX_AGE=31536e3;var l=function(e){var n=e.config;if(!1===(null==n?void 0:n.cookiesEnabled))return(0,i.deleteCookie)(t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID),void(this.userId=(0,s.generateUUID)());var a=(0,i.getCookie)(t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID);this.userId=(0,o.isNotNullish)(a)&&!(0,r.isBlank)(a)?a:(0,s.generateUUID)();var l=(0,t.validateCookieDomainValue)(null==n?void 0:n.cookiesDomain),u=(0,t.validateCookieMaxAgeValue)(null==n?void 0:n.cookiesMaxAge),c=Date.now(),d=new Date(c+1e3*u).toUTCString();(0,i.setCookie)(t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID,this.userId,{domain:l,expires:d,maxAge:u})};t.SessionPersistenceHandler=l;t.validateCookieDomainValue=function(e){if(!(0,o.isNullish)(e)&&(0,r.isValidString)(e)&&!(0,r.isBlank)(e))return encodeURIComponent(e)};t.validateCookieMaxAgeValue=function(e){return(0,o.isNullish)(e)?t.COOKIE_DEFAULT_MAX_AGE:(0,a.isNumber)(e)?e:t.COOKIE_DEFAULT_MAX_AGE}},4916:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceInfoFallbackService=void 0;var i=n(1820),a=n(5063),r=function(){function e(){}return e.prototype.reset=function(){this.streamFormat=void 0,this.audioCodec=void 0,this.videoCodec=void 0},e.prototype.setStreamFormat=function(e){this.streamFormat=e},e.prototype.applyStreamFormat=function(e){(0,i.isBlank)(this.streamFormat)||(e.streamFormat=this.streamFormat)},e.prototype.applyAndStoreCodecInfo=function(e,t){(0,a.isNotNullish)(null==t?void 0:t.audioCodec)&&(this.audioCodec=t.audioCodec),(0,a.isNotNullish)(null==t?void 0:t.videoCodec)&&(this.videoCodec=t.videoCodec),(0,i.isBlank)(this.audioCodec)||(e.audioCodec=this.audioCodec),(0,i.isBlank)(this.videoCodec)||(e.videoCodec=this.videoCodec)},e}();t.SourceInfoFallbackService=r},6743:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,a=n(5063);!function(e){e[e.None=0]="None",e[e.Overlapping=1]="Overlapping",e[e.FirstContainedInSecond=2]="FirstContainedInSecond",e[e.SecondContainedInFirst=3]="SecondContainedInFirst"}(i||(i={}));var r=function(){function e(){this.watched=[],this.videoDuration=null}return e.prototype.reset=function(){this.watched=[]},e.prototype.setVideoDuration=function(e){this.videoDuration=1e3*e},e.prototype.addWatched=function(e){if((0,a.isNullish)(this.videoDuration))throw new Error("no video duration set for completion tracker");this.watched.push(e);var t=this.mergeWatched(this.watched);return(this.getDuration(e)-t)/this.videoDuration},e.prototype.getCompletionPercentage=function(){if((0,a.isNullish)(this.videoDuration))throw new Error("no video duration set for completion tracker");for(var e=0,t=0,n=this.watched;t<n.length;t++){var i=n[t];e+=this.getDuration(i)}return e/this.videoDuration},e.prototype.mergeWatched=function(e){for(var t=0;t<e.length;t++)for(var n=e[t],a=t+1;a<e.length;a++){var r=e[a],o=0,s=this.getOverlappingType(n,r);if(s===i.Overlapping?(this.mergeAndReplace(n,t,r,a),o=this.getOverlappingTimespan(n,r)):s===i.FirstContainedInSecond?(this.watched.splice(t,1),o=this.getDuration(n)):s===i.SecondContainedInFirst&&(this.watched.splice(a,1),o=this.getDuration(r)),s!==i.None)return o+this.mergeWatched(this.watched)}return 0},e.prototype.getOverlappingType=function(e,t){return this.isMomentInTimespan(e.end,t)&&e.start<t.start||this.isMomentInTimespan(e.start,t)&&e.end>t.end?i.Overlapping:this.isMomentInTimespan(e.start,t)&&this.isMomentInTimespan(e.end,t)?i.FirstContainedInSecond:this.isMomentInTimespan(t.start,e)&&this.isMomentInTimespan(t.end,e)?i.SecondContainedInFirst:i.None},e.prototype.isMomentInTimespan=function(e,t){return e>=t.start&&e<t.end},e.prototype.mergeAndReplace=function(e,t,n,i){var a=e.end>n.end?e.end:n.end,r={start:e.start<n.start?e.start:n.start,end:a};this.watched.splice(t,1,r),this.watched.splice(i,1)},e.prototype.getOverlappingTimespan=function(e,t){return(e.end<t.end?e.end:t.end)-(e.start>=t.start?e.start:t.start)},e.prototype.getDuration=function(e){return Math.abs(e.end-e.start)},e}();t.default=r},4300:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.SsaiService=void 0;var a,r=n(3588),o=n(3458),s=n(5529),l=n(5063),u=n(2982),c=n(7906);!function(e){e[e.AD_BREAK_STARTED=0]="AD_BREAK_STARTED",e[e.ACTIVE=1]="ACTIVE",e[e.IDLE=2]="IDLE"}(a||(a={}));var d=function(){function e(){this.eventHandler=void 0,this.adIndex=-1,this.state=a.IDLE,this.isFirstSampleOfAd=!1,this.sentAdQuartiles=[],this.errorSent=!1}return e.prototype.activate=function(e){this.eventHandler=e},e.prototype.adBreakStart=function(e){E(this.eventHandler)&&this.state==a.IDLE&&(this.state=a.AD_BREAK_STARTED,this.currentAdMetadata=i({},e))},e.prototype.adStart=function(e){var t;if(E(this.eventHandler)&&this.state!=a.IDLE){var n=(new Date).getTime(),i=this.eventHandler.getPlayerCurrentTime();this.eventHandler.reportPlaybackInteraction(n,i),this.state=a.ACTIVE,this.isFirstSampleOfAd=!0,this.adIndex++,this.resetAdData(),this.currentAdMetadata={adPosition:null===(t=this.currentAdMetadata)||void 0===t?void 0:t.adPosition,adId:null==e?void 0:e.adId,adSystem:null==e?void 0:e.adSystem,customData:null==e?void 0:e.customData},this.currentAdImpressionId=(0,u.generateUUID)(),this.timestampOfAdStart=(0,c.getCurrentMonotonicTimestampInMs)(),this.eventHandler.reportEngagementInteraction({type:"started",adIndex:this.adIndex,currentAdImpressionId:this.currentAdImpressionId,currentAdMetadata:(0,l.isNotNullish)(this.currentAdMetadata)?this.currentAdMetadata:{}})}},e.prototype.adQuartileFinished=function(e,t){E(this.eventHandler)&&this.state==a.ACTIVE&&(this.sentAdQuartiles.includes(e)||(this.eventHandler.reportEngagementInteraction({type:"quartile",adIndex:this.adIndex,currentAdImpressionId:this.currentAdImpressionId,currentAdMetadata:(0,l.isNotNullish)(this.currentAdMetadata)?this.currentAdMetadata:{},quartile:e,quartileMetadata:t,timeSinceAdStartedInMs:(0,c.getMonotonicTimestampInMsSince)(this.timestampOfAdStart)}),this.sentAdQuartiles.push(e)))},e.prototype.adBreakEnd=function(){if(E(this.eventHandler)&&this.state!=a.IDLE){if(this.state==a.ACTIVE){var e=(new Date).getTime(),t=this.eventHandler.getPlayerCurrentTime();this.eventHandler.reportPlaybackInteraction(e,t)}this.resetAdBreakData()}},e.prototype.manipulate=function(e){var t,n,i,o;if(E(this.eventHandler)&&this.state==a.ACTIVE){e.ad=r.AD_TYPE.SSAI,e.adId=null===(t=this.currentAdMetadata)||void 0===t?void 0:t.adId,e.adSystem=null===(n=this.currentAdMetadata)||void 0===n?void 0:n.adSystem,e.adPosition=null===(i=this.currentAdMetadata)||void 0===i?void 0:i.adPosition,this.isFirstSampleOfAd&&(e.adIndex=this.adIndex,this.isFirstSampleOfAd=!1);var u=null===(o=this.currentAdMetadata)||void 0===o?void 0:o.customData;(0,l.isNotNullish)(u)&&s.customDataValuesKeys.forEach((function(t){u[t]&&(e[t]=u[t])})),e[c.SSAI_RELATED_SAMPLE_MARKER]=!0}},e.prototype.sendAdEngagementErrorSample=function(e,t){E(this.eventHandler)&&this.state===a.ACTIVE&&(this.errorSent||e.code!==o.ErrorCode.QUALITY_CHANGE_THRESHOLD_EXCEEDED.code&&(this.eventHandler.reportEngagementInteraction({type:"error",adIndex:this.adIndex,currentAdImpressionId:this.currentAdImpressionId,currentAdMetadata:(0,l.isNotNullish)(this.currentAdMetadata)?this.currentAdMetadata:{},analyticsError:e,originalError:t,timeSinceAdStartedInMs:(0,c.getMonotonicTimestampInMsSince)(this.timestampOfAdStart)}),this.errorSent=!0))},e.prototype.isInActiveState=function(){return this.state===a.ACTIVE},e.prototype.resetSourceRelatedState=function(){this.resetAdBreakData(),this.adIndex=-1},e.prototype.resetAdBreakData=function(){this.state=a.IDLE,this.isFirstSampleOfAd=!1,delete this.currentAdMetadata,this.resetAdData()},e.prototype.resetAdData=function(){var e,t,n;null===(e=this.currentAdMetadata)||void 0===e||delete e.customData,null===(t=this.currentAdMetadata)||void 0===t||delete t.adId,null===(n=this.currentAdMetadata)||void 0===n||delete n.adSystem,this.errorSent=!1,this.currentAdImpressionId=void 0,this.sentAdQuartiles=[],this.timestampOfAdStart=void 0},e}();function E(e){return(0,l.isNotNullish)(e)}t.SsaiService=d},6398:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAdPosition=s,t.hasValidSsaiAdBreakMetadataStructure=function(e){if((0,o.isNullish)(e))return!0;if(!(0,o.isPlainObject)(e))return a.logger.errorMessageToUser("Invalid SsaiAdBreakMetadata: not a plain object"),!1;var t=e;if((0,o.isNotNullish)(t.adPosition)&&!s(t.adPosition))return a.logger.errorMessageToUser("Invalid SsaiAdBreakMetadata: 'adPosition' property is not valid"),!1;return!0},t.simplySanitizeSsaiAdBreakMetadata=function(e){if((0,o.isNullish)(e))return;return{adPosition:e.adPosition}},t.hasValidSsaiAdMetadataStructure=function(e){if((0,o.isNullish)(e))return!0;if(!(0,o.isPlainObject)(e))return a.logger.errorMessageToUser("Invalid SsaiAdMetadata: not a plain object"),!1;var t=e;if((0,o.isNotNullish)(t.adId)&&!(0,r.isValidString)(t.adId))return a.logger.errorMessageToUser("Invalid SsaiAdMetadata: 'adId' property is not string"),!1;if((0,o.isNotNullish)(t.adSystem)&&!(0,r.isValidString)(t.adSystem))return a.logger.errorMessageToUser("Invalid SsaiAdMetadata: 'adSystem' property is not string"),!1;if((0,o.isNotNullish)(t.customData)&&!(0,o.isPlainObject)(t.customData))return a.logger.errorMessageToUser("Invalid SsaiAdMetadata: 'customData' property is not a plain object"),!1;return!0},t.simplySanitizeSsaiAdMetadata=function(e){if((0,o.isNullish)(e))return;var t=void 0;(0,o.isNotNullish)(e.customData)&&(t=(0,i.sanitizeCustomDataValues)(e.customData));return{adId:e.adId,adSystem:e.adSystem,customData:t}},t.isSsaiAdQuartile=l,t.hasValidSsaiAdQuartileStructure=function(e){if(!l(e))return a.logger.errorMessageToUser("Invalid SsaiAdQuartile"),!1;return!0},t.sanitizeSsaiAdQuartileMetadata=function(e){if((0,o.isNullish)(e))return{};if(!(0,o.isPlainObject)(e))return a.logger.errorMessageToUser("Invalid SsaiAdQuartileMetadata: not a plain object"),{};var t={failedBeaconUrl:e.failedBeaconUrl};(0,r.isValidString)(t.failedBeaconUrl)?t.failedBeaconUrl=t.failedBeaconUrl.substring(0,500):(a.logger.errorMessageToUser("Invalid SsaiAdQuartileMetadata: 'failedBeaconUrl' property is not string"),t.failedBeaconUrl=void 0);return t};var i=n(5529),a=n(1916),r=n(1820),o=n(5063);function s(e){return"preroll"===e||"midroll"===e||"postroll"===e}function l(e){return"first"===e||"midpoint"===e||"third"===e||"completed"===e}},8918:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSsaiEngagementErrorData=function(e){return"error"===e.type},t.isSsaiEngagementQuartileData=function(e){return"quartile"===e.type},t.isSsaiEngagementStartedData=function(e){return"started"===e.type}},7906:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.ROUTING_URL_PARAM_VALUE_SSAI=t.ROUTING_URL_PARAM=t.SSAI_RELATED_SAMPLE_MARKER=void 0,t.isSsaiRelatedSample=function(e){if(e[t.SSAI_RELATED_SAMPLE_MARKER])return delete e[t.SSAI_RELATED_SAMPLE_MARKER],!0;if(2===e.adType)return!0;return!1},t.appendSsaiRoutingParam=function(e){return"".concat(e,"?").concat(t.ROUTING_URL_PARAM,"=").concat(t.ROUTING_URL_PARAM_VALUE_SSAI)},t.createErrorAdSample=function(e,t){return s({playbackSample:e,currentAdImpressionId:t.currentAdImpressionId,adIndex:t.adIndex,currentAdMetadata:t.currentAdMetadata,quartile:void 0,quartileMetadata:void 0,errorCode:t.analyticsError.code,errorMessage:t.analyticsError.message,errorSeverity:t.analyticsError.severity,timeSinceAdStartedInMs:t.timeSinceAdStartedInMs})},t.createStartedAdSample=function(e,t){return s({playbackSample:e,currentAdImpressionId:t.currentAdImpressionId,adIndex:t.adIndex,currentAdMetadata:t.currentAdMetadata,quartile:"started",quartileMetadata:void 0,errorCode:void 0,errorMessage:void 0,errorSeverity:void 0,timeSinceAdStartedInMs:void 0})},t.createQuartileAdSample=function(e,t){return s({playbackSample:e,currentAdImpressionId:t.currentAdImpressionId,adIndex:t.adIndex,currentAdMetadata:t.currentAdMetadata,quartile:t.quartile,quartileMetadata:t.quartileMetadata,timeSinceAdStartedInMs:t.timeSinceAdStartedInMs,errorCode:void 0,errorMessage:void 0,errorSeverity:void 0})},t.getCurrentMonotonicTimestampInMs=l,t.getMonotonicTimestampInMsSince=function(e){if((0,o.isNullish)(e))return;return l()-e};var a=n(5529),r=n(9422),o=n(5063);function s(e){var t,n=e.playbackSample,r=e.currentAdImpressionId,s=e.adIndex,l=e.currentAdMetadata,u=e.quartile,c=e.quartileMetadata,d=e.errorCode,E=e.errorMessage,p=e.errorSeverity,v=e.timeSinceAdStartedInMs,h=i(i({},{audioBitrate:null==(t=n)?void 0:t.audioBitrate,analyticsVersion:null==t?void 0:t.analyticsVersion,adPlaybackHeight:null==t?void 0:t.videoPlaybackHeight,adPlaybackWidth:null==t?void 0:t.videoPlaybackWidth,cdnProvider:null==t?void 0:t.cdnProvider,customData1:null==t?void 0:t.customData1,customData2:null==t?void 0:t.customData2,customData3:null==t?void 0:t.customData3,customData4:null==t?void 0:t.customData4,customData5:null==t?void 0:t.customData5,customData6:null==t?void 0:t.customData6,customData7:null==t?void 0:t.customData7,customData8:null==t?void 0:t.customData8,customData9:null==t?void 0:t.customData9,customData10:null==t?void 0:t.customData10,customData11:null==t?void 0:t.customData11,customData12:null==t?void 0:t.customData12,customData13:null==t?void 0:t.customData13,customData14:null==t?void 0:t.customData14,customData15:null==t?void 0:t.customData15,customData16:null==t?void 0:t.customData16,customData17:null==t?void 0:t.customData17,customData18:null==t?void 0:t.customData18,customData19:null==t?void 0:t.customData19,customData20:null==t?void 0:t.customData20,customData21:null==t?void 0:t.customData21,customData22:null==t?void 0:t.customData22,customData23:null==t?void 0:t.customData23,customData24:null==t?void 0:t.customData24,customData25:null==t?void 0:t.customData25,customData26:null==t?void 0:t.customData26,customData27:null==t?void 0:t.customData27,customData28:null==t?void 0:t.customData28,customData29:null==t?void 0:t.customData29,customData30:null==t?void 0:t.customData30,customData31:null==t?void 0:t.customData31,customData32:null==t?void 0:t.customData32,customData33:null==t?void 0:t.customData33,customData34:null==t?void 0:t.customData34,customData35:null==t?void 0:t.customData35,customData36:null==t?void 0:t.customData36,customData37:null==t?void 0:t.customData37,customData38:null==t?void 0:t.customData38,customData39:null==t?void 0:t.customData39,customData40:null==t?void 0:t.customData40,customData41:null==t?void 0:t.customData41,customData42:null==t?void 0:t.customData42,customData43:null==t?void 0:t.customData43,customData44:null==t?void 0:t.customData44,customData45:null==t?void 0:t.customData45,customData46:null==t?void 0:t.customData46,customData47:null==t?void 0:t.customData47,customData48:null==t?void 0:t.customData48,customData49:null==t?void 0:t.customData49,customData50:null==t?void 0:t.customData50,customData51:null==t?void 0:t.customData51,customData52:null==t?void 0:t.customData52,customData53:null==t?void 0:t.customData53,customData54:null==t?void 0:t.customData54,customData55:null==t?void 0:t.customData55,customData56:null==t?void 0:t.customData56,customData57:null==t?void 0:t.customData57,customData58:null==t?void 0:t.customData58,customData59:null==t?void 0:t.customData59,customData60:null==t?void 0:t.customData60,customData61:null==t?void 0:t.customData61,customData62:null==t?void 0:t.customData62,customData63:null==t?void 0:t.customData63,customData64:null==t?void 0:t.customData64,customData65:null==t?void 0:t.customData65,customData66:null==t?void 0:t.customData66,customData67:null==t?void 0:t.customData67,customData68:null==t?void 0:t.customData68,customData69:null==t?void 0:t.customData69,customData70:null==t?void 0:t.customData70,customData71:null==t?void 0:t.customData71,customData72:null==t?void 0:t.customData72,customData73:null==t?void 0:t.customData73,customData74:null==t?void 0:t.customData74,customData75:null==t?void 0:t.customData75,customData76:null==t?void 0:t.customData76,customData77:null==t?void 0:t.customData77,customData78:null==t?void 0:t.customData78,customData79:null==t?void 0:t.customData79,customData80:null==t?void 0:t.customData80,customData81:null==t?void 0:t.customData81,customData82:null==t?void 0:t.customData82,customData83:null==t?void 0:t.customData83,customData84:null==t?void 0:t.customData84,customData85:null==t?void 0:t.customData85,customData86:null==t?void 0:t.customData86,customData87:null==t?void 0:t.customData87,customData88:null==t?void 0:t.customData88,customData89:null==t?void 0:t.customData89,customData90:null==t?void 0:t.customData90,customData91:null==t?void 0:t.customData91,customData92:null==t?void 0:t.customData92,customData93:null==t?void 0:t.customData93,customData94:null==t?void 0:t.customData94,customData95:null==t?void 0:t.customData95,customData96:null==t?void 0:t.customData96,customData97:null==t?void 0:t.customData97,customData98:null==t?void 0:t.customData98,customData99:null==t?void 0:t.customData99,customData100:null==t?void 0:t.customData100,customUserId:null==t?void 0:t.customUserId,domain:null==t?void 0:t.domain,experimentName:null==t?void 0:t.experimentName,key:null==t?void 0:t.key,language:null==t?void 0:t.language,path:null==t?void 0:t.path,platform:null==t?void 0:t.platform,player:null==t?void 0:t.player,playerKey:null==t?void 0:t.playerKey,playerTech:null==t?void 0:t.playerTech,size:null==t?void 0:t.size,screenHeight:null==t?void 0:t.screenHeight,screenWidth:null==t?void 0:t.screenWidth,streamFormat:null==t?void 0:t.streamFormat,userAgent:null==t?void 0:t.userAgent,userId:null==t?void 0:t.userId,version:null==t?void 0:t.version,videoBitrate:null==t?void 0:t.videoBitrate,videoId:null==t?void 0:t.videoId,videoImpressionId:null==t?void 0:t.impressionId,videoTitle:null==t?void 0:t.videoTitle,videoWindowHeight:null==t?void 0:t.videoWindowHeight,videoWindowWidth:null==t?void 0:t.videoWindowWidth}),{adId:null==l?void 0:l.adId,adImpressionId:r,adIndex:s,adPosition:null==l?void 0:l.adPosition,adSystem:null==l?void 0:l.adSystem,adType:2,errorCode:d,errorMessage:E,errorSeverity:p,time:Date.now(),timeSinceAdStartedInMs:v});switch(u){case"started":h.started=1;break;case"first":h.quartile1=1,h.quartile1FailedBeaconUrl=null==c?void 0:c.failedBeaconUrl;break;case"midpoint":h.midpoint=1,h.midpointFailedBeaconUrl=null==c?void 0:c.failedBeaconUrl;break;case"third":h.quartile3=1,h.quartile3FailedBeaconUrl=null==c?void 0:c.failedBeaconUrl;break;case"completed":h.completed=1,h.completedFailedBeaconUrl=null==c?void 0:c.failedBeaconUrl}var f=null==l?void 0:l.customData;return(0,o.isNotNullish)(f)&&a.customDataValuesKeys.forEach((function(e){f[e]&&(h[e]=f[e])})),h}function l(){var e=(0,r.getGlobalPerformanceNow)();return(0,o.isNullish)(e)?Date.now():Math.floor(e)}t.SSAI_RELATED_SAMPLE_MARKER="triggeredBySsai",t.ROUTING_URL_PARAM="routingParam",t.ROUTING_URL_PARAM_VALUE_SSAI="ssai"},3588:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AD_TYPE=void 0,function(e){e[e.NO_AD=0]="NO_AD",e[e.CSAI=1]="CSAI",e[e.SSAI=2]="SSAI"}(n||(t.AD_TYPE=n={}))},4355:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.CdnProvider=void 0,function(e){e.AKAMAI="akamai",e.BITGRAVITY="bitgravity",e.CHINACACHE="chinacache",e.CLOUDFLARE="cloudflare",e.CLOUDFRONT="cloudfront",e.FASTLY="fastly",e.MAXCDN="maxcdn"}(n||(t.CdnProvider=n={}))},5878:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.CastTech=void 0,function(e){e.AirPlay="AirPlay",e.GoogleCast="GoogleCast",e.WebSocket="WebSocket"}(n||(t.CastTech=n={}))},5626:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isVideoCodec=function(e){if(!e)return!1;return-1!==n.findIndex((function(t){return e.startsWith(t)}))},t.isAudioCodec=function(e){if(!e)return!1;return-1!==i.findIndex((function(t){return e.startsWith(t)}))};var n=["avc1","avc3","hvc1","av01","av1","hev1","vp9"],i=["mp4a","ec-3","ac-3","opus","audio/mp4"]},3458:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorCode=void 0;var n=function(){function e(e,t,n){void 0===n&&(n="CRITICAL"),this.code=e,this.message=t,this.errorSeverity=n}return e.BITMOVIN_PLAYER_LICENSING_ERROR=new e(1103,""),e.SETUP_MISSING_LICENSE_WHITELIST=new e(1105,""),e.QUALITY_CHANGE_THRESHOLD_EXCEEDED=new e(1e4,"ANALYTICS_QUALITY_CHANGE_THRESHOLD_EXCEEDED","INFO"),e.BUFFERING_TIMEOUT_REACHED=new e(10001,"ANALYTICS_BUFFERING_TIMEOUT_REACHED"),e.VIDEO_STARTUP_TIMEOUT_REACHED=new e(10002,"ANALYTICS_VIDEOSTART_TIMEOUT_REACHED"),e}();t.ErrorCode=n},2361:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Event=t.JSM_INITIAL_EVENT=void 0,t.JSM_INITIAL_EVENT="jsm-initial",function(e){e.AUDIO_CHANGE="audioChange",e.AUDIOTRACK_CHANGED="audioTrackChanged",e.CUSTOM_DATA_CHANGE="customDataChange",e.END="end",e.END_AD="adEnd",e.END_BUFFERING="endBuffering",e.END_CAST="endCasting",e.END_FULLSCREEN="endFullscreen",e.ERROR="playerError",e.FINISH_QUALITY_CHANGE="finishQualityChange",e.LOADSTART_AUTOPLAY="loadstartAutoplay",e.MANUAL_SOURCE_CHANGE="manualSourceChangeInitiated",e.MUTE="mute",e.PAUSE="pause",e.PLAY="play",e.PLAYING="playing",e.READY="ready",e.SCREEN_RESIZE="resize",e.SEEK="seek",e.SEEKED="seeked",e.SOURCE_LOADED="sourceLoaded",e.SOURCE_UNLOADED="sourceUnloaded",e.START_AD="adStart",e.START_BUFFERING="startBuffering",e.START_CAST="startCasting",e.START_FULLSCREEN="startFullscreen",e.SUBTITLE_CHANGE="subtitleChange",e.TIMECHANGED="timechanged",e.UN_MUTE="unMute",e.UNLOAD="unload",e.VIDEO_CHANGE="videoChange",e.VIDEOSTART_TIMEOUT="VIDEOSTART_TIMEOUT"}(n||(t.Event=n={}))},2168:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MIMETypes=void 0,t.getMIMETypeFromFileExtension=function(e){var n=e.split(/[?#]/)[0].toLowerCase();if((0,i.endsWith)(n,".m3u8"))return t.MIMETypes.HLS;if((0,i.endsWith)(n,".mp4")||(0,i.endsWith)(n,".m4v")||(0,i.endsWith)(n,".m4a"))return t.MIMETypes.MP4;if((0,i.endsWith)(n,".webm"))return t.MIMETypes.WEBM;if((0,i.endsWith)(n,".mpd"))return t.MIMETypes.DASH;return};var i=n(1820);t.MIMETypes={MP4:"video/mp4",WEBM:"video/webm",HLS:"application/x-mpegURL",DASH:"application/dash+xml"}},9946:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PAGE_LOAD_TYPE=void 0,function(e){e[e.FOREGROUND=1]="FOREGROUND",e[e.BACKGROUND=2]="BACKGROUND"}(n||(t.PAGE_LOAD_TYPE=n={}))},556:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Player=void 0,function(e){e.AMAZON_IVS="amazonivs",e.BITMOVIN="bitmovin",e.BITMOVIN_PWX="bitmovin-pwx",e.CHROMECAST_SHAKA="chromecast-shaka",e.DASHJS="dashjs",e.HLSJS="hlsjs",e.HTML5="html5",e.JW="jw",e.RADIANT="radiant",e.SHAKA="shaka",e.THEOPLAYER="theoplayer",e.VIDEOJS="videojs"}(n||(t.Player=n={}))},8525:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PlayerSize=void 0,function(e){e.Fullscreen="FULLSCREEN",e.Window="WINDOW"}(n||(t.PlayerSize=n={}))},7224:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamTypes=void 0,t.getStreamTypesFromURL=function(e){if((0,r.isNullish)(e)||(0,a.isBlank)(e))return;var t=e.split(/[?#]/)[0].toLowerCase();if((0,a.endsWith)(t,".m3u8"))return i.hls;if((0,a.endsWith)(t,".mp4")||(0,a.endsWith)(t,".m4v")||(0,a.endsWith)(t,".m4a"))return i.prog;if((0,a.endsWith)(t,".webm"))return i.prog;if((0,a.endsWith)(t,".mpd"))return i.dash;return},t.getStreamTypeFromMIMEType=function(e){var t;return((t={})[o.MIMETypes.MP4]=i.prog,t[o.MIMETypes.WEBM]=i.prog,t[o.MIMETypes.HLS]=i.hls,t[o.MIMETypes.DASH]=i.dash,t)[e]};var i,a=n(1820),r=n(5063),o=n(2168);!function(e){e.dash="dash",e.hls="hls",e.prog="progressive"}(i||(t.StreamTypes=i={}))},3565:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VideoStartFailedReason=void 0,t.createVideoStartFailedReason=function(e){switch(e){case a.Event.ERROR:return i.PLAYER_ERROR;case a.Event.UNLOAD:case a.Event.MANUAL_SOURCE_CHANGE:case a.Event.SOURCE_UNLOADED:return i.PAGE_CLOSED;case a.Event.VIDEOSTART_TIMEOUT:return i.TIMEOUT;default:return i.UNKNOWN}};var i,a=n(2361);!function(e){e.PAGE_CLOSED="PAGE_CLOSED",e.PLAYER_ERROR="PLAYER_ERROR",e.TIMEOUT="TIMEOUT",e.UNKNOWN="UNKNOWN"}(i||(t.VideoStartFailedReason=i={}))},348:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Feature=void 0;var i=n(5063),a=function(){function e(){this._config=void 0,this._isEnabled=!0}return Object.defineProperty(e.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._isEnabled},enumerable:!1,configurable:!0}),e.prototype.disable=function(){this._isEnabled=!1,this.disabled()},e.prototype.configure=function(e,t){return(0,i.isNotNullish)(t)&&(this._config=this.extractConfig(t)),this.configured(e,this._config),this._config},e}();t.Feature=a},6845:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FeatureManager=void 0;var i=n(1916),a=function(){function e(){this.features=[]}return e.prototype.registerFeatures=function(e){this.features=e},e.prototype.unregisterFeatures=function(){this.features.forEach((function(e){return e.disable()})),this.features=[]},e.prototype.resetFeatures=function(){this.features.forEach((function(e){return e.reset()}))},e.prototype.configureFeatures=function(e,t){this.features=this.features.filter((function(n){var a=n.configure(e,t);return!(!e||!0!==(null==a?void 0:a.enabled))||(i.logger.log("Disabling feature ".concat(n.constructor.name," as it isn't enabled according to license callback.")),n.disable(),!1)})),this.features.forEach((function(e){return e.enabled()}))},e}();t.FeatureManager=a},7614:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)},a=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,a=0,r=t.length;a<r;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorDetailBackend=void 0;var r=n(92),o=n(4649),s=n(5063),l=function(){function e(e){var t;this._queue=[],this._enabled=!1,this.backendUrl=(0,s.joinUrls)(null!==(t=null==e?void 0:e.backendUrl)&&void 0!==t?t:o.ANALYTICS_BACKEND_BASE_URL,"/analytics/error")}return Object.defineProperty(e.prototype,"queue",{get:function(){return this._queue},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(e){this._enabled=e},enumerable:!1,configurable:!0}),e.copyErrorDetailTruncateStringsAndUrls=function(e,t,n){var a,r,o=this;return i(i({},e),{message:null===(a=e.message)||void 0===a?void 0:a.substr(0,t),data:this.copyErrorDataTruncateStrings(e.data,t),httpRequests:null===(r=e.httpRequests)||void 0===r?void 0:r.map((function(e){return o.copyHttpRequestTruncateUrls(e,n)}))})},e.copyHttpRequestTruncateUrls=function(e,t){var n,a;return i(i({},e),{url:null===(n=e.url)||void 0===n?void 0:n.substr(0,t),lastRedirectLocation:null===(a=e.lastRedirectLocation)||void 0===a?void 0:a.substr(0,t)})},e.copyErrorDataTruncateStrings=function(e,t){var n,a;return i(i({},e),{exceptionMessage:null===(n=e.exceptionMessage)||void 0===n?void 0:n.substr(0,t),additionalData:null===(a=e.additionalData)||void 0===a?void 0:a.substr(0,t)})},e.copyErrorDetailTruncateHttpRequests=function(e,t){var n;return i(i({},e),{httpRequests:null===(n=e.httpRequests)||void 0===n?void 0:n.slice(-t)})},e.prototype.limitHttpRequestsOfQueuedErrorDetails=function(t){var n=this;this._queue.forEach((function(i,a){n._queue[a]=e.copyErrorDetailTruncateHttpRequests(i,t)}))},e.prototype.send=function(t){var n=e.copyErrorDetailTruncateStringsAndUrls(t,e.MAX_STRING_LENGTH,e.MAX_URL_LENGTH);this.enabled?(0,r.post)(this.backendUrl,n,(function(){})):this._queue.push(n)},e.prototype.flush=function(){for(var e=a([],this._queue,!0),t=e.shift();(0,s.isNotNullish)(t);)this.removeFromQueue(t),this.send(t),t=e.shift()},e.prototype.clear=function(){this._queue.splice(0,this._queue.length)},e.prototype.removeFromQueue=function(e){var t=this._queue.findIndex((function(t){return t===e}));t>=0&&this._queue.splice(t,1)},e.MAX_URL_LENGTH=450,e.MAX_STRING_LENGTH=2e3,e}();t.ErrorDetailBackend=l},9557:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,a=0,r=t.length;a<r;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorDetailTracking=void 0;var o=n(1916),s=n(5063),l=n(4926),u=function(e){function t(t,n,i,a){var u=e.call(this)||this;return u.settingsProvider=t,u.backend=n,u.subscribables=i,u.httpRequestTracking=a,u.errorIndex=0,u.onErrorHandler=function(e){var t,n;try{if(!u.isEnabled)return;var i=null===(t=u.httpRequestTracking)||void 0===t?void 0:t.httpRequests,a=(0,s.isNullish)(i)?void 0:r([],i,!0),c=u.errorIndex;u.errorIndex++;var d={platform:"web",licenseKey:u.settingsProvider.licenseKey,domain:u.settingsProvider.domain,impressionId:u.settingsProvider.impressionId,analyticsVersion:l.VERSION,errorId:c,timestamp:(0,s.getCurrentTimestamp)(),code:e.code,message:e.message,data:null!==(n=e.errorData)&&void 0!==n?n:{additionalData:void 0,exceptionMessage:void 0,exceptionStacktrace:void 0},httpRequests:a,severity:e.severity};o.logger.log("ErrorDetailTracking.onError: ".concat((0,s.tryJSONStringify)(d))),u.backend.send(d)}catch(e){o.logger.error("ErrorDetailTracking.onError: Error in handler",e)}},i.forEach((function(e){return e.subscribe(u.onErrorHandler)})),u}return a(t,e),t.prototype.reset=function(){var e;null===(e=this.httpRequestTracking)||void 0===e||e.reset(),this.errorIndex=0},t.prototype.enabled=function(){this.backend.enabled=!0,this.backend.flush()},t.prototype.disabled=function(){var e,t=this;this.errorIndex=0,null===(e=this.httpRequestTracking)||void 0===e||e.disable(),this.backend.clear(),this.subscribables.forEach((function(e){return e.unsubscribe(t.onErrorHandler)}))},t.prototype.configured=function(e,t){var n,i,a=Math.max(null!==(n=null==t?void 0:t.numberOfHttpRequests)&&void 0!==n?n:0,0);null===(i=this.httpRequestTracking)||void 0===i||i.configure(a),this.backend.limitHttpRequestsOfQueuedErrorDetails(a)},t.prototype.extractConfig=function(e){return e.errorDetails},t}(n(348).Feature);t.ErrorDetailTracking=u},7881:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRequestTracking=void 0;var i=n(1916),a=n(3129),r=function(){function e(t){var n=this;this.subscribables=t,this._maxRequests=e.DEFAULT_MAX_REQUESTS,this._httpRequestQueue=new a.Queue,this.onDownloadFinishedHandler=function(e){try{n.addRequest(e.httpRequest)}catch(e){i.logger.error("HttpRequestTracking.onDownloadFinished: Error in handler",e)}},t.forEach((function(e){return e.subscribe(n.onDownloadFinishedHandler)}))}return Object.defineProperty(e.prototype,"maxRequests",{get:function(){return this._maxRequests},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"httpRequests",{get:function(){return this._httpRequestQueue.items},enumerable:!1,configurable:!0}),e.prototype.configure=function(e){this._maxRequests=e,this._httpRequestQueue.limit(e)},e.prototype.disable=function(){var e=this;this.subscribables.forEach((function(t){return t.unsubscribe(e.onDownloadFinishedHandler)})),this._httpRequestQueue.clear()},e.prototype.reset=function(){this._httpRequestQueue.clear()},e.prototype.addRequest=function(e){this._httpRequestQueue.offer(e),this._httpRequestQueue.limit(this._maxRequests)},e.DEFAULT_MAX_REQUESTS=10,e}();t.HttpRequestTracking=r},7912:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRequestType=void 0,function(e){e.MANIFEST_DASH="manifest/dash",e.MANIFEST_HLS_MASTER="manifest/hls/master",e.MANIFEST_HLS_VARIANT="manifest/hls/variant",e.MANIFEST_SMOOTH="manifest/smooth",e.MANIFEST_ADS="manifest/ads",e.MEDIA_AUDIO="media/audio",e.MEDIA_VIDEO="media/video",e.MEDIA_SUBTITLES="media/subtitles",e.MEDIA_THUMBNAILS="media/thumbnails",e.MEDIA_SEGMENTINDEX="media/segmentindex",e.DRM_LICENSE_WIDEVINE="drm/license/widevine",e.DRM_LICENSE_PLAYREADY="drm/license/playready",e.DRM_LICENSE_FAIRPLAY="drm/license/fairplay",e.DRM_LICENSE_PRIMETIME="drm/license/primetime",e.DRM_LICENSE_CLEARKEY="drm/license/clearkey",e.DRM_LICENSE_TVKEY="drm/license/tvkey",e.DRM_CERTIFICATE_FAIRPLAY="drm/certificate/fairplay",e.HLS_INTERSTITIALS_ASSET_LIST="hls/interstitials/asset-list",e.KEY_HLS_AES="key/hls/aes",e.TIME_SYNC="time/sync",e.WEBRTC_SDP_REQUEST="webrtc/sdp/request",e.WEBRTC_SDP_ANSWER="webrtc/sdp/answer",e.WEBRTC_SDP_OFFER="webrtc/sdp/offer",e.UNKNOWN="unknown",e.INTERNAL="internal"}(n||(t.HttpRequestType=n={}))},5791:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AdAnalyticsSample=void 0;var i=n(5063),a=function(e){this.platform="web",e&&(this.videoImpressionId=e.impressionId,this.userAgent=e.userAgent,this.language=e.language,this.cdnProvider=e.cdnProvider,i.transferCustomDataFields(e,this),this.customUserId=e.customUserId,this.domain=e.domain,this.experimentName=e.experimentName,this.key=e.key,this.path=e.path,this.player=e.player,this.playerKey=e.playerKey,this.playerTech=e.playerTech,this.screenHeight=e.screenHeight,this.screenWidth=e.screenWidth,this.version=e.version,this.size=e.size,this.userId=e.userId,this.videoId=e.videoId,this.videoTitle=e.videoTitle,this.videoWindowHeight=e.videoWindowHeight,this.videoWindowWidth=e.videoWindowWidth,this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec)};t.AdAnalyticsSample=a},7232:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AdBreakSample=void 0;var i=n(1460),a=n(5063),r=function(e){var t;if(this.adFallbackIndex=0,!(0,a.isNullish)(e)){if(this.adIdPlayer=e.id,this.adReplaceContentDuration=(0,a.calculateTimeWithUndefined)(e.replaceContentDuration),this.adIsPersistent=e.persistent,this.adTagType=e.tagType,this.adTagUrl=e.tagUrl,this.adPreloadOffset=(0,a.calculateTimeWithUndefined)(e.preloadOffset),this.adFallbackIndex=null!==(t=e.fallbackIndex)&&void 0!==t?t:0,this.manifestDownloadTime=(0,a.calculateTimeWithUndefined)(e.manifestDownloadTime),"pre"===e.position||"post"===e.position?this.adPosition=e.position:(0,a.isNotNullish)(e.position)&&(this.adPosition="mid",this.adOffset=e.position),(0,a.isNotNullish)(this.adTagUrl))try{var n=new URL(this.adTagUrl);this.adTagServer=n.hostname,this.adTagPath=n.pathname}catch(e){}(0,i.isFiniteNumber)(e.scheduleTime)&&(this.adScheduleTime=(0,a.calculateTime)(e.scheduleTime))}};t.AdBreakSample=r},4439:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AdSample=void 0;var i=n(5063),a=function(e){var t;if(this.clicked=0,this.closed=0,this.completed=0,this.midpoint=0,this.quartile1=0,this.quartile3=0,this.skipped=0,this.started=0,!(0,i.isNullish)(e)){if(this.adClickthroughUrl=e.clickThroughUrl,this.adId=e.id,this.mediaUrl=e.mediaUrl,this.isLinear=e.isLinear,this.adPlaybackHeight=e.height,this.adPlaybackWidth=e.width,this.streamFormat=e.mimeType,(0,i.isNotNullish)(this.mediaUrl))try{var n=new URL(this.mediaUrl);this.mediaPath=n.pathname,this.mediaServer=n.hostname}catch(e){}(0,i.isNotNullish)(e.bitrate)&&(this.videoBitrate=1e3*e.bitrate);var a=e.vastData;(0,i.isNotNullish)(a)&&(this.adSystem=a.adSystem,this.advertiserName=a.advertiserName,this.apiFramework=a.apiFramework,this.creativeAdId=a.creativeAdId,this.creativeId=a.creativeId,this.universalAdIdRegistry=a.universalAdIdRegistry,this.universalAdIdValue=a.universalAdIdValue,this.adDescription=a.adDescription,this.minSuggestedDuration=(0,i.calculateTimeWithUndefined)(a.minSuggestedDuration),this.surveyUrl=a.surveyUrl,this.adTitle=a.adTitle,this.wrapperAdsCount=a.wrapperAdsCount),this.adSkipAfter=function(e){if(void 0!==e)return-1===e?e:(0,i.calculateTime)(e)}(e.skippableAfter),this.adSkippable=null!==(t=e.skippable)&&void 0!==t?t:(0,i.isNotNullish)(this.adSkipAfter)?this.adSkipAfter>=0:void 0,this.adDuration=(0,i.calculateTimeWithUndefined)(e.duration)}};t.AdSample=a},5529:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeCustomDataValues=t.extractCustomDataFieldsOnly=t.customDataFieldCount=t.customDataValuesKeys=void 0;var i=n(5063);t.customDataValuesKeys=["customData1","customData2","customData3","customData4","customData5","customData6","customData7","customData8","customData9","customData10","customData11","customData12","customData13","customData14","customData15","customData16","customData17","customData18","customData19","customData20","customData21","customData22","customData23","customData24","customData25","customData26","customData27","customData28","customData29","customData30","customData31","customData32","customData33","customData34","customData35","customData36","customData37","customData38","customData39","customData40","customData41","customData42","customData43","customData44","customData45","customData46","customData47","customData48","customData49","customData50","customData51","customData52","customData53","customData54","customData55","customData56","customData57","customData58","customData59","customData60","customData61","customData62","customData63","customData64","customData65","customData66","customData67","customData68","customData69","customData70","customData71","customData72","customData73","customData74","customData75","customData76","customData77","customData78","customData79","customData80","customData81","customData82","customData83","customData84","customData85","customData86","customData87","customData88","customData89","customData90","customData91","customData92","customData93","customData94","customData95","customData96","customData97","customData98","customData99","customData100","experimentName"],t.customDataFieldCount=t.customDataValuesKeys.filter((function(e){return e.match("customData\\d+")})).length;t.extractCustomDataFieldsOnly=function(e){var n={};return t.customDataValuesKeys.forEach((function(t){e[t]&&(n[t]=e[t])})),n};t.sanitizeCustomDataValues=function(e){var n=(0,t.extractCustomDataFieldsOnly)(e),a={};return(0,i.transferCustomDataFields)(n,a),a.experimentName=(0,i.getCustomDataString)(n.experimentName),a}},4501:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LicensingResult=void 0,function(e){e.Denied="denied",e.Granted="granted",e.Skip="skip"}(n||(t.LicensingResult=n={}))},3413:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeVideoDuration=function(e){if((0,a.isNullish)(e)||Number.isNaN(e)||e===1/0)return 0;return e},t.buildPlaybackInfoStreamTypeFields=function(e,t){var n={streamFormat:null!=e?e:void 0,progUrl:t};if((0,a.isNullish)(e))return n;if(e===i.StreamTypes.dash)return{streamFormat:e,mpdUrl:t};if(e===i.StreamTypes.hls)return{streamFormat:e,m3u8Url:t};if(e===i.StreamTypes.prog)return{streamFormat:e,progUrl:t};return n};var i=n(7224),a=n(5063)},9352:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.hasValidSourceMetadataStructure=function(e){if((0,o.isNullish)(e))return!0;if(!(0,o.isPlainObject)(e))return a.logger.errorMessageToUser("Invalid SourceMetadata: not a plain object"),!1;var t=e;if((0,o.isNotNullish)(t.customData)&&!(0,o.isPlainObject)(t.customData))return a.logger.errorMessageToUser("Invalid SourceMetadata: 'customData' property is not a plain object"),!1;return!0},t.sanitizeSourceMetadata=function(e){if((0,o.isNullish)(e))return{};var t={};"title"in e&&(t=i(i({},t),{title:(0,r.isValidString)(e.title)?e.title:void 0}));"videoId"in e&&(t=i(i({},t),{videoId:(0,r.isValidString)(e.videoId)?e.videoId:void 0}));"cdnProvider"in e&&(t=i(i({},t),{cdnProvider:(0,r.isValidString)(e.cdnProvider)?e.cdnProvider:void 0}));"path"in e&&(t=i(i({},t),{path:(0,r.isValidString)(e.path)?e.path:void 0}));"isLive"in e&&(t=i(i({},t),{isLive:(0,o.isBoolean)(e.isLive)?e.isLive:void 0}));"customData"in e&&(t=i(i({},t),{customData:(0,o.isNotNullish)(e.customData)?(0,s.sanitizeCustomDataValues)(e.customData):void 0}));return t};var a=n(1916),r=n(1820),o=n(5063),s=n(5529)},4820:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultStateMachineCallbacks=void 0,t.defaultStateMachineCallbacks={setup:function(){},startup:function(){},programChange:function(){},updateSourceMetadata:function(){},playing:function(){},heartbeat:function(){},qualitychange:function(){},updateSampleQualityInfo:function(){},audiotrack_changing:function(){},pause:function(){},seeking:function(){},rebuffering:function(){},error:function(){},end:function(){},unload:function(){},ad:function(){},mute:function(){},unMute:function(){},subtitle_changing:function(){},setVideoTimeEndFromEvent:function(){},setVideoTimeStartFromEvent:function(){},videoStartFailed:function(){},startCasting:function(){},casting:function(){},manualSourceChange:function(){},initialSourceChange:function(){},muting_ready:function(){},customdatachange:function(){},release:function(){}}},716:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDifferentSubtitleInfo=void 0;var i=n(5063);t.isDifferentSubtitleInfo=function(e,t){return(!(0,i.isNullish)(e)||!(0,i.isNullish)(t))&&!((0,i.isNotNullish)(e)&&(0,i.isNotNullish)(t)&&e.enabled===t.enabled&&e.language===t.language)}},5426:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsCall=void 0;var i=n(7906),a=n(5923),r=n(92),o=n(5063),s=function(){function e(e){this.analyticsServerUrl=(0,o.joinUrls)(e,"analytics"),this.adAnalyticsServerUrl=(0,o.joinUrls)(e,"analytics/a")}return e.prototype.sendRequest=function(e,t){var n=this.analyticsServerUrl;(0,i.isSsaiRelatedSample)(e)&&(n=(0,i.appendSsaiRoutingParam)(n)),(0,r.post)(n,e,t)},e.prototype.sendUnloadRequest=function(e){var t=this,n=this.analyticsServerUrl;(0,i.isSsaiRelatedSample)(e)&&(n=(0,i.appendSsaiRoutingParam)(n)),this.trySendBeacon((function(e){return t.sendRequestSynchronous(e,o.noOp)}),n,e)},e.prototype.trySendBeacon=function(e,t,n,i){var r;if(void 0===i&&(i={}),void 0===(null===(r=a.globalScope.navigator)||void 0===r?void 0:r.sendBeacon))e(n);else{var o=new Blob([JSON.stringify(n)],i);a.globalScope.navigator.sendBeacon(t,o)||e(n)}},e.prototype.sendRequestSynchronous=function(e,t){var n=this.analyticsServerUrl;(0,i.isSsaiRelatedSample)(e)&&(n=(0,i.appendSsaiRoutingParam)(n)),(0,r.post)(n,e,t,!1)},e.prototype.sendAdRequest=function(e){var t=this.adAnalyticsServerUrl;(0,i.isSsaiRelatedSample)(e)&&(t=(0,i.appendSsaiRoutingParam)(t));this.trySendBeacon((function(e){return(0,r.post)(t,e,o.noOp)}),t,e)},e}();t.AnalyticsCall=s},5248:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSourceInfoFromBitmovinSourceConfig=void 0;var i=n(5063);t.getSourceInfoFromBitmovinSourceConfig=function(e,t){if(!e)return{progBitrate:void 0,progUrl:void 0};if("string"==typeof e)return{progBitrate:0,progUrl:e};if(Array.isArray(e)&&e.length>0){var n=t.getPlaybackVideoData(),a=0;return(0,i.isNotNullish)(n)&&!isNaN(+n.id)&&(a=+n.id),{progBitrate:e[a].bitrate||0,progUrl:e[a].url}}return"object"!=typeof e||Array.isArray(e)?{progBitrate:void 0,progUrl:void 0}:{progBitrate:e.bitrate||0,progUrl:e.url}}},404:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodecHelper=void 0;var i=n(5923),a=n(5063),r={avc:['video/mp4; codecs="avc1.42000a"'],vp9:['video/mp4; codecs="vp09.00.50.08"'],av1:['video/mp4; codecs="av01.0.08M.08"'],hevc:['video/mp4; codecs="hev1.1.6.L93.B0"']},o=function(){function e(){}return Object.defineProperty(e,"supportedVideoFormats",{get:function(){var e;if(!(0,a.isNullish)(null===(e=i.globalScope.MediaSource)||void 0===e?void 0:e.isTypeSupported)&&(0,a.isFunction)(i.globalScope.MediaSource.isTypeSupported))return Object.getOwnPropertyNames(r).filter((function(e){return r[e].some((function(e){return i.globalScope.MediaSource.isTypeSupported(e)}))}))},enumerable:!1,configurable:!0}),e}();t.CodecHelper=o},5766:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Converter=void 0;var n=function(){function e(){}return e.bytesToBits=function(e){return 8*e},e.bitsToBytes=function(e){return Math.round(e/8)},e.kiloBitsToBits=function(e){return 1e3*e},e}();t.Converter=n},1652:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventDebugging=void 0;var n=function(e,t,n,i,a){this.event=e,this.from=t,this.to=n,this.timestamp=i,this.eventObject=a};t.EventDebugging=n},92:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.post=function(e,t,n,o){void 0===o&&(o=!0);(0,r.isReactNative)()&&!o&&(o=!0);var s,l=!1;i.globalScope.XDomainRequest?(s=new i.globalScope.XDomainRequest,l=!0):s=new XMLHttpRequest;var u=function(){if(s.readyState==XMLHttpRequest.DONE){if(s.responseText<=0)return;var e=JSON.parse(s.responseText);n(e)}};l?s.onload=u:s.onreadystatechange=u;try{s.open("POST",e,o),l||s.setRequestHeader("Content-Type","text/plain"),s.send(JSON.stringify(t))}catch(e){a.logger.error("Failed to send POST request.",e)}};var i=n(5923),a=n(1916),r=n(5063)},5253:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LicenseCall=function(e,t,n,r){var o=(0,a.joinUrls)(r,"/licensing"),s={analyticsVersion:n,domain:t,key:e};return new Promise((function(e){(0,i.post)(o,s,(function(t){e(t)}))}))};var i=n(92),a=n(5063)},1916:function(e,t){"use strict";var n=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,a=0,r=t.length;a<r;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.padRight=void 0;var i=function(){function e(){}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.prototype.initialize=function(e){this.analyticsDebugConfig=e},e.prototype.log=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.enabled&&console.log(e,t)},e.prototype.table=function(e,t){this.enabled&&console.table(e,t)},e.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.enabled&&console.warn(e,t)},e.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.enabled&&console.error(e,t)},e.prototype.errorMessageToUser=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];console.error.apply(console,n([e],t,!1))},Object.defineProperty(e.prototype,"enabled",{get:function(){return this.analyticsDebugConfig||!1},enumerable:!1,configurable:!0}),e}();t.padRight=function(e,t){return(e+new Array(t).join(" ")).slice(0,t)},t.logger=i.getInstance()},3129:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Queue=void 0;var n=function(){function e(){this._items=[]}return Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._items.length},enumerable:!1,configurable:!0}),e.prototype.offer=function(e){this._items.push(e)},e.prototype.poll=function(){return this._items.shift()},e.prototype.clear=function(){this._items.splice(0)},e.prototype.limit=function(e){for(;this._items.length>e;)this.poll()},e}();t.Queue=n},4649:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SEQUENCE_NUMBER_LIMIT=t.ANALYTICS_MIN_SEEK_DIFFERENCE_THRESHOLD=t.ANALYTICS_REBUFFER_TIMEOUT=t.ANALYTICS_QUALITY_CHANGE_COUNT_RESET_INTERVAL=t.ANALYTICS_QUALITY_CHANGE_COUNT_THRESHOLD=t.ANALYTICS_VIDEOSTART_TIMEOUT=t.ANALYTICS_LICENSECALL_TIMEOUT=t.ANALYTICS_BACKEND_BASE_URL=t.MESSAGE_NAMESPACE=void 0,t.MESSAGE_NAMESPACE="urn:x-cast:com.bitmovin.analytics.cast",t.ANALYTICS_BACKEND_BASE_URL="https://analytics-ingress-global.bitmovin.com",t.ANALYTICS_LICENSECALL_TIMEOUT=6e4,t.ANALYTICS_VIDEOSTART_TIMEOUT=6e4,t.ANALYTICS_QUALITY_CHANGE_COUNT_THRESHOLD=50,t.ANALYTICS_QUALITY_CHANGE_COUNT_RESET_INTERVAL=36e5,t.ANALYTICS_REBUFFER_TIMEOUT=12e4,t.ANALYTICS_MIN_SEEK_DIFFERENCE_THRESHOLD=3,t.SEQUENCE_NUMBER_LIMIT=1e3},5063:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tryJSONStringify=t.isAudioMuted=t.isReactNative=t.joinUrls=t.getURLResourceName=t.calculatePercentage=t.transferCustomDataFields=t.getCustomDataString=t.noOp=t.getCurrentTimestamp=t.calculateTimeWithUndefined=t.calculateTime=t.removeTrailingSlash=t.isFunction=t.isPlainObject=t.isObject=t.toBoolean=t.isBoolean=t.isNotNullish=t.isNullish=void 0,t.isErrorSeverity=function(e){return"CRITICAL"===e||"INFO"===e},t.getPageLoadType=function(){if((0,r.isDocumentHidden)())return i.PAGE_LOAD_TYPE.BACKGROUND;return i.PAGE_LOAD_TYPE.FOREGROUND},t.isArrayBuffer=function(e){return"[object ArrayBuffer]"===Object.prototype.toString.call(e)};var i=n(9946),a=n(5529),r=n(3848),o=n(9422),s=n(1820);t.isNullish=function(e){return null==e};t.isNotNullish=function(e){return!(0,t.isNullish)(e)};t.isBoolean=function(e){return!(0,t.isNullish)(e)&&"boolean"==typeof e};t.toBoolean=function(e){return Boolean(e).valueOf()};t.isObject=function(e){return(0,t.isNotNullish)(e)&&"object"==typeof e};t.isPlainObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)};t.isFunction=function(e){return"function"==typeof e};t.removeTrailingSlash=function(e){return e.replace(/\/$/g,"")};t.calculateTime=function(e){return Math.round(1e3*e)};t.calculateTimeWithUndefined=function(e){if(!(0,t.isNullish)(e))return(0,t.calculateTime)(e)};t.getCurrentTimestamp=function(){return Date.now()};t.noOp=function(){};t.getCustomDataString=function(e){return"object"==typeof e?(0,t.tryJSONStringify)(e):(0,t.isFunction)(e)?(0,t.getCustomDataString)(e()):void 0===e?e:"string"!=typeof e?String(e):e};t.transferCustomDataFields=function(e,n){for(var i=1;i<=a.customDataFieldCount;i++){var r="customData".concat(i);n[r]=(0,t.getCustomDataString)(e[r])}};t.calculatePercentage=function(e,t){if(void 0!==t&&0!==t)return Math.round((e||0)/t*100)};t.getURLResourceName=function(e){return 0===e.length?"":e.split("/").pop()||""};t.joinUrls=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return((0,s.endsWith)(e,"/")&&void 0!==t?e.substr(0,e.length-1):e)+"/"+((0,s.startsWith)(t,"/")?t.substr(1):t)}))};t.isReactNative=function(){return"ReactNative"===(0,o.getGlobalNavigatorProduct)()};t.isAudioMuted=function(e,t){return e||t<.01};t.tryJSONStringify=function(e){if(!(0,t.isNullish)(e))try{return JSON.stringify(e)}catch(e){return}}},4926:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="v2.53.0"},3612:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewportTracker=void 0;var i=n(3848),a=n(5923),r=n(1916),o=n(1820),s=n(5063),l=function(){function e(e,t,n){void 0===n&&(n=1);var a=this;this.inViewport=void 0,this.threshold=n,this.onIntersectionChanged=t,this.element=e;try{var o={root:null,rootMargin:"0px",threshold:n};this.observer=new IntersectionObserver((function(e,t){return a.handleIntersect(e,t)}),o),this.observer.observe(e)}catch(e){r.logger.log("Couldn't create instance of IntersectionObserver. timeInViewport will always be reported as 100%.")}this.hiddenPropertyName=(0,i.getDocumentPropertyWithPrefix)("hidden"),this.hiddenPropertyName&&(this.visibilityChange=this.hiddenPropertyName.replace("hidden","")+"visibilitychange",(0,i.addDocumentEventListener)(this.visibilityChange,this.handleVisibilityChange=this.handleVisibilityChange.bind(this),!1))}return e.prototype.isHidden=function(){return!((0,s.isNullish)(a.globalScope.document)||!(0,o.isValidString)(this.hiddenPropertyName))&&!0===a.globalScope.document[this.hiddenPropertyName]},e.prototype.isInViewport=function(){return!this.isHidden()&&(!!(0,s.isNullish)(this.inViewport)||this.inViewport)},e.prototype.dispose=function(){this.observer&&(this.observer.unobserve(this.element),this.observer.disconnect()),this.visibilityChange&&(0,i.removeDocumentEventListener)(this.visibilityChange,this.handleVisibilityChange,!1)},e.prototype.handleVisibilityChange=function(){this.onIntersectionChanged()},e.prototype.handleIntersect=function(e,t){var n=this;e.forEach((function(e){e.target===n.element&&(n.inViewport=!(e.intersectionRatio<n.threshold))})),this.onIntersectionChanged()},e}();t.ViewportTracker=l},8421:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWebOSTVModelName=function(){try{var e=(0,i.getGlobalWebOSApi)(),t=e.webOSSystem,n=e.PalmSystem,r=(null==t?void 0:t.deviceInfo)?JSON.parse(t.deviceInfo):(null==n?void 0:n.deviceInfo)&&JSON.parse(n.deviceInfo);return(0,a.isValidString)(null==r?void 0:r.modelName)&&!(0,a.isBlank)(null==r?void 0:r.modelName)?r.modelName:void 0}catch(e){return}};var i=n(9422),a=n(1820)},2376:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowEventTracker=void 0;var i=n(9422),a=function(){function e(){this.trackedObjects=[]}return e.prototype.addEventListener=function(e,t){this.trackedObjects.push({eventName:e,func:t}),(0,i.addGlobalEventListener)(e,t)},e.prototype.release=function(){for(;0!==this.trackedObjects.length;){var e=this.trackedObjects.pop();void 0!==e&&(0,i.removeGlobalEventListener)(e.eventName,e.func)}},e}();t.WindowEventTracker=a},8331:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeAnalyticsConfig=function(e){if((0,u.isNullish)(e))return{};l.isBoolean(e.isLive)||(e.isLive=void 0);(0,u.isNotNullish)(e.config)&&(0,u.isNotNullish)(e.config.errorTransformerCallback)&&((0,u.isFunction)(e.config.errorTransformerCallback.transform)||(e.config.errorTransformerCallback=void 0));return e},t.guardConfigChangeAgainstMissingTitle=function(e,t){if((0,u.isNullish)(e)||(0,u.isNullish)(t))return;e.title&&(0,s.isBlank)(t.title)&&o.logger.error("The new analytics configuration does not contain the field `title`")},t.guardConfigChangeAgainstMissingIsLive=function(e,t){if((0,u.isNullish)(e)||(0,u.isNullish)(t))return;e.isLive&&(0,u.isNullish)(t.isLive)&&o.logger.error("The new analytics configuration does not contain the field `isLive`. It will default to `false` which might be unintended? Once stream playback information is available the type will be populated.")},t.guardAgainstDuplicatedUserId=function(e){if((0,u.isNullish)(e))return;(0,u.isNotNullish)(e.customUserId)&&(0,u.isNotNullish)(e.userId)&&o.logger.warn("Configuration Warning: \nCustomUserId and UserId are set in the config \nValue of UserId will be used in sample \nPlease only use one configuration field to set your userId")},t.getDeviceInformationFromAnalyticsConfig=function(e){if((0,u.isNullish)(e))return;var t={};(0,s.isValidString)(e.deviceType)&&!(0,s.isBlank)(e.deviceType)&&(t.model=e.deviceType);(0,s.isValidString)(e.deviceClass)&&!(0,s.isBlank)(e.deviceClass)&&(t.deviceClass=e.deviceClass);if(0===Object.keys(t).length)return;return t},t.getDomainFromAnalyticsConfig=function(e){var t,n,i=(0,r.getGlobalLocationHostname)(),a=i?l.removeTrailingSlash(i):"";return null!==(n=null===(t=null==e?void 0:e.config)||void 0===t?void 0:t.origin)&&void 0!==n?n:a},t.mergeAnalyticsConfig=function(e,t){var n=function(e){var t=["cdnProvider","videoId","title","isLive","experimentName"],n=/customData\d{1,3}$/g;for(var i in e)((0,u.isNotNullish)(i.match(n))||t.includes(i))&&delete e[i];return e}(e),a=function(e,t){if((0,u.isNotNullish)(t))return i(i(i({},e),{enabled:!0}),t);return null!=e?e:{}}(e.config,t.config);return i(i(i({},n),t),{config:a})},t.applySourceMetadataToAnalyticsConfig=function(e,t){var n=i({},e);(0,u.isNotNullish)(t.title)&&(n.title=t.title);(0,u.isNotNullish)(t.videoId)&&(n.videoId=t.videoId);(0,u.isNotNullish)(t.cdnProvider)&&(n.cdnProvider=t.cdnProvider);(0,u.isNotNullish)(t.isLive)&&(n.isLive=t.isLive);(0,u.isNotNullish)(t.customData)&&(n=i(i({},n),(0,a.extractCustomDataFieldsOnly)(t.customData)));return n};var a=n(5529),r=n(9422),o=n(1916),s=n(1820),l=n(5063),u=n(5063)},9627:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.areCollectorRequirementsValid=function(e){var t=[],n=(0,r.isBlank)((0,i.getDomainFromAnalyticsConfig)(e));n&&t.push("no `domain` value found (neither from `window.location` object nor provided by `AnalyticsConfig.config.origin`). Without this value, we cannot verify the origin of your analytics data. Please provide the registered domain via the config during collector creation.");if(t.length>0){var o="Collector setup failed:"+t.join(" -- ");a.logger.errorMessageToUser(o)}return!n};var i=n(8331),a=n(1916),r=n(1820)},3848:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteCookie=t.setCookie=t.getCookie=t.removeDocumentEventListener=t.addDocumentEventListener=t.isVideoInFullscreen=t.isDocumentHidden=t.getDocumentPropertyWithPrefix=void 0;var i=n(1916),a=n(1820),r=n(5063);t.getDocumentPropertyWithPrefix=function(e){if(!(0,r.isNullish)(document)){if(e in document)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0,i=["webkit","moz","ms","o"];n<i.length;n++){var a=i[n]+t;if(a in document)return a}}};t.isDocumentHidden=function(){var e=(0,t.getDocumentPropertyWithPrefix)("hidden");return!!(0,a.isValidString)(e)&&!0===document[e]};t.isVideoInFullscreen=function(){var e,n=(0,t.getDocumentPropertyWithPrefix)("fullscreenElement");return!!(0,a.isValidString)(n)&&"VIDEO"===(null===(e=document[n])||void 0===e?void 0:e.nodeName)};t.addDocumentEventListener=function(e,t,n){(0,r.isNullish)(document)||!(0,r.isFunction)(document.addEventListener)||(0,r.isNullish)(t)||document.addEventListener(e,t,n)};t.removeDocumentEventListener=function(e,t,n){(0,r.isNullish)(document)||!(0,r.isFunction)(document.removeEventListener)||(0,r.isNullish)(t)||document.removeEventListener(e,t,n)};t.getCookie=function(e){if(!(0,r.isNullish)(document)){var t;try{t=document.cookie.split(";")}catch(e){return void i.logger.log("failed to access cookie objects on document",e)}for(var n=e+"=",a=0,o=t;a<o.length;a++){for(var s=o[a];" "===s.charAt(0);)s=s.substring(1);if(0===s.indexOf(n))return s.substring(n.length,s.length)}return""}};t.setCookie=function(e,t,n){if(!(0,r.isNullish)(document)){var a=e+"="+t+"; path=/";(null==n?void 0:n.domain)&&(a+="; domain=".concat(n.domain)),(null==n?void 0:n.expires)&&(a+="; expires=".concat(n.expires)),(null==n?void 0:n.maxAge)&&(a+="; max-age=".concat(n.maxAge));try{document.cookie=a}catch(e){return void i.logger.log("failed to set cookie object on document",e)}}};t.deleteCookie=function(e){if(!(0,r.isNullish)(document))try{document.cookie="".concat(e,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;")}catch(e){return void i.logger.log("failed to delete cookies from document",e)}}},5923:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalScope=void 0,t.globalScope=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;if("undefined"!=typeof self)return self;throw new Error("Unable to locate global object")}()},9422:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalTheoPlayerVersion=t.getGlobalVideojsVersion=t.getGlobalNavigatorUserAgent=t.getGlobalNavigatorProduct=t.getGlobalNavigatorLanguage=t.hasGlobalWebOSApi=t.getGlobalWebOSApi=t.getGlobalPerformanceNow=t.getGlobalLocationPathname=t.getGlobalLocationHostname=t.removeGlobalEventListener=t.addGlobalEventListener=t.getGlobalScreenDimensions=t.getGlobalDevicePixelRatio=void 0;var i=n(5923),a=n(1460),r=n(1820),o=n(5063);t.getGlobalDevicePixelRatio=function(){return(0,o.isNullish)(i.globalScope.devicePixelRatio)?1:i.globalScope.devicePixelRatio>0?i.globalScope.devicePixelRatio:1};t.getGlobalScreenDimensions=function(){if(!(0,o.isNullish)(i.globalScope.screen)&&(0,a.isNumber)(i.globalScope.screen.width)&&(0,a.isNumber)(i.globalScope.screen.height)){var e=(0,t.getGlobalDevicePixelRatio)(),n=i.globalScope.screen.width*e,r=i.globalScope.screen.height*e;if(!(!isFinite(n)||!isFinite(r)||n<=0||r<=0))return{width:n,height:r,scale:e}}};t.addGlobalEventListener=function(e,t){(0,o.isNullish)(i.globalScope.addEventListener)||!(0,o.isFunction)(i.globalScope.addEventListener)||(0,o.isNullish)(t)||i.globalScope.addEventListener(e,t)};t.removeGlobalEventListener=function(e,t){(0,o.isNullish)(i.globalScope.removeEventListener)||!(0,o.isFunction)(i.globalScope.removeEventListener)||(0,o.isNullish)(t)||i.globalScope.removeEventListener(e,t)};t.getGlobalLocationHostname=function(){if(!(0,o.isNullish)(i.globalScope.location)&&(0,r.isValidString)(i.globalScope.location.hostname))return i.globalScope.location.hostname};t.getGlobalLocationPathname=function(){if(!(0,o.isNullish)(i.globalScope.location)&&(0,r.isValidString)(i.globalScope.location.pathname))return i.globalScope.location.pathname};t.getGlobalPerformanceNow=function(){var e;if(!(0,o.isNullish)(null===(e=i.globalScope.performance)||void 0===e?void 0:e.now)&&(0,o.isFunction)(i.globalScope.performance.now))return i.globalScope.performance.now()};t.getGlobalWebOSApi=function(){return{webOSSystem:i.globalScope.webOSSystem,PalmSystem:i.globalScope.PalmSystem}};t.hasGlobalWebOSApi=function(){var e=(0,t.getGlobalWebOSApi)(),n=e.webOSSystem,i=e.PalmSystem;return!(0,o.isNullish)(n)||!(0,o.isNullish)(i)};t.getGlobalNavigatorLanguage=function(){if(!(0,o.isNullish)(i.globalScope.navigator))return i.globalScope.navigator.language||i.globalScope.navigator.userLanguage};t.getGlobalNavigatorProduct=function(){if(!(0,o.isNullish)(i.globalScope.navigator))return i.globalScope.navigator.product};t.getGlobalNavigatorUserAgent=function(){if(!(0,o.isNullish)(i.globalScope.navigator)&&(0,r.isValidString)(i.globalScope.navigator.userAgent))return i.globalScope.navigator.userAgent};t.getGlobalVideojsVersion=function(){if(!(0,o.isNullish)(i.globalScope.videojs))return i.globalScope.videojs.VERSION};t.getGlobalTheoPlayerVersion=function(){if(!(0,o.isNullish)(i.globalScope.THEOplayer))return i.globalScope.THEOplayer.version}},1460:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIntOrUndefined=t.isFiniteNumber=t.isNumber=void 0;var i=n(5063);t.isNumber=function(e){return!(0,i.isNullish)(e)&&"number"==typeof e};t.isFiniteNumber=function(e){return!!(0,t.isNumber)(e)&&((0,i.isFunction)(Number.isFinite)?Number.isFinite(e):isFinite(e))};t.parseIntOrUndefined=function(e){var n=parseInt(e,10);return(0,t.isFiniteNumber)(n)?n:void 0}},2974:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.objectValues=void 0;t.objectValues=function(e){return Object.keys(e).map((function(t){return e[t]}))}},2108:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BITMOVIN_ANALYTICS_AUGMENTED_MARKER=void 0,t.hasPlayerAlreadyBeenAugmented=function(e){return!0===e[t.BITMOVIN_ANALYTICS_AUGMENTED_MARKER]},t.markPlayerInstanceAsAugmented=function(e){e[t.BITMOVIN_ANALYTICS_AUGMENTED_MARKER]=!0},t.isDefined=function(e){if((0,a.isNullish)(e))return i.logger.log("Bitmovin Analytics: Adapter hasn't been initialized yet"),!1;return!0};var i=n(1916),a=n(5063);t.BITMOVIN_ANALYTICS_AUGMENTED_MARKER="__bitmovinAnalyticsHasBeenSetup"},6481:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearSampleStateValues=function(e){e.ad=0,e.adId=void 0,e.adIndex=void 0,e.adPosition=void 0,e.adSystem=void 0,e.autoplay=void 0,e.buffered=0,e.castTech=void 0,e.completed=void 0,e.drmLoadTime=void 0,e.droppedFrames=0,e.duration=0,e.errorCode=void 0,e.errorData=void 0,e.errorMessage=void 0,e.errorSegments=void 0,e.errorSeverity=void 0,e.isProgramChange=void 0,e.pageLoadTime=0,e.paused=0,e.played=0,e.playerStartupTime=0,e.seeked=0,e.startupTime=0,e.state=void 0,e.videoStartFailed=void 0,e.videoStartFailedReason=void 0,e.videoStartupTime=0,e[i.SSAI_RELATED_SAMPLE_MARKER]=void 0},t.getDefaultSamplePath=function(){var e=(0,a.getGlobalLocationPathname)();return(0,r.isValidString)(e)?(0,o.removeTrailingSlash)(e):void 0};var i=n(7906),a=n(9422),r=n(1820),o=n(5063)},1820:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startsWith=t.endsWith=t.isBlank=t.isEmpty=t.isValidString=void 0;var i=n(5063);t.isValidString=function(e){return(0,i.isNotNullish)(e)&&"string"==typeof e};t.isEmpty=function(e){return(0,i.isNullish)(e)||0===e.length};t.isBlank=function(e){return(0,t.isEmpty)(e)||(0,t.isEmpty)(null==e?void 0:e.trim())};t.endsWith=function(e,n){return!(!(0,t.isValidString)(e)||!(0,t.isValidString)(n))&&((0,i.isFunction)(String.prototype.endsWith)?e.endsWith(n):e.substring(e.length-n.length)===n)};t.startsWith=function(e,n){return!(!(0,t.isValidString)(e)||!(0,t.isValidString)(n))&&((0,i.isFunction)(String.prototype.startsWith)?e.startsWith(n):e.substring(0,n.length)===n)}},2982:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateUUID=void 0;t.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}}},t={};function n(i){var a=t[i];if(void 0!==a)return a.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var i={};return function(){"use strict";var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.PlayerModule=e.BitmovinPwxAnalyticsPackage=e.adapters=e.VideojsAdapter=e.THEOplayerAdapter=e.ShakaAdapter=e.HlsAdapter=e.HTMLVideoElementAdapter=e.DashjsAdapter=e.CAFv3Adapter=e.Bitmovin8Adapter=e.AmazonIVSAdapter=e.CdnProviders=e.Players=e.version=void 0;var t=n(3703);Object.defineProperty(e,"AmazonIVSAdapter",{enumerable:!0,get:function(){return t.AmazonIVSAdapter}});var a=n(4679);Object.defineProperty(e,"Bitmovin8Adapter",{enumerable:!0,get:function(){return a.Bitmovin8Adapter}});var r=n(681);Object.defineProperty(e,"PlayerModule",{enumerable:!0,get:function(){return r.PlayerModule}});var o=n(2506);Object.defineProperty(e,"BitmovinPwxAnalyticsPackage",{enumerable:!0,get:function(){return o.BitmovinPwxAnalyticsPackage}});var s=n(5127);Object.defineProperty(e,"CAFv3Adapter",{enumerable:!0,get:function(){return s.CAFv3Adapter}});var l=n(9999);Object.defineProperty(e,"DashjsAdapter",{enumerable:!0,get:function(){return l.DashjsAdapter}});var u=n(9566);Object.defineProperty(e,"HlsAdapter",{enumerable:!0,get:function(){return u.HlsAdapter}});var c=n(701);Object.defineProperty(e,"HTMLVideoElementAdapter",{enumerable:!0,get:function(){return c.HTMLVideoElementAdapter}});var d=n(2063);Object.defineProperty(e,"ShakaAdapter",{enumerable:!0,get:function(){return d.ShakaAdapter}});var E=n(7470);Object.defineProperty(e,"THEOplayerAdapter",{enumerable:!0,get:function(){return E.THEOplayerAdapter}});var p=n(4179);Object.defineProperty(e,"VideojsAdapter",{enumerable:!0,get:function(){return p.VideojsAdapter}});var v=n(4355);Object.defineProperty(e,"CdnProviders",{enumerable:!0,get:function(){return v.CdnProvider}});var h=n(556);Object.defineProperty(e,"Players",{enumerable:!0,get:function(){return h.Player}});var f=n(4926);Object.defineProperty(e,"version",{enumerable:!0,get:function(){return f.VERSION}}),e.adapters={AmazonIVSAdapter:t.AmazonIVSAdapter,Bitmovin8Adapter:a.Bitmovin8Adapter,CAFv3Adapter:s.CAFv3Adapter,DashjsAdapter:l.DashjsAdapter,HTMLVideoElementAdapter:c.HTMLVideoElementAdapter,HlsAdapter:u.HlsAdapter,ShakaAdapter:d.ShakaAdapter,THEOplayerAdapter:E.THEOplayerAdapter,VideojsAdapter:p.VideojsAdapter},e.default={PlayerModule:r.PlayerModule}}(),i}()}));
|
|
11
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bitmovin=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.analytics=t())}(self,(function(){return function(){var e={2595:function(e,t){var n;n={VERSION:"2.4.0",Result:{SUCCEEDED:1,NOTRANSITION:2,CANCELLED:3,PENDING:4},Error:{INVALID_TRANSITION:100,PENDING_TRANSITION:200,INVALID_CALLBACK:300},WILDCARD:"*",ASYNC:"async",create:function(e,t){var i="string"==typeof e.initial?{state:e.initial}:e.initial,a=e.terminal||e.final,r=t||e.target||{},o=e.events||[],s=e.callbacks||{},l={},u={},c=function(e){var t=Array.isArray(e.from)?e.from:e.from?[e.from]:[n.WILDCARD];l[e.name]=l[e.name]||{};for(var i=0;i<t.length;i++)u[t[i]]=u[t[i]]||[],u[t[i]].push(e.name),l[e.name][t[i]]=e.to||t[i];e.to&&(u[e.to]=u[e.to]||[])};i&&(i.event=i.event||"startup",c({name:i.event,from:"none",to:i.state}));for(var d=0;d<o.length;d++)c(o[d]);for(var E in l)l.hasOwnProperty(E)&&(r[E]=n.buildEvent(E,l[E]));for(var E in s)s.hasOwnProperty(E)&&(r[E]=s[E]);return r.current="none",r.is=function(e){return Array.isArray(e)?e.indexOf(this.current)>=0:this.current===e},r.can=function(e){return!this.transition&&void 0!==l[e]&&(l[e].hasOwnProperty(this.current)||l[e].hasOwnProperty(n.WILDCARD))},r.cannot=function(e){return!this.can(e)},r.transitions=function(){return(u[this.current]||[]).concat(u[n.WILDCARD]||[])},r.isFinished=function(){return this.is(a)},r.error=e.error||function(e,t,n,i,a,r,o){throw o||r},r.states=function(){return Object.keys(u).sort()},i&&!i.defer&&r[i.event](),r},doCallback:function(e,t,i,a,r,o){if(t)try{return t.apply(e,[i,a,r].concat(o))}catch(t){return e.error(i,a,r,o,n.Error.INVALID_CALLBACK,"an exception occurred in a caller-provided callback function",t)}},beforeAnyEvent:function(e,t,i,a,r){return n.doCallback(e,e.onbeforeevent,t,i,a,r)},afterAnyEvent:function(e,t,i,a,r){return n.doCallback(e,e.onafterevent||e.onevent,t,i,a,r)},leaveAnyState:function(e,t,i,a,r){return n.doCallback(e,e.onleavestate,t,i,a,r)},enterAnyState:function(e,t,i,a,r){return n.doCallback(e,e.onenterstate||e.onstate,t,i,a,r)},changeState:function(e,t,i,a,r){return n.doCallback(e,e.onchangestate,t,i,a,r)},beforeThisEvent:function(e,t,i,a,r){return n.doCallback(e,e["onbefore"+t],t,i,a,r)},afterThisEvent:function(e,t,i,a,r){return n.doCallback(e,e["onafter"+t]||e["on"+t],t,i,a,r)},leaveThisState:function(e,t,i,a,r){return n.doCallback(e,e["onleave"+i],t,i,a,r)},enterThisState:function(e,t,i,a,r){return n.doCallback(e,e["onenter"+a]||e["on"+a],t,i,a,r)},beforeEvent:function(e,t,i,a,r){if(!1===n.beforeThisEvent(e,t,i,a,r)||!1===n.beforeAnyEvent(e,t,i,a,r))return!1},afterEvent:function(e,t,i,a,r){n.afterThisEvent(e,t,i,a,r),n.afterAnyEvent(e,t,i,a,r)},leaveState:function(e,t,i,a,r){var o=n.leaveThisState(e,t,i,a,r),s=n.leaveAnyState(e,t,i,a,r);return!1!==o&&!1!==s&&(n.ASYNC===o||n.ASYNC===s?n.ASYNC:void 0)},enterState:function(e,t,i,a,r){n.enterThisState(e,t,i,a,r),n.enterAnyState(e,t,i,a,r)},buildEvent:function(e,t){return function(){var i=this.current,a=t[i]||(t[n.WILDCARD]!=n.WILDCARD?t[n.WILDCARD]:i)||i,r=Array.prototype.slice.call(arguments);if(this.transition)return this.error(e,i,a,r,n.Error.PENDING_TRANSITION,"event "+e+" inappropriate because previous transition did not complete");if(this.cannot(e))return this.error(e,i,a,r,n.Error.INVALID_TRANSITION,"event "+e+" inappropriate in current state "+this.current);if(!1===n.beforeEvent(this,e,i,a,r))return n.Result.CANCELLED;if(i===a)return n.afterEvent(this,e,i,a,r),n.Result.NOTRANSITION;var o=this;this.transition=function(){return o.transition=null,o.current=a,n.enterState(o,e,i,a,r),n.changeState(o,e,i,a,r),n.afterEvent(o,e,i,a,r),n.Result.SUCCEEDED},this.transition.cancel=function(){o.transition=null,n.afterEvent(o,e,i,a,r)};var s=n.leaveState(this,e,i,a,r);return!1===s?(this.transition=null,n.Result.CANCELLED):n.ASYNC===s?n.Result.PENDING:this.transition?this.transition():void 0}}},e.exports&&(t=e.exports=n),t.StateMachine=n},887:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bitmovin8AdModule=void 0;var i=n(5063),a=n(5517),r=n(2953),o=n(3182),s=function(){function e(e,t){var n=this;this.player=e,this.windowEventTracker=t,this.adCallbacks=new a.AdCallbacks,this.isLinearAdActive=function(){var e;return null!==(e=n.player.isLinearAdActive())&&void 0!==e&&e},this.getContainer=function(){return n.player.getContainer()},this.getAdModuleInfo=function(){var e;return null!==(e=n.player.getAdModuleInfo())&&void 0!==e?e:{name:void 0,version:void 0}},this.currentTime=function(){var e;return null!==(e=n.player.getCurrentTime())&&void 0!==e?e:0},this.register()}return e.prototype.getAutoPlay=function(){var e;return null!==(e=this.player.autoplay)&&void 0!==e&&e},e.prototype.register=function(){var e=this;this.player.on(o.BITMOVIN8_PLAYER_EVENT.Play,(function(t){"advertising-api"===t.issuer&&e.adCallbacks.onPlay()})),this.player.on(o.BITMOVIN8_PLAYER_EVENT.Paused,(function(t){"advertising-api"===t.issuer&&e.adCallbacks.onPause()})),this.player.on(o.BITMOVIN8_PLAYER_EVENT.AdStarted,(function(t){e.adCallbacks.onAdStarted((0,r.mapBitmovinAd)(t.ad))})),this.player.on(o.BITMOVIN8_PLAYER_EVENT.AdFinished,(function(t){e.adCallbacks.onAdFinished((0,r.mapBitmovinAd)(t.ad))})),this.player.on(o.BITMOVIN8_PLAYER_EVENT.AdBreakStarted,(function(t){e.adCallbacks.onAdBreakStarted((0,r.mapBitmovinAdBreak)(t.adBreak))})),this.player.on(o.BITMOVIN8_PLAYER_EVENT.AdBreakFinished,(function(t){e.adCallbacks.onAdBreakFinished((0,r.mapBitmovinAdBreak)(t.adBreak))})),this.player.on(o.BITMOVIN8_PLAYER_EVENT.AdClicked,(function(t){e.adCallbacks.onAdClicked({clickThroughUrl:t.clickThroughUrl})})),this.player.on(o.BITMOVIN8_PLAYER_EVENT.AdQuartile,(function(t){e.adCallbacks.onAdQuartile({quartile:t.quartile})})),this.player.on(o.BITMOVIN8_PLAYER_EVENT.AdSkipped,(function(t){e.adCallbacks.onAdSkipped((0,r.mapBitmovinAd)(t.ad))})),this.player.on(o.BITMOVIN8_PLAYER_EVENT.AdError,(function(t){var n;e.adCallbacks.onAdError((0,r.mapBitmovinAdError)(t,null===(n=e.player.getActiveAd())||void 0===n?void 0:n.id))})),this.player.on(o.BITMOVIN8_PLAYER_EVENT.AdManifestLoaded,(function(t){var n,a,o=t.adConfig,s="vmap"===(null===(n=null==o?void 0:o.tag)||void 0===n?void 0:n.type),l=(0,i.isNotNullish)(t.adConfig)?(0,r.mapBitmovinAdBreak)(t.adConfig):void 0,u=null===(a=t.downloadTiming)||void 0===a?void 0:a.downloadTime;e.adCallbacks.onAdManifestLoaded({adBreakInfo:l,manifestDownloadTime:u,isVmap:s})}));var t=function(){e.adCallbacks.onBeforeUnload()};this.windowEventTracker.addEventListener("beforeunload",t),this.windowEventTracker.addEventListener("unload",t)},e}();t.Bitmovin8AdModule=s},4679:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bitmovin8Adapter=void 0;var i=n(4350),a=n(6398),r=n(8331),o=n(9627),s=n(1916),l=n(2108),u=n(4926),c=n(4067),d=n(6596),E=n(6923),p=function(){function e(e,t){var n,u=this;if(this.ssai={adBreakStart:function(e){if((0,l.isDefined)(u.internalAdapter)){var t=(0,c.sanitizeBitmovin8AdapterSsaiAdBreakMetadataAdPosition)(e);if((0,a.hasValidSsaiAdBreakMetadataStructure)(t)){var n=(0,a.simplySanitizeSsaiAdBreakMetadata)(t);u.internalAdapter.ssaiService.adBreakStart(n)}}},adStart:function(e){if((0,l.isDefined)(u.analytics)&&(0,l.isDefined)(u.internalAdapter)&&(0,a.hasValidSsaiAdMetadataStructure)(e)){var t=(0,a.simplySanitizeSsaiAdMetadata)(e);u.internalAdapter.ssaiService.adStart(t),u.analytics.setConfigParameters(),u.analytics.setAutoDetectedDeviceInformation()}},adQuartileFinished:function(e,t){if((0,l.isDefined)(u.analytics)&&(0,l.isDefined)(u.internalAdapter)&&(0,a.hasValidSsaiAdQuartileStructure)(e)){var n=(0,a.sanitizeSsaiAdQuartileMetadata)(t);u.internalAdapter.ssaiService.adQuartileFinished(e,n)}},adBreakEnd:function(){(0,l.isDefined)(u.analytics)&&(0,l.isDefined)(u.internalAdapter)&&(u.internalAdapter.ssaiService.adBreakEnd(),u.analytics.setConfigParameters(),u.analytics.setAutoDetectedDeviceInformation())}},(0,l.hasPlayerAlreadyBeenAugmented)(e))s.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance");else{(0,l.markPlayerInstanceAsAugmented)(e);var p=e.getConfig(),v=(0,r.sanitizeAnalyticsConfig)(p.analytics);if((0,o.areCollectorRequirementsValid)(v)){(0,r.guardAgainstDuplicatedUserId)(v),v.playerKey=null!==(n=v.playerKey)&&void 0!==n?n:p.key;var f=d.Bitmovin8InternalAdapter.create(new E.Bitmovin8PlayerProxy(e),t);this.internalAdapter=f,this.analytics=i.Analytics.create(v,this.internalAdapter),e.analytics=this,this.wrapPlayerLoad(e,this.analytics,f)}}}return e.prototype.wrapPlayerLoad=function(e,t,n){var i=e.load;e.load=function(){for(var a=[],r=0;r<arguments.length;r++)a[r]=arguments[r];if(a.length>0){var o=a[0].analytics;t.sourceChange(o)}return n.trackLoadstartWithAutoplay(),i.apply(e,a)}},Object.defineProperty(e.prototype,"version",{get:function(){return u.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,l.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,l.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,l.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,l.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){(0,l.isDefined)(this.analytics)&&this.analytics.sourceChange(e)},e.version=u.VERSION,e}();t.Bitmovin8Adapter=p},6596:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Bitmovin8InternalAdapter=void 0;var o,s=n(2403),l=n(9664),u=n(2663),c=n(6235),d=n(4916),E=n(6743),p=n(5878),v=n(3458),f=n(2361),h=n(556),m=n(8525),A=n(7614),y=n(9557),T=n(7881),g=n(3413),S=n(5248),I=n(4649),N=n(5063),D=n(2647),P=n(887),_=n(3182),b=n(7543),C=n(8676),R=n(665);!function(e){e.Fullscreen="fullscreen",e.Inline="inline",e.PictureInPicture="pictureinpicture"}(o||(o={}));var L=function(e){function t(t,n,i,a,r,o,l){var c=e.call(this,l)||this;c.onBeforeUnLoadEvent=!1,c.getPlayerVersion=function(){var e;return null!==(e=c.player.version)&&void 0!==e?e:"unknown"},c.getPlayerName=function(){return h.Player.BITMOVIN},c.getPlayerTech=function(){var e;return null!==(e=c.player.getPlayerType())&&void 0!==e?e:"unknown"},c.getDrmPerformanceInfo=function(){return c.drmPerformanceInfo},c.httpRequestTrackingAdapter=r,c._videoCompletionTracker=a,c.segmentTracker=i,c.speedMeter=n,c.player=t;var d=new u.HeartbeatService((function(){var e,t;return null!==(t=null!==(e=c.player.getCurrentTime())&&void 0!==e?e:c.lastTrackedCurrentTime)&&void 0!==t?t:0})),E=new s.Bitmovin8AnalyticsStateMachine(c.stateMachineCallbacks,d,c.opts);return d.setListener(E),c.sourceInfoFallbackService=o,c.stateMachine=E,c}return a(t,e),Object.defineProperty(t.prototype,"currentTime",{get:function(){return(0,N.isNotNullish)(this.player.getCurrentTime())&&!this.isAdPlaying?this.player.getCurrentTime():this.lastTrackedCurrentTime?this.lastTrackedCurrentTime:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAdPlaying",{get:function(){return(0,N.isNotNullish)(this.player.getActiveAd())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"supportsDeferredLicenseLoading",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"adModule",{get:function(){return this._adModule},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoCompletionTracker",{get:function(){return this._videoCompletionTracker},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){var t=this;this.registerPlayerEventListeners(),this._adModule=new P.Bitmovin8AdModule(this.player,this.windowEventTracker),this.registerUnloadEventListeners(),this.ssaiService.activate({getPlayerCurrentTime:function(){return t.currentTime},reportEngagementInteraction:function(t){e.sendSsaiEngagementAdSample(t)},reportPlaybackInteraction:function(e,n){t.stateMachine.sendPlayingSample(e,n,!0)}});var n=new T.HttpRequestTracking([this.httpRequestTrackingAdapter]);return[new y.ErrorDetailTracking(e.errorDetailTrackingSettingsProvider,new A.ErrorDetailBackend(e.errorDetailTrackingSettingsProvider.collectorConfig),[e.errorDetailSubscribable],n)]},t.prototype.resetSourceRelatedState=function(){this.ssaiService.resetSourceRelatedState(),e.prototype.resetSourceRelatedState.call(this)},t.prototype.getAutoPlay=function(){var e;return null!==(e=this.player.autoplay)&&void 0!==e&&e},t.prototype.getCurrentPlaybackInfo=function(){var t,n,i=this.player.getContainer(),a=r(r({},e.prototype.getCommonPlaybackInfo.call(this)),{size:this.player.getViewMode()===o.Fullscreen?m.PlayerSize.Fullscreen:m.PlayerSize.Window,playerTech:this.getPlayerTech(),isLive:this.player.isLive(),videoDuration:(0,g.normalizeVideoDuration)(this.videoDuration),streamFormat:this.player.getStreamType(),videoWindowWidth:null==i?void 0:i.offsetWidth,videoWindowHeight:null==i?void 0:i.offsetHeight,isMuted:this.player.isMuted(),isCasting:this.player.isCasting(),audioLanguage:null===(t=this.player.getAudio())||void 0===t?void 0:t.lang,subtitleEnabled:!1,droppedFrames:(0,N.isNotNullish)(this.player.getSource())&&null!==(n=this.player.getDroppedVideoFrames())&&void 0!==n?n:0});return this.applySubtitleProperties(a),this.applyPlaybackQualityProperties(a),this.applyCastingProperties(a),this.applySourceProperties(a),((0,N.isNullish)(a.streamFormat)||"unknown"===a.streamFormat)&&this.sourceInfoFallbackService.applyStreamFormat(a),a},t.prototype.getSegmentInfo=function(){return this.segmentTracker.getSegments()},t.prototype.getDownloadSpeedInfo=function(){return this.speedMeter.getInfo()},t.prototype.resetDownloadSpeedInfoMeasures=function(){this.speedMeter.reset()},t.prototype.onError=function(){this.segmentTracker.reset()},t.prototype.trackLoadstartWithAutoplay=function(){this.getAutoPlay()&&this.eventCallback(f.Event.LOADSTART_AUTOPLAY,{currentTime:this.currentTime})},t.prototype.registerPlayerEventListeners=function(){var e=this;this.player.on(_.BITMOVIN8_PLAYER_EVENT.SourceUnloaded,(function(t){e.segmentTracker.reset(),e.eventCallback(f.Event.SOURCE_UNLOADED,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.SourceLoaded,(function(t){var n;e._videoCompletionTracker.reset(),e.videoDuration=e.player.getDuration(),e._videoCompletionTracker.setVideoDuration(null!==(n=e.player.getDuration())&&void 0!==n?n:0),e.sourceInfoFallbackService.setStreamFormat(e.player.getStreamType()),e.eventCallback(f.Event.SOURCE_LOADED,{})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.CastStarted,(function(t){e.eventCallback(f.Event.START_CAST,t)})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.CastStopped,(function(){e.eventCallback(f.Event.END_CAST,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.Play,(function(t){"ui-seek"!==t.issuer&&e.eventCallback(f.Event.PLAY,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.Playing,(function(t){"advertising-api"!==t.issuer&&e.eventCallback(f.Event.PLAYING,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.Paused,(function(t){"ui-seek"!==t.issuer&&e.eventCallback(f.Event.PAUSE,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.TimeChanged,(function(t){e.isAdPlaying||(e.lastTrackedCurrentTime=e.player.getCurrentTime()),e.eventCallback(f.Event.TIMECHANGED,{currentTime:e.lastTrackedCurrentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.Seek,(function(t){e.allowSeeking(t)&&e.eventCallback(f.Event.SEEK,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.Seeked,(function(){e.eventCallback(f.Event.SEEKED,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.StallStarted,(function(){e.eventCallback(f.Event.START_BUFFERING,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.StallEnded,(function(){e.eventCallback(f.Event.END_BUFFERING,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.AudioPlaybackQualityChanged,(function(t){var n=t,i=n.sourceQuality,a=n.targetQuality;if(!(0,N.isNullish)(a)){var r={type:"audio",bitrate:a.bitrate,currentTime:e.currentTime,codec:a.codec};(0,N.isNotNullish)(i)&&e.qualityChangeService.shouldAllowAudioQualityChange(a.bitrate)&&e.eventCallback(f.Event.AUDIO_CHANGE,r),e.qualityChangeService.setAudioBitrate(a.bitrate),e.stateMachineCallbacks.updateSampleQualityInfo(r)}})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.VideoPlaybackQualityChanged,(function(t){var n=t,i=n.sourceQuality,a=n.targetQuality;if(!(0,N.isNullish)(a)){var r={type:"video",width:a.width,height:a.height,bitrate:a.bitrate,currentTime:e.currentTime,codec:a.codec};(0,N.isNotNullish)(i)&&e.qualityChangeService.shouldAllowVideoQualityChange(a.bitrate)&&e.eventCallback(f.Event.VIDEO_CHANGE,r),e.qualityChangeService.setVideoBitrate(a.bitrate),e.stateMachineCallbacks.updateSampleQualityInfo(r)}})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.ViewModeChanged,(function(t){"fullscreen"===t.to?e.eventCallback(f.Event.START_FULLSCREEN,{currentTime:e.currentTime}):"fullscreen"===t.from&&e.eventCallback(f.Event.END_FULLSCREEN,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.AdStarted,(function(t){e.eventCallback(f.Event.START_AD,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.AdFinished,(function(t){e.eventCallback(f.Event.END_AD,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.AdSkipped,(function(t){e.eventCallback(f.Event.END_AD,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.AdError,(function(t){e.eventCallback(f.Event.END_AD,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.Muted,(function(){e.eventCallback(f.Event.MUTE,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.Unmuted,(function(){e.eventCallback(f.Event.UN_MUTE,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.Error,(function(t){e.eventCallback(f.Event.ERROR,{code:t.code,message:t.name,legacyData:t.data,currentTime:e.currentTime,originalError:t,data:{additionalData:(0,N.tryJSONStringify)(t.data)}}),t.code!==v.ErrorCode.BITMOVIN_PLAYER_LICENSING_ERROR.code&&t.code!==v.ErrorCode.SETUP_MISSING_LICENSE_WHITELIST.code||e.onLicenseCallFailed.dispatch({}),e.ssaiService.sendAdEngagementErrorSample({code:t.code,message:t.name,severity:"CRITICAL"},t)})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.PlaybackFinished,(function(){e.eventCallback(f.Event.END,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.DownloadFinished,(function(t){0===t.downloadType.indexOf("drm/license/")&&(e.drmPerformanceInfo={drmType:t.downloadType.replace("drm/license/",""),drmLoadTime:1e3*t.downloadTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.AudioChanged,(function(t){e.eventCallback(f.Event.AUDIOTRACK_CHANGED,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.SubtitleEnabled,(function(t){e.eventCallback(f.Event.SUBTITLE_CHANGE,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.SubtitleDisabled,(function(t){e.eventCallback(f.Event.SUBTITLE_CHANGE,{currentTime:e.currentTime})})),this.player.on(_.BITMOVIN8_PLAYER_EVENT.LicenseValidated,(function(t){t.data.analytics&&void 0!==t.data.analytics.key?e.onLicenseKeyReceived.dispatch({licenseKey:t.data.analytics.key}):e.onLicenseCallFailed.dispatch({})}))},t.prototype.registerUnloadEventListeners=function(){var e=this,t=function(){if(!e.onBeforeUnLoadEvent){e.onBeforeUnLoadEvent=!0;var t=e.lastTrackedCurrentTime;e.eventCallback(f.Event.UNLOAD,{currentTime:t})}e.release()};this.player.on(_.BITMOVIN8_PLAYER_EVENT.Destroy,t),this.windowEventTracker.addEventListener("beforeunload",t),this.windowEventTracker.addEventListener("unload",t)},t.prototype.applySourceProperties=function(e){var t=this.player.getSource();if(!(0,N.isNullish)(t)){e.videoTitle=t.title,e.mpdUrl=t.dash,e.m3u8Url=t.hls;var n=(0,S.getSourceInfoFromBitmovinSourceConfig)(t.progressive,this.player);e.progUrl=n.progUrl,"progressive"===this.player.getStreamType()&&(e.videoBitrate=n.progBitrate)}},t.prototype.applySubtitleProperties=function(e){var t,n=null===(t=this.player.getSubtitleList())||void 0===t?void 0:t.find((function(e){return!0===e.enabled}));e.subtitleEnabled=(0,N.isNotNullish)(n),e.subtitleLanguage=(0,N.isNotNullish)(n)?n.lang:void 0},t.prototype.applyPlaybackQualityProperties=function(e){var t=this.player.getPlaybackVideoData();(0,N.isNotNullish)(t)&&(e.videoBitrate=t.bitrate,e.videoPlaybackHeight=t.height,e.videoPlaybackWidth=t.width,e.videoCodec=t.codec);var n=this.player.getPlaybackAudioData();(0,N.isNotNullish)(n)&&(e.audioBitrate=n.bitrate,e.audioCodec=n.codec)},t.prototype.applyCastingProperties=function(e){var t=this.player.isCasting()||this.player.isAirplayActive()||!1;if(e.isCasting=t,t)if(this.player.isAirplayActive())e.castTech=p.CastTech.AirPlay;else{var n=this.player.remoteControlConfig;if(!(0,N.isNullish)(n))switch(n.type){case"googlecast":e.castTech=p.CastTech.GoogleCast;break;case"websocket":e.castTech=p.CastTech.WebSocket}}},t.prototype.allowSeeking=function(e){var t=e;return Math.abs(t.position-t.seekTarget)>I.ANALYTICS_MIN_SEEK_DIFFERENCE_THRESHOLD},t.create=function(e,n){var i=new R.SpeedMeterAdapter(e,new l.DownloadSpeedMeter).getDownloadSpeedMeter(),a=new C.SegmentTrackerAdapter(e,new c.SegmentTracker).getSegmentTracker(),r=new b.HttpRequestTrackingAdapter(e);return new t(e,i,a,new E.default,r,new d.SourceInfoFallbackService,n)},t}(D.InternalAdapter);t.Bitmovin8InternalAdapter=L},6923:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bitmovin8PlayerProxy=void 0;var i=n(2974),a=function(){function e(e){var t=this;this.rawPlayer=e,this.on=function(e,n){(0,i.safeAccess)((function(){return t.rawPlayer.on(e,n)}))},this.getCurrentTime=function(e){return(0,i.safeAccess)((function(){return t.rawPlayer.getCurrentTime(e)}))},this.getDuration=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getDuration()}))},this.getPlayerType=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getPlayerType()}))},this.getViewMode=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getViewMode()}))},this.getContainer=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getContainer()}))},this.isLive=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.isLive()}))},this.getStreamType=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getStreamType()}))},this.isMuted=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.isMuted()}))},this.isCasting=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.isCasting()}))},this.isAirplayActive=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.isAirplayActive()}))},this.getAudio=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getAudio()}))},this.getSource=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getSource()}))},this.getDroppedVideoFrames=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getDroppedVideoFrames()}))},this.getPlaybackVideoData=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getPlaybackVideoData()}))},this.getPlaybackAudioData=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getPlaybackAudioData()}))},this.getConfig=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getConfig()}))},this.getSubtitleList=function(){return(0,i.safeAccess)((function(){var e;return null===(e=t.rawPlayer.subtitles)||void 0===e?void 0:e.list()}))},this.isLinearAdActive=function(){return(0,i.safeAccess)((function(){var e;return null===(e=t.rawPlayer.ads)||void 0===e?void 0:e.isLinearAdActive()}))},this.getActiveAd=function(){return(0,i.safeAccess)((function(){var e;return null===(e=t.rawPlayer.ads)||void 0===e?void 0:e.getActiveAd()}))},this.getAdModuleInfo=function(){return(0,i.safeAccess)((function(){var e;return null===(e=t.rawPlayer.ads)||void 0===e?void 0:e.getModuleInfo()}))}}return Object.defineProperty(e.prototype,"version",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.version}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteControlConfig",{get:function(){var e;return null===(e=this.getConfig())||void 0===e?void 0:e.remotecontrol},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoplay",{get:function(){var e,t;return null===(t=null===(e=this.getConfig())||void 0===e?void 0:e.playback)||void 0===t?void 0:t.autoplay},enumerable:!1,configurable:!0}),e}();t.Bitmovin8PlayerProxy=a},2953:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapBitmovinAdError=function(e,t){var n,r={activeAdId:t},o=e,s=o.data;if((0,i.isNotNullish)(s)&&(r.code=s.code||o.code,r.message=s.message||o.name,"adBreak"in s||"adConfig"in s)){var l=null!==(n=s.adBreak)&&void 0!==n?n:s.adConfig;r.adBreakInfo=a(l)}return r},t.mapBitmovinAd=function(e){var t,n,a,r,o,s,l,u,c,d,E,p={id:e.id,isLinear:e.isLinear,clickThroughUrl:e.clickThroughUrl,width:e.width,height:e.height},v=e.isLinear?e:void 0;(0,i.isNotNullish)(v)&&(p.duration=v.duration,p.skippable=(0,i.isNotNullish)(v.skippableAfter),p.skippableAfter=v.skippableAfter,p.mediaUrl=v.mediaFileUrl);var f=e.data;(0,i.isNotNullish)(f)&&(p.bitrate=f.bitrate,p.mimeType=f.mimeType,p.vastData={adSystem:null===(t=f.adSystem)||void 0===t?void 0:t.name,advertiserName:null===(n=f.advertiser)||void 0===n?void 0:n.name,apiFramework:f.apiFramework,creativeAdId:null===(a=f.creative)||void 0===a?void 0:a.adId,creativeId:null===(r=f.creative)||void 0===r?void 0:r.id,universalAdIdRegistry:null===(s=null===(o=f.creative)||void 0===o?void 0:o.universalAdId)||void 0===s?void 0:s.idRegistry,universalAdIdValue:null===(u=null===(l=f.creative)||void 0===l?void 0:l.universalAdId)||void 0===u?void 0:u.value,adDescription:f.adDescription,adTitle:f.adTitle,wrapperAdsCount:null!==(d=null===(c=f.wrapperAdIds)||void 0===c?void 0:c.length)&&void 0!==d?d:0,surveyUrl:null===(E=f.survey)||void 0===E?void 0:E.uri,minSuggestedDuration:f.minSuggestedDuration});return p},t.mapBitmovinAdBreak=a,t.resolveEffectiveAdTag=r,t.getFallbackIndex=o;var i=n(5063);function a(e){var t={replaceContentDuration:e.replaceContentDuration,fallbackIndex:o(e)};t.id="id"in e?e.id:void 0,t.scheduleTime="scheduleTime"in e?e.scheduleTime:void 0;var n=e,i=r(n),a=i.tagUrl,s=i.tagType;return t.tagUrl=a,t.tagType=s,t.persistent="persistent"in e?n.persistent:void 0,t.position="position"in e?e.position:void 0,t.preloadOffset="preloadOffset"in e?e.preloadOffset:void 0,t}function r(e){if((0,i.isNullish)(e.tag))return{};var t=o(e),n={tagType:e.tag.type,tagUrl:e.tag.url};if((0,i.isNullish)(e.fallbackTags)||t<=0||e.fallbackTags.length<t)return n;var a=e.fallbackTags[t-1];return{tagType:a.type,tagUrl:a.url}}function o(e){var t=e.currentFallbackIndex;return(0,i.isNullish)(t)?0:t}},4067:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeBitmovin8AdapterSsaiAdBreakMetadataAdPosition=void 0;var i=n(5063);t.sanitizeBitmovin8AdapterSsaiAdBreakMetadataAdPosition=function(e){var t=e;return(0,i.isNotNullish)(null==t?void 0:t.adPosition)&&("pre-roll"===t.adPosition?t.adPosition="preroll":"mid-roll"===t.adPosition?t.adPosition="midroll":"post-roll"===(null==t?void 0:t.adPosition)&&(t.adPosition="postroll")),t}},3182:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BITMOVIN8_PLAYER_EVENT=void 0,t.BITMOVIN8_PLAYER_EVENT={AdBreakFinished:"adbreakfinished",AdBreakStarted:"adbreakstarted",AdClicked:"adclicked",AdError:"aderror",AdFinished:"adfinished",AdManifestLoaded:"admanifestloaded",AdQuartile:"adquartile",AdSkipped:"adskipped",AdStarted:"adstarted",AudioChanged:"audiochanged",AudioPlaybackQualityChanged:"audioplaybackqualitychanged",CastStarted:"caststarted",CastStopped:"caststopped",Destroy:"destroy",DownloadFinished:"downloadfinished",Error:"error",LicenseValidated:"licensevalidated",Muted:"muted",Paused:"paused",Play:"play",PlaybackFinished:"playbackfinished",Playing:"playing",Seek:"seek",Seeked:"seeked",SegmentPlayback:"segmentplayback",SourceLoaded:"sourceloaded",SourceUnloaded:"sourceunloaded",StallEnded:"stallended",StallStarted:"stallstarted",TimeChanged:"timechanged",SubtitleDisabled:"subtitledisabled",SubtitleEnabled:"subtitleenabled",Unmuted:"unmuted",VideoPlaybackQualityChanged:"videoplaybackqualitychanged",ViewModeChanged:"viewmodechanged"}},7543:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRequestTrackingAdapter=void 0,t.mapHttpRequestType=u;var i=n(675),a=n(7912),r=n(2974),o=n(5063),s=n(3182),l=function(){function e(e){var t=this;this.eventDispatcher=new i.EventDispatcher,e.on(s.BITMOVIN8_PLAYER_EVENT.DownloadFinished,(function(e){return t.onDownloadFinished(e)}))}return e.prototype.subscribe=function(e){return this.eventDispatcher.subscribe(e)},e.prototype.unsubscribe=function(e){this.eventDispatcher.unsubscribe(e)},e.prototype.onDownloadFinished=function(e){var t,n,i;this.eventDispatcher.dispatch({httpRequest:{downloadTime:null!==(t=(0,o.calculateTimeWithUndefined)(null==e?void 0:e.downloadTime))&&void 0!==t?t:0,httpStatus:null!==(n=null==e?void 0:e.httpStatus)&&void 0!==n?n:0,success:null!==(i=null==e?void 0:e.success)&&void 0!==i&&i,timestamp:(0,o.getCurrentTimestamp)(),url:null==e?void 0:e.url,size:null==e?void 0:e.size,timeToFirstByte:(0,o.calculateTimeWithUndefined)(null==e?void 0:e.timeToFirstByte),type:u(null==e?void 0:e.downloadType)}})},e}();function u(e){return(0,r.objectValues)(a.HttpRequestType).includes(e)?e:a.HttpRequestType.UNKNOWN}t.HttpRequestTrackingAdapter=l},8676:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentTrackerAdapter=void 0;var i=n(5063),a=n(3182),r=function(){function e(e,t){var n=this;this.handleSegmentPlaybackEvent=function(e){n.segmentTracker.removeSegment(e.url)},this.segmentTracker=t,e.on(a.BITMOVIN8_PLAYER_EVENT.DownloadFinished,(function(e){return n.handleOnDownloadFinishEvent(e)})),e.on(a.BITMOVIN8_PLAYER_EVENT.SegmentPlayback,(function(e){return n.handleSegmentPlaybackEvent(e)}))}return e.prototype.getSegmentTracker=function(){return this.segmentTracker},e.prototype.handleOnDownloadFinishEvent=function(e){if(0===e.downloadType.indexOf("media/video")){var t=e.url,n={name:i.getURLResourceName(t),url:t,timestamp:e.timestamp};this.segmentTracker.addSegment(n)}},e}();t.SegmentTrackerAdapter=r},665:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeedMeterAdapter=void 0;var i=n(3182),a=function(){function e(e,t){var n=this;this.meter=t,e.on(i.BITMOVIN8_PLAYER_EVENT.DownloadFinished,(function(e){return n.handleOnDownloadFinishEvent(e)}))}return e.prototype.getDownloadSpeedMeter=function(){return this.meter},e.prototype.handleOnDownloadFinishEvent=function(e){e.success&&0===e.downloadType.indexOf("media/video")&&this.meter.addMeasurement({duration:e.downloadTime,size:e.size,timeToFirstByte:e.timeToFirstByte,timestamp:new Date,httpStatus:e.httpStatus})},e}();t.SpeedMeterAdapter=a},681:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlayerModule=void 0;var i=n(4679);t.PlayerModule={name:"analytics",module:{Analytics:i.Bitmovin8Adapter},hooks:{setup:function(e,t){var n=t.getConfig(),i=!n,a=!1===(null==n?void 0:n.analytics);if(i||a)return Promise.resolve();var r=new(0,e.Analytics)(t);return Promise.resolve(r)}}}},2767:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BitmovinPwxAdapter=void 0;var i=n(4350),a=n(8331),r=n(9627),o=n(4926),s=n(28),l=function(){function e(e,t){var n=this;this.getCurrentImpressionId=function(){return n.analytics.getCurrentImpressionId()},this.getUserId=function(){return n.analytics.getUserId()},this.setCustomData=function(e){return n.internalAdapter.setCustomData(e)},this.setCustomDataOnce=function(e){return n.analytics.setCustomDataOnce(e)},this.sourceChange=function(e){throw new Error("Method not implemented.")};var o=(0,a.sanitizeAnalyticsConfig)(t);if(!(0,r.areCollectorRequirementsValid)(o))throw new Error("Failed to create BitmovinPwxAdapter: domain is required");(0,a.guardAgainstDuplicatedUserId)(o),this.internalAdapter=new s.BitmovinPwxInternalAdapter(e),this.analytics=i.Analytics.create(o,this.internalAdapter)}return e.prototype.dispose=function(){this.internalAdapter.release()},Object.defineProperty(e.prototype,"version",{get:function(){return o.VERSION},enumerable:!1,configurable:!0}),e.version=o.VERSION,e}();t.BitmovinPwxAdapter=l},2506:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BitmovinPwxAnalyticsPackage=void 0;var i,a,r,o=n(5063),s=n(2767),l=n(7299);t.BitmovinPwxAnalyticsPackage=(i="analytics-package",a=function(e,t){var n,i,a=t.registry.get(l.CoreExportNames.CoreEffects),r=a.EventListenerEffectFactory,u=a.StateEffectFactory,c=t.using(r,u),d=c.registry.get(l.BundleExportNames.Logger),E=c.registry.get(l.SourceExportNames.SourceState),p=c.registry.get(l.BundleExportNames.PlayerConfig),v=null!==(n=p.analytics)&&void 0!==n?n:{};v.playerKey=null!==(i=v.playerKey)&&void 0!==i?i:p.key,d.log("Applying analytics config ".concat((0,o.tryJSONStringify)(v)));var f=new s.BitmovinPwxAdapter(c,v);d.log('Analytics package initializing for "'.concat(E.url,'"...'));var h=function(){c.abortSignal.removeEventListener("abort",h),d.log('Analytics package disposing for "'.concat(E.url,'"')),f.dispose()};c.abortSignal.addEventListener("abort",h)},r=[l.BundleExportNames.Logger,l.BundleExportNames.PlayerConfig,l.CoreExportNames.Constants,l.CoreExportNames.CoreEffects,l.CoreExportNames.CoreStateAtoms,l.SourceExportNames.SourceState,l.SourcesApiExportNames.SourceEventBus,l.PlaybackApiEventsPackageExportNames.PlaybackEvent],a._name=i,{onAdd:a,dependencies:r})},5406:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.BitmovinPwxAnalyticsStateMachine=t.State=void 0;var r,o=n(2595),s=n(7596),l=n(8253),u=n(2361),c=n(1652),d=n(1916),E=n(1460),p=n(5063);!function(e){e.END="END",e.ERROR="ERROR",e.PAUSE="PAUSE",e.PLAYING="PLAYING",e.READY="READY",e.SETUP="SETUP",e.SOURCE_LOADED="SOURCE_LOADED",e.STARTUP="STARTUP",e.VIDEOSTART_FAILED="VIDEOSTART_FAILED"}(r||(t.State=r={}));var v=function(e){function t(t,n,i){var a=e.call(this,t,n,i)||this;return a.enabledDebugging=!1,a.debuggingStates=[],a}return a(t,e),t.prototype.createStateMachine=function(e){var t,n=this;return o.StateMachine.create({initial:{state:r.SETUP,event:u.JSM_INITIAL_EVENT},error:l.customStateMachineErrorCallback,events:[{name:u.Event.SOURCE_LOADED,from:[r.SETUP,r.ERROR],to:r.READY},(0,l.on)(u.Event.READY).stayIn(r.READY),(0,l.on)(u.Event.PAUSE).stayIn(r.READY),(0,l.on)(u.Event.TIMECHANGED).stayIn(r.READY),{name:u.Event.PLAY,from:r.READY,to:r.STARTUP},{name:u.Event.PLAYING,from:r.READY,to:r.PLAYING},(0,l.on)(u.Event.PLAY).stayIn(r.STARTUP),(0,l.on)(u.Event.PLAYING).stayIn(r.STARTUP),{name:u.Event.TIMECHANGED,from:r.STARTUP,to:r.PLAYING},(0,l.on)(u.Event.READY).stayIn(r.STARTUP),{name:u.Event.PAUSE,from:r.STARTUP,to:r.READY},(0,l.on)(u.Event.PLAYING).stayIn(r.PLAYING),(0,l.on)(u.Event.TIMECHANGED).stayIn(r.PLAYING),{name:u.Event.PAUSE,from:r.PLAYING,to:r.PAUSE},(0,l.on)(u.Event.TIMECHANGED).stayIn(r.PAUSE),(0,l.on)(u.Event.PAUSE).stayIn(r.PAUSE),{name:u.Event.PLAY,from:r.PAUSE,to:r.PLAYING},{name:u.Event.PLAYING,from:r.PAUSE,to:r.PLAYING},{name:u.Event.END,from:r.PLAYING,to:r.END},{name:u.Event.END,from:r.PAUSE,to:r.END},{name:u.Event.PLAYING,from:r.END,to:r.STARTUP},(0,l.on)(u.Event.TIMECHANGED).stayIn(r.END),(0,l.on)(u.Event.END).stayIn(r.END),{name:u.Event.PLAY,from:r.END,to:r.STARTUP},{name:u.Event.ERROR,from:r.STARTUP,to:r.VIDEOSTART_FAILED},{name:u.Event.ERROR,from:(0,l.getAllStatesBut)([r.STARTUP],r),to:r.ERROR},{name:u.Event.UNLOAD,from:(0,l.getAllStatesBut)([r.STARTUP],r),to:r.END},{name:u.Event.UNLOAD,from:[r.STARTUP],to:r.VIDEOSTART_FAILED}],callbacks:(t={},t["onleave".concat(r.PLAYING)]=function(){n.playingHeartbeatService.stopHeartbeat()},t.onleavestate=function(e,t,i,a,o){if((0,l.logStateMachineTransition)("LEAVE",e,t,i),e!==u.JSM_INITIAL_EVENT&&a){n.addStatesToLog(e,t,i,a,o);var s=a-n.onEnterStateTimestamp,c=t===r.STARTUP&&i===r.PLAYING;n.maybeSetOrClearVideoStartTimeouts(t,i),c&&n.stateMachineCallbacks.startup(s,r.STARTUP.toLowerCase());var E=String(t).toLowerCase();if(e===u.Event.UNLOAD)n.stateMachineCallbacks.unload(s,E);else if(t===r.SETUP)n.stateMachineCallbacks.setup(1,r.SETUP.toLowerCase());else if(e===u.Event.PAUSE&&t===r.STARTUP&&i===r.READY)n.clearVideoStartTimeout();else if(t!==r.ERROR&&!c){var v=n.stateMachineCallbacks[E];if((0,p.isFunction)(v))try{v(s,E,o)}catch(e){d.logger.error("Exception occurred in State Machine callback "+E,o,e)}else(0,l.logMissingCallbackWarning)(t,[r.READY])}}},t["onenter".concat(r.PLAYING)]=function(){n.playingHeartbeatService.startHeartbeat()},t.onenterstate=function(t,i,a,r,o){(0,l.logStateMachineTransition)("ENTER",t,i,a),n.onEnterStateTimestamp=null!=r?r:Date.now(),(0,E.isNumber)(e.starttime)&&t===u.JSM_INITIAL_EVENT&&(n.onEnterStateTimestamp=e.starttime)},t["onafter".concat(u.Event.ERROR)]=function(e,t,i,a,r){n.stateMachineCallbacks.error(r)},t)})},t.prototype.addStatesToLog=function(e,t,n,i,a){this.enabledDebugging&&this.debuggingStates.push(new c.EventDebugging(e,t,n,i,a))},t.prototype.getStates=function(){return this.debuggingStates},t.prototype.setEnabledDebugging=function(e){this.enabledDebugging=e},t.prototype.maybeSetOrClearVideoStartTimeouts=function(e,t){e===r.READY&&t===r.STARTUP?this.setVideoStartTimeout():e===r.STARTUP&&t===r.PLAYING&&this.clearVideoStartTimeout()},t}(s.AnalyticsStateMachine);t.BitmovinPwxAnalyticsStateMachine=v},28:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmovinPwxInternalAdapter=void 0;var o=n(2663),s=n(2361),l=n(556),u=n(7224),c=n(7614),d=n(9557),E=n(3413),p=n(2647),v=n(5406),f=n(7299),h=function(e){function t(t,n){var i=e.call(this,n)||this;i.onBeforeUnLoadEvent=!1,i.context=t;var a=new o.HeartbeatService((function(){return i.currentTime})),r=new v.BitmovinPwxAnalyticsStateMachine(i.stateMachineCallbacks,a,i.opts);return a.setListener(r),i.stateMachine=r,i}return a(t,e),t.prototype.getSource=function(){return this.context.registry.get(f.SourceExportNames.SourceState)},Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.getSource().playback.playhead.position},enumerable:!1,configurable:!0}),t.prototype.getAutoPlay=function(){return this.getSource().config.playback.autoplay},t.prototype.getCurrentPlaybackInfo=function(){var e,t,n,i,a,o,s,l=null===(e=this.getSource().sourceConfig.resources.filter((function(e){return e.url.includes(".m3u8")}))[0])||void 0===e?void 0:e.url,c=null===(t=this.getSource().sourceConfig.resources.filter((function(e){return e.url.includes(".mpd")}))[0])||void 0===t?void 0:t.url,d=null===(n=this.getSource().video.element)||void 0===n?void 0:n.getBoundingClientRect(),p=Math.round(null!==(i=null==d?void 0:d.width)&&void 0!==i?i:1),v=Math.round(null!==(a=null==d?void 0:d.height)&&void 0!==a?a:1),f=void 0;return l?f=u.StreamTypes.hls:c&&(f=u.StreamTypes.dash),r(r({},this.getCommonPlaybackInfo()),{droppedFrames:0,isMuted:null===(o=this.getSource().video.element)||void 0===o?void 0:o.muted,isLive:"live"===this.getSource().stream.type,videoWindowHeight:v,videoWindowWidth:p,videoDuration:(0,E.normalizeVideoDuration)(null===(s=this.getSource().video.element)||void 0===s?void 0:s.duration),videoPlaybackHeight:v,videoPlaybackWidth:p,m3u8Url:l,mpdUrl:c,streamFormat:f,videoCodec:void 0,audioCodec:void 0,videoBitrate:0,audioBitrate:0})},t.prototype.getPlayerName=function(){return l.Player.BITMOVIN_PWX},t.prototype.getPlayerTech=function(){return"webx:html5"},t.prototype.getPlayerVersion=function(){return this.context.registry.get(f.CoreExportNames.Constants).Version},t.prototype.initialize=function(e){return this.registerEventListeners(),this.registerUnloadEventListeners(),[new d.ErrorDetailTracking(e.errorDetailTrackingSettingsProvider,new c.ErrorDetailBackend(e.errorDetailTrackingSettingsProvider.collectorConfig),[e.errorDetailSubscribable],void 0)]},t.prototype.registerUnloadEventListeners=function(){var e=this,t=function(){if(!e.onBeforeUnLoadEvent){e.onBeforeUnLoadEvent=!0;var t=e.context.registry.get(f.SourceExportNames.SourceState).playback.playhead.position;e.eventCallback(s.Event.UNLOAD,{currentTime:t})}e.release()};t=t.bind(!0),this.context.abortSignal.addEventListener("abort",t),this.windowEventTracker.addEventListener("beforeunload",t),this.windowEventTracker.addEventListener("unload",t)},t.prototype.registerEventListeners=function(){var e=this,t=this.context.registry.get(f.SourcesApiExportNames.SourceEventBus),n=this.context.registry.get(f.SourceExportNames.SourceState).playback,i=this.context.registry.get(f.PlaybackApiEventsPackageExportNames.PlaybackEvent);t.on(i.Ready,(function(){e.eventCallback(s.Event.SOURCE_LOADED,{currentTime:n.playhead.position})})),t.on(i.Play,(function(){e.eventCallback(s.Event.PLAY,{currentTime:n.playhead.position})})),t.on(i.Playing,(function(){e.eventCallback(s.Event.PLAYING,{currentTime:n.playhead.position})})),t.on(i.Paused,(function(){e.eventCallback(s.Event.PAUSE,{currentTime:n.playhead.position})})),t.on(i.TimeChanged,(function(){e.eventCallback(s.Event.TIMECHANGED,{currentTime:n.playhead.position})})),t.on(i.VideoAttached,(function(){e.eventCallback(s.Event.SOURCE_LOADED,{currentTime:n.playhead.position})})),t.on(i.Ended,(function(){e.eventCallback(s.Event.END,{currentTime:n.playhead.position})}));var a=function(){var t=e.context.abortSignal.reason;"SourceRemovedError"===t.name||"FrameworkDisposedError"===t.name?e.eventCallback(s.Event.SOURCE_UNLOADED,{currentTime:n.playhead.position}):e.eventCallback(s.Event.ERROR,{currentTime:n.playhead.position,code:1007,message:t.message,data:t,originalError:t}),e.context.abortSignal.removeEventListener("abort",a)};this.context.abortSignal.addEventListener("abort",a)},t}(p.InternalAdapter);t.BitmovinPwxInternalAdapter=h},7299:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourcesApiExportNames=t.SourceExportNames=t.PlaybackApiEventsPackageExportNames=t.CoreExportNames=t.BundleExportNames=void 0;t.BundleExportNames={Logger:"logger",PlayerConfig:"player-config"};t.CoreExportNames={Utils:"utils",Constants:"constants",CoreEffects:"core-effects",CoreStateAtoms:"core-state-atoms"};t.PlaybackApiEventsPackageExportNames={PlaybackEvent:"playback-event"};t.SourceExportNames={CreateSourceStateAtom:"create-source-state-atom",CreateSourceReference:"create-source-reference",SourceReferences:"source-references",SourceState:"source-state-atom"};t.SourcesApiExportNames={SourceApiManager:"source-api-manager",VideoElementUtils:"video-element-utils",SourceEventBus:"source-event-bus"}},5127:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CAFv3Adapter=void 0;var i=n(4350),a=n(8331),r=n(9627),o=n(1916),s=n(2108),l=n(4926),u=n(3236),c=function(){function e(e,t,n){if((0,s.hasPlayerAlreadyBeenAugmented)(t))o.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this CastReceiverContext instance");else{(0,s.markPlayerInstanceAsAugmented)(t);var l=(0,a.sanitizeAnalyticsConfig)(e);(0,r.areCollectorRequirementsValid)(l)&&((0,a.guardAgainstDuplicatedUserId)(l),this.internalAdapter=new u.CAFv3InternalAdapter(t,n),this.analytics=i.Analytics.create(l,this.internalAdapter))}}return Object.defineProperty(e.prototype,"version",{get:function(){return l.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,s.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.sourceChange(e)},e.version=l.VERSION,e}();t.CAFv3Adapter=c},3236:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.CAFv3InternalAdapter=void 0,t.detectCAFv3PlaybackInfoStreamTypeFields=g;var o=n(3453),s=n(2663),l=n(2361),u=n(556),c=n(7224),d=n(7614),E=n(9557),p=n(3413),v=n(1820),f=n(5063),h=n(2647),m=n(875),A=n(1489),y=function(e){function t(t,n){var i=e.call(this,n)||this;i.onBeforeUnLoadEvent=!1,i.activeTextTracks=[],i.getPlayerVersion=function(){var e,t;return null!==(t=null===(e=null===cast||void 0===cast?void 0:cast.framework)||void 0===e?void 0:e.VERSION)&&void 0!==t?t:"unknown"},i.getPlayerName=function(){return u.Player.CHROMECAST_SHAKA},i.getPlayerTech=function(){return"html5"},i.getAutoPlay=function(){var e,t,n;return null!==(n=null===(t=null===(e=i.playerManager.getQueueManager())||void 0===e?void 0:e.getCurrentItem())||void 0===t?void 0:t.autoplay)&&void 0!==n&&n},i.getDrmPerformanceInfo=function(){return i.drmPerformanceInfo};var a=new s.HeartbeatService((function(){return t.getPlayerManager().getCurrentTimeSec()})),r=new o.CAFv3AnalyticsStateMachine(i.stateMachineCallbacks,a,i.opts);return a.setListener(r),i.playerManager=new m.CAFv3PlayerProxy(t.getPlayerManager()),i.stateMachine=r,i}return a(t,e),t.prototype.initialize=function(e){return this.registerCastFrameworkEventListeners(),this.registerWindowUnloadEventListeners(),[new E.ErrorDetailTracking(e.errorDetailTrackingSettingsProvider,new d.ErrorDetailBackend(e.errorDetailTrackingSettingsProvider.collectorConfig),[e.errorDetailSubscribable],void 0)]},t.prototype.getCurrentPlaybackInfo=function(){var e,t,n,i=this.playerManager.getStats(),a=null===(e=this.activeTextTracks)||void 0===e?void 0:e.map((function(e){return e.language})).filter(f.isNotNullish);return r(r(r(r({},this.getCommonPlaybackInfo()),g(this.playerManager)),function(e){var t;try{var n=e.getAudioTracksManager(),i=null==n?void 0:n.getActiveTrack();return{audioLanguage:null==i?void 0:i.language,audioCodec:null===(t=null==i?void 0:i.audioTrackInfo)||void 0===t?void 0:t.audioCodec,audioBitrate:void 0}}catch(e){return{}}}(this.playerManager)),{isLive:T(this.playerManager),playerTech:this.getPlayerTech(),videoDuration:(0,p.normalizeVideoDuration)(null!==(n=null===(t=this.playerManager.getMediaInformation())||void 0===t?void 0:t.duration)&&void 0!==n?n:0),videoPlaybackHeight:null==i?void 0:i.height,videoPlaybackWidth:null==i?void 0:i.width,subtitleLanguage:a?a.join(","):void 0,droppedFrames:0})},Object.defineProperty(t.prototype,"currentTime",{get:function(){var e;return null!==(e=this.playerManager.getCurrentTimeSec())&&void 0!==e?e:0},enumerable:!1,configurable:!0}),t.prototype.registerCastFrameworkEventListeners=function(){var e=this;this.playerManager.addEventListener(A.CastFrameworkEvent.LOADED_METADATA,(function(t){e.eventCallback(l.Event.SOURCE_LOADED,{})})),this.playerManager.addEventListener(A.CastFrameworkEvent.PLAYER_LOAD_COMPLETE,(function(){var t=e.playerManager.getTextTracksManager();(0,f.isNotNullish)(t)&&(e.activeTextTracks=t.getActiveTracks()),e.eventCallback(l.Event.READY,{})})),this.playerManager.addEventListener(A.CastFrameworkEvent.PLAY,(function(t){e.eventCallback(l.Event.PLAY,{currentTime:t.currentMediaTime})})),this.playerManager.addEventListener(A.CastFrameworkEvent.PLAYING,(function(t){e.eventCallback(l.Event.PLAYING,{currentTime:e.currentTime})})),this.playerManager.addEventListener(A.CastFrameworkEvent.TIME_UPDATE,(function(t){e.eventCallback(l.Event.TIMECHANGED,{currentTime:t.currentMediaTime})})),this.playerManager.addEventListener(A.CastFrameworkEvent.PAUSE,(function(t){e.eventCallback(l.Event.PAUSE,{currentTime:e.currentTime})})),this.playerManager.addEventListener(A.CastFrameworkEvent.ERROR,(function(t){var n=(0,f.isNotNullish)(t.error)?t.error:void 0;e.eventCallback(l.Event.ERROR,{currentTime:e.playerManager.getCurrentTimeSec(),code:t.detailedErrorCode,message:t.reason,legacyData:n,originalError:t,data:{additionalData:(0,f.tryJSONStringify)(n)}})})),this.playerManager.addEventListener(A.CastFrameworkEvent.SEEKING,(function(t){e.eventCallback(l.Event.SEEK,{currentTime:t.currentMediaTime})})),this.playerManager.addEventListener(A.CastFrameworkEvent.SEEKED,(function(t){e.eventCallback(l.Event.SEEKED,{currentTime:t.currentMediaTime})})),this.playerManager.addEventListener(A.CastFrameworkEvent.BUFFERING,(function(t){t.isBuffering&&e.eventCallback(l.Event.START_BUFFERING,{currentTime:e.currentTime})})),this.playerManager.addEventListener(A.CastFrameworkEvent.REQUEST_LOAD,(function(t){e.sourceChange({})}))},t.prototype.registerWindowUnloadEventListeners=function(){var e=this,t=function(){e.onBeforeUnLoadEvent||(e.onBeforeUnLoadEvent=!0,e.eventCallback(l.Event.UNLOAD,{currentTime:e.currentTime})),e.release()};this.windowEventTracker.addEventListener("beforeunload",t),this.windowEventTracker.addEventListener("unload",t)},t}(h.InternalAdapter);function T(e){var t;return"LIVE"===(null===(t=e.getMediaInformation())||void 0===t?void 0:t.streamType)||(!!e.getLiveSeekableRange()||void 0)}function g(e){var t,n,i=null===(t=e.getMediaInformation())||void 0===t?void 0:t.contentUrl;((0,f.isNullish)(i)||(0,v.isBlank)(i))&&(i=null===(n=e.getMediaInformation())||void 0===n?void 0:n.contentId);var a=(0,c.getStreamTypesFromURL)(i);return(0,p.buildPlaybackInfoStreamTypeFields)(a,i)}t.CAFv3InternalAdapter=y},875:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CAFv3PlayerProxy=void 0;var i=n(2974),a=function(e){var t=this;this.rawPlayer=e,this.addEventListener=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(0,i.safeAccess)((function(){var n;return(n=t.rawPlayer).addEventListener.apply(n,e)}))},this.getCurrentTimeSec=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getCurrentTimeSec()}))},this.getStats=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getStats()}))},this.getMediaInformation=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getMediaInformation()}))},this.getLiveSeekableRange=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getLiveSeekableRange()}))},this.getTextTracksManager=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getTextTracksManager()}))},this.getQueueManager=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getQueueManager()}))},this.getAudioTracksManager=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getAudioTracksManager()}))}};t.CAFv3PlayerProxy=a},1489:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CastFrameworkEvent=void 0,t.CastFrameworkEvent={ALL:"*",BUFFERING:"BUFFERING",ERROR:"ERROR",LOADED_METADATA:"LOADED_METADATA",PAUSE:"PAUSE",PLAY:"PLAY",PLAYING:"PLAYING",PLAYER_LOAD_COMPLETE:"PLAYER_LOAD_COMPLETE",REQUEST_LOAD:"REQUEST_LOAD",SEEKED:"SEEKED",SEEKING:"SEEKING",STALLED:"STALLED",TIME_UPDATE:"TIME_UPDATE"}},9566:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HlsAdapter=void 0;var i=n(4350),a=n(8331),r=n(9627),o=n(1916),s=n(2108),l=n(4926),u=n(1601),c=n(4379),d=function(){function e(e,t,n){if((0,s.hasPlayerAlreadyBeenAugmented)(t))o.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance");else{(0,s.markPlayerInstanceAsAugmented)(t);var l=(0,a.sanitizeAnalyticsConfig)(e);(0,r.areCollectorRequirementsValid)(l)&&((0,a.guardAgainstDuplicatedUserId)(l),this.internalAdapter=new u.HlsInternalAdapter(new c.HlsjsPlayerProxy(t),n),this.analytics=i.Analytics.create(l,this.internalAdapter))}}return Object.defineProperty(e.prototype,"version",{get:function(){return l.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,s.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.sourceChange(e)},e.version=l.VERSION,e}();t.HlsAdapter=d},1601:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getHlsCurrentLevel=t.getHlsCodecInfo=t.HlsInternalAdapter=void 0;var o=n(9664),s=n(2361),l=n(2168),u=n(556),c=n(7614),d=n(9557),E=n(1460),p=n(5063),v=n(7124),f=n(4426),h=n(7922),m=n(4778),A=function(e){function n(n,i){var a=e.call(this,void 0,i)||this;return a.getPlayerName=function(){return u.Player.HLSJS},a.getPlayerVersion=function(){var e;return null!==(e=a.hls.version)&&void 0!==e?e:"unknown"},a.isLive=function(){var e=(0,t.getHlsCurrentLevel)(a.hls);if(!(0,p.isNullish)(null==e?void 0:e.details))return e.details.live},a.onDestroying=function(){a.eventCallback(s.Event.SOURCE_UNLOADED,{}),a.release()},a.hls=n,a.speedMeter=new m.HlsSpeedMeterAdapter(n,new o.DownloadSpeedMeter).getDownloadSpeedMeter(),a}return a(n,e),n.prototype.initialize=function(t){return e.prototype.initialize.call(this,t),this.registerHlsEvents(),[new d.ErrorDetailTracking(t.errorDetailTrackingSettingsProvider,new c.ErrorDetailBackend(t.errorDetailTrackingSettingsProvider.collectorConfig),[t.errorDetailSubscribable],void 0)]},n.prototype.getCurrentPlaybackInfo=function(){var n=this.getSelectedSubtitleLanguage(),i=r(r({},e.prototype.getCurrentPlaybackInfo.call(this)),{audioLanguage:this.getSelectedAudioLanguage(),subtitleEnabled:(0,p.isNotNullish)(n)?n.enabled:void 0,subtitleLanguage:(0,p.isNotNullish)(n)?n.language:void 0}),a=(0,t.getHlsCodecInfo)(this.hls);return this.sourceInfoFallbackService.applyAndStoreCodecInfo(i,a),i},n.prototype.getDownloadSpeedInfo=function(){return this.speedMeter.getInfo()},n.prototype.resetDownloadSpeedInfoMeasures=function(){this.speedMeter.reset()},n.prototype.getCurrentQualityLevelInfo=function(){var e=(0,t.getHlsCurrentLevel)(this.hls);return e?{bitrate:e.bitrate,width:e.width,height:e.height}:null},n.prototype.getMIMEType=function(){return l.MIMETypes.HLS},n.prototype.getStreamURL=function(){var e;return null!==(e=this.hls.url)&&void 0!==e?e:void 0},n.prototype.registerHlsEvents=function(){this.hls.on(h.HLS_PLAYER_EVENT.MEDIA_ATTACHING,this.onMediaAttaching.bind(this)),this.hls.on(h.HLS_PLAYER_EVENT.MEDIA_DETACHING,this.onMediaDetaching.bind(this)),this.hls.on(h.HLS_PLAYER_EVENT.MANIFEST_LOADING,this.onManifestLoading.bind(this)),this.hls.on(h.HLS_PLAYER_EVENT.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched.bind(this)),this.hls.on(h.HLS_PLAYER_EVENT.SUBTITLE_TRACK_SWITCH,this.onSubtitleLanguageSwitched.bind(this)),this.hls.on(h.HLS_PLAYER_EVENT.DESTROYING,this.onDestroying.bind(this)),this.hls.on(h.HLS_PLAYER_EVENT.ERROR,this.onHlsError.bind(this)),this.hls.media&&(this.onMediaAttaching(),this.onManifestLoading())},n.prototype.onMediaAttaching=function(){this.mediaElement||(this.mediaElement=new f.HTMLVideoElementProxy(this.hls.media),this.registerMediaElement(),this.onMaybeReady())},n.prototype.onMediaDetaching=function(){this.unregisterMediaElement()},n.prototype.onManifestLoading=function(){this.onMaybeReady()},n.prototype.onHlsError=function(e,t){if(!t||t.fatal){var n=this.mediaElement,i=void 0;(0,p.isNotNullish)(n)&&(i=n.currentTime);var a=(0,p.isNotNullish)(t)?"".concat(t.type,": ").concat(t.details):void 0;this.eventCallback(s.Event.ERROR,{currentTime:i,code:this.getErrorCodeFromHlsErrorType(t.type),message:a,originalError:t,data:{}})}},n.prototype.onAudioTrackSwitched=function(e,t){var n,i=this.mediaElement;(0,p.isNotNullish)(i)&&(n=i.currentTime),this.eventCallback(s.Event.AUDIOTRACK_CHANGED,{currentTime:n})},n.prototype.onSubtitleLanguageSwitched=function(e,t){var n,i=this.mediaElement;(0,p.isNotNullish)(i)&&(n=i.currentTime),this.eventCallback(s.Event.SUBTITLE_CHANGE,{currentTime:n})},n.prototype.getErrorCodeFromHlsErrorType=function(e){switch(e){case"networkError":return 2;case"mediaError":return 3;case"keySystemError":return 4;case"muxError":return 5;default:return 1}},n.prototype.getSelectedAudioLanguage=function(){var e=this.hls.audioTrack;if(!((0,p.isNullish)(e)||e<0)){var t=this.hls.audioTracks;if(!(0,p.isNullish)(t)&&0!==t.length)return t[e].lang}},n.prototype.getSelectedSubtitleLanguage=function(){var e,t;if((0,p.isNotNullish)(this.hls.subtitleDisplay)){var n=this.hls.subtitleTrack,i=(0,p.isNotNullish)(n)&&n>=0&&this.hls.subtitleDisplay;return{enabled:i,language:i?null===(t=null===(e=this.hls.subtitleTracks)||void 0===e?void 0:e[n])||void 0===t?void 0:t.lang:void 0}}var a=this.hls.subtitleTrackController;if((0,p.isNotNullish)(a)&&(0,p.isNotNullish)(a.media))return this.getSelectedSubtitleFromMediaElement(a.media)},n}(v.HTML5InternalAdapter);t.HlsInternalAdapter=A;t.getHlsCodecInfo=function(e){var n=(0,t.getHlsCurrentLevel)(e);if(n)return{videoCodec:n.videoCodec,audioCodec:n.audioCodec}};t.getHlsCurrentLevel=function(e){var t=e.levels,n=e.currentLevel;if(!(0,p.isNullish)(t)&&0!==t.length&&(0,E.isNumber)(n)&&!(n<0))return t[n]}},4379:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HlsjsPlayerProxy=void 0;var i=n(2974),a=function(){function e(e){var t=this;this.rawPlayer=e,this.on=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(0,i.safeAccess)((function(){var n;return(n=t.rawPlayer).on.apply(n,e)}))}}return Object.defineProperty(e.prototype,"media",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.media}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.url}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"levels",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.levels}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentLevel",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.currentLevel}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioTrack",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.audioTrack}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioTracks",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.audioTracks}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subtitleDisplay",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.subtitleDisplay}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subtitleTrack",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.subtitleTrack}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subtitleTracks",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.subtitleTracks}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.constructor.version}))},enumerable:!1,configurable:!0}),e}();t.HlsjsPlayerProxy=a},7922:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.HLS_PLAYER_EVENT=t.PlaylistLevelType=void 0,function(e){e.AUDIO="audio",e.MAIN="main",e.SUBTITLE="subtitle"}(n||(t.PlaylistLevelType=n={})),t.HLS_PLAYER_EVENT={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_DETACHING:"hlsMediaDetaching",MANIFEST_LOADING:"hlsManifestLoading",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",DESTROYING:"hlsDestroying",ERROR:"hlsError",FRAG_LOADED:"hlsFragLoaded"}},4778:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HlsSpeedMeterAdapter=void 0;var i=n(5063),a=n(7922),r=function(){function e(e,t){var n=this;this.meter=t,e.on(a.HLS_PLAYER_EVENT.FRAG_LOADED,(function(e,t){return n.handleFragmentLoadedEvent(t)}))}return e.prototype.getDownloadSpeedMeter=function(){return this.meter},e.prototype.handleFragmentLoadedEvent=function(e){if("main"===e.frag.type){var t=(0,i.isNotNullish)(e.networkDetails)?e.networkDetails.status:void 0;if(!(0,i.isNullish)(t)){var n=e.frag.stats,a=(n.loading.end-n.loading.start)/1e3,r=(n.loading.first-n.loading.start)/1e3,o={duration:a,size:n.total,timeToFirstByte:r,timestamp:new Date,httpStatus:t};this.meter.addMeasurement(o)}}},e}();t.HlsSpeedMeterAdapter=r},7124:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.HTML5InternalAdapter=void 0;var o=n(3674),s=n(2663),l=n(6743),u=n(2361),c=n(2168),d=n(556),E=n(8525),p=n(7224),v=n(3413),f=n(3848),h=n(1916),m=n(5063),A=n(2647),y=n(8510),T=function(e){function t(t,n){var i=e.call(this,n)||this;i.needsFirstPlayIntent=!0,i.onBeforeUnLoadEvent=!1,i.isBuffering=!1,i.isPaused=!1,i.isSeeking=!1,i.previousMediaTimeInSeconds=0,i.previousMutedValue=!1,i.getPlayerName=function(){return d.Player.HTML5},i.getPlayerTech=function(){return"html5"},i.getAutoPlay=function(){var e,t;return null!==(t=null===(e=i.mediaElement)||void 0===e?void 0:e.autoplay)&&void 0!==t&&t},i.getDrmPerformanceInfo=function(){return i.drmPerformanceInfo},i.isLive=function(){if(i.mediaElement){var e=i.mediaElement.duration;return(0,m.isNullish)(e)||isNaN(e)?void 0:e===1/0}};var a=new s.HeartbeatService((function(){var e;return null!==(e=null==t?void 0:t.currentTime)&&void 0!==e?e:i.previousMediaTimeInSeconds})),r=new o.HTML5AnalyticsStateMachine(i.stateMachineCallbacks,a,i.opts);return a.setListener(r),i.stateMachine=r,i.mediaElement=t,i.mediaElementEventHandlers=[],i.mediaElementOriginalLoadFn=void 0,i.bufferingTimeout=void 0,i.isBuffering=!1,i.isPaused=!1,i.isSeeking=!1,i.previousMediaTimeInSeconds=0,i.previousClientTime=0,i.needsReadyEvent=!0,i.needsFirstPlayIntent=!0,i._videoCompletionTracker=new l.default,i.playerStatisticsProvider=new y.default(t),i}return a(t,e),Object.defineProperty(t.prototype,"videoCompletionTracker",{get:function(){return this._videoCompletionTracker},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){return this.mediaElement&&this.setMediaElement(),this.registerWindowEvents(),[]},t.prototype.getCurrentPlaybackInfo=function(){var e=this.getStreamType();(0,m.isNotNullish)(e)&&this.sourceInfoFallbackService.setStreamFormat(e);var t=r(r(r({},this.getCommonPlaybackInfo()),(0,v.buildPlaybackInfoStreamTypeFields)(e,this.getStreamURL())),{isLive:this.isLive(),size:(0,f.isVideoInFullscreen)()?E.PlayerSize.Fullscreen:E.PlayerSize.Window,playerTech:this.getPlayerTech(),droppedFrames:this.playerStatisticsProvider.getDroppedFrames()});this.mediaElement&&(t=r(r({},t),{videoDuration:(0,v.normalizeVideoDuration)(this.mediaElement.duration),isMuted:this.mediaElement.muted,videoWindowHeight:this.mediaElement.height,videoWindowWidth:this.mediaElement.width}));var n=this.getCurrentQualityLevelInfo();return n&&(t=r(r({},t),{videoPlaybackHeight:n.height,videoPlaybackWidth:n.width,videoBitrate:n.bitrate})),this.sourceInfoFallbackService.applyStreamFormat(t),t},t.prototype.resetSourceRelatedState=function(){e.prototype.resetSourceRelatedState.call(this),this.playerStatisticsProvider.reset(),this.needsFirstPlayIntent=!0,this.isBuffering=!1,this.isPaused=!1,this.isSeeking=!1,this.previousMediaTimeInSeconds=0,clearTimeout(this.bufferingTimeout)},Object.defineProperty(t.prototype,"currentTime",{get:function(){var e;if(!this.mediaElement)throw new Error("No media attached");return null!==(e=this.mediaElement.currentTime)&&void 0!==e?e:this.previousMediaTimeInSeconds},enumerable:!1,configurable:!0}),t.prototype.release=function(){this.unregisterMediaElement(),e.prototype.release.call(this)},t.prototype.setMediaElement=function(e){if(void 0===e&&(e=null),e&&(this.mediaElement&&this.unregisterMediaElement(),this.mediaElement=e),!this.mediaElement)throw new Error("No media element owned");if(this.mediaElementEventHandlers.length>0)throw new Error("Media element already set (only call this once)");this.registerMediaElement(),this.onMaybeReady()},t.prototype.getMIMEType=function(){var e=this.getStreamURL();if(!(0,m.isNullish)(e))return(0,c.getMIMETypeFromFileExtension)(e)},t.prototype.getStreamType=function(){var e=this.getMIMEType();if(e)return(0,p.getStreamTypeFromMIMEType)(e)},t.prototype.getStreamURL=function(){var e=this.mediaElement;if(e)return e.src},t.prototype.registerMediaElement=function(){var e=this,t=this.mediaElement;if(t){this.mediaElementOriginalLoadFn=t.getRawPlayer().load;var n=this.mediaElementOriginalLoadFn;t.getRawPlayer().load=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];e.sourceChange({}),n.apply(t.getRawPlayer(),i)},this.listenToMediaElementEvent("loadstart",(function(){g("loadstart ".concat(t.currentTime)),e.sourceChange({})})),this.listenToMediaElementEvent("loadedmetadata",(function(){var n,i;g("loadedmetadata time:".concat(t.currentTime," / readyState: ").concat(t.readyState)),e.checkQualityLevelAttributes(!0);var a=e.getStreamType();(0,m.isNotNullish)(a)&&e.sourceInfoFallbackService.setStreamFormat(a),(0,m.isNotNullish)(e.mediaElement)&&(e._videoCompletionTracker.reset(),e._videoCompletionTracker.setVideoDuration(null!==(n=e.mediaElement.duration)&&void 0!==n?n:0),e.previousMutedValue=null!==(i=e.mediaElement.muted)&&void 0!==i&&i),e.eventCallback(u.Event.SOURCE_LOADED,{})})),this.listenToMediaElementEvent("play",(function(){var n;g("play ".concat(t.currentTime));var i=null!==(n=t.currentTime)&&void 0!==n?n:e.previousMediaTimeInSeconds;e.needsFirstPlayIntent&&(e.previousMediaTimeInSeconds=i),e.needsFirstPlayIntent=!1,e.eventCallback(u.Event.PLAY,{currentTime:i})})),this.listenToMediaElementEvent("pause",(function(){g("pause ".concat(t.currentTime)),e.onPaused()})),this.listenToMediaElementEvent("playing",(function(){g("playing ".concat(t.currentTime)),clearTimeout(e.bufferingTimeout),e.isPaused=!1,e.needsFirstPlayIntent=!1})),this.registerMediaElementErrorEvent(t),this.listenToMediaElementEvent("volumechange",(function(){var n;g("volumechange ".concat(t.currentTime));var i=t.muted,a=t.volume;if(!(0,m.isNullish)(i)&&!(0,m.isNullish)(a)){var r=null!==(n=t.currentTime)&&void 0!==n?n:e.previousMediaTimeInSeconds,o=(0,m.isAudioMuted)(i,a);e.previousMutedValue!==o&&(o?e.eventCallback(u.Event.MUTE,{currentTime:r}):e.eventCallback(u.Event.UN_MUTE,{currentTime:r}),e.previousMutedValue=o)}})),this.listenToMediaElementEvent("seeking",(function(){g("seeking ".concat(t.currentTime));var n=t.currentTime;e.eventCallback(u.Event.SEEK,{currentTime:n})})),this.listenToMediaElementEvent("seeked",(function(){g("seeked ".concat(t.currentTime));var n=t.currentTime;clearTimeout(e.bufferingTimeout),e.eventCallback(u.Event.SEEKED,{currentTime:n})})),this.listenToMediaElementEvent("timeupdate",(function(){var n,i=null!==(n=t.currentTime)&&void 0!==n?n:0;if(e.isBuffering=!1,e.isSeeking=!1,!e.needsFirstPlayIntent){if(!e.isPaused)1e3*Math.abs(i-e.previousMediaTimeInSeconds)>0&&e.eventCallback(u.Event.TIMECHANGED,{currentTime:i});e.checkQualityLevelAttributes(),e.checkSeeking(),e.checkPlayheadProgress(),e.previousMediaTimeInSeconds=i}})),this.listenToMediaElementEvent("stalled",(function(){})),this.listenToMediaElementEvent("waiting",(function(){g("waiting ".concat(t.currentTime)),e.checkSeeking(),e.onBuffering()}))}},t.prototype.registerMediaElementErrorEvent=function(e){var t=this;this.listenToMediaElementEvent("error",(function(){var n,i,a;g("error ".concat(e.currentTime));var r=e.error;t.eventCallback(u.Event.ERROR,{currentTime:null!==(n=e.currentTime)&&void 0!==n?n:t.previousMediaTimeInSeconds,code:null!==(i=null==r?void 0:r.code)&&void 0!==i?i:void 0,message:null!==(a=null==r?void 0:r.message)&&void 0!==a?a:void 0,originalError:r,data:{}})}))},t.prototype.listenToMediaElementEvent=function(e,t){if(!this.mediaElement)throw new Error("No media attached");var n=t.bind(this);this.mediaElementEventHandlers.push({event:e,handler:n}),this.mediaElement.addEventListener(e,n,!1)},t.prototype.onMaybeReady=function(){var e;this.needsReadyEvent&&this.mediaElement&&(this.needsReadyEvent=!1,this.getCurrentPlaybackInfo(),this._videoCompletionTracker.reset(),this._videoCompletionTracker.setVideoDuration(null!==(e=this.mediaElement.duration)&&void 0!==e?e:0))},t.prototype.unregisterMediaElement=function(){if(!this.mediaElement)throw new Error("No media element attached");var e=this.mediaElement;this.mediaElementEventHandlers.forEach((function(t){e.removeEventListener(t.event,t.handler)}));var t=this.mediaElementOriginalLoadFn;(0,m.isNotNullish)(t)&&(e.getRawPlayer().load=t),this.mediaElement=void 0,this.mediaElementEventHandlers=[],this.mediaElementOriginalLoadFn=void 0,clearTimeout(this.bufferingTimeout)},t.prototype.registerWindowEvents=function(){this.windowEventTracker.addEventListener("beforeunload",this.onPageClose.bind(this)),this.windowEventTracker.addEventListener("unload",this.onPageClose.bind(this))},t.prototype.onPageClose=function(){var e;if(!this.onBeforeUnLoadEvent){this.onBeforeUnLoadEvent=!0;var t=this.mediaElement,n=void 0;(0,m.isNotNullish)(t)&&(n=null!==(e=t.currentTime)&&void 0!==e?e:this.previousMediaTimeInSeconds),this.eventCallback(u.Event.UNLOAD,{currentTime:n})}this.release()},t.prototype.checkQualityLevelAttributes=function(e){var t;if(void 0===e&&(e=!1),!this.mediaElement)throw new Error("No media attached");var n=this.mediaElement,i=this.getCurrentQualityLevelInfo();if(i){var a=i.bitrate,r=i.width,o=i.height;if((0,m.isNotNullish)(a)){var s={type:"video",width:r,height:o,bitrate:a,currentTime:null!==(t=n.currentTime)&&void 0!==t?t:this.previousMediaTimeInSeconds};this.qualityChangeService.shouldAllowVideoQualityChange(a)&&(e||this.eventCallback(u.Event.VIDEO_CHANGE,s)),this.qualityChangeService.setVideoBitrate(a),this.stateMachineCallbacks.updateSampleQualityInfo(s)}}},t.prototype.getSelectedSubtitleFromMediaElement=function(e){if(!(0,m.isNullish)(e.textTracks)){for(var t=0,n=e.textTracks;t<n.length;t++){var i=n[t];if((0,m.isNotNullish)(i.mode)&&"showing"===i.mode){var a=(0,m.isNotNullish)(i.language)&&i.language.length>0;return{enabled:a,language:a?i.language:void 0}}}return{enabled:!1}}},t.prototype.onPaused=function(e){var t;if(!this.isPaused){if(!this.mediaElement)throw new Error("No media attached");e||(e=null!==(t=this.mediaElement.currentTime)&&void 0!==t?t:this.previousMediaTimeInSeconds),this.eventCallback(u.Event.PAUSE,{currentTime:e}),this.isPaused=!0}},t.prototype.onBuffering=function(){if(!this.mediaElement)throw new Error("No media attached");var e=this.mediaElement.currentTime;this.isBuffering||this.isPaused&&!this.isSeeking||(this.isSeeking?this.eventCallback(u.Event.SEEK,{currentTime:e}):this.eventCallback(u.Event.START_BUFFERING,{currentTime:e}),this.isBuffering=!0)},t.prototype.checkPlayheadProgress=function(){var e=this;if(!this.mediaElement)throw new Error("No media attached");var n=this.mediaElement;n.paused&&this.onPaused(),clearTimeout(this.bufferingTimeout),this.bufferingTimeout=setTimeout((function(){var i,a=null!==(i=n.currentTime)&&void 0!==i?i:e.previousMediaTimeInSeconds;n.paused||n.ended&&!e.isBuffering||a-e.previousMediaTimeInSeconds<t.BUFFERING_TIMECHANGED_TIMEOUT_IN_MS/1e3*.8&&e.onBuffering()}),t.BUFFERING_TIMECHANGED_TIMEOUT_IN_MS)},t.prototype.checkSeeking=function(){if(!this.mediaElement)throw new Error("No media attached");var e=this.mediaElement.currentTime,t=this.mediaElement.playbackRate;if(!(0,m.isNullish)(e)&&!(0,m.isNullish)(t)){var n=Math.abs(e-this.previousMediaTimeInSeconds);if(n<1)this.previousClientTime=Date.now();else{var i=(Date.now()-this.previousClientTime)/1e3;n>i*(t+.5)&&(this.isSeeking=!0,this.onPaused(this.previousMediaTimeInSeconds+i)),this.previousClientTime=Date.now()}}},t.BUFFERING_TIMECHANGED_TIMEOUT_IN_MS=1e3,t}(A.InternalAdapter);t.HTML5InternalAdapter=T;var g=function(e){var t=(new Date).toISOString().substring(11),n="".concat(t,"[HTML5InternalAdapter]"),i="".concat(n,": ").concat(e);h.logger.log(i)}},701:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLVideoElementAdapter=void 0;var i=n(5241),a=n(4350),r=n(8331),o=n(9627),s=n(1916),l=n(2108),u=n(4926),c=n(7238),d=n(4426),E=function(){function e(e,t,n,i){if((0,l.hasPlayerAlreadyBeenAugmented)(t))s.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance");else{(0,l.markPlayerInstanceAsAugmented)(t);var u=(0,r.sanitizeAnalyticsConfig)(e);(0,o.areCollectorRequirementsValid)(u)&&((0,r.guardAgainstDuplicatedUserId)(u),this.internalAdapter=new c.HTMLVideoElementInternalAdapter(new d.HTMLVideoElementProxy(t),n,i),this.analytics=a.Analytics.create(u,this.internalAdapter))}}return Object.defineProperty(e.prototype,"sessionMetadata",{get:function(){var e=this.internalAdapter;return{setAudioLanguage:function(t){e.sessionData.audioLanguage=(0,i.sanitizeSessionMetadataAudioLanguage)(t)},setSubtitleEnabled:function(t){e.sessionData.subtitleEnabled=(0,i.sanitizeSessionMetadataSubtitleEnabled)(t)},setSubtitleLanguage:function(t){e.sessionData.subtitleLanguage=(0,i.sanitizeSessionMetadataSubtitleLanguage)(t)}}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return u.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,l.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,l.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,l.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,l.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e,t){if((0,l.isDefined)(this.analytics)&&(0,l.isDefined)(this.internalAdapter)){this.analytics.sourceChange(e);var n=this.internalAdapter;n.sessionData.streamFormat=null==t?void 0:t.streamFormat,n.sessionData.audioCodec=null==t?void 0:t.audioCodec,n.sessionData.videoCodec=null==t?void 0:t.videoCodec,n.sessionData.audioLanguage=null==t?void 0:t.audioLanguage}},e.version=u.VERSION,e}();t.HTMLVideoElementAdapter=E},7238:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLVideoElementInternalAdapter=void 0;var r=n(556),o=function(e){function t(t,n,i){var a=e.call(this,t,n)||this;return a.sessionData={},a.getPlayerVersion=function(){return""},a.getPlayerName=function(){return r.Player.HTML5},a.sessionData.streamFormat=null==i?void 0:i.streamFormat,a.sessionData.audioCodec=null==i?void 0:i.audioCodec,a.sessionData.videoCodec=null==i?void 0:i.videoCodec,a.sessionData.audioLanguage=null==i?void 0:i.audioLanguage,a}return a(t,e),t.prototype.getCurrentPlaybackInfo=function(){var t,n,i,a,r,o,s=e.prototype.getCurrentPlaybackInfo.call(this);s.streamFormat=null!==(t=this.sessionData.streamFormat)&&void 0!==t?t:s.streamFormat,s.audioCodec=null!==(n=this.sessionData.audioCodec)&&void 0!==n?n:s.audioCodec,s.videoCodec=null!==(i=this.sessionData.videoCodec)&&void 0!==i?i:s.videoCodec,s.subtitleEnabled=null!==(a=this.sessionData.subtitleEnabled)&&void 0!==a?a:s.subtitleEnabled;var l=null!==(r=this.sessionData.subtitleLanguage)&&void 0!==r?r:s.subtitleLanguage;return s.subtitleLanguage=!0===s.subtitleEnabled?l:void 0,s.audioLanguage=null!==(o=this.sessionData.audioLanguage)&&void 0!==o?o:s.audioLanguage,s},t.prototype.resetSourceRelatedState=function(){e.prototype.resetSourceRelatedState.call(this),this.sessionData={}},t.prototype.getStreamURL=function(){return this.mediaElement?this.mediaElement.currentSrc:void 0},t.prototype.getCurrentQualityLevelInfo=function(){return{bitrate:void 0,width:this.mediaElement?this.mediaElement.videoWidth:void 0,height:this.mediaElement?this.mediaElement.videoHeight:void 0}},t}(n(7124).HTML5InternalAdapter);t.HTMLVideoElementInternalAdapter=o},4426:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLVideoElementProxy=void 0;var i=n(2974),a=function(){function e(e){var t=this;this.rawPlayer=e,this.addEventListener=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(0,i.safeAccess)((function(){var n;return(n=t.rawPlayer).addEventListener.apply(n,e)}))},this.removeEventListener=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(0,i.safeAccess)((function(){var n;return(n=t.rawPlayer).removeEventListener.apply(n,e)}))}}return Object.defineProperty(e.prototype,"currentTime",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.currentTime}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.duration}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.muted}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.height}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.width}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoplay",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.autoplay}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"src",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.src}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSrc",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.currentSrc}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.readyState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.volume}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"error",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.error}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textTracks",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.textTracks}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.paused}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ended",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.ended}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playbackRate",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.playbackRate}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"videoWidth",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.videoWidth}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"videoHeight",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.videoHeight}))},enumerable:!1,configurable:!0}),e.prototype.getVideoPlaybackQuality=function(){var e=this;return(0,i.safeAccess)((function(){var t,n;return null===(n=(t=e.rawPlayer).getVideoPlaybackQuality)||void 0===n?void 0:n.call(t)}))},e.prototype.getRawPlayer=function(){return this.rawPlayer},e}();t.HTMLVideoElementProxy=a},8510:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(5063),a=function(){function e(e){this.videoElement=e,this.previousTotalDroppedFrames=0}return e.prototype.getDroppedFrames=function(){if(null==this.videoElement)return 0;var e=this.videoElement.getVideoPlaybackQuality();if((0,i.isNullish)(e))return 0;var t=e.droppedVideoFrames,n=t-this.previousTotalDroppedFrames;return this.previousTotalDroppedFrames=t,n},e.prototype.reset=function(){this.previousTotalDroppedFrames=0},e}();t.default=a},2647:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.InternalAdapter=void 0;var a=n(675),r=n(9796),o=n(4916),s=n(4300),l=n(2361),u=n(4820),c=n(9422),d=n(1916),E=n(5063),p=n(2376),v=function(){function e(e){this.onLicenseKeyReceived=new a.EventDispatcher,this.onLicenseCallFailed=new a.EventDispatcher,this.qualityChangeService=new r.default,this.ssaiService=new s.SsaiService,this.stateMachineCallbacks=i({},u.defaultStateMachineCallbacks),this.sourceInfoFallbackService=new o.SourceInfoFallbackService,this.drmPerformanceInfo=void 0,this.windowEventTracker=new p.WindowEventTracker,e||(e={starttime:void 0}),e.starttime||(e.starttime=(0,E.getCurrentTimestamp)()),this.opts=e}return e.prototype.release=function(){this.stateMachine.resetIntervals(),this.stateMachineCallbacks.release(),this.resetSourceRelatedState(),this.windowEventTracker.release()},e.prototype.eventCallback=function(e,t,n){void 0===n&&(n=Date.now()),t=t||{},this.stateMachine?this.stateMachine.callEvent(e,t,n):d.logger.log("Bitmovin Analytics: StateMachine isn't ready yet")},e.prototype.getCommonPlaybackInfo=function(){var e=(0,c.getGlobalScreenDimensions)();return{screenHeight:null==e?void 0:e.height,screenWidth:null==e?void 0:e.width}},e.prototype.getDrmPerformanceInfo=function(){},e.prototype.getSegmentInfo=function(){return[]},e.prototype.getDownloadSpeedInfo=function(){return{segmentsDownloadCount:0,segmentsDownloadSize:0,segmentsDownloadTime:0,avgDownloadSpeed:0,minDownloadSpeed:0,maxDownloadSpeed:0,avgTimeToFirstByte:0}},e.prototype.resetDownloadSpeedInfoMeasures=function(){},e.prototype.setCustomData=function(e){var t=this.stateMachine.currentState,n={customDataValues:e,currentTime:this.currentTime};!this.stateMachine.currentState||"PAUSE"!==this.stateMachine.currentState&&"PLAYING"!==this.stateMachine.currentState?this.stateMachineCallbacks.customdatachange(void 0,void 0,n):(this.eventCallback(l.Event.CUSTOM_DATA_CHANGE,{currentTime:this.currentTime}),this.eventCallback(l.Event[t],n))},e.prototype.sourceChange=function(e){this.eventCallback(l.Event.MANUAL_SOURCE_CHANGE,{currentTime:this.currentTime,config:e})},e.prototype.resetSourceRelatedState=function(){this.sourceInfoFallbackService.reset(),this.drmPerformanceInfo=void 0},e.prototype.programChange=function(e){var t=this.ssaiService.isInActiveState();this.stateMachine.programChange(this.currentTime,t,e)},e}();t.InternalAdapter=v},5517:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AdQuartile=t.AdCallbacks=void 0;var n,i=function(){this.onAdStarted=function(e){},this.onAdFinished=function(e){},this.onAdBreakStarted=function(e){},this.onAdBreakFinished=function(e){},this.onAdClicked=function(e){},this.onAdError=function(e){},this.onAdManifestLoaded=function(e){},this.onAdQuartile=function(e){},this.onAdSkipped=function(e){},this.onPlay=function(){},this.onPause=function(){},this.onBeforeUnload=function(){}};t.AdCallbacks=i,function(e){e.FIRST_QUARTILE="firstQuartile",e.MIDPOINT="midpoint",e.THIRD_QUARTILE="thirdQuartile"}(n||(t.AdQuartile=n={}))},2063:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShakaAdapter=void 0;var i=n(4350),a=n(2361),r=n(8331),o=n(9627),s=n(1916),l=n(2108),u=n(5063),c=n(4926),d=n(2092),E=n(4883),p=function(){function e(e,t,n){if((0,l.hasPlayerAlreadyBeenAugmented)(t))s.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance");else{(0,l.markPlayerInstanceAsAugmented)(t);var a=(0,r.sanitizeAnalyticsConfig)(e);(0,o.areCollectorRequirementsValid)(a)&&((0,r.guardAgainstDuplicatedUserId)(a),this.internalAdapter=new d.ShakaInternalAdapter(new E.ShakaPlayerProxy(t),n),this.analytics=i.Analytics.create(a,this.internalAdapter),this.wrapPlayerLoad(t))}}return e.prototype.wrapPlayerLoad=function(e){var t,n=Object.getPrototypeOf(e),i=null!==(t=Object.getOwnPropertyDescriptor(e,"load"))&&void 0!==t?t:Object.getOwnPropertyDescriptor(n,"load");if(!0===(null==i?void 0:i.writable)||void 0!==(null==i?void 0:i.set)){var r=e.load,o=this.internalAdapter;e.load=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new Promise((function(n,i){r.apply(e,t).then((function(e){return n(e)})).catch((function(e){var t,n={currentTime:0,code:null!==(t=null==e?void 0:e.code)&&void 0!==t?t:void 0,message:(0,u.tryJSONStringify)({category:null==e?void 0:e.category,severity:null==e?void 0:e.severity}),data:{additionalData:(0,u.tryJSONStringify)(null==e?void 0:e.data)},originalError:e};o.eventCallback(a.Event.ERROR,n),i(e)}))}))}}else s.logger.errorMessageToUser("Bitmovin Analytics is unable to intercept player.load method. The provided Shaka player instance appears to be a proxy object (e.g. created via Shaka UI Library). Ensure you provide the local player instance instead.")},Object.defineProperty(e.prototype,"version",{get:function(){return c.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,l.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,l.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,l.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,l.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){(0,l.isDefined)(this.analytics)&&this.analytics.sourceChange(e)},e.version=c.VERSION,e}();t.ShakaAdapter=p},2092:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getShakaStreamFormat=t.getShakaCodecInfo=t.ShakaInternalAdapter=void 0;var o=n(2361),s=n(556),l=n(7224),u=n(7614),c=n(9557),d=n(1916),E=n(5063),p=n(7124),v=n(4426),f=n(4654),h=function(e){function n(t,n){var i=this,a=t.getMediaElement();return(i=e.call(this,a?new v.HTMLVideoElementProxy(a):void 0,n)||this).getPlayerName=function(){return s.Player.SHAKA},i.getPlayerVersion=function(){var e;return null!==(e=i.player.playerVersion)&&void 0!==e?e:"unknown"},i.isLive=function(){return i.player?i.player.isLive():void 0},i.registerMediaElementErrorEvent=function(e){i.player.addEventListener(f.ShakaPlayerEvent.ERROR,(function(e){var t,n,a,r,s,l,u,c,d,p,v;i.eventCallback(o.Event.ERROR,{currentTime:null!==(n=null===(t=i.mediaElement)||void 0===t?void 0:t.currentTime)&&void 0!==n?n:0,code:null!==(r=null===(a=e.detail)||void 0===a?void 0:a.code)&&void 0!==r?r:void 0,message:null!==(l=null===(s=e.detail)||void 0===s?void 0:s.message)&&void 0!==l?l:void 0,originalError:e,data:{additionalData:(0,E.tryJSONStringify)(e.detail),exceptionMessage:null!==(c=null===(u=e.detail)||void 0===u?void 0:u.message)&&void 0!==c?c:void 0,exceptionStacktrace:null!==(v=null===(p=null===(d=e.detail)||void 0===d?void 0:d.stack)||void 0===p?void 0:p.split("\n"))&&void 0!==v?v:void 0}})}))},i.player=t,i}return a(n,e),n.prototype.initialize=function(t){var n,i=this;e.prototype.initialize.call(this,t);var a=null!==(n=this.player.getMediaElement())&&void 0!==n?n:void 0;if((0,E.isNotNullish)(a))this.setMediaElement(new v.HTMLVideoElementProxy(a));else{var r=function(e){if("media-source"===e.state)try{i.player.removeEventListener(f.ShakaPlayerEvent.ONSTATECHANGE,r);var t=i.player.getMediaElement();i.setMediaElement((0,E.isNotNullish)(t)?new v.HTMLVideoElementProxy(t):void 0)}catch(e){d.logger.errorMessageToUser("Something went wrong while getting underlying HTMLVideoElement. Not possible to attach adapter and initialize Bitmovin Analytics. Error: ",e),i.release()}};this.player.addEventListener(f.ShakaPlayerEvent.ONSTATECHANGE,r)}return this.player.addEventListener(f.ShakaPlayerEvent.BUFFERING,(function(e){i.checkQualityLevelAttributes()})),this.player.addEventListener(f.ShakaPlayerEvent.ONSTATECHANGE,(function(e){"detach"===e.state&&(i.eventCallback(o.Event.UNLOAD,{}),i.release())})),[new c.ErrorDetailTracking(t.errorDetailTrackingSettingsProvider,new u.ErrorDetailBackend(t.errorDetailTrackingSettingsProvider.collectorConfig),[t.errorDetailSubscribable],void 0)]},n.prototype.getCurrentPlaybackInfo=function(){var n=r({},e.prototype.getCurrentPlaybackInfo.call(this)),i=(0,t.getShakaCodecInfo)(this.player);return this.sourceInfoFallbackService.applyAndStoreCodecInfo(n,i),n},n.prototype.getStreamType=function(){return(0,t.getShakaStreamFormat)(this.player)},n.prototype.getStreamURL=function(){var e;return null!==(e=this.player.getAssetUri())&&void 0!==e?e:void 0},n.prototype.getCurrentQualityLevelInfo=function(){var e=this.player.getVariantTracks();if((0,E.isNullish)(e))return null;var t=e.filter((function(e){return e.active})).filter((function(e){return e.videoCodec||void 0!==e.videoId}))[0];return t?{bitrate:t.videoBandwidth||t.bandwidth,width:t.width,height:t.height}:null},n}(p.HTML5InternalAdapter);t.ShakaInternalAdapter=h;t.getShakaCodecInfo=function(e){var t=e.getVariantTracks().find((function(e){return e.active}));return{videoCodec:null==t?void 0:t.videoCodec,audioCodec:null==t?void 0:t.audioCodec}};t.getShakaStreamFormat=function(e){var t,n=null===(t=e.getManifestType())||void 0===t?void 0:t.toLowerCase();if(n===l.StreamTypes.dash)return l.StreamTypes.dash;if(n===l.StreamTypes.hls)return l.StreamTypes.hls;return(0,E.isNullish)(n)&&3===e.getLoadMode()&&(0,E.isNotNullish)(e.getAssetUri())?l.StreamTypes.prog:void 0}},4883:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShakaPlayerProxy=void 0;var i=n(2974),a=function(){function e(e){var t=this;this.rawPlayer=e,this.addEventListener=function(e,n){(0,i.safeAccess)((function(){return t.rawPlayer.addEventListener(e,n)}))},this.removeEventListener=function(e,n){(0,i.safeAccess)((function(){return t.rawPlayer.removeEventListener(e,n)}))},this.getMediaElement=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getMediaElement()}))},this.isLive=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.isLive()}))},this.getAssetUri=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getAssetUri()}))},this.getVariantTracks=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.getVariantTracks()}))},this.getManifestType=function(){return(0,i.safeAccess)((function(){var e,n;return null===(n=(e=t.rawPlayer).getManifestType)||void 0===n?void 0:n.call(e)}))},this.getLoadMode=function(){return(0,i.safeAccess)((function(){var e,n;return null===(n=(e=t.rawPlayer).getLoadMode)||void 0===n?void 0:n.call(e)}))}}return Object.defineProperty(e.prototype,"playerVersion",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.constructor.version}))},enumerable:!1,configurable:!0}),e}();t.ShakaPlayerProxy=a},4654:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShakaPlayerEvent=void 0,t.ShakaPlayerEvent={UNLOADING:"unloading",ONSTATECHANGE:"onstatechange",STATECHANGED:"statechanged",BUFFERING:"buffering",ERROR:"error"}},1482:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DrmPerformanceService=void 0,t.isDrmLicenseType=o,t.extractDrmType=s;var i=n(7912),a=n(5063),r=function(){function e(){var e=this;this.drmPerformanceInfo=void 0,this.onDownloadFinished=function(t){var n=t.httpRequest;if(n.success&&!(0,a.isNotNullish)(e.drmPerformanceInfo)&&o(n.type)){var i=s(n.type);e.drmPerformanceInfo={drmType:i,drmLoadTime:n.downloadTime}}}}return e.prototype.getInfo=function(){return this.drmPerformanceInfo},e.prototype.reset=function(){this.drmPerformanceInfo=void 0},e}();function o(e){return e===i.HttpRequestType.DRM_LICENSE_WIDEVINE||e===i.HttpRequestType.DRM_LICENSE_FAIRPLAY||e===i.HttpRequestType.DRM_LICENSE_PLAYREADY||e===i.HttpRequestType.DRM_LICENSE_CLEARKEY}function s(e){var t=e.match(/drm\/license\/(.+)/);return t?t[1]:"unknown"}t.DrmPerformanceService=r},9192:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlaybackProgressDetectionService=void 0;var n=function(){function e(){}return e.prototype.hasPlaybackProgressed=function(e,t){if(void 0===this.lastEventTimestamp||void 0===this.lastCurrentTime)return this.lastEventTimestamp=e,this.lastCurrentTime=t,!1;var n=(e-this.lastEventTimestamp)/1e3,i=t-this.lastCurrentTime;if(n<=0||i<0)return this.lastEventTimestamp=e,this.lastCurrentTime=t,!1;var a=i>=.5*n&&i<=4*n;return this.lastEventTimestamp=e,this.lastCurrentTime=t,a},e.prototype.reset=function(){this.lastEventTimestamp=void 0,this.lastCurrentTime=void 0},e}();t.PlaybackProgressDetectionService=n},7470:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.THEOplayerAdapter=void 0;var i=n(4350),a=n(6398),r=n(9352),o=n(8331),s=n(9627),l=n(1916),u=n(2108),c=n(4926),d=n(7297),E=n(2369),p=function(){function e(e,t,n){var r=this;if(this.ssai={adBreakStart:function(e){if((0,u.isDefined)(r.internalAdapter)&&(0,a.hasValidSsaiAdBreakMetadataStructure)(e)){var t=(0,a.simplySanitizeSsaiAdBreakMetadata)(e);r.internalAdapter.ssaiService.adBreakStart(t)}},adStart:function(e){if((0,u.isDefined)(r.analytics)&&(0,u.isDefined)(r.internalAdapter)&&(0,a.hasValidSsaiAdMetadataStructure)(e)){var t=(0,a.simplySanitizeSsaiAdMetadata)(e);r.internalAdapter.ssaiService.adStart(t),r.analytics.setConfigParameters(),r.analytics.setAutoDetectedDeviceInformation()}},adQuartileFinished:function(e,t){if((0,u.isDefined)(r.analytics)&&(0,u.isDefined)(r.internalAdapter)&&(0,a.hasValidSsaiAdQuartileStructure)(e)){var n=(0,a.sanitizeSsaiAdQuartileMetadata)(t);r.internalAdapter.ssaiService.adQuartileFinished(e,n)}},adBreakEnd:function(){(0,u.isDefined)(r.analytics)&&(0,u.isDefined)(r.internalAdapter)&&(r.internalAdapter.ssaiService.adBreakEnd(),r.analytics.setConfigParameters(),r.analytics.setAutoDetectedDeviceInformation())}},(0,u.hasPlayerAlreadyBeenAugmented)(t.element))l.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance");else{(0,u.markPlayerInstanceAsAugmented)(t.element);var c=(0,o.sanitizeAnalyticsConfig)(e);(0,s.areCollectorRequirementsValid)(c)&&((0,o.guardAgainstDuplicatedUserId)(c),this.internalAdapter=new d.THEOplayerInternalAdapter(new E.THEOplayerProxy(t),n),this.analytics=i.Analytics.create(c,this.internalAdapter))}}return Object.defineProperty(e.prototype,"version",{get:function(){return c.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,u.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,u.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,u.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,u.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){(0,u.isDefined)(this.analytics)&&this.analytics.sourceChange(e)},e.prototype.programChange=function(e){if((0,r.hasValidSourceMetadataStructure)(e)){var t=(0,r.sanitizeSourceMetadata)(e);(0,u.isDefined)(this.internalAdapter)&&this.internalAdapter.programChange(t)}},e.version=c.VERSION,e}();t.THEOplayerAdapter=p},7297:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.THEOplayerInternalAdapter=void 0,t.detectPlaybackInfoStreamTypeFieldsFromSource=L,t.createSpeedMeasurementFromEvent=U;var o=n(655),s=n(9664),l=n(2663),u=n(5878),c=n(2361),d=n(556),E=n(8525),p=n(7224),v=n(7614),f=n(9557),h=n(7881),m=n(7912),A=n(3413),y=n(9422),T=n(1916),g=n(1460),S=n(1820),I=n(5063),N=n(2647),D=n(2935),P=n(1482),_=n(4843),b=n(9192),C=n(944),R=function(e){function t(t,n){var i=e.call(this,n)||this;i.speedMeter=new s.DownloadSpeedMeter,i.delayedEventDispatcher=_.DelayedEventDispatcher.create(),i.drmPerformanceService=new P.DrmPerformanceService,i.playbackProgressDetectionService=new b.PlaybackProgressDetectionService,i.onBeforeUnLoadEvent=!1,i.videoTrackListeners=new Map,i.audioTrackListeners=new Map,i.getDrmPerformanceInfo=function(){return i.drmPerformanceService.getInfo()},i.player=t,i.networkInterceptor=new C.THEOplayerNetworkInterceptor(t),i.networkInterceptor.subscribe((function(e){var t=U(e);(0,I.isNotNullish)(t)&&i.speedMeter.addMeasurement(t),i.drmPerformanceService.onDownloadFinished(e)}));var a=new l.HeartbeatService((function(){return i.currentTime}));return i.stateMachine=new o.THEOplayerAnalyticsStateMachine(i.stateMachineCallbacks,a,i.opts),a.setListener(i.stateMachine),i.player=t,i}return a(t,e),Object.defineProperty(t.prototype,"adModule",{get:function(){return this._adModule},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){var t=this;this.registerEventListeners(),this._adModule=new D.THEOplayerAdModule(this.player,this.windowEventTracker),this.registerUnloadEventListeners(),this.ssaiService.activate({getPlayerCurrentTime:function(){return t.currentTime},reportEngagementInteraction:function(t){e.sendSsaiEngagementAdSample(t)},reportPlaybackInteraction:function(e,n){t.stateMachine.sendPlayingSample(e,n,!0)}});var n=new h.HttpRequestTracking([this.networkInterceptor]),i=new f.ErrorDetailTracking(e.errorDetailTrackingSettingsProvider,new v.ErrorDetailBackend(e.errorDetailTrackingSettingsProvider.collectorConfig),[e.errorDetailSubscribable],n);return this.eventCallback(c.Event.READY,{currentTime:this.currentTime}),[i]},t.prototype.getPlayerVersion=function(){var e=(0,y.getGlobalTheoPlayerVersion)();return(0,S.isValidString)(e)&&!(0,S.isBlank)(e)?e:"unknown"},t.prototype.getPlayerName=function(){return d.Player.THEOPLAYER},t.prototype.getPlayerTech=function(){return"html5"},t.prototype.getAutoPlay=function(){var e;return null!==(e=this.player.autoplay)&&void 0!==e&&e},t.prototype.getCurrentPlaybackInfo=function(){var e,t,n,i,a,o,s,l,c,d,p,v,f,h,m=null===(e=this.player.videoTracks)||void 0===e?void 0:e.find((function(e){return e.enabled})),y=null===(t=this.player.audioTracks)||void 0===t?void 0:t.find((function(e){return e.enabled})),T=null===(n=this.player.textTracks)||void 0===n?void 0:n.find((function(e){return"showing"===e.mode})),g=void 0;(0,I.isNotNullish)(null===(a=null===(i=this.player.cast)||void 0===i?void 0:i.airplay)||void 0===a?void 0:a.casting)?g=u.CastTech.AirPlay:(0,I.isNotNullish)(null===(s=null===(o=this.player.cast)||void 0===o?void 0:o.chromecast)||void 0===s?void 0:s.casting)&&(g=u.CastTech.GoogleCast);var S=this.player.duration;return r(r(r({},this.getCommonPlaybackInfo()),L(this.currentSource)),{audioBitrate:null===(l=null==y?void 0:y.activeQuality)||void 0===l?void 0:l.bandwidth,audioCodec:null===(c=null==y?void 0:y.activeQuality)||void 0===c?void 0:c.codecs,audioLanguage:null==y?void 0:y.language,castTech:g,droppedFrames:0,isCasting:(0,I.isNotNullish)(g),isLive:!(0,I.isNullish)(S)&&!isFinite(S),isMuted:this.player.muted,playerTech:this.getPlayerTech(),size:"fullscreen"===(null===(d=this.player.presentation)||void 0===d?void 0:d.currentMode)?E.PlayerSize.Fullscreen:E.PlayerSize.Window,subtitleEnabled:(0,I.isNotNullish)(T),subtitleLanguage:null==T?void 0:T.language,videoBitrate:null===(p=null==m?void 0:m.activeQuality)||void 0===p?void 0:p.bandwidth,videoCodec:null===(v=null==m?void 0:m.activeQuality)||void 0===v?void 0:v.codecs,videoDuration:(0,A.normalizeVideoDuration)(S),videoPlaybackHeight:this.player.videoHeight,videoPlaybackWidth:this.player.videoWidth,videoWindowHeight:null===(f=this.player.element)||void 0===f?void 0:f.offsetHeight,videoWindowWidth:null===(h=this.player.element)||void 0===h?void 0:h.offsetWidth})},Object.defineProperty(t.prototype,"currentTime",{get:function(){var e;return null!==(e=this.player.currentTime)&&void 0!==e?e:0},enumerable:!1,configurable:!0}),t.prototype.getDownloadSpeedInfo=function(){return this.speedMeter.getInfo()},t.prototype.resetDownloadSpeedInfoMeasures=function(){this.speedMeter.reset()},t.prototype.resetSourceRelatedState=function(){e.prototype.resetSourceRelatedState.call(this),this.ssaiService.resetSourceRelatedState(),this.videoTrackListeners.forEach((function(e,t){t.removeEventListener("activequalitychanged",e)})),this.videoTrackListeners.clear(),this.audioTrackListeners.forEach((function(e,t){t.removeEventListener("activequalitychanged",e)})),this.audioTrackListeners.clear(),this.lastTrackedCurrentTime=void 0,this.currentSource=void 0,this.speedMeter.reset(),this.drmPerformanceService.reset(),this.networkInterceptor.reset(),this.playbackProgressDetectionService.reset()},t.prototype.eventCallback=function(t,n){this.delayedEventDispatcher.dispatchEvent(t,n,this.stateMachine.currentState,e.prototype.eventCallback.bind(this))},t.prototype.handleVideoQualityChanged=function(e){var t=e.quality,n={type:"video",width:t.width,height:t.height,bitrate:t.bandwidth,currentTime:this.currentTime};this.qualityChangeService.shouldAllowVideoQualityChange(t.bandwidth)&&this.eventCallback(c.Event.VIDEO_CHANGE,n),this.qualityChangeService.setVideoBitrate(t.bandwidth),this.stateMachineCallbacks.updateSampleQualityInfo(n)},t.prototype.handleAudioQualityChanged=function(e){var t=e.quality,n={type:"audio",bitrate:t.bandwidth,currentTime:this.currentTime};this.qualityChangeService.shouldAllowAudioQualityChange(t.bandwidth)&&this.eventCallback(c.Event.AUDIO_CHANGE,n),this.qualityChangeService.setAudioBitrate(t.bandwidth),this.stateMachineCallbacks.updateSampleQualityInfo(n)},t.prototype.registerEventListeners=function(){var e,t,n,i,a,r,o,s,l=this;this.player.addEventListener("sourcechange",(function(e){l.eventCallback(c.Event.READY,{})})),this.player.addEventListener("currentsourcechange",(function(e){(0,I.isNotNullish)(l.currentSource)&&l.eventCallback(c.Event.MANUAL_SOURCE_CHANGE,{currentTime:l.lastTrackedCurrentTime,config:{}}),l.currentSource=e.currentSource})),this.player.addEventListener("play",(function(e){l.eventCallback(c.Event.PLAY,{currentTime:e.currentTime})})),this.player.addEventListener("pause",(function(e){l.eventCallback(c.Event.PAUSE,{currentTime:e.currentTime})})),null===(e=this.player.videoTracks)||void 0===e||e.addEventListener("addtrack",(function(e){var t=e.track,n=function(e){l.handleVideoQualityChanged(e)};t.addEventListener("activequalitychanged",n),l.videoTrackListeners.set(t,n)})),null===(t=this.player.videoTracks)||void 0===t||t.addEventListener("removetrack",(function(e){var t=e.track,n=l.videoTrackListeners.get(t);n&&(t.removeEventListener("activequalitychanged",n),l.videoTrackListeners.delete(t))}));for(var u=0,d=null!==(n=this.player.videoTracks)&&void 0!==n?n:[];u<d.length;u++){var E=function(e){l.handleVideoQualityChanged(e)};(f=d[u]).addEventListener("activequalitychanged",E),this.videoTrackListeners.set(f,E)}null===(i=this.player.audioTracks)||void 0===i||i.addEventListener("addtrack",(function(e){var t=e.track,n=function(e){l.handleAudioQualityChanged(e)};t.addEventListener("activequalitychanged",n),l.audioTrackListeners.set(t,n)})),null===(a=this.player.audioTracks)||void 0===a||a.addEventListener("removetrack",(function(e){var t=e.track,n=l.audioTrackListeners.get(t);n&&(t.removeEventListener("activequalitychanged",n),l.audioTrackListeners.delete(t))}));for(var p=0,v=null!==(r=this.player.audioTracks)&&void 0!==r?r:[];p<v.length;p++){var f;E=function(e){l.handleAudioQualityChanged(e)};(f=v[p]).addEventListener("activequalitychanged",E),this.audioTrackListeners.set(f,E)}this.player.addEventListener("seeking",(function(e){l.eventCallback(c.Event.SEEK,{currentTime:l.lastTrackedCurrentTime})})),this.player.addEventListener("timeupdate",(function(e){l.lastTrackedCurrentTime=e.currentTime,"STARTUP"===l.stateMachine.currentState&&l.playbackProgressDetectionService.hasPlaybackProgressed(e.date.getTime(),e.currentTime)&&(T.logger.log('[PlaybackProgressDetectionService] Playback progress detected based on "timeupdate" event, eventTime: '.concat(e.date.getTime(),", player currentTime: ").concat(e.currentTime)),l.eventCallback(c.Event.PLAYING,{currentTime:e.currentTime}))})),this.player.addEventListener("playing",(function(e){l.eventCallback(c.Event.PLAYING,{currentTime:e.currentTime})})),this.player.addEventListener("waiting",(function(e){l.eventCallback(c.Event.START_BUFFERING,{currentTime:e.currentTime})})),this.player.addEventListener("ended",(function(e){l.eventCallback(c.Event.END,{currentTime:e.currentTime})})),this.player.addEventListener("error",(function(e){var t,n,i=e.errorObject.code,a=e.errorObject.message,r=e.errorObject.cause,o=(0,I.tryJSONStringify)(e.errorObject);l.eventCallback(c.Event.ERROR,{code:i,message:a,legacyData:o,currentTime:l.currentTime,originalError:r,data:{exceptionMessage:a,exceptionStacktrace:null!==(n=null===(t=e.errorObject.stack)||void 0===t?void 0:t.split("\n"))&&void 0!==n?n:void 0,additionalData:o}}),l.ssaiService.sendAdEngagementErrorSample({code:i,message:a,severity:"CRITICAL"},e)})),null===(o=this.player.ads)||void 0===o||o.addEventListener("adbreakbegin",(function(e){l.eventCallback(c.Event.START_AD,{currentTime:l.currentTime})})),null===(s=this.player.ads)||void 0===s||s.addEventListener("adbreakend",(function(e){l.eventCallback(c.Event.END_AD,{currentTime:l.currentTime})}))},t.prototype.registerUnloadEventListeners=function(){var e=this,t=function(){if(!e.onBeforeUnLoadEvent){e.onBeforeUnLoadEvent=!0;var t=e.lastTrackedCurrentTime;e.eventCallback(c.Event.UNLOAD,{currentTime:t})}e.release()};this.player.addEventListener("destroy",t),this.windowEventTracker.addEventListener("beforeunload",t),this.windowEventTracker.addEventListener("unload",t)},t}(N.InternalAdapter);function L(e){if((0,I.isNullish)(e))return{};var t=void 0;return(0,I.isNullish)(e.type)||(t=(0,p.getStreamTypeFromMIMEType)(e.type)),(0,I.isNullish)(t)&&(t=(0,p.getStreamTypesFromURL)(e.src)),(0,A.buildPlaybackInfoStreamTypeFields)(t,e.src)}function U(e){var t=e.httpRequest;if(t.success&&(t.type===m.HttpRequestType.MEDIA_VIDEO||t.type===m.HttpRequestType.MEDIA_AUDIO))return{duration:t.downloadTime/1e3,size:(0,g.isNumber)(t.size)?t.size:0,timeToFirstByte:(0,I.isNotNullish)(t.timeToFirstByte)?t.timeToFirstByte/1e3:0,timestamp:new Date,httpStatus:t.httpStatus}}t.THEOplayerInternalAdapter=R},944:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.THEOplayerNetworkInterceptor=t.STALE_REQUEST_TIMEOUT_MS=void 0,t.extractResponseSize=d,t.mapHttpRequestType=E;var i=n(675),a=n(7912),r=n(9422),o=n(1916),s=n(1460),l=n(1820),u=n(5063);t.STALE_REQUEST_TIMEOUT_MS=18e4;var c=function(){function e(e){var t=this;this.player=e,this.eventDispatcher=new i.EventDispatcher,this.pendingRequests=new Map,this.onRequest=function(e){try{var n=e.url;if(!(0,l.isValidString)(n)||(0,l.isBlank)(n))return;var i=(0,r.getGlobalPerformanceNow)(),a=null!=i?i:Date.now();t.cleanupStaleRequests(a);var s={url:n,startTime:a,type:e.type,subType:e.subType,mediaType:e.mediaType},c=t.pendingRequests.get(n);(0,u.isNullish)(c)?t.pendingRequests.set(n,[s]):c.push(s)}catch(e){o.logger.error("THEOplayerNetworkInterceptor: Error in request interceptor",e)}},this.onResponse=function(e){try{var n=e.request;if((0,u.isNullish)(n))return;var i=n.url;if(!(0,l.isValidString)(i)||(0,l.isBlank)(i))return;var a=t.pendingRequests.get(i);if((0,u.isNullish)(a)||0===a.length)return;var c=a.shift();0===a.length&&t.pendingRequests.delete(i);var p=(0,r.getGlobalPerformanceNow)(),v=null!=p?p:Date.now(),f=Math.round(v-c.startTime),h=d(e),m=(0,s.isNumber)(e.status)?e.status:0,A=m>=200&&m<400;t.eventDispatcher.dispatch({httpRequest:{downloadTime:f,httpStatus:m,success:A,timestamp:Date.now(),url:i,size:h,timeToFirstByte:void 0,type:E(c.type,c.subType,c.mediaType,i)}})}catch(e){o.logger.error("THEOplayerNetworkInterceptor: Error in response interceptor",e)}},(0,u.isNullish)(this.player.network)?o.logger.warn("THEOplayerNetworkInterceptor: player.network is not available"):(this.player.network.addRequestInterceptor(this.onRequest),this.player.network.addResponseInterceptor(this.onResponse))}return e.prototype.subscribe=function(e){return this.eventDispatcher.subscribe(e)},e.prototype.unsubscribe=function(e){this.eventDispatcher.unsubscribe(e)},e.prototype.reset=function(){this.pendingRequests.clear()},e.prototype.cleanupStaleRequests=function(e){var n=this;this.pendingRequests.forEach((function(i,a){var r=i.filter((function(n){return e-n.startTime<=t.STALE_REQUEST_TIMEOUT_MS}));0===r.length?n.pendingRequests.delete(a):r.length!==i.length&&n.pendingRequests.set(a,r)}))},e}();function d(e){var t,n,i,a=null!==(n=null===(t=e.headers)||void 0===t?void 0:t["content-length"])&&void 0!==n?n:null===(i=e.headers)||void 0===i?void 0:i["Content-Length"];if((0,u.isNotNullish)(a)){var r=(0,s.parseIntOrUndefined)(a);if((0,u.isNotNullish)(r))return r}if((0,u.isNotNullish)(e.body)){if((0,l.isValidString)(e.body))return e.body.length;if((0,u.isArrayBuffer)(e.body)&&(0,s.isNumber)(e.body.byteLength))return e.body.byteLength}}function E(e,t,n,i){if("content-protection"===e)switch(t){case"widevine-license":return a.HttpRequestType.DRM_LICENSE_WIDEVINE;case"fairplay-license":return a.HttpRequestType.DRM_LICENSE_FAIRPLAY;case"playready-license":return a.HttpRequestType.DRM_LICENSE_PLAYREADY;case"clearkey-license":return a.HttpRequestType.DRM_LICENSE_CLEARKEY;case"aes128-key":return a.HttpRequestType.KEY_HLS_AES;case"fairplay-certificate":return a.HttpRequestType.DRM_CERTIFICATE_FAIRPLAY;default:return a.HttpRequestType.UNKNOWN}return"manifest"===e?(0,l.endsWith)(i,".mpd")?a.HttpRequestType.MANIFEST_DASH:(0,l.endsWith)(i,".m3u8")?a.HttpRequestType.MANIFEST_HLS_MASTER:a.HttpRequestType.UNKNOWN:"video"===n?a.HttpRequestType.MEDIA_VIDEO:"audio"===n?a.HttpRequestType.MEDIA_AUDIO:"text"===n?a.HttpRequestType.MEDIA_SUBTITLES:(0,l.endsWith)(i,".mpd")?a.HttpRequestType.MANIFEST_DASH:(0,l.endsWith)(i,".m3u8")?a.HttpRequestType.MANIFEST_HLS_MASTER:a.HttpRequestType.UNKNOWN}t.THEOplayerNetworkInterceptor=c},2369:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.THEOplayerProxy=void 0;var i=n(2974),a=function(){function e(e){var t=this;this.rawPlayer=e,this.addEventListener=function(e,n){(0,i.safeAccess)((function(){return t.rawPlayer.addEventListener(e,n)}))}}return Object.defineProperty(e.prototype,"currentTime",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.currentTime}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.duration}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoplay",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.autoplay}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.muted}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"videoHeight",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.videoHeight}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"videoWidth",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.videoWidth}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorObject",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.errorObject}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.element}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"source",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.source}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cast",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.cast}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"presentation",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.presentation}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"videoTracks",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.videoTracks}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioTracks",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.audioTracks}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textTracks",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.textTracks}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ads",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.ads}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"network",{get:function(){var e=this;return(0,i.safeAccess)((function(){return e.rawPlayer.network}))},enumerable:!1,configurable:!0}),e}();t.THEOplayerProxy=a},405:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapTheoAd=function(e){var t="linear"===e.type,n={id:e.id,isLinear:t,clickThroughUrl:e.clickThrough,width:e.width,height:e.height},i=t?e:void 0;(0,a.isNotNullish)(i)&&(n.mediaUrl=i.mediaUrl);(0,a.isNotNullish)(e.skipOffset)&&(n.skippable=-1!==e.skipOffset,n.skippableAfter=e.skipOffset);(0,a.isNotNullish)(e.duration)&&(n.duration=e.duration);var r="google-ima"===e.integration||"google-dai"===e.integration?e:void 0;(0,a.isNotNullish)(r)&&(n.bitrate=(0,a.isNotNullish)(r.bitrate)?r.bitrate/1e3:void 0,n.mimeType=r.contentType);n.vastData={adSystem:e.adSystem,creativeId:e.creativeId};var o=e.universalAdIds&&e.universalAdIds.length>0?e.universalAdIds[0]:void 0;(0,a.isNotNullish)(o)&&(n.vastData.universalAdIdRegistry=o.adIdRegistry,n.vastData.universalAdIdValue=o.adIdValue);(0,a.isNotNullish)(r)&&(n.vastData.apiFramework=r.apiFramework,n.vastData.adDescription=r.description,n.vastData.adTitle=r.title,n.vastData.wrapperAdsCount=(0,a.isNotNullish)(r.wrapperAdIds)?r.wrapperAdIds.length:void 0);return n},t.mapTheoAdBreak=function(e,t){var n=e.timeOffset;if(!(0,i.isFiniteNumber)(n)||n<0)return{position:void 0,scheduleTime:void 0};if(0===n)return{position:"pre",scheduleTime:0};var r=(0,a.isNotNullish)(t)?Math.abs(n-t):void 0;if((0,a.isNotNullish)(r)&&r<=1)return{position:"post",scheduleTime:t};return{position:String(n),scheduleTime:n}},t.isAdErrorEvent=function(e){return(0,a.isNotNullish)(e)&&"errorCode"in e};var i=n(1460),a=n(5063)},2935:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.THEOplayerAdModule=void 0;var i=n(1460),a=n(5063),r=n(5517),o=n(405),s=function(){function e(e,t){var n=this;this.adCallbacks=new r.AdCallbacks,this.isLinearAdActive=function(){var e,t=n.player.ads;return!(0,a.isNullish)(t)&&(null!==(e=t.playing)&&void 0!==e&&e)},this.getContainer=function(){return n.player.element},this.getAdModuleInfo=function(){return{name:"theo-ads",version:void 0}},this.currentTime=function(){var e;return null!==(e=n.player.currentTime)&&void 0!==e?e:0},this.getAutoPlay=function(){var e;return null!==(e=n.player.autoplay)&&void 0!==e&&e},this.player=e,this.register(t)}return e.prototype.register=function(e){var t=this,n=this.player.ads;if(!(0,a.isNullish)(n)){n.addEventListener("adbreakbegin",(function(e){t.adCallbacks.onAdBreakStarted((0,o.mapTheoAdBreak)(e.adBreak,t.videoDuration))})),n.addEventListener("adbreakend",(function(e){t.adCallbacks.onAdBreakFinished((0,o.mapTheoAdBreak)(e.adBreak,t.videoDuration))})),n.addEventListener("adbegin",(function(e){t.adCallbacks.onAdStarted((0,o.mapTheoAd)(e.ad))})),n.addEventListener("adend",(function(e){t.adCallbacks.onAdFinished((0,o.mapTheoAd)(e.ad))})),n.addEventListener("adskip",(function(e){t.adCallbacks.onAdSkipped((0,o.mapTheoAd)(e.ad))})),n.addEventListener("aderror",(function(e){var n={};(0,o.isAdErrorEvent)(e)&&(n.code=e.errorCode,n.message=e.message);var i=t.player.errorObject;(0,a.isNotNullish)(i)&&(0,a.isNullish)(n.code)&&(n.code=i.code,n.message=i.message),t.adCallbacks.onAdError(n)})),n.addEventListener("adloaded",(function(e){var n,r,s=t.player.duration;(0,i.isFiniteNumber)(s)&&t.videoDuration!==s&&(t.videoDuration=s);var l={isVmap:!1},u=null===(n=t.player.source)||void 0===n?void 0:n.ads;(0,a.isNotNullish)(u)&&u.length>0&&(l.isVmap="vmap"===u[0].type);var c=null===(r=t.player.ads)||void 0===r?void 0:r.currentAdBreak;(0,a.isNotNullish)(c)&&(l.adBreakInfo=(0,o.mapTheoAdBreak)(c,s)),t.adCallbacks.onAdManifestLoaded(l)})),this.player.addEventListener("playing",(function(){t.isLinearAdActive()&&t.adCallbacks.onPlay()})),this.player.addEventListener("pause",(function(){t.isLinearAdActive()&&t.adCallbacks.onPause()}));var r=function(){t.adCallbacks.onBeforeUnload()};e.addEventListener("beforeunload",r),e.addEventListener("unload",r)}},e}();t.THEOplayerAdModule=s},602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallbackScheduler=t.CALLBACK_SCHEDULER_TIMEOUT_DELAY_MS=void 0;var i=n(5063);t.CALLBACK_SCHEDULER_TIMEOUT_DELAY_MS=50;var a=function(){function e(){this.timeout=void 0}return e.prototype.schedule=function(e){var n=this;(0,i.isNotNullish)(this.timeout)||(this.callback=e,this.timeout=setTimeout((function(){var e;null===(e=n.callback)||void 0===e||e.call(n),n.cancel()}),t.CALLBACK_SCHEDULER_TIMEOUT_DELAY_MS))},e.prototype.isScheduled=function(){return(0,i.isNotNullish)(this.timeout)},e.prototype.execute=function(){var e;null===(e=this.callback)||void 0===e||e.call(this),this.cancel()},e.prototype.cancel=function(){clearTimeout(this.timeout),this.timeout=void 0,this.callback=void 0},e}();t.CallbackScheduler=a},4843:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelayedEventDispatcher=void 0;var i=n(655),a=n(2361),r=n(1916),o=n(602),s=function(){function e(e){this.scenarios=e,this.scheduler=new o.CallbackScheduler}return e.create=function(){return new e([{delayEvent:a.Event.PAUSE,inState:i.State.STARTUP,cancelOnEvent:a.Event.ERROR},{delayEvent:a.Event.PAUSE,inState:i.State.PLAYING,cancelOnEvent:a.Event.SEEK},{delayEvent:a.Event.END_AD,inState:i.State.AD_PLAYBACK,cancelOnEvent:a.Event.END}])},e.prototype.dispatchEvent=function(e,t,n,i){var a=this;this.scheduler.isScheduled()&&null!=this.activeScenario&&(this.activeScenario.cancelOnEvent===e?(r.logger.log("⏳ [DelayedEventDispatcher] 🚫 Cancelling delayed '".concat(String(this.activeScenario.delayEvent),"' — canceled by event '").concat(String(e),"'")),this.scheduler.cancel(),this.activeScenario=void 0):(r.logger.log("⏳ [DelayedEventDispatcher] ✅ Executing delayed '".concat(String(this.activeScenario.delayEvent),"' early — unrelated event '").concat(String(e),"' arrived")),this.scheduler.execute(),this.activeScenario=void 0));var o=this.findMatchingScenario(e,n);if(null!=o){var s=Date.now();return this.activeScenario=o,r.logger.log("⏳ [DelayedEventDispatcher] ➕ Delaying '".concat(String(e),"' in state '").concat(n,"'")),void this.scheduler.schedule((function(){a.activeScenario=void 0,i(e,t,s)}))}i(e,t)},e.prototype.findMatchingScenario=function(e,t){for(var n=0,i=this.scenarios;n<i.length;n++){var a=i[n];if(a.delayEvent===e&&a.inState===t)return a}},e}();t.DelayedEventDispatcher=s},4179:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VideojsAdapter=void 0;var i=n(4350),a=n(8331),r=n(9627),o=n(1916),s=n(2108),l=n(4926),u=n(4040),c=n(9735),d=function(){function e(e,t,n){if((0,s.hasPlayerAlreadyBeenAugmented)(t))o.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance");else{(0,s.markPlayerInstanceAsAugmented)(t);var l=(0,a.sanitizeAnalyticsConfig)(e);(0,r.areCollectorRequirementsValid)(l)&&((0,a.guardAgainstDuplicatedUserId)(l),this.internalAdapter=new u.VideojsInternalAdapter(new c.VideojsPlayerProxy(t),n),this.analytics=i.Analytics.create(l,this.internalAdapter))}}return Object.defineProperty(e.prototype,"version",{get:function(){return l.VERSION},enumerable:!1,configurable:!0}),e.prototype.getCurrentImpressionId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if((0,s.isDefined)(this.analytics))return this.analytics.getUserId()},e.prototype.setCustomData=function(e){(0,s.isDefined)(this.internalAdapter)&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){(0,s.isDefined)(this.analytics)&&this.analytics.sourceChange(e)},e.version=l.VERSION,e}();t.VideojsAdapter=d},4040:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.VideojsInternalAdapter=void 0,t.detectVideoJsPlaybackInfoStreamTypeFields=S;var o=n(5182),s=n(2663),l=n(6743),u=n(5626),c=n(2361),d=n(556),E=n(8525),p=n(7224),v=n(7614),f=n(9557),h=n(3413),m=n(716),A=n(9422),y=n(1820),T=n(5063),g=function(e){function t(t,n){var i=e.call(this,n)||this;i._subtitleInfo={enabled:!1},i.onBeforeUnLoadEvent=!1,i.previousTime=0,i.getPlayerVersion=function(){var e,t,n,a=null===(n=null===(t=(e=i.player).version)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n["video.js"];if((0,y.isValidString)(a)&&!(0,y.isBlank)(a))return a;var r=(0,A.getGlobalVideojsVersion)();return(0,y.isValidString)(r)&&!(0,y.isBlank)(r)?r:"unknown"},i.getPlayerName=function(){return d.Player.VIDEOJS},i.getPlayerTech=function(){return"html5"},i.getAutoPlay=function(){return!0===i.player.autoplay()},i.getDrmPerformanceInfo=function(){return i.drmPerformanceInfo},i.player=t;var a=new s.HeartbeatService((function(){return i.currentTime})),r=new o.VideojsAnalyticsStateMachine(i.stateMachineCallbacks,a,i.opts);return a.setListener(r),i.stateMachine=r,i.videoCompletionTracker=new l.default,i}return a(t,e),t.prototype.resetSourceRelatedState=function(){var t;e.prototype.resetSourceRelatedState.call(this),this.videoCompletionTracker.reset(),this.videoCompletionTracker.setVideoDuration(null!==(t=this.player.duration())&&void 0!==t?t:0),this.previousTime=0},t.prototype.initialize=function(e){return this.register(),[new f.ErrorDetailTracking(e.errorDetailTrackingSettingsProvider,new v.ErrorDetailBackend(e.errorDetailTrackingSettingsProvider.collectorConfig),[e.errorDetailSubscribable],void 0)]},t.prototype.getCurrentPlaybackInfo=function(){var e,t,n;this.selectedAudioLanguage=this.getSelectedAudioTrackLanguage(this.player);var i=this.getCodecInfo(this.player.tech({IWillNotUseThisInPlugins:!0})),a=this.player.duration(),o=r(r(r({},this.getCommonPlaybackInfo()),S(this.player)),{isLive:(0,T.isNullish)(a)||isNaN(a)?void 0:a===1/0,size:this.player.isFullscreen()?E.PlayerSize.Fullscreen:E.PlayerSize.Window,playerTech:this.getPlayerTech(),isMuted:this.player.muted(),videoDuration:(0,h.normalizeVideoDuration)(a),videoWindowHeight:this.player.height(),videoWindowWidth:this.player.width(),videoPlaybackHeight:this.player.videoHeight(),videoPlaybackWidth:this.player.videoWidth(),audioLanguage:this.selectedAudioLanguage,subtitleEnabled:this._subtitleInfo.enabled,subtitleLanguage:this._subtitleInfo.language,videoCodec:null==i?void 0:i.videoCodec,audioCodec:null==i?void 0:i.audioCodec,droppedFrames:0}),s=this.getCurrentQualityLevelInfo();return s&&(o.videoPlaybackWidth=null!==(e=s.width)&&void 0!==e?e:o.videoPlaybackWidth,o.videoPlaybackHeight=null!==(t=s.height)&&void 0!==t?t:o.videoPlaybackHeight,o.videoBitrate=null!==(n=s.bitrate)&&void 0!==n?n:o.videoBitrate),o},t.prototype.getCurrentQualityLevelInfo=function(){return this.currentVideoJsQualityLevel()},t.prototype.register=function(){var e,t=this,n=this;this.player.on("loadstart",(function(){n.eventCallback(c.Event.MANUAL_SOURCE_CHANGE,{config:{}})})),this.player.on("loadedmetadata",(function(){n.videoCompletionTracker.reset(),n.videoCompletionTracker.setVideoDuration(this.duration()),n.previousTime=0,n.eventCallback(c.Event.SOURCE_LOADED,{})})),this.player.ready((function(){n._subtitleInfo=n.getSubtitleInfo(this),n.eventCallback(c.Event.READY,{})})),this.player.on("play",(function(){n.eventCallback(c.Event.PLAY,{currentTime:this.currentTime()})})),this.player.on("pause",(function(){this.seeking()||n.eventCallback(c.Event.PAUSE,{currentTime:this.currentTime()})})),this.player.on("error",(function(){var e=this.error();n.eventCallback(c.Event.ERROR,{currentTime:this.currentTime(),code:e.code,message:e.message,originalError:e,data:{}})})),this.player.on("volumechange",(function(){var e=this.muted(),t=this.volume(),i=(0,T.isAudioMuted)(e,t);this.previousMutedValue!==i&&(i?n.eventCallback(c.Event.MUTE,{currentTime:this.currentTime()}):n.eventCallback(c.Event.UN_MUTE,{currentTime:this.currentTime()}),this.previousMutedValue=i)})),this.player.on("seeking",(function(){n.eventCallback(c.Event.SEEK,{currentTime:(0,T.isNotNullish)(n.previousTime)?n.previousTime:this.currentTime()})})),this.player.on("seeked",(function(){n.eventCallback(c.Event.SEEKED,{currentTime:this.currentTime()})})),this.player.on("texttrackchange",(function(){var e=n.getSubtitleInfo(this),t=!!(0,T.isNullish)(n._subtitleInfo)||(0,m.isDifferentSubtitleInfo)(n._subtitleInfo,e);n._subtitleInfo=e,t&&n.eventCallback(c.Event.SUBTITLE_CHANGE,{currentTime:this.currentTime()})})),null===(e=this.player.audioTracks())||void 0===e||e.on("change",(function(){var e=n.getSelectedAudioTrackLanguage(n.player);(0,T.isNotNullish)(e)&&e!==n.selectedAudioLanguage&&n.eventCallback(c.Event.AUDIOTRACK_CHANGED,{currentTime:n.player.currentTime()})})),this.player.on("stalled",(function(){n.eventCallback(c.Event.START_BUFFERING,{currentTime:this.currentTime()})})),this.player.on("waiting",(function(){n.eventCallback(c.Event.START_BUFFERING,{currentTime:this.currentTime()})})),this.player.on("timeupdate",(function(){this.seeking()||(n.previousTime=this.currentTime()),n.eventCallback(c.Event.TIMECHANGED,{currentTime:this.currentTime()});var e=n.currentVideoJsQualityLevel();if((null==e?void 0:e.height)&&(null==e?void 0:e.width)&&(null==e?void 0:e.bitrate)){var t={type:"video",bitrate:e.bitrate,height:e.height,width:e.width,currentTime:this.currentTime()};n.qualityChangeService.shouldAllowVideoQualityChange(e.bitrate)&&n.eventCallback(c.Event.VIDEO_CHANGE,t),n.qualityChangeService.setVideoBitrate(e.bitrate),n.stateMachineCallbacks.updateSampleQualityInfo(t)}}));var i=function(){if(!t.onBeforeUnLoadEvent){t.onBeforeUnLoadEvent=!0;var e=void 0;(0,T.isNotNullish)(t.player)&&(e=t.player.currentTime()),t.eventCallback(c.Event.UNLOAD,{currentTime:e})}t.release()};i=i.bind(this),this.player.on("dispose",i),this.windowEventTracker.addEventListener("beforeunload",i),this.windowEventTracker.addEventListener("unload",i)},Object.defineProperty(t.prototype,"currentTime",{get:function(){var e;return null!==(e=this.player.currentTime())&&void 0!==e?e:0},enumerable:!1,configurable:!0}),t.prototype.getSelectedAudioTrackLanguage=function(e){for(var t=0,n=e.audioTracks();t<n.length;t++){var i=n[t];if(i.enabled)return i.language}},t.prototype.getSubtitleInfo=function(e){for(var t,n=!1,i=0,a=e.textTracks()||[];i<a.length;i++){var r=a[i];if("showing"===r.mode){n=!0,t=r.language;break}}return{enabled:n,language:t}},t.prototype.currentVideoJsQualityLevel=function(){var e=this.player.tech({IWillNotUseThisInPlugins:!0});if((0,T.isNullish)(e))return null;if((0,T.isNullish)(e.vhs)&&(0,T.isNullish)(e.hls))return null;var t=this.getMediaAttributes(e);return t&&t.bitrate?{bitrate:t.bitrate,width:t.width,height:t.height}:null},t.prototype.getMediaAttributes=function(e){var t;if(e&&(e.vhs?t=e.vhs:e.hls&&(t=e.hls),t&&t.playlists&&(0,T.isFunction)(t.playlists.media))){var n=t.playlists.media();if(n){var i=n.attributes;if(i&&0!==Object.keys(i).length)return{bitrate:i.BANDWIDTH,width:(i.RESOLUTION||{}).width,height:(i.RESOLUTION||{}).height,codecs:i.CODECS}}}},t.prototype.getCodecInfo=function(e){var t=this.getMediaAttributes(e);if(t&&t.codecs){var n=t.codecs.split(",");if(n)return{videoCodec:n.find((function(e){return u.isVideoCodec(e)})),audioCodec:n.find((function(e){return u.isAudioCodec(e)}))}}},t}(n(2647).InternalAdapter);function S(e){var t,n=e.currentSrc(),i=(0,p.getStreamTypesFromURL)(n);if((0,T.isNullish)(i)){var a=null===(t=e.currentType)||void 0===t?void 0:t.call(e);a&&(i=(0,p.getStreamTypeFromMIMEType)(a))}return(0,h.buildPlaybackInfoStreamTypeFields)(i,n)}t.VideojsInternalAdapter=g},9735:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VideojsPlayerProxy=void 0;var i=n(2974),a=function(e){var t=this;this.rawPlayer=e,this.on=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(0,i.safeAccess)((function(){var n;return(n=t.rawPlayer).on.apply(n,e)}))},this.ready=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(0,i.safeAccess)((function(){var n;return(n=t.rawPlayer).ready.apply(n,e)}))},this.duration=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.duration()}))},this.currentTime=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.currentTime()}))},this.currentSrc=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.currentSrc()}))},this.currentType=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.currentType()}))},this.autoplay=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.autoplay()}))},this.muted=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.muted()}))},this.height=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.height()}))},this.width=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.width()}))},this.videoHeight=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.videoHeight()}))},this.videoWidth=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.videoWidth()}))},this.isFullscreen=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.isFullscreen()}))},this.audioTracks=function(){return(0,i.safeAccess)((function(){return t.rawPlayer.audioTracks()}))},this.tech=function(e){return(0,i.safeAccess)((function(){return t.rawPlayer.tech(e)}))},this.version=function(){return(0,i.safeAccess)((function(){var e,n;return null===(n=(e=t.rawPlayer).version)||void 0===n?void 0:n.call(e)}))}};t.VideojsPlayerProxy=a},7596:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsStateMachine=void 0;var a=n(7906),r=n(3458),o=n(2361),s=n(1916),l=n(4649),u=n(5063),c=n(5063),d=[3e3,5e3,1e4,3e4,59700],E=function(){function e(e,t,n){this.stateMachineCallbacks=e,this.onEnterStateTimestamp=0,this.videoStartupTimeoutMs=l.ANALYTICS_VIDEOSTART_TIMEOUT,this.bufferTimeoutMs=l.ANALYTICS_BUFFER_TIMEOUT,this.currentBufferingIntervalIndex=0,this.stateMachine=this.createStateMachine(n),this.playingHeartbeatService=t}return e.prototype.callEvent=function(e,t,n){var i=this.stateMachine[e];if(null!=i)try{i.call(this.stateMachine,n,t)}catch(i){s.logger.error('StateMachine ignored event "'.concat(e,'" call, because it has thrown exception in the current state "').concat(this.currentState,'"'),t,n,i)}else s.logger.warn('StateMachine ignored event "'.concat(e,'" call, because it was not defined'),t,n)},Object.defineProperty(e.prototype,"currentState",{get:function(){return this.stateMachine.current},enumerable:!1,configurable:!0}),e.prototype.resetIntervals=function(){this.clearVideoStartTimeout(),this.clearBufferingTimeoutHandle(!0),this.clearBufferingHeartbeatHandle()},e.prototype.startBufferingHeartbeatInterval=function(e){var t=this;void 0===e&&(e=!0),this.resetBufferingHelpers(e),this.startBufferingTimeoutHandle(),this.bufferingHeartbeatIntervalHandle=setInterval((function(){var e=t.stateMachine.current.toLowerCase();if("buffering"===e){var n=(new Date).getTime(),i=n-t.onEnterStateTimestamp;t.stateMachineCallbacks.heartbeat(i,e,{buffered:i}),t.onEnterStateTimestamp=n,t.currentBufferingIntervalIndex=Math.min(t.currentBufferingIntervalIndex+1,d.length-1),t.startBufferingHeartbeatInterval(!1)}else t.resetBufferingHelpers()}),d[this.currentBufferingIntervalIndex])},e.prototype.resetBufferingHelpers=function(e){void 0===e&&(e=!0),e&&(this.currentBufferingIntervalIndex=0),this.clearBufferingHeartbeatHandle(),this.clearBufferingTimeoutHandle(e)},e.prototype.clearBufferingHeartbeatHandle=function(){(0,c.isNotNullish)(this.bufferingHeartbeatIntervalHandle)&&(clearInterval(this.bufferingHeartbeatIntervalHandle),this.bufferingHeartbeatIntervalHandle=void 0)},e.prototype.startBufferingTimeoutHandle=function(){var e=this;this.currentBufferingIntervalIndex>0||(this.bufferingTimeoutHandle=setTimeout((function(){e.callEvent(o.Event.ERROR,i(i({},r.ErrorCode.BUFFERING_TIMEOUT_REACHED),{data:{additionalData:"StateMachine timed out after ".concat(e.bufferTimeoutMs," ms of consecutive buffering.")}}),u.getCurrentTimestamp()),e.stateMachineCallbacks.release()}),this.bufferTimeoutMs))},e.prototype.clearBufferingTimeoutHandle=function(e){e&&(0,c.isNotNullish)(this.bufferingTimeoutHandle)&&(clearTimeout(this.bufferingTimeoutHandle),this.bufferingTimeoutHandle=void 0)},e.prototype.setVideoStartTimeout=function(){var e=this;(0,c.isNotNullish)(this.videoStartTimeout)&&this.clearVideoStartTimeout(),this.videoStartTimeout=setTimeout((function(){e.callEvent(o.Event.VIDEOSTART_TIMEOUT,{},Date.now()),e.stateMachineCallbacks.release()}),this.videoStartupTimeoutMs)},e.prototype.clearVideoStartTimeout=function(){clearTimeout(this.videoStartTimeout),this.videoStartTimeout=void 0},e.prototype.onHeartbeat=function(e){this.sendPlayingSample(Date.now(),e)},e.prototype.sendPlayingSample=function(e,t,n,i){void 0===n&&(n=!1),void 0===i&&(i=!1);var r=this.stateMachine.current.toLowerCase();if("playing"===r){this.stateMachineCallbacks.setVideoTimeEndFromEvent({currentTime:t});var o=e-this.onEnterStateTimestamp,l={played:o,isProgramChange:!!i||void 0};n&&(l[a.SSAI_RELATED_SAMPLE_MARKER]=!0),this.stateMachineCallbacks.heartbeat(o,r,l),this.resetCurrentStateStart(e,t)}else s.logger.warn('Unexpected call of "sendPlayingSample" in AnalyticsStateMachine from "'.concat(r,'" state'))},e.prototype.resetCurrentStateStart=function(e,t){this.onEnterStateTimestamp=e,this.stateMachineCallbacks.setVideoTimeStartFromEvent({currentTime:t})},e.prototype.programChange=function(e,t,n){if("SETUP"!==this.stateMachine.current&&"READY"!==this.stateMachine.current&&"STARTUP"!==this.stateMachine.current&&"STARTUP_AUTOPLAY"!==this.stateMachine.current){var i=Date.now();"PLAYING"===this.stateMachine.current?this.sendPlayingSample(i,e,t,!0):this.resetCurrentStateStart(i,e),this.stateMachineCallbacks.programChange(n)}else this.stateMachineCallbacks.updateSourceMetadata(n)},e}();t.AnalyticsStateMachine=E},3453:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,a=0,r=t.length;a<r;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.CAFv3AnalyticsStateMachine=t.State=void 0;var o,s=n(2595),l=n(2361),u=n(3565),c=n(1916),d=n(1460),E=n(5063),p=n(7596),v=n(8253);!function(e){e.BUFFERING="BUFFERING",e.CUSTOMDATACHANGE="CUSTOMDATACHANGE",e.ERROR="ERROR",e.PAUSE="PAUSE",e.PLAYING="PLAYING",e.READY="READY",e.SEEKING="SEEKING",e.SEEKING_IN_PAUSE="SEEKING_IN_PAUSE",e.SETUP="SETUP",e.SOURCE_CHANGING="SOURCE_CHANGING",e.STARTUP="STARTUP",e.UNLOADED="UNLOADED",e.VIDEOSTART_FAILED="VIDEOSTART_FAILED"}(o||(t.State=o={}));var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.createStateMachine=function(e){var t,n=this;return(0,s.create)({initial:{state:o.SETUP,event:l.JSM_INITIAL_EVENT},error:v.customStateMachineErrorCallback,events:r(r(r(r(r(r(r(r(r(r(r(r(r(r([],(0,v.whileIn)(o.SETUP).passOver(l.Event.START_BUFFERING),!0),[{name:l.Event.SOURCE_LOADED,from:o.SETUP,to:o.READY},{name:l.Event.READY,from:o.SETUP,to:o.READY}],!1),(0,v.whileIn)(o.READY).passOver(l.Event.READY,l.Event.START_BUFFERING,l.Event.END_BUFFERING,l.Event.TIMECHANGED,l.Event.SEEK,l.Event.SEEKED),!0),[{name:l.Event.PLAY,from:o.READY,to:o.STARTUP},{name:l.Event.ERROR,from:o.STARTUP,to:o.VIDEOSTART_FAILED},{name:l.Event.UNLOAD,from:o.STARTUP,to:o.VIDEOSTART_FAILED},{name:l.Event.VIDEOSTART_TIMEOUT,from:o.STARTUP,to:o.VIDEOSTART_FAILED},{name:l.Event.ERROR,from:(0,v.getAllStatesBut)([o.STARTUP],o),to:o.ERROR},{name:l.Event.UNLOAD,from:(0,v.getAllStatesBut)([o.STARTUP],o),to:o.UNLOADED},{name:l.Event.TIMECHANGED,from:o.STARTUP,to:o.PLAYING}],!1),(0,v.whileIn)(o.PLAYING).passOver(l.Event.TIMECHANGED),!0),[{name:l.Event.START_BUFFERING,from:o.PLAYING,to:o.BUFFERING},{name:l.Event.TIMECHANGED,from:o.BUFFERING,to:o.PLAYING},{name:l.Event.PAUSE,from:o.PLAYING,to:o.PAUSE},{name:l.Event.PAUSE,from:o.BUFFERING,to:o.PAUSE},{name:l.Event.PAUSE,from:o.SEEKING,to:o.PAUSE}],!1),(0,v.whileIn)(o.PAUSE).passOver(l.Event.START_BUFFERING,l.Event.END_BUFFERING),!0),[{name:l.Event.PLAYING,from:o.PAUSE,to:o.PLAYING},{name:l.Event.SEEK,from:o.PAUSE,to:o.SEEKING_IN_PAUSE}],!1),(0,v.whileIn)(o.SEEKING_IN_PAUSE).passOver(l.Event.SEEK,l.Event.START_BUFFERING,l.Event.END_BUFFERING,l.Event.TIMECHANGED),!0),[{name:l.Event.SEEKED,from:o.SEEKING_IN_PAUSE,to:o.PAUSE},{name:l.Event.SEEK,from:o.PLAYING,to:o.SEEKING}],!1),(0,v.whileIn)(o.SEEKING).passOver(l.Event.SEEK,l.Event.START_BUFFERING,l.Event.END_BUFFERING,l.Event.TIMECHANGED),!0),[{name:l.Event.SEEKED,from:o.SEEKING,to:o.PLAYING},{name:l.Event.MANUAL_SOURCE_CHANGE,from:(0,v.getAllStatesBut)([o.SETUP],o),to:o.SOURCE_CHANGING}],!1),(0,v.whileIn)(o.SOURCE_CHANGING).passOver(l.Event.START_BUFFERING,l.Event.TIMECHANGED),!0),[{name:l.Event.SOURCE_LOADED,from:o.SOURCE_CHANGING,to:o.READY},{name:l.Event.CUSTOM_DATA_CHANGE,from:[o.PLAYING,o.PAUSE],to:o.CUSTOMDATACHANGE},{name:l.Event.PLAYING,from:o.CUSTOMDATACHANGE,to:o.PLAYING},{name:l.Event.PAUSE,from:o.CUSTOMDATACHANGE,to:o.PAUSE}],!1),callbacks:(t={},t["onleave".concat(o.PLAYING)]=function(){n.playingHeartbeatService.stopHeartbeat()},t["onleave".concat(o.STARTUP)]=function(){n.clearVideoStartTimeout()},t.onleavestate=function(e,t,i,a,r){if((0,v.logStateMachineTransition)("LEAVE",e,t,i),e!==l.JSM_INITIAL_EVENT&&(t===o.BUFFERING&&n.resetBufferingHelpers(),a&&t!==o.ERROR&&!(t===o.PAUSE&&i===o.SEEKING_IN_PAUSE||t===o.SEEKING_IN_PAUSE&&i===o.PAUSE))){r&&n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var s=a-n.onEnterStateTimestamp,d=String(t).toLowerCase();if(t!==o.STARTUP||i!==o.VIDEOSTART_FAILED)if(t!==o.SEEKING)if(e!==l.Event.UNLOAD){var p=n.stateMachineCallbacks[d];if((0,E.isFunction)(p))try{p(s,d,r)}catch(e){c.logger.error("Exception occurred in State Machine callback "+d,r,e)}else(0,v.logMissingCallbackWarning)(t,[o.READY,o.SOURCE_CHANGING])}else n.stateMachineCallbacks.unload(s,d);else n.stateMachineCallbacks.seeking(s);else n.stateMachineCallbacks.videoStartFailed(s,(0,u.createVideoStartFailedReason)(e))}},t["onenter".concat(o.PLAYING)]=function(){n.playingHeartbeatService.startHeartbeat()},t["onenter".concat(o.SOURCE_CHANGING)]=function(e,t,i,a,r){n.stateMachineCallbacks.manualSourceChange(r)},t["onenter".concat(o.STARTUP)]=function(){n.setVideoStartTimeout()},t.onenterstate=function(t,i,a,r,s){(0,v.logStateMachineTransition)("ENTER",t,i,a),i===o.PAUSE&&a===o.SEEKING_IN_PAUSE||i===o.SEEKING_IN_PAUSE&&a===o.PAUSE||(n.onEnterStateTimestamp=null!=r?r:Date.now(),(0,d.isNumber)(e.starttime)&&t===l.JSM_INITIAL_EVENT&&(n.onEnterStateTimestamp=e.starttime),s&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(s),a===o.BUFFERING&&n.startBufferingHeartbeatInterval())},t["onafter".concat(l.Event.ERROR)]=function(e,t,i,a,r){n.stateMachineCallbacks.error(r)},t)})},t}(p.AnalyticsStateMachine);t.CAFv3AnalyticsStateMachine=f},3674:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,a=0,r=t.length;a<r;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.HTML5AnalyticsStateMachine=void 0;var o,s=n(2595),l=n(2361),u=n(3565),c=n(1916),d=n(1460),E=n(5063),p=n(7596),v=n(8253);!function(e){e.AD="AD",e.AUDIOTRACK_CHANGING="AUDIOTRACK_CHANGING",e.BUFFERING="BUFFERING",e.CASTING="CASTING",e.CUSTOMDATACHANGE="CUSTOMDATACHANGE",e.END="END",e.ERROR="ERROR",e.MUTING_PAUSE="MUTING_PAUSE",e.MUTING_PLAY="MUTING_PLAY",e.MUTING_READY="MUTING_READY",e.PAUSE="PAUSE",e.PAUSED_SEEKING="PAUSED_SEEKING",e.PLAYING="PLAYING",e.QUALITY_CHANGE="QUALITY_CHANGE",e.READY="READY",e.SETUP="SETUP",e.SETUP_SOURCE_CHANGE="SETUP_SOURCE_CHANGE",e.SOURCE_CHANGING="SOURCE_CHANGING",e.STARTUP="STARTUP",e.SUBTITLE_CHANGING="SUBTITLE_CHANGING",e.VIDEOSTART_FAILED="VIDEOSTART_FAILED"}(o||(o={}));var f=function(e){function t(t,n,i){var a=e.call(this,t,n,i)||this;return a.createStateMachine(i),a}return a(t,e),t.prototype.getAllStates=function(){return r([],Object.keys(o).map((function(e){return o[e]})),!0)},t.prototype.getAllStatesBut=function(e){return this.getAllStates().filter((function(t){return e.indexOf(t)<0}))},t.prototype.createStateMachine=function(e){var t,n=this;return s.create({initial:{state:o.SETUP,event:l.JSM_INITIAL_EVENT},error:v.customStateMachineErrorCallback,events:r(r(r(r(r(r(r(r(r(r(r(r(r([{name:l.Event.SOURCE_LOADED,from:[o.SETUP,o.SETUP_SOURCE_CHANGE,o.SOURCE_CHANGING],to:o.READY}],(0,v.whileIn)(o.READY).passOver(l.Event.SEEK,l.Event.SEEKED),!0),[(0,v.on)(l.Event.TIMECHANGED).stayIn(o.SETUP),(0,v.on)(l.Event.SOURCE_LOADED).stayIn(o.READY),{name:l.Event.PLAY,from:o.READY,to:o.STARTUP},{name:l.Event.PLAY,from:o.SOURCE_CHANGING,to:o.STARTUP},{name:l.Event.ERROR,from:o.STARTUP,to:o.VIDEOSTART_FAILED},{name:l.Event.UNLOAD,from:o.STARTUP,to:o.VIDEOSTART_FAILED},{name:l.Event.VIDEOSTART_TIMEOUT,from:o.STARTUP,to:o.VIDEOSTART_FAILED}],!1),(0,v.whileIn)(o.STARTUP).passOver(l.Event.SOURCE_LOADED,l.Event.START_BUFFERING,l.Event.END_BUFFERING,l.Event.VIDEO_CHANGE,l.Event.AUDIO_CHANGE,l.Event.SEEK,l.Event.SEEKED),!0),[{name:l.Event.TIMECHANGED,from:o.READY,to:o.STARTUP},{name:l.Event.TIMECHANGED,from:o.STARTUP,to:o.PLAYING}],!1),(0,v.whileIn)(o.PLAYING).passOver(l.Event.TIMECHANGED),!0),[(0,v.on)(l.Event.SEEKED).stayIn(o.PAUSE),(0,v.on)(l.Event.END_BUFFERING).stayIn(o.PLAYING),{name:l.Event.START_BUFFERING,from:o.PLAYING,to:o.BUFFERING},(0,v.on)(l.Event.START_BUFFERING).stayIn(o.BUFFERING),{name:l.Event.PLAY,from:o.BUFFERING,to:o.PLAYING},{name:l.Event.TIMECHANGED,from:o.BUFFERING,to:o.PLAYING},{name:l.Event.PAUSE,from:o.PLAYING,to:o.PAUSE},{name:l.Event.PAUSE,from:o.BUFFERING,to:o.PAUSE},{name:l.Event.PLAY,from:o.PAUSE,to:o.PLAYING},{name:l.Event.TIMECHANGED,from:o.PAUSE,to:o.PLAYING},{name:l.Event.VIDEO_CHANGE,from:o.PLAYING,to:o.QUALITY_CHANGE},{name:l.Event.AUDIO_CHANGE,from:o.PLAYING,to:o.QUALITY_CHANGE},{name:l.Event.FINISH_QUALITY_CHANGE,from:o.QUALITY_CHANGE,to:o.PLAYING},{name:l.Event.SEEK,from:o.PAUSE,to:o.PAUSED_SEEKING}],!1),(0,v.whileIn)(o.PAUSED_SEEKING).passOver(l.Event.PLAY,l.Event.SEEK,l.Event.START_BUFFERING,l.Event.END_BUFFERING),!0),[{name:l.Event.SEEKED,from:o.PAUSED_SEEKING,to:o.PAUSE},{name:l.Event.TIMECHANGED,from:o.PAUSED_SEEKING,to:o.PLAYING},{name:l.Event.PAUSE,from:o.PAUSED_SEEKING,to:o.PAUSE},{name:l.Event.END,from:o.PAUSED_SEEKING,to:o.END},{name:l.Event.END,from:o.PLAYING,to:o.END},{name:l.Event.END,from:o.PAUSE,to:o.END}],!1),(0,v.whileIn)(o.END).passOver(l.Event.PAUSE,l.Event.SEEK,l.Event.SEEKED,l.Event.TIMECHANGED,l.Event.END_BUFFERING,l.Event.START_BUFFERING,l.Event.END),!0),(0,v.whileIn)(o.PLAYING).passOver(l.Event.SEEK,l.Event.SEEKED),!0),[{name:l.Event.PLAY,from:o.END,to:o.PLAYING},{name:l.Event.ERROR,from:this.getAllStatesBut([o.STARTUP]),to:o.ERROR},{name:l.Event.PAUSE,from:o.ERROR,to:o.ERROR},{name:l.Event.UNLOAD,from:this.getAllStatesBut([o.STARTUP]),to:o.END},{name:l.Event.SUBTITLE_CHANGE,from:o.PLAYING,to:o.SUBTITLE_CHANGING},(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.PAUSE),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.READY),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.STARTUP),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.BUFFERING),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.SUBTITLE_CHANGING),{name:l.Event.TIMECHANGED,from:o.SUBTITLE_CHANGING,to:o.PLAYING},{name:l.Event.AUDIOTRACK_CHANGED,from:o.PLAYING,to:o.AUDIOTRACK_CHANGING},(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.PAUSE),(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.READY),(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.STARTUP),(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.BUFFERING),(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.AUDIOTRACK_CHANGING),{name:l.Event.TIMECHANGED,from:o.AUDIOTRACK_CHANGING,to:o.PLAYING},{name:l.Event.START_AD,from:o.PLAYING,to:o.AD},{name:l.Event.END_AD,from:o.AD,to:o.PLAYING},{name:l.Event.MUTE,from:o.READY,to:o.MUTING_READY},{name:l.Event.UN_MUTE,from:o.READY,to:o.MUTING_READY},{name:"FINISH_MUTING",from:o.MUTING_READY,to:o.READY},{name:l.Event.MUTE,from:o.PLAYING,to:o.MUTING_PLAY},{name:l.Event.UN_MUTE,from:o.PLAYING,to:o.MUTING_PLAY},{name:"FINISH_MUTING",from:o.MUTING_PLAY,to:o.PLAYING},{name:l.Event.MUTE,from:o.PAUSE,to:o.MUTING_PAUSE},{name:l.Event.UN_MUTE,from:o.PAUSE,to:o.MUTING_PAUSE},{name:"FINISH_MUTING",from:o.MUTING_PAUSE,to:o.PAUSE},{name:l.Event.START_CAST,from:[o.READY,o.PAUSE],to:o.CASTING}],!1),(0,v.whileIn)(o.CASTING).passOver(l.Event.PAUSE,l.Event.PLAY,l.Event.TIMECHANGED,l.Event.MUTE,l.Event.SEEK,l.Event.SEEKED),!0),[{name:l.Event.END_CAST,from:o.CASTING,to:o.READY},{name:l.Event.MANUAL_SOURCE_CHANGE,from:o.SETUP,to:o.SETUP_SOURCE_CHANGE},(0,v.on)(l.Event.MANUAL_SOURCE_CHANGE).stayIn(o.SETUP_SOURCE_CHANGE),{name:l.Event.MANUAL_SOURCE_CHANGE,from:this.getAllStatesBut([o.SETUP,o.SETUP_SOURCE_CHANGE]),to:o.SOURCE_CHANGING},{name:l.Event.SOURCE_UNLOADED,from:this.getAllStates(),to:o.SOURCE_CHANGING},(0,v.on)(l.Event.TIMECHANGED).stayIn(o.SOURCE_CHANGING),(0,v.on)(l.Event.PAUSE).stayIn(o.SOURCE_CHANGING),{name:l.Event.CUSTOM_DATA_CHANGE,from:[o.PLAYING,o.PAUSE],to:o.CUSTOMDATACHANGE},{name:l.Event.PLAYING,from:o.CUSTOMDATACHANGE,to:o.PLAYING},{name:l.Event.PAUSE,from:o.CUSTOMDATACHANGE,to:o.PAUSE}],!1),callbacks:(t={},t["onleave".concat(o.PLAYING)]=function(e,t,i,a,r){n.playingHeartbeatService.stopHeartbeat()},t["onleave".concat(o.STARTUP)]=function(e,t,i,a,r){n.clearVideoStartTimeout()},t.onleavestate=function(e,t,i,a,r){if((0,v.logStateMachineTransition)("LEAVE",e,t,i),e!==l.JSM_INITIAL_EVENT&&(t===o.BUFFERING&&n.resetBufferingHelpers(),a&&(t!==o.ERROR||e!==l.Event.MANUAL_SOURCE_CHANGE&&e!==l.Event.SOURCE_UNLOADED))){var s=a-n.onEnterStateTimestamp;r&&i!==o.PAUSED_SEEKING&&n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var d=String(t).toLowerCase();if(i===o.VIDEOSTART_FAILED)n.clearVideoStartTimeout(),n.stateMachineCallbacks.videoStartFailed(s,(0,u.createVideoStartFailedReason)(e));else if(t===o.PAUSED_SEEKING)n.stateMachineCallbacks.seeking(s);else if(e===l.Event.UNLOAD)n.stateMachineCallbacks.unload(s,d);else if(t===o.PAUSE&&i!==o.PAUSED_SEEKING)n.stateMachineCallbacks.pause(s,d);else{var p=n.stateMachineCallbacks[d];if((0,E.isFunction)(p))try{p(s,d,r)}catch(e){c.logger.error("Exception occurred in State Machine callback "+d,r,e)}else(0,v.logMissingCallbackWarning)(t,[o.READY,o.SOURCE_CHANGING,o.SETUP_SOURCE_CHANGE])}r&&i!==o.PAUSED_SEEKING&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(r),e===l.Event.MUTE?n.stateMachineCallbacks.mute():e===l.Event.UN_MUTE&&n.stateMachineCallbacks.unMute()}},t["onenter".concat(o.PLAYING)]=function(e,t,i,a,r){n.onEnterStateTimestamp=a,n.playingHeartbeatService.startHeartbeat()},t["onenter".concat(o.SOURCE_CHANGING)]=function(e,t,i,a,r){e===l.Event.MANUAL_SOURCE_CHANGE&&n.stateMachineCallbacks.manualSourceChange(r)},t["onenter".concat(o.STARTUP)]=function(e,t,i,a,r){n.setVideoStartTimeout()},t["onenter".concat(o.QUALITY_CHANGE)]=function(e,t,i,a,r){n.stateMachineCallbacks.qualitychange(r),n.stateMachine[l.Event.FINISH_QUALITY_CHANGE](a)},t.onenterstate=function(t,i,a,r,s){(0,v.logStateMachineTransition)("ENTER",t,i,a),n.onEnterStateTimestamp=null!=r?r:Date.now(),(0,d.isNumber)(e.starttime)&&t===l.JSM_INITIAL_EVENT&&(n.onEnterStateTimestamp=e.starttime),s&&a!==o.PAUSED_SEEKING&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(s),t===l.Event.START_CAST&&a===o.CASTING&&n.stateMachineCallbacks.startCasting(r,s),a===o.BUFFERING&&n.startBufferingHeartbeatInterval()},t["onafter".concat(l.Event.ERROR)]=function(e,t,i,a,r){n.stateMachineCallbacks.error(r)},t.onafterevent=function(e,t,i,a,r){i!==o.MUTING_READY&&i!==o.MUTING_PLAY&&i!==o.MUTING_PAUSE||n.stateMachine.FINISH_MUTING(a)},t)})},t}(p.AnalyticsStateMachine);t.HTML5AnalyticsStateMachine=f},655:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.THEOplayerAnalyticsStateMachine=t.State=void 0;var r,o=n(2595),s=n(2361),l=n(3565),u=n(1460),c=n(7596),d=n(8253);!function(e){e.AD_PLAYBACK="AD_PLAYBACK",e.AD_PLAYBACK_IN_STARTUP="AD_PLAYBACK_IN_STARTUP",e.BUFFERING="BUFFERING",e.CUSTOMDATACHANGE="CUSTOMDATACHANGE",e.ERROR="ERROR",e.PAUSE="PAUSE",e.PLAYING="PLAYING",e.QUALITY_CHANGE="QUALITY_CHANGE",e.READY="READY",e.SEEKING="SEEKING",e.SETUP="SETUP",e.SOURCE_CHANGING="SOURCE_CHANGING",e.STARTUP="STARTUP",e.UNLOADED="UNLOADED",e.VIDEOSTART_FAILED="VIDEOSTART_FAILED"}(r||(t.State=r={}));var E=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}return a(t,e),t.prototype.createStateMachine=function(e){var t,n=this;return(0,o.create)({initial:{state:r.SETUP,event:s.JSM_INITIAL_EVENT},error:d.customStateMachineErrorCallback,events:[{name:s.Event.READY,from:r.SETUP,to:r.READY},{name:s.Event.PLAY,from:r.READY,to:r.STARTUP},{name:s.Event.PLAYING,from:r.READY,to:r.PLAYING},{name:s.Event.ERROR,from:r.STARTUP,to:r.VIDEOSTART_FAILED},{name:s.Event.MANUAL_SOURCE_CHANGE,from:r.STARTUP,to:r.VIDEOSTART_FAILED},{name:s.Event.VIDEOSTART_TIMEOUT,from:r.STARTUP,to:r.VIDEOSTART_FAILED},{name:s.Event.READY,from:r.VIDEOSTART_FAILED,to:r.READY},{name:s.Event.PAUSE,from:r.STARTUP,to:r.READY},{name:s.Event.PLAYING,from:r.STARTUP,to:r.PLAYING},{name:s.Event.START_AD,from:r.STARTUP,to:r.AD_PLAYBACK_IN_STARTUP},{name:s.Event.END_AD,from:r.AD_PLAYBACK_IN_STARTUP,to:r.STARTUP},{name:s.Event.START_AD,from:(0,d.getAllStatesBut)([r.STARTUP],r),to:r.AD_PLAYBACK},{name:s.Event.END_AD,from:r.AD_PLAYBACK,to:r.PLAYING},{name:s.Event.END,from:r.AD_PLAYBACK,to:r.PAUSE},{name:s.Event.START_BUFFERING,from:r.PLAYING,to:r.BUFFERING},{name:s.Event.PLAYING,from:r.BUFFERING,to:r.PLAYING},{name:s.Event.PAUSE,from:r.BUFFERING,to:r.PAUSE},{name:s.Event.PAUSE,from:r.PLAYING,to:r.PAUSE},{name:s.Event.PLAYING,from:r.PAUSE,to:r.PLAYING},{name:s.Event.PLAY,from:r.PAUSE,to:r.PLAYING},{name:s.Event.SEEK,from:r.PLAYING,to:r.SEEKING},{name:s.Event.PLAYING,from:r.SEEKING,to:r.PLAYING},{name:s.Event.VIDEO_CHANGE,from:r.PLAYING,to:r.QUALITY_CHANGE},{name:s.Event.AUDIO_CHANGE,from:r.PLAYING,to:r.QUALITY_CHANGE},{name:s.Event.FINISH_QUALITY_CHANGE,from:r.QUALITY_CHANGE,to:r.PLAYING},{name:s.Event.MANUAL_SOURCE_CHANGE,from:(0,d.getAllStatesBut)([r.STARTUP],r),to:r.SOURCE_CHANGING},{name:s.Event.READY,from:r.SOURCE_CHANGING,to:r.READY},{name:s.Event.PLAY,from:r.SOURCE_CHANGING,to:r.STARTUP},{name:s.Event.CUSTOM_DATA_CHANGE,from:[r.PLAYING,r.PAUSE],to:r.CUSTOMDATACHANGE},{name:s.Event.PLAYING,from:r.CUSTOMDATACHANGE,to:r.PLAYING},{name:s.Event.PAUSE,from:r.CUSTOMDATACHANGE,to:r.PAUSE},{name:s.Event.ERROR,from:(0,d.getAllStatesBut)([r.STARTUP,r.VIDEOSTART_FAILED],r),to:r.ERROR},{name:s.Event.UNLOAD,from:"*",to:r.UNLOADED}],callbacks:(t={},t["onbefore".concat(s.Event.UNLOAD)]=function(e,t,i,a,o){n.stateMachineCallbacks.setVideoTimeEndFromEvent(o);var s=a-n.onEnterStateTimestamp;return t===r.STARTUP?n.stateMachineCallbacks.videoStartFailed(s,l.VideoStartFailedReason.PAGE_CLOSED):n.stateMachineCallbacks.unload(s,String(t).toLowerCase()),!1},t["onleave".concat(r.AD_PLAYBACK_IN_STARTUP)]=function(e,t,i,a,r){n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var o=a-n.onEnterStateTimestamp;n.stateMachineCallbacks.ad(o,"ad")},t["onleave".concat(r.AD_PLAYBACK)]=function(e,t,i,a,r){n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var o=a-n.onEnterStateTimestamp;n.stateMachineCallbacks.ad(o,"ad")},t["onleave".concat(r.CUSTOMDATACHANGE)]=function(e,t,i,a,r){n.stateMachineCallbacks.customdatachange(void 0,void 0,r)},t["onleave".concat(r.PAUSE)]=function(e,t,i,a,r){n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var o=a-n.onEnterStateTimestamp;n.stateMachineCallbacks.pause(o,"pause")},t["onleave".concat(r.PLAYING)]=function(e,t,i,a,r){n.playingHeartbeatService.stopHeartbeat(),n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var o=a-n.onEnterStateTimestamp;n.stateMachineCallbacks.playing(o,"playing")},t["onleave".concat(r.BUFFERING)]=function(e,t,i,a,r){n.resetBufferingHelpers(),n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var o=a-n.onEnterStateTimestamp;n.stateMachineCallbacks.buffering(o,"buffering")},t["onleave".concat(r.READY)]=function(e,t,i,a,o){if(e===s.Event.PLAYING&&i===r.PLAYING)return n.stateMachineCallbacks.setVideoTimeEndFromEvent(o),void n.stateMachineCallbacks.startup(1,"startup")},t["onleave".concat(r.SEEKING)]=function(e,t,i,a,r){n.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var o=a-n.onEnterStateTimestamp;n.stateMachineCallbacks.seeking(o)},t["onleave".concat(r.SETUP)]=function(e,t,i,a,r){n.stateMachineCallbacks.setVideoTimeEndFromEvent(r),n.stateMachineCallbacks.setup(1,"setup")},t["onleave".concat(r.STARTUP)]=function(e,t,i,a,o){if(n.clearVideoStartTimeout(),i!==r.READY&&i!==r.AD_PLAYBACK_IN_STARTUP){n.stateMachineCallbacks.setVideoTimeEndFromEvent(o);var s=a-n.onEnterStateTimestamp;i!==r.VIDEOSTART_FAILED?n.stateMachineCallbacks.startup(s,"startup"):n.stateMachineCallbacks.videoStartFailed(s,(0,l.createVideoStartFailedReason)(e))}},t.onleavestate=function(e,t,n){(0,d.logStateMachineTransition)("LEAVE",e,t,n)},t["onenter".concat(r.PLAYING)]=function(){n.playingHeartbeatService.startHeartbeat()},t["onenter".concat(r.BUFFERING)]=function(){n.startBufferingHeartbeatInterval()},t["onenter".concat(r.STARTUP)]=function(){n.setVideoStartTimeout()},t["onenter".concat(r.QUALITY_CHANGE)]=function(e,t,i,a,r){n.stateMachineCallbacks.qualitychange(r),n.stateMachine[s.Event.FINISH_QUALITY_CHANGE](a)},t.onenterstate=function(t,i,a,r,o){(0,d.logStateMachineTransition)("ENTER",t,i,a),n.onEnterStateTimestamp=null!=r?r:Date.now(),(0,u.isNumber)(e.starttime)&&t===s.JSM_INITIAL_EVENT&&(n.onEnterStateTimestamp=e.starttime),n.stateMachineCallbacks.setVideoTimeStartFromEvent(o)},t["onafter".concat(s.Event.MANUAL_SOURCE_CHANGE)]=function(e,t,i,a,r){n.stateMachineCallbacks.manualSourceChange(r)},t["onafter".concat(s.Event.ERROR)]=function(e,t,i,a,r){n.stateMachineCallbacks.error(r)},t)})},t}(c.AnalyticsStateMachine);t.THEOplayerAnalyticsStateMachine=E},5182:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,a=0,r=t.length;a<r;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.VideojsAnalyticsStateMachine=void 0;var o,s=n(2595),l=n(2361),u=n(3565),c=n(1916),d=n(1460),E=n(5063),p=n(7596),v=n(8253);!function(e){e.AD="AD",e.AUDIOTRACK_CHANGED_PLAYING="AUDIOTRACK_CHANGED_PLAYING",e.AUDIOTRACK_CHANGING="AUDIOTRACK_CHANGING",e.BUFFERING="BUFFERING",e.CASTING="CASTING",e.CUSTOMDATACHANGE="CUSTOMDATACHANGE",e.END="END",e.END_PLAY_SEEKING="END_PLAY_SEEKING",e.ERROR="ERROR",e.MUTING_PAUSE="MUTING_PAUSE",e.MUTING_PLAY="MUTING_PLAY",e.MUTING_READY="MUTING_READY",e.PAUSE="PAUSE",e.PAUSED_SEEKING="PAUSED_SEEKING",e.PLAY_SEEKING="PLAY_SEEKING",e.PLAYING="PLAYING",e.QUALITY_CHANGE="QUALITY_CHANGE",e.READY="READY",e.SETUP="SETUP",e.SOURCE_CHANGING="SOURCE_CHANGING",e.STARTUP="STARTUP",e.SUBTITLE_CHANGED_PLAYING="SUBTITLE_CHANGED_PLAYING",e.SUBTITLE_CHANGING="SUBTITLE_CHANGING",e.VIDEOSTART_FAILED="VIDEOSTART_FAILED"}(o||(o={}));var f=function(e){function t(t,n,i){var a=e.call(this,t,n,i)||this;return a.seekTimestamp=0,a.seekedTimestamp=0,a}return a(t,e),t.prototype.getAllStates=function(){return r(r([],Object.keys(o).map((function(e){return o[e]})),!0),["FINISH_PLAY_SEEKING","PLAY_SEEK"],!1)},t.prototype.getAllStatesBut=function(e){return this.getAllStates().filter((function(t){return t!==e}))},t.prototype.createStateMachine=function(e){var t,n=this;return s.create({initial:{state:o.SETUP,event:l.JSM_INITIAL_EVENT},error:v.customStateMachineErrorCallback,events:[{name:l.Event.SOURCE_LOADED,from:[o.SETUP,o.ERROR,o.SOURCE_CHANGING],to:o.READY},(0,v.on)(l.Event.TIMECHANGED).stayIn(o.SETUP),(0,v.on)(l.Event.SOURCE_LOADED).stayIn(o.READY),{name:l.Event.READY,from:[o.SETUP,o.ERROR],to:o.READY},{name:l.Event.PLAY,from:o.READY,to:o.STARTUP},{name:l.Event.ERROR,from:o.STARTUP,to:o.VIDEOSTART_FAILED},{name:l.Event.UNLOAD,from:o.STARTUP,to:o.VIDEOSTART_FAILED},{name:l.Event.VIDEOSTART_TIMEOUT,from:o.STARTUP,to:o.VIDEOSTART_FAILED},(0,v.on)(l.Event.START_BUFFERING).stayIn(o.STARTUP),(0,v.on)(l.Event.END_BUFFERING).stayIn(o.STARTUP),{name:l.Event.TIMECHANGED,from:o.STARTUP,to:o.PLAYING},(0,v.on)(l.Event.TIMECHANGED).stayIn(o.PLAYING),(0,v.on)(l.Event.END_BUFFERING).stayIn(o.PLAYING),{name:l.Event.START_BUFFERING,from:o.PLAYING,to:o.BUFFERING},(0,v.on)(l.Event.START_BUFFERING).stayIn(o.BUFFERING),{name:l.Event.TIMECHANGED,from:o.BUFFERING,to:o.PLAYING},(0,v.on)(l.Event.SEEK).stayIn(o.STARTUP),{name:l.Event.SEEK,from:o.PLAYING,to:o.PLAY_SEEKING},(0,v.on)(l.Event.TIMECHANGED).stayIn(o.PLAY_SEEKING),(0,v.on)(l.Event.TIMECHANGED).stayIn(o.PAUSED_SEEKING),{name:l.Event.PAUSE,from:o.PLAYING,to:o.PAUSE},{name:l.Event.PAUSE,from:o.BUFFERING,to:o.PAUSE},(0,v.on)(l.Event.TIMECHANGED).stayIn(o.PAUSE),{name:l.Event.PLAY,from:o.PAUSE,to:o.PLAYING},{name:l.Event.VIDEO_CHANGE,from:o.PLAYING,to:o.QUALITY_CHANGE},{name:l.Event.AUDIO_CHANGE,from:o.PLAYING,to:o.QUALITY_CHANGE},{name:l.Event.FINISH_QUALITY_CHANGE,from:o.QUALITY_CHANGE,to:o.PLAYING},{name:l.Event.SEEK,from:o.PAUSE,to:o.PAUSED_SEEKING},(0,v.on)(l.Event.SEEK).stayIn(o.PAUSED_SEEKING),(0,v.on)(l.Event.START_BUFFERING).stayIn(o.PAUSED_SEEKING),(0,v.on)(l.Event.END_BUFFERING).stayIn(o.PAUSED_SEEKING),{name:l.Event.SEEKED,from:o.PAUSED_SEEKING,to:o.PAUSE},{name:l.Event.PLAY,from:o.PAUSED_SEEKING,to:o.PLAYING},{name:l.Event.PAUSE,from:o.PAUSED_SEEKING,to:o.PAUSE},{name:"PLAY_SEEK",from:o.PAUSE,to:o.PLAY_SEEKING},{name:"PLAY_SEEK",from:o.PAUSED_SEEKING,to:o.PLAY_SEEKING},(0,v.on)("PLAY_SEEK").stayIn(o.PLAY_SEEKING),(0,v.on)(l.Event.SEEK).stayIn(o.PLAY_SEEKING),(0,v.on)(l.Event.START_BUFFERING).stayIn(o.PLAY_SEEKING),(0,v.on)(l.Event.END_BUFFERING).stayIn(o.PLAY_SEEKING),(0,v.on)(l.Event.SEEKED).stayIn(o.PLAY_SEEKING),{name:l.Event.SEEKED,from:o.PLAY_SEEKING,to:o.END_PLAY_SEEKING},(0,v.on)(l.Event.START_BUFFERING).stayIn(o.END_PLAY_SEEKING),(0,v.on)(l.Event.END_BUFFERING).stayIn(o.END_PLAY_SEEKING),(0,v.on)(l.Event.SEEKED).stayIn(o.END_PLAY_SEEKING),{name:l.Event.TIMECHANGED,from:o.END_PLAY_SEEKING,to:o.PLAYING},{name:l.Event.END,from:o.PLAY_SEEKING,to:o.END},{name:l.Event.END,from:o.PAUSED_SEEKING,to:o.END},{name:l.Event.END,from:o.PLAYING,to:o.END},{name:l.Event.END,from:o.PAUSE,to:o.END},(0,v.on)(l.Event.SEEK).stayIn(o.END),(0,v.on)(l.Event.SEEKED).stayIn(o.END),(0,v.on)(l.Event.TIMECHANGED).stayIn(o.END),(0,v.on)(l.Event.END_BUFFERING).stayIn(o.END),(0,v.on)(l.Event.START_BUFFERING).stayIn(o.END),(0,v.on)(l.Event.END).stayIn(o.END),(0,v.on)(l.Event.SEEKED).stayIn(o.PLAYING),{name:l.Event.PLAY,from:o.END,to:o.PLAYING},{name:l.Event.ERROR,from:this.getAllStatesBut(o.STARTUP),to:o.ERROR},{name:l.Event.PAUSE,from:o.ERROR,to:o.ERROR},{name:l.Event.SEEK,from:o.END_PLAY_SEEKING,to:o.PLAY_SEEKING},{name:"FINISH_PLAY_SEEKING",from:o.END_PLAY_SEEKING,to:o.PLAYING},{name:l.Event.UNLOAD,from:this.getAllStatesBut(o.STARTUP),to:o.END},{name:l.Event.START_AD,from:o.PLAYING,to:o.AD},{name:l.Event.END_AD,from:o.AD,to:o.PLAYING},(0,v.on)(l.Event.MUTE).stayIn(o.SETUP),{name:l.Event.MUTE,from:o.READY,to:o.MUTING_READY},{name:l.Event.UN_MUTE,from:o.READY,to:o.MUTING_READY},{name:"FINISH_MUTING",from:o.MUTING_READY,to:o.READY},{name:l.Event.MUTE,from:o.PLAYING,to:o.MUTING_PLAY},{name:l.Event.UN_MUTE,from:o.PLAYING,to:o.MUTING_PLAY},{name:"FINISH_MUTING",from:o.MUTING_PLAY,to:o.PLAYING},{name:l.Event.MUTE,from:o.PAUSE,to:o.MUTING_PAUSE},{name:l.Event.UN_MUTE,from:o.PAUSE,to:o.MUTING_PAUSE},{name:"FINISH_MUTING",from:o.MUTING_PAUSE,to:o.PAUSE},{name:l.Event.START_CAST,from:[o.READY,o.PAUSE],to:o.CASTING},(0,v.on)(l.Event.PAUSE).stayIn(o.CASTING),(0,v.on)(l.Event.PLAY).stayIn(o.CASTING),(0,v.on)(l.Event.TIMECHANGED).stayIn(o.CASTING),(0,v.on)(l.Event.MUTE).stayIn(o.CASTING),(0,v.on)(l.Event.SEEK).stayIn(o.CASTING),(0,v.on)(l.Event.SEEKED).stayIn(o.CASTING),{name:l.Event.END_CAST,from:o.CASTING,to:o.READY},(0,v.on)(l.Event.SEEK).stayIn(o.READY),(0,v.on)(l.Event.SEEKED).stayIn(o.READY),{name:l.Event.SEEKED,from:o.STARTUP,to:o.STARTUP},{name:l.Event.AUDIOTRACK_CHANGED,from:o.PLAYING,to:o.AUDIOTRACK_CHANGED_PLAYING},{name:"FINISH_AUDIOTRACK_CHANGING",from:o.AUDIOTRACK_CHANGED_PLAYING,to:o.PLAYING},(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.PAUSE),(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.READY),(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.BUFFERING),(0,v.on)(l.Event.AUDIOTRACK_CHANGED).stayIn(o.END_PLAY_SEEKING),{name:l.Event.AUDIOTRACK_CHANGED,from:o.AUDIOTRACK_CHANGING,to:o.AUDIOTRACK_CHANGING},{name:l.Event.SUBTITLE_CHANGE,from:o.PLAYING,to:o.SUBTITLE_CHANGED_PLAYING},{name:"FINISH_SUBTITLE_CHANGING",from:o.SUBTITLE_CHANGED_PLAYING,to:o.PLAYING},(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.PAUSE),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.READY),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.BUFFERING),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.END_PLAY_SEEKING),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.SOURCE_CHANGING),(0,v.on)(l.Event.SUBTITLE_CHANGE).stayIn(o.SUBTITLE_CHANGING),{name:l.Event.MANUAL_SOURCE_CHANGE,from:this.getAllStatesBut(o.READY),to:o.SOURCE_CHANGING},(0,v.on)(l.Event.MANUAL_SOURCE_CHANGE).stayIn(o.READY),(0,v.on)(l.Event.MANUAL_SOURCE_CHANGE).stayIn(o.SETUP),(0,v.on)(l.Event.TIMECHANGED).stayIn(o.SOURCE_CHANGING),{name:l.Event.PLAY,from:o.SOURCE_CHANGING,to:o.STARTUP},(0,v.on)(l.Event.SOURCE_LOADED).stayIn(o.STARTUP),{name:l.Event.CUSTOM_DATA_CHANGE,from:[o.PLAYING,o.PAUSE],to:o.CUSTOMDATACHANGE},{name:l.Event.PLAYING,from:o.CUSTOMDATACHANGE,to:o.PLAYING},{name:l.Event.PAUSE,from:o.CUSTOMDATACHANGE,to:o.PAUSE}],callbacks:(t={},t["onleave".concat(o.PLAYING)]=function(){n.playingHeartbeatService.stopHeartbeat()},t.onleavestate=function(e,t,i,a,r){if((0,v.logStateMachineTransition)("LEAVE",e,t,i),e!==l.JSM_INITIAL_EVENT&&(t===o.BUFFERING&&n.resetBufferingHelpers(),a)){var s=a-n.onEnterStateTimestamp;if(r&&i!==o.PAUSED_SEEKING&&i!==o.END_PLAY_SEEKING&&n.stateMachineCallbacks.setVideoTimeEndFromEvent(r),"PLAY_SEEK"===e&&t===o.PAUSE)return!0;t===o.READY&&i===o.STARTUP?n.setVideoStartTimeout():t!==o.STARTUP||i!==o.PLAYING&&i!==o.VIDEOSTART_FAILED||n.clearVideoStartTimeout();var d=String(t).toLowerCase();if(i===o.VIDEOSTART_FAILED)n.clearVideoStartTimeout(),n.stateMachineCallbacks.videoStartFailed(s,(0,u.createVideoStartFailedReason)(e));else if(t===o.PAUSED_SEEKING){var p=a-n.seekTimestamp;n.stateMachineCallbacks.seeking(p)}else if(t===o.END_PLAY_SEEKING){p=n.seekedTimestamp-n.seekTimestamp;n.stateMachineCallbacks.seeking(p)}else if(e===l.Event.UNLOAD)n.stateMachineCallbacks.unload(s,d);else if(t===o.PAUSE&&i!==o.PAUSED_SEEKING)n.stateMachineCallbacks.pause(s,d);else{var f=n.stateMachineCallbacks[d];if((0,E.isFunction)(f))try{f(s,d,r)}catch(e){c.logger.error("Exception occurred in State Machine callback "+d,r,e)}else(0,v.logMissingCallbackWarning)(t,[o.READY,o.SOURCE_CHANGING,o.MUTING_PAUSE,o.MUTING_PLAY,o.AUDIOTRACK_CHANGED_PLAYING,o.SUBTITLE_CHANGED_PLAYING])}r&&i!==o.PAUSED_SEEKING&&i!==o.PLAY_SEEKING&&i!==o.END_PLAY_SEEKING&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(r),e===l.Event.MUTE?n.stateMachineCallbacks.mute():e===l.Event.UN_MUTE?n.stateMachineCallbacks.unMute():e===l.Event.MANUAL_SOURCE_CHANGE&&n.stateMachineCallbacks.manualSourceChange(r)}},t["onenter".concat(o.PLAYING)]=function(){n.playingHeartbeatService.startHeartbeat()},t["onenter".concat(o.QUALITY_CHANGE)]=function(e,t,i,a,r){n.stateMachineCallbacks.qualitychange(r),n.stateMachine[l.Event.FINISH_QUALITY_CHANGE](a)},t.onenterstate=function(t,i,a,r,s){(0,v.logStateMachineTransition)("ENTER",t,i,a),n.onEnterStateTimestamp=null!=r?r:Date.now(),(0,d.isNumber)(e.starttime)&&t===l.JSM_INITIAL_EVENT&&(n.onEnterStateTimestamp=e.starttime),s&&a!==o.PAUSED_SEEKING&&a!==o.PLAY_SEEKING&&a!==o.END_PLAY_SEEKING&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(s),t===l.Event.SEEK&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(s),t===l.Event.SEEKED&&n.stateMachineCallbacks.setVideoTimeEndFromEvent(s),"PLAY_SEEK"===t&&a===o.PLAY_SEEKING&&a!==o.PLAY_SEEKING&&a!==o.END_PLAY_SEEKING&&(n.seekTimestamp=n.onEnterStateTimestamp),t===l.Event.START_CAST&&a===o.CASTING&&n.stateMachineCallbacks.startCasting(r,s),a===o.BUFFERING&&n.startBufferingHeartbeatInterval()},t["onafter".concat(l.Event.ERROR)]=function(e,t,i,a,r){n.stateMachineCallbacks.error(r)},t["onafter".concat(l.Event.SEEK)]=function(e,t,i,a,r){n.seekTimestamp=a},t["onafter".concat(l.Event.SEEKED)]=function(e,t,i,a,r){n.seekedTimestamp=a},t.onafterevent=function(e,t,i,a,r){i!==o.MUTING_READY&&i!==o.MUTING_PLAY&&i!==o.MUTING_PAUSE||n.stateMachine.FINISH_MUTING(a),i===o.AUDIOTRACK_CHANGED_PLAYING&&n.stateMachine.FINISH_AUDIOTRACK_CHANGING(a),i===o.SUBTITLE_CHANGED_PLAYING&&n.stateMachine.FINISH_SUBTITLE_CHANGING(a)},t)})},t}(p.AnalyticsStateMachine);t.VideojsAnalyticsStateMachine=f},2403:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,a=0,r=t.length;a<r;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Bitmovin8AnalyticsStateMachine=void 0;var o,s,l=n(2595),u=n(2361),c=n(3565),d=n(1652),E=n(1916),p=n(1460),v=n(5063),f=n(7596),h=n(8253);!function(e){e.AD_PAUSE="AD_PAUSE",e.AD_PLAYING="AD_PLAYING",e.AD_READY="AD_READY",e.AD_STARTUP="AD_STARTUP",e.AUDIOTRACK_CHANGING="AUDIOTRACK_CHANGING",e.BUFFERING="BUFFERING",e.CASTING="CASTING",e.CUSTOMDATACHANGE="CUSTOMDATACHANGE",e.END="END",e.END_PLAY_SEEKING="END_PLAY_SEEKING",e.ERROR="ERROR",e.INITIAL_SOURCE_CHANGE="INITIAL_SOURCE_CHANGE",e.MUTING_PAUSE="MUTING_PAUSE",e.MUTING_PLAY="MUTING_PLAY",e.MUTING_READY="MUTING_READY",e.PAUSE="PAUSE",e.PLAY_SEEKING="PLAY_SEEKING",e.PLAYING="PLAYING",e.QUALITY_CHANGE="QUALITY_CHANGE",e.READY="READY",e.SETUP="SETUP",e.SOURCE_CHANGING="SOURCE_CHANGING",e.STARTUP="STARTUP",e.STARTUP_AUTOPLAY="STARTUP_AUTOPLAY",e.SUBTITLE_CHANGING="SUBTITLE_CHANGING",e.VIDEOSTART_FAILED="VIDEOSTART_FAILED"}(o||(o={})),function(e){e.PAUSE_AFTER_SOURCE_LOADED="PAUSE_AFTER_SOURCE_LOADED",e.PAUSE_BEFORE_SOURCE_LOADED="PAUSE_BEFORE_SOURCE_LOADED"}(s||(s={}));var m=function(e){function t(t,n,i){var a=e.call(this,t,n,i)||this;return a.debuggingStates=[],a.enabledDebugging=!1,a.sourceLoadedDuringAutoplayStartup=!1,a}return a(t,e),t.prototype.getAllStatesBut=function(e){return this.getAllStates().filter((function(t){return e.indexOf(t)<0}))},t.prototype.getAllStates=function(){return Object.keys(o).map((function(e){return o[e]}))},t.prototype.createStateMachine=function(e){var t,n=this;return l.create({initial:{state:o.SETUP,event:u.JSM_INITIAL_EVENT},error:h.customStateMachineErrorCallback,events:r(r([{name:u.Event.SOURCE_LOADED,from:[o.SETUP,o.ERROR,o.SOURCE_CHANGING,o.INITIAL_SOURCE_CHANGE],to:o.READY},{name:u.Event.PLAY,from:o.READY,to:o.STARTUP},{name:u.Event.PLAYING,from:o.READY,to:o.PLAYING},(0,h.on)(u.Event.READY).stayIn(o.READY),{name:u.Event.ERROR,from:[o.STARTUP,o.AD_STARTUP,o.STARTUP_AUTOPLAY],to:o.VIDEOSTART_FAILED},{name:u.Event.UNLOAD,from:[o.STARTUP,o.AD_STARTUP,o.STARTUP_AUTOPLAY],to:o.VIDEOSTART_FAILED},{name:u.Event.VIDEOSTART_TIMEOUT,from:[o.STARTUP,o.STARTUP_AUTOPLAY],to:o.VIDEOSTART_FAILED},{name:u.Event.SOURCE_UNLOADED,from:[o.STARTUP,o.STARTUP_AUTOPLAY],to:o.VIDEOSTART_FAILED},{name:u.Event.MANUAL_SOURCE_CHANGE,from:[o.STARTUP,o.STARTUP_AUTOPLAY],to:o.VIDEOSTART_FAILED},{name:u.Event.TIMECHANGED,from:[o.STARTUP,o.STARTUP_AUTOPLAY],to:o.PLAYING},(0,h.on)(u.Event.PLAY).stayIn(o.STARTUP),(0,h.on)(u.Event.PLAYING).stayIn(o.STARTUP),(0,h.on)(u.Event.START_BUFFERING).stayIn(o.STARTUP),(0,h.on)(u.Event.END_BUFFERING).stayIn(o.STARTUP),(0,h.on)(u.Event.VIDEO_CHANGE).stayIn(o.STARTUP),(0,h.on)(u.Event.AUDIO_CHANGE).stayIn(o.STARTUP),(0,h.on)(u.Event.READY).stayIn(o.STARTUP),{name:u.Event.PAUSE,from:o.STARTUP,to:o.READY},{name:u.Event.LOADSTART_AUTOPLAY,from:[o.SETUP,o.SOURCE_CHANGING,o.INITIAL_SOURCE_CHANGE],to:o.STARTUP_AUTOPLAY},{name:s.PAUSE_BEFORE_SOURCE_LOADED,from:o.STARTUP_AUTOPLAY,to:o.INITIAL_SOURCE_CHANGE},{name:s.PAUSE_AFTER_SOURCE_LOADED,from:o.STARTUP_AUTOPLAY,to:o.READY}],(0,h.whileIn)(o.STARTUP_AUTOPLAY).passOver(u.Event.PAUSE,u.Event.SOURCE_LOADED),!0),[(0,h.on)(u.Event.PLAYING).stayIn(o.PLAYING),(0,h.on)(u.Event.TIMECHANGED).stayIn(o.PLAYING),(0,h.on)(u.Event.END_BUFFERING).stayIn(o.PLAYING),{name:u.Event.START_BUFFERING,from:o.PLAYING,to:o.BUFFERING},{name:u.Event.END_BUFFERING,from:o.BUFFERING,to:o.PLAYING},(0,h.on)(u.Event.TIMECHANGED).stayIn(o.BUFFERING),{name:u.Event.PAUSE,from:o.PLAYING,to:o.PAUSE},{name:u.Event.PAUSE,from:o.BUFFERING,to:o.PAUSE},{name:u.Event.PLAY,from:o.PAUSE,to:o.PLAYING},{name:u.Event.VIDEO_CHANGE,from:o.PLAYING,to:o.QUALITY_CHANGE},{name:u.Event.AUDIO_CHANGE,from:o.PLAYING,to:o.QUALITY_CHANGE},{name:u.Event.FINISH_QUALITY_CHANGE,from:o.QUALITY_CHANGE,to:o.PLAYING},{name:u.Event.SEEK,from:o.PLAYING,to:o.PLAY_SEEKING},{name:u.Event.PLAY,from:o.PLAY_SEEKING,to:o.END_PLAY_SEEKING},{name:u.Event.PLAYING,from:o.PLAY_SEEKING,to:o.END_PLAY_SEEKING},{name:u.Event.SEEKED,from:o.PLAY_SEEKING,to:o.END_PLAY_SEEKING},{name:u.Event.SEEK,from:o.END_PLAY_SEEKING,to:o.PLAY_SEEKING},{name:u.Event.PLAYING,from:o.END_PLAY_SEEKING,to:o.PLAYING},{name:u.Event.TIMECHANGED,from:o.END_PLAY_SEEKING,to:o.PLAYING},{name:u.Event.PAUSE,from:[o.PLAY_SEEKING,o.END_PLAY_SEEKING],to:o.PAUSE},(0,h.on)(u.Event.SEEK).stayIn(o.PLAY_SEEKING),(0,h.on)(u.Event.START_BUFFERING).stayIn(o.PLAY_SEEKING),(0,h.on)(u.Event.END_BUFFERING).stayIn(o.PLAY_SEEKING),(0,h.on)(u.Event.START_BUFFERING).stayIn(o.END_PLAY_SEEKING),(0,h.on)(u.Event.END_BUFFERING).stayIn(o.END_PLAY_SEEKING),(0,h.on)(u.Event.SEEKED).stayIn(o.END_PLAY_SEEKING),(0,h.on)(u.Event.PLAY).stayIn(o.END_PLAY_SEEKING),(0,h.on)(u.Event.SEEK).stayIn(o.PAUSE),(0,h.on)(u.Event.SEEKED).stayIn(o.PAUSE),(0,h.on)(u.Event.SEEKED).stayIn(o.PLAYING),{name:u.Event.END,from:o.PLAY_SEEKING,to:o.END},{name:u.Event.END,from:o.PLAYING,to:o.END},{name:u.Event.END,from:o.PAUSE,to:o.END},(0,h.on)(u.Event.SEEK).stayIn(o.END),(0,h.on)(u.Event.SEEKED).stayIn(o.END),(0,h.on)(u.Event.TIMECHANGED).stayIn(o.END),(0,h.on)(u.Event.END_BUFFERING).stayIn(o.END),(0,h.on)(u.Event.START_BUFFERING).stayIn(o.END),(0,h.on)(u.Event.END).stayIn(o.END),{name:u.Event.PLAY,from:o.END,to:o.STARTUP},{name:u.Event.ERROR,from:this.getAllStatesBut([o.STARTUP,o.STARTUP_AUTOPLAY]),to:o.ERROR},{name:u.Event.UNLOAD,from:this.getAllStatesBut([o.STARTUP,o.STARTUP_AUTOPLAY,o.AD_STARTUP]),to:o.END},{name:u.Event.SUBTITLE_CHANGE,from:o.PLAYING,to:o.SUBTITLE_CHANGING},(0,h.on)(u.Event.SUBTITLE_CHANGE).stayIn(o.PAUSE),(0,h.on)(u.Event.SUBTITLE_CHANGE).stayIn(o.BUFFERING),(0,h.on)(u.Event.SUBTITLE_CHANGE).stayIn(o.END_PLAY_SEEKING),(0,h.on)(u.Event.SUBTITLE_CHANGE).stayIn(o.SUBTITLE_CHANGING),{name:u.Event.TIMECHANGED,from:o.SUBTITLE_CHANGING,to:o.PLAYING},{name:u.Event.AUDIOTRACK_CHANGED,from:o.PLAYING,to:o.AUDIOTRACK_CHANGING},(0,h.on)(u.Event.AUDIOTRACK_CHANGED).stayIn(o.PAUSE),(0,h.on)(u.Event.AUDIOTRACK_CHANGED).stayIn(o.BUFFERING),(0,h.on)(u.Event.AUDIOTRACK_CHANGED).stayIn(o.END_PLAY_SEEKING),(0,h.on)(u.Event.AUDIOTRACK_CHANGED).stayIn(o.AUDIOTRACK_CHANGING),{name:u.Event.TIMECHANGED,from:o.AUDIOTRACK_CHANGING,to:o.PLAYING},{name:u.Event.START_AD,from:o.STARTUP,to:o.AD_STARTUP},{name:u.Event.END_AD,from:o.AD_STARTUP,to:o.STARTUP},(0,h.on)(u.Event.PLAY).stayIn(o.AD_STARTUP),(0,h.on)(u.Event.PAUSE).stayIn(o.AD_STARTUP),{name:u.Event.START_AD,from:o.READY,to:o.AD_READY},{name:u.Event.END_AD,from:o.AD_READY,to:o.STARTUP},(0,h.on)(u.Event.PLAY).stayIn(o.AD_READY),(0,h.on)(u.Event.PAUSE).stayIn(o.AD_READY),{name:u.Event.START_AD,from:o.PAUSE,to:o.AD_PAUSE},{name:u.Event.END_AD,from:o.AD_PAUSE,to:o.PAUSE},(0,h.on)(u.Event.PLAY).stayIn(o.AD_PAUSE),(0,h.on)(u.Event.PAUSE).stayIn(o.AD_PAUSE),{name:u.Event.START_AD,from:o.PLAYING,to:o.AD_PLAYING},{name:u.Event.END_AD,from:o.AD_PLAYING,to:o.PLAYING},(0,h.on)(u.Event.PLAY).stayIn(o.AD_PLAYING),(0,h.on)(u.Event.PAUSE).stayIn(o.AD_PLAYING),{name:u.Event.END,from:o.AD_PLAYING,to:o.END},(0,h.on)(u.Event.TIMECHANGED).stayIn(o.AD_STARTUP),(0,h.on)(u.Event.TIMECHANGED).stayIn(o.AD_READY),(0,h.on)(u.Event.TIMECHANGED).stayIn(o.AD_PAUSE),(0,h.on)(u.Event.TIMECHANGED).stayIn(o.AD_PLAYING),(0,h.on)(u.Event.END_AD).stayIn(o.PLAYING),(0,h.on)(u.Event.END_AD).stayIn(o.PAUSE),(0,h.on)(u.Event.END_AD).stayIn(o.READY),(0,h.on)(u.Event.END_AD).stayIn(o.STARTUP),{name:u.Event.MUTE,from:o.READY,to:o.MUTING_READY},{name:u.Event.UN_MUTE,from:o.READY,to:o.MUTING_READY},{name:"FINISH_MUTING",from:o.MUTING_READY,to:o.READY},{name:u.Event.MUTE,from:o.PLAYING,to:o.MUTING_PLAY},{name:u.Event.UN_MUTE,from:o.PLAYING,to:o.MUTING_PLAY},{name:"FINISH_MUTING",from:o.MUTING_PLAY,to:o.PLAYING},{name:u.Event.MUTE,from:o.PAUSE,to:o.MUTING_PAUSE},{name:u.Event.UN_MUTE,from:o.PAUSE,to:o.MUTING_PAUSE},{name:"FINISH_MUTING",from:o.MUTING_PAUSE,to:o.PAUSE},{name:u.Event.START_CAST,from:[o.READY,o.PAUSE,o.PLAYING],to:o.CASTING},(0,h.on)(u.Event.PAUSE).stayIn(o.CASTING),(0,h.on)(u.Event.PLAY).stayIn(o.CASTING),(0,h.on)(u.Event.PLAYING).stayIn(o.CASTING),(0,h.on)(u.Event.TIMECHANGED).stayIn(o.CASTING),(0,h.on)(u.Event.MUTE).stayIn(o.CASTING),(0,h.on)(u.Event.UN_MUTE).stayIn(o.CASTING),(0,h.on)(u.Event.SEEK).stayIn(o.CASTING),(0,h.on)(u.Event.SEEKED).stayIn(o.CASTING),{name:u.Event.END_CAST,from:o.CASTING,to:o.READY},(0,h.on)(u.Event.SEEK).stayIn(o.READY),(0,h.on)(u.Event.SEEKED).stayIn(o.READY),(0,h.on)(u.Event.SEEKED).stayIn(o.STARTUP),{name:u.Event.MANUAL_SOURCE_CHANGE,from:this.getAllStatesBut([o.SETUP,o.STARTUP,o.STARTUP_AUTOPLAY]),to:o.SOURCE_CHANGING},{name:u.Event.MANUAL_SOURCE_CHANGE,from:o.SETUP,to:o.INITIAL_SOURCE_CHANGE},{name:u.Event.SOURCE_UNLOADED,from:this.getAllStatesBut([o.STARTUP,o.STARTUP_AUTOPLAY]),to:o.SOURCE_CHANGING},{name:u.Event.CUSTOM_DATA_CHANGE,from:[o.PLAYING,o.PAUSE],to:o.CUSTOMDATACHANGE},{name:u.Event.PLAYING,from:o.CUSTOMDATACHANGE,to:o.PLAYING},{name:u.Event.PAUSE,from:o.CUSTOMDATACHANGE,to:o.PAUSE}],!1),callbacks:(t={},t["onbefore".concat(u.Event.SOURCE_LOADED)]=function(e,t,i,a,r){t===o.STARTUP_AUTOPLAY&&(n.sourceLoadedDuringAutoplayStartup=!0)},t["onbefore".concat(u.Event.SOURCE_UNLOADED)]=function(e,t,i,a,r){return!(t===o.STARTUP_AUTOPLAY&&!n.sourceLoadedDuringAutoplayStartup)},t["onbefore".concat(u.Event.PAUSE)]=function(e,t,i,a,r){return t!==o.STARTUP_AUTOPLAY||(n.sourceLoadedDuringAutoplayStartup?n.stateMachine[s.PAUSE_AFTER_SOURCE_LOADED](a,r):n.stateMachine[s.PAUSE_BEFORE_SOURCE_LOADED](a,r),!1)},t["onleave".concat(o.END_PLAY_SEEKING)]=function(e,t,i,a,r){var s;if(i!==o.PLAY_SEEKING){var l=a-(null!==(s=n.seekStartTimestamp)&&void 0!==s?s:a);n.seekStartTimestamp=void 0,n.stateMachineCallbacks.setVideoTimeEndFromEvent(r),n.stateMachineCallbacks.seeking(l)}},t["onleave".concat(o.PLAYING)]=function(){n.playingHeartbeatService.stopHeartbeat()},t["onleave".concat(o.STARTUP_AUTOPLAY)]=function(){n.sourceLoadedDuringAutoplayStartup=!1,n.clearVideoStartTimeout()},t["onleave".concat(o.PLAY_SEEKING)]=function(e,t,i,a,r){var s;if(i!==o.END_PLAY_SEEKING){var l=a-(null!==(s=n.seekStartTimestamp)&&void 0!==s?s:a);n.seekStartTimestamp=void 0,n.stateMachineCallbacks.seeking(l)}},t.onleavestate=function(e,t,i,a,r){if((0,h.logStateMachineTransition)("LEAVE",e,t,i),e!==u.JSM_INITIAL_EVENT&&(t===o.BUFFERING&&n.resetBufferingHelpers(),a)){n.addStatesToLog(e,t,i,a,r);var l=a-n.onEnterStateTimestamp;r&&i!==o.END_PLAY_SEEKING&&n.stateMachineCallbacks.setVideoTimeEndFromEvent(r),r&&e!==u.Event.END_AD&&(n.lastTrackedVideoEndObject=r),t!==o.READY&&t!==o.AD_STARTUP||i!==o.STARTUP?t!==o.STARTUP||i!==o.PLAYING&&i!==o.AD_STARTUP||n.clearVideoStartTimeout():n.setVideoStartTimeout();var d=String(t).toLowerCase();if(i===o.VIDEOSTART_FAILED)n.clearVideoStartTimeout(),n.stateMachineCallbacks.videoStartFailed(l,(0,c.createVideoStartFailedReason)(e));else if(t===o.END_PLAY_SEEKING)(0,v.noOp)();else if(e===u.Event.UNLOAD)n.stateMachineCallbacks.unload(l,d);else if(t===o.AD_PAUSE||t===o.AD_READY||t===o.AD_PLAYING||t===o.AD_STARTUP)(0,v.isNotNullish)(n.lastTrackedVideoEndObject)&&(n.stateMachineCallbacks.setVideoTimeStartFromEvent(n.lastTrackedVideoEndObject),n.stateMachineCallbacks.setVideoTimeEndFromEvent(n.lastTrackedVideoEndObject)),n.stateMachineCallbacks.ad(l,"ad");else if(e===u.Event.START_AD&&t===o.STARTUP)(0,v.noOp)();else if(e===u.Event.SOURCE_LOADED&&t===o.INITIAL_SOURCE_CHANGE)(0,v.noOp)();else if(t===o.SETUP)n.stateMachineCallbacks.setup(1,o.SETUP.toLowerCase());else if(e===u.Event.PAUSE&&t===o.STARTUP&&i===o.READY||e===s.PAUSE_BEFORE_SOURCE_LOADED&&t===o.STARTUP_AUTOPLAY&&i===o.INITIAL_SOURCE_CHANGE||e===s.PAUSE_AFTER_SOURCE_LOADED&&t===o.STARTUP_AUTOPLAY&&i===o.READY)n.clearVideoStartTimeout();else if(t===o.STARTUP_AUTOPLAY)n.stateMachineCallbacks.startup(l,o.STARTUP.toLowerCase());else if(t!==o.ERROR){var p=n.stateMachineCallbacks[d];if((0,v.isFunction)(p))try{p(l,d,r)}catch(e){E.logger.error("Exception occurred in State Machine callback "+d,r,e)}else(0,h.logMissingCallbackWarning)(t,[o.READY,o.SOURCE_CHANGING])}r&&i!==o.END_PLAY_SEEKING&&t!==o.PLAY_SEEKING&&i!==o.PLAY_SEEKING&&t!==o.AD_STARTUP&&t!==o.AD_READY&&t!==o.AD_PLAYING&&t!==o.AD_PAUSE&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(r),e===u.Event.MUTE?n.stateMachineCallbacks.mute():e===u.Event.UN_MUTE&&n.stateMachineCallbacks.unMute()}},t["onenter".concat(o.STARTUP_AUTOPLAY)]=function(){n.setVideoStartTimeout()},t["onenter".concat(o.PLAYING)]=function(){n.playingHeartbeatService.startHeartbeat()},t["onenter".concat(o.PLAY_SEEKING)]=function(e,t,i,a,r){t!==o.END_PLAY_SEEKING&&(n.seekStartTimestamp=a)},t["onenter".concat(o.QUALITY_CHANGE)]=function(e,t,i,a,r){n.stateMachineCallbacks.qualitychange(r),n.stateMachine[u.Event.FINISH_QUALITY_CHANGE](a)},t.onenterstate=function(t,i,a,r,s){(0,h.logStateMachineTransition)("ENTER",t,i,a),n.onEnterStateTimestamp=null!=r?r:Date.now(),(0,p.isNumber)(e.starttime)&&t===u.JSM_INITIAL_EVENT&&(n.onEnterStateTimestamp=e.starttime),!s||a===o.END_PLAY_SEEKING||i===o.PLAY_SEEKING||i===o.AD_STARTUP||i===o.AD_READY||i===o.AD_PLAYING||i===o.AD_PAUSE||t===u.Event.SEEK&&i===o.END_PLAY_SEEKING||n.stateMachineCallbacks.setVideoTimeStartFromEvent(s),t===u.Event.START_CAST&&a===o.CASTING&&n.stateMachineCallbacks.startCasting(r,s),a===o.BUFFERING&&n.startBufferingHeartbeatInterval()},t["onafter".concat(u.Event.ERROR)]=function(e,t,i,a,r){n.stateMachineCallbacks.error(r)},t["onafter".concat(u.Event.SOURCE_UNLOADED)]=function(e,t,i,a,r){n.sourceLoadedDuringAutoplayStartup=!1},t.onafterevent=function(e,t,i,a,r){e===u.Event.MANUAL_SOURCE_CHANGE&&t===o.SETUP?n.stateMachineCallbacks.initialSourceChange(r):e===u.Event.MANUAL_SOURCE_CHANGE&&n.stateMachineCallbacks.manualSourceChange(r),i!==o.MUTING_READY&&i!==o.MUTING_PLAY&&i!==o.MUTING_PAUSE||n.stateMachine.FINISH_MUTING(a)},t)})},t.prototype.getStates=function(){return this.debuggingStates},t.prototype.setEnabledDebugging=function(e){this.enabledDebugging=e},t.prototype.addStatesToLog=function(e,t,n,i,a){this.enabledDebugging&&this.debuggingStates.push(new d.EventDebugging(e,t,n,i,a))},t}(f.AnalyticsStateMachine);t.Bitmovin8AnalyticsStateMachine=m},8253:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logStateMachineTransition=t.logMissingCallbackWarning=t.customStateMachineErrorCallback=t.whileIn=t.on=void 0,t.getAllStates=s,t.getAllStatesBut=function(e,t){return s(t).filter((function(t){return e.indexOf(t)<0}))};var i=n(2595),a=n(1916),r=n(2974),o=n(5063);t.on=function(e){return{stayIn:function(t){return{name:e,from:t,to:t}}}};t.whileIn=function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.map((function(t){return{name:t,from:e,to:e}}))};return{runEventCallbacksFor:t,passOver:t}};t.customStateMachineErrorCallback=function(e,t,n,r,s,l,u){var c='StateMachine ignored event "'.concat(e,'", ').concat(l),d={eventName:e,from:t,to:n,args:(0,o.tryJSONStringify)(r),errorCode:s,errorMessage:l};s!==i.Error.INVALID_TRANSITION?a.logger.error(c,d):a.logger.log(c,d)};t.logMissingCallbackWarning=function(e,t){(void 0===t&&(t=[]),(0,o.isNullish)(e))||(0,o.isNullish)(t.find((function(t){return e===t})))&&a.logger.warn("Could not find StateMachine callback function for "+e)};function s(e){return(0,r.objectValues)(e)}t.logStateMachineTransition=function(e,t,n,i){"ENTER"===e?a.logger.log("[ENTER] ".concat((0,a.padRight)(i,20)," EVENT: ").concat((0,a.padRight)(t,20)," from ").concat((0,a.padRight)(n,20))):a.logger.log("[LEAVE] ".concat((0,a.padRight)(n,20)," EVENT: ").concat((0,a.padRight)(t,20)," to ").concat((0,a.padRight)(i,20)))}},5241:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeSessionMetadataAudioLanguage=function(e){if((0,i.isNullish)(e))return;return String(e).substring(0,50)},t.sanitizeSessionMetadataSubtitleEnabled=function(e){if((0,i.isNullish)(e))return;return(0,i.toBoolean)(e)},t.sanitizeSessionMetadataSubtitleLanguage=function(e){if((0,i.isNullish)(e))return;return String(e).substring(0,100)};var i=n(5063)},8917:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.AdAnalytics=void 0,t.buildInitialActiveAdBreakState=v,t.buildInitialActiveAdState=f;var a=n(5517),r=n(1916),o=n(1460),s=n(6481),l=n(5063),u=n(5063),c=n(2982),d=n(4926),E=n(3612),p=function(){function e(e,t){var n=this;this.onBeforeUnLoadEvent=!1,this.isPlaying=!1,this.adPodPosition=0,this.analytics=e,this.adapter=t,this.adapter.adCallbacks.onAdStarted=function(e){return n.onAdStarted(e)},this.adapter.adCallbacks.onAdFinished=function(e){return n.onAdFinished(e)},this.adapter.adCallbacks.onAdBreakStarted=function(e){return n.onAdBreakStarted(e)},this.adapter.adCallbacks.onAdBreakFinished=function(e){return n.onAdBreakFinished(e)},this.adapter.adCallbacks.onAdClicked=function(e){return n.onAdClicked(e)},this.adapter.adCallbacks.onAdError=function(e){return n.onAdError(e)},this.adapter.adCallbacks.onAdManifestLoaded=function(e){return n.onAdManifestLoaded(e)},this.adapter.adCallbacks.onPlay=function(){return n.onPlay()},this.adapter.adCallbacks.onPause=function(){return n.onPause()},this.adapter.adCallbacks.onBeforeUnload=function(){return n.onBeforeUnload()},this.adapter.adCallbacks.onAdSkipped=function(e){return n.onAdSkipped(e)},this.adapter.adCallbacks.onAdQuartile=function(e){return n.onAdQuartile(e)};var i=this.adapter.getContainer();(0,u.isNotNullish)(i)&&(this.viewportTracker=new E.ViewportTracker(i,(function(){return n.onIntersectionChanged()}),.5))}return e.prototype.release=function(){var e;this.clearCurrentTimeInterval(),null===(e=this.viewportTracker)||void 0===e||e.dispose(),this.adManifestDownloadTime=void 0},e.prototype.onIntersectionChanged=function(){this.activeAdState&&(this.isContainerInViewport()?this.enterViewportTimestamp=Date.now():this.enterViewportTimestamp&&(this.activeAdState.timeInViewport=(this.activeAdState.timeInViewport||0)+Date.now()-this.enterViewportTimestamp))},e.prototype.isContainerInViewport=function(){return!this.viewportTracker||this.viewportTracker.isInViewport()},e.prototype.onPlay=function(){if(this.adapter&&this.adapter.isLinearAdActive()&&this.activeAdState){var e=Date.now();this.beginPlayingTimestamp=e,this.enterViewportTimestamp=e,this.isPlaying=!0}},e.prototype.onPause=function(){this.adapter&&this.adapter.isLinearAdActive()&&this.activeAdState&&(this.updatePlayingTime(this.activeAdState),this.isPlaying=!1)},e.prototype.onAdManifestLoaded=function(e){e.isVmap?this.sendAnalyticsRequest(v(e.adBreakInfo)):this.adManifestDownloadTime=e.manifestDownloadTime},e.prototype.onAdBreakStarted=function(e){this.adPodPosition=0,this.activeAdBreakState=v(i(i({},e),{manifestDownloadTime:this.adManifestDownloadTime})),delete this.adManifestDownloadTime,this.adStartupTimestamp=Date.now()},e.prototype.onAdBreakFinished=function(e){this.resetActiveAd(),this.activeAdBreakState=void 0},e.prototype.onAdStarted=function(e){e.isLinear&&(this.resetActiveAd(),this.activeAdState=f(e),this.currentTime=void 0,this.activeAdState.adStartupTime=this.adStartupTimestamp?Date.now()-this.adStartupTimestamp:void 0,this.startAd(this.activeAdState))},e.prototype.onAdFinished=function(e){if(this.activeAdBreakState&&this.activeAdState){var t=i({},this.activeAdState);t.completed=1,this.resetActiveAd(),this.completeAd(this.activeAdBreakState,t,t.adDuration)}},e.prototype.onAdSkipped=function(e){if(this.activeAdBreakState&&this.activeAdState){var t=i({},this.activeAdState);t.skipped=1,t.skipPosition=this.currentTime,t.skipPercentage=l.calculatePercentage(t.skipPosition,this.activeAdState.adDuration),this.resetActiveAd(),this.completeAd(this.activeAdBreakState,t,t.skipPosition)}},e.prototype.onAdError=function(e){var t,n,i=v(e.adBreakInfo),a=this.analytics.transformError({code:e.code,message:e.message,severity:"CRITICAL"},e);i.errorCode=a.code,i.errorData=(0,u.tryJSONStringify)({code:e.code,message:e.message}),i.errorMessage=a.message,i.errorSeverity=a.severity,this.activeAdState&&e.activeAdId&&this.activeAdState.adId===e.activeAdId&&(t=this.activeAdState,n=this.currentTime,t.errorPosition=this.currentTime,t.errorPercentage=l.calculatePercentage(t.errorPosition,t.adDuration)),this.completeAd(i,t,n)},e.prototype.onAdClicked=function(e){this.activeAdState&&(this.activeAdState.adClickthroughUrl=e.clickThroughUrl,this.activeAdState.clicked=1,this.activeAdState.clickPosition=this.currentTime,this.activeAdState.clickPercentage=l.calculatePercentage(this.activeAdState.clickPosition,this.activeAdState.adDuration))},e.prototype.onAdQuartile=function(e){this.activeAdState&&(e.quartile===a.AdQuartile.FIRST_QUARTILE?this.activeAdState.quartile1=1:e.quartile===a.AdQuartile.MIDPOINT?this.activeAdState.midpoint=1:e.quartile===a.AdQuartile.THIRD_QUARTILE&&(this.activeAdState.quartile3=1))},e.prototype.onBeforeUnload=function(){if(!this.onBeforeUnLoadEvent&&(this.onBeforeUnLoadEvent=!0,this.activeAdState&&this.activeAdBreakState)){var e=i({},this.activeAdState);e.closed=1,e.closePosition=this.currentTime,e.closePercentage=l.calculatePercentage(e.closePosition,e.adDuration),this.resetActiveAd(),this.completeAd(this.activeAdBreakState,e,e.closePosition)}},e.prototype.sendAnalyticsRequest=function(e,t){var n=i(i(i({},(0,s.buildAdSample)(this.analytics.sample)),e),t||f()),a=this.adapter.getAdModuleInfo();n.platform="web",n.analyticsVersion=d.VERSION,n.adModule=a.name,n.adModuleVersion=a.version,n.autoplay=this.adapter.getAutoPlay(),n.pageLoadType=l.getPageLoadType(),n.time=Date.now(),n.adImpressionId=(0,c.generateUUID)(),n.percentageInViewport=l.calculatePercentage(n.timeInViewport,n.timePlayed),this.analytics.backend.sendAdRequest(n)},e.prototype.updatePlayingTime=function(e){var t=Date.now();this.beginPlayingTimestamp&&this.isPlaying&&(void 0!==e.timePlayed&&(e.timePlayed+=t-this.beginPlayingTimestamp),this.isContainerInViewport()&&this.enterViewportTimestamp&&void 0!==e.timeInViewport&&(e.timeInViewport+=t-this.enterViewportTimestamp))},e.prototype.startAd=function(t){var n=this;t.started=1,t.timePlayed=0,t.timeInViewport=0,t.adPodPosition=this.adPodPosition;var i=Date.now();this.beginPlayingTimestamp=i,this.enterViewportTimestamp=this.isContainerInViewport()?i:void 0,this.isPlaying=!0,this.currentTime=0,this.adPodPosition++,this.currentTimeInterval=setInterval((function(){try{null!=(null==t?void 0:t.adDuration)&&t.adDuration>0&&n.adapter.isLinearAdActive()&&(n.currentTime=l.calculateTime(Math.max(n.adapter.currentTime(),0)))}catch(e){r.logger.log("AdStarted monitoring interval failed and got cleared",e),n.resetActiveAd()}}),e.TIMEOUT_CURRENT_TIME_INTERVAL)},e.prototype.completeAd=function(e,t,n){void 0===t&&(t=f()),t.exitPosition=n,t.playPercentage=l.calculatePercentage(t.exitPosition,t.adDuration),(0,u.isNotNullish)(t.playPercentage)&&(0===t.quartile1&&t.playPercentage>=25&&(t.quartile1=1),0===t.midpoint&&t.playPercentage>=50&&(t.midpoint=1),0===t.quartile3&&t.playPercentage>=75&&(t.quartile3=1)),this.adStartupTimestamp=Date.now(),this.updatePlayingTime(t),this.isPlaying=!1,this.sendAnalyticsRequest(e,t)},e.prototype.resetActiveAd=function(){this.clearCurrentTimeInterval(),this.activeAdState=void 0},e.prototype.clearCurrentTimeInterval=function(){clearInterval(this.currentTimeInterval),delete this.currentTime},e.MODULE_NAME="ads",e.TIMEOUT_CURRENT_TIME_INTERVAL=100,e}();function v(e){var t,n={adFallbackIndex:0};if((0,u.isNullish)(e))return n;if(n.adIdPlayer=e.id,n.adReplaceContentDuration=l.calculateTimeWithUndefined(e.replaceContentDuration),n.adIsPersistent=e.persistent,n.adTagType=e.tagType,n.adTagUrl=e.tagUrl,n.adPreloadOffset=l.calculateTimeWithUndefined(e.preloadOffset),n.adFallbackIndex=null!==(t=e.fallbackIndex)&&void 0!==t?t:0,n.manifestDownloadTime=l.calculateTimeWithUndefined(e.manifestDownloadTime),"pre"===e.position||"post"===e.position?n.adPosition=e.position:(0,u.isNotNullish)(e.position)&&(n.adPosition="mid",n.adOffset=e.position),(0,u.isNotNullish)(n.adTagUrl))try{var i=new URL(n.adTagUrl);n.adTagServer=i.hostname,n.adTagPath=i.pathname}catch(e){}return(0,o.isFiniteNumber)(e.scheduleTime)&&(n.adScheduleTime=l.calculateTime(e.scheduleTime)),n}function f(e){var t,n={clicked:0,closed:0,completed:0,midpoint:0,quartile1:0,quartile3:0,skipped:0,started:0};if((0,u.isNullish)(e))return n;if(n.adClickthroughUrl=e.clickThroughUrl,n.adId=e.id,n.mediaUrl=e.mediaUrl,n.isLinear=e.isLinear,n.adPlaybackHeight=e.height,n.adPlaybackWidth=e.width,n.streamFormat=e.mimeType,(0,u.isNotNullish)(n.mediaUrl))try{var i=new URL(n.mediaUrl);n.mediaPath=i.pathname,n.mediaServer=i.hostname}catch(e){}(0,u.isNotNullish)(e.bitrate)&&(n.videoBitrate=1e3*e.bitrate);var a=e.vastData;return(0,u.isNotNullish)(a)&&(n.adSystem=a.adSystem,n.advertiserName=a.advertiserName,n.apiFramework=a.apiFramework,n.creativeAdId=a.creativeAdId,n.creativeId=a.creativeId,n.universalAdIdRegistry=a.universalAdIdRegistry,n.universalAdIdValue=a.universalAdIdValue,n.adDescription=a.adDescription,n.minSuggestedDuration=l.calculateTimeWithUndefined(a.minSuggestedDuration),n.surveyUrl=a.surveyUrl,n.adTitle=a.adTitle,n.wrapperAdsCount=a.wrapperAdsCount),(0,u.isNotNullish)(e.skippableAfter)&&(n.adSkipAfter=-1===e.skippableAfter?e.skippableAfter:l.calculateTime(e.skippableAfter)),n.adSkippable=null!==(t=e.skippable)&&void 0!==t?t:(0,u.isNotNullish)(n.adSkipAfter)?n.adSkipAfter>=0:void 0,n.adDuration=l.calculateTimeWithUndefined(e.duration),n}t.AdAnalytics=p},4350:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Analytics=void 0,t.setQualityInfoOnSample=U;var a=n(3588),r=n(3458),o=n(8525),s=n(3565),l=n(6845),u=n(5529),c=n(8331),d=n(404),E=n(5923),p=n(9422),v=n(1916),f=n(1460),h=n(6481),m=n(1820),A=n(5063),y=n(5063),T=n(2982),g=n(4926),S=n(8421),I=n(8917),N=n(3054),D=n(675),P=n(7721),_=n(2226),b=n(847),C=n(8918),R=n(7906),L=function(){function e(e,t,n,a,r,o,s){var l=this;this.adapter=t,this.backendFactory=n,this.sessionHandler=a,this.featureManager=r,this.onErrorDetailEventDispatcher=o,this.identicalErrorReportingLimiter=s,this.hasSentStartupSample=!1,this.droppedSampleFrames=0,this.playerStartupTime=0,this.authenticationCallback={authenticationCompleted:function(e,t){l.featureManager.configureFeatures(e,t)}},this.sourceChange=function(e){if(v.logger.log("Processing Source Change for Analytics",e),(0,y.isNullish)(e))l.adapter.sourceChange(l.config);else{(0,c.guardConfigChangeAgainstMissingTitle)(l.config,e),(0,c.guardConfigChangeAgainstMissingIsLive)(l.config,e),(0,c.guardAgainstDuplicatedUserId)(e);var t=(0,c.mergeAnalyticsConfig)(l.config,e);l.adapter.sourceChange(t)}},this.setCustomDataOnce=function(e){var t=i({},l.config);l.setState("customdatachange"),l.sendSample(e),l.config=i({},t),l.setConfigParameters(),l.setAutoDetectedDeviceInformation()},this.setCustomData=function(e){l.adapter.setCustomData(e)},this.getCurrentImpressionId=function(){return l.sample.impressionId},this.getUserId=function(){return l.sessionHandler.userId},this.changeCustomData=function(e){l.config=i(i({},l.config),(0,u.extractCustomDataFieldsOnly)(e)),l.setConfigParameters(),l.setAutoDetectedDeviceInformation()},this.config=e,this.sessionHandler=new b.SessionPersistenceHandler(this.config);var d=this;this.errorDetailTrackingSettingsProvider={get domain(){return(0,c.getDomainFromAnalyticsConfig)(d.config)},get licenseKey(){var e;return null!==(e=d.config.key)&&void 0!==e?e:""},get impressionId(){var e;return null!==(e=d.getCurrentImpressionId())&&void 0!==e?e:""},get collectorConfig(){return d.config.config}};var E=this.adapter.onLicenseKeyReceived.subscribe((function(e){l.config.key||(l.config.key=e.licenseKey),E()}));this.sample=this.buildInitialSample(),this.droppedSampleFrames=0,this.init(),this.setupStateMachineCallbacks();var p=this.adapter.initialize(this);this.featureManager.registerFeatures(p),this.adapter.adModule&&(this.adAnalytics=new I.AdAnalytics(this,this.adapter.adModule))}return Object.defineProperty(e.prototype,"version",{get:function(){return g.VERSION},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorDetailSubscribable",{get:function(){return this.onErrorDetailEventDispatcher},enumerable:!1,configurable:!0}),e.prototype.init=function(){if(!0===this.adapter.supportsDeferredLicenseLoading||(0,m.isValidString)(this.config.key)&&!(0,m.isBlank)(this.config.key)){v.logger.initialize(this.config.debug),this.featureManager.resetFeatures();var e=(0,c.getDomainFromAnalyticsConfig)(this.config);this.backend=this.backendFactory.createBackend(this.config,{key:this.config.key,domain:e,version:g.VERSION},this.adapter,this.authenticationCallback),this.hasSentStartupSample=!1,this.identicalErrorReportingLimiter.reset(),this.setConfigParameters(),this.setAutoDetectedDeviceInformation(),this.sample.impressionId=(0,T.generateUUID)(),this.sample.userId=this.sessionHandler.userId,this.adapter.videoCompletionTracker&&this.adapter.videoCompletionTracker.reset(),this.adapter.qualityChangeService.resetValues(),this.adapter.ssaiService.resetSourceRelatedState()}else v.logger.errorMessageToUser("Invalid analytics license key provided")},e.prototype.setConfigParameters=function(){var e;this.sample.key=this.config.key,this.sample.playerKey=this.config.playerKey,this.config.player&&(this.sample.player=this.config.player),this.sample.domain=(0,c.getDomainFromAnalyticsConfig)(this.config),this.sample.deviceInformation=(0,c.getDeviceInformationFromAnalyticsConfig)(this.config),this.sample.isLive=!!(0,y.isNotNullish)(this.config.isLive)&&this.config.isLive,this.sample.cdnProvider=this.config.cdnProvider,this.sample.videoId=this.config.videoId,this.sample.videoTitle=this.config.title,this.sample.customUserId=null!==(e=this.config.userId)&&void 0!==e?e:this.config.customUserId,A.transferCustomDataFields(this.config,this.sample),this.sample.experimentName=this.config.experimentName},e.prototype.setAutoDetectedDeviceInformation=function(){var e,t;if(!(0,y.isNotNullish)(null===(e=this.sample.deviceInformation)||void 0===e?void 0:e.model)&&(0,p.hasGlobalWebOSApi)()){var n=(0,S.getWebOSTVModelName)();(0,y.isNullish)(n)||(this.sample.deviceInformation=null!==(t=this.sample.deviceInformation)&&void 0!==t?t:{},this.sample.deviceInformation.model=n)}},e.prototype.setupStateMachineCallbacks=function(){var e=this;this.adapter.stateMachineCallbacks.setup=function(t,n){var i,a;v.logger.log("Setup bitmovin analytics "+e.sample.analyticsVersion+" with impressionId: "+e.sample.impressionId),e.setDuration(t),e.setState(n),e.sample.playerStartupTime=t,e.playerStartupTime=e.sample.playerStartupTime;var r=null===(a=null===(i=E.globalScope.performance)||void 0===i?void 0:i.timing)||void 0===a?void 0:a.navigationStart;if((0,y.isNotNullish)(r)&&(0,f.isFiniteNumber)(r)){var o=Math.round(Date.now()-E.globalScope.performance.timing.navigationStart);e.sample.pageLoadTime=o}e.sendSample()},this.adapter.stateMachineCallbacks.startup=function(t,n){e.setState(n),e.sample.supportedVideoCodecs=d.CodecHelper.supportedVideoFormats;var i=Math.max(t,1);e.setDuration(i),e.sample.videoStartupTime=i,e.sample.startupTime=(e.playerStartupTime||0)+i,e.sample.autoplay=e.adapter.getAutoPlay();var a=e.adapter.getDrmPerformanceInfo();(0,y.isNotNullish)(a)&&(e.sample.drmType=a.drmType,e.sample.drmLoadTime=a.drmLoadTime);var r=e.adapter.getCurrentPlaybackInfo(),o=r.videoBitrate,s=r.audioBitrate;e.adapter.qualityChangeService.setStartupHasFinished(o,s),e.hasSentStartupSample=!0,e.sendSample()},this.adapter.stateMachineCallbacks.programChange=function(t){e.playerStartupTime=0,e.config=(0,c.applySourceMetadataToAnalyticsConfig)(e.config,t),e.sample=e.buildInitialSample(),e.sample.path=(0,m.isValidString)(t.path)?t.path:(0,h.getDefaultSamplePath)(),e.init(),e.setState("programchange"),e.sample.isProgramChange=!0,e.sample.supportedVideoCodecs=d.CodecHelper.supportedVideoFormats;e.setDuration(1),e.sample.videoStartupTime=1,e.sample.startupTime=1,e.sample.autoplay=e.adapter.getAutoPlay(),e.sample.drmType=void 0,e.sample.drmLoadTime=void 0;var n=e.adapter.getCurrentPlaybackInfo(),i=n.videoBitrate,a=n.audioBitrate;e.adapter.qualityChangeService.setStartupHasFinished(i,a),e.hasSentStartupSample=!0,e.sendSample()},this.adapter.stateMachineCallbacks.updateSourceMetadata=function(t){e.config=(0,c.applySourceMetadataToAnalyticsConfig)(e.config,t),e.setConfigParameters(),e.setAutoDetectedDeviceInformation(),e.sample.path=(0,m.isValidString)(t.path)?t.path:(0,h.getDefaultSamplePath)()},this.adapter.stateMachineCallbacks.playing=function(t,n){e.setDuration(t),e.setState(n),e.sample.played=t,e.setCompletionValues(),e.sendSample()},this.adapter.stateMachineCallbacks.unload=function(t,n){var i=e.sample.videoTimeStart;"playing"===n&&(e.setDuration(t),e.setState(n),e.sample.played=t,e.setCompletionValues(),(0,f.isNumber)(e.sample.videoTimeEnd)&&(i=e.sample.videoTimeEnd),e.backend.sendUnloadRequest(e.sample),(0,h.clearSampleStateValues)(e.sample)),e.hasSentStartupSample&&(e.setVideoTimeStart(i),e.setVideoTimeEnd(i),e.setState("closed"),e.backend.sendUnloadRequest(e.sample),(0,h.clearSampleStateValues)(e.sample))},this.adapter.stateMachineCallbacks.heartbeat=function(t,n,a){e.setState(n),e.setDuration(t),e.sample=i(i({},e.sample),a),"playing"===n&&e.setCompletionValues(),e.sendSample()},this.adapter.stateMachineCallbacks.qualitychange=function(t){e.adapter.qualityChangeService.startResetInterval(),e.adapter.qualityChangeService.increaseCounter(),e.adapter.qualityChangeService.hasExceededQualityChangeThreshold()?e.adapter.stateMachineCallbacks.error({code:r.ErrorCode.QUALITY_CHANGE_THRESHOLD_EXCEEDED.code,message:r.ErrorCode.QUALITY_CHANGE_THRESHOLD_EXCEEDED.message,errorSeverity:r.ErrorCode.QUALITY_CHANGE_THRESHOLD_EXCEEDED.errorSeverity,legacyData:void 0,data:{},currentTime:t.currentTime}):(e.setState("qualitychange"),e.setDuration(0),e.adapter.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.adapter.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.adapter.stateMachineCallbacks.updateSampleQualityInfo(t),e.sendSample())},this.adapter.stateMachineCallbacks.updateSampleQualityInfo=function(t){"audio"===t.type?((0,f.isNumber)(t.bitrate)&&(e.sample.audioBitrate=t.bitrate),(0,m.isValidString)(t.codec)&&(e.sample.audioCodec=t.codec)):"video"===t.type&&((0,f.isNumber)(t.bitrate)&&(e.sample.videoBitrate=t.bitrate),(0,m.isValidString)(t.codec)&&(e.sample.videoCodec=t.codec),(0,f.isNumber)(t.height)&&(e.sample.videoPlaybackHeight=t.height),(0,f.isNumber)(t.width)&&(e.sample.videoPlaybackWidth=t.width))},this.adapter.stateMachineCallbacks.audiotrack_changing=function(){e.sendSample()},this.adapter.stateMachineCallbacks.pause=function(t,n){e.setDuration(t),e.setState(n),e.sample.paused=t,e.sendSample()},this.adapter.stateMachineCallbacks.seeking=function(t){e.setDuration(t),e.setState("seeking"),e.sample.seeked=t,e.sendSample()},this.adapter.stateMachineCallbacks.buffering=function(t,n){e.setDuration(t),e.setState(n),e.sample.buffered=t,e.sendSample()},this.adapter.stateMachineCallbacks.videoStartFailed=function(t,n){e.setState("startup"),e.sample.videoStartFailed=!0,e.sample.videoStartFailedReason=n,e.sample.duration=t,n!==s.VideoStartFailedReason.PLAYER_ERROR&&(n===s.VideoStartFailedReason.TIMEOUT&&(e.sample.errorCode=r.ErrorCode.VIDEO_STARTUP_TIMEOUT_REACHED.code,e.sample.errorMessage=r.ErrorCode.VIDEO_STARTUP_TIMEOUT_REACHED.message,e.sample.errorSeverity=r.ErrorCode.VIDEO_STARTUP_TIMEOUT_REACHED.errorSeverity,e.onErrorDetailEventDispatcher.dispatch({code:r.ErrorCode.VIDEO_STARTUP_TIMEOUT_REACHED.code,message:r.ErrorCode.VIDEO_STARTUP_TIMEOUT_REACHED.message,severity:r.ErrorCode.VIDEO_STARTUP_TIMEOUT_REACHED.errorSeverity})),e.sendSample())},this.adapter.stateMachineCallbacks.error=function(t){var n,i=e.transformError({code:t.code,message:t.message,severity:null!==(n=t.errorSeverity)&&void 0!==n?n:"CRITICAL"},t.originalError);!i.code||e.identicalErrorReportingLimiter.shouldReportError(i.code,i.severity)?(e.adapter.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.adapter.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.setState("error"),e.setDuration(0),e.sample.errorCode=i.code,e.sample.errorMessage=i.message,e.sample.errorSeverity=i.severity,e.sample.errorData=(0,y.tryJSONStringify)(t.legacyData),e.sample.errorSegments=e.adapter.getSegmentInfo().map((function(e){return e.name})),e.adapter.onError&&e.adapter.onError(),e.onErrorDetailEventDispatcher.dispatch({code:i.code,message:i.message,severity:i.severity,errorData:t.data}),e.sendSample()):v.logger.log("Bitmovin Analytics: Processing of the error with code ".concat(i.code," was ignored because the error limit was exceeded."))},this.adapter.stateMachineCallbacks.ad=function(t,n){e.setDuration(t),e.setState(n),e.sample.ad=a.AD_TYPE.CSAI,e.sendSample()},this.adapter.stateMachineCallbacks.mute=function(){e.sample.isMuted=!0},this.adapter.stateMachineCallbacks.unMute=function(){e.sample.isMuted=!1},this.adapter.stateMachineCallbacks.subtitle_changing=function(){e.sendSample()},this.adapter.stateMachineCallbacks.setVideoTimeEndFromEvent=function(t){(0,f.isNumber)(null==t?void 0:t.currentTime)&&e.setVideoTimeEnd(A.calculateTime(t.currentTime))},this.adapter.stateMachineCallbacks.setVideoTimeStartFromEvent=function(t){(0,f.isNumber)(null==t?void 0:t.currentTime)&&e.setVideoTimeStart(A.calculateTime(t.currentTime))},this.adapter.stateMachineCallbacks.manualSourceChange=function(t){e.adapter.resetSourceRelatedState(),e.sample=e.buildInitialSample(),e.droppedSampleFrames=0,e.playerStartupTime=0,e.config=Object.keys(t.config).length>0?t.config:e.config,e.init()},this.adapter.stateMachineCallbacks.initialSourceChange=function(t){e.config=t.config,e.setConfigParameters(),e.setAutoDetectedDeviceInformation()},this.adapter.stateMachineCallbacks.end=function(){e.sample=e.buildInitialSample(),e.droppedSampleFrames=0,e.playerStartupTime=0,e.init()},this.adapter.stateMachineCallbacks.release=function(){var t;e.backend=new _.NoOpBackend,null===(t=e.adAnalytics)||void 0===t||t.release(),e.adapter.qualityChangeService.stopResetInterval(),e.identicalErrorReportingLimiter.reset()},this.adapter.stateMachineCallbacks.customdatachange=function(t,n,i){(0,y.isNotNullish)(null==i?void 0:i.customDataValues)&&e.changeCustomData(i.customDataValues)}},e.prototype.setDuration=function(e){this.sample.duration=e},e.prototype.setState=function(e){this.sample.state=e},e.prototype.setPlaybackInfoFromAdapter=function(){var e=this.adapter.getCurrentPlaybackInfo();e&&(this.sample.isLive=(0,y.isNotNullish)(this.config.isLive)?this.config.isLive:e.isLive,(0,y.isNullish)(this.sample.isLive)&&(this.sample.isLive=!1),(0,m.isValidString)(e.size)&&(this.sample.size=e.size),(0,m.isValidString)(e.playerTech)&&(this.sample.playerTech=e.playerTech),(0,f.isNumber)(e.videoDuration)&&(this.sample.videoDuration=A.calculateTime(e.videoDuration||0)),(0,m.isValidString)(e.streamFormat)&&(this.sample.streamFormat=e.streamFormat),(0,m.isValidString)(e.mpdUrl)&&(this.sample.mpdUrl=e.mpdUrl),(0,m.isValidString)(e.m3u8Url)&&(this.sample.m3u8Url=e.m3u8Url),(0,m.isValidString)(e.progUrl)&&(this.sample.progUrl=e.progUrl),(0,f.isNumber)(e.videoWindowWidth)&&(this.sample.videoWindowWidth=e.videoWindowWidth),(0,f.isNumber)(e.videoWindowHeight)&&(this.sample.videoWindowHeight=e.videoWindowHeight),(0,f.isNumber)(e.screenHeight)&&(this.sample.screenHeight=e.screenHeight),(0,f.isNumber)(e.screenWidth)&&(this.sample.screenWidth=e.screenWidth),A.isBoolean(e.isMuted)&&(this.sample.isMuted=e.isMuted),A.isBoolean(e.isCasting)&&(this.sample.isCasting=e.isCasting),(0,m.isValidString)(e.castTech)&&(this.sample.castTech=e.castTech),(0,m.isValidString)(e.videoTitle)&&!this.config.title&&(this.sample.videoTitle=e.videoTitle),(0,m.isValidString)(e.audioCodec)&&(this.sample.audioCodec=e.audioCodec),(0,m.isValidString)(e.videoCodec)&&(this.sample.videoCodec=e.videoCodec),(0,m.isValidString)(e.audioLanguage)&&(this.sample.audioLanguage=e.audioLanguage),A.isBoolean(e.subtitleEnabled)&&(this.sample.subtitleEnabled=e.subtitleEnabled),(0,m.isValidString)(e.subtitleLanguage)?this.sample.subtitleLanguage=e.subtitleLanguage:this.sample.subtitleLanguage=void 0,(0,f.isNumber)(e.droppedFrames)&&(this.sample.droppedFrames=Math.max(e.droppedFrames-this.droppedSampleFrames,0),this.droppedSampleFrames=e.droppedFrames))},e.prototype.sendSample=function(e){if(this.setPlaybackInfoFromAdapter(),this.sample.time=A.getCurrentTimestamp(),this.sample.downloadSpeedInfo=this.adapter.getDownloadSpeedInfo(),this.adapter.resetDownloadSpeedInfoMeasures(),this.adapter.ssaiService.manipulate(this.sample),null!=e&&this.changeCustomData(e),(0,y.isNullish)(this.sample.videoBitrate)||this.sample.videoBitrate<=0){U(this.sample,this.adapter.getCurrentPlaybackInfo());var t=i({},this.sample);this.backend.sendRequest(t)}else{t=i({},this.sample);this.backend.sendRequest(t),U(this.sample,this.adapter.getCurrentPlaybackInfo())}(0,h.clearSampleStateValues)(this.sample)},e.prototype.sendSsaiEngagementAdSample=function(e){var t;if(!0===(null===(t=this.config.config)||void 0===t?void 0:t.ssaiEngagementTrackingEnabled))if((0,C.isSsaiEngagementStartedData)(e)){var n=(0,R.createStartedAdSample)(this.sample,e);this.backend.sendAdRequest(n)}else if((0,C.isSsaiEngagementQuartileData)(e)){n=(0,R.createQuartileAdSample)(this.sample,e);this.backend.sendAdRequest(n)}else if((0,C.isSsaiEngagementErrorData)(e)){e.analyticsError=this.transformError(e.analyticsError,e.originalError);var i=(0,R.createErrorAdSample)(this.sample,e);this.backend.sendAdRequest(i)}else;},e.prototype.setCompletionValues=function(){if(this.adapter.videoCompletionTracker){var e=this.adapter.videoCompletionTracker.addWatched({start:this.sample.videoTimeStart,end:this.sample.videoTimeEnd}),t=this.adapter.videoCompletionTracker.getCompletionPercentage();Number.isNaN(e)||Number.isNaN(t)||(this.sample.completed=e,this.sample.completedTotal=t)}},e.prototype.setVideoTimeStart=function(e){this.sample.videoTimeStart=e},e.prototype.setVideoTimeEnd=function(e){this.sample.videoTimeEnd=e},e.prototype.transformError=function(e,t){var n,i,a={code:e.code,message:e.message,severity:e.severity};try{var r=null===(i=null===(n=this.config.config)||void 0===n?void 0:n.errorTransformerCallback)||void 0===i?void 0:i.transform(a,{originalError:t});a.code=(0,f.isNumber)(null==r?void 0:r.code)?null==r?void 0:r.code:a.code,a.message=(0,m.isValidString)(null==r?void 0:r.message)?null==r?void 0:r.message:a.message,a.severity=(0,m.isValidString)(null==r?void 0:r.severity)&&(0,y.isErrorSeverity)(null==r?void 0:r.severity)?r.severity:a.severity}catch(e){v.logger.error("Error in errorTransformerCallback",e)}return a},e.prototype.buildInitialSample=function(){var e,t=this.config.player||this.adapter.getPlayerName(),n=(0,p.getGlobalScreenDimensions)();return{ad:0,analyticsVersion:g.VERSION,audioBitrate:0,buffered:0,completedTotal:0,droppedFrames:0,duration:0,isLive:null!==(e=this.config.isLive)&&void 0!==e&&e,language:(0,p.getGlobalNavigatorLanguage)(),pageLoadTime:0,pageLoadType:A.getPageLoadType(),path:(0,h.getDefaultSamplePath)(),paused:0,platform:"web",played:0,player:t,playerStartupTime:0,playerTech:this.adapter.getPlayerTech(),screenHeight:null==n?void 0:n.height,screenWidth:null==n?void 0:n.width,seeked:0,size:o.PlayerSize.Window,startupTime:0,time:0,userAgent:(0,p.getGlobalNavigatorUserAgent)(),version:t+"-"+this.adapter.getPlayerVersion(),videoBitrate:0,videoDuration:0,videoPlaybackHeight:0,videoPlaybackWidth:0,videoStartupTime:0,videoTimeEnd:0,videoTimeStart:0,videoWindowHeight:0,videoWindowWidth:0}},e.create=function(t,n){return new e(t,n,new N.BackendFactory,new b.SessionPersistenceHandler(t),new l.FeatureManager,new D.EventDispatcher,new P.IdenticalErrorReportingLimiter)},e.version=g.VERSION,e}();function U(e,t){(0,f.isNumber)(t.videoPlaybackHeight)&&(e.videoPlaybackHeight=t.videoPlaybackHeight),(0,f.isNumber)(t.videoPlaybackWidth)&&(e.videoPlaybackWidth=t.videoPlaybackWidth),(0,f.isNumber)(t.videoBitrate)&&(e.videoBitrate=t.videoBitrate),(0,f.isNumber)(t.audioBitrate)&&(e.audioBitrate=t.audioBitrate)}t.Analytics=L},3054:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BackendFactory=void 0;var i=n(5253),a=n(4649),r=n(7540),o=n(3489),s=n(399),l=n(2226),u=n(7390),c=function(){function e(){}return e.prototype.createBackend=function(e,t,n,i){if(!this.isEnabled(e))return new l.NoOpBackend;var a=this.createInnerBackend(e,t,n,i);return this.decorateWithDebuggingBackend(e,a)},e.prototype.decorateWithDebuggingBackend=function(e,t){return e.debug?new r.DebuggingBackend(e,t):t},e.prototype.decorateWithBackendFromConfigIfAvailable=function(e,t){return void 0!==e&&void 0!==e.config&&void 0!==e.config.wrapBackend?e.config.wrapBackend(t):t},e.prototype.isEnabled=function(e){return void 0===e.config||!1!==e.config.enabled},e.prototype.createInnerBackend=function(e,t,n,r){var l=e.config&&e.config.backendUrl||a.ANALYTICS_BACKEND_BASE_URL,c=new o.LicenseCheckingBackend(t,i.LicenseCall,l,n,r);c=this.decorateWithBackendFromConfigIfAvailable(e,c);var d=new u.SequenceNumberBackend(c);return new s.LongPlaytimeFilteringBackend(d)},e}();t.BackendFactory=c},7540:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggingBackend=void 0;var i=n(1916),a=function(){function e(e,t){this.underlying=t,e.debug&&e.debug.fields&&(this.debugFields=e.debug.fields)}return e.prototype.sendRequest=function(e){this.printFields(e),this.underlying.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){this.printFields(e),this.underlying.sendUnloadRequest(e)},e.prototype.sendAdRequest=function(e){this.underlying.sendAdRequest(e)},e.prototype.printFields=function(e){if(this.debugFields&&this.debugFields.length){var t={};this.debugFields.forEach((function(n){return t[n]=e[n]})),i.logger.table([t])}},e}();t.DebuggingBackend=a},9664:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DownloadSpeedMeter=void 0;var i=n(5766),a=n(3786),r=function(){function e(){this.measures=[]}return e.prototype.reset=function(){this.measures=[]},e.prototype.addMeasurement=function(e){if(!(e.httpStatus>=400)){var t=new a.Measure(e),n=i.Converter.bitsToBytes(3e8);t.speed>=n||this.measures.push(t)}},e.prototype.getInfo=function(){return{segmentsDownloadCount:this.measures.length,segmentsDownloadSize:this.measures.map((function(e){return e.size})).reduce(this.add,0),segmentsDownloadTime:Math.ceil(1e3*this.totalTime()),avgDownloadSpeed:this.avgSpeed(),minDownloadSpeed:this.minSpeed(),maxDownloadSpeed:this.maxSpeed(),avgTimeToFirstByte:this.avgTimeToFirstByte()}},e.prototype.add=function(e,t){return e+t},e.prototype.avgSpeed=function(){if(0===this.measures.length)return 0;var e=this.speeds().reduce((function(e,t){return e+t}),0),t=this.measures.length;return this.bytePerSecondToBitPerSecond(e/t)},e.prototype.bytePerSecondToBitPerSecond=function(e){return i.Converter.bytesToBits(e)},e.prototype.minSpeed=function(){return 0===this.measures.length?0:this.bytePerSecondToBitPerSecond(Math.min.apply(Math,this.speeds()))},e.prototype.speeds=function(){return this.measures.map((function(e){return e.speed}))},e.prototype.maxSpeed=function(){return 0===this.measures.length?0:this.bytePerSecondToBitPerSecond(Math.max.apply(Math,this.speeds()))},e.prototype.totalTime=function(){return 0===this.measures.length?0:this.measures.reduce((function(e,t){return e+t.duration}),0)},e.prototype.avgTimeToFirstByte=function(){if(0===this.measures.length)return 0;var e=this.measures.reduce((function(e,t){return e+1e3*t.timeToFirstByte}),0)/this.measures.length;return Math.ceil(e)},e}();t.DownloadSpeedMeter=r},675:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventDispatcher=void 0;var n=function(){function e(){this.callbacks=[]}return e.prototype.subscribe=function(e){var t=this;return this.callbacks.push(e),function(){return t.unsubscribe(e)}},e.prototype.dispatch=function(e){this.callbacks.slice(0).forEach((function(t){t(e)}))},e.prototype.unsubscribe=function(e){var t=this.callbacks.indexOf(e);t>-1&&this.callbacks.splice(t,1)},Object.defineProperty(e.prototype,"subscriberCount",{get:function(){return this.callbacks.length},enumerable:!1,configurable:!0}),e}();t.EventDispatcher=n},2663:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeartbeatService=t.DEFAULT_HEARTBEAT_INTERVAL_MS=void 0,t.DEFAULT_HEARTBEAT_INTERVAL_MS=59700;var n=function(){function e(e){this.getPlayerCurrentTime=e}return e.prototype.setListener=function(e){this.listener=e},e.prototype.startHeartbeat=function(){var e=this;void 0!==this.heartbeatInterval&&this.clearHeartbeat(),this.heartbeatInterval=setInterval((function(){var t;null===(t=e.listener)||void 0===t||t.onHeartbeat(e.getPlayerCurrentTime())}),t.DEFAULT_HEARTBEAT_INTERVAL_MS)},e.prototype.stopHeartbeat=function(){this.clearHeartbeat()},e.prototype.clearHeartbeat=function(){clearTimeout(this.heartbeatInterval),this.heartbeatInterval=void 0},e}();t.HeartbeatService=n},7721:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdenticalErrorReportingLimiter=void 0;var n=function(){function e(){this._currentErrorCount=0}return e.prototype.shouldReportError=function(t,n){return t===this._lastErrorCode&&n===this._lastErrorSeverity?(this._currentErrorCount++,this._currentErrorCount<=e.MAX_IDENTICAL_ERROR_REPORTING):(this._lastErrorCode=t,this._lastErrorSeverity=n,this._currentErrorCount=1,!0)},e.prototype.reset=function(){this._lastErrorCode=void 0,this._lastErrorSeverity=void 0,this._currentErrorCount=0},e.MAX_IDENTICAL_ERROR_REPORTING=5,e}();t.IdenticalErrorReportingLimiter=n},3489:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.LicenseCheckingBackend=void 0;var a=n(4501),r=n(1916),o=n(4649),s=n(2226),l=n(1125),u=n(2364),c=function(){function e(e,t,n,a,r){var u=this;this.licenseCall=t,this.backendBaseUrl=n,this.adapter=a,this.authenticationCallback=r,this.licenseKeyReceived=function(e){clearTimeout(u.licenseLazyLoadingTimeoutHandle),u.unsubscribeFromAdapter(),u.info.key=e.licenseKey,u.promise=u.wrapLicenseCheckPromiseWithCallback(u.performLicenseCheck(),u.authenticationCallback)},this.licenseCallFailed=function(){clearTimeout(u.licenseLazyLoadingTimeoutHandle),u.unsubscribeFromAdapter(),u.backend=new s.NoOpBackend,u.authenticationCallback.authenticationCompleted(!1,void 0)},this.licenseLazyLoadingTimeout=function(){u.unsubscribeFromAdapter(),u.backend=new s.NoOpBackend,u.authenticationCallback.authenticationCompleted(!1,void 0)},this.info=i({},e),this.backend=new l.QueueBackend,this.licenseCall=t,void 0!==e.key&&""!==e.key?this.promise=this.wrapLicenseCheckPromiseWithCallback(this.performLicenseCheck(),this.authenticationCallback):!0===a.supportsDeferredLicenseLoading?(a.onLicenseKeyReceived.subscribe(this.licenseKeyReceived),a.onLicenseCallFailed.subscribe(this.licenseCallFailed),this.licenseLazyLoadingTimeoutHandle=setTimeout(this.licenseLazyLoadingTimeout,o.ANALYTICS_LICENSECALL_TIMEOUT)):(r.authenticationCompleted(!1,void 0),this.backend=new s.NoOpBackend)}return e.prototype.performLicenseCheck=function(){var e=this,t=this.info,n=t.key,i=t.domain,o=t.version;if(!n||""===n){var l={status:a.LicensingResult.Denied,message:"No license key provided"};return this.backend=new s.NoOpBackend,Promise.resolve(l)}return this.licenseCall(n,i,o,this.backendBaseUrl).then((function(t){if(t.status!==a.LicensingResult.Granted)throw new Error(t.message);var i=new u.RemoteBackend(e.backendBaseUrl,n);return e.backend.flushTo(i),e.backend=i,t})).catch((function(t){return"Ignoring Impression due to DNT Header being set"===t.message?r.logger.error("License Check for Bitmovin Analytics failed because of",t):r.logger.errorMessageToUser("License Check for Bitmovin Analytics failed because of",t),e.backend=new s.NoOpBackend,{status:a.LicensingResult.Denied,message:t.message}}))},e.prototype.sendRequest=function(e){this.backend.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){this.backend.sendUnloadRequest(e)},e.prototype.sendAdRequest=function(e){this.backend.sendAdRequest(e)},e.prototype.unsubscribeFromAdapter=function(){this.adapter.onLicenseKeyReceived.unsubscribe(this.licenseKeyReceived),this.adapter.onLicenseCallFailed.unsubscribe(this.licenseCallFailed)},e.prototype.wrapLicenseCheckPromiseWithCallback=function(e,t){return e.then((function(e){return t.authenticationCompleted(e.status===a.LicensingResult.Granted,e.features),e}))},e}();t.LicenseCheckingBackend=c},399:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LongPlaytimeFilteringBackend=void 0;var i=n(5063),a=function(){function e(e){this.nextBackend=e}return e.prototype.sendRequest=function(e){this.isPlayedAboveThreshold(e)||this.nextBackend.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){this.isPlayedAboveThreshold(e)||this.nextBackend.sendUnloadRequest(e)},e.prototype.sendAdRequest=function(e){this.nextBackend.sendAdRequest(e)},e.prototype.isPlayedAboveThreshold=function(e){return((0,i.isNullish)(e.played)?0:e.played)>=9e4},e}();t.LongPlaytimeFilteringBackend=a},3786:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Measure=void 0;var n=function(){function e(e){this.download=e}return Object.defineProperty(e.prototype,"speed",{get:function(){return this.download.size/this.download.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this.download.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.download.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeToFirstByte",{get:function(){return this.download.timeToFirstByte},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestamp",{get:function(){return this.download.timestamp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"httpStatus",{get:function(){return this.download.httpStatus},enumerable:!1,configurable:!0}),e}();t.Measure=n},2226:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoOpBackend=void 0;var n=function(){function e(){}return e.prototype.sendRequest=function(e){},e.prototype.sendUnloadRequest=function(e){},e.prototype.sendAdRequest=function(e){throw new Error("Method not implemented.")},e}();t.NoOpBackend=n},9796:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1460),a=n(4649),r=function(){function e(e){void 0===e&&(e=a.ANALYTICS_QUALITY_CHANGE_COUNT_THRESHOLD),this.qualityChangeCount=0,this.previousVideoBitrate=0,this.previousAudioBitrate=0,this.startupHasFinished=!1,this.QUALITY_CHANGE_COUNT_THRESHOLD=e}return e.prototype.resetValues=function(){this.qualityChangeCount=0,this.stopResetInterval(),this.previousVideoBitrate=0,this.previousAudioBitrate=0,this.startupHasFinished=!1},e.prototype.increaseCounter=function(){this.qualityChangeCount++},e.prototype.hasExceededQualityChangeThreshold=function(){return this.qualityChangeCount>this.QUALITY_CHANGE_COUNT_THRESHOLD},e.prototype.setStartupHasFinished=function(e,t){this.startupHasFinished=!0,(0,i.isFiniteNumber)(e)&&(this.previousVideoBitrate=e),(0,i.isFiniteNumber)(t)&&(this.previousAudioBitrate=t)},e.prototype.shouldAllowVideoQualityChange=function(e){return this.startupHasFinished&&(0,i.isFiniteNumber)(e)&&0!==this.previousVideoBitrate&&this.previousVideoBitrate!==e&&!this.hasExceededQualityChangeThreshold()},e.prototype.setVideoBitrate=function(e){this.startupHasFinished&&(this.previousVideoBitrate=e)},e.prototype.shouldAllowAudioQualityChange=function(e){return this.startupHasFinished&&(0,i.isFiniteNumber)(e)&&0!==this.previousAudioBitrate&&this.previousAudioBitrate!==e&&!this.hasExceededQualityChangeThreshold()},e.prototype.setAudioBitrate=function(e){this.startupHasFinished&&(this.previousAudioBitrate=e)},e.prototype.startResetInterval=function(){var e=this;void 0===this.qualityChangeCountResetIntervalId&&(this.qualityChangeCountResetIntervalId=setInterval((function(){e.qualityChangeCount=0}),a.ANALYTICS_QUALITY_CHANGE_COUNT_RESET_INTERVAL))},e.prototype.stopResetInterval=function(){void 0!==this.qualityChangeCountResetIntervalId&&(clearInterval(this.qualityChangeCountResetIntervalId),delete this.qualityChangeCountResetIntervalId)},e}();t.default=r},1125:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueueBackend=void 0;var n=function(){function e(){this.queue=[],this.unloadQueue=[],this.adQueue=[]}return e.prototype.sendRequest=function(e){this.queue.push(e)},e.prototype.sendUnloadRequest=function(e){this.unloadQueue.push(e)},e.prototype.sendAdRequest=function(e){this.adQueue.push(e)},e.prototype.flushTo=function(e){this.queue.forEach((function(t){e.sendRequest(t)})),this.unloadQueue.forEach((function(t){e.sendUnloadRequest(t)})),this.adQueue.forEach((function(t){e.sendAdRequest(t)}))},e}();t.QueueBackend=n},2364:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteBackend=void 0;var i=n(5426),a=function(){function e(e,t){this.analyticsCall=new i.AnalyticsCall(e),this.licenseKey=t}return e.prototype.sendRequest=function(e){e.key=this.licenseKey,this.analyticsCall.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){e.key=this.licenseKey,this.analyticsCall.sendUnloadRequest(e)},e.prototype.sendAdRequest=function(e){e.key=this.licenseKey,this.analyticsCall.sendAdRequest(e)},e}();t.RemoteBackend=a},6235:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentTracker=void 0;var n=function(){function e(){this.segments=[]}return e.prototype.reset=function(){this.segments=[]},e.prototype.addSegment=function(e){this.segments.push(e)},e.prototype.removeSegment=function(e){this.segments=this.segments.filter((function(t){return t.url!==e}))},e.prototype.getSegments=function(){return this.segments},e}();t.SegmentTracker=n},7390:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequenceNumberBackend=void 0;var i=n(4649),a=function(){function e(e){this.sequenceNumber=0,this.nextBackend=e}return e.prototype.sendRequest=function(e){this.updateSampleBeforeSending(e),this.isSequenceNumberAboveThreshold(e)||this.nextBackend.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){this.updateSampleBeforeSending(e),this.isSequenceNumberAboveThreshold(e)||this.nextBackend.sendUnloadRequest(e)},e.prototype.sendAdRequest=function(e){this.isSequenceNumberAboveThreshold(e)||this.nextBackend.sendAdRequest(e)},e.prototype.updateSampleBeforeSending=function(e){e.sequenceNumber=this.sequenceNumber++},e.prototype.isSequenceNumberAboveThreshold=function(e){var t;return(null!==(t=e.sequenceNumber)&&void 0!==t?t:0)>i.SEQUENCE_NUMBER_LIMIT},e}();t.SequenceNumberBackend=a},847:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateCookieMaxAgeValue=t.validateCookieDomainValue=t.SessionPersistenceHandler=t.COOKIE_DEFAULT_MAX_AGE=t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID=void 0;var i=n(3848),a=n(1460),r=n(1820),o=n(5063),s=n(2982);t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID="bitmovin_analytics_uuid",t.COOKIE_DEFAULT_MAX_AGE=31536e3;var l=function(e){var n=e.config;if(!1===(null==n?void 0:n.cookiesEnabled))return(0,i.deleteCookie)(t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID),void(this.userId=(0,s.generateUUID)());var a=(0,i.getCookie)(t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID);this.userId=(0,o.isNotNullish)(a)&&!(0,r.isBlank)(a)?a:(0,s.generateUUID)();var l=(0,t.validateCookieDomainValue)(null==n?void 0:n.cookiesDomain),u=(0,t.validateCookieMaxAgeValue)(null==n?void 0:n.cookiesMaxAge),c=Date.now(),d=new Date(c+1e3*u).toUTCString();(0,i.setCookie)(t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID,this.userId,{domain:l,expires:d,maxAge:u})};t.SessionPersistenceHandler=l;t.validateCookieDomainValue=function(e){if(!(0,o.isNullish)(e)&&(0,r.isValidString)(e)&&!(0,r.isBlank)(e))return encodeURIComponent(e)};t.validateCookieMaxAgeValue=function(e){return(0,o.isNullish)(e)?t.COOKIE_DEFAULT_MAX_AGE:(0,a.isNumber)(e)?e:t.COOKIE_DEFAULT_MAX_AGE}},4916:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceInfoFallbackService=void 0;var i=n(1820),a=n(5063),r=function(){function e(){}return e.prototype.reset=function(){this.streamFormat=void 0,this.audioCodec=void 0,this.videoCodec=void 0},e.prototype.setStreamFormat=function(e){this.streamFormat=e},e.prototype.applyStreamFormat=function(e){(0,i.isBlank)(this.streamFormat)||(e.streamFormat=this.streamFormat)},e.prototype.applyAndStoreCodecInfo=function(e,t){(0,a.isNotNullish)(null==t?void 0:t.audioCodec)&&(this.audioCodec=t.audioCodec),(0,a.isNotNullish)(null==t?void 0:t.videoCodec)&&(this.videoCodec=t.videoCodec),(0,i.isBlank)(this.audioCodec)||(e.audioCodec=this.audioCodec),(0,i.isBlank)(this.videoCodec)||(e.videoCodec=this.videoCodec)},e}();t.SourceInfoFallbackService=r},6743:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,a=n(5063);!function(e){e[e.None=0]="None",e[e.Overlapping=1]="Overlapping",e[e.FirstContainedInSecond=2]="FirstContainedInSecond",e[e.SecondContainedInFirst=3]="SecondContainedInFirst"}(i||(i={}));var r=function(){function e(){this.watched=[],this.videoDuration=null}return e.prototype.reset=function(){this.watched=[]},e.prototype.setVideoDuration=function(e){this.videoDuration=1e3*e},e.prototype.addWatched=function(e){if((0,a.isNullish)(this.videoDuration))throw new Error("no video duration set for completion tracker");this.watched.push(e);var t=this.mergeWatched(this.watched);return(this.getDuration(e)-t)/this.videoDuration},e.prototype.getCompletionPercentage=function(){if((0,a.isNullish)(this.videoDuration))throw new Error("no video duration set for completion tracker");for(var e=0,t=0,n=this.watched;t<n.length;t++){var i=n[t];e+=this.getDuration(i)}return e/this.videoDuration},e.prototype.mergeWatched=function(e){for(var t=0;t<e.length;t++)for(var n=e[t],a=t+1;a<e.length;a++){var r=e[a],o=0,s=this.getOverlappingType(n,r);if(s===i.Overlapping?(this.mergeAndReplace(n,t,r,a),o=this.getOverlappingTimespan(n,r)):s===i.FirstContainedInSecond?(this.watched.splice(t,1),o=this.getDuration(n)):s===i.SecondContainedInFirst&&(this.watched.splice(a,1),o=this.getDuration(r)),s!==i.None)return o+this.mergeWatched(this.watched)}return 0},e.prototype.getOverlappingType=function(e,t){return this.isMomentInTimespan(e.end,t)&&e.start<t.start||this.isMomentInTimespan(e.start,t)&&e.end>t.end?i.Overlapping:this.isMomentInTimespan(e.start,t)&&this.isMomentInTimespan(e.end,t)?i.FirstContainedInSecond:this.isMomentInTimespan(t.start,e)&&this.isMomentInTimespan(t.end,e)?i.SecondContainedInFirst:i.None},e.prototype.isMomentInTimespan=function(e,t){return e>=t.start&&e<t.end},e.prototype.mergeAndReplace=function(e,t,n,i){var a=e.end>n.end?e.end:n.end,r={start:e.start<n.start?e.start:n.start,end:a};this.watched.splice(t,1,r),this.watched.splice(i,1)},e.prototype.getOverlappingTimespan=function(e,t){return(e.end<t.end?e.end:t.end)-(e.start>=t.start?e.start:t.start)},e.prototype.getDuration=function(e){return Math.abs(e.end-e.start)},e}();t.default=r},4300:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.SsaiService=void 0;var a,r=n(3588),o=n(3458),s=n(5529),l=n(5063),u=n(2982),c=n(7906);!function(e){e[e.AD_BREAK_STARTED=0]="AD_BREAK_STARTED",e[e.ACTIVE=1]="ACTIVE",e[e.IDLE=2]="IDLE"}(a||(a={}));var d=function(){function e(){this.eventHandler=void 0,this.adIndex=-1,this.state=a.IDLE,this.isFirstSampleOfAd=!1,this.sentAdQuartiles=[],this.errorSent=!1}return e.prototype.activate=function(e){this.eventHandler=e},e.prototype.adBreakStart=function(e){E(this.eventHandler)&&this.state==a.IDLE&&(this.state=a.AD_BREAK_STARTED,this.currentAdMetadata=i({},e))},e.prototype.adStart=function(e){var t;if(E(this.eventHandler)&&this.state!=a.IDLE){var n=(new Date).getTime(),i=this.eventHandler.getPlayerCurrentTime();this.eventHandler.reportPlaybackInteraction(n,i),this.state=a.ACTIVE,this.isFirstSampleOfAd=!0,this.adIndex++,this.resetAdData(),this.currentAdMetadata={adPosition:null===(t=this.currentAdMetadata)||void 0===t?void 0:t.adPosition,adId:null==e?void 0:e.adId,adSystem:null==e?void 0:e.adSystem,customData:null==e?void 0:e.customData},this.currentAdImpressionId=(0,u.generateUUID)(),this.timestampOfAdStart=(0,c.getCurrentMonotonicTimestampInMs)(),this.eventHandler.reportEngagementInteraction({type:"started",adIndex:this.adIndex,currentAdImpressionId:this.currentAdImpressionId,currentAdMetadata:(0,l.isNotNullish)(this.currentAdMetadata)?this.currentAdMetadata:{}})}},e.prototype.adQuartileFinished=function(e,t){E(this.eventHandler)&&this.state==a.ACTIVE&&(this.sentAdQuartiles.includes(e)||(this.eventHandler.reportEngagementInteraction({type:"quartile",adIndex:this.adIndex,currentAdImpressionId:this.currentAdImpressionId,currentAdMetadata:(0,l.isNotNullish)(this.currentAdMetadata)?this.currentAdMetadata:{},quartile:e,quartileMetadata:t,timeSinceAdStartedInMs:(0,c.getMonotonicTimestampInMsSince)(this.timestampOfAdStart)}),this.sentAdQuartiles.push(e)))},e.prototype.adBreakEnd=function(){if(E(this.eventHandler)&&this.state!=a.IDLE){if(this.state==a.ACTIVE){var e=(new Date).getTime(),t=this.eventHandler.getPlayerCurrentTime();this.eventHandler.reportPlaybackInteraction(e,t)}this.resetAdBreakData()}},e.prototype.manipulate=function(e){var t,n,i,o;if(E(this.eventHandler)&&this.state==a.ACTIVE){e.ad=r.AD_TYPE.SSAI,e.adId=null===(t=this.currentAdMetadata)||void 0===t?void 0:t.adId,e.adSystem=null===(n=this.currentAdMetadata)||void 0===n?void 0:n.adSystem,e.adPosition=null===(i=this.currentAdMetadata)||void 0===i?void 0:i.adPosition,this.isFirstSampleOfAd&&(e.adIndex=this.adIndex,this.isFirstSampleOfAd=!1);var u=null===(o=this.currentAdMetadata)||void 0===o?void 0:o.customData;(0,l.isNotNullish)(u)&&s.customDataValuesKeys.forEach((function(t){u[t]&&(e[t]=u[t])})),e[c.SSAI_RELATED_SAMPLE_MARKER]=!0}},e.prototype.sendAdEngagementErrorSample=function(e,t){E(this.eventHandler)&&this.state===a.ACTIVE&&(this.errorSent||e.code!==o.ErrorCode.QUALITY_CHANGE_THRESHOLD_EXCEEDED.code&&(this.eventHandler.reportEngagementInteraction({type:"error",adIndex:this.adIndex,currentAdImpressionId:this.currentAdImpressionId,currentAdMetadata:(0,l.isNotNullish)(this.currentAdMetadata)?this.currentAdMetadata:{},analyticsError:e,originalError:t,timeSinceAdStartedInMs:(0,c.getMonotonicTimestampInMsSince)(this.timestampOfAdStart)}),this.errorSent=!0))},e.prototype.isInActiveState=function(){return this.state===a.ACTIVE},e.prototype.resetSourceRelatedState=function(){this.resetAdBreakData(),this.adIndex=-1},e.prototype.resetAdBreakData=function(){this.state=a.IDLE,this.isFirstSampleOfAd=!1,delete this.currentAdMetadata,this.resetAdData()},e.prototype.resetAdData=function(){var e,t,n;null===(e=this.currentAdMetadata)||void 0===e||delete e.customData,null===(t=this.currentAdMetadata)||void 0===t||delete t.adId,null===(n=this.currentAdMetadata)||void 0===n||delete n.adSystem,this.errorSent=!1,this.currentAdImpressionId=void 0,this.sentAdQuartiles=[],this.timestampOfAdStart=void 0},e}();function E(e){return(0,l.isNotNullish)(e)}t.SsaiService=d},6398:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAdPosition=s,t.hasValidSsaiAdBreakMetadataStructure=function(e){if((0,o.isNullish)(e))return!0;if(!(0,o.isPlainObject)(e))return a.logger.errorMessageToUser("Invalid SsaiAdBreakMetadata: not a plain object"),!1;var t=e;if((0,o.isNotNullish)(t.adPosition)&&!s(t.adPosition))return a.logger.errorMessageToUser("Invalid SsaiAdBreakMetadata: 'adPosition' property is not valid"),!1;return!0},t.simplySanitizeSsaiAdBreakMetadata=function(e){if((0,o.isNullish)(e))return;return{adPosition:e.adPosition}},t.hasValidSsaiAdMetadataStructure=function(e){if((0,o.isNullish)(e))return!0;if(!(0,o.isPlainObject)(e))return a.logger.errorMessageToUser("Invalid SsaiAdMetadata: not a plain object"),!1;var t=e;if((0,o.isNotNullish)(t.adId)&&!(0,r.isValidString)(t.adId))return a.logger.errorMessageToUser("Invalid SsaiAdMetadata: 'adId' property is not string"),!1;if((0,o.isNotNullish)(t.adSystem)&&!(0,r.isValidString)(t.adSystem))return a.logger.errorMessageToUser("Invalid SsaiAdMetadata: 'adSystem' property is not string"),!1;if((0,o.isNotNullish)(t.customData)&&!(0,o.isPlainObject)(t.customData))return a.logger.errorMessageToUser("Invalid SsaiAdMetadata: 'customData' property is not a plain object"),!1;return!0},t.simplySanitizeSsaiAdMetadata=function(e){if((0,o.isNullish)(e))return;var t=void 0;(0,o.isNotNullish)(e.customData)&&(t=(0,i.sanitizeCustomDataValues)(e.customData));return{adId:e.adId,adSystem:e.adSystem,customData:t}},t.isSsaiAdQuartile=l,t.hasValidSsaiAdQuartileStructure=function(e){if(!l(e))return a.logger.errorMessageToUser("Invalid SsaiAdQuartile"),!1;return!0},t.sanitizeSsaiAdQuartileMetadata=function(e){if((0,o.isNullish)(e))return{};if(!(0,o.isPlainObject)(e))return a.logger.errorMessageToUser("Invalid SsaiAdQuartileMetadata: not a plain object"),{};var t={failedBeaconUrl:e.failedBeaconUrl};(0,r.isValidString)(t.failedBeaconUrl)?t.failedBeaconUrl=t.failedBeaconUrl.substring(0,500):(a.logger.errorMessageToUser("Invalid SsaiAdQuartileMetadata: 'failedBeaconUrl' property is not string"),t.failedBeaconUrl=void 0);return t};var i=n(5529),a=n(1916),r=n(1820),o=n(5063);function s(e){return"preroll"===e||"midroll"===e||"postroll"===e}function l(e){return"first"===e||"midpoint"===e||"third"===e||"completed"===e}},8918:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSsaiEngagementErrorData=function(e){return"error"===e.type},t.isSsaiEngagementQuartileData=function(e){return"quartile"===e.type},t.isSsaiEngagementStartedData=function(e){return"started"===e.type}},7906:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.ROUTING_URL_PARAM_VALUE_SSAI=t.ROUTING_URL_PARAM=t.SSAI_RELATED_SAMPLE_MARKER=void 0,t.isSsaiRelatedSample=function(e){if(e[t.SSAI_RELATED_SAMPLE_MARKER])return delete e[t.SSAI_RELATED_SAMPLE_MARKER],!0;if(2===e.adType)return!0;return!1},t.appendSsaiRoutingParam=function(e){return"".concat(e,"?").concat(t.ROUTING_URL_PARAM,"=").concat(t.ROUTING_URL_PARAM_VALUE_SSAI)},t.createErrorAdSample=function(e,t){return s({playbackSample:e,currentAdImpressionId:t.currentAdImpressionId,adIndex:t.adIndex,currentAdMetadata:t.currentAdMetadata,quartile:void 0,quartileMetadata:void 0,errorCode:t.analyticsError.code,errorMessage:t.analyticsError.message,errorSeverity:t.analyticsError.severity,timeSinceAdStartedInMs:t.timeSinceAdStartedInMs})},t.createStartedAdSample=function(e,t){return s({playbackSample:e,currentAdImpressionId:t.currentAdImpressionId,adIndex:t.adIndex,currentAdMetadata:t.currentAdMetadata,quartile:"started",quartileMetadata:void 0,errorCode:void 0,errorMessage:void 0,errorSeverity:void 0,timeSinceAdStartedInMs:void 0})},t.createQuartileAdSample=function(e,t){return s({playbackSample:e,currentAdImpressionId:t.currentAdImpressionId,adIndex:t.adIndex,currentAdMetadata:t.currentAdMetadata,quartile:t.quartile,quartileMetadata:t.quartileMetadata,timeSinceAdStartedInMs:t.timeSinceAdStartedInMs,errorCode:void 0,errorMessage:void 0,errorSeverity:void 0})},t.getCurrentMonotonicTimestampInMs=l,t.getMonotonicTimestampInMsSince=function(e){if((0,o.isNullish)(e))return;return l()-e};var a=n(5529),r=n(9422),o=n(5063);function s(e){var t,n=e.playbackSample,r=e.currentAdImpressionId,s=e.adIndex,l=e.currentAdMetadata,u=e.quartile,c=e.quartileMetadata,d=e.errorCode,E=e.errorMessage,p=e.errorSeverity,v=e.timeSinceAdStartedInMs,f=i(i({},{audioBitrate:null==(t=n)?void 0:t.audioBitrate,analyticsVersion:null==t?void 0:t.analyticsVersion,adPlaybackHeight:null==t?void 0:t.videoPlaybackHeight,adPlaybackWidth:null==t?void 0:t.videoPlaybackWidth,cdnProvider:null==t?void 0:t.cdnProvider,customData1:null==t?void 0:t.customData1,customData2:null==t?void 0:t.customData2,customData3:null==t?void 0:t.customData3,customData4:null==t?void 0:t.customData4,customData5:null==t?void 0:t.customData5,customData6:null==t?void 0:t.customData6,customData7:null==t?void 0:t.customData7,customData8:null==t?void 0:t.customData8,customData9:null==t?void 0:t.customData9,customData10:null==t?void 0:t.customData10,customData11:null==t?void 0:t.customData11,customData12:null==t?void 0:t.customData12,customData13:null==t?void 0:t.customData13,customData14:null==t?void 0:t.customData14,customData15:null==t?void 0:t.customData15,customData16:null==t?void 0:t.customData16,customData17:null==t?void 0:t.customData17,customData18:null==t?void 0:t.customData18,customData19:null==t?void 0:t.customData19,customData20:null==t?void 0:t.customData20,customData21:null==t?void 0:t.customData21,customData22:null==t?void 0:t.customData22,customData23:null==t?void 0:t.customData23,customData24:null==t?void 0:t.customData24,customData25:null==t?void 0:t.customData25,customData26:null==t?void 0:t.customData26,customData27:null==t?void 0:t.customData27,customData28:null==t?void 0:t.customData28,customData29:null==t?void 0:t.customData29,customData30:null==t?void 0:t.customData30,customData31:null==t?void 0:t.customData31,customData32:null==t?void 0:t.customData32,customData33:null==t?void 0:t.customData33,customData34:null==t?void 0:t.customData34,customData35:null==t?void 0:t.customData35,customData36:null==t?void 0:t.customData36,customData37:null==t?void 0:t.customData37,customData38:null==t?void 0:t.customData38,customData39:null==t?void 0:t.customData39,customData40:null==t?void 0:t.customData40,customData41:null==t?void 0:t.customData41,customData42:null==t?void 0:t.customData42,customData43:null==t?void 0:t.customData43,customData44:null==t?void 0:t.customData44,customData45:null==t?void 0:t.customData45,customData46:null==t?void 0:t.customData46,customData47:null==t?void 0:t.customData47,customData48:null==t?void 0:t.customData48,customData49:null==t?void 0:t.customData49,customData50:null==t?void 0:t.customData50,customData51:null==t?void 0:t.customData51,customData52:null==t?void 0:t.customData52,customData53:null==t?void 0:t.customData53,customData54:null==t?void 0:t.customData54,customData55:null==t?void 0:t.customData55,customData56:null==t?void 0:t.customData56,customData57:null==t?void 0:t.customData57,customData58:null==t?void 0:t.customData58,customData59:null==t?void 0:t.customData59,customData60:null==t?void 0:t.customData60,customData61:null==t?void 0:t.customData61,customData62:null==t?void 0:t.customData62,customData63:null==t?void 0:t.customData63,customData64:null==t?void 0:t.customData64,customData65:null==t?void 0:t.customData65,customData66:null==t?void 0:t.customData66,customData67:null==t?void 0:t.customData67,customData68:null==t?void 0:t.customData68,customData69:null==t?void 0:t.customData69,customData70:null==t?void 0:t.customData70,customData71:null==t?void 0:t.customData71,customData72:null==t?void 0:t.customData72,customData73:null==t?void 0:t.customData73,customData74:null==t?void 0:t.customData74,customData75:null==t?void 0:t.customData75,customData76:null==t?void 0:t.customData76,customData77:null==t?void 0:t.customData77,customData78:null==t?void 0:t.customData78,customData79:null==t?void 0:t.customData79,customData80:null==t?void 0:t.customData80,customData81:null==t?void 0:t.customData81,customData82:null==t?void 0:t.customData82,customData83:null==t?void 0:t.customData83,customData84:null==t?void 0:t.customData84,customData85:null==t?void 0:t.customData85,customData86:null==t?void 0:t.customData86,customData87:null==t?void 0:t.customData87,customData88:null==t?void 0:t.customData88,customData89:null==t?void 0:t.customData89,customData90:null==t?void 0:t.customData90,customData91:null==t?void 0:t.customData91,customData92:null==t?void 0:t.customData92,customData93:null==t?void 0:t.customData93,customData94:null==t?void 0:t.customData94,customData95:null==t?void 0:t.customData95,customData96:null==t?void 0:t.customData96,customData97:null==t?void 0:t.customData97,customData98:null==t?void 0:t.customData98,customData99:null==t?void 0:t.customData99,customData100:null==t?void 0:t.customData100,customUserId:null==t?void 0:t.customUserId,domain:null==t?void 0:t.domain,experimentName:null==t?void 0:t.experimentName,key:null==t?void 0:t.key,language:null==t?void 0:t.language,path:null==t?void 0:t.path,platform:null==t?void 0:t.platform,player:null==t?void 0:t.player,playerKey:null==t?void 0:t.playerKey,playerTech:null==t?void 0:t.playerTech,size:null==t?void 0:t.size,screenHeight:null==t?void 0:t.screenHeight,screenWidth:null==t?void 0:t.screenWidth,streamFormat:null==t?void 0:t.streamFormat,userAgent:null==t?void 0:t.userAgent,userId:null==t?void 0:t.userId,version:null==t?void 0:t.version,videoBitrate:null==t?void 0:t.videoBitrate,videoId:null==t?void 0:t.videoId,videoImpressionId:null==t?void 0:t.impressionId,videoTitle:null==t?void 0:t.videoTitle,videoWindowHeight:null==t?void 0:t.videoWindowHeight,videoWindowWidth:null==t?void 0:t.videoWindowWidth}),{adId:null==l?void 0:l.adId,adImpressionId:r,adIndex:s,adPosition:null==l?void 0:l.adPosition,adSystem:null==l?void 0:l.adSystem,adType:2,errorCode:d,errorMessage:E,errorSeverity:p,time:Date.now(),timeSinceAdStartedInMs:v});switch(u){case"started":f.started=1;break;case"first":f.quartile1=1,f.quartile1FailedBeaconUrl=null==c?void 0:c.failedBeaconUrl;break;case"midpoint":f.midpoint=1,f.midpointFailedBeaconUrl=null==c?void 0:c.failedBeaconUrl;break;case"third":f.quartile3=1,f.quartile3FailedBeaconUrl=null==c?void 0:c.failedBeaconUrl;break;case"completed":f.completed=1,f.completedFailedBeaconUrl=null==c?void 0:c.failedBeaconUrl}var h=null==l?void 0:l.customData;return(0,o.isNotNullish)(h)&&a.customDataValuesKeys.forEach((function(e){h[e]&&(f[e]=h[e])})),f}function l(){var e=(0,r.getGlobalPerformanceNow)();return(0,o.isNullish)(e)?Date.now():Math.floor(e)}t.SSAI_RELATED_SAMPLE_MARKER="triggeredBySsai",t.ROUTING_URL_PARAM="routingParam",t.ROUTING_URL_PARAM_VALUE_SSAI="ssai"},3588:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AD_TYPE=void 0,function(e){e[e.NO_AD=0]="NO_AD",e[e.CSAI=1]="CSAI",e[e.SSAI=2]="SSAI"}(n||(t.AD_TYPE=n={}))},4355:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.CdnProvider=void 0,function(e){e.AKAMAI="akamai",e.BITGRAVITY="bitgravity",e.CHINACACHE="chinacache",e.CLOUDFLARE="cloudflare",e.CLOUDFRONT="cloudfront",e.FASTLY="fastly",e.MAXCDN="maxcdn"}(n||(t.CdnProvider=n={}))},5878:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.CastTech=void 0,function(e){e.AirPlay="AirPlay",e.GoogleCast="GoogleCast",e.WebSocket="WebSocket"}(n||(t.CastTech=n={}))},5626:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isVideoCodec=function(e){if(!e)return!1;return-1!==n.findIndex((function(t){return e.startsWith(t)}))},t.isAudioCodec=function(e){if(!e)return!1;return-1!==i.findIndex((function(t){return e.startsWith(t)}))};var n=["avc1","avc3","hvc1","av01","av1","hev1","vp9"],i=["mp4a","ec-3","ac-3","opus","audio/mp4"]},3458:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorCode=void 0;var n=function(){function e(e,t,n){void 0===n&&(n="CRITICAL"),this.code=e,this.message=t,this.errorSeverity=n}return e.BITMOVIN_PLAYER_LICENSING_ERROR=new e(1103,""),e.SETUP_MISSING_LICENSE_WHITELIST=new e(1105,""),e.QUALITY_CHANGE_THRESHOLD_EXCEEDED=new e(1e4,"ANALYTICS_QUALITY_CHANGE_THRESHOLD_EXCEEDED","INFO"),e.BUFFERING_TIMEOUT_REACHED=new e(10001,"ANALYTICS_BUFFERING_TIMEOUT_REACHED"),e.VIDEO_STARTUP_TIMEOUT_REACHED=new e(10002,"ANALYTICS_VIDEOSTART_TIMEOUT_REACHED"),e}();t.ErrorCode=n},2361:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Event=t.JSM_INITIAL_EVENT=void 0,t.JSM_INITIAL_EVENT="jsm-initial",function(e){e.AUDIO_CHANGE="audioChange",e.AUDIOTRACK_CHANGED="audioTrackChanged",e.CUSTOM_DATA_CHANGE="customDataChange",e.END="end",e.END_AD="adEnd",e.END_BUFFERING="endBuffering",e.END_CAST="endCasting",e.END_FULLSCREEN="endFullscreen",e.ERROR="playerError",e.FINISH_QUALITY_CHANGE="finishQualityChange",e.LOADSTART_AUTOPLAY="loadstartAutoplay",e.MANUAL_SOURCE_CHANGE="manualSourceChangeInitiated",e.MUTE="mute",e.PAUSE="pause",e.PLAY="play",e.PLAYING="playing",e.READY="ready",e.SCREEN_RESIZE="resize",e.SEEK="seek",e.SEEKED="seeked",e.SOURCE_LOADED="sourceLoaded",e.SOURCE_UNLOADED="sourceUnloaded",e.START_AD="adStart",e.START_BUFFERING="startBuffering",e.START_CAST="startCasting",e.START_FULLSCREEN="startFullscreen",e.SUBTITLE_CHANGE="subtitleChange",e.TIMECHANGED="timechanged",e.UN_MUTE="unMute",e.UNLOAD="unload",e.VIDEO_CHANGE="videoChange",e.VIDEOSTART_TIMEOUT="VIDEOSTART_TIMEOUT"}(n||(t.Event=n={}))},2168:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MIMETypes=void 0,t.getMIMETypeFromFileExtension=function(e){var n=e.split(/[?#]/)[0].toLowerCase();if((0,i.endsWith)(n,".m3u8"))return t.MIMETypes.HLS;if((0,i.endsWith)(n,".mp4")||(0,i.endsWith)(n,".m4v")||(0,i.endsWith)(n,".m4a"))return t.MIMETypes.MP4;if((0,i.endsWith)(n,".webm"))return t.MIMETypes.WEBM;if((0,i.endsWith)(n,".mpd"))return t.MIMETypes.DASH;return};var i=n(1820);t.MIMETypes={MP4:"video/mp4",WEBM:"video/webm",HLS:"application/x-mpegURL",DASH:"application/dash+xml"}},9946:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PAGE_LOAD_TYPE=void 0,function(e){e[e.FOREGROUND=1]="FOREGROUND",e[e.BACKGROUND=2]="BACKGROUND"}(n||(t.PAGE_LOAD_TYPE=n={}))},556:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Player=void 0,function(e){e.BITMOVIN="bitmovin",e.BITMOVIN_PWX="bitmovin-pwx",e.CHROMECAST_SHAKA="chromecast-shaka",e.HLSJS="hlsjs",e.HTML5="html5",e.JW="jw",e.RADIANT="radiant",e.SHAKA="shaka",e.THEOPLAYER="theoplayer",e.VIDEOJS="videojs"}(n||(t.Player=n={}))},8525:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PlayerSize=void 0,function(e){e.Fullscreen="FULLSCREEN",e.Window="WINDOW"}(n||(t.PlayerSize=n={}))},7224:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamTypes=void 0,t.getStreamTypesFromURL=function(e){if((0,r.isNullish)(e)||(0,a.isBlank)(e))return;var t=e.split(/[?#]/)[0].toLowerCase();if((0,a.endsWith)(t,".m3u8"))return i.hls;if((0,a.endsWith)(t,".mp4")||(0,a.endsWith)(t,".m4v")||(0,a.endsWith)(t,".m4a"))return i.prog;if((0,a.endsWith)(t,".webm"))return i.prog;if((0,a.endsWith)(t,".mpd"))return i.dash;return},t.getStreamTypeFromMIMEType=function(e){var t;return((t={})[o.MIMETypes.MP4]=i.prog,t[o.MIMETypes.WEBM]=i.prog,t[o.MIMETypes.HLS]=i.hls,t[o.MIMETypes.DASH]=i.dash,t)[e]};var i,a=n(1820),r=n(5063),o=n(2168);!function(e){e.dash="dash",e.hls="hls",e.prog="progressive"}(i||(t.StreamTypes=i={}))},3565:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VideoStartFailedReason=void 0,t.createVideoStartFailedReason=function(e){switch(e){case a.Event.ERROR:return i.PLAYER_ERROR;case a.Event.UNLOAD:case a.Event.MANUAL_SOURCE_CHANGE:case a.Event.SOURCE_UNLOADED:return i.PAGE_CLOSED;case a.Event.VIDEOSTART_TIMEOUT:return i.TIMEOUT;default:return i.UNKNOWN}};var i,a=n(2361);!function(e){e.PAGE_CLOSED="PAGE_CLOSED",e.PLAYER_ERROR="PLAYER_ERROR",e.TIMEOUT="TIMEOUT",e.UNKNOWN="UNKNOWN"}(i||(t.VideoStartFailedReason=i={}))},348:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Feature=void 0;var i=n(5063),a=function(){function e(){this._config=void 0,this._isEnabled=!0}return Object.defineProperty(e.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._isEnabled},enumerable:!1,configurable:!0}),e.prototype.disable=function(){this._isEnabled=!1,this.disabled()},e.prototype.configure=function(e,t){return(0,i.isNotNullish)(t)&&(this._config=this.extractConfig(t)),this.configured(e,this._config),this._config},e}();t.Feature=a},6845:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FeatureManager=void 0;var i=n(1916),a=function(){function e(){this.features=[]}return e.prototype.registerFeatures=function(e){this.features=e},e.prototype.unregisterFeatures=function(){this.features.forEach((function(e){return e.disable()})),this.features=[]},e.prototype.resetFeatures=function(){this.features.forEach((function(e){return e.reset()}))},e.prototype.configureFeatures=function(e,t){this.features=this.features.filter((function(n){var a=n.configure(e,t);return!(!e||!0!==(null==a?void 0:a.enabled))||(i.logger.log("Disabling feature ".concat(n.constructor.name," as it isn't enabled according to license callback.")),n.disable(),!1)})),this.features.forEach((function(e){return e.enabled()}))},e}();t.FeatureManager=a},7614:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)},a=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,a=0,r=t.length;a<r;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorDetailBackend=void 0;var r=n(92),o=n(4649),s=n(5063),l=function(){function e(e){var t;this._queue=[],this._enabled=!1,this.backendUrl=(0,s.joinUrls)(null!==(t=null==e?void 0:e.backendUrl)&&void 0!==t?t:o.ANALYTICS_BACKEND_BASE_URL,"/analytics/error")}return Object.defineProperty(e.prototype,"queue",{get:function(){return this._queue},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(e){this._enabled=e},enumerable:!1,configurable:!0}),e.copyErrorDetailTruncateStringsAndUrls=function(e,t,n){var a,r,o=this;return i(i({},e),{message:null===(a=e.message)||void 0===a?void 0:a.substr(0,t),data:this.copyErrorDataTruncateStrings(e.data,t),httpRequests:null===(r=e.httpRequests)||void 0===r?void 0:r.map((function(e){return o.copyHttpRequestTruncateUrls(e,n)}))})},e.copyHttpRequestTruncateUrls=function(e,t){var n,a;return i(i({},e),{url:null===(n=e.url)||void 0===n?void 0:n.substr(0,t),lastRedirectLocation:null===(a=e.lastRedirectLocation)||void 0===a?void 0:a.substr(0,t)})},e.copyErrorDataTruncateStrings=function(e,t){var n,a;return i(i({},e),{exceptionMessage:null===(n=e.exceptionMessage)||void 0===n?void 0:n.substr(0,t),additionalData:null===(a=e.additionalData)||void 0===a?void 0:a.substr(0,t)})},e.copyErrorDetailTruncateHttpRequests=function(e,t){var n;return i(i({},e),{httpRequests:null===(n=e.httpRequests)||void 0===n?void 0:n.slice(-t)})},e.prototype.limitHttpRequestsOfQueuedErrorDetails=function(t){var n=this;this._queue.forEach((function(i,a){n._queue[a]=e.copyErrorDetailTruncateHttpRequests(i,t)}))},e.prototype.send=function(t){var n=e.copyErrorDetailTruncateStringsAndUrls(t,e.MAX_STRING_LENGTH,e.MAX_URL_LENGTH);this.enabled?(0,r.post)(this.backendUrl,n):this._queue.push(n)},e.prototype.flush=function(){for(var e=a([],this._queue,!0),t=e.shift();(0,s.isNotNullish)(t);)this.removeFromQueue(t),this.send(t),t=e.shift()},e.prototype.clear=function(){this._queue.splice(0,this._queue.length)},e.prototype.removeFromQueue=function(e){var t=this._queue.findIndex((function(t){return t===e}));t>=0&&this._queue.splice(t,1)},e.MAX_URL_LENGTH=450,e.MAX_STRING_LENGTH=2e3,e}();t.ErrorDetailBackend=l},9557:function(e,t,n){"use strict";var i,a=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,a=0,r=t.length;a<r;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorDetailTracking=void 0;var o=n(1916),s=n(5063),l=n(4926),u=function(e){function t(t,n,i,a){var u=e.call(this)||this;return u.settingsProvider=t,u.backend=n,u.subscribables=i,u.httpRequestTracking=a,u.errorIndex=0,u.onErrorHandler=function(e){var t,n;try{if(!u.isEnabled)return;var i=null===(t=u.httpRequestTracking)||void 0===t?void 0:t.httpRequests,a=(0,s.isNullish)(i)?void 0:r([],i,!0),c=u.errorIndex;u.errorIndex++;var d={platform:"web",licenseKey:u.settingsProvider.licenseKey,domain:u.settingsProvider.domain,impressionId:u.settingsProvider.impressionId,analyticsVersion:l.VERSION,errorId:c,timestamp:(0,s.getCurrentTimestamp)(),code:e.code,message:e.message,data:null!==(n=e.errorData)&&void 0!==n?n:{additionalData:void 0,exceptionMessage:void 0,exceptionStacktrace:void 0},httpRequests:a,severity:e.severity};o.logger.log("ErrorDetailTracking.onError: ".concat((0,s.tryJSONStringify)(d))),u.backend.send(d)}catch(e){o.logger.error("ErrorDetailTracking.onError: Error in handler",e)}},i.forEach((function(e){return e.subscribe(u.onErrorHandler)})),u}return a(t,e),t.prototype.reset=function(){var e;null===(e=this.httpRequestTracking)||void 0===e||e.reset(),this.errorIndex=0},t.prototype.enabled=function(){this.backend.enabled=!0,this.backend.flush()},t.prototype.disabled=function(){var e,t=this;this.errorIndex=0,null===(e=this.httpRequestTracking)||void 0===e||e.disable(),this.backend.clear(),this.subscribables.forEach((function(e){return e.unsubscribe(t.onErrorHandler)}))},t.prototype.configured=function(e,t){var n,i,a=Math.max(null!==(n=null==t?void 0:t.numberOfHttpRequests)&&void 0!==n?n:0,0);null===(i=this.httpRequestTracking)||void 0===i||i.configure(a),this.backend.limitHttpRequestsOfQueuedErrorDetails(a)},t.prototype.extractConfig=function(e){return e.errorDetails},t}(n(348).Feature);t.ErrorDetailTracking=u},7881:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRequestTracking=void 0;var i=n(1916),a=n(3129),r=function(){function e(t){var n=this;this.subscribables=t,this._maxRequests=e.DEFAULT_MAX_REQUESTS,this._httpRequestQueue=new a.Queue,this.onDownloadFinishedHandler=function(e){try{n.addRequest(e.httpRequest)}catch(e){i.logger.error("HttpRequestTracking.onDownloadFinished: Error in handler",e)}},t.forEach((function(e){return e.subscribe(n.onDownloadFinishedHandler)}))}return Object.defineProperty(e.prototype,"maxRequests",{get:function(){return this._maxRequests},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"httpRequests",{get:function(){return this._httpRequestQueue.items},enumerable:!1,configurable:!0}),e.prototype.configure=function(e){this._maxRequests=e,this._httpRequestQueue.limit(e)},e.prototype.disable=function(){var e=this;this.subscribables.forEach((function(t){return t.unsubscribe(e.onDownloadFinishedHandler)})),this._httpRequestQueue.clear()},e.prototype.reset=function(){this._httpRequestQueue.clear()},e.prototype.addRequest=function(e){this._httpRequestQueue.offer(e),this._httpRequestQueue.limit(this._maxRequests)},e.DEFAULT_MAX_REQUESTS=10,e}();t.HttpRequestTracking=r},7912:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRequestType=void 0,function(e){e.MANIFEST_DASH="manifest/dash",e.MANIFEST_HLS_MASTER="manifest/hls/master",e.MANIFEST_HLS_VARIANT="manifest/hls/variant",e.MANIFEST_SMOOTH="manifest/smooth",e.MANIFEST_ADS="manifest/ads",e.MEDIA_AUDIO="media/audio",e.MEDIA_VIDEO="media/video",e.MEDIA_SUBTITLES="media/subtitles",e.MEDIA_THUMBNAILS="media/thumbnails",e.MEDIA_SEGMENTINDEX="media/segmentindex",e.DRM_LICENSE_WIDEVINE="drm/license/widevine",e.DRM_LICENSE_PLAYREADY="drm/license/playready",e.DRM_LICENSE_FAIRPLAY="drm/license/fairplay",e.DRM_LICENSE_PRIMETIME="drm/license/primetime",e.DRM_LICENSE_CLEARKEY="drm/license/clearkey",e.DRM_LICENSE_TVKEY="drm/license/tvkey",e.DRM_CERTIFICATE_FAIRPLAY="drm/certificate/fairplay",e.HLS_INTERSTITIALS_ASSET_LIST="hls/interstitials/asset-list",e.KEY_HLS_AES="key/hls/aes",e.TIME_SYNC="time/sync",e.WEBRTC_SDP_REQUEST="webrtc/sdp/request",e.WEBRTC_SDP_ANSWER="webrtc/sdp/answer",e.WEBRTC_SDP_OFFER="webrtc/sdp/offer",e.UNKNOWN="unknown",e.INTERNAL="internal"}(n||(t.HttpRequestType=n={}))},5529:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeCustomDataValues=t.extractCustomDataFieldsOnly=t.customDataFieldCount=t.customDataValuesKeys=void 0;var i=n(5063);t.customDataValuesKeys=["customData1","customData2","customData3","customData4","customData5","customData6","customData7","customData8","customData9","customData10","customData11","customData12","customData13","customData14","customData15","customData16","customData17","customData18","customData19","customData20","customData21","customData22","customData23","customData24","customData25","customData26","customData27","customData28","customData29","customData30","customData31","customData32","customData33","customData34","customData35","customData36","customData37","customData38","customData39","customData40","customData41","customData42","customData43","customData44","customData45","customData46","customData47","customData48","customData49","customData50","customData51","customData52","customData53","customData54","customData55","customData56","customData57","customData58","customData59","customData60","customData61","customData62","customData63","customData64","customData65","customData66","customData67","customData68","customData69","customData70","customData71","customData72","customData73","customData74","customData75","customData76","customData77","customData78","customData79","customData80","customData81","customData82","customData83","customData84","customData85","customData86","customData87","customData88","customData89","customData90","customData91","customData92","customData93","customData94","customData95","customData96","customData97","customData98","customData99","customData100","experimentName"],t.customDataFieldCount=t.customDataValuesKeys.filter((function(e){return e.match("customData\\d+")})).length;t.extractCustomDataFieldsOnly=function(e){var n={};return t.customDataValuesKeys.forEach((function(t){e[t]&&(n[t]=e[t])})),n};t.sanitizeCustomDataValues=function(e){var n=(0,t.extractCustomDataFieldsOnly)(e),a={};return(0,i.transferCustomDataFields)(n,a),a.experimentName=(0,i.getCustomDataString)(n.experimentName),a}},4501:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LicensingResult=void 0,function(e){e.Denied="denied",e.Granted="granted",e.Skip="skip"}(n||(t.LicensingResult=n={}))},3413:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeVideoDuration=function(e){if((0,a.isNullish)(e)||Number.isNaN(e)||e===1/0)return 0;return e},t.buildPlaybackInfoStreamTypeFields=function(e,t){var n={streamFormat:null!=e?e:void 0,progUrl:t};if((0,a.isNullish)(e))return n;if(e===i.StreamTypes.dash)return{streamFormat:e,mpdUrl:t};if(e===i.StreamTypes.hls)return{streamFormat:e,m3u8Url:t};if(e===i.StreamTypes.prog)return{streamFormat:e,progUrl:t};return n};var i=n(7224),a=n(5063)},9352:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.hasValidSourceMetadataStructure=function(e){if((0,o.isNullish)(e))return!0;if(!(0,o.isPlainObject)(e))return a.logger.errorMessageToUser("Invalid SourceMetadata: not a plain object"),!1;var t=e;if((0,o.isNotNullish)(t.customData)&&!(0,o.isPlainObject)(t.customData))return a.logger.errorMessageToUser("Invalid SourceMetadata: 'customData' property is not a plain object"),!1;return!0},t.sanitizeSourceMetadata=function(e){if((0,o.isNullish)(e))return{};var t={};"title"in e&&(t=i(i({},t),{title:(0,r.isValidString)(e.title)?e.title:void 0}));"videoId"in e&&(t=i(i({},t),{videoId:(0,r.isValidString)(e.videoId)?e.videoId:void 0}));"cdnProvider"in e&&(t=i(i({},t),{cdnProvider:(0,r.isValidString)(e.cdnProvider)?e.cdnProvider:void 0}));"path"in e&&(t=i(i({},t),{path:(0,r.isValidString)(e.path)?e.path:void 0}));"isLive"in e&&(t=i(i({},t),{isLive:(0,o.isBoolean)(e.isLive)?e.isLive:void 0}));"customData"in e&&(t=i(i({},t),{customData:(0,o.isNotNullish)(e.customData)?(0,s.sanitizeCustomDataValues)(e.customData):void 0}));return t};var a=n(1916),r=n(1820),o=n(5063),s=n(5529)},4820:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultStateMachineCallbacks=void 0,t.defaultStateMachineCallbacks={setup:function(){},startup:function(){},programChange:function(){},updateSourceMetadata:function(){},playing:function(){},heartbeat:function(){},qualitychange:function(){},updateSampleQualityInfo:function(){},audiotrack_changing:function(){},pause:function(){},seeking:function(){},buffering:function(){},error:function(){},end:function(){},unload:function(){},ad:function(){},mute:function(){},unMute:function(){},subtitle_changing:function(){},setVideoTimeEndFromEvent:function(){},setVideoTimeStartFromEvent:function(){},videoStartFailed:function(){},startCasting:function(){},casting:function(){},manualSourceChange:function(){},initialSourceChange:function(){},muting_ready:function(){},customdatachange:function(){},release:function(){}}},716:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDifferentSubtitleInfo=void 0;var i=n(5063);t.isDifferentSubtitleInfo=function(e,t){return(!(0,i.isNullish)(e)||!(0,i.isNullish)(t))&&!((0,i.isNotNullish)(e)&&(0,i.isNotNullish)(t)&&e.enabled===t.enabled&&e.language===t.language)}},5426:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsCall=void 0;var i=n(7906),a=n(5923),r=n(92),o=n(5063),s=function(){function e(e){this.analyticsServerUrl=(0,o.joinUrls)(e,"analytics"),this.adAnalyticsServerUrl=(0,o.joinUrls)(e,"analytics/a")}return e.prototype.sendRequest=function(e){var t=this.analyticsServerUrl;(0,i.isSsaiRelatedSample)(e)&&(t=(0,i.appendSsaiRoutingParam)(t)),(0,r.post)(t,e)},e.prototype.sendUnloadRequest=function(e){var t=this,n=this.analyticsServerUrl;(0,i.isSsaiRelatedSample)(e)&&(n=(0,i.appendSsaiRoutingParam)(n)),this.trySendBeacon((function(e){return t.sendRequestSynchronous(e)}),n,e)},e.prototype.trySendBeacon=function(e,t,n,i){var r;if(void 0===i&&(i={}),void 0===(null===(r=a.globalScope.navigator)||void 0===r?void 0:r.sendBeacon))e(n);else{var o=new Blob([JSON.stringify(n)],i);a.globalScope.navigator.sendBeacon(t,o)||e(n)}},e.prototype.sendRequestSynchronous=function(e){var t=this.analyticsServerUrl;(0,i.isSsaiRelatedSample)(e)&&(t=(0,i.appendSsaiRoutingParam)(t)),(0,r.post)(t,e,void 0,!1)},e.prototype.sendAdRequest=function(e){var t=this.adAnalyticsServerUrl;(0,i.isSsaiRelatedSample)(e)&&(t=(0,i.appendSsaiRoutingParam)(t));this.trySendBeacon((function(e){return(0,r.post)(t,e)}),t,e)},e}();t.AnalyticsCall=s},5248:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSourceInfoFromBitmovinSourceConfig=void 0;var i=n(5063);t.getSourceInfoFromBitmovinSourceConfig=function(e,t){if(!e)return{progBitrate:void 0,progUrl:void 0};if("string"==typeof e)return{progBitrate:0,progUrl:e};if(Array.isArray(e)&&e.length>0){var n=t.getPlaybackVideoData(),a=0;return(0,i.isNotNullish)(n)&&!isNaN(+n.id)&&(a=+n.id),{progBitrate:e[a].bitrate||0,progUrl:e[a].url}}return"object"!=typeof e||Array.isArray(e)?{progBitrate:void 0,progUrl:void 0}:{progBitrate:e.bitrate||0,progUrl:e.url}}},404:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodecHelper=void 0;var i=n(5923),a=n(5063),r={avc:['video/mp4; codecs="avc1.42000a"'],vp9:['video/mp4; codecs="vp09.00.50.08"'],av1:['video/mp4; codecs="av01.0.08M.08"'],hevc:['video/mp4; codecs="hev1.1.6.L93.B0"']},o=function(){function e(){}return Object.defineProperty(e,"supportedVideoFormats",{get:function(){var e;if(!(0,a.isNullish)(null===(e=i.globalScope.MediaSource)||void 0===e?void 0:e.isTypeSupported)&&(0,a.isFunction)(i.globalScope.MediaSource.isTypeSupported))return Object.getOwnPropertyNames(r).filter((function(e){return r[e].some((function(e){return i.globalScope.MediaSource.isTypeSupported(e)}))}))},enumerable:!1,configurable:!0}),e}();t.CodecHelper=o},5766:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Converter=void 0;var n=function(){function e(){}return e.bytesToBits=function(e){return 8*e},e.bitsToBytes=function(e){return Math.round(e/8)},e.kiloBitsToBits=function(e){return 1e3*e},e}();t.Converter=n},1652:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventDebugging=void 0;var n=function(e,t,n,i,a){this.event=e,this.from=t,this.to=n,this.timestamp=i,this.eventObject=a};t.EventDebugging=n},92:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.post=function(e,t,n,o){void 0===o&&(o=!0);var s,l=!1;i.globalScope.XMLHttpRequest&&("withCredentials"in(s=new i.globalScope.XMLHttpRequest)||(s=null));!s&&i.globalScope.XDomainRequest&&(s=new i.globalScope.XDomainRequest,l=!0);if(!s){var u="Failed to create POST request, XHR implementation is missing";return a.logger.error(u),void(n&&n(new Error(u),null))}s.onload=function(){if(l){if(n)try{n(null,JSON.parse(s.responseText))}catch(t){var e="Failed to parse response";a.logger.error(e,t),n(new Error(e+": "+String(t)),null)}}else{if(s.status<200||s.status>=300){e="POST error response:"+s.status+": "+s.statusText;return a.logger.error(e),void(n&&n(new Error(e),null))}if(n)try{n(null,JSON.parse(s.responseText))}catch(t){e="Failed to parse response";a.logger.error(e,t),n(new Error(e+": "+String(t)),null)}}},s.onerror=function(){var e="POST request failed: "+s.status+" "+s.statusText;a.logger.error(e),n&&n(new Error(e),null)};try{var c=o;(0,r.isReactNative)()&&!c&&(c=!0),l&&(c=!0),s.open("POST",e,c),l||s.setRequestHeader("Content-Type","text/plain"),s.send(JSON.stringify(t))}catch(e){u="Failed to send POST request: "+String(e);a.logger.error(u),n&&n(new Error(u),null)}};var i=n(5923),a=n(1916),r=n(5063)},5253:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LicenseCall=function(e,t,n,s){var l=(0,o.joinUrls)(s,"/licensing"),u={analyticsVersion:n,domain:t,key:e};return new Promise((function(e,t){var n=setTimeout((function(){var e="License call POST request timed out";a.logger.error(e),t(new Error(e))}),r.ANALYTICS_LICENSECALL_TIMEOUT);(0,i.post)(l,u,(function(i,a){clearTimeout(n),i?t(i):e(a)}))}))};var i=n(92),a=n(1916),r=n(4649),o=n(5063)},1916:function(e,t){"use strict";var n=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,a=0,r=t.length;a<r;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.padRight=void 0;var i=function(){function e(){}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.prototype.initialize=function(e){this.analyticsDebugConfig=e},e.prototype.log=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.enabled&&console.log(e,t)},e.prototype.table=function(e,t){this.enabled&&console.table(e,t)},e.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.enabled&&console.warn(e,t)},e.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.enabled&&console.error(e,t)},e.prototype.errorMessageToUser=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];console.error.apply(console,n([e],t,!1))},Object.defineProperty(e.prototype,"enabled",{get:function(){return this.analyticsDebugConfig||!1},enumerable:!1,configurable:!0}),e}();t.padRight=function(e,t){return(e+new Array(t).join(" ")).slice(0,t)},t.logger=i.getInstance()},3129:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Queue=void 0;var n=function(){function e(){this._items=[]}return Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._items.length},enumerable:!1,configurable:!0}),e.prototype.offer=function(e){this._items.push(e)},e.prototype.poll=function(){return this._items.shift()},e.prototype.clear=function(){this._items.splice(0)},e.prototype.limit=function(e){for(;this._items.length>e;)this.poll()},e}();t.Queue=n},4649:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SEQUENCE_NUMBER_LIMIT=t.ANALYTICS_MIN_SEEK_DIFFERENCE_THRESHOLD=t.ANALYTICS_BUFFER_TIMEOUT=t.ANALYTICS_QUALITY_CHANGE_COUNT_RESET_INTERVAL=t.ANALYTICS_QUALITY_CHANGE_COUNT_THRESHOLD=t.ANALYTICS_VIDEOSTART_TIMEOUT=t.ANALYTICS_LICENSECALL_TIMEOUT=t.ANALYTICS_BACKEND_BASE_URL=t.MESSAGE_NAMESPACE=void 0,t.MESSAGE_NAMESPACE="urn:x-cast:com.bitmovin.analytics.cast",t.ANALYTICS_BACKEND_BASE_URL="https://analytics-ingress-global.bitmovin.com",t.ANALYTICS_LICENSECALL_TIMEOUT=6e4,t.ANALYTICS_VIDEOSTART_TIMEOUT=6e4,t.ANALYTICS_QUALITY_CHANGE_COUNT_THRESHOLD=50,t.ANALYTICS_QUALITY_CHANGE_COUNT_RESET_INTERVAL=36e5,t.ANALYTICS_BUFFER_TIMEOUT=12e4,t.ANALYTICS_MIN_SEEK_DIFFERENCE_THRESHOLD=3,t.SEQUENCE_NUMBER_LIMIT=1e3},5063:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tryJSONStringify=t.isAudioMuted=t.isReactNative=t.joinUrls=t.getURLResourceName=t.calculatePercentage=t.transferCustomDataFields=t.getCustomDataString=t.noOp=t.getCurrentTimestamp=t.calculateTimeWithUndefined=t.calculateTime=t.removeTrailingSlash=t.isFunction=t.isPlainObject=t.isObject=t.toBoolean=t.isBoolean=t.isNotNullish=t.isNullish=void 0,t.isErrorSeverity=function(e){return"CRITICAL"===e||"INFO"===e},t.getPageLoadType=function(){if((0,r.isDocumentHidden)())return i.PAGE_LOAD_TYPE.BACKGROUND;return i.PAGE_LOAD_TYPE.FOREGROUND},t.isArrayBuffer=function(e){return"[object ArrayBuffer]"===Object.prototype.toString.call(e)};var i=n(9946),a=n(5529),r=n(3848),o=n(9422),s=n(1820);t.isNullish=function(e){return null==e};t.isNotNullish=function(e){return!(0,t.isNullish)(e)};t.isBoolean=function(e){return!(0,t.isNullish)(e)&&"boolean"==typeof e};t.toBoolean=function(e){return Boolean(e).valueOf()};t.isObject=function(e){return(0,t.isNotNullish)(e)&&"object"==typeof e};t.isPlainObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)};t.isFunction=function(e){return"function"==typeof e};t.removeTrailingSlash=function(e){return e.replace(/\/$/g,"")};t.calculateTime=function(e){return Math.round(1e3*e)};t.calculateTimeWithUndefined=function(e){if(!(0,t.isNullish)(e))return(0,t.calculateTime)(e)};t.getCurrentTimestamp=function(){return Date.now()};t.noOp=function(){};t.getCustomDataString=function(e){return"object"==typeof e?(0,t.tryJSONStringify)(e):(0,t.isFunction)(e)?(0,t.getCustomDataString)(e()):void 0===e?e:"string"!=typeof e?String(e):e};t.transferCustomDataFields=function(e,n){for(var i=1;i<=a.customDataFieldCount;i++){var r="customData".concat(i);n[r]=(0,t.getCustomDataString)(e[r])}};t.calculatePercentage=function(e,t){if(void 0!==t&&0!==t)return Math.round((e||0)/t*100)};t.getURLResourceName=function(e){return 0===e.length?"":e.split("/").pop()||""};t.joinUrls=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return((0,s.endsWith)(e,"/")&&void 0!==t?e.substr(0,e.length-1):e)+"/"+((0,s.startsWith)(t,"/")?t.substr(1):t)}))};t.isReactNative=function(){return"ReactNative"===(0,o.getGlobalNavigatorProduct)()};t.isAudioMuted=function(e,t){return e||t<.01};t.tryJSONStringify=function(e){if(!(0,t.isNullish)(e))try{return JSON.stringify(e)}catch(e){return}}},4926:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="v2.53.2"},3612:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewportTracker=void 0;var i=n(3848),a=n(5923),r=n(1916),o=n(1820),s=n(5063),l=function(){function e(e,t,n){void 0===n&&(n=1);var a=this;this.inViewport=void 0,this.threshold=n,this.onIntersectionChanged=t,this.element=e;try{var o={root:null,rootMargin:"0px",threshold:n};this.observer=new IntersectionObserver((function(e,t){return a.handleIntersect(e,t)}),o),this.observer.observe(e)}catch(e){r.logger.log("Couldn't create instance of IntersectionObserver. timeInViewport will always be reported as 100%.")}this.hiddenPropertyName=(0,i.getDocumentPropertyWithPrefix)("hidden"),this.hiddenPropertyName&&(this.visibilityChange=this.hiddenPropertyName.replace("hidden","")+"visibilitychange",(0,i.addDocumentEventListener)(this.visibilityChange,this.handleVisibilityChange=this.handleVisibilityChange.bind(this),!1))}return e.prototype.isHidden=function(){return!((0,s.isNullish)(a.globalScope.document)||!(0,o.isValidString)(this.hiddenPropertyName))&&!0===a.globalScope.document[this.hiddenPropertyName]},e.prototype.isInViewport=function(){return!this.isHidden()&&(!!(0,s.isNullish)(this.inViewport)||this.inViewport)},e.prototype.dispose=function(){this.observer&&(this.observer.unobserve(this.element),this.observer.disconnect()),this.visibilityChange&&(0,i.removeDocumentEventListener)(this.visibilityChange,this.handleVisibilityChange,!1)},e.prototype.handleVisibilityChange=function(){this.onIntersectionChanged()},e.prototype.handleIntersect=function(e,t){var n=this;e.forEach((function(e){e.target===n.element&&(n.inViewport=!(e.intersectionRatio<n.threshold))})),this.onIntersectionChanged()},e}();t.ViewportTracker=l},8421:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWebOSTVModelName=function(){try{var e=(0,i.getGlobalWebOSApi)(),t=e.webOSSystem,n=e.PalmSystem,r=(null==t?void 0:t.deviceInfo)?JSON.parse(t.deviceInfo):(null==n?void 0:n.deviceInfo)&&JSON.parse(n.deviceInfo);return(0,a.isValidString)(null==r?void 0:r.modelName)&&!(0,a.isBlank)(null==r?void 0:r.modelName)?r.modelName:void 0}catch(e){return}};var i=n(9422),a=n(1820)},2376:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowEventTracker=void 0;var i=n(9422),a=function(){function e(){this.trackedObjects=[]}return e.prototype.addEventListener=function(e,t){this.trackedObjects.push({eventName:e,func:t}),(0,i.addGlobalEventListener)(e,t)},e.prototype.release=function(){for(;0!==this.trackedObjects.length;){var e=this.trackedObjects.pop();void 0!==e&&(0,i.removeGlobalEventListener)(e.eventName,e.func)}},e}();t.WindowEventTracker=a},8331:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeAnalyticsConfig=function(e){if((0,u.isNullish)(e))return{};l.isBoolean(e.isLive)||(e.isLive=void 0);(0,u.isNotNullish)(e.config)&&(0,u.isNotNullish)(e.config.errorTransformerCallback)&&((0,u.isFunction)(e.config.errorTransformerCallback.transform)||(e.config.errorTransformerCallback=void 0));return e},t.guardConfigChangeAgainstMissingTitle=function(e,t){if((0,u.isNullish)(e)||(0,u.isNullish)(t))return;e.title&&(0,s.isBlank)(t.title)&&o.logger.error("The new analytics configuration does not contain the field `title`")},t.guardConfigChangeAgainstMissingIsLive=function(e,t){if((0,u.isNullish)(e)||(0,u.isNullish)(t))return;e.isLive&&(0,u.isNullish)(t.isLive)&&o.logger.error("The new analytics configuration does not contain the field `isLive`. It will default to `false` which might be unintended? Once stream playback information is available the type will be populated.")},t.guardAgainstDuplicatedUserId=function(e){if((0,u.isNullish)(e))return;(0,u.isNotNullish)(e.customUserId)&&(0,u.isNotNullish)(e.userId)&&o.logger.warn("Configuration Warning: \nCustomUserId and UserId are set in the config \nValue of UserId will be used in sample \nPlease only use one configuration field to set your userId")},t.getDeviceInformationFromAnalyticsConfig=function(e){if((0,u.isNullish)(e))return;var t={};(0,s.isValidString)(e.deviceType)&&!(0,s.isBlank)(e.deviceType)&&(t.model=e.deviceType);(0,s.isValidString)(e.deviceClass)&&!(0,s.isBlank)(e.deviceClass)&&(t.deviceClass=e.deviceClass);if(0===Object.keys(t).length)return;return t},t.getDomainFromAnalyticsConfig=function(e){var t,n,i=(0,r.getGlobalLocationHostname)(),a=i?l.removeTrailingSlash(i):"";return null!==(n=null===(t=null==e?void 0:e.config)||void 0===t?void 0:t.origin)&&void 0!==n?n:a},t.mergeAnalyticsConfig=function(e,t){var n=function(e){var t=["cdnProvider","videoId","title","isLive","experimentName"],n=/customData\d{1,3}$/g;for(var i in e)((0,u.isNotNullish)(i.match(n))||t.includes(i))&&delete e[i];return e}(e),a=function(e,t){if((0,u.isNotNullish)(t))return i(i(i({},e),{enabled:!0}),t);return null!=e?e:{}}(e.config,t.config);return i(i(i({},n),t),{config:a})},t.applySourceMetadataToAnalyticsConfig=function(e,t){var n=i({},e);(0,u.isNotNullish)(t.title)&&(n.title=t.title);(0,u.isNotNullish)(t.videoId)&&(n.videoId=t.videoId);(0,u.isNotNullish)(t.cdnProvider)&&(n.cdnProvider=t.cdnProvider);(0,u.isNotNullish)(t.isLive)&&(n.isLive=t.isLive);(0,u.isNotNullish)(t.customData)&&(n=i(i({},n),(0,a.extractCustomDataFieldsOnly)(t.customData)));return n};var a=n(5529),r=n(9422),o=n(1916),s=n(1820),l=n(5063),u=n(5063)},9627:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.areCollectorRequirementsValid=function(e){var t=[],n=(0,r.isBlank)((0,i.getDomainFromAnalyticsConfig)(e));n&&t.push("no `domain` value found (neither from `window.location` object nor provided by `AnalyticsConfig.config.origin`). Without this value, we cannot verify the origin of your analytics data. Please provide the registered domain via the config during collector creation.");if(t.length>0){var o="Collector setup failed:"+t.join(" -- ");a.logger.errorMessageToUser(o)}return!n};var i=n(8331),a=n(1916),r=n(1820)},3848:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteCookie=t.setCookie=t.getCookie=t.removeDocumentEventListener=t.addDocumentEventListener=t.isVideoInFullscreen=t.isDocumentHidden=t.getDocumentPropertyWithPrefix=void 0;var i=n(1916),a=n(1820),r=n(5063);t.getDocumentPropertyWithPrefix=function(e){if(!(0,r.isNullish)(document)){if(e in document)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0,i=["webkit","moz","ms","o"];n<i.length;n++){var a=i[n]+t;if(a in document)return a}}};t.isDocumentHidden=function(){var e=(0,t.getDocumentPropertyWithPrefix)("hidden");return!!(0,a.isValidString)(e)&&!0===document[e]};t.isVideoInFullscreen=function(){var e,n=(0,t.getDocumentPropertyWithPrefix)("fullscreenElement");return!!(0,a.isValidString)(n)&&"VIDEO"===(null===(e=document[n])||void 0===e?void 0:e.nodeName)};t.addDocumentEventListener=function(e,t,n){(0,r.isNullish)(document)||!(0,r.isFunction)(document.addEventListener)||(0,r.isNullish)(t)||document.addEventListener(e,t,n)};t.removeDocumentEventListener=function(e,t,n){(0,r.isNullish)(document)||!(0,r.isFunction)(document.removeEventListener)||(0,r.isNullish)(t)||document.removeEventListener(e,t,n)};t.getCookie=function(e){if(!(0,r.isNullish)(document)){var t;try{t=document.cookie.split(";")}catch(e){return void i.logger.log("failed to access cookie objects on document",e)}for(var n=e+"=",a=0,o=t;a<o.length;a++){for(var s=o[a];" "===s.charAt(0);)s=s.substring(1);if(0===s.indexOf(n))return s.substring(n.length,s.length)}return""}};t.setCookie=function(e,t,n){if(!(0,r.isNullish)(document)){var a=e+"="+t+"; path=/";(null==n?void 0:n.domain)&&(a+="; domain=".concat(n.domain)),(null==n?void 0:n.expires)&&(a+="; expires=".concat(n.expires)),(null==n?void 0:n.maxAge)&&(a+="; max-age=".concat(n.maxAge));try{document.cookie=a}catch(e){return void i.logger.log("failed to set cookie object on document",e)}}};t.deleteCookie=function(e){if(!(0,r.isNullish)(document))try{document.cookie="".concat(e,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;")}catch(e){return void i.logger.log("failed to delete cookies from document",e)}}},5923:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalScope=void 0,t.globalScope=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;if("undefined"!=typeof self)return self;throw new Error("Unable to locate global object")}()},9422:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalTheoPlayerVersion=t.getGlobalVideojsVersion=t.getGlobalNavigatorUserAgent=t.getGlobalNavigatorProduct=t.getGlobalNavigatorLanguage=t.hasGlobalWebOSApi=t.getGlobalWebOSApi=t.getGlobalPerformanceNow=t.getGlobalLocationPathname=t.getGlobalLocationHostname=t.removeGlobalEventListener=t.addGlobalEventListener=t.getGlobalScreenDimensions=t.getGlobalDevicePixelRatio=void 0;var i=n(5923),a=n(1460),r=n(1820),o=n(5063);t.getGlobalDevicePixelRatio=function(){return(0,o.isNullish)(i.globalScope.devicePixelRatio)?1:i.globalScope.devicePixelRatio>0?i.globalScope.devicePixelRatio:1};t.getGlobalScreenDimensions=function(){if(!(0,o.isNullish)(i.globalScope.screen)&&(0,a.isNumber)(i.globalScope.screen.width)&&(0,a.isNumber)(i.globalScope.screen.height)){var e=(0,t.getGlobalDevicePixelRatio)(),n=i.globalScope.screen.width*e,r=i.globalScope.screen.height*e;if(!(!isFinite(n)||!isFinite(r)||n<=0||r<=0))return{width:n,height:r,scale:e}}};t.addGlobalEventListener=function(e,t){(0,o.isNullish)(i.globalScope.addEventListener)||!(0,o.isFunction)(i.globalScope.addEventListener)||(0,o.isNullish)(t)||i.globalScope.addEventListener(e,t)};t.removeGlobalEventListener=function(e,t){(0,o.isNullish)(i.globalScope.removeEventListener)||!(0,o.isFunction)(i.globalScope.removeEventListener)||(0,o.isNullish)(t)||i.globalScope.removeEventListener(e,t)};t.getGlobalLocationHostname=function(){if(!(0,o.isNullish)(i.globalScope.location)&&(0,r.isValidString)(i.globalScope.location.hostname))return i.globalScope.location.hostname};t.getGlobalLocationPathname=function(){if(!(0,o.isNullish)(i.globalScope.location)&&(0,r.isValidString)(i.globalScope.location.pathname))return i.globalScope.location.pathname};t.getGlobalPerformanceNow=function(){var e;if(!(0,o.isNullish)(null===(e=i.globalScope.performance)||void 0===e?void 0:e.now)&&(0,o.isFunction)(i.globalScope.performance.now))return i.globalScope.performance.now()};t.getGlobalWebOSApi=function(){return{webOSSystem:i.globalScope.webOSSystem,PalmSystem:i.globalScope.PalmSystem}};t.hasGlobalWebOSApi=function(){var e=(0,t.getGlobalWebOSApi)(),n=e.webOSSystem,i=e.PalmSystem;return!(0,o.isNullish)(n)||!(0,o.isNullish)(i)};t.getGlobalNavigatorLanguage=function(){if(!(0,o.isNullish)(i.globalScope.navigator))return i.globalScope.navigator.language||i.globalScope.navigator.userLanguage};t.getGlobalNavigatorProduct=function(){if(!(0,o.isNullish)(i.globalScope.navigator))return i.globalScope.navigator.product};t.getGlobalNavigatorUserAgent=function(){if(!(0,o.isNullish)(i.globalScope.navigator)&&(0,r.isValidString)(i.globalScope.navigator.userAgent))return i.globalScope.navigator.userAgent};t.getGlobalVideojsVersion=function(){if(!(0,o.isNullish)(i.globalScope.videojs))return i.globalScope.videojs.VERSION};t.getGlobalTheoPlayerVersion=function(){if(!(0,o.isNullish)(i.globalScope.THEOplayer))return i.globalScope.THEOplayer.version}},1460:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIntOrUndefined=t.isFiniteNumber=t.isNumber=void 0;var i=n(5063);t.isNumber=function(e){return!(0,i.isNullish)(e)&&"number"==typeof e};t.isFiniteNumber=function(e){return!!(0,t.isNumber)(e)&&((0,i.isFunction)(Number.isFinite)?Number.isFinite(e):isFinite(e))};t.parseIntOrUndefined=function(e){var n=parseInt(e,10);return(0,t.isFiniteNumber)(n)?n:void 0}},2974:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.objectValues=void 0,t.safeAccess=function(e){try{return e()}catch(e){return void i.logger.log("safeAccess catched failed access on property: ",e)}};var i=n(1916);t.objectValues=function(e){return Object.keys(e).map((function(t){return e[t]}))}},2108:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BITMOVIN_ANALYTICS_AUGMENTED_MARKER=void 0,t.hasPlayerAlreadyBeenAugmented=function(e){return!0===e[t.BITMOVIN_ANALYTICS_AUGMENTED_MARKER]},t.markPlayerInstanceAsAugmented=function(e){e[t.BITMOVIN_ANALYTICS_AUGMENTED_MARKER]=!0},t.isDefined=function(e){if((0,a.isNullish)(e))return i.logger.log("Bitmovin Analytics: Adapter hasn't been initialized yet"),!1;return!0};var i=n(1916),a=n(5063);t.BITMOVIN_ANALYTICS_AUGMENTED_MARKER="__bitmovinAnalyticsHasBeenSetup"},6481:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearSampleStateValues=function(e){e.ad=0,e.adId=void 0,e.adIndex=void 0,e.adPosition=void 0,e.adSystem=void 0,e.autoplay=void 0,e.buffered=0,e.castTech=void 0,e.completed=void 0,e.drmLoadTime=void 0,e.droppedFrames=0,e.duration=0,e.errorCode=void 0,e.errorData=void 0,e.errorMessage=void 0,e.errorSegments=void 0,e.errorSeverity=void 0,e.isProgramChange=void 0,e.pageLoadTime=0,e.paused=0,e.played=0,e.playerStartupTime=0,e.seeked=0,e.startupTime=0,e.state=void 0,e.videoStartFailed=void 0,e.videoStartFailedReason=void 0,e.videoStartupTime=0,e[i.SSAI_RELATED_SAMPLE_MARKER]=void 0},t.getDefaultSamplePath=function(){var e=(0,a.getGlobalLocationPathname)();return(0,r.isValidString)(e)?(0,s.removeTrailingSlash)(e):void 0},t.buildAdSample=function(e){var t={};if((0,s.isNullish)(e))return t;return t.cdnProvider=e.cdnProvider,t.customUserId=e.customUserId,t.domain=e.domain,t.key=e.key,t.language=e.language,t.path=e.path,t.player=e.player,t.playerKey=e.playerKey,t.playerTech=e.playerTech,t.screenHeight=e.screenHeight,t.screenWidth=e.screenWidth,t.size=e.size,t.userAgent=e.userAgent,t.userId=e.userId,t.version=e.version,t.videoId=e.videoId,t.videoImpressionId=e.impressionId,t.videoTitle=e.videoTitle,t.videoWindowHeight=e.videoWindowHeight,t.videoWindowWidth=e.videoWindowWidth,o.transferCustomDataFields(e,t),t.experimentName=e.experimentName,t};var i=n(7906),a=n(9422),r=n(1820),o=n(5063),s=n(5063)},1820:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startsWith=t.endsWith=t.isBlank=t.isEmpty=t.isValidString=void 0;var i=n(5063);t.isValidString=function(e){return(0,i.isNotNullish)(e)&&"string"==typeof e};t.isEmpty=function(e){return(0,i.isNullish)(e)||0===e.length};t.isBlank=function(e){return(0,t.isEmpty)(e)||(0,t.isEmpty)(null==e?void 0:e.trim())};t.endsWith=function(e,n){return!(!(0,t.isValidString)(e)||!(0,t.isValidString)(n))&&((0,i.isFunction)(String.prototype.endsWith)?e.endsWith(n):e.substring(e.length-n.length)===n)};t.startsWith=function(e,n){return!(!(0,t.isValidString)(e)||!(0,t.isValidString)(n))&&((0,i.isFunction)(String.prototype.startsWith)?e.startsWith(n):e.substring(0,n.length)===n)}},2982:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateUUID=void 0;t.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}}},t={};function n(i){var a=t[i];if(void 0!==a)return a.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var i={};return function(){"use strict";var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.PlayerModule=e.BitmovinPwxAnalyticsPackage=e.adapters=e.VideojsAdapter=e.THEOplayerAdapter=e.ShakaAdapter=e.HlsAdapter=e.HTMLVideoElementAdapter=e.CAFv3Adapter=e.Bitmovin8Adapter=e.CdnProviders=e.Players=e.version=void 0;var t=n(4679);Object.defineProperty(e,"Bitmovin8Adapter",{enumerable:!0,get:function(){return t.Bitmovin8Adapter}});var a=n(681);Object.defineProperty(e,"PlayerModule",{enumerable:!0,get:function(){return a.PlayerModule}});var r=n(2506);Object.defineProperty(e,"BitmovinPwxAnalyticsPackage",{enumerable:!0,get:function(){return r.BitmovinPwxAnalyticsPackage}});var o=n(5127);Object.defineProperty(e,"CAFv3Adapter",{enumerable:!0,get:function(){return o.CAFv3Adapter}});var s=n(9566);Object.defineProperty(e,"HlsAdapter",{enumerable:!0,get:function(){return s.HlsAdapter}});var l=n(701);Object.defineProperty(e,"HTMLVideoElementAdapter",{enumerable:!0,get:function(){return l.HTMLVideoElementAdapter}});var u=n(2063);Object.defineProperty(e,"ShakaAdapter",{enumerable:!0,get:function(){return u.ShakaAdapter}});var c=n(7470);Object.defineProperty(e,"THEOplayerAdapter",{enumerable:!0,get:function(){return c.THEOplayerAdapter}});var d=n(4179);Object.defineProperty(e,"VideojsAdapter",{enumerable:!0,get:function(){return d.VideojsAdapter}});var E=n(4355);Object.defineProperty(e,"CdnProviders",{enumerable:!0,get:function(){return E.CdnProvider}});var p=n(556);Object.defineProperty(e,"Players",{enumerable:!0,get:function(){return p.Player}});var v=n(4926);Object.defineProperty(e,"version",{enumerable:!0,get:function(){return v.VERSION}}),e.adapters={Bitmovin8Adapter:t.Bitmovin8Adapter,CAFv3Adapter:o.CAFv3Adapter,HTMLVideoElementAdapter:l.HTMLVideoElementAdapter,HlsAdapter:s.HlsAdapter,ShakaAdapter:u.ShakaAdapter,THEOplayerAdapter:c.THEOplayerAdapter,VideojsAdapter:d.VideojsAdapter},e.default={PlayerModule:a.PlayerModule}}(),i}()}));
|
|
12
12
|
//# sourceMappingURL=bitmovin-analytics.js.map
|