1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9056],{73512:e=>{!function(){"use strict";self,e.exports=(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[238],{34795:function(e,t){var i,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ContainerFormat=void 0,(n=i||(t.ContainerFormat=i={})).MP4="mp4",n.TS="ts",n.WEBM="webm"},12030:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.DrmKidErrorHandler=void 0;var n=i(80813),r=i(91678),o=i(46151),a=i(33436),s=i(93204),u=i(13114);t.DrmKidErrorHandler=function(){function e(e,t){var i=this;this.context=e,this.onDownloadedRepresentationExcludedCallback=t,this.iY=function(e,t){if(void 0!==e&&void 0!==t){var n=e.filter(function(e){return!t.includes(e)});i.hY(n)}};var r=e.sourceContext.sourceIdentifier;this.fY=e.store,this.cY=e.logger,this.gY=e.serviceManager.get(n.ServiceName.SourceStoreService,r),this.dY=e.serviceManager.get(n.ServiceName.ManifestService,r),this.eY=(0,s.subscribe)(this.gY)(u.getDrmKeyIdsWithErrors,this.iY)}return e.prototype.hY=function(e){var t=(n=this.dY,n.getAllRepresentations().filter(function(t){return t.associatedKid&&e.includes(t.associatedKid)}).map(function(e){return e._internalId})),i=this.fY.getState();if(0!==t.length&&void 0!==i){var n,s,u=(s=(0,o.getMetricsHistoryFromInstanceState)(i,"default",a.MetricType.RequestedRepresentations).map(function(e){return e.value}),t.some(function(e){return s.some(function(t){return t.equals(e)})}));this.cY.debug("Excluding representations due to DRM licenses not being available",t),this.dY.excludeRepresentations(t)&&u&&(this.fY.dispatch((0,r.clearMetricsHistory)("default",a.MetricType.RequestedRepresentations)),this.onDownloadedRepresentationExcludedCallback())}},e.prototype.trackSegment=function(e){var t=e.getDrmKid();if(void 0!==t){var i=this.gY.getState(),n=e.getRepresentationId(),r=i?(0,u.getDrmKeyIdsWithErrors)(i):[];t!==this.dY.getRepresentationDrmKid(n)&&(this.dY.setRepresentationDrmKid(n,t),this.hY(r))}},e.prototype.dispose=function(){this.eY()},e}()},65272:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.HeartbeatService=void 0;var n=i(80813),r=i(88844);function o(e){e.shouldClearSubtitleServiceBuffers()&&e.clearSubtitleServiceBuffers()}function a(e,t){var i,n;e.shouldSuspendHeartbeat()||((n=(i=e.getActiveSegmentControllers()).length>0)&&i.forEach(function(i){var n=t.getTimeForNextSegment(i.getMimeType());e.getNextSegment(i,n)}),e.areAllLoadersReady()&&(n?o(e):e.isLoadingLastPeriod()?(e.areMediaTypesFinalForPlayingPeriod()?e.maybeStop():e.isAVCompletelyLoaded()&&e.signalEndOfStream(),o(e)):(e.switchLoadingPeriod(),a(e,t))))}t.HeartbeatService=function(){function e(e,t){this.serviceManager=e,this.mediaPlayerController=t,this.mA=-1}return Object.defineProperty(e.prototype,"nA",{get:function(){return this.serviceManager.get(n.ServiceName.StreamTimeService)},enumerable:!1,configurable:!0}),e.prototype.oA=function(){var e=this;(0,r.clearTimeoutIfDefined)(this.mA),this.mA=window.setTimeout(function(){return e.pA()},250)},e.prototype.pA=function(){this.oA(),a(this.mediaPlayerController,this.nA)},e.prototype.beat=function(){this.started&&a(this.mediaPlayerController,this.nA)},Object.defineProperty(e.prototype,"started",{get:function(){return -1!==this.mA},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.pA()},e.prototype.stop=function(){(0,r.clearTimeoutIfDefined)(this.mA),this.mA=-1},e.prototype.dispose=function(){this.stop()},e}()},94358:function(e,t,i){var n,r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.MediaPlayer=t.LoadState=void 0,t.checkIfGapSkip=W;var o,a=i(4524),s=i(48143),u=i(80813),c=i(56481),d=i(9768),l=i(3714),h=i(90408),p=i(44468),f=i(91678),g=i(46151),m=i(33436),v=i(23690),y=i(87827),S=i(48488),T=i(93204),b=i(34047),M=i(85434),I=i(89927),P=i(19274),C=i(88052),E=i(62756),A=i(65272),R=i(23901),_=i(96533),B=i(38568),D=i(90087),O=i(23940),L=i(52090),k=i(44552),x=i(15761),N=i(36193),w=i(52447),F=i(88935),H=i(27531),U=i(33903),G=i(47531),Z=i(16870),j=i(68981);(n=o||(t.LoadState=o={})).Unloaded="unloaded",n.Preparing="preparing",n.Loading="loading",n.Loaded="loaded";var V=Object.freeze({id:"auto",bitrate:null}),q=Object.freeze({id:"auto",bitrate:null,width:null,height:null});function K(e){return e===d.ADVERTISING_ISSUER_NAME||e===d.ADVERTISING_RESTORE_ISSUER_NAME}function Y(e){return!!e&&e===d.RECOVERY_ISSUER_NAME}function W(e,t){if(!C.ModuleManager.has(E.ModuleName.RendererMse)||!e.videoElement)return!1;for(var i=C.ModuleManager.get(E.ModuleName.RendererMse).Ranges,n=e.settings.MIN_SIZE_FOR_GAP_SKIPPING,r=i.findGaps(e.videoElement.buffered,n),o=!1,a=0;a<r.length;a++).1>=Math.abs(r.end(a)+i.TIME_FUDGE_FACTOR-t)&&(o=!0);return o}t.MediaPlayer=function(){function e(e){var t=this;this.h=-1,this.j=!1,this.m=!1,this.n=!1,this.o=!0,this.p=d.API_ISSUER_NAME,this.q=d.API_ISSUER_NAME,this.G=function(e){if(null==t.P()&&!e.isInit()){var i=t.isLive()?t.H(e):0;t.Q(i)}},this.I=function(){t.isLive()&&t.M()&&t.N()},this.J=function(e){if(t.j)t.j=!1;else{t.b.debug("Caught a video element error: ",e);var i=(0,h.createPlayerErrorFromMediaError)(e,t.a.sourceContext.sourceIdentifier),n=t.a.serviceManager.get(u.ServiceName.RecoveryService);if(n)return void n.handleError(i);
vendor: 4,754 bytes, line 1
1t.unload(),t.f.fireError(i)}},this.L=function(){if(t.u){var e=t.u.getStatus(t.t,t.R());t.t!==e.mode&&(t.a.eventHandler.dispatchEvent(l.PlayerEvent.LatencyModeChanged,{from:t.t,to:e.mode}),t.t=e.mode),e.mode===l.LatencyMode.Suspended||t.v.seekingOrTimeshifting||(e.requiredAction===t.g.LiveLatencyControlAction.Seek?t.K():e.requiredAction===t.g.LiveLatencyControlAction.PlaybackRate&&t.setPlaybackSpeed(1,e.actionParam,!1))}},this.T=function(){t.v.getIsRendererStalling()?(t.b.debug("Renderer is currently stalled. Waiting for unstalling before ending stall."),t.Gb(),t.y=(0,T.subscribe)(t.a.store)(function(e){return(0,y.getPlayerState)(e)},function(){return t.S()},function(e){return!(0,y.getIsRendererStalled)(e)})):t.S()},this.U=function(){t.m&&(t.b.debug("Detected replay attempt from video element"),t.a.internalPlayer.play()),t.v.transitionToPlayState(!0,t.p)},this.V=function(){t.b.insane("video element signaled pause in state: ".concat(t.v.playbackState)),t.k.maybeTransitionToPausedState(t.q)},this.yb=function(e){return{id:e.id,lang:e.lang,label:e.label,role:e.role,metadata:e.metadata,getQualities:function(){var i=(0,_.getManifestService)(t.a);return i?D.MediaPlayerManifestApiFactory.getAudioQualities(i,t.getCurrentPlayingPeriodId(),e.id):[]}}},this.Ab=function(e){var i=W(t.a,e.time);!t.d.GLOBAL_DISABLE_SEEKING||i||t.v.isSourceSwitching()||void 0===t.r||Math.abs(e.time-t.r)>.05&&(t.b.debug("Seeking not allowed, seeking back to expected time"),t.a.videoElement.currentTime=t.r)},this.Bb=function(e){if(!t.m){var i=0===t.e.getCurrentTime(!0),n=t.isPlaying(),r=t.v.isSeeking(),o=t.v.isTimeShifting(),a=t.isStalled();!n||r||o||a||i?t.b.debug("Skipping timeupdate",{isPlaying:n,isSeeking:r,isStalled:a,timeUpdateWithoutBuffer:i,time:e.time}):t.Y(t.getCurrentTime())}},this.Cb=function(){t.m=!0},this.Db=function(){t.a.logger.debug("DVR window exceeded"),t.v.isPlaying()?t.d.DISABLE_AUTO_RECOVERY_ON_DVR_WINDOW_EXCEEDED||t.Eb():t.n=!0},this.Fb=function(e){3001===e.code&&t.unload()},this.Jb=function(){var e;(null==(e=(0,_.getManifestService)(t.a))?void 0:e.isHlsManifest())||t.Ib()},this.Kb=function(){var e;(null==(e=(0,_.getManifestService)(t.a))?void 0:e.isHlsManifest())||t.Hb()},this.Mb=function(e){t.isLive()&&(t.M()?t.N():t.O(!1))},this.a=e,this.b=e.logger,this.c=e.config,this.d=e.settings,this.e=e.renderer,this.f=e.eventHandler,this.l=o.Unloaded,this.a.store.dispatch((0,f.initializeMetricsForMimeType)("default",this.a.settings)),this.k=new L.MediaPlayerController(e,this.G),C.ModuleManager.has(E.ModuleName.LowLatency)&&(this.g=C.ModuleManager.get(E.ModuleName.LowLatency)),this.f.on(l.PlayerEvent.PeriodSwitch,this.Jb),this.f.on(l.PlayerEvent.PeriodSwitched,this.Kb),this.f.on(l.PlayerEvent.PlaybackSpeedChanged,this.Mb),this.x=(0,T.subscribe)(this.a.store)(function(e){return(0,y.getIsPlaying)((0,y.getPlayerState)(e))},this.I,function(e,t){return e&&!t})}return e.prototype.A=function(e,t){this.B(e,t,t.sourceContext),this.C(t)},e.prototype.B=function(e,t,i){(0,Z.initializeSynchronizedTimeService)(t,i),(0,_.initializeManifestService)(t,i),(0,R.initializeManifestLoadingService)(t,i,e),(0,B.initializeManifestUpdateSchedulingService)(t,i)},e.prototype.C=function(e){var t,i,n;t=C.ModuleManager.get(E.ModuleName.ABR).AdaptationService,e.serviceManager.set(u.ServiceName.AdaptationService,new t(e)),e.serviceManager.set(u.ServiceName.TimedMetadataService,new x.TimedMetadataService(e)),e.serviceManager.set(u.ServiceName.SegmentService,new k.SegmentService(e)),i=new G.StreamTimeService(e.serviceManager,e.sourceContext.sourceIdentifier),e.serviceManager.set(u.ServiceName.StreamTimeService,i),n=this.k,e.serviceManager.set(u.ServiceName.HeartbeatService,new A.HeartbeatService(e.serviceManager,n),e.sourceContext.sourceIdentifier),this.s=this.D(e),this.u=this.E(e)},e.prototype.D=function(e){var t=e.serviceManager,i=e.sourceContext.sourceIdentifier;if(C.ModuleManager.has(E.ModuleName.Subtitles)&&!t.has(u.ServiceName.SubtitleService,i)){var n=C.ModuleManager.get(E.ModuleName.Subtitles).SubtitleService;t.set(u.ServiceName.SubtitleService,new n(e),i)}return t.get(u.ServiceName.SubtitleService,i)},e.prototype.E=function(e){var t,i=e.serviceManager;if(null==(t=this.u)||t.dispose(),C.ModuleManager.has(E.ModuleName.LowLatency)&&this.g)return i.set(u.ServiceName.LiveLatencyService,new this.g.LiveLatencyService(e)),i.get(u.ServiceName.LiveLatencyService)},e.prototype.F=function(e){var t,i,n,r,o=this.a.serviceManager;[u.ServiceName.LiveLatencyService,u.ServiceName.TimedMetadataService].forEach(function(e){return(0,s.disposeService)(o,e)});var a=null==(t=this.a.sourceContext)?void 0:t.sourceIdentifier;if(a){(0,s.disposeService)(o,u.ServiceName.HeartbeatService,a),(0,s.disposeService)(o,u.ServiceName.SegmentService,a);
1var c=e===d.ADVERTISING_ISSUER_NAME,l=!this.a.sourceContext.isAd;c&&l||Y(e)?(null==(i=o.get(u.ServiceName.ManifestService,a))||i.suspend(),null==(n=o.get(u.ServiceName.ManifestUpdateSchedulingService,a))||n.suspend(),c?null==(r=o.get(u.ServiceName.SubtitleService,a))||r.disableAllSubtitles():[u.ServiceName.ManifestLoadingService,u.ServiceName.SubtitleService].forEach(function(e){return(0,s.disposeService)(o,e,a)})):[u.ServiceName.ManifestService,u.ServiceName.ManifestLoadingService,u.ServiceName.ManifestUpdateSchedulingService,u.ServiceName.SynchronizedTimeService,u.ServiceName.SubtitleService].forEach(function(e){return(0,s.disposeService)(o,e,a)})}},e.prototype.H=function(e){var t=null!=e.getSegmentInfo().wallClockTime?e.getPlaybackTime()-(0,I.toSeconds)(e.getSegmentInfo().wallClockTime):0;return this.k.getSeekableRange().start+t},e.prototype.play=function(e){return this.p=e,this.o?this.i?this.v.isPlaying()?(this.b.debug("Ignoring play call as play was already triggered or we're already playing"),Promise.resolve()):(this.m=!1,this.v.isPaused()&&this.isLive()&&(this.n||this.getMaxTimeShift()>=0)&&!this.d.DISABLE_AUTO_RECOVERY_ON_DVR_WINDOW_EXCEEDED&&(this.a.logger.debug("Handling DVR window excursion - going to live edge"),this.K(),this.n=!1),this.k.start(),this.v.transitionToPendingPlayState(!1,e),this.e.play()):Promise.resolve():Promise.reject("Play control not permitted")},e.prototype.K=function(){this.d.ENABLE_SEEK_FOR_LIVE?this.v.isSeeking()||this.seek(this.getSeekableRange().end,d.INTERNAL_ISSUER_NAME):this.v.isTimeShifting()||this.timeShift(0,d.INTERNAL_ISSUER_NAME)},e.prototype.M=function(){return!!this.u&&!this.isPaused()&&0===this.getTimeShift()&&1===this.getPlaybackSpeed()&&!this.v.isTimeShifting()&&!this.v.isSeeking()},e.prototype.N=function(){var e;null==(e=this.u)||e.resumeControl()},e.prototype.O=function(e){void 0===e&&(e=!0);var t=this.t===l.LatencyMode.Suspended;this.u&&!t&&(this.u.suspendControl(),e&&this.setPlaybackSpeed(1,1,!1))},e.prototype.P=function(){var e;
1return(0,U.getRelativeCurrentTimeOffset)(null==(e=this.qb())?void 0:e.getState())},e.prototype.Q=function(e){var t;null==(t=this.qb())||t.dispatch((0,H.setRelativeCurrentTimeOffset)(e))},e.prototype.R=function(){var e=[this.getBufferLevel(p.BufferType.ForwardDuration,p.MediaType.Audio),this.getBufferLevel(p.BufferType.ForwardDuration,p.MediaType.Video)].map(function(e){return e.level}).filter(function(e){return null!==e});return 0===e.length?0:Math.min.apply(Math,e)},e.prototype.S=function(){this.Gb(),this.v.stallExit(),this.v.transitionToPlayingState(this.p),this.m=!1},e.prototype.preload=function(){this.l!==o.Unloaded&&this.k&&this.k.start()},e.prototype.pause=function(e){var t;this.o&&(this.b.insane("Pause was called via the API"),this.v.isInitial()||(this.q=e,this.isLive()&&(null==(t=this.u)?void 0:t.isConfigured())&&(this.O(),this.L()),this.v.isPaused()||this.v.isStopped()||this.e.pause(),this.v.transitionToPausedState(this.e.isPaused(),e)))},e.prototype.mute=function(e){this.isMuted()||(this.e.mute(),this.a.eventHandler.dispatchEvent(l.PlayerEvent.Muted,{issuer:e||d.API_ISSUER_NAME}))},e.prototype.unmute=function(e){this.isMuted()&&(this.e.unmute(),this.a.eventHandler.dispatchEvent(l.PlayerEvent.Unmuted,{issuer:e||d.API_ISSUER_NAME}))},e.prototype.W=function(e,t){var i,n=null==(i=this.qb())?void 0:i.getState();if(!n)return e;for(var r=C.ModuleManager.get(E.ModuleName.HLS).selectors,o=r.getHlsState,a=(0,r.getMergedDiscontinuityTimings)(o(n)),s=Object.values(a),u=0;u<s.length-1;u++){var c=s[u].endTime,d=s[u+1].startTime;if(e>=c-t&&e<d)return this.b.debug("Adjusting seek target to discontinuity start: ".concat(e," -> ").concat(d)),d}return e},e.prototype.seek=function(e,t){void 0===t&&(t="");var i,n,r,o=this.c&&this.c.hasOwnProperty("playback")?this.c.playback:{},a=!o.hasOwnProperty("seeking")||o.seeking,s=this.a.store.getState(),u=!!s&&null!=(r=null==(n=null==(i=(0,y.getPlayerState)(s))?void 0:i.seekingProcess)?void 0:n.isInitial)&&r,c=![d.STARTUP_ISSUER_NAME,d.INTERNAL_ISSUER_NAME].includes(t),l=u||!this.d.GLOBAL_DISABLE_SEEKING&&a,h=(0,_.getManifestService)(this.a);if(!l||!this.o||!h)return!1;var p=this.d.END_OF_BUFFER_TOLERANCE,f=h.isHlsManifest()?this.W(e,p):(0,j.adjustTargetTimeToPeriodStart)(e,p,h,this.b);return this.m=!1,this.X(),this.Lb(),this.v.transitionToSeekingState(f,t,c),this.a.store.dispatch((0,v.updateSeekingProcess)({issuer:t,targetTime:f,seekableRange:this.getSeekableRange(),isInitial:u})),!0},e.prototype.X=function(){this.v.isTimeShifting()&&(this.k.getTimeShiftHandler().cancel(),this.v.transitionToTimeShiftedState(!1))},e.prototype.Y=function(e){var t;e!==this.r&&(this.a.eventHandler.dispatchEvent(l.PlayerEvent.TimeChanged,{time:e}),this.r=e,this.isLive()&&(null==(t=this.u)?void 0:t.isConfigured())&&this.L())},e.prototype.setVolume=function(e,t){var i=this.e.getVolume();this.e.setVolume(e),i!==e&&this.a.eventHandler.dispatchEvent(l.PlayerEvent.VolumeChanged,{targetVolume:e,sourceVolume:i,issuer:t||d.API_ISSUER_NAME})},e.prototype.setAudioQuality=function(e){var t,i=this.getAvailableAudioQualities(),n=this.getAudioQuality();(t="auto"===e?V:i.find(function(t){return t.id===e}))&&n.id!==t.id&&(this.Z(p.MediaType.Audio,e),this.a.eventHandler.dispatchEvent(l.PlayerEvent.AudioQualityChanged,{sourceQuality:n,sourceQualityId:n.id,targetQuality:t,targetQualityId:t.id}))},e.prototype.getAudioQuality=function(){var e=this.sb(p.MediaType.Audio),t=this.a.serviceManager.get(u.ServiceName.AdaptationService),i=t.isAuto(e),n=t.getCurrentRepresentationId(e);return i||null===n?V:this.getAvailableAudioQualities().find(function(e){return e.id===n.representationId})},e.prototype.Z=function(e,t){var i=this.sb(e);this.a.serviceManager.get(u.ServiceName.AdaptationService).setFixedRepresentation(i,t)},e.prototype.setVideoQuality=function(e){var t,i=this.getAvailableVideoQualities(),n=this.getVideoQuality();(t="auto"===e?q:i.find(function(t){return t.id===e}))&&n.id!==t.id&&(this.a.eventHandler.dispatchEvent(l.PlayerEvent.VideoQualityChanged,{sourceQuality:n,sourceQualityId:n.id,targetQuality:t,targetQualityId:t.id}),this.Z(p.MediaType.Video,e))},e.prototype.getVideoQuality=function(){var e=this.sb(p.MediaType.Video),t=this.a.serviceManager.get(u.ServiceName.AdaptationService),i=t.isAuto(e),n=t.getCurrentRepresentationId(e);return i||null===n?q:this.getAvailableVideoQualities().find(function(e){return e.id===n.representationId})},e.prototype.kb=function(){var e=this.a.sourceContext;e.source&&e.source.options&&e.source.options.headers&&(this.d.HTTP_HEADERS=e.source.options.headers)},e.prototype.lb=function(e,t){var i=this.qb(t);if(void 0!==i)if(e.type===p.StreamType.Hls&&C.ModuleManager.has(E.ModuleName.HLS)&&!i.hasReducer("hls")){var n=C.ModuleManager.get(E.ModuleName.HLS);i.addReducers(r(r({},w.engineBitmovinSourceReducers),{hls:n.HlsReducer}))}else i.addReducers(w.engineBitmovinSourceReducers)},e.prototype.mb=function(){this.e.on(P.MediaElementEvent.error,this.J),this.e.on(P.MediaElementEvent.timeupdate,this.Bb),this.e.on(P.MediaElementEvent.seeking,this.Ab),this.e.on(P.MediaElementEvent.playing,this.T),this.e.on(P.MediaElementEvent.play,this.U),this.e.on(P.MediaElementEvent.pause,this.V)},e.prototype.nb=function(){this.e.off(P.MediaElementEvent.error,this.J),this.e.off(P.MediaElementEvent.timeupdate,this.Bb),this.e.off(P.MediaElementEvent.seeking,this.Ab),this.e.off(P.MediaElementEvent.playing,this.T),this.e.off(P.MediaElementEvent.play,this.U),this.e.off(P.MediaElementEvent.pause,this.V)},e.prototype.ob=function(){this.b.debug("setting bitrate boundaries for audio to "+this.d.MIN_SELECTABLE_AUDIO_BITRATE+" - "+this.d.MAX_SELECTABLE_AUDIO_BITRATE),this.b.debug("setting bitrate boundaries for video to "+this.d.MIN_SELECTABLE_VIDEO_BITRATE+" - "+this.d.MAX_SELECTABLE_VIDEO_BITRATE)},e.prototype.pb=function(e,t){var i,n=this;return this.l===o.Unloaded?Promise.reject("Unload during load"):(this.A(e,this.a),this.a.sourceContext.source=e.config,(null==(i=this.a.videoElement)?void 0:i.eventHandler)&&this.a.videoElement.eventHandler.reset(),this.i=e,this.m=!1,this.n=!1,this.r=void 0,this.a.store.dispatch((0,v.updateSeekingProcess)({isInitial:!0})),this.ob(),this.u&&(this.t=l.LatencyMode.Suspended,this.u.reset()),this.d.GLOBAL_DISABLE_SEEKING=t||!1,this.l=o.Loading,this.mb(),this.k.init(e).then(function(){n.l===o.Loading&&(n.l=o.Loaded,n.Hb())}))},e.prototype.prepareSource=function(e,t){this.lb(e,t.sourceIdentifier),this.B(e,this.a,t);var i,n=this.a.serviceManager.get(u.ServiceName.ManifestUpdateSchedulingService,t.sourceIdentifier);return(null==n?void 0:n.isInitiated())?Promise.resolve():null!=(i=null==n?void 0:n.init(e.url.toString()))?i:Promise.resolve()},e.prototype.prepareLoad=function(){var e=this.a.serviceManager.get(u.ServiceName.PlayerStateService);e&&(this.v=e);var t=Promise.resolve();return this.l===o.Loading&&(t=this.unload()),this.v.reset(),this.l=o.Preparing,t},e.prototype.load=function(e,t){var i,n=this;if("dash"!==e.type&&"hls"!==e.type&&"smooth"!==e.type)return Promise.reject("invalid source");this.lb(e),this.kb(),this.w=(0,T.subscribe)(this.a.store)(function(e){return(0,y.getIsStopped)((0,y.getPlayerState)(e))},this.Cb,function(e){return!0===e}),this.f.on(l.PlayerEvent.DVRWindowExceeded,this.Db,!0),this.f.on(l.PlayerEvent.Error,this.Fb,!0);var r=null!=(i=null==t?void 0:t.seeking)&&i;return this.e.ready().then(function(){return n.pb(e,r)})},e.prototype.qb=function(e){return this.a.serviceManager.get(u.ServiceName.SourceStoreService,null!=e?e:this.a.sourceContext.sourceIdentifier)},e.prototype.unload=function(e){var t,i=this;if(this.Gb(),this.l===o.Unloaded)return Promise.resolve();var n=this.l===o.Loaded;this.m=!1,this.l=o.Unloaded,this.j=!0,this.nb(),null==this||this.w(),this.f.off(l.PlayerEvent.DVRWindowExceeded,this.Db),this.f.off(l.PlayerEvent.Error,this.Fb);var r=this.a.settings.ENABLE_SOURCEBUFFER_REUSE_ON_CONTENT_SWITCH&&K(e)&&!(C.ModuleManager.has(E.ModuleName.Advert
vendor: 6,092 bytes, line 1
1ising)&&void 0!==(null==(t=C.ModuleManager.get(E.ModuleName.Advertising))?void 0:t.imaMarker)),a=this.v.isPlay();(this.v.isPlaying()||a&&r)&&this.e.pause(),this.v.reset();var s=this.a.sourceContext.sourceIdentifier;return this.a.serviceManager.has(u.ServiceName.SynchronizedTimeService,s)&&!K(e)&&this.a.serviceManager.get(u.ServiceName.SynchronizedTimeService,s).reset(),this.Ib(),(this.k?this.k.terminate(r):Promise.resolve()).then(function(){i.i=void 0,i.F(e),K(e)||Y(e)||(i.qb().dispatch((0,N.clearActiveTracksAction)()),i.Q(null),i.a.store.dispatch((0,S.resetDrmKidErrors)())),n&&i.f.dispatchEvent(l.PlayerEvent.SourceUnloaded)})},e.prototype.rb=function(){return this.k.isInitialized()},e.prototype.isPlaying=function(){return this.v.isPlaying()},e.prototype.isPaused=function(){return this.v.isPaused()},e.prototype.hasEnded=function(){return this.m},e.prototype.isMuted=function(){return this.e.isMuted()},e.prototype.isStalled=function(){return this.v.isStalled},e.prototype.isLive=function(){var e,t;return null!=(t=null==(e=(0,_.getManifestService)(this.a))?void 0:e.isLive())&&t},e.prototype.getVolume=function(){return this.e.getVolume()},e.prototype.getCurrentTime=function(e){void 0===e&&(e=p.TimeMode.AbsoluteTime);var t,i=null!=(t=this.P())?t:0;return!this.isLive()&&this.hasEnded()?e===p.TimeMode.RelativeTime?this.getDuration():this.getDuration()+i:e===p.TimeMode.RelativeTime?Math.max(0,this.k.getCurrentTime()-i):this.k.getCurrentTime()},e.prototype.getDuration=function(){var e,t;return null!=(t=null==(e=(0,_.getManifestService)(this.a))?void 0:e.getDuration())?t:0},e.prototype.getAvailableVideoQualities=function(){var e=(0,_.getManifestService)(this.a);return this.rb()&&e?e.getVideoRepresentations(this.getCurrentPlayingPeriodId()):[]},e.prototype.getAvailableSegments=function(){return this.rb()?this.k.getAvailableSegments():{}},e.prototype.getAvailableAudioQualities=function(){var e=this.getAudio(),t=(0,_.getManifestService)(this.a);if(!this.rb()||!e||!t)return[];var i=t.getAudioRepresentations(this.getCurrentPlayingPeriodId());return i[e.id]?i[e.id]:[]},e.prototype.getDroppedVideoFrames=function(){return this.e.getDroppedVideoFrames()},e.prototype.setTargetBufferLevel=function(e,t,i){this.a.bufferSettings.setTargetLevel(e,t,i)},e.prototype.getBufferLevel=function(e,t){var i={level:null,targetLevel:this.a.bufferSettings.getTargetLevel(e,t),type:e,media:t},n=this.e.getCurrentTime(),r=(0,g.getMetricsState)(this.a.store.getState()),o=Object.keys(r).find(function(e){return M.MimeTypeHelper.isVideo(e)}),a=Object.keys(r).find(function(e){return M.MimeTypeHelper.isAudio(e)});return t===p.MediaType.Video&&o?i.level=this.k.getBufferLevel(o,n,e):t===p.MediaType.Audio&&a&&(i.level=this.k.getBufferLevel(a,n,e)),i},e.prototype.getTotalStalledTime=function(){var e=(0,g.getMetricsState)(this.a.store.getState());for(var t in e)if(e[t]){var i=(0,g.getMetricsLastEntry)(e,t,m.MetricType.StalledSeconds);if(i&&i.value&&!isNaN(i.value))return Math.round(100*i.value)/100}return 0},e.prototype.sb=function(e){return Object.keys((0,g.getMetricsState)(this.a.store.getState())).find(function(t){return t.includes(e)})},e.prototype.getDownloadedData=function(e){var t=this.sb(e),i=r({},this.ub(t)),n=r({},this.tb(t));return n.id&&(n.id=""+n.id),void 0===n.width&&void 0!==i.width&&(n.width=i.width),n.width=parseInt(""+n.width),void 0===n.height&&void 0!==i.height&&(n.height=i.height),n.height=parseInt(""+n.height),void 0===n.bitrate&&void 0!==i.bitrate&&(n.bitrate=i.bitrate),n.bitrate=parseInt(""+n.bitrate),n.isAuto=this.a.serviceManager.get(u.ServiceName.AdaptationService).isAuto(t),n},e.prototype.tb=function(e){if(this.k.hasStarted()){var t=(0,g.getMetricsState)(this.a.store.getState());if(t[e])return(0,g.getMetricsLastEntry)(t,e,m.MetricType.DownloadedRepresentation).value}return{}},e.prototype.ub=function(e){if(this.k.hasStarted()){var t=(0,g.getMetricsState)(this.a.store.getState());if(t[e])return(0,g.getMetricsLastEntry)(t,e,m.MetricType.DownloadedAdaptationSet).value}return{}},e.prototype.getDownloadedVideoData=function(){var e=this.getDownloadedData(p.MediaType.Video),t=!0;return e.hasOwnProperty("isAuto")&&(t=e.isAuto),e&&(e.bitrate||e.id)?{id:e.id,bitrate:e.bitrate,height:e.height,width:e.width,isAuto:t}:{id:"",bitrate:0,height:0,width:0,isAuto:!0}},e.prototype.getDownloadedAudioData=function(){var e=this.getDownloadedData(p.MediaType.Audio),t=!0;return e.hasOwnProperty("isAuto")&&(t=e.isAuto),e&&(e.bitrate||e.id)?{id:e.id,bitrate:e.bitrate,isAuto:t}:{id:"",bitrate:0,isAuto:!0}},e.prototype.getPlaybackVideoData=function(){var e=this.k.getPlaybackRepresentation(p.MediaType.Video)||{},t=isNaN(e._height)?0:Number(e._height),i=isNaN(e._width)?0:Number(e._width),n={id:e._id+"",bitrate:Number(e._bandwidth)||0,frameRate:e._frameRate,height:t,width:i,uid:e.uid,colorInfo:(0,O.toVideoColorInfo)(e)};return e._codecs&&(n.codec=b.CodecStringHelper.getExtractedCodecStrings(e._codecs).video),n},e.prototype.getPlaybackAudioData=function(){var e,t={id:String(void 0),bitrate:Number(void 0)},i=this.k.getPlaybackRepresentation(p.MediaType.Audio);return i&&null!=(e=(0,O.representationToQuality)(i,i._mimeType))?e:t},e.prototype.setQueryParameters=function(e){this.d.QUERY_PARAMETERS=e},e.prototype.clearQueryParameters=function(){this.d.QUERY_PARAMETERS=void 0},e.prototype.vb=function(e){this.v&&this.v.isTimeShifting()&&(this.v.transitionToTimeShiftedState(e),this.h=-1)},e.prototype.wb=function(){this.vb(!1)},e.prototype.xb=function(e){this.vb(e)},e.prototype.getMaxTimeShift=function(){if(this.isLive()&&this.rb())return this.c.playback&&!1===this.c.playback.timeShift?0:this.k.getMaxTimeShift()},e.prototype.timeShift=function(e,t){var i=this;if(void 0===t&&(t=""),this.rb()&&0>=this.getMaxTimeShift()){-1===this.h&&(this.h=this.getCurrentTime(),0===this.h&&(this.h=this.k.getTimeShiftLiveEdge())),this.Lb();var n=this.k.getPlaybackTimeForTimeShiftOffset(e),r=![d.STARTUP_ISSUER_NAME,d.INTERNAL_ISSUER_NAME].includes(t);this.v.transitionToTimeShiftingState(this.h,n,t||d.API_ISSUER_NAME,r),this.k.timeShift(e,function(){return i.xb(r)}
1).catch(function(){return i.wb()})}},e.prototype.getTimeShift=function(){return this.rb()?this.k.getTimeShift():0},e.prototype.addSubtitle=function(e){var t=this;return this.rb()&&this.s?Promise.resolve(void 0).then(function(){t.s.addExternalSubtitle(e)}):Promise.reject(void 0)},e.prototype.removeSubtitle=function(e){this.rb()&&this.s&&this.s.removeSubtitle(e)},e.prototype.enableSubtitle=function(e){return this.rb()&&this.s?this.s.enableSubtitle(e):Promise.resolve(!1)},e.prototype.disableSubtitle=function(e){return this.rb()&&this.s?this.s.disableSubtitle(e):Promise.resolve(!1)},e.prototype.listSubtitles=function(){return this.rb()&&this.s&&this.k?this.s.getAvailableSubtitles(this.getCurrentPlayingPeriodId()):[]},e.prototype.setAudio=function(e){var t=this;if(this.rb()&&this.k&&"string"==typeof e){var i=this.getAudio();if(i&&i.id===String(e))return;this.k.setAudio(e).then(function(){var e=t.getAudio();e&&i&&e.id!==i.id&&t.a.eventHandler.dispatchEvent(l.PlayerEvent.AudioChanged,{targetAudio:e,sourceAudio:i,time:t.e.getCurrentTime()})}).catch(function(e){t.b.debug("setAudio failed for lang ",e)})}},e.prototype.getAvailableAudio=function(){return this.rb()&&this.k?this.k.getAvailableAudio(this.getCurrentPlayingPeriodId()).map(this.yb):[]},e.prototype.getAudio=function(){if(this.rb()&&this.k){var e=this.k.getAudio();if(e)return this.yb(e)}return null},e.prototype.getManifest=function(){var e,t=null==(e=(0,_.getManifestService)(this.a))?void 0:e.getManifest();if(t)return t._isHls?this.zb():t.originalDashManifest},e.prototype.zb=function(){return C.ModuleManager.get(E.ModuleName.HLS).selectors.getHlsState(this.qb().getState()).masterPlaylist.string},e.prototype.getBufferedRanges=function(){var e=this.k.getBufferedRanges(!0);return a.BufferRangeHelper.getCommonBufferedRanges(e).map(function(e){return{start:e.getStart(),end:e.getEnd()}})},e.prototype.getSnapshot=function(e,t){if(this.isPlaying()||this.isPaused())return this.e.getSnapshotData(e,t)},e.prototype.setPlaybackSpeed=function(e,t,i){void 0===t&&(t=1),void 0===i&&(i=!0),this.e.setPlaybackSpeed(e*t),this.v.playbackSpeed!==this.e.getPlaybackSpeed()&&this.v.setPlaybackSpeed(e,t,i)},e.prototype.getPlaybackSpeed=function(){return this.v.playbackSpeed},e.prototype.permitControl=function(e){this.o=e},e.prototype.getSeekableRange=function(){return(!this.isLive()||this.d.ENABLE_SEEK_FOR_LIVE)&&this.k?this.k.getSeekableRange():{start:-1,end:-1}},e.prototype.createManifestApi=function(){return D.MediaPlayerManifestApiFactory.create(this,this.a)},e.prototype.Eb=function(){var e=this.k.getTimeShiftHandler(),t=this.getMaxTimeShift()+e.getMinSegmentDuration(),i=this.k.getPlaybackTimeForTimeShiftOffset(t),n=e.isTimeInBufferedRange(i);this.a.logger.debug("Handling DVRWindowExceeded - TimeShifting to ".concat(n?t:"live edge")),this.timeShift(n?t:0)},e.prototype.getLatency=function(){var e;return null==(e=this.u)?void 0:e.getLatency()},e.prototype.setTargetLatency=function(e){var t=(0,_.getManifestService)(this.a);if(this.u&&t){var i=Math.abs(t.getTimeShiftBufferDepthSeconds());e>i&&(e=i,this.b.debug("Tried to set target latency outside DVR window, corrected to lower bound",i)),this.a.eventHandler.dispatchEvent(l.PlayerEvent.TargetLatencyChanged,{from:this.u.getTargetLatency(),to:e}),this.u.setTargetLatency(e)}},e.prototype.getTargetLatency=function(){var e;return null==(e=this.u)?void 0:e.getTargetLatency()},e.prototype.setCatchupConfig=function(e){var t;null==(t=this.u)||t.setCatchupConfig(e)},e.prototype.getCatchupConfig=function(){var e;return null==(e=this.u)?void 0:e.getCatchupConfig()},e.prototype.setFallbackConfig=function(e){var t;null==(t=this.u)||t.setFallbackConfig(e)},e.prototype.getFallbackConfig=function(){var e;return null==(e=this.u)?void 0:e.getFallbackConfig()},e.prototype.release=function(e){var t,i=this;return this.f.off(l.PlayerEvent.PeriodSwitch,this.Jb),this.f.off(l.PlayerEvent.PeriodSwitched,this.Kb),this.f.off(l.PlayerEvent.PlaybackSpeedChanged,this.Mb),this.x(),null==(t=this.z)||t.call(this),this.unload(e).then(function(){return i.v=null,i.k=(0,c.dispose)(i.k),i.e.release().then(function(){return i.e=null})})},e.prototype.Gb=function(){this.y&&(this.y(),this.y=void 0)},e.prototype.Hb=function(){for(var e=this.getCurrentTime(),t=0,i=this.getAvailableAudio();t<i.length;t++){var n=i[t];this.a.eventHandler.dispatchEvent(l.PlayerEvent.AudioAdded,{track:n,time:e})}},e.prototype.Ib=function(){for(var e=this.getCurrentTime(),t=0,i=this.getAvailableAudio();t<i.length;t++){var n=i[t];this.a.eventHandler.dispatchEvent(l.PlayerEvent.AudioRemoved,{track:n,time:e})}},e.prototype.Lb=function(){var e=this;!this.z&&this.a.store&&(this.z=(0,y.subscribeToSeekedOrTimeshifted)(this.a.store,function(){var t;null==(t=e.z)||t.call(e),e.z=void 0,e.M()?e.N():e.O()}))}
vendor: 4,962 bytes, line 1
1,e.prototype.getCurrentPlayingPeriodId=function(){return(0,F.getPlayingPeriodId)(this.qb().getState())},e.prototype.updateCallback=function(e){},e.prototype.onFullscreenEnter=function(){},e.prototype.onFullscreenExit=function(){},e.prototype.isAirplayAvailable=function(){return!1},e.prototype.isAirplayActive=function(){return!1},e.prototype.showAirplayTargetPicker=function(){},e}()},52090:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MediaPlayerController=void 0,t.isBufferChangeRequired=q;var n=i(4524),r=i(80813),o=i(56481),a=i(9768),s=i(3714),u=i(44468),c=i(70962),d=i(91678),l=i(23690),h=i(87827),p=i(15971),f=i(77179),g=i(93204),m=i(34047),v=i(79721),y=i(78877),S=i(87244),T=i(85434),b=i(28334),M=i(19274),I=i(88052),P=i(62756),C=i(35046),E=i(12030),A=i(87222),R=i(13422),_=i(16197),B=i(84696),D=i(14443),O=i(58784),L=i(11536),k=i(36193),x=i(62198),N=i(42208),w=i(88935),F=i(13114),H=i(39523),U=i(99529),G=i(52602),Z=i(69102),j=i(60729);function V(e){var t=I.ModuleManager.get(P.ModuleName.HLS,!1),i=null==t?void 0:t.M3u8Loader;return void 0!==i&&e instanceof i}function q(e,t){return!(0,Z.areAudioMimeCodecsCompatible)({mimeType:e._mimeType,codec:(0,R.getCodecsFromAdaptationSet)(e)},{mimeType:t._mimeType,codec:(0,R.getCodecsFromAdaptationSet)(t)})}function K(e,t){var i=e.getPlaybackTimeRange(),n=(0,U.getTrackIdentifier)(e.getSegmentInfo());i&&(null==t||t.dispatch((0,H.removeStreamTimeRange)(n,i,U.StreamTimeRangeType.Loading)))}t.MediaPlayerController=function(){function e(e,t){var i=this;this.FC={},this.eC=function(e,t){if(void 0===t||t===i.yC.sourceContext)if(i.EC.isBufferClearingOngoing())K(e,i.fC());else{if(i.VC.trackSegment(e),i.dC(e))return i.yC.logger.debug("Dropping segment ".concat(e.getUrl())),void K(e,i.fC());var n=e.getMimeType(),r=i.FC[n];r&&i.gC(r)&&i.aC(e.getPeriodId()),i.EC.addSegment(e).then(function(){var e;null==(e=i.RC)||e.beat()}).catch(function(e){i.jB&&i.jB.debug("Failed to add segment to buffer",e)}),i.zC(e)}else i.yC.logger.debug("Dropping segment from stale source: ".concat(e.getUrl()))},this.MD=function(){var e=i.EC.getBufferedRangesMap(),t=Math.max.apply(Math,Object.values(e).filter(function(e){return e.length>0}).map(function(e){return e[e.length-1].start}));i.seek(t,!1,!0)},this.ND=function(){var e;i.PD(),i.BC&&i.rC(),i.OD(),i.BC&&(i.getAllSegmentControllers().forEach(function(e){return e.updateMpd()}),null==(e=i.TC)||e.onManifestUpdate()),i.yC.serviceManager.get(r.ServiceName.TimedMetadataService).parseEventStream()},this.dD=function(){(i.hasStreamEnded()||i.isInitialized()&&!i.JC.isPlaying())&&i.start()},this.jD=function(e){var t;if(e){if(e.success||408===e.httpStatus){var n=i.FC[e.mimeType];n&&i.kD(e,n)}e.success||null==(t=i.RC)||t.beat()}},this.lD=function(){i.getAllSegmentControllers().every(function(e){var t=i.SC.getTimeForNextSegment(e.getMimeType());return e.hasNext(t)})?i.jB.debug("ignoring ended event in firePlaybackFinishedEvent as there are more segments available"):i.IC.isLastPeriod(i.KC.getCurrentPlayingPeriodId())?i.EC.hasFutureBufferBlockData()||(i.stop(),i.jB.debug("Stopping buffer controller"),i.EC.stop(!0),i.JC.transitionToStoppedState()):i.jB.debug("ignoring ended event in firePlaybackFinishedEvent as there is a future period")},this.yC=e,this.jB=e.logger,this.uC=e.settings,this.vC=e.bufferSettings,this.wC=e.eventHandler,this.xC=e.renderer,this.zC=t,this.BC=!1,this.AC=null,this.CC={},this.DC=0,this.NC=!1,this.MC=!1,this.WC=new L.PlayerConfigEnhancer(e)}return e.prototype.aC=function(e){this.EC.addRequiredMediaType(e,"video/mp4"),this.EC.addRequiredMediaType(e,"audio/mp4")},e.prototype.bC=function(){var e=this,t=this.IC.isLive(),i=t?this.getTimeShift():this.xC.getCurrentTime();t?this.timeShift(i,function(){},!0).catch(function(t){return e.yC.logger.debug("TimeShift failed",t)}):this.seek(i,!1,!1,!0)},e.prototype.cC=function(){this.bC(),this.yC.logger.debug("manifest update interrupted by DRM key status change")},e.prototype.dC=function(e){var t=T.MimeTypeHelper.isSubtitle(e.getMimeType()),i=this.yC.sourceContext.technology.streaming===u.StreamType.Hls,n=(0,f.getStartTimeOffset)(this.fC().getState())+this.IC.getDuration(),r=this.isVod()&&e.getPlaybackTime()>=n,o=this.NC||r,a=this.IC.isRepresentationExcluded(e.getRepresentationId());return!t&&!i&&o||a},e.prototype.fC=function(){return this.yC.serviceManager.get(r.ServiceName.SourceStoreService,this.yC.sourceContext.sourceIdentifier)},e.prototype.gC=function(e){var t=m.CodecStringHelper.getExtractedCodecStrings(e.getCodecs());return!!(t.video&&t.audio)},e.prototype.getMaxTimeShift=function(){return this.getTimeShiftHandler().getMaxTimeShift()},e.prototype.hC=function(){this.wC.off(s.PlayerEvent.SegmentRequestFinished,this.jD)},e.prototype.iC=function(){var e=this,t=this.yC.store;!this.ZC&&t&&(this.ZC=(0,g.subscribe)(t)(function(e){if(e)return(0,h.getPlayerState)(e).seekingProcess},function(t,i){return t&&i&&e.gD(t,i)}))},e.prototype.jC=function(){var e=this.fC();
1!this.XC&&e&&(this.XC=(0,g.subscribe)(e)(x.getManifest,this.ND,function(e,t){return e.isInitialized&&!t.isInitialized}))},e.prototype.kC=function(){this.XC&&(this.XC(),this.XC=null)},e.prototype.lC=function(){var e=this.fC();!this.YC&&e&&(this.YC=(0,g.subscribe)(e)(w.getPlayingTracksState,this.dD,w.wasSwitchingToPeriodIdReset))},e.prototype.mC=function(){this.YC&&(this.YC(),this.YC=void 0)},e.prototype.nC=function(e){var t,i,n=e._mimeType;if(T.MimeTypeHelper.isAV(n)){this.yC.store.dispatch((0,d.initializeMetricsForMimeType)(n,this.yC.settings)),this.fC().dispatch((0,k.setMediaTypeAction)(e._internalId,(0,B.resolveMediaTypes)(e))),this.CC[n]=(0,R.getCodecsFromAdaptationSet)(e);var r=this.KC.getCurrentPlayingPeriodId();this.FC[n]=new D.SegmentController(this.yC,this.eC,n,this.CC[n],e.isTransmuxingRequired,this.GC,null!=(t=e._periodId)?t:r,this.fC()),null==(i=this.TC)||i.updateSegmentControllers(this.FC),this.OC&&this.FC[n].setTransmuxer(this.OC),r&&this.xC.storeDrmInitDataFromManifest(e),this.yC.segmentInfoService&&this.yC.segmentInfoService.setSegmentControllers(Object.values(this.FC))}},e.prototype.updatePeriodForTimeshift=function(e,t,i){var n,r=this.KC.getCurrentPlayingPeriodId();r||this.KC.setCurrentPlayingPeriodId(e),this.KC.getCurrentLoadingPeriodId()!==e&&i&&this.switchLoadingPeriodForAllMedia(e),t&&r!==e&&(this.yC.logger.debug("Updating current playing period to ".concat(e)),this.KC.setCurrentPlayingPeriodId(e)),r!==e&&(null==(n=(0,p.getSourceStore)(this.yC))||n.dispatch((0,N.periodSwitchStarted)(e)))},e.prototype.oC=function(e){var t=e.AdaptationSet.find(function(e){return T.MimeTypeHelper.isVideo(e._mimeType)});t&&this.EC.addRequiredMediaType(e._id,t._mimeType);var i=e.AdaptationSet.find(function(e){return T.MimeTypeHelper.isAudio(e._mimeType)});i&&this.EC.addRequiredMediaType(e._id,i._mimeType)},e.prototype.pC=function(e){var t=this;e.AdaptationSet.filter(function(e){return T.MimeTypeHelper.isSubtitle(e._mimeType)}).forEach(function(i){t.EC.addRequiredMediaType(e._id,i._mimeType)})},e.prototype.qC=function(e){this.oC(e),this.pC(e)},e.prototype.rC=function(){var e=this;
1this.IC.getAllPeriods().forEach(function(t){e.qC(t),e.EC.checkIfEndOfBufferReached(e.uC.END_OF_BUFFER_TOLERANCE,!0)})},e.prototype.sC=function(){var e=this;return this.AC?this.AC:!0===this.BC||null===this.IC.getManifest()?this.AC=Promise.resolve():(this.tC(),this.CC={},this.AC=this.xC.ready().then(function(){return e.GD()}))},e.prototype.tC=function(){var e=this;this.FC&&(Object.keys(this.FC).forEach(function(t){return e.FC[t].dispose()}),this.FC={})},e.prototype.ED=function(){var e=this;if(I.ModuleManager.has(P.ModuleName.ContainerTS)){var t=I.ModuleManager.get(P.ModuleName.ContainerTS);this.getAllSegmentControllers().filter(function(e){return e.isTransmuxerRequired()}).forEach(function(i){e.OC=e.OC||new t.WebWorkerTransmuxer(e.yC,e.FD()),i.setTransmuxer(e.OC)}),this.PC&&this.PC.setTransmuxer(this.OC)}},e.prototype.FD=function(){return this.getAllSegmentControllers().filter(function(e){return T.MimeTypeHelper.isAV(e.getMimeType())}).length>1},e.prototype.GD=function(){var e=this;return this.KC.setInitialPeriod(),this.LD().then(function(){e.rC();var t=e.KC.getCurrentPlayingPeriod()||e.IC.getFirstPeriod();t&&e.ID(t),e.HD(),e.ED(),e.BC=!0})},e.prototype.HD=function(){var e,t,i,n,r=this.getAudioSegmentController();if(this.PC){var o=null!=(i=null==(t=null==(e=null==r?void 0:r.getCurrentLangObj)?void 0:e.call(r))?void 0:t.lang)?i:null==(n=(0,A.getPreferredLanguage)("audio/mp4"))?void 0:n.language;this.PC.enableForcedSubtitle(o)}},e.prototype.ID=function(e){var t,i=this;this.JD(null!=(t=null==e?void 0:e.AdaptationSet)?t:[]).forEach(function(e){return i.KD(e)})},e.prototype.JD=function(e){var t,i,n,r=e.find(function(e){return T.MimeTypeHelper.isAudio(e._mimeType)}),o=e.find(function(e){return T.MimeTypeHelper.isVideo(e._mimeType)}),a=(null!=(i=null==(t=null==o?void 0:o.ContentComponent)?void 0:t.length)?i:0)>1;if(!r||!o||!a)return e;var s=(0,A.getHlsDefaultLanguage)(r._mimeType,this.fC().getState()),u=null==(n=o.ContentComponent)?void 0:n.find(function(e){return e._lang===(null==s?void 0:s.language)&&e._id===(null==s?void 0:s.name)});return s&&u?[o]:e},e.prototype.KD=function(e){var t=e._mimeType;(0,T.isMediaTypeContained)(Object.keys(this.CC),t)||this.nC(e)},e.prototype.LD=function(){var e,t,i=this;if((null==(e=this.EC)?void 0:e.isSuspended())&&this.EC.canRestoreFromSuspended()){var n=null==(t=this.fC())?void 0:t.getState(),r=n?(0,f.getStartTimeOffset)(n):0;return this.EC.restore(this.IC.getTotalDuration(),this.KC.getCurrentPlayingPeriodId(),r)}var o=Promise.resolve();return this.EC&&(this.EC.isSuspended()&&(o=this.xC.shutdown(!1).catch(function(e){i.jB.debug("Error during renderer shutdown when trying to re-initialize: ",e)})),this.EC.dispose()),o.then(function(){i.EC=new C.BufferController(i.yC,i.MD,i.IC.getTotalDuration(),i.KC.getCurrentPlayingPeriodId())})},e.prototype.getBufferLevel=function(e,t,i,n){return void 0===n&&(n=!0),this.EC?this.EC.getOverallBufferLevel(e,t,i,n):0},e.prototype.OD=function(){var e=this;this.yC.serviceManager.maybeCall(r.ServiceName.ThumbnailService,function(t){e.yC.sourceContext.source&&e.yC.sourceContext.source.thumbnailTrack||t.addThumbnails(e.IC.getAllDashThumbnailSources())})},e.prototype.PD=function(){var e=this.IC.isLive(),t=this.yC.serviceManager.get(r.ServiceName.StartOffsetService),i=this.IC.hasSuggestedStartPosition();if(e){var n=this.IC.getTimeShiftBufferDepthSeconds();0!==n&&(this.QC.expirationTimeInSeconds=n),i&&(t.manifestStartOffset=this.IC.getLiveStartOffset(),this.QD())}else i&&(t.manifestStartOffset=this.IC.getVodStartOffset())},e.prototype.QD=function(){if(!this.isInitialized()){var e=Math.abs(this.IC.getLiveStartOffset(!1));e=e>0?e:this.IC.getMaxSegmentDuration(),this.yC.bufferSettings.setDistanceToLiveEdge(e)}},e.prototype.terminate=function(e){var t,i=this;this.jB.debug("stopping playback"),this.stop(),this.getAllSegmentControllers().forEach(function(e){return e.stop()}),this.EC&&(e?this.EC.suspend():this.EC.stop(!0)),this.OC=(0,o.dispose)(this.OC),this.TC=(0,o.dispose)(this.TC),this.VC=(0,o.dispose)(this.VC),(0,o.dispose)(this.KC),this.UC=null,this.xC.off(M.MediaElementEvent.ended,this.lD);var n=e?Promise.resolve():this.xC.shutdown(!1).catch(function(e){return i.jB.debug("Got an error on shutdown",{message:e.message}),Promise.resolve()});return this.hC(),this.mC(),this.BC=!1,null==(t=this.KC)||t.setCurrentPlayingPerio
1dId(void 0),this.CC=null,this.tC(),n},e.prototype.dispose=function(){this.TC=(0,o.dispose)(this.TC),this.EC=(0,o.dispose)(this.EC),(0,o.dispose)(this.KC);try{this.hC()}catch(e){}this.kC(),this.mC(),this.tC(),this.ZC&&this.ZC(),this.PC=null,this.RC=null,this.SC=null,this.FC=null,this.uC=null,this.vC=null,this.wC=null,this.xC=null,this.CC=null},e.prototype.RD=function(){var e=this.yC.sourceContext.sourceIdentifier;this.IC=this.yC.serviceManager.get(r.ServiceName.ManifestService,e),this.JC=this.yC.serviceManager.get(r.ServiceName.PlayerStateService),this.PC=this.yC.serviceManager.get(r.ServiceName.SubtitleService,e),this.QC=this.yC.serviceManager.get(r.ServiceName.MetadataParsedService),this.GC=this.yC.serviceManager.get(r.ServiceName.ManifestLoadingService,e),this.RC=this.yC.serviceManager.get(r.ServiceName.HeartbeatService,e),this.SC=this.yC.serviceManager.get(r.ServiceName.StreamTimeService),this.HC=this.yC.serviceManager.get(r.ServiceName.ManifestUpdateSchedulingService,e)},e.prototype.init=function(e){var t,i=this,n=this.fC();this.KC=new O.PeriodSwitchTracker(this.yC),this.lC(),this.iC(),this.LC=!1,this.RD(),n&&!this.VC&&(this.VC=new E.DrmKidErrorHandler(this.yC,function(){return i.cC()})),this.xC.on(M.MediaElementEvent.ended,this.lD);var o=this.HC.isInitiated()?Promise.resolve():this.HC.init(e.url.toString());e.config.drm&&(null==(t=this.yC.serviceManager.get(r.ServiceName.DrmService))||t.resolveDrmSystemFromSourceConfig(e.config.drm));var a=this.yC.settings.MAX_STARTUP_BUFFER,s=c.DefaultSettings.MAX_STARTUP_BUFFER;return s!==1/0&&a<s&&this.jB.debug("MAX_STARTUP_BUFFER (".concat(a," s) is below the recommended startup buffer for this platform (").concat(s," s). Playback may stall on initial play.")),o.then(function(){return i.jC(),i.ND(),i.WC.adjustToCurrentSource(i.yC,i.IC),i.BC?Promise.resolve():i.sC()})},e.prototype.stop=function(){var e;this.jB.debug("Stopping main timer"),null==(e=this.RC)||e.stop(),this.AC=null,this.wC.off(s.PlayerEvent.SegmentRequestFinished,this.jD),this.kC()},e.prototype.isOneLoaderReady=function(){return this.getAllSegmentControllers().some(function(e){return e.canLoad()})},e.prototype.areAllLoadersReady=function(){return this.getAllSegmentControllers().every(function(e){return e.canLoad()})},e.prototype.isVod=function(){return!this.IC.isLive()},e.prototype.SD=function(){return this.JC.isPaused()&&this.uC.STOP_DOWNLOAD_ON_PAUSE&&this.IC.isLive()},e.prototype.TD=function(e){var t=Object.keys(this.FC).find(function(t){return T.MimeTypeHelper.isAV(t)&&e!==t});if(!t||(0,j.isPlayingLowLatencyHls)(this.yC))return!1;if(this.LC)return T.MimeTypeHelper.isAudio(t);var i=this.FC[t],n=this.SC.getTimeForNextSegment(t);if(i.hasNext(n)&&!i.hasDownloadError&&!i.hasDelayedSegmentsInTransmuxer()){var r=this.getBufferRelevantTime(),o=this.aD(e,r),a=this.aD(t,r);return this.uC.DISABLE_PARALLEL_SEGMENT_LOADING&&o===a?T.MimeTypeHelper.isVideo(t):!this.UD(t,a)&&n<this.SC.getTimeForNextSegment(e)}return i.getCurrentPeriodId()!==this.FC[e].getCurrentPeriodId()},e.prototype.UD=function(e,t){var i=T.MimeTypeHelper.getMediaType(e);return t>=this.vC.getForwardTargetLevel(i)},e.prototype.VD=function(){var e=this,t=this.getAllSegmentControllers(),i=this.EC.hasPendingSegments(),n=t.map(function(e){return e.getMimeType()}),r=t.some(function(e){return e.hasPendingSegments()}),o=n.some(function(t){return e.xC.isDataBeingAppended(t)});return!r&&!i&&!o},e.prototype.shouldSuspendHeartbeat=function(){return!this.isOneLoaderReady()||this.SD()||this.EC.isBufferClearingOngoing()||this.MC},e.prototype.getActiveSegmentControllers=function(){var e=this;return this.getAllSegmentControllers().filter(function(t){return e.WD(t)})},e.prototype.WD=function(e){var t=this.KC.getCurrentLoadingPeriodId(),i=this.SC.getTimeForNextSegment(e.getMimeType());return e.canLoad()&&(e.hasNext(i)||e.hasPendingSegments(t))&&!this.TD(e.getMimeType())},e.prototype.shouldClearSubtitleServiceBuffers=function(){var e;return!this.JC.seekingOrTimeshifting&&!!(null==(e=this.PC)?void 0:e.hasSubtitles())},e.prototype.clearSubtitleServiceBuffers=function(){var e;null==(e=this.PC)||e.clearBuffersUntil(this.xC.getCurrentTime()-10)}
1,e.prototype.areMediaTypesFinalForPlayingPeriod=function(){var e=this.KC.getCurrentPlayingPeriodId();return this.EC.areBufferBlockMediaTypesFinalForPeriod(e)},e.prototype.maybeStop=function(){var e=this.IC.isManifestFinalized(),t=this.IC.isLastPeriod(this.KC.getCurrentLoadingPeriodId());e&&t&&(this.EC.stop(!1),this.VD()&&(this.signalEndOfStream(),this.stop()))},e.prototype.XD=function(){var e=this;if(!this.JC.isPlay()||this.JC.hasBeenPlaying)return!1;var t=this.yC.settings.MAX_STARTUP_BUFFER;if(t===1/0||this.EC.isSegmentStoreWaitingForSegments())return!1;var i=this.getBufferRelevantTime();if(this.ZD(i))return this.jB.debug("Not delaying segment loading despite reaching max startup buffer: current time ".concat(i," is in an A/V timeline gap")),!1;var n=Object.keys(this.CC),r=Math.max(t,this.YD(n)),o=n.map(function(t){return e.aD(t,i)});return!(Math.min.apply(Math,o)<r||(this.jB.debug("Max startup buffer of ".concat(r," reached, delaying segment loading until playback has started"),{currentTime:i,maxStartupBuffer:r,bufferLevels:o}),0))},e.prototype.YD=function(e){var t=this.yC.settings.STARTUP_THRESHOLD,i=this.fC(),n=(0,F.getDrmState)(null==i?void 0:i.getState()),r=(0,y.getBufferEndSafetyMargin)(n);return Math.max((0,b.getPlatformSafeStartupBuffer)(this.yC,e),t,r)},e.prototype.ZD=function(e){if(this.EC.isInStartupPhase())return!1;var t=this.EC.getBufferedRangesMap(!1),i=Object.keys(t),r=i.filter(function(i){return!(0,n.isInTimeRanges)(t[i],e)});return 0!==r.length&&r.length!==i.length&&r.every(function(i){return Math.min.apply(Math,t[i].map(function(e){return e.start}))-e>=1})},e.prototype.getNextSegment=function(e,t){if(e.canLoad()&&this.xC.shouldContinueBuffering()&&!this.XD()){var i=T.MimeTypeHelper.getMediaType(e.getMimeType()),n=this.vC.getForwardTargetLevel(i),o=this.aD(e.getMimeType(),this.getBufferRelevantTime());o>=n||(this.yC.serviceManager.get(r.ServiceName.AdaptationService).addSample(e.getMimeType(),{bufferTargetLevel:n,bufferLevel:o}),e.hasNext(t)&&e.getNext(t))}},e.prototype.getBufferRelevantTime=function(){return this.JC.seekingOrTimeshifting?this.JC.targetPlaybackTime:this.xC.getCurrentTime()},e.prototype.aD=function(e,t){return this.getBufferLevel(e,t,u.BufferType.ForwardDuration)},e.prototype.isLoadingLastPeriod=function(){return this.KC.isLoadingLastPeriod()&&!this.LC},e.prototype.switchLoadingPeriod=function(){if(this.LC){var e=this.getAudioSegmentController(),t=e.getCurrentPeriodId(),i=this.IC.getNextPeriod(t)._id;this.cD(i),e.getCurrentPeriodId()===this.KC.getCurrentLoadingPeriodId()&&(e.isTransmuxerRequired()&&e.getTransmuxer()&&(e.getTransmuxer().dispose(),e.setTransmuxer(this.OC)),this.LC=!1,this.jB.debug("The audio SegmentController caught up to the overall loading period again."))}else{var n=this.IC.getNextPeriod(this.KC.getCurrentLoadingPeriodId());n&&this.switchLoadingPeriodForAllMedia(n._id)}},e.prototype.switchLoadingPeriodForAllMedia=function(e){var t=this;e!==this.KC.getCurrentLoadingPeriodId()&&(this.LC=!1,this.bD(e),this.getAllSegmentControllers().filter(function(t){return t.getCurrentPeriodId()!==e}).forEach(function(i){i.switchPeriod(e),t.xC.storeDrmInitDataFromManifest(i.getAdaptationSetForPeriodId(e))}),this.KC.setCurrentLoadingPeriodId(e))},e.prototype.bD=function(e){var t,i,n=this;(null!=(i=null==(t=this.IC.getPeriod(new _.PeriodId(e)))?void 0:t.AdaptationSet)?i:[]).forEach(function(e){return n.KD(e)}),this.resetTransmuxer()},e.prototype.cD=function(e){var t=this.getAudioSegmentController(),i=t.getCurrentPeriodId();t.resetTransmuxer(),t.switchPeriod(e),this.jB.debug("Switched audio loading period from ".concat(i," to ").concat(e))},e.prototype.isAVCompletelyLoaded=function(){var e=this.getAllSegmentControllers().some(function(e){return e.hasPendingSegments()})||this.EC.hasPendingSegments();return this.IC.isManifestFinalized()&&!e},e.prototype.getBufferedRanges=function(e){return void 0===e&&(e=!1),this.EC.getBufferedRangesMap(e)},e.prototype.resetTransmuxer=function(){this.OC&&(this.OC.dispose(),this.OC=null),this.ED()},e.prototype.eD=function(){this.EC.hasStopped()&&this.EC.restart()},e.prototype.fD=function(e,t,i,n){if(i&&0===e)return!1;var r=e<this.xC.getCurrentTime()&&this.yC.settings.CLEAR_BUFFERS_O
1N_SEEKING_BACKWARDS;return!t&&(!this.EC.isInBufferedRange(e)||r)||n},e.prototype.gD=function(e,t){var i;if(-1===e.targetTime&&t.targetTime>=0)null==(i=this.JC)||i.transitionToSeekedState(t.issuer!==a.STARTUP_ISSUER_NAME);else{var n=e.targetTime!==t.targetTime,r=e.targetTime>=0;n&&r&&this.seek(e.targetTime,e.issuer===a.STARTUP_ISSUER_NAME)}},e.prototype.seek=function(e,t,i,n){var r,o=this;if(void 0===t&&(t=!1),void 0===i&&(i=!1),void 0===n&&(n=!1),this.EC){this.eD(),this.DC++;var s=this.DC,u=null!=(r=this.IC.getPeriodIdForTime(e))?r:v.DEFAULT_PERIOD_ID;this.hD(u);var c,d,f=this.KC.getCurrentPlayingPeriodId();this.jB.debug("seek from current period (".concat(f,") to target period ")+"(".concat(u,") - seek time in period is: ").concat(e)),this.EC.readyToSeek().then(function(){var r;if(d=o.fD(e,i,t,n),c=o.KC.getCurrentLoadingPeriodId()!==u&&d,f!==u&&(null==(r=(0,p.getSourceStore)(o.yC))||r.dispatch((0,N.periodSwitchStarted)(u))),d&&o.EC.isBufferAvailable())return o.iD()}).then(function(){return o.BC?(c&&o.switchLoadingPeriodForAllMedia(u),d&&o.getAllSegmentControllers().forEach(function(t){t.setAdaptionLogicStartupPhase(),t.seekTo(e)}),(t?Promise.resolve():o.start()).then(function(){var t;null==(t=o.RC)||t.beat(),o.EC.setCurrentTime(e).then(function(t){var i;o.yC.isDisposed||(o.DC===s?(o.jB.debug("Successfully seeked to ".concat(t)),null==(i=(0,p.getSourceStore)(o.yC))||i.dispatch((0,N.periodSwitchFinished)(u)),o.yC.store.dispatch((0,l.updateSeekingProcess)({targetTime:-1,issuer:"",isInitial:!1,seekableRange:{start:-1,end:-1}}))):function(e){var t=e.getState();if(!t)return!1;var i=(0,h.getPlayerState)(t).seekingProcess.issuer;return i!==a.STARTUP_ISSUER_NAME&&""!==i}(o.yC.store)&&o.yC.logger.debug("Seek to ".concat(e," has finished but a newer operation has been started")))}).catch(function(e){o.jB.debug("Failed to set currentTime on seek",e)})})):(o.jB.debug("Aborting seek as MediaPlayerController has been terminated!"),Promise.resolve())})}},e.prototype.hD=function(e){var t=this;void 0===this.KC.getCurrentPlayingPeriodId()&&(this.jB.debug("current period is undefined, using seek target period "+e),this.KC.setCurrentPlayingPeriodId(e),this.resetTransmuxer(),this.getAllSegmentControllers().forEach(function(e){e.switchPeriod(t.KC.getCurrentPlayingPeriodId()),T.MimeTypeHelper.isAV(e.getMimeType())&&t.xC.storeDrmInitDataFromManifest(e.getCurrentAdaptationSet())}),this.KC.setCurrentLoadingPeriodId(this.KC.getCurrentPlayingPeriodId()))},e.prototype.iD=function(){var e=this;return this.yC.logger.debug("Clearing buffer on seek"),this.NC=!1,this.getAllSegmentControllers().forEach(function(e){return e.cancelLoading()}),this.EC.clearBuffers().catch(function(){e.jB.debug("Failed to clear buffers on seek, carrying on regardless")})},e.prototype.getAllSegmentControllers=function(){return Object.values(this.FC||{})},e.prototype.getAudioSegmentController=function(){return this.getAllSegmentControllers().find(function(e){return T.MimeTypeHelper.isAudio(e.getMimeType())})},e.prototype.kD=function(e,t){var i,n;if(!(e.isInit||!e.success&&this.JC.seekingOrTimeshifting)){var o=T.MimeTypeHelper.getMediaType(t.getMimeType()),a=this.getBufferLevel(t.getMimeType(),this.xC.getCurrentTime(),u.BufferType.ForwardDuration),s=this.vC.getForwardTargetLevel(o);null==(n=null==(i=this.yC.serviceManager)?void 0:i.get(r.ServiceName.AdaptationService))||n.addSample(t.getMimeType(),{bufferTargetLevel:s,bufferLevel:a,segmentDuration:e.duration,segmentDownloadDuration:e.downloadTime,downloadCancelled:!e.success})}},e.prototype.signalEndOfStream=function(e){void 0===e&&(e=!0),this.isVod()&&(this.NC||(this.NC=!0,this.EC.setEndOfStream(!0),e&&this.stop()),this.EC.isStarted()&&this.EC.stop())},e.prototype.start=function(){var e=this;return this.hasStarted()?Promise.resolve():this.sC().then(function(){var t;e.EC.hasStreamEnded()&&(e.seek((0,f.getStartTimeOffset)(e.fC().getState())),e.getAllSegmentControllers().forEach(function(e){return e.resetTransmuxer()})),e.EC.isStarted()||e.EC.restart(),e.getAllSegmentControllers().filter(function(e){return T.MimeTypeHelper.isAV(e.getMimeType())}
1).forEach(function(t){return e.xC.storeDrmInitDataFromManifest(t.getCurrentAdaptationSet())}),e.jB.debug("Starting main timer"),e.NC=!1,null==(t=e.RC)||t.start(),e.jC(),e.wC.on(s.PlayerEvent.SegmentRequestFinished,e.jD)})},e.prototype.maybeTransitionToPausedState=function(e){(0,S.isSwitchingBufferBlocks)(this.fC())?this.yC.logger.debug("Ignoring transition to Paused because buffer block switch is ongoing"):this.JC.isSourceSwitching()?this.yC.logger.debug("Ignoring transition to Paused because source switch is ongoing"):this.JC.transitionToPausedState(!0,e,!0)},e.prototype.mD=function(e){var t=this;return Promise.all(e.map(function(e){return t.EC.clearCacheForMimeType(e),t.EC.clearBuffer(e)})).then(function(){})},e.prototype.nD=function(e,t){var i=this,n=e.getSourceBufferTypes().find(T.MimeTypeHelper.isAudio);return this.EC.clearCacheForMimeType(n),this.EC.removeBufferRange(n,t+this.uC.AUDIO_TRACK_SWITCH_BUFFER_GRACE_PERIOD).catch(function(){return i.jB.debug("Failed to trim forward buffer after audio track switch")})},e.prototype.oD=function(e,t){var i=this;return this.EC.setEndOfStream(!1).then(function(){var n=i.uC.DISABLE_AUDIO_BUFFER_CLEARING_ON_TRACK_SWITCH?i.nD(e,t):i.mD(e.getSourceBufferTypes());return e.getCurrentPeriodId()!==i.KC.getCurrentPlayingPeriodId()?i.xD(e):e.getCurrentPeriodId()!==i.KC.getCurrentLoadingPeriodId()&&i.KC.setCurrentLoadingPeriodId(e.getCurrentPeriodId()),e.setAdaptionLogicStartupPhase(),e.seekTo(t),i.start().catch(function(){return i.jB.debug("Failed to restart stopped MPC after audio track switch")}),n.then(function(){i.uC.DISABLE_AUDIO_BUFFER_CLEARING_ON_TRACK_SWITCH||i.xC.setCurrentTime(t).catch(function(e){return i.jB.debug("Failed to set currentTime on audio track switch",e)})}).catch(function(e){return i.jB.debug("Failed to attempt to restore playback after audio track switch",e)})})},e.prototype.setAudio=function(e){var t,i=this,n=this.getAvailableAudio(this.KC.getCurrentPlayingPeriodId()),r=n.find(function(t){return t.id===e});if(!this.BC||!r)return Promise.reject(null);var o=null==(t=this.getAudio())?void 0:t.id,a=n.find(function(e){return e.id===o});if(!a||o===e)return Promise.reject(o);var s=Object.keys(this.FC),u=s.find(T.MimeTypeHelper.isAudio)||s.find(T.MimeTypeHelper.isVideo),c=this.IC.getAdaptationSet(a.adaptationSetId),d=this.IC.getAdaptationSet(r.adaptationSetId);return c&&d&&u?(this.MC=!0,this.pD(d,r.id).then(function(){var e,t=null!=(e=i.IC.getAdaptationSet(r.adaptationSetId))?e:d;return i.rD(c,t,u).then(function(e){return i.sD(c,t,r,e)}).then(function(e){return i.qD(e)}).then(function(e){return i.vD(e,r)})}).finally(function(){return i.MC=!1})):Promise.reject("Did not find matching adaptation set")},e.prototype.pD=function(e,t){return T.MimeTypeHelper.isAudio(e._mimeType)&&V(this.GC)?this.GC.updateAdaptationSet(t):Promise.resolve()},e.prototype.qD=function(e){return Object.keys(e).some(T.MimeTypeHelper.isAudio)&&V(this.GC)&&this.getAllSegmentControllers().forEach(function(e){return e.updateMpd()}),Promise.resolve(e)},e.prototype.rD=function(e,t,i){var n,r=this,o=q(t,e),a=T.MimeTypeHelper.isVideo(t._mimeType)||T.MimeTypeHelper.isVideo(e._mimeType),s=!(0,Z.hasContentProtection)(e.ContentProtection,t.ContentProtection);return!a&&(o||s)?(this.EC.updateRequiredMediaType(t._mimeType,i),this.uD(i,t).then(function(){var e=Object.keys(r.FC).find(T.MimeTypeHelper.isVideo);return s&&e?r.mD([e]).then(function(){var t,i=r.FC[e],n=r.KC.getCurrentPlayingPeriodId();i.getCurrentPeriodId()!==n&&r.FC[e].switchPeriod(n),r.FC[e].seekTo(r.xC.getCurrentTime()),null==(t=r.TC)||t.updateSegmentControllers(r.FC)}):Promise.resolve()}).then(function(){return r.EC.changeBufferType(t._mimeType,r.CC[t._mimeType],s)})):Promise.resolve(((n={})[t._mimeType]="",n))},e.prototype.sD=function(e,t,i,n){var r=this;return T.MimeTypeHelper.isVideo(t._mimeType)||T.MimeTypeHelper.isVideo(e._mimeType)?this.mD([e._mimeType,t._mimeType]).then(function(){var n=T.MimeTypeHelper.isVideo(t._mimeType);return r.OC.setShouldExpectSeparateAvSegments(!n),n?(r.tD(e),Promise.resolve()):(r.KD(t),r.wD(i,e._mimeType))}).then(function(){return n}):Promise.resolve(n)},e.prototype.tD=function(e){var t;if(e){var i=e._mimeType,n=this.FC[i];n.cancelLoading(),n.dispose(),delete this.FC[i],delete this.CC[i],null==(t=this.TC)||t.updateSegmentControllers(this.FC),this.fC().dispatch((0,k.removeActiveTrackAction)(e._internalId)),this.yC.segmentInfoService&&this.yC.segmentInfoService.setSegmentControllers(Object.values(this.FC))}},e.prototype.uD=function(e,t){var i=this,n=this.FC[e];return this.tD(n.getCurrentAdaptationSet()),this.mD([e]).then(function(){return i.nC(t),t._mimeType})},e.prototype.vD=function(e,t){var i=this;return Promise.all(Object.keys(e).map(function(e){return i.wD(t,e)})).then(function(){})},e.prototype.wD=function(e,t){if(this.PC&&this.PC.enableForcedSubtitle(e.lang),this.FC[t].setCurrentLangObj(e),this.FC[t].cancelLoading(),this.hasStarted()||this.NC){var i=this.getBufferRelevantTime();return this.oD(this.FC[t],i)}return Promise.resolve()},e.prototype.getAudio=function(){if(this.BC){var e=void 0,t=Object.keys(this.FC).find(function(e){return T.MimeTypeHelper.isAudio(e)});if(t&&(e=this.FC[t].getCurrentLangObj()),!e){var i=Object.keys(this.FC).find(function(e){return T.MimeTypeHelper.isVideo(e)});if(i&&this.FC[i].getSourceBufferTypes()){var n=this.FC[i];if(n.getSourceBufferTypes().some(function(e){return T.MimeTypeHelper.isAudio(e)})){var r=n.getCurrentAdaptationSet()._internalId;
vendor: 4,353 bytes, line 1
1e=this.getAvailableAudio(this.KC.getCurrentPlayingPeriodId()).find(function(e){return e.adaptationSetId===r})||n.getCurrentLangObj()}}}return e||null}return null},e.prototype.xD=function(e){if(this.gC(e))this.switchLoadingPeriodForAllMedia(this.KC.getCurrentPlayingPeriodId());else{if(this.jB.debug("audio needs to load previous period(s) and catch up to the overall loading period"),e.isTransmuxerRequired()){var t=I.ModuleManager.get(P.ModuleName.ContainerTS);e.setTransmuxer(new t.WebWorkerTransmuxer(this.yC,this.FD()))}this.LC=!0,this.cD(this.KC.getCurrentPlayingPeriodId())}},e.prototype.getPlaybackRepresentation=function(e){for(var t in this.FC)if(this.FC[t]&&t.includes(e))return this.yC.serviceManager.get(r.ServiceName.TimedMetadataService).getPlaybackRepresentation(t)},e.prototype.getTimeShift=function(){return this.getTimeShiftHandler().getTimeShift()},e.prototype.getTimeShiftLiveEdge=function(){return this.IC.isLive()?this.getTimeShiftHandler().getTimeShiftLiveEdge():0},e.prototype.getPlaybackTimeForTimeShiftOffset=function(e){return this.getTimeShiftHandler().calculatePlaybackTimeForTimeShiftOffset(e)},e.prototype.getTimeShiftHandler=function(){return this.TC||(this.TC=new G.TimeShiftHandler(this.yC,this,this.EC,this.FC)),this.TC},e.prototype.timeShift=function(e,t,i){return void 0===i&&(i=!1),this.getTimeShiftHandler().timeShift(e,t,i)},e.prototype.getAvailableAudio=function(e){return this.IC.getAvailableAudio(e)},e.prototype.hasStreamEnded=function(){return!!this.EC&&this.EC.hasStreamEnded()},e.prototype.getCurrentTime=function(){return this.xC.getCurrentTime()},e.prototype.getSeekableRange=function(){if(this.IC.isLive()){if(this.JC.seekingOrTimeshifting&&this.UC)return this.UC;var e=this.getTimeShiftLiveEdge(),t=e+this.getMaxTimeShift();return this.UC={start:t,end:e}}var i=this.getAllSegmentControllers().find(function(e){return T.MimeTypeHelper.isAV(e.getMimeType())});return i?i.getMPDHandler().getSeekableRange():{start:-1,end:-1}},e.prototype.getAvailableSegments=function(){var e=this,t={};return Object.keys(this.FC).forEach(function(i){t[i]=e.FC[i].getSegmentInfos()}),t},e.prototype.isInitialized=function(){return this.BC},e.prototype.hasStarted=function(){var e,t;return null!=(t=null==(e=this.RC)?void 0:e.started)&&t},e}()},84696:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.resolveMediaTypes=function(e){return(0,r.getCodecsFromAdaptationSet)(e).split(",").map(function(e){return(0,n.getMediaTypeFromCodec)(e)})};var n=i(34047),r=i(13422)},52570:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MseModuleDefinition=void 0;var n=i(68925),r=i(86897),o=i(62756),a=i(34795),s=i(47151),u=i(67580),c=i(13422),d=i(79505),l=i(94358),h=i(99257),p=i(42456),f=i(88618),g=i(17556),m=i(48514),v=i(14443),y=i(25248),S=i(63066),T=i(54015),b=i(97587),M=i(36193),I=i(44115),P=i(88935),C=i(72498),E=i(39523),A=i(99529),R=i(64922),_={removeStreamTimeRange:E.removeStreamTimeRange,removeLoadedRange:n.removeLoadedRange,addLoadedRange:n.addLoadedRange,resetLoadedRanges:n.resetLoadedRanges,resetStreamTimeline:E.resetStreamTimeline,removeActiveTrackAction:M.removeActiveTrackAction,setRepresentationIdAction:M.setRepresentationIdAction,setMediaTypeAction:M.setMediaTypeAction},B={getPlayingPeriodId:P.getPlayingPeriodId,getContainerFormat:I.getContainerFormat,getLoadedRangesForMimeType:r.getLoadedRangesForMimeType,getSegmentInfos:C.getSegmentInfos},D={containerFormat:a.ContainerFormat,streamTimeRangeType:A.StreamTimeRangeType};t.MseModuleDefinition={name:o.ModuleName.EngineBitmovin,module:{MediaPlayer:l.MediaPlayer,SegmentController:v.SegmentController,technologyChecker:new R.TechnologyChecker,Stream:b.Stream,FetchController:f.FetchController,SegmentInfoService:y.SegmentInfoService,PreloadingService:g.PreloadingService,SegmentPrefetchingService:T.SegmentPrefetchingService,SegmentCacheService:m.SegmentCacheService,AdRestorationOptimizationService:h.AdRestorationOptimizationService,ManifestCachingService:u.ManifestCachingService,SegmentListMPDHandler:S.SegmentListMPDHandler,actions:_,selectors:B,mseModuleTypes:D,AdaptationSetId:s.AdaptationSetId,RepresentationId:d.RepresentationId,getTrackIdentifier:A.getTrackIdentifier,getCodecsFromAdaptationSet:c.getCodecsFromAdaptationSet,collectInitialSegmentInfos:p.collectInitialSegmentInfos}},t.default=t.MseModuleDefinition}
1,58784:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.PeriodSwitchTracker=void 0;var n=i(80813),r=i(3714),o=i(93204),a=i(89927),s=i(42208),u=i(88935);t.PeriodSwitchTracker=function(){function e(e){var t=this;this.tY=function(e,i){var n=t.getCurrentPlayingPeriodId(),o=e.switchingToPeriodId;n!==o&&(t.mY.debug("Starting switch from Period ".concat(n," to Period ").concat(o)),t.lY.eventHandler.dispatchEvent(r.PlayerEvent.PeriodSwitch,{sourcePeriod:{periodId:n},targetPeriod:{periodId:o}}))},this.uY=function(e,i){var n=i.switchingToPeriodId,o=t.getCurrentPlayingPeriodId();if(n!==o){t.setCurrentPlayingPeriodId(n);var a=t.getCurrentPlayingPeriod();a&&a.AdaptationSet.forEach(function(e){return t.lY.renderer.storeDrmInitDataFromManifest(e)}),t.mY.debug("Successfully switched from Period ".concat(o," to Period ").concat(n)),t.lY.eventHandler.dispatchEvent(r.PlayerEvent.PeriodSwitched,{sourcePeriod:{periodId:o},targetPeriod:{periodId:n}})}},this.lY=e,this.mY=e.logger,this.rY()}return e.prototype.qY=function(){return this.lY.serviceManager.get(n.ServiceName.ManifestService,this.lY.sourceContext.sourceIdentifier)},e.prototype.getCurrentPlayingPeriod=function(){return this.qY().findPeriod(this.getCurrentPlayingPeriodId())},e.prototype.rY=function(){var e=this.vY();!this.pY&&e&&(this.pY=(0,o.subscribe)(e)(u.getPlayingTracksState,this.tY,u.isSwitchingPeriods)),!this.oY&&e&&(this.oY=(0,o.subscribe)(e)(u.getPlayingTracksState,this.uY,u.wasSwitchingToPeriodIdReset))},e.prototype.sY=function(){this.oY&&(this.oY(),this.oY=void 0),this.pY&&(this.pY(),this.pY=void 0)},e.prototype.vY=function(){return this.lY.serviceManager.get(n.ServiceName.SourceStoreService,this.lY.sourceContext.sourceIdentifier)},e.prototype.getCurrentLoadingPeriodId=function(){return this.nY},e.prototype.setCurrentLoadingPeriodId=function(e){this.nY=e},e.prototype.getCurrentPlayingPeriodId=function(){return(0,u.getPlayingPeriodId)(this.vY().getState())},e.prototype.setCurrentPlayingPeriodId=function(e){this.vY().dispatch((0,s.setPlayingPeriodId)(e))},e.prototype.resetPeriodIds=function(){this.setCurrentPlayingPeriodId(void 0),this.setCurrentLoadingPeriodId(void 0)},e.prototype.isLoadingLastPeriod=function(){return this.qY().isLastPeriod(this.nY)},e.prototype.setInitialPeriod=function(){var e=this.qY().isLive()?this.wY():this.xY();this.nY=e,this.setCurrentPlayingPeriodId(this.nY),this.mY.debug("setting initial period to ".concat(this.nY))},e.prototype.wY=function(){var e=(0,a.toSeconds)(Date.now())-this.qY().getDesiredDistanceToLiveEdge();return this.qY().getPeriodIdForTime(e)},e.prototype.xY=function(){var e=this.lY.serviceManager.get(n.ServiceName.StartOffsetService).getStartOffset(this.lY.sourceContext.source);return this.qY().getPeriodIdForTime(e)},e.prototype.dispose=function(){this.sY()},e}()},11536:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.PlayerConfigEnhancer=void 0;var n=i(21281),r=i(70850),o=i(50962);t.PlayerConfigEnhancer=function(){function e(e){this.jY={},r.Util.deepCopy(this.jY,e.config),this.kY={},r.Util.deepCopy(this.kY,e.settings)}return e.prototype.adjustToCurrentSource=function(e,t){var i,r,a,s,u=e.config;if(u.adaptation&&(u.adaptation.logic=null==(i=this.jY.adaptation)?void 0:i.logic),e.settings.CHUNKED_CMAF_STREAMING=this.kY.CHUNKED_CMAF_STREAMING,t.isDashManifest()&&t.isLive()&&(0,o.isLowLatencyConfigured)(e)){e.logger.debug("Detected DASH Live stream and LL config, enabling 'low-latency-v1' adaptation logic and CHUNKED_CMAF_STREAMING tweak"),u.adaptation=null!=(r=u.adaptation)?r:{},u.adaptation.logic=null!=(a=u.adaptation.logic)?a:n.AdaptationLogicType.LOW_LATENCY;var c=e.internalPlayer.getConfig().tweaks||{};e.settings.CHUNKED_CMAF_STREAMING=null==(s=c.CHUNKED_CMAF_STREAMING)||s}},e}()},3095:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.createSegmentParser=function(e,t){if(t===o.ContainerFormat.MP4&&n.ModuleManager.has(r.ModuleName.ContainerMP4)){var i=n.ModuleManager.get(r.ModuleName.ContainerMP4);return new i.MP4Parser(e,new i.MP4EncryptionParser(e))}if(t===o.ContainerFormat.WEBM&&n.ModuleManager.has(r.ModuleName.ContainerWebM))return new(0,n.ModuleManager.get(r.ModuleName.ContainerWebM).WebMParser)};var n=i(88052),r=i(62756),o=i(34795)}
1,47531:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.StreamTimeService=void 0;var n=i(80813),r=i(74853),o=i(99529);function a(e){return[o.StreamTimeRangeType.Loading,o.StreamTimeRangeType.Failed].includes(e.type)}t.StreamTimeService=function(){function e(e,t){this.serviceManager=e,this.sourceIdentifier=t}return Object.defineProperty(e.prototype,"uE",{get:function(){return this.serviceManager.get(n.ServiceName.SourceStoreService,this.sourceIdentifier).getState()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vE",{get:function(){var e;return null==(e=this.uE)?void 0:e.streamTimeline},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wE",{get:function(){var e;return null==(e=this.uE)?void 0:e.buffer.bufferStateMap},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"xE",{get:function(){return this.serviceManager.get(n.ServiceName.PlayerStateService)},enumerable:!1,configurable:!0}),e.prototype.getTimeForNextSegment=function(e){var t,i,n,o,s=(0,r.findFromEnd)(this.vE[e]||[],a),u=null==(t=this.wE)?void 0:t[e],c=[s,(null==(i=null==u?void 0:u.loadedRanges)?void 0:i[u.loadedRanges.length-1])||(null==(n=null==u?void 0:u.rendererRanges)?void 0:n[u.rendererRanges.length-1])].filter(function(e){return e}).map(function(e){return e.end}),d=Math.max.apply(Math,c);return isFinite(d)?d:(null==(o=this.xE)?void 0:o.seekingOrTimeshifting)?this.xE.targetPlaybackTime:0},e.prototype.dispose=function(){},e}()},64922:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.TechnologyChecker=void 0;var n=i(88052),r=i(62756);t.TechnologyChecker=function(){function e(){}return e.prototype.getSupportedTechnologies=function(){return n.ModuleManager.has(r.ModuleName.RendererMse)?n.ModuleManager.get(r.ModuleName.RendererMse).technologyChecker.getSupportedTechnologies():[]},e}()},52602:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.TimeShiftHandler=void 0;var n=i(80813),r=i(3714),o=i(87827),a=i(15971),s=i(79721),u=i(89927),c=i(23068),d=i(70850),l=i(88052),h=i(62756),p=i(42208),f=i(39523),g=i(99529),m=i(68981),v=i(50962),y=i(60729);t.TimeShiftHandler=function(){function e(e,t,i,r){var o=this;this.TZ=!1,this.gZ=function(){o.hZ(!0)},this.iZ=function(e){var t=o.yY.renderer.getCurrentTime(!0),i=t-e;i=d.Util.roundValue(i,1),o.fZ(i,t)},this.yY=e,this.zY=t,this.AY=i,this.BY=Object.keys(r).map(function(e){return r[e]}),this.CY=e.serviceManager.get(n.ServiceName.ManifestService,e.sourceContext.sourceIdentifier),this.DY=e.logger,this.QZ=0,this.UZ=e.sourceContext.sourceIdentifier,this.jZ()}return e.prototype.VZ=function(){var e=(0,v.isLowLatencyConfigured)(this.yY),t=(0,y.isPlayingLowLatencyHls)(this.yY);return e||t},e.prototype.WZ=function(){var e;if(this.RZ&&!this.RZ.isOngoing){var t=(0,u.toSeconds)(Date.now()-this.RZ.timestamp);e=this.RZ.liveEdge+t}else e=this.XZ();return isFinite(e)||(e=(0,u.toSeconds)(Date.now()-this.CY.getAvailabilityStartTime())),e},e.prototype.XZ=function(){var e=this.ZZ();if(!this.VZ())return e;var t=this.YZ(),i=this.CY.getRequestTimestamp(),n=null!=i?i:Date.now(),r=this.YZ(n)-e,o=this.CY.getDesiredDistanceToLiveEdge();return r>=0&&r<o?t:e},e.prototype.YZ=function(e){void 0===e&&(e=Date.now());var t=this.yY.serviceManager.maybeCall(n.ServiceName.SynchronizedTimeService,function(e){return e.getTimeDifference()},0,this.yY.sourceContext.sourceIdentifier);return(0,u.toSeconds)(e+t)},e.prototype.ZZ=function(){return this.BY.map(function(e){return e.getLiveEdgeTime()}).reduce(function(e,t){return t<e&&t>=0?t:e},1/0)},e.prototype.updateSegmentControllers=function(e){this.BY=Object.values(e)},e.prototype.getMaxTimeShift=function(){return this.CY.getManifest()?Math.min(this.CY.getTimeShiftBufferDepthSeconds()+this.CY.getDesiredDistanceToLiveEdge(),0):0},e.prototype.getTimeShiftLiveEdge=function(){return this.WZ()-this.CY.getDesiredDistanceToLiveEdge()},e.prototype.getTimeShift=function(){var e=this.aZ();if(this.SZ&&Math.abs((0,u.toSeconds)(Date.now()-this.SZ.completionDate)-(this.zY.getCurrentTime()-this.SZ.reachedTime))<this.yY.settings.ACCEPTABLE_TIMESHIFT_INACCURACY)return this.SZ.offset;var t=this.getMaxTimeShift();return e<t&&(e=t),e>0&&(e=0),e},e.prototype.aZ=function(e){return void 0===e&&(e=!1),!this.RZ||this.RZ.isOngoing?0:(e?this.zY.getBufferRelevantTime():this.zY.getCurrentTime())-this.getTimeShiftLiveEdge()},e.prototype.bZ=function(){return this.WZ()-this.zY.getBufferRelevantTime()},e.prototype.timeShift=function(e,t,i){var n,r=this;void 0===i&&(i=!1);var o=!!this.RZ;o||this.eZ(),e=Math.max(this.getMaxTimeShift(),e);var u=this.zY.getCurrentTime(),d=this.calculatePlaybackTimeForTimeShiftOffset(e),l=null!=(n=this.CY.getPeriodIdForTime(d))?n:s.DEFAULT_PERIOD_ID;this.QZ++;var h=this.QZ,f=i||this.AY.shouldBuffersBeClearedOnTimeshift(d);return this.DY.debug("Performing timeShift to offset ".concat(e,", time: ").concat(u," -> ").concat(d,", period: ").concat(l)),this.AY.setTimeshiftCancelState(!1),(0,c.isDefined)(l)&&this.zY.updatePeriodForTimeshift(l,!o,f),f&&this.BY.forEach(function(e){return e.seekTo(d)}),o&&this.cZ(d),this.hZ(!0),this.AY.setCurrentTime(d,!0,i).then(function(i){var n;
1r.hZ(!1),r.SZ={offset:e,completionDate:Date.now(),reachedTime:i},r.QZ===h&&t?(r.DY.debug("Successfully timeShifted to ".concat(i,", hit target time with a diff of ").concat(i-d)),null==(n=(0,a.getSourceStore)(r.yY))||n.dispatch((0,p.periodSwitchFinished)(l)),t()):t&&r.yY.logger.debug("Timeshift to ".concat(e," has finished but a newer operation has been started"))}).catch(function(e){r.DY.debug("Failed to set currentTime on timeShift",e)}).finally(function(){return r.AY.setTimeshiftCancelState(!1)})},e.prototype.cZ=function(e){var t;if(this.CY.isHlsManifest()){var i,r,o,a,s=this.yY.serviceManager.get(n.ServiceName.SourceStoreService,this.UZ);i=null==(t=l.ModuleManager.get(h.ModuleName.HLS))?void 0:t.selectors.getHlsState(null==s?void 0:s.getState()),-1!==(a=null!=(o=null==(r=null==i?void 0:i.timestampRolloverPositions)?void 0:r.next)?o:-1)&&(e>=a||e<=i.timestampRolloverPositions.previous)&&(this.yY.logger.debug("Resetting transmuxer because target is beyond a timestamp rollover"),this.zY.resetTransmuxer())}},e.prototype.cancel=function(){this.yY.logger.debug("Cancelling ongoing time shift operation..."),this.AY.setTimeshiftCancelState(!0)},e.prototype.calculatePlaybackTimeForTimeShiftOffset=function(e){var t=this.CY.getDesiredDistanceToLiveEdge(),i=this.WZ(),n=i+(e-t);return n=Math.max(n,0),0===e&&this.VZ()&&(n=Math.min(i,n+this.yY.settings.LOW_LATENCY_SEEK_AHEAD)),this.CY.hasMultiplePeriods()?(0,m.adjustTargetTimeToPeriodStart)(n,this.yY.settings.END_OF_BUFFER_TOLERANCE,this.CY,this.yY.logger):n},e.prototype.onManifestUpdate=function(){this.eZ(),this.CY.isLive()&&(this.aZ(!0)<this.getMaxTimeShift()-this.getMinSegmentDuration()?this.yY.settings.DISABLE_AUTO_RECOVERY_ON_DVR_WINDOW_EXCEEDED?this.TZ||(this.yY.eventHandler.dispatchEvent(r.PlayerEvent.DVRWindowExceeded),this.TZ=!0):this.yY.eventHandler.dispatchEvent(r.PlayerEvent.DVRWindowExceeded):this.TZ=!1,this.dZ())},e.prototype.dZ=function(){var e=this;this.yY.serviceManager.maybeCall(n.ServiceName.SourceStoreService,function(t){var i,n=e.CY.getTimeShiftBufferDepthSeconds(),r=e.WZ()+n,o=null==(i=t.getState())?void 0:i.streamTimeline;void 0!==o&&Object.keys(o).forEach(function(e){t.dispatch((0,f.removeStreamTimeRange)(e,{start:0,end:r},g.StreamTimeRangeType.Failed))})})},e.prototype.isTimeInBufferedRange=function(e){return this.AY.isInBufferedRange(e)},e.prototype.getMinSegmentDuration=function(){return this.BY.reduce(function(e,t){return Math.min(e,t.getMPDHandler().getSegmentDuration())},1/0)},e.prototype.eZ=function(){var e=this.CY.isLive(),t=e?this.bZ():1/0,i=e?Math.abs(this.CY.getTimeShiftBufferDepthSeconds()):this.CY.getDuration();this.yY.bufferSettings.setTargetBufferLevelConstraints({minimumBufferLength:this.getMinSegmentDuration(),currentDistanceToLiveEdge:t,streamDuration:i})},e.prototype.fZ=function(e,t){this.SZ={completionDate:Date.now(),reachedTime:t,offset:e},this.hZ(!1)},e.prototype.hZ=function(e){this.RZ&&(e||!this.RZ.isOngoing)||(this.RZ={timestamp:Date.now(),liveEdge:this.WZ(),isOngoing:e})},e.prototype.jZ=function(){var e=this;this.EY=(0,o.subscribeToSeek)(this.yY.store,this.gZ),this.FY=(0,o.subscribeToSeeked)(this.yY.store,function(t,i){return e.iZ(i.seekingProcess.seekableRange.end)})},e.prototype.kZ=function(){var e,t;null==(e=this.EY)||e.call(this),null==(t=this.FY)||t.call(this)},e.prototype.dispose=function(){this.kZ(),this.AY.setTimeshiftCancelState(!0)},e}()},90685:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.BufferBlock=t.EncryptionState=void 0,t.isPrecedingSegment=u;var n,r,o=i(85434),a=i(48954);function s(e,t,i){e.hasOwnProperty(t)&&i(e[t])}function u(e,t,i){var n=e.isInit(),r=e.getMimeType()!==t;return!n&&!r&&e.getPlaybackTime()+e.getDuration()<i}(n=r||(t.EncryptionState=r={})).Encrypted="encrypted",n.Clear="clear",t.BufferBlock=function(){function e(e,t){this.id=e,this.sourceIdentifier=t,this.hcb={},this.icb={},this.fcb=[],this.gcb=new Map}return e.prototype.addSegment=function(e){var t=e.getMimeType();e.isInit()&&this.ocb(t),this.jcb(e),this.kcb(e);var i=e.isInit()?0:e.getDuration();this.fcb.push({segment:e}),e.isInit()||(this.setMaxSegmentDuration(t,Math.max(i,this.getMaxSegmentDuration(t))),this.ncb(e,t)),e.setBufferBlockId(this.id),this.mcb(e)},e.prototype.jcb=function(e){var t=e.getSegmentInfo(),i=t.discontinuitySequenceNumber,n=t.mimeType;n&&(this.hcb[n]||(this.hcb[n]=[]),null==i||this.hcb[n].includes(i)||this.hcb[n].push(i))},e.prototype.kcb=function(e){var t=e.getSegmentInfo(),i=t.periodId,n=t.mimeType;n&&(this.icb[n]||(this.icb[n]=[]),null==i||this.icb[n].includes(i)||this.icb[n].push(i))},e.prototype.setSegregationCriteria=function(e,t){this.gcb.has(t)||this.lcb(t),this.pcb(t).segregationCriteria=e},e.prototype.lcb=function(e){var t={};return this.gcb.set(e,t),t},e.prototype.updateMediaTypeForMimeType=function(e){var t=this.pcb(e.mimeType)||this.lcb(e.mimeType);t.mediaType?(s(e,"codec",function(e){t.mediaType.codec=e}),s(e,"timescale",function(e){t.mediaType.timescale=e})):t.mediaType=e},e.prototype.getSegregationCriteria=function(e){var t;return null==(t=this.pcb(e))?void 0:t.segregationCriteria},e.prototype.mcb=function(e){var t=e.getMimeType(),i=this.getMediaType(t);i?(null!=i.codec||(i.codec=e.getCodec()),null!=i.timescale||(i.timescale=e.getTimescale())):(this.gcb.has(t)||this.gcb.set(t,{}),this.pcb(t).mediaType={mimeType:t,codec:e.getCodec(),timescale:e.getTimescale()})},e.prototype.getMediaType=function(e){var t,i;return null!=(i=null==(t=this.pcb(e))?void 0:t.mediaType)?i:null},e.prototype.addMediaType=function(e){o.MimeTypeHelper.isAV(e.mimeType)&&!this.getMediaType(e.mimeType)&&(this.gcb.has(e.mimeType)||this.lcb(e.mimeType),this.pcb(e.mimeType).mediaType=e)},e.prototype.removeMediaType=function(e){this.gcb.delete(e)},e.prototype.hasMediaType=function(e){var t,i;return null!=(i=null==(t=this.gcb)?void 0:t.has(e))&&i},e.prototype.getMediaTypes=function(){return(0,a.getValues)(this.gcb).map(function(e){return e.mediaType})},e.prototype.getMediaTypesWithoutSubs=function(){return this.getMediaTypes().filter(function(e){return o.MimeTypeHelper.isAV(e.mimeType)})},e.prototype.removeSegment=function(e){var t=this.fcb.findIndex(function(t){return t.segment===e});t>-1&&this.fcb.splice(t,1)},e.prototype.clearSegments=function(e){this.fcb=this.fcb.filter(function(t){return t.segment.getMimeType()!==e});var t=this.pcb(e);t&&(t.playbackTimeRange=void 0),this.hcb[e]=[],this.icb[e]=[]},e.prototype.getPrecedingSegments=function(e,t){var i=[];return this.fcb.forEach(function(n){u(n.segment,e,t)&&i.push(n.segment)}),i},e.prototype.ncb=function(e,t){var i=this.getPlaybackTimeRange(t),n=e.getPlaybackTime(),r=n+e.getDuration();i?(n<i.start&&(i.start=n),r>i.end&&(i.end=r)):this.pcb(t).playbackTimeRange={start:n,end:r}},e.prototype.getPlaybackTimeRange=function(e){var t,i;return null!=(i=null==(t=this.pcb(e))?void 0:t.playbackTimeRange)?i:null},e.prototype.getId=function(){return this.id},e.prototype.getSourceIdentifier=function(){return this.sourceIdentifier},e.prototype.getAllKnownPeriodIds=function(){var e;return(e=[]).concat.apply(e,Object.values(this.icb))},e.prototype.getMinCommonStartTime=function(){return(0,a.getValues)(this.gcb).filter(function(e){return e.playbackTimeRange}).map(function(e){return e.playbackTimeRange}).reduce(function(e,t){return Math.max(t.start,e)},-1/0)},e.prototype.getCommonPlaybackTimeRanges=function(){return(0,a.getValues)(this.gcb).filter(function(e){return e.playbackTimeRange}).map(function(e){return e.playbackTimeRange}).reduce(function(e,t){return{start:Math.max(t.start,e.start),end:Math.min(t.end,e.end)}},{start:-1/0,end:1/0}
vendor: 5,563 bytes, line 1
1)},e.prototype.setMaxSegmentDuration=function(e,t){this.gcb.has(e)||this.lcb(e),this.pcb(e).maxSegmentDuration=t},e.prototype.getMaxSegmentDuration=function(e){var t;return(null==(t=this.pcb(e))?void 0:t.maxSegmentDuration)||0},e.prototype.hasMaxSegmentDuration=function(e){var t;return null!=(null==(t=this.pcb(e))?void 0:t.maxSegmentDuration)},e.prototype.hasMaxSegmentDurations=function(){return!!(0,a.getValues)(this.gcb).map(function(e){return e.maxSegmentDuration}).find(function(e){return e>=0})},e.prototype.getMinMaxSegmentDuration=function(){var e=Number.MAX_VALUE;return(0,a.getValues)(this.gcb).map(function(e){return e.maxSegmentDuration}).forEach(function(t){return e=t<e?t:e}),e},e.prototype.getAllSegmentsForMimeType=function(e){return this.getAllSegments().filter(function(t){return t.getMimeType()===e})},e.prototype.getAllSegments=function(){return this.fcb.map(function(e){return e.segment})},e.prototype.hasDataSegments=function(e){return this.fcb.some(function(t){return!t.segment.isInit()&&t.segment.getMimeType()===e})},e.prototype.hasSegments=function(){return this.getAllSegments().length>0},e.prototype.hasTrackedDiscontinuity=function(e){var t=this;return Object.keys(this.hcb).some(function(i){return t.hcb[i].includes(e)})},e.prototype.hasTrackedPeriodId=function(e){var t=this;return Object.keys(this.icb).some(function(i){return t.icb[i].includes(e)})},e.prototype.getNextSegment=function(){var e=this.fcb.filter(function(e){return!e.pendingRemoval});if(0===e.length)return null;var t=e.find(function(t){return e.filter(function(e){return t.segment.getMimeType()===e.segment.getMimeType()}).some(function(e){return!e.segment.isInit()})});return t?(t.pendingRemoval=!0,t.segment):null},e.prototype.ocb=function(e){var t=this.getAllSegmentsForMimeType(e);if(t.length>0){var i=t[t.length-1];i.isInit()&&this.removeSegment(i)}},e.prototype.pcb=function(e){return this.gcb.get(e)},Object.defineProperty(e.prototype,"mediaTypes",{get:function(){var e={};return this.gcb.forEach(function(t,i){e[i]=t.mediaType}),e},enumerable:!1,configurable:!0}),e.prototype.getMinDistanceFromBufferBlock=function(e){var t=this.getCommonPlaybackTimeRanges();return Math.min(Math.min(Math.abs(e.getPlaybackTime()-t.start),Math.abs(e.getPlaybackTime()-t.end)),Math.min(Math.abs(e.getPlaybackEndTime()-t.start),Math.abs(e.getPlaybackEndTime()-t.end)))},e}()},674:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.areBufferBlocksEqual=function(e,t){return!(!e||!t)&&e===t}},35046:function(e,t,i){var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferController=void 0;var r=i(4524),o=i(66790),a=i(40306),s=i(3336),u=i(25926),c=i(4224),d=i(80813),l=i(56481),h=i(3714),p=i(44468),f=i(33468),g=i(91678),m=i(46151),v=i(33436),y=i(87827),S=i(85648),T=i(68925),b=i(86897),M=i(21513),I=i(93204),P=i(79721),C=i(34841),E=i(87244),A=i(85434),R=i(15487),_=i(89927),B=i(23068),D=i(70850),O=i(19274),L=i(88052),k=i(62756),x=i(95880),N=i(62198),w=i(42208),F=i(59604),H=i(13114),U=i(39523),G=i(14808),Z=i(99529),j=i(90685),V=i(60632),q=i(94305),K=i(51888),Y=i(39494),W=i(77264);function z(e,t){return{periodId:t,contentInformation:e.getMediaTypes().map(function(t){return{codec:t.codec,mimeType:t.mimeType,isDrmProtected:e.getSegregationCriteria(t.mimeType).encryption===j.EncryptionState.Encrypted}})}}t.BufferController=function(){function e(e,t,i,n){var r=this;this.JZ=[],this.d0=!1,this.e0=!0,this.f0=!1,this.g0=!1,this.h0=!1,this.o0={},this.q0={},this.t0=!1,this.v0=0,this.B0=function(){r.b0=r.HZ.getTotalDuration(),r.b0>(r.GZ.getDuration()||0)&&r.E0()},this.E0=function(){r.f0||r.GZ.setDuration(r.b0)},this.F0=function(e){r.BZ.logger.debug("Renderer setup failed with",e)},this.X0=function(){Date.now()-r.k0>r.j0&&r.W0()&&r.P0();var e=!(0,M.getCapabilities)().isTizen;r.checkIfEndOfBufferReached(r.DZ.END_OF_BUFFER_TOLERANCE,e)},this.Y0=function(){if(r.IZ){var e=r.IZ.getBufferBlock(r.PZ),t=e?r.IZ.getSmallestMaxSegmentDuration(e):r.DZ.END_OF_BUFFER_RECOVERY_TOLERANCE;r.checkIfEndOfBufferReached(t,!0)}},this.Z0=function(){r.o1(r.GZ.getCurrentTime(!0))},this.k1=function(){r.checkIfEndOfBufferReached(r.DZ.END_OF_BUFFER_RECOVERY_TOLERANCE,!0)},this.BZ=e,this.CZ=e.logger,this.DZ=e.settings,this.EZ=e.bufferSettings,this.FZ=e.eventHandler,this.GZ=e.renderer,this.HZ=e.serviceManager.get(d.ServiceName.ManifestService,e.sourceContext.sourceIdentifier),this.IZ=new Y.SegmentStore(this.BZ,this.DZ),this.a0=t,this.p0=new q.BufferStallingService(this.U1(),this.CZ,this.BZ.renderer),this.b0=i,this.PZ=Y.INITIAL_BUFFER_BLOCK_ID,this.n0=new Map,this.i0=!1,this.k0=0,this.j0=(0,_.toMilliSeconds)(this.BZ.settings.MINIMAL_BACKWARD_BUFFER_CLEARING_INTERVAL),this.m0=new Map,this.s0=new K.DeferredReject,this.KZ=Promise.resolve(null),this.w0=new V.BufferRangesCache(this.BZ,this.IZ),this.A0(),this.GZ.ready().then(function(){r.E0(),r.D0()&&r.J0(n)}).catch(this.F0),this.z0()}return e.prototype.z0=function(){var e=this;this.y0=(0,I.subscribe)(this.BZ.store)(function(e){return e&&(0,y.getPlayerState)(e).seekState},function(){e.W0()&&e.P0()},function(e,t){return e===S.SeekState.Seeked&&t!==S.SeekState.Seeked})},e.prototype.A0=function(){var e=this,t=this.BZ.store;void 0!==t&&(this.x0=(0,I.subscribe)(t)(function(e){return e&&(0,y.getIsStopped)((0,y.getPlayerState)(e))},function(){e.f0=!0,e.g0=!0},function(e){return!0===e}))}
1,Object.defineProperty(e.prototype,"C0",{get:function(){return this.p0.isRendererStalling()},enumerable:!1,configurable:!0}),e.prototype.D0=function(){var e,t;return!!(null==(t=(0,H.getDrmState)(null==(e=this.K0())?void 0:e.getState()))?void 0:t.immediateLicenseRequest)},e.prototype.G0=function(e,t){var i=this,n=Promise.resolve();return this.l0=new C.Deferred,this.GZ.hasSourceBuffers()&&(n=this.GZ.shutdown(!0)),this.o0={},this.l0.resolve(n.then(function(){return i.GZ.ready()}).then(function(){i.E0(),i.b1(),e.forEach(function(e){var t=e.mimeType;i.addMimeTypeAndCodec(t,e.codec)||(i.CZ.debug("Could not create source buffer for ".concat(t)),i.BZ.store.dispatch((0,g.removeMetricsForMimeType)(t))),i.H0(t)}),i.JZ=e.filter(function(e){return A.MimeTypeHelper.isAV(e.mimeType)});var n,r=null!=(n=t.getAllKnownPeriodIds()[0])?n:P.DEFAULT_PERIOD_ID;return i.J0(r),Promise.resolve(i.JZ.length)})),this.l0.promise.catch(function(e){return i.CZ.warn("Failed to create buffers",e)}).then(function(){i.l0=null}),this.l0.promise},e.prototype.H0=function(e){var t=this,i=this.K0();i&&(this.q0[e]=i.subscribe(function(){return t.Q0(e)},(0,b.hasBufferMaxSizeChanged)(e)))},e.prototype.I0=function(e){var t=this.q0[e];t&&(t(),delete this.q0[e])},e.prototype.J0=function(e){var t,i=this,r=(0,H.getDrmState)(null==(t=this.K0())?void 0:t.getState());if(void 0!==r&&Object.keys(r).length>0){var a=n(n({},this.BZ.sourceContext.source),{drm:r}),s=this.HZ.getDRMCapabilitiesForPeriod(e);Object.keys(f.KeySystemMap).some(function(e){return a.drm.hasOwnProperty(e)})&&(this.KZ=this.GZ.setDrmConfig(r,s),this.KZ.catch(function(e){(null==e?void 0:e.message)!==o.DrmSetupError.CANCELLED&&i.CZ.debug("Could not initialize renderer with given DRM config: ".concat(null==e?void 0:e.message),e)}))}},e.prototype.K0=function(){var e;return null==(e=this.BZ.serviceManager)?void 0:e.get(d.ServiceName.SourceStoreService,this.BZ.sourceContext.sourceIdentifier)},e.prototype.L0=function(){var e=this;return this.u0?this.u0.catch(function(){return e.t0=!0,Promise.reject("Failed to clear buffer on timeshift, stopping segment cache processing")}).then(function(){return e.t0?(e.t0=!1,Promise.reject("Timeshift cancelled, stopping segment cache processing")):Promise.resolve()}):Promise.resolve()},e.prototype.addSegment=function(e){var t,i,n,r,o=this;if(!this.IZ)return Promise.reject("Skipping segment processing, segment store is already disposed");this.CZ.insane("adding segment to cache for period ".concat(e.getPeriodId()," with playback time ").concat(e.getPlaybackTime()," and mime type ").concat(e.getMimeType())),this.IZ.addSegment(e);var a=this.Y1(),s=this.IZ.getBufferBlock(a);if(this.IZ.getNextBufferBlock(a)&&this.U0(s)&&(null==(r=this.K0())||r.dispatch((0,T.setLoadingRangeFinished)(!0))),this.a1(),t=this.K0(),i=(0,Z.getTrackIdentifier)(e.getSegmentInfo()),(n=e.getPlaybackTimeRange())&&(null==t||t.dis
1patch((0,U.removeStreamTimeRange)(i,n,Z.StreamTimeRangeType.Loading))),null==t||t.dispatch((0,T.addLoadedRange)(i,(0,F.segmentToBufferBlockTimeRange)(e))),!this.areBufferBlockMediaTypesFinalForPeriod(e.getPeriodId()))return Promise.resolve();var u=Promise.resolve();if(this.LZ){var c=this.LZ.time,d=this.t1(c);if(!this.IZ.canSwitchToBufferBlock(d))return Promise.resolve();u=this.L0().then(function(){var t;if(!o.isBufferAvailable()){var i=null==(t=o.IZ)?void 0:t.getBufferBlockForSegment(e),n=null==i?void 0:i.getMediaTypesWithoutSubs();return n&&i?o.G0(n,i).then(function(){}):void o.CZ.debug("Chosen buffer block for segment unexpectedly had no mediaTypes")}}).then(function(){return o.u1(c,d)})}else if((0,E.isSwitchingBufferBlocks)(this.K0())||this.isBufferAvailable()||this.l0)this.l0&&(u=this.l0.promise);else{var l=this.IZ.getBufferBlockForSegment(e),h=null==l?void 0:l.getMediaTypesWithoutSubs();if(!h||!l)return this.CZ.debug("Chosen buffer block for segment unexpectedly had no mediaTypes"),Promise.resolve();u=this.G0(h,l)}return u.then(function(){return o.GZ?o.GZ.ready():Promise.reject("Stopping queue processing, renderer is not available")}).then(function(){return o.S0()})},e.prototype.M0=function(e,t){var i=this;this.IZ&&this.IZ.getPrecedingSegments(e,t).forEach(function(e){var t;i.IZ.removeSegment(e),null==(t=i.K0())||t.dispatch((0,T.removeLoadedRange)(e.getMimeType(),(0,F.segmentToBufferBlockTimeRange)(e)))})},e.prototype.N0=function(e,t){var i=this;return this.M0(e,t),this.k0=Date.now(),this.GZ.removeData(e,0,t).catch(function(t){return i.CZ.debug("Error clearing ".concat(e," backward buffer:"),t)})},e.prototype.O0=function(){if(this.IZ){var e=this.IZ.getBufferBlock(this.PZ),t=e?this.IZ.getSmallestMaxSegmentDuration(e):-1;this.j0=(0,_.toMilliSeconds)(Math.max(t/2,this.BZ.settings.MINIMAL_BACKWARD_BUFFER_CLEARING_INTERVAL))}},e.prototype.P0=function(){var e,t,i=this;this.O0();var n=null==(e=this.IZ)?void 0:e.getBufferBlock(this.PZ),r=this.GZ.getCurrentTime(),o=(0,b.getBufferStateMap)(null==(t=this.K0())?void 0:t.getState());o&&Object.keys(o).forEach(function(e){var t,a=null==(t=(0,b.getRendererBufferedRanges)(o,e)[0])?void 0:t.start,s=A.MimeTypeHelper.getMediaType(e);if(void 0!==a&&(null==n?void 0:n.hasMaxSegmentDuration(e))){var u=r-Math.max(n.getMaxSegmentDuration(e)+1,i.EZ.getBackwardTargetLevel(s));a<u&&(i.CZ.debug("Clearing backward buffer for ".concat(e," from ").concat(a," to ").concat(u)),i.N0(e,u).catch(function(e){i.BZ.logger.debug("Could not clear backward buffer",e)}))}})},e.prototype.setEndOfStream=function(e){var t;return e&&this.OZ||!this.GZ?(this.CZ.debug("Skipping setting EOS"),Promise.resolve()):(e&&(null==(t=this.K0())||t.dispatch((0,T.setLoadingRangeFinished)(!0))),this.i0=e,this.GZ.setEndOfStream(e))},e.prototype.Q0=function(e){var t,i=(0,b.getBufferState)(null==(t=this.K0())?void 0:t.getState()),n=void 0!==i?(0,b.getBufferMaxSize)(i,e):b.DefaultBufferMaxSize;if(this.CZ.debug("Exceeded quota for ".concat(e," with ").concat(n," seconds of data in the buffers")),!this.BZ.settings.NO_QUOTA_EXCEEDED_ADJUSTMENT){var r=this.GZ.getCurrentTime(),o=this.IZ.getSmallestSafeBufferSize(r,e);this.EZ.adjustMaxBufferLevels(o,e,n)}},e.prototype.R0=function(){var e,t,i=this.IZ.getBufferBlock(this.PZ),n=(e=this.IZ.getAllSegmentsFromBufferBlock(i).toArray()).reduce(function(e,t){var i=e.getPlaybackTime();return t.getPlaybackTime()<i?t:e},e[0]),r=null!=(t=null==n?void 0:n.getPlaybackTime())?t:0;r<0&&(this.FZ.dispatchEvent(h.PlayerEvent.Warning,new u.PlayerWarning(c.WarningCode.PLAYBACK_NEGATIVE_DECODING_TIMESTAMP_ENCOUNTERED)),this.CZ.debug("Encountered negative DTS ".concat(r,", attempting to correct PTO...")),this.v0=r)},e.prototype.S0=function(){var e=this;return this.e0?this.I1()?(this.R0(),this.V0(1/0).then(function(){return e.K1()})):Promise.resolve():this.V0(1/0)},e.prototype.getBufferedRangesMap=function(e){void 0===e&&(e=!0);var t,i=(0,b.getBufferState)(null==(t=this.K0())?void 0:t.getState());return void 0!==i&&this.IZ?e?this.w0.getRanges(i):(0,b.getRendererBufferRangesMap)(this.IZ,i)(this.PZ):{}},e.prototype.T0=function(e,t){var i=this;if(!this.IZ)return Promise.resolve();var n=this.IZ.getAllSegmentsFromBufferBlock(e),o=n.hasNext()&&n.next();return o?(this.IZ.removeSegment(o),this.O1(o).catch(function(e){i.CZ.warn("Could not add segment to renderer (mimeType: ".concat(o.getMimeType(),", playbackTime: ").concat(o.getPlaybackTime(),")"),e)}).then(function(){o.isInit()||null==(n=i.K0())||n.dispatch((0,T.removeLoadedRange)(o.getMimeType(),(0,F.segmentToBufferBlockTimeRange)(o))),i.n0.set(o.getMimeType(),!o.isInit());var n,a=r.BufferRangeHelper.getTotalCommonBufferLength(i.getBufferedRangesMap());return!(0,E.isSwitchingBufferBlocks)(i.K0())||a<t?i.T0(e,t):Promise.resolve()})):Promise.resolve()},e.prototype.U0=function(e){var t,i,n=this;if(!e)return!1;var r=this.hasStopped(),o=null==(t=this.IZ)?void 0:t.hasStartedLoadingNextBufferBlock(this.PZ),a=null==(i=this.IZ)?void 0:i.hasSegmentsForBufferBlock(e);return!this.JZ.some(function(e){return n.GZ.isDataBeingAppended(e.mimeType)})&&(o||r)&&!a},e.prototype.isSegmentStoreWaitingForSegments=function(){var e,t;return null!=(t=null==(e=this.IZ)?void 0:e.isWaitingForSegments())&&t},e.prototype.V0=function(e){var t=this,i=this.IZ.getBufferBlock(this.PZ);return this.OZ=!0,this.T0(i,e).then(function(){var e,n;t.OZ=!1,t.C0&&!t.isBufferClearingOngoing()&&t.R1()&&t.W1(),t.U0(i)?(t.CZ.debug("Finished loading BB ".concat(t.PZ,": signaling EOS")),null==(e=t.K0())||e.dispatch((0,T.setLoadingRangeFinished)(!0)),t.NZ?t.CZ.debug("Skipped EOS signaling as a BufferBlock switch is just being executed"):t.MZ&&
1(0,E.isSwitchingBufferBlocks)(t.K0())?(t.CZ.debug("delaying EOS signal until ongoing period switch is completed"),t.MZ.then(function(){t.setEndOfStream(!0)})):t.setEndOfStream(!0)):null==(n=t.K0())||n.dispatch((0,T.setLoadingRangeFinished)(!1))})},e.prototype.W0=function(){var e,t,i=this.BZ.serviceManager.get(d.ServiceName.PlayerStateService);if(!i)return!1;var n=null!=(e=i.seekingOrTimeshifting)&&e,r=null==(t=this.K0())?void 0:t.getState(),o=r&&(0,b.getIsTimestampRollingOver)(r);return!(this.i0||(0,E.isSwitchingBufferBlocks)(this.K0())||n||o)},e.prototype.checkIfEndOfBufferReached=function(e,t){if(this.GZ.hasDataInSourceBuffers()){var i=this.GZ.getCurrentTime(!0);this.l1(i,e)&&(this.m1()?t?this.o1(i):this.CZ.debug("End of buffer reached, but cannot switch buffer block yet."):!this.f0&&this.J1()>0&&(this.T1(),this.n1()))}else this.GZ.isPaused()||this.T1()},e.prototype.l1=function(e,t){var i=this.GZ.getEndOfBufferTime();return void 0!==i&&(e>=i-t||this.HZ.isLive()&&0===e)},e.prototype.m1=function(){var e,t=null==(e=this.IZ)?void 0:e.getBufferBlock(this.PZ);return!!t&&!!this.IZ&&this.IZ.hasStartedLoadingNextBufferBlock(t.getId())},e.prototype.n1=function(){var e,t=!0;this.n0.forEach(function(i,n){A.MimeTypeHelper.isVideo(n)&&(t=i,e=n)}),t||(this.CZ.debug("Resetting currentTime on video element on stalling"),this.BZ.videoElement.currentTime=this.BZ.videoElement.currentTime,this.n0.set(e,!0))},e.prototype.o1=function(e){var t,i,n=this.K0();if((0,E.isSwitchingBufferBlocks)(n))return!1;var r=null==n?void 0:n.getState();if(!r||(0,b.getIsTimestampRollingOver)(r))return!1;var o=this.m1(),a=null==(t=this.IZ)?void 0:t.getNextBufferBlock(this.PZ);if(o&&a&&(null==(i=this.IZ)?void 0:i.areBufferBlockMediaTypesFinal(a))){var s=a.getMinCommonStartTime(),u=isFinite(s)&&s>=e?s:e;return this.u1(u,a),!0}return!1},e.prototype.readyToSeek=function(){return this.MZ?(this.CZ.debug("Awaiting ongoing buffer block switch before seek"),this.MZ.then(function(){}).catch(function(){})):Promise.resolve()},e.prototype.shouldBuffersBeClearedOnTimeshift=function(e){var t=this.GZ.getCurrentTime();return!this.isInBufferedRange(e)||e<t},e.prototype.p1=function(e,t){return void 0===t&&(t=!1),t||this.shouldBuffersBeClearedOnTimeshift(e)?this.q1():Promise.resolve()},e.prototype.setTimeshiftCancelState=function(e){this.t0=e},e.prototype.q1=function(){var e=this;return this.BZ.logger.debug("Clearing buffer on timeshift"),this.clearBuffers().then(function(){return e.t0?(e.t0=!1,Promise.reject("cancelled timeshift")):Promise.resolve()})},e.prototype.setCurrentTime=function(e,t,i){var n=this;void 0===t&&(t=!1),void 0===i&&(i=!1);var r=this.IZ.getBufferBlockForPlaybackTime(e),o=this.IZ.getBufferBlock(this.PZ),a=!!(!r||r.getId()!==o.getId());return this.c0=e,this.e0||this.isInBufferedRange(e)||this.T1(),t&&this.isBufferAvailable()&&!this.isBufferClearingOngoing()&&this.p1(e,i).catch(function(e){return n.CZ.debug("Error clearing buffers:",e)}),a?r?this.u1(e,r):this.w1(e):(this.LZ=void 0,this.GZ.setCurrentTime(e).then(function(e){return n.r1(e)}))},e.prototype.r1=function(e){return this.c0=void 0,this.R1()?this.C0&&(this.CZ.debug("End stalling after seek to ".concat(e)),this.W1()):this.CZ.debug("Delay ending stall as the restart threshold is not yet reached"),Promise.resolve(e)},e.prototype.s1=function(e,t){var i,n,r,o,a,s=null!=(n=null==(i=this.LZ)?void 0:i.time)?n:t,u=(0,B.isNumber)(null==(r=this.LZ)?void 0:r.time)&&(null==(o=this.IZ)?void 0:o.canSwitchToBufferBlockForTime(s));if(this.CZ.debug("Buffer block switch failed:",e),this.s0=new K.DeferredReject,u){this.CZ.debug("Trying to continue delayed BufferBlock switch to ".concat(s,"..."));var c=this.t1(s);return this.u1(s,c)}return null==(a=this.K0())||a.dispatch((0,T.setBufferBlockSwitchOngoing)(!1)),Promise.resolve(t)},e.prototype.t1=function(e){var t,i=this.HZ.getPeriodIdForTime(e);return null==(t=this.IZ)?void 0:t.getTargetBufferBlock(e,i)},e.prototype.u1=function(e,t){var i,n,r,o=this,a=function(){};if(this.s0&&this.s0.reject("BufferBlock switch interrupted by newest one"),this.s0=new K.DeferredReject,null==(i=this.K0())||i.dispatch((0,T.setBufferBlockSwitchOngoing)(!0)),this.LZ&&(a=this.LZ.deferred.resolve),!(null==(n=this.IZ)?void 0:n.canSwitchToBufferBlock(t)))return this.w1(e);this.NZ=!0;var s=null!=(r=this.u0)?r:this.g1();return this.MZ=s.then(function(){return o.LZ=void 0}).then(function(){return o.s0.next(function(){return o.v1(t,e)})}).then(function(e){return o.NZ=!1,o.s0=new K.DeferredReject,a(e),e}).catch(function(t){return o.s1(t,e)}).finally(function(){o.MZ=void 0}),this.MZ},e.prototype.v1=function(e,t){var i,n;return this.hasStreamEnded()?(null==(i=this.s0)||i.reject("BufferBlock switch interrupted by source unloading"),Promise.reject("Source was unloaded")):(0,R.isTizen2017)()||(null==(n=this.IZ)?void 0:n.shouldSwitchBufferBlock(e,this.PZ))?this.B1(t,e):this.x1(t,e)},e.prototype.w1=function(e){(0,E.isSwitchingBufferBlocks)(this.K0())&&this.s0&&this.s0.reject("BufferBlock switch interrupted by newest one");var t=this.IZ.getAvailablePositionForTime(e,this.GZ.getCurrentTime());return this.LZ&&this.LZ.time===e||(this.LZ&&this.LZ.time!==e&&this.LZ.deferred.reject(),this.LZ={time:t,deferred:new C.Deferred}),this.LZ.deferred.promise},e.prototype.x1=function(e,t){var i,n=this,r=t.getId();return(null==(i=this.IZ)?void 0:i.getBufferBlock(r))?(this.i0=!1,this.PZ=r,this.IZ.deleteOldBufferBlocks(r),this.NZ=!1,this.m0.clear(),this.s0.next(function(){return n.V0(1/0)}).then(function(){return n.s0.next(function(){return n.D1(e)})}).then(function(e){var t;return null==(t=n.K0())||t.dispatch((0,T.setBufferBlockSwitchOngoing)(!1)),n.y1(),n.r1(e)})):(this.CZ.debug("Target BufferBlock is no longer available, cancelling BufferBlock switch..."),Promise.reject("The targeted buffer BufferBlock is no longer available"))},e.prototype.y1=function(){var e=this,t=this.U1();t&&(this.C0||t.isPaused()||this.GZ.play().catch(function(t){e.CZ.debug("play call failed with reason:",t)}))},e.prototype.z1=function(e,t){var i,n=null==(i=this.IZ)?void 0:i.getBufferBlock(this.PZ);if(!n)return!0;var r=n.getAllKnownPeriodIds().some(function(t){return e.hasTrackedPeriodId(t)}),o=this.JZ.length===t.length,a=!(r||o)||!(0,W.canReuseSourceBuffer)(n,e,t);return this.A1(a,n,e)},e.prototype.A1=function(e,t,i){var n,r,o,a,s=null==(n=this.BZ)?void 0:n.sourceContext.source,u=null==(r=null==s?void 0:s.options)?void 0:r.shouldRecreateSourceBuffersOnPeriodSwitch;if(!u)return e;var c=t.getAllKnownPeriodIds(),d=z(t,null!=(o=c[c.length-1])?o:P.DEFAULT_PERIOD_ID),l=null!=(a=i.getAllKnownPeriodIds()[0])?a:P.DEFAULT_PERIOD_ID,h=z(i,l),p=(0,D.safeUserCallback)(function(){return u(d,h,e)},this.BZ.logger);return"boolean"==typeof p?(this.CZ.debug("User overwrote default SourceBuffer recreation strategy from ".concat(e," to ").concat(p)+" for the switch from ".concat(d.periodId," to ").concat(h.periodId,".")),p):e},e.prototype.B1=function(e,t){var i,n,r,o,a,s,u=this;this.CZ.debug("Switching buffer block for time ".concat(e));var c=t.getMediaTypesWithoutSubs(),l=this.C1(t,c);if(this.JZ=c,null==(i=this.K0())||i.dispatch((0,T.setLoadingRangeFinished)(!1)),null==(r=null==(n=this.BZ.serviceManager)?void 0:n.get(d.ServiceName.TimedMetadataService))||r.resetContentBoundaryTracking(),!1===(null==(o=this.U1())?void 0:o.seekingOrTimeshifting)){var h=null!=(a=t.getAllKnownPeriodIds()[0])?a:P.DEFAULT_PERIOD_ID;null==(s=this.K0())||s.dispatch((0,w.periodSwitchStarted)(h))}return this.s0.next(function(){return l}).then(function(){return u.s0.next(function(){return u.x1(e,t)})}).then(function(e){return u.s0.next(function(){return u.V0(1/0).catch(function(){return u.BZ.logger.debug("Could not push segment into renderer")})}).then(function(){return e})})},e.prototype.C1=function(e,t){return this.z1(e,t)?(this.CZ.debug("recreating the buffers with types",t),this.G0(t,e)):Promise.resolve(0)},e.prototype.D1=function(e){var t=this,i=this.LZ;return this.LZ=void 0,this.s0.next(function(){return t.GZ.setCurrentTime(e)}).then(function(e){return i&&i.deferred&&i.deferred.resolve(e),e})},e.prototype.addMimeTypeAndCodec=function(e,t,i){if(void 0===i&&(i=!1),!A.MimeTypeHelper.isAV(e))return!0;var n=this.GZ.addBuffer(e,t);return n&&((0,m.getMetricsState)(this.BZ.store.getState())[e]||this.BZ.store.dispatch((0,g.initializeMetricsForMimeType)(e,this.BZ.settings)),i||this.BZ.store.dispatch((0,g.addMetricsValue)(e,v.MetricType.StalledSeconds,0))),n},e.prototype.E1=function(){var e,t,i,n,r,o=this.Y1(),a=null==(e=this.IZ)?void 0:e.getAllBufferBlocks(),s=null==(t=this.IZ)?void 0:t.getFutureBufferBlocks(o),u=null==(i=this.IZ)?void 0:i.getBufferBlock(o);if(null==a?void 0:a.length){if(!(null==s?void 0:s.length))return u;for(var c=a.findIndex(function(e){return e.getId()===o}),d=c;d<a.length;d++){var l=a[d];(null==(n=this.IZ)?void 0:n.hasStartedLoadingNextBufferBlock(l.getId()))&&(u=null==(r=this.IZ)?void 0:r.getNextBufferBlock(l.getId()))}return u}},e.prototype.F1=function(){return this.JZ.map(function(e){return e.mimeType})},e.prototype.G1=function(){var e,t;return null!=(t=null==(e=this.E1())?void 0:e.getMediaTypes().map(function(e){return e.mimeType}))?t:[]},e.prototype.H1=function(e,t,i){var n=this;if(!this.isBufferAvailable())return 0;var r=e.map(function(e){return n.getOverallBufferLevel(e,t,p.BufferType.ForwardDuration,i)});return r.length>0?Math.min.apply(Math,r):0},e.prototype.I1=function(){var e=this.EZ.getForwardTargetLevel(),t=this.J1()-this.DZ.DURATION_MISMATCH_TOLERANCE,i=Math.min(this.DZ.STARTUP_THRESHOLD,e-this.DZ.STARTUP_THRESHOLD_DELTA,isFinite(t)?t:1/0),n=this.G1();return this.H1(n)>=i}
1,e.prototype.J1=function(){return this.HZ.isLive()?1/0:this.GZ.getDuration()-this.X1()},e.prototype.K1=function(){if(this.e0){var e=Date.now(),t=(0,m.getMetricsState)(this.BZ.store.getState()),i=(0,m.getMetricsLastEntry)(t,"default",v.MetricType.StartTime).value,n=(0,_.toSeconds)(e-i);this.BZ.store.dispatch((0,g.addMetricsValue)("default",v.MetricType.StartupTimeSeconds,n)),isNaN(n)||this.CZ.debug("start up time: ".concat(n)),this.e0=!1,this.W1()}},e.prototype.L1=function(e){var t=this.GZ.getCurrentTime(!0);e.isInit()&&A.MimeTypeHelper.isVideo(e.getMimeType())&&this.C0&&this.isInBufferedRange(t)&&(this.CZ.debug("Resetting currentTime on video element on unstalling"),this.BZ.videoElement.currentTime=this.BZ.videoElement.currentTime)},e.prototype.M1=function(e){var t=this;e.getDrmInitData().filter(function(e){var t;return(null==(t=e.kid)?void 0:t.length)>0}).forEach(function(i){return t.HZ.setRepresentationDrmKid(e.getRepresentationId(),i.kid[0])})},e.prototype.N1=function(e){var t=e.getPresentationTimeOffset()+this.v0;isNaN(t)||e.setPresentationTimeOffset(t)},e.prototype.O1=function(e){var t=this;this.v0<0&&this.N1(e);var i=A.MimeTypeHelper.extractContentType(e.getMimeType()),n=e.getInitSegment();return n&&this.o0[i]!==n?(this.o0[i]=n,Promise.all([n,e].map(function(e){return t.P1(e)})).then()):this.P1(e)},e.prototype.P1=function(e){var t=this;return e.hasDrmInitData()&&this.M1(e),this.KZ.catch(function(i){if(e.isEncrypted()){var n,r;throw(null==i?void 0:i.message)!==o.DrmSetupError.CANCELLED&&t.BZ.eventHandler.fireError((n=t.BZ.sourceContext.sourceIdentifier,L.ModuleManager.has(k.ModuleName.DRM)?(null==i?void 0:i.message)===o.DrmSetupError.MISSING_CONFIGURATION?new s.PlayerError(a.ErrorCode.DRM_MISSING_CONFIGURATION,{reason:i.message},void 0,n):new s.PlayerError(a.ErrorCode.DRM_NO_KEY_SYSTEM,{reason:null!=(r=null==i?void 0:i.message)?r:i},void 0,n):new x.PlayerModuleMissingError(k.ModuleName.DRM))),"DRMConfig failure"}t.CZ.debug("Problem ensuring segment, error:",i)}).then(function(){return t.L1(e),t.Q1(e),t.GZ.appendData(e).catch(function(e){t.CZ.debug("could not append data to renderer",e)})})},e.prototype.Q1=function(e){var t,i;if(!e.isInit()){var n=e.getSegmentInfo().discontinuitySequenceNumber,r=e.getPeriodId(),o=void 0!==n?String(n):r,a=e.getMimeType();if(o!==this.m0.get(a)){var s=e.getPresentationTimeOffset();(0,B.isNumber)(s)&&isFinite(s)&&this.GZ.setTimestampOffset(a,-s),this.m0.set(a,o),null==(i=null==(t=this.BZ.serviceManager)?void 0:t.get(d.ServiceName.TimedMetadataService))||i.trackContentBoundary(e)}}},e.prototype.R1=function(){var e=this;if(!this.EZ)return!1;var t=this.DZ.RESTART_THRESHOLD;(0,R.isWebOS)()&&(t=Math.max(t,1.5));var i=Math.min(t,this.EZ.getForwardTargetLevel()-this.DZ.RESTART_THRESHOLD_DELTA,this.J1()),n=this.F1(),r=n.every(function(t){return e.GZ.getBufferedRanges(t).length>0}),o=this.H1(n);return r&&o>=i},e.prototype.S1=function(){return!this.e0&&!(0,E.isSwitchingBufferBlocks)(this.K0())},e.prototype.T1=function(){this.S1()&&this.p0.startStalling()},e.prototype.U1=function(){return this.BZ.serviceManager.get(d.ServiceName.PlayerStateService)},e.prototype.V1=function(e){var t=this.U1();if(!t)return!1;var i=this.DZ,n=Math.max(i.END_OF_BUFFER_TOLERANCE,i.END_OF_BUFFER_RECOVERY_TOLERANCE,i.RESTART_THRESHOLD),r=this.F1(),o=this.H1(r,e,!1),a=o>=this.J1()||this.f0;return!(o>=n)&&!a&&!t.seekingOrTimeshifting},e.prototype.W1=function(){if(this.C0)if((0,E.isSwitchingBufferBlocks)(this.K0()))this.CZ.debug("Ending stall was aborted due to buffer block switching");else{var e=this.X1();this.V1(e)?this.Z1(e)?(this.CZ.debug("Ending stall at the gap"),this.a0()):this.CZ.debug("Cannot unstall yet as playback is stalling at a gap and there is no future common buffer"):this.p0.endStalling()}},e.prototype.X1=function(){return void 0!==this.c0?this.c0:this.GZ.getCurrentTime()},e.prototype.Y1=function(){return this.IZ.getCurrentBufferBlockId()},e.prototype.hasPendingSegments=function(e){return e=e||this.Y1(),this.IZ.getFutureBufferBlocks(e).some(function(e){return e.hasSegments()})},e.prototype.getOverallBufferLevel=function(e,t,i,n){void 0===t&&(t=this.GZ.getCurrentTime()),void 0===i&&(i=p.BufferType.ForwardDuration),void 0===n&&(n=!0),this.e0&&(t=this.
1X1());var o=this.getBufferedRangesMap()[e];return o&&0!==o.length?(o=n?r.BufferRangeHelper.mergeRanges(o.concat(r.BufferRangeHelper.findGapsInRanges(o)),this.DZ.GAP_TOLERANCE):o.filter(function(e){return e.start<=t&&t<=e.end}),r.BufferRangeHelper.getBufferLevel(o,t,i)):0},e.prototype.Z1=function(e){return void 0===e&&(e=this.GZ.getCurrentTime()),r.BufferRangeHelper.getCommonBufferedRanges(this.getBufferedRangesMap()).some(function(t){return t.getStart()>e})},e.prototype.hasFutureBufferBlockData=function(){var e;return!!(null==(e=this.IZ)?void 0:e.getNextBufferBlock(this.PZ))||(0,E.isSwitchingBufferBlocks)(this.K0())},e.prototype.isInBufferedRange=function(e){return r.BufferRangeHelper.isInBufferedRange(this.getBufferedRangesMap(),e)},e.prototype.isStarted=function(){return this.d0},e.prototype.isSuspended=function(){return this.h0},e.prototype.isInStartupPhase=function(){return this.e0},e.prototype.hasStreamEnded=function(){return this.g0},e.prototype.a1=function(){var e;if(!this.r0){var t=this.K0();void 0!==t&&void 0!==(null==(e=t.getState())?void 0:e.manifest)&&(this.r0=(0,I.subscribe)(t)(N.getManifest,this.B0,function(e){return(null==e?void 0:e.isInitialized)||!1}))}},e.prototype.stop=function(e){var t;void 0===e&&(e=!1),this.f0=!0,this.d0=!1,this.e0=!1,e?(this.GZ.end(),null==(t=this.K0())||t.dispatch((0,T.setBufferBlockSwitchOngoing)(!1)),this.g0=!0,this.CZ.debug("stopped playback"),this.GZ.off(O.MediaElementEvent.stalled,this.k1),this.GZ.off(O.MediaElementEvent.waiting,this.k1),this.GZ.off(O.MediaElementEvent.ended,this.Z0),this.GZ.off(O.MediaElementEvent.timeupdate,this.X0),this.GZ.off(O.MediaElementEvent.currenttimenotadvancing,this.Y0),this.r0&&(this.r0(),this.r0=void 0),void 0!==this.x0&&(this.x0(),this.x0=void 0),this.b1(),this.n0.clear()):this.W1()},e.prototype.hasStopped=function(){return this.f0},e.prototype.b1=function(){var e=this;Object.keys(this.q0).forEach(function(t){return e.I0(t)})},e.prototype.restart=function(){this.f0=!1,this.h0=!1,this.d0||(this.d0=!0,this.GZ.on(O.MediaElementEvent.stalled,this.k1),this.GZ.on(O.MediaElementEvent.waiting,this.k1),this.GZ.on(O.MediaElementEvent.ended,this.Z0),this.GZ.on(O.MediaElementEvent.timeupdate,this.X0),this.GZ.on(O.MediaElementEvent.currenttimenotadvancing,this.Y0)),this.g0=!1},e.prototype.suspend=function(){var e,t,i,n;this.f0=!0,this.h0=!0,this.d0=!1,this.GZ.off(O.MediaElementEvent.stalled,this.k1),this.GZ.off(O.MediaElementEvent.waiting,this.k1),this.GZ.off(O.MediaElementEvent.ended,this.Z0),this.GZ.off(O.MediaElementEvent.timeupdate,this.X0),this.GZ.off(O.MediaElementEvent.currenttimenotadvancing,this.Y0),null==(e=this.r0)||e.call(this),this.r0=void 0,null==(t=this.x0)||t.call(this),this.x0=void 0,null==(i=this.y0)||i.call(this),this.y0=void 0,this.b1(),null==(n=this.s0)||n.reject("BufferController suspended"),this.u0&&(this.u0=this.u0.catch(function(){})),this.GZ.clearSegmentQueues()},e.prototype.canRestoreFromSuspended=function(){var e,t=void 0!==this.BZ.sourceContext.source.drm,i=null!=(null==(e=this.BZ.videoElement)?void 0:e.mediaKeys);return this.GZ.canReuseMse()&&(!t||i)},e.prototype.c1=function(e){var t;this.HZ=this.BZ.serviceManager.get(d.ServiceName.ManifestService,this.BZ.sourceContext.sourceIdentifier),this.b0=e,this.v0=0,this.k0=0,this.LZ=void 0,this.MZ=void 0,this.s0=new K.DeferredReject,this.i0=!1,this.OZ=!1,this.g0=!1,this.NZ=!1,this.n0.clear(),this.o0={},this.m0.clear(),this.c0=void 0,this.t0=!1,null==(t=this.K0())||t.dispatch((0,T.setBufferBlockSwitchOngoing)(!1)),this.e0=!0},e.prototype.restore=function(e,t,i){var n,r=this;void 0===i&&(i=0),this.c1(e),this.p0.dispose();var o=this.U1();return o?(this.p0=new q.BufferStallingService(o,this.CZ,this.BZ.renderer),null==(n=this.IZ)||n.clearRequiredMediaTypes(),this.A0(),this.z0(),this.d1().then(function(){r.GZ.setDuration(r.b0),r.D0()&&r.J0(t),r.restart(),r.setCurrentTime(i).catch(function(){})},function(e){r.F0(e)})):Promise.reject(Error("Could not get player state service"))},e.prototype.d1=function(){var e=this;return this.GZ.resetSeekState(),this.u0=this.f1(),this.u0.finally(function(){return e.u0=void 0}),this.u0.then(function(){e.BZ.videoElement&&(e.BZ.videoElement.currentTime=0);var t,i=null==(t=e.IZ)?void 0:t.getActiveBufferBlock();
1i&&i.getSourceIdentifier()!==e.BZ.sourceContext.sourceIdentifier&&(Object.keys(i.mediaTypes).forEach(function(e){return i.clearSegments(e)}),e.w0.invalidate())})},e.prototype.dispose=function(){var e,t;this.stop(!0),this.GZ=null,this.FZ=null,this.DZ=null,this.EZ=null,this.FZ=null,this.IZ=void 0,this.o0=null,null==(e=this.y0)||e.call(this),null==(t=this.K0())||t.dispatch((0,T.resetLoadedRanges)()),this.w0.dispose(),this.JZ=[],this.b1(),this.KZ=null,this.p0=(0,l.dispose)(this.p0)},e.prototype.changeBufferType=function(e,t,i){var n,r,o=this.JZ.find(function(t){return A.MimeTypeHelper.getMediaType(t.mimeType)===A.MimeTypeHelper.getMediaType(e)});return o&&(this.JZ.splice(this.JZ.indexOf(o),1),this.JZ.push({mimeType:e,codec:t}),this.I0(o.mimeType),null==(r=this.K0())||r.dispatch((0,T.resetLoadedRanges)(o.mimeType))),this.H0(e),this.o0={},o?this.GZ.changeBufferType(e,t,i):Promise.resolve(((n={})[e]=t,n))},e.prototype.addRequiredMediaType=function(e,t){this.IZ.addRequiredMediaType(e,t)},e.prototype.updateRequiredMediaType=function(e,t){var i;null==(i=this.IZ)||i.changeMediaType(e,t)},e.prototype.areBufferBlockMediaTypesFinalForPeriod=function(e){var t,i;return null!=(i=null==(t=this.IZ)?void 0:t.areBufferBlockMediaTypesFinalForPeriod(e))&&i},e.prototype.clearCacheForMimeType=function(e){var t;null==(t=this.K0())||t.dispatch((0,T.resetLoadedRanges)(e)),this.IZ.clearSegments(e)},e.prototype.e1=function(){var e,t=this;Object.keys((0,G.getStreamTimeline)(null==(e=this.K0())?void 0:e.getState())).filter(function(e){return A.MimeTypeHelper.isAV(e)}).forEach(function(e){return t.clearCacheForMimeType(e)})},e.prototype.isBufferClearingOngoing=function(){return void 0!==this.u0},e.prototype.clearBuffers=function(){var e=this;return this.u0?this.CZ.debug("Skipping buffer clearing as it is already ongoing"):(this.T1(),this.e1(),this.u0=this.f1(),this.u0.finally(function(){return e.u0=void 0})),this.u0},e.prototype.f1=function(){var e=this;return this.setEndOfStream(!1).then(function(){return e.clearRendererBuffers()})},e.prototype.g1=function(){var e=this;return this.setEndOfStream(!1).then(function(){return e.s0.next(function(){return e.clearRendererBuffers()})})},e.prototype.clearRendererBuffers=function(){var e=this;return this.isBufferAvailable()?Promise.all(this.JZ.map(function(t){return e.clearBuffer(t.mimeType)})).then(function(){}):Promise.resolve()},e.prototype.clearBuffer=function(e){var t=this;return this.GZ.removeData(e,void 0,void 0,this.isSuspended()).catch(function(i){return t.CZ.debug("Error clearing ".concat(e," buffer:"),i)})},e.prototype.removeBufferRange=function(e,t,i){var n=this;return this.GZ.removeData(e,t,i).catch(function(t){return n.CZ.debug("Error removing ".concat(e," buffer range:"),t)})},e.prototype.isBufferAvailable=function(){return this.JZ.length>0},e}()},60632:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.BufferRangesCache=void 0;var n=i(80813),r=i(86897),o=i(93204),a=i(10333);t.BufferRangesCache=function(){function e(e,t){var i=this;this.context=e,this.segmentStore=t,this.Ddb=this.Fdb(),this.Bdb=(0,o.subscribe)(e.store)(a.sourceIdentifiersSelector,function(){return i.Edb()},function(e,t){return!!e.includes(i.context.sourceContext.sourceIdentifier)&&(0,a.hasASourceStoreIdentifierChanged)(e,t)}),this.Hdb(),this.Idb((0,r.getBufferState)(this.Ddb.getState()))}return e.prototype.Edb=function(){this.Ddb=this.Fdb(),this.Ddb?(this.Hdb(),this.Idb((0,r.getBufferState)(this.Ddb.getState()))):this.Gdb()},e.prototype.Fdb=function(){return this.context.serviceManager.get(n.ServiceName.SourceStoreService,this.context.sourceContext.sourceIdentifier)},e.prototype.Gdb=function(){this.Adb&&this.Adb(),this.Adb=void 0,this.Bdb=void 0},e.prototype.Hdb=function(){var e=this;this.Gdb(),this.Adb=(0,o.subscribe)(this.Ddb)(function(e){return(0,r.getBufferState)(e)},function(t){return e.Idb(t)},r.hasBufferRangesChanged)},e.prototype.Idb=function(e){this.Cdb={overallBufferRanges:(0,r.getBufferRangesMap)(this.segmentStore,e,this.context.settings.GAP_TOLERANCE)}},e.prototype.getRanges=function(e){return void 0!==this.Adb&&void 0!==this.Cdb&&0!==Object.keys(this.Cdb.overallBufferRanges).length||this.Idb(e),this.Cdb.overallBufferRanges},e.prototype.invalidate=function(){this.Cdb=void 0},e.prototype.dispose=function(){this.Gdb(),this.Bdb&&(this.Bdb(),this.Bdb=void 0),this.Cdb=void 0},e}()}
vendor: 3,663 bytes, line 1
1,94305:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.BufferStallingService=void 0;var n=i(85648),r=i(60877);t.BufferStallingService=function(){function e(e,t,i){this.playerStateService=e,this.logger=t,this.renderer=i}return e.prototype.startStalling=function(){this.isRendererStalling()||(this.logger.debug("Stalling playback at ".concat(this.renderer.getCurrentTime(!0))),this.logger.insane("Video element stall started in state: ".concat(this.playerStateService.playbackState)),this.playerStateService.setIsRendererStalling(!0),this.playerStateService.isPlaying()&&(this.logger.insane("Call pause on renderer"),this.renderer.pause()))},e.prototype.endStalling=function(){var e=this;if(this.isRendererStalling()){this.playerStateService.setIsRendererStalling(!1);var t=[n.PlaybackState.Play,n.PlaybackState.Playing].includes(this.playerStateService.playbackState);this.logger.debug("Unstalling and ".concat(t?"":"not ","restarting playback")),t&&(!this.playerStateService.seekingOrTimeshifting&&(0,r.shouldResetCurrentTimeAfterBufferUnderrun)()&&(this.logger.debug("Resetting current time before unstalling"),this.renderer.setCurrentTime(this.renderer.getCurrentTime())),this.renderer.play().catch(function(t){e.logger&&e.logger.debug("Play after unstalling failed with reason: ".concat(t))}))}},e.prototype.isRendererStalling=function(){return this.playerStateService.getIsRendererStalling()},e.prototype.dispose=function(){this.logger=null,this.playerStateService=null,this.renderer=null},e}()},51888:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeferredReject=void 0,t.DeferredReject=function(){function e(){this.Jdb=!1}return e.prototype.reject=function(e){this.Jdb=!0,this.Kdb=e},e.prototype.next=function(e){return this.Jdb?Promise.reject(this.Kdb):e()},e}()},39494:function(e,t,i){var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentStore=t.INITIAL_BUFFER_BLOCK_ID=void 0;var r=i(68925),o=i(86897),a=i(15971),s=i(34047),u=i(79721),c=i(76399),d=i(85434),l=i(88052),h=i(62756),p=i(59604),f=i(99529),g=i(90685),m=i(674),v=i(77264);t.INITIAL_BUFFER_BLOCK_ID=0;var y=function(){function e(e,t){this.context=e,this.Ndb=[],this.Odb=[],this.Qdb={},this.Qdb={},this.Pdb=new v.Segregation(this.Qdb,t),this.Ndb.push(this.bdb())}return e.prototype.Rdb=function(){var e=this;return this.Ndb.filter(function(t){return t.getSourceIdentifier()===e.context.sourceContext.sourceIdentifier})},e.prototype.Sdb=function(e){return this.Rdb().find(function(t){return t.hasTrackedPeriodId(e)})},e.prototype.hasSegmentsForBufferBlock=function(e){return this.getAllSegmentsFromBufferBlock(e).hasNext()},e.prototype.isWaitingForSegments=function(){return 0!==this.Odb.length},e.prototype.hasDataSegmentsForBufferBlock=function(e){return Object.keys(e.mediaTypes).filter(function(e){return d.MimeTypeHelper.isAV(e)}).every(function(t){return e.hasDataSegments(t)})},e.prototype.getTargetBufferBlock=function(e,t){return this.getBufferBlockForPlaybackTime(e)||this.cdb(e)||this.Sdb(t)},e.prototype.canSwitchToBufferBlock=function(e){if(!e)return!1;var t=this.areBufferBlockMediaTypesFinal(e);return this.hasDataSegmentsForBufferBlock(e)&&t},e.prototype.canSwitchToBufferBlockForTime=function(e){var t=this.getBufferBlockForPlaybackTime(e);return this.canSwitchToBufferBlock(t)},e.prototype.areBufferBlockMediaTypesFinalForPeriod=function(e){var t,i=this;if(void 0===this.Qdb[e])return!1;var n=this.Sdb(e);
1if(!n||0===Object.keys(null!=(t=null==n?void 0:n.mediaTypes)?t:{}).length)return!1;var r=Object.keys(n.mediaTypes);return Object.keys(this.Qdb[e]).filter(function(e){return d.MimeTypeHelper.isAV(e)}).every(function(t){var n;return r.includes(t)&&(null==(n=i.Qdb[e][t])?void 0:n.codec)})},e.prototype.areBufferBlockMediaTypesFinal=function(e){var t,i=this;return!(!e||0===Object.keys(null!=(t=null==e?void 0:e.mediaTypes)?t:{}).length)&&e.getAllKnownPeriodIds().every(function(e){return i.areBufferBlockMediaTypesFinalForPeriod(e)})},e.prototype.addRequiredMediaType=function(e,t){this.Qdb[e]||(this.Qdb[e]={}),this.Qdb[e][t]||(this.Qdb[e][t]={mimeType:t});var i=this.Sdb(e);i&&(i.mediaTypes[t]||i.addMediaType({mimeType:t}))},e.prototype.clearRequiredMediaTypes=function(){var e=this;Object.keys(this.Qdb).forEach(function(t){return delete e.Qdb[t]})},e.prototype.changeMediaType=function(e,t){var i=this,n=Object.keys(this.Qdb),r=t;n.forEach(function(n){t||(r=Object.keys(i.Qdb[n]).find(function(t){return d.MimeTypeHelper.getMediaType(t)===d.MimeTypeHelper.getMediaType(e)})),i.Tdb(n,r),i.addRequiredMediaType(n,e),i.clearSegments(r)})},e.prototype.Tdb=function(e,t){if(this.Qdb[e]){delete this.Qdb[e][t];var i=this.Sdb(e);i&&i.removeMediaType(t)}},e.prototype.Udb=function(e,t){var i;if(this.Qdb[e]){var r=this.Qdb[e][t.mimeType];this.Qdb[e][t.mimeType]=n(n({},r),t)}else this.Qdb[e]=((i={})[t.mimeType]=t,i)},e.prototype.Vdb=function(e,t){var i=this,n=this.Rdb();if(1===n.length&&this.Pdb.canAddSegmentToBufferBlock(e,n[0],t))return n[0];var r=n.reduce(function(n,r){return i.Pdb.canAddSegmentToBufferBlock(e,r,t)&&(!n||r.getMinDistanceFromBufferBlock(e)<n.getMinDistanceFromBufferBlock(e))?r:n},void 0);if(r){var o,a,s=r.getCommonPlaybackTimeRanges(),u=e.getPlaybackTime(),c=n.filter(function(e){return e!==r}).map(function(e){return{range:e.getCommonPlaybackTimeRanges(),block:e}}).sort(function(e,t){return e.range.start-t.range.start}),d=(o=s.start,c.reduce(function(e,t){return t.range.end<=o?Math.max(t.range.start,e):e},-1/0)),l=(a=s.end,c.reduce(function(e,t){return t.range.start>=a?Math.min(t.range.start,e):e},1/0));if(d<=u&&u<=l&&!this.Wdb(u,r,c))return r}},e.prototype.Wdb=function(e,t,i){return i.filter(function(e){return isFinite(e.range.start)&&e.range.start>t.getCommonPlaybackTimeRanges().start&&isFinite(e.range.end)&&e.range.end>t.getCommonPlaybackTimeRanges().end}).some(function(t){var i=t.range.start<=e&&e<=t.range.end,n=e>t.range.end;return i||n})},e.prototype.Xdb=function(e,t){var i=this,n=null!=e?e:u.DEFAULT_PERIOD_ID;return Object.keys(this.Qdb[n]).filter(function(e){return d.MimeTypeHelper.isAV(e)}).every(function(e){return i.Odb.some(function(i){return i.getMimeType()===e&&i.getSegmentInfo().discontinuitySequenceNumber===t&&i.getPeriodId()===n})})},e.prototype.Ydb=function(e){var t,i=null==(t=(0,a.getSourceState)(this.context))?void 0:t.hls;return!!i&&(0,l.ModuleManager.get(h.ModuleName.HLS).selectors.areDiscontinuitiesMisaligned)(i,Object.keys(this.Qdb[u.DEFAULT_PERIOD_ID]).filter(function(e){return d.MimeTypeHelper.isAV(e)}),e.getDuration())},e.prototype.addSegment=function(e){var t,i,n,r,o,a,u,c=this;if(t=this.Ndb,i=this.context.sourceContext.sourceIdentifier,n=t.filter(function(e){return e.getSourceIdentifier()===i}),o=(r=e.getSegmentInfo()).codecs,a=r.discontinuitySequenceNumber,u=r.periodId,null!=a?n.some(function(e){return e.hasTrackedDiscontinuity(a)})||(0,s.isAVMuxedTogether)(o):void 0===u||n.some(function(e){return e.hasTrackedPeriodId(u)}))this.Zdb([e]);else{var d=e.getSegmentInfo(),l=d.discontinuitySequenceNumber,h=d.periodId;if(this.Odb.push(e),this.context.logger.debug("[SegmentStore] Reached new content boundary ".concat(null!=l?l:h," with ").concat(e.getMimeType()," segment"),{url:e.getUrl()}),this.Xdb(h,l)){var p=this.Odb.filter(function(e){return e.getSegmentInfo().discontinuitySequenceNumber===l&&e.getSegmentInfo().periodId===h});this.context.logger.debug("[SegmentStore] ".concat(null==l?"Period":"Discontinuity"," ").concat(null!=l?l:h," is ready: adding segments to store")),this.Zdb(p),this.Odb=this.Odb.filter(function(e){return e.getSegmentInfo().discontinuitySequenceNumber!==l||e.getSegmentInfo().periodId!==h})}else this.Ydb(e)&&(this.context.logger.debug("[SegmentStore] Detected misaligned discontinuities: flushing all delayed segments"),this.Odb.forEach(function(e){return c.Zdb([e])}),this.Odb=[])}},e.prototype.Zdb=function(e){var t=this,i=e.reduce(function(e,i){var n=t.Pdb.getSegregationCriteria(i),r=t.Vdb(i,n);return null===e?r:r!==e?void 0:r},null);i||(i=this.bdb(),this.Ndb.push(i)),e.forEach(function(e){var n=t.Pdb.getSegregationCriteria(e);t.context.logger.debug("[SegmentStore] Added ".concat(e.getMimeType()," segment to BB with ID ").concat(i.getId()),{segment:e.getUrl(),segmentCriteria:n});var o=(0,a.getSourceStore)(t.context),s=(0,f.getTrackIdentifier)(e.getSegmentInfo());null==o||o.dispatch((0,r.removeLoadedRange)(s,(0,p.segmentToBufferBlockTimeRange)(e))),i.addSegment(e),null==o||o.dispatch((0,r.addLoadedRange)(s,(0,p.segmentToBufferBlockTimeRange)(e))),i.getSegregationCriteria(e.getMimeType())||i.setSegregationCriteria(n,e.getMimeType());var u=i.getMediaType(e.getMimeType());u&&t.Udb(e.getPeriodId(),u)})},e.prototype.adb=function(){var e=this.Ndb[this.Ndb.length-1];return e?e.getId()+1:t.INITIAL_BUFFER_BLOCK_ID},e.prototype.bdb=function(){var e=this.adb();return this.context.logger.debug("[SegmentStore] creating new BB with ID ".concat(e," for source ").concat(this.context.sourceContext.sourceIdentifier," (isAd: ").concat(this.context.sourceContext.
1isAd,")")),new g.BufferBlock(e,this.context.sourceContext.sourceIdentifier)},e.prototype.getMediaTypes=function(e){var t=this;return e&&this.Qdb[e]?Object.keys(this.Qdb[e]).map(function(i){return t.Qdb[e][i]}):[]},e.prototype.getAllBufferBlocks=function(){return this.Ndb},e.prototype.getCurrentBufferBlockId=function(){var e,i=this.Ndb[0];return null!=(e=null==i?void 0:i.getId())?e:t.INITIAL_BUFFER_BLOCK_ID},e.prototype.deleteOldBufferBlocks=function(e){this.Ndb=this.Ndb.filter(function(t){return t.getId()>=e&&t.getAllSegments().length>0})},e.prototype.getActiveBufferBlock=function(){var e;return null!=(e=this.getBufferBlock(this.getCurrentBufferBlockId()))?e:null},e.prototype.getBufferBlock=function(e){return this.Ndb.find(function(t){return t.getId()===e})},e.prototype.getBufferBlockForSegment=function(e){return this.getBufferBlock(e.getBufferBlockId())},e.prototype.getBufferBlockForPlaybackTime=function(e){var t=this,i=this.Rdb().filter(function(i){var n=0===e?t.getSmallestMaxSegmentDuration(i)-.01:.01;return Object.keys(i.mediaTypes).filter(function(e){return d.MimeTypeHelper.isAV(e)}).every(function(t){var r,o;return(null==(r=i.getPlaybackTimeRange(t))?void 0:r.start)<=e+n&&(null==(o=i.getPlaybackTimeRange(t))?void 0:o.end)>=e})});return i[i.length-1]},e.prototype.cdb=function(e){return this.Rdb().filter(function(t){return t.getMinCommonStartTime()>=e}).sort(function(e,t){return e.getMinCommonStartTime()-t.getMinCommonStartTime()})[0]},e.prototype.getNextSegment=function(){var e,t;return null!=(t=null==(e=this.getActiveBufferBlock())?void 0:e.getNextSegment())?t:null},e.prototype.removeSegment=function(e){var t=this.getBufferBlockForSegment(e);t&&t.removeSegment(e),this.Odb=this.Odb.filter(function(t){return t!==e})},e.prototype.getAllSegmentsFromBufferBlock=function(e,t){if(!e)return c.EmptyIterator.getInstance();var i=e.getAllSegments();return t?new c.FilterIterator(new c.ArrayIterator(i),function(e){return e.getMimeType()===t}):new c.ArrayIterator(i)},e.prototype.getNextBufferBlock=function(e){return this.Ndb.find(function(t){return t.getId()>e})},e.prototype.getFutureBufferBlocks=function(e){return this.Ndb.filter(function(t){return t.getId()>=e})},e.prototype.getPrecedingSegments=function(e,t){var i=this.Odb.filter(function(i){return(0,g.isPrecedingSegment)(i,e,t)});return this.Ndb.flatMap(function(i){return i.getPrecedingSegments(e,t)}).concat(i)},e.prototype.clearSegments=function(e){this.context.logger.debug("[SegmentStore] clearing all segments for ".concat(e)),this.Ndb.forEach(function(t){return t.clearSegments(e)}),this.Odb=this.Odb.filter(function(t){return t.getMimeType()!==e})},e.prototype.getSmallestMaxSegmentDuration=function(e){return e&&e.hasMaxSegmentDurations()?e.getMinMaxSegmentDuration():-1},e.prototype.getSmallestSafeBufferSize=function(e,t){var i=this.getBufferBlockForPlaybackTime(e);return(null==i?void 0:i.hasMaxSegmentDuration(t))?i.getMaxSegmentDuration(t)+1:1},e.prototype.getAvailablePositionForTime=function(e,t){var i=e;if(t&&e>t){var n=this.getBufferBlockForPlaybackTime(e);n||(n=this.cdb(e))&&(i=n.getMinCommonStartTime())}return i},e.prototype.getPlaybackTimesForBufferBlock=function(e,t){var i=this,n=this.getBufferBlock(e);return t.map(function(e){var t=new c.FilterIterator(i.getAllSegmentsFromBufferBlock(n,e),function(e){return!e.isInit()});return t.hasNext()?t.next().getPlaybackTime():-1/0})},e.prototype.hasStartedLoadingNextBufferBlock=function(e){var t=this.getNextBufferBlock(e);return!!t&&this.hasDataSegmentsForBufferBlock(t)},e.prototype.shouldSwitchBufferBlock=function(e,t){return!(0,m.areBufferBlocksEqual)(e,this.getBufferBlock(t))},e.prototype.getSegmentStoreRangesMap=function(e,t){var i={};return t.forEach(function(e){return i[e]=[]}),this.getFutureBufferBlocks(this.getCurrentBufferBlockId()).map(function(e){return e.getId()}).concat(1/0).map(function(t){return(0,o.getBufferBlockLoadedRanges)(e,t)}).forEach(function(e){return Object.keys(e).forEach(function(t){return i[t].push(e[t])})}),i},e}();t.SegmentStore=y},77264:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.Segregation=void 0,t.areSegregationCriteriaEqual=c,t.canReuseSourceBuffer=function(e,t,i){var o=(0,r.getCapabilities)().isTizen?m:(0,r.getCapabilities)().isLegacyEdge?y:(0,r.getCapabilities)()[n.CapabilityKey.isEdge]?g:(0,r.getCapabilities)()[n.CapabilityKey.isWebOS]?v:(0,r.getCapabilities)()[n.CapabilityKey.isPlayStation4]?p:(0,r.getCapabilities)()[n.CapabilityKey.isPlayStation5]?f:h;return i.every(function(i){var n=i.mimeType;return o.canReuseSourceBuffers(e,t,n)})};var n=i(7387),r=i(21513),o=i(34047),a=i(85434),s=i(15487),u=i(90685);
1function c(e,t,i){return void 0===i&&(i=[]),Object.keys(e).filter(function(e){return!i.includes(e)}).every(function(i){return t&&t[i]===e[i]})}function d(e,t){var i=e.getMediaTypes().find(function(e){return e.mimeType===t});return i?i.timescale:0}function l(e,t,i){return{currentCriteria:e.getSegregationCriteria(i),nextCriteria:t.getSegregationCriteria(i)}}t.Segregation=function(){function e(e,t){this.requiredMediaTypes=e,this.settings=t,this.requiredMediaTypes=e}return e.prototype.Ldb=function(e){var t;return!!(null==(t=this.requiredMediaTypes[e.getPeriodId()])?void 0:t[e.getMimeType()])},e.prototype.Mdb=function(e,t){var i=this;if(void 0!==t.getSegmentInfo().discontinuitySequenceNumber)return!0;if(!this.Ldb(t))return!1;var n=t.getPeriodId(),r=Object.keys(this.requiredMediaTypes[n]||{}).filter(function(e){return a.MimeTypeHelper.isAV(e)});return e.length===r.length&&e.every(function(e){var t;return null==(t=i.requiredMediaTypes[n])?void 0:t[e.mimeType]})},e.prototype.getSegregationCriteria=function(e){var t,i={encryption:e.isEncrypted()?u.EncryptionState.Encrypted:u.EncryptionState.Clear,codec:o.CodecStringHelper.extractCodec(e.getCodec())};if(this.settings.HLS_CLEAR_BUFFERS_ON_DISCONTINUITY_SWITCHES){var n=null==(t=e.getSegmentInfo())?void 0:t.discontinuitySequenceNumber;null!=n&&(i.discontinuityNumber=n)}return(this.settings.DASH_CLEAR_BUFFERS_ON_PERIOD_SWITCHES||(0,s.isTizen2016)())&&(i.periodId=e.getPeriodId()),i},e.prototype.canAddSegmentToBufferBlock=function(e,t,i){var n,r=t.getMediaTypes();if(0===r.length)return!0;if(!this.Mdb(r,e))return!1;var o=e.getMimeType(),a=t.getSegregationCriteria(o);if(a)return c(i,a);var s=null==(n=r.find(function(e){return e.mimeType!==o}))?void 0:n.mimeType;return!s||c(i,t.getSegregationCriteria(s),["codec","encryption"])},e}();var h={canReuseSourceBuffers:function(e,t,i){var n=l(e,t,i);return S(n.currentCriteria,n.nextCriteria)}},p={canReuseSourceBuffers:function(e,t,i){var n=l(e,t,i),r=n.currentCriteria,o=n.nextCriteria;return S(r,o)&&T(r,o)&&b(r,o)&&(null==r?void 0:r.periodId)===(null==o?void 0:o.periodId)&&M(e,t,i)}},f={canReuseSourceBuffers:function(e,t,i){var n=l(e,t,i),r=n.currentCriteria,o=n.nextCriteria;return S(r,o)&&T(r,o)&&M(e,t,i)}},g={canReuseSourceBuffers:function(e,t,i){var n=l(e,t,i),r=n.currentCriteria,o=n.nextCriteria;return S(r,o)&&T(r,o)}},m={canReuseSourceBuffers:function(e,t,i){var n=l(e,t,i),r=n.currentCriteria,o=n.nextCriteria;return!(0,s.isTizen2017)()&&S(r,o)&&T(r,o)&&M(e,t,i)}},v={canReuseSourceBuffers:function(e,t,i){var n=l(e,t,i),r=n.currentCriteria,o=n.nextCriteria,a=S(r,o)&&M(e,t,i)&&!b(r,o);return((0,s.isWebOs2017)()||(0,s.isWebOs2016)())&&(a=a&&T(r,o)),a}},y={canReuseSourceBuffers:function(e,t,i){return!1}};function S(e,t){return(null==e?void 0:e.codec)===(null==t?void 0:t.codec)}function T(e,t){return(null==e?void 0:e.encryption)===(null==t?void 0:t.encryption)}function b(e,t){return(null==e?void 0:e.discontinuityNumber)===(null==t?void 0:t.discontinuityNumber)}function M(e,t,i){return d(e,i)===d(t,i)}},14302:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractUpdater=t.REPRESENTATION_UPDATE_CANCEL=void 0,t.calculateUpdateDelayInMillis=c;var n=i(80813),r=i(3714),o=i(34841),a=i(89927),s=i(88844);t.REPRESENTATION_UPDATE_CANCEL="CANCEL";var u=function(){function e(e,t){var i=this;this.context=e,this.updateCallbacks=t,this.lP=function(){var e,t;!1===(null==(e=i.kP)?void 0:e.hasSettled)&&(i.context.logger.debug("Scheduling delayed manifest update as playback has started"),null==(t=i.kP)||t.resolve(),i.kP=void 0)},this.rP=function(e){i.sP(e),i.clearTimeout()},this.tP=function(e){i.success(e),i.clearTimeout(),i.jP||i.scheduleUpdate()},this.jP=!1,e.eventHandler.on(r.PlayerEvent.Playing,this.lP,!0)}return e.prototype.cancel=function(){var e;this.hP&&(this.hP.reject(t.REPRESENTATION_UPDATE_CANCEL),this.updateCallbacks.error(t.REPRESENTATION_UPDATE_CANCEL),null==(e=this.kP)||e.reject(t.REPRESENTATION_UPDATE_CANCEL),this.kP=void 0),this.clearTimeout()},e.prototype.clearTimeout=function(){(0,s.clearTimeoutIfDefined)(this.iP),this.iP=null},e.prototype.stop=function(){null!==this.iP&&(this.jP=!0,this.cancel())},e.prototype.start=function(){this.jP=!1,this.scheduleUpdate()},e.prototype.scheduleUpdate=function(e){void 0===e&&(e=!1),this.iP||this.jP||this.mP(e)},e.prototype.mP=function(e){var t=this,i=c(this.getLastReloadTimestamp(),this.getReloadIntervalInSeconds());if(!(i>
10x7fffffff)){var n=new o.Deferred,r={isForcedUpdate:e,wasInvalidated:function(){return n!==t.hP}};n.promise.catch(function(){}),this.hP=n,this.iP=window.setTimeout(function(){return t.nP(r)},i)}},e.prototype.nP=function(e){var t=this;this.oP(e.isForcedUpdate).then(function(){return t.update()}).then(function(i){e.wasInvalidated()||t.tP(i)}).catch(function(i){e.wasInvalidated()||t.rP(i)})},e.prototype.oP=function(e){var t,i,r,a;return!(null==(t=this.context.settings)?void 0:t.POSTPONE_MANIFEST_UPDATES_UNTIL_PLAYBACK_START)||e||!0!==(null==(a=null==(r=null==(i=this.context)?void 0:i.serviceManager)?void 0:r.get(n.ServiceName.PlayerStateService))?void 0:a.isPlay())||this.qP()?Promise.resolve():(this.context.logger.debug("Delaying manifest update until playback has started"),this.kP=this.kP||new o.Deferred,this.kP.promise)},e.prototype.pP=function(){return this.context.serviceManager.get(n.ServiceName.SourceStoreService,this.context.sourceContext.sourceIdentifier)},e.prototype.qP=function(){var e,t,i;return null==(i=null==(t=null==(e=this.pP())?void 0:e.getState())?void 0:t.hls)?void 0:i.isLowLatencyPlaylist},e.prototype.sP=function(e){this.hP.reject(e),this.updateCallbacks.error(e)},e.prototype.success=function(e){this.hP.resolve(e),this.updateCallbacks.success(e)},e.prototype.dispose=function(){this.context.eventHandler.off(r.PlayerEvent.Playing,this.lP,!0)},Object.defineProperty(e.prototype,"isStopped",{get:function(){return this.jP},enumerable:!1,configurable:!0}),e.prototype.getPayload=function(){return this.hP.promise},e}();function c(e,t){if(isNaN(t))return 0;var i=(0,a.toSeconds)(Date.now()-e);return i>=t?0:(0,a.toMilliSeconds)(t-i)}t.AbstractUpdater=u},87222:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.findAdaptationSetOfMimeType=function(e,t,i){void 0===i&&(i={});var n,r=i.sourceState,o=i.langObj,c=i.periodSwitched,l=s(e,r),h=d(t,e);return l&&(n=u(h,l,o,c)),!n&&r&&(n=u(h,a(e,r),o,c)),n||h[0]},t.getHlsDefaultLanguage=a,t.getPreferredLanguage=s,t.findAdaptationSetsForMimeType=d;var n=i(85434),r=i(88052),o=i(62756);function a(e,t){var i;if(r.ModuleManager.has(o.ModuleName.HLS)){var a=r.ModuleManager.get(o.ModuleName.HLS).selectors,s=a.getHlsState,u=a.getDefaultLanguages,c=s(t),d=c?u(c):void 0;if(d){var l=null==(i=n.MimeTypeHelper.getMediaType(e))?void 0:i.toUpperCase();return l?d[l]:void 0}}}function s(e,t){var i=t&&a(e,t),n={language:navigator.language||navigator.userLanguage||(null==i?void 0:i.language)};return n.language&&i&&c(n.language,i.language)&&(n.name=i.name),n}function u(e,t,i,n){if(void 0===n&&(n=!1),0!==e.length){var r,o,a,s=void 0;if(i&&(r=n,o=e.find(function(e){return e._lang&&i.lang&&e._lang===i.lang}),a=(a=e.find(function(e){return i.adaptationSetId&&e._internalId.equals(i.adaptationSetId)}))||e.find(function(e){return i.id===e._internalId.adaptationSetId}),s=r?o||a:a||o),s)return s;if(t&&t.language){var u=e.filter(function(e){return!(!e._lang||null==e._lang)&&c(e._lang,t.language)});return u.find(function(e){return e.Representation.find(function(e){return e._name===t.name})})||u[0]}}}function c(e,t){return!!((null==e?void 0:e.includes(t))||(null==t?void 0:t.includes(e)))}function d(e,t){return e.AdaptationSet.filter(function(e){return e._mimeType===t||e.Representation.find(function(e){return e._mimeType===t})})}},47151:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.AdaptationSetId=void 0,t.createAdaptationSetIdFromMimeTypeAndIndex=function(e,t,i){return new o(e,"".concat(t,"-").concat(i))};var o=function(e){function t(t,i){var n=e.call(this,t)||this;return n.Ob=i,n}return r(t,e),Object.defineProperty(t.prototype,"adaptationSetId",{get:function(){return this.Ob}
1,enumerable:!1,configurable:!0}),t.prototype.equals=function(t){return e.prototype.equals.call(this,t)&&this.adaptationSetId===(null==t?void 0:t.adaptationSetId)},t.prototype.key=function(){return e.prototype.key.call(this)+"-"+this.adaptationSetId},t}(i(16197).PeriodId);t.AdaptationSetId=o},92778:function(e,t){var i,n;Object.defineProperty(t,"__esModule",{value:!0}),t.DashSchemeUri=void 0,(n=i||(t.DashSchemeUri=i={})).AudioChannelConfig="urn:mpeg:dash:23003:3:audio_channel_configuration:2011",n.TransferCharacteristics="urn:mpeg:mpegB:cicp:TransferCharacteristics"},23940:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MPDExtractor=void 0,t.stripUnderscorePrefix=m,t.applyProperties=v,t.toVideoColorInfo=y,t.representationToQuality=S,t.representationToAudioQuality=T,t.representationToVideoQuality=b,t.isVideoRepresentation=M,t.isAudioRepresentation=I,t.getMinimumUpdatePeriodInSeconds=function(e){return null==(null==e?void 0:e._minimumUpdatePeriod)?1/0:s.DurationConverter.getDurationInSec(e._minimumUpdatePeriod)},t.getContentTypeFromMimeTypeAndCodecs=C;var n=i(80813),r=i(44468),o=i(77179),a=i(34047),s=i(52424),u=i(85434),c=i(89927),d=i(70850),l=i(88052),h=i(62756),p=i(59707),f=i(62198),g=i(92778);function m(e){return 0===e.indexOf("_")?e.substring(1):e}function v(e,t,i){return void 0===i&&(i=[]),Object.keys(e).filter(function(e){return 0===i.length||i.indexOf(e)>-1}).forEach(function(i){t[m(i)]=e[i]}),t}function y(e){var t;return{dynamicRange:null!=(t=e._dynamicRange)?t:r.VideoDynamicRange.Unknown}}function S(e,t,i){if(!e)return null;if(I(0,t))return T(e,i);if(M(0,t))return b(e,i);var n={id:e._id,bitrate:e._bandwidth||0};return n.label=e._label||P(n.bitrate),n}function T(e,t){var i,n,r={id:e._id,bitrate:e._bandwidth||0},o=a.CodecStringHelper.getExtractedCodecStrings(e._codecs||t);o.audio&&(r.codec=o.audio);var s=null==(n=null==(i=e.AudioChannelConfiguration)?void 0:i.find(function(e){var t=e._schemeIdUri,i=e._value;return t===g.DashSchemeUri.AudioChannelConfig&&void 0!==i}))?void 0:n._value;return s&&(r.channels=parseInt(s)),r.label=e._label||P(r.bitrate),r}function b(e,t){var i={id:e._id,bitrate:e._bandwidth||0,width:e._width||0,height:e._height||0},n=a.CodecStringHelper.getExtractedCodecStrings(e._codecs||t);n.video&&(i.codec=n.video),i.colorInfo=y(e),e.hasOwnProperty("_frameRate")&&(i.frameRate=e._frameRate);var r=P(i.bitrate);return i.width&&i.height&&(r="".concat(i.width,"x").concat(i.height,", ").concat(r)),i.label=e._label||r,i}function M(e,t){return u.MimeTypeHelper.isVideo(t)}function I(e,t){return u.MimeTypeHelper.isAudio(t)}function P(e){return"".concat(Math.round(e/1e3),"kbps")}function C(e,t){return"".concat(e,'; codecs="').concat(t,'"')}function E(e,t){for(var i=function(t){-1===e.findIndex(function(e){return e.contentType===t.contentType})&&e.push(t)},n=0;n<t.length;n++)i(t[n])}t.MPDExtractor=function(){function e(e,t){var i=this;this.isLive=function(){var e;return"dynamic"===(null==(e=i.XB())?void 0:e._type)},this.RB=e,this.SB=t,this.TB=e.settings,this.VB=!1,this.UB=e.serviceManager.get(n.ServiceName.SynchronizedTimeService,this.SB.sourceIdentifier),this.WB=e.serviceManager.get(n.ServiceName.SourceStoreService,this.SB.sourceIdentifier)}return e.prototype.XB=function(){var e;return(0,f.getManifest)(null==(e=this.WB)?void 0:e.getState())},e.prototype.YB=function(){var e,t;return null!=(t=null==(e=this.XB())?void 0:e.Period)?t:[]},e.prototype.ZB=function(e){var t=this.YB().find(function(t){return t._id===e});return t?t.AdaptationSet:[]},e.prototype.adjustPeriodStartTimes=function(){var e,t,i,n=null==(e=this.WB)?void 0:e.getState();if(n&&!this.VB&&!(null==(t=this.XB())?void 0:t._isHls)){var r=this.isLive()?(0,c.toSeconds)(this.getAvailabilityStartTime()):(0,o.getStartTimeOffset)(n);null==(i=this.WB)||i.dispatch((0,p.adjustPeriodStartTimes)(r)),this.VB=!0}},e.prototype.getAvailabilityStartTime=function(){var e;return this.isLive()&&(null==(e=this.XB())?void 0:e._availabilityStartTime)?d.Util.getUtcDate(this.XB()._availabilityStartTime).getTime()-this.aB():0},e.prototype.getAvailabilityEndTime=function(){var e;return(null==(e=this.XB())?void 0:e.hasOwnProperty("_availabilityEndTime"))?new Date(d.Util.getUtcDate(this.XB()._availabilityEndTime).getTime()-this.aB()):null},e.prototype.aB=function(){return this.UB?this.UB.getTimeDifference():0},e.prototype.getType=function(){var e;return null==(e=this.XB())?void 0:e._type},e.prototype.getDuration=function(){var e;return null==(e=this.XB())?void 0:e._mediaPresentationDuration},e.prototype.getRequestTimestamp=function(){var e;return null==(e=this.XB())?void 0:e._requestTimestamp},e.isValueWithinBounds=function(e,t,i){return!e||e>=t&&e<=i},e.prototype.bB=function(t){var i=e.isValueWithinBounds(t.width,this.RB.config.adaptation.resolution.minSelectableVideoWidth,this.RB.config.adaptation.resolution.maxSelectableVideoWidth),n=e.isValueWithinBounds(t.height,this.RB.config.adaptation.resolution.minSelectableVideoHeight,this.RB.config.adaptation.resolution.maxSelectableVideoHeight),r=e.isValueWithinBounds(t.bitrate,this.TB.MIN_SELECTABLE_VIDEO_BITRATE,this.TB.MAX_SELECTABLE_VIDEO_BITRATE);return i&&n&&r},e.prototype.cB=function(t){return e.isValueWithinBounds(t.bitrate,this.TB.MIN_SELECTABLE_AUDIO_BITRATE,this.TB.MAX_SELECTABLE_AUDIO_BITRATE)},e.prototype.dB=function(e,t){var i=this;if(!e)return[];var n=t.filter(function(t){return u.MimeTypeHelper.isVideo(e)&&i.bB(t)||u.MimeTypeHelper.isAudio(e)&&i.cB(t)});return n.length<1&&t.length>0?t:n},e.prototype.eB=function(e){if(!e)return[];var t=e.Representation.map(function(t){return S(t,e._mimeType,e._codecs)});return this.TB.EXCLUDE_DISALLOWED_REPRESENTATIONS&&(t=this.dB(e._mimeType,t)),t},e.prototype.getAudioQualities=function(e){var t=this,i=this.gB(e);return i?this.ZB(i).reduce(function(e,i){return i._mimeType&&u.MimeTypeHelper.isAudio(i._mimeType)&&(e[i._internalId.adaptationSetId]=t.eB(i)),e},{}):{}},e.prototype.getVideoQualities=function(e){var t=this.gB(e);if(!t)return[];var i=this.ZB(t).find(function(e){return e._mimeType&&u.MimeTypeHelper.isVideo(e._mimeType)});return i?this.eB(i):[]},e.prototype.getLangObjectFromAdaptationSet=function(e,t,i){var n={id:null,lang:null,adaptationSetId:null,kind:null,label:"off",url:null},r=e._mimeType&&e._mimeType.indexOf(t)>-1,o=i&&e._mimeType.indexOf(i)>-1;return u.MimeTypeHelper.isSubtitle(t)&&(n.kind="subtitle"),e.Role&&e.Role.length>0&&(n.role=e.Role.map(function(e){return v(e,{})})),(r||o)&&(v(e,n,["_lang","_isFragmented"]),n.lang=n.lang||"und",n.label=e._label||n.lang,n.adaptationSetId=e._internalId,n.id=e._internalId.adaptationSetId,n.metadata=this.fB(e)),n},e.prototype.fB=function(e){var t;if(null==(t=e.SupplementalProperty)?void 0:t.length)return e.SupplementalProperty.map(function(e){return{schemeIdUri:e._schemeIdUri,value:e._value,id:e._id}})},e.prototype.toSubtitleTrack=function(e,t,i){var n,r,o,a,s=this.getLangObjectFromAdaptationSet(e,t,i),u={
1id:s.id,lang:s.lang,kind:s.kind,isFragmented:null!=(a=s.isFragmented)&&a,isSideloaded:!1,enabled:!1,label:s.label};return null!=s.role&&(u.role=s.role),null!=s.metadata&&(u.metadata=s.metadata),n=e.Representation[0],u.forced=!!(null==(r=u.role)?void 0:r.some(function(e){return e.value&&["forced_subtitle","forced-subtitle"].includes(e.value)}))||!!(null==(o=null==n?void 0:n._hls)?void 0:o.isForced),u},e.prototype.getAvailableSubtitles=function(e){var t=this,i=0;return(e=this.gB(e))?this.ZB(e).filter(function(e){return u.MimeTypeHelper.isSubtitle(e._mimeType)}).map(function(e){var n=t.toSubtitleTrack(e,"application","text");return n.id||(i++,n.id="sub_".concat(i)),n}):[]},e.prototype.getClosedCaptionLabels=function(e){return(e=this.gB(e))?this.ZB(e).filter(function(e){return e.ClosedCaptionLabels}).flatMap(function(e){return Object.keys(e.ClosedCaptionLabels).map(function(t){var i=e.ClosedCaptionLabels[t];return{id:t,kind:"captions",lang:i.lang||"unknown",label:i.label||"Captions (".concat(t,")")}})}):[]},e.prototype.getAvailableAudio=function(e,t){var i=this;void 0===t&&(t=!0);var n=this.gB(e);if(!n)return[];var o=this.ZB(n),a=0,s=o.filter(function(e){return u.MimeTypeHelper.isAudio(e._mimeType)}).map(function(e){var t=i.getLangObjectFromAdaptationSet(e,r.MediaType.Audio);return t&&"off"!==t.label?(t.id||(t.id="audio_"+a,a++),t):null});if(t){var c=o.find(function(e){return u.MimeTypeHelper.isVideo(e._mimeType)});if(c&&c.ContentComponent){var d=c.ContentComponent.filter(function(e){return e._contentType===r.MediaType.Audio}).map(function(e){return{id:e._id,lang:e._lang,label:e._id,adaptationSetId:c._internalId}});s=s.concat(d)}}return s.filter(function(e){return e})},e.prototype.getAvailableVideo=function(e){var t=this.gB(e);if(!t)return[];var i=this.ZB(t).find(function(e){return u.MimeTypeHelper.isVideo(e._mimeType)});return i?[this.getLangObjectFromAdaptationSet(i,r.MediaType.Video)]:[]},e.getContentProtectionForManifestElement=function(e){var t;return(null==(t=null==e?void 0:e.ContentProtection)?void 0:t.length)&&l.ModuleManager.has(h.ModuleName.DRM)?l.ModuleManager.get(h.ModuleName.DRM).ContentProtectionHelper.parseContentProtectionDescriptors(e.ContentProtection):[]},e.getContentProtectionForAdaptationSet=function(t){for(var i=[],n=0;n<t.Representation.length;n++)i=i.concat(e.getContentProtectionForManifestElement(t.Representation[n]));return i.concat(e.getContentProtectionForManifestElement(t))},e.prototype.getTimeShiftBufferDepthSeconds=function(){if(this.isLive()){var e=this.XB()._timeShiftBufferDepth,t=(0,c.toSeconds)(Date.now()-this.getAvailabilityStartTime());return e===-1/0?-t:Math.max(e,-t)}return 0},e.getCurrentAndSuccessorPeriod=function(e,t){for(var i=null,n=0,r=null;n<e.length;n++)if(e[n]._id===t){i=e[n],r=e[n+1]||null;break}return[i,r]},e.prototype.getPeriodDuration=function(t,i){i=null!=i?i:this.YB();var n,r=e.getCurrentAndSuccessorPeriod(i,t),o=r[0],a=r[1];if(o&&o._duration)return s.DurationConverter.getDurationInSec(o._duration);if(o&&o.start&&a&&a.start)return a.start-o.start;if(null==(n=this.XB())?void 0:n._mediaPresentationDuration){var u=s.DurationConverter.getDurationInSec(this.XB()._mediaPresentationDuration);if(!isNaN(u))return u}return 1/0},e.prototype.getDRMCapabilitiesForPeriod=function(e){if(!(e=this.gB(e)))return[[],[]];var t=this.YB().find(function(t){return t._id===e});return this.getDRMCapabilitiesFromPeriod(t)},e.prototype.getDRMCapabilitiesFromPeriod=function(t){for(var i=[],n=[],r=0,o=t.AdaptationSet;r<o.length;r++){var a=o[r],s=a._mimeType,c=e.getMimeTypeCodecStringForAdaptationSet(a);u.MimeTypeHelper.isVideo(s)?E(n,c):u.MimeTypeHelper.isAudio(s)&&E(i,c)}return[i,n]},e.prototype.dispose=function(){this.TB=null},e.getMimeTypeCodecStringForAdaptationSet=function(t){for(var i=[],n=0,r=t.Representation;n<r.length;n++){var o=r[n],a=e.getAttributeFromRepresentationOrAdaptationSet("_codecs",o,t),s=t._mimeType;if(t._mimeType&&a){var u=C(s,a);i.push({contentType:u})}}return i},e.getAttributeFromRepresentationOrAdaptationSet=function(e,t,i){return t.hasOwnProperty(e)&&t[e]?t[e]:i.hasOwnProperty(e)&&i[e]?i[e]:null},e.prototype.gB=function(e){var t=this.YB();if(0===t.length)return this.RB.logger.warn("No periods available in the manifest"),null;if(t.find(function(t){return t._id===e}))return e;var i=t[t.length-1]._id;return this.RB.logger.debug("Period "+e+" not available - return last period ("+i+")"),i},e.prototype.getEventStreamEvents=function(e){var t=this;return e&&e.EventStream?e.EventStream.filter(function(e){return e.Event}).flatMap(function(i){var n,r=Number(null!=(n=i._timescale)?n:1);return t.hB(e.start,i,r)}):[]},e.prototype.hB=function(e,t,i){var n=this;return t.Event.map(function(r){var o={};if(o.startTime=(r._presentationTime||0)/i+e,r._duration){var a=r._duration/i;o.endTime=o.startTime+a}else o.endTime=o.startTime;return o.data=n.iB(r,t._schemeIdUri),o})},e.prototype.iB=function(e,t){var i=/<event[^>]*>(.*)(<\/event>|\/>)/g.exec(e.rawXmlRepresentation),n=void 0;i&&i.length>1&&(n=i[1]);var r={};return Object.getOwnPropertyNames(e).filter(function(e){return!["_presentationTime","_duration","__text"].some(function(t){return t===e})&&0===e.lastIndexOf("_",0)}
1).forEach(function(t){r[t.substring(1,t.length)]=e[t]}),{properties:r,content:n,schemeIdUri:t}},e}()},67580:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.ManifestCachingService=void 0;var n=i(58313);t.ManifestCachingService=function(){function e(){this.Pb={}}return e.prototype.set=function(e,t,i){var r,o,a=n.URLHelper.toFullUrl(e);r=a,(o=this.Pb)[r]||(o[r]={}),this.Pb[a][t]=i},e.prototype.Qb=function(e,t){var i,r,o=n.URLHelper.toFullUrl(e);i=o,(r=this.Pb)[i]||(r[i]={}),this.Pb[o].expire=t},e.prototype.get=function(e,t){var i=n.URLHelper.toFullUrl(t),r=this.Pb[i];if(r&&r.expire>=Date.now())return r[e];delete this.Pb[i]},e.prototype.cacheHttpResponse=function(e,t,i){void 0===i&&(i=1/0),this.set(t,"httpResponse",e),this.Qb(t,i)},e.prototype.cacheParsedManifest=function(e,t,i){void 0===i&&(i=1/0),this.set(t,"parsedManifest",e),this.Qb(t,i)},e.prototype.cacheSegmentList=function(e,t,i){void 0===i&&(i=1/0),this.set(t,"segmentList",e),this.Qb(t,i)},e.prototype.getHttpResponse=function(e){return this.get("httpResponse",e)},e.prototype.getParsedManifest=function(e){return this.get("parsedManifest",e)},e.prototype.getSegmentList=function(e){return this.get("segmentList",e)},e.prototype.clear=function(){this.Pb={}},e.prototype.dispose=function(){this.Pb={}},e}()},23901:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.createManifestLoadingService=c,t.initializeManifestLoadingService=function(e,t,i){var n=e.serviceManager,r=t.sourceIdentifier;if(!n.has(o.ServiceName.ManifestLoadingService,r)){var a=c(i,e,t);n.set(o.ServiceName.ManifestLoadingService,a,r)}};var n=i(40306),r=i(3336),o=i(80813),a=i(44468),s=i(88052),u=i(62756);function c(e,t,i){switch(e.type){case a.StreamType.Dash:return new(0,s.ModuleManager.get(u.ModuleName.DASH).MPDLoader)(t,i);case a.StreamType.Hls:return new(0,s.ModuleManager.get(u.ModuleName.HLS).M3u8Loader)(t,i);case a.StreamType.Smooth:return new(0,s.ModuleManager.get(u.ModuleName.Smooth).SmoothStreamingLoader)(t,i);default:throw new r.PlayerError(n.ErrorCode.SOURCE_INVALID,{given:e.type,supported:"dash, hls, smooth"},"The provided stream type is not supported by the player.",i.sourceIdentifier)}}},13422:function(e,t,i){var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.orderAdaptationSetsByCodec=function(e,t){return(e=n({},e)).Period=e.Period.map(function(e){if(!e.AdaptationSet)return n({},e);var i=e.AdaptationSet.reduce(function(e,t){var i=t._mimeType;return r.MimeTypeHelper.isVideo(i)?e.videoSets.push(t):r.MimeTypeHelper.isAudio(i)?e.audioSets.push(t):e.otherSets.push(t),e},{videoSets:[],audioSets:[],otherSets:[]}),o=i.videoSets,s=i.audioSets,u=i.otherSets,c=a(o,t.video),d={};return s.forEach(function(e){var t=e._lang||"none";d[t]=d[t]||[],d[t].push(e)}),Object.keys(d).forEach(function(e){c=c.concat(a(d[e],t.audio))}),n(n({},e),{AdaptationSet:c.concat(u)})}),e},t.sortAdaptationSetsByBestCodec=a,t.getCodecsFromAdaptationSet=s,t.removeRepresentations=function(e,t){if(!(e.Period&&e.Period.length>0)||0===t.length)return e;var i=e.Period.map(function(e){var i;return i=e.AdaptationSet.map(function(e){var i,r;return i=e._internalId,r=e.Representation.filter(function(e){return!t.some(function(t){return t.equals(new o.RepresentationId(i,e._id))})}),n(n({},e),{Representation:r})}).filter(function(e){return e.Representation.length>0}),n(n({},e),{AdaptationSet:i})}).filter(function(e){return e.AdaptationSet.length>0});return n(n({},e),{Period:i})};var r=i(85434),o=i(79505);function a(e,t){var i=function(e){for(var i=0;i<t.length;i++)if(0===e.indexOf(t[i]))return i;return t.length+1};return e.sort(function(e,t){return i(s(e))-i(s(t))})}function s(e){var t;if((null==(t=null==e?void 0:e._codecs)?void 0:t.length)>0)return e._codecs;if(e.Representation&&e.Representation.length>0){var i=e.Representation[e.Representation.length-1];if(i._codecs)return i._codecs}return""}},96533:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.
1setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},a=this&&this.__spreadArray||function(e,t,i){if(i||2==arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.ManifestService=void 0,t.initializeInternalIds=H,t.addDrmKidsToRepresentations=U,t.iterateAdaptationSets=G,t.getNearestPeriodForTime=Z,t.findLowestPossibleBandwidthFromRepresentations=function(e,t){return void 0===t&&(t=-1/0),e.reduce(function(e,i){return i._bandwidth>=t?Math.min(e,i._bandwidth):e},1/0)},t.getMatchingRepresentationsByBandwidth=j,t.getMatchingRepresentationByBandwidth=V,t.getCodecPriorities=K,t.getCodecOfAdaptationSetMimeType=Y,t.getManifestService=function(e,t){var i,n=null!=t?t:null==(i=e.sourceContext)?void 0:i.sourceIdentifier;if(n)return e.serviceManager.get(c.ServiceName.ManifestService,n)},t.initializeManifestService=function(e,t){var i,n=e.serviceManager,r=t.sourceIdentifier;if(n.has(c.ServiceName.ManifestService,r))null==(i=n.get(c.ServiceName.ManifestService,r))||i.restore();else{var o=new F(e,t);n.set(c.ServiceName.ManifestService,o,r)}};var s=i(40306),u=i(3336),c=i(80813),d=i(56481),l=i(3714),h=i(90408),p=i(25811),f=i(48488),g=i(30012),m=i(20649),v=i(88847),y=i(94685),S=i(74853),T=i(34047),b=i(52424),M=i(85434),I=i(15014),P=i(89927),C=i(23068),E=i(88052),A=i(62756),R=i(59707),_=i(62198),B=i(90919),D=i(87222),O=i(47151),L=i(13422),k=i(23940),x=i(16197),N=i(79505),w="Outdated",F=function(e){function t(t,i){var n=e.call(this,{onRestore:function(){return n.HA()}})||this;n.context=t,n.zA=0,n.GA=function(e){var t=n.getAdaptationSet(e._internalId);if(t){var i=t._mimeType,r=t._codecs;(0,k.isAudioRepresentation)(e,i)?n.context.eventHandler.dispatchEvent(l.PlayerEvent.AudioQualityRemoved,{quality:(0,k.representationToAudioQuality)(e,r)}):(0,k.isVideoRepresentation)(e,i)&&n.context.eventHandler.dispatchEvent(l.PlayerEvent.VideoQualityRemoved,{quality:(0,k.representationToVideoQuality)(e,r)})}},n.MA=function(e){(e.Representation||[]).forEach(function(t){e._codecs&&!t._codecs&&(t._codecs=e._codecs),e._width&&!t._width&&(t._width=e._width),e._height&&!t._height&&(t._height=e._height)}),delete e.SegmentTemplate},n.rA=i,n.qA=t.settings,n.vA=[];var r=n.rA.sourceIdentifier;return n.wA=t.serviceManager.get(c.ServiceName.SynchronizedTimeService,r),n.sA=t.serviceManager.get(c.ServiceName.SourceStoreService,r),n}return r(t,e),Object.defineProperty(t.prototype,"AA",{get:function(){return this.uA||(this.uA=new k.MPDExtractor(this.context,this.rA)),this.uA},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BA",{get:function(){var e;return(0,_.getManifest)(null==(e=this.sA)?void 0:e.getState())},enumerable:!1,configurable:!0}),t.prototype.CA=function(e){this.sA.dispatch((0,R.setManifestAction)(this.preProcessManifest(e)))},t.prototype.updateManifest=function(e){var t=this;this.zA++;var i=this.zA;return this.ZA(e).then(function(){return t.DA(i),t.EA(e)}).then(function(){t.DA(i),t.FA(e)}).catch(function(e){if(e!==w)throw e;t.context.logger.debug("Skipping manifest update, since a newer manifest is available")})},t.prototype.DA=function(e){if(e!==this.zA)throw w},t.prototype.EA=function(e){var t,i,n=this,r=null==(t=this.context.serviceManager)?void 0:t.get(c.ServiceName.DrmService),o=null==(i=this.context.serviceManager)?void 0:i.get(c.ServiceName.DrmDetectorService);return r&&o&&(null==e?void 0:e.Period)?r.getUsedOrEarlyResolvedKeySystemUid().then(function(t){if(t){var i,r,a,s=(i=n.AA,r=[],a=[],e.Period.forEac
1h(function(e){var t=i.getDRMCapabilitiesFromPeriod(e);r=r.concat(t[0]),a=a.concat(t[1])}),{audioCapabilities:r,videoCapabilities:a}),u=s.audioCapabilities,c=s.videoCapabilities;return o.getSupportedCapabilities(t,u,c).then(function(t){var i;return i=n.context.logger,void e.Period.forEach(function(e){e.AdaptationSet=e.AdaptationSet.filter(function(n){return n.Representation=n.Representation.filter(function(r){var o,a,s=e.ContentProtection||n.ContentProtection,u=(null==s?void 0:s.length)>0,c=(0,k.getContentTypeFromMimeTypeAndCodecs)(r._mimeType,r._codecs),d=(o=t.audioCapabilities,a=t.videoCapabilities,M.MimeTypeHelper.isAudio(c)?!!o.find(function(e){return e.contentType===c}):!M.MimeTypeHelper.isVideo(c)||!!a.find(function(e){return e.contentType===c}));return u&&!d&&i.debug("Representation not supported by MediaKeySystem (".concat(c,")")),!u||d}),!M.MimeTypeHelper.isAV(n._mimeType)||n.Representation.length>0})})})}}):Promise.resolve()},t.prototype.FA=function(e){if((0,y.isContextAvailable)(this.context)&&this.context.serviceManager){if(this.XA(),e.isInitialized=!1,this.CA(e),this.isLive()){var t=this.getFirstPeriod(),i=this.isHlsManifest()&&t?t.start:(0,P.toSeconds)(this.getAvailabilityStartTime());this.sA.dispatch((0,g.setStartTimeOffset)(i))}this.AA.adjustPeriodStartTimes();var n=this.UA();(0,h.maybeFireDurationChangedEvent)(this.tA,n,this.context.eventHandler),this.tA=n,this.QA(!0),this.context.serviceManager.maybeCall(c.ServiceName.HeartbeatService,function(e){return e.beat()},void 0,this.rA.sourceIdentifier)}},t.prototype.excludeRepresentations=function(e){var t=this,i=e.map(function(e){return t.getRepresentationById(e)}).filter(function(e){return!!e});this.QA(!1);
vendor: 4,389 bytes, line 1
1var n=W(this.getAllPeriods());this.vA=S.ArrayHelper.union(this.vA,e),this.sA.dispatch((0,R.removeRepresentationsAction)(this.vA));var r=W(this.getAllPeriods());return Object.keys(n).every(function(e){return null!=r[e]&&n[e].length===r[e].length})?(this.XA(),i.forEach(this.GA),this.QA(!0),!0):(this.context.eventHandler.fireError(new u.PlayerError(s.ErrorCode.SOURCE_ERROR,void 0,"No playable track left",this.rA.sourceIdentifier)),!1)},t.prototype.isRepresentationExcluded=function(e){return this.vA.some(function(t){return t.equals(e)})},t.prototype.resetExcludedRepresentations=function(){this.vA=[]},t.prototype.HA=function(){this.RA(this.getManifest()),this.sA.dispatch((0,R.setManifestAction)(H(this.getManifest())))},t.getAdaptationSetSwitchingSupplementalProperties=function(e){return!e.SupplementalProperty||e.SupplementalProperty.length<=0?null:e.SupplementalProperty.filter(function(e){return"urn:mpeg:dash:adaptation-set-switching:2016"===e._schemeIdUri})},t.prototype.IA=function(e,t,i){var n=i&&i.length>0;if(!n&&!this.qA.ADAPTATION_SET_SWITCHING_WITHOUT_SUPPLEMENTAL_PROPERTY)return null;var r=[],o=e._group,a=Y(e);return n&&i.forEach(function(e){e._value&&r.push.apply(r,e._value.split(","))}),this.qA.ADAPTATION_SET_SWITCHING_WITHOUT_SUPPLEMENTAL_PROPERTY&&t.forEach(function(e){r.includes(e._id)||r.push(e._id)}),t.filter(function(t){if(!r.includes(t._id)||t._id===e._id)return!1;var i=t._group===o,n=t._mimeType===e._mimeType,s=Y(t)===a,u=t._lang===e._lang;return n&&s&&i&&u})},t.prototype.JA=function(e){var i=this;return e.AdaptationSet?e.AdaptationSet.reduce(function(n,r){var o=t.getAdaptationSetSwitchingSupplementalProperties(r),s=i.IA(r,e.AdaptationSet,o);return s&&0!==s.length?S.ArrayHelper.addAndMergeIntersects(n,a([r],s,!0)):n},[]):[]},t.mergeAdaptationSetProperties=function(e,t,i){var n=e.hasOwnProperty(i),r=t.hasOwnProperty(i);(n||r)&&(n?r||(t[i]=[]):e[i]=[],e[i]=e[i].concat(t[i]))},t.prototype.KA=function(e,t){return e.filter(function(e){return e.hasOwnProperty(t)}).map(function(e){return e[t]})},t.prototype.LA=function(e,t){var i=[e].concat(t),n=this.KA(i,"_minWidth"),r=this.KA(i,"_maxWidth"),o=this.KA(i,"_minHeight"),a=this.KA(i,"_maxHeight"),s=this.KA(i,"_minBandwidth"),u=this.KA(i,"_maxBandwidth");n.length>0&&(e._minWidth=Math.min.apply(null,n)),r.length>0&&(e._maxWidth=Math.max.apply(null,r)),o.length>0&&(e._minHeight=Math.min.apply(null,o)),a.length>0&&(e._maxHeight=Math.max.apply(null,a)),s.length>0&&(e._minBandwidth=Math.min.apply(null,s)),u.length>0&&(e._maxBandwidth=Math.max.apply(null,u))},t.prototype.NA=function(e,i){i.forEach(this.MA);var n=i.shift();i.forEach(function(e){["Representation","ContentComponent","ContentProtection","SupplementalProperty"].forEach(function(i){return t.mergeAdaptationSetProperties(n,e,i)})}),this.LA(n,i),e.AdaptationSet=e.AdaptationSet.filter(function(e){return!i.includes(e)})},t.prototype.OA=function(e){var t;null==(t=null==e?void 0:e.AdaptationSet)||t.forEach(function(e){var t;null==(t=null==e?void 0:e.Representation)||t.sort(function(e,t){return e._bandwidth-t._bandwidth})})},t.prototype.PA=function(e){var t=this;return e.Period.forEach(function(e){t.JA(e).forEach(function(i){t.NA(e,i)}),t.OA(e)}),e},t.prototype.setRepresentationDrmKid=function(e,t){this.sA.dispatch((0,R.setRepresentationDrmKidAction)(e,t))},t.prototype.getRepresentationDrmKid=function(e){var t;return null==(t=this.getRepresentationById(e))?void 0:t.associatedKid},t.prototype.QA=function(e){this.sA.dispatch((0,R.setManifestInitializedAction)(e))},t.prototype.RA=function(e){var t=this.rA.source.drm,i=null==e.Period?[]:e.Period.filter(function(e){return e.AdaptationSet&&e.AdaptationSet.length>0}).reduce(function(e,t){return e.concat(t.AdaptationSet)},[]).filter(function(e){return e.ContentProtection&&e.ContentProtection.length>0}).flatMap(function(e){return e.ContentProtection}).filter(function(e){return null!=e.laurl&&e.laurl.length>0}).flatMap(function(e){return e.laurl.map(function(t){return o(o({},t),{drmType:p.DRMSchemeIDURIs[e._schemeIdUri]})})}).filter(function(e){return null!=e.drmType}).map(function(e){var t;return(t={})[e.drmType]={LA_URL:e._licenseUrl},t}),n={};i.length>0&&(n=o({},i[0])),null!=t&&Object.keys(t).length>0&&Object.keys(t).forEach(function(e){n[e]=null!=n[e]?o(o({},n[e]),t[e]):t[e]}),this.SA(n);var r=Object.keys(n).length>0?(0,f.setManifestDrm)(n):(0,f.resetManifestDrm)();
1this.sA.dispatch(r)},t.prototype.SA=function(e){if(E.ModuleManager.has(A.ModuleName.DRM)&&Object.keys(e).length>0&&!this.context.serviceManager.has(c.ServiceName.DrmService)){var t=E.ModuleManager.get(A.ModuleName.DRM).DrmService;this.context.serviceManager.set(c.ServiceName.DrmService,new t(this.context))}this.context.serviceManager.maybeCall(c.ServiceName.DrmService,function(t){t.isDrmConfigSet()||t.setDrmConfig(e)})},t.prototype.TA=function(){var e=new Map;return this.getAllRepresentations().filter(function(e){return e._internalId&&e.associatedKid}).forEach(function(t){return e.set(t._internalId.key(),t.associatedKid)}),e},t.prototype.preProcessManifest=function(e){var t,i=this.TA();return e.Period&&e.Period.length>0?(U(e=(0,L.orderAdaptationSetsByCodec)(e,K(this.context.config,this.rA.source))),e=this.PA(e),E.ModuleManager.has(A.ModuleName.Envivio)&&(e=E.ModuleManager.get(A.ModuleName.Envivio).fixSegmentTimelineLiveStream(e)),this.isSuspended()||this.RA(e),e=H(e),t=e=(0,L.removeRepresentations)(e,this.vA),t.Period.flatMap(function(e){var t;return null!=(t=null==e?void 0:e.AdaptationSet)?t:[]}).flatMap(function(e){var t;return null!=(t=null==e?void 0:e.Representation)?t:[]}).forEach(function(e){i.has(e._internalId.key())&&(e.associatedKid=i.get(e._internalId.key()))}),e):(this.context.eventHandler.fireError(new u.PlayerError(s.ErrorCode.SOURCE_ERROR,void 0,"No playable track left",this.rA.sourceIdentifier)),null)},t.prototype.UA=function(){if(this.AA){var e=NaN,t=this.AA.getDuration();return t&&(this.xA&&this.xA===t?e=this.yA:(e=b.DurationConverter.getDurationInSec(t),this.xA=t,this.yA=e)),isNaN(e)&&this.isLive()?1/0:e}return 0},t.prototype.getDuration=function(){return this.tA},t.prototype.isLive=function(){return!!this.BA&&this.AA.isLive()},t.prototype.getAvailabilityStartTime=function(){return this.AA.getAvailabilityStartTime()},t.prototype.getAvailabilityEndTime=function(){return this.AA.getAvailabilityEndTime()},t.prototype.isAvailabilityEndTimeExceeded=function(){var e=this.getAvailabilityEndTime();return e&&Date.now()>e.getTime()},t.prototype.findPeriod=function(e){return(0,I.findPeriod)(this.BA,e)},t.prototype.getAllPeriods=function(){var e,t;return null!=(t=null==(e=this.BA)?void 0:e.Period)?t:[]},t.prototype.getPeriod=function(e){return e?this.findPeriod(e.periodId):null},t.prototype.isLanguageAvailable=function(e,t,i){var n=(0,I.findPeriod)(this.BA,e)||this.getFirstPeriod();return(0,D.findAdaptationSetsForMimeType)(n,t).some(function(e){var t=e._lang&&i.lang&&e._lang===i.lang,n=i.adaptationSetId&&e._internalId.equals(i.adaptationSetId);return t||n})},t.prototype.findAdaptationSet=function(e,t,i,n){void 0===n&&(n=!1);var r=(0,I.findPeriod)(this.BA,e)||this.getFirstPeriod();if(void 0!==r){var o=this.sA.getState(),a=(0,D.findAdaptationSetOfMimeType)(t,r,{sourceState:o,langObj:i,periodSwitched:n,playbackConfig:this.context.config.playback});return a||this.context.logger.debug("No AdaptationSet found to match mime type "+t),a}},t.prototype.getManifest=function(){return this.BA},t.prototype.getAvailableAudio=function(e,t){return this.AA.getAvailableAudio(e,t)},t.prototype.getAvailableVideo=function(e){return this.AA.getAvailableVideo(e)},t.prototype.getAvailableSubtitles=function(e){return this.AA.getAvailableSubtitles(e)},t.prototype.getClosedCaptionLabels=function(e){return this.AA.getClosedCaptionLabels(e)},t.prototype.getVideoRepresentations=function(e){return this.AA.getVideoQualities(e)},t.prototype.getAudioRepresentations=function(e){return this.AA.getAudioQualities(e)},t.prototype.getPeriodDuration=function(e,t){var i;return this.AA.getPeriodDuration(e,null!=t?t:null==(i=this.getManifest())?void 0:i.Period)},t.prototype.VA=function(e){var t,i,n,r,o,a,s,u,c,d,l,h,p,f,g,m;return this.isLastPeriod(e._id)?null!=(i=(null==(n=e.AdaptationSet[0])?void 0:n.SegmentTemplate)?null==(a=null==(o=null==(r=n.SegmentTemplate[0])?void 0:r.SegmentTimeline)?void 0:o[0])?void 0:a.totalDuration:(null==n?void 0:n.SegmentList)?null==(s=n.SegmentList[0])?void 0:s.totalDuration:(null==n?void 0:n.Representation)?null!=(p=null==(h=null==(l=null==(d=null==(c=null==(u=n.Representation[0])?void 0:u.SegmentTemplate)?void 0:c[0])?void 0:d.SegmentTimeline)?void 0:l[0])?void 0:h.totalDuration)?p:null==(m=null==(g=null==(f=n.Representation[0])?void 0:f.SegmentList)?void 0:g[0])?void 0:m.totalDuration:void 0)?i:1/0:null!=(t=e.duration)?t:this.getPeriodDuration(e._id
1)},t.prototype.hasMultiplePeriods=function(){return this.getAllPeriods().length>1},t.prototype.hasSinglePeriod=function(){return 1===this.getAllPeriods().length},t.prototype.WA=function(){var e=this;return this.getAllPeriods().reduce(function(t,i){return t+e.VA(i)},0)},t.prototype.getTimeShiftBufferDepthSeconds=function(){var e=this.AA.getTimeShiftBufferDepthSeconds();return this.isHlsManifest()?e:Math.max(e,-this.WA())},t.prototype.getRequestTimestamp=function(){return this.AA.getRequestTimestamp()},t.prototype.getMediaPresentationDuration=function(){var e,t=b.DurationConverter.getDurationInSec(null==(e=this.BA)?void 0:e._mediaPresentationDuration);return isNaN(t)?0:t},t.prototype.calculateCumulativePeriodDuration=function(e){for(var t,i,n=0,r=0,o=null!=(i=null==(t=this.BA)?void 0:t.Period)?i:[];r<o.length;r++){var a=o[r];if(a._id===e)break;n+=this.getPeriodDuration(a._id)}return this.isLive()?(0,P.toSeconds)(Date.now()-this.getAvailabilityStartTime())-n:n},t.prototype.getMinimumUpdatePeriod=function(){return(0,k.getMinimumUpdatePeriodInSeconds)(this.BA)},t.prototype.getContentProtectionForAdaptationSet=function(e){return k.MPDExtractor.getContentProtectionForAdaptationSet(e)},t.prototype.getLangObjectFromAdaptationSet=function(e,t){return this.AA.getLangObjectFromAdaptationSet(e,t)},t.prototype.toSubtitleTrack=function(e,t){return this.AA.toSubtitleTrack(e,t)},t.prototype.getDRMCapabilitiesForPeriod=function(e){return this.AA.getDRMCapabilitiesForPeriod(e)},t.prototype.hasManifestTypeChanged=function(e){return!(!this.BA||this.BA._type===e||(this.context.logger.log("Manifest has just changed from "+this.BA._type+" to "+e),0))},t.prototype.getPeriodIdForTime=function(e){var t,i=this.getAllPerio
1ds();return 1===i.length?i[0]._id:null==(t=Z(i,e))?void 0:t._id},t.prototype.dispose=function(){this.XA(),e.prototype.dispose.call(this)},t.prototype.XA=function(){this.uA=(0,d.dispose)(this.uA)},t.prototype.YA=function(){var e=this.getFirstPeriod();if(this.yA&&e&&e.start)return e.start+this.yA},t.prototype.getTotalDuration=function(){if(this.isLive())return this.YA()||1/0;var e=this.getLastPeriod();return e?(e.start||e._start&&b.DurationConverter.getDurationInSec(e._start)||0)+this.AA.getPeriodDuration(e._id):0},t.prototype.getFirstPeriod=function(){return this.getAllPeriods()[0]},t.prototype.getLastPeriod=function(){var e=this.getAllPeriods();if(e.length>0)return e[e.length-1]},t.prototype.isLastPeriod=function(e){var t=this.getLastPeriod();return!!t&&e===t._id},t.prototype.isManifestFinalized=function(){return!this.isLive()},t.prototype.isFirstPeriod=function(e){var t=this.getFirstPeriod();return!!t&&t._id===e},t.prototype.isHlsManifest=function(){var e,t;return null!=(t=null==(e=this.getManifest())?void 0:e._isHls)&&t},t.prototype.isDashManifest=function(){return!this.isHlsManifest()&&!this.isSmoothManifest()},t.prototype.isSmoothManifest=function(){var e,t;return"smooth"===(null==(t=null==(e=this.BA)?void 0:e.originalFormat)?void 0:t.format)},t.prototype.getHlsTags=function(){if(!this.isHlsManifest())return null;var e=E.ModuleManager.get(A.ModuleName.HLS).selectors,t=e.getHlsState;return(0,e.getCustomTags)(t(this.sA.getState()))},t.prototype.isMimeTypePartOfPeriod=function(e,t){var i=this.getPeriod(new x.PeriodId(t));return(i?i.AdaptationSet:[]).some(function(t){return t._mimeType===e})},t.prototype.getNextPeriod=function(e){var t;if(null==(t=this.BA)?void 0:t.Period)for(var i=this.findPeriod(e),n=this.BA.Period.indexOf(i)+1;n<this.BA.Period.length;n++){var r=this.BA.Period[n];if(r)return r}return null},t.prototype.getEventStreamEvents=function(e){return this.AA.getEventStreamEvents(e)},t.prototype.hasAdaptationSets=function(e){var t=this.BA;if(t&&t.Period){var i=t.Period.find(function(t){return t._id===e});return!!(i&&i.AdaptationSet)}return!1},t.prototype.ZA=function(e){if(this.wA){var t=this.wA.getSynchronizationPromise();if(t)return t;if(e.UTCTiming&&e.UTCTiming.length>0)return this.wA.synchronizeWithServer(e.UTCTiming,e._downloadTime)}return Promise.resolve()},t.prototype.getAdaptationSet=function(e){if(e&&this.BA)return(0,I.findAdaptationSet)(this.BA,e)},t.prototype.getRepresentationById=function(e){if(e&&this.BA)return(0,I.findRepresentation)(this.BA,e)},t.prototype.representationExists=function(e){return!!this.getRepresentationById(e)},t.prototype.getMatchingRepresentationsByBandwidth=function(e,t,i){void 0===i&&(i=function(){return!0});var n=this.getAdaptationSet(e);return n?j(n.Representation,t,i):[]},t.prototype.getMatchingRepresentationByBandwidth=function(e,t,i){void 0===i&&(i=function(){return!0});var n=this.getAdaptationSet(e);return n?V(n.Representation,t,i):null},t.prototype.getAllRepresentations=function(){return this.getAllPerio
1ds().flatMap(function(e){var t;return(null==(t=e.AdaptationSet)?void 0:t.flatMap(function(e){return e.Representation}))||[]})},t.prototype.getRepresentation=function(e,t){return this.getRepresentationById(new N.RepresentationId(e,t))},t.prototype.getAllAdaptationSets=function(){return this.getAllPeriods().flatMap(function(e){return e.AdaptationSet})},t.prototype.getAllImageAdaptationSets=function(){return this.getAllAdaptationSets().filter(function(e){return e._mimeType.includes("image")&&"image"===e._contentType})},t.prototype.getAllDashThumbnailSources=function(){var e=this;return this.getAllImageAdaptationSets().map(function(t){var i=e.findPeriod(t._internalId.periodId);return{adaptationSet:t,timing:{startTime:i.start,duration:i.duration}}})},t.prototype.getAdaptationSetIndex=function(e){var t=this.findPeriod(e.periodId);return t&&t.AdaptationSet&&0!==t.AdaptationSet.length?t.AdaptationSet.findIndex(function(t){return t._internalId.equals(e)}):-1},t.prototype.getAvailableBaseURLsForRepresentation=function(e){var t=this.getAdaptationSet(e);if(void 0===e||!t)return[];for(var i=[],n=t.Representation,r=0;r<n.length;r++)if(n[r]._internalId.equals(e)&&n[r].BaseURL&&n[r].BaseURL.length>0){i=n[r].BaseURL;break}var o=[];for(r=0;r<i.length;r++)o.push((0,m.forceReallocation)(i[r].url));return o},t.prototype.findDownloadedHlsRepresentation=function(e){var t=this.getAdaptationSet(e);return t?t.Representation.find(function(e){return e._hls&&!!e._hls.requestTimestamp}):null},t.prototype.isManifestFetchRequired=function(e){if(!this.isHlsManifest())return!1;var t=Date.now(),i=this.getRepresentationById(e),n=!!i.SegmentList&&i.SegmentList.length>0&&!!i.SegmentList[0].SegmentURL,r=n?i.SegmentList[0].SegmentURL.length:0,o=t-(i._requestTimestamp||t),a=this.isLive()&&o>=this.getMinimumUpdatePeriod();return!(!n||r>0)||a},t.prototype.hasSelfInitialisingSegments=function(){return this.getAllPerio
1ds().map(function(e){return e.AdaptationSet}).reduce(function(e,t){return e.concat(t)},[]).map(function(e){return e.Representation}).reduce(function(e,t){return e.concat(t)},[]).some(function(e){var t=e.SegmentList&&e.SegmentList.length>0?e.SegmentList:[],i=!!e.SegmentBase&&e.SegmentBase.length>0,n=e.SegmentTemplate&&e.SegmentTemplate.length>0?e.SegmentTemplate:[];return!(e.init||i||t.some(function(e){return!!e.init})||n.some(function(e){return!!e._initialization}))})},t.prototype.isSegmentInfoLoaded=function(e){var t=this.getRepresentationById(e);return!(!t||!t.segmentIndex&&!t.segmentIndexParsingError)},t.prototype.isPrecedingPeriod=function(e,t){if(!(e&&t&&this.BA&&this.BA.Period))return!1;var i=this.BA.Period.findIndex(function(t){return t._id===e}),n=this.BA.Period.findIndex(function(e){return e._id===t});return i>=0&&n>=0&&n<i},t.prototype.getMaxSegmentDuration=function(){var e=b.DurationConverter.getDurationInSec(this.BA._maxSegmentDuration);return isNaN(e)?0:e},t.prototype.getDesiredDistanceToLiveEdge=function(){var e,t=null==(e=this.context.serviceManager.get(c.ServiceName.LiveLatencyService))?void 0:e.getTargetLatency();return(0,C.isDefined)(t)?t:this.context.bufferSettings.getForwardTargetLevel()+this.qA.LIVE_EDGE_DISTANCE},t.prototype.hasSuggestedStartPosition=function(){var e,t;return null!=(t=null==(e=this.BA)?void 0:e.hasOwnProperty("_startOffset"))&&t},t.prototype.getVodStartOffset=function(){return Math.max(0,Math.min(this.BA._startOffset,this.getDuration()-this.qA.SEEK_TO_END_OFFSET))},t.prototype.getLiveStartOffset=function(e){void 0===e&&(e=!0);var t=this.BA._startOffset;return t-=Math.abs(this.getTimeShiftBufferDepthSeconds()),e&&(t+=this.getDesiredDistanceToLiveEdge(),t=Math.min(0,t)),t},t.prototype.initSegmentStartTimesFromReferenceSegment=function(e){this.sA.dispatch((0,R.initPlaybackTimesFromReferenceSegment)(e))},t.prototype.initializeSegmentStartTimesFromStart=function(e){var t,i,n=this.getRepresentationById(e),r=null==(i=null==(t=null==n?void 0:n.SegmentList)?void 0:t[0])?void 0:i.SegmentURL;if(n&&(null==r?void 0:r.length)){var o=r.length-1,a=(0,P.toSeconds)(n._requestTimestamp)-r[o]._duration;this.context.logger.debug("Initializing segment start times with start time of last segment ".concat(a),e),this.sA.dispatch((0,R.initPlaybackTimesFromIndex)(e,o,a))}else this.context.logger.debug("Failed to initialize segment start times, no segments found",e)},t.prototype.hasSegmentStartTimeForHlsRepresentation=function(e){var t,i,n,r=this.getRepresentationById(e);return void 0!==(null==(n=null==(i=null==(t=null==r?void 0:r.SegmentList)?void 0:t[0])?void 0:i.SegmentURL[0])?void 0:n._playbackTime)},t.prototype.getStartTimeForHlsSegment=function(e,t){var i,n,r,o,a,s=this.getRepresentationById(e),u=null!=(r=null==(n=null==(i=null==s?void 0:s.SegmentList)?void 0:i[0])?void 0:n.SegmentURL)?r:[],c=(0,B.findSegmentUrlIndexWithinSegmentList)(t,u);return -1!==c&&void 0!==u[c]._playbackTime?u[c]._playbackTime:null!=(a=null==(o=this.getFirstPeriod())?void 0:o.start)?a:void 0},t.prototype.isTimeNearPeriodEnd=function(e,t,i){var n=this.findPeriod(t),r=null==n?void 0:n.start;if(void 0===r)return!1;
1var o=r+this.getPeriodDuration(n._id,this.getAllPeriods());return e>=r&&e<=o&&o-e<=i},t}(v.Suspendable);function H(e){var t;return(e=o({},e)).Period=null==(t=e.Period)?void 0:t.map(function(e){var t;return o(o({},e),{AdaptationSet:null==(t=e.AdaptationSet)?void 0:t.map(function(t,i){var n,r=(0,O.createAdaptationSetIdFromMimeTypeAndIndex)(e._id,t._mimeType,i);return o(o({},t),{_internalId:r,_periodId:e._id,Representation:null==(n=t.Representation)?void 0:n.map(function(e){return o(o({},e),{_internalId:new N.RepresentationId(r,e._id)})})})})})}),e}function U(e){if(E.ModuleManager.has(A.ModuleName.DRM)){var t=E.ModuleManager.get(A.ModuleName.DRM).ContentProtectionHelper.getFirstKeyId;G(e,function(e){for(var i=t(e.ContentProtection),n=0;e.Representation&&n<e.Representation.length;n++){var r=e.Representation[n];(i||r.ContentProtection)&&(r.associatedKid=r.ContentProtection&&t(r.ContentProtection)||i)}})}}function G(e,t){for(var i=0;e.Period&&i<e.Period.length;i++)for(var n=e.Period[i],r=0;n.AdaptationSet&&r<n.AdaptationSet.length;r++)t(n.AdaptationSet[r])}function Z(e,t){if(e&&e.length){if(t<e[0].start)return e[0];var i=e[e.length-1];return t>=i.start?i:function(e,t){for(var i=e.length-1;i>=0;i--){var n=e[i].start+e[i].duration;if(t>=e[i].start&&t<n)return e[i];if(t>=n&&t<e[i+1].start)return e[i+1]}}(e,t)||i}}function j(e,t,i){void 0===i&&(i=function(){return!0});var n,r=e.filter(i),o=r.filter(function(e){return e._bandwidth===t});return o.length>0?o:(n=r.map(function(e){return e._bandwidth}).reduce(function(e,i){return Math.abs(i-t)<Math.abs(e-t)?i:e}),r.filter(function(e){return e._bandwidth===n}))}function V(e,t,i){void 0===e&&(e=[]),void 0===i&&(i=function(){return!0});var n=e.filter(i),r=null,o=-1/0;return n.forEach(function(e){e._bandwidth>o&&e._bandwidth<=t&&(o=e._bandwidth,r=e)}),r||n[0]}function q(e,t,i){var n=i?"videoCodecPriority":"audioCodecPriority";return(null==t?void 0:t.options)&&t.options[n]?t.options[n]:e.playback&&e.playback[n]?e.playback&&e.playback[n]:[]}function K(e,t){return{video:q(e,t,!0),audio:q(e,t,!1)}}function Y(e){var t=(0,L.getCodecsFromAdaptationSet)(e);if(!t||0===t.length)return null;var i=T.CodecStringHelper.getExtractedCodecStrings(t),n=e._mimeType.split("/")[0];return i[n]?T.CodecStringHelper.extractCodec(i[n]):null}function W(e){return e.reduce(function(e,t){return e[t._id]=t.AdaptationSet.map(function(e){return e._mimeType}).filter(function(e,t,i){return M.MimeTypeHelper.isAV(e)&&i.indexOf(e)===t}),e},{})}t.ManifestService=F},38568:function(e,t,i){var n,r,o,a,s,u,c=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),d=this&&this.__runInitializers||function(e,t,i){for(var n=arguments.length>2,r=0;r<t.length;r++)i=n?t[r].call(e,i):t[r].call(e);return n?i:void 0},l=this&&this.__esDecorate||function(e,t,i,n,r,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw TypeError("Function expected");return e}for(var s,u=n.kind,c="getter"===u?"get":"setter"===u?"set":"value",d=!t&&e?n.static?e:e.prototype:null,l=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in n)f[g]="access"===g?{}:n[g];for(var g in n.access)f.access[g]=n.access[g];f.addInitializer=function(e){if(h)throw TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var m=(0,i[p])("accessor"===u?{get:l.get,set:l.set}:l[c],f);if("accessor"===u){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw TypeError("Object expected");(s=a(m.get))&&(l.get=s),(s=a(m.set))&&(l.set=s),(s=a(m.init))&&r.unshift(s)}else(s=a(m))&&("field"===u?r.unshift(s):l[c]=s)}d&&Object.defineProperty(d,n.name,l),h=!0};Object.defineProperty(t,"__esModule",{value:!0}
vendor: 4,470 bytes, line 1
1),t.ManifestUpdateScheduler=void 0,t.initializeManifestUpdateSchedulingService=function(e,t){var i,n=e.serviceManager,r=t.sourceIdentifier;if(n.has(p.ServiceName.ManifestUpdateSchedulingService,r))null==(i=n.get(p.ServiceName.ManifestUpdateSchedulingService,r))||i.restore();else{var o=new P(e,t);n.set(p.ServiceName.ManifestUpdateSchedulingService,o,r)}},t.isRepresentationUpToDate=C;var h=i(3336),p=i(80813),f=i(77401),g=i(69957),m=i(85648),v=i(93204),y=i(88847),S=i(85434),T=i(89927),b=i(59707),M=i(22059),I=i(63147),P=(o=y.Suspendable,a=[],r=function(e){function t(t,i){var n=e.call(this,{onSuspend:function(){return n.PB()},onRestore:function(){return n.QB()}})||this;n.kB=d(n,a),n.sB=!1,n.tB={},n.yB=function(e){return null==e?void 0:e.activeTracks},n.zB=function(e){e&&n.mB.isHlsManifest()&&n.AB(e)},n.EB=function(e){return e.player&&e.player.playbackState},n.FB=function(e){e&&(e===m.PlaybackState.Paused?n.NB():e===m.PlaybackState.Playing&&n.OB())},n.IB=function(e){n.KB(e),n.mB.updateManifest(n.mB.getManifest()).catch(function(){n.rB.debug("Updating the manifest failed")})},n.JB=function(e,t){if(n.rB.debug("Rejection while updating the representation",e),e===f.RequestError.Failed||e===f.RequestError.TimedOut||e instanceof h.PlayerError){var i=e instanceof h.PlayerError?e.name:e;n.pB.dispatch((0,b.updateRepresentationFailedDownloadAction)(t._internalId,i)),n.mB.updateManifest(n.mB.getManifest()).catch(function(e){n.rB.debug("Error while updating the manifest after the representation failed to load",e)})}},n.LB=function(){n.rB.debug("Error while loading manifest")},n.kB=t,n.lB=i;var r=n.lB.sourceIdentifier;return n.mB=t.serviceManager.get(p.ServiceName.ManifestService,r),n.nB=t.serviceManager.get(p.ServiceName.ManifestLoadingService,r),n.oB=t.store,n.pB=t.serviceManager.get(p.ServiceName.SourceStoreService,r),n.qB=t.eventHandler,n.rB=t.logger,n.vB=n.xB(),n.wB=n.DB(t),n}return c(t,e),t.prototype.xB=function(){var e=this;return(0,v.subscribe)(this.pB)(function(t){return e.yB(t)},this.zB)},t.prototype.AB=function(e){this.BB(e),this.CB(e)},t.prototype.BB=function(e){var t=this;Object.keys(e).filter(function(t){return e[t].selectedRepresentationId}).forEach(function(i){t.GB(e[i].selectedRepresentationId)})},t.prototype.CB=function(e){var t=this;Object.keys(this.tB).filter(function(t){return!Object.keys(e).includes(t)}).forEach(function(e){t.tB[e].stop(),delete t.tB[e]})},t.prototype.DB=function(e){return(0,v.subscribe)(this.oB)(this.EB,this.FB,function(){return e.settings.STOP_DOWNLOAD_ON_PAUSE})},t.prototype.GB=function(e){var t=this.mB.getRepresentationById(e),i=e.adaptationSetId;t?this.tB[i]?this.tB[i].getRepresentation()._internalId.equals(e)||this.tB[i].setRepresentation(t):this.tB[t._internalId.adaptationSetId]=this.HB(t):this.rB.debug("[ManifestUpdateScheduler] Representation not found for update: ".concat(e.representationId," (adaptationSet: ").concat(i,", periodId: ").concat(e.periodId,")"))},t.prototype.stopRepresentationUpdates=function(e){var t,i=this.tB[e._internalId.adaptationSetId];return null!=(t=null==i?void 0:i.stopRepresentationUpdate(e))?t:Promise.resolve()},t.prototype.scheduleRepresentationUpdate=function(e){var t=this.tB[e._internalId.adaptationSetId];null==t||t.setRepresentation(e),null==t||t.start()},t.prototype.HB=function(e){var t=this,i=new I.RepresentationUpdater(this.kB,e,this.nB,{success:this.IB,error:function(e){return t.JB(e,i.getRepresentation())}});return S.MimeTypeHelper.isAV(e._mimeType)||i.setRepresentation(e),i.start(),i},t.prototype.KB=function(e){this.pB.dispatch((0,b.updateRepresentationAction)(e))},t.prototype.init=function(e){var t=this;return this.nB.load(e).then(function(e){return t.mB.updateManifest(e).then(function(){t.sB=!0,t.mB.isLive()&&!t.mB.isHlsManifest()&&t.MB(e)})}).catch(function(e){return e instanceof h.PlayerError||e instanceof Error?Promise.reject(e):Promise.reject(Error("The loading of the manifest has failed or was cancelled"))})},t.prototype.MB=function(e){var t=this;this.uB=new M.ManifestUpdater(this.kB,this.nB,e,{minAllowedUpdatePeriod:this.kB.settings.MINIMUM_ALLOWED_UPDATE_PERIOD,maxAllowedUpdatePeriod:this.kB.settings.MAXIMUM_ALLOWED_UPDATE_PERIOD},{success:function(e){return t.mB.updateManifest(e)},error:this.LB}),this.uB.start()},t.prototype.waitForRepUpdate=function(e){return 0===Object.keys(this.tB).length||C(this.mB.getRepresentationById(e))?Promise.resolve():this.tB[e.adaptationSetId].updateRepresentation().then(function(){})}
1,t.prototype.NB=function(){Object.values(this.tB).forEach(function(e){return e.stop()}),this.uB&&this.uB.stop()},t.prototype.OB=function(){Object.values(this.tB).filter(function(e){return e.isStopped}).forEach(function(e){e.start()}),this.uB&&this.uB.isStopped&&this.uB.start()},t.prototype.PB=function(){this.wB()},t.prototype.QB=function(){this.wB=this.DB(this.kB)},t.prototype.isInitiated=function(){return this.sB},t.prototype.dispose=function(){var t;this.vB(),this.wB(),this.NB(),null==(t=this.uB)||t.dispose(),Object.values(this.tB).forEach(function(e){e.dispose()}),this.uB=null,this.tB=null,e.prototype.dispose.call(this)},t}(o),u="function"==typeof Symbol&&Symbol.metadata?Object.create(null!=(s=o[Symbol.metadata])?s:null):void 0,l(r,null,[(0,g.trackPerformance)("ManifestUpdateScheduler.init",!0)],{kind:"method",name:"init",static:!1,private:!1,access:{has:function(e){return"init"in e},get:function(e){return e.init}},metadata:u},null,a),u&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:u}),r);function C(e){var t;return!!e._requestTimestamp&&e._requestTimestamp+(0,T.toMilliSeconds)(null!=(t=e._updateInterval)?t:1/0)>Date.now()}t.ManifestUpdateScheduler=P},22059:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.ManifestUpdater=void 0;var o=i(14302),a=i(23940);t.ManifestUpdater=function(e){function t(t,i,n,r,o){var a=e.call(this,t,o)||this;return a.context=t,a.manifestLoader=i,a.manifest=n,a.settings=r,a}return r(t,e),t.prototype.getUpdatedManifest=function(){return this.getPayload()},t.prototype.update=function(){var e=this;return this.manifestLoader.load(this.manifest._currentLoadingUrl).then(function(t){return e.manifest=t,t})},t.prototype.getReloadIntervalInSeconds=function(){var e=(0,a.getMinimumUpdatePeriodInSeconds)(this.manifest);return isNaN(e)?this.settings.minAllowedUpdatePeriod:Math.min(this.settings.maxAllowedUpdatePeriod,Math.max(this.settings.minAllowedUpdatePeriod,e))},t.prototype.getLastReloadTimestamp=function(){return this.manifest._requestTimestamp},t}(o.AbstractUpdater)},90087:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MediaPlayerManifestApiFactory=void 0;var n=i(80813),r=i(3714),o=i(16197);t.MediaPlayerManifestApiFactory=function(){function e(){}return e.create=function(t,i){var r=i.serviceManager.get(n.ServiceName.ManifestService,i.sourceContext.sourceIdentifier);return new function(){r.isHlsManifest()?this.hls=e.createHlsApi(r):r.isSmoothManifest()||(this.dash=e.createDashApi(t,r))}},e.createDashApi=function(t,i){return new(function(){function n(){}return n.prototype.getPeriod=function(){var n=i.getPeriodIdForTime(t.getCurrentTime()),r=i.getPeriod(new o.PeriodId(n));return r?e.createPeriodApi(i,r):null}
1,n.prototype.listPeriods=function(){return i.getAllPeriods().map(function(t){return e.createPeriodApi(i,t)})},n}())},e.createHlsApi=function(t){return new(function(){function i(){this.properties=t.getHlsTags()}return i.prototype.getVideoTracks=function(){return e.getVideoTracks(t,t.getFirstPeriod()._id)},i.prototype.getAudioTracks=function(){return e.getAudioTracks(t,t.getFirstPeriod()._id)},i.prototype.getTextTracks=function(){return e.getTextTracks(t,t.getFirstPeriod()._id)},i}())},e.createPeriodApi=function(t,i){return new(function(){function n(){this.id=i._id,this.properties={},i._id&&(this.properties.id=i._id),i._start&&(this.properties.start=i._start),i._duration&&(this.properties.duration=i._duration)}return n.prototype.getVideoTracks=function(){return e.getVideoTracks(t,this.id)},n.prototype.getAudioTracks=function(){return e.getAudioTracks(t,this.id)},n.prototype.getTextTracks=function(){return e.getTextTracks(t,this.id)},n.prototype.getMetadata=function(){return e.getMetadata(t,this.id)},n}())},e.getAudioTracks=function(t,i){return t.getAvailableAudio(i,!1).map(function(n){var r={id:n.id,label:n.label,lang:n.lang,getQualities:function(){return e.getAudioQualities(t,i,n.id)}};return n.role&&(r.role=n.role),n.metadata&&(r.metadata=n.metadata),r})},e.getVideoTracks=function(t,i){return t.getAvailableVideo(i).map(function(n){var r={id:n.id,label:n.label,getQualities:function(){return e.getVideoQualities(t,i)}};return n.role&&(r.role=n.role),n.metadata&&(r.metadata=n.metadata),r})},e.getTextTracks=function(e,t){return e.getAvailableSubtitles(t)},e.getMetadata=function(e,t){return e.getEventStreamEvents(e.findPeriod(t)).map(function(e){return{type:r.MetadataType.EVENT_STREAM,payload:e.data,start:e.startTime,end:e.endTime}})},e.getAudioQualities=function(e,t,i){return e.getAudioRepresentations(t)[i]||[]},e.getVideoQualities=function(e,t){return e.getVideoRepresentations(t)},e}()},16197:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.PeriodId=void 0,t.PeriodId=function(){function e(e){this.uF=e}return Object.defineProperty(e.prototype,"periodId",{get:function(){return this.uF},enumerable:!1,configurable:!0}),e.prototype.equals=function(e){return null!=e&&this.periodId===e.periodId},e.prototype.key=function(){return this.periodId},e}()},79505:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.RepresentationId=void 0;var o=i(47151);t.RepresentationId=function(e){function t(t,i){var n=e.call(this,t.periodId,t.adaptationSetId)||this;return n.Rb=i,n}return r(t,e),Object.defineProperty(t.prototype,"representationId",{get:function(){return this.Rb},enumerable:!1,configurable:!0}),t.prototype.equals=function(t){return e.prototype.equals.call(this,t)&&this.representationId===(null==t?void 0:t.representationId)},t.prototype.key=function(){return e.prototype.key.call(this)+"-"+this.representationId},t.from=function(e){return e._representationId&&e._adaptationSetId&&e._periodId?new t(new o.AdaptationSetId(e._periodId,e._adaptationSetId),e._representationId):null},t}(o.AdaptationSetId)},63147:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.RepresentationUpdater=void 0;
1var o=i(88052),a=i(62756),s=i(60729),u=i(14302);t.RepresentationUpdater=function(e){function t(t,i,n,r){var o=e.call(this,t,r)||this;return o.context=t,o.representation=i,o.manifestLoader=n,o}return r(t,e),t.prototype.getRepresentation=function(){return this.representation},t.prototype.setRepresentation=function(e){this.representation._internalId.equals(e._internalId)||this.cancel(),this.representation=e,this.scheduleUpdate(!0)},t.prototype.updateRepresentation=function(){return this.getPayload()},t.prototype.stopRepresentationUpdate=function(t){return e.prototype.stop.call(this),this.manifestLoader.stopRepresentationUpdate(t)},t.prototype.update=function(){var e=this;return this.manifestLoader.updateRepresentation(this.representation).then(function(t){if(e.representation._id!==t._id)throw u.REPRESENTATION_UPDATE_CANCEL;return e.representation=t,t})},t.prototype.getReloadIntervalInSeconds=function(){var e,t;return this.representation._requestTimestamp?(0,s.isPlayingLowLatencyHls)(this.context)&&(null==(e=o.ModuleManager.get(a.ModuleName.HLS))?void 0:e.canMakeBlockingPlaylistReload(this.representation,this.context.settings))?0:null!=(t=this.representation._updateInterval)?t:1/0:0},t.prototype.getLastReloadTimestamp=function(){return this.representation._requestTimestamp?this.representation._requestTimestamp:0},t}(u.AbstractUpdater)},99257:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.AdRestorationOptimizationService=void 0;var n=i(3714),r=i(91678),o=i(46151),a=i(94685),s=i(13422),u=i(80813),c=i(81524);t.AdRestorationOptimizationService=function(){function e(){var e=this;this.cb=function(){(0,a.isContextAvailable)(e.Tb)&&e.Tb.eventHandler.off(n.PlayerEvent.AdStarted,e.cb),e.db(e.Xb),e.Xb=[]}}return e.prototype.updatePlayerContext=function(e){this.Sb=[],this.Tb=e,this.Ub=e.segmentInfoService,this.Vb=e.segmentPrefetchingService,this.Wb=e.segmentCacheService,this.Zb()},e.prototype.Zb=function(){var e;(null==(e=this.Tb)?void 0:e.sourceContext)&&!this.Tb.sourceContext.isAd&&(this.Yb=this.Tb.sourceContext)},e.prototype.optimizeRestorationAfterUpcomingAdBreak=function(){var e,t,i=this,r=null==(t=null==(e=this.ab())?void 0:e.getState())?void 0:t.playback;if(!(0,a.isContextAvailable)(this.Tb)||!this.Ub||!r)return Promise.reject("Could not get playback state and/or SegmentInfoService");this.Zb();var o=(0,c.getPlaybackPosition)(r);return isNaN(o)?Promise.reject("Could not get playback position"):this.Ub.getSegmentInfos(o,this.Tb.settings.AD_RESTORATION_SEGMENT_PREFETCHING_DURATION).then(function(e){i.bb(e),i.Xb=e,(0,a.isContextAvailable)(i.Tb)&&i.Tb.eventHandler&&i.Tb.eventHandler.on(n.PlayerEvent.AdStarted,i.cb)})},e.prototype.ab=function(){return(0,a.isContextAvailable)(this.Tb)?this.Tb.serviceManager.get(u.ServiceName.SourceStoreService,this.Tb.sourceContext.sourceIdentifier):void 0},e.prototype.bb=function(e){var t=(0,a.isContextAvailable)(this.Tb)?this.Tb.sourceContext.sourceIdentifier:void 0,i=t?this.Tb.serviceManager.get(u.ServiceName.ManifestService,t):void 0;i&&e.forEach(function(e){var t=i.getAdaptationSet(e.internalRepresentationId);t&&(e.codecs=(0,s.getCodecsFromAdaptationSet)(t))})},e.prototype.db=function(e){var t;this.Sb=e.reduce(function(e,t){return t.mimeType&&!e.includes(t.mimeType)&&e.push(t.mimeType),e},[]),this.eb(),this.Yb&&(null==(t=this.Vb)||t.fetchAll(e,this.Yb))},e.prototype.hasPrefetchedSegment=function(e,t){var i,n;return(!(0,a.isContextAvailable)(this.Tb)||!this.Tb.sourceContext.isAd)&&!!this.Yb&&null!=(n=null==(i=this.Wb)?void 0:i.hasPrefetchedSegment(e,t,this.Yb))&&n},e.prototype.getPrefetchedSegment=function(e,t){var i,n;return this.Yb&&null!=(n=null==(i=this.Wb)?void 0:i.getPrefetchedSegment(e,t,this.Yb))?n:null},e.prototype.getRepresentationForPrefetchedSegment=function(e){var t;if(this.Yb)return null==(t=this.Wb)?void 0:t.getRepresentationForPrefetchedSegment(e,this.Yb)},e.prototype.eb=function(){var e=this;if((0,a.isContextAvailable)(this.Tb)){var t=this.Tb.store.getState();if(0!==this.Sb.length&&t){var i=(0,o.getMetricsState)(t);this.Sb.forEach(function(t){i[t]||e.Tb.store.dispatch((0,r.initializeMetricsForMimeType)(t,e.Tb.settings))})}}},e.prototype.reset=function(){(0,a.isContextAvailable)(this.Tb)&&this.Tb.eventHandler.off(n.PlayerEvent.AdStarted,this.cb),this.Sb=[],this.Xb=[]},e.prototype.dispose=function(){this.reset(),this.Ub=void 0,this.Vb=void 0,this.Wb=void 0},e}()}
1,17382:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateDownloadRates=function(e){return e.map(function(e){return(0,n.bytesToBits)(e.bytes)/e.downloadDuration}).filter(function(e){return e<1/0})},t.filterValuesExceedingAverageByMargin=function(e){var t=1.1*r(e);return e.filter(function(e){return e<=t})},t.calcAverage=r,t.bpsToMbps=function(e){return e/1024/1024};var n=i(33004);function r(e){return e.reduce(function(e,t){return e+t},0)/e.length}},49440:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.resolveContainerFormat=function(e,t,i){var s,c,d;return i?(c=r.ModuleManager.has(o.ModuleName.ContainerMP4),d=null==(s=r.ModuleManager.get(o.ModuleName.ContainerMP4,!1))?void 0:s.isValidMp4,c&&d(t)?{source:a.ContainerFormat.MP4,target:a.ContainerFormat.MP4}:n.MimeTypeHelper.isSubtitle(e)?u(e):{source:a.ContainerFormat.TS,target:a.ContainerFormat.MP4}):u(e)};var n=i(85434),r=i(88052),o=i(62756),a=i(34795),s=i(14443);function u(e){var t=(0,s.extractContainerFormat)(e);return t?{source:t,target:t}:void 0}},23133:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.addEncryptionKeyToStore=function(e,t,i){return(0,a.getEncryptionKey)(i.getState(),e)?i.dispatch((0,o.updateEncryptionKey)({uri:e,key:void 0,loadState:s.KeyLoadState.Loading})):i.dispatch((0,o.addEncryptionKey)({uri:e,key:void 0,loadState:s.KeyLoadState.Loading})),t.load(e).then(function(t){var n;return null==i||i.dispatch((0,o.updateEncryptionKey)({uri:e,key:r.FormatHelper.bytesToHex(t),loadState:s.KeyLoadState.Loaded})),(n=(0,a.getAllEncryptionKeys)(i.getState()))&&n.length>u&&i.dispatch((0,o.removeEncryptionKey)(n[0].uri)),t}).catch(function(t){return null==i||i.dispatch((0,o.updateEncryptionKey)({uri:e,key:void 0,loadState:s.KeyLoadState.Cancel})),Promise.reject(t)})},t.waitForKeyToBeLoaded=function(e,t){return new Promise(function(i,o){var u=(0,n.subscribe)(e)(function(e){return(0,a.getEncryptionKey)(e,t)},function(e){return e.loadState===s.KeyLoadState.Cancel?(u(),o(Error("Encryption key load cancelled!"))):e.loadState===s.KeyLoadState.Loaded&&e.key?(u(),i(r.FormatHelper.hexToBytes(e.key).buffer)):void 0})})};var n=i(93204),r=i(70233),o=i(51386),a=i(66628),s=i(92096),u=20},88618:function(e,t,i){var n,r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.FetchController=void 0;var o,a=i(77401),s=i(43446),u=i(29669),c=i(34841),d=i(88844),l=i(97587);(n=o||(o={})).User="user",n.Timeout="timeout",t.FetchController=function(){function e(e,t,i,n){var o=this;this.useStreamResponse=n,this.setProgressListener=function(e){o.yc=e},this.Hc=function(e){o.yc&&(o.xc.progressTimestamp=s.TimingUtil.getHiResTimestamp(),o.zc.loadedBytes=e,o.yc(r({},o.zc)))},this.Ic=function(){(0,d.clearTimeoutIfDefined)(o.uc)},this.fb=e.logger,this.gb=i,this.ib=t,this.jb=new c.Deferred,this.wc=0,this.xc={sendTimestamp:-1,openedTimestamp:-1,headersReceivedTimestamp:-1,progressTimestamp:-1,doneTimestamp:-1},this.hb=new AbortController,this.zc={loadedBytes:0,url:t.url,responseTiming:this.xc,chunks:[],elapsedTime:0}}return e.prototype.getResponse=function(){return this.Ac(this.ib),this.jb.promise},e.prototype.cancel=function(e){void 0===e&&(e=o.User),(0,d.clearTimeoutIfDefined)(this.uc),this.vc=e,this.hb.abort()},e.prototype.Ac=function(e){var t,i,n=this,c={method:e.method,headers:new Headers(e.headers),credentials:e.credentials,signal:this.hb?this.hb.signal:void 0,body:(t=e.method,[u.HttpRequestMethod.GET,u.HttpRequestMethod.HEAD].includes(t))?void 0:e.body};this.xc.sendTimestamp=s.TimingUtil.getHiResTimestamp(),fetch(e.url,c).then(function(e){var t;if(n.xc.headersReceivedTimestamp=s.TimingUtil.getHiResTimestamp(),null==(t=n.yc)||t.call(n,r({},n.zc)),e.ok){var i=n.Cc(e);n.Ec(e).then(function(e){i.body=e,i.length=n.wc,i.timeToFirstByte=n.xc.headersReceivedTimestamp-n.xc.sendTimestamp,n.xc.doneTimestamp>0&&(i.elapsedTime=n.xc.doneTimestamp-n.xc.sendTimestamp),n.jb.resolve(i)}).catch(function(t){n.Jc({error:t.message,response:n.Cc(e)})})}else n.Jc({error:a.RequestError.Failed,response:n.Cc(e)})}).catch(function(e){n.Jc({error:n.Dc(e)})}
1),this.xc.openedTimestamp=s.TimingUtil.getHiResTimestamp(),null==(i=this.yc)||i.call(this,r({},this.zc)),this.uc=window.setTimeout(function(){return n.cancel(o.Timeout)},this.gb)},e.prototype.Bc=function(e){var t={};return e.headers.forEach(function(e,i){return t[i]=e}),t},e.prototype.Cc=function(e){return{request:this.ib,url:e.url,headers:this.Bc(e),status:e.status,statusText:e.statusText}},e.prototype.Dc=function(e){return this.fb.debug("fetch error",e),e instanceof Error&&"AbortError"===e.name?this.vc===o.User?a.RequestError.Canceled:a.RequestError.TimedOut:a.RequestError.Failed},e.prototype.Ec=function(e){var t=this;if(e.body&&this.useStreamResponse){var i=new l.Stream,n=this.xc.headersReceivedTimestamp;return this.Fc(e,function(e){var r=s.TimingUtil.getHiResTimestamp(),o=r-n;n=r,t.zc.chunks.push({downloadDuration:o,bytes:e.byteLength});var a=e instanceof Uint8Array?e.buffer:e;i.add(a)}).then(function(){i.end(),t.Ic()}).catch(function(e){t.fb.debug("Error reading of fetch response:",e),i.abort(t.Dc(e))}),Promise.resolve(i)}var r=e.headers.get("Content-Length"),o=r?parseInt(r):0;return this.zc.totalBytes=o,this.Fc(e.clone()).catch(function(e){t.fb.debug("Error reading of fetch response:",e)}),this.Gc(e).then(function(e){return t.wc=o,t.xc.doneTimestamp=s.TimingUtil.getHiResTimestamp(),t.Ic(),e})},e.prototype.Fc=function(e,t){var i=this;if(!e.body)return Promise.reject(Error("response.body is null"));var n=e.body.getReader(),r=function(){return n.read().then(function(e){var n=e.done,o=e.value;return n?(i.xc.doneTimestamp=s.TimingUtil.getHiResTimestamp(),void i.Hc(i.wc)):o?(null==t||t(o),i.wc+=o.byteLength,i.Hc(i.wc),r()):void 0})};return r()},e.prototype.Gc=function(e){switch(this.ib.responseType){case u.HttpResponseType.ARRAYBUFFER:return e.arrayBuffer();case u.HttpResponseType.TEXT:return e.text();case u.HttpResponseType.JSON:return e.json();default:return Promise.reject(Error("Unsupported response type on fetch request"))}},e.prototype.Jc=function(e){(0,d.clearTimeoutIfDefined)(this.uc),this.fb.debug("Error performing fetch: ".concat(e.error),e.response),this.jb.reject(e)},e}()},94618:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.KeyLoader=void 0;var n=i(40306),r=i(3336),o=i(4129),a=i(77401),s=i(29669);t.KeyLoader=function(){function e(e){this.j4=e,this.k4=e.settings,this.m4=e.sourceContext.sourceIdentifier,this.l4=new o.DefaultContentLoader(this.j4,{maxRetries:this.k4.MAX_RETRIES,retryDelay:this.k4.RETRY_DELAY,requestType:s.HttpRequestType.KEY_HLS_AES})}return e.prototype.n4=function(){var e=this.j4.sourceContext.source&&this.j4.sourceContext.source.hasOwnProperty("options")&&this.j4.sourceContext.source.options,t=e&&e.hasOwnProperty("withCredentials")&&e.withCredentials,i=e&&e.hasOwnProperty("hlsWithCredentials")&&e.hlsWithCredentials;return!!t||!!i},e.prototype.load=function(e){var t=this;return this.l4?this.l4.load(e,s.HttpRequestMethod.GET,s.HttpResponseType.ARRAYBUFFER,void 0,void 0,this.n4()).then(function(e){return e.body}).catch(function(i){if(i.message===a.RequestError.Canceled)return Promise.reject(i);var o=new r.PlayerError(n.ErrorCode.DRM_FAILED_LICENSE_REQUEST,{statusCode:i.status,statusText:i.statusText,keyUrl:e},"Failed to load the DRM key: ".concat(i.status," ").concat(i.statusText,"."),t.m4);return t.j4.eventHandler.fireError(o),Promise.reject(o)}):Promise.reject("Could not load: No loader.")},e.prototype.isLoading=function(){return!!this.l4&&this.l4.isLoading()},e.prototype.dispose=function(){this.l4&&"function"==typeof this.l4.dispose&&this.l4.dispose(),this.l4=void 0,this.k4=void 0},e}()},689:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.getLoaderConfig=function(e,t){var i,n;return(null==(i=e.config.tweaks)?void 0:i.segmentLoaderArgs)?e.config.tweaks.segmentLoaderArgs:{maxRetries:e.settings.MAX_CDN_RETRIES,requestType:(n=t,o.MimeTypeHelper.isVideo(n)?r.HttpRequestType.MEDIA_VIDEO:o.MimeTypeHelper.isAudio(n)?r.HttpRequestType.MEDIA_AUDIO:o.MimeTypeHelper.isSubtitle(n)?r.HttpRequestType.MEDIA_SUBTITLES:o.MimeTypeHelper.isUnknown(n)?r.HttpRequestType.INTERNAL:r.HttpRequestType.UNKNOWN),disableDownloadTimeout:!0,resetRetriesWhenOffline:!0}},t.getLoader=function(e,t){var i,r=null==(i=e.config.tweaks)?void 0:i.segmentLoader;return r&&"function"==typeof r?new r(t):new n.DefaultContentLoader(e,t)};var n=i(4129),r=i(29669),o=i(85434)},54053:function(e,t){var i,n;
1Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentInfoError=void 0,(n=i||(t.SegmentInfoError=i={})).END_OF_STREAM_REACHED="END_OF_STREAM_REACHED",n.PERIOD_COMPLETE="PERIOD_COMPLETE",n.SEGMENT_EXCEEDING_PERIOD_DURATION="SEGMENT_EXCEEDING_PERIOD_DURATION"},86219:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MPDHandlerFactory=void 0;var n=i(80813),r=i(88052),o=i(62756),a=i(63066);t.MPDHandlerFactory=function(){function e(){}return e.createInstance=function(e,t,i,s){var u,c=e.serviceManager.get(n.ServiceName.ManifestService,t.sourceIdentifier);if(!c||!s)return null;var d=s.Representation&&s.Representation[0],l=d&&d.SegmentTemplate?d.SegmentTemplate:s.SegmentTemplate;if(c.isSmoothManifest()){var h=e.serviceManager.get(n.ServiceName.ManifestLoadingService,t.sourceIdentifier);return h?l?new(r.ModuleManager.get(o.ModuleName.Smooth).createSmoothSegmentTemplateMPDHandler())(e,t,i,h):null:null}return c.isHlsManifest()?(null==d?void 0:d.SegmentList)?new a.SegmentListMPDHandler(e,t):null:(u=r.ModuleManager.get(o.ModuleName.DASH),l&&l[0].SegmentTimeline?new u.SegmentTimelineMPDHandler(e,t):l?new u.SegmentTemplateMPDHandler(e,t):(null==d?void 0:d.SegmentList)?new a.SegmentListMPDHandler(e,t):(null==d?void 0:d.SegmentBase)?new u.SegmentBaseMPDHandler(e,t):null)},e}()},17556:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.PreloadingService=void 0;var n=i(69251),r=i(42456);t.PreloadingService=function(){function e(e){this.context=e,this.Kc={},this.Lc=!1}return e.prototype.preloadSource=function(e,t){var i=this;if(!e.hls&&!e.dash)return Promise.reject(Error("Source preloading requires an HLS or DASH source."));var r=(0,n.deriveSourceIdentifier)(e,this.context.internalPlayerID),o={isCancelled:!1};return this.Kc[r]=o,this.context.internalPlayer.prepareSource(e,t).then(function(e){return i.Mc(e)}).finally(function(){return i.Nc(r,o)})},e.prototype.Mc=function(e){var t=this;return(0,r.collectInitialSegmentInfos)(this.context,e).then(function(i){var n;return i.length>0&&(null==(n=t.context.segmentPrefetchingService)||n.fetchAll(i,e)),e})},e.prototype.cancelPreload=function(e){this.cancelQueuedPrefetches(e);var t=this.Kc[e];t?t.isCancelled=!0:this.Oc(e)},e.prototype.cancelQueuedPrefetches=function(e){var t;null==(t=this.context.segmentPrefetchingService)||t.clearPrefetchingQueues(e)},e.prototype.Nc=function(e,t){this.Kc[e]===t&&(delete this.Kc[e],t.isCancelled&&!this.Lc&&this.Oc(e))},e.prototype.Oc=function(e){var t,i;null==(t=this.context.segmentPrefetchingService)||t.disposeSource(e),null==(i=this.context.serviceManager)||i.disposeScope(e)},e.prototype.dispose=function(){this.Lc=!0,this.Kc={}},e}()},11051:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.throwRepresentationDownloadError=function(e,t,i,s){if(e.logger.debug(t),s instanceof r.PlayerError)e.eventHandler.fireError(s);else if(s&&Object.keys(n.ErrorCode).includes(s)){var u=n.ErrorCode[s];e.eventHandler.fireError(new r.PlayerError(u,a(i),t,e.sourceContext.sourceIdentifier))}else s!==o.RequestError.TimedOut?e.eventHandler.fireError(new r.PlayerError(n.ErrorCode.SOURCE_COULD_NOT_LOAD_MANIFEST,a(i),t,e.sourceContext.sourceIdentifier)):e.eventHandler.fireError(new r.PlayerError(n.ErrorCode.NETWORK_MANIFEST_DOWNLOAD_TIMEOUT,a(i),"Failed to load the segment: the request timed out.",e.sourceContext.sourceIdentifier))};var n=i(40306),r=i(3336),o=i(77401);function a(e){return{url:null==e?void 0:e.Uri,mimeType:null==e?void 0:e._mimeType,codecs:null==e?void 0:e._codecs,bitrate:null==e?void 0:e._bandwidth}}},37641:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentCache=void 0,t.areSegmentsIdentical=o;var n=i(74853),r=i(19541);function o(e,t){return(e.isInitSegment?["url","periodId","byteRange","representationId"]:["url","periodId","byteRange","discontinuitySequenceNumber"]).every(function(i){return"object"==typeof e[i]?(0,r.compareValues)(e[i],t[i]):e[i]===t[i]})}t.SegmentCache=function(){function e(e){this.PF=Math.max(0,e),this.QF=[]}return e.prototype.contains=function(e){return this.QF.some(function(t){return o(e.getSegmentInfo(),t.getSegmentInfo())})},e.prototype.RF=function(e){this.QF=0!==e?this.QF.slice(-e):[]},e.prototype.add=function(e){this.contains(e)||(this.QF.push(e),this.RF(this.PF))},e.prototype.get=function(e){return this.QF.find(function(t){return o(e,t.getSegmentInfo())})},e.prototype.clear=function(){this.RF(0)},e.prototype.remove=function(e){this.QF=this.QF.filter((0,n.invert)(e))},e.prototype.getCapacity=function(){return this.PF},e.prototype.getCachedCount=function(){return this.QF.length},e.prototype.getCachedSegments=function(){return this.QF.slice(0)},e}()},48514:function(e,t){function i(e,t){var i=[];return e.forEach(function(e){return i.push(t(e))}),i}
1Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentCacheService=void 0,t.SegmentCacheService=function(){function e(){}return e.prototype.updatePlayerContext=function(e){this.Pc=e.segmentPrefetchingService},e.prototype.hasPrefetchedSegment=function(e,t,i){var n=e;return"string"==typeof e&&(n=this.Qc(e,t,i)),!(!n||"string"==typeof n||!this.Pc)&&!!this.Pc.getPrefetchedSegment(n,i)},e.prototype.getPrefetchedSegment=function(e,t,i){var n=this;if(!this.Pc||!e.mimeType)return null;var r=this.Pc.getPrefetchedSegment(e,i);return this.Pc.clearPrefetchingQueue(e.mimeType,i),r&&(this.Pc.removePrefetchedSegment(e,i),this.Pc.setShouldDownloadBeCancelledCallback(e.mimeType,t,i),r.catch(function(){}).finally(function(){n.Pc&&e.mimeType&&n.Pc.removeShouldDownloadBeCancelledCallback(e.mimeType,i)})),r},e.prototype.getRepresentationForPrefetchedSegment=function(e,t){var n,r,o=null==(r=null==(n=this.Pc)?void 0:n.getPrefetchedSegments(t))?void 0:r.get(e);if(o)return i(o,function(e){return e.segmentInfo.internalRepresentationId}).find(Boolean)},e.prototype.Qc=function(e,t,n){var r,o,a=null==(o=null==(r=this.Pc)?void 0:r.getPrefetchedSegments(n))?void 0:o.get(e);if(a)return i(a,function(e){return e.segmentInfo}).find(function(e){if(null==(null==t?void 0:t.segmentNumber)||null==(null==t?void 0:t.startTime)||null==(null==t?void 0:t.duration))return!0;var i=t.segmentNumber+1,n=Math.round(t.startTime+t.duration),r=e.segmentNumber===i,o=null!=e.startTime&&Math.round(e.startTime)===n;return r||o})},e.prototype.dispose=function(){this.Pc=void 0},e}()},14443:function(e,t,i){var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},r=this&&this.__spreadArray||function(e,t,i){if(i||2==arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentController=void 0,t.getSegmentManager=ei,t.extractContainerFormat=en;var o=i(66790),a=i(40306),s=i(3336),u=i(25926),c=i(4224),d=i(80813),l=i(56481),h=i(3714),p=i(13531),f=i(77401),g=i(98714),m=i(49859),v=i(91678),y=i(46151),S=i(33436),T=i(15971),b=i(93204),M=i(94685),I=i(34047),P=i(85434),C=i(15014),E=i(89927),A=i(23068),R=i(88052),_=i(62756),B=i(95880),D=i(34795),O=i(13422),L=i(23940),k=i(84696),x=i(3095),N=i(19627),w=i(36193),F=i(44115),H=i(59707),U=i(88935),G=i(39523),Z=i(99529),j=i(60729),V=i(86659),q=i(49440),K=i(73794),Y=i(86219),W=i(11051),z=i(37641),Q=i(50429),X=i(65439),J=i(65244),$=i(98892),ee=i(25902);function et(e,t){var i=(0,X.getSegmentInfoTimeRange)(e),n=(0,Z.getTrackIdentifier)(e);
1i&&(null==t||t.dispatch((0,G.removeStreamTimeRange)(n,i,Z.StreamTimeRangeType.Loading)))}function ei(e,t,i,n,r,o){var a=e.serviceManager.get(d.ServiceName.AdaptationService),s=e.serviceManager.get(d.ServiceName.ManifestService,t.sourceIdentifier),u=function(t,n){var o=!!(null==a?void 0:a.shouldDownloadBeCancelled(i,t,n));return(null==s?void 0:s.isHlsManifest())&&r.possiblyDependentSegments&&o?(e.logger.debug("Download should be cancelled, but this is disabled for segments not starting with key frames"),!1):o};return e.serviceManager.maybeCall(d.ServiceName.SegmentService,function(e){return e.add({mimeType:i,shouldDownloadBeCancelledCallback:u},n,o)})}function en(e){var t=e.split("/")[1].toLowerCase();return Object.values(D.ContainerFormat).find(function(e){return e===t})}function er(e,t,i){if(e&&(0,M.isContextAvailable)(t))return t.serviceManager.maybeCall(d.ServiceName.ManifestService,function(t){return t.getRepresentationById(e)},void 0,i.sourceIdentifier)}t.SegmentController=function(){function e(e,t,i,n,r,a,s,u){var c=this;if(this.context=e,this.mimeType=i,this.manifestLoader=a,this.Rc=R.ModuleManager.get(_.ModuleName.HLS,!1),this.Xc={},this.Yc=[],this.hasDownloadError=!1,this.ec=!1,this.jc=!1,this.kc=!1,this.Ed=[],this.Ud=function(e){if((0,M.isContextAvailable)(c.context)){var t="Error obtaining ".concat(c.mimeType," segment info");c.ac&&c.ac===e?c.Fd.insane(t,e):c.td(t,e),c.ac=e}},this.ad=function(e){c.td("Error in cancelLoading of segmentLoaderPool ",e)},this.getNext=function(e,t){var i,n=!(null==(i=c.Id)?void 0:i.canLoad())||c.gc||c.hasActiveTransmuxingJobs()||c.kc||c.zd();if(c.Vc&&!n){c.td("Getting next segment for time ".concat(e));var r={periodId:c.dc,recommendedRepresentationId:t,time:e};c.Rd(r).then(function(e){return c.rd(e)}).catch(c.Ud)}},this.ld=function(e){c.hasDownloadError=!1,c.gd(e);var t=c.hd(e);if(t!==o.SegmentVerificationResult.Drop){if(t!==o.SegmentVerificationResult.Park)if(c.isTransmuxerRequired()){var i=e.getSegmentInfo();i.presentationTimeOffset&&isNaN(i.presentationTimeOffset)&&(c.Uc.setTimestampOffset(0),i.presentationTimeOffset=0),c.fd(e)}else{var n=!1;c.Vc&&c.Id&&(n=c.bc.onSegmentAvailable(e,{id3:[],closedCaptions:[]},c.Vc,c.Id)),n||et(e.getSegmentInfo(),c.sc),e.getMimeType().indexOf("mp4")>-1&&!c.be()&&(c.Zc=e.isLastSegment())}}else et(e.getSegmentInfo(),c.sc)},this.Ue=function(e,t){var i,n=!!(null==(i=c.pc)?void 0:i.shouldDownloadBeCancelled(c.mimeType,e,t));return c.be()&&c.oc.possiblyDependentSegments&&n?(c.td("Download should be cancelled, but this is disabled for segments not starting with key frames"),!1):n},this.rc=e.sourceContext,this.dc=s,this.sc=u,this.tc=function(e){return t(e,c.rc)},this.Sc=e.serviceManager.get(d.ServiceName.ManifestUpdateSchedulingService,this.rc.sourceIdentifier),this.hc=new N.SegmentUnavailabilityHandler(this.context),this.pc=this.context.serviceManager.get(d.ServiceName.AdaptationService),this.qc=this.context.serviceManager.get(d.ServiceName.StreamTimeService),this.oc={isTransmuxingRequired:r&&!this.Jd,transmuxer:void 0,possiblyDependentSegments:!1,isAvMuxedTogether:(0,I.isAVMuxedTogether)(n),discardNextSegment:!1,muxedAudioTrackIndex:0},this.qd()){var l=this.pd();this.oc.isTransmuxingRequired=l.source!==l.target}this.Ye()}return Object.defineProperty(e.prototype,"Fd",{get:function(){return this.context.logger},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Gd",{get:function(){return this.context.settings},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Hd",{get:function(){return this.context.eventHandler},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Id",{get:function(){return ei(this.context,this.rc,this.mimeType,this.Tc,this.oc,this.lc)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Jd",{get:function(){return P.MimeTypeHelper.isSubtitle(this.mimeType)},enumerable:!1,configurable:!0}),e.prototype.Kd=function(e){var t,i=this.Ld();if(i){var n=null==(t=this.pc)?void 0:t.getUserSelectedRepresentation(this.mimeType,this.Vc,e);return n?(this.Hd.dispatchEvent(i,{representationID:n._internalId.representationId}),n._internalId):void this.Hd.dispatchEvent(i,{representationID:e.representationId})}},e.prototype.Ld=function(){return P.MimeTypeHelper.isAudio(this.mimeType)?h.PlayerEvent.AudioAdaptation:P.MimeTypeHelper.isVideo(this.mimeType)?h.PlayerEvent.VideoAdaptation:null},e.prototype.Md=function(){var e;if(null==(e=this.context.segmentCacheService)?void 0:e.hasPrefetchedSegment(this.mimeType,this.fc,this.rc))return this.context.segmentCacheService.getRepresentationForPrefetchedSegment(this.mimeType,this.rc)},e.prototype.Nd=function(e){if(!this.Uc.canSwitchRepresentation(e.time)&&this.Wc)return this.Wc;var t=this.Md();if(t)return t;var i=this.sc.getState(),n=!!i&&!!(0,m.getPreferredBitrate)((0,m.getAdaptationState)(i),this.mimeType),r=this.Od(),o=e.recommendedRepresentationId,a=(null==o?void 0:o.periodId)===this.getCurrentPeriodId();o&&a&&!n&&(r=o);var s=r?this.Kd(r):void 0;return s?(this.jc=!0,s):r},e.prototype.Od=function(){var e,t,i={hlsDependentSegments:this.oc.possiblyDependentSegments,segmentDuration:this.Uc.getSegmentDuration()};return null==(e=this.pc)?void 0:e.selectRepresentation(this.mimeType,i,null==(t=this.getCurrentAdaptationSet())?void 0:t.Representation)},e.prototype.Pd=function(e){var t=this.Wc?this.Wc.representationId:null;this.td("switching representation from ".concat(t," to ").concat(e.representationId)),this.Uc.setRepresentationId(e),this.Wc=e},e.prototype.invalidateOngoingRequests=function(){this.ec=!0},e.prototype.Qd=function(e,t){var i,n=er(e,this.context,this.rc),r=er(t,this.context,this.rc),o=n?(0,L.representationToQuality)(n,this.mimeType):void 0,a=r?(0,L.representationToQuality)(r,this.mimeType):void 0;if(a){var s={targetQuality:a,targetQualityId:a.id,sourceQuality:o,sourceQualityId:null!=(i=null==o?void 0:o.id)?i:null};P.MimeTypeHelper.isVideo(this.mimeType)?this.context.eventHandler.dispatchEvent(h.PlayerEvent.VideoDownloadQualityChange,s):P.MimeTypeHelper.isAudio(this.mimeType)&&this.context.eventHandler.dispatchEvent(h.PlayerEvent.AudioDownloadQualityChange,s)}},e.prototype.Rd=function(e){var t,i=this,r=void 0!==(null==(t=this.fc)?void 0:t.segmentNumber)?this.fc.segmentNumber+1:0,o=this.Nd(e),u=!o.equals(this.Wc);return u&&P.MimeTypeHelper.isAV(this.mimeType)&&this.Qd(this.Wc,o),this.ec=!1,this.gc=this.Yd(o).then(function(){return i.Vc&&i.Uc.setAdaptationSetId(i.Vc,o),u&&i.Pd(o),i.Uc.updateRepresentation(o)}).then(function(){return i.Uc.getNextSegmentInfo(e.time)}).then(function(e){var t,a=null!=(t=i.Wc)?t:o;if(i.Vd(e,r,a),i.Sd(e))throw(0,M.isContextAvailable)(i.context)&&i.td("invalidating ongoing SegmentInfo request for",n({}
1,e)),"ongoing segment info request was invalidated";return i.fc=e,e}).catch(function(t){if(i.gc=void 0,t instanceof s.PlayerError?[a.ErrorCode.SOURCE_MANIFEST_INVALID,a.ErrorCode.SOURCE_COULD_NOT_LOAD_MANIFEST,a.ErrorCode.NETWORK_ERROR,a.ErrorCode.NETWORK_SEGMENT_DOWNLOAD_TIMEOUT].includes(t.code):t===f.RequestError.Failed||t===f.RequestError.TimedOut){var r,u,c=null!=(u=null!=(r=null==t?void 0:t.name)?r:null==t?void 0:t.message)?u:t;i.td("Loading failed for representation ".concat(o.representationId," (").concat(c,")"));var d=i.Oe(o);if(d)return i.td("Trying with lower quality representation ".concat(d.representationId)),i.Rd(n(n({},e),{recommendedRepresentationId:d}));i.Pe(o,t)}throw t}).finally(function(){i.ic=void 0}),this.gc},e.prototype.Sd=function(e){return this.ec&&e&&!e.isInitSegment&&!this.Td(e)},e.prototype.Td=function(e){return void 0!==this.ic&&(0,A.isNumber)(e.startTime)&&(0,A.isNumber)(e.duration)&&this.ic>=e.startTime&&this.ic<=e.startTime+e.duration},e.prototype.getDataSegmentInfo=function(e){var t={periodId:this.dc,time:e};return this.Wc&&this.Wc.periodId===this.getCurrentPeriodId()?this.Rd(n(n({},t),{recommendedRepresentationId:this.Wc})):this.Rd(t)},e.prototype.Vd=function(e,t,i){e&&(this.Wd(e,i),this.Xd(e),(0,V.applyBaseUrlsToSegmentInfo)(this.context,this.rc,i,e,this.fc),e.duration||e.isInitSegment||(e.duration=this.Uc.getSegmentDuration()),(void 0===e.segmentNumber||isNaN(e.segmentNumber))&&(e.segmentNumber=t),e.discardData=this.oc.discardNextSegment,this.oc.discardNextSegment=!1,this.jc&&(e.preventDownloadCanceling=!0,this.jc=!1))},e.prototype.Wd=function(e,t){var i=er(t,this.context,this.rc);i&&(e.representationId=t.representationId,e.internalRepresentationId=t,e.mimeType=this.mimeType,e.bitrate=i._bandwidth,e.periodId=t.periodId,e.codecs=this.getCodecs(),P.MimeTypeHelper.isAudio(this.mimeType)?(e.sampleRate=i._audioSamplingRate,e.width=void 0,e.height=void 0):P.MimeTypeHelper.isVideo(this.mimeType)&&(e.width=i._width,e.height=i._height,e.frameRate=i._frameRate))},e.prototype.Xd=function(e){if(P.MimeTypeHelper.isVideo(this.mimeType)&&!e.dateTime&&this.Gd.AKAMAI_DATETIME_PARSING&&this.Rc){var t=null!=e.duration?this.Rc.PlaylistUtils.getProgramDateTimeFromSegmentUrl(e.url,e.duration):void 0;t&&(e.dateTime=t)}},e.prototype.Yd=function(e){var t,i,n,r,o=null!=(i=null==(t=this.Vc)?void 0:t.adaptationSetId)?i:"",a=null==(n=this.sc.getState().activeTracks)?void 0:n[o],s=!(null==(r=null==a?void 0:a.selectedRepresentationId)?void 0:r.equals(e));return this.sc.dispatch((0,w.setRepresentationIdAction)(e)),s?this.Sc?this.Sc.waitForRepUpdate(e):Promise.reject("ManifestUpdateScheduler does not exist."):Promise.resolve()},e.prototype.Zd=function(){var e;return this.isTransmuxerRequired()&&!!(null==(e=this.oc.transmuxer)?void 0:e.isTransmuxing())},e.prototype.hasActiveTransmuxingJobs=function(){var e;return!!this.isTransmuxerRequired()&&(this.hasDelayedSegmentsInTransmuxer()||!!(null==(e=this.oc.transmuxer)?void 0:e.hasActiveJobs()))},e.prototype.hasDelayedSegmentsInTransmuxer=function(){var e;return P.MimeTypeHelper.isAudio(this.mimeType)&&this.isTransmuxerRequired()&&!!(null==(e=this.oc.transmuxer)?void 0:e.hasDelayedAudioSegments())},e.prototype.bd=function(){var e,t,i=this;(null!=(t=null==(e=this.oc.transmuxer)?void 0:e.discardCurrentJobs(this.mimeType))?t:[]).forEach(function(e){return et(e.mp2tsSegment.getSegmentInfo(),i.sc)})},e.prototype.cancelLoading=function(){var e,t;return this.ec=!0,null!=(t=null==(e=this.Id)?void 0:e.cancel().catch(this.ad))?t:Promise.resolve()},e.prototype.seekTo=function(e){var t=this;null!==e&&this.Vc&&(this.cancelLoading(),this.bd(),this.Yc=[],this.hasDownloadError=!1,this.Zc=!1,this.nc&&this.nc.reset(),this.isTransmuxerRequired()&&this.oc.transmuxer&&this.oc.transmuxer.resetCaptionParser(),e>=0&&(this.ic=e,this.Uc.seekTo(e),this.context.serviceManager.maybeCall(
vendor: 1,064 bytes, line 1
1d.ServiceName.TimedMetadataService,function(e){return e.clearSegmentBoundMetadata(t.mimeType)})))},e.prototype.cd=function(e){var t,i=this,n=this.ee(this.dc),r=this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(e){return e.getMediaPresentationDuration()},0,this.rc.sourceIdentifier);if(n&&n.hasOwnProperty("_duration"))t=this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(e){return e.getPeriodDuration(i.dc)},void 0,this.rc.sourceIdentifier);else{if(0===r)return!1;t=r}return this.Uc.hasNext(t)},e.prototype.dd=function(e){var t=this;if(this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(e){return e.isAvailabilityEndTimeExceeded()},!1,this.rc.sourceIdentifier))return this.Fd.log("Stream (".concat(this.mimeType,") availability end time reached, stopping download of further segments.")),this.Zc=!0,!1;this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(e){return e.isLastPeriod(t.dc)},!1,this.rc.sourceIdentifier)&&this.Uc.resolvePendingSegmentInfoRequests();
1var i=this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(e){return e.getPeriodDuration(t.dc)},void 0,this.rc.sourceIdentifier);return this.Uc.hasNext(i)},e.prototype.hasNext=function(e){var t=this,i=this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(e){return e.isLastPeriod(t.dc)},!1,this.rc.sourceIdentifier);return!(this.Zc&&i||!this.Vc||!this.Uc)&&(this.de()?this.dd(e):this.cd(e))},e.prototype.ed=function(e){var t=this;if(e.transmuxedSegments.every(function(e){return null!==e.getCodec()})){!this.oc.possiblyDependentSegments&&e.transmuxedSegments.some(function(e){return P.MimeTypeHelper.isAV(e.getMimeType())&&!e.isIndependentlyDecodable()})&&(this.td("Encountered HLS segment not starting with a key frame"),this.oc.possiblyDependentSegments=!0);var i=e.transmuxedSegments.find(function(e){return"video/mp4"===e.getMimeType()}),n=e.transmuxedSegments.filter(function(e){return"audio/mp4"===e.getMimeType()}),r=[i,n[this.oc.muxedAudioTrackIndex]||n[0]].filter(function(e){return!!e});r.forEach(function(e){return t.cc.maybeAdjustTimestampOffsetAtDiscontinuityChange(e,t.Uc)}),this.Id&&this.Vc&&this.bc.onMuxedSegmentAvailable(e,r,this.Vc,this.Id);var o=r[r.length-1];o&&o.getMimeType().indexOf("mp4")>-1&&(this.Zc=o.isLastSegment()),this.td("Transmuxing done",e.originalSegment.getUrl())}else{var a=e.originalSegment.getUrl();this.td("Discarding muxing because codecs were not available in the segment: ".concat(a))}},e.prototype.hasPendingSegments=function(e){var t,i,n,r,o,a;return e?(o=this.isTransmuxerRequired()&&!!this.oc.transmuxer&&this.oc.transmuxer.isTransmuxingSegmentsForPeriod(e),a=null!=(i=null==(t=this.Id)?void 0:t.isLoading(e))&&i):(o=this.Zd(),a=null!=(r=null==(n=this.Id)?void 0:n.isLoading())&&r),a||o||this.kc||!!this.gc},e.prototype.fd=function(e){var t=this;if(this.oc.transmuxer){var i=e.getSegmentInfo();this.oc.transmuxer.isSetupForDiscontinuity(i.discontinuitySequenceNumber)||(void 0===i.startTime&&(this.td("resetting segment playback times for new initialization"),this.sc.dispatch((0,H.resetSegmentPlaybackTimes)())),(0,K.initializeHlsSegmentStartTimes)(e,this.context,this.Uc));var n=Date.now();this.oc.transmuxer.transmuxSegment(e).then(function(e){var r,o=(0,E.toSeconds)(Date.now()-n),a={time:o,representationId:i.internalRepresentationId};return t.context.store.dispatch((0,v.addMetricsValue)(t.mimeType,S.MetricType.TransmuxingTime,a)),t.context.logger.debug("Transmuxed ".concat(t.mimeType," segment in: ").concat(null==o?void 0:o.toFixed(2),", quality: ").concat(null!=(r=i.representationId)?r:"")),t.ed(e)}).catch(function(i){et(e.getSegmentInfo(),t.sc),i!==o.TransmuxingRejectionReason.TRANSMUXING_ABORTED?t.od(e,"Transmuxing failed: ".concat(i)):t.td(i,e.getUrl())})}},e.prototype.gd=function(e){var t;
1if(!this.qd()||this.md(e)){var i=(0,q.resolveContainerFormat)(this.mimeType,e,this.be());this.td("Container format is ".concat(null==i?void 0:i.source)),i&&this.sc.dispatch((0,w.setContainerFormatAction)(e.getRepresentationId(),i)),this.oc.isTransmuxingRequired=!!(i&&i.source!==i.target),!this.oc.isTransmuxingRequired&&P.MimeTypeHelper.isAV(this.mimeType)&&(null==(t=this.oc.transmuxer)||t.dispose(),this.context.serviceManager.maybeCall(d.ServiceName.SubtitleService,function(e){e.setTransmuxer(void 0)},void 0,this.rc.sourceIdentifier))}},e.prototype.hd=function(e){if(this.md(e))return this.td("Warning: Loaded segment has size 0 bytes, skipping further processing! May cause gap!",e.getUrl()),null==(t=this.nc)||t.reset(),o.SegmentVerificationResult.Drop;if(this.isTransmuxerRequired()){if(!R.ModuleManager.has(_.ModuleName.ContainerTS))return this.context.eventHandler.fireError(new B.PlayerModuleMissingError(_.ModuleName.ContainerTS)),o.SegmentVerificationResult.Drop}else if(!this.ce()&&this.nd(e)){if(this.context.settings.DROP_INVALID_SEGMENTS)return this.od(e,"The loaded MP4 segment is invalid, skipping further processing! May cause gap!"),o.SegmentVerificationResult.Drop;this.od(e,"The loaded MP4 segment is invalid. This may cause playback issues!")}var t,i=R.ModuleManager.get(_.ModuleName.LowLatency,!1),n=this.context.serviceManager.get(d.ServiceName.ManifestService,this.rc.sourceIdentifier);if((0,j.isPlayingLowLatencyHls)(this.context)&&i&&n){var r=i.verifyLlHlsSegment(e,n);if(r===o.SegmentVerificationResult.Drop)return this.td("LL-HLS Segment Verification: Dropping (partial) segment as it disappeared from playlist",e.getUrl()),o.SegmentVerificationResult.Drop;if(r===o.SegmentVerificationResult.Park)return this.jd(e),o.SegmentVerificationResult.Park}return o.SegmentVerificationResult.Publish},e.prototype.jd=function(e){var t=this,i=(0,b.subscribe)(this.sc)(function(t){var i;if(t.manifest)return null==(i=(0,C.findRepresentation)(t.manifest,e.getRepresentationId()))?void 0:i._requestTimestamp},function(){i(),t.kd(i),t.ld(e)},function(e,t){return e!==t});this.Ed.push(i)},e.prototype.kd=function(e){var t=this.Ed.findIndex(function(t){return t===e});t>-1&&this.Ed.splice(t,1)},e.prototype.md=function(e){var t=e.getData();return!!(t&&t.byteLength<1)},e.prototype.nd=function(e){if(!R.ModuleManager.has(_.ModuleName.ContainerMP4)||!P.MimeTypeHelper.isAV(this.mimeType))return!1;var t=R.ModuleManager.get(_.ModuleName.ContainerMP4,!1),i=t.isValidMp4,n=t.MP4Parser;return this.Tc instanceof n&&!i(e)},e.prototype.od=function(e,t){this.Hd.dispatchEvent(h.PlayerEvent.Warning,new u.PlayerWarning(c.WarningCode.PLAYBACK_INVALID_DATA_SEGMENT_ENCOUNTERED,t,{mimeType:e.getMimeType(),segmentUrl:e.getUrl()}))},e.prototype.pd=function(){var e=this.sc.getState();return e&&(0,F.getContainerFormat)(e,P.MimeTypeHelper.getMediaType(this.mimeType))},e.prototype.qd=function(){return!!this.pd()},e.prototype.rd=function(e){var t=this;return this.gc=void 0,this.kc=!0,e?(this.Yc.push(e),this.ac=void 0,this.sd(e),this.ud(e).catch(function(i){return t.xd(i,e)}).finally(function(){return t.kc=!1})):Promise.resolve()},e.prototype.sd=function(e){var t=this.getInitSegmentInfoForDataSegmentInfo(e);t&&(e.init=t)},e.prototype.td=function(e){for(var t,i,n,o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];(null==(i=this.Fd)?void 0:i.isLevelEnabled(p.LogLevel.DEBUG))&&(t=this.Fd).debug.apply(t,r(["[".concat(this.mimeType,"][").concat(null==(n=this.Wc)?void 0:n.representationId,"] SegmentController: ").concat(e)],o,!1))},e.prototype.ud=function(e){var t;return(null==(t=this.Fd)?void 0:t.isLevelEnabled(p.LogLevel.DEBUG))&&this.td("Loading ".concat(JSON.stringify(e))),this.vd(e)},e.prototype.getInitSegmentInfoForDataSegmentInfo=function(e){var t;return(t=e.init?n(n({},e.init),{isInitSegment:!0,internalRepresentationId:e.internalRepresentationId}):this.Uc.getInitSegmentInfo(e.internalRepresentationId))&&this.Vd(t,void 0,e.internalRepresentationId),t},e.prototype.vd=function(e){var t=this;return this.Id?this.Id.getSegment(e).then(function(e){return t.wd(e)}):Promise.reject()},e.prototype.wd=function(e){var t=this;return new Promise(function(i,n){e.transform(function(e){var i,n,r;i=e.getSegmentInfo(),(r=(n=t.Yc).findIndex(function(e){return(0,z.areSegmentsIdentical)(e,i)}))>-1&&n.splice(r,1),t.ld(e)},function(){return i()},function(e){var i=e.message,r={reason:i};return n(r),r.reason!==J.SegmentLoadingErrorReason.CANCEL&&t.td("Error loading segment",i),i})})},e.prototype.xd=function(e,t){null==(i=(0,T.getSourceStore)(this.context))||i.dispatch((0,g.clearPreferredBitrateForMimeTypeAction)(this.mimeType)),et(t,this.sc);var i,n=(null==e?void 0:e.info)?e.info.response.status:0;switch(null==e?void 0:e.reason){case J.SegmentLoadingErrorReason.CANCEL:this.td("Download was cancelled as the segment is probably outdated");break;case J.SegmentLoadingErrorReason.ERROR_DECRYPTING:this.td("Could not decrypt segment",t.url),this.Hd.dispatchEvent(h.PlayerEvent.Warning,new u.PlayerWarning(c.WarningCode.DRM_COULD_NOT_DECRYPT_SEGMENT));break;case J.SegmentLoadingErrorReason.ERROR_LOADING:this.Bd(n,t,J.SegmentLoadingErrorReason.ERROR_LOADING);break;case J.SegmentLoadingErrorReason.TIMEOUT:this.Bd(n,t,J.SegmentLoadingErrorReason.TIMEOUT);break;case J.SegmentLoadingErrorReason.ABR_TIMEOUT:this.Te(t);break;default:this.td("Unexpected error while loading the segment",{url:t.url,error:e})}},e.prototype.yd=function(e,t){var i=this;return this.Rc&&this.manifestLoader instanceof this.Rc.M3u8Loader?this.manifestLoader.switchToBackupStream(e,t).then(function(e){return e.length>0}
1).catch(function(e){return i.td("Could not switch to HLS backup stream: ".concat(e)),Promise.resolve(!1)}):Promise.resolve(!1)},e.prototype.zd=function(){return!!(this.Rc&&this.manifestLoader instanceof this.Rc.M3u8Loader)&&this.manifestLoader.isSwitchingToBackupStreams()},e.prototype.Ad=function(){var e=this.Gd.CHUNKED_CMAF_STREAMING?1:this.Yc.length;return this.Uc.getIndex()-e},e.prototype.Bd=function(e,t,i){(null==t?void 0:t.isPreloadHint)?this.td("Ignoring download error of preload hint segment.",t.url):(this.td("Failed to load segment (code: ".concat(e,") ").concat(t.url)),this.hc.shouldTryAlternatives(e)?this.Cd(t,e,i):(this.Re(t),this.hasDownloadError=!0))},e.prototype.Cd=function(e,t,i){var n=this;if(this.Wc&&this.Wc.equals(e.internalRepresentationId)){var r=this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(e){return n.Vc&&e.getRepresentation(n.Vc,n.Wc.representationId)},null,this.rc.sourceIdentifier);if(r){var o=!1;this.yd(r,e).then(function(e){return o=e}).then(function(){var e;return null==(e=n.Id)?void 0:e.cancel()}).then(function(){return n.Dd(o,e,t,i)})}}else this.td("Ignoring download error of previous representation.")},e.prototype.Dd=function(e,t,i,n){var r,o=this.Ad();if(this.Yc=[],e)this.Uc.setIndex(Math.max(0,o));else if(r=this.hc.switchBaseURL(t))this.context.logger.debug("Switching ".concat(this.mimeType," segment location to ").concat(r.baseURL)),this.rd(r);else{var a=this.Oe(this.Wc);if(a){if(this.qc){this.Uc.setIndex(Math.max(0,o)),this.td("Trying with lower quality segment ".concat(a.representationId));var s=this.qc.getTimeForNextSegment((0,Z.getTrackIdentifier)(t)),u=this.Uc.getLatestTimeForPossibleSwitch(s);this.getNext(u,a)}}else this.hasDownloadError=!0,this.Qe(t,i,n)}},e.prototype.Oe=function(e){var t,i,n;if(e&&(null==(t=this.pc)?void 0:t.isAuto(this.mimeType))){var r=null!=(n=null==(i=this.fe(this.Vc))?void 0:i.Representation)?n:[];return this.hc.switchQuality(r,e)}},e.prototype.Pe=function(e,t){var i;if(this.de()&&this.Gd.INFINITE_RETRIES_FOR_LIVE){this.td("Could not load any segment of any quality from any CDN: restart retries."),this.hc.downloadSuccess(!1);var n=er(this.Wc,this.context,this.rc);n&&(this.sc.dispatch((0,H.updateRepresentationFailedDownloadAction)(n._internalId,null)),null==(i=this.Sc)||i.scheduleRepresentationUpdate(n))}else{var r=er(e,this.context,this.rc);(0,W.throwRepresentationDownloadError)(this.context,"Could not load segments of any quality from any CDN",r,t)}},e.prototype.Qe=function(e,t,i){this.Re(e),this.de()&&this.Gd.INFINITE_RETRIES_FOR_LIVE?(this.td("Could not load current segment of any quality from any CDN (all retries failed), skipping it..."),this.Se(e)):(0,Q.throwDownloadError)(this.context,"Segment not available at any quality or location",t,e,i)},e.prototype.Re=function(e){var t,i=(0,X.getSegmentInfoTimeRange)(e);if(i&&(0,M.isContextAvailable)(this.context)&&e.mimeType){var n=(0,Z.getTrackIdentifier)(e);null==(t=(0,T.getSourceStore)(this.context))||t.dispatch((0,G.addStreamTimeRange)(n,i,Z.StreamTimeRangeType.Failed))}},e.prototype.Se=function(e){if(this.hc.downloadSuccess(!1),e.hasDownloadFailed=!0,null!=e.startTime&&null!=e.duration){var t=e.startTime+e.duration,i=this.Uc.adjustTimeToNextSegmentStart(t);this.getNext(i)}},e.prototype.Te=function(e){var t,i=this;(0,M.isContextAvailable)(this.context)&&(this.td("Download took too long, cancelled it",e.url),!e.isInitSegment&&this.Uc&&(null==(t=this.Id)||t.cancel().then(function(){if(i.Uc){var e=i.Ad();i.Yc=[],i.td("Trying to get the same segment with a lower bitrate."),i.Uc.setIndex(Math.max(0,e))}})))},e.prototype.Ve=function(e,t,i){var n=this;if(void 0===i&&(i=!1),this.Jd&&!(null==t?void 0:t.id))return this.lc=t,void(this.Id&&this.cancelLoading());
1var r=this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(r){return r.findAdaptationSet(e,n.mimeType,t,i)},null,this.rc.sourceIdentifier);return r?(this.lc=this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(e){return e.getLangObjectFromAdaptationSet(r,n.mimeType)},void 0,this.rc.sourceIdentifier),r._internalId):void 0},e.prototype.getCurrentAdaptationSet=function(){return this.fe(this.Vc)},e.prototype.getAdaptationSetForPeriodId=function(e){return this.fe(this.Xc[e])||this.getCurrentAdaptationSet()},e.prototype.updateMpd=function(){this.td("Caught a manifest update event");var e,t,i=!this.ee(this.dc),n=this.Vc;this.Vc=this.Ve(this.dc,this.lc,!1),!i&&this.Vc&&(this.Xc[this.dc]=this.Vc,null==(e=this.pc)||e.setAdaptationSetId(this.mimeType,this.Vc),this.Uc.setAdaptationSetId(this.Vc,this.Wc,{isPeriodSwitch:!1,isManifestUpdate:!0}));var r=this.Vc&&!this.Vc.equals(n);for(var o in r&&P.MimeTypeHelper.isAV(this.mimeType)&&(null==(t=this.context.renderer)||t.storeDrmInitDataFromManifest(this.getCurrentAdaptationSet())),this.Xc)this.ee(o)||delete this.Xc[o]},e.prototype.activateSubtitleSegmentController=function(e){var t;this.Jd&&(this.Vc&&(this.Uc.setAdaptationSetId(this.Vc),null==(t=this.pc)||t.setAdaptationSetId(this.mimeType,this.Vc)),isNaN(this.Uc.getTimestampOffset())&&this.Uc.setTimestampOffset(0),this.seekTo(e))},e.prototype.setCurrentLangObj=function(e){var t;if(this.oc.isAvMuxedTogether&&P.MimeTypeHelper.isVideo(this.mimeType)){var i=this.fe(this.Vc);if(null==i?void 0:i.ContentComponent){var n=i.ContentComponent.find(function(t){return"audio"===t._contentType&&t._id===e.id});if(n)return this.oc.muxedAudioTrackIndex=i.ContentComponent.filter(function(e){return"audio"===e._contentType}).indexOf(n),void(this.lc=e)}}e.id!==(null==(t=this.lc)?void 0:t.id)&&this.We(e)},e.prototype.We=function(e){var t,i=this.Vc;if(this.Vc&&this.sc.dispatch((0,w.removeActiveTrackAction)(this.Vc)),this.Vc=this.Ve(this.dc,e),this.Vc){var n=this.fe(this.Vc);n&&this.sc.dispatch((0,w.setMediaTypeAction)(n._internalId,(0,k.resolveMediaTypes)(n))),P.MimeTypeHelper.isAV(this.mimeType)&&(null==(t=this.context.renderer)||t.storeDrmInitDataFromManifest(n)),this.Xc[this.dc]=this.Vc,i&&!this.Vc.equals(i)&&this.Xe(e)}},e.prototype.Xe=function(e){var t,i;this.lc=e,this.mc=e,this.td("Trying to set language to ID ".concat(this.lc.id)+" (lang: ".concat(this.lc.lang,") for mpd handler and adaption handler")),this.Vc&&(this.Uc.setAdaptationSetId(this.Vc),null==(t=this.pc)||t.setAdaptationSetId(this.mimeType,this.Vc),null==(i=this.pc)||i.selectRepresentation(this.mimeType))},e.prototype.getCurrentLangObj=function(){return this.lc},e.prototype.stop=function(){var e,t;return this.bd(),null==(e=this.Id)||e.clearCache(),null==(t=this.pc)||t.shutdown(this.mimeType),this.cancelLoading()},e.prototype.Ye=function(){var e,t=this,i=this.context.serviceManager.maybeCall(
vendor: 1,226 bytes, line 1
1d.ServiceName.ManifestService,function(e){return e.getFirstPeriod()},void 0,this.rc.sourceIdentifier);!this.dc&&i&&(this.dc=i._id);var n=this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(e){return e.hasAdaptationSets(t.dc)?e.findAdaptationSet(t.dc,t.mimeType):void 0},void 0,this.rc.sourceIdentifier),r=Y.MPDHandlerFactory.createInstance(this.context,this.rc,this.mimeType,n);if(r){this.Uc=r;var o,u=en(this.mimeType);u&&(o=(0,x.createSegmentParser)(this.context,u)),o?this.Tc=o:this.td("Could not create segment parser for mime type"),this.cc=new ee.TimestampOffsetService(this.context,this.mimeType),this.bc=new $.SegmentPreProcessor(this.context,this.mimeType,this.tc,this.oc,this.hc,this.cc,this.Tc),this.bc.setMpdHandler(this.Uc),this.hasDownloadError=!1,this.Vc=this.Ve(this.dc,this.lc),this.Vc&&(this.Xc[this.dc]=this.Vc),this.context.serviceManager.maybeCall(d.ServiceName.SegmentService,function(e){return e.add({mimeType:t.mimeType,shouldDownloadBeCancelledCallback:t.Ue},t.Tc,t.lc)}),this.be()&&(this.nc=new this.Rc.HlsTimelineTracker(this.context,this.Gd.GAP_TOLERANCE),this.bc.setHlsTimelineTracker(this.nc)),P.MimeTypeHelper.isMP4(this.mimeType)&&this.context.serviceManager.maybeCall(
1d.ServiceName.SubtitleService,function(e){e.setupCea608CaptionExtractor(t.context.logger)},void 0,this.rc.sourceIdentifier),this.Vc&&(null==(e=this.pc)||e.setAdaptationSetId(this.mimeType,this.Vc),this.Uc.setAdaptationSetId(this.Vc,void 0,{isPeriodSwitch:!0}),this.de()&&!this.Gd.ENABLE_SEEK_FOR_LIVE&&this.Uc.timeShift(0,this.dc)),this.Zc=!1}else this.Hd.fireError(new s.PlayerError(a.ErrorCode.SOURCE_MANIFEST_INVALID,void 0,"Could not create an MPD handler for the given source.",this.rc.sourceIdentifier))},e.prototype.getSegmentInfos=function(){var e,t=this,i=null==(e=this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(e){return e.getAvailableBaseURLsForRepresentation(t.Wc)},null,this.rc.sourceIdentifier))?void 0:e[0];return this.Uc.getSegmentInfos(i)},e.prototype.getCurrentPeriodId=function(){return this.dc},e.prototype.Ze=function(e){var t=this;return this.mc&&this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(i){return i.isLanguageAvailable(e,t.mimeType,t.mc)},!1,this.rc.sourceIdentifier)?this.mc:this.lc},e.prototype.switchPeriod=function(e){var t,i,n,r,o=this,u=this.Ze(e);if(this.td("switching period from ".concat(this.dc," to ").concat(e)),this.cancelLoading(),null==(t=this.Id)||t.clearCache(),this.ae(),this.dc=e,this.Wc=void 0,this.Vc=this.Ve(e,u,!0),this.Vc&&(this.Xc[e]=this.Vc),this.Vc){null==(i=this.pc)||i.setAdaptationSetId(this.mimeType,this.Vc);var c=this.Uc.getPendingSegmentInfoRequest(),l=null!=(n=this.fe(this.Vc))?n:void 0,h=Y.MPDHandlerFactory.createInstance(this.context,this.rc,this.mimeType,l);h?(this.Uc.dispose(),this.Uc=h):this.Hd.fireError(new s.PlayerError(a.ErrorCode.SOURCE_MANIFEST_INVALID)),this.bc.setMpdHandler(this.Uc),this.Uc.setPendingSegmentInfoRequest(c),this.Uc.setAdaptationSetId(this.Vc,void 0,{isPeriodSwitch:!0})}if(this.isTransmuxerRequired()){var p=this.context.serviceManager.maybeCall(
1d.ServiceName.ManifestService,function(e){return o.Vc&&e.findDownloadedHlsRepresentation(o.Vc)},null,this.rc.sourceIdentifier);p&&this.Uc.setRepresentationId(p._internalId),this.nc&&this.nc.reset(),null==(r=this.Id)||r.clearCache(!1)}this.hasDownloadError=!1,this.Zc=!1},e.prototype.getMPDHandler=function(){return this.Uc},e.prototype.getIndex=function(){return this.Uc&&this.Uc.getIndex()||0},e.prototype.getSourceBufferTypes=function(){var e=[];return this.isTransmuxerRequired()&&this.oc.isAvMuxedTogether?(e.push("video/mp4"),e.push("audio/mp4")):e.push(this.mimeType),e},e.prototype.getCodecs=function(){var e,t=this.getCurrentAdaptationSet();return null!=(e=t&&(0,O.getCodecsFromAdaptationSet)(t))?e:void 0},e.prototype.getLiveEdgeTime=function(){return this.de()?this.Uc.getLiveEdgeTime():-1},e.prototype.setAdaptionLogicStartupPhase=function(){var e;null==(e=this.pc)||e.setStartupPhase(this.mimeType)},e.prototype.getMimeType=function(){return this.mimeType},e.prototype.ae=function(){var e=this,t=this.context.store.getState(),i=t?(0,y.getMetricsState)(t):void 0;if(this.Id&&i){var n=this.sc.getState(),r=n?(0,U.getPlayingPeriodId)(n):void 0;this.Id.removeCachedInitSegments(function(t){return e.context.serviceManager.maybeCall(
1d.ServiceName.ManifestService,function(e){return e.isPrecedingPeriod(r,t.getPeriodId())},!1,e.rc.sourceIdentifier)}),((0,y.getMetricsHistory)(i,this.mimeType,S.MetricType.CachedInitSegments)||[]).filter(function(t){var i=t.value.internalRepId.periodId;return e.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(e){return e.isPrecedingPeriod(r,i)},!1,e.rc.sourceIdentifier)}).forEach(function(t){return e.context.store.dispatch((0,v.removeMetricsValue)(e.mimeType,S.MetricType.CachedInitSegments,t))})}},e.prototype.canLoad=function(){var e;return!!(null==(e=this.Id)?void 0:e.canLoad())},e.prototype.isTransmuxerRequired=function(){return this.oc.isTransmuxingRequired},e.prototype.setTransmuxer=function(e){this.oc.transmuxer=e},e.prototype.getTransmuxer=function(){return this.oc.transmuxer},e.prototype.resetTransmuxer=function(){this.oc.transmuxer&&this.oc.transmuxer.reset()},e.prototype.be=function(){return this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(e){return e.isHlsManifest()},!1,this.rc.sourceIdentifier)},e.prototype.ce=function(){return this.context.serviceManager.maybeCall(
1d.ServiceName.ManifestService,function(e){return e.isSmoothManifest()},!1,this.rc.sourceIdentifier)},e.prototype.de=function(){return this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(e){return e.isLive()},!1,this.rc.sourceIdentifier)},e.prototype.ee=function(e){return this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(t){return t.findPeriod(e)},null,this.rc.sourceIdentifier)},e.prototype.fe=function(e){return this.context.serviceManager.maybeCall(d.ServiceName.ManifestService,function(t){return t.getAdaptationSet(e)},null,this.rc.sourceIdentifier)},e.prototype.dispose=function(){var e,t;(0,l.dispose)(this.Uc),(0,l.dispose)(this.cc),(0,l.dispose)(this.bc),null==(e=this.pc)||e.release(this.mimeType),this.nc&&this.nc.dispose(),(0,M.isContextAvailable)(this.context)&&(null==(t=this.context.serviceManager.get(d.ServiceName.SegmentService))||t.disposeOfType(this.mimeType,this.lc)),this.Ed.forEach(function(e){return e()})},e}()},50429:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.throwDownloadError=function(e,t,i,d,l){e.eventHandler.dispatchEvent(s.PlayerEvent.Warning,new o.PlayerWarning(a.WarningCode.PLAYBACK_DECODE_RETRIES_EXCEEDED)),e.eventHandler.fireError(function(e,t,i,o,a){var s=e.sourceContext.sourceIdentifier;if(0===i)return t&&t===u.RequestError.TimedOut||a===c.SegmentLoadingErrorReason.TIMEOUT?new r.PlayerError(n.ErrorCode.NETWORK_SEGMENT_DOWNLOAD_TIMEOUT,{segmentUrl:o.url,mimeType:o.mimeType},"Failed to load the segment: the request timed out.",s):new r.PlayerError(n.ErrorCode.NETWORK_ERROR,{url:o.url,statusCode:i},t,s);e.logger.debug(t);var d={message:t};return o.url&&(d.segment={url:o.url,mimeType:o.mimeType,codecs:o.codecs}),a===c.SegmentLoadingErrorReason.TIMEOUT?new r.PlayerError(n.ErrorCode.NETWORK_SEGMENT_DOWNLOAD_TIMEOUT,d,t,s):new r.PlayerError(n.ErrorCode.NETWORK_ERROR,d,t,s)}(e,t,i,d,l))};var n=i(40306),r=i(3336),o=i(25926),a=i(4224),s=i(3714),u=i(77401),c=i(65244)},77286:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentInfoProvider=void 0;var n=i(58313),r=i(90919);t.SegmentInfoProvider=function(){function e(){}return e.findSegmentInfoOfRepresentation=function(t,i){if(i.SegmentList){var n=i.SegmentList[0].SegmentURL,r=t.getUrl(),o=n.find(function(t){return e.getSegmentInfoUrl(t,i)===r});if(o)return o}return null},e.findHlsRepresentationForSegment=function(e,t){var i,n,o=t.Representation.find(function(t){return e.getRepresentationId().representationId===t._internalId.representationId});if(o){var a=(0,r.findSegmentUrlIndexWithinSegmentList)(e.getSegmentInfo(),null!=(n=null==(i=o.SegmentList)?void 0:i[0].SegmentURL)?n:[]);if(-1!==a)return{representation:o,index:a}}},e.getSegmentInfoUrl=function(e,t){var i=e._media;return n.URLHelper.isUrlAbsolute(i)||(i=n.URLHelper.concatUrlParts(t.BaseURL[0],i)),i},e}()},25248:function(e,t,i){var n=this&&this.__spreadArray||function(e,t,i){if(i||2==arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentInfoService=void 0,t.getSegmentInfoId=function(e){return e.url+(e.byteRange?","+JSON.stringify(e.byteRange):"")};var r=i(80813),o=i(94685);t.SegmentInfoService=function(){function e(){this.he=[]}return e.prototype.updatePlayerContext=function(e){this.ge=e},e.prototype.setSegmentControllers=function(e){this.he=e},e.prototype.getSegmentControllerMimeTypes=function(){return this.he.map(function(e){return e.getMimeType()})},e.prototype.getSegmentInfos=function(e,t){if(!(0,o.isContextAvailable)(this.ge))return Promise.resolve([]);var i=this.ge.serviceManager.get(r.ServiceName.ManifestService,this.ge.sourceContext.sourceIdentifier).getPeriodIdForTime(e);return Promise.all(this.he.map(function(r){var o;return o={startTime:e,duration:t,targetPeriodId:i},r.getCurrentPeriodId()!==o.targetPeriodId&&r.switchPeriod(o.targetPeriodId),r.seekTo(o.startTime),r.getCurrentAdaptationSet()?(function e(t,i,n){void 0===n&&(n=[]);var r=n[n.length-1],o=r?r.startTime+r.duration:0;return i<=0||!t.hasNext(o)?Promise.resolve(n):t.getDataSegmentInfo(o).then(function(r){return r.duration&&(i-=r.duration),n.push(r),e(t,i,n)})})(r,o.duration).then(function(e){if(e.length>0){var t=r.getInitSegmentInfoForDataSegmentInfo(e[0]);if(t)return n([t],e,!0)}return e}):Promise.resolve([])})).then(function(e){return e.flatMap(function(e){return e})})},e.prototype.dispose=function(){this.he=[]},e}()}
1,65439:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.isSegmentTiming=function(e){return"startTime"in e&&(0,n.isNumber)(e.startTime)&&"duration"in e&&(0,n.isNumber)(e.duration)},t.findSegmentIndexForTime=function(e,t,i){var n=!e||!e.length,o=t<e[0].startTime+e[0].duration;if(n||o)return 0;var a=e.length-1;if(t>=e[a].startTime)return a;var s=Math.min(Math.floor(Math.max(t-e[0].startTime,0)/i),e.length-1);return r(e[0])&&r(e[s])?function(e,t,i){for(;e[i]&&e[i].startTime>t;)i--;for(;e[i]&&e[i].startTime+e[i].duration<=t;)i++;return Math.min(i=Math.max(i,0),e.length-1)}(e,t,s):null},t.createInitSegmentInfoBase=function(e){var t=e._internalId;return{internalRepresentationId:t,representationId:t.representationId,periodId:t.periodId,mimeType:e._mimeType,isInitSegment:!0}},t.getSegmentInfoTimeRange=function(e){if((null==e?void 0:e.duration)&&void 0!==(null==e?void 0:e.startTime))return{start:e.startTime,end:e.startTime+e.duration}};var n=i(23068);function r(e){return e&&(0,n.isNumber)(e.startTime)}},63066:function(e,t,i){var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentListMPDHandler=t.PHANTOM_SEGMENT_URL=void 0,t.assignSegmentStartTimesFromHlsRepresentation=T,t.copyPropValues=M,t.getMatchingPart=I;var r=i(66790),o=i(80813),a=i(77179),s=i(20649),u=i(74853),c=i(52424),d=i(89927),l=i(23068),h=i(88052),p=i(62756),f=i(50827),g=i(72498),m=i(60729),v=i(54053),y=i(65439);t.PHANTOM_SEGMENT_URL="PHANTOM-SEGMENT";var S=function(){function e(e,t){this.ie=e,this.je=t,this.le=e.settings,this.ke=e.logger,this.re=e.serviceManager.get(o.ServiceName.ManifestService,this.je.sourceIdentifier),this.qe=0,this.te={},this.se=NaN}return Object.defineProperty(e.prototype,"ue",{get:function(){return this.ie.serviceManager.get(o.ServiceName.PlayerStateService)},enumerable:!1,configurable:!0}),e.prototype.ve=function(e,t){if(!e)return null;var i,o={isInitSegment:!1,url:e._media,duration:e._duration,internalRepresentationId:t,periodId:t.periodId};if(e._key&&e._key.method!==r.HlsEncryptionMethod.NONE&&(o.key=e._key),void 0!==e._playbackTime&&(o.startTime=e._playbackTime),e._dateTime&&(o.dateTime=e._dateTime),e._metadata&&(o.metadata=e._metadata),e._byteRange&&(o.byteRange=e._byteRange),e._init&&(o.init=e._init,(null==(i=e._init.key)?void 0:i.method)===r.HlsEncryptionMethod.NONE&&(o.init=n({},o.init),delete o.init.key)),void 0!==e._mediaSequence&&(o.mediaSequence=e._mediaSequence),void 0!==e._discontinuitySequenceNumber&&(o.discontinuitySequenceNumber=e._discontinuitySequenceNumber),e._parts){var a=o.dateTime;o.parts=e._parts.map(function(e){var t,i=(t={url:e.uri,duration:e.duration,isInitSegment:!1,internalRepresentationId:o.internalRepresentationId,isPreloadHint:!!e.isPreloadHint,isIndependent:!!e.independent},e.byteRange&&(t.byteRange=e.byteRange),o.key&&(t.key=o.key),o.init&&(t.init=o.init),(0,l.isDefined)(o.mediaSequence)&&(t.mediaSequence=o.mediaSequence),(0,l.isDefined)(o.discontinuitySequenceNumber)&&(t.discontinuitySequenceNumber=o.discontinuitySequenceNumber),t);return a&&(i.dateTime=a,i.startTime=(0,d.toSeconds)(a.getTime()),a=new Date(a.getTime()+(0,d.toMilliSeconds)(e.duration))),i})}return o},e.prototype.we=function(e,t,i){if(t.SegmentURL.length<1)return e.entries=[],e.totalDuration=0,e.entries.length;for(var n=this.ve(t.SegmentURL[0],i),r=0,o=0,a=0;a<e.entries.length;a++){var s=e.entries[a];if((0,f.isIdenticalSegmentInfo)(s,n))break;r+=s.duration,e.entries.splice(a,1),a--,o++,this.ne.equals(i)&&this.rewindOneSegment()}return e.totalDuration-=r,o},e.prototype.xe=function(e,i,n,r){for(var o,a,u=[],c=e.entries[e.entries.length-1],d=0,l=r?(a=[],null==(o=r.S)||o.forEach(function(e){a.push(e);for(var t=e._r?parseInt(e._r):0;t>0;)a.push({_d:e._d}),t--}),a):void 0,h=this.xf(n),p=i.SegmentURL.length-1;p>=0;p--){var g=this.ve(i.SegmentURL[p],n);if(c&&(0,f.isIdenticalSegmentInfo)(c,g)){if(b(c)){var m=function(e,i){var n=i.duration-e.duration;return M(i,e,["url","mediaURL","duration","parts","init","key","discontinuitySequenceNumber","isDiscontinuityStart"]),e.url.endsWith(t.PHANTOM_SEGMENT_URL)||(e.url=(0,s.forceReallocation)(e.url)),n}(c,g);e.totalDuration+=m}break}c&&(0,f.isIdenticalInitSegmentInfo)(c.init,g.init)&&(g.init=c.init),(null==l?void 0:l[p])&&this.ye(g,l[p],e,h),isNaN(g.duration)&&(g.duration=e.maximumSegmentDuration),g.duration/=e.timescale,d+=g.duration,u.push(g)}return e.totalDuration+=d,u.reverse(),e.entries=e.entries.concat(u),u.length},e.prototype.ye=function(e,t,i,n){var r,o;
1if(e.duration=parseInt(t._d),void 0!==t._t){var a=null!=(r=i.timescale)?r:1,s=null!=(o=i.presentationTimeOffset)?o:0;e.startTime=n+(parseInt(t._t)-s)/a}},e.prototype.ze=function(e,t){var i,n,r,o=t.SegmentList,a=t._internalId.representationId,s=null==(i=this.ne)?void 0:i.equals(t._internalId),u=null==(n=null==o?void 0:o[0])?void 0:n.SegmentURL.length;if(!s||u){e.Uri&&e.Uri!==t.Uri&&this.Ae(e,null==o?void 0:o[0],s),e.Uri=t.Uri,e.timescale=1,e.maximumSegmentDuration=1,e.startNumber=1;for(var c=this,d=0;d<o.length;d++)!function(i){var n=o[i];if(n.hasOwnProperty("_duration")&&(e.maximumSegmentDuration=Number(n._duration)),["_timescale","_startNumber","_presentationTimeOffset"].filter(function(e){return n.hasOwnProperty(e)}).forEach(function(t){return e[t.substr(1)]=n[t]}),c.Be(e,n,t),n.hasOwnProperty("SegmentURL")){var s=c.we(e,n,t._internalId),u=c.xe(e,n,t._internalId,null==(r=n.SegmentTimeline)?void 0:r[0]);c.Ce(t._mimeType,a,s,u),c.re.isHlsManifest()?T(e.entries,t._internalId,c.re):c.De(e,t._internalId)}}(d)}},e.prototype.Ae=function(e,t,i){var n,r,o,a,s,c;if(this.re.isLive()&&i){var d,l,h=null!=(o=null==(r=null==(n=e.entries)?void 0:n[0])?void 0:r.mediaSequence)?o:1/0,p=(null!=(s=null==(a=null==t?void 0:t.SegmentURL[0])?void 0:a._mediaSequence)?s:0)-h,f=Math.ceil(24/(e.totalDuration/(null!=(l=null==(d=e.entries)?void 0:d.length)?l:1)));!isNaN(p)&&p>0&&p<f&&this.pf(p)}(0,u.clearArray)(null!=(c=e.entries)?c:[]),e.totalDuration=0},e.prototype.Be=function(e,t,i){var n,r=null==(n=h.ModuleManager.get(p.ModuleName.DASH,!1))?void 0:n.initSegmentInfoSourceDetectors.isInitializationNode;(null==r?void 0:r(t))?e.init=h.ModuleManager.get(p.ModuleName.DASH,!1).initSegmentInfoProviders.provideSegmentInfoFromInitializationNodeProperty(t,i):delete e.init},e.prototype.Ce=function(e,t,i,n){(i>0||n>0)&&this.ke.debug("[".concat(e,"][").concat(t,"] Updated segment list, removed ").concat(i," segments and added ").concat(n," segments"))},e.prototype.De=function(e,t){var i=this.xf(t);e.entries.forEach(function(e){var t;null!=e.startTime||(e.startTime=i),i=e.startTime+(null!=(t=e.duration)?t:0)})},e.prototype.extrapolateStartTimesFromDiscontinuityStarts=function(e){var t,i,n,r,o=null==(i=null==(t=this.Ee())?void 0:t.getState())?void 0:i.hls;if(o){var a=e.getRepresentationId().representationId,s=this.getSegmentListEntries(this.ne),u=h.ModuleManager.get(p.ModuleName.HLS).selectors,c=u.getDiscoSequenceTimings,d=u.getMergedDiscontinuityTimings,l=function(e,t){for(var i=e[0].discontinuitySequenceNumber,n=1;n<e.length;n++){var r=e[n].discontinuitySequenceNumber;if(r!==i){var o=function(e,t){var i=e[String(t)];return i&&i.startTime>0?i.startTime:(i=e[String(t-1)])&&i.endTime>0?i.endTime:null}(t,r);if(null!=o)return{index:n,discontinuityStartTime:o}}}return null}(s,null!=(n=c(o,e.getMimeType()))?n:d(o));if(!l){var f=null==(r=this.qf())?void 0:r.start;if(void 0===f)return;l={index:0,discontinuityStartTime:f},this.ke.debug("Could not find discontinuity boundary with start time, using period start time ".concat(f))}this.ke.debug("Assigning segment start times for rep ".concat(a," from discontinuity at index ").concat(l.index," with time ").concat(l.discontinuityStartTime)),s[l.index].startTime=l.discontinuityStartTime;for(var g=l.index-1;g>=0;g--)s[g].startTime=s[g+1].startTime-s[g+1].duration;for(g=l.index+1;g<s.length;g++)s[g].startTime=s[g-1].startTime+s[g-1].duration}},e.prototype.Ee=function(){return this.ie.serviceManager.get(o.ServiceName.SourceStoreService,this.je.sourceIdentifier)},e.prototype.Fe=function(e,t){for(var i=-1,n=this.getSegmentListEntries(t),r=n.length-1;r>=0;r--)if((0,f.isIdenticalSegmentInfo)(n[r],e)){i=r;break}return i},e.prototype.Ge=function(e){var t,i=this,n=null==(t=this.re)?void 0:t.getAdaptationSet(e);n&&n.Representation.forEach(function(e){var t=i.te[e._internalId.key()];if(t||(t=i.Ke(e._internalId.key())),e.hasOwnProperty("SegmentList")&&(i.ze(t,e),h.ModuleManager.has(p.ModuleName.DASH))){var n=h.ModuleManager.get(p.ModuleName.DASH).initSegmentInfoSourceDetectors.isInitializationNode;if(!t.hasOwnProperty("init")&&e.hasOwnProperty("SegmentBase")&&e.SegmentBase&&n(e.SegmentBase[0])){var r=h.ModuleManager.get(p.ModuleName.DASH).initSegmentInfoProviders.provideSegmentInfoFromInitializationNodeProperty;t.init=r(e.SegmentBase[0],e)}}})},e.prototype.He=function(){var e,t,i=this,n=null==(e=this.ie.serviceManager.get(o.ServiceName.SourceStoreService,this.je.sourceIdentifier).getState().activeTracks)?void 0:e[this.oe.adaptationSetId];if((null==(t=null==n?void 0:n.selectedRepresentationId)?void 0:t.periodId)===this.oe.periodId)return n.selectedRepresentationId;if(this.ne){var r=this.re.getRepresentation(this.oe,this.ne.representationId);if(r)return r._internalId}return(this.Ie(function(e){return i.isSegmentInfoLoaded(e._internalId)})||this.Ie())._internalId},e.prototype.Ie=function(e){return this.re.getMatchingRepresentationByBandwidth(this.oe,this.Le(),e)},e.prototype.Je=function(){var e=this.oe.equals(this.ne),t=!this.ne||!!this.re.getRepresentationById(this.ne);return!this.ne||!e||!t},e.prototype.setAdaptationSetId=function(e){this.oe=e,this.Ge(this.oe);var t,i=this.re.isLive(),n=0;this.Je()&&(this.ne=this.He());var r=this.te[this.ne.key()];if(r||(r=this.Ke(this.ne.key())),r&&i&&r.entries&&r.entries.length>0){var o=r.entries.length-1;this.me>o&&(n=this.me-o),this.me=Math.min(o,this.me||0),this.me=Math.max(0,this.me),t=r.entries[this.me]}if(this.me=this.me||0,i&&(this.qe=this.getSegmentDuration()*this.le.LIVE_SEGMENT_LIST_START_INDEX_OFFSET),i){if
vendor: 4,428 bytes, line 1
1(t&&r){var a=this.Fe(t,this.ne);a>=0?this.me=a+n:this.Ne()}else this.Ne();var s=this.Me();s?this.kf(s):this.resolvePendingSegmentInfoRequests()}else this.resolvePendingSegmentInfoRequests()},e.prototype.Ke=function(e){var t={totalDuration:0,entries:[],SegmentURL:[],startNumber:0,init:null,maximumSegmentDuration:1,timescale:1};return this.te[e]=t,t},e.prototype.Le=function(){var e=0,t=this.sf();return t&&(e=t._bandwidth),e},e.prototype.Me=function(){var e;if(this.re.isHlsManifest()){var t=this.re.getRepresentationById(this.ne);if(null==(e=null==t?void 0:t._hls)?void 0:e.loadFailureReason)return t._hls.loadFailureReason}return this.hasNext()||this.re.isLastPeriod(this.ne.periodId)?null:v.SegmentInfoError.PERIOD_COMPLETE},e.prototype.Ne=function(){this.le.ENABLE_SEEK_FOR_LIVE?this.me=0:this.timeShift(0)},e.prototype.Yf=function(e,t){var i,n,r=this.re.getRepresentationById(e),o=this.re.getRepresentationById(t),a=(0,l.isNumber)(null==(i=null==o?void 0:o._hls)?void 0:i.mediaSequence)&&(0,l.isNumber)(null==(n=null==r?void 0:r._hls)?void 0:n.mediaSequence);if(r&&o&&a){var s=o._hls.mediaSequence-r._hls.mediaSequence,c=this.getSegmentListEntries(e),d=this.getSegmentListEntries(t);s>=c.length||(d[0].startTime=c[s].startTime,(0,u.forEachFromIndex)(d,1,function(e,t){(0,l.isNumber)(e.startTime)&&(0,l.isNumber)(e.duration)&&(t.startTime=e.startTime+e.duration)}))}},e.prototype.setRepresentationId=function(e){var t=this.re.getRepresentationById(e),i=this.getSegmentListEntries(this.ne)[this.me];if(t){var n=void 0===this.ne,r=this.ne;if(this.ne=e,this.re.isLive()&&t._hls){if(this.le.HLS_SYNC_SEGMENT_PLAYBACK_TIME_VIA_MEDIA_SEQUENCE&&this.Yf(r,this.ne),n)this.Ne();else if(this.le.HLS_SYNC_VIA_MEDIA_SEQUENCE){var o=this.re.getRepresentationById(r)._hls.mediaSequence+this.me;this.me=o-t._hls.mediaSequence,this.me=Math.max(this.me,0)}else if(null!=(null==i?void 0:i.startTime)&&!isNaN(i.startTime)){var a=this.wf(i.startTime);null===a||isNaN(a)||(this.me=this.Zf(a,i.startTime))}}return!0}return!1},e.prototype.Zf=function(e,t){var i=this.getSegmentListEntries(this.ne),n=[i[e],i[e+1]];if(e===i.length-1||n.some(function(e){return!e.startTime}))return e;var r=n.map(function(e){return Math.abs(e.startTime-t)}),o=Math.min.apply(this,r);return e+r.indexOf(o)},e.prototype.getInitSegmentInfo=function(){var e=this.tf(this.ne);if(null==e?void 0:e.init)return e.init.presentationTimeOffset=this.getTimestampOffset(),e.init;var t=this.getSegmentListEntries(this.ne);if(this.gf(t)&&this.me>-1){var i=n({},t[this.me]);if(i.init){var r=i.init;return r.isInitSegment=!0,r}}return null},e.prototype.af=function(e){var t;if(!(this.getSegmentListEntries(this.ne).length<1||this.me<0)){var i=this.bf(e);return i&&this.ke.debug("".concat(null==(t=this.oe)?void 0:t.adaptationSetId," given time ").concat(e," matches seek time, performing precise segment/part search"),e),(0,m.isPlayingLowLatencyHls)(this.ie)&&this.cf(e,i),this.df(e,i)}},e.prototype.bf=function(e){var t;return e===(null==(t=this.ue)?void 0:t.targetPlaybackTime)},e.prototype.cf=function(e,t){var i;if(0!==e){if(this.me=this.wf(e),!t){var n=this.getSegmentListEntries(this.ne),r=n[this.me];if(!(r.parts&&r.parts.length>0)){var o=this.me;this.me=P(e,this.me,n),this.me!==o&&this.ke.debug("Snapped segment index for time ".concat(e," to next segment boundary at ").concat(null==(i=n[this.me])?void 0:i.startTime))}}}else this.ie.logger.debug("Ignoring target time of 0 for LL-HLS")},e.prototype.df=function(e,t){var i=this.getSegmentListEntries(this.ne);if(this.gf(i)){var n=i[this.me];if(!(n.parts&&n.parts.length>0))return this.ff();if(b(n))return I(n,e,t);var r=I(n,e,t);return r?n.parts.indexOf(r)>0?r:this.ff():(this.me++,this.df(e,t))}},e.prototype.getNextSegmentInfo=function(e){var t=this.af(e);return t?(this.ef(t),Promise.resolve(t)):this.jf({time:e})},e.prototype.ef=function(e){return e.presentationTimeOffset=this.getTimestampOffset(),e.startTime&&(e.wallClockTime=(0,d.toMilliSeconds)(e.startTime)),e},e.prototype.ff=function(){return this.getSegmentListEntries(this.ne)[this.me++]},e.prototype.getSegmentInfos=function(){var e=this,t={},i=this.re.getAdaptationSet(this.oe);return i&&i.Representation.forEach(function(i){var n=e.getSegmentListEntries(i._internalId);t[i._id]=n.map(function(e){return{url:e.url,duration:e.duration,startTime:e.startTime}})}),t},e.prototype.getSubtitleUrl=function(){return this.re.getAvailableSubtitles(this.oe.periodId)[
10].url},e.prototype.getStartNumber=function(){var e=this.tf(this.ne);return e?e.startNumber:1},e.prototype.getSegmentDuration=function(){var e=this,t=this.tf(this.ne),i=this.getSegmentListEntries(this.ne);if(t)return i.length>0&&(0,l.isNumber)(t.totalDuration)?t.totalDuration/i.length:t.maximumSegmentDuration;if(this.re.getAdaptationSet(this.oe)){var n=Object.keys(this.te).map(function(t){return e.te[t]}).find(function(e){return null!==e});if(n)return n.maximumSegmentDuration}return 1},e.prototype.seekTo=function(e){e>-1&&(this.me=this.wf(e))},e.prototype.gf=function(e){return this.me<e.length},e.prototype.hasNext=function(){var e=this.getSegmentListEntries(this.ne);return!this.ne||!e.length||(this.re.isLive()?this.hf(e):this.gf(e))},e.prototype.hf=function(e){return!!this.re.isLastPeriod(this.ne.periodId)||this.gf(e)},e.prototype.setTimestampOffset=function(e,t){void 0===t&&(t=1),this.se=e/t},e.prototype.getTimestampOffset=function(){if(!isNaN(this.se))return this.se;var e=this.qf(),t=0;if(this.ne){var i=this.tf(this.ne);i&&!isNaN(i.presentationTimeOffset)&&(t=i.presentationTimeOffset/i.timescale)}return e&&!this.re.isHlsManifest()&&(t-=e.start),t},e.prototype.getIndex=function(){return this.me},e.prototype.setIndex=function(e){"number"==typeof e?e<0?(this.ke.debug("Tried to set index at MPDHandler to value smaller 0. Setting to 0."),this.me=0):this.me=e:this.ke.debug("Tried to set index at MPDHandler with parameter not being a number!")},e.prototype.jf=function(e){var t,i=this;if(this.pe)return Promise.reject("fail");var r=this.re.getRepresentationById(this.ne);return(null==(t=null==r?void 0:r._hls)?void 0:t.loadFailureReason)?Promise.reject(r._hls.loadFailureReason):(this.ke.debug("No segment info was found for the target time. Waiting for representation update."),new Promise(function(t,r){i.pe=n(n({},e),{resolve:t,reject:r})}))},e.prototype.resolvePendingSegmentInfoRequests=function(){if(this.pe){var e=this.af(this.pe.time);e?(this.ef(e),this.pe.resolve(e),this.pe=null):this.re.isLive()||this.hasNext()||this.pe.reject(v.SegmentInfoError.END_OF_STREAM_REACHED)}},e.prototype.kf=function(e){this.pe&&(this.pe.reject(e),this.pe=null)},e.prototype.lf=function(){var e=this.getSegmentListEntries(this.ne);return e.length>0?e.length-1:0},e.prototype.mf=function(e){for(var t,i=Math.abs(e),n=this.getSegmentDuration(),r=this.getSegmentListEntries(this.ne),o=this.lf(),a=0,s=r.length-1;s>=0&&!((a+=null!=(t=r[s].duration)?t:n)>=i);s--)o--;return Math.max(0,o)},e.prototype.timeShift=function(e,t,i){if(this.re.isLive()){var n=this.me;this.me=i&&this.nf()?this.wf(i):this.mf(e),this.ke.debug("timeShift changes index from ".concat(n," to ").concat(this.me,", based on")+" offset ".concat(e," and target time ").concat(i))}},e.prototype.nf=function(){var e,t=null==(e=this.getSegmentListEntries(this.ne)[0])?void 0:e.startTime;return(0,l.isNumber)(t)&&t>=0},e.prototype.updateRepresentation=function(e){return Promise.resolve(e)},e.prototype.isSegmentInfoLoaded=function(e){if(void 0===e&&(e=this.ne),!e)return!1;var t=this.getSegmentListEntries(e),i=this.re.getRepresentationById(e);return!(!t.length||!i)},e.prototype.pf=function(e){this.ke.debug("Rewinding segment list index by ".concat(e," segments")),this.me-=e,this.me<0&&(this.ke.debug("List array index is smaller than 0, probably a discontinuity. Using 0."),this.me=0)},e.prototype.rewindOneSegment=function(){return this.me--,!(this.me<0&&(this.ke.debug("List array index is smaller than 0, probably a discontinuity. Using 0."),this.me=0,1))},e.prototype.qf=function(){return this.re.getPeriod(this.ne)},e.prototype.rf=function(e){var t=this.qf().start;return(this.re.hasSinglePeriod()?this.getSeekableRange().start:t)+this.getSegmentListEntries(this.ne).slice(0,e).reduce(function(e,t){return e+t.duration},0)},e.prototype.sf=function(){return this.re.getRepresentationById(this.ne)},e.prototype.tf=function(e){if(e)return this.te[e.key()]},e.prototype.getSegmentListEntries=function(e){var t,i;return e?this.le.ENABLE_SEGMENT_INFO_PROVIDER_FROM_STORE&&this.re.isHlsManifest()?this.uf(e):null!=(i=null==(t=this.tf(e))?void 0:t.entries)?i:[]:[]},e.prototype.uf=function(e){var t,i=null==(t=this.Ee())?void 0:t.getState();return(0,g.getSegmentInfos)(i,e.key())},e.prototype.vf=function(e,t){var i,n;if(!this.oe)return 0;for(var r=this.re.getPeriod(this.oe),o=null!=(i=null==r?void 0:r.start)?i:0,a=this.getSegmentListEntries(this.ne),s=0,u=o;u<=t&&s<a.length;s++)u+=null!=(n=a[s].duration)?n:0;return Math.max(s-1,0)},e.prototype.wf=function(e){var t,i,n=this.tf(this.ne),r=this.getSegmentListEntries(this.ne);
1if(!n||0===r.length||!(0,l.isNumber)(n.totalDuration))return 0;var o=this.xf(),a=Math.max((null==(t=this.re)?void 0:t.isFirstPeriod(null==(i=this.ne)?void 0:i.periodId))?o+this.qe:o,e),s=n.totalDuration/r.length,u=(0,y.findSegmentIndexForTime)(r,a,s);return null!==u?u:this.vf(n,a)},e.prototype.xf=function(e){void 0===e&&(e=this.ne);var t,i,n=null==(i=null==(t=this.re)?void 0:t.getPeriod(e))?void 0:i.start;return void 0!==n?n:(this.ke.debug("Unexpected period start of undefined for period ".concat(e.periodId,", falling back to 0")),0)},e.prototype.getLiveEdgeTime=function(){var e,t,i,n=null==(e=this.re)?void 0:e.getLastPeriod();if(void 0===(null==n?void 0:n.start))return 1/0;var r=null!=(t=this.yf())?t:c.DurationConverter.getDurationInSec(null!=(i=n._duration)?i:"");return n.start+r},e.prototype.yf=function(){var e;return null==(e=this.tf(this.ne))?void 0:e.totalDuration},e.prototype.getActualTimeShiftBufferDepth=function(){return this.re.getTimeShiftBufferDepthSeconds()},e.prototype.getSeekableRange=function(){var e={start:0,end:0},t=this.re.getTotalDuration();if(!this.re.isLive())return e.start=(0,a.getStartTimeOffset)(this.Ee().getState()),e.end=t,e;var i=this.re.getTimeShiftBufferDepthSeconds(),n=(0,d.toSeconds)(this.re.getRequestTimestamp()-this.re.getAvailabilityStartTime());if(e.start=Math.max(n+i,0),e.end=Math.max(n,0),h.ModuleManager.has(p.ModuleName.HLS)&&this.re.isHlsManifest()){var r=h.ModuleManager.get(p.ModuleName.HLS).selectors,o=r.getHlsState;"EVENT"===(0,r.getPlaylistType)(o(this.Ee().getState()))?(e.start=0,e.end=t):e.start+=this.qe}return e.end-=this.re.getDesiredDistanceToLiveEdge(),e},e.prototype.getPendingSegmentInfoRequest=function(){return this.pe},e.prototype.setPendingSegmentInfoRequest=function(e){this.pe=e},e.prototype.canSwitchRepresentation=function(e){var t,i,n=this.getSegmentListEntries(this.ne)[this.me];if(!n)return!0;var r=(t=this.le.LL_HLS_SEGMENT_END_TIME_MATCHING_TOLERANCE,void 0!==n.startTime&&void 0!==n.duration&&Math.abs(e-(n.startTime+n.duration))<t);if(!b(n)&&r)return!0;var o=this.bf(e);return!((null==(i=null==n?void 0:n.parts)?void 0:i.length)&&I(n,e,o)!==n.parts[0])},e.prototype.getLatestTimeForPossibleSwitch=function(e){var t,i=this.zf(e),n=i.isLoadingCurrentSegmentsParts,r=i.currentSegment;return r&&n&&null!=(t=r.startTime)?t:e},e.prototype.adjustTimeToNextSegmentStart=function(e){var t=this.zf(e),i=t.isLoadingCurrentSegmentsParts,n=t.currentSegment;return i&&(null==n?void 0:n.startTime)&&(null==n?void 0:n.duration)?n.startTime+n.duration:e},e.prototype.zf=function(e){var t,i=function(e,t){var i,n,r;if(t&&!(t.length<1)&&(null==(i=t[0])?void 0:i.duration)){var o=(0,y.findSegmentIndexForTime)(t,e,t[0].duration),a=e<(null!=(r=null==(n=t[0])?void 0:n.startTime)?r:1/0),s=t[t.length-1];if(void 0!==s.startTime&&void 0!==s.duration){var u=e>s.startTime+s.duration;if(!(null===o||a||u))return t[o]}}}(e,this.getSegmentListEntries(this.ne)),n=null==(t=null==i?void 0:i.parts)?void 0:t[0],r=this.bf(e),o=!1;if(n&&i){var a=I(i,e,r);o=void 0!==a&&a!==n}return{currentSegment:i,isLoadingCurrentSegmentsParts:o}},e.prototype.dispose=function(){this.le=null,this.re=null,this.oe=null,this.ne=null,this.re=null,this.pe=null,this.te=null},e}();function T(e,t,i){var n;e.length&&i.hasSegmentStartTimeForHlsRepresentation(t)&&(null!=e[0].startTime?n=(0,u.findIndexFromEnd)(e,function(e){return null!=e.startTime})+1:(e[0].startTime=i.getStartTimeForHlsSegment(t,e[0]),n=1),(0,u.forEachFromIndex)(e,n,function(e,t){return t.startTime=e.startTime+e.duration}))}function b(e){return e.url.endsWith(t.PHANTOM_SEGMENT_URL)}function M(e,t,i){i.forEach(function(i){return t[i]=e[i]})}function I(e,t,i){var n,r=null==(n=e.parts)?void 0:n.every(y.isSegmentTiming);if(e.parts&&r){var o=e.parts,a=o.reduce(function(e,t){return e+t.duration},0)/o.length,s=(0,y.findSegmentIndexForTime)(o,t,a);if(null!=s)return i?e.parts[0]:(s=P(t,s,o),e.parts[s])}}function P(e,t,i){var n=i[t],r=n.startTime+n.duration;return Math.abs(e-n.startTime)<=Math.abs(e-r)?t:t+1}t.SegmentListMPDHandler=S},65244:function(e,t,i){var n,r,o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};
1Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentLoader=t.State=t.SegmentLoadingErrorReason=void 0;var a,s,u=i(66790),c=i(40306),d=i(3336),l=i(80813),h=i(3714),p=i(77401),f=i(4131),g=i(43446),m=i(91523),v=i(57456),y=i(29669),S=i(91678),T=i(46151),b=i(33436),M=i(70233),I=i(85434),P=i(89927),C=i(88844),E=i(23068),A=i(58313),R=i(88052),_=i(62756),B=i(95880),D=i(34795),O=i(17143),L=i(44115),k=i(66628),x=i(92096),N=i(33004),w=i(17382),F=i(23133),H=i(94618),U=i(689),G=i(97587);function Z(e){switch(e){case s.ABR_TIMEOUT:return a.ABR_TIMEOUT;case s.TIMEOUT:return a.TIMEOUT;default:return a.CANCEL}}(n=a||(t.SegmentLoadingErrorReason=a={})).CANCEL="CANCEL",n.ERROR_LOADING="ERROR_LOADING",n.ERROR_DECRYPTING="ERROR_DECRYPTING",n.BUSY="BUSY",n.UNKNOWN="UNKNOWN",n.TIMEOUT="TIMEOUT",n.ABR_TIMEOUT="ABR_TIMEOUT",(r=s||(t.State=s={}))[r.IDLE=1]="IDLE",r[r.LOADING=2]="LOADING",r[r.CANCELLING=3]="CANCELLING",r[r.TERMINATED=4]="TERMINATED",r[r.TIMEOUT=5]="TIMEOUT",r[r.ABR_TIMEOUT=6]="ABR_TIMEOUT",t.SegmentLoader=function(){function e(e,t,i,n,r){void 0===r&&(r=!1);var a=this;if(this.context=e,this.cancelLoading=function(e){var t,i,n,r,o,u,c;if(void 0===e&&(e=s.CANCELLING),(0,C.clearTimeoutIfDefined)(a.VF),a.VF=void 0,(0,C.clearIntervalIfDefined)(a.WF),a.WF=void 0,a.isLoading()){var d=a.pG[a.sG];if(delete a.pG[a.sG],a.vG=e,a.XF.cancel(),void 0!==a.qG){var l=null!=(i=null==(t=a.qG.responseTiming)?void 0:t.headersReceivedTimestamp)?i:-1,h=null!=(r=null==(n=a.qG.responseTiming)?void 0:n.openedTimestamp)?r:-1,p=null!=(o=a.qG.elapsedTime)?o:-1,g=l-h;p>=0&&g>=0&&p>g&&a.context.store.dispatch((0,S.addMetricsValue)(a.UF,b.MetricType.DownloadInformation,{bytes:a.qG.loadedBytes,time:p,timeToFirstByte:g})),(null==(u=a.qG)?void 0:u.chunks)&&d&&a.CG(d),a.xG={success:!1,httpStatus:408,url:a.sG,downloadTime:p,size:a.qG.loadedBytes,duration:null!=(c=a.rG)?c:0,isInit:a.tG,mimeType:a.UF,uid:void 0,timeToFirstByte:(0,f.hasLoadedData)(a.qG)?g:-1}}a.qG=void 0}},this.LG=function(){var e,t,i,n=null!=(i=null==(t=null==(e=a.qG)?void 0:e.responseTiming)?void 0:t.sendTimestamp)?i:-1;void 0===a.qG||n<0||a.MG(o(o({},a.qG),{elapsedTime:g.TimingUtil.getHiResTimestamp()-n}))},this.MG=function(e){var t,i=null!=(t=e.elapsedTime)?t:-1,n=a.pG[a.sG];a.qG=o(o({},e),{segmentDuration:a.rG,url:a.sG,representationBitrate:n.bitrate}),a.tG||i<=.5||a.vG!==s.LOADING||a.iG(a.qG,n.internalRepresentationId)&&a.cancelLoading(s.ABR_TIMEOUT)},this.NG=function(e,t,i){var n,r,o,s,u,c,d=a.context.store.getState(),l=d?(0,T.getMetricsState)(d):void 0;if(a.context.logger.debug("Downloaded ".concat(a.UF," ").concat(a.tG?"init":"data"," segment in: ").concat(null==(n=e.elapsedTime)?void 0:n.toFixed(2),", TTFB: ").concat(null==(r=e.timeToFirstByte)?void 0:r.toFixed(2),", quality: ").concat(null!=(s=null==(o=a.pG[a.sG])?void 0:o.representationId)?s:"")),!a.tG&&l&&a.UF in l&&(a.context.store.dispatch((0,S.addMetricsValue)(a.UF,b.MetricType.DownloadTime,t)),a.context.store.dispatch((0,S.addMetricsValue)(a.UF,b.MetricType.DownloadSuccess,!0)),(0,v.isDownloadTimeInformationValid)(e)&&a.context.store.dispatch((0,S.addMetricsValue)(a.UF,b.MetricType.DownloadInformation,{bytes:e.length,time:e.elapsedTime,timeToFirstByte:e.timeToFirstByte})),null==(u=a.qG)?void 0:u.chunks)){a.SF.debug("[SegmentLoader] ",a.qG.chunks);var p=(0,w.calculateDownloadRates)(a.qG.chunks),f=(0,w.calcAverage)((0,w.filterValuesExceedingAverageByMargin)(p)),g=a.qG.loadedBytes,m=a.pG[a.sG],y=m.duration,M=void 0!==y?(0,N.bytesToBits)(g)/y:void 0,I=m.bitrate;a.SF.debug("[SegmentLoader] DL rate (AVG-based filter): ".concat((0,w.bpsToMbps)(f),", segmentBitrate: ").concat(M)),a.context.store.dispatch((0,S.addMetricsValue)(a.UF,b.MetricType.ChunkedDownloadInformation,{downloadRate:f,segmentBitrate:M,representationBitrate:I}))}(0,C.clearTimeoutIfDefined)(a.VF),a.VF=void 0,(0,C.clearIntervalIfDefined)(a.WF),a.WF=void 0;var P={success:!0,httpStatus:e.status,url:e.url,downloadTime:e.elapsedTime,size:e.length,duration:a.rG,isInit:a.tG,mimeType:a.UF,uid:a.sG&&btoa((0,A.encodeNonAsciiCharacters)(a.sG)),timeToFirstByte:null!=(c=e.timeToFirstByte)?c:-1};a.TF.dispatchEvent(h.PlayerEvent.SegmentRequestFinished,P)},this.BG=n,this.SF=e.logger,this.TF=e.eventHandler,this.kG=e.config.tweaks.segmentLoaderArgs||null,this.jG=e.config.tweaks.segmentLoader||null,this.rG=1,this.vG=s.IDLE,this.UF=t,this.iG=i,this.oG=null,this.pG={},this.xG=null,this.AG=r,R.ModuleManager.has(_.ModuleName.ContainerMP4)){var u=R.ModuleManager.get(_.ModuleName.ContainerMP4);this.zG=new u.CmafChunkParser(this.context)}this.WG()}return e.prototype.CG=function(e){var t,i,n,r,o,a,s,u,c=(null!=(n=null==(i=null==(t=this.qG)?void 0:t.responseTiming)?void 0:i.progressTimestamp)?n:g.TimingUtil.getHiResTimestamp())-(null!=(a=null==(o=null==(r=this.qG)?void 0:r.responseTiming)?void 0:o.headersReceivedTimestamp)?a:0),d=(0,N.bytesToBits)(null!=(u=null==(s=this.qG)?void 0:s.loadedBytes)?u:0)/c,l=void 0===e.duration?1:Math.max(1-c/e.duration,.1);this.context.store.dispatch((0,S.addMetricsValue)(this.UF,b.MetricType.ChunkedDownloadInformation,{downloadRate:d*l,segmentBitrate:void 0,representationBitrate:e.bitrate}))},e.prototype.isLoading=function(){var e=!!(this.lG&&this.lG.isLoading());return this.vG===s.LOADING||this.vG===s.CANCELLING||this.XF&&this.XF.isLoading()||e},e.prototype.isRetrying=function(){return this.XF&&this.XF.isRetrying()},e.prototype.load=function(e){var t=this;if(this.isLoading())return this.SF.debug("Error loading segment, loader is busy!"+this.sG),Promise.reject({reason:a.BUSY});this.XF&&this.XF.dispose();var i=this.DG(e);return this.xG=null,this.qG=void 0,this.XF=(0,U.getLoader)(this.context,i),this.vG=s.LOADING,this.sG=e.url,this.pG[this.sG]=e,this.tG=e.isInitSegment,this.rG=e.duration,this.oG=this.EG(e).then(function(){return t.OG(e)}).catch(function(e){throw t.vG=s.IDLE,t.oG=null,e}),this.oG},e.prototype.DG=function(e){var t=o({},this.wG);return e.isPreloadHint&&(t.maxRetries=0),(e.isInitSegment||e.preventDownloadCanceling||function(e,t){var i,n=null==(i=null==e?void 0:e.serviceManager)?void 0:i.get(l.ServiceName.AdaptationService);if(!n||!t.mimeType||!t.representationId)return!1;
1var r=n.getLowestRepresentationId(t.mimeType);return t.representationId===r}(this.context,e))&&(t.disableDownloadTimeout=!1,e.preventDownloadCanceling=!0),t},e.prototype.EG=function(e){var t,i=this;this.uG=e.key;var n=!!(null==(t=this.uG)?void 0:t.buffer);if(!this.uG||n)return Promise.resolve();switch(this.uG.method){case u.HlsEncryptionMethod.AES_128:return this.GG(e).then(function(e){e&&(i.uG.buffer=e)});case u.HlsEncryptionMethod.SAMPLE_AES:return this.uG.keyformat===u.APPLE_KEYFORMAT_DELIVERY?Promise.resolve():(this.TF.fireError(new d.PlayerError(c.ErrorCode.SOURCE_ENCRYPTION_METHOD_NOT_SUPPORTED,{"encryption-method":this.uG.method,supported:u.HlsEncryptionMethod.AES_128},"The ".concat(u.HlsEncryptionMethod.SAMPLE_AES," encryption method is not supported."),this.BG.sourceIdentifier)),Promise.reject({reason:a.ERROR_DECRYPTING}));case u.HlsEncryptionMethod.SAMPLE_AES_CTR:return Promise.resolve();default:return Promise.reject({reason:a.ERROR_DECRYPTING})}},e.prototype.getCurrentLoadPromise=function(){return this.oG},e.prototype.FG=function(){var e;return null==(e=this.context.serviceManager)?void 0:e.get(l.ServiceName.SourceStoreService,this.BG.sourceIdentifier)},e.prototype.GG=function(e){var t,i=null==(t=e.key)?void 0:t.uri,n=this.FG();if(!n||!i)return Promise.reject(Error("Source store not available."));var r=n.getState(),o=(0,k.getEncryptionKey)(r,i);return(null==o?void 0:o.uri)&&o.loadState!==x.KeyLoadState.Cancel?o.key?Promise.resolve(M.FormatHelper.hexToBytes(o.key).buffer):(0,F.waitForKeyToBeLoaded)(n,i):(null!=this.lG||(this.lG=new H.KeyLoader(this.context)),(0,F.addEncryptionKeyToStore)(i,this.lG,n))},e.prototype.HG=function(e,t){if(this.AG)return null;var i,n=null!=(i=this.IG(t))?i:this.JG(t);return n?(this.pG[e]&&(this.pG[e].wasPrefetched=!0),n):null},e.prototype.IG=function(e){var t;return this.context.serviceManager.has(l.ServiceName.PreloadingService)&&(null==(t=this.context.segmentCacheService)?void 0:t.hasPrefetchedSegment(e,void 0,this.BG))?this.context.segmentCacheService.getPrefetchedSegment(e,this.iG,this.BG):null},e.prototype.JG=function(e){var t;return(null==(t=this.context.adRestorationOptimizationService)?void 0:t.hasPrefetchedSegment(e))?this.context.adRestorationOptimizationService.getPrefetchedSegment(e,this.iG):null},e.prototype.KG=function(){(0,C.clearIntervalIfDefined)(this.WF);var e=(0,P.toMilliSeconds)(this.context.settings.SEGMENT_LOADING_PROGRESS_CHECK_INTERVAL);this.WF=e<=0?void 0:window.setInterval(this.LG,e)},e.prototype.OG=function(e){var t,i=this,n={};e.byteRange&&(n.Range="bytes="+e.byteRange.start+"-"+e.byteRange.end);var r=this.BG.source,o=(null==r?void 0:r.options)?!!r.options.withCredentials:void 0;(0,C.clearTimeoutIfDefined)(this.VF),this.VF=void 0,(0,C.clearIntervalIfDefined)(this.WF),this.WF=void 0,e.preventDownloadCanceling||(this.VF=window.setTimeout(function(){return i.cancelLoading(s.TIMEOUT)},(0,m.getRequestTimeout)(this.context,this.wG.requestType)));var a=this.HG(this.sG,e);if(a)return this.context.logger.debug("return prefetched segment for",this.sG),a.then(function(e){var t=new G.Stream;return i.VG(),t.add(e),e.getSegmentInfo().wasPrefetched=!0,t.end(),t}).catch(function(e){throw e});var u=null==(t=this.FG())?void 0:t.getState(),c=u&&(0,L.getContainerFormat)(u,I.MimeTypeHelper.getMediaType(this.UF)),d=(null==c?void 0:c.source)===D.ContainerFormat.MP4,l=!!this.uG||!!this.nG,h=this.context.settings.CHUNKED_CMAF_STREAMING&&this.zG&&d&&!e.isInitSegment&&!l;return this.KG(),this.XF.load(this.sG,y.HttpRequestMethod.GET,y.HttpResponseType.ARRAYBUFFER,null,n,o,this.UF,h).then(function(e){return i.UG(e.body)}).catch(function(e){throw i.PG(e)})},e.prototype.PG=function(e){var t,i;return[s.CANCELLING,s.TIMEOUT,s.ABR_TIMEOUT].includes(this.vG)?(this.SF.debug("Cancelled ".concat(this.UF," download [").concat(this.sG,"]")),this.xG&&(null==(t=this.TF)||t.dispatchEvent(h.PlayerEvent.SegmentRequestFinished,this.xG)),i={reason:Z(this.vG)}):this.vG===s.LOADING&&(i={reason:a.ERROR_LOADING,info:{response:e,isInit:this.tG}}),i},e.prototype.getAllLoadingPeriodIds=function(){var e=this;return Object.keys(this.pG).map(function(t){var i;return null==(i=e.pG[t])?void 0:i.periodId}).filter(E.isDefined)},e.prototype.getCurrentLoadingSegmentInfo=function(){return this.isLoading()&&this.sG&&this.pG[this.sG]?this.pG[this.sG]:null},e.prototype.attachDecrypter=function(e){this.nG=this.nG||e},e.prototype.attachClearKeyLoader=function(e){this.mG=this.mG||e},e.prototype.terminate=function(){var e,t=this;this.isLoading()?(null==(e=this.oG)||e.catch(function(){t.vG=s.TERMINATED}),this.cancelLoading()):this.vG=s.TERMINATED},e.prototype.QG=function(e){return(0,O.createSegmentFromInfo)(this.pG[this.sG],this.UF,e)},e.prototype.RG=function(e,t){return this.uG&&this.uG.method===u.HlsEncryptionMethod.AES_128&&!t?this.SG(e):this.nG?this.TG(e):Promise.resolve(e)},e.prototype.SG=function(e){var t,i;return R.ModuleManager.has(_.ModuleName.Crypto)?(null==(t=this.uG)?void 0:t.buffer)&&(null==(i=this.uG)?void 0:i.iv)?(this.SF.debug("Decrypting AES-128-encrypted segment ".concat(this.sG,", ")+"KEY: 0x".concat(M.FormatHelper.bytesToHex(this.uG.buffer),", ")+"IV: 0x".concat(this.uG.iv)),new(0,R.ModuleManager.get(_.ModuleName.Crypto).CryptoApi)(this.context,"AES-CBC",this.uG.buffer,this.uG.iv,this.UF).decrypt(e).then(function(e){if(!e||0===e.byteLength)throw{reason:a.ERROR_DECRYPTING};return e}).catch(function(){throw{reason:a.ERROR_DECRYPTING}})):(this.SF.debug("Error decrypting AES-128-encrypted segment, missing key or IV"),Promise.reject({reason:a.ERROR_DECRYPTING})):(this.context.eventHandler.fireError(new B.PlayerModuleMissingError(_.ModuleName.Crypto)),Promise.reject({reason:a.ERROR_DECRYPTING}))},e.prototype.TG=function(e){var t=this,i=Promise.resolve(e);if(this.tG)i=this.nG.parseInitSegment(e),this.mG&&(i=i.then(function(e){return t.mG.load(t.nG.getKeyIds()).then(function(i){return t.nG.addKeys(i),Promise.resolve(e)})}));else if(this.nG.isEncrypted()){var n=M.FormatHelper.bytesToHex(this.nG.getKey());
1this.SF.debug("Decrypting SAMPLE-AES-encrypted segment ".concat(this.sG,", KEY: 0x").concat(n)),i=this.nG.decryptDataSegment(e)}return i.catch(function(){throw{reason:a.ERROR_DECRYPTING}})},e.prototype.UG=function(e,t){var i=this;if(void 0===t&&(t=!1),e instanceof ArrayBuffer){this.yG=new G.Stream;var n=Date.now();this.RG(e,t).then(function(t){i.vG===s.TERMINATED||i.vG===s.CANCELLING?i.yG.abort(a.CANCEL):(i.yG.add(i.QG(t)),i.yG.end());var r,o=i.pG[i.sG];if(e!==t&&o){var u=(0,P.toSeconds)(Date.now()-n),c=o.internalRepresentationId;i.context.store.dispatch((0,S.addMetricsValue)(i.UF,b.MetricType.DecryptionTime,{time:u,representationId:c})),i.context.logger.debug("Decrypted ".concat(i.UF," segment in: ").concat(null==u?void 0:u.toFixed(2),", quality: ").concat(null!=(r=null==c?void 0:c.representationId)?r:""))}}).catch(function(){return i.yG.abort(a.ERROR_DECRYPTING)}).finally(function(){return i.VG()})}else this.yG=e.transform(function(e){return i.zG.appendData(e),i.zG.getCompleteChunks()},function(){},function(e){return e.message}).transform(function(e){return i.QG(e)},function(){return i.VG()},function(e){i.SF.debug("Error handling fetch segment request",e);var t=a.ERROR_LOADING;return e.message===p.RequestError.Canceled&&(t=Z(i.vG)),i.VG(),t});return Promise.resolve(this.yG)},e.prototype.VG=function(){this.vG=s.IDLE,this.oG=null,this.zG&&this.zG.reset(),this.pG&&delete this.pG[this.sG]},e.prototype.dispose=function(){this.terminate(),(0,C.clearTimeoutIfDefined)(this.VF),(0,C.clearIntervalIfDefined)(this.WF),this.XF&&this.XF.dispose&&this.XF.dispose(),this.lG&&this.lG.dis
1pose(),R.ModuleManager.has(_.ModuleName.Crypto)&&R.ModuleManager.get(_.ModuleName.Crypto).WebWorkerCrypto.dispose(),this.XF=null,this.jG=null,this.kG=null,this.lG=null,this.sG=null,this.uG=null,this.pG={},this.qG=void 0,this.nG=null,this.TF=null},e.prototype.WG=function(){var e=this;this.wG=o(o({},(0,U.getLoaderConfig)(this.context,this.UF)),{onSuccess:this.NG,onProgress:this.MG,onFailure:function(t,i){var n,r;e.context.store.dispatch((0,S.addMetricsValue)(e.UF,b.MetricType.DownloadSuccess,!1)),(null==i?void 0:i.name)===p.RequestError.TimedOut&&(e.vG=s.TIMEOUT),(0,C.clearTimeoutIfDefined)(e.VF),e.VF=void 0,(0,C.clearIntervalIfDefined)(e.WF),e.WF=void 0,delete e.pG[e.sG],e.TF.dispatchEvent(h.PlayerEvent.SegmentRequestFinished,{success:!1,httpStatus:t&&t.status||0,url:null!=(n=null==t?void 0:t.url)?n:e.sG,downloadTime:-1,size:-1,duration:e.rG,isInit:e.tG,mimeType:e.UF,uid:void 0,timeToFirstByte:null!=(r=null==t?void 0:t.timeToFirstByte)?r:-1})}})},e}()},71018:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentLoaderPool=void 0,t.getLoaderPoolSize=m;var n=i(91678),r=i(46151),o=i(33436),a=i(15971),s=i(94685),u=i(85434),c=i(23068),d=i(88052),l=i(62756),h=i(39523),p=i(99529),f=i(65439),g=i(65244);function m(e,t){var i=u.MimeTypeHelper.extractContentType(e);return t&&(0,c.isNumber)(t[i])?Math.max(1,t[i]):1}function v(e){return!!(null==e?void 0:e.LA_URL)}function y(e){return(null==e?void 0:e.length)>0}t.SegmentLoaderPool=function(){function e(e,t){this.context=e,this.oZ=e.sourceContext,this.lZ=t.mimeType,this.mZ=[],this.nZ=t.shouldDownloadBeCancelledCallback,this.addLoaders(m(this.lZ,e.settings.SEGMENT_LOADER_POOL_SIZE)),this.rZ()}return e.prototype.addLoaders=function(e){for(var t=0;t<e;t++)this.mZ.push(new g.SegmentLoader(this.context,this.lZ,this.nZ,this.oZ))},e.prototype.pZ=function(e){if(this.context.segmentPrefetchingService&&this.context.segmentPrefetchingService.hasMp4Decrypter(this.lZ,this.oZ))return this.context.segmentPrefetchingService.getDecrypter(this.lZ,this.oZ);var t=d.ModuleManager.get(l.ModuleName.Crypto).createDecrypter,i=y(e.drm.clearkey)?e.drm.clearkey:[];return t(this.context,this.lZ,i)},e.prototype.qZ=function(e){return new(0,d.ModuleManager.get(l.ModuleName.Crypto).ClearKeyLoader)(this.context,e)},e.prototype.rZ=function(){var e,t,i=this.oZ.source,n=y(null==(e=null==i?void 0:i.drm)?void 0:e.clearkey)||v(null==(t=null==i?void 0:i.drm)?void 0:t.clearkey)?this.pZ(i):null;if(n&&(this.mZ.forEach(function(e){return e.attachDecrypter(n)}),this.context.segmentPrefetchingService&&this.context.segmentPrefetchingService.setDecrypter(n,this.lZ,this.oZ),v(i.drm.clearkey))){var r=this.qZ(i.drm.clearkey);this.mZ.forEach(function(e){return e.attachClearKeyLoader(r)})}},e.prototype.isLoading=function(){return this.mZ.some(function(e){return e.isLoading()})},e.prototype.isFreeLoaderAvailable=function(){return this.mZ.some(function(e){return!e.isLoading()})},e.prototype.sZ=function(e){var t=(0,r.getMetricsHistoryFromInstanceState)(this.context.store.getState(),"default",o.MetricType.RequestedRepresentations);(t?t.map(function(e){return e.value}):[]).includes(e)||this.context.store.dispatch((0,n.addMetricsValue)("default",o.MetricType.RequestedRepresentations,e))},e.prototype.load=function(e){var t=this.mZ.find(function(e){return!e.isLoading()});if(!t)return this.context.logger.debug("Failed to load segment. No free loader!",e.url),Promise.reject(null);this.sZ(e.internalRepresentationId),this.context.logger.debug("[SegmentLoader ".concat(this.mZ.indexOf(t),"][").concat(e.mimeType,"][").concat(e.representationId,"] Loading ").concat(e.startTime," ").concat(e.url));var i=(0,f.getSegmentInfoTimeRange)(e),n=(0,p.getTrackIdentifier)(e),r=(0,a.getSourceStore)(this.context);return i&&(null==r||r.dispatch((0,h.addStreamTimeRange)(n,i,p.StreamTimeRangeType.Loading))),t.load(e).catch(function(e){throw i&&(null==r||r.dispatch((0,h.removeStreamTimeRange)(n,i,p.StreamTimeRangeType.Loading))),e})},e.prototype.cancelLoading=function(){var e=this;return Promise.all(this.mZ.map(function(e){return e.isLoading()&&e.cancelLoading(),Promise.resolve(e.getCurrentLoadPromise())})).then(function(){}).catch(function(t){(null==t?void 0:t.reason)!==g.SegmentLoadingErrorReason.CANCEL&&(0,s.isContextAvailable)(e.context)&&e.context.logger.debug("Error while loading a segment ",t)})}
1,e.prototype.getLoadingPeriodIds=function(){return this.mZ.flatMap(function(e){return e.getAllLoadingPeriodIds()})},e.prototype.dispose=function(){this.cancelLoading(),this.mZ.forEach(function(e){return e.dispose()}),this.mZ=null},e}()},98892:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentPreProcessor=void 0;var n=i(80813),r=i(3714),o=i(91678),a=i(33436),s=i(15971),u=i(85434),c=i(66502),d=i(88052),l=i(62756),h=i(23940),p=i(39523),f=i(99529),g=i(60729),m=i(73794),v=i(37641),y=i(77286),S=i(65439),T=i(63066);function b(e,t){return!t.isAvMuxedTogether||u.MimeTypeHelper.isVideo(e.getMimeType())}function M(e){return u.MimeTypeHelper.isSubtitle(e.getMimeType())}t.SegmentPreProcessor=function(){function e(e,t,i,r,o,a,s){this.context=e,this.mimeType=t,this.onDataAvailableCallback=i,this.hls=r,this.segmentUnavailabilityHandler=o,this.timestampOffsetService=a,this.segmentParser=s,this.ZG=!1,this.aG=null;var u=e.sourceContext.sourceIdentifier;this.XG=this.context.serviceManager.get(n.ServiceName.ManifestService,u)}return Object.defineProperty(e.prototype,"cG",{get:function(){return this.context.logger},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dG",{get:function(){return this.context.eventHandler},enumerable:!1,configurable:!0}),e.prototype.setHlsTimelineTracker=function(e){this.YG=e},e.prototype.setMpdHandler=function(e){this.bG=e},e.prototype.onMuxedSegmentAvailable=function(e,t,i,n){var r=this,o=t.find(function(e){return b(e,r.hls)});if(o){var a,u,c,d,l,h,g=!o.getRepresentationId().equals(this.aG),m=this.tH(o,i,g),v=m.shouldMakeSegmentAvailable,y=m.shouldCacheSegment;v?t.forEach(function(t){var o=e.metadata[e.transmuxedSegments.indexOf(t)];r.onSegmentAvailable(t,o,i,n)||n.cacheSegment(e.originalSegment)}):(y&&n.cacheSegment(e.originalSegment),a=e.originalSegment,u=this.context,c=(0,s.getSourceStore)(u),d=a.getSegmentInfo(),l=(0,S.getSegmentInfoTimeRange)(d),h=(0,f.getTrackIdentifier)(d),c&&l&&c.dispatch((0,p.removeStreamTimeRange)(h,l,f.StreamTimeRangeType.Loading)))}},e.prototype.onSegmentAvailable=function(e,t,i,n){var r,o,a;return this.cG.debug("onSegmentAvailable ".concat(e.getMimeType()).concat(e.isInit()?" init":""," segment [").concat(e.getUrl(),"]")),this.segmentUnavailabilityHandler.downloadSuccess(e.isInit()),null==(o=(r=this.bG).generateSmoothInitSegment)||o.call(r,e,this.segmentParser),this.hls.isTransmuxingRequired||c.TextSegmentAnalyzer.isPlainTextPayload(e.getData())||null==(a=this.segmentParser)||a.parseSegment(e),!!e.isInit()||this.eG(e,t,i,n)},e.prototype.eG=function(e,t,i,r){var o,a,u,d,l,h,g,v,y,T,I=this,P=!e.getRepresentationId().equals(this.aG);b(e,this.hls)&&P&&this.gG(e,this.aG);var C=this.hls.isTransmuxingRequired,E=!0;if(this.XG.isHlsManifest()){if(this.fG(e),!C&&!c.TextSegmentAnalyzer.isPlainTextPayload(e.getData())){(isNaN(this.bG.getTimestampOffset())||0===this.bG.getTimestampOffset())&&(0,m.initializeHlsSegmentStartTimes)(e,this.context,this.bG),this.timestampOffsetService.maybeAdjustTimestampOffsetAtDiscontinuityChange(e,this.bG)&&(null==(g=this.segmentParser)||g.parseSegment(e));var A=this.tH(e,i,P),R=A.shouldMakeSegmentAvailable,_=A.shouldCacheSegment;if(!R)return _&&r.cacheSegment(e),!1}M(e)&&this.timestampOffsetService.maybeAdjustTimestampOffsetAtDiscontinuityChange(e,this.bG),this.XG.initSegmentStartTimesFromReferenceSegment(e)}if(C&&this.hls.possiblyDependentSegments&&P&&b(e,this.hls)&&!this.ZG){this.cG.debug("Just switched playlists, isIndependentlyDecodable=".concat(e.isIndependentlyDecodable(),", (").concat(e.getMimeType(),", ").concat(e.getUrl(),")"));var B=this.bG.getIndex()>1;!e.isIndependentlyDecodable()&&B&&(this.cG.debug("Started keyframe recovery"),this.bG.setIndex(this.bG.getIndex()-2),E=!1,this.hls.discardNextSegment=!0,this.ZG=!0)}if(!E)return!1;o=this.context,a=(0,s.getSourceStore)(o),u=e.getSegmentInfo(),d=(0,S.getSegmentInfoTimeRange)(u),l=e.getPlaybackTimeRange(),h=(0,f.getTrackIdentifier)(u),a&&d&&l&&(a.dispatch((0,p.removeStreamTimeRange)(h,d,f.StreamTimeRangeType.Loading)),a.dispatch((0,p.addStreamTimeRange)(h,l,f.StreamTimeRangeType.Loading))),this.context.serviceManager.get(n.ServiceName.TimedMetadataService).onSegmentAvailable({segment:e,extractedMetadata:t,isSegmentOfMainStream:b(e,this.hls),presentationTimeOffset:this.bG.getTimestampOffset()}),this.context.serviceManager.maybeCall(n.ServiceName.SubtitleService,function(i){i.handleClosedCaptions(I.bG,e,null==t?void 0:t.closedCaptions,C)},void 0,null==(v=this.context.sourceContext)?void 0:v.sourceIdentifier);var D=e.getPlaybackTime(),O=null==(y=e.getSegmentInfo())?void 0:y.startTime,L=O?Math.abs(D-O):void 0;return this.cG.debug("[".concat("SegmentPreProcessor","][").concat(e.getMimeType(),"]: playbackTimeForSegment=").concat(D," expected=").concat(O," (diff=").concat(null==L?void 0:L.toFixed(3),") ").concat(e.getUrl())),b(e,this.hls)&&(null==(T=this.YG)||T.trackPlaybackTime(e),this.ZG=!1),this.onDataAvailableCallback(e),E},e.prototype.fG=function(e){var t=d.ModuleManager.get(l.ModuleName.LowLatency,!1);(0,g.isPlayingLowLatencyHls)(this.context)&&t&&t.applyUpdatedSegmentInfoProps(e,this.XG)},e.prototype.gG=function(e,t){this.hG(e.getMimeType(),t,e.getRepresentationId());var i=e.getSegmentInfo(),n={id:i.representationId,bitrate:i.bitrate,width:i.width,height:i.height};this.context.store.dispatch((0,o.addMetricsValue)(this.mimeType,a.MetricType.DownloadedRepresentation,n)),this.aG=e.getRepresentationId()},e.prototype.hG=function(e,t,i){if(u.MimeTypeHelper.isVideo(e))n=r.PlayerEvent.VideoDownloadQualityChanged;else{if(!u.MimeTypeHelper.isAudio(e))return;n=r.PlayerEvent.AudioDownloadQualityChanged}var n,o=(0,h.representationToQuality)(this.XG.getRepresentationById(t),e),a=(0,h.representationToQuality)(this.XG.getRepresentationById(i),e);this.dG.dispatchEvent(n,{targetQuality:a,targetQualityId:a.id,sourceQuality:o,sourceQualityId:o?o.id:null})},e.prototype.sH=function(e,t){var i={hasGap:!1};if(e&&this.XG.isHlsManifest()&&!M(e)&&b(e,this.hls)&&this.YG){var n=y.SegmentInfoProvider.findHlsRepresentationForSegment(e,this.XG.getAdaptationSet(t));if(n&&(i=this.YG.checkForTimelineGap(e,n.representation,n.index)).hasGap&&void 0!==i.correctedIndex){this.cG.debug("Encountered timeline gap (".concat(i.gapSizeSec,"), just loaded ").concat(e.getUrl()));var r=n.representation._internalId,o=this.bG instanceof T.SegmentListMPDHandler&&this.bG.getSegmentListEntries(r)&&this.bG.getSegmentListEntries(r)[i.correctedIndex];if(o&&(0,v.areSegmentsIdentical)(e.getSegmentInfo(),o))return this.cG.debug("Gap handling: Segment is identical to the one we just loaded, not rewinding"),i.hasGap=!1,i;o&&o.hasDownloadFailed?(this.cG.debug("Gap handling: Could not handle gap, segment has failed to download"),i.couldHandle=!1):(this.cG.debug("Gap handling: Correcting index from ".concat(this.bG.getIndex()," to ").concat(i.correctedIndex)),this.bG.setIndex(i.correctedIndex))}}return i},e.prototype.tH=function(e,t,i){if(!(this.YG.isGapVerificationNeeded()||this.YG.isSeekTargetVerificationNeeded()||i))return{shouldMakeSegmentAvailable:!0,shouldCacheSegment:!1};var n,r=this.sH(e,t);return r.hasGap?r.couldHandle?(null!=(n=r.gapSizeSec)?n:0)>0?{shouldMakeSegmentAvailable:!1,shouldCacheSegment:!0}:{shouldMakeSegmentAvailable:!1,shouldCacheSegment:!1}:(this.YG.reset(),{shouldMakeSegmentAvailable:!0,shouldCacheSegment:!1}):{shouldMakeSegmentAvailable:!0,shouldCacheSegment:!1}},e.prototype.dispose=function(){this.aG=null,this.YG=null,this.XG=null,this.onDataAvailableCallback=null,this.hls=null,this.segmentUnavailabilityHandler=null,this.timestampOffsetService=null,this.segmentParser=null,this.bG=null},e}()}
1,11991:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentPrefetcher=void 0;var n=i(94685),r=i(19483),o=i(65244);t.SegmentPrefetcher=function(){function e(e){var t=this;this.LH=0,this.MH=function(e){var i=t.FH.get(e);i&&0!==i.length&&t.NH(i.shift()).then(function(){return t.MH(e)})},this.FH=new r.ArrayMap,this.HH=new Map,this.GH=new Map,this.IH=new Map,this.JH=e,this.KH=new Map}return e.prototype.updateContext=function(e,t){this.DH=e,this.EH=null!=t?t:e.sourceContext},e.prototype.setShouldDownloadBeCancelledCallback=function(e,t){this.KH.set(e,t)},e.prototype.removeShouldDownloadBeCancelledCallback=function(e){this.KH.delete(e)},e.prototype.setDecrypter=function(e,t){this.GH.set(t,e),this.IH.has(t)&&this.IH.get(t).attachDecrypter(e)},e.prototype.removeDecrypter=function(e){this.GH.delete(e)},e.prototype.getDecrypter=function(e){return this.GH.get(e)},e.prototype.prefetchSegment=function(e){return this.NH(e)},e.prototype.prefetchSegments=function(e){var t=this;e.forEach(function(e){return t.FH.add(e.mimeType,e)}),this.FH.keys.forEach(function(e){return t.MH(e)})},e.prototype.NH=function(e){var t=this,i=this.LH,n=this.PH(e.mimeType).then(function(){return i===t.LH?t.OH(e):void 0}).then(function(){}).catch(function(){});return this.HH.set(e.mimeType,n),n},e.prototype.OH=function(e){var t=this;if(!(0,n.isContextAvailable)(this.DH))return Promise.reject("PlayerContext not available");var i=this.QH(e).load(e).then(function(e){return e.read()}).then(function(e){return e.value});return this.JH.onPrefetch({segmentInfo:e,loadingPromise:i}),i.catch(function(i){(0,n.isContextAvailable)(t.DH)&&t.DH.logger.debug("segment prefetching failed for",e,"with",i)}),i},e.prototype.PH=function(e){return this.HH.has(e)||this.HH.set(e,Promise.resolve()),this.HH.get(e)},e.prototype.QH=function(e){return this.IH.has(e.mimeType)||this.IH.set(e.mimeType,this.RH(e)),this.IH.get(e.mimeType)},e.prototype.RH=function(e){this.HH.set(e.mimeType,Promise.resolve());var t=new o.SegmentLoader(this.DH,e.mimeType,this.SH(e),this.EH,!0);return t.attachDecrypter(this.GH.get(e.mimeType)),t},e.prototype.SH=function(e){var t=this;return function(i){var n=e.mimeType,r=t.IH.get(n),o=r?r.getCurrentLoadingSegmentInfo():null,a=void 0!==n?t.KH.get(n):void 0,s=o?o.internalRepresentationId:e.internalRepresentationId;return void 0!==a&&a(i,s)}},e.prototype.clearPrefetchingQueue=function(e){this.FH.delete(e)},e.prototype.clearPrefetchingQueues=function(){this.FH.clear(),this.LH++},e.prototype.reset=function(){this.FH.clear(),this.LH++,this.IH.forEach(function(e){return e.dispose()}),this.KH.clear(),this.IH.clear(),this.GH.clear()},e.prototype.dispose=function(){this.reset(),this.IH=null,this.KH=null},e}()},54015:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentPrefetchingService=void 0;var n=i(25248),r=i(11991);t.SegmentPrefetchingService=function(){function e(){this.Bf=new Map,this.Cf=new Map}return e.prototype.updatePlayerContext=function(e){this.Af=e;var t,i,n=null==(t=e.sourceContext)?void 0:t.sourceIdentifier;n&&(null==(i=this.Bf.get(n))||i.updateContext(e))},e.prototype.setDecrypter=function(e,t,i){this.Ef(i).setDecrypter(e,t)},e.prototype.removeDecrypter=function(e,t){this.Ef(t).removeDecrypter(e)},e.prototype.getDecrypter=function(e,t){return this.Ef(t).getDecrypter(e)},e.prototype.hasMp4Decrypter=function(e,t){return!!this.getDecrypter(e,t)},e.prototype.setShouldDownloadBeCancelledCallback=function(e,t,i){this.Ef(i).setShouldDownloadBeCancelledCallback(e,t)},e.prototype.removeShouldDownloadBeCancelledCallback=function(e,t){this.Ef(t).removeShouldDownloadBeCancelledCallback(e)},e.prototype.fetch=function(e,t){var i=this,r=t.sourceIdentifier;return this.Ef(t).prefetchSegment(e).then(function(){var t,o,a=e.mimeType?null==(o=null==(t=i.Gf(r))?void 0:t.get(e.mimeType))?void 0:o.get((0,n.getSegmentInfoId)(e)):void 0;return a?Promise.resolve(a.loadingPromise):Promise.reject()})},e.prototype.fetchAll=function(e,t){this.Ef(t).prefetchSegments(e)},e.prototype.hasPrefetchedSegment=function(e,t){return!!this.Df(e,t)},e.prototype.getPrefetchedSegment=function(e,t){var i=this.Df(e,t);return i?i.loadingPromise:null},e.prototype.Df=function(e,t){var i,r,o=t.sourceIdentifier,a=this.Gf(o
1);return e.mimeType&&(null==a?void 0:a.has(e.mimeType))&&null!=(r=null==(i=a.get(e.mimeType))?void 0:i.get((0,n.getSegmentInfoId)(e)))?r:null},e.prototype.getPrefetchedSegments=function(e){return this.Gf(e.sourceIdentifier)},e.prototype.removePrefetchedSegment=function(e,t){var i=t.sourceIdentifier,r=this.Gf(i);e.mimeType&&(null==r?void 0:r.has(e.mimeType))&&r.get(e.mimeType).delete((0,n.getSegmentInfoId)(e))},e.prototype.clearPrefetchingQueue=function(e,t){var i=t.sourceIdentifier,n=this.Bf.get(i);null==n||n.clearPrefetchingQueue(e)},e.prototype.clearPrefetchingQueues=function(e){var t;null==(t=this.Bf.get(e))||t.clearPrefetchingQueues()},e.prototype.disposeSource=function(e){var t,i=this.Bf.get(e);i&&(i.dispose(),this.Bf.delete(e)),null==(t=this.Cf)||t.delete(e)},e.prototype.reset=function(){this.Bf.forEach(function(e){return e.reset()}),this.Bf.clear(),this.Cf.clear()},e.prototype.dispose=function(){this.Bf.forEach(function(e){return e.dispose()}),this.Bf.clear(),this.Cf=null},e.prototype.Ef=function(e){var t=this,i=e.sourceIdentifier;if(!this.Bf.has(i)){var n=new r.SegmentPrefetcher({onPrefetch:function(e){return t.Ff(i,e)}});n.updateContext(this.Af,e),this.Bf.set(i,n)}return this.Bf.get(i)},e.prototype.Ff=function(e,t){var i,r=t.segmentInfo.mimeType;if(void 0!==r){var o=this.Hf(e);o.has(r)||o.set(r,new Map),null==(i=o.get(r))||i.set((0,n.getSegmentInfoId)(t.segmentInfo),t)}},e.prototype.Gf=function(e){return this.Cf.get(e)},e.prototype.Hf=function(e){return this.Cf.has(e)||this.Cf.set(e,new Map),this.Gf(e)},e}()},44552:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentManager=t.SegmentService=void 0;var n=i(56481),r=i(44468),o=i(85434),a=i(15487),s=i(37641),u=i(71018),c=i(97587),d=i(87300),l=i(88401);t.SegmentService=function(){function e(e){var t=this;this.context=e,this.AD=function(e){t.yD.has(e)&&(t.yD.get(e).dispose(),t.yD.delete(e))},this.yD=new Map}return e.prototype.zD=function(e,t){var i=void 0===t?{}:t,n=i.id,r=i.lang;return o.MimeTypeHelper.isSubtitle(e)?[e,n,r].filter(Boolean).join("-"):e},e.prototype.add=function(e,t,i){var n=this.get(e.mimeType,i);return n||(n=this.createSegmentManager(e,t),this.yD.set(this.zD(e.mimeType,i),n)),n},e.prototype.createSegmentManager=function(e,t){return new h(this.context,e,t)},e.prototype.get=function(e,t){return this.yD.get(this.zD(e,t))},e.prototype.disposeOfType=function(e,t){this.AD(this.zD(e,t))},e.prototype.dispose=function(){this.yD.forEach(function(e){return e.dispose()}),this.yD.clear()},e}();var h=function(){function e(e,t,i){var n=this;this.context=e,this.segmentParser=i,this.QE=!1,this.OE=new u.SegmentLoaderPool(e,t),this.DD=new l.UrlInitSegmentProvider(e,t.mimeType),this.BD=new s.SegmentCache(e.settings.MAX_NUM_CACHED_SEGMENTS);var r=o.MimeTypeHelper.getMediaType(t.mimeType);this.ZE(r)&&(this.CD=new d.TimeWindowSegmentCache(t.mimeType,function(){return n.YE(r)})),this.PE=Promise.resolve(null)}return e.prototype.getSegment=function(e){var t=e.isInitSegment?this.RE(e).then(function(e){return p(e)}):this.SE(e);return this.PE=this.PE.catch(function(){}).then(function(){return t}),this.PE},e.prototype.RE=function(e){var t=this;return this.DD.getSegment(e).then(function(e){var i;return null==(i=t.segmentParser)||i.parseSegment(e),e}).catch(function(e){return t.context.logger.debug("Error during loading an init segment",e),Promise.reject(e)})},e.prototype.SE=function(e){var t,i=this;(null==(t=e.key)?void 0:t.method)&&(this.QE=!0);var n=this.TE(e);return(this.UE()?this.VE(n,e):this.WE(n,e)).then(function(e){var t=e[0],n=e[1];return t.transform(function(e){var t;return i.aE(e,n),null==(t=i.CD)||t.add(e),e},function(){},function(e){return i.context.logger.debug("Loading failed",e),e.message})})},e.prototype.TE=function(e){var t=Promise.resolve();if(e.init){var i=this.DD.getCachedSegment(e);t=i?Promise.resolve(i):this.RE(e.init)}return t},e.prototype.UE=function(){var e;return this.context.settings.DISABLE_PARALLEL_SEGMENT_LOADING||!!(null==(e=this.context.sourceContext.source.drm)?void 0:e.clearkey)||this.QE||(0,a.isTizen2016)()},e.prototype.VE=function(e,t){var i=this;return e.then(function(e){return i.XE(t).then(function(t){return[t,e]})})},e.prototype.WE=function(e,t){return Promise.all([this.XE(t),e])},e.prototype.XE=function(e){var t,i=this.getCachedSegment(e);
1if(null!=i)return this.context.logger.debug("Returning segment from cache for URL: ".concat(e.url)),Promise.resolve(p(i));var n=null==(t=this.CD)?void 0:t.get(e);return null!=n?(this.context.logger.debug("Returning segment from the forward buffer cache for URL: ".concat(e.url)),Promise.resolve(p(n))):this.OE.load(e)},e.prototype.YE=function(e){var t,i,n=null!=(i=null==(t=this.context.renderer)?void 0:t.getCurrentTime())?i:0;if(isFinite(n)&&!(n<=0))return{start:n,end:n+this.context.bufferSettings.getForwardTargetLevel(e)}},e.prototype.ZE=function(e){return e===r.MediaType.Video&&this.context.settings.SEGMENT_CACHE_MEDIA_TYPES.includes(e)&&!this.context.settings.CHUNKED_CMAF_STREAMING},e.prototype.aE=function(e,t){t&&e.setInitSegment(t)},e.prototype.isLoading=function(e){return e?this.OE.getLoadingPeriodIds().includes(e):this.OE.getLoadingPeriodIds().length>0},e.prototype.canLoad=function(){var e=this.OE.isFreeLoaderAvailable();return this.UE()?e&&!this.DD.isLoading():e},e.prototype.cacheSegment=function(e){this.BD.add(e)},e.prototype.hasCachedSegment=function(e){return!!this.getCachedSegment(e)},e.prototype.getCachedSegment=function(e){return e.isInitSegment?this.DD.getCachedSegment(e):this.BD.get(e)},e.prototype.removeCachedInitSegments=function(e){this.DD.removeCachedSegments(e)},e.prototype.clearCache=function(e){var t;void 0===e&&(e=!0),e&&this.DD.removeCachedSegments(function(){return!0}),this.BD.clear(),null==(t=this.CD)||t.clear()},e.prototype.cancel=function(){return this.OE.cancelLoading()},e.prototype.dispose=function(){this.cancel(),this.clearCache(!1),this.OE=(0,n.dispose)(this.OE),this.segmentParser=void 0,(0,n.dispose)(this.DD)},e}();function p(e){var t=new c.Stream;return t.add(e),t.end(),t}t.SegmentManager=h},87300:function(e,t,i){var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.TimeWindowSegmentCache=void 0;var r=i(17143),o=i(37641),a=i(65439);function s(e,t){return(0,o.areSegmentsIdentical)(t,e.info)}t.TimeWindowSegmentCache=function(){function e(e,t){this.mimeType=e,this.getRetentionWindow=t,this.tZ=[]}return e.prototype.get=function(e){var t=this.tZ.find(function(t){return s(t,e)});return t&&(0,r.createSegmentFromInfo)(t.info,this.mimeType,t.data.slice(0))},e.prototype.add=function(e){var t=e.getSegmentInfo(),i=t&&(0,a.getSegmentInfoTimeRange)(t);i&&!this.tZ.some(function(e){return s(e,t)})&&(this.tZ.push(n(n({},i),{info:t,data:e.getData().slice(0)})),this.uZ())},e.prototype.clear=function(){this.tZ=[]},e.prototype.uZ=function(){var e=this.getRetentionWindow();e&&(this.tZ=this.tZ.filter(function(t){return t.end>e.start&&t.start<=e.end}))},e}()},25902:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.TimestampOffsetService=void 0;var n=i(80813),r=i(85434),o=i(66502),a=i(88052),s=i(62756);t.TimestampOffsetService=function(){function e(e,t){this.context=e,this.mimeType=t,this.uH=new Map;var i=e.sourceContext.sourceIdentifier;this.vH=e.serviceManager.get(n.ServiceName.SourceStoreService,i)}return Object.defineProperty(e.prototype,"wH",{get:function(){return this.context.logger},enumerable:!1,configurable:!0}),e.prototype.maybeAdjustTimestampOffsetAtDiscontinuityChange=function(e,t){var i=e.getSegmentInfo().discontinuitySequenceNumber;if(null==i||e.isInit())return!1;var n=this.uH.get(e.getMimeType())!==i,r=isNaN(t.getTimestampOffset());if(n||r)this.xH(e,i,t);else if(e.getSegmentInfo().wasPrefetched){var o=this.yH(e,i);this.zH(e,o)}return this.uH.set(e.getMimeType(),i),!0},e.prototype.xH=function(e,t,i){var n=this.yH(e,t);this.AH(e,t,i),this.wH.debug("[".concat(this.mimeType,"] Initialized PTO for new discontinuity ").concat(t," to ").concat(n," on segment ").concat(e.getUrl())),i.setTimestampOffset(n),this.zH(e,n)},e.prototype.yH=function(e,t){var i,n,r=this.CH(e).encodedPlaybackTime,o=a.ModuleManager.get(s.ModuleName.HLS),u=null!=(i=null==o?void 0:o.selectors)?i:{},c=u.getHlsState,d=u.getPresentationTimeOffset,l=null==c?void 0:c(this.vH.getState());return l&&null!=(n=d(l,String(t)))?n:this.BH(e,r,t)},e.prototype.zH=function(e,t){var i=this.CH(e),n=i.encodedPlaybackTime,r=i.shouldUpdatePlaybackTime;e.getSegmentInfo().presentationTimeOffset=t,e.setPresentationTimeOffset(t),r&&e.setPlaybackTime(n-t)},e.prototype.AH=function(e,t,i){null==e.getSegmentInfo().startTime&&"extrapolateStartTimesFromDiscontinuityStarts"in i&&(this.wH.debug("[".concat(e.getMimeType(),"] Missing segment startTime when trying to calculate PTO for discontinuity ").concat(t)),i.extrapolateStartTimesFromDiscontinuityStarts(e))},e.prototype.BH=function(e,t,i){var n=t-e.getSegmentInfo().startTime,u=a.ModuleManager.get(s.ModuleName.HLS);return r.MimeTypeHelper.isSubtitle(e.getMimeType())&&o.TextSegmentAnalyzer.isPlainTextPayload(e.getData())||
1(this.vH.dispatch(u.actions.setPresentationTimeOffset(String(i),n)),this.wH.debug("[".concat(e.getMimeType(),"] Setting PTO for discontinuity ").concat(i," to ").concat(n))),n},e.prototype.CH=function(e){var t,i=a.ModuleManager.get(s.ModuleName.ContainerMP4,!1),n=!0,r=i?i.parsePlaybackTime(e,this.wH):e.getBaseMediaDecodeTime()/e.getTimescale();return isNaN(r)&&(r=null!=(t=e.getPlaybackTime())?t:e.getSegmentInfo().startTime,n=!1),{encodedPlaybackTime:r,shouldUpdatePlaybackTime:n}},e.prototype.dispose=function(){this.uH=null,this.vH=null},e}()},88401:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.UrlInitSegmentProvider=void 0;var n=i(91678),r=i(33436),o=i(37641),a=i(71018);t.UrlInitSegmentProvider=function(){function e(e,t){this.yZ={},this.vZ=e,this.wZ=new a.SegmentLoaderPool(e,{mimeType:t,shouldDownloadBeCancelledCallback:function(){return!1}}),this.xZ=new o.SegmentCache(1/0)}return e.prototype.getSegment=function(e){var t=this,i=this.xZ.get(e);return i?Promise.resolve(i):null!=this.yZ[e.url]?this.yZ[e.url]:this.zZ(e).then(function(e){return t.AZ(e),e})},e.prototype.isLoading=function(){return this.wZ.isLoading()},e.prototype.zZ=function(e){var t=this;this.wZ.isFreeLoaderAvailable()||this.wZ.addLoaders(1),this.vZ.logger.debug("Loading init segment",e.url);var i=this.wZ.load(e).then(function(e){return e.read()}).then(function(t){if(!t.value)throw Error("SegmentStream error ".concat(e.url));return t.value}).finally(function(){delete t.yZ[e.url]});return this.yZ[e.url]=i,i},e.prototype.AZ=function(e){this.xZ.add(e),this.vZ.store.dispatch((0,n.addMetricsValue)(e.getMimeType(),r.MetricType.CachedInitSegments,{internalRepId:e.getSegmentInfo().internalRepresentationId}))},e.prototype.getCachedSegment=function(e){return this.xZ.get(e)},e.prototype.removeCachedSegments=function(e){this.xZ.remove(e)},e.prototype.dispose=function(){this.xZ.clear(),this.wZ.dispose()},e}()},86659:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.applyBaseUrlsToSegmentInfo=function(e,t,i,o,a){var s=e.serviceManager.maybeCall(n.ServiceName.ManifestService,function(e){return e.getAvailableBaseURLsForRepresentation(i)},void 0,t.sourceIdentifier),u=e.serviceManager.maybeCall(n.ServiceName.ManifestService,function(e){return e.isHlsManifest()},!1,t.sourceIdentifier);o.availableBaseURLs=s,o.firstUsedBaseURLIndex=0,(null==a?void 0:a.lastUsedBaseURLIndex)&&(o.firstUsedBaseURLIndex=a.lastUsedBaseURLIndex),o.lastUsedBaseURLIndex=o.firstUsedBaseURLIndex,u?(o.baseURL="",o.mediaURL||(o.mediaURL=o.url)):(o.baseURL=s[o.firstUsedBaseURLIndex],o.mediaURL=o.mediaURL||o.url),o.url=r.URLHelper.concatBaseUrlWithPartial(o.baseURL,o.mediaURL)};var n=i(80813),r=i(58313)},42456:function(e,t,i){var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.collectInitialSegmentInfos=function(e,t){var i=(0,a.getManifestService)(e,t.sourceIdentifier),u=e.serviceManager.get(r.ServiceName.AdaptationService);if(!i||!u)return Promise.resolve([]);var l=i.getFirstPeriod();return l?Promise.all(l.AdaptationSet.reduce(function(e,t){return o.MimeTypeHelper.isAV(t._mimeType)&&!(0,o.isMediaTypeContained)(e,t._mimeType)&&e.push(t._mimeType),e},[]).map(function(e){return i.findAdaptationSet(l._id,e)}).filter(function(e){return!!e}).map(function(i){var r;return(r=c.MPDHandlerFactory.createInstance(e,t,i._mimeType,i))?Promise.resolve().then(function(){var o,a;return o=i.Representation.map(function(e){return n(n({},(0,s.representationToQuality)(e,i._mimeType)),{representation:e})}),a=u.selectQualityBasedOnBitrateMeasurement(o,i._mimeType).representation,r.setAdaptationSetId(i._internalId,a._internalId),r.updateRepresentation(a._internalId).then(function(){var n=r.getInitSegmentInfo(a._internalId);return n?[d(e,t,n,i._mimeType,a)]:[]}).then(function(n){return r.getNextSegmentInfo(0).then(function(r){return r&&n.push(d(e,t,r,i._mimeType,a)),n})})}).catch(function(t){return e.logger.debug("Failed to collect segment infos for mime type [".concat(i._mimeType,"]"),t),[]}).finally(function(){return r.dispose()}):Promise.resolve([])})).then(function(e){var t;return(t=[]).concat.apply(t,e)}):Promise.resolve([])};var r=i(80813),o=i(85434),a=i(96533),s=i(23940),u=i(86659),c=i(86219);function d(e,t,i,r,o){var a,s,c,d,l=n(n({},i),{mimeType:null!=(a=i.mimeType)?a:r,internalRepresentationId:null!=(s=i.internalRepresentationId)?s:o._internalId,codecs:null!=(c=i.codecs)?c:o._codecs,periodId:null!=(d=i.periodId)?d:o._internalId.periodId});return(0,u.applyBaseUrlsToSegmentInfo)(e,t,o._internalId,l),l}}
1,73794:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.initializeHlsSegmentStartTimes=function(e,t,i){var o=t.sourceContext.sourceIdentifier,a=t.serviceManager.get(n.ServiceName.ManifestService,o);if(a&&!a.getAllAdaptationSets().some(function(e){return e.Representation.some(function(e){var t,i;return void 0!==(null==(i=null==(t=e.SegmentList)?void 0:t[0].SegmentURL[0])?void 0:i._playbackTime)})})){var s=e.getRepresentationId();a.initializeSegmentStartTimesFromStart(s),(0,r.assignSegmentStartTimesFromHlsRepresentation)(i.getSegmentListEntries(e.getRepresentationId()),s,a)}};var n=i(80813),r=i(63066)},97587:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.Stream=void 0;var n=i(34841),r=i(24389),o=i(78006);t.Stream=function(){function e(){var e=this;this.Mf=function(){e.Kf&&!e.isEmpty()&&(e.Kf.resolve({done:!1,value:e.Jf.shift()}),e.Kf=null)},this.If=o.StreamState.Open,this.Jf=[],this.Lf=new n.Deferred,this.Lf.promise.catch(function(){})}return e.prototype.add=function(e){this.If===o.StreamState.Open&&(this.Jf.push(e),this.Mf())},e.prototype.read=function(){if(this.Kf)return Promise.reject({name:r.StreamReadError.ParallelRead});if(this.If===o.StreamState.Ended&&this.isEmpty())return Promise.resolve({done:!0});if(this.If===o.StreamState.Aborted)return Promise.reject({name:r.StreamReadError.Aborted,message:this.getError()});this.Kf=new n.Deferred;var e=this.Kf.promise;return this.Mf(),e},e.prototype.end=function(){this.If===o.StreamState.Open&&(this.If=o.StreamState.Ended,this.Kf&&this.isEmpty()&&(this.Kf.resolve({done:!0}),this.Kf=null),this.Lf.resolve())},e.prototype.abort=function(e){var t;if(this.If===o.StreamState.Open){this.If=o.StreamState.Aborted,this.error=e;var i={name:o.StreamState.Aborted,message:null!=(t=this.getError())?t:""};this.Kf&&(this.Kf.reject(i),this.Kf=null),this.Lf.reject(i)}},e.prototype.transform=function(t,i,n){var r=this,o=new e,a=function(){r.read().then(function(e){var n=e.done,r=e.value;if(n)i&&i(),o.end();else{var s=null!=r&&t(r);s&&o.add(s),a()}}).catch(function(e){n?o.abort(n(e)):o.abort(e)})};return a(),o},e.prototype.isEmpty=function(){return 0===this.Jf.length},e.prototype.getError=function(){return this.error||null},e}()},24389:function(e,t){var i,n;Object.defineProperty(t,"__esModule",{value:!0}),t.StreamReadError=void 0,(n=i||(t.StreamReadError=i={})).Aborted="aborted",n.ParallelRead="parallelread"},78006:function(e,t){var i,n;Object.defineProperty(t,"__esModule",{value:!0}),t.StreamState=void 0,(n=i||(t.StreamState=i={})).Open="open",n.Ended="ended",n.Aborted="aborted"},61800:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.DiscontinuityMonitor=void 0;var n=i(3714);t.DiscontinuityMonitor=function(){function e(e){var t=this;this.context=e,this.D2=function(){t.A2=!0},this.E2=function(){var e=t.context.internalPlayer.getCurrentTime();Object.values(t.B2).forEach(function(i){e>=i.playbackTime&&i.playbackTime+i.duration>=e&&t.maybeFirePeriodSwitchEvents(i)}),t.B2={},t.A2=!1},this.z2={},this.B2={},this.A2=!1,this.C2=[],this.context.eventHandler.on(n.PlayerEvent.Seek,this.D2,!0),this.context.eventHandler.on(n.PlayerEvent.Seeked,this.E2,!0)}return e.prototype.trackIncomingDiscontinuity=function(e,t,i,n){this.z2[t]?this.A2&&(this.B2[t]={mimeType:t,discontinuitySequenceNumber:e,playbackTime:i,duration:n}):this.z2[t]={discontinuitySequenceNumber:e,startTime:i||0},this.C2.includes(e)||this.C2.push(e)},e.prototype.isDiscontinuityExpected=function(e){return this.C2.includes(e)},e.prototype.reset=function(){this.C2=[]},e.prototype.maybeFirePeriodSwitchEvents=function(e){var t=e.mimeType,i=e.discontinuitySequenceNumber,r=e.playbackTime;if(null!=i&&this.z2[t]){var o=this.z2[t].discontinuitySequenceNumber;o!==i&&(this.F2(t,i,r)&&(this.context.eventHandler.dispatchEvent(n.PlayerEvent.PeriodSwitch),this.context.eventHandler.dispatchEvent(n.PlayerEvent.PeriodSwitched,{sourcePeriod:{periodId:String(o)},targetPeriod:{periodId:String(i)}})),this.z2[t]={discontinuitySequenceNumber:i,startTime:r})}},e.prototype.F2=function(e,t,i){var n=this,r=Object.keys(this.z2).filter(function(t){return t!==e}),o=!0;return r.forEach(function(e){var r=n.z2[e];r.discontinuitySequenceNumber===t&&1>Math.abs(i-r.startTime)&&(o=!1)}),o},e.prototype.dispose=function(){this.context.eventHandler.off(n.PlayerEvent.Seek,this.D2),this.context.eventHandler.off(n.PlayerEvent.Seeked,this.E2)},e}()}
1,86163:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.PeriodSwitchMonitor=void 0;var n=i(15971),r=i(42208),o=i(88935);t.PeriodSwitchMonitor=function(){function e(e){this.context=e,this.G2=[]}return e.prototype.isPeriodExpected=function(e){return this.G2.includes(e)},e.prototype.trackIncomingPeriod=function(e){this.G2.includes(e)||this.G2.push(e)},e.prototype.maybeHandlePeriodSwitch=function(e){var t=(0,n.getSourceStore)(this.context),i=null==t?void 0:t.getState();if(t&&i){var a=e.periodId,s=(0,o.getPlayingPeriodId)(i);a&&a!==s&&this.G2.includes(a)&&(t.dispatch((0,r.periodSwitchStarted)(a)),t.dispatch((0,r.periodSwitchFinished)(a)))}},e.prototype.reset=function(){this.G2=[]},e.prototype.dispose=function(){this.G2=[]},e}()},87187:function(e,t,i){var n,r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentInitType=t.Segment=void 0;var o,a=i(74853),s=i(85434),u=i(65439);t.Segment=function(){function e(e,t,i,n,r,s,u,c,d,l){void 0===s&&(s=o.NONE),this.lO=[],this.data=e,this.gO=t,this.hO=i,this.fO=n,this.iO=r,this.jO=s,this.kO=u,this.nO=!1,this.XO={subtitles:[]},this.oO=c,this.pO=d,this.aO=l,this.qO=!1,this.tO=null,e instanceof ArrayBuffer||"string"==typeof e&&(this.data=a.ArrayHelper.stringToArrayWithoutEncoding(e).buffer)}return e.prototype.setDrmKid=function(e){this.vO=e},e.prototype.hasDrmKid=function(){return!!this.getDrmKid()},e.prototype.getDrmKid=function(){var e,t,i;return null!=(i=null!=(e=this.vO)?e:null==(t=this.uO)?void 0:t.getDrmKid())?i:void 0},e.prototype.setDrmInitData=function(e){this.tO=e},e.prototype.hasDrmInitData=function(){var e;return(null==(e=this.tO)?void 0:e.length)>0},e.prototype.getDrmInitData=function(){return this.hasDrmInitData()?this.tO:[]},e.prototype.getMimeType=function(){return this.gO},e.prototype.isInit=function(){return this.jO===o.INIT},e.prototype.isSelfInit=function(){return this.jO===o.SELF_INIT},e.prototype.isEncrypted=function(){return this.nO},e.prototype.setEncrypted=function(e){this.nO=e},e.prototype.setUrl=function(e){this.YO=e},e.prototype.getUrl=function(){return this.YO},e.prototype.getData=function(){return this.data},e.prototype.setData=function(e){this.data=e},e.prototype.getMetadata=function(){return this.XO},e.prototype.setMetadata=function(e){this.XO=e},e.prototype.getPlaybackTime=function(){return this.aO},e.prototype.setPlaybackTime=function(e){this.aO=e},e.prototype.getPlaybackEndTime=function(){return this.aO+this.iO},e.prototype.getPlaybackTimeRange=function(){return this.iO?{start:this.getPlaybackTime(),end:this.getPlaybackEndTime()}:(0,u.getSegmentInfoTimeRange)(this.getSegmentInfo())},e.prototype.getBaseMediaDecodeTime=function(){return this.cO},e.prototype.setBaseMediaDecodeTime=function(e){this.cO=e},e.prototype.getPresentationTimeOffset=function(){return this.dO},e.prototype.setPresentationTimeOffset=function(e){this.dO=e},e.prototype.getTFDTBoxOffsets=function(){return this.bO},e.prototype.setTFDTBoxOffsets=function(e){this.bO=e},e.prototype.wO=function(e){var t;return this.getParserMetadata()&&this.getParserMetadata()[e]?this.getParserMetadata()[e]:(null==(t=this.getInitSegment())?void 0:t.getParserMetadata())?this.getInitSegment().getParserMetadata()[e]:void 0},e.prototype.getTimescale=function(){return this.wO("timescale")},e.prototype.getIvSize=function(){return this.wO("ivSize")},e.prototype.getDefaultSampleDuration=function(){return this.wO("defaultSampleDuration")},e.prototype.getDefaultSampleSize=function(){return this.wO("defaultSampleSize")},e.prototype.setTimescale=function(e){this.updateParserMetadata({timescale:e})},e.prototype.getPeriodId=function(){return this.fO},e.prototype.getCodec=function(){return this.hO},e.prototype.setCodec=function(e){this.hO=e},e.prototype.getDuration=function(){return this.iO},e.prototype.setDuration=function(e){this.iO=e},e.prototype.getNetworkRequestSize=function(){return this.oO},e.prototype.getRepresentationId=function(){return this.pO},e.prototype.getParsedData=function(){return this.ZO},e.prototype.setParsedData=function(e){this.ZO=e},e.prototype.getSegmentInfo=function(){return this.eO},e.prototype.isIndependentlyDecodable=function(){return this.kO},e.prototype.setSegmentInfo=function(e){this.eO=e},e.prototype.getMediaInfo=function(){var e={};return this.eO&&this.eO.bitrate&&(e.bitrate=this.eO.bitrate),s.MimeTypeHelper.isAudio(this.gO)?this.eO&&this.eO.sampleRate&&(e.sampleRate=this.eO.sampleRate):s.MimeTypeHelper.isVideo(this.gO)&&(this.eO&&this.eO.width&&(e.width=this.eO.width),this.eO&&this.eO.height&&(e.height=this.eO.height),this.eO&&this.eO.frameRate&&(e.frameRate=this.eO.frameRate)),e},e.prototype.isDirty=function(){return this.qO},e.prototype.setDirty=function(e){this.qO=e},e.prototype.setInbandEvents=function(e){this.lO=e},e.prototype.getInbandEvents=function(){return this.lO},e.prototype.setLastSegment=function(e){this.mO=e},e.prototype.isLastSegment=function(){return this.mO},e.prototype.wasLoadedFrom=function(e){return this.getUrl().includes(e)},e.prototype.getParserMetadata=function(){return this.rO},e.prototype.setParserMetadata=function(e){this.rO=e},e.prototype.updateParserMetadata=function(e){this.rO=r(r({},this.rO),e)},e.prototype.setBufferBlockId=function(e){this.sO=e},e.prototype.getBufferBlockId=function(){return this.sO},e.prototype.setInitSegment=function(e){this.uO=e},e.prototype.getInitSegment=function(){return this.uO},e}(),(n=o||(t.SegmentInitType=o={}
vendor: 10,158 bytes, line 1
1))[n.NONE=0]="NONE",n[n.INIT=1]="INIT",n[n.SELF_INIT=2]="SELF_INIT"},50827:function(e,t){function i(e){return[e.url,e.mediaURL].filter(Boolean)}function n(e,t){return null==e?null==t:null!=t&&e.start===t.start&&e.end===t.end}Object.defineProperty(t,"__esModule",{value:!0}),t.isIdenticalSegmentInfo=function(e,t){if(void 0!==e.mediaSequence&&void 0!==t.mediaSequence)return e.mediaSequence===t.mediaSequence;var r,o,a=(r=i(e),o=i(t),r.some(function(e){return o.includes(e)})),s=n(e.byteRange,t.byteRange),u=e.discontinuitySequenceNumber===t.discontinuitySequenceNumber;return a&&s&&u},t.isIdenticalInitSegmentInfo=function(e,t){var i=(null==e?void 0:e.url)===(null==t?void 0:t.url),r=n(null==e?void 0:e.byteRange,null==t?void 0:t.byteRange);return i&&r}},19627:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentUnavailabilityHandler=void 0;var n=i(3714),r=i(58313);t.SegmentUnavailabilityHandler=function(){function e(e){this.MF={},this.NF=!1,this.LF=e}return e.prototype.downloadSuccess=function(e){this.NF&&e?this.NF=!1:this.MF={}},e.prototype.OF=function(e,t){for(var i=[],n=0;n<e.length&&!e[n]._internalId.equals(t);n++)this.MF[e[n]._id]||i.push(e[n]);return i.length>0?i[i.length-1]._internalId:null},e.prototype.switchQuality=function(e,t){this.MF[t.representationId]=!0;var i=this.OF(e,t);return i?(this.NF=!0,i):(this.LF.logger.log("no quality left, all tried"),null)},e.prototype.switchBaseURL=function(e){var t=e.availableBaseURLs,i=e.lastUsedBaseURLIndex+1;if((i%=t.length)===e.firstUsedBaseURLIndex)return this.LF.logger.log("no base url left, all tried"),null;var o=e.baseURL;return e.lastUsedBaseURLIndex=i,e.baseURL=t[i],e.url=r.URLHelper.concatBaseUrlWithPartial(e.baseURL,e.mediaURL),this.LF.eventHandler.dispatchEvent(n.PlayerEvent.ContentLocationChanged,{sourceLocationId:null!=o?o:"",targetLocationId:e.baseURL,reason:n.ContentLocationChangedReason.Failover}),e},e.prototype.shouldTryAlternatives=function(e){return e>=400&&e<=599||0===e},e}()},15761:function(e,t,i){var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.TimedMetadataService=void 0;var r=i(80813),o=i(56481),a=i(3714),s=i(59225),u=i(32485),c=i(91678),d=i(46151),l=i(33436),h=i(85434),p=i(58313),f=i(23940),g=i(79505),m=i(61800),v=i(86163);function y(e){var t=e.getSegmentInfo();return{uid:btoa((0,p.encodeNonAsciiCharacters)(e.getUrl())),url:e.getUrl(),mimeType:e.getMimeType(),playbackTime:e.getPlaybackTime(),presentationTimestamp:e.getBaseMediaDecodeTime()/e.getTimescale(),duration:e.getDuration(),mediaInfo:e.getMediaInfo(),wallClockTime:t.wallClockTime,discontinuitySequenceNumber:t.discontinuitySequenceNumber,periodId:void 0===t.discontinuitySequenceNumber?t.periodId:void 0}}t.TimedMetadataService=function(){function e(e){var t,i=this;this.context=e,this.jE=function(e){if(e.hasOwnProperty("metadata")){var t={metadataType:e.metadataType.toUpperCase(),metadata:e.metadata};(e.start||0===e.start)&&(t.start=e.start),e.end&&(t.end=e.end),i.context.eventHandler.dispatchEvent(a.PlayerEvent.Metadata,t)}},this.lE=function(e){e&&e.hasOwnProperty("metadataType")&&i.context.eventHandler.dispatchEvent(a.PlayerEvent.Metadata,{metadataType:e.metadataType,metadata:e.metadata})},this.mE=function(e){var t=e.metadata.event;return!(void 0!==t.periodId&&!i.hE.isPeriodExpected(t.periodId))&&!(void 0!==t.discontinuitySequenceNumber&&!i.gE.isDiscontinuityExpected(t.discontinuitySequenceNumber))&&(i.dE[t.mimeType]=t,i.cE[t.mimeType]=g.RepresentationId.from(e.metadata.representationId),i.gE.maybeFirePeriodSwitchEvents(t),i.hE.maybeHandlePeriodSwitch(t),i.bE[t.mimeType]&&i.bE[t.mimeType].id===t.representationId||i.nE(t),void i.context.eventHandler.dispatchEvent(a.PlayerEvent.SegmentPlayback,t))},this.bE={},this.cE={},this.dE={},this.fE=this.context.serviceManager.get(r.ServiceName.ManifestService,e.sourceContext.sourceIdentifier);var n=((t={})[u.TimedMetadataType.InBand]=this.lE,t[u.TimedMetadataType.SegmentPlayback]=this.mE,t[u.TimedMetadataType.Manifest]=this.jE,t[u.TimedMetadataType.EventStream]=this.jE,t[u.TimedMetadataType.DateRange]=this.jE,t[u.TimedMetadataType.CustomTag]=this.jE,t);this.eE=new s.MetadataService(e,n),this.gE=new m.DiscontinuityMonitor(e),this.hE=new v.PeriodSwitchMonitor(e)}return e.prototype.clearSegmentBoundMetadata=function(e){this.eE.removeMatchingCues(u.TimedMetadataType.SegmentPlayback,function(t){return t.content.metadata.mimeType===e})},e.prototype.onSegmentAvailable=function(e){var t,i=this,n=e.segment,r=e.extractedMetadata,o=e.isSegmentOfMainStream,s=e.presentationTimeOffset;if(o){u=y(n),(c=n.getSegmentInfo()).dateTime&&(u.dateTime=c.dateTime),c.representationId&&(u.representationId=c.representationId),t=u;var u,c,d=n.getSegmentInfo();d.metadata&&d.metadata.forEach(function(e){i.tE(e,t,n.getPeriodId())}),d.metadata&&d.metadata.length>0&&d.metadata[0].type===a.MetadataType.CUSTOM&&this.rE(d),this.pE(r,s,n.getPeriodId())}else t=y(n);this.iE(n,t),n.getInbandEvents().forEach(function(e){i.sE(e,n.getPeriodId())})},e.prototype.iE=function(e,t){if(!e.isInit()){var i=e.getSegmentInfo(),n=e.getMimeType(),r={metadata:{event:t,representationId:{_periodId:i.internalRepresentationId.periodId,_adaptationSetId:i.internalRepresentationId.adaptationSetId,_representationId:i.internalRepresentationId.representationId},mimeType:n}};this.eE.addToTimeline(u.TimedMetadataType.SegmentPlayback,t.playbackTime,r),(0,d.getMetricsState)(this.context.store.getState())[n]||this.context.store.dispatch((0,c.initializeMetricsForMimeType)(n,this.context.settings)),this.context.store.dispatch((0,c.addMetricsValue)(n,l.MetricType.SegmentInformation,{bitrate:8*e.getNetworkRequestSize()/e.getDuration(),duration:e.getDuration(),playbackTime:i.startTime||e.getPlaybackTime(),representationId:e.getRepresentationId()}))}},e.prototype.parseEventStream=function(){var e=this;this.fE.getAllPeriods().forEach(function(t){e.fE.getEventStreamEvents(t).forEach(function(i){e.kE(i,t)})})},e.prototype.kE=function(e,t){var i={metadataType:a.MetadataType.EVENT_STREAM,metadata:e.data,start:e.startTime,end:e.endTime};this.eE.addToMetadataParsedService(e.startTime,n(n({},i),{data:e.data}),t._id),this.eE.addToTimeline(u.TimedMetadataType.EventStream,e.startTime,i)},e.prototype.getPlaybackRepresentation=function(e){var t=this.context.serviceManager.get(r.ServiceName.ManifestService,this.context.sourceContext.sourceIdentifier),i=null==t?void 0:t.getRepresentationById(this.cE[e]);if(i)return i=n({},i),this.dE[e]&&(i.uid=this.dE[e].uid),i},e.prototype.trackContentBoundary=function(e){var t=e.getPeriodId();this.hE.trackIncomingPeriod(t);var i=e.getSegmentInfo().discontinuitySequenceNumber;if(void 0!==i){var n=e.getSegmentInfo().startTime,r=e.getSegmentInfo().duration,o=e.getMimeType();this.gE.trackIncomingDiscontinuity(i,o,n,r)}},e.prototype.resetContentBoundaryTracking=function(){this.hE.reset(),this.gE.reset()},e.prototype.nE=function(e){var t,i=h.MimeTypeHelper.isAudio(e.mimeType),n=h.MimeTypeHelper.isVideo(e.mimeType);if(i||n){var r=i?a.PlayerEvent.AudioPlaybackQualityChanged:a.PlayerEvent.VideoPlaybackQualityChanged,o=i?{id:e.representationId,bitrate:parseFloat(e.mediaInfo.bitrate)}:{id:e.representationId,bitrate:parseFloat(e.mediaInfo.bitrate),width:parseFloat(e.mediaInfo.width),height:parseFloat(e.mediaInfo.height),colorInfo:(0,f.toVideoColorInfo)(null!=(t=this.getPlaybackRepresentation(e.mimeType))?t:{})},s={targetQuality:o,sourceQuality:this.bE[e.mimeType]||null};this.context.eventHandler.dispatchEvent(r,s),this.bE[e.mimeType]=o}},e.prototype.processDateRangeEvent=function(e,t){var i={metadataType:a.MetadataType.DATERANGE,metadata:e.data,start:e.startTime,end:e.endTime};this.eE.addToMetadataParsedService(e.startTime,n(n({},i),{data:e.data}),t),this.eE.addToTimeline(u.TimedMetadataType.DateRange,e.startTime,i)},e.prototype.oE=function(e,t){var i=this;e.forEach(function(e){if(e._metadata&&e._metadata.length>0&&e._playbackTime){var n={metadataType:a.MetadataType.CUSTOM,metadata:e._metadata,data:e._metadata,start:e._playbackTime,end:e._playbackTime+e._duration};i.eE.addToMetadataParsedService(e._playbackTime,n,t)}})},e.prototype.pE=function(e,t,i){var n=this;e&&Array.isArray(e.id3)&&e.id3.length>0&&e.id3.forEach(function(e){n.qE(e,t,i)})},e.prototype.qE=function(e,t,i){var r=e.presentationTime-t,o={metadataType:a.MetadataType.ID3,metadata:e.data,start:r};this.eE.addToMetadataParsedService(r,n(n({},o),{data:e.data}),i),this.eE.addToTimeline(u.TimedMetadataType.InBand,r,o)},e.prototype.rE=function(e){var t=this,i=this.fE.getRepresentationById(e.internalRepresentationId);i.SegmentList[0].SegmentURL.forEach(function(n,r){n._media===e.url&&(n._playbackTime||function(e,t,i){for(var n=t,r=i;n>=0;)e[n]._playbackTime=r,r-=e[n]._duration,n--;for(n=t+1,r=i+e[t]._duration;n<e.length;)e[n]._playbackTime=r,r+=e[n]._duration,n++}(i.SegmentList[0].SegmentURL,r,e.startTime),t.eE.addToTimeline(u.TimedMetadataType.CustomTag,e.startTime,{metadataType:a.MetadataType.CUSTOM,metadata:n._metadata,start:e.startTime,end:e.startTime+e.duration}))}),this.oE(i.SegmentList[0].SegmentURL,e.periodId)},e.prototype.sE=function(e,t){var i=e.presentationTime,r={metadataType:a.MetadataType.EMSG,metadata:e,start:i};this.eE.addToMetadataParsedService(i,n(n({},r),{data:e}),t),this.eE.addToTimeline(u.TimedMetadataType.InBand,i,r)},e.prototype.tE=function(e,t,i){var r=e.type;if(r===a.MetadataType.CUSTOM)t.EXPERIMENTAL=t.EXPERIMENTAL||{},t.EXPERIMENTAL.hlsAttributes=t.EXPERIMENTAL.hlsAttributes||[],t.EXPERIMENTAL.hlsAttributes=t.EXPERIMENTAL.hlsAttributes.concat(e.attributes);else{var o={metadataType:/^CUE-(IN|OUT(-CONT)?)$/.test(r)?a.MetadataType.CUETAG:a.MetadataType[e.type],metadata:e,start:t.playbackTime};this.eE.addToMetadataParsedService(o.start,n(n({},o),{data:e}),i),this.eE.addToTimeline(u.TimedMetadataType.Manifest,o.start,o)}},e.prototype.dispose=function(){this.eE=(0,o.dispose)(this.eE),this.fE=null,this.gE=(0,o.dispose)(this.gE),this.hE.dispose()},e}()}
1,17143:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.createSegmentFromInfo=function(e,t,i){var r,o=new n.Segment(i,t,null!=(r=e.codecs)?r:null,e.periodId,e.duration,e.isInitSegment?n.SegmentInitType.INIT:n.SegmentInitType.NONE,!0,i.byteLength,e.internalRepresentationId,e.startTime);return o.setUrl(e.url),o.setSegmentInfo(e),o};var n=i(87187)},36193:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.setRepresentationIdAction=function(e){return(0,n.createAction)(o.ActiveTracksActionType.SetSelectedRepresentationId,{selectedRepresentationId:e})},t.setMediaTypeAction=function(e,t){var i=(0,r.forceArray)(t);return(0,n.createAction)(o.ActiveTracksActionType.SetMediaType,{trackId:e,mediaTypes:i})},t.setContainerFormatAction=function(e,t){return(0,n.createAction)(o.ActiveTracksActionType.SetContainerFormat,{trackId:e,containerFormat:t})},t.removeActiveTrackAction=function(e){return(0,n.createAction)(o.ActiveTracksActionType.RemoveActiveTrack,{adaptationSetId:e})},t.clearActiveTracksAction=function(){return(0,n.createAction)(o.ActiveTracksActionType.ClearActiveTracks)};var n=i(35267),r=i(74853),o=i(7511)},7511:function(e,t){var i,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ActiveTracksActionType=void 0,(n=i||(t.ActiveTracksActionType=i={})).SetSelectedRepresentationId="@instance/sources/@source/activetracks/setselectedrepresentationid",n.SetMediaType="@instance/sources/@source/activetracks/setmediatype",n.SetContainerFormat="@instance/sources/@source/activetracks/setcontainerformat",n.RemoveActiveTrack="@instance/sources/@source/activetracks/remove",n.ClearActiveTracks="@instance/sources/@source/activetracks/clear"},44115:function(e,t,i){var n,r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},o=this&&this.__rest||function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)0>t.indexOf(n[r])&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i};Object.defineProperty(t,"__esModule",{value:!0}),t.ActiveTracksReducer=void 0,t.getContainerFormat=function(e,t){var i;if(e.activeTracks)return null==(i=Object.values(e.activeTracks).find(function(e){var i;return null==(i=e.mediaTypes)?void 0:i.includes(t)}))?void 0:i.containerFormat},t.getMediaTypes=function(e,t){var i;return e.activeTracks&&(null==(i=e.activeTracks[t.adaptationSetId])?void 0:i.mediaTypes)||[]};var a=i(3793),s=i(7511),u={};t.ActiveTracksReducer=(0,a.default)({},((n={})[s.ActiveTracksActionType.SetSelectedRepresentationId]=function(e,t){var i,n,o;return o=e[(n=t.payload.selectedRepresentationId).adaptationSetId],r(r({},e),((i={})[n.adaptationSetId]=r(r({},o),{selectedRepresentationId:n}),i))},n[s.ActiveTracksActionType.SetMediaType]=function(e,t){var i,n,o,a,s;return o=(i=t.payload).trackId,a=i.mediaTypes,s=e[o.adaptationSetId],r(r({},e),((n={})[o.adaptationSetId]=r(r({},s),{mediaTypes:a}),n))},n[s.ActiveTracksActionType.SetContainerFormat]=function(e,t){var i,n,o,a,s;return o=(i=t.payload).trackId,a=i.containerFormat,s=e[o.adaptationSetId],r(r({},e),((n={})[o.adaptationSetId]=r(r({},s),{containerFormat:a}),n))},n[s.ActiveTracksActionType.RemoveActiveTrack]=function(e,t){var i,n;return e[i=t.payload.adaptationSetId.adaptationSetId],n=o(e,["symbol"==typeof i?i:i+""]),r({},n)},n[s.ActiveTracksActionType.ClearActiveTracks]=function(){return u},n))},51386:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEncryptionKey=t.updateEncryptionKey=t.addEncryptionKey=void 0;var n=i(35267),r=i(92096);t.addEncryptionKey=function(e){return(0,n.createAction)(r.EncryptionKeyActionKey.AddEncryptionKey,e)},t.updateEncryptionKey=function(e){return(0,n.createAction)(r.EncryptionKeyActionKey.UpdateEncryptionKey,e)},t.removeEncryptionKey=function(e){return(0,n.createAction)(r.EncryptionKeyActionKey.RemoveEncryptionKey,{keyUri:e})}},20477:function(e,t,i){var n,r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},o=this&&this.__spreadArray||function(e,t,i){if(i||2==arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};
1Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptionKeyReducer=void 0;var a=i(3793),s=i(92096);t.EncryptionKeyReducer=(0,a.default)([],((n={})[s.EncryptionKeyActionKey.AddEncryptionKey]=function(e,t){var i=t.payload;return o(o([],e,!0),[r({},i)],!1)},n[s.EncryptionKeyActionKey.UpdateEncryptionKey]=function(e,t){var i=t.payload,n=e.findIndex(function(e){return e.uri===i.uri});if(-1===n)return e;var a=e[n],s=o([],e,!0);return s.splice(n,1,r(r({},a),i)),s},n[s.EncryptionKeyActionKey.RemoveEncryptionKey]=function(e,t){var i=t.payload;return o([],e,!0).filter(function(e){return e.uri!==i.keyUri})},n))},66628:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getEncryptionKey=t.getAllEncryptionKeys=void 0,t.getAllEncryptionKeys=function(e){return null==e?void 0:e.encryptionKeys},t.getEncryptionKey=function(e,t){var i;return null==(i=null==e?void 0:e.encryptionKeys)?void 0:i.find(function(e){return e.uri===t})}},92096:function(e,t){var i,n,r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptionKeyActionKey=t.KeyLoadState=void 0,(r=i||(t.KeyLoadState=i={})).Loading="loading",r.Loaded="loaded",r.Cancel="cancel",(o=n||(t.EncryptionKeyActionKey=n={})).AddEncryptionKey="@instance/sources/@source/encryptionkey/addEncryptionKey",o.UpdateEncryptionKey="@instance/sources/@source/encryptionkey/updateEncryptionKey",o.RemoveEncryptionKey="@instance/sources/@source/encryptionkey/removeEncryptionKey"},52447:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.engineBitmovinSourceReducers=void 0;var n=i(44115),r=i(20477),o=i(79872),a=i(88935),s=i(63184),u=i(95236),c=i(73861),d=i(41710),l=i(14808);t.engineBitmovinSourceReducers={manifest:o.ManifestReducer,activeTracks:n.ActiveTracksReducer,playingTracks:a.PlayingTracksReducer,encryptionKeys:r.EncryptionKeyReducer,buffer:c.BufferReducer,renderer:d.RendererReducer,streamTimeline:l.StreamTimelineReducer,segmentInfoMap:u.SegmentInfoMapReducer,relativeCurrentTimeOff
1set:s.RelativeCurrentTimeOffsetReducer}},42208:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.periodSwitchStarted=t.periodSwitchFinished=t.setPlayingPeriodId=void 0;var n=i(35267),r=i(84362);t.setPlayingPeriodId=function(e){return(0,n.createAction)(r.PlayingTracksActionKey.SetPlayingPeriodId,e)},t.periodSwitchFinished=function(e){return(0,n.createAction)(r.PlayingTracksActionKey.FinishedPeriodSwitch,e)},t.periodSwitchStarted=function(e){return(0,n.createAction)(r.PlayingTracksActionKey.StartedPeriodSwitch,e)}},88935:function(e,t,i){var n,r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.PlayingTracksReducer=t.isSwitchingPeriods=t.wasSwitchingToPeriodIdReset=t.getPlayingTracksState=t.getPlayingPeriodId=void 0;var o=i(3793),a=i(84362);t.getPlayingPeriodId=function(e){var t;return null==(t=e.playingTracks)?void 0:t.playingPeriodId},t.getPlayingTracksState=function(e){return e.playingTracks},t.wasSwitchingToPeriodIdReset=function(e,t){return void 0!==(null==t?void 0:t.switchingToPeriodId)&&void 0===(null==e?void 0:e.switchingToPeriodId)},t.isSwitchingPeriods=function(e,t){return void 0===(null==t?void 0:t.switchingToPeriodId)&&void 0!==(null==e?void 0:e.switchingToPeriodId)},t.PlayingTracksReducer=(0,o.default)({},((n={})[a.PlayingTracksActionKey.SetPlayingPeriodId]=function(e,t){var i=t.payload;return r(r({},e),{playingPeriodId:i})},n[a.PlayingTracksActionKey.FinishedPeriodSwitch]=function(e,t){var i=t.payload;return r(r({},e),{switchingToPeriodId:e.switchingToPeriodId===i?void 0:e.switchingToPeriodId})},n[a.PlayingTracksActionKey.StartedPeriodSwitch]=function(e,t){var i=t.payload;return r(r({},e),{switchingToPeriodId:i})},n))},84362:function(e,t){var i,n;Object.defineProperty(t,"__esModule",{value:!0}),t.PlayingTracksActionKey=void 0,(n=i||(t.PlayingTracksActionKey=i={})).SetPlayingPeriodId="@instance/sources/@source/playingTracks/setPlayingPeriodId",n.FinishedPeriodSwitch="@instance/sources/@source/playingTracks/periodSwitchFinished",n.StartedPeriodSwitch="@instance/sources/@source/playingTracks/periodSwitchStarted"},27531:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}
1),t.RelativeCurrentTimeOffsetActionType=void 0,t.setRelativeCurrentTimeOffset=function(e){return(0,r.createAction)(n.SetRelativeCurrentTimeOffset,e)};var n,r=i(35267);(n||(t.RelativeCurrentTimeOffsetActionType=n={})).SetRelativeCurrentTimeOffset="@instance/source/setrelativecurrenttimeoffset"},63184:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.RelativeCurrentTimeOffsetReducer=void 0;var n,r=i(3793),o=i(27531);t.RelativeCurrentTimeOffsetReducer=(0,r.default)(null,((n={})[o.RelativeCurrentTimeOffsetActionType.SetRelativeCurrentTimeOffset]=function(e,t){return t.payload},n))},33903:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getRelativeCurrentTimeOffset=void 0,t.getRelativeCurrentTimeOffset=function(e){var t;return null!=(t=null==e?void 0:e.relativeCurrentTimeOffset)?t:null}},10333:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sourceIdentifiersSelector=t.hasASourceStoreIdentifierChanged=void 0,t.hasASourceStoreIdentifierChanged=function(e,t){return e.length!==t.length||e.some(function(e){return!t.includes(e)})},t.sourceIdentifiersSelector=function(e){var t;return Object.keys(null!=(t=e.sources)?t:{})}},59707:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.setManifestAction=function(e){return(0,n.createAction)(r.ManifestActionType.SetManifest,{manifest:e})},t.setManifestInitializedAction=function(e){return(0,n.createAction)(r.ManifestActionType.SetManifestInitialized,{isInitialized:e})},t.removeRepresentationsAction=function(e){return(0,n.createAction)(r.ManifestActionType.RemoveRepresentations,{representationIds:e})},t.updateManifestAction=function(e){return(0,n.createAction)(r.ManifestActionType.UpdateManifest,e)},t.updateAdaptationSetAction=function(e,t){return(0,n.createAction)(r.ManifestActionType.UpdateAdaptationSet,{adaptationSetId:e,updates:t})},t.updateRepresentationAction=function(e){return(0,n.createAction)(r.ManifestActionType.UpdateRepresentation,e)},t.updatePeriodTimingAction=function(e,t){return(0,n.createAction)(r.ManifestActionType.UpdatePeriodTiming,{periodId:e,timing:t})},t.adjustPeriodStartTimes=function(e){return(0,n.createAction)(r.ManifestActionType.AdjustPeriodStartTimes,{offset:e})},t.setRepresentationDrmKidAction=function(e,t){return(0,n.createAction)(r.ManifestActionType.SetRepresentationDrmKid,{representationId:e,associatedKid:t})},t.updateRepresentationFailedDownloadAction=function(e,t){return(0,n.createAction)(r.ManifestActionType.UpdateRepresentationFailedDownload,{representationId:e,loadFailureReason:t})},t.setRepresentationSegmentIndexAction=function(e,t){return(0,n.createAction)(r.ManifestActionType.SetRepresentationSegmentIndex,{representationId:e,segmentIndex:t})},t.setRepresentationIsLoadingAction=function(e,t){return(0,n.createAction)(r.ManifestActionType.SetRepresentationIsLoading,{representationId:e,isLoading:t})},t.setRepresentationSegmentIndexParsingErrorAction=function(e,t){return(0,n.createAction)(r.ManifestActionType.SetRepresentationSegmentIndexParsingError,{representationId:e,segmentIndexParsingError:t})},t.setRepresentationAnchorPointAction=function(e,t){return(0,n.createAction)(r.ManifestActionType.SetRepresentationAnchorPoint,{representationId:e,anchorPoint:t})},t.initPlaybackTimesFromIndex=function(e,t,i){return(0,n.createAction)(r.ManifestActionType.InitPlaybackTimesFromIndex,{representationId:e,index:t,playbackTimeForIndex:i})},t.initPlaybackTimesFromReferenceSegment=function(e){return(0,n.createAction)(r.ManifestActionType.InitPlaybackTimesFromReferenceSegment,{representationId:e.getRepresentationId(),segmentUrl:e.getUrl(),segmentPlaybackTime:e.getPlaybackTime(),discontinuitySequenceNumber:e.getSegmentInfo().discontinuitySequenceNumber})},t.resetSegmentPlaybackTimes=function(){return(0,n.createAction)(r.ManifestActionType.ResetSegmentPlaybackTimes)};var n=i(35267),r=i(71050)},79872:function(e,t,i){var n,r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},o=this&&this.__spreadArray||function(e,t,i){if(i||2==arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};
1Object.defineProperty(t,"__esModule",{value:!0}),t.ManifestReducer=void 0;var a=i(3793),s=i(15014),u=i(13422),c=i(71050);function d(e,t,i){var n,o;return r(r({},e),{Period:null!=(o=null==(n=e.Period)?void 0:n.map(function(e){var n;return r(r({},e),{AdaptationSet:null==(n=e.AdaptationSet)?void 0:n.map(function(e){var n;return r(r({},e),{Representation:null==(n=e.Representation)?void 0:n.map(function(e){return e._internalId.equals(t)?r(r({},e),i):e})})})})}))?o:[]})}function l(e,t,i){var n=o([],e,!0);return n[t]=r({},n[t]),n[t]._playbackTime=i,function(e,t){for(var i=t-1;i>=0;i--)e[i]=r({},e[i]),e[i]._playbackTime=e[i+1]._playbackTime-e[i]._duration}(n,t),function(e,t){for(var i=t+1;i<e.length;i++)e[i]=r({},e[i]),e[i]._playbackTime=e[i-1]._playbackTime+e[i-1]._duration}(n,t),n}function h(e){return r(r({},e),{SegmentURL:e.SegmentURL.map(function(e){var t=r({},e);return delete t._playbackTime,t})})}t.ManifestReducer=(0,a.default)({},((n={})[c.ManifestActionType.SetManifest]=function(e,t){return t.payload.manifest||e},n[c.ManifestActionType.SetManifestInitialized]=function(e,t){return r(r({},e),{isInitialized:t.payload.isInitialized})},n[c.ManifestActionType.RemoveRepresentations]=function(e,t){return 0===t.payload.representationIds.length?e:(0,u.removeRepresentations)(e,t.payload.representationIds)},n[c.ManifestActionType.UpdateManifest]=function(e,t){var i;return i=t.payload,r(r({},e),i)},n[c.ManifestActionType.UpdateAdaptationSet]=function(e,t){return function(e,t){var i,n=t.adaptationSetId,a=t.updates,s=e.Period.findIndex(function(e){return e._id===n.periodId});if(s<0)return e;var u=null==(i=e.Period[s])?void 0:i.AdaptationSet.findIndex(function(e){return e._internalId.equals(n)});if(u<0)return e;var c=r({},e);c.Period=o([],c.Period,!0),c.Period[s]=r({},c.Period[s]);var d=c.Period[s];return d.AdaptationSet=o([],d.AdaptationSet,!0),d.AdaptationSet[u]=r(r({},d.AdaptationSet[u]),a),c}(e,t.payload)},n[c.ManifestActionType.UpdateRepresentation]=function(e,t){return function(e,t){var i,n,a,s=t._internalId;if(!e.Period)return e;var u=e.Period.findIndex(function(e){return e._id===s.periodId}),c=null==(i=e.Period[u])?void 0:i.AdaptationSet.findIndex(function(e){return e._internalId.equals(s)}),d=null==(a=null==(n=e.Period[u])?void 0:n.AdaptationSet[c])?void 0:a.Representation.findIndex(function(e){return e._internalId.equals(s)}),l=r({},e);l.Period=o([],l.Period,!0),l.Period[u]=r({},l.Period[u]);var h=l.Period[u];h.AdaptationSet=o([],h.AdaptationSet,!0),h.AdaptationSet[c]=r({},h.AdaptationSet[c]);var p=h.AdaptationSet[c];return p.Representation=o([],p.Representation,!0),p.Representation[d]=t,l}(e,t.payload)},n[c.ManifestActionType.UpdateRepresentationFailedDownload]=function(e,t){var i,n,o=t.payload,a=o.representationId,s=o.loadFailureReason,u=function(e){var t;return e._internalId.equals(a)?s:null==(t=e._hls)?void 0:t.loadFailureReason};return r(r({},e),{Period:null!=(n=null==(i=e.Period)?void 0:i.map(function(e){var t;return r(r({},e),{AdaptationSet:null==(t=e.AdaptationSet)?void 0:t.map(function(e){var t;return r(r({},e),{Representation:null==(t=e.Representation)?void 0:t.map(function(e){return r(r({},e),{_hls:r(r({},e._hls),{loadFailureReason:u(e)})})})})})})}))?n:[]})},n[c.ManifestActionType.AdjustPeriodStartTimes]=function(e,t){return t.payload.offset?r(r({},e),{Period:e.Period.map(function(e){return r(r({},e),{start:e.start+t.payload.offset})})}):e},n[c.ManifestActionType.UpdatePeriodTiming]=function(e,t){return function(e,t){if(!e.Period)return e;var i=t.periodId,n=t.timing,a=e.Period.findIndex(function(e){return e._id===i});if(a<0)return e;var s=o([],e.Period,!0);return s[a]=r(r({},s[a]),n),r(r({},e),{Period:s})}(e,t.payload)},n[c.ManifestActionType.SetRepresentationDrmKid]=function(e,t){var i=t.payload;return d(e,i.representationId,{associatedKid:i.associatedKid})},n[c.ManifestActionType.SetRepresentationIsLoading]=function(e,t){var i=t.payload;return d(e,i.representationId,{isLoading:i.isLoading})},n[c.ManifestActionType.SetRepresentationSegmentIndex]=function(e,t){var i=t.payload;return d(e,i.representationId,{segmentIndex:i.segmentIndex})},n[c.ManifestActionType.SetRepresentationSegmentIndexParsingError]=function(e,t){var i=t.payload;return d(e,i.representationId,{segmentIndexParsingError:i.segmentIndexParsingError})},n[c.ManifestActionType.SetRepresentationAnchorPoint]=function(e,t){var i=t.payload;
1return d(e,i.representationId,{anchorPoint:i.anchorPoint})},n[c.ManifestActionType.InitPlaybackTimesFromIndex]=function(e,t){var i,n=t.payload,o=n.representationId,a=n.index,u=n.playbackTimeForIndex,c=(0,s.findRepresentation)(e,o);return c?d(e,o,r(r({},c),{SegmentList:null==(i=c.SegmentList)?void 0:i.map(function(e){return r(r({},e),{SegmentURL:l(e.SegmentURL,a,u)})})})):e},n[c.ManifestActionType.InitPlaybackTimesFromReferenceSegment]=function(e,t){var i,n=t.payload,o=n.representationId,a=n.segmentUrl,u=n.segmentPlaybackTime,c=n.discontinuitySequenceNumber,h=(0,s.findRepresentation)(e,o);if(!(null==h?void 0:h.SegmentList)||0===h.SegmentList.length||void 0!==(null==(i=h.SegmentList[0].SegmentURL[0])?void 0:i._playbackTime)||void 0===u)return e;var p=h.SegmentList[0].SegmentURL.findIndex(function(e){return e._media===a&&e._discontinuitySequenceNumber===c});return -1===p?e:d(e,o,r(r({},h),{SegmentList:h.SegmentList.map(function(e){return r(r({},e),{SegmentURL:l(e.SegmentURL,p,u)})})}))},n[c.ManifestActionType.ResetSegmentPlaybackTimes]=function(e){return r(r({},e),{Period:e.Period.map(function(e){return r(r({},e),{AdaptationSet:e.AdaptationSet.map(function(e){return r(r({},e),{Representation:e.Representation.map(function(e){var t;return r(r({},e),{SegmentList:null==(t=e.SegmentList)?void 0:t.map(h)})})})})})})})},n))},62198:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getManifest=void 0,t.getManifest=function(e){return null==e?void 0:e.manifest}},71050:function(e,t){var i,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ManifestActionType=void 0,(n=i||(t.ManifestActionType=i={})).SetManifest="@instance/manifest/setmanifest",n.SetManifestInitialized="@instance/manifest/setmanifestinitialized",n.RemoveRepresentations="@instance/manifest/removerepresentations",n.UpdateManifest="@instance/manifest/updatemanifest",n.UpdateAdaptationSet="@instance/manifest/updateadaptationset",n.UpdateRepresentation="@instance/manifest/updaterepresentation",n.UpdatePeriodTiming="@instance/manifest/updateperiodtiming",n.AdjustPeriodStartTimes="@instance/manifest/adjustperiodstarttimes",n.SetRepresentationDrmKid="@instance/manifest/setrepresentationdrmkid",n.UpdateRepresentationFailedDownload="@instance/manifest/setrepresentationfaileddownload",n.SetRepresentationSegmentIndex="@instance/manifest/setrepresentationsegmentindex",n.SetRepresentationIsLoading="@instance/manifest/setrepresentationisloading",n.SetRepresentationSegmentIndexParsingError="@instance/manifest/setrepresentationsegmentindexparsingerror",n.SetRepresentationAnchorPoint="@instance/manifest/setrepresentationacnhorpoint",n.InitPlaybackTimesFromIndex="@instance/manifest/initplaybacktimesfromindex",n.InitPlaybackTimesFromReferenceSegment="@instance/manifest/initplaybacktimesfromreferencesegment",n.ResetSegmentPlaybackTimes="@instance/manifest/resetsegmentplaybacktimes"},95236:function(e,t,i){var n,r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},o=this&&this.__spreadArray||function(e,t,i){if(i||2==arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentInfoMapReducer=void 0;var a=i(3793),s=i(37641),u=i(49713);function c(e,t,i){var n;return r(r({},e),((n={})[t]=i,n))}t.SegmentInfoMapReducer=(0,a.default)({},((n={})[u.SegmentInfoMapActionType.SetSegmentInfos]=function(e,t){return c(e,t.payload.qualityPath,t.payload.updatedEntry)},n[u.SegmentInfoMapActionType.UpdateSegmentInfos]=function(e,t){return function(e,t,i){if(!e[t]||0===i.segmentInfos.length)return c(e,t,i);var n=e[t].segmentInfos,a=n.findIndex(function(e){return(0,s.areSegmentsIdentical)(e,i.segmentInfos[0])});if(-1===a)return c(e,t,i);var u,d,l=n.length-a,h=i.segmentInfos.length-l;if(0!==a||0!==h){var p=h>
10?i.segmentInfos.slice(-h):[];d=o(o([],n.slice(a),!0),p,!0)}else d=n;var f=r(r(r({},e[t]),i),{segmentInfos:d});return r(r({},e),((u={})[t]=f,u))}(e,t.payload.qualityPath,t.payload.updatedEntry)},n))},72498:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMostRecentlyRefreshedQuality=t.getSegmentInfos=t.getSegmentMapEntry=void 0,t.getSegmentMapEntry=function(e,t){return null==e?void 0:e.segmentInfoMap[t]},t.getSegmentInfos=function(e,i){var n,r;return null!=(r=null==(n=(0,t.getSegmentMapEntry)(e,i))?void 0:n.segmentInfos)?r:[]},t.getMostRecentlyRefreshedQuality=function(e){if(e)return Object.values(e.segmentInfoMap).filter(function(e){return null!=e.qualityInfo.lastUpdateTimestamp}).sort(function(e,t){var i=e.qualityInfo.lastUpdateTimestamp;return t.qualityInfo.lastUpdateTimestamp-i})[0]}},49713:function(e,t){var i,n;Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentInfoMapActionType=void 0,(n=i||(t.SegmentInfoMapActionType=i={})).SetSegmentInfos="@instance/sources/@source/playback/setSegmentInfos",n.UpdateSegmentInfos="@instance/sources/@source/playback/updateSegmentInfos"},59604:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.mergeBufferBlockTimeRanges=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=a(e);return Object.keys(i).flatMap(function(e){return n.BufferRangeHelper.mergeRanges(i[e],r)})},t.excludeBufferBlockTimeRange=function(e,t){var i,s=t.bufferBlockId,u=a(e.map(function(e){return o(e.start,e.end,e.bufferBlockId)})),c=u[s];if(!(null==c?void 0:c.length))return e;var d=(i=[],c.forEach(function(e){(0,n.areDisjoint)(e,t)?i.push(e):(0,n.isSurrounding)(e,t)?i.push.apply(i,[o(e.start,t.start,e.bufferBlockId),o(t.end,e.end,e.bufferBlockId)]):(0,n.isFullyIncluded)(e,t)||i.push(o(e.start>=t.start?t.end:e.start,e.end>t.end?e.end:t.start,e.bufferBlockId))}),i.filter(function(e){return e.end-e.start>=r}));return u[s]=n.BufferRangeHelper.mergeRanges(d,r),Object.keys(u).flatMap(function(e){return u[e]})},t.segmentToBufferBlockTimeRange=function(e){var t,i=null!=(t=e.getBufferBlockId())?t:1/0,n=e.getPlaybackTime();return o(n,n+e.getDuration(),i)};var n=i(4524),r=.1;function o(e,t,i){return{start:(0,n.rangeFixedValue)(e),end:(0,n.rangeFixedValue)(t),bufferBlockId:i}}function a(e){var t={};return e.forEach(function(e){t[e.bufferBlockId]||(t[e.bufferBlockId]=[]),t[e.bufferBlockId].push(e)}),t}},73861:function(e,t,i){var n,r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},o=this&&this.__spreadArray||function(e,t,i){if(i||2==arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferReducer=void 0;var a=i(4524),s=i(3793),u=i(70118),c=i(59604);function d(){return{isLoadingRangeFinished:!1,isBufferBlockSwitchOngoing:!1,isTimestampRollingOver:!1,bufferStateMap:{}}}t.BufferReducer=(0,s.default)(d(),((n={})[u.BufferActionType.SetBufferMaxSize]=function(e,t){var i,n=t.payload;return r(r({},e),{bufferStateMap:r(r({},e.bufferStateMap),((i={})[n.mimeType]=r(r({},e.bufferStateMap[n.mimeType]),{maxBufferSize:n.maxBufferSize}),i))})},n[u.BufferActionType.SetRendererRanges]=function(e,t){var i,n=t.payload;return r(r({},e),{bufferStateMap:r(r({},e.bufferStateMap),((i={})[n.mimeType]=r(r({},e.bufferStateMap[n.mimeType]),{rendererRanges:n.ranges}),i))})},n[u.BufferActionType.SetBufferBlockSwitchOngoing]=function(e,t){var i=t.payload;return r(r({},e),{isBufferBlockSwitchOngoing:i.isOngoing})},n[u.BufferActionType.SetTimestampRollingOver]=function(e,t){var i=t.payload;return r(r({},e),{isTimestampRollingOver:i.isRollingOver})},n[u.BufferActionType.AddLoadedRange]=function(e,t){var i,n,s,u=t.payload,d=u.mimeType,l=u.range;if(!d)return e;var h=null!=(s=null==(n=e.bufferStateMap[d])?void 0:n.loadedRanges)?s:[];return h.some(function(e){return(0,a.isFullyIncluded)(l,e)})?e:r(r({},e),{bufferStateMap:r(r({},e.bufferStateMap),((i={})[d]=r(r({},e.bufferStateMap[d]),{loadedRanges:c.mergeBufferBlockTimeRanges.apply(void 0,o(o([],h,!1),[l],!1))}),i))})},n[u.BufferActionType.RemoveLoadedRange]=function(e,t){var i,n,o,s=t.payload,u=s.mimeType,d=s.range;if(!u)return e;var l=null!=(o=null==(n=e.bufferStateMap[u])?void 0:n.loadedRanges)?o:[];return l.every(function(e){return!(0,a.isOverlapping)(d,e)})?e:r(r({},e),{bufferStateMap:r(r({},e.bufferStateMap),((i={})[u]=r(r({},e.bufferStateMap[u]),{loadedRanges:(0,c.excludeBufferBlockTimeRange)(l,d)}
1),i))})},n[u.BufferActionType.ResetLoadedRanges]=function(e,t){var i,n,o,a=t.payload.mimeType;if(void 0===a){if(void 0===e)return d();var s=r(r({},e),{bufferStateMap:r({},e.bufferStateMap)});return Object.keys(s.bufferStateMap).forEach(function(e){s.bufferStateMap[e]=r(r({},s.bufferStateMap[e]),{loadedRanges:[]})}),s}return(null!=(o=null==(n=e.bufferStateMap[a])?void 0:n.loadedRanges)?o:[]).length>0?r(r({},e),{bufferStateMap:r(r({},e.bufferStateMap),((i={})[a]=r(r({},e.bufferStateMap[a]),{loadedRanges:[]}),i))}):e},n[u.BufferActionType.SetLoadingRangeFinished]=function(e,t){var i=t.payload.isFinished;return i!==e.isLoadingRangeFinished?r(r({},e),{isLoadingRangeFinished:i}):e},n))},13114:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getDrmUsedKeySystem=t.getDrmKeyIdsWithErrors=t.getDrmState=void 0,t.getDrmState=function(e){return null==e?void 0:e.drm},t.getDrmKeyIdsWithErrors=function(e){var t,i;return null!=(i=null==(t=e.drm)?void 0:t.keyIdsWithErrors)?i:[]},t.getDrmUsedKeySystem=function(e){var i;return(null==(i=(0,t.getDrmState)(e))?void 0:i.usedKeySystem)||{kind:null,uid:null}}},41710:function(e,t,i){var n,r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.RendererReducer=void 0;var o=i(3793),a=i(39564);t.RendererReducer=(0,o.default)({mseObjectUrl:""},((n={})[a.RendererActionType.SetMseObjectUrl]=function(e,t){var i=t.payload;return r(r({},e),{mseObjectUrl:i.url})},n))},39523:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.addStreamTimeRange=function(e,t,i){var o={start:t.start,end:t.end,type:i};return(0,n.createAction)(r.StreamTimelineActionType.StreamTimeRangeAdd,{mimeType:e,streamTimeRange:o})},t.removeStreamTimeRange=function(e,t,i){return(0,n.createAction)(r.StreamTimelineActionType.StreamTimeRangeRemove,{mimeType:e,range:t,type:i})},t.resetStreamTimeline=function(e){return(0,n.createAction)(r.StreamTimelineActionType.StreamTimelineReset,e)};var n=i(35267),r=i(80965)},14808:function(e,t,i){var n,r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},o=this&&this.__spreadArray||function(e,t,i){if(i||2==arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.getStreamTimeline=t.StreamTimelineReducer=void 0;var a=i(4524),s=i(3793),u=i(99529),c=i(80965),d={};t.StreamTimelineReducer=(0,s.default)(d,((n={})[c.StreamTimelineActionType.StreamTimeRangeAdd]=function(e,t){var i,n,a,s;return i=t.payload.mimeType,n=t.payload.streamTimeRange,s=e[i]?o([],e[i],!0):[],r(r({},e),((a={})[i]=(0,u.addStreamTimeRangeToTimeline)(s,n),a))},n[c.StreamTimelineActionType.StreamTimeRangeRemove]=function(e,t){return function(e,t,i,n){if(!e[t])return e;var s,c=o([],e[t],!0);if(n){var d=r(r({},i),{type:n});c=(0,u.removeStreamTimeRangeFromTimeline)(c,d)}else c=a.BufferRangeHelper.excludeTimeRange(c,i);return r(r({},e),((s={})[t]=c,s))}(e,t.payload.mimeType,t.payload.range,t.payload.type)},n[c.StreamTimelineActionType.StreamTimelineReset]=function(e,t){var i,n;return(i=t.payload)?r(r({},e),((n={})[i]=[],n)):d},n)),t.getStreamTimeline=function(e){var t;return null!=(t=null==e?void 0:e.streamTimeline)?t:{}}},80965:function(e,t){var i,n;Object.defineProperty(t,"__esModule",{value:!0}),t.StreamTimelineActionType=void 0,(n=i||(t.StreamTimelineActionType=i={})).StreamTimelineReset="@instance/source/stream/streamtimelinereset",n.StreamTimeRangeRemove="@instance/source/stream/streamtimerangeremove",n.StreamTimeRangeAdd="@instance/source/stream/streamtimerangeadd"},99529:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.StreamTimeRangeType=void 0,t.addStreamTimeRangeToTimeline=function(e,t){var i=e.filter(function(e){return e.type===t.type}
1).concat(t),n=o.BufferRangeHelper.mergeRanges(i,a.DefaultSettings.GAP_TOLERANCE);return e=e.filter(function(e){return e.type!==t.type}),n.forEach(function(t){e=s.ArrayHelper.insertInSortedArray(e,t,function(e){return e.start>t.start})}),e},t.removeStreamTimeRangeFromTimeline=function(e,t){var i=e.filter(function(e){return e.type===t.type}),n=o.BufferRangeHelper.excludeTimeRange(i,t);return e=e.filter(function(e){return e.type!==t.type}),n.forEach(function(t){t.end-t.start>a.DefaultSettings.GAP_TOLERANCE&&(e=s.ArrayHelper.insertInSortedArray(e,t,function(e){return e.start>t.start}))}),e},t.getTrackIdentifier=function(e){var t=e.mimeType,i=e.internalRepresentationId;return u.MimeTypeHelper.isSubtitle(t)?"".concat(t,"/").concat(i.adaptationSetId):t};var n,r,o=i(4524),a=i(70962),s=i(74853),u=i(85434);(n=r||(t.StreamTimeRangeType=r={})).Loading="loading",n.Failed="failed"},16870:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.SynchronizedTimeService=void 0,t.initializeSynchronizedTimeService=function(e,t){var i=e.serviceManager,r=t.sourceIdentifier;if(!i.has(n.ServiceName.SynchronizedTimeService,r)){var o=new u(e,t);i.set(n.ServiceName.SynchronizedTimeService,o,r)}};var n=i(80813),r=i(89927),o=i(55938),a=i(58747),s=i(58486),u=function(){function e(e,t){this.vF=e,this.wF=t,this.xF=0;var i=new s.HttpHeadTimeProvider(this.vF,new a.ISO8601TimeDecoder),n=new s.HttpGetTimeProvider(this.vF,new a.XSDateTimeDecoder),r=new s.HttpGetTimeProvider(this.vF,new a.ISO8601TimeDecoder),o=new s.StringTimeProvider(new a.XSDateTimeDecoder);this.yF={"urn:mpeg:dash:utc:http-head:2012":i,"urn:mpeg:dash:utc:http-head:2014":i,"urn:mpeg:dash:utc:http-xsdate:2012":n,"urn:mpeg:dash:utc:http-xsdate:2014":n,"urn:mpeg:dash:utc:http-iso:2012":r,"urn:mpeg:dash:utc:http-iso:2014":r,"urn:mpeg:dash:utc:direct:2012":o,"urn:mpeg:dash:utc:direct:2014":o},this.BF()}return e.prototype.BF=function(){var e=(0,o.getUtcTimingSources)(this.vF.config,this.wF.source);e.length>0&&this.synchronizeWithServer(e)},e.prototype.getTimeDifference=function(){return this.xF},e.prototype.CF=function(e){var t=this,i=e.shift();if(!i)return Promise.reject(Error("No time source left to try"));if(!this.yF[i.schemeIdUri])return this.vF.logger.debug("UTCTiming scheme ".concat(i.schemeIdUri," is not supported.")),this.CF(e);this.zF=this.yF[i.schemeIdUri];var n=Date.now();return this.zF.requestTime(i.value).then(function(e){return e+(Date.now()-n)/2}).catch(function(){return t.vF.logger.debug("UTCTiming scheme ".concat(i.schemeIdUri," resulted in an error")),t.CF(e)})},e.prototype.synchronizeWithServer=function(e,t){var i=this;return void 0===t&&(t=0),this.AF||(this.AF=this.CF(e).then(function(e){i.zF=void 0,i.xF=e+(0,r.toMilliSeconds)(t)-Date.now(),i.vF.logger.debug("Synchronized client time with time server - drift: ".concat((0,r.toSeconds)(i.xF),"s"))}).catch(function(){i.vF.logger.debug("Synchronizing client time with time server unsuccessful")})),this.AF},e.prototype.getSynchronizationPromise=function(){return this.AF},e.prototype.reset=function(){this.xF=0,this.AF=void 0,this.zF&&(this.zF.cancelRequest(),this.zF=void 0)},e.prototype.dispose=function(){this.reset()},e}();t.SynchronizedTimeService=u},58747:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.XSDateTimeDecoder=t.ISO8601TimeDecoder=void 0,t.ISO8601TimeDecoder=function(){function e(){}return e.prototype.decode=function(e){return Date.parse(e)},e}(),t.XSDateTimeDecoder=function(){function e(){}return e.prototype.decode=function(t){var i=Date.parse(t);if(isNaN(i)){var n=e.DATETIME_REGEX.exec(t);if(!n)return NaN;var r=Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),n[6]&&parseInt(n[6],10)||0,n[7]&&1e3*parseFloat(n[7])||0);if(n[9]&&n[10]){var o=60*parseInt(n[9],10)+parseInt(n[10],10);r+=("+"===n[8]?-1:1)*o*6e4}return new Date(r).getTime()}return i},e.DATETIME_REGEX=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d*)(\.\d*)?)?(?:([+-])(\d{2}):(\d{2}))?/,e}()},58486:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]}
1)instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.StringTimeProvider=t.HttpHeadTimeProvider=t.HttpGetTimeProvider=t.HttpTimeProvider=t.ServerTimeProvider=void 0;var o=i(4129),a=i(29669),s=function(e){this.timeDecoder=e};t.ServerTimeProvider=s;var u=function(e){function t(t,i){var n=e.call(this,i)||this;return n.n3=t,n}return r(t,e),t.prototype.p3=function(e){var t=this,i=e.shift();return i?(this.o3=new o.DefaultContentLoader(this.n3,{requestType:a.HttpRequestType.TIME_SYNC,maxRetries:1}),this.o3.load(i,this.requestMethod).then(function(e){var i=t.timeDecoder.decode(t.processResponse(e));return t.o3=void 0,isNaN(i)?Promise.reject(Error("Failed to decode time")):Promise.resolve(i)}).catch(function(i){return t.n3.logger.debug("could not load UTC time url",i),t.p3(e)})):Promise.reject(Error("No time source left to try"))},t.prototype.requestTime=function(e){var t=this,i=e.match(/\S+/g);return i?this.p3(i).then(function(e){return t.o3=void 0,e}):Promise.reject(Error("No time source left to try"))},t.prototype.cancelRequest=function(){this.o3&&this.o3.cancel()},t}(s);t.HttpTimeProvider=u;var c=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.requestMethod=a.HttpRequestMethod.GET,n}return r(t,e),t.prototype.processResponse=function(e){return e.body},t}(u);t.HttpGetTimeProvider=c,t.HttpHeadTimeProvider=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.requestMethod=a.HttpRequestMethod.HEAD,n}return r(t,e),t.prototype.processResponse=function(e){var t=Object.keys(e.headers).find(function(e){return"date"===e.toLocaleLowerCase()});return t&&e.headers[t]||""},t}(c),t.StringTimeProvider=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.requestTime=function(e){var t=this.timeDecoder.decode(e);return isNaN(t)?Promise.reject(Error("Failed to decode time")):Promise.resolve(t)},t.prototype.cancelRequest=function(){},t}(s)},55938:function(e,t,i){var n=this&&this.__spreadArray||function(e,t,i){if(i||2==arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.getUtcTimingSources=function(e,t){var i,o,a,s,u=[];return(a=(null==(i=e.live)?void 0:i.synchronization)||[],s=(null==(o=t.live)?void 0:o.synchronization)||[],n(n([],a,!0),s.filter(function(e){return!a.some(function(t){return t.method===e.method})}),!0)).forEach(function(e){var t=function(e){switch(e){case r.LiveSynchronizationMethod.HttpHead:return"urn:mpeg:dash:utc:http-head:2014";case r.LiveSynchronizationMethod.HttpXsDate:return"urn:mpeg:dash:utc:http-xsdate:2014";case r.LiveSynchronizationMethod.HttpIso:return"urn:mpeg:dash:utc:http-iso:2014";default:return}}(e.method);t&&u.push({schemeIdUri:t,value:e.serverUrl})}),u};var r=i(21281)},69102:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.areAudioMimeCodecsCompatible=function(e,t){return e.mimeType===t.mimeType&&n.CodecStringHelper.canSwitchBetweenAudioCodecs(e.codec,t.codec)},t.hasContentProtection=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),0===e.length&&0===t.length||e.length>0&&t.length>0};var n=i(34047)},90919:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.findSegmentUrlIndexWithinSegmentList=function(e,t){return t.findIndex(function(t){var i=e.discontinuitySequenceNumber===t._discontinuitySequenceNumber,o=r(e.url,t._media),a=(0,n.compareValues)(e.byteRange,t._byteRange);return i&&o&&a})},t.matchesMediaUrl=r;var n=i(19541);function r(e,t){return e.endsWith(t)||e.split("?")[0].endsWith(t)}},48954:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getValues=function(e){var t=[];return e.forEach(function(e){t.push(e)}),t},t.getKeys=function(e){var t=[];return e.forEach(function(e,i){t.push(i)}),t}}
1,33004:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.bytesToBits=function(e){return 8*e}},68981:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.adjustTargetTimeToPeriodStart=function(e,t,i,n){var r,o=i.getPeriodIdForTime(e);if(!o)return e;var a=i.isTimeNearPeriodEnd(e,o,t),s=i.getNextPeriod(o);return a&&s?(n.debug("Target time ".concat(e," too close to end of period ").concat(o,", adjusting to next period start ").concat(s.start)),null!=(r=s.start)?r:e):e}},50962:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.isLowLatencyConfigured=function(e){var t=e.serviceManager.get(n.ServiceName.LiveLatencyService);return(null==t?void 0:t.isConfigured())||!1};var n=i(80813)},60729:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.isPlayingLowLatencyHls=function(e){if(!(0,a.isLowLatencyConfigured)(e)||!e.settings.LL_HLS)return!1;var t,i=(0,n.getSourceState)(e);if(!i)return!1;var s=r.ModuleManager.get(o.ModuleName.HLS,!1);if(!s)return!1;var u=s.selectors,c=u.getHlsState,d=u.getIsLowLatencyPlaylist,l=c(i);return!!l&&null!=(t=d(l))&&t};var n=i(15971),r=i(88052),o=i(62756),a=i(50962)}},function(e){return e(e.s=52570)}])}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.